meowtail 0.2.0-alpha.1 → 0.3.0-alpha.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 (561) hide show
  1. package/AGENT-COMPONENTS.md +2 -2
  2. package/ASSISTANT.md +5 -1
  3. package/CHANGELOG.md +96 -0
  4. package/COMPONENTS.md +342 -0
  5. package/README.md +195 -43
  6. package/THIRD_PARTY_NOTICES.md +47 -0
  7. package/dist/src/chat/assistant-composer.d.ts +10 -6
  8. package/dist/src/chat/assistant-composer.js +57 -135
  9. package/dist/src/chat/assistant-content.d.ts +28 -14
  10. package/dist/src/chat/assistant-content.js +87 -80
  11. package/dist/src/chat/assistant-markdown.d.ts +10 -7
  12. package/dist/src/chat/assistant-markdown.js +5 -9
  13. package/dist/src/chat/assistant-question.d.ts +9 -7
  14. package/dist/src/chat/assistant-question.js +31 -63
  15. package/dist/src/chat/assistant-scroll.d.ts +2 -0
  16. package/dist/src/chat/assistant-scroll.js +28 -1
  17. package/dist/src/chat/assistant-types.d.ts +22 -1
  18. package/dist/src/chat/assistant-types.js +7 -0
  19. package/dist/src/chat/assistant.d.ts +9 -6
  20. package/dist/src/chat/assistant.js +233 -200
  21. package/dist/src/chat/attachments.d.ts +11 -8
  22. package/dist/src/chat/attachments.js +45 -55
  23. package/dist/src/chat/bubble.d.ts +12 -13
  24. package/dist/src/chat/bubble.js +8 -13
  25. package/dist/src/chat/bubble.options.d.ts +3 -0
  26. package/dist/src/chat/bubble.options.js +4 -0
  27. package/dist/src/chat/composer-panel.d.ts +11 -11
  28. package/dist/src/chat/composer-panel.js +13 -8
  29. package/dist/src/chat/composer.d.ts +19 -19
  30. package/dist/src/chat/composer.js +62 -28
  31. package/dist/src/chat/composer.options.d.ts +4 -0
  32. package/dist/src/chat/composer.options.js +5 -0
  33. package/dist/src/chat/conversation.d.ts +19 -10
  34. package/dist/src/chat/conversation.js +22 -16
  35. package/dist/src/chat/frame.d.ts +10 -7
  36. package/dist/src/chat/frame.js +6 -3
  37. package/dist/src/chat/header.d.ts +10 -7
  38. package/dist/src/chat/header.js +14 -12
  39. package/dist/src/chat/index.d.ts +21 -17
  40. package/dist/src/chat/index.js +21 -17
  41. package/dist/src/chat/message-actions.d.ts +10 -7
  42. package/dist/src/chat/message-actions.js +6 -3
  43. package/dist/src/chat/message-context.d.ts +1 -1
  44. package/dist/src/chat/message-list.d.ts +32 -14
  45. package/dist/src/chat/message-list.js +19 -18
  46. package/dist/src/chat/message.d.ts +9 -7
  47. package/dist/src/chat/message.js +26 -19
  48. package/dist/src/chat/process.d.ts +9 -6
  49. package/dist/src/chat/process.js +13 -5
  50. package/dist/src/chat/question.d.ts +12 -7
  51. package/dist/src/chat/question.js +17 -4
  52. package/dist/src/chat/reasoning.d.ts +23 -0
  53. package/dist/src/chat/reasoning.js +28 -0
  54. package/dist/src/chat/sources.d.ts +12 -9
  55. package/dist/src/chat/sources.js +17 -8
  56. package/dist/src/chat/status.d.ts +13 -13
  57. package/dist/src/chat/status.js +11 -12
  58. package/dist/src/chat/status.options.d.ts +3 -0
  59. package/dist/src/chat/status.options.js +4 -0
  60. package/dist/src/chat/task.d.ts +8 -7
  61. package/dist/src/chat/task.js +46 -35
  62. package/dist/src/chat/tool-call.d.ts +10 -8
  63. package/dist/src/chat/tool-call.js +60 -58
  64. package/dist/src/components/accordion.d.ts +26 -0
  65. package/dist/src/components/accordion.js +44 -0
  66. package/dist/src/components/action-rail.d.ts +9 -7
  67. package/dist/src/components/action-rail.js +11 -8
  68. package/dist/src/components/action-row.d.ts +22 -0
  69. package/dist/src/components/action-row.js +18 -0
  70. package/dist/src/components/action-row.options.d.ts +4 -0
  71. package/dist/src/components/action-row.options.js +5 -0
  72. package/dist/src/components/alert.d.ts +20 -16
  73. package/dist/src/components/alert.js +16 -11
  74. package/dist/src/components/alert.options.d.ts +6 -0
  75. package/dist/src/components/alert.options.js +7 -0
  76. package/dist/src/components/app-bar.d.ts +9 -7
  77. package/dist/src/components/app-bar.js +12 -6
  78. package/dist/src/components/aspect-ratio.d.ts +13 -8
  79. package/dist/src/components/aspect-ratio.js +10 -14
  80. package/dist/src/components/avatar.d.ts +23 -0
  81. package/dist/src/components/avatar.js +31 -0
  82. package/dist/src/components/avatar.options.d.ts +3 -0
  83. package/dist/src/components/avatar.options.js +4 -0
  84. package/dist/src/components/badge.d.ts +16 -15
  85. package/dist/src/components/badge.js +9 -12
  86. package/dist/src/components/badge.options.d.ts +4 -0
  87. package/dist/src/components/badge.options.js +5 -0
  88. package/dist/src/components/breadcrumb.d.ts +10 -7
  89. package/dist/src/components/breadcrumb.js +9 -7
  90. package/dist/src/components/button.d.ts +16 -25
  91. package/dist/src/components/button.js +9 -20
  92. package/dist/src/components/button.options.d.ts +9 -0
  93. package/dist/src/components/button.options.js +10 -0
  94. package/dist/src/components/card-action.d.ts +10 -7
  95. package/dist/src/components/card-action.js +6 -6
  96. package/dist/src/components/card-content.d.ts +10 -7
  97. package/dist/src/components/card-content.js +6 -6
  98. package/dist/src/components/card-description.d.ts +10 -7
  99. package/dist/src/components/card-description.js +6 -6
  100. package/dist/src/components/card-footer.d.ts +10 -7
  101. package/dist/src/components/card-footer.js +7 -6
  102. package/dist/src/components/card-header.d.ts +10 -7
  103. package/dist/src/components/card-header.js +6 -6
  104. package/dist/src/components/card-title.d.ts +10 -7
  105. package/dist/src/components/card-title.js +6 -6
  106. package/dist/src/components/card.d.ts +15 -13
  107. package/dist/src/components/card.js +13 -11
  108. package/dist/src/components/card.options.d.ts +3 -0
  109. package/dist/src/components/card.options.js +2 -0
  110. package/dist/src/components/checkbox.d.ts +16 -9
  111. package/dist/src/components/checkbox.js +65 -34
  112. package/dist/src/components/choice-group.d.ts +10 -7
  113. package/dist/src/components/choice-group.js +43 -52
  114. package/dist/src/components/choice-select.d.ts +12 -8
  115. package/dist/src/components/choice-select.js +125 -165
  116. package/dist/src/components/code-block.d.ts +29 -8
  117. package/dist/src/components/code-block.js +59 -37
  118. package/dist/src/components/container.d.ts +15 -13
  119. package/dist/src/components/container.js +13 -11
  120. package/dist/src/components/container.options.d.ts +3 -0
  121. package/dist/src/components/container.options.js +4 -0
  122. package/dist/src/components/context-menu.d.ts +18 -0
  123. package/dist/src/components/context-menu.js +36 -0
  124. package/dist/src/components/credential-source.js +4 -10
  125. package/dist/src/components/description-list.d.ts +17 -13
  126. package/dist/src/components/description-list.js +11 -11
  127. package/dist/src/components/detail-section.d.ts +9 -7
  128. package/dist/src/components/detail-section.js +12 -8
  129. package/dist/src/components/dialog-actions.d.ts +12 -0
  130. package/dist/src/components/dialog-actions.js +7 -0
  131. package/dist/src/components/dialog-header.d.ts +18 -0
  132. package/dist/src/components/dialog-header.js +14 -0
  133. package/dist/src/components/dialog-panel.d.ts +14 -0
  134. package/dist/src/components/dialog-panel.js +8 -0
  135. package/dist/src/components/dialog.d.ts +12 -38
  136. package/dist/src/components/dialog.js +10 -29
  137. package/dist/src/components/diff-block.d.ts +12 -7
  138. package/dist/src/components/diff-block.js +12 -15
  139. package/dist/src/components/disclosure.d.ts +16 -11
  140. package/dist/src/components/disclosure.js +14 -13
  141. package/dist/src/components/drawer.d.ts +9 -7
  142. package/dist/src/components/drawer.js +36 -38
  143. package/dist/src/components/empty-state.d.ts +23 -13
  144. package/dist/src/components/empty-state.js +18 -7
  145. package/dist/src/components/empty-state.options.d.ts +3 -0
  146. package/dist/src/components/empty-state.options.js +2 -0
  147. package/dist/src/components/field-group.d.ts +10 -7
  148. package/dist/src/components/field-group.js +12 -15
  149. package/dist/src/components/field.d.ts +12 -8
  150. package/dist/src/components/field.js +55 -22
  151. package/dist/src/components/grid.d.ts +18 -20
  152. package/dist/src/components/grid.js +21 -23
  153. package/dist/src/components/grid.options.d.ts +7 -0
  154. package/dist/src/components/grid.options.js +8 -0
  155. package/dist/src/components/hover-card.d.ts +13 -8
  156. package/dist/src/components/hover-card.js +26 -36
  157. package/dist/src/components/icon-button.d.ts +17 -14
  158. package/dist/src/components/icon-button.js +9 -13
  159. package/dist/src/components/icon-button.options.d.ts +3 -0
  160. package/dist/src/components/icon-button.options.js +4 -0
  161. package/dist/src/components/icon-rail.d.ts +9 -7
  162. package/dist/src/components/icon-rail.js +14 -10
  163. package/dist/src/components/image-lightbox.d.ts +12 -7
  164. package/dist/src/components/image-lightbox.js +38 -43
  165. package/dist/src/components/image-preview.d.ts +8 -6
  166. package/dist/src/components/image-preview.js +23 -33
  167. package/dist/src/components/index.d.ts +105 -87
  168. package/dist/src/components/index.js +105 -87
  169. package/dist/src/components/inline.d.ts +14 -10
  170. package/dist/src/components/inline.js +20 -17
  171. package/dist/src/components/input.d.ts +10 -7
  172. package/dist/src/components/input.js +6 -6
  173. package/dist/src/components/item.d.ts +15 -15
  174. package/dist/src/components/item.js +17 -15
  175. package/dist/src/components/item.options.d.ts +4 -0
  176. package/dist/src/components/item.options.js +5 -0
  177. package/dist/src/components/json-block.d.ts +12 -7
  178. package/dist/src/components/json-block.js +14 -15
  179. package/dist/src/components/json-tree.d.ts +12 -7
  180. package/dist/src/components/json-tree.js +32 -33
  181. package/dist/src/components/layout-item.d.ts +9 -6
  182. package/dist/src/components/layout-item.js +17 -16
  183. package/dist/src/components/layout-types.d.ts +2 -6
  184. package/dist/src/components/layout-types.js +1 -6
  185. package/dist/src/components/layout.options.d.ts +5 -0
  186. package/dist/src/components/layout.options.js +6 -0
  187. package/dist/src/components/link.d.ts +15 -0
  188. package/dist/src/components/link.js +8 -0
  189. package/dist/src/components/list-group.d.ts +17 -13
  190. package/dist/src/components/list-group.js +19 -17
  191. package/dist/src/components/menu-button.d.ts +13 -0
  192. package/dist/src/components/menu-button.js +10 -0
  193. package/dist/src/components/menu.d.ts +14 -7
  194. package/dist/src/components/menu.js +48 -70
  195. package/dist/src/components/mermaid-diagram.d.ts +41 -0
  196. package/dist/src/components/mermaid-diagram.js +127 -0
  197. package/dist/src/components/meta-row.d.ts +19 -18
  198. package/dist/src/components/meta-row.js +51 -38
  199. package/dist/src/components/meta-row.options.d.ts +4 -0
  200. package/dist/src/components/meta-row.options.js +5 -0
  201. package/dist/src/components/modal.d.ts +41 -0
  202. package/dist/src/components/modal.js +103 -0
  203. package/dist/src/components/nav-item.d.ts +13 -7
  204. package/dist/src/components/nav-item.js +13 -19
  205. package/dist/src/components/nav-list.d.ts +50 -0
  206. package/dist/src/components/nav-list.js +53 -0
  207. package/dist/src/components/number-input.d.ts +31 -0
  208. package/dist/src/components/number-input.js +109 -0
  209. package/dist/src/components/output-block.d.ts +8 -6
  210. package/dist/src/components/output-block.js +19 -31
  211. package/dist/src/components/page-frame.d.ts +19 -16
  212. package/dist/src/components/page-frame.js +17 -10
  213. package/dist/src/components/page-frame.options.d.ts +4 -0
  214. package/dist/src/components/page-frame.options.js +5 -0
  215. package/dist/src/components/page-header.d.ts +15 -7
  216. package/dist/src/components/page-header.js +18 -7
  217. package/dist/src/components/page.d.ts +54 -0
  218. package/dist/src/components/page.js +27 -0
  219. package/dist/src/components/path-label.d.ts +13 -8
  220. package/dist/src/components/path-label.js +37 -36
  221. package/dist/src/components/path-picker.d.ts +9 -7
  222. package/dist/src/components/path-picker.js +19 -26
  223. package/dist/src/components/pill.d.ts +9 -7
  224. package/dist/src/components/pill.js +7 -13
  225. package/dist/src/components/popover.d.ts +10 -7
  226. package/dist/src/components/popover.js +172 -175
  227. package/dist/src/components/process-group.d.ts +14 -9
  228. package/dist/src/components/process-group.js +13 -4
  229. package/dist/src/components/process-step.d.ts +9 -7
  230. package/dist/src/components/process-step.js +8 -6
  231. package/dist/src/components/progress.d.ts +17 -0
  232. package/dist/src/components/progress.js +7 -0
  233. package/dist/src/components/prose.d.ts +23 -0
  234. package/dist/src/components/prose.js +17 -0
  235. package/dist/src/components/prose.options.d.ts +4 -0
  236. package/dist/src/components/prose.options.js +5 -0
  237. package/dist/src/components/rail-item.d.ts +9 -7
  238. package/dist/src/components/rail-item.js +10 -15
  239. package/dist/src/components/rail-section.d.ts +9 -7
  240. package/dist/src/components/rail-section.js +12 -6
  241. package/dist/src/components/read-block.d.ts +8 -6
  242. package/dist/src/components/read-block.js +51 -56
  243. package/dist/src/components/region-layout.d.ts +23 -4
  244. package/dist/src/components/region-layout.js +76 -72
  245. package/dist/src/components/resource-card.d.ts +9 -7
  246. package/dist/src/components/resource-card.js +17 -6
  247. package/dist/src/components/resource-link.d.ts +9 -7
  248. package/dist/src/components/resource-link.js +13 -10
  249. package/dist/src/components/risk-confirmation.d.ts +9 -7
  250. package/dist/src/components/risk-confirmation.js +7 -13
  251. package/dist/src/components/search-block.d.ts +9 -6
  252. package/dist/src/components/search-block.js +14 -16
  253. package/dist/src/components/search-input.d.ts +14 -9
  254. package/dist/src/components/search-input.js +12 -12
  255. package/dist/src/components/section.d.ts +44 -0
  256. package/dist/src/components/section.js +45 -0
  257. package/dist/src/components/segmented-control.d.ts +9 -7
  258. package/dist/src/components/segmented-control.js +50 -55
  259. package/dist/src/components/select.d.ts +10 -7
  260. package/dist/src/components/select.js +6 -6
  261. package/dist/src/components/separator.d.ts +10 -7
  262. package/dist/src/components/separator.js +6 -11
  263. package/dist/src/components/shortcut-keys.d.ts +13 -8
  264. package/dist/src/components/shortcut-keys.js +9 -7
  265. package/dist/src/components/skeleton-boundary.d.ts +13 -8
  266. package/dist/src/components/skeleton-boundary.js +31 -32
  267. package/dist/src/components/skeleton.d.ts +14 -13
  268. package/dist/src/components/skeleton.js +9 -11
  269. package/dist/src/components/skeleton.options.d.ts +3 -0
  270. package/dist/src/components/skeleton.options.js +2 -0
  271. package/dist/src/components/slider.d.ts +24 -0
  272. package/dist/src/components/slider.js +34 -0
  273. package/dist/src/components/spinner.d.ts +10 -7
  274. package/dist/src/components/spinner.js +8 -6
  275. package/dist/src/components/stack.d.ts +14 -10
  276. package/dist/src/components/stack.js +19 -16
  277. package/dist/src/components/state-dot.d.ts +13 -8
  278. package/dist/src/components/state-dot.js +23 -27
  279. package/dist/src/components/status-dot.d.ts +18 -26
  280. package/dist/src/components/status-dot.js +12 -21
  281. package/dist/src/components/status-dot.options.d.ts +9 -0
  282. package/dist/src/components/status-dot.options.js +10 -0
  283. package/dist/src/components/status.d.ts +10 -8
  284. package/dist/src/components/status.js +8 -7
  285. package/dist/src/components/switch.d.ts +8 -5
  286. package/dist/src/components/switch.js +9 -6
  287. package/dist/src/components/table.d.ts +48 -0
  288. package/dist/src/components/table.js +138 -0
  289. package/dist/src/components/table.options.d.ts +2 -0
  290. package/dist/src/components/table.options.js +3 -0
  291. package/dist/src/components/tabs.d.ts +11 -10
  292. package/dist/src/components/tabs.js +24 -54
  293. package/dist/src/components/tabs.options.d.ts +2 -0
  294. package/dist/src/components/tabs.options.js +3 -0
  295. package/dist/src/components/tag.d.ts +15 -19
  296. package/dist/src/components/tag.js +9 -12
  297. package/dist/src/components/tag.options.d.ts +6 -0
  298. package/dist/src/components/tag.options.js +7 -0
  299. package/dist/src/components/task-list.d.ts +34 -0
  300. package/dist/src/components/task-list.js +81 -0
  301. package/dist/src/components/terminal-block.d.ts +9 -6
  302. package/dist/src/components/terminal-block.js +32 -39
  303. package/dist/src/components/text-shimmer.d.ts +13 -8
  304. package/dist/src/components/text-shimmer.js +16 -14
  305. package/dist/src/components/text.d.ts +30 -0
  306. package/dist/src/components/text.js +24 -0
  307. package/dist/src/components/text.options.d.ts +3 -0
  308. package/dist/src/components/text.options.js +4 -0
  309. package/dist/src/components/textarea.d.ts +10 -7
  310. package/dist/src/components/textarea.js +6 -6
  311. package/dist/src/components/timeline.d.ts +18 -13
  312. package/dist/src/components/timeline.js +19 -12
  313. package/dist/src/components/toast.d.ts +13 -8
  314. package/dist/src/components/toast.js +12 -7
  315. package/dist/src/components/toolbar.d.ts +10 -7
  316. package/dist/src/components/toolbar.js +6 -22
  317. package/dist/src/components/tooltip.d.ts +9 -7
  318. package/dist/src/components/tooltip.js +17 -34
  319. package/dist/src/components/web-block.d.ts +9 -6
  320. package/dist/src/components/web-block.js +19 -21
  321. package/dist/src/components/window-title-bar.d.ts +9 -7
  322. package/dist/src/components/window-title-bar.js +11 -6
  323. package/dist/src/components/work-card.d.ts +9 -7
  324. package/dist/src/components/work-card.js +17 -6
  325. package/dist/src/icons/README.md +81 -1
  326. package/dist/src/icons/assistant-mark.d.ts +9 -0
  327. package/dist/src/icons/assistant-mark.js +10 -0
  328. package/dist/src/icons/doodle-cat.d.ts +2 -2
  329. package/dist/src/icons/doodle-cat.js +1 -1
  330. package/dist/src/icons/empty-stack.d.ts +10 -0
  331. package/dist/src/icons/empty-stack.js +16 -0
  332. package/dist/src/icons/file-type-icon.d.ts +2 -2
  333. package/dist/src/icons/icon-frame.d.ts +2 -2
  334. package/dist/src/icons/icon-frame.js +1 -1
  335. package/dist/src/icons/icon-source.d.ts +2 -2
  336. package/dist/src/icons/icon.d.ts +9 -3
  337. package/dist/src/icons/icon.js +8 -2
  338. package/dist/src/icons/index.d.ts +2 -0
  339. package/dist/src/icons/index.js +2 -0
  340. package/dist/src/icons/meowland-mark.d.ts +2 -2
  341. package/dist/src/index.d.ts +2 -0
  342. package/dist/src/index.js +2 -0
  343. package/dist/src/json/catalog.d.ts +2 -0
  344. package/dist/src/json/catalog.js +1 -0
  345. package/dist/src/registry/factory.d.ts +9 -0
  346. package/dist/src/registry/factory.js +9 -0
  347. package/dist/src/registry/index.d.ts +198 -561
  348. package/dist/src/registry/index.js +267 -245
  349. package/dist/src/shared/action-row-fit.d.ts +19 -0
  350. package/dist/src/shared/action-row-fit.js +59 -0
  351. package/dist/src/theme/audit.d.ts +2 -0
  352. package/dist/src/theme/audit.js +60 -0
  353. package/dist/src/theme/base.styles.d.ts +3 -2
  354. package/dist/src/theme/base.styles.js +43 -5
  355. package/dist/src/theme/chat/assistant.styles.d.ts +1 -1
  356. package/dist/src/theme/chat/assistant.styles.js +240 -133
  357. package/dist/src/theme/chat/attachments.styles.d.ts +1 -1
  358. package/dist/src/theme/chat/attachments.styles.js +96 -96
  359. package/dist/src/theme/chat/composer-panel.styles.d.ts +1 -1
  360. package/dist/src/theme/chat/composer-panel.styles.js +24 -21
  361. package/dist/src/theme/chat/composer.styles.d.ts +1 -1
  362. package/dist/src/theme/chat/composer.styles.js +281 -215
  363. package/dist/src/theme/chat/conversation.styles.d.ts +1 -1
  364. package/dist/src/theme/chat/conversation.styles.js +24 -25
  365. package/dist/src/theme/chat/frame.styles.d.ts +1 -1
  366. package/dist/src/theme/chat/frame.styles.js +35 -34
  367. package/dist/src/theme/chat/header.styles.d.ts +1 -1
  368. package/dist/src/theme/chat/header.styles.js +37 -37
  369. package/dist/src/theme/chat/message.styles.d.ts +1 -1
  370. package/dist/src/theme/chat/message.styles.js +132 -190
  371. package/dist/src/theme/chat/question.styles.d.ts +1 -1
  372. package/dist/src/theme/chat/question.styles.js +34 -33
  373. package/dist/src/theme/chat/reasoning.styles.d.ts +1 -0
  374. package/dist/src/theme/chat/reasoning.styles.js +142 -0
  375. package/dist/src/theme/chat/records.styles.d.ts +1 -1
  376. package/dist/src/theme/chat/records.styles.js +200 -243
  377. package/dist/src/theme/chat/status.styles.d.ts +1 -1
  378. package/dist/src/theme/chat/status.styles.js +14 -58
  379. package/dist/src/theme/chat/task.styles.d.ts +1 -1
  380. package/dist/src/theme/chat/task.styles.js +32 -34
  381. package/dist/src/theme/components/accordion.styles.d.ts +1 -0
  382. package/dist/src/theme/components/accordion.styles.js +64 -0
  383. package/dist/src/theme/components/action-rail.styles.d.ts +1 -1
  384. package/dist/src/theme/components/action-rail.styles.js +10 -10
  385. package/dist/src/theme/components/alert.styles.d.ts +1 -1
  386. package/dist/src/theme/components/alert.styles.js +37 -28
  387. package/dist/src/theme/components/app-bar.styles.d.ts +1 -1
  388. package/dist/src/theme/components/app-bar.styles.js +19 -18
  389. package/dist/src/theme/components/avatar.styles.d.ts +1 -0
  390. package/dist/src/theme/components/avatar.styles.js +54 -0
  391. package/dist/src/theme/components/badge.styles.d.ts +1 -1
  392. package/dist/src/theme/components/badge.styles.js +31 -30
  393. package/dist/src/theme/components/breadcrumb.styles.d.ts +1 -1
  394. package/dist/src/theme/components/breadcrumb.styles.js +21 -21
  395. package/dist/src/theme/components/button.styles.d.ts +1 -1
  396. package/dist/src/theme/components/button.styles.js +95 -74
  397. package/dist/src/theme/components/card.styles.d.ts +1 -1
  398. package/dist/src/theme/components/card.styles.js +53 -52
  399. package/dist/src/theme/components/choice-group.styles.d.ts +1 -1
  400. package/dist/src/theme/components/choice-group.styles.js +39 -38
  401. package/dist/src/theme/components/choice-select.styles.d.ts +1 -1
  402. package/dist/src/theme/components/choice-select.styles.js +79 -98
  403. package/dist/src/theme/components/code-block.styles.d.ts +1 -1
  404. package/dist/src/theme/components/code-block.styles.js +50 -32
  405. package/dist/src/theme/components/context-menu.styles.d.ts +1 -0
  406. package/dist/src/theme/components/context-menu.styles.js +14 -0
  407. package/dist/src/theme/components/description-list.styles.d.ts +1 -1
  408. package/dist/src/theme/components/description-list.styles.js +11 -10
  409. package/dist/src/theme/components/detail-section.styles.d.ts +1 -1
  410. package/dist/src/theme/components/detail-section.styles.js +15 -13
  411. package/dist/src/theme/components/dialog.styles.d.ts +1 -1
  412. package/dist/src/theme/components/dialog.styles.js +76 -42
  413. package/dist/src/theme/components/disclosure.styles.d.ts +1 -1
  414. package/dist/src/theme/components/disclosure.styles.js +31 -31
  415. package/dist/src/theme/components/drawer.styles.d.ts +1 -1
  416. package/dist/src/theme/components/drawer.styles.js +13 -13
  417. package/dist/src/theme/components/empty-state.styles.d.ts +1 -1
  418. package/dist/src/theme/components/empty-state.styles.js +30 -26
  419. package/dist/src/theme/components/field-group.styles.d.ts +1 -1
  420. package/dist/src/theme/components/field-group.styles.js +15 -15
  421. package/dist/src/theme/components/field.styles.d.ts +1 -1
  422. package/dist/src/theme/components/field.styles.js +17 -17
  423. package/dist/src/theme/components/hover-card.styles.d.ts +1 -1
  424. package/dist/src/theme/components/hover-card.styles.js +23 -23
  425. package/dist/src/theme/components/icon-rail.styles.d.ts +1 -1
  426. package/dist/src/theme/components/icon-rail.styles.js +50 -50
  427. package/dist/src/theme/components/image-lightbox.styles.d.ts +1 -1
  428. package/dist/src/theme/components/image-lightbox.styles.js +27 -27
  429. package/dist/src/theme/components/image-preview.styles.d.ts +1 -1
  430. package/dist/src/theme/components/image-preview.styles.js +23 -18
  431. package/dist/src/theme/components/item.styles.d.ts +1 -1
  432. package/dist/src/theme/components/item.styles.js +49 -44
  433. package/dist/src/theme/components/json.styles.d.ts +1 -1
  434. package/dist/src/theme/components/json.styles.js +82 -53
  435. package/dist/src/theme/components/layout.styles.d.ts +1 -1
  436. package/dist/src/theme/components/layout.styles.js +50 -48
  437. package/dist/src/theme/components/link.styles.d.ts +1 -0
  438. package/dist/src/theme/components/link.styles.js +32 -0
  439. package/dist/src/theme/components/list-group.styles.d.ts +1 -1
  440. package/dist/src/theme/components/list-group.styles.js +25 -24
  441. package/dist/src/theme/components/menu.styles.d.ts +1 -1
  442. package/dist/src/theme/components/menu.styles.js +49 -37
  443. package/dist/src/theme/components/mermaid-diagram.styles.d.ts +1 -0
  444. package/dist/src/theme/components/mermaid-diagram.styles.js +162 -0
  445. package/dist/src/theme/components/meta-row.styles.d.ts +1 -1
  446. package/dist/src/theme/components/meta-row.styles.js +25 -24
  447. package/dist/src/theme/components/modal.styles.d.ts +5 -0
  448. package/dist/src/theme/components/modal.styles.js +11 -0
  449. package/dist/src/theme/components/native-input.styles.d.ts +1 -1
  450. package/dist/src/theme/components/native-input.styles.js +38 -83
  451. package/dist/src/theme/components/nav-item.styles.d.ts +1 -1
  452. package/dist/src/theme/components/nav-item.styles.js +30 -30
  453. package/dist/src/theme/components/nav-list.styles.d.ts +1 -0
  454. package/dist/src/theme/components/nav-list.styles.js +155 -0
  455. package/dist/src/theme/components/number-input.styles.d.ts +1 -0
  456. package/dist/src/theme/components/number-input.styles.js +83 -0
  457. package/dist/src/theme/components/output-block.styles.d.ts +1 -1
  458. package/dist/src/theme/components/output-block.styles.js +129 -104
  459. package/dist/src/theme/components/page-frame.styles.d.ts +1 -1
  460. package/dist/src/theme/components/page-frame.styles.js +53 -17
  461. package/dist/src/theme/components/page-header.styles.d.ts +1 -1
  462. package/dist/src/theme/components/page-header.styles.js +34 -14
  463. package/dist/src/theme/components/page.styles.d.ts +1 -0
  464. package/dist/src/theme/components/page.styles.js +55 -0
  465. package/dist/src/theme/components/path-label.styles.d.ts +1 -1
  466. package/dist/src/theme/components/path-label.styles.js +10 -10
  467. package/dist/src/theme/components/path-picker.styles.d.ts +1 -1
  468. package/dist/src/theme/components/path-picker.styles.js +13 -13
  469. package/dist/src/theme/components/pill.styles.d.ts +1 -1
  470. package/dist/src/theme/components/pill.styles.js +22 -18
  471. package/dist/src/theme/components/popover.styles.d.ts +1 -1
  472. package/dist/src/theme/components/popover.styles.js +17 -17
  473. package/dist/src/theme/components/process-group.styles.d.ts +1 -1
  474. package/dist/src/theme/components/process-group.styles.js +56 -60
  475. package/dist/src/theme/components/progress.styles.d.ts +1 -0
  476. package/dist/src/theme/components/progress.styles.js +70 -0
  477. package/dist/src/theme/components/region-layout.styles.d.ts +1 -1
  478. package/dist/src/theme/components/region-layout.styles.js +18 -18
  479. package/dist/src/theme/components/resource-card.styles.d.ts +1 -1
  480. package/dist/src/theme/components/resource-card.styles.js +37 -37
  481. package/dist/src/theme/components/resource-link.styles.d.ts +1 -1
  482. package/dist/src/theme/components/resource-link.styles.js +21 -21
  483. package/dist/src/theme/components/risk-confirmation.styles.d.ts +1 -1
  484. package/dist/src/theme/components/risk-confirmation.styles.js +4 -4
  485. package/dist/src/theme/components/search-input.styles.d.ts +1 -1
  486. package/dist/src/theme/components/search-input.styles.js +17 -38
  487. package/dist/src/theme/components/section.styles.d.ts +1 -0
  488. package/dist/src/theme/components/section.styles.js +100 -0
  489. package/dist/src/theme/components/segmented-control.styles.d.ts +1 -1
  490. package/dist/src/theme/components/segmented-control.styles.js +32 -26
  491. package/dist/src/theme/components/separator.styles.d.ts +1 -1
  492. package/dist/src/theme/components/separator.styles.js +5 -5
  493. package/dist/src/theme/components/shortcut-keys.styles.d.ts +1 -1
  494. package/dist/src/theme/components/shortcut-keys.styles.js +15 -13
  495. package/dist/src/theme/components/skeleton.styles.d.ts +1 -1
  496. package/dist/src/theme/components/skeleton.styles.js +13 -12
  497. package/dist/src/theme/components/slider.styles.d.ts +1 -0
  498. package/dist/src/theme/components/slider.styles.js +126 -0
  499. package/dist/src/theme/components/spinner.styles.d.ts +1 -1
  500. package/dist/src/theme/components/spinner.styles.js +10 -10
  501. package/dist/src/theme/components/state-dot.styles.d.ts +1 -1
  502. package/dist/src/theme/components/state-dot.styles.js +23 -23
  503. package/dist/src/theme/components/status-dot.styles.d.ts +1 -1
  504. package/dist/src/theme/components/status-dot.styles.js +16 -15
  505. package/dist/src/theme/components/status.styles.d.ts +1 -1
  506. package/dist/src/theme/components/status.styles.js +4 -20
  507. package/dist/src/theme/components/table.styles.d.ts +1 -0
  508. package/dist/src/theme/components/table.styles.js +156 -0
  509. package/dist/src/theme/components/tabs.styles.d.ts +1 -1
  510. package/dist/src/theme/components/tabs.styles.js +48 -45
  511. package/dist/src/theme/components/tag.styles.d.ts +1 -1
  512. package/dist/src/theme/components/tag.styles.js +24 -24
  513. package/dist/src/theme/components/task-list.styles.d.ts +1 -0
  514. package/dist/src/theme/components/task-list.styles.js +223 -0
  515. package/dist/src/theme/components/text-shimmer.styles.d.ts +1 -1
  516. package/dist/src/theme/components/text-shimmer.styles.js +29 -25
  517. package/dist/src/theme/components/text.styles.d.ts +1 -0
  518. package/dist/src/theme/components/text.styles.js +34 -0
  519. package/dist/src/theme/components/timeline.styles.d.ts +1 -1
  520. package/dist/src/theme/components/timeline.styles.js +14 -26
  521. package/dist/src/theme/components/toast.styles.d.ts +1 -1
  522. package/dist/src/theme/components/toast.styles.js +28 -15
  523. package/dist/src/theme/components/toggle.styles.d.ts +1 -1
  524. package/dist/src/theme/components/toggle.styles.js +38 -28
  525. package/dist/src/theme/components/toolbar.styles.d.ts +1 -1
  526. package/dist/src/theme/components/toolbar.styles.js +8 -8
  527. package/dist/src/theme/components/tooltip.styles.d.ts +1 -1
  528. package/dist/src/theme/components/tooltip.styles.js +11 -11
  529. package/dist/src/theme/components/web-block.styles.d.ts +1 -1
  530. package/dist/src/theme/components/web-block.styles.js +19 -19
  531. package/dist/src/theme/components/window-title-bar.styles.d.ts +1 -1
  532. package/dist/src/theme/components/window-title-bar.styles.js +10 -10
  533. package/dist/src/theme/components/work-card.styles.d.ts +1 -1
  534. package/dist/src/theme/components/work-card.styles.js +37 -34
  535. package/dist/src/theme/icons/icons.styles.d.ts +1 -1
  536. package/dist/src/theme/icons/icons.styles.js +52 -2
  537. package/dist/src/theme/index.d.ts +206 -134
  538. package/dist/src/theme/index.js +78 -13
  539. package/dist/src/theme/selectors.d.ts +3 -0
  540. package/dist/src/theme/selectors.js +7 -0
  541. package/dist/src/theme/shared/action-row.styles.d.ts +1 -0
  542. package/dist/src/theme/shared/action-row.styles.js +52 -0
  543. package/dist/src/theme/shared/chart.tokens.d.ts +18 -0
  544. package/dist/src/theme/shared/chart.tokens.js +19 -0
  545. package/dist/src/theme/shared/code-highlight.styles.d.ts +1 -1
  546. package/dist/src/theme/shared/code-highlight.styles.js +6 -6
  547. package/dist/src/theme/shared/field-surface.styles.d.ts +1 -0
  548. package/dist/src/theme/shared/field-surface.styles.js +90 -0
  549. package/dist/src/theme/shared/prose.styles.d.ts +1 -0
  550. package/dist/src/theme/shared/prose.styles.js +152 -0
  551. package/dist/src/theme/shared/state-badge.styles.d.ts +1 -0
  552. package/dist/src/theme/shared/state-badge.styles.js +80 -0
  553. package/dist/src/theme/tokens.d.ts +259 -93
  554. package/dist/src/theme/tokens.js +284 -116
  555. package/dist/src/theme/utilities.d.ts +19 -0
  556. package/dist/src/theme/utilities.js +233 -0
  557. package/package.json +12 -8
  558. package/dist/src/theme/components/resource-card.tokens.d.ts +0 -5
  559. package/dist/src/theme/components/resource-card.tokens.js +0 -6
  560. package/dist/src/theme/palette.d.ts +0 -55
  561. package/dist/src/theme/palette.js +0 -56
