@wzrhine/agent 0.0.0-stage → 0.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 (347) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/LICENSE +21 -0
  3. package/README.md +29 -3
  4. package/dist/agent.css +15 -0
  5. package/dist/components/artifact/ArtifactCard.d.ts +56 -0
  6. package/dist/components/artifact/ArtifactCard.d.ts.map +1 -0
  7. package/dist/components/artifact/ArtifactCard.js +78 -0
  8. package/dist/components/artifact/ArtifactCard.js.map +1 -0
  9. package/dist/components/artifact/FilePreview.d.ts +117 -0
  10. package/dist/components/artifact/FilePreview.d.ts.map +1 -0
  11. package/dist/components/artifact/FilePreview.js +207 -0
  12. package/dist/components/artifact/FilePreview.js.map +1 -0
  13. package/dist/components/artifact/FilePreviewTabs.d.ts +51 -0
  14. package/dist/components/artifact/FilePreviewTabs.d.ts.map +1 -0
  15. package/dist/components/artifact/FilePreviewTabs.js +150 -0
  16. package/dist/components/artifact/FilePreviewTabs.js.map +1 -0
  17. package/dist/components/composer/AttachmentList.d.ts +33 -0
  18. package/dist/components/composer/AttachmentList.d.ts.map +1 -0
  19. package/dist/components/composer/AttachmentList.js +56 -0
  20. package/dist/components/composer/AttachmentList.js.map +1 -0
  21. package/dist/components/composer/Composer.d.ts +113 -0
  22. package/dist/components/composer/Composer.d.ts.map +1 -0
  23. package/dist/components/composer/Composer.js +327 -0
  24. package/dist/components/composer/Composer.js.map +1 -0
  25. package/dist/components/composer/ComposerInput.d.ts +101 -0
  26. package/dist/components/composer/ComposerInput.d.ts.map +1 -0
  27. package/dist/components/composer/ComposerInput.js +301 -0
  28. package/dist/components/composer/ComposerInput.js.map +1 -0
  29. package/dist/components/composer/ComposerNotice.d.ts +38 -0
  30. package/dist/components/composer/ComposerNotice.d.ts.map +1 -0
  31. package/dist/components/composer/ComposerNotice.js +16 -0
  32. package/dist/components/composer/ComposerNotice.js.map +1 -0
  33. package/dist/components/composer/MentionMenu.d.ts +37 -0
  34. package/dist/components/composer/MentionMenu.d.ts.map +1 -0
  35. package/dist/components/composer/MentionMenu.js +55 -0
  36. package/dist/components/composer/MentionMenu.js.map +1 -0
  37. package/dist/components/composer/MenuPanel.d.ts +49 -0
  38. package/dist/components/composer/MenuPanel.d.ts.map +1 -0
  39. package/dist/components/composer/MenuPanel.js +50 -0
  40. package/dist/components/composer/MenuPanel.js.map +1 -0
  41. package/dist/components/composer/ModelPicker.d.ts +40 -0
  42. package/dist/components/composer/ModelPicker.d.ts.map +1 -0
  43. package/dist/components/composer/ModelPicker.js +115 -0
  44. package/dist/components/composer/ModelPicker.js.map +1 -0
  45. package/dist/components/composer/PermissionPicker.d.ts +31 -0
  46. package/dist/components/composer/PermissionPicker.d.ts.map +1 -0
  47. package/dist/components/composer/PermissionPicker.js +43 -0
  48. package/dist/components/composer/PermissionPicker.js.map +1 -0
  49. package/dist/components/composer/SendStopButton.d.ts +71 -0
  50. package/dist/components/composer/SendStopButton.d.ts.map +1 -0
  51. package/dist/components/composer/SendStopButton.js +87 -0
  52. package/dist/components/composer/SendStopButton.js.map +1 -0
  53. package/dist/components/composer/SlashCommandMenu.d.ts +33 -0
  54. package/dist/components/composer/SlashCommandMenu.d.ts.map +1 -0
  55. package/dist/components/composer/SlashCommandMenu.js +43 -0
  56. package/dist/components/composer/SlashCommandMenu.js.map +1 -0
  57. package/dist/components/composer/composer-text.d.ts +10 -0
  58. package/dist/components/composer/composer-text.d.ts.map +1 -0
  59. package/dist/components/composer/composer-text.js +26 -0
  60. package/dist/components/composer/composer-text.js.map +1 -0
  61. package/dist/components/composer/composer-utils.d.ts +74 -0
  62. package/dist/components/composer/composer-utils.d.ts.map +1 -0
  63. package/dist/components/composer/composer-utils.js +133 -0
  64. package/dist/components/composer/composer-utils.js.map +1 -0
  65. package/dist/components/conversation/ConversationList.d.ts +88 -0
  66. package/dist/components/conversation/ConversationList.d.ts.map +1 -0
  67. package/dist/components/conversation/ConversationList.js +81 -0
  68. package/dist/components/conversation/ConversationList.js.map +1 -0
  69. package/dist/components/conversation/ConversationRow.d.ts +66 -0
  70. package/dist/components/conversation/ConversationRow.d.ts.map +1 -0
  71. package/dist/components/conversation/ConversationRow.js +65 -0
  72. package/dist/components/conversation/ConversationRow.js.map +1 -0
  73. package/dist/components/conversation/conversation-status.d.ts +21 -0
  74. package/dist/components/conversation/conversation-status.d.ts.map +1 -0
  75. package/dist/components/conversation/conversation-status.js +33 -0
  76. package/dist/components/conversation/conversation-status.js.map +1 -0
  77. package/dist/components/intervention/ApprovalDiff.d.ts +14 -0
  78. package/dist/components/intervention/ApprovalDiff.d.ts.map +1 -0
  79. package/dist/components/intervention/ApprovalDiff.js +25 -0
  80. package/dist/components/intervention/ApprovalDiff.js.map +1 -0
  81. package/dist/components/intervention/ApprovalPanel.d.ts +57 -0
  82. package/dist/components/intervention/ApprovalPanel.d.ts.map +1 -0
  83. package/dist/components/intervention/ApprovalPanel.js +111 -0
  84. package/dist/components/intervention/ApprovalPanel.js.map +1 -0
  85. package/dist/components/intervention/ErrorRecoveryNotice.d.ts +28 -0
  86. package/dist/components/intervention/ErrorRecoveryNotice.d.ts.map +1 -0
  87. package/dist/components/intervention/ErrorRecoveryNotice.js +30 -0
  88. package/dist/components/intervention/ErrorRecoveryNotice.js.map +1 -0
  89. package/dist/components/intervention/GrantList.d.ts +49 -0
  90. package/dist/components/intervention/GrantList.d.ts.map +1 -0
  91. package/dist/components/intervention/GrantList.js +58 -0
  92. package/dist/components/intervention/GrantList.js.map +1 -0
  93. package/dist/components/intervention/InterventionDock.d.ts +24 -0
  94. package/dist/components/intervention/InterventionDock.d.ts.map +1 -0
  95. package/dist/components/intervention/InterventionDock.js +18 -0
  96. package/dist/components/intervention/InterventionDock.js.map +1 -0
  97. package/dist/components/intervention/QuestionnaireCard.d.ts +60 -0
  98. package/dist/components/intervention/QuestionnaireCard.d.ts.map +1 -0
  99. package/dist/components/intervention/QuestionnaireCard.js +322 -0
  100. package/dist/components/intervention/QuestionnaireCard.js.map +1 -0
  101. package/dist/components/intervention/action-lock.d.ts +20 -0
  102. package/dist/components/intervention/action-lock.d.ts.map +1 -0
  103. package/dist/components/intervention/action-lock.js +65 -0
  104. package/dist/components/intervention/action-lock.js.map +1 -0
  105. package/dist/components/intervention/icons.d.ts +8 -0
  106. package/dist/components/intervention/icons.d.ts.map +1 -0
  107. package/dist/components/intervention/icons.js +11 -0
  108. package/dist/components/intervention/icons.js.map +1 -0
  109. package/dist/components/intervention/questionnaire-answers.d.ts +29 -0
  110. package/dist/components/intervention/questionnaire-answers.d.ts.map +1 -0
  111. package/dist/components/intervention/questionnaire-answers.js +81 -0
  112. package/dist/components/intervention/questionnaire-answers.js.map +1 -0
  113. package/dist/components/message/AgentMessage.d.ts +98 -0
  114. package/dist/components/message/AgentMessage.d.ts.map +1 -0
  115. package/dist/components/message/AgentMessage.js +94 -0
  116. package/dist/components/message/AgentMessage.js.map +1 -0
  117. package/dist/components/message/CitationChip.d.ts +34 -0
  118. package/dist/components/message/CitationChip.d.ts.map +1 -0
  119. package/dist/components/message/CitationChip.js +30 -0
  120. package/dist/components/message/CitationChip.js.map +1 -0
  121. package/dist/components/message/CodeBlock.d.ts +45 -0
  122. package/dist/components/message/CodeBlock.d.ts.map +1 -0
  123. package/dist/components/message/CodeBlock.js +21 -0
  124. package/dist/components/message/CodeBlock.js.map +1 -0
  125. package/dist/components/message/JumpToLatest.d.ts +27 -0
  126. package/dist/components/message/JumpToLatest.d.ts.map +1 -0
  127. package/dist/components/message/JumpToLatest.js +17 -0
  128. package/dist/components/message/JumpToLatest.js.map +1 -0
  129. package/dist/components/message/Markdown.d.ts +21 -0
  130. package/dist/components/message/Markdown.d.ts.map +1 -0
  131. package/dist/components/message/Markdown.js +21 -0
  132. package/dist/components/message/Markdown.js.map +1 -0
  133. package/dist/components/message/MessageActions.d.ts +63 -0
  134. package/dist/components/message/MessageActions.d.ts.map +1 -0
  135. package/dist/components/message/MessageActions.js +83 -0
  136. package/dist/components/message/MessageActions.js.map +1 -0
  137. package/dist/components/message/MessageList.d.ts +100 -0
  138. package/dist/components/message/MessageList.d.ts.map +1 -0
  139. package/dist/components/message/MessageList.js +266 -0
  140. package/dist/components/message/MessageList.js.map +1 -0
  141. package/dist/components/message/MessagePart.d.ts +44 -0
  142. package/dist/components/message/MessagePart.d.ts.map +1 -0
  143. package/dist/components/message/MessagePart.js +146 -0
  144. package/dist/components/message/MessagePart.js.map +1 -0
  145. package/dist/components/message/RunDetails.d.ts +26 -0
  146. package/dist/components/message/RunDetails.d.ts.map +1 -0
  147. package/dist/components/message/RunDetails.js +113 -0
  148. package/dist/components/message/RunDetails.js.map +1 -0
  149. package/dist/components/message/SkillUseList.d.ts +22 -0
  150. package/dist/components/message/SkillUseList.d.ts.map +1 -0
  151. package/dist/components/message/SkillUseList.js +20 -0
  152. package/dist/components/message/SkillUseList.js.map +1 -0
  153. package/dist/components/message/ThinkingBlock.d.ts +44 -0
  154. package/dist/components/message/ThinkingBlock.d.ts.map +1 -0
  155. package/dist/components/message/ThinkingBlock.js +34 -0
  156. package/dist/components/message/ThinkingBlock.js.map +1 -0
  157. package/dist/components/message/icons.d.ts +14 -0
  158. package/dist/components/message/icons.d.ts.map +1 -0
  159. package/dist/components/message/icons.js +16 -0
  160. package/dist/components/message/icons.js.map +1 -0
  161. package/dist/components/message/plain-text.d.ts +11 -0
  162. package/dist/components/message/plain-text.d.ts.map +1 -0
  163. package/dist/components/message/plain-text.js +58 -0
  164. package/dist/components/message/plain-text.js.map +1 -0
  165. package/dist/components/message/renderers.d.ts +30 -0
  166. package/dist/components/message/renderers.d.ts.map +1 -0
  167. package/dist/components/message/renderers.js +2 -0
  168. package/dist/components/message/renderers.js.map +1 -0
  169. package/dist/components/message/use-copy.d.ts +18 -0
  170. package/dist/components/message/use-copy.d.ts.map +1 -0
  171. package/dist/components/message/use-copy.js +65 -0
  172. package/dist/components/message/use-copy.js.map +1 -0
  173. package/dist/components/process/AgentProcess.d.ts +47 -0
  174. package/dist/components/process/AgentProcess.d.ts.map +1 -0
  175. package/dist/components/process/AgentProcess.js +78 -0
  176. package/dist/components/process/AgentProcess.js.map +1 -0
  177. package/dist/components/process/RunStatus.d.ts +60 -0
  178. package/dist/components/process/RunStatus.d.ts.map +1 -0
  179. package/dist/components/process/RunStatus.js +34 -0
  180. package/dist/components/process/RunStatus.js.map +1 -0
  181. package/dist/components/shell/AgentEmptyState.d.ts +35 -0
  182. package/dist/components/shell/AgentEmptyState.d.ts.map +1 -0
  183. package/dist/components/shell/AgentEmptyState.js +20 -0
  184. package/dist/components/shell/AgentEmptyState.js.map +1 -0
  185. package/dist/components/shell/AgentHeader.d.ts +84 -0
  186. package/dist/components/shell/AgentHeader.d.ts.map +1 -0
  187. package/dist/components/shell/AgentHeader.js +38 -0
  188. package/dist/components/shell/AgentHeader.js.map +1 -0
  189. package/dist/components/shell/AgentShell.d.ts +138 -0
  190. package/dist/components/shell/AgentShell.d.ts.map +1 -0
  191. package/dist/components/shell/AgentShell.js +206 -0
  192. package/dist/components/shell/AgentShell.js.map +1 -0
  193. package/dist/components/shell/AgentSidePane.d.ts +54 -0
  194. package/dist/components/shell/AgentSidePane.d.ts.map +1 -0
  195. package/dist/components/shell/AgentSidePane.js +26 -0
  196. package/dist/components/shell/AgentSidePane.js.map +1 -0
  197. package/dist/components/shell/ResizeHandle.d.ts +50 -0
  198. package/dist/components/shell/ResizeHandle.d.ts.map +1 -0
  199. package/dist/components/shell/ResizeHandle.js +84 -0
  200. package/dist/components/shell/ResizeHandle.js.map +1 -0
  201. package/dist/components/shell/use-controllable.d.ts +9 -0
  202. package/dist/components/shell/use-controllable.d.ts.map +1 -0
  203. package/dist/components/shell/use-controllable.js +26 -0
  204. package/dist/components/shell/use-controllable.js.map +1 -0
  205. package/dist/components/tools/ChunkPager.d.ts +48 -0
  206. package/dist/components/tools/ChunkPager.d.ts.map +1 -0
  207. package/dist/components/tools/ChunkPager.js +68 -0
  208. package/dist/components/tools/ChunkPager.js.map +1 -0
  209. package/dist/components/tools/CodeModeToolTree.d.ts +64 -0
  210. package/dist/components/tools/CodeModeToolTree.d.ts.map +1 -0
  211. package/dist/components/tools/CodeModeToolTree.js +97 -0
  212. package/dist/components/tools/CodeModeToolTree.js.map +1 -0
  213. package/dist/components/tools/DiffPreview.d.ts +83 -0
  214. package/dist/components/tools/DiffPreview.d.ts.map +1 -0
  215. package/dist/components/tools/DiffPreview.js +95 -0
  216. package/dist/components/tools/DiffPreview.js.map +1 -0
  217. package/dist/components/tools/ToolActivity.d.ts +63 -0
  218. package/dist/components/tools/ToolActivity.d.ts.map +1 -0
  219. package/dist/components/tools/ToolActivity.js +45 -0
  220. package/dist/components/tools/ToolActivity.js.map +1 -0
  221. package/dist/components/tools/ToolDetails.d.ts +106 -0
  222. package/dist/components/tools/ToolDetails.d.ts.map +1 -0
  223. package/dist/components/tools/ToolDetails.js +247 -0
  224. package/dist/components/tools/ToolDetails.js.map +1 -0
  225. package/dist/components/tools/ToolHistory.d.ts +48 -0
  226. package/dist/components/tools/ToolHistory.d.ts.map +1 -0
  227. package/dist/components/tools/ToolHistory.js +37 -0
  228. package/dist/components/tools/ToolHistory.js.map +1 -0
  229. package/dist/components/tools/ToolOutput.d.ts +61 -0
  230. package/dist/components/tools/ToolOutput.d.ts.map +1 -0
  231. package/dist/components/tools/ToolOutput.js +45 -0
  232. package/dist/components/tools/ToolOutput.js.map +1 -0
  233. package/dist/components/tools/ToolRecord.d.ts +54 -0
  234. package/dist/components/tools/ToolRecord.d.ts.map +1 -0
  235. package/dist/components/tools/ToolRecord.js +78 -0
  236. package/dist/components/tools/ToolRecord.js.map +1 -0
  237. package/dist/components/tools/shared.d.ts +93 -0
  238. package/dist/components/tools/shared.d.ts.map +1 -0
  239. package/dist/components/tools/shared.js +160 -0
  240. package/dist/components/tools/shared.js.map +1 -0
  241. package/dist/components/workspace/ActivityLedger.d.ts +44 -0
  242. package/dist/components/workspace/ActivityLedger.d.ts.map +1 -0
  243. package/dist/components/workspace/ActivityLedger.js +63 -0
  244. package/dist/components/workspace/ActivityLedger.js.map +1 -0
  245. package/dist/components/workspace/CompactionNotice.d.ts +63 -0
  246. package/dist/components/workspace/CompactionNotice.d.ts.map +1 -0
  247. package/dist/components/workspace/CompactionNotice.js +36 -0
  248. package/dist/components/workspace/CompactionNotice.js.map +1 -0
  249. package/dist/components/workspace/ContextUsage.d.ts +44 -0
  250. package/dist/components/workspace/ContextUsage.d.ts.map +1 -0
  251. package/dist/components/workspace/ContextUsage.js +106 -0
  252. package/dist/components/workspace/ContextUsage.js.map +1 -0
  253. package/dist/components/workspace/PersistentTerminal.d.ts +86 -0
  254. package/dist/components/workspace/PersistentTerminal.d.ts.map +1 -0
  255. package/dist/components/workspace/PersistentTerminal.js +155 -0
  256. package/dist/components/workspace/PersistentTerminal.js.map +1 -0
  257. package/dist/components/workspace/PinnedSummary.d.ts +43 -0
  258. package/dist/components/workspace/PinnedSummary.d.ts.map +1 -0
  259. package/dist/components/workspace/PinnedSummary.js +33 -0
  260. package/dist/components/workspace/PinnedSummary.js.map +1 -0
  261. package/dist/components/workspace/RunSummary.d.ts +35 -0
  262. package/dist/components/workspace/RunSummary.d.ts.map +1 -0
  263. package/dist/components/workspace/RunSummary.js +46 -0
  264. package/dist/components/workspace/RunSummary.js.map +1 -0
  265. package/dist/components/workspace/SubAgentCard.d.ts +60 -0
  266. package/dist/components/workspace/SubAgentCard.d.ts.map +1 -0
  267. package/dist/components/workspace/SubAgentCard.js +73 -0
  268. package/dist/components/workspace/SubAgentCard.js.map +1 -0
  269. package/dist/components/workspace/TerminalRow.d.ts +51 -0
  270. package/dist/components/workspace/TerminalRow.d.ts.map +1 -0
  271. package/dist/components/workspace/TerminalRow.js +62 -0
  272. package/dist/components/workspace/TerminalRow.js.map +1 -0
  273. package/dist/components/workspace/shared.d.ts +22 -0
  274. package/dist/components/workspace/shared.d.ts.map +1 -0
  275. package/dist/components/workspace/shared.js +36 -0
  276. package/dist/components/workspace/shared.js.map +1 -0
  277. package/dist/index.d.ts +130 -0
  278. package/dist/index.d.ts.map +1 -0
  279. package/dist/index.js +76 -0
  280. package/dist/index.js.map +1 -0
  281. package/dist/motion/agent-motion.d.ts +62 -0
  282. package/dist/motion/agent-motion.d.ts.map +1 -0
  283. package/dist/motion/agent-motion.js +61 -0
  284. package/dist/motion/agent-motion.js.map +1 -0
  285. package/dist/primitives/AgentSpark.d.ts +17 -0
  286. package/dist/primitives/AgentSpark.d.ts.map +1 -0
  287. package/dist/primitives/AgentSpark.js +11 -0
  288. package/dist/primitives/AgentSpark.js.map +1 -0
  289. package/dist/primitives/AgentStatus.d.ts +32 -0
  290. package/dist/primitives/AgentStatus.d.ts.map +1 -0
  291. package/dist/primitives/AgentStatus.js +13 -0
  292. package/dist/primitives/AgentStatus.js.map +1 -0
  293. package/dist/primitives/StatusGlyph.d.ts +10 -0
  294. package/dist/primitives/StatusGlyph.d.ts.map +1 -0
  295. package/dist/primitives/StatusGlyph.js +31 -0
  296. package/dist/primitives/StatusGlyph.js.map +1 -0
  297. package/dist/primitives/icons.d.ts +7 -0
  298. package/dist/primitives/icons.d.ts.map +1 -0
  299. package/dist/primitives/icons.js +55 -0
  300. package/dist/primitives/icons.js.map +1 -0
  301. package/dist/provider/AgentMessages.d.ts +51 -0
  302. package/dist/provider/AgentMessages.d.ts.map +1 -0
  303. package/dist/provider/AgentMessages.js +77 -0
  304. package/dist/provider/AgentMessages.js.map +1 -0
  305. package/dist/provider/messages/composer.d.ts +90 -0
  306. package/dist/provider/messages/composer.d.ts.map +1 -0
  307. package/dist/provider/messages/composer.js +155 -0
  308. package/dist/provider/messages/composer.js.map +1 -0
  309. package/dist/provider/messages/intervention.d.ts +135 -0
  310. package/dist/provider/messages/intervention.d.ts.map +1 -0
  311. package/dist/provider/messages/intervention.js +321 -0
  312. package/dist/provider/messages/intervention.js.map +1 -0
  313. package/dist/provider/messages/message.d.ts +118 -0
  314. package/dist/provider/messages/message.d.ts.map +1 -0
  315. package/dist/provider/messages/message.js +224 -0
  316. package/dist/provider/messages/message.js.map +1 -0
  317. package/dist/provider/messages/shell.d.ts +70 -0
  318. package/dist/provider/messages/shell.d.ts.map +1 -0
  319. package/dist/provider/messages/shell.js +109 -0
  320. package/dist/provider/messages/shell.js.map +1 -0
  321. package/dist/provider/messages/status.d.ts +20 -0
  322. package/dist/provider/messages/status.d.ts.map +1 -0
  323. package/dist/provider/messages/status.js +195 -0
  324. package/dist/provider/messages/status.js.map +1 -0
  325. package/dist/provider/messages/tools.d.ts +210 -0
  326. package/dist/provider/messages/tools.d.ts.map +1 -0
  327. package/dist/provider/messages/tools.js +482 -0
  328. package/dist/provider/messages/tools.js.map +1 -0
  329. package/dist/provider/messages/workspace.d.ts +176 -0
  330. package/dist/provider/messages/workspace.d.ts.map +1 -0
  331. package/dist/provider/messages/workspace.js +325 -0
  332. package/dist/provider/messages/workspace.js.map +1 -0
  333. package/dist/styles/artifact.css +564 -0
  334. package/dist/styles/base.css +220 -0
  335. package/dist/styles/composer.css +1001 -0
  336. package/dist/styles/conversation.css +275 -0
  337. package/dist/styles/intervention.css +929 -0
  338. package/dist/styles/message.css +917 -0
  339. package/dist/styles/process.css +207 -0
  340. package/dist/styles/shell.css +441 -0
  341. package/dist/styles/tools.css +929 -0
  342. package/dist/styles/workspace.css +1294 -0
  343. package/dist/utils/cx.d.ts +3 -0
  344. package/dist/utils/cx.d.ts.map +1 -0
  345. package/dist/utils/cx.js +5 -0
  346. package/dist/utils/cx.js.map +1 -0
  347. package/package.json +64 -3
