@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,53 @@
1
+ import type { TodoItem } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/todo_pb";
2
+ /** Props for {@link TodoCard}. */
3
+ export interface TodoCardProps {
4
+ /**
5
+ * The agent's todo map for one execution — the proto map shape
6
+ * (`execution.status.todos`) passed through by reference so a settled
7
+ * card skips re-renders while siblings stream (DD-009/010).
8
+ */
9
+ readonly todos: {
10
+ readonly [key: string]: TodoItem;
11
+ };
12
+ /** Additional CSS class names for the root container. */
13
+ readonly className?: string;
14
+ }
15
+ /**
16
+ * The agent's plan, rendered inline in the message thread as a collapsible
17
+ * card — the Cursor-style "what I'm going to do, and how far I've got"
18
+ * surface. It is the in-thread home of the todo list that previously lived
19
+ * in the right-side Plan tab.
20
+ *
21
+ * The card chrome matches the rest of the thread's tool cards (a single
22
+ * neutral {@link https://tailwindcss.com `border-border-prominent`} line) and
23
+ * wraps the chrome-less {@link TodoList} primitive — the same list the
24
+ * sub-agent section renders bare, so there is exactly one todo renderer and no
25
+ * card-in-a-card.
26
+ *
27
+ * Disclosure follows the thread's {@link useAutoDisclosure} convention: open
28
+ * while the plan is active (any item in progress), settling closed once the
29
+ * plan is fully resolved, with a user's manual toggle always winning. This
30
+ * keeps an in-flight plan visible and a finished one tidy, mirroring
31
+ * `ToolRunGroup`/{@link SubAgentSection}.
32
+ *
33
+ * `React.memo`'d on the by-reference `todos` map: structural sharing
34
+ * (`shareTodos`) keeps the reference stable across stream frames, so the card
35
+ * re-renders only when the plan actually changes — never per frame.
36
+ *
37
+ * All visual properties flow through `--stgm-*` tokens.
38
+ *
39
+ * @example
40
+ * ```tsx
41
+ * <TodoCard todos={execution.status?.todos ?? {}} />
42
+ * ```
43
+ */
44
+ export declare const TodoCard: import("react").NamedExoticComponent<TodoCardProps>;
45
+ /**
46
+ * Shallow comparator for {@link TodoCardProps}. The `todos` map is kept
47
+ * referentially stable by `shareTodos`, so an identity check is exactly the
48
+ * right (and cheapest) "did the plan change?" test.
49
+ *
50
+ * @internal Exported for testing — not part of the public API.
51
+ */
52
+ export declare function todoCardPropsEqual(prev: Readonly<TodoCardProps>, next: Readonly<TodoCardProps>): boolean;
53
+ //# sourceMappingURL=TodoCard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TodoCard.d.ts","sourceRoot":"","sources":["../../src/execution/TodoCard.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,8DAA8D,CAAC;AAO7F,kCAAkC;AAClC,MAAM,WAAW,aAAa;IAC5B;;;;OAIG;IACH,QAAQ,CAAC,KAAK,EAAE;QAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,QAAQ,CAAA;KAAE,CAAC;IACrD,yDAAyD;IACzD,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,eAAO,MAAM,QAAQ,qDA6EC,CAAC;AAEvB;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,QAAQ,CAAC,aAAa,CAAC,EAC7B,IAAI,EAAE,QAAQ,CAAC,aAAa,CAAC,GAC5B,OAAO,CAET"}
@@ -0,0 +1,77 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { memo, useMemo } from "react";
4
+ import { TodoStatus } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/enum_pb";
5
+ import { cn } from "@stigmer/theme";
6
+ import { useRenderTracer } from "../internal/dev";
7
+ import { useAutoDisclosure } from "../internal/useAutoDisclosure";
8
+ import { TodoList, findActiveTodo, todoCompletionSummary } from "./TodoList";
9
+ /**
10
+ * The agent's plan, rendered inline in the message thread as a collapsible
11
+ * card — the Cursor-style "what I'm going to do, and how far I've got"
12
+ * surface. It is the in-thread home of the todo list that previously lived
13
+ * in the right-side Plan tab.
14
+ *
15
+ * The card chrome matches the rest of the thread's tool cards (a single
16
+ * neutral {@link https://tailwindcss.com `border-border-prominent`} line) and
17
+ * wraps the chrome-less {@link TodoList} primitive — the same list the
18
+ * sub-agent section renders bare, so there is exactly one todo renderer and no
19
+ * card-in-a-card.
20
+ *
21
+ * Disclosure follows the thread's {@link useAutoDisclosure} convention: open
22
+ * while the plan is active (any item in progress), settling closed once the
23
+ * plan is fully resolved, with a user's manual toggle always winning. This
24
+ * keeps an in-flight plan visible and a finished one tidy, mirroring
25
+ * `ToolRunGroup`/{@link SubAgentSection}.
26
+ *
27
+ * `React.memo`'d on the by-reference `todos` map: structural sharing
28
+ * (`shareTodos`) keeps the reference stable across stream frames, so the card
29
+ * re-renders only when the plan actually changes — never per frame.
30
+ *
31
+ * All visual properties flow through `--stgm-*` tokens.
32
+ *
33
+ * @example
34
+ * ```tsx
35
+ * <TodoCard todos={execution.status?.todos ?? {}} />
36
+ * ```
37
+ */
38
+ export const TodoCard = memo(function TodoCard({ todos, className, }) {
39
+ useRenderTracer("TodoCard", { todos });
40
+ const count = Object.keys(todos).length;
41
+ const isActive = findActiveTodo(todos) != null;
42
+ const summary = todoCompletionSummary(todos);
43
+ const allDone = useMemo(() => count > 0 &&
44
+ Object.values(todos).every((t) => t.status === TodoStatus.TODO_COMPLETED ||
45
+ t.status === TodoStatus.TODO_CANCELLED), [todos, count]);
46
+ // Open while the plan is being worked, tidy once it is fully resolved; a
47
+ // manual toggle wins for the card's lifetime. A completed plan in session
48
+ // history therefore renders collapsed.
49
+ const [expanded, handleToggle] = useAutoDisclosure(isActive);
50
+ // buildThreadItems only emits this item when todos exist, but guard anyway
51
+ // so the component is safe to use standalone.
52
+ if (count === 0)
53
+ return null;
54
+ return (_jsxs("div", { role: "region", "aria-label": "Agent to-dos", "data-cursor-target": "todo-card", className: cn("rounded-lg border border-border-prominent overflow-hidden", className), children: [_jsxs("button", { type: "button", "aria-expanded": expanded, onClick: handleToggle, className: cn("flex w-full cursor-pointer items-center gap-2 px-2.5 py-1.5 text-left text-xs text-muted-foreground transition-colors", "hover:bg-muted-subtle",
55
+ // ring-inset so the card's overflow-hidden does not clip the focus ring.
56
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring"), children: [_jsx("span", { className: cn("shrink-0", allDone ? "text-success" : "text-muted-foreground"), "aria-hidden": "true", children: _jsx(PlanIcon, {}) }), _jsx("span", { className: "min-w-0 flex-1 truncate font-medium text-foreground", children: "To-dos" }), summary && (_jsx("span", { className: "shrink-0 tabular-nums text-muted-foreground", children: summary })), _jsx(ChevronIcon, { expanded: expanded })] }), expanded && (_jsx("div", { className: "border-t border-border-muted px-2.5 py-2", children: _jsx(TodoList, { todos: todos }) }))] }));
57
+ }, todoCardPropsEqual);
58
+ /**
59
+ * Shallow comparator for {@link TodoCardProps}. The `todos` map is kept
60
+ * referentially stable by `shareTodos`, so an identity check is exactly the
61
+ * right (and cheapest) "did the plan change?" test.
62
+ *
63
+ * @internal Exported for testing — not part of the public API.
64
+ */
65
+ export function todoCardPropsEqual(prev, next) {
66
+ return prev.todos === next.todos && prev.className === next.className;
67
+ }
68
+ // ---------------------------------------------------------------------------
69
+ // Inline SVG icons — kept inline for SDK independence (codebase pattern)
70
+ // ---------------------------------------------------------------------------
71
+ function PlanIcon() {
72
+ return (_jsx("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", children: _jsx("path", { d: "M2 3h8M2 6h6M2 9h7" }) }));
73
+ }
74
+ function ChevronIcon({ expanded }) {
75
+ 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 text-muted-foreground transition-transform duration-150", expanded && "rotate-90"), "aria-hidden": "true", children: _jsx("path", { d: "M3.5 2L6.5 5L3.5 8" }) }));
76
+ }
77
+ //# sourceMappingURL=TodoCard.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TodoCard.js","sourceRoot":"","sources":["../../src/execution/TodoCard.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEtC,OAAO,EA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AC;AACJ,CAAC;AAED,SAAS,WAAW,CAAC,EAAE,QAAQ,EAAyB;IACtD,OAAO,CACL,cACE,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,MAAM,EAAC,cAAc,EACrB,WAAW,EAAC,KAAK,EACjB,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,EACtB,SAAS,EAAE,EAAE,CACX,kEAAkE,EAClE,QAAQ,IAAI,WAAW,CACxB,iBACW,MAAM,YAElB,eAAM,CAAC,EAAC,oBAAoB,GAAG,GAC3B,CACP,CAAC;AACJ,CAAC"}
@@ -12,6 +12,12 @@ export interface ToolArgsViewProps {
12
12
  readonly args: Record<string, unknown> | null;
13
13
  /** MCP server slug for MCP tool classification and metadata. */
14
14
  readonly mcpServerSlug?: string;
15
+ /**
16
+ * Whether the file-tool view renders the path row. Defaults to `true`. Set to
17
+ * `false` where an ancestor already names the file (the approval gate header),
18
+ * so the write/edit content shows without restating the path.
19
+ */
20
+ readonly showFileName?: boolean;
15
21
  /** Additional CSS class names for the root container. */
16
22
  readonly className?: string;
17
23
  }
@@ -39,5 +45,5 @@ export interface ToolArgsViewProps {
39
45
  * <ToolArgsView toolName={tc.name} args={tc.args} mcpServerSlug={tc.mcpServerSlug} />
40
46
  * ```
41
47
  */
42
- export declare function ToolArgsView({ toolName, args, mcpServerSlug, className, }: ToolArgsViewProps): import("react/jsx-runtime").JSX.Element;
48
+ export declare function ToolArgsView({ toolName, args, mcpServerSlug, showFileName, className, }: ToolArgsViewProps): import("react/jsx-runtime").JSX.Element;
43
49
  //# sourceMappingURL=ToolArgsView.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ToolArgsView.d.ts","sourceRoot":"","sources":["../../src/execution/ToolArgsView.tsx"],"names":[],"mappings":"AAsBA,sCAAsC;AACtC,MAAM,WAAW,iBAAiB;IAChC;;;OAGG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B;;;OAGG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAC9C,gEAAgE;IAChE,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,yDAAyD;IACzD,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,YAAY,CAAC,EAC3B,QAAQ,EACR,IAAI,EACJ,aAAa,EACb,SAAS,GACV,EAAE,iBAAiB,2CAsBnB"}
1
+ {"version":3,"file":"ToolArgsView.d.ts","sourceRoot":"","sources":["../../src/execution/ToolArgsView.tsx"],"names":[],"mappings":"AAsBA,sCAAsC;AACtC,MAAM,WAAW,iBAAiB;IAChC;;;OAGG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B;;;OAGG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAC9C,gEAAgE;IAChE,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC;;;;OAIG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,CAAC;IAChC,yDAAyD;IACzD,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,YAAY,CAAC,EAC3B,QAAQ,EACR,IAAI,EACJ,aAAa,EACb,YAAmB,EACnB,SAAS,GACV,EAAE,iBAAiB,2CAuBnB"}
@@ -5,7 +5,7 @@ import { cn } from "@stigmer/theme";
5
5
  import { resolveToolCategory, } from "./tool-categories";
6
6
  import { FilePathLink } from "./FilePathLink";
7
7
  import { McpArgsView, McpMetadataRow } from "./McpToolDetail";
8
- import { useSandboxNormalize } from "./SandboxContext";
8
+ import { TerminalSession } from "./TerminalSession";
9
9
  import { CollapsibleCode, FilePathIcon, formatJson, } from "./tool-rendering-primitives";
10
10
  /**
11
11
  * Unified tool-arguments renderer used by both {@link ApprovalCard}
@@ -31,15 +31,15 @@ import { CollapsibleCode, FilePathIcon, formatJson, } from "./tool-rendering-pri
31
31
  * <ToolArgsView toolName={tc.name} args={tc.args} mcpServerSlug={tc.mcpServerSlug} />
32
32
  * ```
33
33
  */
34
- export function ToolArgsView({ toolName, args, mcpServerSlug, className, }) {
34
+ export function ToolArgsView({ toolName, args, mcpServerSlug, showFileName = true, className, }) {
35
35
  const categoryInfo = useMemo(() => resolveToolCategory(toolName, mcpServerSlug), [toolName, mcpServerSlug]);
36
36
  const primaryArg = useMemo(() => extractPrimaryArgValue(args, categoryInfo), [args, categoryInfo]);
37
- return (_jsx("div", { className: cn("text-xs", className), children: _jsx(CategoryArgsDispatch, { category: categoryInfo.category, toolName: toolName, args: args, primaryArg: primaryArg, mcpServerSlug: mcpServerSlug }) }));
37
+ return (_jsx("div", { className: cn("text-xs", className), children: _jsx(CategoryArgsDispatch, { category: categoryInfo.category, toolName: toolName, args: args, primaryArg: primaryArg, mcpServerSlug: mcpServerSlug, showFileName: showFileName }) }));
38
38
  }
39
39
  // ---------------------------------------------------------------------------
40
40
  // Dispatch
41
41
  // ---------------------------------------------------------------------------
42
- function CategoryArgsDispatch({ category, toolName, args, primaryArg, mcpServerSlug, }) {
42
+ function CategoryArgsDispatch({ category, toolName, args, primaryArg, mcpServerSlug, showFileName, }) {
43
43
  switch (category) {
44
44
  case "shell":
45
45
  return primaryArg ? _jsx(ShellArgsView, { command: primaryArg }) : null;
@@ -47,7 +47,7 @@ function CategoryArgsDispatch({ category, toolName, args, primaryArg, mcpServerS
47
47
  case "write":
48
48
  case "edit":
49
49
  case "delete":
50
- return primaryArg ? (_jsx(FileArgsView, { path: primaryArg, category: category, args: args })) : null;
50
+ return primaryArg ? (_jsx(FileArgsView, { path: primaryArg, category: category, args: args, showFileName: showFileName })) : null;
51
51
  case "search":
52
52
  case "list":
53
53
  return primaryArg ? _jsx(SearchArgsView, { pattern: primaryArg }) : null;
@@ -60,11 +60,12 @@ function CategoryArgsDispatch({ category, toolName, args, primaryArg, mcpServerS
60
60
  // ---------------------------------------------------------------------------
61
61
  // Category-specific views
62
62
  // ---------------------------------------------------------------------------
63
+ // Pre-execution (approval gate) shell view: the command only, in the same
64
+ // terminal chrome the completed call uses — there is no output yet.
63
65
  function ShellArgsView({ command }) {
64
- const normalize = useSandboxNormalize();
65
- return (_jsx("div", { className: "rounded-md border border-border bg-[var(--stgm-terminal-bg,#1a1a2e)] p-2.5", children: _jsxs("pre", { className: "whitespace-pre-wrap break-words font-mono text-xs text-[var(--stgm-terminal-fg,#e0e0e0)]", children: [_jsxs("span", { className: "select-none text-[var(--stgm-terminal-prompt,#6b7280)]", children: ["$", " "] }), normalize(command)] }) }));
66
+ return _jsx(TerminalSession, { command: command });
66
67
  }
67
- function FileArgsView({ path, category, args, }) {
68
+ function FileArgsView({ path, category, args, showFileName = true, }) {
68
69
  const writeContent = useMemo(() => {
69
70
  if (category !== "write" && category !== "edit")
70
71
  return null;
@@ -72,7 +73,7 @@ function FileArgsView({ path, category, args, }) {
72
73
  return null;
73
74
  return extractWriteContentFromArgs(args);
74
75
  }, [category, args]);
75
- return (_jsxs("div", { className: "space-y-1.5", children: [_jsxs("div", { className: "flex items-center gap-1.5 text-xs", children: [_jsx(FilePathIcon, {}), _jsx(FilePathLink, { path: path, className: "text-xs" })] }), writeContent && (_jsx(CollapsibleCode, { label: "Content", content: writeContent }))] }));
76
+ return (_jsxs("div", { className: "space-y-1.5", children: [showFileName && (_jsxs("div", { className: "flex items-center gap-1.5 text-xs", children: [_jsx(FilePathIcon, {}), _jsx(FilePathLink, { path: path, className: "text-xs" })] })), writeContent && (_jsx(CollapsibleCode, { label: "Content", content: writeContent }))] }));
76
77
  }
77
78
  function SearchArgsView({ pattern }) {
78
79
  return (_jsxs("div", { className: "flex items-center gap-1.5 text-xs", children: [_jsx("span", { className: "text-muted-foreground", children: "Pattern:" }), _jsx("code", { className: "rounded bg-muted px-1.5 py-0.5 font-mono text-foreground", children: pattern })] }));
@@ -1 +1 @@
1
- {"version":3,"file":"ToolArgsView.js","sourceRoot":"","sources":["../../src/execution/ToolArgsView.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AACpC,OAAO,EACL,mBAAmB,GAEpB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EACL,eAAe,EACf,YAAY,EACZ,UAAU,GACX,MAAM,6BAA6B,CAAC;AAwBrC;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,UAAU,YAAY,CAAC,EAC3B,QAAQ,EACR,IAAI,EACJ,aAAa,EACb,SAAS,GACS;IAClB,MAAM,YAAY,GAAG,OAAO,CAC1B,GAAG,EAAE,CAAC,mBAAmB,CAAC,QAAQ,EAAE,aAAa,CAAC,EAClD,CAAC,QAAQ,EAAE,aAAa,CAAC,CAC1B,CAAC;IAEF,MAAM,UAAU,GAAG,OAAO,CACxB,GAAG,EAAE,CAAC,sBAAsB,CAAC,IAAI,EAAE,YAAY,CAAC,EAChD,CAAC,IAAI,EAAE,YAAY,CAAC,CACrB,CAAC;IAEF,OAAO,CACL,cAAK,SAAS,EAAE,EAAE,CAAC,SAAS,EAAE,SAAS,CAAC,YACtC,KAAC,oBAAoB,IACnB,QAAQ,EAAE,YAAY,CAAC,QAAQ,EAC/B,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,IAAI,EACV,UAAU,EAAE,UAAU,EACtB,aAA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ailProps {
4
4
  /** The tool call to render in detail. */
5
5
  readonly toolCall: ToolCall;
6
+ /**
7
+ * Whether the owning row's header truncated the primary argument (the search
8
+ * query / list path). A header-owned layout fact: when `true`, the search/list
9
+ * body restates the full, wrapping value so a long query is reachable without
10
+ * relying on the hover tooltip; when `false` (the default) the header already
11
+ * shows the value in full, so the body does not repeat it. Only the
12
+ * search/list branch consumes it.
13
+ */
14
+ readonly primaryArgTruncated?: boolean;
6
15
  /** Additional CSS class names for the root container. */
7
16
  readonly className?: string;
8
17
  }
@@ -27,7 +36,7 @@ export interface ToolCallDetailProps {
27
36
  * <ToolCallDetail toolCall={toolCall} />
28
37
  * ```
29
38
  */
30
- export declare function ToolCallDetail({ toolCall, className }: ToolCallDetailProps): import("react/jsx-runtime").JSX.Element;
39
+ export declare function ToolCallDetail({ toolCall, primaryArgTruncated, className, }: ToolCallDetailProps): import("react/jsx-runtime").JSX.Element;
31
40
  /**
32
41
  * Returns a human-readable duration string from two ISO 8601 timestamps, or
33
42
  * `null` when either timestamp is empty or invalid.
@@ -1 +1 @@
1
- {"version":3,"file":"ToolCallDetail.d.ts","sourceRoot":"","sources":["../../src/execution/ToolCallDetail.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iEAAiE,CAAC;AAUhG,wCAAwC;AACxC,MAAM,WAAW,mBAAmB;IAClC,yCAAyC;IACzC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,yDAAyD;IACzD,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,cAAc,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,mBAAmB,2CAQ1E;AAkHD;;;GAGG;AACH,wBAAgB,cAAc,CAC5B,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,MAAM,GAClB,MAAM,GAAG,IAAI,CAiBf"}
1
+ {"version":3,"file":"ToolCallDetail.d.ts","sourceRoot":"","sources":["../../src/execution/ToolCallDetail.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iEAAiE,CAAC;AAehG,wCAAwC;AACxC,MAAM,WAAW,mBAAmB;IAClC,yCAAyC;IACzC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B;;;;;;;OAOG;IACH,QAAQ,CAAC,mBAAmB,CAAC,EAAE,OAAO,CAAC;IACvC,yDAAyD;IACzD,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,cAAc,CAAC,EAC7B,QAAQ,EACR,mBAA2B,EAC3B,SAAS,GACV,EAAE,mBAAmB,2CAcrB;AAyMD;;;GAGG;AACH,wBAAgB,cAAc,CAC5B,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,MAAM,GAClB,MAAM,GAAG,IAAI,CAiBf"}
@@ -1,11 +1,13 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { cn } from "@stigmer/theme";
4
+ import { BoundedContent } from "../internal/BoundedContent";
4
5
  import { McpToolDetail } from "./McpToolDetail";
5
6
  import { ToolArgsView } from "./ToolArgsView";
6
7
  import { ResultView } from "./ResultView";
7
8
  import { useToolPresentation } from "./tool-presenter";
8
9
  import { CollapsiblePre } from "./tool-rendering-primitives";
10
+ import { describeApprovalPolicySource, isInformativePolicySource, } from "./approval-provenance";
9
11
  /**
10
12
  * Renders the detail panel for a single tool call with category-specific
11
13
  * treatments.
@@ -27,39 +29,75 @@ import { CollapsiblePre } from "./tool-rendering-primitives";
27
29
  * <ToolCallDetail toolCall={toolCall} />
28
30
  * ```
29
31
  */
30
- export function ToolCallDetail({ toolCall, className }) {
31
- const { category, result } = useToolPresentation(toolCall);
32
- return (_jsx("div", { className: cn("space-y-2 text-xs", className), children: _jsx(CategoryDetail, { toolCall: toolCall, category: category, result: result }) }));
32
+ export function ToolCallDetail({ toolCall, primaryArgTruncated = false, className, }) {
33
+ const { category, result, primaryArg } = useToolPresentation(toolCall);
34
+ return (_jsx("div", { className: cn("space-y-2 text-xs", className), children: _jsx(CategoryDetail, { toolCall: toolCall, category: category, result: result, primaryArg: primaryArg, primaryArgTruncated: primaryArgTruncated }) }));
33
35
  }
34
36
  // ---------------------------------------------------------------------------
35
37
  // Category composition
36
38
  //
37
- // Each category composes from three parts: MetadataRow (duration, slug),
38
- // ToolArgsView (the input), and ResultView (the effect). The combination is
39
- // chosen to be informative without duplication.
39
+ // Invariant: the owning row header owns the METADATA (icon, label, file name,
40
+ // ± stats, MCP slug, status, duration); the detail body owns the CONTENT — the
41
+ // ToolArgsView input and the ResultView effect — plus, at most, a
42
+ // ProvenanceNote when the authorization provenance is genuinely informative.
43
+ // The body never restates header metadata. Each category picks the input/effect
44
+ // combination that is informative without duplication.
40
45
  // ---------------------------------------------------------------------------
41
- function CategoryDetail({ toolCall, category, result, }) {
46
+ function CategoryDetail({ toolCall, category, result, primaryArg, primaryArgTruncated, }) {
42
47
  const args = _jsx(ArgsSection, { toolCall: toolCall });
43
48
  switch (category) {
44
49
  case "think":
45
50
  return _jsx(ThinkToolDetail, { toolCall: toolCall });
46
51
  case "mcp":
47
52
  return _jsx(McpToolDetail, { toolCall: toolCall });
53
+ case "search":
54
+ case "list":
55
+ // The query/path is the input; the matches are the effect. The owning row
56
+ // header already shows the query (truncated, with a hover tooltip), so the
57
+ // body does NOT restate it as a redundant "Pattern:" row — it shows the
58
+ // full, wrapping value only when the header truncated it (a long query),
59
+ // then the result. This is the search/list analog of the edit branch's
60
+ // "the diff already names the file" de-duplication.
61
+ return (_jsxs(_Fragment, { children: [_jsx(ProvenanceNote, { toolCall: toolCall }), primaryArgTruncated && primaryArg && (_jsx(SearchQueryBlock, { category: category, value: primaryArg })), _jsx(ResultView, { view: result, showStats: false })] }));
48
62
  case "edit":
63
+ case "write":
49
64
  // The diff already names the file and quantifies the change, so it stands
50
- // alone — showing the new content as an argument would duplicate it.
51
- return (_jsxs(_Fragment, { children: [_jsx(MetadataRow, { toolCall: toolCall }), _jsx(ResultView, { view: result })] }));
65
+ // alone — showing the written content as an argument would duplicate it. A
66
+ // write whose capture is unavailable degrades to a `file` result here
67
+ // (ResultView shows the content), so the input is never lost. The owning
68
+ // row already names the file, so the body suppresses the path.
69
+ //
70
+ // The diff is the one tool body with no internal truncation of its own, so
71
+ // it is bounded by the shared BoundedContent budget (the same clamp the
72
+ // approval gate diff uses) — a large or still-streaming edit shows a
73
+ // consistent, scannable window with one in-place reveal, never the whole
74
+ // file. Every other category's body self-truncates (terminal / text via
75
+ // CollapsiblePre), so only edit/write wrap here — never double-bound.
76
+ return (_jsxs(_Fragment, { children: [_jsx(ProvenanceNote, { toolCall: toolCall }), _jsx(BoundedContent, { cursorTarget: "tool-detail-expand", children: _jsx(ResultView, { view: result, showFileName: false, showStats: false }) })] }));
52
77
  case "read":
53
- case "write":
54
78
  case "delete":
55
- // The input is the point (path, or path + written content). Only surface a
79
+ // The input is the point (path, or path for a delete). Only surface a
56
80
  // result body when it carries new information — i.e. an error.
57
- return (_jsxs(_Fragment, { children: [_jsx(MetadataRow, { toolCall: toolCall }), args, result.type === "error" && _jsx(ResultView, { view: result })] }));
81
+ return (_jsxs(_Fragment, { children: [_jsx(ProvenanceNote, { toolCall: toolCall }), args, result.type === "error" && _jsx(ResultView, { view: result })] }));
82
+ case "shell":
83
+ // The result IS a terminal session (command + output in one block via
84
+ // ResultView's terminal view), so a separate args box would just restate
85
+ // the command line the session already leads with. The exception is a
86
+ // hard tool failure (TOOL_CALL_FAILED → error view, which has no command):
87
+ // show the command (args) alongside the error so it is never lost.
88
+ return (_jsxs(_Fragment, { children: [_jsx(ProvenanceNote, { toolCall: toolCall }), result.type === "error" ? (_jsxs(_Fragment, { children: [args, _jsx(ResultView, { view: result })] })) : (_jsx(ResultView, { view: result }))] }));
58
89
  default:
59
- // shell, search, list, fetch, web-search, unknown: input + effect.
60
- return (_jsxs(_Fragment, { children: [_jsx(MetadataRow, { toolCall: toolCall }), args, _jsx(ResultView, { view: result })] }));
90
+ // fetch, web-search, unknown: input + effect.
91
+ return (_jsxs(_Fragment, { children: [_jsx(ProvenanceNote, { toolCall: toolCall }), args, _jsx(ResultView, { view: result })] }));
61
92
  }
62
93
  }
94
+ // The full, wrapping query (search) or path (list), shown in the body only when
95
+ // the owning row's header truncated it — so a long value is reachable without
96
+ // hovering, without restating a short value the header already shows in full.
97
+ function SearchQueryBlock({ category, value, }) {
98
+ const label = category === "list" ? "Path" : "Query";
99
+ return (_jsxs("div", { className: "space-y-1", children: [_jsx("span", { className: "font-medium text-muted-foreground", children: label }), _jsx("code", { className: "block whitespace-pre-wrap break-words rounded bg-muted px-1.5 py-0.5 font-mono text-foreground", children: value })] }));
100
+ }
63
101
  function ArgsSection({ toolCall }) {
64
102
  return (_jsx(ToolArgsView, { toolName: toolCall.name, args: toolCall.args, mcpServerSlug: toolCall.mcpServerSlug }));
65
103
  }
@@ -72,12 +110,21 @@ function ThinkToolDetail({ toolCall }) {
72
110
  // ---------------------------------------------------------------------------
73
111
  // Shared sub-components
74
112
  // ---------------------------------------------------------------------------
75
- function MetadataRow({ toolCall }) {
76
- const duration = formatDuration(toolCall.startedAt, toolCall.completedAt);
77
- const hasMetadata = toolCall.mcpServerSlug || duration;
78
- if (!hasMetadata)
113
+ // The detail body's only metadata. Duration and the MCP slug live in the owning
114
+ // row header (ToolCallItem / ApprovalCardHeader), so the body never restates
115
+ // them; it surfaces the authorization provenance the runner stamped onto the
116
+ // call (approval_policy_source) ONLY when it is genuinely informative — an
117
+ // explicit override, a server-marked destructive tighten, or a post-hoc
118
+ // lease/bypass that cleared it. The everyday "this category just needs approval"
119
+ // default and legacy UNSPECIFIED are noise, so they render nothing, mirroring
120
+ // the approval gate's smart-suppress (isInformativePolicySource).
121
+ function ProvenanceNote({ toolCall }) {
122
+ if (!isInformativePolicySource(toolCall.approvalPolicySource))
123
+ return null;
124
+ const provenance = describeApprovalPolicySource(toolCall.approvalPolicySource);
125
+ if (!provenance)
79
126
  return null;
80
- return (_jsxs("div", { className: "flex flex-wrap items-center gap-x-3 gap-y-1 text-muted-foreground", children: [toolCall.mcpServerSlug && (_jsx("span", { className: "rounded bg-muted px-1.5 py-0.5 font-mono", children: toolCall.mcpServerSlug })), duration && _jsx("span", { children: duration })] }));
127
+ return (_jsx("p", { className: "text-[11px] italic text-muted-foreground", title: provenance, children: provenance }));
81
128
  }
82
129
  // ---------------------------------------------------------------------------
83
130
  // Utilities
@@ -1 +1 @@
1
- {"version":3,"file":"ToolCallDetail.js","sourceRoot":"","sources":["../../src/execution/ToolCallDetail.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAIb,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAU7D;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,UAAU,cAAc,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAuB;IACzE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,mBAAmB,CAAC,QAAQ,CAAC,CAAC;IAE3D,OAAO,CACL,cAAK,SAAS,EAAE,EAAE,CAAC,mBAAmB,EAAE,SAAS,CAAC,YAChD,KAAC,cAAc,IAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,GAAI,GACtE,CACP,CAAC;AACJ,CAAC;AAED,8EAA8E;AAC9E,uBAAuB;AACvB,E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M,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC;IACjD,OAAO,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,OAAO,KAAK,OAAO,GAAG,CAAC,CAAC,CAAC,GAAG,OAAO,GAAG,CAAC;AACjE,CAAC"}
@@ -12,13 +12,18 @@ export interface ToolCallGroupProps {
12
12
  */
13
13
  readonly subAgentExecutions?: readonly SubAgentExecution[];
14
14
  /**
15
- * Custom summary formatter. Receives the tool calls and returns a
16
- * display string. When omitted, the component uses a default that
17
- * shows the tool name for single calls and a count for multiple.
15
+ * Custom label formatter for a folded run chip (e.g. a run of reads).
16
+ * Receives the run's tool calls and returns the chip's collapsed label.
17
+ *
18
+ * NOTE: the unit of summary moved from the *turn* to the *run*. This used to
19
+ * label the whole turn ("Ran 3 tools"); since the turn no longer collapses,
20
+ * it now labels each {@link ToolRunGroup} chip. The signature is unchanged.
18
21
  */
19
22
  readonly formatSummary?: (toolCalls: readonly ToolCall[]) => string;
20
23
  /**
21
- * Initial expansion state. Defaults to `false`.
24
+ * @deprecated No-op. The turn no longer collapses as a unit — rows persist
25
+ * and only repetitive runs fold (see {@link ToolRunGroup}). Kept for
26
+ * back-compat so existing call sites keep type-checking.
22
27
  */
23
28
  readonly defaultExpanded?: boolean;
24
29
  /** Additional CSS class names for the root container. */
@@ -36,23 +41,28 @@ export interface ToolCallGroupProps {
36
41
  */
37
42
  export declare function toolCallGroupPropsEqual(prev: Readonly<ToolCallGroupProps>, next: Readonly<ToolCallGroupProps>): boolean;
38
43
  /**
39
- * Renders a summary line for a group of tool calls from a single
40
- * AI turn. Click to expand and see individual tool calls.
44
+ * Renders one AI turn's tool activity as a **persistent-row timeline** rather
45
+ * than a collapsible "Ran N tools" box. Each call stays visible after it
46
+ * settles, so completed work is never hidden behind a pill — the thread reads
47
+ * like a virtual human at work.
41
48
  *
42
- * Two-level progressive disclosure:
43
- * 1. **Collapsed** aggregate status icon + summary label.
44
- * 2. **Expanded** — list of {@link ToolCallItem} rows, each
45
- * expandable to show detail (args, result, error, timing) or
46
- * a nested sub-agent thread.
49
+ * The turn is segmented by {@link segmentToolCalls}:
50
+ * - high-signal calls (edits, shell, MCP, sub-agents, …) render as persistent
51
+ * {@link ToolCallItem} rows; a content-bearing call shows its body inline
52
+ * (no card chevron), bounded by a single in-place reveal;
53
+ * - runs of consecutive low-signal same-category calls (read / list / search)
54
+ * fold into one collapsible {@link ToolRunGroup} chip — the *only* collapse,
55
+ * because that is the only genuine noise.
47
56
  *
48
- * Default summaries use active-voice phrasing ("Ran 3 tools",
49
- * "Running 2 tools") with category-aware labels for single tools
50
- * (e.g., "Shell: ls -la /tmp"). Platform builders can override
51
- * via the `formatSummary` prop.
57
+ * The rows are clustered under a light left rail (the neutral counterpart to
58
+ * {@link SubAgentSection}'s primary-tinted rail for delegated work), keeping a
59
+ * turn's tools visually associated with their AI message without a tab that
60
+ * hides things.
52
61
  *
53
- * Wrapped in `React.memo` with a custom comparator that checks
54
- * `toolCalls` elements by reference (structural sharing keeps
55
- * individual `ToolCall` objects stable for unchanged calls).
62
+ * Wrapped in `React.memo` with a custom comparator that checks `toolCalls`
63
+ * elements by reference (structural sharing keeps individual `ToolCall` objects
64
+ * stable for unchanged calls), so settled rows skip re-renders while siblings
65
+ * stream (DD-009/010).
56
66
  *
57
67
  * @example
58
68
  * ```tsx
@@ -1 +1 @@
1
- {"version":3,"file":"ToolCallGroup.d.ts","sourceRoot":"","sources":["../../src/execution/ToolCallGroup.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iEAAiE,CAAC;AAChG,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kEAAkE,CAAC;AAU1G,uCAAuC;AACvC,MAAM,WAAW,kBAAkB;IACjC,4DAA4D;IAC5D,QAAQ,CAAC,SAAS,EAAE,SAAS,QAAQ,EAAE,CAAC;IACxC;;;;;OAKG;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