@stigmer/react 3.1.2 → 3.1.4
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/composer/SessionComposer.d.ts +37 -5
- package/composer/SessionComposer.d.ts.map +1 -1
- package/composer/SessionComposer.js +13 -5
- package/composer/SessionComposer.js.map +1 -1
- package/execution/ArtifactApplyButton.d.ts +25 -0
- package/execution/ArtifactApplyButton.d.ts.map +1 -0
- package/execution/ArtifactApplyButton.js +21 -0
- package/execution/ArtifactApplyButton.js.map +1 -0
- package/execution/ArtifactContentBody.d.ts +36 -0
- package/execution/ArtifactContentBody.d.ts.map +1 -0
- package/execution/ArtifactContentBody.js +62 -0
- package/execution/ArtifactContentBody.js.map +1 -0
- package/execution/ArtifactDocument.d.ts +48 -0
- package/execution/ArtifactDocument.d.ts.map +1 -0
- package/execution/ArtifactDocument.js +89 -0
- package/execution/ArtifactDocument.js.map +1 -0
- package/execution/ArtifactPreviewModal.d.ts +9 -9
- package/execution/ArtifactPreviewModal.d.ts.map +1 -1
- package/execution/ArtifactPreviewModal.js +18 -145
- package/execution/ArtifactPreviewModal.js.map +1 -1
- package/execution/ArtifactRow.d.ts +49 -0
- package/execution/ArtifactRow.d.ts.map +1 -0
- package/execution/ArtifactRow.js +56 -0
- package/execution/ArtifactRow.js.map +1 -0
- package/execution/ArtifactsWidget.d.ts +6 -9
- package/execution/ArtifactsWidget.d.ts.map +1 -1
- package/execution/ArtifactsWidget.js +15 -19
- package/execution/ArtifactsWidget.js.map +1 -1
- package/execution/FileChangeProgressBar.d.ts +47 -0
- package/execution/FileChangeProgressBar.d.ts.map +1 -0
- package/execution/FileChangeProgressBar.js +49 -0
- package/execution/FileChangeProgressBar.js.map +1 -0
- package/execution/FileChangesView.d.ts.map +1 -1
- package/execution/FileChangesView.js +19 -4
- package/execution/FileChangesView.js.map +1 -1
- package/execution/FileReviewAtoms.d.ts +27 -0
- package/execution/FileReviewAtoms.d.ts.map +1 -0
- package/execution/FileReviewAtoms.js +64 -0
- package/execution/FileReviewAtoms.js.map +1 -0
- package/execution/FileReviewCard.d.ts +2 -2
- package/execution/FileReviewCard.d.ts.map +1 -1
- package/execution/FileReviewCard.js +32 -62
- package/execution/FileReviewCard.js.map +1 -1
- package/execution/MessageEntry.d.ts +0 -9
- package/execution/MessageEntry.d.ts.map +1 -1
- package/execution/MessageEntry.js +1 -11
- package/execution/MessageEntry.js.map +1 -1
- package/execution/MessageThread.d.ts +3 -4
- package/execution/MessageThread.d.ts.map +1 -1
- package/execution/MessageThread.js +25 -11
- package/execution/MessageThread.js.map +1 -1
- package/execution/PlanArtifactCard.d.ts +16 -10
- package/execution/PlanArtifactCard.d.ts.map +1 -1
- package/execution/PlanArtifactCard.js +31 -7
- package/execution/PlanArtifactCard.js.map +1 -1
- package/execution/PlanCompletionCard.d.ts +4 -4
- package/execution/PlanCompletionCard.d.ts.map +1 -1
- package/execution/PlanCompletionCard.js +4 -4
- package/execution/PlanCompletionCard.js.map +1 -1
- package/execution/PlanStreamingCard.d.ts +7 -2
- package/execution/PlanStreamingCard.d.ts.map +1 -1
- package/execution/PlanStreamingCard.js +11 -6
- package/execution/PlanStreamingCard.js.map +1 -1
- package/execution/index.d.ts +12 -2
- package/execution/index.d.ts.map +1 -1
- package/execution/index.js +6 -1
- package/execution/index.js.map +1 -1
- package/execution/use-build-from-plan-hotkey.d.ts +1 -1
- package/execution/use-build-from-plan-hotkey.js +1 -1
- package/execution/useArtifactContent.d.ts +6 -1
- package/execution/useArtifactContent.d.ts.map +1 -1
- package/execution/useArtifactContent.js +7 -2
- package/execution/useArtifactContent.js.map +1 -1
- package/execution/useArtifactCopy.d.ts +51 -0
- package/execution/useArtifactCopy.d.ts.map +1 -0
- package/execution/useArtifactCopy.js +75 -0
- package/execution/useArtifactCopy.js.map +1 -0
- package/execution/useArtifactDownload.d.ts.map +1 -1
- package/execution/useArtifactDownload.js +17 -5
- package/execution/useArtifactDownload.js.map +1 -1
- package/execution/useArtifactInspection.d.ts +85 -0
- package/execution/useArtifactInspection.d.ts.map +1 -0
- package/execution/useArtifactInspection.js +143 -0
- package/execution/useArtifactInspection.js.map +1 -0
- package/execution/useCreateAgentExecution.d.ts +16 -3
- package/execution/useCreateAgentExecution.d.ts.map +1 -1
- package/execution/useCreateAgentExecution.js +1 -0
- package/execution/useCreateAgentExecution.js.map +1 -1
- package/index.d.ts +4 -4
- package/index.d.ts.map +1 -1
- package/index.js +3 -3
- package/index.js.map +1 -1
- package/internal/MermaidDiagram.d.ts +47 -0
- package/internal/MermaidDiagram.d.ts.map +1 -0
- package/internal/MermaidDiagram.js +118 -0
- package/internal/MermaidDiagram.js.map +1 -0
- package/internal/file-tree/FileTreeNode.d.ts.map +1 -1
- package/internal/file-tree/FileTreeNode.js +2 -2
- package/internal/file-tree/FileTreeNode.js.map +1 -1
- package/internal/markdown-components.d.ts.map +1 -1
- package/internal/markdown-components.js +34 -0
- package/internal/markdown-components.js.map +1 -1
- package/internal/mermaid-loader.d.ts +26 -0
- package/internal/mermaid-loader.d.ts.map +1 -0
- package/internal/mermaid-loader.js +34 -0
- package/internal/mermaid-loader.js.map +1 -0
- package/internal/mermaid-theme-css.d.ts +41 -0
- package/internal/mermaid-theme-css.d.ts.map +1 -0
- package/internal/mermaid-theme-css.js +179 -0
- package/internal/mermaid-theme-css.js.map +1 -0
- package/internal/slug.d.ts +9 -5
- package/internal/slug.d.ts.map +1 -1
- package/internal/slug.js +10 -6
- package/internal/slug.js.map +1 -1
- package/library/detect-plan-artifact.d.ts +27 -9
- package/library/detect-plan-artifact.d.ts.map +1 -1
- package/library/detect-plan-artifact.js +26 -6
- package/library/detect-plan-artifact.js.map +1 -1
- package/library/index.d.ts +1 -1
- package/library/index.d.ts.map +1 -1
- package/library/index.js +1 -1
- package/library/index.js.map +1 -1
- package/package.json +5 -4
- package/session/PlanEditor.js +1 -1
- package/session/PlanEditor.js.map +1 -1
- package/session/SessionViewer.d.ts.map +1 -1
- package/session/SessionViewer.js +122 -30
- package/session/SessionViewer.js.map +1 -1
- package/session/artifact-document.d.ts +13 -0
- package/session/artifact-document.d.ts.map +1 -0
- package/session/artifact-document.js +22 -0
- package/session/artifact-document.js.map +1 -0
- package/session/facets/ArtifactsTab.d.ts +30 -4
- package/session/facets/ArtifactsTab.d.ts.map +1 -1
- package/session/facets/ArtifactsTab.js +32 -10
- package/session/facets/ArtifactsTab.js.map +1 -1
- package/session/index.d.ts +2 -1
- package/session/index.d.ts.map +1 -1
- package/session/index.js +4 -1
- package/session/index.js.map +1 -1
- package/session/plan-document.d.ts +14 -2
- package/session/plan-document.d.ts.map +1 -1
- package/session/plan-document.js +14 -3
- package/session/plan-document.js.map +1 -1
- package/session/usePlanDraft.d.ts +1 -1
- package/session/useSessionArtifacts.d.ts +17 -0
- package/session/useSessionArtifacts.d.ts.map +1 -1
- package/session/useSessionArtifacts.js +16 -5
- package/session/useSessionArtifacts.js.map +1 -1
- package/session/useSessionConversation.d.ts +26 -3
- package/session/useSessionConversation.d.ts.map +1 -1
- package/session/useSessionConversation.js +51 -6
- package/session/useSessionConversation.js.map +1 -1
- package/session/useSessionPageFlow.d.ts.map +1 -1
- package/session/useSessionPageFlow.js +1 -0
- package/session/useSessionPageFlow.js.map +1 -1
- package/session/useSessionPanel.d.ts +20 -0
- package/session/useSessionPanel.d.ts.map +1 -1
- package/session/useSessionPanel.js +13 -0
- package/session/useSessionPanel.js.map +1 -1
- package/session/useSessionRailViews.d.ts +13 -1
- package/session/useSessionRailViews.d.ts.map +1 -1
- package/session/useSessionRailViews.js +5 -3
- package/session/useSessionRailViews.js.map +1 -1
- package/src/composer/SessionComposer.tsx +76 -7
- package/src/composer/__tests__/SessionComposer-editing.test.tsx +128 -0
- package/src/execution/ArtifactApplyButton.tsx +79 -0
- package/src/execution/ArtifactContentBody.tsx +255 -0
- package/src/execution/ArtifactDocument.tsx +344 -0
- package/src/execution/ArtifactPreviewModal.tsx +49 -415
- package/src/execution/ArtifactRow.tsx +165 -0
- package/src/execution/ArtifactsWidget.tsx +24 -33
- package/src/execution/FileChangeProgressBar.tsx +121 -0
- package/src/execution/FileChangesView.tsx +18 -4
- package/src/execution/FileReviewAtoms.tsx +89 -0
- package/src/execution/FileReviewCard.tsx +57 -90
- package/src/execution/MessageEntry.tsx +0 -62
- package/src/execution/MessageThread.tsx +29 -15
- package/src/execution/PlanArtifactCard.tsx +130 -52
- package/src/execution/PlanCompletionCard.tsx +5 -5
- package/src/execution/PlanStreamingCard.tsx +15 -11
- package/src/execution/__tests__/ArtifactContentBody.test.tsx +131 -0
- package/src/execution/__tests__/ArtifactDocument.test.tsx +100 -0
- package/src/execution/__tests__/ArtifactPreviewModal.test.tsx +6 -6
- package/src/execution/__tests__/ArtifactRow.test.tsx +139 -0
- package/src/execution/__tests__/ArtifactsWidget.test.tsx +78 -0
- package/src/execution/__tests__/FileChangeProgressBar.test.tsx +125 -0
- package/src/execution/__tests__/FileReviewCard.test.tsx +66 -7
- package/src/execution/__tests__/MessageThread.test.tsx +1 -1
- package/src/execution/__tests__/PlanArtifactCard.test.tsx +52 -18
- package/src/execution/__tests__/PlanCompletionCard.test.tsx +2 -2
- package/src/execution/__tests__/PlanStreamingCard.test.tsx +11 -4
- package/src/execution/__tests__/buildThreadItems-plan-completion.test.ts +104 -8
- package/src/execution/__tests__/message-entry.test.tsx +56 -39
- package/src/execution/__tests__/useArtifactCopy.test.tsx +90 -0
- package/src/execution/__tests__/useArtifactDownload.test.tsx +2 -0
- package/src/execution/__tests__/useArtifactInspection.test.tsx +151 -0
- package/src/execution/__tests__/useCreateAgentExecution.test.tsx +35 -0
- package/src/execution/index.ts +20 -2
- package/src/execution/use-build-from-plan-hotkey.ts +1 -1
- package/src/execution/useArtifactContent.ts +7 -0
- package/src/execution/useArtifactCopy.ts +109 -0
- package/src/execution/useArtifactDownload.ts +17 -5
- package/src/execution/useArtifactInspection.ts +252 -0
- package/src/execution/useCreateAgentExecution.ts +17 -3
- package/src/index.ts +17 -2
- package/src/internal/MermaidDiagram.tsx +164 -0
- package/src/internal/__tests__/a11y/mermaid-theme.a11y.test.tsx +122 -0
- package/src/internal/__tests__/markdown-components.test.tsx +93 -1
- package/src/internal/__tests__/mermaid-diagram.test.tsx +282 -0
- package/src/internal/file-tree/FileTreeNode.tsx +13 -2
- package/src/internal/markdown-components.tsx +36 -1
- package/src/internal/mermaid-loader.ts +44 -0
- package/src/internal/mermaid-theme-css.ts +178 -0
- package/src/internal/slug.ts +10 -6
- package/src/library/__tests__/detect-plan-artifact.test.ts +21 -0
- package/src/library/detect-plan-artifact.ts +32 -10
- package/src/library/index.ts +2 -0
- package/src/session/PlanEditor.tsx +1 -1
- package/src/session/SessionViewer.tsx +227 -51
- package/src/session/__tests__/PlanEditor.test.tsx +4 -4
- package/src/session/__tests__/PlanStreamingDocument.test.tsx +1 -1
- package/src/session/__tests__/SessionViewer-artifactTabs.test.tsx +210 -0
- package/src/session/__tests__/SessionViewer-editResubmit.test.tsx +233 -0
- package/src/session/__tests__/SessionViewer-fileReviewDock.test.tsx +57 -0
- package/src/session/__tests__/useSessionArtifacts.test.ts +57 -0
- package/src/session/__tests__/useSessionConversation.test.tsx +216 -1
- package/src/session/__tests__/useSessionPanel.test.ts +70 -1
- package/src/session/artifact-document.ts +23 -0
- package/src/session/facets/ArtifactsTab.tsx +66 -18
- package/src/session/facets/__tests__/ArtifactsTab.test.tsx +111 -47
- package/src/session/index.ts +5 -1
- package/src/session/plan-document.ts +14 -3
- package/src/session/usePlanDraft.ts +1 -1
- package/src/session/useSessionArtifacts.ts +16 -5
- package/src/session/useSessionConversation.ts +80 -10
- package/src/session/useSessionPageFlow.ts +1 -0
- package/src/session/useSessionPanel.ts +41 -0
- package/src/session/useSessionRailViews.tsx +21 -1
- package/src/workspace/EditorTabs.tsx +38 -9
- package/src/workspace/ExplorerTree.tsx +10 -4
- package/src/workspace/FileViewer.tsx +27 -6
- package/src/workspace/WorkspaceContentSearch.tsx +44 -20
- package/src/workspace/WorkspaceEditor.tsx +19 -16
- package/src/workspace/WorkspaceFileSearch.tsx +51 -28
- package/src/workspace/WorkspaceSurface.tsx +106 -48
- package/src/workspace/__tests__/EditorTabs.test.tsx +4 -2
- package/src/workspace/__tests__/ExplorerTree.test.tsx +52 -0
- package/src/workspace/__tests__/FileViewer.test.tsx +18 -0
- package/src/workspace/__tests__/WorkspaceContentSearch.test.tsx +38 -5
- package/src/workspace/__tests__/WorkspaceEditor-initialPanel.test.tsx +19 -0
- package/src/workspace/__tests__/WorkspaceFileSearch.test.tsx +27 -6
- package/src/workspace/__tests__/WorkspaceSurface.test.tsx +70 -0
- package/src/workspace/__tests__/a11y/harness.tsx +140 -0
- package/src/workspace/__tests__/a11y/mock-capabilities.ts +138 -0
- package/src/workspace/__tests__/a11y/workspace-editor.a11y.test.tsx +65 -0
- package/src/workspace/__tests__/a11y/workspace-explorer-search.a11y.test.tsx +112 -0
- package/src/workspace/__tests__/a11y/workspace-viewer-tabs.a11y.test.tsx +69 -0
- package/styles.css +1 -1
- package/workspace/EditorTabs.d.ts +21 -3
- package/workspace/EditorTabs.d.ts.map +1 -1
- package/workspace/EditorTabs.js +18 -6
- package/workspace/EditorTabs.js.map +1 -1
- package/workspace/ExplorerTree.js +8 -4
- package/workspace/ExplorerTree.js.map +1 -1
- package/workspace/FileViewer.d.ts.map +1 -1
- package/workspace/FileViewer.js +19 -8
- package/workspace/FileViewer.js.map +1 -1
- package/workspace/WorkspaceContentSearch.d.ts.map +1 -1
- package/workspace/WorkspaceContentSearch.js +23 -2
- package/workspace/WorkspaceContentSearch.js.map +1 -1
- package/workspace/WorkspaceEditor.d.ts.map +1 -1
- package/workspace/WorkspaceEditor.js +8 -10
- package/workspace/WorkspaceEditor.js.map +1 -1
- package/workspace/WorkspaceFileSearch.d.ts.map +1 -1
- package/workspace/WorkspaceFileSearch.js +23 -3
- package/workspace/WorkspaceFileSearch.js.map +1 -1
- package/workspace/WorkspaceSurface.d.ts.map +1 -1
- package/workspace/WorkspaceSurface.js +54 -18
- package/workspace/WorkspaceSurface.js.map +1 -1
- package/execution/ArtifactCard.d.ts +0 -81
- package/execution/ArtifactCard.d.ts.map +0 -1
- package/execution/ArtifactCard.js +0 -130
- package/execution/ArtifactCard.js.map +0 -1
- package/src/execution/ArtifactCard.tsx +0 -320
|
@@ -1,24 +1,42 @@
|
|
|
1
1
|
import type { AgentExecution } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/api_pb";
|
|
2
2
|
import type { ExecutionArtifact } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/artifact_pb";
|
|
3
3
|
/**
|
|
4
|
-
* The session's current plan: the published
|
|
5
|
-
* recent execution that produced one, plus the execution it belongs
|
|
6
|
-
* (artifact content RPCs are execution-scoped).
|
|
4
|
+
* The session's current plan: the published plan artifact (a `*.plan.md` FILE)
|
|
5
|
+
* of the most recent execution that produced one, plus the execution it belongs
|
|
6
|
+
* to (artifact content RPCs are execution-scoped).
|
|
7
7
|
*/
|
|
8
8
|
export interface SessionPlan {
|
|
9
9
|
/** ID of the execution that published the plan. */
|
|
10
10
|
readonly executionId: string;
|
|
11
|
-
/** The published
|
|
11
|
+
/** The published plan artifact (`*.plan.md`). */
|
|
12
12
|
readonly artifact: ExecutionArtifact;
|
|
13
13
|
}
|
|
14
14
|
/**
|
|
15
|
-
*
|
|
16
|
-
*
|
|
15
|
+
* Legacy plan filename. Detection-only: {@link isPlanArtifactName} still
|
|
16
|
+
* accepts this exact name so plans published before named artifacts existed
|
|
17
|
+
* keep working. The runner never freshly emits it (a titleless plan falls back
|
|
18
|
+
* to a bare `<id>.plan.md`). Kept in sync with the runner's
|
|
19
|
+
* `PLAN_ARTIFACT_NAME` (shared/plan-artifact.ts).
|
|
17
20
|
*/
|
|
18
21
|
export declare const PLAN_ARTIFACT_NAME = "plan.md";
|
|
19
22
|
/**
|
|
20
|
-
*
|
|
21
|
-
*
|
|
23
|
+
* Suffix every named plan artifact carries (`<slug>_<id>.plan.md`, or a bare
|
|
24
|
+
* `<id>.plan.md` when untitled). The runner derives the slug from the plan's
|
|
25
|
+
* title and the `<id>` from its content hash; detection keys on this suffix.
|
|
26
|
+
* Kept in sync with the runner's `PLAN_ARTIFACT_SUFFIX` (shared/plan-artifact.ts)
|
|
27
|
+
* — the runner and browser SDK have disjoint module graphs, so the constant is
|
|
28
|
+
* duplicated by design, mirroring {@link PLAN_ARTIFACT_NAME}.
|
|
29
|
+
*/
|
|
30
|
+
export declare const PLAN_ARTIFACT_SUFFIX = ".plan.md";
|
|
31
|
+
/**
|
|
32
|
+
* Returns `true` when a filename is a plan's: the legacy exact `plan.md`, or
|
|
33
|
+
* any `*.plan.md`. Accepting the legacy name keeps plans published before named
|
|
34
|
+
* artifacts existed detectable.
|
|
35
|
+
*/
|
|
36
|
+
export declare function isPlanArtifactName(name: string): boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Returns `true` when an artifact is the published plan: a FILE artifact whose
|
|
39
|
+
* name satisfies {@link isPlanArtifactName}.
|
|
22
40
|
*
|
|
23
41
|
* Detection is by convention — the same lightweight, content-free approach used
|
|
24
42
|
* for skill packages ({@link isSkillPackage}) — so the UI never needs an extra
|
|
@@ -36,7 +54,7 @@ export declare function isPlanArtifact(artifact: ExecutionArtifact): boolean;
|
|
|
36
54
|
export declare function findPlanArtifact(execution: AgentExecution | null | undefined): ExecutionArtifact | undefined;
|
|
37
55
|
/**
|
|
38
56
|
* Finds the session's LATEST plan across all executions — the plan the panel's
|
|
39
|
-
* plan document tab edits and "Build
|
|
57
|
+
* plan document tab edits and the "Build" action implements. Executions are
|
|
40
58
|
* scanned newest-first (the array is chronological), mirroring the thread's
|
|
41
59
|
* latest-plan-owns-the-build-action rule so every surface agrees on which
|
|
42
60
|
* plan is current.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"detect-plan-artifact.d.ts","sourceRoot":"","sources":["../../src/library/detect-plan-artifact.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6DAA6D,CAAC;AAClG,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kEAAkE,CAAC;AAG1G;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAC1B,mDAAmD;IACnD,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,
|
|
1
|
+
{"version":3,"file":"detect-plan-artifact.d.ts","sourceRoot":"","sources":["../../src/library/detect-plan-artifact.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6DAA6D,CAAC;AAClG,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kEAAkE,CAAC;AAG1G;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAC1B,mDAAmD;IACnD,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,iDAAiD;IACjD,QAAQ,CAAC,QAAQ,EAAE,iBAAiB,CAAC;CACtC;AAED;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,YAAY,CAAC;AAE5C;;;;;;;GAOG;AACH,eAAO,MAAM,oBAAoB,aAAa,CAAC;AAE/C;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAExD;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,iBAAiB,GAAG,OAAO,CAKnE;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,SAAS,EAAE,cAAc,GAAG,IAAI,GAAG,SAAS,GAC3C,iBAAiB,GAAG,SAAS,CAO/B;AAED;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CACnC,UAAU,EAAE,SAAS,cAAc,EAAE,GACpC,WAAW,GAAG,SAAS,CAUzB"}
|
|
@@ -1,12 +1,32 @@
|
|
|
1
1
|
import { ExecutionArtifactKind } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/enum_pb";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
3
|
+
* Legacy plan filename. Detection-only: {@link isPlanArtifactName} still
|
|
4
|
+
* accepts this exact name so plans published before named artifacts existed
|
|
5
|
+
* keep working. The runner never freshly emits it (a titleless plan falls back
|
|
6
|
+
* to a bare `<id>.plan.md`). Kept in sync with the runner's
|
|
7
|
+
* `PLAN_ARTIFACT_NAME` (shared/plan-artifact.ts).
|
|
5
8
|
*/
|
|
6
9
|
export const PLAN_ARTIFACT_NAME = "plan.md";
|
|
7
10
|
/**
|
|
8
|
-
*
|
|
9
|
-
*
|
|
11
|
+
* Suffix every named plan artifact carries (`<slug>_<id>.plan.md`, or a bare
|
|
12
|
+
* `<id>.plan.md` when untitled). The runner derives the slug from the plan's
|
|
13
|
+
* title and the `<id>` from its content hash; detection keys on this suffix.
|
|
14
|
+
* Kept in sync with the runner's `PLAN_ARTIFACT_SUFFIX` (shared/plan-artifact.ts)
|
|
15
|
+
* — the runner and browser SDK have disjoint module graphs, so the constant is
|
|
16
|
+
* duplicated by design, mirroring {@link PLAN_ARTIFACT_NAME}.
|
|
17
|
+
*/
|
|
18
|
+
export const PLAN_ARTIFACT_SUFFIX = ".plan.md";
|
|
19
|
+
/**
|
|
20
|
+
* Returns `true` when a filename is a plan's: the legacy exact `plan.md`, or
|
|
21
|
+
* any `*.plan.md`. Accepting the legacy name keeps plans published before named
|
|
22
|
+
* artifacts existed detectable.
|
|
23
|
+
*/
|
|
24
|
+
export function isPlanArtifactName(name) {
|
|
25
|
+
return name === PLAN_ARTIFACT_NAME || name.endsWith(PLAN_ARTIFACT_SUFFIX);
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Returns `true` when an artifact is the published plan: a FILE artifact whose
|
|
29
|
+
* name satisfies {@link isPlanArtifactName}.
|
|
10
30
|
*
|
|
11
31
|
* Detection is by convention — the same lightweight, content-free approach used
|
|
12
32
|
* for skill packages ({@link isSkillPackage}) — so the UI never needs an extra
|
|
@@ -15,7 +35,7 @@ export const PLAN_ARTIFACT_NAME = "plan.md";
|
|
|
15
35
|
*/
|
|
16
36
|
export function isPlanArtifact(artifact) {
|
|
17
37
|
return (artifact.kind === ExecutionArtifactKind.FILE &&
|
|
18
|
-
artifact.name
|
|
38
|
+
isPlanArtifactName(artifact.name));
|
|
19
39
|
}
|
|
20
40
|
/**
|
|
21
41
|
* Finds the plan artifact on a completed execution, or `undefined` when none
|
|
@@ -36,7 +56,7 @@ export function findPlanArtifact(execution) {
|
|
|
36
56
|
}
|
|
37
57
|
/**
|
|
38
58
|
* Finds the session's LATEST plan across all executions — the plan the panel's
|
|
39
|
-
* plan document tab edits and "Build
|
|
59
|
+
* plan document tab edits and the "Build" action implements. Executions are
|
|
40
60
|
* scanned newest-first (the array is chronological), mirroring the thread's
|
|
41
61
|
* latest-plan-owns-the-build-action rule so every surface agrees on which
|
|
42
62
|
* plan is current.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"detect-plan-artifact.js","sourceRoot":"","sources":["../../src/library/detect-plan-artifact.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,qBAAqB,EAAE,MAAM,8DAA8D,CAAC;AAcrG
|
|
1
|
+
{"version":3,"file":"detect-plan-artifact.js","sourceRoot":"","sources":["../../src/library/detect-plan-artifact.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,qBAAqB,EAAE,MAAM,8DAA8D,CAAC;AAcrG;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,SAAS,CAAC;AAE5C;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,UAAU,CAAC;AAE/C;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAAC,IAAY;IAC7C,OAAO,IAAI,KAAK,kBAAkB,IAAI,IAAI,CAAC,QAAQ,CAAC,oBAAoB,CAAC,CAAC;AAC5E,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,cAAc,CAAC,QAA2B;IACxD,OAAO,CACL,QAAQ,CAAC,IAAI,KAAK,qBAAqB,CAAC,IAAI;QAC5C,kBAAkB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAClC,CAAC;AACJ,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,gBAAgB,CAC9B,SAA4C;IAE5C,MAAM,SAAS,GAAG,SAAS,EAAE,MAAM,EAAE,SAAS,CAAC;IAC/C,IAAI,CAAC,SAAS,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,SAAS,CAAC;IAC3D,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;QAC/C,IAAI,cAAc,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;YAAE,OAAO,SAAS,CAAC,CAAC,CAAC,CAAC;IACxD,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,qBAAqB,CACnC,UAAqC;IAErC,KAAK,IAAI,CAAC,GAAG,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;QAChD,MAAM,SAAS,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;QAChC,MAAM,QAAQ,GAAG,gBAAgB,CAAC,SAAS,CAAC,CAAC;QAC7C,MAAM,WAAW,GAAG,SAAS,CAAC,QAAQ,EAAE,EAAE,CAAC;QAC3C,IAAI,QAAQ,IAAI,WAAW,EAAE,CAAC;YAC5B,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,CAAC;QACnC,CAAC;IACH,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
package/library/index.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export type { StigmerResourceKind, StigmerResourceDetection, } from "./detect-st
|
|
|
8
8
|
export { useDetectStigmerResource } from "./useDetectStigmerResource.js";
|
|
9
9
|
export { isSkillPackage, detectSkillPackage, } from "./detect-skill-package.js";
|
|
10
10
|
export type { SkillPackageDetection } from "./detect-skill-package.js";
|
|
11
|
-
export { isPlanArtifact, findPlanArtifact, findLatestSessionPlan, PLAN_ARTIFACT_NAME, } from "./detect-plan-artifact.js";
|
|
11
|
+
export { isPlanArtifact, isPlanArtifactName, findPlanArtifact, findLatestSessionPlan, PLAN_ARTIFACT_NAME, PLAN_ARTIFACT_SUFFIX, } from "./detect-plan-artifact.js";
|
|
12
12
|
export type { SessionPlan } from "./detect-plan-artifact.js";
|
|
13
13
|
export { findStreamingPlan } from "./detect-streaming-plan.js";
|
|
14
14
|
export type { StreamingPlan } from "./detect-streaming-plan.js";
|
package/library/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/library/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,EACzB,kBAAkB,EAClB,qBAAqB,GACtB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,YAAY,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,YAAY,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAErE,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,YAAY,EACV,mBAAmB,EACnB,wBAAwB,GACzB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAEzE,OAAO,EACL,cAAc,EACd,kBAAkB,GACnB,MAAM,2BAA2B,CAAC;AACnC,YAAY,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAEvE,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,qBAAqB,EACrB,kBAAkB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/library/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,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AAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,YAAY,EACV,sBAAsB,EACtB,mBAAmB,EACnB,eAAe,GAChB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,YAAY,EACV,wBAAwB,EACxB,uBAAuB,GACxB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,YAAY,EACV,YAAY,EACZ,aAAa,EACb,uBAAuB,GACxB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,YAAY,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AAE3E,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC9E,YAAY,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAEvE,OAAO,EACL,yBAAyB,EACzB,0BAA0B,EAC1B,eAAe,EACf,gBAAgB,GACjB,MAAM,uBAAuB,CAAC;AAC/B,YAAY,EACV,gCAAgC,EAChC,qBAAqB,GACtB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,YAAY,EAAE,8BAA8B,EAAE,MAAM,gCAAgC,CAAC;AAErF,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,YAAY,EACV,sBAAsB,EACtB,yBAAyB,GAC1B,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAC7E,YAAY,EAAE,+BAA+B,EAAE,MAAM,iCAAiC,CAAC"}
|
package/library/index.js
CHANGED
|
@@ -4,7 +4,7 @@ export { ResourceCountCard } from "./ResourceCountCard.js";
|
|
|
4
4
|
export { detectStigmerResource } from "./detect-stigmer-resource.js";
|
|
5
5
|
export { useDetectStigmerResource } from "./useDetectStigmerResource.js";
|
|
6
6
|
export { isSkillPackage, detectSkillPackage, } from "./detect-skill-package.js";
|
|
7
|
-
export { isPlanArtifact, findPlanArtifact, findLatestSessionPlan, PLAN_ARTIFACT_NAME, } from "./detect-plan-artifact.js";
|
|
7
|
+
export { isPlanArtifact, isPlanArtifactName, findPlanArtifact, findLatestSessionPlan, PLAN_ARTIFACT_NAME, PLAN_ARTIFACT_SUFFIX, } from "./detect-plan-artifact.js";
|
|
8
8
|
export { findStreamingPlan } from "./detect-streaming-plan.js";
|
|
9
9
|
export { useDetectSkillPackage } from "./useDetectSkillPackage.js";
|
|
10
10
|
export { parseResourceYaml } from "./parse-resource-yaml.js";
|
package/library/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/library/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,EACzB,kBAAkB,EAClB,qBAAqB,GACtB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAG/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAG3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAMrE,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAEzE,OAAO,EACL,cAAc,EACd,kBAAkB,GACnB,MAAM,2BAA2B,CAAC;AAGnC,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,qBAAqB,EACrB,kBAAkB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/library/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,EACzB,kBAAkB,EAClB,qBAAqB,GACtB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAG/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,wB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|
2
2
|
"name": "@stigmer/react",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.4",
|
|
4
4
|
"description": "React provider and client hook for the Stigmer platform SDK",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@bufbuild/protovalidate": "^1.1.1",
|
|
39
39
|
"@dagrejs/dagre": "^1.1.4",
|
|
40
|
-
"@stigmer/theme": "3.1.
|
|
40
|
+
"@stigmer/theme": "3.1.4",
|
|
41
41
|
"diff": "^8.0.3",
|
|
42
42
|
"fflate": "^0.8.2",
|
|
43
43
|
"hast-util-to-jsx-runtime": "^2.3.6",
|
|
@@ -60,12 +60,13 @@
|
|
|
60
60
|
"@codemirror/state": "^6.0.0",
|
|
61
61
|
"@codemirror/view": "^6.0.0",
|
|
62
62
|
"@lezer/highlight": "^1.0.0",
|
|
63
|
-
"@stigmer/protos": "3.1.
|
|
64
|
-
"@stigmer/sdk": "3.1.
|
|
63
|
+
"@stigmer/protos": "3.1.4",
|
|
64
|
+
"@stigmer/sdk": "3.1.4",
|
|
65
65
|
"@tanstack/react-table": "^8.20.0",
|
|
66
66
|
"@xyflow/react": "^12.0.0",
|
|
67
67
|
"elkjs": "^0.9.0",
|
|
68
68
|
"lucide-react": ">=0.400.0",
|
|
69
|
+
"mermaid": "^11.0.0",
|
|
69
70
|
"react": "^19.0.0",
|
|
70
71
|
"react-dom": "^19.0.0",
|
|
71
72
|
"react-virtuoso": "^4.0.0",
|
package/session/PlanEditor.js
CHANGED
|
@@ -56,7 +56,7 @@ export function PlanEditor({ plan, draft, onBuildFromPlan, buildDisabled, readOn
|
|
|
56
56
|
}
|
|
57
57
|
return (_jsxs(PlanEditorFrame, { onKeyDown: handleKeyDown, children: [_jsxs("div", { className: "flex min-w-0 flex-wrap items-center gap-2", children: [_jsxs("div", { className: "inline-flex shrink-0 rounded-md bg-muted p-0.5", role: "tablist", "aria-label": "Plan view", children: [_jsx(ViewTab, { active: activeView === "rendered", onClick: () => setView("rendered"), label: "Rendered" }), _jsx(ViewTab, { active: activeView === "source", onClick: () => setView("source"), label: "Source" }), activeDraft !== undefined && (_jsx(ViewTab, { active: activeView === "edit", onClick: () => setView("edit"), label: "Edit", disabled: !canEdit, title: !canEdit
|
|
58
58
|
? "This plan is too large to edit in place — download it instead."
|
|
59
|
-
: undefined }))] }), _jsx("span", { className: "text-[0.65rem] tabular-nums text-muted-foreground-faint", children: formatArtifactSize(plan.artifact.sizeBytes) }), _jsxs("div", { className: "ml-auto flex min-w-0 flex-wrap items-center gap-3", children: [activeDraft?.isEdited && (_jsxs("span", { className: "inline-flex items-center gap-2", children: [_jsx("span", { className: "rounded-md bg-accent px-1.5 py-0.5 text-[0.65rem] font-medium text-muted-foreground", children: "Edited" }), _jsx("button", { type: "button", onClick: () => activeDraft.setDraft(null), className: "rounded text-[0.65rem] font-medium text-muted-foreground underline-offset-2 hover:text-foreground hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", children: "Revert" })] })), readOnly ? (_jsx("span", { role: "status", className: "rounded-md bg-muted px-2 py-0.5 text-[0.65rem] font-medium text-muted-foreground", children: "Superseded by a newer plan" })) : (onBuildFromPlan && (_jsxs("button", { type: "button", disabled: buildDisabled, onClick: onBuildFromPlan, className: cn("inline-flex min-w-0 items-center gap-1.5 rounded-md px-3 py-1.5", "text-xs font-medium transition-colors", "bg-primary text-primary-foreground hover:bg-primary-hover", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", "disabled:pointer-events-none disabled:opacity-50"), children: [_jsx(ImplementIcon, {}), _jsx("span", { className: "truncate", children: buildDisabled ? "Starting build…" : "Build
|
|
59
|
+
: undefined }))] }), _jsx("span", { className: "text-[0.65rem] tabular-nums text-muted-foreground-faint", children: formatArtifactSize(plan.artifact.sizeBytes) }), _jsxs("div", { className: "ml-auto flex min-w-0 flex-wrap items-center gap-3", children: [activeDraft?.isEdited && (_jsxs("span", { className: "inline-flex items-center gap-2", children: [_jsx("span", { className: "rounded-md bg-accent px-1.5 py-0.5 text-[0.65rem] font-medium text-muted-foreground", children: "Edited" }), _jsx("button", { type: "button", onClick: () => activeDraft.setDraft(null), className: "rounded text-[0.65rem] font-medium text-muted-foreground underline-offset-2 hover:text-foreground hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", children: "Revert" })] })), readOnly ? (_jsx("span", { role: "status", className: "rounded-md bg-muted px-2 py-0.5 text-[0.65rem] font-medium text-muted-foreground", children: "Superseded by a newer plan" })) : (onBuildFromPlan && (_jsxs("button", { type: "button", disabled: buildDisabled, onClick: onBuildFromPlan, className: cn("inline-flex min-w-0 items-center gap-1.5 rounded-md px-3 py-1.5", "text-xs font-medium transition-colors", "bg-primary text-primary-foreground hover:bg-primary-hover", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", "disabled:pointer-events-none disabled:opacity-50"), children: [_jsx(ImplementIcon, {}), _jsx("span", { className: "truncate", children: buildDisabled ? "Starting build…" : "Build" })] })))] })] }), activeView === "rendered" && _jsx(RenderedPlan, { text: effectiveText }), activeView === "source" && (_jsx("pre", { className: "overflow-x-auto rounded-md bg-muted p-3 font-mono text-xs whitespace-pre-wrap text-foreground", children: effectiveText })), activeView === "edit" && activeDraft !== undefined && (_jsx("textarea", { value: effectiveText, onChange: (e) => activeDraft.setDraft(e.target.value), "aria-label": "Edit plan", spellCheck: false, rows: 28, className: cn("w-full flex-1 resize-y rounded-md border border-border bg-card p-3", "font-mono text-xs leading-relaxed text-foreground", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring") })), isTruncated && (_jsx("p", { role: "status", className: "text-[0.65rem] text-muted-foreground", children: "Preview truncated \u2014 download the artifact for the full plan." }))] }));
|
|
60
60
|
}
|
|
61
61
|
/**
|
|
62
62
|
* The editor-area envelope: a centered document column so the plan reads as a
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlanEditor.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nD;;;;;;OAMG;IACH,QAAQ,CAAC,wBAAwB,CAAC,EAAE,wBAAwB,CAAC;IAC7D;;;;;;;OAOG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,kBAAkB,CAAC;IAC5C;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,eAAe,CAAC;IACpC;;;;OAIG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,SAAS,CAAC;IACnC;;;;;OAKG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,SAAS,CAAC;IAChC,iEAAiE;IACjE,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,mBAAmB,KAAK,IAAI,CAAC;IAC3D,qDAAqD;IACrD,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,wBAAgB,aAAa,CAAC,EAC5B,SAAS,EACT,GAAG,EACH,gBAAgB,EAChB,YAAmB,EACnB,WAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,wBAAwB,EACxB,aAAa,EACb,QAAuB,EACvB,aAAa,EACb,UAAU,EACV,SAAS,EACT,SAAS,GACV,EAAE,kBAAkB,2CA0TpB"}
|
package/session/SessionViewer.js
CHANGED
|
@@ -13,12 +13,14 @@ import { useWorkspaceEditors, isVirtualEntryId } from "../internal/store/index.j
|
|
|
13
13
|
import { ThreadSelectionContext } from "../execution/ThreadSelectionContext.js";
|
|
14
14
|
import { useSelectedThreadItem } from "../execution/useThreadSelection.js";
|
|
15
15
|
import { MessageThread } from "../execution/MessageThread.js";
|
|
16
|
+
import { FileChangeProgressBar } from "../execution/FileChangeProgressBar.js";
|
|
16
17
|
import { FileReviewDock } from "../execution/FileReviewDock.js";
|
|
18
|
+
import { FilePathContext, } from "../execution/FilePathContext.js";
|
|
17
19
|
import { ThreadSkeleton } from "../execution/ThreadSkeleton.js";
|
|
18
20
|
import { SessionComposer } from "../composer/index.js";
|
|
19
21
|
import { SecretFlowErrorGuide, isSecretFlowError } from "../error/index.js";
|
|
20
22
|
import { useStigmer } from "../hooks.js";
|
|
21
|
-
import {
|
|
23
|
+
import { findLatestSessionPlan, findPlanArtifact, } from "../library/detect-plan-artifact.js";
|
|
22
24
|
import { findStreamingPlan } from "../library/detect-streaming-plan.js";
|
|
23
25
|
import { useSessionPageFlow } from "./useSessionPageFlow.js";
|
|
24
26
|
import { useOpenFileChange } from "./useOpenFileChange.js";
|
|
@@ -26,27 +28,33 @@ import { usePlanDraft, planDraftKey } from "./usePlanDraft.js";
|
|
|
26
28
|
import { PlanEditor } from "./PlanEditor.js";
|
|
27
29
|
import { PlanStreamingDocument } from "./PlanStreamingDocument.js";
|
|
28
30
|
import { PLAN_DOCUMENT_ENTRY_ID, PLAN_DOCUMENT_PATH } from "./plan-document.js";
|
|
31
|
+
import { ARTIFACT_DOCUMENT_ENTRY_ID } from "./artifact-document.js";
|
|
32
|
+
import { ArtifactDocument } from "../execution/ArtifactDocument.js";
|
|
29
33
|
import { useSessionRailViews } from "./useSessionRailViews.js";
|
|
30
34
|
import { useSessionPanel } from "./useSessionPanel.js";
|
|
31
35
|
import { SessionPanelChip } from "./SessionPanelChip.js";
|
|
32
36
|
import { useSessionWriteBacks } from "./useSessionWriteBacks.js";
|
|
33
|
-
import { useSessionArtifacts } from "./useSessionArtifacts.js";
|
|
37
|
+
import { useSessionArtifacts, artifactKey, } from "./useSessionArtifacts.js";
|
|
34
38
|
import { ExecutionPhase } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/enum_pb";
|
|
35
39
|
/**
|
|
36
40
|
* Where the approved plan mounts in the implement execution's workspace —
|
|
37
41
|
* the harnesses' standard attachment inputs directory, where the runner's
|
|
38
42
|
* implement-plan directive points the agent (shared/implement-plan-prompt.ts).
|
|
39
|
-
* Attaching
|
|
40
|
-
* the user approved (including in-place
|
|
43
|
+
* Attaching under the plan's own filename (e.g. `feature-x_a1b2c3d4.plan.md`) is what
|
|
44
|
+
* makes the build implement the document the user approved (including in-place
|
|
45
|
+
* edits), not a paraphrase from memory; the runner detects it by the plan
|
|
46
|
+
* filename convention (`isPlanArtifactName`), so the exact name is free to vary.
|
|
41
47
|
*/
|
|
42
|
-
|
|
48
|
+
function approvedPlanMountPath(planFileName) {
|
|
49
|
+
return `.stigmer/inputs/${planFileName}`;
|
|
50
|
+
}
|
|
43
51
|
/**
|
|
44
52
|
* The build turn's user message — a short human-readable label, NOT the
|
|
45
53
|
* implement instruction. The agent-facing instruction is runner-injected
|
|
46
|
-
* (keyed off `executionConfig.buildFromPlan`)
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
54
|
+
* (keyed off `executionConfig.buildFromPlan`). The thread hides the turn
|
|
55
|
+
* entirely from the same flag (the plan card above it is the visible cause);
|
|
56
|
+
* this label exists for surfaces without that treatment (the CLI, execution
|
|
57
|
+
* history, older clients), which show it as-is.
|
|
50
58
|
*/
|
|
51
59
|
const BUILD_FROM_PLAN_MESSAGE = "Build from plan";
|
|
52
60
|
/**
|
|
@@ -205,7 +213,7 @@ export function SessionViewer({ sessionId, org, gitHubConnection, enableGitHub =
|
|
|
205
213
|
setInteractionMode("agent");
|
|
206
214
|
setPlanAttachFailed(false);
|
|
207
215
|
// `buildFromPlan` (not message text) is what tells the runner to inject
|
|
208
|
-
// the implement directive and the thread to
|
|
216
|
+
// the implement directive and the thread to hide the turn's message —
|
|
209
217
|
// with or without the attachment (the runner picks the directive variant).
|
|
210
218
|
const submitImplementTurn = (attachments) => {
|
|
211
219
|
composerRef.current?.submit(BUILD_FROM_PLAN_MESSAGE, {
|
|
@@ -224,19 +232,22 @@ export function SessionViewer({ sessionId, org, gitHubConnection, enableGitHub =
|
|
|
224
232
|
// execution. The published artifact itself stays immutable; the approved
|
|
225
233
|
// copy is a new input on the build turn (edit-as-input provenance).
|
|
226
234
|
setIsBuildingFromPlan(true);
|
|
235
|
+
// The approved copy keeps the published plan's filename, so the mounted
|
|
236
|
+
// input, the download, and the plan card all agree on one name.
|
|
237
|
+
const planFileName = sessionPlan.artifact.name;
|
|
227
238
|
void (async () => {
|
|
228
239
|
try {
|
|
229
240
|
const approvedText = planDraft.readDraft() ?? (await fetchPlanText(stigmer, sessionPlan));
|
|
230
241
|
const response = await stigmer.agentExecution.uploadAttachment(create(UploadAttachmentRequestSchema, {
|
|
231
|
-
filename:
|
|
242
|
+
filename: planFileName,
|
|
232
243
|
content: new TextEncoder().encode(approvedText),
|
|
233
244
|
contentType: "text/markdown",
|
|
234
245
|
}));
|
|
235
246
|
submitImplementTurn([
|
|
236
247
|
{
|
|
237
|
-
filename:
|
|
248
|
+
filename: planFileName,
|
|
238
249
|
storageKey: response.storageKey,
|
|
239
|
-
mountPath:
|
|
250
|
+
mountPath: approvedPlanMountPath(planFileName),
|
|
240
251
|
contentType: "text/markdown",
|
|
241
252
|
},
|
|
242
253
|
]);
|
|
@@ -262,6 +273,20 @@ export function SessionViewer({ sessionId, org, gitHubConnection, enableGitHub =
|
|
|
262
273
|
: executionId);
|
|
263
274
|
panel.openPlanDocument();
|
|
264
275
|
}, [sessionPlan, panel.openPlanDocument]);
|
|
276
|
+
// "Open artifact" (an Artifacts-facet row) → an editor-pane document tab.
|
|
277
|
+
// Writing the editors store re-renders only the panel subtree (which
|
|
278
|
+
// subscribes), never this streaming column. Plan artifacts are routed to the
|
|
279
|
+
// plan tab upstream (in ArtifactsTab), so they never reach here.
|
|
280
|
+
const handleOpenArtifact = useCallback((entry) => {
|
|
281
|
+
panel.openArtifact(entry.artifact);
|
|
282
|
+
}, [panel.openArtifact]);
|
|
283
|
+
// Double-click an artifact row → pin its tab (the leading single click already
|
|
284
|
+
// opened the preview via `handleOpenArtifact`). Mirrors the file tree's
|
|
285
|
+
// preview/pin split; plan artifacts are routed to the plan tab upstream (in
|
|
286
|
+
// ArtifactsTab) and never reach here.
|
|
287
|
+
const handleActivateArtifact = useCallback((entry) => {
|
|
288
|
+
panel.pinArtifact(entry.artifact);
|
|
289
|
+
}, [panel.pinArtifact]);
|
|
265
290
|
// Open a transcript tool-call file path in the panel's read-only editor.
|
|
266
291
|
// Resolves the (possibly absolute / subdir-prefixed) path to a
|
|
267
292
|
// repo/root-relative selection the editor can fetch; on a definite hit it
|
|
@@ -285,7 +310,7 @@ export function SessionViewer({ sessionId, org, gitHubConnection, enableGitHub =
|
|
|
285
310
|
if (!conv.session && !conv.isLoading) {
|
|
286
311
|
return _jsx(SessionStarting, {});
|
|
287
312
|
}
|
|
288
|
-
return (_jsxs("div", { className: cn("relative flex h-full w-full flex-col", className), children: [_jsxs("div", { className: "absolute top-2 right-6 z-10 flex items-center gap-2", children: [headerActions, _jsx(SessionPanelChip, { isOpen: panel.isOpen, onToggle: panel.isOpen ? panel.closePanel : panel.openPanel, badgeCount: writeBackCount + artifactCount })] }), _jsx(ThreadSelectionContext.Provider, { value: selectionStore, children: _jsx(ResizableSplit, { resizablePane: "primary", collapsedPane: panel.isOpen ? "none" : "secondary", defaultSize: 420, minSize: 320, maxSize: 640, storageKey: "stgm-session-chat-width", responsiveCollapse: panel.isOpen ? "primary" : "none", ariaLabel: "Resize chat panel", className: "min-h-0 flex-1", primary: _jsx(ConversationColumn, { flow: flow, modelId: modelId, setModelId: setModelId, interactionMode: interactionMode, setInteractionMode: setInteractionMode, composerRef: composerRef, org: org, gitHubConnection: gitHubConnection, enableGitHub: enableGitHub, enableLocal: enableLocal, onBrowseLocalFolder: onBrowseLocalFolder, onBuildFromPlan: handleBuildFromPlan, onOpenPlan: handleOpenPlan, isBuildingFromPlan: isBuildingFromPlan, planAttachFailed: planAttachFailed, onDismissPlanAttachFailed: () => setPlanAttachFailed(false), onFilePathClick: handleTranscriptFilePathClick, isEndUser: isEndUser }), secondary: panel.isOpen ? (_jsx(SessionPanelRegion, { flow: flow, org: org, panel: panel, accessSlot: accessSlot, onApplied: onApplied, onImplementPlan: handleBuildFromPlan, implementPlanDisabled: !conv.canSendFollowUp || isBuildingFromPlan, sessionPlan: sessionPlan, streamingPlan: streamingPlan, planDraft: planDraft, openPlanExecutionId: openPlanExecutionId, onOpenPlan: handleOpenPlan, enableLocal: enableLocal, onBrowseLocalFolder: onBrowseLocalFolder, workspaceFileLister: workspaceFileLister, workspaceFileReader: workspaceFileReader, workspaceContentSearcher: workspaceContentSearcher, isEndUser: isEndUser })) : null }) })] }));
|
|
313
|
+
return (_jsxs("div", { className: cn("relative flex h-full w-full flex-col", className), children: [_jsxs("div", { className: "absolute top-2 right-6 z-10 flex items-center gap-2", children: [headerActions, _jsx(SessionPanelChip, { isOpen: panel.isOpen, onToggle: panel.isOpen ? panel.closePanel : panel.openPanel, badgeCount: writeBackCount + artifactCount })] }), _jsx(ThreadSelectionContext.Provider, { value: selectionStore, children: _jsx(ResizableSplit, { resizablePane: "primary", collapsedPane: panel.isOpen ? "none" : "secondary", defaultSize: 420, minSize: 320, maxSize: 640, storageKey: "stgm-session-chat-width", responsiveCollapse: panel.isOpen ? "primary" : "none", ariaLabel: "Resize chat panel", className: "min-h-0 flex-1", primary: _jsx(ConversationColumn, { flow: flow, modelId: modelId, setModelId: setModelId, interactionMode: interactionMode, setInteractionMode: setInteractionMode, composerRef: composerRef, org: org, gitHubConnection: gitHubConnection, enableGitHub: enableGitHub, enableLocal: enableLocal, onBrowseLocalFolder: onBrowseLocalFolder, onBuildFromPlan: handleBuildFromPlan, onOpenPlan: handleOpenPlan, isBuildingFromPlan: isBuildingFromPlan, planAttachFailed: planAttachFailed, onDismissPlanAttachFailed: () => setPlanAttachFailed(false), onFilePathClick: handleTranscriptFilePathClick, isEndUser: isEndUser }), secondary: panel.isOpen ? (_jsx(SessionPanelRegion, { flow: flow, org: org, panel: panel, accessSlot: accessSlot, onApplied: onApplied, onImplementPlan: handleBuildFromPlan, implementPlanDisabled: !conv.canSendFollowUp || isBuildingFromPlan, sessionPlan: sessionPlan, streamingPlan: streamingPlan, planDraft: planDraft, openPlanExecutionId: openPlanExecutionId, onOpenPlan: handleOpenPlan, onOpenArtifact: handleOpenArtifact, onActivateArtifact: handleActivateArtifact, enableLocal: enableLocal, onBrowseLocalFolder: onBrowseLocalFolder, workspaceFileLister: workspaceFileLister, workspaceFileReader: workspaceFileReader, workspaceContentSearcher: workspaceContentSearcher, isEndUser: isEndUser })) : null }) })] }));
|
|
289
314
|
}
|
|
290
315
|
const ConversationColumn = memo(function ConversationColumn({ flow, modelId, setModelId, interactionMode, setInteractionMode, composerRef, org, gitHubConnection, enableGitHub, enableLocal, onBrowseLocalFolder, onBuildFromPlan, onOpenPlan, isBuildingFromPlan, planAttachFailed, onDismissPlanAttachFailed, onFilePathClick, isEndUser, }) {
|
|
291
316
|
const { conv } = flow;
|
|
@@ -305,21 +330,55 @@ const ConversationColumn = memo(function ConversationColumn({ flow, modelId, set
|
|
|
305
330
|
const handleStop = useCallback(() => {
|
|
306
331
|
void conv.stop();
|
|
307
332
|
}, [conv.stop]);
|
|
308
|
-
// Edit-and-resubmit: stop the in-flight turn
|
|
309
|
-
// the original text
|
|
310
|
-
//
|
|
311
|
-
//
|
|
312
|
-
//
|
|
333
|
+
// Edit-and-resubmit: stop the in-flight turn, pre-fill the composer with
|
|
334
|
+
// the original text, and remember which execution is being edited. The
|
|
335
|
+
// append-only execution log is never rewritten — submitting while editing
|
|
336
|
+
// creates a NEW execution that carries `supersedesExecutionId`, and the
|
|
337
|
+
// conversation read model hides the superseded turn so the edited message
|
|
338
|
+
// replaces the original in place (Cursor-style, stigmer/stigmer#181).
|
|
339
|
+
//
|
|
340
|
+
// The editing state is explicit (banner + cancel in the composer) so the
|
|
341
|
+
// supersede link only attaches when the user actually resubmits the edit.
|
|
342
|
+
// Cancelling drops the link — a subsequent unrelated message appends
|
|
343
|
+
// normally without hiding any history.
|
|
344
|
+
const [editingExecutionId, setEditingExecutionId] = useState(null);
|
|
345
|
+
const activeExecutionId = conv.activeStreamExecution?.metadata?.id ?? null;
|
|
313
346
|
const handleEditMessage = useCallback((text) => {
|
|
314
347
|
void conv.stop();
|
|
348
|
+
setEditingExecutionId(activeExecutionId);
|
|
315
349
|
composerRef.current?.setMessage(text);
|
|
316
350
|
composerRef.current?.focus();
|
|
317
|
-
}, [conv.stop, composerRef]);
|
|
318
|
-
|
|
351
|
+
}, [conv.stop, activeExecutionId, composerRef]);
|
|
352
|
+
const handleCancelEdit = useCallback(() => {
|
|
353
|
+
setEditingExecutionId(null);
|
|
354
|
+
composerRef.current?.setMessage("");
|
|
355
|
+
}, [composerRef]);
|
|
356
|
+
// Submit wrapper that attaches the supersede link while editing, then
|
|
357
|
+
// exits editing mode. Ordinary (non-editing) submits pass through as-is.
|
|
358
|
+
const handleComposerSubmit = useCallback((message, modelName, context) => {
|
|
359
|
+
void flow.handleSubmit(message, modelName, editingExecutionId
|
|
360
|
+
? { ...context, supersedesExecutionId: editingExecutionId }
|
|
361
|
+
: context);
|
|
362
|
+
setEditingExecutionId(null);
|
|
363
|
+
}, [flow.handleSubmit, editingExecutionId]);
|
|
364
|
+
// The composer-docked FileReviewDock sits OUTSIDE MessageThread, so the
|
|
365
|
+
// thread's own FilePathContext provider does not reach it. This provider
|
|
366
|
+
// gives the dock's file list the same path resolution and click routing
|
|
367
|
+
// (open in the panel's viewer; GitHub/copy fallback) as the transcript —
|
|
368
|
+
// one click behavior for a path everywhere in the session. Memoized so the
|
|
369
|
+
// dock's memoized cards are not invalidated by unrelated renders (DD-010).
|
|
370
|
+
const dockFilePathCtx = useMemo(() => ({
|
|
371
|
+
workspaceEntries: conv.workspaceEntries ?? [],
|
|
372
|
+
onFilePathClick,
|
|
373
|
+
}), [conv.workspaceEntries, onFilePathClick]);
|
|
374
|
+
return (_jsxs("div", { className: "flex h-full min-w-0 flex-col", children: [_jsx(MessageThread, { executions: conv.completedExecutions, activeStreamExecution: conv.activeStreamExecution, pendingUserMessage: conv.pendingUserMessage, pendingMessageFailed: !!conv.sendError && !!conv.pendingUserMessage, onRetrySend: conv.retryLastSend, onRetryExecution: onRetryExecution, onApprovalSubmit: flow.submitApproval, submittingApprovalIds: conv.submittingApprovalIds, approvalErrors: conv.approvalErrors, showFileReviewRecords: true, onEditMessage: conv.isStoppable ? handleEditMessage : undefined, workspaceEntries: conv.workspaceEntries, onFilePathClick: onFilePathClick, sandboxWorkspaceRoot: flow.sandboxWorkspaceRoot, onBuildFromPlan: onBuildFromPlan, onOpenPlan: onOpenPlan, org: org, planActionsDisabled: !conv.canSendFollowUp || isBuildingFromPlan, planBuildPending: isBuildingFromPlan, contentColumn: "center", className: "flex-1" }), _jsxs("div", { className: CONVERSATION_COLUMN_CLASS, children: [planAttachFailed && (_jsx(PlanAttachFailedNotice, { onDismiss: onDismissPlanAttachFailed })), conv.isReconnecting && _jsx(ReconnectingIndicator, {}), conv.connectTimedOut && (_jsx(ConnectTimedOutBanner, { onRetry: conv.reconnectStream })), conv.isSlow && !conv.connectTimedOut && _jsx(SlowIndicator, {}), conv.streamError && (_jsx(StreamErrorBanner, { error: conv.streamError, onReconnect: conv.reconnectStream })), sendError && _jsx(SendErrorBanner, { error: sendError }), flow.autoApproveAll && (_jsx(AutoApproveIndicator, { onTurnOff: () => flow.setAutoApproveAll(false) })), _jsxs(FilePathContext.Provider, { value: dockFilePathCtx, children: [_jsx(FileChangeProgressBar, { progress: conv.fileChangeProgress }), _jsx(FileReviewDock, { changeSets: conv.fileChangeSets, onSubmit: conv.submitFileDecision, submittingDecisionKeys: conv.submittingFileDecisionKeys, decisionErrors: conv.fileDecisionErrors })] }), _jsx(SessionComposer, { ref: composerRef, onSubmit: handleComposerSubmit, isSubmitting: conv.isSending, disabled: !conv.canSendFollowUp, onStop: conv.isStoppable ? handleStop : undefined, isStopping: conv.isStopping, isEditing: editingExecutionId != null, onCancelEdit: handleCancelEdit, org: org, harness: flow.harness, defaultModelId: modelId, onModelChange: setModelId, interactionMode: interactionMode, onInteractionModeChange: setInteractionMode, showInteractionModePicker: true, workspace: flow.workspace, gitHubConnection: gitHubConnection, enableGitHub: enableGitHub, enableLocal: enableLocal, onBrowseLocalFolder: onBrowseLocalFolder, agentRef: flow.agentRef, onAgentRefChange: flow.setAgentRef, onAgentResolutionChange: flow.setResolution, isDefaultAgent: flow.isDefaultAgent, lockAgent: isEndUser, mcpServerUsages: isEndUser ? undefined : flow.mcpServerUsages, onMcpServerUsagesChange: isEndUser ? undefined : flow.setMcpServerUsages, skillRefs: isEndUser ? undefined : flow.skillRefs, onSkillRefsChange: isEndUser ? undefined : flow.setSkillRefs, sessionVariables: isEndUser ? undefined : flow.sessionVariables, className: "px-4 py-3" })] })] }));
|
|
319
375
|
});
|
|
320
|
-
function SessionPanelRegion({ flow, org, panel, accessSlot, onApplied, onImplementPlan, implementPlanDisabled, sessionPlan, streamingPlan, planDraft, openPlanExecutionId, onOpenPlan, enableLocal, onBrowseLocalFolder, workspaceFileLister, workspaceFileReader, workspaceContentSearcher, isEndUser, }) {
|
|
376
|
+
function SessionPanelRegion({ flow, org, panel, accessSlot, onApplied, onImplementPlan, implementPlanDisabled, sessionPlan, streamingPlan, planDraft, openPlanExecutionId, onOpenPlan, onOpenArtifact, onActivateArtifact, enableLocal, onBrowseLocalFolder, workspaceFileLister, workspaceFileReader, workspaceContentSearcher, isEndUser, }) {
|
|
321
377
|
const selectedItem = useSelectedThreadItem();
|
|
322
378
|
const { editors, activeKey, activeFile, reveal } = useWorkspaceEditors(panel.editorsStore);
|
|
379
|
+
// Session artifacts, deduped by identity — the source both the Artifacts
|
|
380
|
+
// rail-view badge and the open artifact document tabs resolve against.
|
|
381
|
+
const { artifacts: sessionArtifacts } = useSessionArtifacts(flow.allExecutions);
|
|
323
382
|
// Honor a pending jump-to-line reveal only while it targets the active editor
|
|
324
383
|
// (an EditorReveal is structurally a RevealTarget). Switching tabs changes
|
|
325
384
|
// activeKey, so a stale reveal for another tab is naturally ignored.
|
|
@@ -360,14 +419,12 @@ function SessionPanelRegion({ flow, org, panel, accessSlot, onApplied, onImpleme
|
|
|
360
419
|
// tab and its turn then ended without publishing, with no earlier plan to
|
|
361
420
|
// fall back to.
|
|
362
421
|
const openPlanIsLatest = openPlan?.executionId === sessionPlan?.executionId;
|
|
363
|
-
const
|
|
364
|
-
return
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
},
|
|
370
|
-
];
|
|
422
|
+
const planVirtualDocument = useMemo(() => {
|
|
423
|
+
return {
|
|
424
|
+
entryId: PLAN_DOCUMENT_ENTRY_ID,
|
|
425
|
+
path: PLAN_DOCUMENT_PATH,
|
|
426
|
+
content: streamingPlan ? (_jsx(PlanStreamingDocument, { displayText: streamingPlan.displayText }, `streaming-${streamingPlan.executionId}`)) : openPlan ? (_jsx(PlanEditor, { plan: openPlan, draft: openPlanIsLatest ? planDraft : undefined, onBuildFromPlan: openPlanIsLatest ? onImplementPlan : undefined, buildDisabled: implementPlanDisabled, readOnly: !openPlanIsLatest }, planDraftKey(openPlan))) : (_jsx(PlanUnavailableNotice, {})),
|
|
427
|
+
};
|
|
371
428
|
}, [
|
|
372
429
|
streamingPlan,
|
|
373
430
|
openPlan,
|
|
@@ -376,6 +433,30 @@ function SessionPanelRegion({ flow, org, panel, accessSlot, onApplied, onImpleme
|
|
|
376
433
|
onImplementPlan,
|
|
377
434
|
implementPlanDisabled,
|
|
378
435
|
]);
|
|
436
|
+
// The open artifact document tabs (the artifact virtual-document FAMILY).
|
|
437
|
+
// Built in a SEPARATE memo from the plan doc so artifact-tab churn never
|
|
438
|
+
// recreates the plan doc (and vice versa). Bounded to what is actually open:
|
|
439
|
+
// one document per editor whose entry id is the artifact family's, resolved
|
|
440
|
+
// back to its `SessionArtifactEntry` by the same `artifactKey` used to open
|
|
441
|
+
// it (single source of truth for artifact identity). Only the ACTIVE doc's
|
|
442
|
+
// `content` is mounted by the surface, so building these elements is cheap;
|
|
443
|
+
// keying on `contentHash` remounts a tab whose artifact was overwritten by a
|
|
444
|
+
// later execution. A tab whose artifact no longer exists degrades to an
|
|
445
|
+
// honest notice rather than vanishing.
|
|
446
|
+
const artifactByKey = useMemo(() => new Map(sessionArtifacts.map((entry) => [artifactKey(entry.artifact), entry])), [sessionArtifacts]);
|
|
447
|
+
const artifactVirtualDocuments = useMemo(() => {
|
|
448
|
+
return editors
|
|
449
|
+
.filter((editor) => editor.entryId === ARTIFACT_DOCUMENT_ENTRY_ID)
|
|
450
|
+
.map((editor) => {
|
|
451
|
+
const entry = artifactByKey.get(editor.path);
|
|
452
|
+
return {
|
|
453
|
+
entryId: ARTIFACT_DOCUMENT_ENTRY_ID,
|
|
454
|
+
path: editor.path,
|
|
455
|
+
content: entry ? (_jsx(ArtifactDocument, { artifact: entry.artifact, executionId: entry.executionId, org: org, isTerminal: entry.isTerminal, onApplied: onApplied }, entry.artifact.contentHash || editor.path)) : (_jsx(ArtifactUnavailableNotice, {})),
|
|
456
|
+
};
|
|
457
|
+
});
|
|
458
|
+
}, [editors, artifactByKey, org, onApplied]);
|
|
459
|
+
const virtualDocuments = useMemo(() => [planVirtualDocument, ...artifactVirtualDocuments], [planVirtualDocument, artifactVirtualDocuments]);
|
|
379
460
|
const handleRemoveAgent = useCallback(() => {
|
|
380
461
|
flow.setAgentRef(null);
|
|
381
462
|
flow.setResolution(null);
|
|
@@ -421,6 +502,8 @@ function SessionPanelRegion({ flow, org, panel, accessSlot, onApplied, onImpleme
|
|
|
421
502
|
onApplied,
|
|
422
503
|
onImplementPlan,
|
|
423
504
|
onOpenPlan,
|
|
505
|
+
onOpenArtifact,
|
|
506
|
+
onActivateArtifact,
|
|
424
507
|
});
|
|
425
508
|
// Explorer-footer folder attach (desktop only — needs the native picker).
|
|
426
509
|
// Same wiring the retired Workspace tab used.
|
|
@@ -460,6 +543,15 @@ function AutoApproveIndicator({ onTurnOff }) {
|
|
|
460
543
|
function PlanUnavailableNotice() {
|
|
461
544
|
return (_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 turn ended before a plan was completed." }), _jsx("p", { className: "text-xs text-muted-foreground", children: "Any partial plan text remains in the conversation." })] }));
|
|
462
545
|
}
|
|
546
|
+
/**
|
|
547
|
+
* Shown in an artifact document tab whose artifact is no longer among the
|
|
548
|
+
* session's outputs (an edge only reachable if the executions backing the tab
|
|
549
|
+
* changed underneath it). The tab stays closable; the content is honest rather
|
|
550
|
+
* than blank.
|
|
551
|
+
*/
|
|
552
|
+
function ArtifactUnavailableNotice() {
|
|
553
|
+
return (_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 artifact is no longer available." }), _jsx("p", { className: "text-xs text-muted-foreground", children: "It may have been replaced by a newer version of this session." })] }));
|
|
554
|
+
}
|
|
463
555
|
/**
|
|
464
556
|
* Non-blocking notice for a build that fell back to message-only implement
|
|
465
557
|
* (the approved plan.md could not be uploaded/attached). The build itself
|