@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.
Files changed (285) hide show
  1. package/composer/SessionComposer.d.ts +37 -5
  2. package/composer/SessionComposer.d.ts.map +1 -1
  3. package/composer/SessionComposer.js +13 -5
  4. package/composer/SessionComposer.js.map +1 -1
  5. package/execution/ArtifactApplyButton.d.ts +25 -0
  6. package/execution/ArtifactApplyButton.d.ts.map +1 -0
  7. package/execution/ArtifactApplyButton.js +21 -0
  8. package/execution/ArtifactApplyButton.js.map +1 -0
  9. package/execution/ArtifactContentBody.d.ts +36 -0
  10. package/execution/ArtifactContentBody.d.ts.map +1 -0
  11. package/execution/ArtifactContentBody.js +62 -0
  12. package/execution/ArtifactContentBody.js.map +1 -0
  13. package/execution/ArtifactDocument.d.ts +48 -0
  14. package/execution/ArtifactDocument.d.ts.map +1 -0
  15. package/execution/ArtifactDocument.js +89 -0
  16. package/execution/ArtifactDocument.js.map +1 -0
  17. package/execution/ArtifactPreviewModal.d.ts +9 -9
  18. package/execution/ArtifactPreviewModal.d.ts.map +1 -1
  19. package/execution/ArtifactPreviewModal.js +18 -145
  20. package/execution/ArtifactPreviewModal.js.map +1 -1
  21. package/execution/ArtifactRow.d.ts +49 -0
  22. package/execution/ArtifactRow.d.ts.map +1 -0
  23. package/execution/ArtifactRow.js +56 -0
  24. package/execution/ArtifactRow.js.map +1 -0
  25. package/execution/ArtifactsWidget.d.ts +6 -9
  26. package/execution/ArtifactsWidget.d.ts.map +1 -1
  27. package/execution/ArtifactsWidget.js +15 -19
  28. package/execution/ArtifactsWidget.js.map +1 -1
  29. package/execution/FileChangeProgressBar.d.ts +47 -0
  30. package/execution/FileChangeProgressBar.d.ts.map +1 -0
  31. package/execution/FileChangeProgressBar.js +49 -0
  32. package/execution/FileChangeProgressBar.js.map +1 -0
  33. package/execution/FileChangesView.d.ts.map +1 -1
  34. package/execution/FileChangesView.js +19 -4
  35. package/execution/FileChangesView.js.map +1 -1
  36. package/execution/FileReviewAtoms.d.ts +27 -0
  37. package/execution/FileReviewAtoms.d.ts.map +1 -0
  38. package/execution/FileReviewAtoms.js +64 -0
  39. package/execution/FileReviewAtoms.js.map +1 -0
  40. package/execution/FileReviewCard.d.ts +2 -2
  41. package/execution/FileReviewCard.d.ts.map +1 -1
  42. package/execution/FileReviewCard.js +32 -62
  43. package/execution/FileReviewCard.js.map +1 -1
  44. package/execution/MessageEntry.d.ts +0 -9
  45. package/execution/MessageEntry.d.ts.map +1 -1
  46. package/execution/MessageEntry.js +1 -11
  47. package/execution/MessageEntry.js.map +1 -1
  48. package/execution/MessageThread.d.ts +3 -4
  49. package/execution/MessageThread.d.ts.map +1 -1
  50. package/execution/MessageThread.js +25 -11
  51. package/execution/MessageThread.js.map +1 -1
  52. package/execution/PlanArtifactCard.d.ts +16 -10
  53. package/execution/PlanArtifactCard.d.ts.map +1 -1
  54. package/execution/PlanArtifactCard.js +31 -7
  55. package/execution/PlanArtifactCard.js.map +1 -1
  56. package/execution/PlanCompletionCard.d.ts +4 -4
  57. package/execution/PlanCompletionCard.d.ts.map +1 -1
  58. package/execution/PlanCompletionCard.js +4 -4
  59. package/execution/PlanCompletionCard.js.map +1 -1
  60. package/execution/PlanStreamingCard.d.ts +7 -2
  61. package/execution/PlanStreamingCard.d.ts.map +1 -1
  62. package/execution/PlanStreamingCard.js +11 -6
  63. package/execution/PlanStreamingCard.js.map +1 -1
  64. package/execution/index.d.ts +12 -2
  65. package/execution/index.d.ts.map +1 -1
  66. package/execution/index.js +6 -1
  67. package/execution/index.js.map +1 -1
  68. package/execution/use-build-from-plan-hotkey.d.ts +1 -1
  69. package/execution/use-build-from-plan-hotkey.js +1 -1
  70. package/execution/useArtifactContent.d.ts +6 -1
  71. package/execution/useArtifactContent.d.ts.map +1 -1
  72. package/execution/useArtifactContent.js +7 -2
  73. package/execution/useArtifactContent.js.map +1 -1
  74. package/execution/useArtifactCopy.d.ts +51 -0
  75. package/execution/useArtifactCopy.d.ts.map +1 -0
  76. package/execution/useArtifactCopy.js +75 -0
  77. package/execution/useArtifactCopy.js.map +1 -0
  78. package/execution/useArtifactDownload.d.ts.map +1 -1
  79. package/execution/useArtifactDownload.js +17 -5
  80. package/execution/useArtifactDownload.js.map +1 -1
  81. package/execution/useArtifactInspection.d.ts +85 -0
  82. package/execution/useArtifactInspection.d.ts.map +1 -0
  83. package/execution/useArtifactInspection.js +143 -0
  84. package/execution/useArtifactInspection.js.map +1 -0
  85. package/execution/useCreateAgentExecution.d.ts +16 -3
  86. package/execution/useCreateAgentExecution.d.ts.map +1 -1
  87. package/execution/useCreateAgentExecution.js +1 -0
  88. package/execution/useCreateAgentExecution.js.map +1 -1
  89. package/index.d.ts +4 -4
  90. package/index.d.ts.map +1 -1
  91. package/index.js +3 -3
  92. package/index.js.map +1 -1
  93. package/internal/MermaidDiagram.d.ts +47 -0
  94. package/internal/MermaidDiagram.d.ts.map +1 -0
  95. package/internal/MermaidDiagram.js +118 -0
  96. package/internal/MermaidDiagram.js.map +1 -0
  97. package/internal/file-tree/FileTreeNode.d.ts.map +1 -1
  98. package/internal/file-tree/FileTreeNode.js +2 -2
  99. package/internal/file-tree/FileTreeNode.js.map +1 -1
  100. package/internal/markdown-components.d.ts.map +1 -1
  101. package/internal/markdown-components.js +34 -0
  102. package/internal/markdown-components.js.map +1 -1
  103. package/internal/mermaid-loader.d.ts +26 -0
  104. package/internal/mermaid-loader.d.ts.map +1 -0
  105. package/internal/mermaid-loader.js +34 -0
  106. package/internal/mermaid-loader.js.map +1 -0
  107. package/internal/mermaid-theme-css.d.ts +41 -0
  108. package/internal/mermaid-theme-css.d.ts.map +1 -0
  109. package/internal/mermaid-theme-css.js +179 -0
  110. package/internal/mermaid-theme-css.js.map +1 -0
  111. package/internal/slug.d.ts +9 -5
  112. package/internal/slug.d.ts.map +1 -1
  113. package/internal/slug.js +10 -6
  114. package/internal/slug.js.map +1 -1
  115. package/library/detect-plan-artifact.d.ts +27 -9
  116. package/library/detect-plan-artifact.d.ts.map +1 -1
  117. package/library/detect-plan-artifact.js +26 -6
  118. package/library/detect-plan-artifact.js.map +1 -1
  119. package/library/index.d.ts +1 -1
  120. package/library/index.d.ts.map +1 -1
  121. package/library/index.js +1 -1
  122. package/library/index.js.map +1 -1
  123. package/package.json +5 -4
  124. package/session/PlanEditor.js +1 -1
  125. package/session/PlanEditor.js.map +1 -1
  126. package/session/SessionViewer.d.ts.map +1 -1
  127. package/session/SessionViewer.js +122 -30
  128. package/session/SessionViewer.js.map +1 -1
  129. package/session/artifact-document.d.ts +13 -0
  130. package/session/artifact-document.d.ts.map +1 -0
  131. package/session/artifact-document.js +22 -0
  132. package/session/artifact-document.js.map +1 -0
  133. package/session/facets/ArtifactsTab.d.ts +30 -4
  134. package/session/facets/ArtifactsTab.d.ts.map +1 -1
  135. package/session/facets/ArtifactsTab.js +32 -10
  136. package/session/facets/ArtifactsTab.js.map +1 -1
  137. package/session/index.d.ts +2 -1
  138. package/session/index.d.ts.map +1 -1
  139. package/session/index.js +4 -1
  140. package/session/index.js.map +1 -1
  141. package/session/plan-document.d.ts +14 -2
  142. package/session/plan-document.d.ts.map +1 -1
  143. package/session/plan-document.js +14 -3
  144. package/session/plan-document.js.map +1 -1
  145. package/session/usePlanDraft.d.ts +1 -1
  146. package/session/useSessionArtifacts.d.ts +17 -0
  147. package/session/useSessionArtifacts.d.ts.map +1 -1
  148. package/session/useSessionArtifacts.js +16 -5
  149. package/session/useSessionArtifacts.js.map +1 -1
  150. package/session/useSessionConversation.d.ts +26 -3
  151. package/session/useSessionConversation.d.ts.map +1 -1
  152. package/session/useSessionConversation.js +51 -6
  153. package/session/useSessionConversation.js.map +1 -1
  154. package/session/useSessionPageFlow.d.ts.map +1 -1
  155. package/session/useSessionPageFlow.js +1 -0
  156. package/session/useSessionPageFlow.js.map +1 -1
  157. package/session/useSessionPanel.d.ts +20 -0
  158. package/session/useSessionPanel.d.ts.map +1 -1
  159. package/session/useSessionPanel.js +13 -0
  160. package/session/useSessionPanel.js.map +1 -1
  161. package/session/useSessionRailViews.d.ts +13 -1
  162. package/session/useSessionRailViews.d.ts.map +1 -1
  163. package/session/useSessionRailViews.js +5 -3
  164. package/session/useSessionRailViews.js.map +1 -1
  165. package/src/composer/SessionComposer.tsx +76 -7
  166. package/src/composer/__tests__/SessionComposer-editing.test.tsx +128 -0
  167. package/src/execution/ArtifactApplyButton.tsx +79 -0
  168. package/src/execution/ArtifactContentBody.tsx +255 -0
  169. package/src/execution/ArtifactDocument.tsx +344 -0
  170. package/src/execution/ArtifactPreviewModal.tsx +49 -415
  171. package/src/execution/ArtifactRow.tsx +165 -0
  172. package/src/execution/ArtifactsWidget.tsx +24 -33
  173. package/src/execution/FileChangeProgressBar.tsx +121 -0
  174. package/src/execution/FileChangesView.tsx +18 -4
  175. package/src/execution/FileReviewAtoms.tsx +89 -0
  176. package/src/execution/FileReviewCard.tsx +57 -90
  177. package/src/execution/MessageEntry.tsx +0 -62
  178. package/src/execution/MessageThread.tsx +29 -15
  179. package/src/execution/PlanArtifactCard.tsx +130 -52
  180. package/src/execution/PlanCompletionCard.tsx +5 -5
  181. package/src/execution/PlanStreamingCard.tsx +15 -11
  182. package/src/execution/__tests__/ArtifactContentBody.test.tsx +131 -0
  183. package/src/execution/__tests__/ArtifactDocument.test.tsx +100 -0
  184. package/src/execution/__tests__/ArtifactPreviewModal.test.tsx +6 -6
  185. package/src/execution/__tests__/ArtifactRow.test.tsx +139 -0
  186. package/src/execution/__tests__/ArtifactsWidget.test.tsx +78 -0
  187. package/src/execution/__tests__/FileChangeProgressBar.test.tsx +125 -0
  188. package/src/execution/__tests__/FileReviewCard.test.tsx +66 -7
  189. package/src/execution/__tests__/MessageThread.test.tsx +1 -1
  190. package/src/execution/__tests__/PlanArtifactCard.test.tsx +52 -18
  191. package/src/execution/__tests__/PlanCompletionCard.test.tsx +2 -2
  192. package/src/execution/__tests__/PlanStreamingCard.test.tsx +11 -4
  193. package/src/execution/__tests__/buildThreadItems-plan-completion.test.ts +104 -8
  194. package/src/execution/__tests__/message-entry.test.tsx +56 -39
  195. package/src/execution/__tests__/useArtifactCopy.test.tsx +90 -0
  196. package/src/execution/__tests__/useArtifactDownload.test.tsx +2 -0
  197. package/src/execution/__tests__/useArtifactInspection.test.tsx +151 -0
  198. package/src/execution/__tests__/useCreateAgentExecution.test.tsx +35 -0
  199. package/src/execution/index.ts +20 -2
  200. package/src/execution/use-build-from-plan-hotkey.ts +1 -1
  201. package/src/execution/useArtifactContent.ts +7 -0
  202. package/src/execution/useArtifactCopy.ts +109 -0
  203. package/src/execution/useArtifactDownload.ts +17 -5
  204. package/src/execution/useArtifactInspection.ts +252 -0
  205. package/src/execution/useCreateAgentExecution.ts +17 -3
  206. package/src/index.ts +17 -2
  207. package/src/internal/MermaidDiagram.tsx +164 -0
  208. package/src/internal/__tests__/a11y/mermaid-theme.a11y.test.tsx +122 -0
  209. package/src/internal/__tests__/markdown-components.test.tsx +93 -1
  210. package/src/internal/__tests__/mermaid-diagram.test.tsx +282 -0
  211. package/src/internal/file-tree/FileTreeNode.tsx +13 -2
  212. package/src/internal/markdown-components.tsx +36 -1
  213. package/src/internal/mermaid-loader.ts +44 -0
  214. package/src/internal/mermaid-theme-css.ts +178 -0
  215. package/src/internal/slug.ts +10 -6
  216. package/src/library/__tests__/detect-plan-artifact.test.ts +21 -0
  217. package/src/library/detect-plan-artifact.ts +32 -10
  218. package/src/library/index.ts +2 -0
  219. package/src/session/PlanEditor.tsx +1 -1
  220. package/src/session/SessionViewer.tsx +227 -51
  221. package/src/session/__tests__/PlanEditor.test.tsx +4 -4
  222. package/src/session/__tests__/PlanStreamingDocument.test.tsx +1 -1
  223. package/src/session/__tests__/SessionViewer-artifactTabs.test.tsx +210 -0
  224. package/src/session/__tests__/SessionViewer-editResubmit.test.tsx +233 -0
  225. package/src/session/__tests__/SessionViewer-fileReviewDock.test.tsx +57 -0
  226. package/src/session/__tests__/useSessionArtifacts.test.ts +57 -0
  227. package/src/session/__tests__/useSessionConversation.test.tsx +216 -1
  228. package/src/session/__tests__/useSessionPanel.test.ts +70 -1
  229. package/src/session/artifact-document.ts +23 -0
  230. package/src/session/facets/ArtifactsTab.tsx +66 -18
  231. package/src/session/facets/__tests__/ArtifactsTab.test.tsx +111 -47
  232. package/src/session/index.ts +5 -1
  233. package/src/session/plan-document.ts +14 -3
  234. package/src/session/usePlanDraft.ts +1 -1
  235. package/src/session/useSessionArtifacts.ts +16 -5
  236. package/src/session/useSessionConversation.ts +80 -10
  237. package/src/session/useSessionPageFlow.ts +1 -0
  238. package/src/session/useSessionPanel.ts +41 -0
  239. package/src/session/useSessionRailViews.tsx +21 -1
  240. package/src/workspace/EditorTabs.tsx +38 -9
  241. package/src/workspace/ExplorerTree.tsx +10 -4
  242. package/src/workspace/FileViewer.tsx +27 -6
  243. package/src/workspace/WorkspaceContentSearch.tsx +44 -20
  244. package/src/workspace/WorkspaceEditor.tsx +19 -16
  245. package/src/workspace/WorkspaceFileSearch.tsx +51 -28
  246. package/src/workspace/WorkspaceSurface.tsx +106 -48
  247. package/src/workspace/__tests__/EditorTabs.test.tsx +4 -2
  248. package/src/workspace/__tests__/ExplorerTree.test.tsx +52 -0
  249. package/src/workspace/__tests__/FileViewer.test.tsx +18 -0
  250. package/src/workspace/__tests__/WorkspaceContentSearch.test.tsx +38 -5
  251. package/src/workspace/__tests__/WorkspaceEditor-initialPanel.test.tsx +19 -0
  252. package/src/workspace/__tests__/WorkspaceFileSearch.test.tsx +27 -6
  253. package/src/workspace/__tests__/WorkspaceSurface.test.tsx +70 -0
  254. package/src/workspace/__tests__/a11y/harness.tsx +140 -0
  255. package/src/workspace/__tests__/a11y/mock-capabilities.ts +138 -0
  256. package/src/workspace/__tests__/a11y/workspace-editor.a11y.test.tsx +65 -0
  257. package/src/workspace/__tests__/a11y/workspace-explorer-search.a11y.test.tsx +112 -0
  258. package/src/workspace/__tests__/a11y/workspace-viewer-tabs.a11y.test.tsx +69 -0
  259. package/styles.css +1 -1
  260. package/workspace/EditorTabs.d.ts +21 -3
  261. package/workspace/EditorTabs.d.ts.map +1 -1
  262. package/workspace/EditorTabs.js +18 -6
  263. package/workspace/EditorTabs.js.map +1 -1
  264. package/workspace/ExplorerTree.js +8 -4
  265. package/workspace/ExplorerTree.js.map +1 -1
  266. package/workspace/FileViewer.d.ts.map +1 -1
  267. package/workspace/FileViewer.js +19 -8
  268. package/workspace/FileViewer.js.map +1 -1
  269. package/workspace/WorkspaceContentSearch.d.ts.map +1 -1
  270. package/workspace/WorkspaceContentSearch.js +23 -2
  271. package/workspace/WorkspaceContentSearch.js.map +1 -1
  272. package/workspace/WorkspaceEditor.d.ts.map +1 -1
  273. package/workspace/WorkspaceEditor.js +8 -10
  274. package/workspace/WorkspaceEditor.js.map +1 -1
  275. package/workspace/WorkspaceFileSearch.d.ts.map +1 -1
  276. package/workspace/WorkspaceFileSearch.js +23 -3
  277. package/workspace/WorkspaceFileSearch.js.map +1 -1
  278. package/workspace/WorkspaceSurface.d.ts.map +1 -1
  279. package/workspace/WorkspaceSurface.js +54 -18
  280. package/workspace/WorkspaceSurface.js.map +1 -1
  281. package/execution/ArtifactCard.d.ts +0 -81
  282. package/execution/ArtifactCard.d.ts.map +0 -1
  283. package/execution/ArtifactCard.js +0 -130
  284. package/execution/ArtifactCard.js.map +0 -1
  285. package/src/execution/ArtifactCard.tsx +0 -320
