@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,74 @@
1
+ import type { ActionStatus, CommandOption, DraftStatus, MentionOption, RunStatus, TriggerChar } from '@wzrhine/agent-core';
2
+ /** DOM id of option `index` in the listbox `listboxId` (used by aria-activedescendant). */
3
+ export declare function menuOptionId(listboxId: string, index: number): string;
4
+ /**
5
+ * Next active index for ↑ / ↓. Clamped at both ends (no wrap-around), so holding a key never
6
+ * jumps from the last option back to the first. Disabled options stay reachable: their reason is
7
+ * read out when active. Returns -1 for an empty list.
8
+ */
9
+ export declare function moveActiveIndex(count: number, index: number, delta: number): number;
10
+ /** Splits an `@` query into the drilled folder prefix (`src/components/`) and the filter (`but`). */
11
+ export declare function splitMentionQuery(query: string): {
12
+ directory: string;
13
+ filter: string;
14
+ };
15
+ /** Query after drilling into a folder option: `src/` + `components/`. */
16
+ export declare function drillQuery(query: string, option: MentionOption): string;
17
+ /** Default token name for a mention: the drilled folder prefix + the option label (`src/agent.ts`). */
18
+ export declare function defaultMentionTokenName(option: MentionOption, query: string): string;
19
+ /** Case-insensitive filter over label and detail, using the filter part of the query. */
20
+ export declare function filterMentionOptions(options: readonly MentionOption[], query: string): MentionOption[];
21
+ /** Matches name, aliases, label and description; exact name / alias matches come first. */
22
+ export declare function filterCommandOptions(options: readonly CommandOption[], query: string): CommandOption[];
23
+ /** Commands (and actions) first, then skills, keeping the host order inside each kind. */
24
+ export declare function orderCommandOptions(options: readonly CommandOption[]): CommandOption[];
25
+ export interface OptionGroup<T> {
26
+ key: string;
27
+ label: string | undefined;
28
+ items: Array<{
29
+ option: T;
30
+ index: number;
31
+ }>;
32
+ }
33
+ /** Groups consecutive options by `group(option)`, keeping their flat index for keyboard state. */
34
+ export declare function groupOptions<T>(options: readonly T[], group: (option: T) => string | undefined): OptionGroup<T>[];
35
+ /** Removes every `trigger + name` token (and one adjacent space) from a value. */
36
+ export declare function removeTokens(value: string, trigger: TriggerChar, name: string): string;
37
+ /** Thumbnails are only drawn from `data:image/`, `blob:` or same-origin URLs handed in by the host. */
38
+ export declare function isSafeThumbnail(url: string | undefined, origin?: string): boolean;
39
+ /** Visible state of the persistent send / stop button (ADR-0011 §3–4). */
40
+ export type SendStopState = 'send' | 'sending' | 'send-unknown' | 'retry-save' | 'stop' | 'stop-pending' | 'stop-unknown';
41
+ export interface SendStopInput {
42
+ canSend: boolean;
43
+ /** Explicit mode; otherwise derived from `runStatus`. */
44
+ mode?: 'send' | 'stop';
45
+ runStatus?: RunStatus;
46
+ /** Receipt of the last send. */
47
+ sendStatus?: ActionStatus;
48
+ /** Receipt of the last stop request. */
49
+ stopStatus?: ActionStatus;
50
+ draftStatus?: DraftStatus;
51
+ hasSend: boolean;
52
+ hasStop: boolean;
53
+ hasRetry: boolean;
54
+ /** From the unknown receipt: whether retrying the same action is safe (default true). */
55
+ retryable?: boolean;
56
+ hasRetrySave: boolean;
57
+ }
58
+ export interface SendStopResolved {
59
+ state: SendStopState;
60
+ /** Whether activating the button does something right now. */
61
+ enabled: boolean;
62
+ /** Which callback an activation calls. */
63
+ action: 'send' | 'stop' | 'retry' | 'retry-save' | null;
64
+ /** Icon shown: arrow or square. */
65
+ icon: 'send' | 'stop';
66
+ }
67
+ /**
68
+ * Decides the button state. "Stop sent" ≠ "stopped": while the run is `cancelling` or the stop
69
+ * request is in flight / accepted but the run still runs, the button is `stop-pending` (inert).
70
+ * Unknown receipts never look like success and never create a new action: they offer the retry
71
+ * callback (same actionId, host-owned) when it is safe, otherwise stay inert.
72
+ */
73
+ export declare function resolveSendStop(input: SendStopInput): SendStopResolved;
74
+ //# sourceMappingURL=composer-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"composer-utils.d.ts","sourceRoot":"","sources":["../../../src/components/composer/composer-utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,WAAW,EAAE,aAAa,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAO3H,2FAA2F;AAC3F,wBAAgB,YAAY,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAErE;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAInF;AAED,qGAAqG;AACrG,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,MAAM,EA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;AAED,0EAA0E;AAC1E,MAAM,MAAM,aAAa,GACrB,MAAM,GACN,SAAS,GACT,cAAc,GACd,YAAY,GACZ,MAAM,GACN,cAAc,GACd,cAAc,CAAC;AAEnB,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,yDAAyD;IACzD,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,gCAAgC;IAChC,UAAU,CAAC,EAAE,YAAY,CAAC;IAC1B,wCAAwC;IACxC,UAAU,CAAC,EAAE,YAAY,CAAC;IAC1B,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;IAClB,yFAAyF;IACzF,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,YAAY,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,aAAa,CAAC;IACrB,8DAA8D;IAC9D,OAAO,EAAE,OAAO,CAAC;IACjB,0CAA0C;IAC1C,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,YAAY,GAAG,IAAI,CAAC;IACxD,mCAAmC;IACnC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;CACvB;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,aAAa,GAAG,gBAAgB,CAqBtE"}
@@ -0,0 +1,133 @@
1
+ import { canStopRun, encodeToken } from '@wzrhine/agent-core';
2
+ /*
3
+ * Pure helpers for the composer family (no React). Hosts may use the filters for local option
4
+ * lists; remote lists are filtered by the host in `onMentionQuery` / `onCommandQuery`.
5
+ */
6
+ /** DOM id of option `index` in the listbox `listboxId` (used by aria-activedescendant). */
7
+ export function menuOptionId(listboxId, index) {
8
+ return `${listboxId}-option-${index}`;
9
+ }
10
+ /**
11
+ * Next active index for ↑ / ↓. Clamped at both ends (no wrap-around), so holding a key never
12
+ * jumps from the last option back to the first. Disabled options stay reachable: their reason is
13
+ * read out when active. Returns -1 for an empty list.
14
+ */
15
+ export function moveActiveIndex(count, index, delta) {
16
+ if (count <= 0)
17
+ return -1;
18
+ if (index < 0)
19
+ return delta > 0 ? 0 : count - 1;
20
+ return Math.max(0, Math.min(count - 1, index + delta));
21
+ }
22
+ /** Splits an `@` query into the drilled folder prefix (`src/components/`) and the filter (`but`). */
23
+ export function splitMentionQuery(query) {
24
+ const slash = query.lastIndexOf('/');
25
+ return slash === -1 ? { directory: '', filter: query } : { directory: query.slice(0, slash + 1), filter: query.slice(slash + 1) };
26
+ }
27
+ /** Query after drilling into a folder option: `src/` + `components/`. */
28
+ export function drillQuery(query, option) {
29
+ return `${splitMentionQuery(query).directory}${option.label}/`;
30
+ }
31
+ /** Default token name for a mention: the drilled folder prefix + the option label (`src/agent.ts`). */
32
+ export function defaultMentionTokenName(option, query) {
33
+ return `${splitMentionQuery(query).directory}${option.label}`;
34
+ }
35
+ /** Case-insensitive filter over label and detail, using the filter part of the query. */
36
+ export function filterMentionOptions(options, query) {
37
+ const needle = splitMentionQuery(query).filter.toLowerCase();
38
+ if (!needle)
39
+ return [...options];
40
+ return options.filter((o) => o.label.toLowerCase().includes(needle) || (o.detail ?? '').toLowerCase().includes(needle));
41
+ }
42
+ /** Matches name, aliases, label and description; exact name / alias matches come first. */
43
+ export function filterCommandOptions(options, query) {
44
+ const needle = query.toLowerCase();
45
+ if (!needle)
46
+ return [...options];
47
+ const hits = options.filter((o) => [o.name, o.label, o.description ?? '', ...(o.aliases ?? [])].some((text) => text.toLowerCase().includes(needle)));
48
+ const exact = (o) => o.name.toLowerCase() === needle || (o.aliases ?? []).some((a) => a.toLowerCase() === needle);
49
+ return [...hits.filter(exact), ...hits.filter((o) => !exact(o))];
50
+ }
51
+ /** Commands (and actions) first, then skills, keeping the host order inside each kind. */
52
+ export function orderCommandOptions(options) {
53
+ return [...options.filter((o) => o.kind !== 'skill'), ...options.filter((o) => o.kind === 'skill')];
54
+ }
55
+ /** Groups consecutive options by `group(option)`, keeping their flat index for keyboard state. */
56
+ export function groupOptions(options, group) {
57
+ const groups = [];
58
+ options.forEach((option, index) => {
59
+ const label = group(option);
60
+ const last = groups[groups.length - 1];
61
+ if (last && last.label === label)
62
+ last.items.push({ option, index });
63
+ else
64
+ groups.push({ key: `${groups.length}-${label ?? ''}`, label, items: [{ option, index }] });
65
+ });
66
+ return groups;
67
+ }
68
+ /** Removes every `trigger + name` token (and one adjacent space) from a value. */
69
+ export function removeTokens(value, trigger, name) {
70
+ const token = encodeToken(trigger, name);
71
+ let out = value;
72
+ for (;;) {
73
+ const at = out.indexOf(token);
74
+ if (at === -1)
75
+ return out;
76
+ let start = at;
77
+ let end = at + token.length;
78
+ if (out[end] === ' ')
79
+ end += 1;
80
+ else if (start > 0 && out[start - 1] === ' ')
81
+ start -= 1;
82
+ out = out.slice(0, start) + out.slice(end);
83
+ }
84
+ }
85
+ /** Thumbnails are only drawn from `data:image/`, `blob:` or same-origin URLs handed in by the host. */
86
+ export function isSafeThumbnail(url, origin) {
87
+ if (!url)
88
+ return false;
89
+ if (/^data:image\//i.test(url) || /^blob:/i.test(url))
90
+ return true;
91
+ if (/^[a-z][a-z\d+.-]*:/i.test(url) || url.startsWith('//')) {
92
+ if (!origin)
93
+ return false;
94
+ try {
95
+ return new URL(url).origin === origin;
96
+ }
97
+ catch {
98
+ return false;
99
+ }
100
+ }
101
+ // Relative URL: same origin by definition.
102
+ return true;
103
+ }
104
+ /**
105
+ * Decides the button state. "Stop sent" ≠ "stopped": while the run is `cancelling` or the stop
106
+ * request is in flight / accepted but the run still runs, the button is `stop-pending` (inert).
107
+ * Unknown receipts never look like success and never create a new action: they offer the retry
108
+ * callback (same actionId, host-owned) when it is safe, otherwise stay inert.
109
+ */
110
+ export function resolveSendStop(input) {
111
+ const stoppable = input.mode === 'stop' || (input.mode === undefined && input.runStatus !== undefined && (canStopRun(input.runStatus) || input.runStatus === 'cancelling'));
112
+ if (stoppable && (input.hasStop || input.runStatus === 'cancelling' || input.stopStatus !== undefined)) {
113
+ if (input.runStatus === 'cancelling' || input.stopStatus === 'submitting' || input.stopStatus === 'accepted') {
114
+ return { state: 'stop-pending', enabled: false, action: null, icon: 'stop' };
115
+ }
116
+ if (input.stopStatus === 'unknown') {
117
+ const canRetry = input.hasRetry && input.retryable !== false;
118
+ return { state: 'stop-unknown', enabled: canRetry, action: canRetry ? 'retry' : null, icon: 'stop' };
119
+ }
120
+ return { state: 'stop', enabled: input.hasStop, action: input.hasStop ? 'stop' : null, icon: 'stop' };
121
+ }
122
+ if (input.sendStatus === 'submitting')
123
+ return { state: 'sending', enabled: false, action: null, icon: 'send' };
124
+ if (input.sendStatus === 'unknown') {
125
+ const canRetry = input.hasRetry && input.retryable !== false;
126
+ return { state: 'send-unknown', enabled: canRetry, action: canRetry ? 'retry' : null, icon: 'send' };
127
+ }
128
+ if (input.draftStatus === 'error' && input.hasRetrySave)
129
+ return { state: 'retry-save', enabled: true, action: 'retry-save', icon: 'send' };
130
+ const enabled = input.canSend && input.hasSend && !stoppable;
131
+ return { state: 'send', enabled, action: enabled ? 'send' : null, icon: 'send' };
132
+ }
133
+ //# sourceMappingURL=composer-utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"composer-utils.js","sourceRoot":"","sources":["../../../src/components/composer/composer-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAG9D;;;GAGG;AAEH,2FAA2F;AAC3F,MAAM,UAAU,YAAY,CAAC,SAAiB,EAAE,KAAa;IAC3D,OAAO,GAAG,SAAS,WAAW,KAAK,EAAE,CAAC;AACxC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,KAAa,EAAE,KAAa,EAAE,KAAa;IACzE,IAAI,KAAK,IAAI,CAAC;QAAE,OAAO,CAAC,CAAC,CAA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,MAAM,EAAE,CAAC;IAC/G,IAAI,KAAK,CAAC,UAAU,KAAK,SAAS,EAAE,CAAC;QACnC,MAAM,QAAQ,GAAG,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,SAAS,KAAK,KAAK,CAAC;QAC7D,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;IACvG,CAAC;IACD,IAAI,KAAK,CAAC,WAAW,KAAK,OAAO,IAAI,KAAK,CAAC,YAAY;QAAE,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;IAC3I,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,OAAO,IAAI,CAAC,SAAS,CAAC;IAC7D,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;AACnF,CAAC"}
@@ -0,0 +1,88 @@
1
+ import * as React from 'react';
2
+ import type { ConversationSection, ConversationView } from '@wzrhine/agent-core';
3
+ import type { ConversationRowProps } from './ConversationRow.js';
4
+ /**
5
+ * ConversationList (atlas 03): grouped conversation index with search, selection and row actions.
6
+ *
7
+ * - Data in, actions out: `sections` are rendered as given (the host filters for `search`, sorts
8
+ * and dedupes); empty sections are skipped. Selection is `selectedId` + `onSelect`, nothing
9
+ * else: a background refresh (new `sections`) never changes the selection or moves focus.
10
+ * If the focused row disappears and focus fell back to `<body>`, focus moves to the nearest
11
+ * remaining row so keyboard users are not dropped at the top of the page.
12
+ * - Structure: each group is a heading (`headingLevel`, default h2) and a `<ul>` labelled by it;
13
+ * rows are `<li>` with real buttons. The viewport scrolls on its own.
14
+ * - Keyboard: one row is the Tab stop (the focused, else selected, else first row); ↑ / ↓ move
15
+ * focus between rows across groups, Home / End jump to the first / last row. Enter / Space
16
+ * select (native button). Tab from a row reaches its "more" button, then leaves the list.
17
+ * - Search: rendered only with `onSearchChange` (labelled `type="search"` input). The result
18
+ * count is announced through a polite status that is mounted before the query changes.
19
+ * - States: `loading` without items shows skeleton rows (`aria-busy`, sr text); with items it
20
+ * keeps them and marks the list busy. `error` shows an Alert with 「重试」 when `onRetry` is
21
+ * given. No items shows an EmptyState (search-empty when `search` is non-empty).
22
+ * - Motion: one shared selection ghost glides between rows via motion/react `layoutId`, scoped
23
+ * per instance with `useId` (two lists never trade ghosts), on `resolve('transform', 'base')`;
24
+ * under reduced motion it jumps. Rows themselves never animate layout, so 300 rows stay cheap.
25
+ */
26
+ export type ConversationListProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'onSelect' | 'children'> & {
27
+ sections: ConversationSection[];
28
+ selectedId?: string;
29
+ onSelect?: (id: string) => void;
30
+ /** Controlled search query; the host filters `sections`. */
31
+ search?: string;
32
+ /** Renders the search input. */
33
+ onSearchChange?: (query: string) => void;
34
+ loading?: boolean;
35
+ /** Error message; `true` uses the default copy. */
36
+ error?: React.ReactNode;
37
+ onRetry?: () => void;
38
+ /** Extra controls per row (rendered before the "more" menu). */
39
+ renderActions?: (item: ConversationView) => React.ReactNode;
40
+ onPin?: ConversationRowProps['onPin'];
41
+ onArchive?: ConversationRowProps['onArchive'];
42
+ onUnarchive?: ConversationRowProps['onUnarchive'];
43
+ onDelete?: ConversationRowProps['onDelete'];
44
+ /** Rows that cannot be selected or acted on (e.g. while a switch is pending). */
45
+ isDisabled?: (item: ConversationView) => boolean;
46
+ /** Level of the group headings (and the empty-state title). */
47
+ headingLevel?: 2 | 3 | 4 | 5 | 6;
48
+ /** Accessible name of the list region. */
49
+ label?: string;
50
+ /** Empty state shown when there are no conversations and no search. */
51
+ empty?: React.ReactNode;
52
+ /** Reference time for row timestamps (default: now). */
53
+ now?: Date;
54
+ /** Number of skeleton rows while loading. */
55
+ skeletonRows?: number;
56
+ };
57
+ export declare const ConversationList: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<HTMLDivElement>, "children" | "onSelect"> & {
58
+ sections: ConversationSection[];
59
+ selectedId?: string;
60
+ onSelect?: (id: string) => void;
61
+ /** Controlled search query; the host filters `sections`. */
62
+ search?: string;
63
+ /** Renders the search input. */
64
+ onSearchChange?: (query: string) => void;
65
+ loading?: boolean;
66
+ /** Error message; `true` uses the default copy. */
67
+ error?: React.ReactNode;
68
+ onRetry?: () => void;
69
+ /** Extra controls per row (rendered before the "more" menu). */
70
+ renderActions?: (item: ConversationView) => React.ReactNode;
71
+ onPin?: ConversationRowProps["onPin"];
72
+ onArchive?: ConversationRowProps["onArchive"];
73
+ onUnarchive?: ConversationRowProps["onUnarchive"];
74
+ onDelete?: ConversationRowProps["onDelete"];
75
+ /** Rows that cannot be selected or acted on (e.g. while a switch is pending). */
76
+ isDisabled?: (item: ConversationView) => boolean;
77
+ /** Level of the group headings (and the empty-state title). */
78
+ headingLevel?: 2 | 3 | 4 | 5 | 6;
79
+ /** Accessible name of the list region. */
80
+ label?: string;
81
+ /** Empty state shown when there are no conversations and no search. */
82
+ empty?: React.ReactNode;
83
+ /** Reference time for row timestamps (default: now). */
84
+ now?: Date;
85
+ /** Number of skeleton rows while loading. */
86
+ skeletonRows?: number;
87
+ } & React.RefAttributes<HTMLDivElement>>;
88
+ //# sourceMappingURL=ConversationList.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConversationList.d.ts","sourceRoot":"","sources":["../../../src/components/conversation/ConversationList.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAKjF,OAAO,KAAK,EAA8B,oBAAoB,EAAE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D,GAAG,CAAC,EAAE,IAAI,CAAC;IACX,6CAA6C;IAC7C,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAIF,eAAO,MAAM,gBAAgB;cAjCjB,mBAAmB,EAAE;iBAClB,MAAM;eACR,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI;IAC/B,4DAA4D;aACnD,MAAM;IACf,gCAAgC;qBACf,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI;cAC9B,OAAO;IACjB,mDAAmD;YAC3C,KAAK,CAAC,SAAS;cACb,MAAM,IAAI;IACpB,gEAAgE;oBAChD,CAAC,IAAI,EAAE,gBAAgB,KAAK,KAAK,CAAC,SAAS;YACnD,oBAAoB,CAAC,OAAO,CAAC;gBACzB,oBAAoB,CAAC,WAAW,CAAC;kBAC/B,oBAAoB,CAAC,aAAa,CAAC;eACtC,oBAAoB,CAAC,UAAU,CAAC;IAC3C,iFAAiF;iBACpE,CAAC,IAAI,EAAE,gBAAgB,KAAK,OAAO;IAChD,+DAA+D;mBAChD,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC;IAChC,0CAA0C;YAClC,MAAM;IACd,uEAAuE;YAC/D,KAAK,CAAC,SAAS;IACvB,wDAAwD;UAClD,IAAI;IACV,6CAA6C;mBAC9B,MAAM;wCAuMrB,CAAC"}
@@ -0,0 +1,81 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import * as React from 'react';
4
+ import { motion } from 'motion/react';
5
+ import { Alert, Button, EmptyState, Input, Skeleton } from '@wzrhine/react';
6
+ import { useAgentFormat, useAgentMessages } from '../../provider/AgentMessages.js';
7
+ import { AgentIcon } from '../../primitives/icons.js';
8
+ import { cx } from '../../utils/cx.js';
9
+ import { ConversationRow, ConversationRowContext } from './ConversationRow.js';
10
+ const ROW_SELECTOR = '.rl-agent-row__main';
11
+ export const ConversationList = React.forwardRef(function ConversationList({ sections, selectedId, onSelect, search, onSearchChange, loading = false, error, onRetry, renderActions, onPin, onArchive, onUnarchive, onDelete, isDisabled, headingLevel = 2, label, empty, now, skeletonRows = 5, className, ...rest }, ref) {
12
+ const shell = useAgentMessages().shell;
13
+ const format = useAgentFormat();
14
+ const uid = React.useId();
15
+ const searchId = `${uid}-search`;
16
+ const viewportRef = React.useRef(null);
17
+ const [focusedId, setFocusedId] = React.useState(null);
18
+ const lastFocused = React.useRef(null);
19
+ const visible = React.useMemo(() => sections.filter((section) => section.items.length > 0), [sections]);
20
+ const ids = React.useMemo(() => visible.flatMap((section) => section.items.map((item) => item.id)), [visible]);
21
+ const total = ids.length;
22
+ const query = search?.trim() ?? '';
23
+ const tabStopId = focusedId && ids.includes(focusedId) ? focusedId : selectedId && ids.includes(selectedId) ? selectedId : (ids[0] ?? null);
24
+ const rowContext = React.useMemo(() => ({
25
+ tabStopId,
26
+ ghostId: `${uid}-ghost`,
27
+ selectedId,
28
+ onFocusRow: (id) => {
29
+ setFocusedId(id);
30
+ lastFocused.current = { id, index: ids.indexOf(id) };
31
+ },
32
+ }), [tabStopId, uid, selectedId, ids]);
33
+ // A refresh that removed the focused row leaves focus on <body>: move it to the nearest row.
34
+ React.useEffect(() => {
35
+ const last = lastFocused.current;
36
+ if (!last || ids.includes(last.id))
37
+ return;
38
+ lastFocused.current = null;
39
+ if (typeof document === 'undefined' || (document.activeElement && document.activeElement !== document.body))
40
+ return;
41
+ const buttons = viewportRef.current?.querySelectorAll(`${ROW_SELECTOR}:not(:disabled)`);
42
+ if (!buttons || buttons.length === 0)
43
+ return;
44
+ buttons[Math.min(last.index, buttons.length - 1)]?.focus();
45
+ }, [ids]);
46
+ const onKeyDown = (event) => {
47
+ const viewport = viewportRef.current;
48
+ const target = event.target;
49
+ // Events from portalled menus bubble through React; only handle keys from rows in this list.
50
+ if (!viewport || !viewport.contains(target) || !target.closest('.rl-agent-row'))
51
+ return;
52
+ if (!['ArrowDown', 'ArrowUp', 'Home', 'End'].includes(event.key) || event.altKey || event.ctrlKey || event.metaKey)
53
+ return;
54
+ const buttons = Array.from(viewport.querySelectorAll(`${ROW_SELECTOR}:not(:disabled)`));
55
+ if (buttons.length === 0)
56
+ return;
57
+ const row = target.closest('.rl-agent-row');
58
+ const current = buttons.findIndex((button) => row?.contains(button));
59
+ let next = current;
60
+ if (event.key === 'ArrowDown')
61
+ next = current < 0 ? 0 : Math.min(current + 1, buttons.length - 1);
62
+ else if (event.key === 'ArrowUp')
63
+ next = current < 0 ? 0 : Math.max(current - 1, 0);
64
+ else if (event.key === 'Home')
65
+ next = 0;
66
+ else
67
+ next = buttons.length - 1;
68
+ event.preventDefault();
69
+ const button = buttons[next];
70
+ button?.focus();
71
+ button?.scrollIntoView?.({ block: 'nearest' });
72
+ };
73
+ const Heading = `h${headingLevel}`;
74
+ const showSkeleton = loading && total === 0 && !error;
75
+ const errorText = error === true ? shell.error : error;
76
+ return (_jsxs("div", { ...rest, ref: ref, className: cx('rl-agent-list', className), "data-loading": loading || undefined, children: [onSearchChange && (_jsxs("div", { className: "rl-agent-list__search", children: [_jsx("label", { htmlFor: searchId, className: "rl-agent-sr", children: shell.searchLabel }), _jsx(Input, { id: searchId, type: "search", size: "sm", value: search ?? '', placeholder: shell.searchPlaceholder, prefix: _jsx(AgentIcon, { name: "search" }), autoComplete: "off", onChange: (event) => onSearchChange(event.currentTarget.value) }), _jsx("span", { className: "rl-agent-sr", role: "status", children: query && !loading ? shell.searchResults(format.number(total)) : '' })] })), _jsxs(motion.div, { ref: viewportRef, layoutScroll: true, className: "rl-agent-list__viewport", role: "region", "aria-label": label ?? shell.listLabel, "aria-busy": loading || undefined, tabIndex: -1, onKeyDown: onKeyDown, children: [errorText != null && errorText !== false && (_jsx(Alert, { tone: "danger", className: "rl-agent-list__error", title: errorText, action: onRetry ? (_jsx(Button, { size: "sm", variant: "secondary", onClick: onRetry, children: shell.retry })) : undefined })), showSkeleton && (_jsxs("div", { className: "rl-agent-list__skeleton", children: [_jsx("span", { className: "rl-agent-sr", children: shell.loading }), Array.from({ length: skeletonRows }, (_, i) => (_jsxs("div", { className: "rl-agent-list__skeleton-row", "aria-hidden": "true", children: [_jsx(Skeleton, { shape: "circle", width: "var(--rl-icon-size-sm)" }), _jsx(Skeleton, { width: i % 2 ? '70%' : '85%' })] }, i)))] })), !showSkeleton && total === 0 && !errorText && (_jsx("div", { className: "rl-agent-list__empty", children: query ? (_jsx(EmptyState, { kind: "no-results", size: "sm", headingLevel: headingLevel, title: shell.searchEmptyTitle(query), description: shell.searchEmptyDescription })) : ((empty ?? _jsx(EmptyState, { kind: "first-use", size: "sm", headingLevel: headingLevel, title: shell.emptyTitle, description: shell.emptyDescription }))) })), _jsx(ConversationRowContext.Provider, { value: rowContext, children: visible.map((section) => {
77
+ const headingId = `${uid}-${section.id}`;
78
+ return (_jsxs("div", { className: "rl-agent-list__section", children: [_jsx(Heading, { id: headingId, className: "rl-agent-list__heading", children: section.label }), _jsx("ul", { className: "rl-agent-list__rows", "aria-labelledby": headingId, children: section.items.map((item) => (_jsx(ConversationRow, { item: item, selected: item.id === selectedId, disabled: isDisabled?.(item), onSelect: onSelect, onPin: onPin, onArchive: onArchive, onUnarchive: onUnarchive, onDelete: onDelete, actions: renderActions?.(item), now: now }, item.id))) })] }, section.id));
79
+ }) })] })] }));
80
+ });
81
+ //# sourceMappingURL=ConversationList.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConversationList.js","sourceRoot":"","sources":["../../../src/components/conversation/ConversationList.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE5E,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnF,OAAO,EAAE,SAAS,EA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AAO,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE;4BACvB,MAAM,SAAS,GAAG,GAAG,GAAG,IAAI,OAAO,CAAC,EAAE,EAAE,CAAC;4BACzC,OAAO,CACL,eAAsB,SAAS,EAAC,wBAAwB,aACtD,KAAC,OAAO,IAAC,EAAE,EAAE,SAAS,EAAE,SAAS,EAAC,wBAAwB,YACvD,OAAO,CAAC,KAAK,GACN,EACV,aAAI,SAAS,EAAC,qBAAqB,qBAAkB,SAAS,YAC3D,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAC3B,KAAC,eAAe,IAEd,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,IAAI,CAAC,EAAE,KAAK,UAAU,EAChC,QAAQ,EAAE,UAAU,EAAE,CAAC,IAAI,CAAC,EAC5B,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,SAAS,EACpB,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,aAAa,EAAE,CAAC,IAAI,CAAC,EAC9B,GAAG,EAAE,GAAG,IAVH,IAAI,CAAC,EAAE,CAWZ,CACH,CAAC,GACC,KApBG,OAAO,CAAC,EAAE,CAqBd,CACP,CAAC;wBACJ,CAAC,CAAC,GAC8B,IACvB,IACT,CACP,CAAC;AACJ,CAAC,CAAC,CAAC"}
@@ -0,0 +1,66 @@
1
+ import * as React from 'react';
2
+ import type { ConversationView } from '@wzrhine/agent-core';
3
+ /**
4
+ * ConversationRow (atlas 04): one conversation in the index.
5
+ *
6
+ * Structure: `<li>` with two sibling buttons, never nested: the main button selects the
7
+ * conversation (`aria-current="true"` when selected) and the "more" IconButton opens a Menu
8
+ * (@wzrhine/react). Because they are siblings, nothing in the menu bubbles into selection.
9
+ *
10
+ * - Accessible name of the main button = title + pinned + status + unread (joined with the
11
+ * locale separator); time and preview are its description. Status = glyph + text, never colour
12
+ * alone; settled runs (idle / completed / cancelled) draw nothing, attention (approval,
13
+ * question, children, error) always wins over the run status.
14
+ * - Running rows show a breathing glyph through the shared loop lifecycle (`useAgentLoop`), so
15
+ * off-screen rows, hidden pages and reduced motion keep it static; only active rows pay for it.
16
+ * - The title is one ellipsised line (full text in `title`); time and unread live in a fixed
17
+ * column, so a long title never pushes them out and an unread change never changes the height.
18
+ * - The "more" button is visible on hover / focus-within / while its menu is open (always on
19
+ * touch screens) and keeps its space reserved. A capability without a callback renders no item;
20
+ * with no item at all there is no button.
21
+ * - Archive is reversible, so it confirms inline: the first 「归档」 keeps the menu open and turns
22
+ * the item into 「确认归档」; closing the menu resets it. Delete is not reversible: it opens an
23
+ * AlertDialog; `onDelete` may return a Promise (the dialog waits, and stays open on rejection).
24
+ * - `disabled` disables both buttons.
25
+ */
26
+ export type ConversationRowProps = Omit<React.LiHTMLAttributes<HTMLLIElement>, 'onSelect' | 'title' | 'children'> & {
27
+ item: ConversationView;
28
+ selected?: boolean;
29
+ disabled?: boolean;
30
+ onSelect?: (id: string) => void;
31
+ /** Toggle pin; receives the requested state. */
32
+ onPin?: (item: ConversationView, pinned: boolean) => void;
33
+ onArchive?: (item: ConversationView) => void;
34
+ onUnarchive?: (item: ConversationView) => void;
35
+ /** Confirmed delete. Return a Promise to keep the dialog open until it settles. */
36
+ onDelete?: (item: ConversationView) => void | Promise<unknown>;
37
+ /** Extra controls next to the "more" button. */
38
+ actions?: React.ReactNode;
39
+ /** Reference time for the today / earlier format (default: now). */
40
+ now?: Date;
41
+ };
42
+ /** Internal wiring from ConversationList: roving tab stop and the shared selection ghost. */
43
+ export interface ConversationRowListContext {
44
+ tabStopId: string | null;
45
+ ghostId: string;
46
+ selectedId: string | undefined;
47
+ onFocusRow: (id: string) => void;
48
+ }
49
+ export declare const ConversationRowContext: React.Context<ConversationRowListContext | null>;
50
+ export declare const ConversationRow: React.ForwardRefExoticComponent<Omit<React.LiHTMLAttributes<HTMLLIElement>, "children" | "title" | "onSelect"> & {
51
+ item: ConversationView;
52
+ selected?: boolean;
53
+ disabled?: boolean;
54
+ onSelect?: (id: string) => void;
55
+ /** Toggle pin; receives the requested state. */
56
+ onPin?: (item: ConversationView, pinned: boolean) => void;
57
+ onArchive?: (item: ConversationView) => void;
58
+ onUnarchive?: (item: ConversationView) => void;
59
+ /** Confirmed delete. Return a Promise to keep the dialog open until it settles. */
60
+ onDelete?: (item: ConversationView) => void | Promise<unknown>;
61
+ /** Extra controls next to the "more" button. */
62
+ actions?: React.ReactNode;
63
+ /** Reference time for the today / earlier format (default: now). */
64
+ now?: Date;
65
+ } & React.RefAttributes<HTMLLIElement>>;
66
+ //# sourceMappingURL=ConversationRow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConversationRow.d.ts","sourceRoot":"","sources":["../../../src/components/conversation/ConversationRow.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAa,gBAAgB,EAAmB,MAAM,qBAAqB,CAAC;AAQxF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,MAAM,oBAAoB,GAAG,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,aAAa,CAAC,EAAE,UAAU,GAAG,OAAO,GAAG,UAAU,CAAC,GAAG;IAClH,IAAI,EAAE,gBAAgB,CAAC;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,gDAAgD;IAChD,KAAK,CAAC,EAAE,CAAC,IAAI,EAAE,gBAAgB,EAAE,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IAC1D,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAC7C,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAC/C,mFAAmF;IACnF,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,gBAAgB,KAAK,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAC/D,gDAAgD;IAChD,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,oEAAoE;IACpE,GAAG,CAAC,EAAE,IAAI,CAAC;CACZ,CAAC;AAEF,6FAA6F;AAC7F,MAAM,WAAW,0BAA0B;IACzC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,UAAU,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CAClC;AAED,eAAO,MAAM,sBAAsB,kDAA+D,CAAC;AAyBnG,eAAO,MAAM,eAAe;UAjDpB,gBAAgB;eACX,OAAO;eACP,OAAO;eACP,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI;IAC/B,gDAAgD;YACxC,CAAC,IAAI,EAAE,gBAAgB,EAAE,MAAM,EAAE,OAAO,KAAK,IAAI;gBAC7C,CAAC,IAAI,EAAE,gBAAgB,KAAK,IAAI;kBAC9B,CAAC,IAAI,EAAE,gBAAgB,KAAK,IAAI;IAC9C,mFAAmF;eACxE,CAAC,IAAI,EAAE,gBAAgB,KAAK,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC;IAC9D,gDAAgD;cACtC,KAAK,CAAC,SAAS;IACzB,oEAAoE;UAC9D,IAAI;uCA4MV,CAAC"}
@@ -0,0 +1,65 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import * as React from 'react';
4
+ import { motion } from 'motion/react';
5
+ import { AlertDialog, IconButton, Menu, MenuItem, MenuSeparator, useRhineMotion } from '@wzrhine/react';
6
+ import { useAgentFormat, useAgentMessages } from '../../provider/AgentMessages.js';
7
+ import { AgentIcon } from '../../primitives/icons.js';
8
+ import { StatusGlyph } from '../../primitives/StatusGlyph.js';
9
+ import { loopAttributes, useAgentLoop } from '../../motion/agent-motion.js';
10
+ import { cx } from '../../utils/cx.js';
11
+ import { conversationStatus, isSameDay } from './conversation-status.js';
12
+ export const ConversationRowContext = React.createContext(null);
13
+ function ActiveGlyph({ glyph, tone }) {
14
+ const { ref, lifecycle } = useAgentLoop(true);
15
+ return (_jsx("span", { ref: ref, className: "rl-agent-row__glyph", children: _jsx(StatusGlyph, { name: glyph, tone: tone, active: true, ...loopAttributes(lifecycle) }) }));
16
+ }
17
+ function SelectionGhost({ layoutId, selectedId }) {
18
+ const { resolve } = useRhineMotion();
19
+ return (_jsx(motion.span, { "aria-hidden": "true", className: "rl-agent-row__ghost", layoutId: layoutId, layoutDependency: selectedId, initial: false, transition: resolve('transform', 'base') }));
20
+ }
21
+ export const ConversationRow = React.forwardRef(function ConversationRow({ item, selected = false, disabled = false, onSelect, onPin, onArchive, onUnarchive, onDelete, actions, now, className, ...rest }, ref) {
22
+ const messages = useAgentMessages();
23
+ const shell = messages.shell;
24
+ const format = useAgentFormat();
25
+ const list = React.useContext(ConversationRowContext);
26
+ const descId = React.useId();
27
+ const [menuOpen, setMenuOpen] = React.useState(false);
28
+ const [confirmArchive, setConfirmArchive] = React.useState(false);
29
+ const [deleteOpen, setDeleteOpen] = React.useState(false);
30
+ const [deleteMounted, setDeleteMounted] = React.useState(false);
31
+ const title = item.title.trim() || shell.untitled;
32
+ const status = conversationStatus(item, messages.status, shell);
33
+ const unread = item.unread && item.unread > 0 ? item.unread : 0;
34
+ const nameParts = [title, item.pinned ? shell.pinned : null, status?.label ?? null, unread ? shell.unread(format.number(unread)) : null];
35
+ const name = nameParts.filter(Boolean).join(shell.separator);
36
+ let time = null;
37
+ if (item.updatedAt) {
38
+ const date = new Date(item.updatedAt);
39
+ if (!Number.isNaN(date.getTime()))
40
+ time = isSameDay(date, now ?? new Date()) ? format.time(item.updatedAt) : format.date(item.updatedAt);
41
+ }
42
+ const canPin = !!onPin && !item.archived;
43
+ const canArchive = !!onArchive && !item.archived;
44
+ const canUnarchive = !!onUnarchive && !!item.archived;
45
+ const canDelete = !!onDelete;
46
+ const hasMenu = canPin || canArchive || canUnarchive || canDelete;
47
+ const tabbable = list ? list.tabStopId === item.id : true;
48
+ return (_jsxs("li", { ...rest, ref: ref, className: cx('rl-agent-row', className), "data-id": item.id, "data-selected": selected || undefined, "data-disabled": disabled || undefined, "data-status": status?.kind, "data-menu-open": menuOpen || undefined, "data-has-menu": hasMenu || actions != null || undefined, children: [selected && list && _jsx(SelectionGhost, { layoutId: list.ghostId, selectedId: list.selectedId }), _jsxs("button", { type: "button", className: "rl-agent-row__main", "aria-current": selected ? 'true' : undefined, "aria-label": name, "aria-describedby": time || item.preview ? descId : undefined, disabled: disabled, tabIndex: tabbable ? 0 : -1, onFocus: () => list?.onFocusRow(item.id), onClick: () => onSelect?.(item.id), children: [_jsx("span", { className: "rl-agent-row__status", "aria-hidden": "true", children: status &&
49
+ (status.active ? (_jsx(ActiveGlyph, { glyph: status.glyph, tone: status.tone })) : (_jsx("span", { className: "rl-agent-row__glyph", children: _jsx(StatusGlyph, { name: status.glyph, tone: status.tone }) }))) }), _jsxs("span", { className: "rl-agent-row__title", title: title, children: [item.pinned && _jsx(AgentIcon, { name: "pin", className: "rl-agent-row__pin" }), _jsx("span", { className: "rl-agent-row__title-text", children: title })] }), _jsxs("span", { className: "rl-agent-row__meta", "aria-hidden": "true", children: [unread > 0 && _jsx("span", { className: "rl-agent-row__unread", children: format.compact(unread) }), time && (_jsx("time", { className: "rl-agent-row__time", dateTime: item.updatedAt, children: time }))] }), item.preview && (_jsx("span", { className: "rl-agent-row__preview", "aria-hidden": "true", children: item.preview })), _jsx("span", { id: descId, className: "rl-agent-sr", children: [time, item.preview].filter(Boolean).join(shell.separator) })] }), (hasMenu || actions != null) && (_jsxs("span", { className: "rl-agent-row__actions", children: [actions, hasMenu && (_jsxs(Menu, { open: menuOpen, onOpenChange: (open) => {
50
+ setMenuOpen(open);
51
+ if (!open)
52
+ setConfirmArchive(false);
53
+ }, align: "end", disabled: disabled, trigger: _jsx(IconButton, { className: "rl-agent-row__more", size: "sm", icon: _jsx(AgentIcon, { name: "more" }), label: shell.more(title), disabled: disabled, tabIndex: tabbable ? 0 : -1, onFocus: () => list?.onFocusRow(item.id) }), children: [canPin && (_jsx(MenuItem, { icon: _jsx(AgentIcon, { name: "pin" }), onSelect: () => onPin(item, !item.pinned), children: item.pinned ? shell.unpin : shell.pin })), canArchive && (_jsx(MenuItem, { icon: _jsx(AgentIcon, { name: "archive" }), keepOpen: !confirmArchive, onSelect: () => {
54
+ if (!confirmArchive) {
55
+ setConfirmArchive(true);
56
+ return;
57
+ }
58
+ setConfirmArchive(false);
59
+ onArchive(item);
60
+ }, children: confirmArchive ? shell.confirmArchive : shell.archive })), canUnarchive && (_jsx(MenuItem, { icon: _jsx(AgentIcon, { name: "unarchive" }), onSelect: () => onUnarchive(item), children: shell.unarchive })), canDelete && (canPin || canArchive || canUnarchive) && _jsx(MenuSeparator, {}), canDelete && (_jsx(MenuItem, { icon: _jsx(AgentIcon, { name: "trash" }), tone: "danger", onSelect: () => {
61
+ setDeleteMounted(true);
62
+ setDeleteOpen(true);
63
+ }, children: shell.delete }))] }))] })), canDelete && deleteMounted && (_jsx(AlertDialog, { open: deleteOpen, onOpenChange: setDeleteOpen, title: shell.deleteTitle, description: shell.deleteDescription(title), confirmLabel: shell.deleteConfirm, errorText: shell.deleteError, onConfirm: () => onDelete(item) }))] }));
64
+ });
65
+ //# sourceMappingURL=ConversationRow.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConversationRow.js","sourceRoot":"","sources":["../../../src/components/conversation/ConversationRow.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,I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IAAI,EAAC,WAAW,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,YAC9E,KAAK,CAAC,SAAS,GACP,CACZ,EACA,SAAS,IAAI,CAAC,MAAM,IAAI,UAAU,IAAI,YAAY,CAAC,IAAI,KAAC,aAAa,KAAG,EACxE,SAAS,IAAI,CACZ,KAAC,QAAQ,IACP,IAAI,EAAE,KAAC,SAAS,IAAC,IAAI,EAAC,OAAO,GAAG,EAChC,IAAI,EAAC,QAAQ,EACb,QAAQ,EAAE,GAAG,EAAE;oCACb,gBAAgB,CAAC,IAAI,CAAC,CAAC;oCACvB,aAAa,CAAC,IAAI,CAAC,CAAC;gCACtB,CAAC,YAEA,KAAK,CAAC,MAAM,GACJ,CACZ,IACI,CACR,IACI,CACR,EACA,SAAS,IAAI,aAAa,IAAI,CAC7B,KAAC,WAAW,IACV,IAAI,EAAE,UAAU,EAChB,YAAY,EAAE,aAAa,EAC3B,KAAK,EAAE,KAAK,CAAC,WAAW,EACxB,WAAW,EAAE,KAAK,CAAC,iBAAiB,CAAC,KAAK,CAAC,EAC3C,YAAY,EAAE,KAAK,CAAC,aAAa,EACjC,SAAS,EAAE,KAAK,CAAC,WAAW,EAC5B,SAAS,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,GAC/B,CACH,IACE,CACN,CAAC;AACJ,CAAC,CAAC,CAAC"}
@@ -0,0 +1,21 @@
1
+ import type { AgentTone, ConversationView, StatusGlyphName } from '@wzrhine/agent-core';
2
+ import type { AgentStatusMessages } from '../../provider/messages/status.js';
3
+ import type { AgentShellMessages } from '../../provider/messages/shell.js';
4
+ /** What a conversation row shows as its status: glyph + tone + label, or nothing. */
5
+ export interface RowStatus {
6
+ glyph: StatusGlyphName;
7
+ tone: AgentTone;
8
+ label: string;
9
+ /** Ongoing activity: the glyph breathes (lifecycle-gated). */
10
+ active: boolean;
11
+ kind: 'attention' | 'run';
12
+ }
13
+ /**
14
+ * Attention (needs the user) wins over the run status. Settled, uneventful runs (`idle`,
15
+ * `completed`, `cancelled`) show no glyph: the list would otherwise be a column of check marks.
16
+ * `failed` / `interrupted` stay visible. No run status = nothing (unknown is never shown as success).
17
+ */
18
+ export declare function conversationStatus(item: ConversationView, status: AgentStatusMessages, shell: AgentShellMessages): RowStatus | null;
19
+ /** Same calendar day in local time. */
20
+ export declare function isSameDay(a: Date, b: Date): boolean;
21
+ //# sourceMappingURL=conversation-status.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conversation-status.d.ts","sourceRoot":"","sources":["../../../src/components/conversation/conversation-status.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAExF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAE3E,qFAAqF;AACrF,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,eAAe,CAAC;IACvB,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,8DAA8D;IAC9D,MAAM,EAAE,OAAO,CAAC;IAChB,IAAI,EAAE,WAAW,GAAG,KAAK,CAAC;CAC3B;AASD;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,gBAAgB,EAAE,MAAM,EAAE,mBAAmB,EAAE,KAAK,EAAE,kBAAkB,GAAG,SAAS,GAAG,IAAI,CAcnI;AAED,uCAAuC;AACvC,wBAAgB,SAAS,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,GAAG,OAAO,CAEnD"}