@stigmer/react 3.0.9-dev.20260616060535 → 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 (426) 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/useAutoDisclosure.d.ts +34 -0
  178. package/internal/useAutoDisclosure.d.ts.map +1 -0
  179. package/internal/useAutoDisclosure.js +53 -0
  180. package/internal/useAutoDisclosure.js.map +1 -0
  181. package/internal/useElapsedSince.d.ts +30 -0
  182. package/internal/useElapsedSince.d.ts.map +1 -0
  183. package/internal/useElapsedSince.js +70 -0
  184. package/internal/useElapsedSince.js.map +1 -0
  185. package/internal/useIsOverflowing.d.ts +30 -0
  186. package/internal/useIsOverflowing.d.ts.map +1 -0
  187. package/internal/useIsOverflowing.js +47 -0
  188. package/internal/useIsOverflowing.js.map +1 -0
  189. package/internal/useIsTextTruncated.d.ts +24 -0
  190. package/internal/useIsTextTruncated.d.ts.map +1 -0
  191. package/internal/useIsTextTruncated.js +41 -0
  192. package/internal/useIsTextTruncated.js.map +1 -0
  193. package/internal/useKeyedSubmission.d.ts +49 -0
  194. package/internal/useKeyedSubmission.d.ts.map +1 -0
  195. package/internal/useKeyedSubmission.js +67 -0
  196. package/internal/useKeyedSubmission.js.map +1 -0
  197. package/package.json +4 -4
  198. package/session/SessionViewer.d.ts +2 -2
  199. package/session/SessionViewer.d.ts.map +1 -1
  200. package/session/SessionViewer.js +10 -4
  201. package/session/SessionViewer.js.map +1 -1
  202. package/session/index.d.ts +2 -0
  203. package/session/index.d.ts.map +1 -1
  204. package/session/index.js +1 -0
  205. package/session/index.js.map +1 -1
  206. package/session/inspector/ChangesTab.d.ts +8 -5
  207. package/session/inspector/ChangesTab.d.ts.map +1 -1
  208. package/session/inspector/ChangesTab.js +11 -8
  209. package/session/inspector/ChangesTab.js.map +1 -1
  210. package/session/inspector/SessionInspector.d.ts +4 -4
  211. package/session/inspector/SessionInspector.d.ts.map +1 -1
  212. package/session/inspector/SessionInspector.js +4 -4
  213. package/session/inspector/SessionInspector.js.map +1 -1
  214. package/session/inspector/index.d.ts +0 -2
  215. package/session/inspector/index.d.ts.map +1 -1
  216. package/session/inspector/index.js +0 -1
  217. package/session/inspector/index.js.map +1 -1
  218. package/session/inspector/useSessionInspector.d.ts +8 -4
  219. package/session/inspector/useSessionInspector.d.ts.map +1 -1
  220. package/session/inspector/useSessionInspector.js +27 -20
  221. package/session/inspector/useSessionInspector.js.map +1 -1
  222. package/session/useSessionConversation.d.ts +37 -3
  223. package/session/useSessionConversation.d.ts.map +1 -1
  224. package/session/useSessionConversation.js +18 -2
  225. package/session/useSessionConversation.js.map +1 -1
  226. package/session/useSessionFileChanges.d.ts +74 -0
  227. package/session/useSessionFileChanges.d.ts.map +1 -0
  228. package/session/useSessionFileChanges.js +178 -0
  229. package/session/useSessionFileChanges.js.map +1 -0
  230. package/src/__tests__/styles-border-layer-invariant.test.ts +105 -0
  231. package/src/execution/ApprovalCard.tsx +368 -230
  232. package/src/execution/ApprovalContext.ts +109 -0
  233. package/src/execution/ArtifactCard.tsx +10 -6
  234. package/src/execution/ArtifactPreviewModal.tsx +12 -6
  235. package/src/execution/EmptyChangeNotice.tsx +62 -0
  236. package/src/execution/FileChangesView.tsx +383 -0
  237. package/src/execution/FilePathLink.tsx +65 -12
  238. package/src/execution/FileReviewCard.tsx +1118 -0
  239. package/src/execution/FileReviewContext.ts +53 -0
  240. package/src/execution/FileReviewDock.tsx +157 -0
  241. package/src/execution/McpToolDetail.tsx +98 -32
  242. package/src/execution/MessageThread.tsx +374 -9
  243. package/src/execution/PlanArtifactCard.tsx +9 -6
  244. package/src/execution/PlanCompletionCard.tsx +1 -1
  245. package/src/execution/ResultView.tsx +333 -162
  246. package/src/execution/SubAgentSection.tsx +58 -11
  247. package/src/execution/TerminalSession.tsx +91 -0
  248. package/src/execution/TodoCard.tsx +186 -0
  249. package/src/execution/ToolArgsView.tsx +28 -17
  250. package/src/execution/ToolCallDetail.tsx +137 -26
  251. package/src/execution/ToolCallGroup.tsx +68 -296
  252. package/src/execution/ToolCallItem.tsx +265 -67
  253. package/src/execution/ToolRunGroup.tsx +302 -0
  254. package/src/execution/__tests__/ApprovalCard.test.tsx +395 -5
  255. package/src/execution/__tests__/ArtifactPreviewModal.test.tsx +0 -1
  256. package/src/execution/__tests__/EmptyChangeNotice.test.tsx +24 -0
  257. package/src/execution/__tests__/FileChangesView.test.tsx +296 -0
  258. package/src/execution/__tests__/FilePathLink.test.tsx +92 -0
  259. package/src/execution/__tests__/FileReviewCard.test.tsx +1044 -0
  260. package/src/execution/__tests__/FileReviewDock.test.tsx +134 -0
  261. package/src/execution/__tests__/McpToolDetail.test.tsx +79 -0
  262. package/src/execution/__tests__/MessageThread.test.tsx +324 -0
  263. package/src/execution/__tests__/PlanArtifactCard.test.tsx +37 -16
  264. package/src/execution/__tests__/ResultView.test.tsx +280 -2
  265. package/src/execution/__tests__/SubAgentSection.test.tsx +180 -0
  266. package/src/execution/__tests__/TerminalSession.test.tsx +72 -0
  267. package/src/execution/__tests__/TodoCard.test.tsx +102 -0
  268. package/src/execution/__tests__/ToolArgsView.test.tsx +48 -0
  269. package/src/execution/__tests__/ToolCallDetail.test.tsx +195 -0
  270. package/src/execution/__tests__/ToolCallGroup.test.tsx +132 -0
  271. package/src/execution/__tests__/ToolCallItem.test.tsx +521 -0
  272. package/src/execution/__tests__/ToolRunGroup.test.tsx +137 -0
  273. package/src/execution/__tests__/blanked-narration.test.tsx +149 -0
  274. package/src/execution/__tests__/buildThreadItems-approvals.test.ts +304 -0
  275. package/src/execution/__tests__/buildThreadItems-file-review.test.ts +331 -0
  276. package/src/execution/__tests__/file-path-resolver.test.ts +44 -0
  277. package/src/execution/__tests__/file-review-status.test.ts +343 -0
  278. package/src/execution/__tests__/segment-tool-calls.test.ts +124 -0
  279. package/src/execution/__tests__/subagent-file-review-badge.test.tsx +273 -0
  280. package/src/execution/__tests__/thread-keys.test.ts +195 -0
  281. package/src/execution/__tests__/tool-presenter.test.tsx +95 -0
  282. package/src/execution/__tests__/useArtifactDownload.test.tsx +67 -0
  283. package/src/execution/__tests__/useArtifactDownloadUrl.test.tsx +51 -0
  284. package/src/execution/__tests__/useFileChangeContent.test.tsx +240 -0
  285. package/src/execution/__tests__/useFileReview.test.tsx +236 -0
  286. package/src/execution/__tests__/useSubmitApproval.test.tsx +165 -0
  287. package/src/execution/__tests__/useToolOutputContent.test.tsx +82 -0
  288. package/src/execution/approval-provenance.ts +8 -0
  289. package/src/execution/artifact-utils.ts +0 -18
  290. package/src/execution/execution-phases.ts +4 -16
  291. package/src/execution/file-path-resolver.ts +38 -0
  292. package/src/execution/file-review-status.ts +219 -0
  293. package/src/execution/index.ts +84 -4
  294. package/src/execution/segment-tool-calls.ts +101 -0
  295. package/src/execution/tool-categories.ts +128 -1
  296. package/src/execution/tool-presenter.ts +58 -3
  297. package/src/execution/tool-rendering-primitives.tsx +11 -14
  298. package/src/execution/useArtifactDownload.ts +109 -0
  299. package/src/execution/useArtifactDownloadUrl.ts +116 -0
  300. package/src/execution/useFileChangeContent.ts +149 -0
  301. package/src/execution/useFileReview.ts +197 -0
  302. package/src/execution/useSubmitApproval.ts +49 -27
  303. package/src/execution/useToolOutputContent.ts +70 -0
  304. package/src/index.ts +60 -1
  305. package/src/internal/ApprovalPeekBar.tsx +73 -0
  306. package/src/internal/BoundedContent.tsx +97 -0
  307. package/src/internal/DecisionButton.tsx +127 -0
  308. package/src/internal/InCardDecisionError.tsx +47 -0
  309. package/src/internal/RevealToggle.tsx +91 -0
  310. package/src/internal/VirtualizedThread.tsx +28 -2
  311. package/src/internal/__tests__/ApprovalPeekBar.test.tsx +34 -0
  312. package/src/internal/__tests__/BoundedContent.test.tsx +92 -0
  313. package/src/internal/__tests__/DecisionButton.test.tsx +107 -0
  314. package/src/internal/__tests__/RevealToggle.test.tsx +61 -0
  315. package/src/internal/__tests__/useAutoDisclosure.test.ts +74 -0
  316. package/src/internal/__tests__/useElapsedSince.test.tsx +68 -0
  317. package/src/internal/__tests__/useIsOverflowing.test.ts +36 -0
  318. package/src/internal/__tests__/useKeyedSubmission.test.tsx +126 -0
  319. package/src/internal/useAutoDisclosure.ts +58 -0
  320. package/src/internal/useElapsedSince.ts +72 -0
  321. package/src/internal/useIsOverflowing.ts +61 -0
  322. package/src/internal/useIsTextTruncated.ts +55 -0
  323. package/src/internal/useKeyedSubmission.ts +101 -0
  324. package/src/session/SessionViewer.tsx +21 -4
  325. package/src/session/__tests__/SessionViewer-fileReviewDock.test.tsx +198 -0
  326. package/src/session/__tests__/audienceWiring.test.tsx +4 -0
  327. package/src/session/__tests__/useSessionFileChanges.test.ts +303 -0
  328. package/src/session/index.ts +3 -0
  329. package/src/session/inspector/ChangesTab.tsx +20 -17
  330. package/src/session/inspector/SessionInspector.tsx +12 -10
  331. package/src/session/inspector/__tests__/ArtifactsTab.test.tsx +0 -1
  332. package/src/session/inspector/__tests__/ChangesTab.test.tsx +38 -0
  333. package/src/session/inspector/__tests__/useSessionInspector.test.ts +46 -61
  334. package/src/session/inspector/index.ts +0 -3
  335. package/src/session/inspector/useSessionInspector.ts +27 -20
  336. package/src/session/useSessionConversation.ts +80 -3
  337. package/src/session/useSessionFileChanges.ts +207 -0
  338. package/src/styles.css +35 -10
  339. package/src/version-history/DiffViewer.tsx +10 -7
  340. package/src/version-history/UnifiedDiffView.tsx +66 -0
  341. package/src/version-history/__tests__/DiffViewer.test.tsx +57 -0
  342. package/src/version-history/__tests__/UnifiedDiffView.test.tsx +50 -0
  343. package/src/version-history/__tests__/computeDiff.test.ts +35 -0
  344. package/src/version-history/__tests__/parseUnifiedDiff.test.ts +82 -0
  345. package/src/version-history/computeDiff.ts +6 -37
  346. package/src/version-history/diff-hunks.ts +63 -0
  347. package/src/version-history/index.ts +1 -0
  348. package/src/version-history/parseUnifiedDiff.ts +34 -0
  349. package/src/workflow/WorkflowExecutionApprovalCard.tsx +49 -24
  350. package/src/workflow/WorkflowExecutionTimeline.tsx +15 -4
  351. package/src/workflow/WorkflowExecutionTimelineEvent.tsx +8 -3
  352. package/src/workflow/WorkflowExecutionViewer.tsx +72 -28
  353. package/src/workflow/WorkflowFileReviewList.tsx +152 -0
  354. package/src/workflow/WorkflowTaskApprovalCard.tsx +37 -85
  355. package/src/workflow/__tests__/ExecutionInspector.test.tsx +30 -2
  356. package/src/workflow/__tests__/WorkflowExecutionApprovalCard.test.tsx +129 -0
  357. package/src/workflow/__tests__/WorkflowFileReviewList.test.tsx +129 -0
  358. package/src/workflow/__tests__/WorkflowTaskApprovalCard.test.tsx +43 -11
  359. package/src/workflow/__tests__/useWorkflowExecutionActions.test.tsx +276 -0
  360. package/src/workflow/execution-inspector/ExecutionInspector.tsx +42 -18
  361. package/src/workflow/index.ts +5 -0
  362. package/src/workflow/useWorkflowExecutionActions.ts +177 -29
  363. package/styles.css +1 -1
  364. package/version-history/DiffViewer.d.ts.map +1 -1
  365. package/version-history/DiffViewer.js +9 -3
  366. package/version-history/DiffViewer.js.map +1 -1
  367. package/version-history/UnifiedDiffView.d.ts +29 -0
  368. package/version-history/UnifiedDiffView.d.ts.map +1 -0
  369. package/version-history/UnifiedDiffView.js +36 -0
  370. package/version-history/UnifiedDiffView.js.map +1 -0
  371. package/version-history/computeDiff.d.ts +3 -1
  372. package/version-history/computeDiff.d.ts.map +1 -1
  373. package/version-history/computeDiff.js +5 -35
  374. package/version-history/computeDiff.js.map +1 -1
  375. package/version-history/diff-hunks.d.ts +21 -0
  376. package/version-history/diff-hunks.d.ts.map +1 -0
  377. package/version-history/diff-hunks.js +58 -0
  378. package/version-history/diff-hunks.js.map +1 -0
  379. package/version-history/index.d.ts +1 -0
  380. package/version-history/index.d.ts.map +1 -1
  381. package/version-history/index.js +1 -0
  382. package/version-history/index.js.map +1 -1
  383. package/version-history/parseUnifiedDiff.d.ts +22 -0
  384. package/version-history/parseUnifiedDiff.d.ts.map +1 -0
  385. package/version-history/parseUnifiedDiff.js +34 -0
  386. package/version-history/parseUnifiedDiff.js.map +1 -0
  387. package/workflow/WorkflowExecutionApprovalCard.d.ts +8 -1
  388. package/workflow/WorkflowExecutionApprovalCard.d.ts.map +1 -1
  389. package/workflow/WorkflowExecutionApprovalCard.js +17 -3
  390. package/workflow/WorkflowExecutionApprovalCard.js.map +1 -1
  391. package/workflow/WorkflowExecutionTimeline.d.ts +11 -2
  392. package/workflow/WorkflowExecutionTimeline.d.ts.map +1 -1
  393. package/workflow/WorkflowExecutionTimeline.js +2 -2
  394. package/workflow/WorkflowExecutionTimeline.js.map +1 -1
  395. package/workflow/WorkflowExecutionTimelineEvent.d.ts +4 -1
  396. package/workflow/WorkflowExecutionTimelineEvent.d.ts.map +1 -1
  397. package/workflow/WorkflowExecutionTimelineEvent.js +2 -2
  398. package/workflow/WorkflowExecutionTimelineEvent.js.map +1 -1
  399. package/workflow/WorkflowExecutionViewer.d.ts.map +1 -1
  400. package/workflow/WorkflowExecutionViewer.js +18 -10
  401. package/workflow/WorkflowExecutionViewer.js.map +1 -1
  402. package/workflow/WorkflowFileReviewList.d.ts +46 -0
  403. package/workflow/WorkflowFileReviewList.d.ts.map +1 -0
  404. package/workflow/WorkflowFileReviewList.js +48 -0
  405. package/workflow/WorkflowFileReviewList.js.map +1 -0
  406. package/workflow/WorkflowTaskApprovalCard.d.ts +8 -1
  407. package/workflow/WorkflowTaskApprovalCard.d.ts.map +1 -1
  408. package/workflow/WorkflowTaskApprovalCard.js +12 -19
  409. package/workflow/WorkflowTaskApprovalCard.js.map +1 -1
  410. package/workflow/execution-inspector/ExecutionInspector.d.ts +21 -4
  411. package/workflow/execution-inspector/ExecutionInspector.d.ts.map +1 -1
  412. package/workflow/execution-inspector/ExecutionInspector.js +6 -3
  413. package/workflow/execution-inspector/ExecutionInspector.js.map +1 -1
  414. package/workflow/index.d.ts +1 -0
  415. package/workflow/index.d.ts.map +1 -1
  416. package/workflow/index.js +1 -0
  417. package/workflow/index.js.map +1 -1
  418. package/workflow/useWorkflowExecutionActions.d.ts +62 -4
  419. package/workflow/useWorkflowExecutionActions.d.ts.map +1 -1
  420. package/workflow/useWorkflowExecutionActions.js +94 -18
  421. package/workflow/useWorkflowExecutionActions.js.map +1 -1
  422. package/session/inspector/PlanTab.d.ts +0 -15
  423. package/session/inspector/PlanTab.d.ts.map +0 -1
  424. package/session/inspector/PlanTab.js +0 -19
  425. package/session/inspector/PlanTab.js.map +0 -1
  426. package/src/session/inspector/PlanTab.tsx +0 -31
