@stigmer/react 3.0.9-dev.20260615153829 → 3.1.0

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 (439) hide show
  1. package/execution/ApprovalCard.d.ts +47 -3
  2. package/execution/ApprovalCard.d.ts.map +1 -1
  3. package/execution/ApprovalCard.js +138 -70
  4. package/execution/ApprovalCard.js.map +1 -1
  5. package/execution/ApprovalContext.d.ts +72 -0
  6. package/execution/ApprovalContext.d.ts.map +1 -0
  7. package/execution/ApprovalContext.js +41 -0
  8. package/execution/ApprovalContext.js.map +1 -0
  9. package/execution/ArtifactCard.d.ts.map +1 -1
  10. package/execution/ArtifactCard.js +3 -1
  11. package/execution/ArtifactCard.js.map +1 -1
  12. package/execution/ArtifactPreviewModal.d.ts.map +1 -1
  13. package/execution/ArtifactPreviewModal.js +5 -3
  14. package/execution/ArtifactPreviewModal.js.map +1 -1
  15. package/execution/EmptyChangeNotice.d.ts +38 -0
  16. package/execution/EmptyChangeNotice.d.ts.map +1 -0
  17. package/execution/EmptyChangeNotice.js +27 -0
  18. package/execution/EmptyChangeNotice.js.map +1 -0
  19. package/execution/FileChangesView.d.ts +81 -0
  20. package/execution/FileChangesView.d.ts.map +1 -0
  21. package/execution/FileChangesView.js +164 -0
  22. package/execution/FileChangesView.js.map +1 -0
  23. package/execution/FilePathLink.d.ts +24 -4
  24. package/execution/FilePathLink.d.ts.map +1 -1
  25. package/execution/FilePathLink.js +31 -9
  26. package/execution/FilePathLink.js.map +1 -1
  27. package/execution/FileReviewCard.d.ts +111 -0
  28. package/execution/FileReviewCard.d.ts.map +1 -0
  29. package/execution/FileReviewCard.js +558 -0
  30. package/execution/FileReviewCard.js.map +1 -0
  31. package/execution/FileReviewContext.d.ts +35 -0
  32. package/execution/FileReviewContext.d.ts.map +1 -0
  33. package/execution/FileReviewContext.js +23 -0
  34. package/execution/FileReviewContext.js.map +1 -0
  35. package/execution/FileReviewDock.d.ts +73 -0
  36. package/execution/FileReviewDock.d.ts.map +1 -0
  37. package/execution/FileReviewDock.js +65 -0
  38. package/execution/FileReviewDock.js.map +1 -0
  39. package/execution/McpToolDetail.d.ts.map +1 -1
  40. package/execution/McpToolDetail.js +38 -5
  41. package/execution/McpToolDetail.js.map +1 -1
  42. package/execution/MessageThread.d.ts +42 -3
  43. package/execution/MessageThread.d.ts.map +1 -1
  44. package/execution/MessageThread.js +263 -18
  45. package/execution/MessageThread.js.map +1 -1
  46. package/execution/PlanArtifactCard.d.ts.map +1 -1
  47. package/execution/PlanArtifactCard.js +3 -1
  48. package/execution/PlanArtifactCard.js.map +1 -1
  49. package/execution/PlanCompletionCard.d.ts +1 -1
  50. package/execution/PlanCompletionCard.js +1 -1
  51. package/execution/ResultView.d.ts +19 -1
  52. package/execution/ResultView.d.ts.map +1 -1
  53. package/execution/ResultView.js +141 -40
  54. package/execution/ResultView.js.map +1 -1
  55. package/execution/SubAgentSection.d.ts.map +1 -1
  56. package/execution/SubAgentSection.js +45 -6
  57. package/execution/SubAgentSection.js.map +1 -1
  58. package/execution/TerminalSession.d.ts +34 -0
  59. package/execution/TerminalSession.d.ts.map +1 -0
  60. package/execution/TerminalSession.js +34 -0
  61. package/execution/TerminalSession.js.map +1 -0
  62. package/execution/TodoCard.d.ts +53 -0
  63. package/execution/TodoCard.d.ts.map +1 -0
  64. package/execution/TodoCard.js +77 -0
  65. package/execution/TodoCard.js.map +1 -0
  66. package/execution/ToolArgsView.d.ts +7 -1
  67. package/execution/ToolArgsView.d.ts.map +1 -1
  68. package/execution/ToolArgsView.js +10 -9
  69. package/execution/ToolArgsView.js.map +1 -1
  70. package/execution/ToolCallDetail.d.ts +10 -1
  71. package/execution/ToolCallDetail.d.ts.map +1 -1
  72. package/execution/ToolCallDetail.js +66 -19
  73. package/execution/ToolCallDetail.js.map +1 -1
  74. package/execution/ToolCallGroup.d.ts +28 -18
  75. package/execution/ToolCallGroup.d.ts.map +1 -1
  76. package/execution/ToolCallGroup.js +39 -148
  77. package/execution/ToolCallGroup.js.map +1 -1
  78. package/execution/ToolCallItem.d.ts +36 -8
  79. package/execution/ToolCallItem.d.ts.map +1 -1
  80. package/execution/ToolCallItem.js +140 -21
  81. package/execution/ToolCallItem.js.map +1 -1
  82. package/execution/ToolRunGroup.d.ts +48 -0
  83. package/execution/ToolRunGroup.d.ts.map +1 -0
  84. package/execution/ToolRunGroup.js +168 -0
  85. package/execution/ToolRunGroup.js.map +1 -0
  86. package/execution/approval-provenance.d.ts +2 -0
  87. package/execution/approval-provenance.d.ts.map +1 -0
  88. package/execution/approval-provenance.js +6 -0
  89. package/execution/approval-provenance.js.map +1 -0
  90. package/execution/artifact-utils.d.ts +0 -10
  91. package/execution/artifact-utils.d.ts.map +1 -1
  92. package/execution/artifact-utils.js +0 -17
  93. package/execution/artifact-utils.js.map +1 -1
  94. package/execution/execution-phases.d.ts +1 -6
  95. package/execution/execution-phases.d.ts.map +1 -1
  96. package/execution/execution-phases.js +4 -14
  97. package/execution/execution-phases.js.map +1 -1
  98. package/execution/file-path-resolver.d.ts +28 -0
  99. package/execution/file-path-resolver.d.ts.map +1 -1
  100. package/execution/file-path-resolver.js +24 -0
  101. package/execution/file-path-resolver.js.map +1 -1
  102. package/execution/file-review-status.d.ts +127 -0
  103. package/execution/file-review-status.d.ts.map +1 -0
  104. package/execution/file-review-status.js +135 -0
  105. package/execution/file-review-status.js.map +1 -0
  106. package/execution/index.d.ts +39 -5
  107. package/execution/index.d.ts.map +1 -1
  108. package/execution/index.js +23 -3
  109. package/execution/index.js.map +1 -1
  110. package/execution/segment-tool-calls.d.ts +46 -0
  111. package/execution/segment-tool-calls.d.ts.map +1 -0
  112. package/execution/segment-tool-calls.js +71 -0
  113. package/execution/segment-tool-calls.js.map +1 -0
  114. package/execution/tool-categories.d.ts +62 -1
  115. package/execution/tool-categories.d.ts.map +1 -1
  116. package/execution/tool-categories.js +96 -2
  117. package/execution/tool-categories.js.map +1 -1
  118. package/execution/tool-presenter.d.ts +38 -2
  119. package/execution/tool-presenter.d.ts.map +1 -1
  120. package/execution/tool-presenter.js +23 -1
  121. package/execution/tool-presenter.js.map +1 -1
  122. package/execution/tool-rendering-primitives.d.ts.map +1 -1
  123. package/execution/tool-rendering-primitives.js +3 -2
  124. package/execution/tool-rendering-primitives.js.map +1 -1
  125. package/execution/useArtifactDownload.d.ts +44 -0
  126. package/execution/useArtifactDownload.d.ts.map +1 -0
  127. package/execution/useArtifactDownload.js +80 -0
  128. package/execution/useArtifactDownload.js.map +1 -0
  129. package/execution/useArtifactDownloadUrl.d.ts +67 -0
  130. package/execution/useArtifactDownloadUrl.d.ts.map +1 -0
  131. package/execution/useArtifactDownloadUrl.js +59 -0
  132. package/execution/useArtifactDownloadUrl.js.map +1 -0
  133. package/execution/useFileChangeContent.d.ts +61 -0
  134. package/execution/useFileChangeContent.d.ts.map +1 -0
  135. package/execution/useFileChangeContent.js +89 -0
  136. package/execution/useFileChangeContent.js.map +1 -0
  137. package/execution/useFileReview.d.ts +89 -0
  138. package/execution/useFileReview.d.ts.map +1 -0
  139. package/execution/useFileReview.js +106 -0
  140. package/execution/useFileReview.js.map +1 -0
  141. package/execution/useSubmitApproval.d.ts +17 -2
  142. package/execution/useSubmitApproval.d.ts.map +1 -1
  143. package/execution/useSubmitApproval.js +27 -23
  144. package/execution/useSubmitApproval.js.map +1 -1
  145. package/execution/useToolOutputContent.d.ts +44 -0
  146. package/execution/useToolOutputContent.d.ts.map +1 -0
  147. package/execution/useToolOutputContent.js +31 -0
  148. package/execution/useToolOutputContent.js.map +1 -0
  149. package/index.d.ts +6 -6
  150. package/index.d.ts.map +1 -1
  151. package/index.js +3 -3
  152. package/index.js.map +1 -1
  153. package/internal/ApprovalPeekBar.d.ts +23 -0
  154. package/internal/ApprovalPeekBar.d.ts.map +1 -0
  155. package/internal/ApprovalPeekBar.js +25 -0
  156. package/internal/ApprovalPeekBar.js.map +1 -0
  157. package/internal/BoundedContent.d.ts +49 -0
  158. package/internal/BoundedContent.d.ts.map +1 -0
  159. package/internal/BoundedContent.js +50 -0
  160. package/internal/BoundedContent.js.map +1 -0
  161. package/internal/DecisionButton.d.ts +47 -0
  162. package/internal/DecisionButton.d.ts.map +1 -0
  163. package/internal/DecisionButton.js +42 -0
  164. package/internal/DecisionButton.js.map +1 -0
  165. package/internal/InCardDecisionError.d.ts +31 -0
  166. package/internal/InCardDecisionError.d.ts.map +1 -0
  167. package/internal/InCardDecisionError.js +23 -0
  168. package/internal/InCardDecisionError.js.map +1 -0
  169. package/internal/RevealToggle.d.ts +36 -0
  170. package/internal/RevealToggle.d.ts.map +1 -0
  171. package/internal/RevealToggle.js +32 -0
  172. package/internal/RevealToggle.js.map +1 -0
  173. package/internal/VirtualizedThread.d.ts +7 -1
  174. package/internal/VirtualizedThread.d.ts.map +1 -1
  175. package/internal/VirtualizedThread.js +7 -3
  176. package/internal/VirtualizedThread.js.map +1 -1
  177. package/internal/code-highlight.d.ts +24 -0
  178. package/internal/code-highlight.d.ts.map +1 -0
  179. package/internal/code-highlight.js +115 -0
  180. package/internal/code-highlight.js.map +1 -0
  181. package/internal/markdown-components.d.ts.map +1 -1
  182. package/internal/markdown-components.js +13 -2
  183. package/internal/markdown-components.js.map +1 -1
  184. package/internal/useAutoDisclosure.d.ts +34 -0
  185. package/internal/useAutoDisclosure.d.ts.map +1 -0
  186. package/internal/useAutoDisclosure.js +53 -0
  187. package/internal/useAutoDisclosure.js.map +1 -0
  188. package/internal/useElapsedSince.d.ts +30 -0
  189. package/internal/useElapsedSince.d.ts.map +1 -0
  190. package/internal/useElapsedSince.js +70 -0
  191. package/internal/useElapsedSince.js.map +1 -0
  192. package/internal/useIsOverflowing.d.ts +30 -0
  193. package/internal/useIsOverflowing.d.ts.map +1 -0
  194. package/internal/useIsOverflowing.js +47 -0
  195. package/internal/useIsOverflowing.js.map +1 -0
  196. package/internal/useIsTextTruncated.d.ts +24 -0
  197. package/internal/useIsTextTruncated.d.ts.map +1 -0
  198. package/internal/useIsTextTruncated.js +41 -0
  199. package/internal/useIsTextTruncated.js.map +1 -0
  200. package/internal/useKeyedSubmission.d.ts +49 -0
  201. package/internal/useKeyedSubmission.d.ts.map +1 -0
  202. package/internal/useKeyedSubmission.js +67 -0
  203. package/internal/useKeyedSubmission.js.map +1 -0
  204. package/package.json +7 -4
  205. package/session/SessionViewer.d.ts +2 -2
  206. package/session/SessionViewer.d.ts.map +1 -1
  207. package/session/SessionViewer.js +10 -4
  208. package/session/SessionViewer.js.map +1 -1
  209. package/session/index.d.ts +2 -0
  210. package/session/index.d.ts.map +1 -1
  211. package/session/index.js +1 -0
  212. package/session/index.js.map +1 -1
  213. package/session/inspector/ChangesTab.d.ts +8 -5
  214. package/session/inspector/ChangesTab.d.ts.map +1 -1
  215. package/session/inspector/ChangesTab.js +11 -8
  216. package/session/inspector/ChangesTab.js.map +1 -1
  217. package/session/inspector/SessionInspector.d.ts +4 -4
  218. package/session/inspector/SessionInspector.d.ts.map +1 -1
  219. package/session/inspector/SessionInspector.js +4 -4
  220. package/session/inspector/SessionInspector.js.map +1 -1
  221. package/session/inspector/index.d.ts +0 -2
  222. package/session/inspector/index.d.ts.map +1 -1
  223. package/session/inspector/index.js +0 -1
  224. package/session/inspector/index.js.map +1 -1
  225. package/session/inspector/useSessionInspector.d.ts +8 -4
  226. package/session/inspector/useSessionInspector.d.ts.map +1 -1
  227. package/session/inspector/useSessionInspector.js +27 -20
  228. package/session/inspector/useSessionInspector.js.map +1 -1
  229. package/session/useSessionConversation.d.ts +37 -3
  230. package/session/useSessionConversation.d.ts.map +1 -1
  231. package/session/useSessionConversation.js +18 -2
  232. package/session/useSessionConversation.js.map +1 -1
  233. package/session/useSessionFileChanges.d.ts +74 -0
  234. package/session/useSessionFileChanges.d.ts.map +1 -0
  235. package/session/useSessionFileChanges.js +178 -0
  236. package/session/useSessionFileChanges.js.map +1 -0
  237. package/src/__tests__/styles-border-layer-invariant.test.ts +105 -0
  238. package/src/execution/ApprovalCard.tsx +368 -230
  239. package/src/execution/ApprovalContext.ts +109 -0
  240. package/src/execution/ArtifactCard.tsx +10 -6
  241. package/src/execution/ArtifactPreviewModal.tsx +12 -6
  242. package/src/execution/EmptyChangeNotice.tsx +62 -0
  243. package/src/execution/FileChangesView.tsx +383 -0
  244. package/src/execution/FilePathLink.tsx +65 -12
  245. package/src/execution/FileReviewCard.tsx +1118 -0
  246. package/src/execution/FileReviewContext.ts +53 -0
  247. package/src/execution/FileReviewDock.tsx +157 -0
  248. package/src/execution/McpToolDetail.tsx +98 -32
  249. package/src/execution/MessageThread.tsx +374 -9
  250. package/src/execution/PlanArtifactCard.tsx +9 -6
  251. package/src/execution/PlanCompletionCard.tsx +1 -1
  252. package/src/execution/ResultView.tsx +333 -162
  253. package/src/execution/SubAgentSection.tsx +58 -11
  254. package/src/execution/TerminalSession.tsx +91 -0
  255. package/src/execution/TodoCard.tsx +186 -0
  256. package/src/execution/ToolArgsView.tsx +28 -17
  257. package/src/execution/ToolCallDetail.tsx +137 -26
  258. package/src/execution/ToolCallGroup.tsx +68 -296
  259. package/src/execution/ToolCallItem.tsx +265 -67
  260. package/src/execution/ToolRunGroup.tsx +302 -0
  261. package/src/execution/__tests__/ApprovalCard.test.tsx +395 -5
  262. package/src/execution/__tests__/ArtifactContentRenderer.test.tsx +15 -0
  263. package/src/execution/__tests__/ArtifactPreviewModal.test.tsx +0 -1
  264. package/src/execution/__tests__/EmptyChangeNotice.test.tsx +24 -0
  265. package/src/execution/__tests__/FileChangesView.test.tsx +296 -0
  266. package/src/execution/__tests__/FilePathLink.test.tsx +92 -0
  267. package/src/execution/__tests__/FileReviewCard.test.tsx +1044 -0
  268. package/src/execution/__tests__/FileReviewDock.test.tsx +134 -0
  269. package/src/execution/__tests__/McpToolDetail.test.tsx +79 -0
  270. package/src/execution/__tests__/MessageThread.test.tsx +324 -0
  271. package/src/execution/__tests__/PlanArtifactCard.test.tsx +37 -16
  272. package/src/execution/__tests__/ResultView.test.tsx +280 -2
  273. package/src/execution/__tests__/SubAgentSection.test.tsx +180 -0
  274. package/src/execution/__tests__/TerminalSession.test.tsx +72 -0
  275. package/src/execution/__tests__/TodoCard.test.tsx +102 -0
  276. package/src/execution/__tests__/ToolArgsView.test.tsx +48 -0
  277. package/src/execution/__tests__/ToolCallDetail.test.tsx +195 -0
  278. package/src/execution/__tests__/ToolCallGroup.test.tsx +132 -0
  279. package/src/execution/__tests__/ToolCallItem.test.tsx +521 -0
  280. package/src/execution/__tests__/ToolRunGroup.test.tsx +137 -0
  281. package/src/execution/__tests__/blanked-narration.test.tsx +149 -0
  282. package/src/execution/__tests__/buildThreadItems-approvals.test.ts +304 -0
  283. package/src/execution/__tests__/buildThreadItems-file-review.test.ts +331 -0
  284. package/src/execution/__tests__/file-path-resolver.test.ts +44 -0
  285. package/src/execution/__tests__/file-review-status.test.ts +343 -0
  286. package/src/execution/__tests__/message-entry.test.tsx +16 -0
  287. package/src/execution/__tests__/segment-tool-calls.test.ts +124 -0
  288. package/src/execution/__tests__/subagent-file-review-badge.test.tsx +273 -0
  289. package/src/execution/__tests__/thread-keys.test.ts +195 -0
  290. package/src/execution/__tests__/tool-presenter.test.tsx +95 -0
  291. package/src/execution/__tests__/useArtifactDownload.test.tsx +67 -0
  292. package/src/execution/__tests__/useArtifactDownloadUrl.test.tsx +51 -0
  293. package/src/execution/__tests__/useFileChangeContent.test.tsx +240 -0
  294. package/src/execution/__tests__/useFileReview.test.tsx +236 -0
  295. package/src/execution/__tests__/useSubmitApproval.test.tsx +165 -0
  296. package/src/execution/__tests__/useToolOutputContent.test.tsx +82 -0
  297. package/src/execution/approval-provenance.ts +8 -0
  298. package/src/execution/artifact-utils.ts +0 -18
  299. package/src/execution/execution-phases.ts +4 -16
  300. package/src/execution/file-path-resolver.ts +38 -0
  301. package/src/execution/file-review-status.ts +219 -0
  302. package/src/execution/index.ts +84 -4
  303. package/src/execution/segment-tool-calls.ts +101 -0
  304. package/src/execution/tool-categories.ts +128 -1
  305. package/src/execution/tool-presenter.ts +58 -3
  306. package/src/execution/tool-rendering-primitives.tsx +11 -14
  307. package/src/execution/useArtifactDownload.ts +109 -0
  308. package/src/execution/useArtifactDownloadUrl.ts +116 -0
  309. package/src/execution/useFileChangeContent.ts +149 -0
  310. package/src/execution/useFileReview.ts +197 -0
  311. package/src/execution/useSubmitApproval.ts +49 -27
  312. package/src/execution/useToolOutputContent.ts +70 -0
  313. package/src/index.ts +60 -1
  314. package/src/internal/ApprovalPeekBar.tsx +73 -0
  315. package/src/internal/BoundedContent.tsx +97 -0
  316. package/src/internal/DecisionButton.tsx +127 -0
  317. package/src/internal/InCardDecisionError.tsx +47 -0
  318. package/src/internal/RevealToggle.tsx +91 -0
  319. package/src/internal/VirtualizedThread.tsx +28 -2
  320. package/src/internal/__tests__/ApprovalPeekBar.test.tsx +34 -0
  321. package/src/internal/__tests__/BoundedContent.test.tsx +92 -0
  322. package/src/internal/__tests__/DecisionButton.test.tsx +107 -0
  323. package/src/internal/__tests__/RevealToggle.test.tsx +61 -0
  324. package/src/internal/__tests__/code-highlight.test.tsx +59 -0
  325. package/src/internal/__tests__/markdown-components.test.tsx +68 -2
  326. package/src/internal/__tests__/useAutoDisclosure.test.ts +74 -0
  327. package/src/internal/__tests__/useElapsedSince.test.tsx +68 -0
  328. package/src/internal/__tests__/useIsOverflowing.test.ts +36 -0
  329. package/src/internal/__tests__/useKeyedSubmission.test.tsx +126 -0
  330. package/src/internal/code-highlight.tsx +120 -0
  331. package/src/internal/markdown-components.tsx +20 -3
  332. package/src/internal/useAutoDisclosure.ts +58 -0
  333. package/src/internal/useElapsedSince.ts +72 -0
  334. package/src/internal/useIsOverflowing.ts +61 -0
  335. package/src/internal/useIsTextTruncated.ts +55 -0
  336. package/src/internal/useKeyedSubmission.ts +101 -0
  337. package/src/session/SessionViewer.tsx +21 -4
  338. package/src/session/__tests__/SessionViewer-fileReviewDock.test.tsx +198 -0
  339. package/src/session/__tests__/audienceWiring.test.tsx +4 -0
  340. package/src/session/__tests__/useSessionFileChanges.test.ts +303 -0
  341. package/src/session/index.ts +3 -0
  342. package/src/session/inspector/ChangesTab.tsx +20 -17
  343. package/src/session/inspector/SessionInspector.tsx +12 -10
  344. package/src/session/inspector/__tests__/ArtifactsTab.test.tsx +0 -1
  345. package/src/session/inspector/__tests__/ChangesTab.test.tsx +38 -0
  346. package/src/session/inspector/__tests__/useSessionInspector.test.ts +46 -61
  347. package/src/session/inspector/index.ts +0 -3
  348. package/src/session/inspector/useSessionInspector.ts +27 -20
  349. package/src/session/useSessionConversation.ts +80 -3
  350. package/src/session/useSessionFileChanges.ts +207 -0
  351. package/src/styles.css +123 -10
  352. package/src/version-history/DiffViewer.tsx +10 -7
  353. package/src/version-history/UnifiedDiffView.tsx +66 -0
  354. package/src/version-history/__tests__/DiffViewer.test.tsx +57 -0
  355. package/src/version-history/__tests__/UnifiedDiffView.test.tsx +50 -0
  356. package/src/version-history/__tests__/computeDiff.test.ts +35 -0
  357. package/src/version-history/__tests__/parseUnifiedDiff.test.ts +82 -0
  358. package/src/version-history/computeDiff.ts +6 -37
  359. package/src/version-history/diff-hunks.ts +63 -0
  360. package/src/version-history/index.ts +1 -0
  361. package/src/version-history/parseUnifiedDiff.ts +34 -0
  362. package/src/workflow/WorkflowExecutionApprovalCard.tsx +49 -24
  363. package/src/workflow/WorkflowExecutionTimeline.tsx +15 -4
  364. package/src/workflow/WorkflowExecutionTimelineEvent.tsx +8 -3
  365. package/src/workflow/WorkflowExecutionViewer.tsx +72 -28
  366. package/src/workflow/WorkflowFileReviewList.tsx +152 -0
  367. package/src/workflow/WorkflowTaskApprovalCard.tsx +37 -85
  368. package/src/workflow/__tests__/ExecutionInspector.test.tsx +30 -2
  369. package/src/workflow/__tests__/WorkflowExecutionApprovalCard.test.tsx +129 -0
  370. package/src/workflow/__tests__/WorkflowFileReviewList.test.tsx +129 -0
  371. package/src/workflow/__tests__/WorkflowTaskApprovalCard.test.tsx +43 -11
  372. package/src/workflow/__tests__/useWorkflowExecutionActions.test.tsx +276 -0
  373. package/src/workflow/execution-inspector/ExecutionInspector.tsx +42 -18
  374. package/src/workflow/index.ts +5 -0
  375. package/src/workflow/useWorkflowExecutionActions.ts +177 -29
  376. package/styles.css +1 -1
  377. package/version-history/DiffViewer.d.ts.map +1 -1
  378. package/version-history/DiffViewer.js +9 -3
  379. package/version-history/DiffViewer.js.map +1 -1
  380. package/version-history/UnifiedDiffView.d.ts +29 -0
  381. package/version-history/UnifiedDiffView.d.ts.map +1 -0
  382. package/version-history/UnifiedDiffView.js +36 -0
  383. package/version-history/UnifiedDiffView.js.map +1 -0
  384. package/version-history/computeDiff.d.ts +3 -1
  385. package/version-history/computeDiff.d.ts.map +1 -1
  386. package/version-history/computeDiff.js +5 -35
  387. package/version-history/computeDiff.js.map +1 -1
  388. package/version-history/diff-hunks.d.ts +21 -0
  389. package/version-history/diff-hunks.d.ts.map +1 -0
  390. package/version-history/diff-hunks.js +58 -0
  391. package/version-history/diff-hunks.js.map +1 -0
  392. package/version-history/index.d.ts +1 -0
  393. package/version-history/index.d.ts.map +1 -1
  394. package/version-history/index.js +1 -0
  395. package/version-history/index.js.map +1 -1
  396. package/version-history/parseUnifiedDiff.d.ts +22 -0
  397. package/version-history/parseUnifiedDiff.d.ts.map +1 -0
  398. package/version-history/parseUnifiedDiff.js +34 -0
  399. package/version-history/parseUnifiedDiff.js.map +1 -0
  400. package/workflow/WorkflowExecutionApprovalCard.d.ts +8 -1
  401. package/workflow/WorkflowExecutionApprovalCard.d.ts.map +1 -1
  402. package/workflow/WorkflowExecutionApprovalCard.js +17 -3
  403. package/workflow/WorkflowExecutionApprovalCard.js.map +1 -1
  404. package/workflow/WorkflowExecutionTimeline.d.ts +11 -2
  405. package/workflow/WorkflowExecutionTimeline.d.ts.map +1 -1
  406. package/workflow/WorkflowExecutionTimeline.js +2 -2
  407. package/workflow/WorkflowExecutionTimeline.js.map +1 -1
  408. package/workflow/WorkflowExecutionTimelineEvent.d.ts +4 -1
  409. package/workflow/WorkflowExecutionTimelineEvent.d.ts.map +1 -1
  410. package/workflow/WorkflowExecutionTimelineEvent.js +2 -2
  411. package/workflow/WorkflowExecutionTimelineEvent.js.map +1 -1
  412. package/workflow/WorkflowExecutionViewer.d.ts.map +1 -1
  413. package/workflow/WorkflowExecutionViewer.js +18 -10
  414. package/workflow/WorkflowExecutionViewer.js.map +1 -1
  415. package/workflow/WorkflowFileReviewList.d.ts +46 -0
  416. package/workflow/WorkflowFileReviewList.d.ts.map +1 -0
  417. package/workflow/WorkflowFileReviewList.js +48 -0
  418. package/workflow/WorkflowFileReviewList.js.map +1 -0
  419. package/workflow/WorkflowTaskApprovalCard.d.ts +8 -1
  420. package/workflow/WorkflowTaskApprovalCard.d.ts.map +1 -1
  421. package/workflow/WorkflowTaskApprovalCard.js +12 -19
  422. package/workflow/WorkflowTaskApprovalCard.js.map +1 -1
  423. package/workflow/execution-inspector/ExecutionInspector.d.ts +21 -4
  424. package/workflow/execution-inspector/ExecutionInspector.d.ts.map +1 -1
  425. package/workflow/execution-inspector/ExecutionInspector.js +6 -3
  426. package/workflow/execution-inspector/ExecutionInspector.js.map +1 -1
  427. package/workflow/index.d.ts +1 -0
  428. package/workflow/index.d.ts.map +1 -1
  429. package/workflow/index.js +1 -0
  430. package/workflow/index.js.map +1 -1
  431. package/workflow/useWorkflowExecutionActions.d.ts +62 -4
  432. package/workflow/useWorkflowExecutionActions.d.ts.map +1 -1
  433. package/workflow/useWorkflowExecutionActions.js +94 -18
  434. package/workflow/useWorkflowExecutionActions.js.map +1 -1
  435. package/session/inspector/PlanTab.d.ts +0 -15
  436. package/session/inspector/PlanTab.d.ts.map +0 -1
  437. package/session/inspector/PlanTab.js +0 -19
  438. package/session/inspector/PlanTab.js.map +0 -1
  439. package/src/session/inspector/PlanTab.tsx +0 -31
