@lostgradient/cinder 0.15.0 → 0.16.1

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 (338) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +3 -3
  3. package/components.json +2 -143
  4. package/dist/components/access-gate/index.js +379 -327
  5. package/dist/components/alert-dialog/index.js +170 -172
  6. package/dist/components/confirm-dialog/index.js +170 -172
  7. package/dist/components/data-table/index.js +88 -31
  8. package/dist/components/drawer/index.js +11 -11
  9. package/dist/components/focus-trap/index.d.ts +1 -0
  10. package/dist/components/focus-trap/index.js +171 -1
  11. package/dist/components/icons/index.d.ts +80 -1
  12. package/dist/components/icons/index.js +1256 -0
  13. package/dist/components/markdown-editor/index.js +170 -170
  14. package/dist/components/modal/index.js +20 -20
  15. package/dist/components/review-editor/index.js +170 -187
  16. package/dist/components/sheet/index.js +11 -11
  17. package/dist/components/sidebar/index.js +37 -37
  18. package/dist/components/table/index.js +85 -28
  19. package/dist/components/table/table.css +11 -0
  20. package/dist/components/table/table.schema.js +10 -1
  21. package/dist/components/table/table.types.d.ts +24 -1
  22. package/dist/index.d.ts +0 -8
  23. package/dist/index.js +23266 -30180
  24. package/dist/server/components/access-gate/index.js +7 -10
  25. package/dist/server/components/alert-dialog/index.js +4 -4
  26. package/dist/server/components/approval-card/index.js +6 -6
  27. package/dist/server/components/autocomplete/index.js +4 -4
  28. package/dist/server/components/choice-grid/index.js +2 -2
  29. package/dist/server/components/color-field/index.js +2 -2
  30. package/dist/server/components/combobox/index.js +3 -3
  31. package/dist/server/components/command-item/index.js +3 -5
  32. package/dist/server/components/command-menu/index.js +3 -5
  33. package/dist/server/components/confirm-dialog/index.js +4 -4
  34. package/dist/server/components/context-menu/index.js +7 -7
  35. package/dist/server/components/data-table/index.js +4 -4
  36. package/dist/server/components/date-picker/index.js +4 -4
  37. package/dist/server/components/date-range-field/index.js +4 -4
  38. package/dist/server/components/diff-viewer/index.js +9 -11
  39. package/dist/server/components/drawer/index.js +4 -4
  40. package/dist/server/components/dropdown/index.js +7 -7
  41. package/dist/server/components/faceted-filter-bar/index.js +2 -2
  42. package/dist/server/components/focus-trap/index.js +7 -2
  43. package/dist/server/components/icons/index.js +156 -0
  44. package/dist/server/components/inline-loading/index.js +1 -1
  45. package/dist/server/components/json-schema-editor/index.js +11 -13
  46. package/dist/server/components/load-more/index.js +2 -3
  47. package/dist/server/components/markdown-editor/index.js +13 -12
  48. package/dist/server/components/menu-bar/index.js +4 -4
  49. package/dist/server/components/modal/index.js +4 -4
  50. package/dist/server/components/popover/index.js +3 -3
  51. package/dist/server/components/review-editor/index.js +169 -122
  52. package/dist/server/components/schedule-builder/index.js +5 -5
  53. package/dist/server/components/schema-form/index.js +1 -1
  54. package/dist/server/components/segment/index.js +3 -3
  55. package/dist/server/components/segmented-control/index.js +4 -4
  56. package/dist/server/components/selection-popover/index.js +3 -3
  57. package/dist/server/components/sheet/index.js +3 -3
  58. package/dist/server/components/sidebar/index.js +4 -4
  59. package/dist/server/components/table/index.js +4 -4
  60. package/dist/server/components/tag-input/index.js +2 -2
  61. package/dist/server/index.js +272 -316
  62. package/dist/server/{index.server-dwwqssey.js → index.server-0qh3v3nq.js} +1 -1
  63. package/dist/server/index.server-25wmev4e.js +2 -0
  64. package/dist/server/{index.server-zdm63dt8.js → index.server-2c56kqws.js} +107 -25
  65. package/dist/server/{index.server-y4n8vc08.js → index.server-2pc5cv6c.js} +1 -1
  66. package/dist/server/{index.server-1vsv7ngz.js → index.server-3g76h7z7.js} +12 -2
  67. package/dist/server/{index.server-xz99aed4.js → index.server-45n4s30n.js} +12 -12
  68. package/dist/server/{index.server-zzd5wpbw.js → index.server-4dfs3xwn.js} +1 -1
  69. package/dist/server/{index.server-vhyjjx9z.js → index.server-4jkqgp17.js} +7 -9
  70. package/dist/server/{index.server-bmxbsk4y.js → index.server-51sxnete.js} +18 -18
  71. package/dist/server/{index.server-1bwvsnjk.js → index.server-6rv1rfwq.js} +37 -14
  72. package/dist/server/{index.server-np3c7kx0.js → index.server-7798gc22.js} +1 -1
  73. package/dist/server/{index.server-2m1kenak.js → index.server-7kjw6qw5.js} +1 -1
  74. package/dist/server/{index.server-tfftb7hs.js → index.server-7zpzspk6.js} +1 -1
  75. package/dist/server/{index.server-7yvpb6z7.js → index.server-894t97kv.js} +4 -4
  76. package/dist/server/{index.server-47v2fhp4.js → index.server-8b35ekqg.js} +1 -1
  77. package/dist/server/{index.server-j5hn2qds.js → index.server-8nm871y8.js} +80 -30
  78. package/dist/server/{index.server-h0cvwvhy.js → index.server-9drzqktm.js} +1 -1
  79. package/dist/server/{index.server-x9s4m9eg.js → index.server-agsdwg53.js} +1 -1
  80. package/dist/server/{index.server-hpeavvnq.js → index.server-b4gp066a.js} +1 -1
  81. package/dist/server/{index.server-gkazv439.js → index.server-bf7d81b4.js} +7 -7
  82. package/dist/server/{index.server-krqvnt6p.js → index.server-d4ft97bx.js} +4 -2
  83. package/dist/server/{index.server-t1x9h8cb.js → index.server-dg19y3m7.js} +1 -1
  84. package/dist/server/{index.server-jt1twhgk.js → index.server-dq0k0qf6.js} +10 -10
  85. package/dist/server/{index.server-pxq277t5.js → index.server-frb9e55d.js} +1 -1
  86. package/dist/server/{index.server-9kz37z89.js → index.server-g3726bja.js} +1 -1
  87. package/dist/server/{index.server-jdcq5zza.js → index.server-gwgm8gqg.js} +8 -8
  88. package/dist/server/index.server-gyzmkrnz.js +2 -0
  89. package/dist/server/{index.server-mr68brd6.js → index.server-jgdtsvz2.js} +1 -1
  90. package/dist/server/{index.server-p56xxef1.js → index.server-m8ya4p7w.js} +1 -1
  91. package/dist/server/{index.server-1nq7z1qw.js → index.server-mda2y5g6.js} +1 -1
  92. package/dist/server/{index.server-e89qfamd.js → index.server-mknhgg07.js} +4 -4
  93. package/dist/server/{index.server-j570vb03.js → index.server-mvjzcna5.js} +1 -1
  94. package/dist/server/index.server-n4jxy52q.js +2 -0
  95. package/dist/server/{index.server-eftvmq3f.js → index.server-pfbzz3x7.js} +1 -1
  96. package/dist/server/{index.server-zrh23kty.js → index.server-pyjzfjfn.js} +1 -1
  97. package/dist/server/{index.server-rga8sc7j.js → index.server-q1d48s9t.js} +40 -36
  98. package/dist/server/{index.server-46cjwcqw.js → index.server-qv0kkre4.js} +5 -5
  99. package/dist/server/{index.server-yhzydqxe.js → index.server-r82zjq88.js} +5 -5
  100. package/dist/server/{index.server-9ykk1kbg.js → index.server-rbd5ys4z.js} +1 -1
  101. package/dist/server/{index.server-tcay903b.js → index.server-tnecnach.js} +4 -4
  102. package/dist/server/{index.server-h89zk5ev.js → index.server-wasj5rbh.js} +8 -8
  103. package/dist/server/{index.server-9ra3xv88.js → index.server-x66zvjfc.js} +9 -9
  104. package/dist/server/index.server-xanq9ppe.js +119 -0
  105. package/dist/server/{index.server-6sh11ap6.js → index.server-y4kfz0er.js} +1 -1
  106. package/dist/server/{index.server-n82rcv0m.js → index.server-z721a5gp.js} +4 -4
  107. package/dist/server/{index.server-mm1xa3kr.js → index.server-zdhv33ph.js} +51 -20
  108. package/dist/server/{index.server-t3hknp1c.js → index.server-zm04d9eq.js} +4 -4
  109. package/dist/server/{index.server-nx9c2ep1.js → index.server-zncgb7mw.js} +2 -2
  110. package/package.json +10 -130
  111. package/src/components/focus-trap/index.ts +1 -0
  112. package/src/components/icons/index.ts +82 -40
  113. package/src/components/table/table.css +11 -0
  114. package/src/components/table/table.examples.json +3 -3
  115. package/src/components/table/table.schema.json +9 -0
  116. package/src/components/table/table.schema.ts +11 -0
  117. package/src/components/table/table.svelte +58 -14
  118. package/src/components/table/table.types.ts +27 -1
  119. package/src/index.ts +0 -34
  120. package/src/styles/components.css +0 -4
  121. package/dist/components/chat/adapter/chat-adapter.d.ts +0 -123
  122. package/dist/components/chat/adapter/index.d.ts +0 -8
  123. package/dist/components/chat/artifact/artifact-panel.svelte.d.ts +0 -15
  124. package/dist/components/chat/artifact/artifact-viewer.svelte.d.ts +0 -10
  125. package/dist/components/chat/artifact/chat-artifact-layout.svelte.d.ts +0 -23
  126. package/dist/components/chat/artifact/index.d.ts +0 -3
  127. package/dist/components/chat/builders.d.ts +0 -25
  128. package/dist/components/chat/chat.css +0 -16
  129. package/dist/components/chat/chat.css.d.ts +0 -1
  130. package/dist/components/chat/chat.schema.d.ts +0 -3
  131. package/dist/components/chat/chat.schema.js +0 -366
  132. package/dist/components/chat/chat.svelte.d.ts +0 -31
  133. package/dist/components/chat/chat.types.d.ts +0 -268
  134. package/dist/components/chat/chat.variables.d.ts +0 -2
  135. package/dist/components/chat/chat.variables.js +0 -61
  136. package/dist/components/chat/container/chat-events.d.ts +0 -22
  137. package/dist/components/chat/container/chat-history-trigger.svelte.d.ts +0 -15
  138. package/dist/components/chat/container/chat-jump-controls.svelte.d.ts +0 -24
  139. package/dist/components/chat/container/chat-participant-typing.svelte.d.ts +0 -31
  140. package/dist/components/chat/container/chat-search-bar.svelte.d.ts +0 -38
  141. package/dist/components/chat/container/chat-status-announcer.svelte.d.ts +0 -21
  142. package/dist/components/chat/container/chat.svelte.d.ts +0 -17
  143. package/dist/components/chat/container/index.d.ts +0 -12
  144. package/dist/components/chat/container/scroll-utilities.d.ts +0 -119
  145. package/dist/components/chat/container/use-chat-disclosure-state.svelte.d.ts +0 -58
  146. package/dist/components/chat/container/use-chat-keyboard-nav.svelte.d.ts +0 -57
  147. package/dist/components/chat/container/use-chat-message-groups.svelte.d.ts +0 -74
  148. package/dist/components/chat/container/use-chat-read-receipts.svelte.d.ts +0 -51
  149. package/dist/components/chat/container/use-chat-scroll-state.svelte.d.ts +0 -111
  150. package/dist/components/chat/container/use-chat-search.svelte.d.ts +0 -82
  151. package/dist/components/chat/container/use-chat-typing-indicator.svelte.d.ts +0 -76
  152. package/dist/components/chat/container/use-chat-unread-state.svelte.d.ts +0 -80
  153. package/dist/components/chat/container/use-chat-virtualizer.svelte.d.ts +0 -47
  154. package/dist/components/chat/conversation-model.d.ts +0 -16
  155. package/dist/components/chat/export/conversation-export-actions.svelte.d.ts +0 -17
  156. package/dist/components/chat/export/index.d.ts +0 -8
  157. package/dist/components/chat/index.d.ts +0 -25
  158. package/dist/components/chat/index.js +0 -11319
  159. package/dist/components/chat/input/attachment-kind.d.ts +0 -10
  160. package/dist/components/chat/input/chat-attachment-preview.svelte.d.ts +0 -8
  161. package/dist/components/chat/input/chat-attachment-serialization.d.ts +0 -9
  162. package/dist/components/chat/input/chat-attachment.d.ts +0 -11
  163. package/dist/components/chat/input/chat-input.svelte.d.ts +0 -79
  164. package/dist/components/chat/input/index.d.ts +0 -5
  165. package/dist/components/chat/message/chat-date-separator.svelte.d.ts +0 -12
  166. package/dist/components/chat/message/chat-message-parts-renderer.svelte.d.ts +0 -4
  167. package/dist/components/chat/message/chat-message-parts.d.ts +0 -96
  168. package/dist/components/chat/message/chat-message.svelte.d.ts +0 -91
  169. package/dist/components/chat/message/chat-read-receipt.svelte.d.ts +0 -27
  170. package/dist/components/chat/message/image-lightbox.svelte.d.ts +0 -17
  171. package/dist/components/chat/message/index.d.ts +0 -6
  172. package/dist/components/chat/message/markdown-preview.svelte.d.ts +0 -8
  173. package/dist/components/chat/message/message-attachments.svelte.d.ts +0 -17
  174. package/dist/components/chat/message/message-content.svelte.d.ts +0 -18
  175. package/dist/components/chat/message/parts/image-part.svelte.d.ts +0 -17
  176. package/dist/components/chat/message/parts/markdown-part.svelte.d.ts +0 -8
  177. package/dist/components/chat/message/parts/reasoning-part.svelte.d.ts +0 -12
  178. package/dist/components/chat/message/parts/step-part.svelte.d.ts +0 -8
  179. package/dist/components/chat/message/parts/suggestion-part.svelte.d.ts +0 -18
  180. package/dist/components/chat/message/parts/tool-approval-part.svelte.d.ts +0 -12
  181. package/dist/components/chat/message/parts/tool-call-part.svelte.d.ts +0 -12
  182. package/dist/components/chat/message/parts/tool-result-part.svelte.d.ts +0 -8
  183. package/dist/components/chat/message/tool-call-group.svelte.d.ts +0 -15
  184. package/dist/components/chat/message/tool-payload-code.svelte.d.ts +0 -9
  185. package/dist/components/chat/utilities/conversation.d.ts +0 -12
  186. package/dist/components/chat/utilities/index.d.ts +0 -9
  187. package/dist/components/chat/utilities/types.d.ts +0 -262
  188. package/dist/components/chat/utilities/utilities.d.ts +0 -140
  189. package/dist/components/chat-composer-popover/chat-composer-popover-filter.d.ts +0 -11
  190. package/dist/components/chat-composer-popover/chat-composer-popover.css +0 -7
  191. package/dist/components/chat-composer-popover/chat-composer-popover.css.d.ts +0 -1
  192. package/dist/components/chat-composer-popover/chat-composer-popover.schema.d.ts +0 -3
  193. package/dist/components/chat-composer-popover/chat-composer-popover.schema.js +0 -150
  194. package/dist/components/chat-composer-popover/chat-composer-popover.svelte.d.ts +0 -46
  195. package/dist/components/chat-composer-popover/chat-composer-popover.types.d.ts +0 -77
  196. package/dist/components/chat-composer-popover/chat-composer-popover.variables.d.ts +0 -2
  197. package/dist/components/chat-composer-popover/chat-composer-popover.variables.js +0 -61
  198. package/dist/components/chat-composer-popover/index.d.ts +0 -6
  199. package/dist/components/chat-composer-popover/index.js +0 -3285
  200. package/dist/components/chat-conversation-header/chat-conversation-header.css +0 -51
  201. package/dist/components/chat-conversation-header/chat-conversation-header.css.d.ts +0 -1
  202. package/dist/components/chat-conversation-header/chat-conversation-header.schema.d.ts +0 -3
  203. package/dist/components/chat-conversation-header/chat-conversation-header.schema.js +0 -94
  204. package/dist/components/chat-conversation-header/chat-conversation-header.svelte.d.ts +0 -19
  205. package/dist/components/chat-conversation-header/chat-conversation-header.types.d.ts +0 -18
  206. package/dist/components/chat-conversation-header/chat-conversation-header.variables.d.ts +0 -2
  207. package/dist/components/chat-conversation-header/chat-conversation-header.variables.js +0 -61
  208. package/dist/components/chat-conversation-header/index.d.ts +0 -5
  209. package/dist/components/chat-conversation-header/index.js +0 -4278
  210. package/dist/components/chat-conversation-list/chat-conversation-list.css +0 -127
  211. package/dist/components/chat-conversation-list/chat-conversation-list.css.d.ts +0 -1
  212. package/dist/components/chat-conversation-list/chat-conversation-list.schema.d.ts +0 -3
  213. package/dist/components/chat-conversation-list/chat-conversation-list.schema.js +0 -105
  214. package/dist/components/chat-conversation-list/chat-conversation-list.svelte.d.ts +0 -21
  215. package/dist/components/chat-conversation-list/chat-conversation-list.types.d.ts +0 -17
  216. package/dist/components/chat-conversation-list/chat-conversation-list.variables.d.ts +0 -2
  217. package/dist/components/chat-conversation-list/chat-conversation-list.variables.js +0 -61
  218. package/dist/components/chat-conversation-list/conversation-summary.d.ts +0 -30
  219. package/dist/components/chat-conversation-list/index.d.ts +0 -6
  220. package/dist/components/chat-conversation-list/index.js +0 -536
  221. package/dist/server/components/chat/index.js +0 -131
  222. package/dist/server/components/chat-composer-popover/index.js +0 -26
  223. package/dist/server/components/chat-conversation-header/index.js +0 -41
  224. package/dist/server/components/chat-conversation-list/index.js +0 -19
  225. package/dist/server/index.server-2bbwajb2.js +0 -54
  226. package/dist/server/index.server-2hqrv7ca.js +0 -9
  227. package/dist/server/index.server-67qgdypc.js +0 -9
  228. package/dist/server/index.server-6hnfzc7f.js +0 -263
  229. package/dist/server/index.server-8rmtb8vx.js +0 -175
  230. package/dist/server/index.server-a59y47rw.js +0 -59
  231. package/dist/server/index.server-bfkka7x4.js +0 -2
  232. package/dist/server/index.server-czf35aba.js +0 -4241
  233. package/dist/server/index.server-kb6w1a7c.js +0 -27
  234. package/dist/server/index.server-mzj20rfz.js +0 -77
  235. package/dist/server/index.server-nphtb2ey.js +0 -76
  236. package/dist/server/index.server-qkfd0qa7.js +0 -2
  237. package/dist/server/index.server-rf67m8v5.js +0 -2
  238. package/dist/server/index.server-rqe5bqgm.js +0 -37
  239. package/dist/server/index.server-xtjjmsyq.js +0 -315
  240. package/dist/server/index.server-yq9evnp4.js +0 -38
  241. package/dist/server/index.server-z1qvwaem.js +0 -74
  242. package/dist/server/index.server-z7hxtqs1.js +0 -83
  243. package/src/components/chat/adapter/chat-adapter.ts +0 -132
  244. package/src/components/chat/adapter/index.ts +0 -15
  245. package/src/components/chat/artifact/artifact-panel.svelte +0 -112
  246. package/src/components/chat/artifact/artifact-viewer.svelte +0 -101
  247. package/src/components/chat/artifact/chat-artifact-layout.svelte +0 -56
  248. package/src/components/chat/artifact/index.ts +0 -3
  249. package/src/components/chat/builders.ts +0 -464
  250. package/src/components/chat/chat.css +0 -16
  251. package/src/components/chat/chat.examples.json +0 -67
  252. package/src/components/chat/chat.schema.json +0 -290
  253. package/src/components/chat/chat.schema.ts +0 -335
  254. package/src/components/chat/chat.svelte +0 -67
  255. package/src/components/chat/chat.types.ts +0 -284
  256. package/src/components/chat/chat.variables.json +0 -1
  257. package/src/components/chat/chat.variables.ts +0 -3
  258. package/src/components/chat/container/chat-events.ts +0 -26
  259. package/src/components/chat/container/chat-history-trigger.svelte +0 -95
  260. package/src/components/chat/container/chat-jump-controls.svelte +0 -191
  261. package/src/components/chat/container/chat-participant-typing.svelte +0 -128
  262. package/src/components/chat/container/chat-search-bar.svelte +0 -219
  263. package/src/components/chat/container/chat-status-announcer.svelte +0 -22
  264. package/src/components/chat/container/chat.svelte +0 -1879
  265. package/src/components/chat/container/index.ts +0 -64
  266. package/src/components/chat/container/scroll-utilities.ts +0 -204
  267. package/src/components/chat/container/use-chat-disclosure-state.svelte.ts +0 -62
  268. package/src/components/chat/container/use-chat-keyboard-nav.svelte.ts +0 -153
  269. package/src/components/chat/container/use-chat-message-groups.svelte.ts +0 -146
  270. package/src/components/chat/container/use-chat-read-receipts.svelte.ts +0 -62
  271. package/src/components/chat/container/use-chat-scroll-state.svelte.ts +0 -292
  272. package/src/components/chat/container/use-chat-search.svelte.ts +0 -116
  273. package/src/components/chat/container/use-chat-typing-indicator.svelte.ts +0 -153
  274. package/src/components/chat/container/use-chat-unread-state.svelte.ts +0 -170
  275. package/src/components/chat/container/use-chat-virtualizer.svelte.ts +0 -260
  276. package/src/components/chat/conversation-model.ts +0 -56
  277. package/src/components/chat/export/conversation-export-actions.svelte +0 -174
  278. package/src/components/chat/export/index.ts +0 -9
  279. package/src/components/chat/index.ts +0 -160
  280. package/src/components/chat/input/attachment-kind.ts +0 -28
  281. package/src/components/chat/input/chat-attachment-preview.svelte +0 -223
  282. package/src/components/chat/input/chat-attachment-serialization.ts +0 -63
  283. package/src/components/chat/input/chat-attachment.ts +0 -12
  284. package/src/components/chat/input/chat-input.svelte +0 -810
  285. package/src/components/chat/input/index.ts +0 -9
  286. package/src/components/chat/message/chat-date-separator.svelte +0 -87
  287. package/src/components/chat/message/chat-message-parts-renderer.svelte +0 -139
  288. package/src/components/chat/message/chat-message-parts.ts +0 -163
  289. package/src/components/chat/message/chat-message.svelte +0 -861
  290. package/src/components/chat/message/chat-read-receipt.svelte +0 -85
  291. package/src/components/chat/message/image-lightbox.svelte +0 -255
  292. package/src/components/chat/message/index.ts +0 -6
  293. package/src/components/chat/message/markdown-preview.svelte +0 -77
  294. package/src/components/chat/message/message-attachments.svelte +0 -178
  295. package/src/components/chat/message/message-content.svelte +0 -132
  296. package/src/components/chat/message/parts/image-part.svelte +0 -11
  297. package/src/components/chat/message/parts/markdown-part.svelte +0 -17
  298. package/src/components/chat/message/parts/reasoning-part.svelte +0 -274
  299. package/src/components/chat/message/parts/step-part.svelte +0 -127
  300. package/src/components/chat/message/parts/suggestion-part.svelte +0 -83
  301. package/src/components/chat/message/parts/tool-approval-part.svelte +0 -298
  302. package/src/components/chat/message/parts/tool-call-part.svelte +0 -19
  303. package/src/components/chat/message/parts/tool-result-part.svelte +0 -65
  304. package/src/components/chat/message/tool-call-group.svelte +0 -274
  305. package/src/components/chat/message/tool-payload-code.svelte +0 -35
  306. package/src/components/chat/utilities/conversation.ts +0 -44
  307. package/src/components/chat/utilities/index.ts +0 -33
  308. package/src/components/chat/utilities/types.ts +0 -288
  309. package/src/components/chat/utilities/utilities.ts +0 -507
  310. package/src/components/chat-composer-popover/chat-composer-popover-filter.ts +0 -68
  311. package/src/components/chat-composer-popover/chat-composer-popover.css +0 -7
  312. package/src/components/chat-composer-popover/chat-composer-popover.examples.json +0 -13
  313. package/src/components/chat-composer-popover/chat-composer-popover.schema.json +0 -90
  314. package/src/components/chat-composer-popover/chat-composer-popover.schema.ts +0 -95
  315. package/src/components/chat-composer-popover/chat-composer-popover.svelte +0 -234
  316. package/src/components/chat-composer-popover/chat-composer-popover.types.ts +0 -88
  317. package/src/components/chat-composer-popover/chat-composer-popover.variables.json +0 -1
  318. package/src/components/chat-composer-popover/chat-composer-popover.variables.ts +0 -3
  319. package/src/components/chat-composer-popover/index.ts +0 -19
  320. package/src/components/chat-conversation-header/chat-conversation-header.css +0 -51
  321. package/src/components/chat-conversation-header/chat-conversation-header.examples.json +0 -13
  322. package/src/components/chat-conversation-header/chat-conversation-header.schema.json +0 -34
  323. package/src/components/chat-conversation-header/chat-conversation-header.schema.ts +0 -38
  324. package/src/components/chat-conversation-header/chat-conversation-header.svelte +0 -49
  325. package/src/components/chat-conversation-header/chat-conversation-header.types.ts +0 -20
  326. package/src/components/chat-conversation-header/chat-conversation-header.variables.json +0 -1
  327. package/src/components/chat-conversation-header/chat-conversation-header.variables.ts +0 -3
  328. package/src/components/chat-conversation-header/index.ts +0 -9
  329. package/src/components/chat-conversation-list/chat-conversation-list.css +0 -127
  330. package/src/components/chat-conversation-list/chat-conversation-list.examples.json +0 -13
  331. package/src/components/chat-conversation-list/chat-conversation-list.schema.json +0 -45
  332. package/src/components/chat-conversation-list/chat-conversation-list.schema.ts +0 -52
  333. package/src/components/chat-conversation-list/chat-conversation-list.svelte +0 -75
  334. package/src/components/chat-conversation-list/chat-conversation-list.types.ts +0 -18
  335. package/src/components/chat-conversation-list/chat-conversation-list.variables.json +0 -1
  336. package/src/components/chat-conversation-list/chat-conversation-list.variables.ts +0 -3
  337. package/src/components/chat-conversation-list/conversation-summary.ts +0 -88
  338. package/src/components/chat-conversation-list/index.ts +0 -11