@@ -0,0 +1,89 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { cn } from "@stigmer/theme";
4
+ import { useArtifactInspection } from "./useArtifactInspection.js";
5
+ import { ArtifactContentBody } from "./ArtifactContentBody.js";
6
+ import { ArtifactApplyButton } from "./ArtifactApplyButton.js";
7
+ import { useArtifactDownload } from "./useArtifactDownload.js";
8
+ import { formatArtifactSize } from "./artifact-utils.js";
9
+ /**
10
+ * The editor-pane rendering of a single execution artifact — the
11
+ * {@link SurfaceVirtualDocument} counterpart of the {@link ArtifactPreviewModal}
12
+ * popup, mounted as an artifact-family virtual document under
13
+ * {@link ARTIFACT_DOCUMENT_ENTRY_ID}. Opening an artifact from the session
14
+ * panel's Artifacts facet lands here (VS Code "each file is a tab") rather than
15
+ * a modal.
16
+ *
17
+ * Shares the modal's exact behavior and body via the two extracted pieces —
18
+ * {@link useArtifactInspection} (content + detection + apply/push + copy) and
19
+ * {@link ArtifactContentBody} (loading / error / binary / text / directory) —
20
+ * so the two surfaces can never drift. Only the chrome differs: a document
21
+ * toolbar (name + size + detection badge; Copy / Download / Apply) over the
22
+ * shared body, instead of the modal's header + footer action bar.
23
+ *
24
+ * Holds no must-survive local state: the panel region unmounts on collapse and
25
+ * switching tabs remounts the active document, resetting transient apply/copy
26
+ * state exactly as the modal resets on close. A `cacheKey` on the content fetch
27
+ * keeps reopening a recently-viewed artifact instant (DD-014).
28
+ *
29
+ * All visual properties flow through `--stgm-*` tokens (DD-005).
30
+ */
31
+ export function ArtifactDocument({ artifact, executionId, org, isTerminal, onApplied, className, }) {
32
+ // Instant reopen: cache the content per (execution, storage key, version).
33
+ // contentHash is included so a later overwrite of the same path never serves
34
+ // a stale cached body.
35
+ const cacheKey = `artifact-doc:${executionId}:${artifact.storageKey}:${artifact.contentHash}`;
36
+ const inspection = useArtifactInspection(artifact, executionId, org, {
37
+ cacheKey,
38
+ onApplied,
39
+ });
40
+ const { download, isDownloading } = useArtifactDownload(executionId);
41
+ const showCopy = !inspection.isDirectory && inspection.content !== null;
42
+ return (_jsxs("div", { role: "article", "aria-label": `Artifact ${artifact.name}`, className: cn("flex min-h-0 min-w-0 flex-1 flex-col", className), children: [_jsxs("div", { className: "sticky top-0 z-10 flex min-w-0 flex-wrap items-center gap-x-3 gap-y-1.5 border-b border-border bg-background px-4 py-2", children: [_jsx("span", { className: "shrink-0 text-muted-foreground", children: inspection.isDirectory ? _jsx(FolderIcon, {}) : _jsx(FileIcon, {}) }), _jsxs("span", { className: "truncate text-sm font-medium text-foreground", children: [artifact.name, inspection.isDirectory && "/"] }), _jsx("span", { className: "shrink-0 text-[0.65rem] tabular-nums text-muted-foreground-faint", children: formatArtifactSize(artifact.sizeBytes) }), inspection.isDetecting && !inspection.detectionLabel && (_jsx("span", { className: "h-4 w-24 shrink-0 animate-pulse rounded-full bg-muted", "aria-hidden": "true" })), inspection.detectionLabel && (_jsx("span", { className: "inline-flex shrink-0 items-center rounded-full bg-primary-subtle px-2 py-0.5 text-xs font-medium text-primary", children: inspection.detectionLabel })), _jsxs("div", { className: "ml-auto flex min-w-0 flex-wrap items-center gap-3", children: [showCopy && (_jsxs("button", { type: "button", onClick: inspection.copy, "aria-label": inspection.copied ? "Copied to clipboard" : "Copy content", className: cn("inline-flex items-center gap-1.5 text-xs font-medium transition-colors", inspection.copied
43
+ ? "text-success"
44
+ : "text-muted-foreground hover:text-foreground", FOCUS_RING_CLASSES), children: [inspection.copied ? _jsx(CheckIcon, {}) : _jsx(CopyIcon, {}), inspection.copied ? "Copied" : "Copy"] })), _jsxs("button", { type: "button", onClick: () => download(artifact.storageKey, artifact.name), disabled: isDownloading, className: cn("inline-flex items-center gap-1.5 text-xs font-medium text-muted-foreground transition-colors hover:text-foreground disabled:opacity-50", FOCUS_RING_CLASSES), children: [_jsx(DownloadIcon, {}), isDownloading
45
+ ? "Preparing\u2026"
46
+ : inspection.isDirectory
47
+ ? "Download ZIP"
48
+ : "Download"] }), _jsx(ApplyCluster, { isDetected: inspection.isDetected, ctaLabel: inspection.ctaLabel, isTerminal: isTerminal, isApplying: inspection.isApplying, applyResult: inspection.applyResult, applyError: inspection.applyError, onApply: inspection.apply })] })] }), _jsx(ArtifactContentBody, { artifact: artifact, content: inspection.content, contentType: inspection.contentType, isLoading: inspection.isLoading, error: inspection.error, isTruncated: inspection.isTruncated, skillDetection: inspection.skillDetection, className: "min-w-0" }), _jsx("div", { role: "status", "aria-live": "polite", "aria-atomic": "true", className: "sr-only", children: inspection.copied && "Content copied to clipboard" })] }));
49
+ }
50
+ /**
51
+ * The Apply/Push affordance: the terminal-gated {@link ArtifactApplyButton}, or
52
+ * the post-apply success / error-with-retry states. Mirrors the modal action
53
+ * bar's apply cluster so both surfaces read identically.
54
+ */
55
+ function ApplyCluster({ isDetected, ctaLabel, isTerminal, isApplying, applyResult, applyError, onApply, }) {
56
+ if (applyResult) {
57
+ return (_jsxs("span", { className: "inline-flex items-center gap-1.5 text-xs font-medium text-success", children: [_jsx(CheckIcon, {}), "Applied ", "\u00B7", " ", applyResult.name || applyResult.kind] }));
58
+ }
59
+ if (applyError) {
60
+ return (_jsxs("span", { className: "inline-flex items-center gap-2", role: "alert", children: [_jsx("span", { className: "text-xs text-destructive", children: applyError.message }), _jsx("button", { type: "button", onClick: onApply, className: cn("text-xs font-medium text-destructive underline transition-colors hover:text-destructive-muted", FOCUS_RING_CLASSES), children: "Retry" })] }));
61
+ }
62
+ if (isDetected && ctaLabel) {
63
+ return (_jsx("span", { "data-cursor-target": "apply-resource-button", children: _jsx(ArtifactApplyButton, { label: ctaLabel, isTerminal: isTerminal, isApplying: isApplying, onApply: onApply }) }));
64
+ }
65
+ return null;
66
+ }
67
+ // ---------------------------------------------------------------------------
68
+ // Shared style constants
69
+ // ---------------------------------------------------------------------------
70
+ const FOCUS_RING_CLASSES = "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:rounded-sm";
71
+ // ---------------------------------------------------------------------------
72
+ // Inline SVG icons (SDK independence — no lucide dependency)
73
+ // ---------------------------------------------------------------------------
74
+ function FileIcon() {
75
+ return (_jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [_jsx("path", { d: "M9.5 1.5H5C4.17 1.5 3.5 2.17 3.5 3V13C3.5 13.83 4.17 14.5 5 14.5H11C11.83 14.5 12.5 13.83 12.5 13V4.5L9.5 1.5Z" }), _jsx("path", { d: "M9.5 1.5V4.5H12.5" })] }));
76
+ }
77
+ function FolderIcon() {
78
+ return (_jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: _jsx("path", { d: "M14.5 12.5C14.5 13.33 13.83 14 13 14H3C2.17 14 1.5 13.33 1.5 12.5V3.5C1.5 2.67 2.17 2 3 2H6L8 4.5H13C13.83 4.5 14.5 5.17 14.5 6V12.5Z" }) }));
79
+ }
80
+ function CopyIcon() {
81
+ return (_jsxs("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", stroke: "currentColor", strokeWidth: "1.2", strokeLinecap: "round", strokeLinejoin: "round", className: "shrink-0", "aria-hidden": "true", children: [_jsx("rect", { x: "4", y: "4", width: "6.5", height: "6.5", rx: "1" }), _jsx("path", { d: "M8 4V2.5C8 1.95 7.55 1.5 7 1.5H2.5C1.95 1.5 1.5 1.95 1.5 2.5V7C1.5 7.55 1.95 8 2.5 8H4" })] }));
82
+ }
83
+ function DownloadIcon() {
84
+ return (_jsxs("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", className: "shrink-0", "aria-hidden": "true", children: [_jsx("path", { d: "M6 1.5V8.5" }), _jsx("path", { d: "M3 6L6 9L9 6" }), _jsx("path", { d: "M2 10.5H10" })] }));
85
+ }
86
+ function CheckIcon() {
87
+ return (_jsx("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", className: "shrink-0", "aria-hidden": "true", children: _jsx("path", { d: "M2 6.5L4.5 9L10 3" }) }));
88
+ }
89
+ //# sourceMappingURL=ArtifactDocument.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ArtifactDocument.js","sourceRoot":"","sources":["../../src/execution/ArtifactDocument.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,O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AC,IAAI,EACX,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,MAAM,EAAC,cAAc,EACrB,WAAW,EAAC,KAAK,EACjB,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,EACtB,SAAS,EAAC,UAAU,iBACR,MAAM,aAElB,eAAM,CAAC,EAAC,GAAG,EAAC,CAAC,EAAC,GAAG,EAAC,KAAK,EAAC,KAAK,EAAC,MAAM,EAAC,KAAK,EAAC,EAAE,EAAC,GAAG,GAAG,EACpD,eAAM,CAAC,EAAC,wFAAwF,GAAG,IAC/F,CACP,CAAC;AACJ,CAAC;AAED,SAAS,YAAY;IACnB,OAAO,CACL,eACE,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,MAAM,EAAC,cAAc,EACrB,WAAW,EAAC,KAAK,EACjB,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,EACtB,SAAS,EAAC,UAAU,iBACR,MAAM,aAElB,eAAM,CAAC,EAAC,YAAY,GAAG,EACvB,eAAM,CAAC,EAAC,cAAc,GAAG,EACzB,eAAM,CAAC,EAAC,YAAY,GAAG,IACnB,CACP,CAAC;AACJ,CAAC;AAED,SAAS,SAAS;IAChB,OAAO,CACL,cACE,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,MAAM,EAAC,cAAc,EACrB,WAAW,EAAC,KAAK,EACjB,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,EACtB,SAAS,EAAC,UAAU,iBACR,MAAM,YAElB,eAAM,CAAC,EAAC,mBAAmB,GAAG,GAC1B,CACP,CAAC;AACJ,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import type { ExecutionArtifact } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/artifact_pb";
2
- import { type ApplyResourceResult } from "../library/useApplyResource.js";
2
+ import type { ApplyResourceResult } from "../library/useApplyResource.js";
3
3
  /** Props for {@link ArtifactPreviewContent}. */
