@lostgradient/cinder 0.8.0 → 0.11.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 (371) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/README.md +2 -2
  3. package/components.json +140 -18
  4. package/dist/components/_internal/command-list-context.d.ts +3 -3
  5. package/dist/components/_internal/create-command-list-state.svelte.d.ts +11 -11
  6. package/dist/components/access-gate/index.js +435 -218
  7. package/dist/components/approval-card/approval-card-actions.svelte.d.ts +16 -0
  8. package/dist/components/approval-card/approval-card-state.d.ts +65 -0
  9. package/dist/components/approval-card/approval-card.css +269 -92
  10. package/dist/components/approval-card/approval-card.schema.js +10 -31
  11. package/dist/components/approval-card/approval-card.svelte.d.ts +3 -3
  12. package/dist/components/approval-card/approval-card.types.d.ts +14 -28
  13. package/dist/components/approval-card/index.d.ts +1 -1
  14. package/dist/components/approval-card/index.js +4268 -2884
  15. package/dist/components/card/card.css +5 -0
  16. package/dist/components/card/card.schema.js +2 -2
  17. package/dist/components/card/card.types.d.ts +2 -2
  18. package/dist/components/card/index.js +2 -1
  19. package/dist/components/chat/builders.d.ts +17 -8
  20. package/dist/components/chat/chat.schema.js +44 -2
  21. package/dist/components/chat/chat.svelte.d.ts +4 -2
  22. package/dist/components/chat/chat.types.d.ts +34 -3
  23. package/dist/components/chat/container/chat.svelte.d.ts +4 -2
  24. package/dist/components/chat/conversation-model.d.ts +1 -1
  25. package/dist/components/chat/index.d.ts +4 -4
  26. package/dist/components/chat/index.js +2767 -6278
  27. package/dist/components/chat/input/chat-attachment-serialization.d.ts +9 -0
  28. package/dist/components/chat/input/chat-input.svelte.d.ts +22 -1
  29. package/dist/components/chat/input/index.d.ts +1 -0
  30. package/dist/components/chat/utilities/conversation.d.ts +6 -6
  31. package/dist/components/chat-composer-popover/chat-composer-popover-filter.d.ts +11 -0
  32. package/dist/components/chat-composer-popover/chat-composer-popover.css +7 -0
  33. package/dist/components/chat-composer-popover/chat-composer-popover.css.d.ts +1 -0
  34. package/dist/components/chat-composer-popover/chat-composer-popover.schema.d.ts +3 -0
  35. package/dist/components/chat-composer-popover/chat-composer-popover.schema.js +150 -0
  36. package/dist/components/chat-composer-popover/chat-composer-popover.svelte.d.ts +46 -0
  37. package/dist/components/chat-composer-popover/chat-composer-popover.types.d.ts +77 -0
  38. package/dist/components/chat-composer-popover/chat-composer-popover.variables.d.ts +2 -0
  39. package/dist/components/chat-composer-popover/chat-composer-popover.variables.js +61 -0
  40. package/dist/components/chat-composer-popover/index.d.ts +6 -0
  41. package/dist/components/chat-composer-popover/index.js +3285 -0
  42. package/dist/components/chat-conversation-header/index.js +577 -4537
  43. package/dist/components/chat-conversation-list/index.js +24 -3984
  44. package/dist/components/code-block/code-block.schema.js +5 -1
  45. package/dist/components/code-block/code-block.types.d.ts +6 -0
  46. package/dist/components/code-block/index.js +4 -4
  47. package/dist/components/command-item/index.js +7 -6
  48. package/dist/components/command-menu/command-menu.schema.js +5 -1
  49. package/dist/components/command-menu/command-menu.types.d.ts +2 -0
  50. package/dist/components/command-menu/index.js +48 -19
  51. package/dist/components/command-palette/index.js +40 -14
  52. package/dist/components/connection-indicator/connection-indicator.css +136 -0
  53. package/dist/components/connection-indicator/connection-indicator.css.d.ts +1 -0
  54. package/dist/components/connection-indicator/connection-indicator.schema.d.ts +3 -0
  55. package/dist/components/connection-indicator/connection-indicator.schema.js +89 -0
  56. package/dist/components/connection-indicator/connection-indicator.svelte.d.ts +21 -0
  57. package/dist/components/connection-indicator/connection-indicator.types.d.ts +46 -0
  58. package/dist/components/connection-indicator/connection-indicator.variables.d.ts +2 -0
  59. package/dist/components/connection-indicator/connection-indicator.variables.js +61 -0
  60. package/dist/components/connection-indicator/index.d.ts +5 -0
  61. package/dist/components/connection-indicator/index.js +409 -0
  62. package/dist/components/container/container.schema.js +4 -4
  63. package/dist/components/event-stream-viewer/index.js +44 -44
  64. package/dist/components/experimental/json-viewer/index.js +44 -44
  65. package/dist/components/invocation-rule-builder/index.d.ts +1 -1
  66. package/dist/components/invocation-rule-builder/index.js +305 -150
  67. package/dist/components/invocation-rule-builder/invocation-rule-builder.css +28 -0
  68. package/dist/components/invocation-rule-builder/invocation-rule-builder.schema.js +89 -5
  69. package/dist/components/invocation-rule-builder/invocation-rule-builder.svelte.d.ts +2 -1
  70. package/dist/components/invocation-rule-builder/invocation-rule-builder.types.d.ts +114 -16
  71. package/dist/components/json-schema-editor/index.js +5 -2
  72. package/dist/components/json-viewer/index.js +44 -44
  73. package/dist/components/json-viewer/json-viewer.css +10 -6
  74. package/dist/components/payload-inspector/index.d.ts +1 -1
  75. package/dist/components/payload-inspector/index.js +306 -1422
  76. package/dist/components/payload-inspector/payload-inspector.css +15 -75
  77. package/dist/components/payload-inspector/payload-inspector.schema.js +5 -41
  78. package/dist/components/payload-inspector/payload-inspector.svelte.d.ts +5 -5
  79. package/dist/components/payload-inspector/payload-inspector.types.d.ts +10 -56
  80. package/dist/components/run-step-timeline/index.d.ts +1 -1
  81. package/dist/components/run-step-timeline/index.js +992 -559
  82. package/dist/components/run-step-timeline/run-step-branch-disclosure.svelte.d.ts +17 -0
  83. package/dist/components/run-step-timeline/run-step-timeline.css +124 -0
  84. package/dist/components/run-step-timeline/run-step-timeline.schema.js +873 -350
  85. package/dist/components/run-step-timeline/run-step-timeline.svelte.d.ts +1 -15
  86. package/dist/components/run-step-timeline/run-step-timeline.types.d.ts +182 -5
  87. package/dist/components/run-step-timeline/run-step-timeline.utilities.d.ts +52 -0
  88. package/dist/components/schedule-builder/index.d.ts +5 -0
  89. package/dist/components/schedule-builder/index.js +3176 -0
  90. package/dist/components/schedule-builder/schedule-builder.css +121 -0
  91. package/dist/components/schedule-builder/schedule-builder.css.d.ts +1 -0
  92. package/dist/components/schedule-builder/schedule-builder.schema.d.ts +3 -0
  93. package/dist/components/schedule-builder/schedule-builder.schema.js +141 -0
  94. package/dist/components/schedule-builder/schedule-builder.svelte.d.ts +22 -0
  95. package/dist/components/schedule-builder/schedule-builder.types.d.ts +130 -0
  96. package/dist/components/schedule-builder/schedule-builder.utilities.d.ts +78 -0
  97. package/dist/components/schedule-builder/schedule-builder.variables.d.ts +2 -0
  98. package/dist/components/schedule-builder/schedule-builder.variables.js +61 -0
  99. package/dist/components/tab/index.js +5 -2
  100. package/dist/components/tab/tab.schema.js +7 -3
  101. package/dist/components/tab/tab.svelte.d.ts +2 -1
  102. package/dist/components/tab/tab.types.d.ts +8 -2
  103. package/dist/components/tabs/index.js +5 -2
  104. package/dist/components/tag-input/index.js +22 -4
  105. package/dist/components/tag-input/tag-input.schema.js +5 -1
  106. package/dist/components/tag-input/tag-input.types.d.ts +4 -0
  107. package/dist/components/team-section/index.js +2 -1
  108. package/dist/components/testimonial-section/index.js +2 -1
  109. package/dist/index.d.ts +10 -4
  110. package/dist/index.js +28577 -30168
  111. package/dist/server/components/access-gate/index.js +3 -1
  112. package/dist/server/components/accordion/index.js +2 -2
  113. package/dist/server/components/alert-dialog/index.js +2 -2
  114. package/dist/server/components/approval-card/index.js +15 -19
  115. package/dist/server/components/autocomplete/index.js +7 -7
  116. package/dist/server/components/avatar-group/index.js +5 -5
  117. package/dist/server/components/button-group/index.js +3 -5
  118. package/dist/server/components/card/index.js +2 -2
  119. package/dist/server/components/chat/index.js +15 -12
  120. package/dist/server/components/chat-composer-popover/index.js +26 -0
  121. package/dist/server/components/chat-conversation-header/index.js +10 -11
  122. package/dist/server/components/chat-conversation-list/index.js +4 -5
  123. package/dist/server/components/checkbox/index.js +3 -3
  124. package/dist/server/components/choice-grid/index.js +2 -2
  125. package/dist/server/components/code-block/index.js +2 -2
  126. package/dist/server/components/color-field/index.js +3 -3
  127. package/dist/server/components/combobox/index.js +6 -6
  128. package/dist/server/components/command-item/index.js +5 -3
  129. package/dist/server/components/command-menu/index.js +6 -4
  130. package/dist/server/components/command-palette/index.js +2 -2
  131. package/dist/server/components/confirm-dialog/index.js +2 -2
  132. package/dist/server/components/connection-indicator/index.js +16 -0
  133. package/dist/server/components/context-menu/index.js +5 -5
  134. package/dist/server/components/data-table/index.js +5 -5
  135. package/dist/server/components/date-picker/index.js +6 -6
  136. package/dist/server/components/date-range-field/index.js +7 -7
  137. package/dist/server/components/description-list/index.js +3 -5
  138. package/dist/server/components/diff-viewer/index.js +9 -8
  139. package/dist/server/components/drawer/index.js +3 -3
  140. package/dist/server/components/dropdown/index.js +4 -4
  141. package/dist/server/components/event-stream-viewer/index.js +2 -2
  142. package/dist/server/components/experimental/json-viewer/index.js +2 -2
  143. package/dist/server/components/faceted-filter-bar/index.js +1 -1
  144. package/dist/server/components/hover-card/index.js +1 -1
  145. package/dist/server/components/input/index.js +3 -3
  146. package/dist/server/components/invocation-rule-builder/index.js +1 -1
  147. package/dist/server/components/json-schema-editor/index.js +24 -23
  148. package/dist/server/components/json-viewer/index.js +2 -2
  149. package/dist/server/components/markdown-editor/index.js +13 -13
  150. package/dist/server/components/modal/index.js +1 -1
  151. package/dist/server/components/multi-select/index.js +1 -1
  152. package/dist/server/components/newsletter-section/index.js +3 -3
  153. package/dist/server/components/payload-inspector/index.js +4 -16
  154. package/dist/server/components/popover/index.js +5 -5
  155. package/dist/server/components/review-editor/index.js +27 -26
  156. package/dist/server/components/run-step-timeline/index.js +2 -2
  157. package/dist/server/components/schedule-builder/index.js +30 -0
  158. package/dist/server/components/schema-form/index.js +4 -4
  159. package/dist/server/components/secret-value-field/index.js +3 -5
  160. package/dist/server/components/segment/index.js +3 -3
  161. package/dist/server/components/segmented-control/index.js +4 -4
  162. package/dist/server/components/selection-popover/index.js +4 -4
  163. package/dist/server/components/sheet/index.js +2 -2
  164. package/dist/server/components/side-navigation/index.js +2 -2
  165. package/dist/server/components/sidebar/index.js +3 -3
  166. package/dist/server/components/tab/index.js +2 -2
  167. package/dist/server/components/table/index.js +3 -3
  168. package/dist/server/components/tabs/index.js +4 -4
  169. package/dist/server/components/tag-input/index.js +3 -3
  170. package/dist/server/components/team-section/index.js +8 -8
  171. package/dist/server/components/testimonial-section/index.js +2 -2
  172. package/dist/server/components/time-field/index.js +5 -3
  173. package/dist/server/components/toggle/index.js +2 -2
  174. package/dist/server/components/tooltip/index.js +1 -1
  175. package/dist/server/index.js +235 -211
  176. package/dist/server/{index.server-20y4mdhm.js → index.server-0chhpkg7.js} +40 -14
  177. package/dist/server/index.server-0sx92swg.js +9 -0
  178. package/dist/server/{index.server-ecm1vs3g.js → index.server-1nq7z1qw.js} +1 -1
  179. package/dist/server/{index.server-s9khh4ry.js → index.server-2bbwajb2.js} +3 -5
  180. package/dist/server/index.server-2hqrv7ca.js +9 -0
  181. package/dist/server/{index.server-69epaape.js → index.server-2qj6s2mh.js} +1 -1
  182. package/dist/server/{index.server-gxf0d1p5.js → index.server-2s5h1d05.js} +2 -2
  183. package/dist/server/{index.server-qfa2rxzx.js → index.server-2zdbz3rj.js} +3 -5
  184. package/dist/server/{index.server-pt8b65mt.js → index.server-38aywdk1.js} +1 -1
  185. package/dist/server/{index.server-0jhra85x.js → index.server-3w72dxz7.js} +4 -4
  186. package/dist/server/{index.server-rermas0k.js → index.server-47v2fhp4.js} +4 -4
  187. package/dist/server/{index.server-v4zabrsx.js → index.server-4x4hgvqe.js} +434 -26
  188. package/dist/server/{index.server-9j5sym59.js → index.server-4x91gzy1.js} +2 -2
  189. package/dist/server/{index.server-q48q15g7.js → index.server-4y2jtvv1.js} +4 -2
  190. package/dist/server/{index.server-j3ddzcaa.js → index.server-5gzyqv78.js} +6 -6
  191. package/dist/server/index.server-67qgdypc.js +9 -0
  192. package/dist/server/index.server-6hnfzc7f.js +263 -0
  193. package/dist/server/{index.server-9jete4xx.js → index.server-6sh11ap6.js} +4 -4
  194. package/dist/server/{index.server-4ztq565m.js → index.server-85p4ydph.js} +1 -1
  195. package/dist/server/{index.server-4nk7gy0q.js → index.server-894t97kv.js} +1 -1
  196. package/dist/server/{index.server-1vscnped.js → index.server-8dt36sdm.js} +2 -1
  197. package/dist/server/{index.server-bfsbp9dz.js → index.server-8xvc73zh.js} +4 -4
  198. package/dist/server/{index.server-cvnw3hw9.js → index.server-9kz37z89.js} +1 -1
  199. package/dist/server/{index.server-kc1k02tk.js → index.server-9ykk1kbg.js} +1 -1
  200. package/dist/server/{index.server-g789yep6.js → index.server-aqethy0w.js} +2 -2
  201. package/dist/server/index.server-be9bpqeh.js +93 -0
  202. package/dist/server/{index.server-wc9aggfz.js → index.server-bmxbsk4y.js} +7 -7
  203. package/dist/server/{index.server-f3z7tpxr.js → index.server-c42b462p.js} +2 -4
  204. package/dist/server/{index.server-7vyzen5x.js → index.server-c5qv3p61.js} +171 -63
  205. package/dist/server/index.server-cch0eed5.js +144 -0
  206. package/dist/server/{index.server-q89dz8h1.js → index.server-d3pqthtp.js} +4 -3
  207. package/dist/server/{index.server-jk4rx4aa.js → index.server-dmmvwy6p.js} +1 -1
  208. package/dist/server/{index.server-hcfnae5y.js → index.server-dwwqssey.js} +4 -4
  209. package/dist/server/{index.server-e8x1hgw6.js → index.server-dz1r9xw5.js} +4 -4
  210. package/dist/server/{index.server-wm7mk5kw.js → index.server-ez5hp0ya.js} +1 -1
  211. package/dist/server/{index.server-wc8dbm5e.js → index.server-g95bk8rc.js} +4 -2
  212. package/dist/server/index.server-gkazv439.js +576 -0
  213. package/dist/server/index.server-gmh5ar16.js +2 -0
  214. package/dist/server/{index.server-dp9j2kkr.js → index.server-h0cvwvhy.js} +1 -1
  215. package/dist/server/{index.server-cbtg8rq5.js → index.server-h89zk5ev.js} +8 -8
  216. package/dist/server/{index.server-pacrqvyz.js → index.server-h90pjrez.js} +1 -1
  217. package/dist/server/{index.server-p8d04em5.js → index.server-hcsd5gdb.js} +6 -2
  218. package/dist/server/{index.server-n39drzes.js → index.server-hpeavvnq.js} +1 -1
  219. package/dist/server/{index.server-1p3patnj.js → index.server-hx91ng7z.js} +1 -1
  220. package/dist/server/{index.server-mehav5vs.js → index.server-jdcq5zza.js} +7 -7
  221. package/dist/server/{index.server-jync915v.js → index.server-jfrssta6.js} +25 -25
  222. package/dist/server/{index.server-jtj3r53y.js → index.server-jgb8yh5k.js} +1 -1
  223. package/dist/server/{index.server-ejyf7e48.js → index.server-jj76374p.js} +1 -1
  224. package/dist/server/{index.server-w1g5q9j9.js → index.server-jtgw9d23.js} +4 -2
  225. package/dist/server/{index.server-hd8gpehd.js → index.server-jxseyx33.js} +1 -1
  226. package/dist/server/{index.server-kg2sepsr.js → index.server-krqvnt6p.js} +14 -15
  227. package/dist/server/{index.server-0e1m3agz.js → index.server-ks49bprh.js} +1 -1
  228. package/dist/server/{index.server-f0hma3jp.js → index.server-kt0ncrqs.js} +1 -1
  229. package/dist/server/index.server-m0ezemav.js +170 -0
  230. package/dist/server/index.server-m191rm44.js +79 -0
  231. package/dist/server/{index.server-z721a5gp.js → index.server-n82rcv0m.js} +4 -4
  232. package/dist/server/{index.server-rhhmdxtz.js → index.server-np3c7kx0.js} +4 -4
  233. package/dist/server/{index.server-hpcs7tmh.js → index.server-p56xxef1.js} +1 -1
  234. package/dist/server/{index.server-w83kmcrx.js → index.server-pag862vz.js} +10 -10
  235. package/dist/server/index.server-qbkxz7r2.js +750 -0
  236. package/dist/server/{index.server-sh2rxejg.js → index.server-qke3ekjt.js} +1 -1
  237. package/dist/server/{index.server-73x2d3j3.js → index.server-rbpvcrr3.js} +1 -1
  238. package/dist/server/{index.server-8cxs4kya.js → index.server-rga8sc7j.js} +41 -44
  239. package/dist/server/{index.server-e3fnv1g6.js → index.server-sedjxt36.js} +5 -5
  240. package/dist/server/{index.server-pen9pxt6.js → index.server-sf3nk3j2.js} +2 -2
  241. package/dist/server/{index.server-f23vtaw4.js → index.server-tcay903b.js} +8 -7
  242. package/dist/server/{index.server-7fp0epev.js → index.server-veastatv.js} +4 -4
  243. package/dist/server/{index.server-jeqg2d22.js → index.server-xeqtpv61.js} +1 -1
  244. package/dist/server/{index.server-9s4na701.js → index.server-xjnge1yw.js} +4 -4
  245. package/dist/server/index.server-xtjjmsyq.js +315 -0
  246. package/dist/server/{index.server-hhxjaeen.js → index.server-xz99aed4.js} +4 -4
  247. package/dist/server/{index.server-vne4rzfa.js → index.server-y4n8vc08.js} +1 -1
  248. package/dist/server/{index.server-5d01cn4f.js → index.server-y83kqayt.js} +4 -4
  249. package/dist/server/{index.server-1nh09ck7.js → index.server-yhzydqxe.js} +5 -5
  250. package/dist/server/index.server-z38bxms8.js +734 -0
  251. package/dist/server/{index.server-atjc1qcq.js → index.server-z7hxtqs1.js} +1 -1
  252. package/dist/server/{index.server-w6k62afr.js → index.server-ze1ymmbw.js} +2 -2
  253. package/dist/server/{index.server-914v805w.js → index.server-zgd1g8mk.js} +1 -1
  254. package/dist/server/{index.server-aeexcxdp.js → index.server-zh3r8vfd.js} +1 -1
  255. package/dist/server/{index.server-10jb2jzm.js → index.server-zsjf8enc.js} +4 -4
  256. package/package.json +102 -5
  257. package/src/components/_internal/command-list-context.ts +3 -3
  258. package/src/components/_internal/create-command-list-state.svelte.ts +39 -13
  259. package/src/components/approval-card/approval-card-actions.svelte +168 -0
  260. package/src/components/approval-card/approval-card-state.ts +152 -1
  261. package/src/components/approval-card/approval-card.css +269 -92
  262. package/src/components/approval-card/approval-card.examples.json +3 -3
  263. package/src/components/approval-card/approval-card.schema.json +9 -30
  264. package/src/components/approval-card/approval-card.schema.ts +13 -31
  265. package/src/components/approval-card/approval-card.svelte +176 -470
  266. package/src/components/approval-card/approval-card.types.ts +15 -28
  267. package/src/components/approval-card/index.ts +1 -0
  268. package/src/components/card/card.css +5 -0
  269. package/src/components/card/card.schema.json +1 -1
  270. package/src/components/card/card.schema.ts +1 -1
  271. package/src/components/card/card.svelte +1 -0
  272. package/src/components/card/card.types.ts +2 -2
  273. package/src/components/chat/builders.ts +445 -14
  274. package/src/components/chat/chat.schema.json +36 -1
  275. package/src/components/chat/chat.schema.ts +44 -1
  276. package/src/components/chat/chat.svelte +12 -0
  277. package/src/components/chat/chat.types.ts +35 -3
  278. package/src/components/chat/container/chat.svelte +73 -3
  279. package/src/components/chat/conversation-model.ts +1 -0
  280. package/src/components/chat/index.ts +16 -3
  281. package/src/components/chat/input/chat-attachment-serialization.ts +63 -0
  282. package/src/components/chat/input/chat-input.svelte +22 -5
  283. package/src/components/chat/input/index.ts +5 -0
  284. package/src/components/chat/utilities/conversation.ts +33 -15
  285. package/src/components/chat-composer-popover/chat-composer-popover-filter.ts +68 -0
  286. package/src/components/chat-composer-popover/chat-composer-popover.css +7 -0
  287. package/src/components/chat-composer-popover/chat-composer-popover.examples.json +13 -0
  288. package/src/components/chat-composer-popover/chat-composer-popover.schema.json +90 -0
  289. package/src/components/chat-composer-popover/chat-composer-popover.schema.ts +95 -0
  290. package/src/components/chat-composer-popover/chat-composer-popover.svelte +234 -0
  291. package/src/components/chat-composer-popover/chat-composer-popover.types.ts +88 -0
  292. package/src/components/chat-composer-popover/chat-composer-popover.variables.json +1 -0
  293. package/src/components/chat-composer-popover/chat-composer-popover.variables.ts +3 -0
  294. package/src/components/chat-composer-popover/index.ts +19 -0
  295. package/src/components/code-block/code-block.schema.json +4 -0
  296. package/src/components/code-block/code-block.schema.ts +5 -0
  297. package/src/components/code-block/code-block.svelte +3 -3
  298. package/src/components/code-block/code-block.types.ts +6 -0
  299. package/src/components/command-item/command-item.svelte +7 -6
  300. package/src/components/command-menu/command-menu.schema.json +4 -0
  301. package/src/components/command-menu/command-menu.schema.ts +4 -0
  302. package/src/components/command-menu/command-menu.svelte +16 -5
  303. package/src/components/command-menu/command-menu.types.ts +2 -0
  304. package/src/components/connection-indicator/connection-indicator.css +136 -0
  305. package/src/components/connection-indicator/connection-indicator.examples.json +31 -0
  306. package/src/components/connection-indicator/connection-indicator.schema.json +29 -0
  307. package/src/components/connection-indicator/connection-indicator.schema.ts +36 -0
  308. package/src/components/connection-indicator/connection-indicator.svelte +63 -0
  309. package/src/components/connection-indicator/connection-indicator.types.ts +58 -0
  310. package/src/components/connection-indicator/connection-indicator.variables.json +1 -0
  311. package/src/components/connection-indicator/connection-indicator.variables.ts +3 -0
  312. package/src/components/connection-indicator/index.ts +10 -0
  313. package/src/components/container/container.schema.json +3 -3
  314. package/src/components/container/container.schema.ts +3 -3
  315. package/src/components/invocation-rule-builder/index.ts +4 -0
  316. package/src/components/invocation-rule-builder/invocation-rule-builder.css +28 -0
  317. package/src/components/invocation-rule-builder/invocation-rule-builder.examples.json +6 -0
  318. package/src/components/invocation-rule-builder/invocation-rule-builder.schema.json +76 -3
  319. package/src/components/invocation-rule-builder/invocation-rule-builder.schema.ts +83 -3
  320. package/src/components/invocation-rule-builder/invocation-rule-builder.svelte +326 -113
  321. package/src/components/invocation-rule-builder/invocation-rule-builder.types.ts +157 -43
  322. package/src/components/json-viewer/_json-viewer-node.svelte +15 -1
  323. package/src/components/json-viewer/json-viewer.css +10 -6
  324. package/src/components/payload-inspector/index.ts +0 -2
  325. package/src/components/payload-inspector/payload-inspector.css +15 -75
  326. package/src/components/payload-inspector/payload-inspector.examples.json +5 -5
  327. package/src/components/payload-inspector/payload-inspector.schema.json +3 -31
  328. package/src/components/payload-inspector/payload-inspector.schema.ts +3 -36
  329. package/src/components/payload-inspector/payload-inspector.svelte +46 -239
  330. package/src/components/payload-inspector/payload-inspector.types.ts +10 -58
  331. package/src/components/run-step-timeline/index.ts +8 -0
  332. package/src/components/run-step-timeline/run-step-branch-disclosure.svelte +16 -0
  333. package/src/components/run-step-timeline/run-step-timeline.css +124 -0
  334. package/src/components/run-step-timeline/run-step-timeline.examples.json +18 -0
  335. package/src/components/run-step-timeline/run-step-timeline.schema.json +872 -349
  336. package/src/components/run-step-timeline/run-step-timeline.schema.ts +931 -349
  337. package/src/components/run-step-timeline/run-step-timeline.svelte +387 -268
  338. package/src/components/run-step-timeline/run-step-timeline.types.ts +192 -5
  339. package/src/components/run-step-timeline/run-step-timeline.utilities.ts +242 -0
  340. package/src/components/schedule-builder/index.ts +14 -0
  341. package/src/components/schedule-builder/schedule-builder.css +121 -0
  342. package/src/components/schedule-builder/schedule-builder.examples.json +31 -0
  343. package/src/components/schedule-builder/schedule-builder.schema.json +78 -0
  344. package/src/components/schedule-builder/schedule-builder.schema.ts +86 -0
  345. package/src/components/schedule-builder/schedule-builder.svelte +629 -0
  346. package/src/components/schedule-builder/schedule-builder.types.ts +137 -0
  347. package/src/components/schedule-builder/schedule-builder.utilities.ts +344 -0
  348. package/src/components/schedule-builder/schedule-builder.variables.json +1 -0
  349. package/src/components/schedule-builder/schedule-builder.variables.ts +3 -0
  350. package/src/components/tab/tab.schema.json +6 -2
  351. package/src/components/tab/tab.schema.ts +8 -2
  352. package/src/components/tab/tab.svelte +9 -5
  353. package/src/components/tab/tab.types.ts +8 -2
  354. package/src/components/tag-input/tag-input.schema.json +4 -0
  355. package/src/components/tag-input/tag-input.schema.ts +4 -0
  356. package/src/components/tag-input/tag-input.svelte +20 -3
  357. package/src/components/tag-input/tag-input.types.ts +4 -0
  358. package/src/index.ts +41 -5
  359. package/src/styles/components.css +3 -0
  360. package/dist/server/index-49we2xfs.js +0 -344
  361. package/dist/server/index-8fhvxk30.js +0 -265
  362. package/dist/server/index-x2ysg8ds.js +0 -388
  363. package/dist/server/index.server-20j0jh30.js +0 -9
  364. package/dist/server/index.server-dc35kh7d.js +0 -1835
  365. package/dist/server/index.server-kd4b0342.js +0 -607
  366. package/dist/server/index.server-n5cdmsz4.js +0 -30
  367. package/dist/server/index.server-pxg74pyp.js +0 -393
  368. package/dist/server/index.server-rjap4k7y.js +0 -1389
  369. package/dist/server/index.server-vt6sn9y4.js +0 -447
  370. package/dist/server/index.server-w63n618v.js +0 -9
  371. package/dist/server/index.server-y2pa1k46.js +0 -9
