@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
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
 
3
- import { useState } from "react";
3
+ import { memo } from "react";
4
4
  import type { ToolCall } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/message_pb";
5
5
  import type { SubAgentExecution } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/subagent_pb";
6
6
  import {
@@ -8,12 +8,18 @@ import {
8
8
  ToolCallStatus,
9
9
  } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/enum_pb";
10
10
  import { cn } from "@stigmer/theme";
11
+ import { useRenderTracer } from "../internal/dev";
12
+ import { useAutoDisclosure } from "../internal/useAutoDisclosure";
13
+ import { useIsTextTruncated } from "../internal/useIsTextTruncated";
11
14
  import { ToolCallDetail, formatDuration } from "./ToolCallDetail";
12
15
  import { SubAgentSection } from "./SubAgentSection";
16
+ import { ApprovalCardBody } from "./ApprovalCard";
17
+ import { useApproval } from "./ApprovalContext";
18
+ import { useFileReviewRowState } from "./FileReviewContext";
19
+ import type { FileReviewRowState } from "./file-review-status";
13
20
  import { FilePathLink } from "./FilePathLink";
14
- import { type ToolCategory } from "./tool-categories";
21
+ import { isFileCategory, type ToolCategory } from "./tool-categories";
15
22
  import { useToolPresentation } from "./tool-presenter";
16
- import { useSandboxNormalize } from "./SandboxContext";
17
23
  import { useThreadSelection } from "./useThreadSelection";
18
24
 
19
25
  /** Props for {@link ToolCallItem}. */
@@ -27,9 +33,18 @@ export interface ToolCallItemProps {
27
33
  */
28
34
  readonly subAgentExecution?: SubAgentExecution | null;
29
35
  /**
30
- * Initial expansion state. Defaults to `false`.
36
+ * Forces the detail panel open on first render regardless of the
37
+ * auto-disclosure policy. Defaults to `false`.
31
38
  */
32
39
  readonly defaultExpanded?: boolean;
40
+ /**
41
+ * Whether the row renders as its own self-contained card (a thin rounded
42
+ * border). Defaults to `true`. Set to `false` when the row is nested inside a
43
+ * container that already provides the border — e.g. the folded
44
+ * `ToolRunGroup` chip — where the row falls back to a divider-separated
45
+ * row to avoid a card-in-a-card.
46
+ */
47
+ readonly bordered?: boolean;
33
48
  /** Additional CSS class names for the root container. */
34
49
  readonly className?: string;
35
50
  }
@@ -37,48 +52,123 @@ export interface ToolCallItemProps {
37
52
  /**
38
53
  * Renders a single tool call as a row in the tool call group.
39
54
  *
40
- * Two rendering modes:
55
+ * Three rendering modes, set by one rule — **does the body carry content the
56
+ * one-line row cannot?**
57
+ *
58
+ * - **Non-expandable** (completed/skipped Read): a static `<div>` row with a
59
+ * clickable {@link FilePathLink}. The path IS the complete information.
60
+ * - **Preview** (content-bearing: shell / edit / write / fetch / web-search /
61
+ * unknown / mcp): a plain (non-button) header above an **always-visible**
62
+ * {@link ToolCallDetail} body — Cursor-style "previews aren't collapsible".
63
+ * There is no header chevron; each content block self-bounds with its own
64
+ * single in-place reveal (`RevealToggle`), so a long diff or output
65
+ * never floods the thread. The body is suppressed only for an `empty` result
66
+ * (e.g. a no-output shell), which stays a clean one-line row.
67
+ * - **Summary / sub-agent** (read / list / search / delete / think, and
68
+ * sub-agent delegations): a chevron-gated `div[role=button]` header that
69
+ * discloses a body hidden by default — {@link ToolCallDetail}, a
70
+ * {@link SubAgentSection}, or, when gated, an inline {@link ApprovalCardBody}.
71
+ * {@link useAutoDisclosure} force-opens it while *running* or *awaiting
72
+ * approval*, then settles it closed; a manual click always wins thereafter.
41
73
  *
42
- * - **Non-expandable** (completed/skipped Read): a static `<div>` row
43
- * with a clickable {@link FilePathLink}. No chevron, no expansion.
44
- * The clickable path IS the complete information.
45
- * - **Expandable** (all other tools): a `<button>` row that toggles a
46
- * {@link ToolCallDetail} or {@link SubAgentSection} detail panel.
74
+ * The two disclosure axes — the card-level chevron and a block's
75
+ * content-overflow reveal never govern the same body, which is what removes
76
+ * the old "expand, then Show more" double control.
47
77
  *
48
78
  * Shows category-aware labels (e.g., "Shell", "Read", "Edit") with
49
79
  * the primary argument as a subtitle, a category-specific icon, and
50
80
  * an inline approval decision badge when applicable.
51
81
  *
82
+ * Wrapped in `React.memo` — structural sharing (DD-009/010) preserves
83
+ * the `ToolCall` reference when unchanged, so a settled row skips
84
+ * re-renders while sibling tools stream.
85
+ *
52
86
  * @example
53
87
  * ```tsx
54
88
  * <ToolCallItem toolCall={tc} />
55
89
  * <ToolCallItem toolCall={tc} subAgentExecution={sub} />
56
90
  * ```
57
91
  */
58
- export function ToolCallItem({
92
+ export const ToolCallItem = memo(function ToolCallItem({
59
93
  toolCall,
60
94
  subAgentExecution,
61
95
  defaultExpanded = false,
96
+ bordered = true,
62
97
  className,
63
98
  }: ToolCallItemProps) {
64
- const [expanded, setExpanded] = useState(defaultExpanded);
99
+ useRenderTracer("ToolCallItem", { status: toolCall.status, id: toolCall.id });
65
100
 
66
101
  const status = mapToolCallStatus(toolCall);
67
102
  const StatusIcon = STATUS_ICON[status];
68
103
  const duration = formatDuration(toolCall.startedAt, toolCall.completedAt);
69
104
  const isSubAgent = subAgentExecution != null;
70
105
 
71
- const { category, label, primaryArg, resultSummary } = useToolPresentation(toolCall);
106
+ const { category, label, primaryArg, result, resultSummary, disclosure } =
107
+ useToolPresentation(toolCall);
72
108
  const CategoryIcon = CATEGORY_ICON[category];
73
109
 
110
+ // An unresolved approval gating this exact call (parent or nested sub-agent),
111
+ // or null. Drives the inline approval panel and forces the row open.
112
+ const approval = useApproval(toolCall.id);
113
+
114
+ // The card-level disclosure for *summary* rows (preview rows ignore it — their
115
+ // body is always visible). Force-open only while the row carries live or
116
+ // actionable content: while it runs, or while it awaits approval; a manual
117
+ // toggle takes over from there. Called unconditionally to honour the rules of
118
+ // hooks even though preview rows do not read `expanded`.
119
+ const autoOpen =
120
+ toolCall.status === ToolCallStatus.TOOL_CALL_RUNNING || approval != null;
121
+ const [expanded, handleToggle] = useAutoDisclosure(autoOpen, {
122
+ initialOpen: defaultExpanded || autoOpen,
123
+ });
124
+
74
125
  const displayLabel = isSubAgent
75
126
  ? subAgentExecution.subject || subAgentExecution.name || label
76
127
  : label;
77
128
 
78
- const normalize = useSandboxNormalize();
79
129
  const approvalBadge = getApprovalBadge(toolCall);
130
+
131
+ // A flowed file edit stamped with its change set id badges the set's live
132
+ // review state (pending review / kept / discarded) right on the row — the
133
+ // observational record stays in place while the decision surface is the
134
+ // set's own bar. Null for unstamped rows and honest-degradation cases.
135
+ const reviewState = useFileReviewRowState(toolCall.fileChangeSetId, primaryArg);
136
+ const reviewBadge = reviewState ? REVIEW_BADGE[reviewState] : null;
137
+
80
138
  const selection = useThreadSelection("tool-call", toolCall.id);
81
139
 
140
+ // Search/list show their query/path as the header subtitle (truncated). Track
141
+ // whether it actually clips so the expanded detail can restate the full,
142
+ // wrapping value only when needed — avoiding a redundant repeat of a short
143
+ // value the header already shows in full. Gated to these two categories so
144
+ // only the rows that consume the signal pay for the measurement.
145
+ const measuresSubtitle = category === "search" || category === "list";
146
+ const { ref: subtitleRef, isTruncated: primaryArgTruncated } =
147
+ useIsTextTruncated<HTMLSpanElement>(measuresSubtitle);
148
+
149
+ // Cursor-style chrome: each tool call is its own self-contained card — a thin
150
+ // rounded neutral border. A pending gate carries a restrained left accent on
151
+ // the card itself (warning, or destructive for a delete); that accent is the
152
+ // only "awaiting you" cue now that the amber fill is gone. Nested inside a
153
+ // folded run chip the card degrades to a divider-separated row (via
154
+ // `bordered={false}`) so we never draw a card inside a card.
155
+ const cardClass = bordered
156
+ ? cn(
157
+ // border-prominent (not border): a transparent card needs a line the eye
158
+ // actually catches — the default border token is white at 14% opacity,
159
+ // which vanishes on the dark thread surface.
160
+ "rounded-lg border border-border-prominent overflow-hidden",
161
+ approval != null &&
162
+ (category === "delete"
163
+ ? "border-l-2 border-l-destructive"
164
+ : "border-l-2 border-l-warning"),
165
+ selection?.isSelected && "ring-1 ring-primary/40",
166
+ )
167
+ : cn(
168
+ "border-b border-border-muted last:border-b-0",
169
+ selection?.isSelected && "ring-1 ring-primary/40 rounded-sm",
170
+ );
171
+
82
172
  // Completed/skipped Read items are non-expandable — the clickable
83
173
  // path in the row is the complete information. Failed reads remain
84
174
  // expandable to show the error.
@@ -101,6 +191,18 @@ export function ToolCallItem({
101
191
  </span>
102
192
  )}
103
193
 
194
+ {reviewBadge && (
195
+ <span
196
+ className={cn(
197
+ "shrink-0 rounded px-1 py-0.5 text-[10px] font-medium leading-none",
198
+ reviewBadge.colorClass,
199
+ )}
200
+ data-cursor-target="file-review-row-badge"
201
+ >
202
+ {reviewBadge.label}
203
+ </span>
204
+ )}
205
+
104
206
  {toolCall.mcpServerSlug && (
105
207
  <span className="shrink-0 rounded bg-muted px-1 py-0.5 font-mono text-muted-foreground">
106
208
  {toolCall.mcpServerSlug}
@@ -142,11 +244,10 @@ export function ToolCallItem({
142
244
 
143
245
  if (isNonExpandableRead) {
144
246
  return (
145
- <div className={cn(
146
- "border-b border-border-muted last:border-b-0",
147
- selection?.isSelected && "ring-1 ring-primary/40 rounded-sm",
148
- className,
149
- )}>
247
+ <div
248
+ data-cursor-target="tool-call-row"
249
+ className={cn(cardClass, className)}
250
+ >
150
251
  <div
151
252
  className="flex w-full items-center gap-2 px-2.5 py-1.5 text-xs"
152
253
  >
@@ -169,65 +270,145 @@ export function ToolCallItem({
169
270
  );
170
271
  }
171
272
 
172
- const displaySubtitle = isSubAgent
173
- ? null
174
- : category === "shell" && primaryArg
175
- ? normalize(primaryArg)
176
- : primaryArg;
273
+ // Shell shows neither a command subtitle nor an exit summary in the header —
274
+ // both live in the terminal session body below, so the header stays minimal
275
+ // (icon + label + status + duration).
276
+ const displaySubtitle =
277
+ isSubAgent || category === "shell" ? null : primaryArg;
278
+
279
+ // For file tools the subtitle is a path: render it filename-first through
280
+ // FilePathLink (full path on hover) rather than the raw, often-absolute string
281
+ // that buried the file name behind a long prefix.
282
+ const subtitleIsFilePath =
283
+ !isSubAgent && primaryArg != null && isFileCategory(category);
284
+
285
+ // Preview categories (shell, edit, write, fetch, web-search, unknown, mcp)
286
+ // render their body ALWAYS — Cursor-style "previews aren't collapsible" — so
287
+ // no header chevron competes with the body's own in-place reveal. Summary
288
+ // categories and sub-agents keep the chevron: their body is genuinely hidden
289
+ // by default, so the chevron has a real job. The two disclosure axes
290
+ // (card-level chevron vs. content-overflow reveal) never govern one body.
291
+ const isPreviewCategory = !isSubAgent && disclosure === "preview";
292
+
293
+ // The disclosed body, shared by both layouts: a pending gate decides inline,
294
+ // a sub-agent shows its delegation, otherwise the category detail.
295
+ const body = isSubAgent ? (
296
+ <SubAgentSection subAgentExecution={subAgentExecution} collapsible={false} />
297
+ ) : approval ? (
298
+ // The row above is this approval's header, so render only the body (preview
299
+ // + actions). The enclosing card already carries the border + warning/
300
+ // destructive accent for a pending gate, so the body renders borderless.
301
+ <ApprovalCardBody
302
+ pendingApproval={approval.pendingApproval}
303
+ onSubmit={approval.onSubmit}
304
+ isSubmitting={approval.isSubmitting}
305
+ error={approval.error}
306
+ />
307
+ ) : (
308
+ <ToolCallDetail
309
+ toolCall={toolCall}
310
+ primaryArgTruncated={primaryArgTruncated}
311
+ />
312
+ );
177
313
 
314
+ // The header's metadata, identical in both layouts (the chevron is appended
315
+ // only by the summary layout below).
316
+ const headerInner = (
317
+ <>
318
+ <span className="shrink-0 text-muted-foreground" aria-hidden="true">
319
+ <CategoryIcon />
320
+ </span>
321
+
322
+ <span className="min-w-0 flex-1 flex items-baseline gap-1.5 overflow-hidden">
323
+ <span className="shrink-0 font-medium text-foreground">
324
+ {displayLabel}
325
+ </span>
326
+ {subtitleIsFilePath && primaryArg ? (
327
+ <FilePathLink
328
+ path={primaryArg}
329
+ className="min-w-0 text-xs text-muted-foreground"
330
+ />
331
+ ) : (
332
+ displaySubtitle && (
333
+ <span
334
+ ref={measuresSubtitle ? subtitleRef : undefined}
335
+ title={displaySubtitle}
336
+ className="min-w-0 truncate text-muted-foreground font-mono"
337
+ >
338
+ {displaySubtitle}
339
+ </span>
340
+ )
341
+ )}
342
+ {!isSubAgent && category !== "shell" && resultSummary && (
343
+ <span className="shrink-0 tabular-nums text-muted-foreground">
344
+ {resultSummary}
345
+ </span>
346
+ )}
347
+ </span>
348
+
349
+ {trailingContent}
350
+ </>
351
+ );
352
+
353
+ // Preview layout: a plain (non-button) header above an always-visible body.
354
+ // The body renders only when it has something to show — a pending gate, or a
355
+ // non-empty result — so a no-output shell (which normalizes to an `empty`
356
+ // result) stays a clean one-line row, never an empty padded box.
357
+ if (isPreviewCategory) {
358
+ const showBody = approval != null || result.type !== "empty";
359
+ return (
360
+ <div
361
+ data-cursor-target="tool-call-row"
362
+ className={cn(cardClass, className)}
363
+ >
364
+ <div className="flex w-full items-center gap-2 px-2.5 py-1.5 text-xs">
365
+ {headerInner}
366
+ </div>
367
+ {showBody && (
368
+ <div className="px-2.5 pb-2.5 pt-1" data-cursor-target="tool-preview">
369
+ {body}
370
+ </div>
371
+ )}
372
+ </div>
373
+ );
374
+ }
375
+
376
+ // Summary / sub-agent layout: a chevron-gated header disclosing a body hidden
377
+ // by default. The header is a div[role=button], not a <button>, because it
378
+ // carries the nested "Inspect tool call" <button> (a <button> may not contain
379
+ // another); Enter/Space drive the toggle for keyboard parity.
178
380
  return (
179
- <div className={cn(
180
- "border-b border-border-muted last:border-b-0",
181
- selection?.isSelected && "ring-1 ring-primary/40 rounded-sm",
182
- className,
183
- )}>
184
- <button
185
- type="button"
381
+ <div
382
+ data-cursor-target="tool-call-row"
383
+ className={cn(cardClass, className)}
384
+ >
385
+ <div
386
+ role="button"
387
+ tabIndex={0}
186
388
  aria-expanded={expanded}
187
- onClick={() => setExpanded((v) => !v)}
389
+ onClick={handleToggle}
390
+ onKeyDown={(e) => {
391
+ if (e.key === "Enter" || e.key === " ") {
392
+ e.preventDefault();
393
+ handleToggle();
394
+ }
395
+ }}
188
396
  className={cn(
189
- "flex w-full items-center gap-2 px-2.5 py-1.5 text-left text-xs transition-colors",
397
+ "flex w-full cursor-pointer items-center gap-2 px-2.5 py-1.5 text-left text-xs transition-colors",
190
398
  "hover:bg-muted-subtle",
399
+ // ring-inset so the card's overflow-hidden does not clip the focus ring.
400
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring",
191
401
  expanded && "bg-muted-faint",
192
402
  )}
193
403
  >
194
- <span className="shrink-0 text-muted-foreground" aria-hidden="true">
195
- <CategoryIcon />
196
- </span>
197
-
198
- <span className="min-w-0 flex-1 flex items-baseline gap-1.5 overflow-hidden">
199
- <span className="shrink-0 font-medium text-foreground">
200
- {displayLabel}
201
- </span>
202
- {displaySubtitle && (
203
- <span className="min-w-0 truncate text-muted-foreground font-mono">
204
- {displaySubtitle}
205
- </span>
206
- )}
207
- {!isSubAgent && resultSummary && (
208
- <span className="shrink-0 tabular-nums text-muted-foreground">
209
- {resultSummary}
210
- </span>
211
- )}
212
- </span>
213
-
214
- {trailingContent}
215
-
404
+ {headerInner}
216
405
  <ChevronIcon expanded={expanded} />
217
- </button>
218
-
219
- {expanded && (
220
- <div className="px-2.5 pb-2.5 pt-1">
221
- {isSubAgent ? (
222
- <SubAgentSection subAgentExecution={subAgentExecution} collapsible={false} />
223
- ) : (
224
- <ToolCallDetail toolCall={toolCall} />
225
- )}
226
- </div>
227
- )}
406
+ </div>
407
+
408
+ {expanded && <div className="px-2.5 pb-2.5 pt-1">{body}</div>}
228
409
  </div>
229
410
  );
230
- }
411
+ });
231
412
 
232
413
  // ---------------------------------------------------------------------------
233
414
  // Approval badge
@@ -252,6 +433,23 @@ function getApprovalBadge(toolCall: ToolCall): ApprovalBadgeInfo | null {
252
433
  }
253
434
  }
254
435
 
436
+ // ---------------------------------------------------------------------------
437
+ // File-review badge — a stamped edit row's live review state
438
+ // ---------------------------------------------------------------------------
439
+
440
+ /**
441
+ * The badge pill for each {@link FileReviewRowState}, in the approval badge's
442
+ * visual vocabulary. "Kept"/"Discarded" match the decision surface's verdict
443
+ * copy (see FileReviewCard's VerdictBadge) so the row and the bar always speak
444
+ * the same language.
445
+ */
446
+ const REVIEW_BADGE: Record<FileReviewRowState, ApprovalBadgeInfo> = {
447
+ pending: { label: "Pending review", colorClass: "bg-warning/15 text-warning" },
448
+ kept: { label: "Kept", colorClass: "bg-success/15 text-success" },
449
+ discarded: { label: "Discarded", colorClass: "bg-destructive/15 text-destructive" },
450
+ failed: { label: "Review failed", colorClass: "bg-destructive/15 text-destructive" },
451
+ };
452
+
255
453
  // ---------------------------------------------------------------------------
256
454
  // Status mapping
257
455
  // ---------------------------------------------------------------------------