@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
@@ -13,6 +13,14 @@ export interface ApprovalCardProps {
13
13
  readonly onSubmit: (action: ApprovalAction, comment?: string) => void;
14
14
  /** True while the RPC for this specific tool call is in flight. */
15
15
  readonly isSubmitting?: boolean;
16
+ /**
17
+ * This gate's last failed decision, or `null` — surfaced in-card, beside the
18
+ * action buttons (the optimistic spinner reverts on failure, so this explains
19
+ * the snap-back). A thread can hold many gates; the error must name the one it
20
+ * belongs to, which a single global banner cannot do. Supply the entry from
21
+ * {@link useSubmitApproval}'s `errorsByToolCallId` for this `toolCallId`.
22
+ */
23
+ readonly error?: Error | null;
16
24
  /** Additional CSS class names for the root container. */
17
25
  readonly className?: string;
18
26
  }
@@ -23,9 +31,11 @@ export interface ApprovalCardProps {
23
31
  * The compact header row matches the ToolCallItem layout:
24
32
  * [CategoryIcon] Label primaryArg [⏳ waiting Xm]
25
33
  *
26
- * Arguments are rendered through the shared {@link ToolArgsView}
27
- * dispatch, ensuring pixel-level parity between the approval
28
- * preview and the post-execution detail view.
34
+ * The body shows the proposed change from the tool args (the
35
+ * pre-execution deny-gate has no captured `FileChangeSet` yet): the
36
+ * write/edit content when present, an {@link EmptyChangeNotice} when
37
+ * only a path is known, otherwise the shared {@link ToolArgsView}
38
+ * dispatch, keeping pixel-level parity with the detail view.
29
39
  *
30
40
  * Wrapped in `React.memo` — structural sharing (T04) preserves the
31
41
  * `PendingApproval` reference when unchanged, so approval cards
@@ -41,4 +51,38 @@ export interface ApprovalCardProps {
41
51
  * ```
42
52
  */
43
53
  export declare const ApprovalCard: import("react").NamedExoticComponent<ApprovalCardProps>;
54
+ /** Props for {@link ApprovalCardHeader}. */
55
+ export interface ApprovalCardHeaderProps {
56
+ /** The pending approval to summarize. */
57
+ readonly pendingApproval: PendingApproval;
58
+ /** Adds a bottom divider, for use above {@link ApprovalCardBody}. */
59
+ readonly bordered?: boolean;
60
+ }
61
+ /**
62
+ * The compact summary row of an approval — `[icon] Label primaryArg [via sub]
63
+ * [⏳ Xm]`. Used as the standalone {@link ApprovalCard}'s header. Not rendered
64
+ * inline on a {@link ToolCallItem}, whose own row already serves as the header.
65
+ */
66
+ export declare function ApprovalCardHeader({ pendingApproval, bordered, }: ApprovalCardHeaderProps): import("react/jsx-runtime").JSX.Element;
67
+ /** Props for {@link ApprovalCardBody}. */
68
+ export interface ApprovalCardBodyProps {
69
+ /** The pending approval to render a decision panel for. */
70
+ readonly pendingApproval: PendingApproval;
71
+ /** Called when the user picks Approve / Approve-all / Skip / Reject. */
72
+ readonly onSubmit: (action: ApprovalAction, comment?: string) => void;
73
+ /** True while the RPC for this tool call is in flight. */
74
+ readonly isSubmitting?: boolean;
75
+ /** This gate's last failed decision, or `null` — surfaced in-card below the actions. */
76
+ readonly error?: Error | null;
77
+ /** Additional CSS class names for the body container. */
78
+ readonly className?: string;
79
+ }
80
+ /**
81
+ * The decision panel of an approval: the optional message and gate reason, the
82
+ * file-changes / args preview, and the action buttons. Reused in two places —
83
+ * the standalone {@link ApprovalCard} (with {@link ApprovalCardHeader} above
84
+ * it) and inline inside a gated {@link ToolCallItem}'s expanded panel, where
85
+ * the item's own row is the header. One body, identical preview in both.
86
+ */
87
+ export declare function ApprovalCardBody({ pendingApproval, onSubmit, isSubmitting, error, className, }: ApprovalCardBodyProps): import("react/jsx-runtime").JSX.Element;
44
88
  //# sourceMappingURL=ApprovalCard.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ApprovalCard.d.ts","sourceRoot":"","sources":["../../src/execution/ApprovalCard.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kEAAkE,CAAC;AACxG,OAAO,EAAE,cAAc,EAAE,MAAM,8DAA8D,CAAC;AAS9F,sCAAsC;AACtC,MAAM,WAAW,iBAAiB;IAChC,8CAA8C;IAC9C,QAAQ,CAAC,eAAe,EAAE,eAAe,CAAC;IAC1C;;;;;OAKG;IACH,QAAQ,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,cAAc,EAAE,OAAO,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACtE,mEAAmE;IACnE,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,CAAC;IAChC,yDAAyD;IACzD,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,YAAY,yDAqKvB,CAAC"}
1
+ {"version":3,"file":"ApprovalCard.d.ts","sourceRoot":"","sources":["../../src/execution/ApprovalCard.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kEAAkE,CAAC;AACxG,OAAO,EAAE,cAAc,EAAY,MAAM,8DAA8D,CAAC;AAqBxG,sCAAsC;AACtC,MAAM,WAAW,iBAAiB;IAChC,8CAA8C;IAC9C,QAAQ,CAAC,eAAe,EAAE,eAAe,CAAC;IAC1C;;;;;OAKG;IACH,QAAQ,CAAC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,17 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { memo, useCallback, useEffect, useMemo, useState } from "react";
4
- import { ApprovalAction } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/enum_pb";
4
+ import { ApprovalAction, ToolKind } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/enum_pb";
5
5
  import { cn } from "@stigmer/theme";
6
- import { resolveToolCategoryFromKind, extractPrimaryArgFromPreview, } from "./tool-categories";
6
+ import { describeApprovalPolicySource, isInformativePolicySource, } from "./approval-provenance";
7
+ import { resolveToolCategoryFromKind, extractPrimaryArgFromPreview, extractWriteContentFromPreview, isFileCategory, } from "./tool-categories";
7
8
  import { CATEGORY_ICON } from "./ToolCallItem";
8
9
  import { ToolArgsView } from "./ToolArgsView";
10
+ import { EmptyChangeNotice } from "./EmptyChangeNotice";
11
+ import { FilePathLink } from "./FilePathLink";
12
+ import { DecisionButton } from "../internal/DecisionButton";
13
+ import { InCardDecisionError } from "../internal/InCardDecisionError";
14
+ import { useElapsedSince, formatElapsed } from "../internal/useElapsedSince";
9
15
  /**
10
16
  * Renders a pending tool-call approval request with the same visual
11
17
  * structure as an expanded {@link ToolCallItem} in the history list.
@@ -13,9 +19,11 @@ import { ToolArgsView } from "./ToolArgsView";
13
19
  * The compact header row matches the ToolCallItem layout:
14
20
  * [CategoryIcon] Label primaryArg [⏳ waiting Xm]
15
21
  *
16
- * Arguments are rendered through the shared {@link ToolArgsView}
17
- * dispatch, ensuring pixel-level parity between the approval
18
- * preview and the post-execution detail view.
22
+ * The body shows the proposed change from the tool args (the
23
+ * pre-execution deny-gate has no captured `FileChangeSet` yet): the
24
+ * write/edit content when present, an {@link EmptyChangeNotice} when
25
+ * only a path is known, otherwise the shared {@link ToolArgsView}
26
+ * dispatch, keeping pixel-level parity with the detail view.
19
27
  *
20
28
  * Wrapped in `React.memo` — structural sharing (T04) preserves the
21
29
  * `PendingApproval` reference when unchanged, so approval cards
@@ -30,7 +38,51 @@ import { ToolArgsView } from "./ToolArgsView";
30
38
  * />
31
39
  * ```
32
40
  */
33
- export const ApprovalCard = memo(function ApprovalCard({ pendingApproval, onSubmit, isSubmitting = false, className, }) {
41
+ export const ApprovalCard = memo(function ApprovalCard({ pendingApproval, onSubmit, isSubmitting = false, error = null, className, }) {
42
+ // Prefer the denormalized wire tool_kind (populated by the server-side
43
+ // PendingApproval projection); fall back to the name for legacy executions.
44
+ const categoryInfo = resolveToolCategoryFromKind(pendingApproval.toolKind, pendingApproval.toolName, pendingApproval.mcpServerSlug);
45
+ // Cursor-grade chrome: a thin neutral card (no amber "brown" fill), with the
46
+ // gate's "needs your decision" signal carried by one restrained cue — a 2px
47
+ // left accent bar — plus the warning-colored clock/elapsed in the header. A
48
+ // destructive (delete) gate keeps a red accent as a hard safety signal.
49
+ const accentClass = categoryInfo.category === "delete"
50
+ ? "border-l-2 border-l-destructive"
51
+ : "border-l-2 border-l-warning";
52
+ return (_jsxs("div", { role: "alert", "aria-label": `Approval required for ${pendingApproval.toolName}`, className: cn("rounded-lg border border-border-prominent", accentClass, className), children: [_jsx(ApprovalCardHeader, { pendingApproval: pendingApproval, bordered: true }), _jsx(ApprovalCardBody, { pendingApproval: pendingApproval, onSubmit: onSubmit, isSubmitting: isSubmitting, error: error })] }));
53
+ });
54
+ /**
55
+ * The compact summary row of an approval — `[icon] Label primaryArg [via sub]
56
+ * [⏳ Xm]`. Used as the standalone {@link ApprovalCard}'s header. Not rendered
57
+ * inline on a {@link ToolCallItem}, whose own row already serves as the header.
58
+ */
59
+ export function ApprovalCardHeader({ pendingApproval, bordered = false, }) {
60
+ const categoryInfo = resolveToolCategoryFromKind(pendingApproval.toolKind, pendingApproval.toolName, pendingApproval.mcpServerSlug);
61
+ const CategoryIcon = CATEGORY_ICON[categoryInfo.category];
62
+ const primaryArg = useMemo(() => extractPrimaryArgFromPreview(pendingApproval.toolName, pendingApproval.argsPreview, pendingApproval.mcpServerSlug, pendingApproval.toolKind), [
63
+ pendingApproval.toolName,
64
+ pendingApproval.argsPreview,
65
+ pendingApproval.mcpServerSlug,
66
+ pendingApproval.toolKind,
67
+ ]);
68
+ return (_jsxs("div", { className: cn("flex items-center gap-2 px-2.5 py-1.5 text-xs", bordered && "border-b border-border-muted"), children: [_jsx("span", { className: "shrink-0 text-warning", "aria-hidden": "true", children: _jsx(CategoryIcon, {}) }), _jsxs("span", { className: "min-w-0 flex-1 flex items-center gap-1.5 overflow-hidden", children: [_jsx("span", { className: "shrink-0 font-medium text-foreground", children: categoryInfo.label }), primaryArg &&
69
+ categoryInfo.category !== "shell" &&
70
+ (isFileCategory(categoryInfo.category) ? (
71
+ // A file tool's primary arg is a path — render it filename-first
72
+ // with the full path on hover, matching the ToolCallItem header.
73
+ _jsx(FilePathLink, { path: primaryArg, className: "min-w-0 text-xs text-muted-foreground" })) : (
74
+ // Shell is the exception: its command is shown in the body's
75
+ // terminal session, so the header stays minimal (icon + label).
76
+ _jsx("span", { className: "min-w-0 truncate font-mono text-muted-foreground", children: primaryArg })))] }), pendingApproval.fromSubAgent && pendingApproval.subAgentName && (_jsxs("span", { className: "shrink-0 rounded bg-muted px-1 py-0.5 font-mono text-muted-foreground", children: ["via ", pendingApproval.subAgentSubject || pendingApproval.subAgentName] })), _jsx(WaitingDuration, { requestedAt: pendingApproval.requestedAt }), _jsx("span", { className: "shrink-0 text-warning", "aria-hidden": "true", children: _jsx(ClockIcon, {}) })] }));
77
+ }
78
+ /**
79
+ * The decision panel of an approval: the optional message and gate reason, the
80
+ * file-changes / args preview, and the action buttons. Reused in two places —
81
+ * the standalone {@link ApprovalCard} (with {@link ApprovalCardHeader} above
82
+ * it) and inline inside a gated {@link ToolCallItem}'s expanded panel, where
83
+ * the item's own row is the header. One body, identical preview in both.
84
+ */
85
+ export function ApprovalCardBody({ pendingApproval, onSubmit, isSubmitting = false, error = null, className, }) {
34
86
  const [activeAction, setActiveAction] = useState(null);
35
87
  const handleAction = useCallback((action) => {
36
88
  setActiveAction(action);
@@ -41,15 +93,7 @@ export const ApprovalCard = memo(function ApprovalCard({ pendingApproval, onSubm
41
93
  setActiveAction(null);
42
94
  }
43
95
  }, [isSubmitting]);
44
- // Prefer the denormalized wire tool_kind (populated by the server-side
45
- // PendingApproval projection); fall back to the name for legacy executions.
46
96
  const categoryInfo = resolveToolCategoryFromKind(pendingApproval.toolKind, pendingApproval.toolName, pendingApproval.mcpServerSlug);
47
- const CategoryIcon = CATEGORY_ICON[categoryInfo.category];
48
- const primaryArg = useMemo(() => extractPrimaryArgFromPreview(pendingApproval.toolName, pendingApproval.argsPreview, pendingApproval.mcpServerSlug), [
49
- pendingApproval.toolName,
50
- pendingApproval.argsPreview,
51
- pendingApproval.mcpServerSlug,
52
- ]);
53
97
  const parsedArgs = useMemo(() => {
54
98
  if (!pendingApproval.argsPreview)
55
99
  return null;
@@ -64,74 +108,98 @@ export const ApprovalCard = memo(function ApprovalCard({ pendingApproval, onSubm
64
108
  return null;
65
109
  }
66
110
  }, [pendingApproval.argsPreview]);
67
- const borderClass = categoryInfo.category === "delete"
68
- ? "border-destructive/30 bg-destructive-subtle"
69
- : "border-warning/30 bg-warning/5";
70
- return (_jsxs("div", { role: "alert", "aria-label": `Approval required for ${pendingApproval.toolName}`, className: cn("rounded-lg border", borderClass, className), children: [_jsxs("div", { className: cn("flex items-center gap-2 px-2.5 py-1.5 text-xs", "border-b border-border-muted"), children: [_jsx("span", { className: "shrink-0 text-warning", "aria-hidden": "true", children: _jsx(CategoryIcon, {}) }), _jsxs("span", { className: "min-w-0 flex-1 flex items-baseline gap-1.5 overflow-hidden", children: [_jsx("span", { className: "shrink-0 font-medium text-foreground", children: categoryInfo.label }), primaryArg && (_jsx("span", { className: "min-w-0 truncate font-mono text-muted-foreground", children: primaryArg }))] }), pendingApproval.fromSubAgent && pendingApproval.subAgentName && (_jsxs("span", { className: "shrink-0 rounded bg-muted px-1 py-0.5 font-mono text-muted-foreground", children: ["via ", pendingApproval.subAgentSubject || pendingApproval.subAgentName] })), _jsx(WaitingDuration, { requestedAt: pendingApproval.requestedAt }), _jsx("span", { className: "shrink-0 text-warning", "aria-hidden": "true", children: _jsx(ClockIcon, {}) })] }), _jsxs("div", { className: "px-3 py-2.5 space-y-2", children: [pendingApproval.message && categoryInfo.category !== "shell" && (_jsx("p", { className: "text-xs text-foreground", children: pendingApproval.message })), parsedArgs && (_jsx(ToolArgsView, { toolName: pendingApproval.toolName, args: parsedArgs, mcpServerSlug: pendingApproval.mcpServerSlug })), _jsxs("div", { className: "flex items-center gap-2 pt-1", children: [_jsx(ActionButton, { label: "Approve", action: ApprovalAction.APPROVE, activeAction: activeAction, isSubmitting: isSubmitting, onClick: handleAction, variant: "approve", cursorTarget: "approve-button" }), _jsx(ActionButton, { label: "Approve & don't ask again", action: ApprovalAction.APPROVE_ALL, activeAction: activeAction, isSubmitting: isSubmitting, onClick: handleAction, variant: "approveAll", cursorTarget: "approve-all-button" }), _jsx(ActionButton, { label: "Skip", action: ApprovalAction.SKIP, activeAction: activeAction, isSubmitting: isSubmitting, onClick: handleAction, variant: "skip" }), _jsx(ActionButton, { label: "Reject", action: ApprovalAction.REJECT, activeAction: activeAction, isSubmitting: isSubmitting, onClick: handleAction, variant: "reject" })] })] })] }));
71
- });
111
+ // APPROVE_ALL now grants a run-lifetime lease scoped to the clicked tool's
112
+ // CLASS — its MCP server for an MCP tool, else its approval category (where
113
+ // write and edit collapse to one "file edits" class, mirroring the runner's
114
+ // toolApprovalCategory). The label must name that exact class so the button
115
+ // never over-promises: it does NOT silence other classes.
116
+ const approveAllLabel = useMemo(() => buildApproveAllLabel(categoryInfo.category, pendingApproval.mcpServerSlug), [categoryInfo.category, pendingApproval.mcpServerSlug]);
117
+ // Why-gated: the authorization provenance the server projected onto the
118
+ // PendingApproval (approval_policy_source). Smart-suppressed — the everyday
119
+ // "this category needs approval" default is noise next to the action it gates,
120
+ // so only a genuinely informative provenance (an explicit override, a
121
+ // server-marked destructive tighten) earns a line; the full phrase is on hover.
122
+ const gateReason = useMemo(() => describeApprovalPolicySource(pendingApproval.approvalPolicySource), [pendingApproval.approvalPolicySource]);
123
+ const showGateReason = gateReason != null &&
124
+ isInformativePolicySource(pendingApproval.approvalPolicySource);
125
+ // The runner's message for a file tool ("Write file: <path>") only restates
126
+ // the header + diff, so it is suppressed; a message is shown only when it adds
127
+ // information (e.g. an MCP tool's human-authored prompt). Shell shows its
128
+ // command in the args view, never a message.
129
+ const showMessage = Boolean(pendingApproval.message) &&
130
+ categoryInfo.category !== "shell" &&
131
+ !isFileCategory(categoryInfo.category);
132
+ const isWriteEdit = categoryInfo.category === "write" || categoryInfo.category === "edit";
133
+ // The proposed write/edit content from the args preview, when the gate carries
134
+ // no authoritative file_changes capture. Drives the three-way fallback below.
135
+ const writeContent = useMemo(() => extractWriteContentFromPreview(pendingApproval.argsPreview), [pendingApproval.argsPreview]);
136
+ // The decision-relevant preview. The pre-execution deny-gate is an
137
+ // apply-then-review exception: the change has not been captured yet (the tool
138
+ // is DENIED, awaiting approval), so there is no `FileChangeSet` to render.
139
+ // Instead the gate shows the PROPOSED change from the tool args: the write/edit
140
+ // content when the args carry it (path suppressed — the header has it); a
141
+ // neutral "no preview" notice when only a path is known (the resume placeholder
142
+ // case); otherwise the shared args view for non-file tools. (Captured
143
+ // file-review — the apply-then-review path — renders via FileReviewCard, not
144
+ // here.)
145
+ let preview = null;
146
+ if (isWriteEdit && writeContent === null) {
147
+ // No proposed content in the args. A whole-file write is modeled as a create
148
+ // throughout the runner (FILE_WRITE -> CREATE), so the authoritative toolKind
149
+ // lets the gate say plainly that a new file is being written rather than the
150
+ // misleading non-committal "no preview". An edit (modify) cannot be proven a
151
+ // create, so it keeps the non-committal notice.
152
+ const kind = pendingApproval.toolKind === ToolKind.FILE_WRITE ? "create" : "no-preview";
153
+ preview = _jsx(EmptyChangeNotice, { kind: kind });
154
+ }
155
+ else if (parsedArgs) {
156
+ preview = (_jsx(ToolArgsView, { toolName: pendingApproval.toolName, args: parsedArgs, mcpServerSlug: pendingApproval.mcpServerSlug, showFileName: !isWriteEdit }));
157
+ }
158
+ return (_jsxs("div", { className: cn("px-3 py-2.5 space-y-2", className), children: [showMessage && (_jsx("p", { className: "text-xs text-foreground", children: pendingApproval.message })), preview, categoryInfo.category === "shell" && (_jsx("p", { className: "text-[11px] italic text-muted-foreground", children: "Files this command creates or changes are covered by this approval \u2014 they are kept automatically, with no second review." })), _jsxs("div", { className: "flex items-center gap-2 pt-1", children: [_jsx(DecisionButton, { label: "Approve", variant: "primary", onClick: () => handleAction(ApprovalAction.APPROVE), isActive: activeAction === ApprovalAction.APPROVE, isSubmitting: isSubmitting, cursorTarget: "approve-button" }), _jsx(DecisionButton, { label: "Skip", variant: "ghost", onClick: () => handleAction(ApprovalAction.SKIP), isActive: activeAction === ApprovalAction.SKIP, isSubmitting: isSubmitting }), _jsx(DecisionButton, { label: "Reject", variant: "danger", onClick: () => handleAction(ApprovalAction.REJECT), isActive: activeAction === ApprovalAction.REJECT, isSubmitting: isSubmitting }), _jsx(DecisionButton, { label: approveAllLabel, variant: "ghost", onClick: () => handleAction(ApprovalAction.APPROVE_ALL), isActive: activeAction === ApprovalAction.APPROVE_ALL, isSubmitting: isSubmitting, className: "ml-auto", cursorTarget: "approve-all-button" })] }), showGateReason && (_jsx("p", { className: "text-[11px] italic text-muted-foreground", title: gateReason ?? undefined, "data-cursor-target": "approval-gate-reason", children: gateReason })), error && (_jsx(InCardDecisionError, { error: error, leadIn: "submit decision", cursorTarget: "approval-error" }))] }));
159
+ }
72
160
  // ---------------------------------------------------------------------------
73
- // Internal sub-components
161
+ // Internal helpers
74
162
  // ---------------------------------------------------------------------------
75
- function ActionButton({ label, action, activeAction, isSubmitting, onClick, variant, cursorTarget, }) {
76
- const isActive = activeAction === action;
77
- const disabled = isSubmitting;
78
- const variantClasses = {
79
- approve: cn("bg-success text-success-foreground hover:bg-success/90", "disabled:bg-success/50 disabled:text-success-foreground/70"),
80
- approveAll: cn("text-success hover:bg-success/10", "disabled:text-success/50"),
81
- skip: cn("border border-border bg-background text-muted-foreground hover:bg-muted hover:text-foreground", "disabled:bg-muted-faint disabled:text-muted-foreground-faint"),
82
- reject: cn("bg-destructive text-destructive-foreground hover:bg-destructive-hover", "disabled:bg-destructive-subtle0 disabled:text-destructive-foreground/70"),
83
- };
84
- return (_jsxs("button", { type: "button", disabled: disabled, onClick: () => onClick(action), "aria-label": label, "data-cursor-target": cursorTarget, className: cn("inline-flex items-center justify-center gap-1.5 rounded-md px-3 py-1.5 text-xs font-medium transition-colors", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2", "disabled:cursor-not-allowed", variantClasses[variant]), children: [isActive && isSubmitting ? _jsx(SpinnerIcon, {}) : null, label] }));
163
+ /**
164
+ * Builds the truthful APPROVE_ALL button label for a tool's lease class.
165
+ *
166
+ * The lease an APPROVE_ALL grants is scoped to ONE class: the MCP server for an
167
+ * MCP tool, otherwise the approval category (write/delete/shell) — where the
168
+ * presentation "write" and "edit" categories collapse to a single "file edits"
169
+ * class, exactly as the runner's `toolApprovalCategory` collapses FILE_WRITE and
170
+ * FILE_EDIT to "write". The label names that class so the button never implies a
171
+ * broader effect than the lease actually has. The generic fallback only applies
172
+ * to a tool with no leasable class, which is not normally gated for approval.
173
+ */
174
+ function buildApproveAllLabel(category, mcpServerSlug) {
175
+ if (mcpServerSlug) {
176
+ return `Approve all ${mcpServerSlug} tools`;
177
+ }
178
+ switch (category) {
179
+ case "shell":
180
+ return "Approve all shell commands";
181
+ case "delete":
182
+ return "Approve all file deletions";
183
+ case "write":
184
+ case "edit":
185
+ return "Approve all file edits";
186
+ default:
187
+ return "Approve all of this kind";
188
+ }
85
189
  }
190
+ // ---------------------------------------------------------------------------
191
+ // Internal sub-components
192
+ // ---------------------------------------------------------------------------
86
193
  function WaitingDuration({ requestedAt }) {
87
- const startMs = useMemo(() => {
88
- if (!requestedAt)
89
- return null;
90
- const t = new Date(requestedAt).getTime();
91
- return Number.isNaN(t) ? null : t;
92
- }, [requestedAt]);
93
- const [elapsed, setElapsed] = useState(null);
94
- useEffect(() => {
95
- if (startMs === null) {
96
- setElapsed(null);
97
- return;
98
- }
99
- setElapsed(Math.max(0, Date.now() - startMs));
100
- const id = setInterval(() => {
101
- setElapsed(Math.max(0, Date.now() - startMs));
102
- }, 1000);
103
- return () => clearInterval(id);
104
- }, [startMs]);
194
+ const elapsed = useElapsedSince(requestedAt);
105
195
  if (elapsed === null)
106
196
  return null;
107
197
  return (_jsx("span", { className: "shrink-0 text-xs text-muted-foreground", children: formatElapsed(elapsed) }));
108
198
  }
109
- function formatElapsed(ms) {
110
- if (ms < 1000)
111
- return "just now";
112
- const seconds = Math.floor(ms / 1000);
113
- if (seconds < 60)
114
- return `${seconds}s`;
115
- const minutes = Math.floor(seconds / 60);
116
- const remainingSeconds = seconds % 60;
117
- if (minutes < 60) {
118
- return remainingSeconds > 0
119
- ? `${minutes}m ${remainingSeconds}s`
120
- : `${minutes}m`;
121
- }
122
- const hours = Math.floor(minutes / 60);
123
- const remainingMinutes = minutes % 60;
124
- return remainingMinutes > 0
125
- ? `${hours}h ${remainingMinutes}m`
126
- : `${hours}h`;
127
- }
128
199
  // ---------------------------------------------------------------------------
129
200
  // Inline SVG icons
130
201
  // ---------------------------------------------------------------------------
131
202
  function ClockIcon() {
132
203
  return (_jsxs("svg", { width: "10", height: "10", viewBox: "0 0 12 12", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", children: [_jsx("circle", { cx: "6", cy: "6", r: "4.5" }), _jsx("path", { d: "M6 3.5V6L7.5 7.5" })] }));
133
204
  }
134
- function SpinnerIcon() {
135
- return (_jsx("svg", { width: "10", height: "10", viewBox: "0 0 12 12", fill: "none", stroke: "currentColor", strokeWidth: "1.5", className: "animate-spin", "aria-hidden": "true", children: _jsx("path", { d: "M6 1.5A4.5 4.5 0 1 1 1.5 6", strokeLinecap: "round" }) }));
136
- }
137
205
  //# sourceMappingUR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,EAAC,wCAAwC,YACrD,aAAa,CAAC,OAAO,CAAC,GAClB,CACR,CAAC;AACJ,CAAC;AAED,8EAA8E;AAC9E,mBAAmB;AACnB,8EAA8E;AAE9E,SAAS,SAAS;IAChB,OAAO,CACL,eACE,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,aAEtB,iBAAQ,EAAE,EAAC,GAAG,EAAC,EAAE,EAAC,GAAG,EAAC,CAAC,EAAC,KAAK,GAAG,EAChC,eAAM,CAAC,EAAC,kBAAkB,GAAG,IACzB,CACP,CAAC;AACJ,CAAC"}
@@ -0,0 +1,72 @@
1
+ import type { PendingApproval } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/approval_pb";
2
+ import type { ApprovalAction } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/enum_pb";
3
+ /**
4
+ * Context value that carries the run's pending approvals to the tool rows
5
+ * that own them, so an approval gate can render *inline* on the exact tool
6
+ * call it blocks (parent thread and nested sub-agents alike) instead of as a
7
+ * detached card at the bottom of the thread.
8
+ *
9
+ * Provided by {@link MessageThread} (or a platform builder's custom wrapper),
10
+ * beside {@link FilePathContext} / `SandboxContext`. When no provider is
11
+ * present — or the consumer did not supply an `onApprovalSubmit` handler — the
12
+ * map is empty and {@link useApproval} returns `null`, so the inline UI is a
13
+ * no-op (backward compatible).
14
+ *
15
+ * The map is keyed by `tool_call_id` and rebuilt only when the underlying
16
+ * `pendingApprovals` list changes (not per streaming frame), so subscribing
17
+ * tool rows re-render on approval events, not on every snapshot — preserving
18
+ * the thread's streaming re-render isolation (DD-009 / DD-010).
19
+ */
20
+ export interface ApprovalContextValue {
21
+ /** Unresolved approvals, keyed by the `tool_call_id` they gate. */
22
+ readonly approvalsByToolCallId: ReadonlyMap<string, PendingApproval>;
23
+ /**
24
+ * Submits a decision for a gated tool call. Wired to the same handler the
25
+ * bottom {@link ApprovalCard} backstop uses; when absent, no inline approval
26
+ * UI is shown.
27
+ */
28
+ readonly onSubmit?: (toolCallId: string, action: ApprovalAction, comment?: string) => void;
29
+ /** Tool-call ids whose decision RPC is in flight, for per-card spinners. */
30
+ readonly submittingIds: ReadonlySet<string>;
31
+ /**
32
+ * Per-tool-call failures, keyed by `tool_call_id` (the parallel of
33
+ * {@link submittingIds}). A failed decision is surfaced in-card, beside the
34
+ * exact gate that failed, so the inline row can name *which* action did not
35
+ * take and why. Empty when no provider supplies it.
36
+ */
37
+ readonly errorsByToolCallId: ReadonlyMap<string, Error>;
38
+ }
39
+ /** Context that supplies a run's pending approvals to the tool rows they gate. */
40
+ export declare const ApprovalContext: import("react").Context<ApprovalContextValue>;
41
+ /**
42
+ * Resolved inline-approval state for a single tool call. Its shape is a superset
43
+ * of the props {@link ApprovalCardBody} reads, so a consumer can spread it
44
+ * directly: `<ApprovalCardBody {...approval} />`.
45
+ */
46
+ export interface UseApprovalResult {
47
+ /** The pending approval gating this tool call. */
48
+ readonly pendingApproval: PendingApproval;
49
+ /** Submits a decision for this tool call (id already bound). */
50
+ readonly onSubmit: (action: ApprovalAction, comment?: string) => void;
51
+ /** True while this tool call's decision RPC is in flight. */
52
+ readonly isSubmitting: boolean;
53
+ /** This gate's last failed decision, or `null` — surfaced in-card beside it. */
54
+ readonly error: Error | null;
55
+ }
56
+ /**
57
+ * Returns the inline-approval state for a tool call, or `null` when the call
58
+ * is not currently gated (no matching approval, or no submit handler wired).
59
+ *
60
+ * The returned `onSubmit` is pre-bound to `toolCallId` and stable across
61
+ * renders, so it can flow straight into a memoized approval body.
62
+ *
63
+ * @example
64
+ * ```tsx
65
+ * const approval = useApproval(toolCall.id);
66
+ * if (approval) {
67
+ * return <ApprovalCardBody {...approval} />;
68
+ * }
69
+ * ```
70
+ */
71
+ export declare function useApproval(toolCallId: string): UseApprovalResult | null;
72
+ //# sourceMappingURL=ApprovalContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ApprovalContext.d.ts","sourceRoot":"","sources":["../../src/execution/ApprovalContext.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kEAAkE,CAAC;AACxG,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8DAA8D,CAAC;AAEnG;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,WAAW,oBAAoB;IACnC,mEAAmE;IACnE,QAAQ,CAAC,qBAAqB,EAAE,WAAW,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IACrE;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAClB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,cAAc,EACtB,OAAO,CAAC,EAAE,MAAM,KACb,IAAI,CAAC;IACV,4EAA4E;IAC5E,QAAQ,CAAC,aAAa,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC5C;;;;;OAKG;IACH,QAAQ,CAAC,kBAAkB,EAAE,WAAW,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;CACzD;AAQD,kFAAkF;AAClF,eAAO,MAAM,eAAe,+CACwB,CAAC;AAErD;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC,kDAAkD;IAClD,QAAQ,CAAC,eAAe,EAAE,eAAe,CAAC;IAC1C,gEAAgE;IAChE,QAAQ,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,cAAc,EAAE,OAAO,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACtE,6DAA6D;IAC7D,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;IAC/B,gFAAgF;IAChF,QAAQ,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;CAC9B;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,WAAW,CAAC,UAAU,EAAE,MAAM,GAAG,iBAAiB,GAAG,IAAI,CAsBxE"}
@@ -0,0 +1,41 @@
1
+ import { createContext, useCallback, useContext } from "react";
2
+ const DEFAULT_VALUE = {
3
+ approvalsByToolCallId: new Map(),
4
+ submittingIds: new Set(),
5
+ errorsByToolCallId: new Map(),
6
+ };
7
+ /** Context that supplies a run's pending approvals to the tool rows they gate. */
8
+ export const ApprovalContext = createContext(DEFAULT_VALUE);
9
+ /**
10
+ * Returns the inline-approval state for a tool call, or `null` when the call
11
+ * is not currently gated (no matching approval, or no submit handler wired).
12
+ *
13
+ * The returned `onSubmit` is pre-bound to `toolCallId` and stable across
14
+ * renders, so it can flow straight into a memoized approval body.
15
+ *
16
+ * @example
17
+ * ```tsx
18
+ * const approval = useApproval(toolCall.id);
19
+ * if (approval) {
20
+ * return <ApprovalCardBody {...approval} />;
21
+ * }
22
+ * ```
23
+ */
24
+ export function useApproval(toolCallId) {
25
+ const { approvalsByToolCallId, onSubmit, submittingIds, errorsByToolCallId } = useContext(ApprovalContext);
26
+ const handleSubmit = useCallback((action, comment) => {
27
+ onSubmit?.(toolCallId, action, comment);
28
+ }, [onSubmit, toolCallId]);
29
+ const pendingApproval = toolCallId
30
+ ? approvalsByToolCallId.get(toolCallId)
31
+ : undefined;
32
+ if (!pendingApproval || !onSubmit)
33
+ return null;
34
+ return {
35
+ pendingApproval,
36
+ onSubmit: handleSubmit,
37
+ isSubmitting: submittingIds.has(toolCallId),
38
+ error: errorsByToolCallId.get(toolCallId) ?? null,
39
+ };
40
+ }
41
+ //# sourceMappingURL=ApprovalContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ApprovalContext.js","sourceRoot":"","sources":["../../src/execution/ApprovalContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AA6C/D,MAAM,aAAa,GAAyB;IAC1C,qBAAqB,EAAE,IAAI,GAAG,EAAE;IAChC,aAAa,EAAE,IAAI,GAAG,EAAE;IACxB,kBAAkB,EAAE,IA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V,EAAE,iBAAiB,2CA+HnB"}
@@ -3,6 +3,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { ExecutionArtifactKind } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/enum_pb";
4
4
  import { cn } from "@stigmer/theme";
5
5
  import { useArtifactContent } from "./useArtifactContent";
6
+ import { useArtifactDownload } from "./useArtifactDownload";
6
7
  import { isTextArtifact, formatArtifactSize } from "./artifact-utils";
7
8
  import { useDetectStigmerResource } from "../library/useDetectStigmerResource";
8
9
  import { useDetectSkillPackage } from "../library/useDetectSkillPackage";
@@ -85,13 +86,14 @@ export function ArtifactCard({ artifact, executionId, org, onPreview, hasNameCol
85
86
  detectionLabel = `Skill \u00B7 ${count} ${count === 1 ? "file" : "files"}`;
86
87
  }
87
88
  const canPreview = !!onPreview && (isTextArtifact(artifact) || isDirectory);
89
+ const { download, isDownloading } = useArtifactDownload(executionId);
88
90
  const parentDir = hasNameCollision && artifact.sandboxPath
89
91
  ? parentDirectory(artifact.sandboxPath)
90
92
  : null;
91
93
  // ---------------------------------------------------------------------------
92
94
  // Render
93
95
  // ---------------------------------------------------------------------------
94
- return (_jsxs("div", { role: "article", "aria-label": artifact.name, className: cn("rounded-md border border-border p-3", className), children: [_jsxs("div", { className: "flex items-start gap-2", children: [_jsx("span", { className: "mt-0.5 shrink-0 text-muted-foreground", children: isDirectory ? _jsx(FolderIcon, {}) : _jsx(FileIcon, {}) }), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsxs("div", { className: "truncate text-sm font-medium text-foreground", children: [artifact.name, isDirectory && "/"] }), parentDir && (_jsx("div", { className: "truncate text-xs text-muted-foreground", children: parentDir })), _jsx("div", { className: "text-xs tabular-nums text-muted-foreground", children: formatArtifactSize(artifact.sizeBytes) })] })] }), isDetecting && !isDetected && (_jsx("div", { className: "mt-1.5 h-5 w-28 animate-pulse rounded-full bg-muted", "aria-hidden": "true" })), detectionLabel && (_jsx("span", { className: "mt-1.5 inline-flex items-center rounded-full bg-primary-subtle px-2 py-0.5 text-xs font-medium text-primary", children: detectionLabel })), _jsxs("div", { className: "mt-2 flex flex-wrap items-center gap-x-3 gap-y-1", children: [canPreview && (_jsx("button", { type: "button", onClick: () => onPreview(artifact), className: cn("text-xs font-medium text-primary transition-colors hover:text-primary-muted", FOCUS_RING_CLASSES), children: "Preview" })), _jsxs("a", { href: artifact.downloadUrl, download: true, className: cn("inline-flex items-center gap-1 text-xs font-medium text-muted-foreground transition-colors hover:text-foreground", FOCUS_RING_CLASSES), children: [_jsx(DownloadIcon, {}), isDirectory ? "Download ZIP" : "Download"] })] })] }));
96
+ return (_jsxs("div", { role: "article", "aria-label": artifact.name, className: cn("rounded-md border border-border p-3", className), children: [_jsxs("div", { className: "flex items-start gap-2", children: [_jsx("span", { className: "mt-0.5 shrink-0 text-muted-foreground", children: isDirectory ? _jsx(FolderIcon, {}) : _jsx(FileIcon, {}) }), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsxs("div", { className: "truncate text-sm font-medium text-foreground", children: [artifact.name, isDirectory && "/"] }), parentDir && (_jsx("div", { className: "truncate text-xs text-muted-foreground", children: parentDir })), _jsx("div", { className: "text-xs tabular-nums text-muted-foreground", children: formatArtifactSize(artifact.sizeBytes) })] })] }), isDetecting && !isDetected && (_jsx("div", { className: "mt-1.5 h-5 w-28 animate-pulse rounded-full bg-muted", "aria-hidden": "true" })), detectionLabel && (_jsx("span", { className: "mt-1.5 inline-flex items-center rounded-full bg-primary-subtle px-2 py-0.5 text-xs font-medium text-primary", children: detectionLabel })), _jsxs("div", { className: "mt-2 flex flex-wrap items-center gap-x-3 gap-y-1", children: [canPreview && (_jsx("button", { type: "button", onClick: () => onPreview(artifact), className: cn("text-xs font-medium text-primary transition-colors hover:text-primary-muted", FOCUS_RING_CLASSES), children: "Preview" })), _jsxs("button", { type: "button", onClick: () => download(artifact.storageKey, artifact.name), disabled: isDownloading, className: cn("inline-flex items-center gap-1 text-xs font-medium text-muted-foreground transition-colors hover:text-foreground disabled:opacity-50", FOCUS_RING_CLASSES), children: [_jsx(DownloadIcon, {}), isDownloading ? "Preparing…" : isDirectory ? "Download ZIP" : "Download"] })] })] }));
95
97
  }
96
98
  // ---------------------------------------------------------------------------
97
99
  // Helpers
@@ -1 +1 @@
1
- {"version":3,"file":"ArtifactCard.js","sourceRoot":"","sources":["../../src/execution/ArtifactCard.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,OAAO,EAAE,qBAAqB,EAAE,MAAM,8DAA8D,CAAC;AACrG,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AACpC,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtE,OAAO,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAC/E,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AAEzE;;;;;GAKG;AACH,MAAM,kBAAkB,GAAG,GAAG,GAAG,IAAI,CAAC;AAkCtC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,MAAM,UAAU,YAAY,CAAC,EAC3B,QAAQ,EACR,WAAW,EACX,GAAG,EACH,SAAS,EACT,gBAAgB,GAAG,KAAK,EACxB,SAAS,GACS;IAClB,8EAA8E;IAC9E,0BAA0B;IAC1B,8EAA8E;IAE9E,MAAM,WAAW,GAAG,QAAQ,CAAC,IAAI,KAAK,qBAAqB,CAAC,SAAS,CAAC;IACtE,MAAM,aAAa,GACjB,CAAC,WAAW;QACZ,cAAc,CAAC,QAAQ,CAAC;QACxB,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,kBAAkB,CAAC;IAElD,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,GAAG,kBAAkB,CACjE,aAAa,CAAC,CAAC,CAAC,WAAW,CAAC,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