@@ -50,6 +50,26 @@
50
50
  "type": "string",
51
51
  "description": "Optional status label displayed in the typing indicator while `streaming` is `true` and no streaming content has arrived yet (e.g. `\"Thinking…\"` or `\"Analyzing file…\"`). When omitted, three animated dots are shown."
52
52
  },
53
+ "composerRole": {
54
+ "type": "string",
55
+ "description": "Explicit role for the composer textarea, for overlay patterns such as ARIA comboboxes."
56
+ },
57
+ "composerAriaExpanded": {
58
+ "enum": [false, true, "true", "false"],
59
+ "description": "`aria-expanded` passed to the composer textarea for overlays such as slash-command menus."
60
+ },
61
+ "composerAriaControls": {
62
+ "type": "string",
63
+ "description": "`aria-controls` passed to the composer textarea for overlays such as slash-command menus."
64
+ },
65
+ "composerAriaActiveDescendant": {
66
+ "type": "string",
67
+ "description": "`aria-activedescendant` passed to the composer textarea for overlays such as slash-command menus."
68
+ },
69
+ "composerAriaAutocomplete": {
70
+ "enum": ["none", "inline", "list", "both"],
71
+ "description": "`aria-autocomplete` passed to the composer textarea for overlays such as slash-command menus."
72
+ },
53
73
  "virtualized": {
54
74
  "type": "boolean",
55
75
  "description": "Use the virtualized message render path for long transcripts. The complete `ConversationHistory` remains unchanged; only the DOM window is reduced. Default `false`."
@@ -164,10 +184,25 @@
164
184
  "name": "onattachmentremove",
165
185
  "reason": "function-or-snippet"
166
186
  },