@@ -0,0 +1,331 @@
1
+ /**
2
+ * Positioning + emission tests for file-review records: each SETTLED change
3
+ * set's read-only `file-review-record` item must render inside its own
4
+ * execution's segment, immediately after the set's LAST stamped edit row
5
+ * (`ToolCall.file_change_set_id`), with a segment-tail backstop for sets that
6
+ * have no stamped row (shell-made changes, legacy transcripts). A PENDING set
7
+ * (AWAITING_REVIEW on a live execution) is never a thread item — its decision
8
+ * surface is the composer-docked FileReviewDock; only the stamped rows' badges
9
+ * carry the pending state in-thread.
10
+ */
11
+
12
+ import { describe, it, expect } from "vitest";
13
+ import { create } from "@bufbuild/protobuf";
14
+ import {
15
+ AgentExecutionSchema,
16
+ AgentExecutionStatusSchema,
17
+ type AgentExecution,
18
+ } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/api_pb";
19
+ import { AgentExecutionSpecSchema } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/spec_pb";
20
+ import { ApiResourceMetadataSchema } from "@stigmer/protos/ai/stigmer/commons/apiresource/metadata_pb";
21
+ import {
22
+ AgentMessageSchema,
23
+ FileContentSchema,
24
+ ToolCallSchema,
25
+ type AgentMessage,
26
+ type ToolCall,
27
+ } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/message_pb";
28
+ import {
29
+ CapturedFileChangeSchema,
30
+ FileChangeSetSchema,
31
+ type FileChangeSet,
32
+ } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/filereview_pb";
33
+ import {
34
+ DiffCompleteness,
35
+ ExecutionPhase,
36
+ FileChangeKind,
37
+ FileChangeSetStatus,
38
+ MessageType,
39
+ ToolCallStatus,
40
+ } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/enum_pb";
41
+ import { buildThreadItems, type ThreadItem } from "../MessageThread";
42
+
43
+ // ---------------------------------------------------------------------------
44
+ // Helpers
45
+ // ---------------------------------------------------------------------------
46
+
47
+ /** A completed edit tool call, optionally stamped with its change set id. */
48
+ function editCall(id: string, path: string, fileChangeSetId = ""): ToolCall {
49
+ return create(ToolCallSchema, {
50
+ id,
51
+ name: "edit",
52
+ status: ToolCallStatus.TOOL_CALL_COMPLETED,
53
+ args: { path, old_string: "a", new_string: "b" },
54
+ fileChangeSetId,
55
+ });
56
+ }
57
+
58
+ function aiMessage(content: string, toolCalls: ToolCall[] = []): AgentMessage {
59
+ return create(AgentMessageSchema, {
60
+ type: MessageType.MESSAGE_AI,
61
+ content,
62
+ toolCalls,
63
+ });
64
+ }
65
+
66
+ function changeSet(id: string, paths: string[], status = FileChangeSetStatus.RECONCILED): FileChangeSet {
67
+ return create(FileChangeSetSchema, {
68
+ id,
69
+ status,
70
+ aggregateDigest: "agg",
71
+ diffCompleteness: DiffCompleteness.COMPLETE,
72
+ changes: paths.map((path) =>
73
+ create(CapturedFileChangeSchema, {
74
+ id: `${id}:${path}`,
75
+ pathBefore: path,
76
+ pathAfter: path,
77
+ kind: FileChangeKind.MODIFY,
78
+ before: create(FileContentSchema, { body: { case: "inline", value: "a\n" } }),
79
+ after: create(FileContentSchema, { body: { case: "inline", value: "b\n" } }),
80
+ fileDigest: `d-${path}`,
81
+ diffComplete: true,
82
+ }),
83
+ ),
84
+ });
85
+ }
86
+
87
+ function execution(opts: {
88
+ id: string;
89
+ phase: ExecutionPhase;
90
+ messages: AgentMessage[];
91
+ changeSets?: FileChangeSet[];
92
+ }): AgentExecution {
93
+ return create(AgentExecutionSchema, {
94
+ metadata: create(ApiResourceMetadataSchema, { id: opts.id }),
95
+ spec: create(AgentExecutionSpecSchema, { message: "go" }),
96
+ status: create(AgentExecutionStatusSchema, {
97
+ phase: opts.phase,
98
+ messages: opts.messages,
99
+ fileChangeSets: opts.changeSets ?? [],
100
+ }),
101
+ });
102
+ }
103
+
104
+ /** buildThreadItems with file-review records enabled (positional args, approvals off). */
105
+ function build(executions: AgentExecution[]): ThreadItem[] {
106
+ return buildThreadItems(
107
+ executions,
108
+ null,
109
+ null,
110
+ false,
111
+ undefined,
112
+ undefined,
113
+ false,
114
+ false,
115
+ true,
116
+ );
117
+ }
118
+
119
+ function kinds(items: ThreadItem[]): string[] {
120
+ return items.map((i) => i.kind);
121
+ }
122
+
123
+ function recordIndex(items: ThreadItem[], setId: string): number {
124
+ return items.findIndex(
125
+ (i) => i.kind === "file-review-record" && i.fileChangeSet.id === setId,
126
+ );
127
+ }
128
+
129
+ // ---------------------------------------------------------------------------
130
+ // Tests
131
+ // ---------------------------------------------------------------------------
132
+
133
+ describe("buildThreadItems — file-review record positioning", () => {
134
+ it("places a settled record immediately after the set's LAST stamped row, not at the tail", () => {
135
+ const setId = "aex-1:0";
136
+ const exec = execution({
137
+ id: "aex-1",
138
+ phase: ExecutionPhase.EXECUTION_IN_PROGRESS,
139
+ messages: [
140
+ aiMessage("Let me edit.", [editCall("tc-1", "notes.md", setId)]),
141
+ aiMessage("Running tests.", [
142
+ create(ToolCallSchema, { id: "tc-shell", name: "shell", status: ToolCallStatus.TOOL_CALL_COMPLETED, args: { command: "npm test" } }),
143
+ ]),
144
+ aiMessage("One more edit.", [editCall("tc-2", "README.md", setId)]),
145
+ aiMessage("All done, summary follows."),
146
+ ],
147
+ changeSets: [changeSet(setId, ["notes.md", "README.md"])],
148
+ });
149
+
150
+ const items = build([exec]);
151
+ const recIdx = recordIndex(items, setId);
152
+ expect(recIdx).toBeGreaterThan(-1);
153
+
154
+ // The item right before the record is the tool group carrying the LAST
155
+ // stamped row (tc-2); the closing narration comes after.
156
+ const before = items[recIdx - 1];
157
+ expect(before.kind).toBe("tool-group");
158
+ expect(
159
+ before.kind === "tool-group" && before.toolCalls.some((tc) => tc.id === "tc-2"),
160
+ ).toBe(true);
161
+ const closing = items.findIndex(
162
+ (i) => i.kind === "message" && i.message.content === "All done, summary follows.",
163
+ );
164
+ expect(recIdx).toBeLessThan(closing);
165
+ });
166
+
167
+ it("falls back to the segment tail for a set with no stamped row (shell-made changes)", () => {
168
+ // A shell-made set has no stamped rows, so this record is its ONLY
169
+ // in-thread trace — the tail backstop guarantees it is never dropped.
170
+ const setId = "aex-1:0";
171
+ const exec = execution({
172
+ id: "aex-1",
173
+ phase: ExecutionPhase.EXECUTION_IN_PROGRESS,
174
+ messages: [
175
+ aiMessage("Shell only.", [
176
+ create(ToolCallSchema, { id: "tc-shell", name: "shell", status: ToolCallStatus.TOOL_CALL_COMPLETED, args: { command: "echo x > f.txt" } }),
177
+ ]),
178
+ ],
179
+ changeSets: [changeSet(setId, ["f.txt"])],
180
+ });
181
+
182
+ const items = build([exec]);
183
+ const recIdx = recordIndex(items, setId);
184
+ expect(recIdx).toBe(items.length - 1); // never invisible — tail backstop
185
+ });
186
+
187
+ it("never emits a PENDING set — the composer dock owns the decision surface", () => {
188
+ const exec = execution({
189
+ id: "aex-1",
190
+ phase: ExecutionPhase.EXECUTION_WAITING_FOR_APPROVAL,
191
+ messages: [aiMessage("Edited.", [editCall("tc-1", "a.ts", "aex-1:0")])],
192
+ changeSets: [changeSet("aex-1:0", ["a.ts"], FileChangeSetStatus.AWAITING_REVIEW)],
193
+ });
194
+
195
+ expect(kinds(build([exec]))).not.toContain("file-review-record");
196
+ });
197
+
198
+ it("emits an honest record for an AWAITING_REVIEW set on a TERMINAL execution", () => {
199
+ // An execution that died mid-review: the set is not decidable anywhere
200
+ // (the dock only surfaces live sets), so the thread records it read-only —
201
+ // its files read "Not reviewed" rather than vanishing.
202
+ const setId = "aex-1:0";
203
+ const exec = execution({
204
+ id: "aex-1",
205
+ phase: ExecutionPhase.EXECUTION_FAILED,
206
+ messages: [aiMessage("Edited.", [editCall("tc-1", "a.ts", setId)])],
207
+ changeSets: [changeSet(setId, ["a.ts"], FileChangeSetStatus.AWAITING_REVIEW)],
208
+ });
209
+
210
+ expect(recordIndex(build([exec]), setId)).toBeGreaterThan(-1);
211
+ });
212
+
213
+ it("keeps every settled turn's record in its own segment across executions, and skips the live pending one", () => {
214
+ const historical = execution({
215
+ id: "aex-1",
216
+ phase: ExecutionPhase.EXECUTION_COMPLETED,
217
+ messages: [aiMessage("Turn one edit.", [editCall("tc-old", "a.ts", "aex-1:0")])],
218
+ changeSets: [changeSet("aex-1:0", ["a.ts"], FileChangeSetStatus.RECONCILED)],
219
+ });
220
+ const live = execution({
221
+ id: "aex-2",
222
+ phase: ExecutionPhase.EXECUTION_WAITING_FOR_APPROVAL,
223
+ messages: [aiMessage("Turn two edit.", [editCall("tc-new", "b.ts", "aex-2:0")])],
224
+ changeSets: [changeSet("aex-2:0", ["b.ts"], FileChangeSetStatus.AWAITING_REVIEW)],
225
+ });
226
+
227
+ const items = build([historical, live]);
228
+ const oldRec = recordIndex(items, "aex-1:0");
229
+
230
+ // The historical record sits inside the FIRST execution's segment — before
231
+ // the second execution's opening message — not at the thread tail.
232
+ const secondTurnStart = items.findIndex(
233
+ (i) => i.kind === "message" && i.message.content === "Turn two edit.",
234
+ );
235
+ expect(oldRec).toBeGreaterThan(-1);
236
+ expect(oldRec).toBeLessThan(secondTurnStart);
237
+
238
+ // The live execution's pending set is not a thread item (dock owns it).
239
+ expect(recordIndex(items, "aex-2:0")).toBe(-1);
240
+ });
241
+
242
+ it("anchors each of a multi-turn execution's settled sets to its own rows", () => {
243
+ // One execution, two turns (a resume): each turn's settled set anchors
244
+ // after ITS last stamped row, in transcript order.
245
+ const exec = execution({
246
+ id: "aex-1",
247
+ phase: ExecutionPhase.EXECUTION_IN_PROGRESS,
248
+ messages: [
249
+ aiMessage("Turn one.", [editCall("tc-t1", "a.ts", "aex-1:0")]),
250
+ aiMessage("Turn two.", [editCall("tc-t2", "b.ts", "aex-1:1")]),
251
+ ],
252
+ changeSets: [
253
+ changeSet("aex-1:0", ["a.ts"], FileChangeSetStatus.RECONCILED),
254
+ changeSet("aex-1:1", ["b.ts"], FileChangeSetStatus.RECONCILED),
255
+ ],
256
+ });
257
+
258
+ const items = build([exec]);
259
+ const rec0 = recordIndex(items, "aex-1:0");
260
+ const rec1 = recordIndex(items, "aex-1:1");
261
+ expect(rec0).toBeGreaterThan(-1);
262
+ expect(rec1).toBeGreaterThan(rec0);
263
+
264
+ // Each record directly follows the tool group carrying its own turn's row.
265
+ const before0 = items[rec0 - 1];
266
+ const before1 = items[rec1 - 1];
267
+ expect(
268
+ before0.kind === "tool-group" && before0.toolCalls.some((tc) => tc.id === "tc-t1"),
269
+ ).toBe(true);
270
+ expect(
271
+ before1.kind === "tool-group" && before1.toolCalls.some((tc) => tc.id === "tc-t2"),
272
+ ).toBe(true);
273
+ });
274
+
275
+ it("skips a CAPTURING set (no changes yet) and emits nothing when records are disabled", () => {
276
+ const exec = execution({
277
+ id: "aex-1",
278
+ phase: ExecutionPhase.EXECUTION_IN_PROGRESS,
279
+ messages: [aiMessage("Working.", [editCall("tc-1", "a.ts", "aex-1:0")])],
280
+ changeSets: [changeSet("aex-1:0", [], FileChangeSetStatus.CAPTURING)],
281
+ });
282
+
283
+ // An empty-changes set never renders…
284
+ expect(kinds(build([exec]))).not.toContain("file-review-record");
285
+
286
+ // …and with records disabled (last positional arg false) none render
287
+ // regardless of change sets.
288
+ const withChanges = execution({
289
+ id: "aex-2",
290
+ phase: ExecutionPhase.EXECUTION_IN_PROGRESS,
291
+ messages: [aiMessage("Edit.", [editCall("tc-2", "b.ts", "aex-2:0")])],
292
+ changeSets: [changeSet("aex-2:0", ["b.ts"])],
293
+ });
294
+ const disabled = buildThreadItems(
295
+ [withChanges],
296
+ null,
297
+ null,
298
+ false,
299
+ undefined,
300
+ undefined,
301
+ false,
302
+ false,
303
+ false,
304
+ );
305
+ expect(kinds(disabled)).not.toContain("file-review-record");
306
+ });
307
+
308
+ it("renders a legacy hidden row as absent while its settled set still surfaces at the segment tail", () => {
309
+ // A pre-stamping session: the flowed edit row was collapsed to the hidden
310
+ // SKIPPED shape (no stamp), and the set has no anchor. The hidden row must
311
+ // not resurface; the settled record falls back to the tail.
312
+ const setId = "aex-legacy:0";
313
+ const hidden = create(ToolCallSchema, {
314
+ id: "tc-hidden",
315
+ name: "edit",
316
+ status: ToolCallStatus.TOOL_CALL_SKIPPED,
317
+ });
318
+ const exec = execution({
319
+ id: "aex-legacy",
320
+ phase: ExecutionPhase.EXECUTION_IN_PROGRESS,
321
+ messages: [aiMessage("Edited.", [hidden])],
322
+ changeSets: [changeSet(setId, ["a.ts"])],
323
+ });
324
+
325
+ const items = build([exec]);
326
+ // The hidden row's message emits no tool group (its only call is collapsed).
327
+ expect(kinds(items)).not.toContain("tool-group");
328
+ // The settled record still surfaces, at the tail.
329
+ expect(recordIndex(items, setId)).toBe(items.length - 1);
330
+ });
331
+ });
@@ -11,6 +11,7 @@ import {
11
11
  classifyPath,
12
12
  resolveGitBrowseUrl,
13
13
  resolvePathAction,
14
+ splitDisplayPath,
14
15
  } from "../file-path-resolver";