@@ -1,36 +1,33 @@
1
- import { defineComponent, h, unwrap } from "meowjsx";
1
+ import { derived, h, isSignal, unwrap } from "meowjsx";
2
+ // Fragment is required by the classic JSX transform for conditional attachment controls.
3
+ // eslint-disable-next-line no-unused-vars
4
+ import { Fragment } from "meowjsx";
2
5
  import { ChatComposer } from "./composer.js";
3
6
  import { ChatAttachments } from "./attachments.js";
4
7
  import { IconButton } from "../components/icon-button.js";
5
8
  import { ChoiceSelect } from "../components/choice-select.js";
6
9
  import { Icon } from "../icons/icon.js";
7
- import { assistantDerived } from "./assistant-content.js";
8
10
  import { consumeAssistantDraft, snapshotAssistantDraft } from "./assistant-draft.js";
9
11
  import { assistantCopy as defaultAssistantCopy, } from "./assistant-types.js";
10
- export const assistantComposerContract = {
11
- name: "assistant-composer",
12
- parts: ["root", "choices", "feedback", "file"],
13
- };
14
- export const AssistantComposer = defineComponent(assistantComposerContract, ({ options }, context) => {
12
+ export function AssistantComposer({ options, trailing }, context) {
15
13
  const assistantCopy = { ...defaultAssistantCopy, ...options.labels };
16
14
  const controlled = options.draft !== undefined;
17
15
  if (controlled && !options.onDraftChange && !options.readOnly)
18
16
  throw new Error("A controlled Assistant draft requires onDraftChange or readOnly");
19
17
  const local = context.signal(options.defaultDraft ?? { text: "", attachments: [] });
20
- const draft = assistantDerived(context, () => controlled ? unwrap(options.draft) : local.value);
21
- const text = assistantDerived(context, () => draft.value.text);
18
+ const draft = derived(() => (controlled ? unwrap(options.draft) : local.value));
19
+ const text = derived(() => draft.value.text);
22
20
  const pending = context.signal(false);
23
21
  const attaching = context.signal(false);
24
22
  const feedback = context.signal("");
25
- const disabled = assistantDerived(context, () => options.readOnly || unwrap(options.disabled ?? false));
26
- const submitDisabled = assistantDerived(context, () => disabled.value ||
23
+ const disabled = derived(() => options.readOnly || unwrap(options.disabled ?? false));
24
+ const submitDisabled = derived(() => disabled.value ||
27
25
  pending.value ||
28
26
  !options.onSubmit ||
29
27
  (!draft.value.text.trim() && !draft.value.attachments.length));
30
28
  let textVersion = 0;
31
29
  let previousText = draft.value.text;
32
30
  let disposed = false;
33
- let textarea;
34
31
  let fileInput;
35
32
  const urls = new Set();
36
33
  context.effect(() => {
@@ -46,12 +43,6 @@ export const AssistantComposer = defineComponent(assistantComposerContract, ({ o
46
43
  local.value = next;
47
44
  options.onDraftChange?.(next);
48
45
  };
49
- const resize = () => {
50
- if (!textarea)
51
- return;
52
- textarea.style.height = "auto";
53
- textarea.style.height = `${textarea.scrollHeight}px`;
54
- };
55
46
  const send = async (event) => {
56
47
  event.preventDefault();
57
48
  if (pending.value || submitDisabled.value || !options.onSubmit)
@@ -75,15 +66,14 @@ export const AssistantComposer = defineComponent(assistantComposerContract, ({ o
75
66
  feedback.value = assistantCopy.submitError;
76
67
  }
77
68
  finally {
78
- if (!disposed) {
69
+ if (!disposed)
79
70
  pending.value = false;
80
- resize();
81
- }
82
71
  }
83
72
  };
84
73
  const attach = async (event) => {
85
- const files = [...(event.currentTarget.files ?? [])];
86
- event.currentTarget.value = "";
74
+ const input = event.currentTarget;
75
+ const files = [...(input.files ?? [])];
76
+ input.value = "";
87
77
  if (!files.length || disabled.value || attaching.value)
88
78
  return;
89
79
  attaching.value = true;
@@ -122,123 +112,55 @@ export const AssistantComposer = defineComponent(assistantComposerContract, ({ o
122
112
  });
123
113
  const localModel = context.signal(unwrap(options.models ?? [])[0]?.value ?? "");
124
114
  const localReasoning = context.signal(unwrap(options.reasoningOptions ?? [])[0]?.value ?? "");
125
- const choices = context.part("choices", "div", null, assistantDerived(context, () => {
126
- const models = unwrap(options.models ?? []);
127
- return models.length
128
- ? h(ChoiceSelect, {
129
- options: models,
130
- value: options.model ?? localModel,
131
- "aria-label": assistantCopy.model,
132
- onValueChange: (value) => {
133
- if (options.model === undefined)
134
- localModel.value = value;
135
- options.onModelChange?.(value);
136
- },
137
- placement: "top",
138
- matchTriggerWidth: false,
139
- })
140
- : null;
141
- }), assistantDerived(context, () => {
142
- const reasoning = unwrap(options.reasoningOptions ?? []);
143
- return reasoning.length
144
- ? h(ChoiceSelect, {
145
- options: reasoning,
146
- value: options.reasoning ?? localReasoning,
147
- "aria-label": assistantCopy.reasoning,
148
- onValueChange: (value) => {
149
- if (options.reasoning === undefined)
150
- localReasoning.value = value;
151
- options.onReasoningChange?.(value);
152
- },
153
- placement: "top",
154
- matchTriggerWidth: false,
155
- })
156
- : null;
157
- }), options.composerTrailing);
158
- return context.part("root", "div", null, h(ChatComposer, {
159
- value: text,
160
- placeholder: assistantCopy.placeholder,
161
- inputLabel: assistantCopy.composer,
162
- submitLabel: assistantCopy.send,
163
- submitDisabled,
164
- trailing: choices,
165
- attachments: assistantDerived(context, () => draft.value.attachments.length
166
- ? h(ChatAttachments, {
167
- items: draft.value.attachments.map((attachment) => ({
115
+ const modelsLive = options.models !== undefined && (isSignal(options.models) || options.models.length > 0);
116
+ const reasoningLive = options.reasoningOptions !== undefined &&
117
+ (isSignal(options.reasoningOptions) || options.reasoningOptions.length > 0);
118
+ const choices = (h("div", { ref: context.parts.choices },
119
+ modelsLive ? (h(ChoiceSelect, { hidden: derived(() => unwrap(options.models ?? []).length === 0), options: derived(() => unwrap(options.models ?? [])), value: options.model ?? localModel, "aria-label": assistantCopy.model, onValueChange: (value) => {
120
+ if (options.model === undefined)
121
+ localModel.value = value;
122
+ options.onModelChange?.(value);
123
+ }, placement: "top", matchTriggerWidth: false })) : null,
124
+ reasoningLive ? (h(ChoiceSelect, { hidden: derived(() => unwrap(options.reasoningOptions ?? []).length === 0), options: derived(() => unwrap(options.reasoningOptions ?? [])), value: options.reasoning ?? localReasoning, "aria-label": assistantCopy.reasoning, onValueChange: (value) => {
125
+ if (options.reasoning === undefined)
126
+ localReasoning.value = value;
127
+ options.onReasoningChange?.(value);
128
+ }, placement: "top", matchTriggerWidth: false })) : null,
129
+ options.composerTrailing,
130
+ trailing));
131
+ return (h("div", { ref: context.parts.root },
132
+ h(ChatComposer, { layout: "bar", value: text, placeholder: assistantCopy.placeholder, inputLabel: assistantCopy.composer, submitLabel: assistantCopy.send, disabled: disabled, readOnly: Boolean(options.readOnly), submitDisabled: submitDisabled, trailing: choices, attachments: h(ChatAttachments, { hidden: derived(() => draft.value.attachments.length === 0), items: derived(() => draft.value.attachments.map((attachment) => ({
168
133
  ...attachment,
169
134
  onRemove: disabled.value
170
135
  ? undefined
171
136
  : () => change({
172
137
  ...draft.value,
173
- attachments: draft.value.attachments.filter((item) => item !== attachment),
138
+ attachments: draft.value.attachments.filter((item) => item.id !== attachment.id),
174
139
  }),
175
- })),
176
- })
177
- : null),
178
- hint: assistantDerived(context, () => unwrap(options.disabledReason ?? "")),
179
- onSubmit: send,
180
- onInput: (event) => {
181
- textVersion++;
182
- change({ ...draft.value, text: event.target.value });
183
- resize();
184
- },
185
- onKeyDown: (event) => {
186
- if (event.target === textarea &&
187
- event.key === "Enter" &&
188
- !event.shiftKey &&
189
- !event.isComposing &&
190
- event.keyCode !== 229)
191
- void send(event);
192
- },
193
- ref: (form) => {
194
- let active = true;
195
- let stop;
196
- const observer = new ResizeObserver(resize);
197
- observer.observe(form);
198
- // Host refs run before children mount; find the native input after this tree is mounted.
199
- queueMicrotask(() => {
200
- if (!active || disposed || !form.isConnected)
201
- return;
202
- textarea = form.querySelector("textarea");
203
- stop = context.effect(() => {
204
- const value = text.value;
205
- textarea.disabled = !!disabled.value;
206
- textarea.readOnly = !!options.readOnly;
207
- queueMicrotask(() => {
208
- if (!disposed && textarea) {
209
- if (textarea.value !== value)
210
- textarea.value = value;
211
- resize();
212
- }
213
- });
214
- });
215
- resize();
216
- });
217
- return () => {
218
- active = false;
219
- stop?.();
220
- observer.disconnect();
221
- textarea = undefined;
222
- };
223
- },
224
- children: options.allowAttachments === false
225
- ? []
226
- : [
227
- h(IconButton, {
228
- label: assistantCopy.attach,
229
- disabled: assistantDerived(context, () => disabled.value || attaching.value),
230
- onClick: () => fileInput?.click(),
231
- children: h(Icon, { name: "paperclip" }),
232
- }),
233
- context.part("file", "input", {
234
- type: "file",
235
- multiple: true,
236
- hidden: true,
237
- onChange: attach,
238
- ref: (element) => {
140
+ }))) }), hint: derived(() => unwrap(options.disabledReason ?? "")), onSubmit: send, onInput: (event) => {
141
+ textVersion++;
142
+ change({ ...draft.value, text: event.target.value });
143
+ }, onKeyDown: (event) => {
144
+ const target = event.target;
145
+ if (target instanceof HTMLTextAreaElement &&
146
+ target.dataset.chatInput !== undefined &&
147
+ event.key === "Enter" &&
148
+ !event.shiftKey &&
149
+ !event.isComposing &&
150
+ event.keyCode !== 229)
151
+ void send(event);
152
+ } }, options.allowAttachments === false ? null : (h(Fragment, null,
153
+ h(IconButton, { label: assistantCopy.attach, disabled: derived(() => disabled.value || attaching.value), onClick: () => fileInput?.click() },
154
+ h(Icon, { name: "paperclip" })),
155
+ h("input", { type: "file", multiple: true, hidden: true, onChange: attach, ref: [
156
+ context.parts.file,
157
+ (element) => {
239
158
  fileInput = element;
240
159
  },
241
- }),
242
- ],
243
- }), context.part("feedback", "p", { role: "status", hidden: assistantDerived(context, () => !feedback.value) }, feedback));
244
- });
160
+ ] })))),
161
+ h("p", { role: "status", hidden: derived(() => !feedback.value), ref: context.parts.feedback }, feedback)));
162
+ }
163
+ AssistantComposer.meta = {
164
+ name: "assistant-composer",
165
+ parts: ["root", "choices", "feedback", "file"],
166
+ };
@@ -1,22 +1,36 @@
1
- import { type LifecycleScope, type Signal } from "meowjsx";
2
- import type { AssistantMessage, AssistantMessagePart, AssistantProcessStep, AssistantViewProps } from "./assistant-types.js";
3
- /** All derived values live in their owning component lifecycle. */
4
- export declare function assistantDerived<T>(context: Pick<LifecycleScope, "signal" | "effect">, read: () => T): import("meowjsx").WritableSignal<T>;
5
- export declare const assistantStepsContract: {
6
- readonly name: "assistant-steps";
7
- readonly parts: readonly ["root", "step", "label", "description", "status"];
8
- };
9
- export declare const AssistantSteps: import("meowjsx").Component<{
1
+ import { type Context, type Signal } from "meowjsx";
2
+ import type { AssistantLabels, AssistantMessage, AssistantMessagePart, AssistantProcessStep, AssistantViewProps } from "./assistant-types.js";
3
+ export declare function AssistantSteps({ steps }: {
10
4
  steps: Signal<readonly AssistantProcessStep[]>;
11
- }, "assistant-steps", "description" | "label" | "root" | "status" | "step">;
12
- export declare const AssistantPartView: import("meowjsx").Component<{
5
+ }, context: Context<typeof AssistantSteps>): import("meowjsx").VNode;
6
+ export declare namespace AssistantSteps {
7
+ var meta: {
8
+ readonly name: "assistant-steps";
9
+ readonly parts: readonly ["root", "step", "label", "description", "status"];
10
+ };
11
+ }
12
+ export declare function AssistantPartView({ value, message, renderPart, onToolAction, }: {
13
13
  value: Signal<AssistantMessagePart>;
14
14
  message: Signal<AssistantMessage>;
15
15
  renderPart?: AssistantViewProps["renderPart"];
16
16
  onToolAction?: AssistantViewProps["onToolAction"];
17
- }, "assistant-part", "root">;
18
- export declare const AssistantMessageView: import("meowjsx").Component<{
17
+ }, context: Context<typeof AssistantPartView>): import("meowjsx").VNode;
18
+ export declare namespace AssistantPartView {
19
+ var meta: {
20
+ readonly name: "assistant-part";
21
+ readonly parts: readonly ["root"];
22
+ };
23
+ }
24
+ export declare function AssistantMessageView({ value, renderPart, onToolAction, onMessageAction, labels, }: {
19
25
  value: Signal<AssistantMessage>;
20
26
  renderPart?: AssistantViewProps["renderPart"];
21
27
  onToolAction?: AssistantViewProps["onToolAction"];
22
- }, "assistant-message", "root">;
28
+ onMessageAction?: AssistantViewProps["onMessageAction"];
29
+ labels?: AssistantLabels;
30
+ }, context: Context<typeof AssistantMessageView>): import("meowjsx").VNode;
31
+ export declare namespace AssistantMessageView {
32
+ var meta: {
33
+ readonly name: "assistant-message";
34
+ readonly parts: readonly ["root"];
35
+ };
36
+ }
@@ -1,114 +1,121 @@
1
- import { defineComponent, h, keyed, unwrap, } from "meowjsx";
1
+ import { derived, h, keyed, unwrap } from "meowjsx";
2
+ // Fragment is required by the classic JSX transform for process status content.
3
+ // eslint-disable-next-line no-unused-vars
4
+ import { Fragment } from "meowjsx";
2
5
  import { ChatMessage } from "./message.js";
6
+ import { ChatBubble } from "./bubble.js";
3
7
  import { ChatAttachments } from "./attachments.js";
4
8
  import { ChatToolCall } from "./tool-call.js";
5
9
  import { ChatTask } from "./task.js";
6
10
  import { ProcessGroup } from "../components/process-group.js";
7
11
  import { CodeBlock } from "../components/code-block.js";
12
+ import { Status } from "../components/status.js";
8
13
  import { StatusDot } from "../components/status-dot.js";
14
+ import { executionStateLabel, executionStateTone } from "../shared/execution-state.js";
9
15
  import { AssistantMarkdown } from "./assistant-markdown.js";
10
- /** All derived values live in their owning component lifecycle. */
11
- export function assistantDerived(context, read) {
12
- const value = context.signal(read());
13
- context.effect(() => {
14
- value.value = read();
15
- });
16
- return value;
16
+ import { ChatMessageActions } from "./message-actions.js";
17
+ import { IconButton } from "../components/icon-button.js";
18
+ import { Icon } from "../icons/icon.js";
19
+ function AssistantStep({ value }, context) {
20
+ const parts = context.parts;
21
+ return (h("li", { ref: parts.step },
22
+ h(StatusDot, { state: derived(() => value.value.tone ?? "unknown") }),
23
+ h("div", { ref: parts.label },
24
+ h("strong", null, derived(() => value.value.title)),
25
+ h("p", { hidden: derived(() => !value.value.description), ref: parts.description }, derived(() => value.value.description ?? ""))),
26
+ h("span", { ref: parts.status }, derived(() => value.value.statusText ?? ""))));
17
27
  }
18
- export const assistantStepsContract = {
28
+ AssistantStep.meta = {
19
29
  name: "assistant-steps",
20
30
  parts: ["root", "step", "label", "description", "status"],
21
31
  };
22
- const AssistantStep = defineComponent(assistantStepsContract, ({ value }, context) => context.part("step", "li", null, h(StatusDot, { state: assistantDerived(context, () => value.value.tone ?? "unknown") }), context.part("label", "div", null, h("strong", null, assistantDerived(context, () => value.value.title)), context.part("description", "p", { hidden: assistantDerived(context, () => !value.value.description) }, assistantDerived(context, () => value.value.description ?? ""))), context.part("status", "span", null, assistantDerived(context, () => value.value.statusText ?? ""))));
23
- export const AssistantSteps = defineComponent(assistantStepsContract, ({ steps }, context) => context.part("root", "ol", null, keyed(steps, (step) => step.id, (value) => h(AssistantStep, { value }))));
24
- export const AssistantPartView = defineComponent({ name: "assistant-part", parts: ["root"] }, ({ value, message, renderPart, onToolAction }, context) => {
25
- // The keyed identity includes kind, so this component's structural variant is stable.
32
+ export function AssistantSteps({ steps }, context) {
33
+ return (h("ol", { ref: context.parts.root }, keyed(steps, (step) => step.id, (value) => (h(AssistantStep, { value: value })))));
34
+ }
35
+ AssistantSteps.meta = AssistantStep.meta;
36
+ export function AssistantPartView({ value, message, renderPart, onToolAction, }, context) {
26
37
  const initial = value.value;
27
- const custom = renderPart
28
- ? assistantDerived(context, () => renderPart(value.value, message.value))
29
- : undefined;
38
+ const custom = renderPart ? derived(() => renderPart(value.value, message.value)) : undefined;
30
39
  let fallback;
31
40
  if (initial.kind === "text") {
32
- fallback = h(AssistantMarkdown, {
33
- text: assistantDerived(context, () => value.value.text),
34
- });
41
+ const text = h(AssistantMarkdown, { text: derived(() => value.value.text) });
42
+ fallback = message.value.role === "user" ? h(ChatBubble, null, text) : text;
35
43
  }
36
44
  else if (initial.kind === "tool") {
37
45
  const tool = () => value.value;
38
- fallback = h(ChatToolCall, {
39
- label: assistantDerived(context, () => tool().label),
40
- summary: assistantDerived(context, () => tool().summary),
41
- state: assistantDerived(context, () => tool().state ?? "unknown"),
42
- statusLabel: assistantDerived(context, () => tool().statusLabel),
43
- input: assistantDerived(context, () => tool().input),
44
- output: assistantDerived(context, () => tool().output),
45
- outputSummary: assistantDerived(context, () => tool().outputSummary),
46
- maxLines: initial.maxLines,
47
- collapsible: true,
48
- open: initial.defaultOpen ?? false,
49
- onRetry: onToolAction
46
+ fallback = (h(ChatToolCall, { icon: initial.icon ? h(Icon, { name: initial.icon }) : undefined, label: derived(() => tool().label), summary: derived(() => tool().summary), state: derived(() => tool().state ?? "unknown"), statusLabel: derived(() => tool().statusLabel), input: derived(() => tool().input), output: derived(() => tool().output), outputSummary: derived(() => tool().outputSummary), maxLines: initial.maxLines, collapsible: true, open: initial.defaultOpen ?? false, onRetry: onToolAction
50
47
  ? () => {
51
48
  if (tool().canRetry && !tool().retryDisabled)
52
49
  onToolAction(message.value.id, tool().id, "retry");
53
50
  }
54
- : undefined,
55
- onCancel: onToolAction
51
+ : undefined, onCancel: onToolAction
56
52
  ? () => {
57
53
  if (tool().canCancel && !tool().cancelDisabled)
58
54
  onToolAction(message.value.id, tool().id, "cancel");
59
55
  }
60
- : undefined,
61
- canRetry: assistantDerived(context, () => tool().canRetry ?? false),
62
- canCancel: assistantDerived(context, () => tool().canCancel ?? false),
63
- retryDisabled: assistantDerived(context, () => tool().retryDisabled ?? false),
64
- cancelDisabled: assistantDerived(context, () => tool().cancelDisabled ?? false),
65
- });
56
+ : undefined, canRetry: derived(() => tool().canRetry ?? false), canCancel: derived(() => tool().canCancel ?? false), retryDisabled: derived(() => tool().retryDisabled ?? false), cancelDisabled: derived(() => tool().cancelDisabled ?? false) }));
66
57
  }
67
58
  else if (initial.kind === "task") {
68
59
  const task = () => value.value;
69
- fallback = h(ChatTask, {
70
- title: assistantDerived(context, () => task().title),
71
- state: assistantDerived(context, () => task().state),
72
- statusLabel: assistantDerived(context, () => task().statusLabel),
73
- description: assistantDerived(context, () => task().description),
74
- executionText: assistantDerived(context, () => task().executionText),
75
- replyText: assistantDerived(context, () => task().replyText),
76
- progress: assistantDerived(context, () => task().progress),
77
- children: h(AssistantSteps, {
78
- steps: assistantDerived(context, () => task().steps ?? []),
79
- }),
80
- });
60
+ fallback = (h(ChatTask, { title: derived(() => task().title), state: derived(() => task().state), statusLabel: derived(() => task().statusLabel), description: derived(() => task().description), executionText: derived(() => task().executionText), replyText: derived(() => task().replyText), progress: derived(() => task().progress) },
61
+ h(AssistantSteps, { steps: derived(() => task().steps ?? []) })));
81
62
  }
82
63
  else if (initial.kind === "process") {
83
- fallback = h(ProcessGroup, {
84
- title: assistantDerived(context, () => value.value.title),
85
- status: assistantDerived(context, () => value.value.statusText),
86
- open: initial.defaultOpen ?? false,
87
- children: h(AssistantSteps, {
88
- steps: assistantDerived(context, () => value.value.steps),
89
- }),
90
- });
64
+ const processPart = () => value.value;
65
+ const statusText = derived(() => processPart().statusText);
66
+ const status = initial.state === undefined ? (statusText) : (h(Fragment, null,
67
+ h(Status, { state: derived(() => executionStateTone(processPart().state ?? "unknown")), label: derived(() => executionStateLabel(processPart().state ?? "unknown")) }),
68
+ h("span", { hidden: derived(() => !processPart().statusText) }, statusText)));
69
+ fallback = (h(ProcessGroup, { title: derived(() => processPart().title), status: status, open: initial.defaultOpen ?? false },
70
+ h(AssistantSteps, { steps: derived(() => processPart().steps) })));
91
71
  }
92
72
  else if (initial.kind === "code") {
93
- // CodeBlock owns its copy/wrap/highlight lifecycle. Replace only this block on code changes.
94
- fallback = assistantDerived(context, () => {
95
- const part = value.value;
96
- return h(CodeBlock, { code: part.code, language: part.language });
97
- });
98
- }
99
- else {
100
- fallback = assistantDerived(context, () => h(ChatAttachments, { items: value.value.items }));
73
+ fallback = (h(CodeBlock, { code: derived(() => value.value.code), language: derived(() => value.value.language) }));
101
74
  }
102
- const content = custom ? assistantDerived(context, () => unwrap(custom) ?? fallback) : fallback;
103
- return context.part("root", "div", { "data-assistant-part-id": initial.id, "data-kind": initial.kind }, content);
104
- });
105
- export const AssistantMessageView = defineComponent({ name: "assistant-message", parts: ["root"] }, ({ value, renderPart, onToolAction }, context) => {
106
- const parts = assistantDerived(context, () => value.value.parts);
107
- return context.part("root", "div", { "data-assistant-message-id": value.value.id }, h(ChatMessage, {
108
- role: value.value.role,
109
- author: "",
110
- header: h("div", { "data-assistant-message-header": true }, h("strong", null, assistantDerived(context, () => value.value.author)), h("time", null, assistantDerived(context, () => value.value.timestamp ?? "")), h("span", { role: "status" }, assistantDerived(context, () => value.value.status && value.value.status !== "complete" ? value.value.status : ""))),
111
- surface: "none",
112
- children: keyed(parts, (part) => `${part.id}:${part.kind}`, (part) => h(AssistantPartView, { value: part, message: value, renderPart, onToolAction })),
113
- }));
114
- });
75
+ else
76
+ fallback = h(ChatAttachments, { items: derived(() => value.value.items) });
77
+ return (h("div", { "data-assistant-part-id": initial.id, "data-kind": initial.kind, ref: context.parts.root }, custom ? derived(() => unwrap(custom) ?? fallback) : fallback));
78
+ }
79
+ AssistantPartView.meta = { name: "assistant-part", parts: ["root"] };
80
+ function AssistantReplyActions({ value, labels, onMessageAction, }, context) {
81
+ const copied = context.signal(false);
82
+ let timer;
83
+ context.onCleanup(() => clearTimeout(timer));
84
+ const text = () => value.value.parts.flatMap((part) => (part.kind === "text" ? [part.text] : [])).join("\n\n");
85
+ const intent = (action, icon, label) => (h(IconButton, { size: "small", label: label, onClick: () => onMessageAction?.(value.value.id, action) },
86
+ h(Icon, { name: icon })));
87
+ return (h(ChatMessageActions, null,
88
+ h(IconButton, { size: "small", label: derived(() => (copied.value ? labels.copied : labels.copy)), hidden: derived(() => !text()), onClick: async () => {
89
+ try {
90
+ await navigator.clipboard?.writeText(text());
91
+ }
92
+ catch {
93
+ return;
94
+ }
95
+ copied.value = true;
96
+ clearTimeout(timer);
97
+ timer = setTimeout(() => {
98
+ copied.value = false;
99
+ }, 1600);
100
+ }, "data-copied": derived(() => String(copied.value)) },
101
+ h(Icon, { name: "copy", className: "assistant-copy-idle" }),
102
+ h(Icon, { name: "check", className: "assistant-copy-done" })),
103
+ onMessageAction
104
+ ? [
105
+ intent("good", "thumbs-up", labels.good),
106
+ intent("bad", "thumbs-down", labels.bad),
107
+ intent("regenerate", "refresh-cw", labels.regenerate),
108
+ ]
109
+ : null));
110
+ }
111
+ AssistantReplyActions.meta = { name: "assistant-message", parts: ["root"] };
112
+ export function AssistantMessageView({ value, renderPart, onToolAction, onMessageAction, labels, }, context) {
113
+ const parts = derived(() => value.value.parts);
114
+ const reply = value.value.role === "assistant" && labels;
115
+ return (h("div", { "data-assistant-message-id": value.value.id, "data-assistant-role": value.value.role, ref: context.parts.root }, h(ChatMessage, { role: value.value.role, author: "", header: h("div", { "data-assistant-message-header": true },
116
+ h("strong", null, derived(() => value.value.author)),
117
+ h("time", null, derived(() => value.value.timestamp ?? "")),
118
+ h("span", { role: "status" }, derived(() => value.value.status && value.value.status !== "complete" ? value.value.status : ""))), surface: "none", actions: reply ? (h("div", { "data-assistant-actions": true, hidden: derived(() => !!value.value.status && value.value.status !== "complete") },
119
+ h(AssistantReplyActions, { value: value, labels: reply, onMessageAction: onMessageAction }))) : undefined }, keyed(parts, (part) => `${part.id}:${part.kind}`, (part) => (h(AssistantPartView, { value: part, message: value, renderPart: renderPart, onToolAction: onToolAction }))))));
120
+ }
121
+ AssistantMessageView.meta = { name: "assistant-message", parts: ["root"] };
@@ -1,11 +1,14 @@
1
- import { type Signal } from "meowjsx";
1
+ import { type Context, type Props, type Signal } from "meowjsx";
2
2
  export declare function assistantSafeLink(href: string): string | undefined;
3
3
  /** Raw HTML and images are text. Only explicit safe external links become navigation. */
4
4
  export declare const assistantMarkdown: (text: string) => string;
5
- export declare const assistantMarkdownContract: {
6
- readonly name: "assistant-markdown";
7
- readonly parts: readonly ["root"];
8
- };
9
- export declare const AssistantMarkdown: import("meowjsx").Component<{
5
+ export declare function AssistantMarkdown({ text, ref }: {
10
6
  text: Signal<string>;
11
- }, "assistant-markdown", "root">;
7
+ ref?: Props["ref"];
8
+ }, context: Context<typeof AssistantMarkdown>): import("meowjsx").VNode;
9
+ export declare namespace AssistantMarkdown {
10
+ var meta: {
11
+ readonly name: "assistant-markdown";
12
+ readonly parts: readonly ["root"];
13
+ };
14
+ }
@@ -1,4 +1,4 @@
1
- import { defineComponent } from "meowjsx";
1
+ import { derived, h } from "meowjsx";
2
2
  import { Marked, Renderer } from "marked";
3
3
  const escape = (text) => text.replace(/[&<>"']/g, (value) => ({ "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" })[value]);
4
4
  export function assistantSafeLink(href) {
@@ -23,11 +23,7 @@ renderer.link = function ({ href, title, tokens }) {
23
23
  const markdown = new Marked({ renderer, gfm: true, breaks: true });
24
24
  /** Raw HTML and images are text. Only explicit safe external links become navigation. */
25
25
  export const assistantMarkdown = (text) => markdown.parse(text, { async: false });
26
- export const assistantMarkdownContract = { name: "assistant-markdown", parts: ["root"] };
27
- export const AssistantMarkdown = defineComponent(assistantMarkdownContract, ({ text }, context) => {
28
- const html = context.signal({ __html: assistantMarkdown(text.value) });
29
- context.effect(() => {
30
- html.value = { __html: assistantMarkdown(text.value) };
31
- });
32
- return context.part("root", "div", { dangerouslySetInnerHTML: html });
33
- });
26
+ export function AssistantMarkdown({ text, ref }, context) {
27
+ return (h("div", { dangerouslySetInnerHTML: derived(() => ({ __html: assistantMarkdown(text.value) })), ref: [context.parts.root, ref] }));
28
+ }
29
+ AssistantMarkdown.meta = { name: "assistant-markdown", parts: ["root"] };
@@ -1,12 +1,14 @@
1
- import { type Signal } from "meowjsx";
1
+ import { type Context, type Signal } from "meowjsx";
2
2
  import { type AssistantLabels, type AssistantQuestion, type AssistantViewProps } from "./assistant-types.js";
3
- export declare const assistantQuestionContract: {
4
- readonly name: "assistant-question";
5
- readonly parts: readonly ["root", "answer", "options"];
6
- };
7
- export declare const AssistantQuestionView: import("meowjsx").Component<{
3
+ export declare function AssistantQuestionView({ value, onAnswer, onDismiss, labels, }: {
8
4
  value: Signal<AssistantQuestion>;
9
5
  onAnswer?: AssistantViewProps["onAnswer"];
10
6
  onDismiss?: AssistantViewProps["onDismissQuestion"];
11
7
  labels?: Partial<AssistantLabels>;
12
- }, "assistant-question", "answer" | "options" | "root">;
8
+ }, context: Context<typeof AssistantQuestionView>): import("meowjsx").VNode;
9
+ export declare namespace AssistantQuestionView {
10
+ var meta: {
11
+ readonly name: "assistant-question";
12
+ readonly parts: readonly ["root", "answer", "options"];
13
+ };
14
+ }