@@ -1,61 +0,0 @@
1
- var __create = Object.create;
2
- var __getProtoOf = Object.getPrototypeOf;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- function __accessProp(key) {
7
- return this[key];
8
- }
9
- var __toESMCache_node;
10
- var __toESMCache_esm;
11
- var __toESM = (mod, isNodeMode, target) => {
12
- var canCache = mod != null && typeof mod === "object";
13
- if (canCache) {
14
- var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap;
15
- var cached = cache.get(mod);
16
- if (cached)
17
- return cached;
18
- }
19
- target = mod != null ? __create(__getProtoOf(mod)) : {};
20
- const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
21
- for (let key of __getOwnPropNames(mod))
22
- if (!__hasOwnProp.call(to, key))
23
- __defProp(to, key, {
24
- get: __accessProp.bind(mod, key),
25
- enumerable: true
26
- });
27
- if (canCache)
28
- cache.set(mod, to);
29
- return to;
30
- };
31
- var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
32
- var __returnValue = (v) => v;
33
- function __exportSetter(name, newValue) {
34
- this[name] = __returnValue.bind(null, newValue);
35
- }
36
- var __export = (target, all) => {
37
- for (var name in all)
38
- __defProp(target, name, {
39
- get: all[name],
40
- enumerable: true,
41
- configurable: true,
42
- set: __exportSetter.bind(all, name)
43
- });
44
- };
45
- var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
46
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
47
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
48
- }) : x)(function(x) {
49
- if (typeof require !== "undefined")
50
- return require.apply(this, arguments);
51
- throw Error('Dynamic require of "' + x + '" is not supported');
52
- });
53
-
54
- // src/components/chat/chat.variables.ts
55
- var variables = [];
56
- var chat_variables_default = variables;
57
- export {
58
- chat_variables_default as default
59
- };
60
-
61
- //# debugId=3F716B6A999EA50E64756E2164756E21
@@ -1,22 +0,0 @@
1
- import type { MessageInput } from '../conversation-model.ts';
2
- import type { ChatAttachment } from '../input/chat-attachment.ts';
3
- /** Event fired when a message is submitted. */
4
- export type ChatSubmitEvent = {
5
- message: MessageInput;
6
- attachments: ChatAttachment[];
7
- };
8
- /** Event fired when stop generating is requested. */
9
- export type ChatStopGeneratingEvent = {
10
- messageId: string;
11
- };
12
- /** Event fired when scroll state changes. */
13
- export type ChatScrollStateChangeEvent = {
14
- atBottom: boolean;
15
- scrollTop: number;
16
- scrollHeight: number;
17
- };
18
- /** Event fired when unread indicator state changes. */
19
- export type ChatUnreadIndicatorChangeEvent = {
20
- unreadCount: number;
21
- newMessageIndicatorVisible: boolean;
22
- };
@@ -1,15 +0,0 @@
1
- export type ChatHistoryTriggerProps = {
2
- /** Whether the history request is in flight. */
3
- loading?: boolean;
4
- /** Button label while idle. */
5
- label?: string;
6
- /** Button label while loading. */
7
- loadingLabel?: string;
8
- /** Called when the user requests older messages. */
9
- onload?: () => void;
10
- };
11
- declare const ChatHistoryTrigger: import("svelte").Component<ChatHistoryTriggerProps, {
12
- focus: (options?: FocusOptions | undefined) => void;
13
- }, "">;
14
- type ChatHistoryTrigger = ReturnType<typeof ChatHistoryTrigger>;
15
- export default ChatHistoryTrigger;
@@ -1,24 +0,0 @@
1
- /**
2
- * Jump-to-latest button and new message indicator for the chat container.
3
- *
4
- * Displays:
5
- * - A jump button when scrolled far enough from bottom
6
- * - A centered "new messages" indicator in the hysteresis zone
7
- */
8
- export type ChatJumpControlsProps = {
9
- /** Whether the jump button should be visible */
10
- showJumpButton: boolean;
11
- /** Whether the new message indicator should be visible */
12
- hasNewMessageIndicator: boolean;
13
- /** Current unread message count */
14
- unreadCount: number;
15
- /** Formatted unread count for display (caps at "99+") */
16
- displayUnreadCount: string;
17
- /** Whether the count exceeds 99 (for compact badge styling) */
18
- hasLargeCount: boolean;
19
- /** Callback when jump-to-latest is clicked */
20
- onjumptolatest?: () => void;
21
- };
22
- declare const ChatJumpControls: import("svelte").Component<ChatJumpControlsProps, {}, "">;
23
- type ChatJumpControls = ReturnType<typeof ChatJumpControls>;
24
- export default ChatJumpControls;
@@ -1,31 +0,0 @@
1
- /**
2
- * Per-participant typing indicator for the Chat component.
3
- *
4
- * A single always-in-DOM outer `<div>` wrapper sits above the bottom sentinel in
5
- * the message timeline. Its text is empty when nobody is typing (the outer wrapper
6
- * is never removed from the DOM). The inner `.chat-participant-typing-indicator`
7
- * div mounts/unmounts via `{#if isActive}` — this is intentional so the
8
- * entrance animation replays on each new typing event.
9
- *
10
- * The aria-live announcement region is NOT emitted by this component. It lives in
11
- * chat.svelte as a sibling of `ChatStatusAnnouncer`, outside the `role="log"` div,
12
- * to prevent double-announcement from nested live regions. This component handles
13
- * the visual rendering only.
14
- *
15
- * Accessibility:
16
- * - The outer wrapper is `aria-hidden="true"` — AT users receive the typing
17
- * announcement from the dedicated live region in the container.
18
- * - data-cinder-participant-typing set when participantCount > 0.
19
- * - data-cinder-participant-count reflects the exact count.
20
- *
21
- * Reduced motion: switches the entrance animation to an opacity fade.
22
- */
23
- export type ChatParticipantTypingProps = {
24
- /** The visible typing label (e.g. "Alice is typing…"). Empty string when nobody is typing. */
25
- typingLabel: string;
26
- /** Total number of currently-typing participants. */
27
- participantCount: number;
28
- };
29
- declare const ChatParticipantTyping: import("svelte").Component<ChatParticipantTypingProps, {}, "">;
30
- type ChatParticipantTyping = ReturnType<typeof ChatParticipantTyping>;
31
- export default ChatParticipantTyping;
@@ -1,38 +0,0 @@
1
- /**
2
- * Search bar for in-conversation message search.
3
- *
4
- * Renders an input field, match counter, navigation buttons, and a close button.
5
- * Auto-focuses the input when mounted.
6
- *
7
- * Keyboard shortcuts:
8
- * - Enter: next match
9
- * - Shift+Enter: previous match
10
- * - Escape: close
11
- */
12
- export type ChatSearchBarProps = {
13
- /**
14
- * Unique namespace for this search bar's ARIA IDs.
15
- * Must match the `id` prop of the parent chat component so that multiple
16
- * chat instances on the same page do not produce duplicate DOM IDs.
17
- */
18
- instanceId: string;
19
- /** Current search query */
20
- query: string;
21
- /** Total number of matches */
22
- matchCount: number;
23
- /** Zero-based index of the current match */
24
- currentMatchIndex: number;
25
- /** Called when the user changes the query */
26
- onquerychange: (query: string) => void;
27
- /** Called when the user requests the next match */
28
- onnext: () => void;
29
- /** Called when the user requests the previous match */
30
- onprevious: () => void;
31
- /** Called when the user closes the search bar */
32
- onclose: () => void;
33
- };
34
- declare const ChatSearchBar: import("svelte").Component<ChatSearchBarProps, {
35
- focusInput: () => void;
36
- }, "">;
37
- type ChatSearchBar = ReturnType<typeof ChatSearchBar>;
38
- export default ChatSearchBar;
@@ -1,21 +0,0 @@
1
- /**
2
- * Screen reader status regions for the chat container.
3
- *
4
- * Provides:
5
- * - A status region showing message count
6
- * - A polite live region for announcing new messages
7
- * - An assertive live region for urgent action-required announcements
8
- */
9
- export type ChatStatusAnnouncerProps = {
10
- /** ID for the status element (used by aria-describedby) */
11
- statusId: string;
12
- /** Total number of messages in the conversation */
13
- messageCount: number;
14
- /** Current screen reader announcement message */
15
- announcerMessage: string;
16
- /** Urgent announcement for assertive live region (tool approval, etc.) */
17
- assertiveMessage?: string;
18
- };
19
- declare const ChatStatusAnnouncer: import("svelte").Component<ChatStatusAnnouncerProps, {}, "">;
20
- type ChatStatusAnnouncer = ReturnType<typeof ChatStatusAnnouncer>;
21
- export default ChatStatusAnnouncer;
@@ -1,17 +0,0 @@
1
- import type { ChatAnnounceLevel, ChatProps } from '../chat.types.ts';
2
- export type { ChatAnnounceLevel, ChatProps };
3
- export type { ChatScrollStateChangeEvent, ChatStopGeneratingEvent, ChatSubmitEvent, ChatUnreadIndicatorChangeEvent, } from './chat-events.ts';
4
- declare const Chat: import("svelte").Component<ChatProps, {
5
- announce: (message: string, level?: ChatAnnounceLevel) => void;
6
- scrollToBottom: () => void;
7
- scrollToTop: () => void;
8
- focusInput: () => void;
9
- clearInput: () => void;
10
- getComposerValue: () => string;
11
- getEditorElement: () => HTMLTextAreaElement | null;
12
- beginStreaming: (messageId: string) => void;
13
- pushToken: (token: string) => void;
14
- endStreaming: () => void;
15
- }, "unreadCount" | "atBottom" | "newMessageIndicatorVisible">;
16
- type Chat = ReturnType<typeof Chat>;
17
- export default Chat;
@@ -1,12 +0,0 @@
1
- export type { ChatScrollStateChangeEvent, ChatStopGeneratingEvent, ChatSubmitEvent, ChatUnreadIndicatorChangeEvent, } from './chat-events.ts';
2
- export { default as Chat } from './chat.svelte';
3
- export { DEFAULT_SCROLL_CONFIGURATION, calculateScrollToBottom, calculateUnreadCount, extractTimestamp, findUnreadBoundaryIndex, formatUnreadCount, isAtBottom, isLargeCount, shouldShowJumpToLatest, } from './scroll-utilities';
4
- export type { ScrollConfiguration, ScrollState } from './scroll-utilities';
5
- export { useChatScrollState, type UseChatScrollStateOptions, type UseChatScrollStateReturn, } from './use-chat-scroll-state.svelte';
6
- export { useChatUnreadState, type UseChatUnreadStateOptions, type UseChatUnreadStateReturn, } from './use-chat-unread-state.svelte';
7
- export { useChatKeyboardNav, type UseChatKeyboardNavOptions, type UseChatKeyboardNavReturn, } from './use-chat-keyboard-nav.svelte';
8
- export { useChatMessageGroups, type DateItem, type MessageItem, type MessageWithDateItem, type ToolCallPair, type UseChatMessageGroupsOptions, type UseChatMessageGroupsReturn, } from './use-chat-message-groups.svelte';
9
- export { default as ChatJumpControls } from './chat-jump-controls.svelte';
10
- export { default as ChatStatusAnnouncer } from './chat-status-announcer.svelte';
11
- export { default as ChatSearchBar } from './chat-search-bar.svelte';
12
- export { useChatSearch, type ChatSearchMatch, type UseChatSearchOptions, type UseChatSearchReturn, } from './use-chat-search.svelte';
@@ -1,119 +0,0 @@
1
- /**
2
- * Pure utility functions for scroll position calculations and unread tracking.
3
- *
4
- * These functions are intentionally pure (no DOM access) for testability.
5
- * They accept scroll state as input and return computed values.
6
- */
7
- import type { Message } from '../conversation-model.ts';
8
- /**
9
- * Represents the scroll state of a container element.
10
- * These values come from HTMLElement scroll properties.
11
- */
12
- export type ScrollState = {
13
- /** Current scroll position from top (scrollTop) */
14
- scrollTop: number;
15
- /** Total scrollable height (scrollHeight) */
16
- scrollHeight: number;
17
- /** Visible viewport height (clientHeight) */
18
- clientHeight: number;
19
- };
20
- /**
21
- * Configuration for scroll behavior thresholds.
22
- */
23
- export type ScrollConfiguration = {
24
- /**
25
- * Pixels from bottom to consider "at bottom".
26
- * A generous threshold handles:
27
- * - Fractional pixel values on high-DPI displays
28
- * - Imprecise touch scrolling
29
- * - Small layout shifts from loading content
30
- * @default 150
31
- */
32
- bottomThreshold: number;
33
- /**
34
- * Pixels scrolled up before showing jump-to-latest button.
35
- * Slightly larger than bottomThreshold to create hysteresis
36
- * (prevents button flickering near the threshold).
37
- * @default 200
38
- */
39
- jumpThreshold: number;
40
- };
41
- /**
42
- * Default scroll configuration values.
43
- *
44
- * The 150px bottom threshold accommodates 2-3 message previews,
45
- * which matches user mental models of "being at the end".
46
- */
47
- export declare const DEFAULT_SCROLL_CONFIGURATION: ScrollConfiguration;
48
- /**
49
- * Determines if the scroll position is at or near the bottom.
50
- *
51
- * Used to decide whether to auto-scroll when new messages arrive.
52
- * If true, new messages should trigger scroll-to-bottom.
53
- * If false, the user is reading history and scroll should not change.
54
- *
55
- * @param state - Current scroll state from the container
56
- * @param threshold - Pixels from bottom to consider "at bottom"
57
- * @returns true if within threshold of the bottom
58
- */
59
- export declare function isAtBottom(state: ScrollState, threshold: number): boolean;
60
- /**
61
- * Determines if the jump-to-latest button should be visible.
62
- *
63
- * Uses a separate (larger) threshold than isAtBottom to create hysteresis,
64
- * preventing the button from flickering when scrolling near the threshold.
65
- *
66
- * @param state - Current scroll state from the container
67
- * @param threshold - Pixels from bottom before showing button
68
- * @returns true if scrolled far enough from bottom to show button
69
- */
70
- export declare function shouldShowJumpToLatest(state: ScrollState, threshold: number): boolean;
71
- /**
72
- * Calculates the number of unread messages based on timestamp.
73
- *
74
- * @param messages - Array of messages with timestamps
75
- * @param lastReadTimestamp - Timestamp of the last read message in milliseconds (0 if none read)
76
- * @returns Count of messages with timestamp > lastReadTimestamp
77
- */
78
- export declare function calculateUnreadCount(messages: Message[], lastReadTimestamp: number): number;
79
- /**
80
- * Finds the index where unread messages begin.
81
- *
82
- * This is used to insert the "unread divider" in the message list.
83
- *
84
- * @param messages - Array of messages with timestamps
85
- * @param lastReadTimestamp - Timestamp of the last read message in milliseconds
86
- * @returns Index of first unread message, or -1 if all messages are read
87
- */
88
- export declare function findUnreadBoundaryIndex(messages: Message[], lastReadTimestamp: number): number;
89
- /**
90
- * Calculates the scroll position needed to scroll to bottom.
91
- *
92
- * @param state - Current scroll state
93
- * @returns The scrollTop value that would scroll to bottom
94
- */
95
- export declare function calculateScrollToBottom(state: ScrollState): number;
96
- /**
97
- * Formats the unread count for display.
98
- * Caps at 99+ to prevent badge overflow.
99
- *
100
- * @param count - Raw unread count
101
- * @returns Formatted string for display ("1", "50", "99+")
102
- */
103
- export declare function formatUnreadCount(count: number): string;
104
- /**
105
- * Determines if a count should be displayed with compact styling.
106
- * Used to adjust badge styling for large numbers.
107
- *
108
- * @param count - Raw unread count
109
- * @returns true if count exceeds 99
110
- */
111
- export declare function isLargeCount(count: number): boolean;
112
- /**
113
- * Extracts a numeric timestamp from a message for comparison.
114
- * Exported for use in components that need to track last-read timestamps.
115
- *
116
- * @param message - Message to extract timestamp from
117
- * @returns Timestamp as milliseconds since epoch, or current time if not available
118
- */
119
- export declare function extractTimestamp(message: Message): number;
@@ -1,58 +0,0 @@
1
- /**
2
- * Runes helper for tracking which per-message disclosures are expanded.
3
- *
4
- * Owns a set of expanded message ids and provides a toggle function. Used for
5
- * any collapsed-by-default disclosure that is keyed by message id and lives in
6
- * a virtualized transcript — reasoning blocks and tool-call cards both use one
7
- * instance each. When a virtualizer remeasure callback is registered
8
- * (optional), toggling fires it so the virtualizer can remeasure the row after
9
- * the disclosure opens/closes.
10
- */
11
- /** Options for the disclosure state helper. */
12
- export type UseChatDisclosureStateOptions = {
13
- /**
14
- * Optional callback to trigger a virtualizer remeasure for a specific message
15
- * row after the disclosure state changes. If the virtualizer is not wired
16
- * (e.g. in non-virtualized mode), pass `undefined` or omit — the toggle
17
- * still works, no remeasure fires.
18
- */
19
- onRemeasureRow?: ((messageId: string) => void) | undefined;
20
- };
21
- /** Return type for the disclosure state helper. */
22
- export type UseChatDisclosureStateReturn = {
23
- /** Whether the disclosure for the given message id is expanded. */
24
- isExpanded: (messageId: string) => boolean;
25
- /**
26
- * Toggle the expanded state for the given message id. Also fires the
27
- * remeasure callback when wired (virtualizer support).
28
- */
29
- toggle: (messageId: string) => void;
30
- /**
31
- * Reset all expanded state to empty. Called on conversation change so stale
32
- * expanded disclosures from the previous conversation are cleared.
33
- */
34
- reset: () => void;
35
- };
36
- /**
37
- * Creates reactive state for per-message disclosure expansion.
38
- *
39
- * The returned `isExpanded` and `toggle` are stable references — safe to pass
40
- * as props without triggering extra re-renders.
41
- *
42
- * @example
43
- * ```svelte
44
- * <script lang="ts">
45
- * import { useChatDisclosureState } from './use-chat-disclosure-state.svelte';
46
- *
47
- * const reasoningState = useChatDisclosureState({});
48
- * </script>
49
- *
50
- * <!-- in template: -->
51
- * <ReasoningPart
52
- * {part}
53
- * expanded={reasoningState.isExpanded(message.id)}
54
- * ontoggle={() => reasoningState.toggle(message.id)}
55
- * />
56
- * ```
57
- */
58
- export declare function useChatDisclosureState(options: UseChatDisclosureStateOptions): UseChatDisclosureStateReturn;
@@ -1,57 +0,0 @@
1
- /**
2
- * Runes helper for chat keyboard navigation.
3
- *
4
- * Extracts keyboard event handling for:
5
- * - Home/End to jump to first/last message
6
- * - PageUp/PageDown for viewport scrolling
7
- * - Arrow keys for message-to-message navigation
8
- */
9
- /** Options for the keyboard navigation helper */
10
- export interface UseChatKeyboardNavOptions {
11
- /** Callback when jump-to-latest is triggered (End key) */
12
- onJumpToLatest: () => void;
13
- /** Optional callback for virtualized top scrolling. */
14
- onJumpToStart?: () => void;
15
- /** Function that returns the appropriate scroll behavior based on user preference */
16
- getScrollBehavior: () => ScrollBehavior;
17
- /** Optional load-earlier trigger focus target. */
18
- getHistoryTrigger?: () => {
19
- focus: () => void;
20
- } | null | undefined;
21
- /** Optional virtualized message navigation hook for off-window rows. */
22
- onVirtualMessageNavigation?: (direction: 'next' | 'previous') => boolean;
23
- }
24
- /** Return type for the keyboard navigation helper */
25
- export interface UseChatKeyboardNavReturn {
26
- /**
27
- * Handle keydown events for the chat container.
28
- * Should be attached to the container's onkeydown event.
29
- */
30
- handleKeyDown(event: KeyboardEvent, viewport: HTMLElement | null): void;
31
- }
32
- /**
33
- * Creates keyboard navigation handlers for the chat container.
34
- *
35
- * Supports:
36
- * - `End`: Jump to latest message
37
- * - `Home`: Scroll to top and focus first message
38
- * - `PageDown`/`PageUp`: Scroll by 90% of viewport
39
- * - `ArrowDown`/`ArrowUp`: Navigate between messages when focused on a message
40
- *
41
- * @example
42
- * ```svelte
43
- * <script lang="ts">
44
- * import { useChatKeyboardNav } from './use-chat-keyboard-nav.svelte';
45
- *
46
- * const keyboardNav = useChatKeyboardNav({
47
- * onJumpToLatest: handleJumpToLatest,
48
- * getScrollBehavior: () => prefersReducedMotion() ? 'auto' : 'smooth',
49
- * });
50
- * </script>
51
- *
52
- * <div onkeydown={(e) => keyboardNav.handleKeyDown(e, viewport)}>
53
- * <!-- chat content -->
54
- * </div>
55
- * ```
56
- */
57
- export declare function useChatKeyboardNav(options: UseChatKeyboardNavOptions): UseChatKeyboardNavReturn;
@@ -1,74 +0,0 @@
1
- /**
2
- * Runes helper for chat message grouping and tool call pairing.
3
- *
4
- * Extracts derived values for:
5
- * - Messages grouped with date separators
6
- * - Tool call pairs indexed by call ID for O(1) lookup
7
- */
8
- import type { Message, ToolCallPair } from '../conversation-model.ts';
9
- /** Date separator item in the message list */
10
- export type DateItem = {
11
- type: 'date';
12
- date: Date;
13
- };
14
- /** Message item in the message list */
15
- export type MessageItem = {
16
- type: 'message';
17
- message: Message;
18
- };
19
- /** Union type for items in the messages-with-dates list */
20
- export type MessageWithDateItem = DateItem | MessageItem;
21
- export type UnreadDividerItem = {
22
- type: 'unread-divider';
23
- afterMessageId: string | null;
24
- };
25
- export type TypingItem = {
26
- type: 'typing';
27
- };
28
- export type ChatRenderRow = MessageWithDateItem | UnreadDividerItem | TypingItem;
29
- export type { ToolCallPair } from '../conversation-model.ts';
30
- /** Options for the message groups helper */
31
- export interface UseChatMessageGroupsOptions {
32
- /** Function that returns the current messages array */
33
- getMessages: () => Message[];
34
- }
35
- /** Return type for the message groups helper */
36
- export interface UseChatMessageGroupsReturn {
37
- /** Messages interleaved with date separators */
38
- readonly messagesWithDates: MessageWithDateItem[];
39
- /** Render rows derived from messagesWithDates; call buildChatRenderRows with options for UI-only rows. */
40
- readonly renderRows: ChatRenderRow[];
41
- /** Map of tool call ID to tool call pairs for O(1) lookup */
42
- readonly toolCallPairsByCallId: Map<string, ToolCallPair[]>;
43
- /** Tool result message IDs already represented inside a paired tool call group */
44
- readonly pairedToolResultIds: Set<string>;
45
- }
46
- /** Find result message IDs that are already represented by paired tool-call messages. */
47
- export declare function findPairedToolResultIds(messages: readonly Message[]): Set<string>;
48
- /** Build visible messages with date separators, skipping paired tool-result messages. */
49
- export declare function buildMessagesWithDateSeparators(messages: readonly Message[], pairedToolResultIds: ReadonlySet<string>): MessageWithDateItem[];
50
- export declare function buildChatRenderRows(items: readonly MessageWithDateItem[], options?: {
51
- firstUnreadId?: string | null;
52
- showTypingIndicator?: boolean;
53
- }): ChatRenderRow[];
54
- export declare function chatRenderRowKey(row: ChatRenderRow): string;
55
- export declare function findRenderRowIndexByMessageId(rows: readonly ChatRenderRow[], messageId: string): number;
56
- /**
57
- * Creates reactive derived values for message grouping and tool call pairing.
58
- *
59
- * @example
60
- * ```svelte
61
- * <script lang="ts">
62
- * import { useChatMessageGroups } from './use-chat-message-groups.svelte';
63
- *
64
- * const messageGroups = useChatMessageGroups({
65
- * getMessages: () => messages,
66
- * });
67
- *
68
- * // Access derived values
69
- * const items = messageGroups.messagesWithDates;
70
- * const pairs = messageGroups.toolCallPairsByCallId.get(callId);
71
- * </script>
72
- * ```
73
- */
74
- export declare function useChatMessageGroups(options: UseChatMessageGroupsOptions): UseChatMessageGroupsReturn;
@@ -1,51 +0,0 @@
1
- /**
2
- * Per-message read receipt state for the Chat component.
3
- *
4
- * Merges two sources of receipt state:
5
- * 1. The `readReceipts` prop — a `Map<messageId, ReadReceipt>` passed directly
6
- * by the consumer (no adapter required).
7
- * 2. The adapter's `onReadReceipt` push handler, forwarded by the container
8
- * via the `handleAdapterReadReceipt` callback below.
9
- *
10
- * The adapter path accumulates receipts incrementally: each incoming event inserts
11
- * a fresh `'read'` receipt for a new message id, or accumulates (deduplicated)
12
- * `readBy` names on a repeat push for an already-recorded message. Adapter events
13
- * always imply `'read'` status, so there is no status ordering or downgrade.
14
- *
15
- * Render rules (enforced in the component, not here):
16
- * - Only shown on `user`-role messages (gated by the caller).
17
- * - Icon + accessible text always present — color alone never conveys state.
18
- * - data-cinder-receipt-status=sent|delivered|read on the wrapper element.
19
- *
20
- * @module
21
- */
22
- import type { ChatReadReceiptEvent } from '../adapter/chat-adapter.ts';
23
- import type { ReadReceipt } from '../chat.types.ts';
24
- export type UseChatReadReceiptsOptions = {
25
- /**
26
- * Getter returning the current `readReceipts` prop value. Called reactively via
27
- * `$derived` inside this hook.
28
- */
29
- getReadReceipts: () => Map<string, ReadReceipt> | undefined;
30
- };
31
- export type UseChatReadReceiptsResult = {
32
- /**
33
- * Look up the effective receipt for a message id. When the `readReceipts` prop
34
- * is DEFINED it is authoritative: only `readReceipts.get(messageId)` is returned
35
- * (so a consumer can suppress adapter-accumulated receipts with an empty Map).
36
- * Adapter-accumulated state is the fallback ONLY when the prop is omitted.
37
- */
38
- getReceipt: (messageId: string) => ReadReceipt | undefined;
39
- /**
40
- * Receive a read-receipt push from the adapter's `onReadReceipt` handler.
41
- * Adapter events imply "read" status; repeat pushes accumulate `readBy` names.
42
- */
43
- handleAdapterReadReceipt: (event: ChatReadReceiptEvent) => void;
44
- /**
45
- * Clear all adapter-accumulated receipts. Called by the container on
46
- * conversation change / subscription teardown so a receipt from one
47
- * conversation cannot leak into the next (message ids can collide).
48
- */
49
- reset: () => void;
50
- };
51
- export declare function useChatReadReceipts(options: UseChatReadReceiptsOptions): UseChatReadReceiptsResult;