@@ -0,0 +1,197 @@
1
+ "use client";
2
+
3
+ import { useCallback, useMemo, useState } from "react";
4
+ import { create } from "@bufbuild/protobuf";
5
+ import {
6
+ FileDecisionAction,
7
+ FileDecisionScope,
8
+ } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/enum_pb";
9
+ import { SubmitFileDecisionInputSchema } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/io_pb";
10
+ import { useStigmer } from "../hooks";
11
+ import { toError } from "../internal/toError";
12
+
13
+ /** Options narrowing a file decision to a single file and binding its digest. */
14
+ export interface FileDecisionOptions {
15
+ /**
16
+ * Decision scope. Defaults to `FILE` when {@link fileChangeId} is set, else
17
+ * `CHANGE_SET` (the whole-set decision that covers every file).
18
+ */
19
+ readonly scope?: FileDecisionScope;
20
+ /** The captured file this decision targets; required for `FILE` scope. */
21
+ readonly fileChangeId?: string;
22
+ /**
23
+ * The digest the reviewer saw (`aggregate_digest` for CHANGE_SET,
24
+ * `file_digest` for FILE). The server enforces it at decision time and the
25
+ * runner re-verifies it at reconcile — "what you approve is what gets applied".
26
+ */
27
+ readonly expectedDigest?: string;
28
+ /** Optional free-text comment recorded on the decision (audit trail). */
29
+ readonly reason?: string;
30
+ /**
31
+ * Set on an APPROVE to consciously KEEP a change whose diff could not be fully
32
+ * reviewed. Honored only for a binary file at `FILE` scope (a binary has no
33
+ * text diff, but its exact bytes are captured and reconcilable). It never
34
+ * relaxes the digest gate, and is ignored for other incompleteness. See DD-16.
35
+ */
36
+ readonly acknowledgeUnreviewable?: boolean;
37
+ }
38
+
39
+ /** Return value of {@link useFileReview}. */
40
+ export interface UseFileReviewReturn {
41
+ /**
42
+ * Submit an approve/reject decision for a change set (or one file within it).
43
+ * Resolves when the backend accepts the decision; the execution stream will
44
+ * deliver the updated `file_change_sets` projection.
45
+ */
46
+ readonly submitFileDecision: (
47
+ executionId: string,
48
+ changeSetId: string,
49
+ action: FileDecisionAction,
50
+ options?: FileDecisionOptions,
51
+ ) => Promise<void>;
52
+ /**
53
+ * Keys (`changeSetId` for a whole-set decision, `changeSetId:fileChangeId` for
54
+ * a per-file one) currently being submitted — drives per-button loading state
55
+ * when a reviewer decides files independently. Build a key with
56
+ * {@link fileDecisionKey}.
57
+ */
58
+ readonly submittingDecisionKeys: ReadonlySet<string>;
59
+ /**
60
+ * Per-decision failures, keyed exactly like {@link submittingDecisionKeys}
61
+ * (via {@link fileDecisionKey}). This is the per-target parallel of the
62
+ * in-flight Set: a review card has many decision targets (the whole set plus
63
+ * each file), so a failure must be attributable to the *one* control that
64
+ * failed — a single scalar cannot say which file. {@link FileReviewCard}
65
+ * consumes this map to render the error in-card, beside the failed control.
66
+ */
67
+ readonly decisionErrors: ReadonlyMap<string, Error>;
68
+ /** Clear the error for one decision key (e.g. before a retry of that target). */
69
+ readonly clearDecisionError: (key: string) => void;
70
+ /**
71
+ * The most-recent decision failure, or `null` when healthy — a convenience
72
+ * mirror of {@link decisionErrors} for a headless consumer that wants a single
73
+ * error value (a banner). The map is authoritative for per-control surfacing.
74
+ */
75
+ readonly error: Error | null;
76
+ /** Reset every decision error (both {@link decisionErrors} and {@link error}). */
77
+ readonly clearError: () => void;
78
+ }
79
+
80
+ /**
81
+ * The loading-state key for a file decision: the change set id for a whole-set
82
+ * (CHANGE_SET) decision, or `changeSetId:fileChangeId` for a per-file one.
83
+ */
84
+ export function fileDecisionKey(changeSetId: string, fileChangeId?: string): string {
85
+ return fileChangeId ? `${changeSetId}:${fileChangeId}` : changeSetId;
86
+ }
87
+
88
+ /** A stable empty map so an error-free hook keeps a constant `decisionErrors` ref. */
89
+ const NO_DECISION_ERRORS: ReadonlyMap<string, Error> = new Map();
90
+
91
+ /**
92
+ * Behavior hook that wraps `agentExecution.submitFileDecision()` with per-decision
93
+ * loading state and error management — the file-review sibling of
94
+ * {@link useSubmitApproval}.
95
+ *
96
+ * File edits are reviewed as a captured change set (the `file_change_sets`
97
+ * projection), NOT as tool-call approvals. Platform builders who want full
98
+ * control over the review UI use this hook directly; those who prefer a drop-in
99
+ * surface use {@link FileReviewCard}, which accepts the callback shape this
100
+ * hook produces.
101
+ *
102
+ * @example
103
+ * ```tsx
104
+ * const { submitFileDecision, submittingDecisionKeys } = useFileReview();
105
+ *
106
+ * // Approve the whole change set:
107
+ * await submitFileDecision(executionId, changeSet.id, FileDecisionAction.APPROVE, {
108
+ * expectedDigest: changeSet.aggregateDigest,
109
+ * });
110
+ * ```
111
+ */
112
+ export function useFileReview(): UseFileReviewReturn {
113
+ const stigmer = useStigmer();
114
+ const [submittingKeys, setSubmittingKeys] = useState<ReadonlySet<string>>(
115
+ new Set(),
116
+ );
117
+ const [decisionErrors, setDecisionErrors] =
118
+ useState<ReadonlyMap<string, Error>>(NO_DECISION_ERRORS);
119
+ const [error, setError] = useState<Error | null>(null);
120
+
121
+ const clearDecisionError = useCallback((key: string) => {
122
+ setDecisionErrors((prev) => {
123
+ if (!prev.has(key)) return prev;
124
+ const next = new Map(prev);
125
+ next.delete(key);
126
+ return next;
127
+ });
128
+ }, []);
129
+
130
+ const clearError = useCallback(() => {
131
+ setDecisionErrors(NO_DECISION_ERRORS);
132
+ setError(null);
133
+ }, []);
134
+
135
+ const submitFileDecision = useCallback(
136
+ async (
137
+ executionId: string,
138
+ changeSetId: string,
139
+ action: FileDecisionAction,
140
+ options?: FileDecisionOptions,
141
+ ): Promise<void> => {
142
+ const fileChangeId = options?.fileChangeId ?? "";
143
+ const scope =
144
+ options?.scope ??
145
+ (fileChangeId ? FileDecisionScope.FILE : FileDecisionScope.CHANGE_SET);
146
+ const key = fileDecisionKey(changeSetId, fileChangeId || undefined);
147
+
148
+ setSubmittingKeys((prev) => {
149
+ const next = new Set(prev);
150
+ next.add(key);
151
+ return next;
152
+ });
153
+ // Clear this target's prior failure (and the scalar mirror) so a retry
154
+ // starts clean — the map and `error` are updated together, never drift.
155
+ clearDecisionError(key);
156
+ setError(null);
157
+
158
+ try {
159
+ const input = create(SubmitFileDecisionInputSchema, {
160
+ agentExecutionId: executionId,
161
+ changeSetId,
162
+ scope,
163
+ fileChangeId,
164
+ action,
165
+ expectedDigest: options?.expectedDigest ?? "",
166
+ reason: options?.reason ?? "",
167
+ acknowledgeUnreviewable: options?.acknowledgeUnreviewable ?? false,
168
+ });
169
+ await stigmer.agentExecution.submitFileDecision(input);
170
+ } catch (err) {
171
+ const e = toError(err);
172
+ setDecisionErrors((prev) => new Map(prev).set(key, e));
173
+ setError(e);
174
+ throw err;
175
+ } finally {
176
+ setSubmittingKeys((prev) => {
177
+ const next = new Set(prev);
178
+ next.delete(key);
179
+ return next;
180
+ });
181
+ }
182
+ },
183
+ [stigmer, clearDecisionError],
184
+ );
185
+
186
+ return useMemo(
187
+ () => ({
188
+ submitFileDecision,
189
+ submittingDecisionKeys: submittingKeys,
190
+ decisionErrors,
191
+ clearDecisionError,
192
+ error,
193
+ clearError,
194
+ }),
195
+ [submitFileDecision, submittingKeys, decisionErrors, clearDecisionError, error, clearError],
196
+ );
197
+ }
@@ -1,11 +1,12 @@
1
1
  "use client";