187
+ {
188
+ "name": "oncomposerblur",
189
+ "reason": "function-or-snippet",
190
+ "description": "Called when focus leaves the composer textarea. Overlay primitives can use\nthis to dismiss without preventing native focus movement."
191
+ },
167
192
  {
168
193
  "name": "oncomposerinput",
169
194
  "reason": "function-or-snippet",
170
- "description": "Called with the composer's current plain-text value on every composer\ninput event. Lets a consumer build slash-command, mention, or autocomplete\nUX without reaching into `.chat-input-editor` DOM directly."
195
+ "description": "Called with the composer's current plain-text value on every composer\ninput event. The optional event exposes the textarea for composer-bound\noverlays without reaching into `.chat-input-editor` DOM directly."
196
+ },
197
+ {
198
+ "name": "oncomposerkeydown",
199
+ "reason": "function-or-snippet",
200
+ "description": "Called before Chat's internal composer key handling when a keydown\noriginates from the composer textarea. Call `event.preventDefault()` to\nlet an overlay consume Arrow keys, Enter, or Escape before Enter-to-send.\nChat does not call this hook during IME composition, so Enter can still\nconfirm the active candidate instead of sending."
201
+ },
202
+ {
203
+ "name": "oncomposerselectionchange",
204
+ "reason": "function-or-snippet",
205
+ "description": "Called after pointer or selection activity may have moved the composer\ncaret without changing text. Overlay primitives can resync their active\ntoken from the textarea selection."
171
206
  },