@@ -0,0 +1,37 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import * as React from 'react';
4
+ import { Collapsible } from '@wzrhine/react';
5
+ import { useAgentMessages } from '../../provider/AgentMessages.js';
6
+ import { cx } from '../../utils/cx.js';
7
+ import { ToolRecord } from './ToolRecord.js';
8
+ import { ActionButton, Notice } from './shared.js';
9
+ /**
10
+ * Append-only order for paged history: rows already shown keep their position; new ids are
11
+ * appended (sorted by `sequence` among themselves). Duplicates — the same id on two pages, or a
12
+ * live row replayed into history — are dropped; the latest data for a known id replaces its
13
+ * content but not its place.
14
+ */
15
+ export function useStableOrder(items) {
16
+ const order = React.useRef([]);
17
+ const latest = new Map();
18
+ for (const item of items)
19
+ if (!latest.has(item.id))
20
+ latest.set(item.id, item);
21
+ const known = new Set(order.current);
22
+ const added = [...latest.values()].filter((t) => !known.has(t.id));
23
+ if (added.every((t) => typeof t.sequence === 'number'))
24
+ added.sort((a, b) => a.sequence - b.sequence);
25
+ const ids = [...order.current.filter((id) => latest.has(id)), ...added.map((t) => t.id)];
26
+ React.useEffect(() => {
27
+ order.current = ids;
28
+ });
29
+ return ids.map((id) => latest.get(id));
30
+ }
31
+ export const ToolHistory = React.forwardRef(function ToolHistory({ items, total, hasMore, loading, error, onLoadMore, onOpenOperation, expanded, defaultExpanded = false, onExpandedChange, title, onLoadDetails, renderDetail, detailActions, detailsErrors, className, ...rest }, ref) {
32
+ const m = useAgentMessages().tools;
33
+ const rows = useStableOrder(items);
34
+ const countText = total != null ? m.historyTotal(rows.length, total) : m.historyLoaded(rows.length);
35
+ return (_jsx("div", { ...rest, ref: ref, className: cx('rl-agent-history', className), children: _jsx(Collapsible, { open: expanded, defaultOpen: defaultExpanded, onOpenChange: onExpandedChange, trigger: _jsxs("span", { className: "rl-agent-history__header", children: [_jsx("span", { className: "rl-agent-history__title", children: title ?? m.historyTitle }), _jsx("span", { className: "rl-agent-history__count", children: countText })] }), triggerProps: { className: 'rl-agent-history__trigger' }, children: _jsxs("div", { className: "rl-agent-history__body", "aria-busy": loading || undefined, children: [rows.length === 0 && !loading && !error && _jsx("p", { className: "rl-agent-detail__aside", children: m.historyEmpty }), rows.length > 0 && (_jsx("ul", { className: "rl-agent-tool-list", "aria-label": m.historyList, children: rows.map((tool) => (_jsx("li", { className: "rl-agent-tool-list__item", children: _jsx(ToolRecord, { tool: tool, onLoadDetails: onLoadDetails, detailsError: detailsErrors?.[tool.id], renderDetail: renderDetail, detailActions: detailActions, actions: onOpenOperation && (_jsx("button", { type: "button", className: "rl-agent-tool-button", "aria-label": `${m.openOperation} · ${tool.displayName ?? tool.name}${tool.subject ? ` ${tool.subject}` : ''}`, onClick: () => onOpenOperation(tool.id), children: _jsx("span", { className: "rl-agent-tool-button__text", children: m.openOperation }) })) }) }, tool.id))) })), _jsx("p", { className: "rl-agent-history__status", role: "status", children: loading ? m.historyLoading : '' }), error != null && error !== false && _jsx(Notice, { tone: "danger", children: error === true ? m.historyError : error }), hasMore && onLoadMore && (_jsx("div", { className: "rl-agent-detail__actions", children: _jsx(ActionButton, { icon: "arrow-down", onClick: onLoadMore, busy: loading, children: m.historyLoadMore }) }))] }) }) }));
36
+ });
37
+ //# sourceMappingURL=ToolHistory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ToolHistory.js","sourceRoot":"","sources":["../../../src/components/tools/ToolHistory.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,EAAE,EAAE,MAAM,mBAAmB,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAEnD;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAAC,KAA8B;IAC3D,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,CAAW,EAAE,CAAC,CAAC;IACzC,MAAM,MAAM,GAAG,IAAI,GAAG,EAAwB,CAAC;IAC/C,KAAK,MAAM,IAAI,IAAI,KAAK;QAAE,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;YAAE,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,E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ToolOutputView } from '@wzrhine/agent-core';
3
+ import type { ChunkPagerActions } from './ChunkPager.js';
4
+ /**
5
+ * ToolOutput (atlas 45): bounded preview of one tool output. The body never grows past
6
+ * `--rl-agent-output-max-height`; it scrolls inside a focusable, named region so keyboard users
7
+ * can scroll it and the page never overflows. Text stays selectable; the copy button copies the
8
+ * loaded portion only.
9
+ *
10
+ * Truncation is never conflated (ADR-0011 §5):
11
+ * - `display` → 「仅显示部分输出」 + `onLoadMore` / `onOpenFull` (only rendered when given);
12
+ * - `execution` → 「工具输出已达上限,结果本身被截断」: nothing more exists to load.
13
+ *
14
+ * `status: 'loading'` shows a skeleton inside an `aria-busy` container; `unavailable` says so
15
+ * instead of pretending the output is empty. With `page` (stored material read page by page) the
16
+ * body is a `ChunkPager` instead of the inline preview; `pager` carries its callbacks.
17
+ * No motion of its own.
18
+ */
19
+ export type ToolOutputProps = Omit<React.HTMLAttributes<HTMLElement>, 'children'> & {
20
+ output: ToolOutputView;
21
+ /** Heading text; defaults to the kind label (「终端输出」, 「JSON」…). */
22
+ label?: React.ReactNode;
23
+ /** Name of the scroll region; defaults to the label text. */
24
+ regionLabel?: string;
25
+ /** Load the next display chunk (`truncated: 'display'`). */
26
+ onLoadMore?: () => void;
27
+ /** Open the full output elsewhere (`truncated: 'display'`). */
28
+ onOpenFull?: () => void;
29
+ /** Busy state for `onLoadMore`. */
30
+ loadingMore?: boolean;
31
+ /** Replace the clipboard write (tests, host clipboards). */
32
+ onCopyText?: (text: string) => void | Promise<void>;
33
+ /** Hide the copy button. */
34
+ copyable?: boolean;
35
+ /** One page of the stored output; replaces the inline body with a `ChunkPager`. */
36
+ page?: MaterialPageView;
37
+ /** Paging callbacks for `page` (`canGoBack` defaults to false). */
38
+ pager?: Partial<ChunkPagerActions>;
39
+ };
40
+ export declare const ToolOutput: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<HTMLElement>, "children"> & {
41
+ output: ToolOutputView;
42
+ /** Heading text; defaults to the kind label (「终端输出」, 「JSON」…). */
43
+ label?: React.ReactNode;
44
+ /** Name of the scroll region; defaults to the label text. */
45
+ regionLabel?: string;
46
+ /** Load the next display chunk (`truncated: 'display'`). */
47
+ onLoadMore?: () => void;
48
+ /** Open the full output elsewhere (`truncated: 'display'`). */
49
+ onOpenFull?: () => void;
50
+ /** Busy state for `onLoadMore`. */
51
+ loadingMore?: boolean;
52
+ /** Replace the clipboard write (tests, host clipboards). */
53
+ onCopyText?: (text: string) => void | Promise<void>;
54
+ /** Hide the copy button. */
55
+ copyable?: boolean;
56
+ /** One page of the stored output; replaces the inline body with a `ChunkPager`. */
57
+ page?: MaterialPageView;
58
+ /** Paging callbacks for `page` (`canGoBack` defaults to false). */
59
+ pager?: Partial<ChunkPagerActions>;
60
+ } & React.RefAttributes<HTMLElement>>;
61
+ //# sourceMappingURL=ToolOutput.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ToolOutput.d.ts","sourceRoot":"","sources":["../../../src/components/tools/ToolOutput.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAK5E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAGzD;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,UAAU,CAAC,GAAG;IAClF,MAAM,EAAE,cAAc,CAAC;IACvB,kEAAkE;IAClE,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,6DAA6D;IAC7D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,4DAA4D;IAC5D,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,+DAA+D;IAC/D,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,mCAAmC;IACnC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,4DAA4D;IAC5D,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACpD,4BAA4B;IAC5B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,mFAAmF;IACnF,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACxB,mEAAmE;IACnE,KAAK,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAC;CACpC,CAAC;AAEF,eAAO,MAAM,UAAU;YArBb,cAAc;IACtB,kEAAkE;YAC1D,KAAK,CAAC,SAAS;IACvB,6DAA6D;kBAC/C,MAAM;IACpB,4DAA4D;iBAC/C,MAAM,IAAI;IACvB,+DAA+D;iBAClD,MAAM,IAAI;IACvB,mCAAmC;kBACrB,OAAO;IACrB,4DAA4D;iBAC/C,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IACnD,4BAA4B;eACjB,OAAO;IAClB,mFAAmF;WAC5E,gBAAgB;IACvB,mEAAmE;YAC3D,OAAO,CAAC,iBAAiB,CAAC;qCA8GlC,CAAC"}
@@ -0,0 +1,45 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
+ import * as React from 'react';
4
+ import { Skeleton } from '@wzrhine/react';
5
+ import { useAgentFormat, useAgentMessages } from '../../provider/AgentMessages.js';
6
+ import { cx } from '../../utils/cx.js';
7
+ import { ChunkPager } from './ChunkPager.js';
8
+ import { ActionButton, CopyButton, Notice, prettyJson } from './shared.js';
9
+ export const ToolOutput = React.forwardRef(function ToolOutput({ output, label, regionLabel, onLoadMore, onOpenFull, loadingMore, onCopyText, copyable = true, page, pager, className, ...rest }, ref) {
10
+ const m = useAgentMessages().tools;
11
+ const fmt = useAgentFormat();
12
+ const noticeId = React.useId();
13
+ const kind = output.kind;
14
+ const heading = label ?? (kind === 'empty' ? m.outputLabel : m.outputKind[kind]);
15
+ const name = regionLabel ?? (typeof heading === 'string' ? heading : m.outputLabel);
16
+ const loading = output.status === 'loading';
17
+ const unavailable = output.status === 'unavailable';
18
+ const raw = output.content ?? '';
19
+ const text = kind === 'json' ? prettyJson(raw) : raw;
20
+ const empty = kind === 'empty' || (!loading && !unavailable && raw === '' && !output.error);
21
+ let body;
22
+ if (page) {
23
+ body = _jsx(ChunkPager, { ...pager, page: page, label: name, canGoBack: pager?.canGoBack ?? false });
24
+ }
25
+ else if (loading) {
26
+ body = (_jsxs("div", { className: "rl-agent-output__loading", "aria-busy": "true", children: [_jsx(Skeleton, { shape: "text", lines: 3 }), _jsx("span", { className: "rl-agent-sr", children: m.outputLoading })] }));
27
+ }
28
+ else if (unavailable) {
29
+ body = _jsx("p", { className: "rl-agent-output__placeholder", children: output.error ?? m.outputUnavailable });
30
+ }
31
+ else if (empty) {
32
+ body = _jsx("p", { className: "rl-agent-output__placeholder", children: m.emptyOutput });
33
+ }
34
+ else if (kind === 'list') {
35
+ const items = text.split('\n').filter((line) => line.trim() !== '');
36
+ body = (_jsx("div", { className: "rl-agent-output__scroll", role: "region", tabIndex: 0, "aria-label": name, children: _jsx("ul", { className: "rl-agent-output__list", children: items.map((item, i) => (_jsx("li", { children: item }, i))) }) }));
37
+ }
38
+ else {
39
+ body = (_jsxs("div", { className: "rl-agent-output__scroll", role: "region", tabIndex: 0, "aria-label": name, children: [kind === 'error' && output.error && _jsx("p", { className: "rl-agent-output__error", children: output.error }), text !== '' && (_jsx("pre", { className: "rl-agent-output__pre", "data-wrap": kind === 'text' || kind === 'error' || undefined, children: _jsx("code", { children: text }) }))] }));
40
+ }
41
+ const showCopy = copyable && !loading && !unavailable && !empty && text !== '' && !page;
42
+ const pageText = page?.status === 'ready' ? (page.content ?? '') : '';
43
+ return (_jsxs("div", { ...rest, ref: ref, role: "group", className: cx('rl-agent-output', className), "data-kind": kind, "data-status": output.status, "data-truncated": output.truncated, "aria-label": name, children: [_jsxs("header", { className: "rl-agent-output__header", children: [_jsx("span", { className: "rl-agent-output__kind", children: heading }), output.summary && _jsx("span", { className: "rl-agent-output__summary", children: output.summary }), output.total != null && output.totalUnit && (_jsx("span", { className: "rl-agent-output__total", children: m.outputTotal(fmt.number(output.total), output.totalUnit) })), output.status === 'partial' && !output.truncated && _jsx("span", { className: "rl-agent-output__total", children: m.outputStreaming }), showCopy && _jsx(CopyButton, { text: text, onCopyText: onCopyText, className: "rl-agent-output__copy" }), copyable && page && pageText !== '' && _jsx(CopyButton, { text: pageText, onCopyText: onCopyText, className: "rl-agent-output__copy" })] }), kind !== 'error' && output.error && !unavailable && _jsx(Notice, { tone: "danger", children: output.error }), body, !page && output.truncated === 'display' && (_jsx(Notice, { tone: "info", id: noticeId, action: (onLoadMore || onOpenFull) && (_jsxs(_Fragment, { children: [onLoadMore && (_jsx(ActionButton, { icon: "arrow-down", onClick: onLoadMore, busy: loadingMore, describedBy: noticeId, children: m.loadMore })), onOpenFull && (_jsx(ActionButton, { icon: "external", onClick: onOpenFull, describedBy: noticeId, children: m.openFull }))] })), children: m.truncatedDisplay })), output.truncated === 'execution' && _jsx(Notice, { tone: "warning", children: m.truncatedExecution })] }));
44
+ });
45
+ //# sourceMappingURL=ToolOutput.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ToolOutput.js","sourceRoot":"","sources":["../../../src/components/tools/ToolOutput.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnF,OAAO,EAAE,EAAE,EAAE,MAAM,mBAAmB,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MA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C,MAAM,IAAC,IAAI,EAAC,SAAS,YAAE,CAAC,CAAC,kBAAkB,GAAU,IACvF,CACP,CAAC;AACJ,CAAC,CAAC,CAAC"}
@@ -0,0 +1,54 @@
1
+ import * as React from 'react';
2
+ import type { ToolCallView } from '@wzrhine/agent-core';
3
+ import type { ToolDetailActions } from './ToolDetails.js';
4
+ /**
5
+ * ToolRecord (atlas 12): one tool call. The whole row is the disclosure trigger (a real
6
+ * `<button>` from `@wzrhine/react` Collapsible, `aria-expanded` / `aria-controls`) whose
7
+ * accessible name reads category, name, subject, summary, status and elapsed time. The raw tool
8
+ * name is in the name's `title` and in the details.
9
+ *
10
+ * Details mount on first open (the panel is unmounted while closed). When
11
+ * `tool.detailsLoaded === false`, opening calls `onLoadDetails(id)` once and shows a skeleton in
12
+ * an `aria-busy` container until the adapter delivers the record; `detailsError` shows the
13
+ * failure with a retry that calls `onLoadDetails` again. A summary is never presented as the full
14
+ * record. The expanded state lives here (or in `expanded` / `onExpandedChange`) and survives any
15
+ * status change. Height animates through Collapsible (CSS, interruptible, instant when reduced);
16
+ * the row itself has no layout animation.
17
+ */
18
+ export type ToolRecordProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> & {
19
+ tool: ToolCallView;
20
+ expanded?: boolean;
21
+ defaultExpanded?: boolean;
22
+ onExpandedChange?: (expanded: boolean, id: string) => void;
23
+ /** Called when the row opens and `tool.detailsLoaded === false`, and on retry. */
24
+ onLoadDetails?: (id: string) => void;
25
+ /** Loading the full record failed (shown with a retry when `onLoadDetails` exists). */
26
+ detailsError?: React.ReactNode;
27
+ /** Override the detail body. Return `undefined` to fall back to the built-in view. */
28
+ renderDetail?: (tool: ToolCallView) => React.ReactNode | undefined;
29
+ /** Callbacks for the built-in detail views (read more, reload, open terminal…). */
30
+ detailActions?: ToolDetailActions;
31
+ /** Controls placed next to the row (outside the trigger button), e.g. 「在对话中定位」. */
32
+ actions?: React.ReactNode;
33
+ /** Extra content at the end of the details (e.g. Code Mode script). */
34
+ detailsFooter?: React.ReactNode;
35
+ };
36
+ export declare const ToolRecord: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<HTMLDivElement>, "children"> & {
37
+ tool: ToolCallView;
38
+ expanded?: boolean;
39
+ defaultExpanded?: boolean;
40
+ onExpandedChange?: (expanded: boolean, id: string) => void;
41
+ /** Called when the row opens and `tool.detailsLoaded === false`, and on retry. */
42
+ onLoadDetails?: (id: string) => void;
43
+ /** Loading the full record failed (shown with a retry when `onLoadDetails` exists). */
44
+ detailsError?: React.ReactNode;
45
+ /** Override the detail body. Return `undefined` to fall back to the built-in view. */
46
+ renderDetail?: (tool: ToolCallView) => React.ReactNode | undefined;
47
+ /** Callbacks for the built-in detail views (read more, reload, open terminal…). */
48
+ detailActions?: ToolDetailActions;
49
+ /** Controls placed next to the row (outside the trigger button), e.g. 「在对话中定位」. */
50
+ actions?: React.ReactNode;
51
+ /** Extra content at the end of the details (e.g. Code Mode script). */
52
+ detailsFooter?: React.ReactNode;
53
+ } & React.RefAttributes<HTMLDivElement>>;
54
+ //# sourceMappingURL=ToolRecord.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ToolRecord.d.ts","sourceRoot":"","sources":["../../../src/components/tools/ToolRecord.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAMxD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAG1D;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC,GAAG;IACrF,IAAI,EAAE,YAAY,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3D,kFAAkF;IAClF,aAAa,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,uFAAuF;IACvF,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC/B,sFAAsF;IACtF,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,KAAK,CAAC,SAAS,GAAG,SAAS,CAAC;IACnE,mFAAmF;IACnF,aAAa,CAAC,EAAE,iBAAiB,CAAC;IAClC,mFAAmF;IACnF,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,uEAAuE;IACvE,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CACjC,CAAC;AAEF,eAAO,MAAM,UAAU;UAlBf,YAAY;eACP,OAAO;sBACA,OAAO;uBACN,CAAC,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,KAAK,IAAI;IAC1D,kFAAkF;oBAClE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI;IACpC,uFAAuF;mBACxE,KAAK,CAAC,SAAS;IAC9B,sFAAsF;mBACvE,CAAC,IAAI,EAAE,YAAY,KAAK,KAAK,CAAC,SAAS,GAAG,SAAS;IAClE,mFAAmF;oBACnE,iBAAiB;IACjC,mFAAmF;cACzE,KAAK,CAAC,SAAS;IACzB,uEAAuE;oBACvD,KAAK,CAAC,SAAS;wCAqH/B,CAAC"}
@@ -0,0 +1,78 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import * as React from 'react';
4
+ import { toolStatusMeta } from '@wzrhine/agent-core';
5
+ import { Collapsible, Skeleton } from '@wzrhine/react';
6
+ import { useAgentFormat, useAgentMessages } from '../../provider/AgentMessages.js';
7
+ import { cx } from '../../utils/cx.js';
8
+ import { ToolDetail } from './ToolDetails.js';
9
+ import { ActionButton, ToolCategoryChip, Notice, ToolStatusPill } from './shared.js';
10
+ export const ToolRecord = React.forwardRef(function ToolRecord({ tool, expanded, defaultExpanded = false, onExpandedChange, onLoadDetails, detailsError, renderDetail, detailActions, actions, detailsFooter, className, ...rest }, ref) {
11
+ const messages = useAgentMessages();
12
+ const m = messages.tools;
13
+ const fmt = useAgentFormat();
14
+ const [innerOpen, setInnerOpen] = React.useState(defaultExpanded);
15
+ const open = expanded ?? innerOpen;
16
+ const requested = React.useRef(false);
17
+ const needsLoad = tool.detailsLoaded === false;
18
+ // One request per row while the record is missing; StrictMode-safe via the ref.
19
+ React.useEffect(() => {
20
+ if (!needsLoad) {
21
+ requested.current = false;
22
+ return;
23
+ }
24
+ if (open && !requested.current && onLoadDetails && detailsError == null) {
25
+ requested.current = true;
26
+ onLoadDetails(tool.id);
27
+ }
28
+ }, [open, needsLoad, onLoadDetails, detailsError, tool.id]);
29
+ const setOpen = (next) => {
30
+ if (expanded === undefined)
31
+ setInnerOpen(next);
32
+ onExpandedChange?.(next, tool.id);
33
+ };
34
+ const category = tool.category ?? 'other';
35
+ const name = tool.displayName ?? tool.name;
36
+ const statusLabel = messages.status.tool[tool.status] ?? tool.status;
37
+ const elapsed = tool.elapsedMs != null ? fmt.duration(tool.elapsedMs) : undefined;
38
+ const label = m.rowLabel({
39
+ category: messages.status.category[category],
40
+ name,
41
+ subject: tool.subject,
42
+ summary: tool.summary,
43
+ status: statusLabel,
44
+ elapsed: elapsed ? messages.status.elapsed(elapsed) : undefined,
45
+ });
46
+ const meta = toolStatusMeta[tool.status] ?? toolStatusMeta.unknown;
47
+ const trigger = (_jsxs("span", { className: "rl-agent-tool-row", children: [_jsx(ToolCategoryChip, { category: category, className: "rl-agent-tool-row__chip" }), _jsxs("span", { className: "rl-agent-tool-row__main", children: [_jsx("span", { className: "rl-agent-tool-row__name", title: tool.name, children: name }), tool.subject && (_jsx("span", { className: "rl-agent-tool-row__subject", title: tool.subject, children: tool.subject })), tool.summary && _jsx("span", { className: "rl-agent-tool-row__summary", children: tool.summary })] }), _jsxs("span", { className: "rl-agent-tool-row__status", children: [_jsx(ToolStatusPill, { status: tool.status }), elapsed && _jsx("span", { className: "rl-agent-tool-row__elapsed", children: elapsed })] })] }));
48
+ return (_jsx("div", { ...rest, ref: ref, className: cx('rl-agent-tool', className), "data-status": tool.status, "data-category": category, "data-active": meta.active || undefined, "data-tool-id": tool.id, children: _jsxs("div", { className: "rl-agent-tool__head", children: [_jsx(Collapsible, { className: "rl-agent-tool__disclosure", open: open, onOpenChange: setOpen, trigger: trigger, triggerProps: {
49
+ className: 'rl-agent-tool__trigger',
50
+ 'aria-label': label,
51
+ }, panelClassName: "rl-agent-tool__panel", children: _jsx(ToolRecordDetails, { tool: tool, name: name, needsLoad: needsLoad, detailsError: detailsError, onRetry: onLoadDetails ? () => onLoadDetails(tool.id) : undefined, renderDetail: renderDetail, detailActions: detailActions, footer: detailsFooter }) }), actions != null && _jsx("div", { className: "rl-agent-tool__actions", children: actions })] }) }));
52
+ });
53
+ function ToolRecordDetails({ tool, name, needsLoad, detailsError, onRetry, renderDetail, detailActions, footer, }) {
54
+ const messages = useAgentMessages();
55
+ const m = messages.tools;
56
+ const auth = tool.authorization;
57
+ let body;
58
+ if (needsLoad && detailsError != null) {
59
+ body = (_jsx(Notice, { tone: "danger", action: onRetry && (_jsx(ActionButton, { icon: "retry", onClick: onRetry, children: m.retry })), children: detailsError === true || detailsError === '' ? m.detailsError : detailsError }));
60
+ }
61
+ else if (needsLoad) {
62
+ body = (_jsxs("div", { className: "rl-agent-tool__loading", "aria-busy": "true", children: [_jsx(Skeleton, { shape: "text", lines: 3 }), _jsx("p", { className: "rl-agent-tool__loading-text", role: "status", children: m.loadingDetails })] }));
63
+ }
64
+ else {
65
+ const custom = renderDetail?.(tool);
66
+ body =
67
+ custom !== undefined ? (custom) : tool.detail ? (_jsx(ToolDetail, { tool: tool, ...detailActions })) : (_jsx("p", { className: "rl-agent-detail__aside", children: m.noDetails }));
68
+ }
69
+ const receipt = tool.receipt && tool.receipt.status !== 'idle' ? tool.receipt : undefined;
70
+ return (_jsxs("div", { className: "rl-agent-tool__details", role: "group", "aria-label": m.detailsRegion(name), children: [_jsxs("p", { className: "rl-agent-tool__facts", children: [_jsx("code", { className: "rl-agent-tool__raw", title: m.rawName(tool.name), children: tool.name }), auth && _jsx("span", { className: "rl-agent-tool__auth", children: m.authorization(m.authorizationDecision[auth.decision], auth.source) })] }), body, receipt && (_jsxs(Notice, { tone: receipt.status === 'unknown'
71
+ ? 'warning'
72
+ : receipt.status === 'rejected'
73
+ ? 'danger'
74
+ : receipt.status === 'accepted'
75
+ ? 'success'
76
+ : 'info', children: [m.receipt[receipt.status], receipt.reason ? ` · ${receipt.reason}` : ''] })), footer] }));
77
+ }
78
+ //# sourceMappingURL=ToolRecord.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ToolRecord.js","sourceRoot":"","sources":["../../../src/components/tools/ToolRecord.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnF,OAAO,EAAE,EAAE,EAAE,MAAM,mBAAmB,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAmCrF,MAAM,CAAC,MAAM,UAAU,GAAG,KAAK,CAAC,UAAU,CAAkC,SAAS,UAAU,CAC7F,EACE,IAAI,EACJ,QAAQ,EACR,eAAe,GAAG,KAAK,EACvB,gBAAgB,EAChB,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,OAAO,EACP,aAAa,EACb,SAAS,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C,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;IAC1F,OAAO,CACL,eAAK,SAAS,EAAC,wBAAwB,EAAC,IAAI,EAAC,OAAO,gBAAa,CAAC,CAAC,aAAa,CAAC,IAAI,CAAC,aACpF,aAAG,SAAS,EAAC,sBAAsB,aACjC,eAAM,SAAS,EAAC,oBAAoB,EAAC,KAAK,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,YAC7D,IAAI,CAAC,IAAI,GACL,EACN,IAAI,IAAI,eAAM,SAAS,EAAC,qBAAqB,YAAE,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,qBAAqB,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,GAAQ,IAC1H,EACH,IAAI,EACJ,OAAO,IAAI,CACV,MAAC,MAAM,IACL,IAAI,EACF,OAAO,CAAC,MAAM,KAAK,SAAS;oBAC1B,CAAC,CAAC,SAAS;oBACX,CAAC,CAAC,OAAO,CAAC,MAAM,KAAK,UAAU;wBAC7B,CAAC,CAAC,QAAQ;wBACV,CAAC,CAAC,OAAO,CAAC,MAAM,KAAK,UAAU;4BAC7B,CAAC,CAAC,SAAS;4BACX,CAAC,CAAC,MAAM,aAGf,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,EACzB,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,IACtC,CACV,EACA,MAAM,IACH,CACP,CAAC;AACJ,CAAC"}
@@ -0,0 +1,93 @@
1
+ import * as React from 'react';
2
+ import type { AgentTone, StatusGlyphName, ToolCategory, ToolStatus } from '@wzrhine/agent-core';
3
+ import type { AgentIconName } from '../../primitives/icons.js';
4
+ /** Icon + tone per tool category. Tone is never the only signal: the chip always has text. */
5
+ export declare const categoryMeta: Record<ToolCategory, {
6
+ icon: AgentIconName;
7
+ tone: AgentTone | 'ink';
8
+ }>;
9
+ export declare function ToolCategoryChip({ category, className }: {
10
+ category?: ToolCategory;
11
+ className?: string;
12
+ }): React.JSX.Element;
13
+ /** Status pill for a tool status: glyph + shared label (+ meta). */
14
+ export declare function ToolStatusPill({ status, meta, appearance, }: {
15
+ status: ToolStatus;
16
+ meta?: React.ReactNode;
17
+ appearance?: 'pill' | 'inline';
18
+ }): React.JSX.Element;
19
+ /** Plain glyph + tone + label pill for local enums (diff status, execution state…). */
20
+ export declare function Pill({ glyph, tone, label, active, }: {
21
+ glyph: StatusGlyphName;
22
+ tone: AgentTone;
23
+ label: React.ReactNode;
24
+ active?: boolean;
25
+ }): React.JSX.Element;
26
+ /** Copy text to the clipboard. `onCopyText` replaces the default `navigator.clipboard` write. */
27
+ export declare function CopyButton({ text, label, onCopyText, className, }: {
28
+ text: string;
29
+ /** Accessible name; defaults to 「复制」. */
30
+ label?: string;
31
+ onCopyText?: (text: string) => void | Promise<void>;
32
+ className?: string;
33
+ }): React.JSX.Element;
34
+ /** Small text button used for in-detail actions (load more, reload, open terminal). */
35
+ export declare function ActionButton({ children, icon, onClick, tone, disabled, busy, describedBy, }: {
36
+ children: React.ReactNode;
37
+ icon?: AgentIconName;
38
+ onClick: () => void;
39
+ tone?: 'accent' | 'neutral';
40
+ disabled?: boolean;
41
+ busy?: boolean;
42
+ describedBy?: string;
43
+ }): React.JSX.Element;
44
+ /**
45
+ * Bounded, horizontally scrollable code view. Optional line numbers start at `startLine` and are
46
+ * `aria-hidden` + unselectable, so copying the code never copies the gutter. The scroller is a
47
+ * focusable named region, so keyboard users can scroll it.
48
+ */
49
+ export declare function CodeView({ code, label, startLine, tone, className, }: {
50
+ code: string;
51
+ label: string;
52
+ /** Show a line-number gutter starting at this 1-based line. */
53
+ startLine?: number;
54
+ tone?: 'surface' | 'inverse';
55
+ className?: string;
56
+ }): React.JSX.Element;
57
+ export interface MetaEntry {
58
+ label: React.ReactNode;
59
+ value: React.ReactNode;
60
+ mono?: boolean;
61
+ }
62
+ /** Key/value facts of a detail view (`<dl>`); entries with an empty value are dropped. */
63
+ export declare function MetaList({ items, label, className, }: {
64
+ items: Array<MetaEntry | false | null | undefined | ''>;
65
+ label?: string;
66
+ className?: string;
67
+ }): React.JSX.Element | null;
68
+ /** One-line notice inside a detail: icon + text, toned. Not a live region. */
69
+ export declare function Notice({ tone, children, action, id, }: {
70
+ tone?: 'neutral' | 'info' | 'warning' | 'danger' | 'success';
71
+ children: React.ReactNode;
72
+ action?: React.ReactNode;
73
+ id?: string;
74
+ }): React.JSX.Element;
75
+ /** Pretty-print JSON content; anything that does not parse is returned untouched. */
76
+ export declare function prettyJson(content: string): string;
77
+ /** Serialise an arbitrary value for display (strings stay as-is unless they hold JSON). */
78
+ export declare function toDisplayJson(value: unknown): string;
79
+ /** Maximum number of rows that still get an entrance when they arrive together. */
80
+ export declare const ENTRANCE_BATCH_LIMIT = 20;
81
+ /**
82
+ * Tracks which ids appeared after the first render. Returns, per id, its index within the batch
83
+ * that just arrived (for stagger) or `-1` for rows present at mount / already seen. Batches larger
84
+ * than `ENTRANCE_BATCH_LIMIT` get no entrance at all (history restore, page loads).
85
+ */
86
+ export declare function useFreshIndex(ids: readonly string[]): (id: string) => number;
87
+ /** Statuses that mean "still moving". */
88
+ export declare const ACTIVE_TOOL_STATUSES: readonly ToolStatus[];
89
+ export declare const FAILED_TOOL_STATUSES: readonly ToolStatus[];
90
+ /** Fixed display order for aggregated status counts. */
91
+ export declare const TOOL_STATUS_ORDER: readonly ToolStatus[];
92
+ export declare function countStatuses(statuses: readonly ToolStatus[]): Array<[ToolStatus, number]>;
93
+ //# sourceMappingURL=shared.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../src/components/tools/shared.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,YAAY,EAAE,U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I,CAAC,EAAE,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAC;IAC7D,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,EAAE,CAAC,EAAE,MAAM,CAAC;CACb,qBAWA;AAED,qFAAqF;AACrF,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAMlD;AAED,2FAA2F;AAC3F,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAQpD;AAED,mFAAmF;AACnF,eAAO,MAAM,oBAAoB,KAAK,CAAC;AAEvC;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,SAAS,MAAM,EAAE,GAAG,CAAC,EAAE,EAAE,MAAM,KAAK,MAAM,CAU5E;AAED,yCAAyC;AACzC,eAAO,MAAM,oBAAoB,EAAE,SAAS,UAAU,EAAkF,CAAC;AACzI,eAAO,MAAM,oBAAoB,EAAE,SAAS,UAAU,EAAsC,CAAC;AAE7F,wDAAwD;AACxD,eAAO,MAAM,iBAAiB,EAAE,SAAS,UAAU,EAalD,CAAC;AAEF,wBAAgB,aAAa,CAAC,QAAQ,EAAE,SAAS,UAAU,EAAE,GAAG,KAAK,CAAC,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,CAI1F"}
@@ -0,0 +1,160 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import * as React from 'react';
4
+ import { toolStatusMeta } from '@wzrhine/agent-core';
5
+ import { useAgentMessages } from '../../provider/AgentMessages.js';
6
+ import { AgentIcon } from '../../primitives/icons.js';
7
+ import { AgentStatus } from '../../primitives/AgentStatus.js';
8
+ import { cx } from '../../utils/cx.js';
9
+ /*
10
+ * Small building blocks shared by the tools family: category chip, copy button, bounded code
11
+ * view, key/value list, inline notice and the "fresh rows" tracker that decides which rows get a
12
+ * first entrance. Internal to the family (only the types that leak into public props are exported
13
+ * from the package entry).
14
+ */
15
+ /** Icon + tone per tool category. Tone is never the only signal: the chip always has text. */
16
+ export const categoryMeta = {
17
+ read: { icon: 'file', tone: 'info' },
18
+ write: { icon: 'edit', tone: 'accent' },
19
+ execute: { icon: 'terminal', tone: 'ink' },
20
+ network: { icon: 'globe', tone: 'info' },
21
+ model: { icon: 'model', tone: 'neutral' },
22
+ agent: { icon: 'agent', tone: 'neutral' },
23
+ question: { icon: 'question', tone: 'neutral' },
24
+ other: { icon: 'tool', tone: 'neutral' },
25
+ };
26
+ export function ToolCategoryChip({ category = 'other', className }) {
27
+ const m = useAgentMessages();
28
+ const meta = categoryMeta[category] ?? categoryMeta.other;
29
+ return (_jsxs("span", { className: cx('rl-agent-tool-chip', className), "data-category": category, "data-tone": meta.tone, children: [_jsx(AgentIcon, { name: meta.icon }), _jsx("span", { className: "rl-agent-tool-chip__label", children: m.status.category[category] ?? m.status.category.other })] }));
30
+ }
31
+ /** Status pill for a tool status: glyph + shared label (+ meta). */
32
+ export function ToolStatusPill({ status, meta, appearance, }) {
33
+ const m = useAgentMessages();
34
+ const s = toolStatusMeta[status] ?? toolStatusMeta.unknown;
35
+ return (_jsx(AgentStatus, { glyph: s.glyph, tone: s.tone, active: s.active, label: m.status.tool[status] ?? status, meta: meta, appearance: appearance }));
36
+ }
37
+ /** Plain glyph + tone + label pill for local enums (diff status, execution state…). */
38
+ export function Pill({ glyph, tone, label, active, }) {
39
+ return _jsx(AgentStatus, { glyph: glyph, tone: tone, label: label, active: active });
40
+ }
41
+ /** Copy text to the clipboard. `onCopyText` replaces the default `navigator.clipboard` write. */
42
+ export function CopyButton({ text, label, onCopyText, className, }) {
43
+ const m = useAgentMessages().tools;
44
+ const [state, setState] = React.useState('idle');
45
+ const timer = React.useRef(undefined);
46
+ React.useEffect(() => () => clearTimeout(timer.current), []);
47
+ const copy = async () => {
48
+ try {
49
+ if (onCopyText)
50
+ await onCopyText(text);
51
+ else if (typeof navigator !== 'undefined' && navigator.clipboard)
52
+ await navigator.clipboard.writeText(text);
53
+ else
54
+ throw new Error('clipboard unavailable');
55
+ setState('copied');
56
+ }
57
+ catch {
58
+ setState('failed');
59
+ }
60
+ clearTimeout(timer.current);
61
+ // Reset the visible confirmation; the status text stays announced once.
62
+ timer.current = setTimeout(() => setState('idle'), 2000);
63
+ };
64
+ const name = label ?? m.copy;
65
+ return (_jsxs("span", { className: cx('rl-agent-copy', className), children: [_jsxs("button", { type: "button", className: "rl-agent-tool-button", "data-size": "sm", "aria-label": name, title: name, onClick: () => void copy(), children: [_jsx(AgentIcon, { name: state === 'copied' ? 'check' : 'copy' }), _jsx("span", { className: "rl-agent-tool-button__text", "aria-hidden": "true", children: state === 'copied' ? m.copied : state === 'failed' ? m.copyFailed : m.copy })] }), _jsx("span", { className: "rl-agent-sr", role: "status", children: state === 'copied' ? m.copied : state === 'failed' ? m.copyFailed : '' })] }));
66
+ }
67
+ /** Small text button used for in-detail actions (load more, reload, open terminal). */
68
+ export function ActionButton({ children, icon, onClick, tone, disabled, busy, describedBy, }) {
69
+ return (_jsxs("button", { type: "button", className: "rl-agent-tool-button", "data-tone": tone, disabled: disabled, "aria-busy": busy || undefined, "aria-disabled": busy || undefined, "aria-describedby": describedBy, onClick: busy ? undefined : onClick, children: [icon && _jsx(AgentIcon, { name: icon }), _jsx("span", { className: "rl-agent-tool-button__text", children: children })] }));
70
+ }
71
+ /**
72
+ * Bounded, horizontally scrollable code view. Optional line numbers start at `startLine` and are
73
+ * `aria-hidden` + unselectable, so copying the code never copies the gutter. The scroller is a
74
+ * focusable named region, so keyboard users can scroll it.
75
+ */
76
+ export function CodeView({ code, label, startLine, tone = 'surface', className, }) {
77
+ const lines = React.useMemo(() => code.replace(/\r\n/g, '\n').split('\n'), [code]);
78
+ return (_jsx("div", { className: cx('rl-agent-code', className), "data-tone": tone, role: "region", tabIndex: 0, "aria-label": label, children: _jsx("pre", { className: "rl-agent-code__pre", children: _jsx("code", { children: startLine != null
79
+ ? lines.map((line, i) => (_jsxs("span", { className: "rl-agent-code__line", children: [_jsx("span", { className: "rl-agent-code__ln", "aria-hidden": "true", children: startLine + i }), _jsx("span", { className: "rl-agent-code__text", children: line }), i < lines.length - 1 ? '\n' : null] }, i)))
80
+ : code }) }) }));
81
+ }
82
+ /** Key/value facts of a detail view (`<dl>`); entries with an empty value are dropped. */
83
+ export function MetaList({ items, label, className, }) {
84
+ const shown = items.filter((x) => !!x && x.value != null && x.value !== '' && x.value !== false);
85
+ if (shown.length === 0)
86
+ return null;
87
+ return (_jsx("dl", { className: cx('rl-agent-tool-meta', className), "aria-label": label, children: shown.map((item, i) => (_jsxs("div", { className: "rl-agent-tool-meta__item", children: [_jsx("dt", { children: item.label }), _jsx("dd", { "data-mono": item.mono || undefined, children: item.value })] }, i))) }));
88
+ }
89
+ /** One-line notice inside a detail: icon + text, toned. Not a live region. */
90
+ export function Notice({ tone = 'neutral', children, action, id, }) {
91
+ const icon = tone === 'warning' || tone === 'danger' ? 'warning' : tone === 'success' ? 'check' : 'info';
92
+ return (_jsxs("div", { className: "rl-agent-notice", "data-tone": tone, children: [_jsx(AgentIcon, { name: icon }), _jsx("p", { className: "rl-agent-notice__text", id: id, children: children }), action != null && _jsx("span", { className: "rl-agent-notice__action", children: action })] }));
93
+ }
94
+ /** Pretty-print JSON content; anything that does not parse is returned untouched. */
95
+ export function prettyJson(content) {
96
+ try {
97
+ return JSON.stringify(JSON.parse(content), null, 2);
98
+ }
99
+ catch {
100
+ return content;
101
+ }
102
+ }
103
+ /** Serialise an arbitrary value for display (strings stay as-is unless they hold JSON). */
104
+ export function toDisplayJson(value) {
105
+ if (value === undefined)
106
+ return '';
107
+ if (typeof value === 'string')
108
+ return prettyJson(value);
109
+ try {
110
+ return JSON.stringify(value, null, 2) ?? String(value);
111
+ }
112
+ catch {
113
+ return String(value);
114
+ }
115
+ }
116
+ /** Maximum number of rows that still get an entrance when they arrive together. */
117
+ export const ENTRANCE_BATCH_LIMIT = 20;
118
+ /**
119
+ * Tracks which ids appeared after the first render. Returns, per id, its index within the batch
120
+ * that just arrived (for stagger) or `-1` for rows present at mount / already seen. Batches larger
121
+ * than `ENTRANCE_BATCH_LIMIT` get no entrance at all (history restore, page loads).
122
+ */
123
+ export function useFreshIndex(ids) {
124
+ const known = React.useRef(null);
125
+ if (known.current === null)
126
+ known.current = new Set(ids);
127
+ const seen = known.current;
128
+ const fresh = ids.filter((id) => !seen.has(id));
129
+ React.useEffect(() => {
130
+ for (const id of ids)
131
+ seen.add(id);
132
+ });
133
+ const allow = fresh.length > 0 && fresh.length <= ENTRANCE_BATCH_LIMIT;
134
+ return (id) => (allow ? fresh.indexOf(id) : -1);
135
+ }
136
+ /** Statuses that mean "still moving". */
137
+ export const ACTIVE_TOOL_STATUSES = ['queued', 'running', 'waiting-approval', 'waiting-user', 'waiting-children'];
138
+ export const FAILED_TOOL_STATUSES = ['failed', 'denied', 'timed-out'];
139
+ /** Fixed display order for aggregated status counts. */
140
+ export const TOOL_STATUS_ORDER = [
141
+ 'running',
142
+ 'queued',
143
+ 'waiting-approval',
144
+ 'waiting-user',
145
+ 'waiting-children',
146
+ 'unknown',
147
+ 'failed',
148
+ 'timed-out',
149
+ 'denied',
150
+ 'partial',
151
+ 'cancelled',
152
+ 'completed',
153
+ ];
154
+ export function countStatuses(statuses) {
155
+ const counts = new Map();
156
+ for (const s of statuses)
157
+ counts.set(s, (counts.get(s) ?? 0) + 1);
158
+ return TOOL_STATUS_ORDER.filter((s) => counts.has(s)).map((s) => [s, counts.get(s)]);
159
+ }
160
+ //# sourceMappingURL=shared.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared.js","sourceRoot":"","sources":["../../../src/components/tools/shared.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE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