4
4
  export interface ArtifactPreviewContentProps {
5
5
  /** The execution artifact to preview. */
@@ -25,10 +25,10 @@ export interface ArtifactPreviewContentProps {
25
25
  */
26
26
  readonly onApplied?: (result: ApplyResourceResult) => void;
27
27
  /**
28
- * Optional plan-build action. When provided, a "Build from plan" primary
29
- * button appears in the action bar (used for plan artifacts: turn the
30
- * plan into an Agent run). Clicking it calls `onImplement` then closes
31
- * the modal. Omit for non-actionable artifacts.
28
+ * Optional plan-build action. When provided, a "Build" primary button
29
+ * appears in the action bar (used for plan artifacts: turn the plan into
30
+ * an Agent run). Clicking it calls `onImplement` then closes the modal.
31
+ * Omit for non-actionable artifacts.
32
32
  */
33
33
  readonly onImplement?: () => void;
34
34
  /** Additional CSS classes for the root container. */
@@ -43,7 +43,7 @@ export interface ArtifactPreviewContentProps {
43
43
  * it inside a `<dialog>`, modal, sheet, overlay, or inline context as
44
44
  * needed.
45
45
  *
46
- * Orchestrates the same detection pipeline as {@link ArtifactCard}:
46
+ * Orchestrates the shared detection pipeline (see {@link useArtifactInspection}):
47
47
  *
48
48
  * - **FILE artifacts**: Fetches text content via {@link useArtifactContent},
49
49
  * renders via {@link ArtifactContentRenderer} (markdown, YAML, JSON, or
@@ -73,7 +73,7 @@ export interface ArtifactPreviewContentProps {
73
73
  * ```
74
74
  *
75
75
  * @see {@link ArtifactPreviewModal} — wraps this component in a native `<dialog>`
76
- * @see {@link ArtifactCard} — compact card that triggers preview via `onPreview`
76
+ * @see {@link ArtifactRow} — dense list row that triggers preview via `onOpen`
77
77
  * @see {@link useArtifactContent} — content-fetching hook (headless alternative)
78
78
  * @see {@link useDetectStigmerResource} — YAML resource detection (headless)
79
79
  * @see {@link useDetectSkillPackage} — skill package detection (headless)
@@ -108,7 +108,7 @@ export interface ArtifactPreviewModalProps {
108
108
  readonly onApplied?: (result: ApplyResourceResult) => void;
109
109
  /**
110
110
  * Optional plan-build action (see {@link ArtifactPreviewContentProps.onImplement}).
111
- * When provided, a "Build from plan" primary button appears; clicking it calls
111
+ * When provided, a "Build" primary button appears; clicking it calls
112
112
  * `onImplement` then closes the modal.
113
113
  */
114
114
  readonly onImplement?: () => void;
@@ -146,7 +146,7 @@ export interface ArtifactPreviewModalProps {
146
146
  * ```
147
147
  *
148
148
  * @see {@link ArtifactPreviewContent} — the content component (use directly for non-dialog contexts)
149
- * @see {@link ArtifactCard} — compact card that triggers preview via `onPreview`
149
+ * @see {@link ArtifactRow} — dense list row that triggers preview via `onOpen`
150
150
  */
151
151
  export declare function ArtifactPreviewModal({ artifact, executionId, org, isTerminal, open, onClose, onApplied, onImplement, className, }: ArtifactPreviewModalProps): import("react/jsx-runtime").JSX.Element;
152
152
  //# sourceMappingURL=ArtifactPreviewModal.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ArtifactPreviewModal.d.ts","sourceRoot":"","sources":["../../src/execution/ArtifactPreviewModal.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kEAAkE,CAAC;AAU1G,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,gCAAgC,CAAC;AAQxC,gDAAgD;AAChD,MAAM,WAAW,2BAA2B;IAC1C,yCAAyC;IACzC,QAAQ,CAAC,QAAQ,EAAE,iBAAiB,CAAC;IACrC,uDAAuD;IACvD,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,8EAA8E;IAC9E,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB;;;;;;OAMG;IACH,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAC7B,+CAA+C;IAC/C,QAAQ,CAAC,OAAO,EAAE,MAAM,IAAI,CAAC;IAC7B;;;;OAIG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,mBAAmB,KAAK,IAAI,CAAC;IAC3D;;;;;OAKG;IACH,QAAQ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O,CAAC;IAC7B,4EAA4E;IAC5E,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,uEAAuE;IACvE,QAAQ,CAAC,OAAO,EAAE,MAAM,IAAI,CAAC;IAC7B;;;;OAIG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,mBAAmB,KAAK,IAAI,CAAC;IAC3D;;;;OAIG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IAClC,qDAAqD;IACrD,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAgB,oBAAoB,CAAC,EACnC,QAAQ,EACR,WAAW,EACX,GAAG,EACH,UAAU,EACV,IAAI,EACJ,OAAO,EACP,SAAS,EACT,WAAW,EACX,SAAS,GACV,EAAE,yBAAyB,2CA8C3B"}
@@ -1,16 +1,12 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { useCallback, useEffect, useRef, useState } from "react";
4
- import { ExecutionArtifactKind } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/enum_pb";
3
+ import { useCallback, useEffect, useRef } from "react";
5
4
  import { cn } from "@stigmer/theme";
6
- import { useArtifactContent } from "./useArtifactContent.js";
7
5
  import { useArtifactDownload } from "./useArtifactDownload.js";
8
- import { isTextArtifact, formatArtifactSize } from "./artifact-utils.js";
9
- import { ArtifactContentRenderer } from "./ArtifactContentRenderer.js";
10
- import { useDetectStigmerResource } from "../library/useDetectStigmerResource.js";
11
- import { useDetectSkillPackage } from "../library/useDetectSkillPackage.js";
12
- import { useApplyResource, } from "../library/useApplyResource.js";
13
- const COPIED_FEEDBACK_MS = 2000;
6
+ import { formatArtifactSize } from "./artifact-utils.js";
7
+ import { ArtifactContentBody } from "./ArtifactContentBody.js";
8
+ import { ArtifactApplyButton } from "./ArtifactApplyButton.js";
9
+ import { useArtifactInspection } from "./useArtifactInspection.js";
14
10
  /**
15
11
  * Artifact preview content with detection pipeline and Apply/Push CTA.
16
12
  *
@@ -20,7 +16,7 @@ const COPIED_FEEDBACK_MS = 2000;
20
16
  * it inside a `<dialog>`, modal, sheet, overlay, or inline context as
21
17
  * needed.
22
18
  *
23
- * Orchestrates the same detection pipeline as {@link ArtifactCard}:
19
+ * Orchestrates the shared detection pipeline (see {@link useArtifactInspection}):
24
20
  *
25
21
  * - **FILE artifacts**: Fetches text content via {@link useArtifactContent},
26
22
  * renders via {@link ArtifactContentRenderer} (markdown, YAML, JSON, or
@@ -50,104 +46,27 @@ const COPIED_FEEDBACK_MS = 2000;
50
46
  * ```
51
47
  *
52
48
  * @see {@link ArtifactPreviewModal} — wraps this component in a native `<dialog>`
53
- * @see {@link ArtifactCard} — compact card that triggers preview via `onPreview`
49
+ * @see {@link ArtifactRow} — dense list row that triggers preview via `onOpen`
54
50
  * @see {@link useArtifactContent} — content-fetching hook (headless alternative)
55
51
  * @see {@link useDetectStigmerResource} — YAML resource detection (headless)
56
52
  * @see {@link useDetectSkillPackage} — skill package detection (headless)
57
53
  * @see {@link useApplyResource} — apply/push behavior hook (headless)
58
54
  */
59
55
  export function ArtifactPreviewContent({ artifact, executionId, org, isTerminal, onClose, onApplied, onImplement, className, }) {
60
- const isDirectory = artifact.kind === ExecutionArtifactKind.DIRECTORY;
61
- const canFetchContent = !isDirectory && isTextArtifact(artifact);
62
- // ---------------------------------------------------------------------------
63
- // Detection orchestration
64
- // ---------------------------------------------------------------------------
65
- const { content, contentType, isTruncated, isLoading: isContentLoading, error: contentError, } = useArtifactContent(canFetchContent ? executionId : null, canFetchContent ? artifact.storageKey : null, undefined, artifact.contentHash || undefined);
66
- const yamlDetection = useDetectStigmerResource(canFetchContent ? content : null);
67
- const { detection: skillDetection, isLoading: isSkillLoading } = useDetectSkillPackage(isDirectory ? artifact : null, isDirectory ? executionId : null);
68
- // ---------------------------------------------------------------------------
69
- // Derived detection state
70
- // ---------------------------------------------------------------------------
71
- const isDetected = yamlDetection.detected || skillDetection.detected;
72
- const isDetecting = (canFetchContent && isContentLoading) || (isDirectory && isSkillLoading);
73
- let detectionLabel = null;
74
- if (yamlDetection.detected) {
75
- detectionLabel = `${yamlDetection.displayName} detected`;
76
- }
77
- else if (skillDetection.detected) {
78
- const count = skillDetection.fileCount;
79
- detectionLabel = `Skill \u00B7 ${count} ${count === 1 ? "file" : "files"}`;
80
- }
81
- // ---------------------------------------------------------------------------
82
- // Apply state
83
- // ---------------------------------------------------------------------------
84
- const { applyYamlResource, pushSkillPackage, isApplying, error: applyError, clearError, } = useApplyResource();
85
- const [applyResult, setApplyResult] = useState(null);
86
- const handleApply = useCallback(async () => {
87
- clearError();
88
- try {
89
- let result;
90
- if (yamlDetection.detected && content) {
91
- result = await applyYamlResource(content, org);
92
- }
93
- else if (skillDetection.detected) {
94
- result = await pushSkillPackage({
95
- org,
96
- executionId,
97
- storageKey: artifact.storageKey,
98
- });
99
- }
100
- else {
101
- return;
102
- }
103
- setApplyResult(result);
104
- onApplied?.(result);
105
- }
106
- catch {
107
- // error state managed by useApplyResource
108
- }
109
- }, [
110
- yamlDetection.detected,
111
- skillDetection.detected,
112
- content,
113
- org,
114
- executionId,
115
- artifact.storageKey,
116
- applyYamlResource,
117
- pushSkillPackage,
118
- clearError,
56
+ // The whole inspect-and-act pipeline (content, detection, apply/push, copy)
57
+ // lives in one headless hook, shared with the editor-area ArtifactDocument so
58
+ // the two surfaces can never drift.
59
+ const inspection = useArtifactInspection(artifact, executionId, org, {
119
60
  onApplied,
120
- ]);
121
- // ---------------------------------------------------------------------------
122
- // Copy to clipboard
123
- // ---------------------------------------------------------------------------
124
- const [copied, setCopied] = useState(false);
125
- const handleCopy = useCallback(() => {
126
- if (!content)
127
- return;
128
- navigator.clipboard.writeText(content).then(() => {
129
- setCopied(true);
130
- setTimeout(() => setCopied(false), COPIED_FEEDBACK_MS);
131
- });
132
- }, [content]);
133
- let ctaLabel = null;
134
- if (yamlDetection.detected) {
135
- ctaLabel = `Apply to ${org}`;
136
- }
137
- else if (skillDetection.detected) {
138
- ctaLabel = `Push Skill to ${org}`;
139
- }
140
- // "Build from plan" runs the plan; closing the modal lets the host's submit
141
- // pipeline take over (switch to Agent + send). Single combined handler keeps
142
- // the caller's contract simple ("just give me onImplement").
61
+ });
62
+ // "Build" runs the plan; closing the modal lets the host's submit pipeline
63
+ // take over (switch to Agent + send). Single combined handler keeps the
64
+ // caller's contract simple ("just give me onImplement").
143
65
  const handleImplement = useCallback(() => {
144
66
  onImplement?.();
145
67
  onClose();
146
68
  }, [onImplement, onClose]);
147
- // ---------------------------------------------------------------------------
148
- // Render
149
- // ---------------------------------------------------------------------------
150
- return (_jsxs("div", { className: cn("flex max-h-[80vh] flex-col", className), children: [_jsx(ContentHeader, { artifact: artifact, isDirectory: isDirectory, detectionLabel: detectionLabel, isDetecting: isDetecting, onClose: onClose }), _jsx("div", { className: "min-h-0 flex-1 overflow-y-auto border-t border-border", children: isDirectory ? (_jsx(DirectoryContentView, { artifact: artifact, skillDetection: skillDetection })) : (_jsx(FileContentStateView, { artifact: artifact, content: content, contentType: contentType, isLoading: isContentLoading, error: contentError, isTruncated: isTruncated })) }), _jsx(ActionBar, { artifact: artifact, executionId: executionId, isDirectory: isDirectory, hasContent: content !== null, copied: copied, onCopy: handleCopy, isDetected: isDetected, ctaLabel: ctaLabel, isTerminal: isTerminal, isApplying: isApplying, applyResult: applyResult, applyError: applyError, onApply: handleApply, onImplement: onImplement ? handleImplement : undefined }), _jsx("div", { role: "status", "aria-live": "polite", "aria-atomic": "true", className: "sr-only", children: copied && "Content copied to clipboard" })] }));
69
+ return (_jsxs("div", { className: cn("flex max-h-[80vh] flex-col", className), children: [_jsx(ContentHeader, { artifact: artifact, isDirectory: inspection.isDirectory, detectionLabel: inspection.detectionLabel, isDetecting: inspection.isDetecting, onClose: onClose }), _jsx(ArtifactContentBody, { artifact: artifact, content: inspection.content, contentType: inspection.contentType, isLoading: inspection.isLoading, error: inspection.error, isTruncated: inspection.isTruncated, skillDetection: inspection.skillDetection, className: "min-h-0 flex-1 overflow-y-auto border-t border-border" }), _jsx(ActionBar, { artifact: artifact, executionId: executionId, isDirectory: inspection.isDirectory, hasContent: inspection.content !== null, copied: inspection.copied, onCopy: inspection.copy, isDetected: inspection.isDetected, ctaLabel: inspection.ctaLabel, isTerminal: isTerminal, isApplying: inspection.isApplying, applyResult: inspection.applyResult, applyError: inspection.applyError, onApply: inspection.apply, onImplement: onImplement ? handleImplement : undefined }), _jsx("div", { role: "status", "aria-live": "polite", "aria-atomic": "true", className: "sr-only", children: inspection.copied && "Content copied to clipboard" })] }));
151
70
  }
152
71
  /**
153
72
  * Full preview modal for execution artifacts using a native `<dialog>`.
@@ -180,7 +99,7 @@ export function ArtifactPreviewContent({ artifact, executionId, org, isTerminal,
180
99
  * ```
181
100
  *
182
101
  * @see {@link ArtifactPreviewContent} — the content component (use directly for non-dialog contexts)
183
- * @see {@link ArtifactCard} — compact card that triggers preview via `onPreview`
102
+ * @see {@link ArtifactRow} — dense list row that triggers preview via `onOpen`
184
103
  */
185
104
  export function ArtifactPreviewModal({ artifact, executionId, org, isTerminal, open, onClose, onApplied, onImplement, className, }) {
186
105
  const dialogRef = useRef(null);
@@ -212,47 +131,13 @@ function ContentHeader({ artifact, isDirectory, detectionLabel, isDetecting, onC
212
131
  return (_jsxs("div", { className: "flex items-start gap-3 p-4 pb-3", children: [_jsx("span", { className: "mt-0.5 shrink-0 text-muted-foreground", children: isDirectory ? _jsx(FolderIcon, {}) : _jsx(FileIcon, {}) }), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsxs("h2", { className: "truncate text-sm font-semibold text-foreground", children: [artifact.name, isDirectory && "/"] }), _jsxs("div", { className: "mt-0.5 flex flex-wrap items-center gap-2", children: [_jsx("span", { className: "text-xs tabular-nums text-muted-foreground", children: formatArtifactSize(artifact.sizeBytes) }), isDetecting && !detectionLabel && (_jsx("span", { className: "h-4 w-24 animate-pulse rounded-full bg-muted", "aria-hidden": "true" })), detectionLabel && (_jsx("span", { className: "inline-flex items-center rounded-full bg-primary-subtle px-2 py-0.5 text-xs font-medium text-primary", children: detectionLabel }))] })] }), _jsx("button", { type: "button", onClick: onClose, "aria-label": "Close preview", className: cn("shrink-0 rounded-sm p-1 text-muted-foreground transition-colors hover:text-foreground", FOCUS_RING_CLASSES), children: _jsx(CloseIcon, {}) })] }));
213
132
  }
214
133
  // ---------------------------------------------------------------------------
215
- // FileContentStateView (internal — loading/error/empty states + renderer)
216
- // ---------------------------------------------------------------------------
217
- const SKELETON_LINE_WIDTHS = [85, 72, 90, 65, 78, 88, 70, 82];
218
- function FileContentStateView({ artifact, content, contentType, isLoading, error, isTruncated, }) {
219
- if (isLoading) {
220
- return (_jsx("div", { className: "space-y-2 p-4", "aria-busy": "true", "aria-label": "Loading content", children: SKELETON_LINE_WIDTHS.map((width, i) => (_jsx("div", { className: "h-4 animate-pulse rounded bg-muted", style: { width: `${width}%` }, "aria-hidden": "true" }, i))) }));
221
- }
222
- if (error) {
223
- return (_jsxs("div", { className: "flex flex-col items-center justify-center gap-2 p-8 text-center", children: [_jsx(ErrorAlertIcon, {}), _jsx("p", { className: "text-sm text-destructive", children: error.message })] }));
224
- }
225
- if (content === null) {
226
- return (_jsx("div", { className: "p-8 text-center text-sm text-muted-foreground", children: "Content not available for preview." }));
227
- }
228
- return (_jsx(ArtifactContentRenderer, { content: content, fileName: artifact.name, contentType: contentType, isTruncated: isTruncated }));
229
- }
230
- // ---------------------------------------------------------------------------
231
- // DirectoryContentView (internal)
232
- // ---------------------------------------------------------------------------
233
- function DirectoryContentView({ artifact, skillDetection, }) {
234
- const entries = artifact.entries;
235
- return (_jsxs("div", { className: "p-4", children: [skillDetection.detected && (_jsxs("div", { className: "mb-4 rounded-md bg-primary-subtle p-3", children: [_jsx("p", { className: "text-sm font-medium text-foreground", children: skillDetection.skillName }), skillDetection.skillDescription && (_jsx("p", { className: "mt-1 text-xs text-muted-foreground", children: skillDetection.skillDescription }))] })), entries.length > 0 ? (_jsxs("div", { children: [_jsxs("h3", { className: "mb-2 text-xs font-medium text-muted-foreground", children: ["Files (", entries.length, ")"] }), _jsx("ul", { className: "space-y-0.5", role: "list", children: entries.map((entry) => (_jsxs("li", { className: "flex items-center gap-2 rounded-sm px-2 py-1 font-mono text-xs text-foreground", children: [_jsx(EntryIcon, { name: entry }), _jsx("span", { className: "min-w-0 truncate", children: entry })] }, entry))) })] })) : (_jsx("p", { className: "text-sm text-muted-foreground", children: "File listing not available." }))] }));
236
- }
237
- function EntryIcon({ name }) {
238
- if (name.endsWith("/"))
239
- return _jsx(FolderSmallIcon, {});
240
- return _jsx(FileSmallIcon, {});
241
- }
242
- // ---------------------------------------------------------------------------
243
134
  // ActionBar (internal)
244
135
  // ---------------------------------------------------------------------------
245
136
  function ActionBar({ artifact, executionId, isDirectory, hasContent, copied, onCopy, isDetected, ctaLabel, isTerminal, isApplying, applyResult, applyError, onApply, onImplement, }) {
246
137
  const { download, isDownloading } = useArtifactDownload(executionId);
247
138
  return (_jsxs("div", { className: "flex items-center justify-between gap-3 border-t border-border px-4 py-3", children: [_jsxs("div", { className: "flex items-center gap-3", children: [!isDirectory && hasContent && (_jsxs("button", { type: "button", onClick: onCopy, "aria-label": copied ? "Copied to clipboard" : "Copy content", className: cn("inline-flex items-center gap-1.5 text-xs font-medium transition-colors", copied
248
139
  ? "text-success"
249
- : "text-muted-foreground hover:text-foreground", FOCUS_RING_CLASSES), children: [copied ? _jsx(CheckIcon, {}) : _jsx(CopyIcon, {}), copied ? "Copied" : "Copy"] })), _jsxs("button", { type: "button", onClick: () => download(artifact.storageKey, artifact.name), disabled: isDownloading, className: cn("inline-flex items-center gap-1.5 text-xs font-medium text-muted-foreground transition-colors hover:text-foreground disabled:opacity-50", FOCUS_RING_CLASSES), children: [_jsx(DownloadIcon, {}), isDownloading ? "Preparing…" : isDirectory ? "Download ZIP" : "Download"] })] }), _jsxs("div", { className: "flex shrink-0 items-center gap-3", children: [onImplement && (_jsxs("button", { type: "button", onClick: onImplement, className: cn("inline-flex items-center gap-1.5 rounded-md px-4 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 focus-visible:ring-offset-2"), children: [_jsx(ImplementIcon, {}), "Build from plan"] })), applyResult ? (_jsxs("span", { className: "inline-flex items-center gap-1.5 text-xs font-medium text-success", children: [_jsx(CheckIcon, {}), "Applied ", "\u00B7", " ", applyResult.name || applyResult.kind] })) : applyError ? (_jsxs("span", { className: "inline-flex items-center gap-2", role: "alert", children: [_jsx("span", { className: "text-xs text-destructive", children: applyError.message }), _jsx("button", { type: "button", onClick: onApply, className: cn("text-xs font-medium text-destructive underline transition-colors hover:text-destructive-muted", FOCUS_RING_CLASSES), children: "Retry" })] })) : isDetected && ctaLabel ? (_jsx("span", { "data-cursor-target": "apply-resource-button", children: _jsx(ApplyButton, { label: ctaLabel, isTerminal: isTerminal, isApplying: isApplying, onApply: onApply }) })) : null] })] }));
250
- }
251
- function ApplyButton({ label, isTerminal, isApplying, onApply, }) {
252
- const canApply = isTerminal && !isApplying;
253
- return (_jsx("button", { type: "button", onClick: canApply ? onApply : undefined, disabled: !canApply, "aria-busy": isApplying, className: cn("rounded-md px-4 py-1.5 text-xs font-medium transition-colors", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2", "disabled:cursor-not-allowed", canApply
254
- ? "bg-primary text-primary-foreground hover:bg-primary-hover"
255
- : "bg-muted text-muted-foreground"), children: isApplying ? (_jsxs("span", { className: "inline-flex items-center gap-1.5", children: [_jsx(SpinnerIcon, {}), "Applying", "\u2026"] })) : (label) }));
140
+ : "text-muted-foreground hover:text-foreground", FOCUS_RING_CLASSES), children: [copied ? _jsx(CheckIcon, {}) : _jsx(CopyIcon, {}), copied ? "Copied" : "Copy"] })), _jsxs("button", { type: "button", onClick: () => download(artifact.storageKey, artifact.name), disabled: isDownloading, className: cn("inline-flex items-center gap-1.5 text-xs font-medium text-muted-foreground transition-colors hover:text-foreground disabled:opacity-50", FOCUS_RING_CLASSES), children: [_jsx(DownloadIcon, {}), isDownloading ? "Preparing…" : isDirectory ? "Download ZIP" : "Download"] })] }), _jsxs("div", { className: "flex shrink-0 items-center gap-3", children: [onImplement && (_jsxs("button", { type: "button", onClick: onImplement, className: cn("inline-flex items-center gap-1.5 rounded-md px-4 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 focus-visible:ring-offset-2"), children: [_jsx(ImplementIcon, {}), "Build"] })), applyResult ? (_jsxs("span", { className: "inline-flex items-center gap-1.5 text-xs font-medium text-success", children: [_jsx(CheckIcon, {}), "Applied ", "\u00B7", " ", applyResult.name || applyResult.kind] })) : applyError ? (_jsxs("span", { className: "inline-flex items-center gap-2", role: "alert", children: [_jsx("span", { className: "text-xs text-destructive", children: applyError.message }), _jsx("button", { type: "button", onClick: onApply, className: cn("text-xs font-medium text-destructive underline transition-colors hover:text-destructive-muted", FOCUS_RING_CLASSES), children: "Retry" })] })) : isDetected && ctaLabel ? (_jsx("span", { "data-cursor-target": "apply-resource-button", children: _jsx(ArtifactApplyButton, { label: ctaLabel, isTerminal: isTerminal, isApplying: isApplying, onApply: onApply }) })) : null] })] }));
256
141
  }