172
207
  {
173
208
  "name": "ondeny",
@@ -63,6 +63,31 @@ const schema = {
63
63
  description:
64
64
  'Optional status label displayed in the typing indicator while `streaming` is `true` and no streaming content has arrived yet (e.g. `"Thinking…"` or `"Analyzing file…"`). When omitted, three animated dots are shown.',
65
65
  },
66
+ composerRole: {
67
+ type: 'string',
68
+ description:
69
+ 'Explicit role for the composer textarea, for overlay patterns such as ARIA comboboxes.',
70
+ },
71
+ composerAriaExpanded: {
72
+ enum: [false, true, 'true', 'false'],
73
+ description:
74
+ '`aria-expanded` passed to the composer textarea for overlays such as slash-command menus.',
75
+ },
76
+ composerAriaControls: {
77
+ type: 'string',
78
+ description:
79
+ '`aria-controls` passed to the composer textarea for overlays such as slash-command menus.',
80
+ },
81
+ composerAriaActiveDescendant: {
82
+ type: 'string',
83
+ description:
84
+ '`aria-activedescendant` passed to the composer textarea for overlays such as slash-command menus.',
85
+ },
86
+ composerAriaAutocomplete: {
87
+ enum: ['none', 'inline', 'list', 'both'],
88
+ description:
89
+ '`aria-autocomplete` passed to the composer textarea for overlays such as slash-command menus.',
90
+ },
66
91
  virtualized: {
67
92
  type: 'boolean',
68
93
  description:
@@ -191,11 +216,29 @@ const schema = {
191
216
  name: 'onattachmentremove',
192
217
  reason: 'function-or-snippet',
193
218
  },
219
+ {
220
+ name: 'oncomposerblur',
221
+ reason: 'function-or-snippet',
222
+ description:
223
+ 'Called when focus leaves the composer textarea. Overlay primitives can use\nthis to dismiss without preventing native focus movement.',
224
+ },
194
225
  {
195
226
  name: 'oncomposerinput',
196
227
  reason: 'function-or-snippet',
197
228
  description:
198
- "Called with the composer's current plain-text value on every composer\ninput event. Lets a consumer build slash-command, mention, or autocomplete\nUX without reaching into `.chat-input-editor` DOM directly.",
229
+ "Called with the composer's current plain-text value on every composer\ninput event. The optional event exposes the textarea for composer-bound\noverlays without reaching into `.chat-input-editor` DOM directly.",
230
+ },
231
+ {
232
+ name: 'oncomposerkeydown',
233
+ reason: 'function-or-snippet',
234
+ description:
235
+ "Called before Chat's internal composer key handling when a keydown\noriginates from the composer textarea. Call `event.preventDefault()` to\nlet an overlay consume Arrow keys, Enter, or Escape before Enter-to-send.\nChat does not call this hook during IME composition, so Enter can still\nconfirm the active candidate instead of sending.",
236
+ },
237
+ {
238
+ name: 'oncomposerselectionchange',
239
+ reason: 'function-or-snippet',
240
+ description:
241
+ 'Called after pointer or selection activity may have moved the composer\ncaret without changing text. Overlay primitives can resync their active\ntoken from the textarea selection.',
199
242
  },
200
243
  {
201
244
  name: 'ondeny',
@@ -30,6 +30,14 @@ export function pushToken(token) {
30
30
  export function endStreaming() {
31
31
  impl?.endStreaming();
32
32
  }
33
+ /**
34
+ * Announce consumer-rendered status text through Chat's existing live regions.
35
+ * No-op until mounted. Built-in tool-approval announcements take precedence
36
+ * over consumer assertive announcements to avoid duplicate urgent output.
37
+ */
38
+ export function announce(message, level = 'polite') {
39
+ impl?.announce(message, level);
40
+ }
33
41
  /** Scroll the message viewport to the bottom. No-op until mounted. */
34
42
  export function scrollToBottom() {
35
43
  impl?.scrollToBottom();
@@ -50,6 +58,10 @@ export function clearInput() {
50
58
  export function getComposerValue() {
51
59
  return impl?.getComposerValue() ?? '';
52
60
  }
61
+ /** Read the composer textarea element. Returns null until mounted. */
62
+ export function getEditorElement() {
63
+ return impl?.getEditorElement() ?? null;
64
+ }
53
65
  </script>
54
66
 
55
67
  <ChatImplementation bind:this={impl} class={mergedClassName} {...rest} />
@@ -49,6 +49,9 @@ export type ReadReceipt = {
49
49
  readBy?: string[];
50
50
  };
51
51
 
52
+ /** Live-region channel for imperative Chat announcements. */
53
+ export type ChatAnnounceLevel = 'polite' | 'assertive';
54
+
52
55
  /**
53
56
  * Full-row override snippet. Inversion of control: receives the message AND a
54
57
  * `renderDefault` snippet that renders the built-in row, so a consumer can wrap
@@ -127,6 +130,16 @@ export type ChatProps = Omit<HTMLAttributes<HTMLElement>, 'class' | 'onsubmit'>
127
130
  * rather than as five separate boolean props.
128
131
  */
129
132
  capabilities?: ChatCapabilities;
133
+ /** Explicit role for the composer textarea, for overlay patterns such as ARIA comboboxes. */
134
+ composerRole?: string | undefined;
135
+ /** `aria-expanded` passed to the composer textarea for overlays such as slash-command menus. */
136
+ composerAriaExpanded?: boolean | 'true' | 'false' | undefined;
137
+ /** `aria-controls` passed to the composer textarea for overlays such as slash-command menus. */
138
+ composerAriaControls?: string | undefined;
139
+ /** `aria-activedescendant` passed to the composer textarea for overlays such as slash-command menus. */
140
+ composerAriaActiveDescendant?: string | undefined;
141
+ /** `aria-autocomplete` passed to the composer textarea for overlays such as slash-command menus. */
142
+ composerAriaAutocomplete?: 'none' | 'inline' | 'list' | 'both' | undefined;
130
143
  /** Use the virtualized message render path for long transcripts. The complete `ConversationHistory` remains unchanged; only the DOM window is reduced. Default `false`. */
131
144
  virtualized?: boolean;
132
145
  /** Estimated row height in pixels for virtualized message rows. Default `88`. */
@@ -245,8 +258,27 @@ export type ChatProps = Omit<HTMLAttributes<HTMLElement>, 'class' | 'onsubmit'>
245
258
  onattachmentfailure?: (file: File, error: string) => void;
246
259
  /**
247
260
  * Called with the composer's current plain-text value on every composer
248
- * input event. Lets a consumer build slash-command, mention, or autocomplete
249
- * UX without reaching into `.chat-input-editor` DOM directly.
261
+ * input event. The optional event exposes the textarea for composer-bound
262
+ * overlays without reaching into `.chat-input-editor` DOM directly.
263
+ */
264
+ oncomposerinput?: (value: string, event?: Event) => void;
265
+ /**
266
+ * Called before Chat's internal composer key handling when a keydown
267
+ * originates from the composer textarea. Call `event.preventDefault()` to
268
+ * let an overlay consume Arrow keys, Enter, or Escape before Enter-to-send.
269
+ * Chat does not call this hook during IME composition, so Enter can still
270
+ * confirm the active candidate instead of sending.
271
+ */
272
+ oncomposerkeydown?: (event: KeyboardEvent) => void;
273
+ /**
274
+ * Called after pointer or selection activity may have moved the composer
275
+ * caret without changing text. Overlay primitives can resync their active
276
+ * token from the textarea selection.
277
+ */
278
+ oncomposerselectionchange?: (event: Event) => void;
279
+ /**
280
+ * Called when focus leaves the composer textarea. Overlay primitives can use
281
+ * this to dismiss without preventing native focus movement.
250
282
  */
251
- oncomposerinput?: (value: string) => void;
283
+ oncomposerblur?: (event: FocusEvent) => void;
252
284
  };
@@ -26,7 +26,8 @@ import { useChatReadReceipts } from './use-chat-read-receipts.svelte.ts';
26
26
  import ChatParticipantTyping from './chat-participant-typing.svelte';
27
27
  import ChatReadReceipt from '../message/chat-read-receipt.svelte';
28
28
  const noopAttachment = () => { };
29
- let { id, conversation, atBottom = $bindable(true), unreadCount = $bindable(0), newMessageIndicatorVisible = $bindable(false), class: className, surfaceMode = 'default', density = 'comfortable', variant = 'bubble', bottomThreshold = DEFAULT_SCROLL_CONFIGURATION.bottomThreshold, jumpThreshold = DEFAULT_SCROLL_CONFIGURATION.jumpThreshold, streaming = false, streamingStatus, capabilities, virtualized = false, virtualizationEstimatedRowHeight = 88, virtualizationOverscan = 3, virtualizationInitialHeight = 640, moreHistoryAvailable = true, loadEarlierLabel = 'Load earlier messages', loadingEarlierLabel = 'Loading earlier messages', header, empty, emptyPrompts, messageActions, messageStatus, row, messagePart, viewportAttachment, typingParticipants, readReceipts, adapter, onadaptererror, onpushmessage, ontypingchange, onreadreceipt, onsubmit, onretry, onedit, onapprove, ondeny, messageReasoning, messageSteps, messageSuggestions, onsuggestionselect, onloadhistory, onstopgenerating, onjumptolatest, onscrollstatechange, onunreadindicatorchange, onexpandedchange, onattachmentadd, onattachmentremove, onattachmentfailure, oncomposerinput, ...rest } = $props();
29
+ const CONSUMER_ANNOUNCEMENT_CLEAR_DELAY_MS = 1000;
30
+ let { id, conversation, atBottom = $bindable(true), unreadCount = $bindable(0), newMessageIndicatorVisible = $bindable(false), class: className, surfaceMode = 'default', density = 'comfortable', variant = 'bubble', bottomThreshold = DEFAULT_SCROLL_CONFIGURATION.bottomThreshold, jumpThreshold = DEFAULT_SCROLL_CONFIGURATION.jumpThreshold, streaming = false, streamingStatus, capabilities, virtualized = false, virtualizationEstimatedRowHeight = 88, virtualizationOverscan = 3, virtualizationInitialHeight = 640, moreHistoryAvailable = true, loadEarlierLabel = 'Load earlier messages', loadingEarlierLabel = 'Loading earlier messages', header, empty, emptyPrompts, messageActions, messageStatus, row, messagePart, viewportAttachment, typingParticipants, readReceipts, adapter, onadaptererror, onpushmessage, ontypingchange, onreadreceipt, onsubmit, onretry, onedit, onapprove, ondeny, messageReasoning, messageSteps, messageSuggestions, onsuggestionselect, onloadhistory, onstopgenerating, onjumptolatest, onscrollstatechange, onunreadindicatorchange, onexpandedchange, onattachmentadd, onattachmentremove, onattachmentfailure, oncomposerinput, oncomposerkeydown, oncomposerselectionchange, oncomposerblur, composerRole, composerAriaExpanded, composerAriaControls, composerAriaActiveDescendant, composerAriaAutocomplete, ...rest } = $props();
30
31
  // ==========================================================================
31
32
  // Refs and Internal State
32
33
  // ==========================================================================
@@ -84,10 +85,15 @@ $effect(() => {
84
85
  toolCallState.reset();
85
86
  typingIndicatorState.reset();
86
87
  readReceiptsState.reset();
88
+ clearConsumerAnnouncements();
87
89
  });
88
90
  let isLoadingHistory = $state(false);
89
91
  let adapterHasMoreHistory = $state(undefined);
90
92
  let historyAnnouncement = $state('');
93
+ let consumerPoliteAnnouncement = $state('');
94
+ let consumerAssertiveAnnouncement = $state('');
95
+ let consumerPoliteAnnouncementTimeout;
96
+ let consumerAssertiveAnnouncementTimeout;
91
97
  let pendingHistoryScroll = $state(null);
92
98
  let deferredAdapterHasMoreHistory = null;
93
99
  let historyAnchorMessageId = $state(null);
@@ -325,6 +331,13 @@ const toolApprovalAssertiveMessage = $derived.by(() => {
325
331
  }
326
332
  return '';
327
333
  });
334
+ const assertiveAnnouncement = $derived(toolApprovalAssertiveMessage || consumerAssertiveAnnouncement);
335
+ const politeAnnouncement = $derived(consumerPoliteAnnouncement || historyAnnouncement || unreadState.announcerMessage);
336
+ $effect(() => {
337
+ if (toolApprovalAssertiveMessage && consumerAssertiveAnnouncement) {
338
+ clearConsumerAssertiveAnnouncement();
339
+ }
340
+ });
328
341
  // ==========================================================================
329
342
  // Scroll Anchoring via $effect.pre
330
343
  // ==========================================================================
@@ -516,6 +529,7 @@ $effect(() => {
516
529
  cancelAnimationFrame(streamingScrollRaf);
517
530
  streamingScrollRaf = undefined;
518
531
  }
532
+ clearConsumerAnnouncements();
519
533
  };
520
534
  });
521
535
  // ==========================================================================
@@ -588,6 +602,50 @@ const historyAnchorScrollAttachment = $derived(historyAnchorMessageId === null |
588
602
  // ==========================================================================
589
603
  // Actions
590
604
  // ==========================================================================
605
+ export function announce(message, level = 'polite') {
606
+ const trimmedMessage = message.trim();
607
+ if (!trimmedMessage)
608
+ return;
609
+ if (level === 'assertive') {
610
+ if (toolApprovalAssertiveMessage)
611
+ return;
612
+ setConsumerAssertiveAnnouncement(trimmedMessage);
613
+ return;
614
+ }
615
+ setConsumerPoliteAnnouncement(trimmedMessage);
616
+ }
617
+ function setConsumerPoliteAnnouncement(message) {
618
+ clearTimeout(consumerPoliteAnnouncementTimeout);
619
+ consumerPoliteAnnouncement = message;
620
+ consumerPoliteAnnouncementTimeout = setTimeout(() => {
621
+ if (consumerPoliteAnnouncement === message)
622
+ consumerPoliteAnnouncement = '';
623
+ consumerPoliteAnnouncementTimeout = undefined;
624
+ }, CONSUMER_ANNOUNCEMENT_CLEAR_DELAY_MS);
625
+ }
626
+ function setConsumerAssertiveAnnouncement(message) {
627
+ clearTimeout(consumerAssertiveAnnouncementTimeout);
628
+ consumerAssertiveAnnouncement = message;
629
+ consumerAssertiveAnnouncementTimeout = setTimeout(() => {
630
+ if (consumerAssertiveAnnouncement === message)
631
+ consumerAssertiveAnnouncement = '';
632
+ consumerAssertiveAnnouncementTimeout = undefined;
633
+ }, CONSUMER_ANNOUNCEMENT_CLEAR_DELAY_MS);
634
+ }
635
+ function clearConsumerPoliteAnnouncement() {
636
+ clearTimeout(consumerPoliteAnnouncementTimeout);
637
+ consumerPoliteAnnouncementTimeout = undefined;
638
+ consumerPoliteAnnouncement = '';
639
+ }
640
+ function clearConsumerAssertiveAnnouncement() {
641
+ clearTimeout(consumerAssertiveAnnouncementTimeout);
642
+ consumerAssertiveAnnouncementTimeout = undefined;
643
+ consumerAssertiveAnnouncement = '';
644
+ }
645
+ function clearConsumerAnnouncements() {
646
+ clearConsumerPoliteAnnouncement();
647
+ clearConsumerAssertiveAnnouncement();
648
+ }
591
649
  function handleJumpToLatest() {
592
650
  if (isVirtualized) {
593
651
  chatVirtualizer.scrollToIndex(Math.max(0, renderRows.length - 1), {
@@ -1069,6 +1127,10 @@ export function clearInput() {
1069
1127
  export function getComposerValue() {
1070
1128
  return inputRef?.getValue() ?? '';
1071
1129
  }
1130
+ /** Read the composer textarea element. Returns null until mounted. */
1131
+ export function getEditorElement() {
1132
+ return inputRef?.getEditorElement() ?? null;
1133
+ }
1072
1134
  /**
1073
1135
  * Begin streaming content for a specific message.
1074
1136
  * The message should already exist in the conversation.
@@ -1414,6 +1476,14 @@ function virtualRowAttachment(row) {
1414
1476
  {allowAttachments}
1415
1477
  onstop={streaming ? handleStopGenerating : undefined}
1416
1478
  {oncomposerinput}
1479
+ {oncomposerkeydown}
1480
+ {oncomposerselectionchange}
1481
+ {oncomposerblur}
1482
+ {composerRole}
1483
+ {composerAriaExpanded}
1484
+ {composerAriaControls}
1485
+ {composerAriaActiveDescendant}
1486
+ {composerAriaAutocomplete}
1417
1487
  {onattachmentadd}
1418
1488
  {onattachmentremove}
1419
1489
  {onattachmentfailure}
@@ -1424,8 +1494,8 @@ function virtualRowAttachment(row) {
1424
1494
  <ChatStatusAnnouncer
1425
1495
  {statusId}
1426
1496
  messageCount={messages.length}
1427
- announcerMessage={historyAnnouncement || unreadState.announcerMessage}
1428
- assertiveMessage={toolApprovalAssertiveMessage}
1497
+ announcerMessage={politeAnnouncement}
1498
+ assertiveMessage={assertiveAnnouncement}
1429
1499
  />
1430
1500
 
1431
1501
  <!-- Typing-participant live region: outside role="log" to avoid double announcement.
@@ -13,6 +13,7 @@ import type { ToMarkdownOptions as ConversationalistToMarkdownOptions } from 'co
13
13
  export type {
14
14
  AssistantMessage,
15
15
  ContainerUploadContent,
16
+ ConversationEnvironment,
16
17
  ConversationHistory,
17
18
  ConversationStatus,
18
19
  ImageContent,
@@ -13,7 +13,13 @@ import './chat.css';
13
13
  import Chat from './chat.svelte';
14
14
 
15
15
  export default Chat;
16
- export type { ChatCapabilities, ChatProps, ReadReceipt, TypingParticipant } from './chat.types.ts';
16
+ export type {
17
+ ChatAnnounceLevel,
18
+ ChatCapabilities,
19
+ ChatProps,
20
+ ReadReceipt,
21
+ TypingParticipant,
22
+ } from './chat.types.ts';
17
23
  export { Chat };
18
24
 
19
25
  // Adapter seam — the optional event/transport boundary around <Chat>. Type-only.
@@ -40,6 +46,7 @@ export {
40
46
  export type {
41
47
  AssistantMessage,
42
48
  ContainerUploadContent,
49
+ ConversationEnvironment,
43
50
  ConversationHistory,
44
51
  ConversationStatus,
45
52
  ExportOptions,
@@ -80,8 +87,14 @@ export {
80
87
  } from './utilities';
81
88
 
82
89
  // Input
83
- export { ChatAttachmentPreview, ChatInput, deriveAttachmentKind } from './input';
84
- export type { AttachmentKind, ChatAttachment } from './input';
90
+ export {
91
+ ChatAttachmentPreview,
92
+ ChatInput,
93
+ deriveAttachmentKind,
94
+ serializeChatAttachment,
95
+ serializeChatAttachments,
96
+ } from './input';
97
+ export type { AttachmentKind, ChatAttachment, SerializedChatAttachment } from './input';
85
98
 
86
99
  // Message
87
100
  export {
@@ -0,0 +1,63 @@
1
+ import type { ChatAttachment } from './chat-attachment.ts';
2
+
3
+ const BASE64_CHUNK_SIZE = 0x8000;
4
+
5
+ type Base64Runtime = typeof globalThis & {
6
+ btoa?: (data: string) => string;
7
+ Buffer?: {
8
+ from: (data: Uint8Array) => { toString: (encoding: 'base64') => string };
9
+ };
10
+ };
11
+
12
+ export interface SerializedChatAttachment {
13
+ name: string;
14
+ mimeType: string;
15
+ kind: ChatAttachment['kind'];
16
+ content: string;
17
+ }
18
+
19
+ function bytesToBase64(bytes: Uint8Array): string {
20
+ const runtime = globalThis as Base64Runtime;
21
+
22
+ if (typeof runtime.btoa === 'function') {
23
+ let binary = '';
24
+
25
+ for (let start = 0; start < bytes.length; start += BASE64_CHUNK_SIZE) {
26
+ const chunk = bytes.subarray(start, start + BASE64_CHUNK_SIZE);
27
+ binary += String.fromCharCode(...chunk);
28
+ }
29
+
30
+ return runtime.btoa(binary);
31
+ }
32
+
33
+ if (typeof runtime.Buffer?.from === 'function') {
34
+ return runtime.Buffer.from(bytes).toString('base64');
35
+ }
36
+
37
+ throw new Error('serializeChatAttachment requires btoa or Buffer for base64 encoding.');
38
+ }
39
+
40
+ export async function serializeChatAttachment(
41
+ attachment: ChatAttachment,
42
+ ): Promise<SerializedChatAttachment> {
43
+ const bytes = new Uint8Array(await attachment.file.arrayBuffer());
44
+
45
+ return {
46
+ name: attachment.file.name,
47
+ mimeType: attachment.file.type,
48
+ kind: attachment.kind,
49
+ content: bytesToBase64(bytes),
50
+ };
51
+ }
52
+
53
+ export async function serializeChatAttachments(
54
+ attachments: readonly ChatAttachment[],
55
+ ): Promise<SerializedChatAttachment[]> {
56
+ const serializedAttachments: SerializedChatAttachment[] = [];
57
+
58
+ for (const attachment of attachments) {
59
+ serializedAttachments.push(await serializeChatAttachment(attachment));
60
+ }
61
+
62
+ return serializedAttachments;
63
+ }
@@ -40,7 +40,7 @@ const attachmentIdFactory = createIdFactory('attachment');
40
40
  // Tracks hash-derived IDs used in this instance so collisions (same name/size/mtime)
41
41
  // get a unique suffix rather than a duplicate DOM ID.
42
42
  const usedAttachmentIds = new Set();
43
- let { id, value = $bindable(''), placeholder = 'Type a message...', composerLabel = 'Message', disabled = false, sending = false, error, class: className, action, name = 'content', clearOnSubmit = true, allowAttachments = true, maxFileSize = 10 * 1024 * 1024, // 10MB
43
+ let { id, value = $bindable(''), placeholder = 'Type a message...', composerLabel = 'Message', composerRole, composerAriaExpanded, composerAriaControls, composerAriaActiveDescendant, composerAriaAutocomplete, disabled = false, sending = false, error, class: className, action, name = 'content', clearOnSubmit = true, allowAttachments = true, maxFileSize = 10 * 1024 * 1024, // 10MB
44
44
  acceptedTypes = [
45
45
  'image/*',
46
46
  'text/*',
@@ -55,7 +55,7 @@ acceptedTypes = [
55
55
  'application/x-sh',
56
56
  'application/sql',
57
57
  'application/toml',
58
- ], onsubmit, onstop, oncomposerinput, onattachmentadd, onattachmentremove, onattachmentfailure, actions, ...rest } = $props();
58
+ ], onsubmit, onstop, oncomposerinput, oncomposerkeydown, oncomposerselectionchange, oncomposerblur, onattachmentadd, onattachmentremove, onattachmentfailure, actions, ...rest } = $props();
59
59
  const resolvedComposerLabel = $derived(composerLabel.trim() || 'Message');
60
60
  // Derived: show stop button when sending and onstop is provided
61
61
  const showStopButton = $derived(sending && onstop !== undefined);
@@ -266,6 +266,12 @@ function handleKeyDown(event) {
266
266
  if (event.isComposing || isComposing) {
267
267
  return;
268
268
  }
269
+ if (event.target === editorElement) {
270
+ oncomposerkeydown?.(event);
271
+ if (event.defaultPrevented) {
272
+ return;
273
+ }
274
+ }
269
275
  // Shift+Enter: Newline (let editor handle it)
270
276
  if (event.key === 'Enter' && event.shiftKey) {
271
277
  return;
@@ -287,8 +293,8 @@ function handleCompositionEnd() {
287
293
  // Fires after `bind:value` has already applied the textarea's new value
288
294
  // (Svelte merges the binding's own input listener with this handler on the
289
295
  // same event), so `value` here is always current — never one keystroke stale.
290
- function handleInput() {
291
- oncomposerinput?.(value);
296
+ function handleInput(event) {
297
+ oncomposerinput?.(value, event);
292
298
  }
293
299
  // =========================================================================
294
300
  // Imperative API
@@ -307,6 +313,9 @@ export function getAttachments() {
307
313
  export function getValue() {
308
314
  return value;
309
315
  }
316
+ export function getEditorElement() {
317
+ return editorElement;
318
+ }
310
319
  export function addFiles(files) {
311
320
  if (!allowAttachments)
312
321
  return;
@@ -326,7 +335,6 @@ onDestroy(() => {
326
335
  method="POST"
327
336
  {action}
328
337
  onsubmit={handleSubmit}
329
- onkeydown={handleKeyDown}
330
338
  onpaste={handlePaste}
331
339
  ondrop={handleDrop}
332
340
  ondragover={handleDragOver}
@@ -367,9 +375,18 @@ onDestroy(() => {
367
375
  bind:this={editorElement}
368
376
  id={`${id}-editor`}
369
377
  bind:value
378
+ onkeydown={handleKeyDown}
370
379
  oninput={handleInput}
380
+ onpointerup={oncomposerselectionchange}
381
+ onselect={oncomposerselectionchange}
382
+ onblur={oncomposerblur}
371
383
  {placeholder}
384
+ role={composerRole}
372
385
  aria-label={resolvedComposerLabel}
386
+ aria-expanded={composerAriaExpanded}
387
+ aria-controls={composerAriaControls}
388
+ aria-activedescendant={composerAriaActiveDescendant}
389
+ aria-autocomplete={composerAriaAutocomplete}
373
390
  {disabled}
374
391
  readonly={sending}
375
392
  class="chat-input-editor"
@@ -1,4 +1,9 @@
1
1
  export { deriveAttachmentKind, type AttachmentKind } from './attachment-kind.js';
2
2
  export { default as ChatAttachmentPreview } from './chat-attachment-preview.svelte';
3
+ export {
4
+ serializeChatAttachment,
5
+ serializeChatAttachments,
6
+ type SerializedChatAttachment,
7
+ } from './chat-attachment-serialization.ts';
3
8
  export type { ChatAttachment } from './chat-attachment.ts';
4
9
  export { default as ChatInput } from './chat-input.svelte';
@@ -1,26 +1,44 @@
1
1
  /**
2
2
  * Conversation-reading helpers for Chat.
3
3
  *
4
- * These delegate to `conversationalist` so message ordering stays aligned with
5
- * the published conversation package. Tool pairing keeps Chat's role gate so an
6
- * incidental tool-shaped field on a non-tool message never renders as a pair.
4
+ * These helpers operate on the Conversationalist transcript shape while keeping
5
+ * Cinder's browser runtime free of the full conversation package.
7
6
  */
8
7
 
9
- import { getMessages } from 'conversationalist';
10
- import { pairToolCallsWithResults as pairConversationalistToolCallsWithResults } from 'conversationalist/utilities';
8
+ import type {
9
+ ConversationHistory,
10
+ Message,
11
+ ToolCallPair,
12
+ ToolResult,
13
+ } from '../conversation-model.ts';
11
14
 
12
- import type { Message, ToolCallPair } from '../conversation-model.ts';
13
-
14
- function hasPairableToolField(message: Message): boolean {
15
- return (
16
- (message.role === 'tool-call' && message.toolCall !== undefined) ||
17
- (message.role === 'tool-result' && message.toolResult !== undefined)
18
- );
15
+ export function getMessages(
16
+ conversation: ConversationHistory,
17
+ options: { includeHidden?: boolean } = {},
18
+ ): Message[] {
19
+ return conversation.ids
20
+ .map((id) => conversation.messages[id])
21
+ .filter((message): message is Message => message !== undefined)
22
+ .filter((message) => options.includeHidden === true || !message.hidden);
19
23
  }
20
24
 
21
25
  /** Pairs tool calls with role-valid tool results from an already-ordered message array. */
22
26
  export function pairToolCallsWithResults(messages: ReadonlyArray<Message>): ToolCallPair[] {
23
- return pairConversationalistToolCallsWithResults(messages.filter(hasPairableToolField));
24
- }
27
+ const resultsByCallId = new Map<string, ToolResult>();
28
+ for (const message of messages) {
29
+ if (message.role === 'tool-result' && message.toolResult !== undefined) {
30
+ resultsByCallId.set(message.toolResult.callId, message.toolResult);
31
+ }
32
+ }
25
33
 
26
- export { getMessages };
34
+ const pairs: ToolCallPair[] = [];
35
+ for (const message of messages) {
36
+ if (message.role === 'tool-call' && message.toolCall !== undefined) {
37
+ pairs.push({
38
+ call: message.toolCall,
39
+ result: resultsByCallId.get(message.toolCall.id),
40
+ });
41
+ }
42
+ }
43
+ return pairs;
44
+ }
@@ -0,0 +1,68 @@
1
+ export type FuzzyFilterItem = {
2
+ value: string;
3
+ label: string;
4
+ keywords?: readonly string[] | undefined;
5
+ };
6
+
7
+ export type FuzzyFilterResult<TItem extends FuzzyFilterItem> = {
8
+ item: TItem;
9
+ score: number;
10
+ };
11
+
12
+ function normalize(value: string): string {
13
+ return value.trim().toLowerCase();
14
+ }
15
+
16
+ export function fuzzySubsequenceScore(candidate: string, query: string): number | null {
17
+ const normalizedCandidate = normalize(candidate);
18
+ const normalizedQuery = normalize(query);
19
+
20
+ if (normalizedQuery.length === 0) return 0;
21
+ if (normalizedCandidate.length === 0) return null;
22
+
23
+ let score = 0;
24
+ let searchIndex = 0;
25
+ let previousMatchIndex = -1;
26
+
27
+ for (const character of normalizedQuery) {
28
+ const matchIndex = normalizedCandidate.indexOf(character, searchIndex);
29
+ if (matchIndex === -1) return null;
30
+
31
+ score += matchIndex === previousMatchIndex + 1 ? 4 : 1;
32
+ if (matchIndex === 0) score += 2;
33
+ if (/[\s/_-]/u.test(normalizedCandidate[matchIndex - 1] ?? '')) score += 2;
34
+
35
+ previousMatchIndex = matchIndex;
36
+ searchIndex = matchIndex + 1;
37
+ }
38
+
39
+ return score - normalizedCandidate.length * 0.01;
40
+ }
41
+
42
+ export function filterFuzzySubsequence<TItem extends FuzzyFilterItem>(
43
+ items: readonly TItem[],
44
+ query: string,
45
+ ): TItem[] {
46
+ const normalizedQuery = normalize(query);
47
+ if (normalizedQuery.length === 0) return [...items];
48
+
49
+ const matchedItems = items
50
+ .map((item, index) => {
51
+ const candidates = [item.label, item.value, ...(item.keywords ?? [])];
52
+ let bestScore: number | null = null;
53
+
54
+ for (const candidate of candidates) {
55
+ const score = fuzzySubsequenceScore(candidate, normalizedQuery);
56
+ if (score !== null && (bestScore === null || score > bestScore)) {
57
+ bestScore = score;
58
+ }
59
+ }
60
+
61
+ return bestScore === null ? null : { item, index, score: bestScore };
62
+ })
63
+ .filter((result) => result !== null);
64
+
65
+ matchedItems.sort((a, b) => b.score - a.score || a.index - b.index);
66
+
67
+ return matchedItems.map((result) => result.item);
68
+ }