@stigmer/react 3.0.9-dev.20260616060535 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (426) hide show
  1. package/execution/ApprovalCard.d.ts +47 -3
  2. package/execution/ApprovalCard.d.ts.map +1 -1
  3. package/execution/ApprovalCard.js +138 -70
  4. package/execution/ApprovalCard.js.map +1 -1
  5. package/execution/ApprovalContext.d.ts +72 -0
  6. package/execution/ApprovalContext.d.ts.map +1 -0
  7. package/execution/ApprovalContext.js +41 -0
  8. package/execution/ApprovalContext.js.map +1 -0
  9. package/execution/ArtifactCard.d.ts.map +1 -1
  10. package/execution/ArtifactCard.js +3 -1
  11. package/execution/ArtifactCard.js.map +1 -1
  12. package/execution/ArtifactPreviewModal.d.ts.map +1 -1
  13. package/execution/ArtifactPreviewModal.js +5 -3
  14. package/execution/ArtifactPreviewModal.js.map +1 -1
  15. package/execution/EmptyChangeNotice.d.ts +38 -0
  16. package/execution/EmptyChangeNotice.d.ts.map +1 -0
  17. package/execution/EmptyChangeNotice.js +27 -0
  18. package/execution/EmptyChangeNotice.js.map +1 -0
  19. package/execution/FileChangesView.d.ts +81 -0
  20. package/execution/FileChangesView.d.ts.map +1 -0
  21. package/execution/FileChangesView.js +164 -0
  22. package/execution/FileChangesView.js.map +1 -0
  23. package/execution/FilePathLink.d.ts +24 -4
  24. package/execution/FilePathLink.d.ts.map +1 -1
  25. package/execution/FilePathLink.js +31 -9
  26. package/execution/FilePathLink.js.map +1 -1
  27. package/execution/FileReviewCard.d.ts +111 -0
  28. package/execution/FileReviewCard.d.ts.map +1 -0
  29. package/execution/FileReviewCard.js +558 -0
  30. package/execution/FileReviewCard.js.map +1 -0
  31. package/execution/FileReviewContext.d.ts +35 -0
  32. package/execution/FileReviewContext.d.ts.map +1 -0
  33. package/execution/FileReviewContext.js +23 -0
  34. package/execution/FileReviewContext.js.map +1 -0
  35. package/execution/FileReviewDock.d.ts +73 -0
  36. package/execution/FileReviewDock.d.ts.map +1 -0
  37. package/execution/FileReviewDock.js +65 -0
  38. package/execution/FileReviewDock.js.map +1 -0
  39. package/execution/McpToolDetail.d.ts.map +1 -1
  40. package/execution/McpToolDetail.js +38 -5
  41. package/execution/McpToolDetail.js.map +1 -1
  42. package/execution/MessageThread.d.ts +42 -3
  43. package/execution/MessageThread.d.ts.map +1 -1
  44. package/execution/MessageThread.js +263 -18
  45. package/execution/MessageThread.js.map +1 -1
  46. package/execution/PlanArtifactCard.d.ts.map +1 -1
  47. package/execution/PlanArtifactCard.js +3 -1
  48. package/execution/PlanArtifactCard.js.map +1 -1
  49. package/execution/PlanCompletionCard.d.ts +1 -1
  50. package/execution/PlanCompletionCard.js +1 -1
  51. package/execution/ResultView.d.ts +19 -1
  52. package/execution/ResultView.d.ts.map +1 -1
  53. package/execution/ResultView.js +141 -40
  54. package/execution/ResultView.js.map +1 -1
  55. package/execution/SubAgentSection.d.ts.map +1 -1
  56. package/execution/SubAgentSection.js +45 -6
  57. package/execution/SubAgentSection.js.map +1 -1
  58. package/execution/TerminalSession.d.ts +34 -0
  59. package/execution/TerminalSession.d.ts.map +1 -0
  60. package/execution/TerminalSession.js +34 -0
  61. package/execution/TerminalSession.js.map +1 -0
  62. package/execution/TodoCard.d.ts +53 -0
  63. package/execution/TodoCard.d.ts.map +1 -0
  64. package/execution/TodoCard.js +77 -0
  65. package/execution/TodoCard.js.map +1 -0
  66. package/execution/ToolArgsView.d.ts +7 -1
  67. package/execution/ToolArgsView.d.ts.map +1 -1
  68. package/execution/ToolArgsView.js +10 -9
  69. package/execution/ToolArgsView.js.map +1 -1
  70. package/execution/ToolCallDetail.d.ts +10 -1
  71. package/execution/ToolCallDetail.d.ts.map +1 -1
  72. package/execution/ToolCallDetail.js +66 -19
  73. package/execution/ToolCallDetail.js.map +1 -1
  74. package/execution/ToolCallGroup.d.ts +28 -18
  75. package/execution/ToolCallGroup.d.ts.map +1 -1
  76. package/execution/ToolCallGroup.js +39 -148
  77. package/execution/ToolCallGroup.js.map +1 -1
  78. package/execution/ToolCallItem.d.ts +36 -8
  79. package/execution/ToolCallItem.d.ts.map +1 -1
  80. package/execution/ToolCallItem.js +140 -21
  81. package/execution/ToolCallItem.js.map +1 -1
  82. package/execution/ToolRunGroup.d.ts +48 -0
  83. package/execution/ToolRunGroup.d.ts.map +1 -0
  84. package/execution/ToolRunGroup.js +168 -0
  85. package/execution/ToolRunGroup.js.map +1 -0
  86. package/execution/approval-provenance.d.ts +2 -0
  87. package/execution/approval-provenance.d.ts.map +1 -0
  88. package/execution/approval-provenance.js +6 -0
  89. package/execution/approval-provenance.js.map +1 -0
  90. package/execution/artifact-utils.d.ts +0 -10
  91. package/execution/artifact-utils.d.ts.map +1 -1
  92. package/execution/artifact-utils.js +0 -17
  93. package/execution/artifact-utils.js.map +1 -1
  94. package/execution/execution-phases.d.ts +1 -6
  95. package/execution/execution-phases.d.ts.map +1 -1
  96. package/execution/execution-phases.js +4 -14
  97. package/execution/execution-phases.js.map +1 -1
  98. package/execution/file-path-resolver.d.ts +28 -0
  99. package/execution/file-path-resolver.d.ts.map +1 -1
  100. package/execution/file-path-resolver.js +24 -0
  101. package/execution/file-path-resolver.js.map +1 -1
  102. package/execution/file-review-status.d.ts +127 -0
  103. package/execution/file-review-status.d.ts.map +1 -0
  104. package/execution/file-review-status.js +135 -0
  105. package/execution/file-review-status.js.map +1 -0
  106. package/execution/index.d.ts +39 -5
  107. package/execution/index.d.ts.map +1 -1
  108. package/execution/index.js +23 -3
  109. package/execution/index.js.map +1 -1
  110. package/execution/segment-tool-calls.d.ts +46 -0
  111. package/execution/segment-tool-calls.d.ts.map +1 -0
  112. package/execution/segment-tool-calls.js +71 -0
  113. package/execution/segment-tool-calls.js.map +1 -0
  114. package/execution/tool-categories.d.ts +62 -1
  115. package/execution/tool-categories.d.ts.map +1 -1
  116. package/execution/tool-categories.js +96 -2
  117. package/execution/tool-categories.js.map +1 -1
  118. package/execution/tool-presenter.d.ts +38 -2
  119. package/execution/tool-presenter.d.ts.map +1 -1
  120. package/execution/tool-presenter.js +23 -1
  121. package/execution/tool-presenter.js.map +1 -1
  122. package/execution/tool-rendering-primitives.d.ts.map +1 -1
  123. package/execution/tool-rendering-primitives.js +3 -2
  124. package/execution/tool-rendering-primitives.js.map +1 -1
  125. package/execution/useArtifactDownload.d.ts +44 -0
  126. package/execution/useArtifactDownload.d.ts.map +1 -0
  127. package/execution/useArtifactDownload.js +80 -0
  128. package/execution/useArtifactDownload.js.map +1 -0
  129. package/execution/useArtifactDownloadUrl.d.ts +67 -0
  130. package/execution/useArtifactDownloadUrl.d.ts.map +1 -0
  131. package/execution/useArtifactDownloadUrl.js +59 -0
  132. package/execution/useArtifactDownloadUrl.js.map +1 -0
  133. package/execution/useFileChangeContent.d.ts +61 -0
  134. package/execution/useFileChangeContent.d.ts.map +1 -0
  135. package/execution/useFileChangeContent.js +89 -0
  136. package/execution/useFileChangeContent.js.map +1 -0
  137. package/execution/useFileReview.d.ts +89 -0
  138. package/execution/useFileReview.d.ts.map +1 -0
  139. package/execution/useFileReview.js +106 -0
  140. package/execution/useFileReview.js.map +1 -0
  141. package/execution/useSubmitApproval.d.ts +17 -2
  142. package/execution/useSubmitApproval.d.ts.map +1 -1
  143. package/execution/useSubmitApproval.js +27 -23
  144. package/execution/useSubmitApproval.js.map +1 -1
  145. package/execution/useToolOutputContent.d.ts +44 -0
  146. package/execution/useToolOutputContent.d.ts.map +1 -0
  147. package/execution/useToolOutputContent.js +31 -0
  148. package/execution/useToolOutputContent.js.map +1 -0
  149. package/index.d.ts +6 -6
  150. package/index.d.ts.map +1 -1
  151. package/index.js +3 -3
  152. package/index.js.map +1 -1
  153. package/internal/ApprovalPeekBar.d.ts +23 -0
  154. package/internal/ApprovalPeekBar.d.ts.map +1 -0
  155. package/internal/ApprovalPeekBar.js +25 -0
  156. package/internal/ApprovalPeekBar.js.map +1 -0
  157. package/internal/BoundedContent.d.ts +49 -0
  158. package/internal/BoundedContent.d.ts.map +1 -0
  159. package/internal/BoundedContent.js +50 -0
  160. package/internal/BoundedContent.js.map +1 -0
  161. package/internal/DecisionButton.d.ts +47 -0
  162. package/internal/DecisionButton.d.ts.map +1 -0
  163. package/internal/DecisionButton.js +42 -0
  164. package/internal/DecisionButton.js.map +1 -0
  165. package/internal/InCardDecisionError.d.ts +31 -0
  166. package/internal/InCardDecisionError.d.ts.map +1 -0
  167. package/internal/InCardDecisionError.js +23 -0
  168. package/internal/InCardDecisionError.js.map +1 -0
  169. package/internal/RevealToggle.d.ts +36 -0
  170. package/internal/RevealToggle.d.ts.map +1 -0
  171. package/internal/RevealToggle.js +32 -0
  172. package/internal/RevealToggle.js.map +1 -0
  173. package/internal/VirtualizedThread.d.ts +7 -1
  174. package/internal/VirtualizedThread.d.ts.map +1 -1
  175. package/internal/VirtualizedThread.js +7 -3
  176. package/internal/VirtualizedThread.js.map +1 -1
  177. package/internal/useAutoDisclosure.d.ts +34 -0
  178. package/internal/useAutoDisclosure.d.ts.map +1 -0
  179. package/internal/useAutoDisclosure.js +53 -0
  180. package/internal/useAutoDisclosure.js.map +1 -0
  181. package/internal/useElapsedSince.d.ts +30 -0
  182. package/internal/useElapsedSince.d.ts.map +1 -0
  183. package/internal/useElapsedSince.js +70 -0
  184. package/internal/useElapsedSince.js.map +1 -0
  185. package/internal/useIsOverflowing.d.ts +30 -0
  186. package/internal/useIsOverflowing.d.ts.map +1 -0
  187. package/internal/useIsOverflowing.js +47 -0
  188. package/internal/useIsOverflowing.js.map +1 -0
  189. package/internal/useIsTextTruncated.d.ts +24 -0
  190. package/internal/useIsTextTruncated.d.ts.map +1 -0
  191. package/internal/useIsTextTruncated.js +41 -0
  192. package/internal/useIsTextTruncated.js.map +1 -0
  193. package/internal/useKeyedSubmission.d.ts +49 -0
  194. package/internal/useKeyedSubmission.d.ts.map +1 -0
  195. package/internal/useKeyedSubmission.js +67 -0
  196. package/internal/useKeyedSubmission.js.map +1 -0
  197. package/package.json +4 -4
  198. package/session/SessionViewer.d.ts +2 -2
  199. package/session/SessionViewer.d.ts.map +1 -1
  200. package/session/SessionViewer.js +10 -4
  201. package/session/SessionViewer.js.map +1 -1
  202. package/session/index.d.ts +2 -0
  203. package/session/index.d.ts.map +1 -1
  204. package/session/index.js +1 -0
  205. package/session/index.js.map +1 -1
  206. package/session/inspector/ChangesTab.d.ts +8 -5
  207. package/session/inspector/ChangesTab.d.ts.map +1 -1
  208. package/session/inspector/ChangesTab.js +11 -8
  209. package/session/inspector/ChangesTab.js.map +1 -1
  210. package/session/inspector/SessionInspector.d.ts +4 -4
  211. package/session/inspector/SessionInspector.d.ts.map +1 -1
  212. package/session/inspector/SessionInspector.js +4 -4
  213. package/session/inspector/SessionInspector.js.map +1 -1
  214. package/session/inspector/index.d.ts +0 -2
  215. package/session/inspector/index.d.ts.map +1 -1
  216. package/session/inspector/index.js +0 -1
  217. package/session/inspector/index.js.map +1 -1
  218. package/session/inspector/useSessionInspector.d.ts +8 -4
  219. package/session/inspector/useSessionInspector.d.ts.map +1 -1
  220. package/session/inspector/useSessionInspector.js +27 -20
  221. package/session/inspector/useSessionInspector.js.map +1 -1
  222. package/session/useSessionConversation.d.ts +37 -3
  223. package/session/useSessionConversation.d.ts.map +1 -1
  224. package/session/useSessionConversation.js +18 -2
  225. package/session/useSessionConversation.js.map +1 -1
  226. package/session/useSessionFileChanges.d.ts +74 -0
  227. package/session/useSessionFileChanges.d.ts.map +1 -0
  228. package/session/useSessionFileChanges.js +178 -0
  229. package/session/useSessionFileChanges.js.map +1 -0
  230. package/src/__tests__/styles-border-layer-invariant.test.ts +105 -0
  231. package/src/execution/ApprovalCard.tsx +368 -230
  232. package/src/execution/ApprovalContext.ts +109 -0
  233. package/src/execution/ArtifactCard.tsx +10 -6
  234. package/src/execution/ArtifactPreviewModal.tsx +12 -6
  235. package/src/execution/EmptyChangeNotice.tsx +62 -0
  236. package/src/execution/FileChangesView.tsx +383 -0
  237. package/src/execution/FilePathLink.tsx +65 -12
  238. package/src/execution/FileReviewCard.tsx +1118 -0
  239. package/src/execution/FileReviewContext.ts +53 -0
  240. package/src/execution/FileReviewDock.tsx +157 -0
  241. package/src/execution/McpToolDetail.tsx +98 -32
  242. package/src/execution/MessageThread.tsx +374 -9
  243. package/src/execution/PlanArtifactCard.tsx +9 -6
  244. package/src/execution/PlanCompletionCard.tsx +1 -1
  245. package/src/execution/ResultView.tsx +333 -162
  246. package/src/execution/SubAgentSection.tsx +58 -11
  247. package/src/execution/TerminalSession.tsx +91 -0
  248. package/src/execution/TodoCard.tsx +186 -0
  249. package/src/execution/ToolArgsView.tsx +28 -17
  250. package/src/execution/ToolCallDetail.tsx +137 -26
  251. package/src/execution/ToolCallGroup.tsx +68 -296
  252. package/src/execution/ToolCallItem.tsx +265 -67
  253. package/src/execution/ToolRunGroup.tsx +302 -0
  254. package/src/execution/__tests__/ApprovalCard.test.tsx +395 -5
  255. package/src/execution/__tests__/ArtifactPreviewModal.test.tsx +0 -1
  256. package/src/execution/__tests__/EmptyChangeNotice.test.tsx +24 -0
  257. package/src/execution/__tests__/FileChangesView.test.tsx +296 -0
  258. package/src/execution/__tests__/FilePathLink.test.tsx +92 -0
  259. package/src/execution/__tests__/FileReviewCard.test.tsx +1044 -0
  260. package/src/execution/__tests__/FileReviewDock.test.tsx +134 -0
  261. package/src/execution/__tests__/McpToolDetail.test.tsx +79 -0
  262. package/src/execution/__tests__/MessageThread.test.tsx +324 -0
  263. package/src/execution/__tests__/PlanArtifactCard.test.tsx +37 -16
  264. package/src/execution/__tests__/ResultView.test.tsx +280 -2
  265. package/src/execution/__tests__/SubAgentSection.test.tsx +180 -0
  266. package/src/execution/__tests__/TerminalSession.test.tsx +72 -0
  267. package/src/execution/__tests__/TodoCard.test.tsx +102 -0
  268. package/src/execution/__tests__/ToolArgsView.test.tsx +48 -0
  269. package/src/execution/__tests__/ToolCallDetail.test.tsx +195 -0
  270. package/src/execution/__tests__/ToolCallGroup.test.tsx +132 -0
  271. package/src/execution/__tests__/ToolCallItem.test.tsx +521 -0
  272. package/src/execution/__tests__/ToolRunGroup.test.tsx +137 -0
  273. package/src/execution/__tests__/blanked-narration.test.tsx +149 -0
  274. package/src/execution/__tests__/buildThreadItems-approvals.test.ts +304 -0
  275. package/src/execution/__tests__/buildThreadItems-file-review.test.ts +331 -0
  276. package/src/execution/__tests__/file-path-resolver.test.ts +44 -0
  277. package/src/execution/__tests__/file-review-status.test.ts +343 -0
  278. package/src/execution/__tests__/segment-tool-calls.test.ts +124 -0
  279. package/src/execution/__tests__/subagent-file-review-badge.test.tsx +273 -0
  280. package/src/execution/__tests__/thread-keys.test.ts +195 -0
  281. package/src/execution/__tests__/tool-presenter.test.tsx +95 -0
  282. package/src/execution/__tests__/useArtifactDownload.test.tsx +67 -0
  283. package/src/execution/__tests__/useArtifactDownloadUrl.test.tsx +51 -0
  284. package/src/execution/__tests__/useFileChangeContent.test.tsx +240 -0
  285. package/src/execution/__tests__/useFileReview.test.tsx +236 -0
  286. package/src/execution/__tests__/useSubmitApproval.test.tsx +165 -0
  287. package/src/execution/__tests__/useToolOutputContent.test.tsx +82 -0
  288. package/src/execution/approval-provenance.ts +8 -0
  289. package/src/execution/artifact-utils.ts +0 -18
  290. package/src/execution/execution-phases.ts +4 -16
  291. package/src/execution/file-path-resolver.ts +38 -0
  292. package/src/execution/file-review-status.ts +219 -0
  293. package/src/execution/index.ts +84 -4
  294. package/src/execution/segment-tool-calls.ts +101 -0
  295. package/src/execution/tool-categories.ts +128 -1
  296. package/src/execution/tool-presenter.ts +58 -3
  297. package/src/execution/tool-rendering-primitives.tsx +11 -14
  298. package/src/execution/useArtifactDownload.ts +109 -0
  299. package/src/execution/useArtifactDownloadUrl.ts +116 -0
  300. package/src/execution/useFileChangeContent.ts +149 -0
  301. package/src/execution/useFileReview.ts +197 -0
  302. package/src/execution/useSubmitApproval.ts +49 -27
  303. package/src/execution/useToolOutputContent.ts +70 -0
  304. package/src/index.ts +60 -1
  305. package/src/internal/ApprovalPeekBar.tsx +73 -0
  306. package/src/internal/BoundedContent.tsx +97 -0
  307. package/src/internal/DecisionButton.tsx +127 -0
  308. package/src/internal/InCardDecisionError.tsx +47 -0
  309. package/src/internal/RevealToggle.tsx +91 -0
  310. package/src/internal/VirtualizedThread.tsx +28 -2
  311. package/src/internal/__tests__/ApprovalPeekBar.test.tsx +34 -0
  312. package/src/internal/__tests__/BoundedContent.test.tsx +92 -0
  313. package/src/internal/__tests__/DecisionButton.test.tsx +107 -0
  314. package/src/internal/__tests__/RevealToggle.test.tsx +61 -0
  315. package/src/internal/__tests__/useAutoDisclosure.test.ts +74 -0
  316. package/src/internal/__tests__/useElapsedSince.test.tsx +68 -0
  317. package/src/internal/__tests__/useIsOverflowing.test.ts +36 -0
  318. package/src/internal/__tests__/useKeyedSubmission.test.tsx +126 -0
  319. package/src/internal/useAutoDisclosure.ts +58 -0
  320. package/src/internal/useElapsedSince.ts +72 -0
  321. package/src/internal/useIsOverflowing.ts +61 -0
  322. package/src/internal/useIsTextTruncated.ts +55 -0
  323. package/src/internal/useKeyedSubmission.ts +101 -0
  324. package/src/session/SessionViewer.tsx +21 -4
  325. package/src/session/__tests__/SessionViewer-fileReviewDock.test.tsx +198 -0
  326. package/src/session/__tests__/audienceWiring.test.tsx +4 -0
  327. package/src/session/__tests__/useSessionFileChanges.test.ts +303 -0
  328. package/src/session/index.ts +3 -0
  329. package/src/session/inspector/ChangesTab.tsx +20 -17
  330. package/src/session/inspector/SessionInspector.tsx +12 -10
  331. package/src/session/inspector/__tests__/ArtifactsTab.test.tsx +0 -1
  332. package/src/session/inspector/__tests__/ChangesTab.test.tsx +38 -0
  333. package/src/session/inspector/__tests__/useSessionInspector.test.ts +46 -61
  334. package/src/session/inspector/index.ts +0 -3
  335. package/src/session/inspector/useSessionInspector.ts +27 -20
  336. package/src/session/useSessionConversation.ts +80 -3
  337. package/src/session/useSessionFileChanges.ts +207 -0
  338. package/src/styles.css +35 -10
  339. package/src/version-history/DiffViewer.tsx +10 -7
  340. package/src/version-history/UnifiedDiffView.tsx +66 -0
  341. package/src/version-history/__tests__/DiffViewer.test.tsx +57 -0
  342. package/src/version-history/__tests__/UnifiedDiffView.test.tsx +50 -0
  343. package/src/version-history/__tests__/computeDiff.test.ts +35 -0
  344. package/src/version-history/__tests__/parseUnifiedDiff.test.ts +82 -0
  345. package/src/version-history/computeDiff.ts +6 -37
  346. package/src/version-history/diff-hunks.ts +63 -0
  347. package/src/version-history/index.ts +1 -0
  348. package/src/version-history/parseUnifiedDiff.ts +34 -0
  349. package/src/workflow/WorkflowExecutionApprovalCard.tsx +49 -24
  350. package/src/workflow/WorkflowExecutionTimeline.tsx +15 -4
  351. package/src/workflow/WorkflowExecutionTimelineEvent.tsx +8 -3
  352. package/src/workflow/WorkflowExecutionViewer.tsx +72 -28
  353. package/src/workflow/WorkflowFileReviewList.tsx +152 -0
  354. package/src/workflow/WorkflowTaskApprovalCard.tsx +37 -85
  355. package/src/workflow/__tests__/ExecutionInspector.test.tsx +30 -2
  356. package/src/workflow/__tests__/WorkflowExecutionApprovalCard.test.tsx +129 -0
  357. package/src/workflow/__tests__/WorkflowFileReviewList.test.tsx +129 -0
  358. package/src/workflow/__tests__/WorkflowTaskApprovalCard.test.tsx +43 -11
  359. package/src/workflow/__tests__/useWorkflowExecutionActions.test.tsx +276 -0
  360. package/src/workflow/execution-inspector/ExecutionInspector.tsx +42 -18
  361. package/src/workflow/index.ts +5 -0
  362. package/src/workflow/useWorkflowExecutionActions.ts +177 -29
  363. package/styles.css +1 -1
  364. package/version-history/DiffViewer.d.ts.map +1 -1
  365. package/version-history/DiffViewer.js +9 -3
  366. package/version-history/DiffViewer.js.map +1 -1
  367. package/version-history/UnifiedDiffView.d.ts +29 -0
  368. package/version-history/UnifiedDiffView.d.ts.map +1 -0
  369. package/version-history/UnifiedDiffView.js +36 -0
  370. package/version-history/UnifiedDiffView.js.map +1 -0
  371. package/version-history/computeDiff.d.ts +3 -1
  372. package/version-history/computeDiff.d.ts.map +1 -1
  373. package/version-history/computeDiff.js +5 -35
  374. package/version-history/computeDiff.js.map +1 -1
  375. package/version-history/diff-hunks.d.ts +21 -0
  376. package/version-history/diff-hunks.d.ts.map +1 -0
  377. package/version-history/diff-hunks.js +58 -0
  378. package/version-history/diff-hunks.js.map +1 -0
  379. package/version-history/index.d.ts +1 -0
  380. package/version-history/index.d.ts.map +1 -1
  381. package/version-history/index.js +1 -0
  382. package/version-history/index.js.map +1 -1
  383. package/version-history/parseUnifiedDiff.d.ts +22 -0
  384. package/version-history/parseUnifiedDiff.d.ts.map +1 -0
  385. package/version-history/parseUnifiedDiff.js +34 -0
  386. package/version-history/parseUnifiedDiff.js.map +1 -0
  387. package/workflow/WorkflowExecutionApprovalCard.d.ts +8 -1
  388. package/workflow/WorkflowExecutionApprovalCard.d.ts.map +1 -1
  389. package/workflow/WorkflowExecutionApprovalCard.js +17 -3
  390. package/workflow/WorkflowExecutionApprovalCard.js.map +1 -1
  391. package/workflow/WorkflowExecutionTimeline.d.ts +11 -2
  392. package/workflow/WorkflowExecutionTimeline.d.ts.map +1 -1
  393. package/workflow/WorkflowExecutionTimeline.js +2 -2
  394. package/workflow/WorkflowExecutionTimeline.js.map +1 -1
  395. package/workflow/WorkflowExecutionTimelineEvent.d.ts +4 -1
  396. package/workflow/WorkflowExecutionTimelineEvent.d.ts.map +1 -1
  397. package/workflow/WorkflowExecutionTimelineEvent.js +2 -2
  398. package/workflow/WorkflowExecutionTimelineEvent.js.map +1 -1
  399. package/workflow/WorkflowExecutionViewer.d.ts.map +1 -1
  400. package/workflow/WorkflowExecutionViewer.js +18 -10
  401. package/workflow/WorkflowExecutionViewer.js.map +1 -1
  402. package/workflow/WorkflowFileReviewList.d.ts +46 -0
  403. package/workflow/WorkflowFileReviewList.d.ts.map +1 -0
  404. package/workflow/WorkflowFileReviewList.js +48 -0
  405. package/workflow/WorkflowFileReviewList.js.map +1 -0
  406. package/workflow/WorkflowTaskApprovalCard.d.ts +8 -1
  407. package/workflow/WorkflowTaskApprovalCard.d.ts.map +1 -1
  408. package/workflow/WorkflowTaskApprovalCard.js +12 -19
  409. package/workflow/WorkflowTaskApprovalCard.js.map +1 -1
  410. package/workflow/execution-inspector/ExecutionInspector.d.ts +21 -4
  411. package/workflow/execution-inspector/ExecutionInspector.d.ts.map +1 -1
  412. package/workflow/execution-inspector/ExecutionInspector.js +6 -3
  413. package/workflow/execution-inspector/ExecutionInspector.js.map +1 -1
  414. package/workflow/index.d.ts +1 -0
  415. package/workflow/index.d.ts.map +1 -1
  416. package/workflow/index.js +1 -0
  417. package/workflow/index.js.map +1 -1
  418. package/workflow/useWorkflowExecutionActions.d.ts +62 -4
  419. package/workflow/useWorkflowExecutionActions.d.ts.map +1 -1
  420. package/workflow/useWorkflowExecutionActions.js +94 -18
  421. package/workflow/useWorkflowExecutionActions.js.map +1 -1
  422. package/session/inspector/PlanTab.d.ts +0 -15
  423. package/session/inspector/PlanTab.d.ts.map +0 -1
  424. package/session/inspector/PlanTab.js +0 -19
  425. package/session/inspector/PlanTab.js.map +0 -1
  426. package/src/session/inspector/PlanTab.tsx +0 -31
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DecisionButton.js","sourceRoot":"","sources":["../../src/internal/DecisionButton.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AAsCpC,MAAM,IAAI,GAAG,EAAE,CACb,wEAAwE,EACxE,uCAAuC,EACvC,qGAAqG;AACrG,+EAA+E;AAC/E,4EAA4E;AAC5E,8EAA8E,CAC/E,CAAC;AAEF,mCAAmC;AACnC,MAAM,OAAO,GAAoC;IAC/C,8EAA8E;IAC9E,6EAA6E;IAC7E,+CAA+C;IAC/C,OAAO,EACL,6EAA6E;IAC/E,mEAAmE;IACnE,KAAK,EAAE,mEAAmE;IAC1E,6EAA6E;IAC7E,2EAA2E;IAC3E,4EAA4E;IAC5E,wCAAwC;IACxC,MAAM,EAAE,EAAE,CACR,uBAAuB,EACvB,oDAAoD,EACpD,oEAAoE,CACrE;CACF,CAAC;AAEF;;;;;;;;;;GAUG;AACH,MAAM,UAAU,cAAc,CAAC,EAC7B,KAAK,EACL,OAAO,EACP,OAAO,EACP,YAAY,GAAG,KAAK,EACpB,QAAQ,GAAG,KAAK,EAChB,QAAQ,GAAG,KAAK,EAChB,SAAS,EACT,YAAY,EACZ,eAAe,GACK;IACpB,OAAO,CACL,kBACE,IAAI,EAAC,QAAQ,EACb,QAAQ,EAAE,YAAY,IAAI,QAAQ,EAClC,OAAO,EAAE,OAAO,gBACJ,KAAK,sBACC,eAAe,wBACb,YAAY,EAChC,SAAS,EAAE,EAAE,CAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC,aAE/C,QAAQ,IAAI,YAAY,CAAC,CAAC,CAAC,KAAC,WAAW,KAAG,CAAC,CAAC,CAAC,IAAI,EACjD,KAAK,IACC,CACV,CAAC;AACJ,CAAC;AAED,8EAA8E;AAC9E,kBAAkB;AAClB,8EAA8E;AAE9E,SAAS,WAAW;IAClB,OAAO,CACL,cACE,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,MAAM,EAAC,cAAc,EACrB,WAAW,EAAC,KAAK,EACjB,SAAS,EAAC,cAAc,iBACZ,MAAM,YAElB,eAAM,CAAC,EAAC,4BAA4B,EAAC,aAAa,EAAC,OAAO,GAAG,GACzD,CACP,CAAC;AACJ,CAAC"}
@@ -0,0 +1,31 @@
1
+ /** Props for {@link InCardDecisionError}. */
2
+ export interface InCardDecisionErrorProps {
3
+ /** The failure to surface. Its `message` is shown verbatim (the actionable part). */
4
+ readonly error: Error;
5
+ /**
6
+ * The verb phrase completing "Couldn't ___" — e.g. `"submit decision"` or
7
+ * `"save"`. Kept short; the server `message` carries the detail.
8
+ */
9
+ readonly leadIn: string;
10
+ /** Stable hook for e2e/visual targeting (`data-cursor-target`). */
11
+ readonly cursorTarget: string;
12
+ }
13
+ /**
14
+ * The shared in-card failure notice for a decision that did not take — used by
15
+ * every decision surface that surfaces errors beside the control that failed:
16
+ * the agent tool gate ({@link ApprovalCard}/{@link ApprovalCardBody}) and the
17
+ * file-review card ({@link FileReviewCard}, whole-set and per-file).
18
+ *
19
+ * One source of truth so those surfaces can never drift in tone, copy shape, or
20
+ * accessibility. `role="alert"` (matching the thread's other inline failures)
21
+ * announces it the moment it appears, since it is a dynamic reaction to the
22
+ * reviewer's action — by the time it renders the optimistic verdict has already
23
+ * reverted, and this explains why. The server `message` is shown verbatim
24
+ * because it is the actionable part (e.g. a digest mismatch means the captured
25
+ * content moved on); the lead-in stays short. Every visual property flows
26
+ * through `--stgm-*` tokens.
27
+ *
28
+ * @internal Not part of the public API.
29
+ */
30
+ export declare function InCardDecisionError({ error, leadIn, cursorTarget, }: InCardDecisionErrorProps): import("react/jsx-runtime").JSX.Element;
31
+ //# sourceMappingURL=InCardDecisionError.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InCardDecisionError.d.ts","sourceRoot":"","sources":["../../src/internal/InCardDecisionError.tsx"],"names":[],"mappings":"AAEA,6CAA6C;AAC7C,MAAM,WAAW,wBAAwB;IACvC,qFAAqF;IACrF,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC;IACtB;;;OAGG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,mEAAmE;IACnE,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;CAC/B;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,KAAK,EACL,MAAM,EACN,YAAY,GACb,EAAE,wBAAwB,2CAU1B"}
@@ -0,0 +1,23 @@
1
+ "use client";
2
+ import { jsxs as _jsxs } from "react/jsx-runtime";
3
+ /**
4
+ * The shared in-card failure notice for a decision that did not take — used by
5
+ * every decision surface that surfaces errors beside the control that failed:
6
+ * the agent tool gate ({@link ApprovalCard}/{@link ApprovalCardBody}) and the
7
+ * file-review card ({@link FileReviewCard}, whole-set and per-file).
8
+ *
9
+ * One source of truth so those surfaces can never drift in tone, copy shape, or
10
+ * accessibility. `role="alert"` (matching the thread's other inline failures)
11
+ * announces it the moment it appears, since it is a dynamic reaction to the
12
+ * reviewer's action — by the time it renders the optimistic verdict has already
13
+ * reverted, and this explains why. The server `message` is shown verbatim
14
+ * because it is the actionable part (e.g. a digest mismatch means the captured
15
+ * content moved on); the lead-in stays short. Every visual property flows
16
+ * through `--stgm-*` tokens.
17
+ *
18
+ * @internal Not part of the public API.
19
+ */
20
+ export function InCardDecisionError({ error, leadIn, cursorTarget, }) {
21
+ return (_jsxs("p", { role: "alert", className: "text-[11px] text-destructive", "data-cursor-target": cursorTarget, children: ["Couldn\u2019t ", leadIn, " \u2014 ", error.message] }));
22
+ }
23
+ //# sourceMappingURL=InCardDecisionError.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InCardDecisionError.js","sourceRoot":"","sources":["../../src/internal/InCardDecisionError.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAeb;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,mBAAmB,CAAC,EAClC,KAAK,EACL,MAAM,EACN,YAAY,GACa;IACzB,OAAO,CACL,aACE,IAAI,EAAC,OAAO,EACZ,SAAS,EAAC,8BAA8B,wBACpB,YAAY,+BAEhB,MAAM,cAAK,KAAK,CAAC,OAAO,IACtC,CACL,CAAC;AACJ,CAAC"}
@@ -0,0 +1,36 @@
1
+ /** Props for {@link RevealToggle}. */
2
+ export interface RevealToggleProps {
3
+ /** Whether the governed content is currently fully revealed. */
4
+ readonly expanded: boolean;
5
+ /** Flips the reveal state. */
6
+ readonly onToggle: () => void;
7
+ /** Label shown while collapsed. Defaults to `"Show more"`. */
8
+ readonly moreLabel?: string;
9
+ /** Label shown while expanded. Defaults to `"Show less"`. */
10
+ readonly lessLabel?: string;
11
+ /** Stable hook for e2e/visual targeting (`data-cursor-target`). */
12
+ readonly cursorTarget?: string;
13
+ /** Additional CSS class names for the control. */
14
+ readonly className?: string;
15
+ }
16
+ /**
17
+ * The single "reveal more / less" control for every bounded block on the
18
+ * execution surface — the diff/gate clamp ({@link BoundedContent}) and the
19
+ * line-count text/terminal blocks ({@link CollapsiblePre} / {@link
20
+ * CollapsibleCode}).
21
+ *
22
+ * It is the Cursor-style affordance the design calls for: a light, centered
23
+ * chevron at the bottom-middle (down to reveal, up to collapse) with a quiet
24
+ * label. Extracting it is what guarantees one disclosure *language* across two
25
+ * truncation *mechanisms* (pixel clamp for visual blocks, line count for text)
26
+ * — the surfaces can never visually drift because they render the same control.
27
+ *
28
+ * Presentational only: it owns no state. The caller holds the reveal state and
29
+ * passes `expanded` + `onToggle`. It carries `aria-expanded` for the block it
30
+ * governs; the owning tool-call row's header chevron (when present) carries the
31
+ * row-level disclosure, so the two axes never collide.
32
+ *
33
+ * @internal Not part of the public API.
34
+ */
35
+ export declare function RevealToggle({ expanded, onToggle, moreLabel, lessLabel, cursorTarget, className, }: RevealToggleProps): import("react/jsx-runtime").JSX.Element;
36
+ //# sourceMappingURL=RevealToggle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RevealToggle.d.ts","sourceRoot":"","sources":["../../src/internal/RevealToggle.tsx"],"names":[],"mappings":"AAIA,sCAAsC;AACtC,MAAM,WAAW,iBAAiB;IAChC,gEAAgE;IAChE,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,8BAA8B;IAC9B,QAAQ,CAAC,QAAQ,EAAE,MAAM,IAAI,CAAC;IAC9B,8DAA8D;IAC9D,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,6DAA6D;IAC7D,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,mEAAmE;IACnE,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,kDAAkD;IAClD,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,YAAY,CAAC,EAC3B,QAAQ,EACR,QAAQ,EACR,SAAuB,EACvB,SAAuB,EACvB,YAAY,EACZ,SAAS,GACV,EAAE,iBAAiB,2CAkBnB"}
@@ -0,0 +1,32 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { cn } from "@stigmer/theme";
4
+ /**
5
+ * The single "reveal more / less" control for every bounded block on the
6
+ * execution surface — the diff/gate clamp ({@link BoundedContent}) and the
7
+ * line-count text/terminal blocks ({@link CollapsiblePre} / {@link
8
+ * CollapsibleCode}).
9
+ *
10
+ * It is the Cursor-style affordance the design calls for: a light, centered
11
+ * chevron at the bottom-middle (down to reveal, up to collapse) with a quiet
12
+ * label. Extracting it is what guarantees one disclosure *language* across two
13
+ * truncation *mechanisms* (pixel clamp for visual blocks, line count for text)
14
+ * — the surfaces can never visually drift because they render the same control.
15
+ *
16
+ * Presentational only: it owns no state. The caller holds the reveal state and
17
+ * passes `expanded` + `onToggle`. It carries `aria-expanded` for the block it
18
+ * governs; the owning tool-call row's header chevron (when present) carries the
19
+ * row-level disclosure, so the two axes never collide.
20
+ *
21
+ * @internal Not part of the public API.
22
+ */
23
+ export function RevealToggle({ expanded, onToggle, moreLabel = "Show more", lessLabel = "Show less", cursorTarget, className, }) {
24
+ return (_jsxs("button", { type: "button", onClick: onToggle, "aria-expanded": expanded, "data-cursor-target": cursorTarget, className: cn("mt-1 flex w-full items-center justify-center gap-1 rounded py-0.5", "text-xs font-medium text-muted-foreground transition-colors hover:text-foreground", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", className), children: [_jsx("span", { children: expanded ? lessLabel : moreLabel }), _jsx(ChevronIcon, { expanded: expanded })] }));
25
+ }
26
+ // ---------------------------------------------------------------------------
27
+ // Inline SVG icon
28
+ // ---------------------------------------------------------------------------
29
+ function ChevronIcon({ expanded }) {
30
+ return (_jsx("svg", { width: "10", height: "10", viewBox: "0 0 10 10", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", className: cn("shrink-0 transition-transform duration-150", expanded && "rotate-180"), "aria-hidden": "true", children: _jsx("path", { d: "M2.5 3.5L5 6.5L7.5 3.5" }) }));
31
+ }
32
+ //# sourceMappingURL=RevealToggle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RevealToggle.js","sourceRoot":"","sources":["../../src/internal/RevealToggle.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AAkBpC;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,YAAY,CAAC,EAC3B,QAAQ,EACR,QAAQ,EACR,SAAS,GAAG,WAAW,EACvB,SAAS,GAAG,WAAW,EACvB,YAAY,EACZ,SAAS,GACS;IAClB,OAAO,CACL,kBACE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,QAAQ,mBACF,QAAQ,wBACH,YAAY,EAChC,SAAS,EAAE,EAAE,CACX,mEAAmE,EACnE,mFAAmF,EACnF,yEAAyE,EACzE,SAAS,CACV,aAED,yBAAO,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,GAAQ,EAC/C,KAAC,WAAW,IAAC,QAAQ,EAAE,QAAQ,GAAI,IAC5B,CACV,CAAC;AACJ,CAAC;AAED,8EAA8E;AAC9E,kBAAkB;AAClB,8EAA8E;AAE9E,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,4CAA4C,EAC5C,QAAQ,IAAI,YAAY,CACzB,iBACW,MAAM,YAElB,eAAM,CAAC,EAAC,wBAAwB,GAAG,GAC/B,CACP,CAAC;AACJ,CAAC"}
@@ -3,13 +3,19 @@ import { ApprovalAction } from "@stigmer/protos/ai/stigmer/agentic/agentexecutio
3
3
  import { type ThreadItem } from "../execution/MessageThread";
4
4
  import { type FilePathContextValue } from "../execution/FilePathContext";
5
5
  import { type SandboxContextValue } from "../execution/SandboxContext";
6
+ import { type ApprovalContextValue } from "../execution/ApprovalContext";
7
+ import { type FileReviewContextValue } from "../execution/FileReviewContext";
6
8
  export interface VirtualizedThreadProps {
7
9
  readonly items: readonly ThreadItem[];
8
10
  readonly formatToolCallSummary?: (toolCalls: readonly ToolCall[]) => string;
9
11
  readonly onApprovalSubmit?: (toolCallId: string, action: ApprovalAction, comment?: string) => void;
10
12
  readonly submittingApprovalIds?: ReadonlySet<string>;
13
+ readonly approvalErrors?: ReadonlyMap<string, Error>;
11
14
  readonly filePathCtx: FilePathContextValue;
12
15
  readonly sandboxCtx: SandboxContextValue;
16
+ readonly approvalCtx: ApprovalContextValue;
17
+ readonly fileReviewCtx: FileReviewContextValue;
18
+ readonly unresolvedApprovalCount: number;
13
19
  readonly onBuildFromPlan?: () => void;
14
20
  readonly org?: string;
15
21
  readonly planActionsDisabled?: boolean;
@@ -28,5 +34,5 @@ export interface VirtualizedThreadProps {
28
34
  *
29
35
  * @internal
30
36
  */
31
- export declare function VirtualizedThread({ items, formatToolCallSummary, onApprovalSubmit, submittingApprovalIds, filePathCtx, sandboxCtx, onBuildFromPlan, org, planActionsDisabled, centerContent, onRetrySend, onRetryExecution, onEditMessage, }: VirtualizedThreadProps): import("react/jsx-runtime").JSX.Element;
37
+ export declare function VirtualizedThread({ items, formatToolCallSummary, onApprovalSubmit, submittingApprovalIds, approvalErrors, filePathCtx, sandboxCtx, approvalCtx, fileReviewCtx, unresolvedApprovalCount, onBuildFromPlan, org, planActionsDisabled, centerContent, onRetrySend, onRetryExecution, onEditMessage, }: VirtualizedThreadProps): import("react/jsx-runtime").JSX.Element;
32
38
  //# sourceMappingURL=VirtualizedThread.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"VirtualizedThread.d.ts","sourceRoot":"","sources":["../../src/internal/VirtualizedThread.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iEAAiE,CAAC;AAChG,OAAO,EAAE,cAAc,EAAE,MAAM,8DAA8D,CAAC;AAC9F,OAAO,EAEL,KAAK,UAAU,EAChB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAmB,KAAK,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAC1F,OAAO,EAAkB,KAAK,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AASvF,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,KAAK,EAAE,SAAS,UAAU,EAAE,CAAC;IACtC,QAAQ,CAAC,qBAAqB,CAAC,EAAE,CAAC,SAAS,EAAE,SAAS,QAAQ,EAAE,KAAK,MAAM,CAAC;IAC5E,QAAQ,CAAC,gBAAgB,CAAC,EAAE,CAC1B,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,cAAc,EACtB,OAAO,CAAC,EAAE,MAAM,KACb,IAAI,CAAC;IACV,QAAQ,CAAC,qBAAqB,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACrD,QAAQ,CAAC,WAAW,EAAE,oBAAoB,CAAC;IAC3C,QAAQ,CAAC,UAAU,EAAE,mBAAmB,CAAC;IACzC,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,IAAI,CAAC;IACtC,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,mBAAmB,CAAC,EAAE,OAAO,CAAC;IACvC,QAAQ,CAAC,aAAa,CAAC,EAAE,OAAO,CAAC;IACjC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IAClC,QAAQ,CAAC,gBAA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,WAAW,CAAC,MAAM,CAAC,CAAC;IACrD,QAAQ,CAAC,cAAc,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IACrD,QAAQ,CAAC,WAAW,EAAE,oBAAoB,CAAC;IAC3C,QAAQ,CAAC,UAAU,EAAE,mBAAmB,CAAC;IACzC,QAAQ,CAAC,WAAW,EAAE,oBAAoB,CAAC;IAC3C,QAAQ,CAAC,aAAa,EAAE,sBAAsB,CAAC;IAC/C,QAAQ,CAAC,uBAAuB,EAAE,MAAM,CAAC;IACzC,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,IAAI,CAAC;IACtC,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,mBAAmB,CAAC,EAAE,OAAO,CAAC;IACvC,QAAQ,CAAC,aAAa,CAAC,EAAE,OAAO,CAAC;IACjC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IAClC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACtD,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACjD;AAuCD;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,KAAK,EACL,qBAAqB,EACrB,gBAAgB,EAChB,qBAAqB,EACrB,cAAc,EACd,WAAW,EACX,UAAU,EACV,WAAW,EACX,aAAa,EACb,uBAAuB,EACvB,eAAe,EACf,GAAG,EACH,mBAAmB,EACnB,aAAa,EACb,WAAW,EACX,gBAAgB,EAChB,aAAa,GACd,EAAE,sBAAsB,2CAuFxB"}
@@ -6,8 +6,11 @@ import { cn } from "@stigmer/theme";
6
6
  import { ThreadItemRenderer, } from "../execution/MessageThread";
7
7
  import { FilePathContext } from "../execution/FilePathContext";
8
8
  import { SandboxContext } from "../execution/SandboxContext";
9
+ import { ApprovalContext } from "../execution/ApprovalContext";
10
+ import { FileReviewContext } from "../execution/FileReviewContext";
9
11
  import { DevProfiler, useDomNodeCount } from "./dev";
10
12
  import { JumpToLatestButton } from "./JumpToLatestButton";
13
+ import { ApprovalPeekBar } from "./ApprovalPeekBar";
11
14
  import { ThreadItemWrapper } from "./ThreadItemWrapper";
12
15
  // ---------------------------------------------------------------------------
13
16
  // Scrollbar classes shared with the non-virtualized path
@@ -33,7 +36,7 @@ const NEAR_BOTTOM_THRESHOLD_PX = 80;
33
36
  *
34
37
  * @internal
35
38
  */
36
- export function VirtualizedThread({ items, formatToolCallSummary, onApprovalSubmit, submittingApprovalIds, filePathCtx, sandboxCtx, onBuildFromPlan, org, planActionsDisabled, centerContent, onRetrySend, onRetryExecution, onEditMessage, }) {
39
+ export function VirtualizedThread({ items, formatToolCallSummary, onApprovalSubmit, submittingApprovalIds, approvalErrors, filePathCtx, sandboxCtx, approvalCtx, fileReviewCtx, unresolvedApprovalCount, onBuildFromPlan, org, planActionsDisabled, centerContent, onRetrySend, onRetryExecution, onEditMessage, }) {
37
40
  const virtuosoRef = useRef(null);
38
41
  const scrollerRef = useRef(null);
39
42
  const [isAtBottom, setIsAtBottom] = useState(true);
@@ -52,13 +55,14 @@ export function VirtualizedThread({ items, formatToolCallSummary, onApprovalSubm
52
55
  formatToolCallSummary,
53
56
  onApprovalSubmit,
54
57
  submittingApprovalIds,
58
+ approvalErrors,
55
59
  onBuildFromPlan,
56
60
  org,
57
61
  planActionsDisabled,
58
62
  onRetrySend,
59
63
  onRetryExecution,
60
64
  onEditMessage,
61
- }), [formatToolCallSummary, onApprovalSubmit, submittingApprovalIds, onBuildFromPlan, org, planActionsDisabled, onRetrySend, onRetryExecution, onEditMessage]);
62
- return (_jsxs(_Fragment, { children: [_jsx(SandboxContext.Provider, { value: sandboxCtx, children: _jsx(FilePathContext.Provider, { value: filePathCtx, children: _jsx(DevProfiler, { id: "MessageThread:virtualized", children: _jsx(Virtuoso, { ref: virtuosoRef, data: items, alignToBottom: true, followOutput: handleFollowOutput, atBottomStateChange: setIsAtBottom, atBottomThreshold: NEAR_BOTTOM_THRESHOLD_PX, computeItemKey: (_index, item) => item.key, increaseViewportBy: { top: 200, bottom: 200 }, scrollerRef: handleScrollerRef, className: "h-full", components: { Scroller: ScrollerWithA11y }, itemContent: (index, item) => (_jsx("div", { className: cn("pb-4 pt-0 first:pt-6", centerContent && "mx-auto w-full max-w-3xl px-4"), children: _jsx(ThreadItemWrapper, { animate: index >= items.length - 2, children: _jsx(ThreadItemRenderer, { item: item, ...renderProps }) }) })) }) }) }) }), _jsx(JumpToLatestButton, { onClick: jumpToLatest, visible: !isAtBottom })] }));
65
+ }), [formatToolCallSummary, onApprovalSubmit, submittingApprovalIds, approvalErrors, onBuildFromPlan, org, planActionsDisabled, onRetrySend, onRetryExecution, onEditMessage]);
66
+ return (_jsxs(_Fragment, { children: [_jsx(SandboxContext.Provider, { value: sandboxCtx, children: _jsx(FilePathContext.Provider, { value: filePathCtx, children: _jsx(ApprovalContext.Provider, { value: approvalCtx, children: _jsx(FileReviewContext.Provider, { value: fileReviewCtx, children: _jsx(DevProfiler, { id: "MessageThread:virtualized", children: _jsx(Virtuoso, { ref: virtuosoRef, data: items, alignToBottom: true, followOutput: handleFollowOutput, atBottomStateChange: setIsAtBottom, atBottomThreshold: NEAR_BOTTOM_THRESHOLD_PX, computeItemKey: (_index, item) => item.key, increaseViewportBy: { top: 200, bottom: 200 }, scrollerRef: handleScrollerRef, className: "h-full", components: { Scroller: ScrollerWithA11y }, itemContent: (index, item) => (_jsx("div", { className: cn("pb-4 pt-0 first:pt-6", centerContent && "mx-auto w-full max-w-3xl px-4"), children: _jsx(ThreadItemWrapper, { animate: index >= items.length - 2, children: _jsx(ThreadItemRenderer, { item: item, ...renderProps }) }) })) }) }) }) }) }) }), _jsx(JumpToLatestButton, { onClick: jumpToLatest, visible: !isAtBottom && unresolvedApprovalCount === 0 }), _jsx(ApprovalPeekBar, { visible: !isAtBottom && unresolvedApprovalCount > 0, count: unresolvedApprovalCount, onClick: jumpToLatest })] }));
63
67
  }
64
68
  //# sourceMappingURL=VirtualizedThread.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"VirtualizedThread.js","sourceRoot":"","sources":["../../src/internal/VirtualizedThread.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EACL,UAAU,EACV,WAAW,EACX,OAAO,EACP,MAAM,EACN,QAAQ,GAET,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,QAAQ,EAAuB,MAAM,gBAAgB,CAAC;AAC/D,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AAGpC,OAAO,EACL,kBAAkB,GAEnB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,eAAe,EAA6B,MAAM,8BAA8B,CAAC;AAC1F,OAAO,EAAE,cAAc,EAA4B,MAAM,6BAA6B,CAAC;AACvF,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AA0BxD,8EAA8E;AAC9E,yDAAyD;AACzD,8EAA8E;AAE9E,MAAM,iBAAiB,GAAG,EAAE,CAC1B,0EAA0E,EAC1E,8BAA8B,EAC9B,6CAA6C,EAC7C,qFAAqF,CACtF,CAAC;AAEF,8EAA8E;AAC9E,6BAA6B;AAC7B,8EAA8E;AAE9E,MAAM,gBAAgB,GAAG,UAAU,CAGjC,SAAS,gBAAgB,CAAC,KAAK,EAAE,GAAG;IACpC,OAAO,CACL,iBACM,KAAK,EACT,GAAG,EAAE,GAAG,EACR,IAAI,EAAC,KAAK,eACA,QAAQ,mBACJ,WAAW,EACzB,SAAS,EAAE,EAAE,CAAC,KAAK,CAAC,SAAS,EAAE,iBAAiB,CAAC,GACjD,CACH,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,8EAA8E;AAC9E,oBAA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ACjB,IAAI,EAAE,IAAI,KACN,WAAW,GACf,GACgB,GAChB,CACP,GACD,GACU,GACe,GACF,GACA,GACD,EAG1B,KAAC,kBAAkB,IACjB,OAAO,EAAE,YAAY,EACrB,OAAO,EAAE,CAAC,UAAU,IAAI,uBAAuB,KAAK,CAAC,GACrD,EACF,KAAC,eAAe,IACd,OAAO,EAAE,CAAC,UAAU,IAAI,uBAAuB,GAAG,CAAC,EACnD,KAAK,EAAE,uBAAuB,EAC9B,OAAO,EAAE,YAAY,GACrB,IACD,CACJ,CAAC;AACJ,CAAC"}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Disclosure state machine for progressively-revealed thread sections
3
+ * (tool-call groups, individual tool rows, sub-agent cards).
4
+ *
5
+ * The challenge it solves: a section should open and close *on its own* as
6
+ * the agent works (open while a tool runs, settle closed when it finishes),
7
+ * yet a user's explicit click must win and never be stomped by the next
8
+ * stream frame. Three components hand-rolled this same "auto unless the user
9
+ * intervened" logic; this hook is the single source of that shape.
10
+ *
11
+ * `autoOpen` is the component's live opinion of whether the section *should*
12
+ * be open right now (e.g. `isRunning || hasPendingApproval`). While the user
13
+ * has not toggled, `open` tracks `autoOpen`. Once the user toggles, their
14
+ * choice sticks for the lifetime of the component — the auto signal is
15
+ * ignored from then on, so the section never reopens or recollapses under
16
+ * them mid-stream.
17
+ *
18
+ * @param autoOpen Whether the section should auto-open given current state.
19
+ * @param options.initialOpen First-render open state. Defaults to `autoOpen`.
20
+ * Use it to honour a caller-provided `defaultExpanded` before the first
21
+ * effect runs.
22
+ * @returns A `[open, toggle]` tuple. `toggle` flips the state and marks it
23
+ * user-controlled.
24
+ *
25
+ * @example
26
+ * ```tsx
27
+ * const [open, toggle] = useAutoDisclosure(isRunning || hasPendingApproval);
28
+ * <button aria-expanded={open} onClick={toggle}>…</button>
29
+ * ```
30
+ */
31
+ export declare function useAutoDisclosure(autoOpen: boolean, options?: {
32
+ readonly initialOpen?: boolean;
33
+ }): readonly [open: boolean, toggle: () => void];
34
+ //# sourceMappingURL=useAutoDisclosure.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useAutoDisclosure.d.ts","sourceRoot":"","sources":["../../src/internal/useAutoDisclosure.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,OAAO,EACjB,OAAO,CAAC,EAAE;IAAE,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAA;CAAE,GAC3C,SAAS,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,IAAI,CAAC,CAoB9C"}
@@ -0,0 +1,53 @@
1
+ "use client";
2
+ import { useEffect, useRef, useState } from "react";
3
+ /**
4
+ * Disclosure state machine for progressively-revealed thread sections
5
+ * (tool-call groups, individual tool rows, sub-agent cards).
6
+ *
7
+ * The challenge it solves: a section should open and close *on its own* as
8
+ * the agent works (open while a tool runs, settle closed when it finishes),
9
+ * yet a user's explicit click must win and never be stomped by the next
10
+ * stream frame. Three components hand-rolled this same "auto unless the user
11
+ * intervened" logic; this hook is the single source of that shape.
12
+ *
13
+ * `autoOpen` is the component's live opinion of whether the section *should*
14
+ * be open right now (e.g. `isRunning || hasPendingApproval`). While the user
15
+ * has not toggled, `open` tracks `autoOpen`. Once the user toggles, their
16
+ * choice sticks for the lifetime of the component — the auto signal is
17
+ * ignored from then on, so the section never reopens or recollapses under
18
+ * them mid-stream.
19
+ *
20
+ * @param autoOpen Whether the section should auto-open given current state.
21
+ * @param options.initialOpen First-render open state. Defaults to `autoOpen`.
22
+ * Use it to honour a caller-provided `defaultExpanded` before the first
23
+ * effect runs.
24
+ * @returns A `[open, toggle]` tuple. `toggle` flips the state and marks it
25
+ * user-controlled.
26
+ *
27
+ * @example
28
+ * ```tsx
29
+ * const [open, toggle] = useAutoDisclosure(isRunning || hasPendingApproval);
30
+ * <button aria-expanded={open} onClick={toggle}>…</button>
31
+ * ```
32
+ */
33
+ export function useAutoDisclosure(autoOpen, options) {
34
+ const [open, setOpen] = useState(options?.initialOpen ?? autoOpen);
35
+ const userToggledRef = useRef(false);
36
+ const prevAutoOpenRef = useRef(autoOpen);
37
+ useEffect(() => {
38
+ // Sync only on a genuine transition of the auto signal — never on mount,
39
+ // so `initialOpen` is honoured, and never against the user's choice.
40
+ if (prevAutoOpenRef.current === autoOpen)
41
+ return;
42
+ prevAutoOpenRef.current = autoOpen;
43
+ if (userToggledRef.current)
44
+ return;
45
+ setOpen(autoOpen);
46
+ }, [autoOpen]);
47
+ const toggle = useRef(() => {
48
+ userToggledRef.current = true;
49
+ setOpen((v) => !v);
50
+ }).current;
51
+ return [open, toggle];
52
+ }
53
+ //# sourceMappingURL=useAutoDisclosure.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useAutoDisclosure.js","sourceRoot":"","sources":["../../src/internal/useAutoDisclosure.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEpD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,UAAU,iBAAiB,CAC/B,QAAiB,EACjB,OAA4C;IAE5C,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAC,OAAO,EAAE,WAAW,IAAI,QAAQ,CAAC,CAAC;IACnE,MAAM,cAAc,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IACrC,MAAM,eAAe,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;IAEzC,SAAS,CAAC,GAAG,EAAE;QACb,yEAAyE;QACzE,qEAAqE;QACrE,IAAI,eAAe,CAAC,OAAO,KAAK,QAAQ;YAAE,OAAO;QACjD,eAAe,CAAC,OAAO,GAAG,QAAQ,CAAC;QACnC,IAAI,cAAc,CAAC,OAAO;YAAE,OAAO;QACnC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACpB,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEf,MAAM,MAAM,GAAG,MAAM,CAAC,GAAG,EAAE;QACzB,cAAc,CAAC,OAAO,GAAG,IAAI,CAAC;QAC9B,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IACrB,CAAC,CAAC,CAAC,OAAO,CAAC;IAEX,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AACxB,CAAC"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Live elapsed time since an ISO 8601 timestamp, re-rendering once per second.
3
+ *
4
+ * The shape behind every "how long has this been going" affordance in the
5
+ * thread: an approval gate waiting on a human, a sub-agent card whose nested
6
+ * activity cannot be streamed (the Cursor SDK returns sub-agent internals only
7
+ * at completion), a long-running tool. A ticking duration is the honest signal
8
+ * that work is progressing when there is nothing else to show — as opposed to
9
+ * fabricating intermediate state.
10
+ *
11
+ * Returns elapsed milliseconds (clamped to >= 0 against client/server clock
12
+ * skew), or `null` when the timestamp is absent or unparseable — callers
13
+ * render nothing rather than a bogus "0s". The interval is scoped to the
14
+ * component instance and torn down on unmount, so a thread full of settled
15
+ * cards costs zero timers.
16
+ *
17
+ * @param startedAt ISO 8601 timestamp the clock counts from (e.g.
18
+ * `ToolCall.approval_requested_at`, `SubAgentExecution.started_at`).
19
+ */
20
+ export declare function useElapsedSince(startedAt: string): number | null;
21
+ /**
22
+ * Format an elapsed duration for the live tickers driven by
23
+ * {@link useElapsedSince}: `just now`, `42s`, `3m 12s`, `1h 5m`.
24
+ *
25
+ * Second-granularity (unlike ToolCallDetail's `formatDuration`, which keeps
26
+ * millisecond precision for completed calls) because a live counter that
27
+ * flickers sub-second digits reads as noise, not progress.
28
+ */
29
+ export declare function formatElapsed(ms: number): string;
30
+ //# sourceMappingURL=useElapsedSince.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useElapsedSince.d.ts","sourceRoot":"","sources":["../../src/internal/useElapsedSince.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAsBhE;AAED;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAgBhD"}
@@ -0,0 +1,70 @@
1
+ "use client";
2
+ import { useEffect, useMemo, useState } from "react";
3
+ /**
4
+ * Live elapsed time since an ISO 8601 timestamp, re-rendering once per second.
5
+ *
6
+ * The shape behind every "how long has this been going" affordance in the
7
+ * thread: an approval gate waiting on a human, a sub-agent card whose nested
8
+ * activity cannot be streamed (the Cursor SDK returns sub-agent internals only
9
+ * at completion), a long-running tool. A ticking duration is the honest signal
10
+ * that work is progressing when there is nothing else to show — as opposed to
11
+ * fabricating intermediate state.
12
+ *
13
+ * Returns elapsed milliseconds (clamped to >= 0 against client/server clock
14
+ * skew), or `null` when the timestamp is absent or unparseable — callers
15
+ * render nothing rather than a bogus "0s". The interval is scoped to the
16
+ * component instance and torn down on unmount, so a thread full of settled
17
+ * cards costs zero timers.
18
+ *
19
+ * @param startedAt ISO 8601 timestamp the clock counts from (e.g.
20
+ * `ToolCall.approval_requested_at`, `SubAgentExecution.started_at`).
21
+ */
22
+ export function useElapsedSince(startedAt) {
23
+ const startMs = useMemo(() => {
24
+ if (!startedAt)
25
+ return null;
26
+ const t = new Date(startedAt).getTime();
27
+ return Number.isNaN(t) ? null : t;
28
+ }, [startedAt]);
29
+ const [elapsed, setElapsed] = useState(null);
30
+ useEffect(() => {
31
+ if (startMs === null) {
32
+ setElapsed(null);
33
+ return;
34
+ }
35
+ setElapsed(Math.max(0, Date.now() - startMs));
36
+ const id = setInterval(() => {
37
+ setElapsed(Math.max(0, Date.now() - startMs));
38
+ }, 1000);
39
+ return () => clearInterval(id);
40
+ }, [startMs]);
41
+ return startMs === null ? null : elapsed;
42
+ }
43
+ /**
44
+ * Format an elapsed duration for the live tickers driven by
45
+ * {@link useElapsedSince}: `just now`, `42s`, `3m 12s`, `1h 5m`.
46
+ *
47
+ * Second-granularity (unlike ToolCallDetail's `formatDuration`, which keeps
48
+ * millisecond precision for completed calls) because a live counter that
49
+ * flickers sub-second digits reads as noise, not progress.
50
+ */
51
+ export function formatElapsed(ms) {
52
+ if (ms < 1000)
53
+ return "just now";
54
+ const seconds = Math.floor(ms / 1000);
55
+ if (seconds < 60)
56
+ return `${seconds}s`;
57
+ const minutes = Math.floor(seconds / 60);
58
+ const remainingSeconds = seconds % 60;
59
+ if (minutes < 60) {
60
+ return remainingSeconds > 0
61
+ ? `${minutes}m ${remainingSeconds}s`
62
+ : `${minutes}m`;
63
+ }
64
+ const hours = Math.floor(minutes / 60);
65
+ const remainingMinutes = minutes % 60;
66
+ return remainingMinutes > 0
67
+ ? `${hours}h ${remainingMinutes}m`
68
+ : `${hours}h`;
69
+ }
70
+ //# sourceMappingURL=useElapsedSince.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useElapsedSince.js","sourceRoot":"","sources":["../../src/internal/useElapsedSince.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAErD;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,eAAe,CAAC,SAAiB;IAC/C,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,EAAE;QAC3B,IAAI,CAAC,SAAS;YAAE,OAAO,IAAI,CAAC;QAC5B,MAAM,CAAC,GAAG,IAAI,IAAI,CAAC,SAAS,CAAC,CAAC,OAAO,EAAE,CAAC;QACxC,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IACpC,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;IAEhB,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAA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AK,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,EAAE,CAAC,CAAC;IACvC,MAAM,gBAAgB,GAAG,OAAO,GAAG,EAAE,CAAC;IACtC,OAAO,gBAAgB,GAAG,CAAC;QACzB,CAAC,CAAC,GAAG,KAAK,KAAK,gBAAgB,GAAG;QAClC,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC;AAClB,CAAC"}
@@ -0,0 +1,30 @@
1
+ export interface UseIsOverflowingReturn<T extends HTMLElement> {
2
+ /** Attach to the element whose vertical overflow should be tracked. */
3
+ readonly ref: React.RefObject<T | null>;
4
+ /** `true` when the element's content is clipped by a vertical clamp (e.g. `overflow-hidden` + `max-h-*`). */
5
+ readonly isOverflowing: boolean;
6
+ }
7
+ /**
8
+ * Tracks whether a vertically-clamped element (e.g. one styled with
9
+ * `overflow-hidden max-h-*`) is actually clipping its content at the current
10
+ * height.
11
+ *
12
+ * The vertical analog of {@link useIsTextTruncated}: it measures
13
+ * `scrollHeight > clientHeight` synchronously via `useLayoutEffect` (so the
14
+ * first value is correct before paint — no flash) and keeps it in sync with
15
+ * content-size changes via a `ResizeObserver`. The state setter compares before
16
+ * writing, so a stable layout never triggers a re-render loop.
17
+ *
18
+ * Pass `enabled: false` to opt out entirely — the observer is not attached and
19
+ * `isOverflowing` stays `false`. Callers gate on this so only the elements that
20
+ * consume the signal pay for the measurement.
21
+ *
22
+ * Note: under a layout-free test environment (`happy-dom`) `scrollHeight` and
23
+ * `clientHeight` are both `0`, so this reports `false`; overflow-driven UI is
24
+ * therefore verified in the e2e (real-browser) layer, mirroring the split the
25
+ * rest of the SDK already documents.
26
+ *
27
+ * @internal
28
+ */
29
+ export declare function useIsOverflowing<T extends HTMLElement = HTMLElement>(enabled: boolean): UseIsOverflowingReturn<T>;
30
+ //# sourceMappingURL=useIsOverflowing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useIsOverflowing.d.ts","sourceRoot":"","sources":["../../src/internal/useIsOverflowing.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,sBAAsB,CAAC,CAAC,SAAS,WAAW;IAC3D,uEAAuE;IACvE,QAAQ,CAAC,GAAG,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;IACxC,6GAA6G;IAC7G,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;CACjC;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,WAAW,GAAG,WAAW,EAClE,OAAO,EAAE,OAAO,GACf,sBAAsB,CAAC,CAAC,CAAC,CA2B3B"}
@@ -0,0 +1,47 @@
1
+ import { useLayoutEffect, useRef, useState } from "react";
2
+ /**
3
+ * Tracks whether a vertically-clamped element (e.g. one styled with
4
+ * `overflow-hidden max-h-*`) is actually clipping its content at the current
5
+ * height.
6
+ *
7
+ * The vertical analog of {@link useIsTextTruncated}: it measures
8
+ * `scrollHeight > clientHeight` synchronously via `useLayoutEffect` (so the
9
+ * first value is correct before paint — no flash) and keeps it in sync with
10
+ * content-size changes via a `ResizeObserver`. The state setter compares before
11
+ * writing, so a stable layout never triggers a re-render loop.
12
+ *
13
+ * Pass `enabled: false` to opt out entirely — the observer is not attached and
14
+ * `isOverflowing` stays `false`. Callers gate on this so only the elements that
15
+ * consume the signal pay for the measurement.
16
+ *
17
+ * Note: under a layout-free test environment (`happy-dom`) `scrollHeight` and
18
+ * `clientHeight` are both `0`, so this reports `false`; overflow-driven UI is
19
+ * therefore verified in the e2e (real-browser) layer, mirroring the split the
20
+ * rest of the SDK already documents.
21
+ *
22
+ * @internal
23
+ */
24
+ export function useIsOverflowing(enabled) {
25
+ const ref = useRef(null);
26
+ const [isOverflowing, setIsOverflowing] = useState(false);
27
+ useLayoutEffect(() => {
28
+ if (!enabled) {
29
+ // Reset so an element that stops consuming the signal doesn't keep a stale true.
30
+ setIsOverflowing((prev) => (prev ? false : prev));
31
+ return;
32
+ }
33
+ const el = ref.current;
34
+ if (!el)
35
+ return;
36
+ const measure = () => {
37
+ const next = el.scrollHeight > el.clientHeight + 1;
38
+ setIsOverflowing((prev) => (prev === next ? prev : next));
39
+ };
40
+ measure();
41
+ const ro = new ResizeObserver(measure);
42
+ ro.observe(el);
43
+ return () => ro.disconnect();
44
+ }, [enabled]);
45
+ return { ref, isOverflowing };
46
+ }
47
+ //# sourceMappingURL=useIsOverflowing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useIsOverflowing.js","sourceRoot":"","sources":["../../src/internal/useIsOverflowing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAS1D;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,UAAU,gBAAgB,CAC9B,OAAgB;IAEhB,MAAM,GAAG,GAAG,MAAM,CAAW,IAAI,CAAC,CAAC;IACnC,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAE1D,eAAe,CAAC,GAAG,EAAE;QACnB,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,iFAAiF;YACjF,gBAAgB,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;YAClD,OAAO;QACT,CAAC;QAED,MAAM,EAAE,GAAG,GAAG,CAAC,OAAO,CAAC;QACvB,IAAI,CAAC,EAAE;YAAE,OAAO;QAEhB,MAAM,OAAO,GAAG,GAAG,EAAE;YACnB,MAAM,IAAI,GAAG,EAAE,CAAC,YAAY,GAAG,EAAE,CAAC,YAAY,GAAG,CAAC,CAAC;YACnD,gBAAgB,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;QAC5D,CAAC,CAAC;QAEF,OAAO,EAAE,CAAC;QAEV,MAAM,EAAE,GAAG,IAAI,cAAc,CAAC,OAAO,CAAC,CAAC;QACvC,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QACf,OAAO,GAAG,EAAE,CAAC,EAAE,CAAC,UAAU,EAAE,CAAC;IAC/B,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IAEd,OAAO,EAAE,GAAG,EAAE,aAAa,EAAE,CAAC;AAChC,CAAC"}
@@ -0,0 +1,24 @@
1
+ export interface UseIsTextTruncatedReturn<T extends HTMLElement> {
2
+ /** Attach to the element whose horizontal overflow should be tracked. */
3
+ readonly ref: React.RefObject<T | null>;
4
+ /** `true` when the element's content is clipped by `overflow` (e.g. `truncate`). */
5
+ readonly isTruncated: boolean;
6
+ }
7
+ /**
8
+ * Tracks whether a single-line, overflow-clipped element (e.g. one styled with
9
+ * Tailwind's `truncate`) is actually truncating its text at the current width.
10
+ *
11
+ * The horizontal analog of {@link useScrollShadows}: it measures
12
+ * `scrollWidth > clientWidth` synchronously via `useLayoutEffect` (so the first
13
+ * value is correct before paint — no flash) and keeps it in sync with width
14
+ * changes via a `ResizeObserver`. The state setter compares before writing, so a
15
+ * stable layout never triggers a re-render loop.
16
+ *
17
+ * Pass `enabled: false` to opt a row out entirely — the observer is not attached
18
+ * and `isTruncated` stays `false`. Callers gate on this so only the rows that
19
+ * consume the signal pay for the measurement.
20
+ *
21
+ * @internal
22
+ */
23
+ export declare function useIsTextTruncated<T extends HTMLElement = HTMLElement>(enabled: boolean): UseIsTextTruncatedReturn<T>;
24
+ //# sourceMappingURL=useIsTextTruncated.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useIsTextTruncated.d.ts","sourceRoot":"","sources":["../../src/internal/useIsTextTruncated.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,wBAAwB,CAAC,CAAC,SAAS,WAAW;IAC7D,yEAAyE;IACzE,QAAQ,CAAC,GAAG,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;IACxC,oFAAoF;IACpF,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;CAC/B;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,WAAW,GAAG,WAAW,EACpE,OAAO,EAAE,OAAO,GACf,wBAAwB,CAAC,CAAC,CAAC,CA2B7B"}
@@ -0,0 +1,41 @@
1
+ import { useLayoutEffect, useRef, useState } from "react";
2
+ /**
3
+ * Tracks whether a single-line, overflow-clipped element (e.g. one styled with
4
+ * Tailwind's `truncate`) is actually truncating its text at the current width.
5
+ *
6
+ * The horizontal analog of {@link useScrollShadows}: it measures
7
+ * `scrollWidth > clientWidth` synchronously via `useLayoutEffect` (so the first
8
+ * value is correct before paint — no flash) and keeps it in sync with width
9
+ * changes via a `ResizeObserver`. The state setter compares before writing, so a
10
+ * stable layout never triggers a re-render loop.
11
+ *
12
+ * Pass `enabled: false` to opt a row out entirely — the observer is not attached
13
+ * and `isTruncated` stays `false`. Callers gate on this so only the rows that
14
+ * consume the signal pay for the measurement.
15
+ *
16
+ * @internal
17
+ */
18
+ export function useIsTextTruncated(enabled) {
19
+ const ref = useRef(null);
20
+ const [isTruncated, setIsTruncated] = useState(false);
21
+ useLayoutEffect(() => {
22
+ if (!enabled) {
23
+ // Reset so a row that stops consuming the signal doesn't keep a stale true.
24
+ setIsTruncated((prev) => (prev ? false : prev));
25
+ return;
26
+ }
27
+ const el = ref.current;
28
+ if (!el)
29
+ return;
30
+ const measure = () => {
31
+ const next = el.scrollWidth > el.clientWidth + 1;
32
+ setIsTruncated((prev) => (prev === next ? prev : next));
33
+ };
34
+ measure();
35
+ const ro = new ResizeObserver(measure);
36
+ ro.observe(el);
37
+ return () => ro.disconnect();
38
+ }, [enabled]);
39
+ return { ref, isTruncated };
40
+ }
41
+ //# sourceMappingURL=useIsTextTruncated.js.map
@@ -0,0 +1 @@
1
+ {"version":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