257
142
  // ---------------------------------------------------------------------------
258
143
  // Inline SVG icons (SDK pattern: no external icon dependency)
@@ -266,12 +151,6 @@ function FileIcon() {
266
151
  function FolderIcon() {
267
152
  return (_jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: _jsx("path", { d: "M14.5 12.5C14.5 13.33 13.83 14 13 14H3C2.17 14 1.5 13.33 1.5 12.5V3.5C1.5 2.67 2.17 2 3 2H6L8 4.5H13C13.83 4.5 14.5 5.17 14.5 6V12.5Z" }) }));
268
153
  }
269
- function FileSmallIcon() {
270
- return (_jsxs("svg", { width: "12", height: "12", viewBox: "0 0 14 14", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", className: "shrink-0 text-muted-foreground", "aria-hidden": "true", children: [_jsx("path", { d: "M8 1H4C3.45 1 3 1.45 3 2V12C3 12.55 3.45 13 4 13H10C10.55 13 11 12.55 11 12V4L8 1Z" }), _jsx("path", { d: "M8 1V4H11" })] }));
271
- }
272
- function FolderSmallIcon() {
273
- return (_jsx("svg", { width: "12", height: "12", viewBox: "0 0 14 14", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", className: "shrink-0 text-muted-foreground", "aria-hidden": "true", children: _jsx("path", { d: "M13 11C13 11.55 12.55 12 12 12H2C1.45 12 1 11.55 1 11V3C1 2.45 1.45 2 2 2H5L7 4H12C12.55 4 13 4.45 13 5V11Z" }) }));
274
- }
275
154
  function CopyIcon() {
276
155
  return (_jsxs("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", stroke: "currentColor", strokeWidth: "1.2", strokeLinecap: "round", strokeLinejoin: "round", className: "shrink-0", "aria-hidden": "true", children: [_jsx("rect", { x: "4", y: "4", width: "6.5", height: "6.5", rx: "1" }), _jsx("path", { d: "M8 4V2.5C8 1.95 7.55 1.5 7 1.5H2.5C1.95 1.5 1.5 1.95 1.5 2.5V7C1.5 7.55 1.95 8 2.5 8H4" })] }));
277
156
  }
@@ -284,10 +163,4 @@ function ImplementIcon() {
284
163
  function CheckIcon() {
285
164
  return (_jsx("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", className: "shrink-0", "aria-hidden": "true", children: _jsx("path", { d: "M2 6.5L4.5 9L10 3" }) }));
286
165
  }
287
- function SpinnerIcon() {
288
- return (_jsx("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", stroke: "currentColor", strokeWidth: "1.5", className: "shrink-0 animate-spin", "aria-hidden": "true", children: _jsx("path", { d: "M6 1.5A4.5 4.5 0 1 1 1.5 6", strokeLinecap: "round" }) }));
289
- }
290
- function ErrorAlertIcon() {
291
- return (_jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", className: "text-destructive", "aria-hidden": "true", children: [_jsx("circle", { cx: "8", cy: "8", r: "6.5" }), _jsx("path", { d: "M8 5.5V8.5" }), _jsx("circle", { cx: "8", cy: "11", r: "0.5", fill: "currentColor", stroke: "none" })] }));
292
- }
293
166
  //# sourceMappingURL=ArtifactPreviewModal.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ArtifactPreviewModal.js","sourceRoot":"","sources":["../../src/execution/ArtifactPreviewModal.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjE,OAAO,EAAE,qBAAqB,EAAE,MAAM,8DAA8D,CAAC;AACrG,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AACpC,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzE,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,wBAAwB,EAAE,MAAM,wCAAwC,CAAC;AAClF,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAE5E,OAAO,EACL,gBAAgB,GAEjB,MAAM,gCAAgC,CAAC;AAExC,MAAM,kBAAkB,GAAG,IAAI,CAAC;AAyChC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EAAC,OAAO,EACtB,SAAS,EAAC,UAAU,iBACR,MAAM,YAElB,eAAM,CAAC,EAAC,oBAAoB,GAAG,GAC3B,CACP,CAAC;AACJ,CAAC;AAED,SAAS,SAAS;IAChB,OAAO,CACL,cACE,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,MAAM,EAAC,cAAc,EACrB,WAAW,EAAC,KAAK,EACjB,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,EACtB,SAAS,EAAC,UAAU,iBACR,MAAM,YAElB,eAAM,CAAC,EAAC,mBAAmB,GAAG,GAC1B,CACP,CAAC;AACJ,CAAC"}
@@ -0,0 +1,49 @@
1
+ import type { ExecutionArtifact } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/artifact_pb";
2
+ /** Props for {@link ArtifactRow}. */
3
+ export interface ArtifactRowProps {
4
+ /** The execution artifact to render. */
5
+ readonly artifact: ExecutionArtifact;
6
+ /** ID of the execution that produced this artifact — used to mint its download URL. */
7
+ readonly executionId: string;
8
+ /**
9
+ * When `true`, another artifact in the list shares this artifact's display
10
+ * `name` but has a different `sandbox_path`; the row renders the parent
11
+ * directory as a muted subtitle to disambiguate. Typically supplied from
12
+ * {@link SessionArtifactEntry.hasNameCollision}.
13
+ */
14
+ readonly hasNameCollision?: boolean;
15
+ /** Single click / Enter / Space: open the artifact (a preview tab, or a modal). */
16
+ readonly onOpen: () => void;
17
+ /**
18
+ * Double click: promote the artifact to a persistent (pinned) tab. Mirrors the
19
+ * file tree's `onOpenFile` (preview) / `onActivateFile` (pin) split — the
20
+ * leading single click of the double click has already opened the preview, so
21
+ * this promotes it. Omit in panel-less hosts (e.g. the modal-only widget):
22
+ * with no handler the row binds no `onDoubleClick`, so a double click is just
23
+ * two harmless single clicks, exactly as `FileTreeNode` behaves.
24
+ */
25
+ readonly onActivate?: () => void;
26
+ /** Additional CSS classes for the row's `<li>`. */
27
+ readonly className?: string;
28
+ }
29
+ /**
30
+ * One dense, VS Code-style artifact row: a full-width open button (shared
31
+ * file-type icon + name + optional collision subtitle + size) with a sibling,
32
+ * hover/focus-revealed Download button.
33
+ *
34
+ * The open target and the Download control are SIBLINGS, never nested — a
35
+ * `<button>` inside a `<button>` is an axe `nested-interactive` (WCAG 4.1.2)
36
+ * violation. This mirrors `ExplorerRoot`'s header + remove-control pattern.
37
+ *
38
+ * Deliberately execution-pure and presentational: it takes only the artifact,
39
+ * its `executionId`, and open/activate closures — no session-domain types and
40
+ * no content fetch (resource detection and Apply/Push live in the opened
41
+ * document/modal, not the list). The two hosts — the session panel's
42
+ * `ArtifactsTab` facet and the panel-less {@link ArtifactsWidget} — map
43
+ * their entries onto these props and own the behavior wiring.
44
+ *
45
+ * @see ArtifactsTab — session-panel facet (rows open editor-pane document tabs)
46
+ * @see ArtifactsWidget — panel-less embeddable (rows open the preview modal)
47
+ */
48
+ export declare function ArtifactRow({ artifact, executionId, hasNameCollision, onOpen, onActivate, className, }: ArtifactRowProps): import("react/jsx-runtime").JSX.Element;
49
+ //# sourceMappingURL=ArtifactRow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ArtifactRow.d.ts","sourceRoot":"","sources":["../../src/execution/ArtifactRow.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kEAAkE,CAAC;AAO1G,qCAAqC;AACrC,MAAM,WAAW,gBAAgB;IAC/B,wCAAwC;IACxC,QAAQ,CAAC,QAAQ,EAAE,iBAAiB,CAAC;IACrC,uFAAuF;IACvF,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B;;;;;OAKG;IACH,QAAQ,CAAC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IACpC,mFAAmF;IACnF,QAAQ,CAAC,MAAM,EAAE,MAAM,IAAI,CAAC;IAC5B;;;;;;;OAOG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACjC,mDAAmD;IACnD,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,WAAW,CAAC,EAC1B,QAAQ,EACR,WAAW,EACX,gBAAwB,EACxB,MAAM,EACN,UAAU,EACV,SAAS,GACV,EAAE,gBAAgB,2CA+DlB"}
@@ -0,0 +1,56 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { ExecutionArtifactKind } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/enum_pb";
4
+ import { cn } from "@stigmer/theme";
5
+ import { FileTypeIcon, FolderTypeIcon } from "../internal/file-icons/index.js";
6
+ import { useArtifactDownload } from "./useArtifactDownload.js";
7
+ import { formatArtifactSize } from "./artifact-utils.js";
8
+ /**
9
+ * One dense, VS Code-style artifact row: a full-width open button (shared
10
+ * file-type icon + name + optional collision subtitle + size) with a sibling,
11
+ * hover/focus-revealed Download button.
12
+ *
13
+ * The open target and the Download control are SIBLINGS, never nested — a
14
+ * `<button>` inside a `<button>` is an axe `nested-interactive` (WCAG 4.1.2)
15
+ * violation. This mirrors `ExplorerRoot`'s header + remove-control pattern.
16
+ *
17
+ * Deliberately execution-pure and presentational: it takes only the artifact,
18
+ * its `executionId`, and open/activate closures — no session-domain types and
19
+ * no content fetch (resource detection and Apply/Push live in the opened
20
+ * document/modal, not the list). The two hosts — the session panel's
21
+ * `ArtifactsTab` facet and the panel-less {@link ArtifactsWidget} — map
22
+ * their entries onto these props and own the behavior wiring.
23
+ *
24
+ * @see ArtifactsTab — session-panel facet (rows open editor-pane document tabs)
25
+ * @see ArtifactsWidget — panel-less embeddable (rows open the preview modal)
26
+ */
27
+ export function ArtifactRow({ artifact, executionId, hasNameCollision = false, onOpen, onActivate, className, }) {
28
+ const isDirectory = artifact.kind === ExecutionArtifactKind.DIRECTORY;
29
+ const { download, isDownloading } = useArtifactDownload(executionId);
30
+ const parentDir = hasNameCollision && artifact.sandboxPath
31
+ ? parentDirectory(artifact.sandboxPath)
32
+ : null;
33
+ return (_jsxs("li", { className: cn("group flex items-stretch", className), children: [_jsxs("button", { type: "button", onClick: onOpen, onDoubleClick: onActivate, title: artifact.sandboxPath || artifact.name, className: cn("flex min-w-0 flex-1 items-center gap-2 px-2 py-1 text-left text-xs text-muted-foreground transition-colors", "hover:bg-muted hover:text-foreground", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring"), children: [_jsx("span", { className: "shrink-0 text-muted-foreground", children: isDirectory ? (_jsx(FolderTypeIcon, { open: false })) : (_jsx(FileTypeIcon, { fileName: artifact.name })) }), _jsxs("span", { className: "min-w-0 flex-1 truncate text-foreground", children: [artifact.name, isDirectory && "/", parentDir && (_jsx("span", { className: "ml-1.5 text-[0.65rem] text-muted-foreground", children: parentDir }))] }), _jsx("span", { className: "shrink-0 tabular-nums text-[0.65rem] text-muted-foreground-faint", children: formatArtifactSize(artifact.sizeBytes) })] }), _jsx("button", { type: "button", onClick: () => download(artifact.storageKey, artifact.name), disabled: isDownloading, "aria-label": isDownloading
34
+ ? `Preparing ${artifact.name}`
35
+ : `Download ${artifact.name}`, title: isDirectory ? "Download ZIP" : "Download", className: cn("flex shrink-0 items-center px-2 text-muted-foreground opacity-0 transition-opacity", "group-hover:opacity-100 focus-visible:opacity-100", "hover:text-foreground disabled:opacity-50", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring"), children: _jsx(DownloadIcon, {}) })] }));
36
+ }
37
+ // ---------------------------------------------------------------------------
38
+ // Helpers
39
+ // ---------------------------------------------------------------------------
40
+ /**
41
+ * Extracts a human-readable parent directory label from a sandbox path.
42
+ * Given `/workspace/configs/agent.yaml` returns `configs/`.
43
+ * Returns `null` when the path has no meaningful parent segment.
44
+ */
45
+ function parentDirectory(sandboxPath) {
46
+ const lastSlash = sandboxPath.lastIndexOf("/");
47
+ if (lastSlash <= 0)
48
+ return null;
49
+ const parent = sandboxPath.slice(0, lastSlash);
50
+ const segment = parent.slice(parent.lastIndexOf("/") + 1);
51
+ return segment ? `${segment}/` : null;
52
+ }
53
+ function DownloadIcon() {
54
+ return (_jsxs("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", className: "shrink-0", "aria-hidden": "true", children: [_jsx("path", { d: "M6 1.5V8.5" }), _jsx("path", { d: "M3 6L6 9L9 6" }), _jsx("path", { d: "M2 10.5H10" })] }));
55
+ }
56
+ //# sourceMappingURL=ArtifactRow.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ArtifactRow.js","sourceRoot":"","sources":["../../src/execution/ArtifactRow.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,OAAO,EAAE,qBAAqB,EAAE,MAAM,8DAA8D,CAAC;AACrG,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAC/E,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AA8BzD;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,WAAW,CAAC,EAC1B,QAAQ,EACR,WAAW,EACX,gBAAgB,GAAG,KAAK,EACxB,MAAM,EACN,UAAU,EACV,SAAS,GACQ;IACjB,MAAM,WAAW,GAAG,QAAQ,CAAC,IAAI,KAAK,qBAAqB,CAAC,SAAS,CAAC;IACtE,MAAM,EAAE,QAAQ,EAAE,aAAa,EAAE,GAAG,mBAAmB,CAAC,WAAW,CAAC,CAAC;IAErE,MAAM,SAAS,GACb,gBAAgB,IAAI,QAAQ,CAAC,WAAW;QACtC,CAAC,CAAC,eAAe,CAAC,QAAQ,CAAC,WAAW,CAAC;QACvC,CAAC,CAAC,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