2
2
 
3
- import { useCallback, useState } from "react";
3
+ import { useCallback, useMemo, useState } from "react";
4
4
  import { create } from "@bufbuild/protobuf";
5
5
  import { ApprovalAction } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/enum_pb";
6
6
  import { SubmitApprovalInputSchema } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/io_pb";
7
7
  import { useStigmer } from "../hooks";
8
8
  import { toError } from "../internal/toError";
9
+ import { useKeyedSubmission } from "../internal/useKeyedSubmission";
9
10
 
10
11
  /** Return value of {@link useSubmitApproval}. */
11
12
  export interface UseSubmitApprovalReturn {
@@ -26,9 +27,24 @@ export interface UseSubmitApprovalReturn {
26
27
  * approve one tool while another decision is still in flight.
27
28
  */
28
29
  readonly submittingToolCallIds: ReadonlySet<string>;
29
- /** Error from the last failed approval submission, or `null` when healthy. */
30
+ /**
31
+ * Per-tool-call failures, keyed by `toolCallId` exactly like
32
+ * {@link submittingToolCallIds}. This is the per-target parallel of the
33
+ * in-flight Set: a thread can hold many simultaneous gates (one per inline
34
+ * tool row, plus the bottom backstop), so a failure must be attributable to
35
+ * the *one* gate that failed — a single scalar cannot say which. {@link
36
+ * ApprovalCard} / {@link ApprovalCardBody} consume this (threaded via
37
+ * {@link ApprovalContext}) to render the error in-card, beside the failed gate.
38
+ */
39
+ readonly errorsByToolCallId: ReadonlyMap<string, Error>;
40
+ /**
41
+ * Error from the last failed approval submission, or `null` when healthy — a
42
+ * convenience mirror of {@link errorsByToolCallId} for a headless consumer
43
+ * that wants a single error value (e.g. a banner, or the `ink` surface). The
44
+ * map is authoritative for per-gate surfacing.
45
+ */
30
46
  readonly error: Error | null;
31
- /** Reset `error` to `null`. */
47
+ /** Reset every approval error (both {@link errorsByToolCallId} and {@link error}). */
32
48
  readonly clearError: () => void;
33
49
  }
34
50
 
@@ -54,12 +70,16 @@ export interface UseSubmitApprovalReturn {
54
70
  */
55
71
  export function useSubmitApproval(): UseSubmitApprovalReturn {
56
72
  const stigmer = useStigmer();
57
- const [submittingIds, setSubmittingIds] = useState<ReadonlySet<string>>(
58
- new Set(),
59
- );
73
+ // Per-gate in-flight + error state, keyed by tool-call id, lives in the
74
+ // shared keyed-submission primitive. The scalar `error` below is a thin
75
+ // mirror kept in lockstep for headless / ink consumers.
76
+ const keyed = useKeyedSubmission<void>();
60
77
  const [error, setError] = useState<Error | null>(null);
61
78
 
62
- const clearError = useCallback(() => setError(null), []);
79
+ const clearError = useCallback(() => {
80
+ keyed.clearErrors();
81
+ setError(null);
82
+ }, [keyed.clearErrors]);
63
83
 
64
84
  const submitApproval = useCallback(
65
85
  async (
@@ -68,34 +88,36 @@ export function useSubmitApproval(): UseSubmitApprovalReturn {
68
88
  action: ApprovalAction,
69
89
  comment?: string,
70
90
  ): Promise<void> => {
71
- setSubmittingIds((prev) => {
72
- const next = new Set(prev);
73
- next.add(toolCallId);
74
- return next;
75
- });
91
+ // Clear the scalar mirror at submit-start; `keyed.run` clears this gate's
92
+ // keyed entry, so the map and `error` are updated together and never drift.
76
93
  setError(null);
77
-
78
94
  try {
79
- const input = create(SubmitApprovalInputSchema, {
80
- agentExecutionId: executionId,
81
- toolCallId,
82
- action,
83
- comment: comment ?? "",
95
+ await keyed.run(toolCallId, async () => {
96
+ await stigmer.agentExecution.submitApproval(
97
+ create(SubmitApprovalInputSchema, {
98
+ agentExecutionId: executionId,
99
+ toolCallId,
100
+ action,
101
+ comment: comment ?? "",
102
+ }),
103
+ );
84
104
  });
85
- await stigmer.agentExecution.submitApproval(input);
86
105
  } catch (err) {
87
106
  setError(toError(err));
88
107
  throw err;
89
- } finally {
90
- setSubmittingIds((prev) => {
91
- const next = new Set(prev);
92
- next.delete(toolCallId);
93
- return next;
94
- });
95
108
  }
96
109
  },
97
- [stigmer],
110
+ [stigmer, keyed.run],
98
111
  );
99
112
 
100
- return { submitApproval, submittingToolCallIds: submittingIds, error, clearError };
113
+ return useMemo(
114
+ () => ({
115
+ submitApproval,
116
+ submittingToolCallIds: keyed.submittingKeys,
117
+ errorsByToolCallId: keyed.errorsByKey,
118
+ error,
119
+ clearError,
120
+ }),
121
+ [submitApproval, keyed.submittingKeys, keyed.errorsByKey, error, clearError],
122
+ );
101
123
  }
@@ -0,0 +1,70 @@
1
+ "use client";
2
+
3
+ import { useMemo } from "react";
4
+ import type { ToolCallOutputRef } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/message_pb";
5
+ import { useArtifactContent } from "./useArtifactContent";
6
+ import { execIdFromStorageKey } from "./useFileChangeContent";
7
+
8
+ /** Return value of {@link useToolOutputContent}. */
9
+ export interface UseToolOutputContentReturn {
10
+ /**
11
+ * Full text content of the offloaded tool output, or `null` while the
12
+ * request is in-flight, failed, or the hook is disabled.
13
+ */
14
+ readonly content: string | null;
15
+ /** `true` while the content request is in-flight. */
16
+ readonly isLoading: boolean;
17
+ /**
18
+ * `true` when the server truncated the content at its size cap. The inline
19
+ * view is then incomplete — offer a full download via the presigned URL.
20
+ */
21
+ readonly isTruncated: boolean;
22
+ /** Error from a failed fetch, or `null`. */
23
+ readonly error: Error | null;
24
+ }
25
+
26
+ /**
27
+ * Minimal shape this hook needs from an offloaded-output reference. Both a full
28
+ * {@link ToolCallOutputRef} and the SDK's normalized `outputRef` view satisfy it.
29
+ */
30
+ export type ToolOutputRefLike = Pick<ToolCallOutputRef, "storageKey" | "contentHash">;
31
+
32
+ /**
33
+ * Behavior hook that resolves the full text of a tool output that the runner
34
+ * offloaded to artifact storage (a {@link ToolCallOutputRef}).
35
+ *
36
+ * Mirrors {@link useFileChangeContent}: it ignores any URL baked into the ref
37
+ * and fetches the bytes on demand through the CORS-safe `getArtifactContent`
38
+ * endpoint, deriving the execution id from the ref's own `storageKey`
39
+ * (`artifacts/{executionId}/...`). This is what lets a "View full output" link
40
+ * keep working long after the original presigned URL would have expired.
41
+ *
42
+ * Fetching is gated by `enabled` so callers can defer the request until the
43
+ * user actually expands the output (lazy), keeping long threads cheap.
44
+ *
45
+ * @param outputRef - The offloaded-output reference, or `null` to skip.
46
+ * @param enabled - When `false`, the hook stays idle. Defaults to `true`.
47
+ *
48
+ * @see useArtifactContent — the underlying content fetch
49
+ * @see useArtifactDownloadUrl — for the truncated/binary full-download fallback
50
+ */
51
+ export function useToolOutputContent(
52
+ outputRef: ToolOutputRefLike | null | undefined,
53
+ enabled = true,
54
+ ): UseToolOutputContentReturn {
55
+ const storageKey = outputRef?.storageKey || null;
56
+ const active = enabled && !!storageKey;
57
+ const executionId = active ? execIdFromStorageKey(storageKey!) : null;
58
+
59
+ const { content, isLoading, isTruncated, error } = useArtifactContent(
60
+ active ? executionId : null,
61
+ active ? storageKey : null,
62
+ null,
63
+ outputRef?.contentHash || undefined,
64
+ );
65
+
66
+ return useMemo(
67
+ () => ({ content, isLoading, isTruncated, error }),
68
+ [content, isLoading, isTruncated, error],
69
+ );
70
+ }
package/src/index.ts CHANGED
@@ -95,6 +95,7 @@ export {
95
95
  useSessionConversation,
96
96
  useSessionArtifacts,
97
97
  useSessionWriteBacks,
98
+ useSessionFileChanges,
98
99
  useSessionUsage,
99
100
  useAgentRefFromSession,
100
101
  useNewSessionFlow,
@@ -134,6 +135,7 @@ export type {
134
135
  UseSessionArtifactsReturn,
135
136
  SessionWriteBackEntry,
136
137
  UseSessionWriteBacksReturn,
138
+ UseSessionFileChangesReturn,
137
139
  ModelCostEntry,
138
140
  UseSessionUsageReturn,
139
141
  UseAgentRefFromSessionReturn,
@@ -182,11 +184,22 @@ export {
182
184
  useExecutionStream,
183
185
  useAgentExecutionActions,
184
186
  useSubmitApproval,
187
+ useFileReview,
188
+ fileDecisionKey,
189
+ fileReviewability,
190
+ changeSetReviewability,
191
+ deriveEffectiveVerdicts,
192
+ changeForRowPath,
193
+ fileReviewRowState,
194
+ foldFileReviewEventStream,
195
+ displayFileChangeSets,
196
+ toDisplayFileChange,
185
197
  ExecutionPhaseBadge,
186
198
  InteractionModeBadge,
187
199
  SetupProgress,
188
200
  ExecutionProgress,
189
201
  TodoList,
202
+ TodoCard,
190
203
  TodoInProgressIcon,
191
204
  findActiveTodo,
192
205
  todoCompletionSummary,
@@ -202,6 +215,7 @@ export {
202
215
  ToolCallDetail,
203
216
  ResultView,
204
217
  summarizeResultView,
218
+ TerminalSession,
205
219
  useToolPresentation,
206
220
  registerToolPresenter,
207
221
  getToolPresenter,
@@ -209,6 +223,7 @@ export {
209
223
  resolveToolCategoryFromCall,
210
224
  resolveToolCategoryFromKind,
211
225
  toolKindToCategoryInfo,
226
+ defaultDisclosureForCategory,
212
227
  McpToolDetail,
213
228
  parseMcpResult,
214
229
  formatDuration,
@@ -220,6 +235,14 @@ export {
220
235
  ThreadSkeleton,
221
236
  FollowUpInput,
222
237
  ApprovalCard,
238
+ ApprovalCardHeader,
239
+ ApprovalCardBody,
240
+ FileReviewCard,
241
+ FileReviewDock,
242
+ ApprovalContext,
243
+ useApproval,
244
+ FileReviewContext,
245
+ useFileReviewRowState,
223
246
  ArtifactCard,
224
247
  ArtifactContentRenderer,
225
248
  ArtifactPreviewContent,
@@ -238,10 +261,17 @@ export {
238
261
  SessionVariablesInput,
239
262
  useExecutionArtifacts,
240
263
  useArtifactContent,
264
+ useArtifactDownloadUrl,
265
+ useArtifactDownload,
266
+ useToolOutputContent,
267
+ useFileChangeContent,
268
+ execIdFromStorageKey,
241
269
  useWorkspaceWriteBacks,
242
270
  WriteBackCard,
271
+ FileChangesView,
272
+ FileChangeDiff,
273
+ EmptyChangeNotice,
243
274
  isTextArtifact,
244
- isArtifactExpired,
245
275
  formatArtifactSize,
246
276
  getArtifactExtension,
247
277
  getFileExtension,
@@ -255,11 +285,18 @@ export type {
255
285
  UseAgentExecutionActionsOptions,
256
286
  UseAgentExecutionActionsReturn,
257
287
  UseSubmitApprovalReturn,
288
+ UseFileReviewReturn,
289
+ FileDecisionOptions,
290
+ FileReviewability,
291
+ FileBlockReason,
292
+ ChangeSetReviewability,
293
+ FileReviewRowState,
258
294
  ExecutionPhaseBadgeProps,
259
295
  InteractionModeBadgeProps,
260
296
  SetupProgressProps,
261
297
  ExecutionProgressProps,
262
298
  TodoListProps,
299
+ TodoCardProps,
263
300
  UsageWidgetProps,
264
301
  ContextGaugeProps,
265
302
  SummarizationBadgeProps,
@@ -271,8 +308,10 @@ export type {
271
308
  ToolCallGroupProps,
272
309
  ToolCallDetailProps,
273
310
  ResultViewProps,
311
+ TerminalSessionProps,
274
312
  ToolPresentation,
275
313
  ToolPresenter,
314
+ ToolDisclosure,
276
315
  McpToolDetailProps,
277
316
  McpArgsViewProps,
278
317
  McpMetadataRowProps,
@@ -284,6 +323,13 @@ export type {
284
323
  ThreadSkeletonProps,
285
324
  FollowUpInputProps,
286
325
  ApprovalCardProps,
326
+ ApprovalCardHeaderProps,
327
+ ApprovalCardBodyProps,
328
+ FileReviewCardProps,
329
+ FileReviewDockProps,
330
+ ApprovalContextValue,
331
+ UseApprovalResult,
332
+ FileReviewContextValue,
287
333
  ArtifactCardProps,
288
334
  ArtifactContentRendererProps,
289
335
  ArtifactRenderMode,
@@ -300,8 +346,18 @@ export type {
300
346
  SessionVariablesInputProps,
301
347
  UseExecutionArtifactsReturn,
302
348
  UseArtifactContentReturn,
349
+ UseArtifactDownloadUrlReturn,
350
+ UseArtifactDownloadUrlOptions,
351
+ UseArtifactDownloadReturn,
352
+ UseToolOutputContentReturn,
353
+ ToolOutputRefLike,
354
+ UseFileChangeContentReturn,
303
355
  UseWorkspaceWriteBacksReturn,
304
356
  WriteBackCardProps,
357
+ FileChangesViewProps,
358
+ FileChangeDiffProps,
359
+ EmptyChangeNoticeProps,
360
+ EmptyChangeKind,
305
361
  } from "./execution";
306
362
 
307
363
  // Execution — proto type re-exports for artifact consumers
@@ -1207,6 +1263,7 @@ export {
1207
1263
  WorkflowExecutionCostPanel,
1208
1264
  WorkflowExecutionArtifactPanel,
1209
1265
  WorkflowExecutionApprovalCard,
1266
+ WorkflowFileReviewList,
1210
1267
  serializeWorkflowYaml,
1211
1268
  parseWorkflowYaml,
1212
1269
  useWorkflowYaml,
@@ -1318,6 +1375,8 @@ export type {
1318
1375
  WorkflowExecutionCostPanelProps,
1319
1376
  WorkflowExecutionArtifactPanelProps,
1320
1377
  WorkflowExecutionApprovalCardProps,
1378
+ WorkflowFileReviewListProps,
1379
+ WorkflowFileDecisionSubmit,
1321
1380
  UseWorkflowYamlReturn,
1322
1381
  UseWorkflowSaveReturn,
1323
1382
  UseWorkflowValidationReturn,
@@ -0,0 +1,73 @@
1
+ "use client";
2
+
3
+ import { cn } from "@stigmer/theme";
4
+
5
+ interface ApprovalPeekBarProps {
6
+ /** Whether the bar is shown — typically `notFollowing && count > 0`. */
7
+ readonly visible: boolean;
8
+ /** Number of unresolved approvals, for the label ("1 approval needed"). */
9
+ readonly count: number;
10
+ /** Jumps to the live frontier where the gated tool call (and its inline approval) sits. */
11
+ readonly onClick: () => void;
12
+ }
13
+
14
+ /**
15
+ * Floating affordance that surfaces a pending approval the user has scrolled
16
+ * away from. A run halts at its first approval gate, so the waiting tool call
17
+ * sits at the live frontier — clicking jumps there (reusing the thread's
18
+ * existing jump-to-latest), landing on the inline approval card.
19
+ *
20
+ * Takes the {@link JumpToLatestButton}'s slot when approvals are pending (the
21
+ * two are mutually exclusive by the caller), styled in `warning` so a gate is
22
+ * never missed off-screen. Always mounted for enter/exit transitions.
23
+ *
24
+ * @internal Not part of the public API.
25
+ */
26
+ export function ApprovalPeekBar({ visible, count, onClick }: ApprovalPeekBarProps) {
27
+ const label =
28
+ count === 1 ? "1 approval needed" : `${count} approvals needed`;
29
+
30
+ return (
31
+ <button
32
+ type="button"
33
+ onClick={onClick}
34
+ aria-label={`${label} — jump to it`}
35
+ aria-hidden={!visible}
36
+ tabIndex={visible ? 0 : -1}
37
+ className={cn(
38
+ "absolute bottom-3 left-1/2 z-10 -translate-x-1/2",
39
+ "flex items-center gap-1.5 rounded-full",
40
+ "border border-warning/40 bg-warning/10 px-3 py-1.5",
41
+ "text-xs font-medium text-warning shadow-md",
42
+ "transition-[opacity,transform] duration-[var(--stgm-motion-duration)]",
43
+ "hover:bg-warning/20",
44
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
45
+ visible
46
+ ? "pointer-events-auto translate-y-0 opacity-100"
47
+ : "pointer-events-none translate-y-2 opacity-0",
48
+ )}
49
+ >
50
+ <ClockIcon />
51
+ {label}
52
+ </button>
53
+ );
54
+ }
55
+
56
+ function ClockIcon() {
57
+ return (
58
+ <svg
59
+ width="14"
60
+ height="14"
61
+ viewBox="0 0 12 12"
62
+ fill="none"
63
+ stroke="currentColor"
64
+ strokeWidth="1.5"
65
+ strokeLinecap="round"
66
+ strokeLinejoin="round"
67
+ aria-hidden="true"
68
+ >
69
+ <circle cx="6" cy="6" r="4.5" />
70
+ <path d="M6 3.5V6L7.5 7.5" />
71
+ </svg>
72
+ );
73
+ }