refactor: name presentation evidence states
This commit is contained in:
@@ -5,7 +5,6 @@ export type AgentRole = "user" | "assistant";
|
||||
export type PresentationToolAction =
|
||||
| { readonly type: "selectWorkflowNode"; readonly nodeId: string }
|
||||
| { readonly type: "focusOperation"; readonly eventId: string }
|
||||
| { readonly type: "openEvidence"; readonly eventId: string }
|
||||
| { readonly type: "showTraceFrame"; readonly frameIndex: number };
|
||||
|
||||
export type AgentToolCall = {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { loadCanonicalDemoRecording } from "../timeline/replay.js";
|
||||
import { runPreparedRecipeReplay } from "./preparedRecipeDriver.js";
|
||||
import { isAllowedAgentToolName } from "./tools.js";
|
||||
|
||||
const collect = async <T>(events: AsyncIterable<T>): Promise<ReadonlyArray<T>> => {
|
||||
const collected: T[] = [];
|
||||
@@ -38,8 +39,9 @@ describe("prepared recipe driver", () => {
|
||||
"selectWorkflowNode",
|
||||
"resumeIssueReview",
|
||||
"readRunTrace",
|
||||
"openEvidence",
|
||||
]);
|
||||
|
||||
expect(isAllowedAgentToolName("openEvidence")).toBe(false);
|
||||
});
|
||||
|
||||
it("emits approval-request at resumeIssueReview and waits for decision", async () => {
|
||||
|
||||
@@ -112,17 +112,6 @@ export async function* runPreparedRecipeReplay(
|
||||
eventId: trace?.id ?? null,
|
||||
});
|
||||
break;
|
||||
case "openEvidence":
|
||||
yield {
|
||||
id: step.id,
|
||||
role: "assistant",
|
||||
parts: [
|
||||
agentToolCallPart(`${step.id}-call`, step.toolName, { eventId: trace?.id ?? "trace" }),
|
||||
presentationActionPart({ type: "openEvidence", eventId: trace?.id ?? "trace" }),
|
||||
agentToolResultPart(`${step.id}-call`, step.toolName, "success", { eventId: trace?.id ?? "trace" }),
|
||||
],
|
||||
};
|
||||
break;
|
||||
default:
|
||||
assertNever(step.toolName);
|
||||
}
|
||||
|
||||
@@ -5,8 +5,7 @@ export type RecipeTool =
|
||||
| "startPreparedReportRun"
|
||||
| "selectWorkflowNode"
|
||||
| "resumeIssueReview"
|
||||
| "readRunTrace"
|
||||
| "openEvidence";
|
||||
| "readRunTrace";
|
||||
|
||||
export type PreparedRecipeStep = {
|
||||
readonly id: string;
|
||||
@@ -58,10 +57,5 @@ export const PREPARE_THESIS_REPORT_RECIPE: PreparedRecipe = {
|
||||
narration: "I will read the run trace as evidence.",
|
||||
toolName: "readRunTrace",
|
||||
},
|
||||
{
|
||||
id: "open-evidence",
|
||||
narration: "I will open the evidence linked to the trace call.",
|
||||
toolName: "openEvidence",
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
@@ -8,7 +8,6 @@ describe("agent tools", () => {
|
||||
expect(AGENT_TOOLS.resumeIssueReview.kind).toBe("workflow");
|
||||
expect(AGENT_TOOLS.readRunTrace.kind).toBe("workflow");
|
||||
expect(AGENT_TOOLS.selectWorkflowNode.kind).toBe("presentation");
|
||||
expect(AGENT_TOOLS.openEvidence.kind).toBe("presentation");
|
||||
});
|
||||
|
||||
it("rejects unknown tool names", () => {
|
||||
|
||||
@@ -7,7 +7,6 @@ export type WorkflowToolName =
|
||||
export type PresentationToolName =
|
||||
| "selectWorkflowNode"
|
||||
| "focusOperation"
|
||||
| "openEvidence"
|
||||
| "showTraceFrame";
|
||||
|
||||
export type AgentToolName = WorkflowToolName | PresentationToolName;
|
||||
@@ -49,11 +48,6 @@ export const AGENT_TOOLS = {
|
||||
kind: "presentation",
|
||||
description: "Focus an operation event in the presentation.",
|
||||
},
|
||||
openEvidence: {
|
||||
name: "openEvidence",
|
||||
kind: "presentation",
|
||||
description: "Open evidence for an operation event.",
|
||||
},
|
||||
showTraceFrame: {
|
||||
name: "showTraceFrame",
|
||||
kind: "presentation",
|
||||
|
||||
Reference in New Issue
Block a user