@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,558 @@
1
+ "use client";
2
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { memo, useCallback, useEffect, useId, useMemo, useState } from "react";
4
+ import { FileCaptureClass, FileChangeKind, FileDecisionAction, FileDecisionOrigin, FileDecisionScope, } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/enum_pb";
5
+ import { toDisplayFileChange } from "@stigmer/sdk";
6
+ import { cn } from "@stigmer/theme";
7
+ import { FileChangeDiff } from "./FileChangesView";
8
+ import { DiffSummary } from "../version-history/DiffSummary";
9
+ import { DecisionButton } from "../internal/DecisionButton";
10
+ import { InCardDecisionError } from "../internal/InCardDecisionError";
11
+ import { splitDisplayPath } from "./file-path-resolver";
12
+ import { fileDecisionKey } from "./useFileReview";
13
+ import { changeSetReviewability, deriveEffectiveVerdicts, fileReviewability, } from "./file-review-status";
14
+ /** A stable empty set so the default `submittingDecisionKeys` keeps a constant ref. */
15
+ const NO_KEYS = new Set();
16
+ /** A stable empty map so the default `decisionErrors` keeps a constant ref. */
17
+ const NO_ERRORS = new Map();
18
+ /**
19
+ * Renders a captured {@link FileChangeSet} as a **compact decision bar**: one
20
+ * line carrying the set summary and the whole-set decision controls, with the
21
+ * per-file detail behind an expander. What the expander holds depends on
22
+ * {@link FileReviewCardProps.showDiffs}: the diff-rich body (default — for
23
+ * surfaces where this card is the only review surface) or a compact file list
24
+ * (the session thread, whose stamped edit rows already show every diff in
25
+ * place). A set that needs per-file attention (binary acknowledgment, blocked
26
+ * files, mid-review) starts expanded.
27
+ *
28
+ * File edits are reviewed as a captured workspace delta, not tool calls, so this
29
+ * is a dedicated decision surface distinct from the message transcript and the
30
+ * tool-approval {@link ApprovalCard}. The reviewer can decide each file
31
+ * individually (Keep / Discard, a `FILE`-scoped decision) or act on the whole
32
+ * set at once (Approve / Reject, a `CHANGE_SET` decision). Either way the runner
33
+ * reconciles the exact approved bytes with hash verification.
34
+ *
35
+ * The unified HITL gate clears only when EVERY file has a verdict — one
36
+ * `CHANGE_SET` decision, or a `FILE` decision per file — so a partially-decided
37
+ * set stays actionable and deciding the last file is what resumes the turn. A
38
+ * per-file verdict is changeable while the set is still open: clicking the other
39
+ * option records a new decision (the backend reconcile is last-write-wins).
40
+ *
41
+ * A `binary-only` set (binary files are the only blocker) can be kept in one
42
+ * action: the bulk button reads "Keep all" and carries the acknowledgment
43
+ * (DD-17). A `blocked` set (something unavailable to review) cannot be approved
44
+ * as a whole — the Approve button is disabled with an explanation, and the
45
+ * per-file path is the escape: keep the reviewable files and discard the rest.
46
+ *
47
+ * Each non-reviewable file is labeled honestly by {@link fileReviewability}: a
48
+ * `binary` change has no text diff to review; an `unavailable` change is one
49
+ * whose diff isn't available at all, with the honest cause the runner recorded
50
+ * (a secret path whose bytes were never captured, or a diff dropped to bound the
51
+ * status — doc 15). Both are discard-only, and their Keep affordance is disabled
52
+ * with the reason associated via `aria-describedby`. Files captured outside
53
+ * normal git tracking (gitignored / non-git CAS) carry a small provenance badge
54
+ * so the reviewer knows the change is not part of the repo's tracked history.
55
+ *
56
+ * Wrapped in `React.memo` — the streamed `FileChangeSet` reference is preserved
57
+ * by structural sharing when unchanged, so review cards skip re-renders during
58
+ * unrelated stream updates.
59
+ *
60
+ * @example
61
+ * ```tsx
62
+ * const { submitFileDecision, submittingDecisionKeys } = useFileReview();
63
+ * <FileReviewCard
64
+ * fileChangeSet={changeSet}
65
+ * onSubmit={(action, opts) => submitFileDecision(executionId, changeSet.id, action, opts)}
66
+ * submittingDecisionKeys={submittingDecisionKeys}
67
+ * />
68
+ * ```
69
+ */
70
+ export const FileReviewCard = memo(function FileReviewCard({ fileChangeSet, onSubmit, submittingDecisionKeys = NO_KEYS, decisionErrors = NO_ERRORS, interactive = true, showDiffs = true, className, }) {
71
+ const changes = fileChangeSet.changes;
72
+ const total = changes.length;
73
+ const setId = fileChangeSet.id;
74
+ // Each file's current verdict, a last-write-wins fold over the ledger-ordered
75
+ // FILE decisions (the same precedence the runner reconcile applies). Drives
76
+ // which per-file option reads as selected and the reviewed-count progress.
77
+ const verdictByFileId = useMemo(() => deriveFileVerdicts(fileChangeSet.decisions), [fileChangeSet.decisions]);
78
+ const decidedCount = verdictByFileId.size;
79
+ // The EFFECTIVE verdicts for history (a CHANGE_SET decision covers every file
80
+ // a FILE decision does not override — the reconcile's own precedence), so a
81
+ // settled "Keep all" set reads every file as kept, never "Not reviewed".
82
+ // Interactive per-file selection deliberately keeps the FILE-only fold above.
83
+ const effectiveVerdicts = useMemo(() => deriveEffectiveVerdicts(fileChangeSet), [fileChangeSet]);
84
+ // The set-level reviewability drives the bulk affordance. A "binary-only" set
85
+ // (binary files are the ONLY blocker) is keepable in one acknowledged action
86
+ // ("Keep all", DD-17); a "blocked" set (a secret/elided file with no keepable
87
+ // bytes) can never be approved at once and must be resolved per file.
88
+ const reviewability = changeSetReviewability(fileChangeSet);
89
+ const incomplete = reviewability !== "complete";
90
+ const binaryOnly = reviewability === "binary-only";
91
+ // Per-file controls earn their space when there is more than one file OR when a
92
+ // lone file is not reviewable — a single binary needs its per-file "Keep anyway"
93
+ // (FILE-scope, acknowledged), which the CHANGE_SET-scoped bulk controls can't
94
+ // offer. A single COMPLETE file stays decided once via the bar's bulk controls.
95
+ const showPerFile = total > 1 || incomplete;
96
+ // The bulk (CHANGE_SET) controls live on the bar for multi-file sets and for a
97
+ // single complete file; they are hidden for a single incomplete file, whose
98
+ // only honest decision is the per-file control in the expanded body (a single
99
+ // binary uses its per-file "Keep anyway" — DD-16 — and a blocked lone file can
100
+ // only be discarded).
101
+ const showBulkControls = total > 1 || !incomplete;
102
+ // The bar starts expanded exactly when the collapsed bar cannot honestly carry
103
+ // the decision: an incomplete set (binary acknowledgment / blocked files need
104
+ // their per-file context) or a review already in progress. A complete set and
105
+ // a settled record start collapsed — the transcript's stamped rows already
106
+ // show what changed, and the expander reveals the per-file detail on demand.
107
+ const [expanded, setExpanded] = useState(() => interactive && (incomplete || decidedCount > 0));
108
+ const bodyId = useId();
109
+ const wholeSetSubmitting = submittingDecisionKeys.has(setId);
110
+ const wholeSetError = decisionErrors.get(setId) ?? null;
111
+ // Bulk (CHANGE_SET) decision state — mirrors ApprovalCardBody: one active
112
+ // action drives the clicked button's spinner, cleared when the RPC settles.
113
+ const [activeAction, setActiveAction] = useState(null);
114
+ useEffect(() => {
115
+ if (!wholeSetSubmitting)
116
+ setActiveAction(null);
117
+ }, [wholeSetSubmitting]);
118
+ const handleBulk = useCallback((action) => {
119
+ setActiveAction(action);
120
+ // Whole-set decision: CHANGE_SET scope, bound to the aggregate digest the
121
+ // reviewer saw (the enforcement gate the runner re-verifies at reconcile).
122
+ // A "Keep all" on a binary-only set carries the acknowledgment: the
123
+ // binaries have no text diff but reconcilable bytes, so the user
124
+ // consciously keeps the whole set (DD-17). The server honors it only when
125
+ // every incompleteness is binary and never relaxes the digest gate.
126
+ onSubmit?.(action, {
127
+ scope: FileDecisionScope.CHANGE_SET,
128
+ expectedDigest: fileChangeSet.aggregateDigest,
129
+ acknowledgeUnreviewable: action === FileDecisionAction.APPROVE && binaryOnly,
130
+ });
131
+ }, [onSubmit, fileChangeSet.aggregateDigest, binaryOnly]);
132
+ const handleFileDecide = useCallback((change, action) => {
133
+ // Per-file decision: FILE scope correlated by the change id, bound to that
134
+ // file's digest (echoed verbatim — the server compares it against the same
135
+ // captured value, so it can never spuriously mismatch). A "Keep anyway" on a
136
+ // binary file carries the acknowledgment: it has no text diff, but its exact
137
+ // bytes are captured and reconcilable, so the user consciously keeps it
138
+ // (DD-16). The server honors this only for a binary file and never relaxes
139
+ // the digest gate.
140
+ onSubmit?.(action, {
141
+ scope: FileDecisionScope.FILE,
142
+ fileChangeId: change.id,
143
+ expectedDigest: change.fileDigest,
144
+ acknowledgeUnreviewable: action === FileDecisionAction.APPROVE &&
145
+ fileReviewability(change).kind === "binary",
146
+ });
147
+ }, [onSubmit]);
148
+ const totals = useMemo(() => {
149
+ let additions = 0;
150
+ let deletions = 0;
151
+ for (const c of changes) {
152
+ if (c.kind === FileChangeKind.ADD)
153
+ additions += 1;
154
+ else if (c.kind === FileChangeKind.DELETE)
155
+ deletions += 1;
156
+ }
157
+ return { additions, deletions };
158
+ }, [changes]);
159
+ // Which non-reviewable classes are present in the set — folded once (memoized
160
+ // like `totals`, DD-010) so the blocked-set copy is accurate to what's actually
161
+ // here (never the generic "binary or truncated").
162
+ const blockSummary = useMemo(() => {
163
+ let hasBinary = false;
164
+ let hasUnavailable = false;
165
+ for (const c of changes) {
166
+ const r = fileReviewability(c);
167
+ if (r.kind === "binary")
168
+ hasBinary = true;
169
+ else if (r.kind === "unavailable")
170
+ hasUnavailable = true;
171
+ }
172
+ return { hasBinary, hasUnavailable };
173
+ }, [changes]);
174
+ // Associates the disabled whole-set Approve with the notice explaining why it
175
+ // is unavailable (a11y: a disabled action is never an unexplained dead end).
176
+ const incompleteNoticeId = useId();
177
+ const labels = bulkLabels(total, decidedCount, binaryOnly);
178
+ // A set the DD-28 policy kept (every change produced by a command the user
179
+ // already approved) says so explicitly: consent was given at the command
180
+ // gate, and the record must never read as if a human reviewed it here.
181
+ const autoKept = !interactive && isPolicyAutoKept(fileChangeSet);
182
+ const summary = interactive
183
+ ? `${total} file${total === 1 ? "" : "s"} awaiting review`
184
+ : autoKept
185
+ ? "Kept automatically — produced by a command you approved"
186
+ : settledSummary(total, changes, effectiveVerdicts);
187
+ return (_jsxs("div", {
188
+ // Interactive: an actionable alert (a pending gate). Read-only: a passive
189
+ // historical record, so a neutral group without the warning accent.
190
+ role: interactive ? "alert" : "group", "aria-label": interactive
191
+ ? `Review ${total} file change${total === 1 ? "" : "s"}`
192
+ : `${total} file change${total === 1 ? "" : "s"}`, className: cn("rounded-lg border border-border-prominent", interactive && "border-l-2 border-l-warning", className), children: [_jsxs("div", { className: "flex flex-wrap items-center gap-2 px-2.5 py-1.5 text-xs", children: [_jsx("span", { className: "shrink-0 font-medium text-foreground", children: interactive ? "Review file changes" : "File changes" }), _jsx("span", { className: "min-w-0 flex-1 truncate text-muted-foreground", children: summary }), interactive && showBulkControls && (_jsxs(_Fragment, { children: [_jsx(DecisionButton, { label: labels.approve, variant: "primary", onClick: () => handleBulk(FileDecisionAction.APPROVE), isActive: activeAction === FileDecisionAction.APPROVE, isSubmitting: wholeSetSubmitting, disabled: incomplete && !binaryOnly, ariaDescribedby: incomplete ? incompleteNoticeId : undefined, cursorTarget: "file-review-approve" }), _jsx(DecisionButton, { label: labels.reject, variant: "danger", onClick: () => handleBulk(FileDecisionAction.REJECT), isActive: activeAction === FileDecisionAction.REJECT, isSubmitting: wholeSetSubmitting, cursorTarget: "file-review-reject" })] })), _jsxs("button", { type: "button", "aria-expanded": expanded, "aria-controls": bodyId, onClick: () => setExpanded((v) => !v), "data-cursor-target": "file-review-expander", className: cn("inline-flex shrink-0 items-center gap-1 rounded-md border border-border px-2 py-1", "text-xs font-medium text-muted-foreground transition-colors", "hover:bg-accent-hover hover:text-foreground", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"), children: [expanded ? "Hide" : !interactive ? "Show" : showDiffs ? "Review" : "Files", _jsx(ExpanderChevron, { expanded: expanded })] })] }), interactive && incomplete && showBulkControls && (_jsx("p", { id: incompleteNoticeId, className: "px-2.5 pb-1.5 text-[11px] italic text-muted-foreground", children: incompleteNotice(showPerFile, blockSummary, binaryOnly) })), interactive && wholeSetError && (_jsx("div", { className: "px-2.5 pb-1.5", children: _jsx(InCardDecisionError, { error: wholeSetError, leadIn: "submit decision", cursorTarget: "file-review-error" }) })), expanded && (_jsxs("div", { id: bodyId, className: "space-y-2 border-t border-border-muted px-3 py-2.5", children: [showDiffs && (_jsx(DiffSummary, { fileCount: total, additions: totals.additions, deletions: totals.deletions })), !interactive
193
+ ? // Settled: every file paired with its committed EFFECTIVE
194
+ // verdict (a bulk decision covers files without their own), no
195
+ // controls — a record of what changed and how it was decided.
196
+ changes.map((change) => (_jsx(SettledFileRow, { change: change, verdict: effectiveVerdicts.get(change.id) ?? null, showDiffs: showDiffs }, change.id)))
197
+ : showPerFile
198
+ ? changes.map((change) => (_jsx(FileChangeReviewRow, { change: change, verdict: verdictByFileId.get(change.id) ?? null, isSubmitting: submittingDecisionKeys.has(fileDecisionKey(setId, change.id)) ||
199
+ wholeSetSubmitting, error: decisionErrors.get(fileDecisionKey(setId, change.id)) ?? null, onDecide: handleFileDecide, showDiffs: showDiffs }, change.id)))
200
+ : // A single complete file decided via the bar's bulk controls:
201
+ // its detail is informational, with no per-file control.
202
+ changes.map((change) => showDiffs ? (_jsxs("div", { className: "space-y-1.5", children: [_jsx(CaptureBadge, { change: change }), _jsx(CapturedChangeDiff, { change: change })] }, change.id)) : (_jsx(FileListRow, { change: change }, change.id))), interactive && showPerFile && (_jsx(ReviewProgress, { decided: decidedCount, total: total }))] }))] }));
203
+ });
204
+ /**
205
+ * Whether the set was kept by the approved-command auto-keep policy (DD-28):
206
+ * some decision carries origin POLICY_APPROVED_COMMAND. Origin is audit
207
+ * provenance — the record label derives from it so an automatic keep is never
208
+ * presented as a human review.
209
+ */
210
+ function isPolicyAutoKept(fileChangeSet) {
211
+ return fileChangeSet.decisions.some((d) => d.origin === FileDecisionOrigin.POLICY_APPROVED_COMMAND);
212
+ }
213
+ /**
214
+ * The settled bar's one-line history: verdict counts folded from the effective
215
+ * decisions ("2 kept · 1 discarded"), with an honest "not reviewed" bucket for
216
+ * files a terminated set never decided. Falls back to a plain changed-count
217
+ * when nothing was decided at all.
218
+ */
219
+ function settledSummary(total, changes, effectiveVerdicts) {
220
+ let kept = 0;
221
+ let discarded = 0;
222
+ for (const c of changes) {
223
+ const v = effectiveVerdicts.get(c.id);
224
+ if (v === FileDecisionAction.APPROVE)
225
+ kept++;
226
+ else if (v === FileDecisionAction.REJECT)
227
+ discarded++;
228
+ }
229
+ const undecided = total - kept - discarded;
230
+ if (kept === 0 && discarded === 0) {
231
+ return `${total} file${total === 1 ? "" : "s"} changed`;
232
+ }
233
+ const parts = [];
234
+ if (kept > 0)
235
+ parts.push(`${kept} kept`);
236
+ if (discarded > 0)
237
+ parts.push(`${discarded} discarded`);
238
+ if (undecided > 0)
239
+ parts.push(`${undecided} not reviewed`);
240
+ return parts.join(" · ");
241
+ }
242
+ /** The bar expander's disclosure chevron (rotates when open). */
243
+ function ExpanderChevron({ expanded }) {
244
+ return (_jsx("svg", { width: "10", height: "10", viewBox: "0 0 10 10", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", className: cn("shrink-0 transition-transform duration-150", expanded && "rotate-90"), "aria-hidden": "true", children: _jsx("path", { d: "M3.5 2L6.5 5L3.5 8" }) }));
245
+ }
246
+ /**
247
+ * One reviewable file with its Keep/Discard control. The decision machinery
248
+ * (verdict radiogroup, block-reason note, in-card error) is identical in both
249
+ * body modes; only the file presentation varies — the bounded diff, or the
250
+ * compact {@link FileListRow} line with the control trailing it.
251
+ */
252
+ const FileChangeReviewRow = memo(function FileChangeReviewRow({ change, verdict, isSubmitting, error, onDecide, showDiffs, }) {
253
+ // One classification per change drives BOTH the disabled Keep and its reason,
254
+ // so the two can never disagree (single source of truth).
255
+ const reviewability = fileReviewability(change);
256
+ const blocked = reviewability.kind !== "reviewable";
257
+ const reasonId = useId();
258
+ const verdictControl = (_jsx(FileVerdictControl, { change: change, reviewability: reviewability, verdict: verdict, isSubmitting: isSubmitting, onDecide: onDecide, describedById: blocked ? reasonId : undefined }));
259
+ return (_jsxs("div", { className: "space-y-1.5", children: [showDiffs ? (_jsxs(_Fragment, { children: [_jsx(CaptureBadge, { change: change }), _jsx(CapturedChangeDiff, { change: change }), verdictControl] })) : (_jsx(FileListRow, { change: change, trailing: verdictControl })), blocked && _jsx(BlockReasonNote, { reviewability: reviewability, id: reasonId }), error && (_jsx(InCardDecisionError, { error: error, leadIn: "save", cursorTarget: "file-review-file-error" }))] }));
260
+ });
261
+ /**
262
+ * A read-only file row for a settled change set: the capture provenance badge
263
+ * and a static verdict badge, with the before/after diff in diff mode or the
264
+ * compact list line otherwise. No decision controls — the verdict is history,
265
+ * not an action. Used by the read-only {@link FileReviewCard}
266
+ * (`interactive={false}`) for decided/reconciled sets and terminal executions.
267
+ */
268
+ const SettledFileRow = memo(function SettledFileRow({ change, verdict, showDiffs, }) {
269
+ if (!showDiffs) {
270
+ return _jsx(FileListRow, { change: change, trailing: _jsx(VerdictBadge, { verdict: verdict }) });
271
+ }
272
+ return (_jsxs("div", { className: "space-y-1.5", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(CaptureBadge, { change: change }), _jsx(VerdictBadge, { verdict: verdict })] }), _jsx(CapturedChangeDiff, { change: change })] }));
273
+ });
274
+ // ---------------------------------------------------------------------------
275
+ // CapturedChangeDiff — a captured change's bounded diff (showDiffs mode)
276
+ // ---------------------------------------------------------------------------
277
+ /**
278
+ * Projects a {@link CapturedFileChange} onto the display `FileChange` and
279
+ * renders its bounded diff — the one place the diff body renders, shared by the
280
+ * interactive, settled, and single-file branches of the diff-mode body.
281
+ */
282
+ function CapturedChangeDiff({ change }) {
283
+ const adapted = useMemo(() => toDisplayFileChange(change), [change]);
284
+ return _jsx(FileChangeDiff, { change: adapted, bounded: true });
285
+ }
286
+ // ---------------------------------------------------------------------------
287
+ // FileListRow — one file as a compact list line (list mode)
288
+ // ---------------------------------------------------------------------------
289
+ /**
290
+ * One file of the change set as a compact, deliberately inert list line: kind
291
+ * letter, path, provenance badge, and an optional trailing slot (the verdict
292
+ * control while reviewing; the committed verdict once settled).
293
+ *
294
+ * The path is plain text — not `FilePathLink` — because the list is an
295
+ * inventory of what the decision covers, not a navigation surface: the diffs
296
+ * live on the transcript's stamped edit rows. The full path stays available on
297
+ * hover via `title`. A rename shows its source path so the move reads in one
298
+ * line.
299
+ */
300
+ function FileListRow({ change, trailing, }) {
301
+ const path = change.pathAfter || change.pathBefore;
302
+ const { dir, base } = splitDisplayPath(path);
303
+ const renamedFrom = change.kind === FileChangeKind.RENAME && change.pathBefore !== change.pathAfter
304
+ ? change.pathBefore
305
+ : "";
306
+ return (_jsxs("div", { className: "flex flex-wrap items-center gap-x-2 gap-y-1", "data-cursor-target": "file-review-list-row", children: [_jsx(FileKindBadge, { kind: change.kind }), _jsxs("span", { className: "flex min-w-0 flex-1 items-center font-mono text-xs text-foreground", title: path, children: [renamedFrom && (_jsxs("span", { className: "min-w-0 truncate text-muted-foreground-faint", children: [renamedFrom, "\u00A0\u2192\u00A0"] })), dir && (_jsx("span", { className: "min-w-0 truncate text-muted-foreground-faint", children: dir })), _jsx("span", { className: "shrink-0", children: base })] }), _jsx(CaptureBadge, { change: change }), trailing] }));
307
+ }
308
+ /** The kind letter, tone, and a11y name for each wire {@link FileChangeKind}. */
309
+ const KIND_BADGE = {
310
+ [FileChangeKind.ADD]: {
311
+ letter: "A",
312
+ colorClass: "text-diff-added-fg",
313
+ label: "added",
314
+ },
315
+ [FileChangeKind.MODIFY]: {
316
+ letter: "M",
317
+ colorClass: "text-diff-hunk-header-fg",
318
+ label: "modified",
319
+ },
320
+ [FileChangeKind.DELETE]: {
321
+ letter: "D",
322
+ colorClass: "text-diff-removed-fg",
323
+ label: "deleted",
324
+ },
325
+ [FileChangeKind.RENAME]: {
326
+ letter: "R",
327
+ colorClass: "text-diff-hunk-header-fg",
328
+ label: "renamed",
329
+ },
330
+ // A binary change is a modification whose diff is not text; the letter stays
331
+ // M and the binary-ness is told by the row's "Keep anyway" + reason note.
332
+ [FileChangeKind.BINARY_CHANGE]: {
333
+ letter: "M",
334
+ colorClass: "text-diff-hunk-header-fg",
335
+ label: "modified (binary)",
336
+ },
337
+ };
338
+ /**
339
+ * The single-letter change-kind marker — the same M/A/D visual vocabulary as
340
+ * the version-history `DiffFileList`, extended with R for captured renames.
341
+ * The letter itself is the non-color channel; the full word is exposed to
342
+ * assistive tech. An UNSPECIFIED kind renders nothing rather than guessing.
343
+ */
344
+ function FileKindBadge({ kind }) {
345
+ const badge = KIND_BADGE[kind];
346
+ if (!badge)
347
+ return null;
348
+ return (_jsx("span", { className: cn("shrink-0 font-mono text-[10px] font-bold", badge.colorClass), "aria-label": badge.label, children: badge.letter }));
349
+ }
350
+ /**
351
+ * A change's committed verdict as a static badge: APPROVE reads "Kept" (the
352
+ * bytes were reconciled into the workspace), REJECT reads "Discarded" (reverted
353
+ * to baseline), and an undecided change (a set terminated mid-review) reads "Not
354
+ * reviewed". Uses the same diff add/remove tokens the card uses elsewhere, so it
355
+ * introduces no new token.
356
+ */
357
+ function VerdictBadge({ verdict }) {
358
+ if (verdict === FileDecisionAction.APPROVE) {
359
+ return (_jsx("span", { className: "shrink-0 text-[11px] font-medium text-diff-added-fg", children: "Kept" }));
360
+ }
361
+ if (verdict === FileDecisionAction.REJECT) {
362
+ return (_jsx("span", { className: "shrink-0 text-[11px] font-medium text-diff-removed-fg", children: "Discarded" }));
363
+ }
364
+ return (_jsx("span", { className: "shrink-0 text-[11px] italic text-muted-foreground", children: "Not reviewed" }));
365
+ }
366
+ /**
367
+ * The per-file decision affordance: a two-option segmented control modeled as a
368
+ * `radiogroup` (the established idiom across the SDK — Keep XOR Discard is a
369
+ * persistent, mutually-exclusive choice because the card stays visible after
370
+ * each file decision). The committed verdict reads as `aria-checked`; clicking
371
+ * the other option flips it (a new last-write-wins decision).
372
+ *
373
+ * `Keep` behavior by reviewability: a `reviewable` file keeps normally; a
374
+ * `binary` file has no text diff but reconcilable bytes, so `Keep` is enabled as
375
+ * an explicit "Keep anyway" that carries the acknowledgment (DD-16); an
376
+ * `unavailable` file (secret-withheld / size-elided) has no keepable bytes, so
377
+ * `Keep` stays disabled — it can only be discarded. `describedById` associates
378
+ * the group with the note explaining the binary/unavailable case.
379
+ */
380
+ function FileVerdictControl({ change, reviewability, verdict, isSubmitting, onDecide, describedById, }) {
381
+ // Optimistic: show the clicked option immediately; the server's decisions
382
+ // projection then confirms it (or, on failure, it reverts to `verdict`).
383
+ const [pending, setPending] = useState(null);
384
+ useEffect(() => {
385
+ if (!isSubmitting)
386
+ setPending(null);
387
+ }, [isSubmitting]);
388
+ const effective = pending ?? verdict;
389
+ const path = change.pathAfter || change.pathBefore;
390
+ // A binary file is keepable via an explicit acknowledgment; only a truly
391
+ // unavailable diff (no captured bytes) leaves Keep disabled.
392
+ const isBinary = reviewability.kind === "binary";
393
+ const keepDisabled = reviewability.kind === "unavailable";
394
+ const keepLabel = isBinary ? "Keep anyway" : "Keep";
395
+ const keepAccessibleLabel = isBinary
396
+ ? `Keep ${path} anyway (binary — no text diff)`
397
+ : `Keep ${path}`;
398
+ const decide = useCallback((action) => {
399
+ if (isSubmitting)
400
+ return;
401
+ setPending(action);
402
+ onDecide(change, action);
403
+ }, [isSubmitting, onDecide, change]);
404
+ return (_jsxs("div", { role: "radiogroup", "aria-label": `Decision for ${path}`, "aria-describedby": describedById, className: "flex items-center gap-1.5", children: [_jsx(VerdictOption, { label: keepLabel, accessibleLabel: keepAccessibleLabel, tone: "keep", selected: effective === FileDecisionAction.APPROVE, busy: isSubmitting && pending === FileDecisionAction.APPROVE, disabled: isSubmitting || keepDisabled, onClick: () => decide(FileDecisionAction.APPROVE) }), _jsx(VerdictOption, { label: "Discard", accessibleLabel: `Discard ${path}`, tone: "discard", selected: effective === FileDecisionAction.REJECT, busy: isSubmitting && pending === FileDecisionAction.REJECT, disabled: isSubmitting, onClick: () => decide(FileDecisionAction.REJECT) })] }));
405
+ }
406
+ // Quiet at rest (ghost), tinted when selected — the verdict is signalled by both
407
+ // fill AND tone (not color alone), and every property flows through `--stgm-*`
408
+ // tokens with no opacity modifiers.
409
+ const VERDICT_BASE = cn("inline-flex items-center justify-center gap-1.5 rounded-md border px-2.5 py-1", "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 disabled:opacity-50");
410
+ const VERDICT_REST = "border-border text-muted-foreground hover:bg-accent-hover hover:text-foreground";
411
+ const VERDICT_SELECTED = {
412
+ keep: "border-success bg-success-subtle text-success",
413
+ discard: "border-destructive bg-destructive-subtle text-destructive",
414
+ };
415
+ function VerdictOption({ label, accessibleLabel, tone, selected, busy, disabled, onClick, }) {
416
+ return (_jsxs("button", { type: "button", role: "radio", "aria-checked": selected, "aria-label": accessibleLabel, disabled: disabled, onClick: onClick, "data-cursor-target": `file-review-${tone}`, className: cn(VERDICT_BASE, selected ? VERDICT_SELECTED[tone] : VERDICT_REST), children: [busy ? _jsx(SpinnerIcon, {}) : null, label] }));
417
+ }
418
+ // ---------------------------------------------------------------------------
419
+ // CaptureBadge — provenance for a file captured outside normal git tracking
420
+ // ---------------------------------------------------------------------------
421
+ /** Non-default provenance the reviewer should be told about, with its a11y text. */
422
+ const PROVENANCE = {
423
+ [FileCaptureClass.GIT_IGNORED_CAPTURED]: {
424
+ label: "gitignored",
425
+ aria: "This file is ignored by git; the change was captured for review",
426
+ },
427
+ [FileCaptureClass.NON_GIT_CAS]: {
428
+ label: "outside git",
429
+ aria: "This file is outside the git repository; the change was captured for review",
430
+ },
431
+ };
432
+ /**
433
+ * A small provenance pill for a file captured outside normal git tracking —
434
+ * gitignored or non-git (CAS). Renders nothing for ordinary git-tracked (or
435
+ * untracked-but-new) files, so the badge appears only when it carries real
436
+ * signal: this change is not part of the repo's tracked history.
437
+ */
438
+ function CaptureBadge({ change }) {
439
+ const provenance = PROVENANCE[change.captureClass];
440
+ if (!provenance)
441
+ return null;
442
+ return (_jsx("span", { className: "inline-flex w-fit items-center rounded border border-border bg-muted-subtle px-1.5 py-0.5 text-[11px] font-medium text-muted-foreground", "aria-label": provenance.aria, "data-cursor-target": "file-review-capture", children: provenance.label }));
443
+ }
444
+ // ---------------------------------------------------------------------------
445
+ // BlockReasonNote — why a file's Keep is unavailable (associated via aria)
446
+ // ---------------------------------------------------------------------------
447
+ /**
448
+ * The in-place explanation for a non-reviewable file, associated with the verdict
449
+ * control via `aria-describedby`. Honest per {@link fileReviewability}: a `binary`
450
+ * change has no text diff but is keepable-as-bytes (an explicit "Keep anyway"); an
451
+ * `unavailable` change's diff cannot be shown at all and is discard-only, with the
452
+ * specific cause the runner recorded (secret-withheld vs size-dropped, doc 15). A
453
+ * reviewable file renders no note.
454
+ */
455
+ function BlockReasonNote({ reviewability, id, }) {
456
+ const text = blockReasonText(reviewability);
457
+ if (!text)
458
+ return null;
459
+ return (_jsx("p", { id: id, className: "text-[11px] italic text-muted-foreground", "data-cursor-target": "file-review-block-reason", children: text }));
460
+ }
461
+ /** The per-file reason copy for a non-reviewable change (null when reviewable). */
462
+ function blockReasonText(reviewability) {
463
+ switch (reviewability.kind) {
464
+ case "binary":
465
+ return "Binary file — no text diff to review. Keep it as-is (its exact bytes are applied) or discard it.";
466
+ case "unavailable":
467
+ switch (reviewability.reason) {
468
+ case "secret":
469
+ return "Contents withheld — this path looks like a secret, so it was never captured for review and can only be discarded.";
470
+ case "size":
471
+ return "Diff too large to display — the full contents were elided to stay within limits, so this change can only be discarded.";
472
+ default:
473
+ return "The full diff isn't available to review, so this change can only be discarded.";
474
+ }
475
+ default:
476
+ return null;
477
+ }
478
+ }
479
+ /**
480
+ * The whole-set incompleteness copy, accurate to which non-reviewable classes are
481
+ * present (never the generic "binary or truncated"). Unavailable is reported
482
+ * ahead of binary because it is the stronger "nothing to see" signal.
483
+ *
484
+ * A `binaryOnly` set is the keepable case (DD-17): binary files are the only
485
+ * blocker, so the copy explains that "Keep all" is available rather than saying
486
+ * the set can't be approved. A `blocked` set (something unavailable) keeps the
487
+ * discard-oriented copy.
488
+ */
489
+ function incompleteNotice(showPerFile, summary, binaryOnly) {
490
+ if (binaryOnly) {
491
+ // Every non-binary file is reviewable; only binaries have no text diff.
492
+ return showPerFile
493
+ ? "This set includes binary files with no text diff. Keep all keeps every file as-is (their exact bytes are applied), or decide each file below."
494
+ : "This is a binary change with no text diff. Keep it as-is (its exact bytes are applied) or discard it.";
495
+ }
496
+ if (showPerFile) {
497
+ if (summary.hasUnavailable) {
498
+ return "Part of this change isn't available to review, so the whole set can't be approved — keep the reviewable files and discard the rest.";
499
+ }
500
+ if (summary.hasBinary) {
501
+ return "This set includes a binary change with no text diff, so it can't be approved at once — decide each file below (keep the reviewable ones; keep or discard the binary).";
502
+ }
503
+ return "Some files can't be reviewed completely, so the whole set can't be approved at once — keep the reviewable files and discard the rest.";
504
+ }
505
+ if (summary.hasUnavailable) {
506
+ return "This change isn't available to review, so it can't be approved — it can only be discarded.";
507
+ }
508
+ if (summary.hasBinary) {
509
+ return "This is a binary change with no text diff, so it can't be approved as a complete change — it can only be discarded.";
510
+ }
511
+ return "This change can't be reviewed completely, so it can't be approved as a complete change.";
512
+ }
513
+ // ---------------------------------------------------------------------------
514
+ // ReviewProgress — how many files still need a verdict before the turn resumes
515
+ // ---------------------------------------------------------------------------
516
+ function ReviewProgress({ decided, total }) {
517
+ return (_jsxs("p", { role: "status", className: "text-[11px] text-muted-foreground", children: [decided, " of ", total, " files reviewed", decided > 0 && decided < total && " — decide the rest to continue"] }));
518
+ }
519
+ // ---------------------------------------------------------------------------
520
+ // Helpers
521
+ // ---------------------------------------------------------------------------
522
+ /**
523
+ * Fold the ledger-ordered decisions into each file's current verdict, last
524
+ * write wins (the precedence the runner reconcile applies). Only FILE-scoped
525
+ * decisions are per-file; a CHANGE_SET decision cannot coexist with an
526
+ * AWAITING_REVIEW set, so it is ignored defensively.
527
+ */
528
+ function deriveFileVerdicts(decisions) {
529
+ const byFileId = new Map();
530
+ for (const d of decisions) {
531
+ if (d.scope === FileDecisionScope.FILE && d.fileChangeId) {
532
+ byFileId.set(d.fileChangeId, d.action);
533
+ }
534
+ }
535
+ return byFileId;
536
+ }
537
+ /**
538
+ * The whole-set action labels, sharpened by file count and review progress. A
539
+ * `binaryOnly` set (DD-17) reads as "Keep all" rather than "Approve all": the
540
+ * bulk keep carries the binary acknowledgment, and "Keep" is the same verb the
541
+ * per-file binary control uses ("Keep anyway").
542
+ */
543
+ function bulkLabels(total, decided, binaryOnly) {
544
+ const approveVerb = binaryOnly ? "Keep" : "Approve";
545
+ if (total <= 1)
546
+ return { approve: approveVerb, reject: "Reject" };
547
+ if (decided > 0 && decided < total) {
548
+ return { approve: `${approveVerb} remaining`, reject: "Reject remaining" };
549
+ }
550
+ return { approve: `${approveVerb} all`, reject: "Reject all" };
551
+ }
552
+ // ---------------------------------------------------------------------------
553
+ // Inline SVG icon
554
+ // ---------------------------------------------------------------------------
555
+ function SpinnerIcon() {
556
+ return (_jsx("svg", { width: "10", height: "10", viewBox: "0 0 12 12", fill: "none", stroke: "currentColor", strokeWidth: "1.5", className: "animate-spin", "aria-hidden": "true", children: _jsx("path", { d: "M6 1.5A4.5 4.5 0 1 1 1.5 6", strokeLinecap: "round" }) }));
557
+ }
558
+ //# sourceMappingURL=FileReviewCard.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FileReviewCard.js","sourceRoot":"","sources":["../../src/execution/FileReviewCard.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAM/E,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,8DAA8D,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,eAAe,EAA4B,MAAM,iBAAiB,CAAC;AAC5E,OAAO,EACL,sBAAsB,EACtB,uBAAuB,EACvB,iBAAiB,GAElB,MAAM,sBAAsB,CAAC;AAE9B,uFAAuF;AACvF,MAAM,OAAO,GAAwB,IAAI,GAAG,EAAE,CAAC;AAE/C,+EAA+E;AAC/E,MAAM,SAAS,GAA+B,IAAI,GAAG,EAAE,CAAC;AAyDxD;;;;;;;;;;;;;;;;;;;;;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UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;IACpD,IAAI,KAAK,IAAI,CAAC;QAAE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;IAClE,IAAI,OAAO,GAAG,CAAC,IAAI,OAAO,GAAG,KAAK,EAAE,CAAC;QACnC,OAAO,EAAE,OAAO,EAAE,GAAG,WAAW,YAAY,EAAE,MAAM,EAAE,kBAAkB,EAAE,CAAC;IAC7E,CAAC;IACD,OAAO,EAAE,OAAO,EAAE,GAAG,WAAW,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC;AACjE,CAAC;AAED,8EAA8E;AAC9E,kBAAkB;AAClB,8EAA8E;AAE9E,SAAS,WAAW;IAClB,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,SAAS,EAAC,cAAc,iBACZ,MAAM,YAElB,eAAM,CAAC,EAAC,4BAA4B,EAAC,aAAa,EAAC,OAAO,GAAG,GACzD,CACP,CAAC;AACJ,CAAC"}
@@ -0,0 +1,35 @@
1
+ import type { FileChangeSet } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/filereview_pb";
2
+ import { type FileReviewRowState } from "./file-review-status";
3
+ /**
4
+ * Context value that carries the session's captured change sets to the
5
+ * transcript tool rows that reference them, so a stamped file-edit row
6
+ * (`ToolCall.file_change_set_id`) can badge itself with the set's live review
7
+ * state — pending review, kept, discarded — right where the edit happened.
8
+ *
9
+ * The sibling of {@link ApprovalContext}, and the same discipline: provided by
10
+ * {@link MessageThread}, keyed by a stable id, rebuilt only when the underlying
11
+ * change sets actually change (structural sharing keeps set references stable
12
+ * across streaming frames), and an empty default so consumers without a
13
+ * provider render no badge (backward compatible).
14
+ *
15
+ * Read-only by design: the row badge is presentation of the set's state, never
16
+ * a decision surface — decisions live exclusively on the set's decision bar
17
+ * ({@link FileReviewCard}).
18
+ */
19
+ export interface FileReviewContextValue {
20
+ /** Every displayable change set across the session, keyed by `FileChangeSet.id`. */
21
+ readonly changeSetsById: ReadonlyMap<string, FileChangeSet>;
22
+ }
23
+ /** Context that supplies the session's change sets to stamped tool rows. */
24
+ export declare const FileReviewContext: import("react").Context<FileReviewContextValue>;
25
+ /**
26
+ * The review state a stamped tool row should badge, or `null` for no badge
27
+ * (unstamped row, unknown set, or a file absent from its set — see
28
+ * {@link fileReviewRowState} for the honest-degradation rules).
29
+ *
30
+ * @param fileChangeSetId The row's `ToolCall.file_change_set_id` (may be "").
31
+ * @param rowPath The row's file path (the presenter's primary arg), used to
32
+ * resolve this file's verdict once the set is decided.
33
+ */
34
+ export declare function useFileReviewRowState(fileChangeSetId: string, rowPath: string | null): FileReviewRowState | null;
35
+ //# sourceMappingURL=FileReviewContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FileReviewContext.d.ts","sourceRoot":"","sources":["../../src/execution/FileReviewContext.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oEAAoE,CAAC;AACxG,OAAO,EAEL,KAAK,kBAAkB,EACxB,MAAM,sBAAsB,CAAC;AAE9B;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WAAW,sBAAsB;IACrC,oFAAoF;IACpF,QAAQ,CAAC,cAAc,EAAE,WAAW,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;CAC7D;AAMD,4EAA4E;AAC5E,eAAO,MAAM,iBAAiB,iDACwB,CAAC;AAEvD;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CACnC,eAAe,EAAE,MAAM,EACvB,OAAO,EAAE,MAAM,GAAG,IAAI,GACrB,kBAAkB,GAAG,IAAI,CAI3B"}