15
16
 
16
17
  // ---------------------------------------------------------------------------
@@ -82,6 +83,49 @@ describe("classifyPath", () => {
82
83
  });
83
84
  });
84
85
 
86
+ // ---------------------------------------------------------------------------
87
+ // splitDisplayPath
88
+ // ---------------------------------------------------------------------------
89
+
90
+ describe("splitDisplayPath", () => {
91
+ it("splits a nested path into dir (with trailing slash) and base", () => {
92
+ expect(splitDisplayPath("src/app/main.ts")).toEqual({
93
+ dir: "src/app/",
94
+ base: "main.ts",
95
+ });
96
+ });
97
+
98
+ it("keeps an absolute path's leading prefix in the dir", () => {
99
+ expect(splitDisplayPath("/Users/me/scm/notes.md")).toEqual({
100
+ dir: "/Users/me/scm/",
101
+ base: "notes.md",
102
+ });
103
+ });
104
+
105
+ it("treats a path with no slash as all base", () => {
106
+ expect(splitDisplayPath("notes.md")).toEqual({ dir: "", base: "notes.md" });
107
+ });
108
+
109
+ it("tolerates a trailing slash (directory), keeping the last segment as base", () => {
110
+ expect(splitDisplayPath("src/app/")).toEqual({ dir: "src/", base: "app" });
111
+ });
112
+
113
+ it("handles platform-mount paths", () => {
114
+ expect(splitDisplayPath(".stigmer/skills/foo.md")).toEqual({
115
+ dir: ".stigmer/skills/",
116
+ base: "foo.md",
117
+ });
118
+ });
119
+
120
+ it("returns empty parts for an empty path", () => {
121
+ expect(splitDisplayPath("")).toEqual({ dir: "", base: "" });
122
+ });
123
+
124
+ it("collapses a slash-only path to empty parts", () => {
125
+ expect(splitDisplayPath("/")).toEqual({ dir: "", base: "" });
126
+ });
127
+ });
128
+
85
129
  // ---------------------------------------------------------------------------
86
130
  // resolveGitBrowseUrl
87
131
  // ---------------------------------------------------------------------------