@stigmer/react 3.2.2 → 3.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/agent/AgentDetailView.d.ts.map +1 -1
- package/agent/AgentDetailView.js +6 -3
- package/agent/AgentDetailView.js.map +1 -1
- package/execution/index.d.ts +1 -2
- package/execution/index.d.ts.map +1 -1
- package/execution/index.js +0 -1
- package/execution/index.js.map +1 -1
- package/execution/useLiveAgentExecution.d.ts +17 -1
- package/execution/useLiveAgentExecution.d.ts.map +1 -1
- package/execution/useLiveAgentExecution.js +19 -4
- package/execution/useLiveAgentExecution.js.map +1 -1
- package/index.d.ts +5 -5
- package/index.d.ts.map +1 -1
- package/index.js +2 -2
- package/index.js.map +1 -1
- package/internal/useInViewport.d.ts +24 -0
- package/internal/useInViewport.d.ts.map +1 -0
- package/internal/useInViewport.js +49 -0
- package/internal/useInViewport.js.map +1 -0
- package/library/VisibilitySelector.d.ts +22 -6
- package/library/VisibilitySelector.d.ts.map +1 -1
- package/library/VisibilitySelector.js +12 -4
- package/library/VisibilitySelector.js.map +1 -1
- package/library/index.d.ts +1 -1
- package/library/index.d.ts.map +1 -1
- package/library/index.js.map +1 -1
- package/mcp-server/McpServerDetailView.d.ts.map +1 -1
- package/mcp-server/McpServerDetailView.js +4 -3
- package/mcp-server/McpServerDetailView.js.map +1 -1
- package/package.json +4 -4
- package/session/SessionViewer.js +8 -1
- package/session/SessionViewer.js.map +1 -1
- package/session/audience.d.ts +6 -1
- package/session/audience.d.ts.map +1 -1
- package/skill/SkillDetailView.d.ts.map +1 -1
- package/skill/SkillDetailView.js +4 -3
- package/skill/SkillDetailView.js.map +1 -1
- package/src/access/__tests__/useManageAccess.test.tsx +104 -0
- package/src/agent/AgentDetailView.tsx +9 -3
- package/src/execution/__tests__/useLiveAgentExecution.test.tsx +125 -0
- package/src/execution/index.ts +4 -7
- package/src/execution/useLiveAgentExecution.ts +41 -3
- package/src/index.ts +4 -5
- package/src/internal/__tests__/useInViewport.test.tsx +115 -0
- package/src/internal/useInViewport.ts +63 -0
- package/src/library/VisibilitySelector.tsx +50 -9
- package/src/library/__tests__/VisibilitySelector.test.tsx +38 -0
- package/src/library/index.ts +4 -1
- package/src/mcp-server/McpServerDetailView.tsx +7 -3
- package/src/session/SessionViewer.tsx +7 -1
- package/src/session/__tests__/audienceWiring.test.tsx +31 -1
- package/src/session/audience.ts +6 -1
- package/src/skill/SkillDetailView.tsx +7 -3
- package/src/workflow/WorkflowAgentCallTranscript.tsx +279 -0
- package/src/workflow/WorkflowDetailView.tsx +7 -3
- package/src/workflow/WorkflowExecutionViewer.tsx +20 -77
- package/src/workflow/WorkflowTaskApprovalSummary.tsx +45 -8
- package/src/workflow/__tests__/WorkflowAgentCallTranscript.liveregion.test.tsx +124 -0
- package/src/workflow/__tests__/{WorkflowAgentExecutionDocument.test.tsx → WorkflowAgentCallTranscript.test.tsx} +146 -121
- package/src/workflow/__tests__/WorkflowExecutionViewer.approvals.test.tsx +81 -220
- package/src/workflow/__tests__/WorkflowExecutionViewer.reconciliation.test.tsx +17 -16
- package/src/workflow/__tests__/WorkflowTaskApprovalSummary.test.tsx +52 -2
- package/src/workflow/__tests__/WorkflowTaskThread.test.tsx +168 -185
- package/src/workflow/__tests__/agent-call-live-experience.test.ts +4 -4
- package/src/workflow/__tests__/task-approval.test.ts +119 -0
- package/src/workflow/__tests__/task-presentation.test.ts +35 -1
- package/src/workflow/__tests__/useWorkflowExecutionPanel.test.ts +0 -57
- package/src/workflow/index.ts +6 -3
- package/src/workflow/task-detail/index.ts +3 -0
- package/src/workflow/task-detail/task-approval.ts +95 -1
- package/src/workflow/thread/WorkflowTaskThread.tsx +96 -252
- package/src/workflow/thread/task-presentation.ts +8 -2
- package/src/workflow/useWorkflowExecutionPanel.ts +0 -47
- package/workflow/WorkflowAgentCallTranscript.d.ts +87 -0
- package/workflow/WorkflowAgentCallTranscript.d.ts.map +1 -0
- package/workflow/WorkflowAgentCallTranscript.js +98 -0
- package/workflow/WorkflowAgentCallTranscript.js.map +1 -0
- package/workflow/WorkflowDetailView.d.ts.map +1 -1
- package/workflow/WorkflowDetailView.js +4 -3
- package/workflow/WorkflowDetailView.js.map +1 -1
- package/workflow/WorkflowExecutionViewer.d.ts.map +1 -1
- package/workflow/WorkflowExecutionViewer.js +23 -52
- package/workflow/WorkflowExecutionViewer.js.map +1 -1
- package/workflow/WorkflowTaskApprovalSummary.d.ts +1 -1
- package/workflow/WorkflowTaskApprovalSummary.d.ts.map +1 -1
- package/workflow/WorkflowTaskApprovalSummary.js +18 -1
- package/workflow/WorkflowTaskApprovalSummary.js.map +1 -1
- package/workflow/index.d.ts +2 -2
- package/workflow/index.d.ts.map +1 -1
- package/workflow/index.js +2 -2
- package/workflow/index.js.map +1 -1
- package/workflow/task-detail/index.d.ts +1 -1
- package/workflow/task-detail/index.d.ts.map +1 -1
- package/workflow/task-detail/index.js +1 -1
- package/workflow/task-detail/index.js.map +1 -1
- package/workflow/task-detail/task-approval.d.ts +44 -1
- package/workflow/task-detail/task-approval.d.ts.map +1 -1
- package/workflow/task-detail/task-approval.js +47 -0
- package/workflow/task-detail/task-approval.js.map +1 -1
- package/workflow/thread/WorkflowTaskThread.d.ts +17 -25
- package/workflow/thread/WorkflowTaskThread.d.ts.map +1 -1
- package/workflow/thread/WorkflowTaskThread.js +60 -105
- package/workflow/thread/WorkflowTaskThread.js.map +1 -1
- package/workflow/thread/task-presentation.d.ts.map +1 -1
- package/workflow/thread/task-presentation.js +7 -2
- package/workflow/thread/task-presentation.js.map +1 -1
- package/workflow/useWorkflowExecutionPanel.d.ts +0 -12
- package/workflow/useWorkflowExecutionPanel.d.ts.map +1 -1
- package/workflow/useWorkflowExecutionPanel.js +0 -12
- package/workflow/useWorkflowExecutionPanel.js.map +1 -1
- package/execution/agent-execution-document.d.ts +0 -31
- package/execution/agent-execution-document.d.ts.map +0 -1
- package/execution/agent-execution-document.js +0 -48
- package/execution/agent-execution-document.js.map +0 -1
- package/src/execution/__tests__/agent-execution-document.test.ts +0 -45
- package/src/execution/agent-execution-document.ts +0 -54
- package/src/workflow/WorkflowAgentExecutionDocument.tsx +0 -283
- package/workflow/WorkflowAgentExecutionDocument.d.ts +0 -79
- package/workflow/WorkflowAgentExecutionDocument.d.ts.map +0 -1
- package/workflow/WorkflowAgentExecutionDocument.js +0 -87
- package/workflow/WorkflowAgentExecutionDocument.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"agent-execution-document.js","sourceRoot":"","sources":["../../src/execution/agent-execution-document.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,mEAAmE;AACnE,4EAA4E;AAC5E,8EAA8E;AAC9E,kEAAkE;AAClE,EAAE;AACF,oEAAoE;AACpE,4EAA4E;AAC5E,4EAA4E;AAC5E,yEAAyE;AACzE,2BAA2B;AAE3B,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAE5D;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,iCAAiC,GAAG,cAAc,CAAC,WAAW,CAAC,CAAC;AAE7E;;;;;;;;;;GAUG;AACH,MAAM,UAAU,qBAAqB,CACnC,gBAAwB,EACxB,QAAgB;IAEhB,OAAO,GAAG,gBAAgB,IAAI,QAAQ,EAAE,CAAC;AAC3C,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,0BAA0B,CAAC,IAAY;IACrD,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACpC,OAAO,SAAS,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC;AAC5D,CAAC"}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect } from "vitest";
|
|
2
|
-
import {
|
|
3
|
-
AGENT_EXECUTION_DOCUMENT_ENTRY_ID,
|
|
4
|
-
agentExecutionTabPath,
|
|
5
|
-
parseAgentExecutionTabPath,
|
|
6
|
-
} from "../agent-execution-document";
|
|
7
|
-
import { ARTIFACT_DOCUMENT_ENTRY_ID } from "../artifact-document";
|
|
8
|
-
import { FILE_CHANGE_DOCUMENT_ENTRY_ID } from "../file-change-document";
|
|
9
|
-
|
|
10
|
-
describe("agent-execution-document identity", () => {
|
|
11
|
-
it("has a distinct family id from the other virtual-document families", () => {
|
|
12
|
-
expect(AGENT_EXECUTION_DOCUMENT_ENTRY_ID).not.toBe(ARTIFACT_DOCUMENT_ENTRY_ID);
|
|
13
|
-
expect(AGENT_EXECUTION_DOCUMENT_ENTRY_ID).not.toBe(FILE_CHANGE_DOCUMENT_ENTRY_ID);
|
|
14
|
-
// NUL-namespaced so it can never alias a real workspace entry id.
|
|
15
|
-
expect(AGENT_EXECUTION_DOCUMENT_ENTRY_ID.startsWith("\u0000")).toBe(true);
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
it("labels the tab with the task name (path basename)", () => {
|
|
19
|
-
const path = agentExecutionTabPath("aex_abc123", "summarize-report");
|
|
20
|
-
expect(path).toBe("aex_abc123/summarize-report");
|
|
21
|
-
expect(path.split("/").pop()).toBe("summarize-report");
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
it("round-trips the child execution id", () => {
|
|
25
|
-
const path = agentExecutionTabPath("aex_abc123", "summarize-report");
|
|
26
|
-
expect(parseAgentExecutionTabPath(path)).toBe("aex_abc123");
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
it("round-trips the id when the task name itself contains a separator", () => {
|
|
30
|
-
const path = agentExecutionTabPath("aex_abc123", "stage/publish");
|
|
31
|
-
expect(parseAgentExecutionTabPath(path)).toBe("aex_abc123");
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
it("keeps two calls to the same agent distinct (per-child identity)", () => {
|
|
35
|
-
const first = agentExecutionTabPath("aex_1", "call-agent");
|
|
36
|
-
const second = agentExecutionTabPath("aex_2", "call-agent");
|
|
37
|
-
expect(first).not.toBe(second);
|
|
38
|
-
expect(parseAgentExecutionTabPath(first)).toBe("aex_1");
|
|
39
|
-
expect(parseAgentExecutionTabPath(second)).toBe("aex_2");
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
it("degrades to the whole path when no separator is present", () => {
|
|
43
|
-
expect(parseAgentExecutionTabPath("aex_bare")).toBe("aex_bare");
|
|
44
|
-
});
|
|
45
|
-
});
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
// Identity of agent-execution transcript tabs in the workspace surface's
|
|
2
|
-
// editor group. Domain: execution (the transcript renderer and the
|
|
3
|
-
// AgentExecution data model are execution-domain; the workflow panel is the
|
|
4
|
-
// first host, and a future session-side consumer — e.g. sub-agent expansion —
|
|
5
|
-
// would share this identity rather than minting a divergent one).
|
|
6
|
-
//
|
|
7
|
-
// Kept in its own module (not in a component file) so behavior-only
|
|
8
|
-
// consumers — the panel controller opens the tabs, the viewer routes them —
|
|
9
|
-
// depend on the identity without pulling the transcript renderer into their
|
|
10
|
-
// module graph (DD-003 headless-first). Mirrors artifact-document.ts and
|
|
11
|
-
// file-change-document.ts.
|
|
12
|
-
|
|
13
|
-
import { virtualEntryId } from "../internal/store/index.js";
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Virtual entry id of the agent-execution transcript document FAMILY. Like
|
|
17
|
-
* artifacts and file changes (and unlike the session's single plan tab),
|
|
18
|
-
* transcripts are many: every opened child AgentExecution shares this one
|
|
19
|
-
* entry id and is distinguished by its id-derived tab path, so
|
|
20
|
-
* `editorKey(AGENT_EXECUTION_DOCUMENT_ENTRY_ID, path)` yields one tab per
|
|
21
|
-
* child execution — the VS Code "each file is a tab" model. The
|
|
22
|
-
* NUL-namespaced virtual id can never alias a real workspace entry, and its
|
|
23
|
-
* distinct `"agentexec"` kind can never collide with the
|
|
24
|
-
* `"artifact"`/`"filechange"`/`"plan"` families.
|
|
25
|
-
*/
|
|
26
|
-
export const AGENT_EXECUTION_DOCUMENT_ENTRY_ID = virtualEntryId("agentexec");
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* The identity of a child AgentExecution's transcript tab within the family.
|
|
30
|
-
*
|
|
31
|
-
* The path deliberately CARRIES the child execution id (unlike artifact tabs,
|
|
32
|
-
* which need an owner-level record map to resolve content): a transcript
|
|
33
|
-
* needs only the id to fetch/stream itself, so the viewer parses it straight
|
|
34
|
-
* back out with {@link parseAgentExecutionTabPath} — no lookup map to keep in
|
|
35
|
-
* sync. The suffix is the AGENT_CALL task name because the editor tab's LABEL
|
|
36
|
-
* is the path's basename: the task name correlates the tab with the DAG node
|
|
37
|
-
* the user opened it from, and keeps two calls to the same agent distinct.
|
|
38
|
-
*/
|
|
39
|
-
export function agentExecutionTabPath(
|
|
40
|
-
childExecutionId: string,
|
|
41
|
-
taskName: string,
|
|
42
|
-
): string {
|
|
43
|
-
return `${childExecutionId}/${taskName}`;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* Recovers the child execution id from a transcript tab's path — the inverse
|
|
48
|
-
* of {@link agentExecutionTabPath}. Splits on the FIRST separator: execution
|
|
49
|
-
* ids never contain `/`, so a task name that does still round-trips.
|
|
50
|
-
*/
|
|
51
|
-
export function parseAgentExecutionTabPath(path: string): string {
|
|
52
|
-
const separator = path.indexOf("/");
|
|
53
|
-
return separator === -1 ? path : path.slice(0, separator);
|
|
54
|
-
}
|
|
@@ -1,283 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
// Editor-area document rendering one child AgentExecution's full transcript.
|
|
4
|
-
// Domain: workflow (the AGENT_CALL counterpart of WorkflowArtifactDocument).
|
|
5
|
-
|
|
6
|
-
import { memo, useCallback, useMemo } from "react";
|
|
7
|
-
import type { AgentExecution } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/api_pb";
|
|
8
|
-
import {
|
|
9
|
-
FileChangeSetStatus,
|
|
10
|
-
type FileDecisionAction,
|
|
11
|
-
} from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/enum_pb";
|
|
12
|
-
import type { FileChangeSet } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/filereview_pb";
|
|
13
|
-
import { displayFileChangeSets } from "@stigmer/sdk";
|
|
14
|
-
import { cn } from "@stigmer/theme";
|
|
15
|
-
import { useLiveAgentExecution } from "../execution/useLiveAgentExecution.js";
|
|
16
|
-
import { MessageThread } from "../execution/MessageThread.js";
|
|
17
|
-
import { ThreadSkeleton } from "../execution/ThreadSkeleton.js";
|
|
18
|
-
import { ExecutionPhaseBadge } from "../execution/ExecutionPhaseBadge.js";
|
|
19
|
-
import { FileReviewDock } from "../execution/FileReviewDock.js";
|
|
20
|
-
import type { FileDecisionOptions } from "../execution/useFileReview.js";
|
|
21
|
-
import { isTerminalPhase } from "../execution/execution-phases.js";
|
|
22
|
-
import type { UseWorkflowExecutionActionsReturn } from "./useWorkflowExecutionActions.js";
|
|
23
|
-
|
|
24
|
-
/** Stable empty list so the thread's memoized rows keep identity (DD-010). */
|
|
25
|
-
const EMPTY_EXECUTIONS: readonly AgentExecution[] = [];
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* The HITL wiring for a child transcript: the slice of
|
|
29
|
-
* {@link UseWorkflowExecutionActionsReturn} the document needs to submit
|
|
30
|
-
* child-gate decisions at the WORKFLOW level.
|
|
31
|
-
*
|
|
32
|
-
* A `Pick` (not a new shape) so the bundle can never drift from the actions
|
|
33
|
-
* hook — the viewer builds it from its single `useWorkflowExecutionActions`
|
|
34
|
-
* instance, which is the same keyed in-flight/error state the bottom
|
|
35
|
-
* Approvals tab renders. One instance, two surfaces: a spinner or failure on
|
|
36
|
-
* a gate is identical wherever that gate is shown.
|
|
37
|
-
*/
|
|
38
|
-
export type WorkflowAgentExecutionHitl = Pick<
|
|
39
|
-
UseWorkflowExecutionActionsReturn,
|
|
40
|
-
| "submitApproval"
|
|
41
|
-
| "approvalSubmittingToolCallIds"
|
|
42
|
-
| "approvalErrorsByToolCallId"
|
|
43
|
-
| "submitFileDecision"
|
|
44
|
-
| "fileDecisionSubmittingKeys"
|
|
45
|
-
| "fileDecisionErrorsByKey"
|
|
46
|
-
>;
|
|
47
|
-
|
|
48
|
-
/** Props for {@link WorkflowAgentExecutionDocument}. */
|
|
49
|
-
export interface WorkflowAgentExecutionDocumentProps {
|
|
50
|
-
/** ID of the child AgentExecution whose transcript to render. */
|
|
51
|
-
readonly childExecutionId: string;
|
|
52
|
-
/** The AGENT_CALL task that spawned the child — the document's title. */
|
|
53
|
-
readonly taskName: string;
|
|
54
|
-
/** Slug of the agent the task called, when known (subtitle context). */
|
|
55
|
-
readonly agentSlug?: string;
|
|
56
|
-
/**
|
|
57
|
-
* Open the child execution as a standalone page — the pop-out escape hatch
|
|
58
|
-
* preserved from the inspector's Agent tab. Host-routed (DD-004).
|
|
59
|
-
*/
|
|
60
|
-
readonly onNavigateToAgentExecution?: (agentExecutionId: string) => void;
|
|
61
|
-
/**
|
|
62
|
-
* Workflow-level HITL handlers (S5 of the UX-parity project). When
|
|
63
|
-
* provided, the transcript becomes interactive: tool-approval gates render
|
|
64
|
-
* their decision cards inline on the gated rows, and pending file reviews
|
|
65
|
-
* dock at the bottom of the document. When omitted, the transcript is
|
|
66
|
-
* read-only — gates show status only (backward compatible, DD-011).
|
|
67
|
-
*/
|
|
68
|
-
readonly hitl?: WorkflowAgentExecutionHitl;
|
|
69
|
-
/** Additional CSS classes for the root element. */
|
|
70
|
-
readonly className?: string;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* The editor-pane rendering of a child AgentExecution's transcript — the
|
|
75
|
-
* `SurfaceVirtualDocument` body the workflow execution panel mounts when an
|
|
76
|
-
* AGENT_CALL task is opened in place (S4 of the UX-parity project). This is
|
|
77
|
-
* the full session-grade experience — streaming `MessageThread` with tool
|
|
78
|
-
* calls, sub-agents, plan cards, and (with {@link
|
|
79
|
-
* WorkflowAgentExecutionDocumentProps.hitl | hitl}) in-place HITL —
|
|
80
|
-
* replacing the inspector's cramped `max-h-[50vh]` thumbnail.
|
|
81
|
-
*
|
|
82
|
-
* HITL ROUTING. Child gates are decided through the WORKFLOW-level RPCs
|
|
83
|
-
* (`WorkflowExecution.submitApproval` / `submitFileDecision`), never the
|
|
84
|
-
* child's own `agentExecution.*` submit path. The two paths are
|
|
85
|
-
* server-equivalent (the workflow RPC forwards to the child — see
|
|
86
|
-
* workflowexecution command.proto), but they differ in authorization: the
|
|
87
|
-
* workflow RPC checks `can_edit` on the workflow execution — the resource
|
|
88
|
-
* the operator owns — while the child path checks the runner-spawned
|
|
89
|
-
* AgentExecution, which the operator may not. Every workflow HITL surface
|
|
90
|
-
* (bottom Approvals tab, inspector) routes this way; the transcript joins
|
|
91
|
-
* them via the same actions instance, so in-flight/error state never forks.
|
|
92
|
-
*
|
|
93
|
-
* FILE-REVIEW DOCK. Pending (AWAITING_REVIEW) sets derive from the CHILD's
|
|
94
|
-
* own live stream — the freshest source this document already holds — not
|
|
95
|
-
* from the parent's `status.pending_file_reviews`: the parent snapshot is
|
|
96
|
-
* fetched once at mount and may lag a mid-run gate, which would blank the
|
|
97
|
-
* dock exactly when the reviewer is watching live. The server validates
|
|
98
|
-
* routing against its own (fresh) stored status at submit time, so a
|
|
99
|
-
* too-early decision degrades to a retryable in-card error, the same
|
|
100
|
-
* treatment tool approvals get. Docked below the thread (mirroring the
|
|
101
|
-
* session's composer dock) so a decision the agent is blocked on can never
|
|
102
|
-
* scroll out of view; settled sets render as read-only records in-thread
|
|
103
|
-
* (`showFileReviewRecords`), never in the dock — the two surfaces partition
|
|
104
|
-
* by the same pending test `MessageThread` uses.
|
|
105
|
-
*
|
|
106
|
-
* Lifecycle: the surface's editor area mounts only the ACTIVE virtual
|
|
107
|
-
* document, so `useLiveAgentExecution` fetches/streams only while this tab
|
|
108
|
-
* is foregrounded (DD-LIVE-006 — at most one child stream is ever live) and
|
|
109
|
-
* a tab-return re-renders instantly from the DD-014 fetch cache.
|
|
110
|
-
*
|
|
111
|
-
* All visual properties flow through `--stgm-*` tokens (DD-005).
|
|
112
|
-
*/
|
|
113
|
-
export const WorkflowAgentExecutionDocument = memo(
|
|
114
|
-
function WorkflowAgentExecutionDocument({
|
|
115
|
-
childExecutionId,
|
|
116
|
-
taskName,
|
|
117
|
-
agentSlug,
|
|
118
|
-
onNavigateToAgentExecution,
|
|
119
|
-
hitl,
|
|
120
|
-
className,
|
|
121
|
-
}: WorkflowAgentExecutionDocumentProps) {
|
|
122
|
-
const { execution, phase, isLoading, isStreaming, isReconnecting, error, reconnect } =
|
|
123
|
-
useLiveAgentExecution(childExecutionId);
|
|
124
|
-
|
|
125
|
-
// Pending file reviews from the child's own (streamed) status — see the
|
|
126
|
-
// component doc for why the parent's pending_file_reviews is not the
|
|
127
|
-
// source. Terminal executions never dock: their AWAITING_REVIEW sets are
|
|
128
|
-
// settled history ("not reviewed") and render as in-thread records — the
|
|
129
|
-
// exact complement of MessageThread's pending test, so no set ever
|
|
130
|
-
// appears in both surfaces.
|
|
131
|
-
const terminal = isTerminalPhase(phase);
|
|
132
|
-
const pendingReviewSets = useMemo<readonly FileChangeSet[]>(() => {
|
|
133
|
-
if (terminal) return [];
|
|
134
|
-
return displayFileChangeSets(execution?.status).filter(
|
|
135
|
-
(cs) =>
|
|
136
|
-
cs.status === FileChangeSetStatus.AWAITING_REVIEW &&
|
|
137
|
-
cs.changes.length > 0,
|
|
138
|
-
);
|
|
139
|
-
}, [execution?.status, terminal]);
|
|
140
|
-
|
|
141
|
-
// Bind the child id into the dock's card-level submit signature. Deps are
|
|
142
|
-
// the specific method (DD-010), so the callback survives unrelated
|
|
143
|
-
// in-flight churn on the actions instance.
|
|
144
|
-
const submitFileDecision = hitl?.submitFileDecision;
|
|
145
|
-
const handleFileDecision = useCallback(
|
|
146
|
-
(changeSetId: string, action: FileDecisionAction, options?: FileDecisionOptions) => {
|
|
147
|
-
submitFileDecision?.(childExecutionId, changeSetId, action, options);
|
|
148
|
-
},
|
|
149
|
-
[submitFileDecision, childExecutionId],
|
|
150
|
-
);
|
|
151
|
-
|
|
152
|
-
return (
|
|
153
|
-
<div
|
|
154
|
-
role="article"
|
|
155
|
-
aria-label={`Agent execution for task ${taskName}`}
|
|
156
|
-
className={cn("flex h-full min-w-0 flex-col", className)}
|
|
157
|
-
>
|
|
158
|
-
{/* Slim identity header: task name (the DAG node this transcript
|
|
159
|
-
belongs to), agent slug, live/phase state, and the standalone
|
|
160
|
-
pop-out. Wraps on narrow panes rather than overflowing. */}
|
|
161
|
-
<div className="flex min-w-0 shrink-0 flex-wrap items-center gap-x-3 gap-y-1 border-b border-border bg-background px-4 py-2">
|
|
162
|
-
<span className="truncate text-sm font-medium text-foreground">
|
|
163
|
-
{taskName}
|
|
164
|
-
</span>
|
|
165
|
-
{agentSlug && (
|
|
166
|
-
<span className="shrink-0 text-xs text-muted-foreground">
|
|
167
|
-
{agentSlug}
|
|
168
|
-
</span>
|
|
169
|
-
)}
|
|
170
|
-
|
|
171
|
-
<span className="shrink-0">
|
|
172
|
-
{isStreaming ? (
|
|
173
|
-
<span className="inline-flex items-center gap-1.5 text-xs font-medium text-primary">
|
|
174
|
-
<span className="inline-block size-1.5 animate-pulse rounded-full bg-primary" aria-hidden="true" />
|
|
175
|
-
Live
|
|
176
|
-
</span>
|
|
177
|
-
) : isReconnecting ? (
|
|
178
|
-
<span className="text-xs text-muted-foreground">Reconnecting…</span>
|
|
179
|
-
) : isTerminalPhase(phase) ? (
|
|
180
|
-
<ExecutionPhaseBadge phase={phase} />
|
|
181
|
-
) : null}
|
|
182
|
-
</span>
|
|
183
|
-
|
|
184
|
-
{onNavigateToAgentExecution && (
|
|
185
|
-
<button
|
|
186
|
-
type="button"
|
|
187
|
-
onClick={() => onNavigateToAgentExecution(childExecutionId)}
|
|
188
|
-
className="ml-auto inline-flex shrink-0 items-center gap-1.5 text-xs font-medium text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:rounded-sm"
|
|
189
|
-
>
|
|
190
|
-
<PopOutIcon />
|
|
191
|
-
Open standalone
|
|
192
|
-
</button>
|
|
193
|
-
)}
|
|
194
|
-
</div>
|
|
195
|
-
|
|
196
|
-
{/* The thread owns the scrolling (its auto-scroll machine + jump-to-
|
|
197
|
-
latest need the scroll container); h-full keeps the surrounding
|
|
198
|
-
editor-pane wrapper inert, so there is exactly one scrollbar. */}
|
|
199
|
-
<div className="min-h-0 min-w-0 flex-1">
|
|
200
|
-
{execution ? (
|
|
201
|
-
<MessageThread
|
|
202
|
-
executions={EMPTY_EXECUTIONS}
|
|
203
|
-
activeStreamExecution={execution}
|
|
204
|
-
onApprovalSubmit={hitl?.submitApproval}
|
|
205
|
-
submittingApprovalIds={hitl?.approvalSubmittingToolCallIds}
|
|
206
|
-
approvalErrors={hitl?.approvalErrorsByToolCallId}
|
|
207
|
-
showFileReviewRecords={hitl != null}
|
|
208
|
-
className="h-full"
|
|
209
|
-
/>
|
|
210
|
-
) : isLoading ? (
|
|
211
|
-
<ThreadSkeleton className="px-4 py-4" />
|
|
212
|
-
) : error ? (
|
|
213
|
-
<div
|
|
214
|
-
role="alert"
|
|
215
|
-
className="mx-auto flex w-full max-w-3xl flex-col items-center gap-2 px-4 py-8 text-center"
|
|
216
|
-
>
|
|
217
|
-
<p className="text-xs text-destructive">{error.message}</p>
|
|
218
|
-
<button
|
|
219
|
-
type="button"
|
|
220
|
-
onClick={reconnect}
|
|
221
|
-
className="rounded border border-border px-3 py-1.5 text-xs font-medium text-foreground hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
|
|
222
|
-
>
|
|
223
|
-
Retry
|
|
224
|
-
</button>
|
|
225
|
-
</div>
|
|
226
|
-
) : (
|
|
227
|
-
<div
|
|
228
|
-
role="status"
|
|
229
|
-
className="mx-auto flex w-full max-w-3xl flex-col items-center gap-1 px-4 py-8 text-center"
|
|
230
|
-
>
|
|
231
|
-
<p className="text-xs font-medium text-foreground">
|
|
232
|
-
This agent execution is no longer available.
|
|
233
|
-
</p>
|
|
234
|
-
<p className="text-xs text-muted-foreground">
|
|
235
|
-
It may have been removed, or the workflow run predates
|
|
236
|
-
transcript retention.
|
|
237
|
-
</p>
|
|
238
|
-
</div>
|
|
239
|
-
)}
|
|
240
|
-
</div>
|
|
241
|
-
|
|
242
|
-
{/* Pending file reviews dock here — pinned below the thread (the
|
|
243
|
-
document has no composer, so the panel bottom is the fixed strip)
|
|
244
|
-
where the decision the child is blocked on can never scroll out
|
|
245
|
-
of view. Same shape as the session's composer dock. */}
|
|
246
|
-
{hitl && pendingReviewSets.length > 0 && (
|
|
247
|
-
<FileReviewDock
|
|
248
|
-
changeSets={pendingReviewSets}
|
|
249
|
-
onSubmit={handleFileDecision}
|
|
250
|
-
submittingDecisionKeys={hitl.fileDecisionSubmittingKeys}
|
|
251
|
-
decisionErrors={hitl.fileDecisionErrorsByKey}
|
|
252
|
-
className="shrink-0"
|
|
253
|
-
/>
|
|
254
|
-
)}
|
|
255
|
-
</div>
|
|
256
|
-
);
|
|
257
|
-
},
|
|
258
|
-
);
|
|
259
|
-
|
|
260
|
-
// ---------------------------------------------------------------------------
|
|
261
|
-
// Inline SVG icons (SDK independence — no lucide dependency)
|
|
262
|
-
// ---------------------------------------------------------------------------
|
|
263
|
-
|
|
264
|
-
function PopOutIcon() {
|
|
265
|
-
return (
|
|
266
|
-
<svg
|
|
267
|
-
width="12"
|
|
268
|
-
height="12"
|
|
269
|
-
viewBox="0 0 12 12"
|
|
270
|
-
fill="none"
|
|
271
|
-
stroke="currentColor"
|
|
272
|
-
strokeWidth="1.3"
|
|
273
|
-
strokeLinecap="round"
|
|
274
|
-
strokeLinejoin="round"
|
|
275
|
-
className="shrink-0"
|
|
276
|
-
aria-hidden="true"
|
|
277
|
-
>
|
|
278
|
-
<path d="M10.5 4.5V1.5H7.5" />
|
|
279
|
-
<path d="M10.5 1.5L6 6" />
|
|
280
|
-
<path d="M8.5 7v3a1 1 0 0 1-1 1h-5a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h3" />
|
|
281
|
-
</svg>
|
|
282
|
-
);
|
|
283
|
-
}
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import type { UseWorkflowExecutionActionsReturn } from "./useWorkflowExecutionActions.js";
|
|
2
|
-
/**
|
|
3
|
-
* The HITL wiring for a child transcript: the slice of
|
|
4
|
-
* {@link UseWorkflowExecutionActionsReturn} the document needs to submit
|
|
5
|
-
* child-gate decisions at the WORKFLOW level.
|
|
6
|
-
*
|
|
7
|
-
* A `Pick` (not a new shape) so the bundle can never drift from the actions
|
|
8
|
-
* hook — the viewer builds it from its single `useWorkflowExecutionActions`
|
|
9
|
-
* instance, which is the same keyed in-flight/error state the bottom
|
|
10
|
-
* Approvals tab renders. One instance, two surfaces: a spinner or failure on
|
|
11
|
-
* a gate is identical wherever that gate is shown.
|
|
12
|
-
*/
|
|
13
|
-
export type WorkflowAgentExecutionHitl = Pick<UseWorkflowExecutionActionsReturn, "submitApproval" | "approvalSubmittingToolCallIds" | "approvalErrorsByToolCallId" | "submitFileDecision" | "fileDecisionSubmittingKeys" | "fileDecisionErrorsByKey">;
|
|
14
|
-
/** Props for {@link WorkflowAgentExecutionDocument}. */
|
|
15
|
-
export interface WorkflowAgentExecutionDocumentProps {
|
|
16
|
-
/** ID of the child AgentExecution whose transcript to render. */
|
|
17
|
-
readonly childExecutionId: string;
|
|
18
|
-
/** The AGENT_CALL task that spawned the child — the document's title. */
|
|
19
|
-
readonly taskName: string;
|
|
20
|
-
/** Slug of the agent the task called, when known (subtitle context). */
|
|
21
|
-
readonly agentSlug?: string;
|
|
22
|
-
/**
|
|
23
|
-
* Open the child execution as a standalone page — the pop-out escape hatch
|
|
24
|
-
* preserved from the inspector's Agent tab. Host-routed (DD-004).
|
|
25
|
-
*/
|
|
26
|
-
readonly onNavigateToAgentExecution?: (agentExecutionId: string) => void;
|
|
27
|
-
/**
|
|
28
|
-
* Workflow-level HITL handlers (S5 of the UX-parity project). When
|
|
29
|
-
* provided, the transcript becomes interactive: tool-approval gates render
|
|
30
|
-
* their decision cards inline on the gated rows, and pending file reviews
|
|
31
|
-
* dock at the bottom of the document. When omitted, the transcript is
|
|
32
|
-
* read-only — gates show status only (backward compatible, DD-011).
|
|
33
|
-
*/
|
|
34
|
-
readonly hitl?: WorkflowAgentExecutionHitl;
|
|
35
|
-
/** Additional CSS classes for the root element. */
|
|
36
|
-
readonly className?: string;
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* The editor-pane rendering of a child AgentExecution's transcript — the
|
|
40
|
-
* `SurfaceVirtualDocument` body the workflow execution panel mounts when an
|
|
41
|
-
* AGENT_CALL task is opened in place (S4 of the UX-parity project). This is
|
|
42
|
-
* the full session-grade experience — streaming `MessageThread` with tool
|
|
43
|
-
* calls, sub-agents, plan cards, and (with {@link
|
|
44
|
-
* WorkflowAgentExecutionDocumentProps.hitl | hitl}) in-place HITL —
|
|
45
|
-
* replacing the inspector's cramped `max-h-[50vh]` thumbnail.
|
|
46
|
-
*
|
|
47
|
-
* HITL ROUTING. Child gates are decided through the WORKFLOW-level RPCs
|
|
48
|
-
* (`WorkflowExecution.submitApproval` / `submitFileDecision`), never the
|
|
49
|
-
* child's own `agentExecution.*` submit path. The two paths are
|
|
50
|
-
* server-equivalent (the workflow RPC forwards to the child — see
|
|
51
|
-
* workflowexecution command.proto), but they differ in authorization: the
|
|
52
|
-
* workflow RPC checks `can_edit` on the workflow execution — the resource
|
|
53
|
-
* the operator owns — while the child path checks the runner-spawned
|
|
54
|
-
* AgentExecution, which the operator may not. Every workflow HITL surface
|
|
55
|
-
* (bottom Approvals tab, inspector) routes this way; the transcript joins
|
|
56
|
-
* them via the same actions instance, so in-flight/error state never forks.
|
|
57
|
-
*
|
|
58
|
-
* FILE-REVIEW DOCK. Pending (AWAITING_REVIEW) sets derive from the CHILD's
|
|
59
|
-
* own live stream — the freshest source this document already holds — not
|
|
60
|
-
* from the parent's `status.pending_file_reviews`: the parent snapshot is
|
|
61
|
-
* fetched once at mount and may lag a mid-run gate, which would blank the
|
|
62
|
-
* dock exactly when the reviewer is watching live. The server validates
|
|
63
|
-
* routing against its own (fresh) stored status at submit time, so a
|
|
64
|
-
* too-early decision degrades to a retryable in-card error, the same
|
|
65
|
-
* treatment tool approvals get. Docked below the thread (mirroring the
|
|
66
|
-
* session's composer dock) so a decision the agent is blocked on can never
|
|
67
|
-
* scroll out of view; settled sets render as read-only records in-thread
|
|
68
|
-
* (`showFileReviewRecords`), never in the dock — the two surfaces partition
|
|
69
|
-
* by the same pending test `MessageThread` uses.
|
|
70
|
-
*
|
|
71
|
-
* Lifecycle: the surface's editor area mounts only the ACTIVE virtual
|
|
72
|
-
* document, so `useLiveAgentExecution` fetches/streams only while this tab
|
|
73
|
-
* is foregrounded (DD-LIVE-006 — at most one child stream is ever live) and
|
|
74
|
-
* a tab-return re-renders instantly from the DD-014 fetch cache.
|
|
75
|
-
*
|
|
76
|
-
* All visual properties flow through `--stgm-*` tokens (DD-005).
|
|
77
|
-
*/
|
|
78
|
-
export declare const WorkflowAgentExecutionDocument: import("react").NamedExoticComponent<WorkflowAgentExecutionDocumentProps>;
|
|
79
|
-
//# sourceMappingURL=WorkflowAgentExecutionDocument.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"WorkflowAgentExecutionDocument.d.ts","sourceRoot":"","sources":["../../src/workflow/WorkflowAgentExecutionDocument.tsx"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,kCAAkC,CAAC;AAK1F;;;;;;;;;;GAUG;AACH,MAAM,MAAM,0BAA0B,GAAG,IAAI,CAC3C,iCAAiC,EAC/B,gBAAgB,GAChB,+BAA+B,GAC/B,4BAA4B,GAC5B,oBAAoB,GACpB,4BAA4B,GAC5B,yBAAyB,CAC5B,CAAC;AAEF,wDAAwD;AACxD,MAAM,WAAW,mCAAmC;IAClD,iEAAiE;IACjE,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,yEAAyE;IACzE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,wEAAwE;IACxE,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B;;;OAGG;IACH,QAAQ,CAAC,0BAA0B,CAAC,EAAE,CAAC,gBAAgB,EAAE,MAAM,KAAK,IAAI,CAAC;IACzE;;;;;;OAMG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,0BAA0B,CAAC;IAC3C,mDAAmD;IACnD,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,eAAO,MAAM,8BAA8B,2EAiJ1C,CAAC"}
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
// Editor-area document rendering one child AgentExecution's full transcript.
|
|
4
|
-
// Domain: workflow (the AGENT_CALL counterpart of WorkflowArtifactDocument).
|
|
5
|
-
import { memo, useCallback, useMemo } from "react";
|
|
6
|
-
import { FileChangeSetStatus, } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/enum_pb";
|
|
7
|
-
import { displayFileChangeSets } from "@stigmer/sdk";
|
|
8
|
-
import { cn } from "@stigmer/theme";
|
|
9
|
-
import { useLiveAgentExecution } from "../execution/useLiveAgentExecution.js";
|
|
10
|
-
import { MessageThread } from "../execution/MessageThread.js";
|
|
11
|
-
import { ThreadSkeleton } from "../execution/ThreadSkeleton.js";
|
|
12
|
-
import { ExecutionPhaseBadge } from "../execution/ExecutionPhaseBadge.js";
|
|
13
|
-
import { FileReviewDock } from "../execution/FileReviewDock.js";
|
|
14
|
-
import { isTerminalPhase } from "../execution/execution-phases.js";
|
|
15
|
-
/** Stable empty list so the thread's memoized rows keep identity (DD-010). */
|
|
16
|
-
const EMPTY_EXECUTIONS = [];
|
|
17
|
-
/**
|
|
18
|
-
* The editor-pane rendering of a child AgentExecution's transcript — the
|
|
19
|
-
* `SurfaceVirtualDocument` body the workflow execution panel mounts when an
|
|
20
|
-
* AGENT_CALL task is opened in place (S4 of the UX-parity project). This is
|
|
21
|
-
* the full session-grade experience — streaming `MessageThread` with tool
|
|
22
|
-
* calls, sub-agents, plan cards, and (with {@link
|
|
23
|
-
* WorkflowAgentExecutionDocumentProps.hitl | hitl}) in-place HITL —
|
|
24
|
-
* replacing the inspector's cramped `max-h-[50vh]` thumbnail.
|
|
25
|
-
*
|
|
26
|
-
* HITL ROUTING. Child gates are decided through the WORKFLOW-level RPCs
|
|
27
|
-
* (`WorkflowExecution.submitApproval` / `submitFileDecision`), never the
|
|
28
|
-
* child's own `agentExecution.*` submit path. The two paths are
|
|
29
|
-
* server-equivalent (the workflow RPC forwards to the child — see
|
|
30
|
-
* workflowexecution command.proto), but they differ in authorization: the
|
|
31
|
-
* workflow RPC checks `can_edit` on the workflow execution — the resource
|
|
32
|
-
* the operator owns — while the child path checks the runner-spawned
|
|
33
|
-
* AgentExecution, which the operator may not. Every workflow HITL surface
|
|
34
|
-
* (bottom Approvals tab, inspector) routes this way; the transcript joins
|
|
35
|
-
* them via the same actions instance, so in-flight/error state never forks.
|
|
36
|
-
*
|
|
37
|
-
* FILE-REVIEW DOCK. Pending (AWAITING_REVIEW) sets derive from the CHILD's
|
|
38
|
-
* own live stream — the freshest source this document already holds — not
|
|
39
|
-
* from the parent's `status.pending_file_reviews`: the parent snapshot is
|
|
40
|
-
* fetched once at mount and may lag a mid-run gate, which would blank the
|
|
41
|
-
* dock exactly when the reviewer is watching live. The server validates
|
|
42
|
-
* routing against its own (fresh) stored status at submit time, so a
|
|
43
|
-
* too-early decision degrades to a retryable in-card error, the same
|
|
44
|
-
* treatment tool approvals get. Docked below the thread (mirroring the
|
|
45
|
-
* session's composer dock) so a decision the agent is blocked on can never
|
|
46
|
-
* scroll out of view; settled sets render as read-only records in-thread
|
|
47
|
-
* (`showFileReviewRecords`), never in the dock — the two surfaces partition
|
|
48
|
-
* by the same pending test `MessageThread` uses.
|
|
49
|
-
*
|
|
50
|
-
* Lifecycle: the surface's editor area mounts only the ACTIVE virtual
|
|
51
|
-
* document, so `useLiveAgentExecution` fetches/streams only while this tab
|
|
52
|
-
* is foregrounded (DD-LIVE-006 — at most one child stream is ever live) and
|
|
53
|
-
* a tab-return re-renders instantly from the DD-014 fetch cache.
|
|
54
|
-
*
|
|
55
|
-
* All visual properties flow through `--stgm-*` tokens (DD-005).
|
|
56
|
-
*/
|
|
57
|
-
export const WorkflowAgentExecutionDocument = memo(function WorkflowAgentExecutionDocument({ childExecutionId, taskName, agentSlug, onNavigateToAgentExecution, hitl, className, }) {
|
|
58
|
-
const { execution, phase, isLoading, isStreaming, isReconnecting, error, reconnect } = useLiveAgentExecution(childExecutionId);
|
|
59
|
-
// Pending file reviews from the child's own (streamed) status — see the
|
|
60
|
-
// component doc for why the parent's pending_file_reviews is not the
|
|
61
|
-
// source. Terminal executions never dock: their AWAITING_REVIEW sets are
|
|
62
|
-
// settled history ("not reviewed") and render as in-thread records — the
|
|
63
|
-
// exact complement of MessageThread's pending test, so no set ever
|
|
64
|
-
// appears in both surfaces.
|
|
65
|
-
const terminal = isTerminalPhase(phase);
|
|
66
|
-
const pendingReviewSets = useMemo(() => {
|
|
67
|
-
if (terminal)
|
|
68
|
-
return [];
|
|
69
|
-
return displayFileChangeSets(execution?.status).filter((cs) => cs.status === FileChangeSetStatus.AWAITING_REVIEW &&
|
|
70
|
-
cs.changes.length > 0);
|
|
71
|
-
}, [execution?.status, terminal]);
|
|
72
|
-
// Bind the child id into the dock's card-level submit signature. Deps are
|
|
73
|
-
// the specific method (DD-010), so the callback survives unrelated
|
|
74
|
-
// in-flight churn on the actions instance.
|
|
75
|
-
const submitFileDecision = hitl?.submitFileDecision;
|
|
76
|
-
const handleFileDecision = useCallback((changeSetId, action, options) => {
|
|
77
|
-
submitFileDecision?.(childExecutionId, changeSetId, action, options);
|
|
78
|
-
}, [submitFileDecision, childExecutionId]);
|
|
79
|
-
return (_jsxs("div", { role: "article", "aria-label": `Agent execution for task ${taskName}`, className: cn("flex h-full min-w-0 flex-col", className), children: [_jsxs("div", { className: "flex min-w-0 shrink-0 flex-wrap items-center gap-x-3 gap-y-1 border-b border-border bg-background px-4 py-2", children: [_jsx("span", { className: "truncate text-sm font-medium text-foreground", children: taskName }), agentSlug && (_jsx("span", { className: "shrink-0 text-xs text-muted-foreground", children: agentSlug })), _jsx("span", { className: "shrink-0", children: isStreaming ? (_jsxs("span", { className: "inline-flex items-center gap-1.5 text-xs font-medium text-primary", children: [_jsx("span", { className: "inline-block size-1.5 animate-pulse rounded-full bg-primary", "aria-hidden": "true" }), "Live"] })) : isReconnecting ? (_jsx("span", { className: "text-xs text-muted-foreground", children: "Reconnecting\u2026" })) : isTerminalPhase(phase) ? (_jsx(ExecutionPhaseBadge, { phase: phase })) : null }), onNavigateToAgentExecution && (_jsxs("button", { type: "button", onClick: () => onNavigateToAgentExecution(childExecutionId), className: "ml-auto inline-flex shrink-0 items-center gap-1.5 text-xs font-medium text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:rounded-sm", children: [_jsx(PopOutIcon, {}), "Open standalone"] }))] }), _jsx("div", { className: "min-h-0 min-w-0 flex-1", children: execution ? (_jsx(MessageThread, { executions: EMPTY_EXECUTIONS, activeStreamExecution: execution, onApprovalSubmit: hitl?.submitApproval, submittingApprovalIds: hitl?.approvalSubmittingToolCallIds, approvalErrors: hitl?.approvalErrorsByToolCallId, showFileReviewRecords: hitl != null, className: "h-full" })) : isLoading ? (_jsx(ThreadSkeleton, { className: "px-4 py-4" })) : error ? (_jsxs("div", { role: "alert", className: "mx-auto flex w-full max-w-3xl flex-col items-center gap-2 px-4 py-8 text-center", children: [_jsx("p", { className: "text-xs text-destructive", children: error.message }), _jsx("button", { type: "button", onClick: reconnect, className: "rounded border border-border px-3 py-1.5 text-xs font-medium text-foreground hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", children: "Retry" })] })) : (_jsxs("div", { role: "status", className: "mx-auto flex w-full max-w-3xl flex-col items-center gap-1 px-4 py-8 text-center", children: [_jsx("p", { className: "text-xs font-medium text-foreground", children: "This agent execution is no longer available." }), _jsx("p", { className: "text-xs text-muted-foreground", children: "It may have been removed, or the workflow run predates transcript retention." })] })) }), hitl && pendingReviewSets.length > 0 && (_jsx(FileReviewDock, { changeSets: pendingReviewSets, onSubmit: handleFileDecision, submittingDecisionKeys: hitl.fileDecisionSubmittingKeys, decisionErrors: hitl.fileDecisionErrorsByKey, className: "shrink-0" }))] }));
|
|
80
|
-
});
|
|
81
|
-
// ---------------------------------------------------------------------------
|
|
82
|
-
// Inline SVG icons (SDK independence — no lucide dependency)
|
|
83
|
-
// ---------------------------------------------------------------------------
|
|
84
|
-
function PopOutIcon() {
|
|
85
|
-
return (_jsxs("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", stroke: "currentColor", strokeWidth: "1.3", strokeLinecap: "round", strokeLinejoin: "round", className: "shrink-0", "aria-hidden": "true", children: [_jsx("path", { d: "M10.5 4.5V1.5H7.5" }), _jsx("path", { d: "M10.5 1.5L6 6" }), _jsx("path", { d: "M8.5 7v3a1 1 0 0 1-1 1h-5a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h3" })] }));
|
|
86
|
-
}
|
|
87
|
-
//# sourceMappingURL=WorkflowAgentExecutionDocument.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"WorkflowAgentExecutionDocument.js","sourceRoot":"","sources":["../../src/workflow/WorkflowAgentExecutionDocument.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,6EAA6E;AAC7E,6EAA6E;AAE7E,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEnD,OAAO,EAC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