@kitn.ai/ui 0.16.0 → 0.18.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 (493) hide show
  1. package/README.md +55 -17
  2. package/dist/components/artifact.d.ts +39 -1
  3. package/dist/components/attachment-types.d.ts +12 -0
  4. package/dist/components/attachments.d.ts +2 -10
  5. package/dist/components/card.d.ts +27 -0
  6. package/dist/components/chain-of-thought.d.ts +78 -2
  7. package/dist/components/chat-scope-picker.d.ts +7 -0
  8. package/dist/components/chat-thread.d.ts +39 -16
  9. package/dist/components/choice-card.d.ts +27 -0
  10. package/dist/components/coachmark.d.ts +49 -0
  11. package/dist/components/composer-dom.d.ts +35 -0
  12. package/dist/components/composer-highlight.d.ts +48 -0
  13. package/dist/components/composer-history.d.ts +34 -0
  14. package/dist/components/composer.d.ts +86 -0
  15. package/dist/components/confirm-card.d.ts +17 -0
  16. package/dist/components/conversation-item.d.ts +9 -0
  17. package/dist/components/conversation-list.d.ts +36 -1
  18. package/dist/components/dismissed-stub.d.ts +22 -0
  19. package/dist/components/file-tree.d.ts +15 -0
  20. package/dist/components/form.d.ts +34 -0
  21. package/dist/components/markdown.d.ts +3 -0
  22. package/dist/components/message.d.ts +71 -2
  23. package/dist/components/model-switcher.d.ts +7 -0
  24. package/dist/components/prompt-input.d.ts +13 -4
  25. package/dist/components/prompt-suggestion.d.ts +9 -1
  26. package/dist/components/reasoning.d.ts +14 -1
  27. package/dist/components/response-compare-types.d.ts +66 -0
  28. package/dist/components/response-compare.d.ts +65 -0
  29. package/dist/components/screen.d.ts +46 -0
  30. package/dist/components/tasks-card.d.ts +50 -1
  31. package/dist/components/toast.d.ts +58 -0
  32. package/dist/components/tool-types.d.ts +10 -0
  33. package/dist/components/tool.d.ts +8 -8
  34. package/dist/components/use-card-resolution.d.ts +10 -6
  35. package/dist/components/voice-input.d.ts +27 -0
  36. package/dist/components/voice-output.d.ts +33 -0
  37. package/dist/core-C8fzo39E.js +12 -0
  38. package/dist/custom-elements.json +8472 -1691
  39. package/dist/elements/agent-card.d.ts +1 -0
  40. package/dist/elements/agent-card.js +1 -0
  41. package/dist/elements/artifact.js +1 -0
  42. package/dist/elements/attachments.js +1 -0
  43. package/dist/elements/autoloader.d.ts +2 -0
  44. package/dist/elements/autoloader.js +1 -0
  45. package/dist/elements/avatar.d.ts +1 -0
  46. package/dist/elements/avatar.js +1 -0
  47. package/dist/elements/badge.d.ts +1 -0
  48. package/dist/elements/badge.js +1 -0
  49. package/dist/elements/button.d.ts +1 -0
  50. package/dist/elements/button.js +1 -0
  51. package/dist/elements/card.js +1 -0
  52. package/dist/elements/cards.d.ts +1 -0
  53. package/dist/elements/cards.js +1 -0
  54. package/dist/elements/chain-of-thought.d.ts +0 -12
  55. package/dist/elements/chain-of-thought.js +1 -0
  56. package/dist/elements/chat-scope-picker.js +1 -0
  57. package/dist/elements/chat-types.d.ts +8 -2
  58. package/dist/elements/chat-workspace.js +1 -0
  59. package/dist/elements/chat.js +1 -0
  60. package/dist/elements/checkpoint.js +1 -0
  61. package/dist/elements/choice.js +1 -0
  62. package/dist/elements/chunks/Icon-DLLBeLG5.js +1 -0
  63. package/dist/elements/chunks/action-icons-UB4V5FNq.js +1 -0
  64. package/dist/elements/chunks/arrow-left-C-gwlUmx.js +1 -0
  65. package/dist/elements/chunks/attachments-CgbErf1r.js +1 -0
  66. package/dist/elements/chunks/badge-DTQpgB6N.js +1 -0
  67. package/dist/elements/chunks/bash-InADTalH.js +1 -0
  68. package/dist/elements/chunks/button-XDUM6lXs.js +1 -0
  69. package/dist/elements/chunks/card-CBlFZ-7I.js +1 -0
  70. package/dist/elements/chunks/card-routing-C986KuUA.js +1 -0
  71. package/dist/elements/chunks/chat-thread-BIhmqwNL.js +1 -0
  72. package/dist/elements/chunks/check-hGUoVIKb.js +1 -0
  73. package/dist/elements/chunks/chevron-down-DDoaSUtO.js +1 -0
  74. package/dist/elements/chunks/chevron-right-CdGEUakB.js +1 -0
  75. package/dist/elements/chunks/circle-BKAZdmzb.js +1 -0
  76. package/dist/elements/chunks/circle-check-CmYG-y3I.js +1 -0
  77. package/dist/elements/chunks/circle-x-DewgAEym.js +1 -0
  78. package/dist/elements/chunks/cn-CU7UAWzk.js +1 -0
  79. package/dist/elements/chunks/code-block-DedwxwFI.js +1 -0
  80. package/dist/elements/chunks/collapsible-FfgmTHtM.js +1 -0
  81. package/dist/elements/chunks/composer-Cfbw5HKT.js +65 -0
  82. package/dist/elements/chunks/context-DwJmxlRE.js +1 -0
  83. package/dist/elements/chunks/conversation-list-DsCQMfPq.js +1 -0
  84. package/dist/elements/chunks/core-AYMC6_lb.js +12 -0
  85. package/dist/elements/chunks/css-M7EaDHN_.js +1 -0
  86. package/dist/elements/chunks/default-input-BuqsoENC.js +1 -0
  87. package/dist/elements/chunks/define-rGsaWsLL.js +1 -0
  88. package/dist/elements/chunks/disclosure-CwoAkpMH.js +1 -0
  89. package/dist/elements/chunks/download-DJ06G3Bz.js +1 -0
  90. package/dist/elements/chunks/dropdown-BFg8ri_R.js +1 -0
  91. package/dist/elements/chunks/ellipsis-dlN6YvGw.js +1 -0
  92. package/dist/elements/chunks/engine-javascript-vq0WuIJl.js +141 -0
  93. package/dist/elements/chunks/external-link-DBX2lc_R.js +1 -0
  94. package/dist/elements/chunks/file-text-HfwUx4F9.js +1 -0
  95. package/dist/elements/chunks/file-tree-C6Toj71u.js +1 -0
  96. package/dist/elements/chunks/folder-MYuqa9Xp.js +1 -0
  97. package/dist/elements/chunks/github-dark-dimmed-DUshB20C.js +1 -0
  98. package/dist/elements/chunks/github-light-JYsPkUQd.js +1 -0
  99. package/dist/elements/chunks/hover-card-gE7iyXdW.js +1 -0
  100. package/dist/elements/chunks/html-CPZ3oZQ7.js +1 -0
  101. package/dist/elements/chunks/icon-Vqz4ivrY.js +1 -0
  102. package/dist/elements/chunks/index-BCRhi84a.js +1 -0
  103. package/dist/elements/chunks/info-B_toFS0l.js +1 -0
  104. package/dist/elements/chunks/input-gzbHYZvQ.js +1 -0
  105. package/dist/elements/chunks/javascript-C25yR2R2.js +1 -0
  106. package/dist/elements/chunks/json-DxJze_jm.js +1 -0
  107. package/dist/elements/chunks/kbd-n49c4KZm.js +1 -0
  108. package/dist/elements/chunks/link-CKPs9yM0.js +1 -0
  109. package/dist/elements/chunks/loader-q6MamGus.js +1 -0
  110. package/dist/elements/chunks/markdown-DBrcqq4S.js +64 -0
  111. package/dist/elements/chunks/message-CTqaYI0s.js +1 -0
  112. package/dist/elements/chunks/message-feedback-Cvzm03w0.js +1 -0
  113. package/dist/elements/chunks/message-square-CUg9eRCi.js +1 -0
  114. package/dist/elements/chunks/minimize-2-l2klxP6K.js +1 -0
  115. package/dist/elements/chunks/model-switcher-CmyjiHO1.js +1 -0
  116. package/dist/elements/chunks/overlay-C8sOYqjT.js +1 -0
  117. package/dist/elements/chunks/paperclip-42Ia7xHD.js +1 -0
  118. package/dist/elements/chunks/progress-bar-tzKMWAwO.js +1 -0
  119. package/dist/elements/chunks/prompt-suggestion-D3F6vP_A.js +1 -0
  120. package/dist/elements/chunks/reasoning-BJNmmyov.js +1 -0
  121. package/dist/elements/chunks/resizable-BRsk19qI.js +1 -0
  122. package/dist/elements/chunks/rotate-cw-BgcggLHC.js +1 -0
  123. package/dist/elements/chunks/scroll-area-CgGbFFbT.js +1 -0
  124. package/dist/elements/chunks/separator-8hM4GdHE.js +1 -0
  125. package/dist/elements/chunks/settings-CaUIYOg-.js +1 -0
  126. package/dist/elements/chunks/settings-group-CYjOVIZQ.js +1 -0
  127. package/dist/elements/chunks/share-BTYM3Ddt.js +1 -0
  128. package/dist/elements/chunks/skeleton-DsTYrPUe.js +1 -0
  129. package/dist/elements/chunks/slots-DkZ-Cmha.js +1 -0
  130. package/dist/elements/chunks/star-9R3LBQ9n.js +1 -0
  131. package/dist/elements/chunks/store-CYl5Y0_u.js +1 -0
  132. package/dist/elements/chunks/svelte--5p79yCD.js +1 -0
  133. package/dist/elements/chunks/text-shimmer-CaYGv8Se.js +1 -0
  134. package/dist/elements/chunks/textarea-NEr2SLcD.js +1 -0
  135. package/dist/elements/chunks/thumbs-up-DZYZkFfc.js +1 -0
  136. package/dist/elements/chunks/toast-store-ClxVZRcc.js +1 -0
  137. package/dist/elements/chunks/tool-CHZOmoe9.js +1 -0
  138. package/dist/elements/chunks/tooltip-WpHElELC.js +1 -0
  139. package/dist/elements/chunks/triangle-alert-BlS80PUg.js +1 -0
  140. package/dist/elements/chunks/tsx-B8rCNbgL.js +1 -0
  141. package/dist/elements/chunks/typescript-RycA9KXf.js +1 -0
  142. package/dist/elements/chunks/use-card-resolution-VSVoxDeJ.js +1 -0
  143. package/dist/elements/chunks/video-DxTPZqT8.js +1 -0
  144. package/dist/elements/chunks/vue-BmIZj4XD.js +1 -0
  145. package/dist/elements/chunks/x-C1qtndxn.js +1 -0
  146. package/dist/elements/coachmark.d.ts +1 -0
  147. package/dist/elements/coachmark.js +1 -0
  148. package/dist/elements/code-block.js +1 -0
  149. package/dist/elements/command.d.ts +1 -0
  150. package/dist/elements/command.js +1 -0
  151. package/dist/elements/compare.d.ts +1 -0
  152. package/dist/elements/compare.js +1 -0
  153. package/dist/elements/composer.d.ts +1 -0
  154. package/dist/elements/composer.js +1 -0
  155. package/dist/elements/confirm-card.js +1 -0
  156. package/dist/elements/context-meter.js +1 -0
  157. package/dist/elements/conversation-list.d.ts +1 -11
  158. package/dist/elements/conversation-list.js +1 -0
  159. package/dist/elements/default-input.d.ts +20 -9
  160. package/dist/elements/define.d.ts +11 -0
  161. package/dist/elements/dialog.d.ts +1 -0
  162. package/dist/elements/dialog.js +1 -0
  163. package/dist/elements/disclosure.d.ts +37 -0
  164. package/dist/elements/editable-label.d.ts +1 -0
  165. package/dist/elements/editable-label.js +1 -0
  166. package/dist/elements/embed.js +1 -0
  167. package/dist/elements/empty.js +1 -0
  168. package/dist/elements/feedback-bar.js +1 -0
  169. package/dist/elements/file-tree.js +1 -0
  170. package/dist/elements/file-upload.js +1 -0
  171. package/dist/elements/form.js +1 -0
  172. package/dist/elements/hover-card.d.ts +1 -0
  173. package/dist/elements/hover-card.js +1 -0
  174. package/dist/elements/icon.d.ts +1 -0
  175. package/dist/elements/icon.js +1 -0
  176. package/dist/elements/image.js +1 -0
  177. package/dist/elements/input.d.ts +1 -0
  178. package/dist/elements/input.js +1 -0
  179. package/dist/elements/kbd.d.ts +1 -0
  180. package/dist/elements/kbd.js +1 -0
  181. package/dist/elements/link-preview.js +1 -0
  182. package/dist/elements/loader.js +1 -0
  183. package/dist/elements/markdown.js +1 -0
  184. package/dist/elements/menu.d.ts +1 -0
  185. package/dist/elements/menu.js +1 -0
  186. package/dist/elements/message-skills.d.ts +0 -16
  187. package/dist/elements/message-skills.js +1 -0
  188. package/dist/elements/message.js +1 -0
  189. package/dist/elements/model-switcher.d.ts +1 -11
  190. package/dist/elements/model-switcher.js +1 -0
  191. package/dist/elements/nav.d.ts +1 -0
  192. package/dist/elements/nav.js +1 -0
  193. package/dist/elements/notice.d.ts +1 -0
  194. package/dist/elements/notice.js +1 -0
  195. package/dist/elements/pane-group.d.ts +1 -0
  196. package/dist/elements/pane-group.js +1 -0
  197. package/dist/elements/pane.d.ts +1 -0
  198. package/dist/elements/pane.js +1 -0
  199. package/dist/elements/popover.js +1 -0
  200. package/dist/elements/progress-bar.d.ts +1 -0
  201. package/dist/elements/progress-bar.js +1 -0
  202. package/dist/elements/prompt-dock.d.ts +1 -0
  203. package/dist/elements/prompt-dock.js +1 -0
  204. package/dist/elements/prompt-input.d.ts +1 -9
  205. package/dist/elements/prompt-input.js +1 -0
  206. package/dist/elements/prompt-suggestions.d.ts +0 -6
  207. package/dist/elements/prompt-suggestions.js +1 -0
  208. package/dist/elements/reasoning.js +1 -0
  209. package/dist/elements/register.d.ts +10 -0
  210. package/dist/elements/remote.js +1 -0
  211. package/dist/elements/resizable.d.ts +1 -17
  212. package/dist/elements/resizable.js +1 -0
  213. package/dist/elements/response-stream.js +14 -0
  214. package/dist/elements/screen.d.ts +1 -0
  215. package/dist/elements/screen.js +1 -0
  216. package/dist/elements/scroll-area.d.ts +1 -0
  217. package/dist/elements/scroll-area.js +1 -0
  218. package/dist/elements/scroll-button.js +1 -0
  219. package/dist/elements/search.d.ts +1 -0
  220. package/dist/elements/search.js +1 -0
  221. package/dist/elements/segmented.d.ts +1 -0
  222. package/dist/elements/segmented.js +1 -0
  223. package/dist/elements/separator.d.ts +1 -0
  224. package/dist/elements/separator.js +1 -0
  225. package/dist/elements/setting-item.d.ts +1 -0
  226. package/dist/elements/setting-item.js +1 -0
  227. package/dist/elements/settings-group.d.ts +1 -0
  228. package/dist/elements/settings-group.js +1 -0
  229. package/dist/elements/skeleton.d.ts +1 -0
  230. package/dist/elements/skeleton.js +1 -0
  231. package/dist/elements/slots.d.ts +176 -0
  232. package/dist/elements/source.d.ts +0 -17
  233. package/dist/elements/source.js +1 -0
  234. package/dist/elements/status.d.ts +1 -0
  235. package/dist/elements/status.js +1 -0
  236. package/dist/elements/switch.js +1 -0
  237. package/dist/elements/tabs.d.ts +1 -0
  238. package/dist/elements/tabs.js +1 -0
  239. package/dist/elements/tasks.js +1 -0
  240. package/dist/elements/text-shimmer.js +1 -0
  241. package/dist/elements/thinking-bar.js +1 -0
  242. package/dist/elements/toast.d.ts +1 -0
  243. package/dist/elements/toast.js +1 -0
  244. package/dist/elements/tool.js +1 -0
  245. package/dist/elements/tooltip.d.ts +1 -0
  246. package/dist/elements/tooltip.js +1 -0
  247. package/dist/elements/voice-input.js +1 -0
  248. package/dist/elements/voice-output.d.ts +1 -0
  249. package/dist/elements/voice-output.js +1 -0
  250. package/dist/elements.d.ts +772 -61
  251. package/dist/engine-javascript-C1x7zo1_.js +141 -0
  252. package/dist/index.d.ts +15 -2
  253. package/dist/index.js +14405 -9810
  254. package/dist/kai.es.js +1 -0
  255. package/dist/llms/llms-full.txt +1234 -107
  256. package/dist/llms/llms.txt +4 -4
  257. package/dist/mcp.es.js +217 -6
  258. package/dist/primitives/card-contract.d.ts +20 -4
  259. package/dist/primitives/card-recovery.d.ts +55 -0
  260. package/dist/primitives/composer-model.d.ts +22 -0
  261. package/dist/primitives/composer-triggers.d.ts +19 -0
  262. package/dist/primitives/create-kai-chat.d.ts +38 -0
  263. package/dist/primitives/message-feedback.d.ts +35 -0
  264. package/dist/primitives/toast-store.d.ts +118 -0
  265. package/dist/primitives/use-speech-recognition.d.ts +26 -0
  266. package/dist/react/index.d.ts +1166 -98
  267. package/dist/react/runtime.d.ts +9 -2
  268. package/dist/react/use-kai-chat.d.ts +41 -0
  269. package/dist/react.js +575 -186
  270. package/dist/register-impl-CYWGkgbI.js +141 -0
  271. package/dist/schemas/choice.schema.json +5 -0
  272. package/dist/schemas/tasks.schema.json +7 -2
  273. package/dist/state/index.d.ts +4 -0
  274. package/dist/state/messages.d.ts +11 -0
  275. package/dist/state/stream.d.ts +22 -0
  276. package/dist/state/suggestions.d.ts +4 -0
  277. package/dist/state.js +117 -0
  278. package/dist/theme.tokens.css +87 -0
  279. package/dist/types.d.ts +4 -0
  280. package/dist/ui/agent-card.d.ts +61 -0
  281. package/dist/ui/button.d.ts +5 -2
  282. package/dist/ui/card.d.ts +61 -0
  283. package/dist/ui/collapsible.d.ts +15 -1
  284. package/dist/ui/command.d.ts +33 -0
  285. package/dist/ui/dialog.d.ts +42 -0
  286. package/dist/ui/dropdown.d.ts +95 -1
  287. package/dist/ui/editable-label.d.ts +26 -0
  288. package/dist/ui/hover-card.d.ts +13 -1
  289. package/dist/ui/icon.d.ts +18 -0
  290. package/dist/ui/input.d.ts +33 -0
  291. package/dist/ui/kbd.d.ts +21 -0
  292. package/dist/ui/nav.d.ts +62 -0
  293. package/dist/ui/notice.d.ts +31 -0
  294. package/dist/ui/overlay.d.ts +12 -0
  295. package/dist/ui/pane-grid.d.ts +58 -0
  296. package/dist/ui/pane-group.d.ts +75 -0
  297. package/dist/ui/pane.d.ts +78 -0
  298. package/dist/ui/popover.d.ts +11 -1
  299. package/dist/ui/progress-bar.d.ts +23 -0
  300. package/dist/ui/prompt-dock.d.ts +96 -0
  301. package/dist/ui/resizable.d.ts +12 -0
  302. package/dist/ui/scroll-area.d.ts +4 -0
  303. package/dist/ui/segmented.d.ts +28 -0
  304. package/dist/ui/settings-group.d.ts +32 -0
  305. package/dist/ui/skeleton.d.ts +12 -0
  306. package/dist/ui/stat.d.ts +16 -0
  307. package/dist/ui/status.d.ts +13 -0
  308. package/dist/ui/switch.d.ts +8 -1
  309. package/dist/ui/tabs.d.ts +35 -0
  310. package/dist/ui/tooltip.d.ts +20 -1
  311. package/frameworks/react/index.tsx +1100 -163
  312. package/frameworks/react/runtime.tsx +30 -1
  313. package/frameworks/react/use-kai-chat.tsx +87 -0
  314. package/llms-full.txt +1234 -107
  315. package/llms.txt +4 -4
  316. package/package.json +36 -12
  317. package/src/agent-tooling/mcp/manifest.ts +14 -0
  318. package/src/agent-tooling/mcp/tools/debug.ts +194 -6
  319. package/src/agent-tooling/mcp/tools/reference.ts +32 -0
  320. package/src/agent-tooling/mcp/tools/scaffold.ts +162 -1
  321. package/src/components/artifact.tsx +98 -13
  322. package/src/components/attachment-types.ts +13 -0
  323. package/src/components/attachments.tsx +4 -14
  324. package/src/components/card.tsx +109 -15
  325. package/src/components/chain-of-thought.tsx +210 -1
  326. package/src/components/chat-scope-picker.tsx +13 -3
  327. package/src/components/chat-thread.tsx +238 -137
  328. package/src/components/choice-card.tsx +136 -15
  329. package/src/components/coachmark.tsx +245 -0
  330. package/src/components/component-meta.json +921 -108
  331. package/src/components/composer-dom.ts +159 -0
  332. package/src/components/composer-highlight.ts +242 -0
  333. package/src/components/composer-history.ts +82 -0
  334. package/src/components/composer.tsx +979 -0
  335. package/src/components/confirm-card.tsx +69 -2
  336. package/src/components/conversation-item.tsx +69 -7
  337. package/src/components/conversation-list.tsx +134 -37
  338. package/src/components/dismissed-stub.tsx +80 -0
  339. package/src/components/file-tree.tsx +197 -47
  340. package/src/components/form-widgets.tsx +9 -7
  341. package/src/components/form.tsx +161 -20
  342. package/src/components/image.tsx +3 -5
  343. package/src/components/link-preview.tsx +5 -4
  344. package/src/components/markdown.tsx +5 -2
  345. package/src/components/message.tsx +174 -14
  346. package/src/components/model-switcher.tsx +19 -4
  347. package/src/components/prompt-input.tsx +46 -75
  348. package/src/components/prompt-suggestion.tsx +48 -16
  349. package/src/components/reasoning.tsx +29 -6
  350. package/src/components/response-compare-types.ts +127 -0
  351. package/src/components/response-compare.tsx +460 -0
  352. package/src/components/screen.tsx +176 -0
  353. package/src/components/tasks-card.tsx +374 -23
  354. package/src/components/toast.tsx +486 -0
  355. package/src/components/tool-types.ts +10 -0
  356. package/src/components/tool.tsx +22 -16
  357. package/src/components/use-card-resolution.ts +24 -8
  358. package/src/components/voice-input.tsx +102 -19
  359. package/src/components/voice-output.tsx +202 -0
  360. package/src/elements/agent-card.tsx +67 -0
  361. package/src/elements/artifact.tsx +53 -4
  362. package/src/elements/attachments.tsx +1 -0
  363. package/src/elements/autoloader.ts +89 -0
  364. package/src/elements/avatar.tsx +33 -0
  365. package/src/elements/badge.tsx +32 -0
  366. package/src/elements/button.tsx +126 -0
  367. package/src/elements/card-media.jpg +0 -0
  368. package/src/elements/card.tsx +124 -31
  369. package/src/elements/cards.tsx +81 -7
  370. package/src/elements/chain-of-thought.tsx +77 -32
  371. package/src/elements/chat-scope-picker.tsx +35 -8
  372. package/src/elements/chat-types.ts +9 -2
  373. package/src/elements/chat-workspace.tsx +157 -43
  374. package/src/elements/chat.tsx +49 -25
  375. package/src/elements/choice.tsx +71 -19
  376. package/src/elements/coachmark.tsx +90 -0
  377. package/src/elements/command.tsx +209 -0
  378. package/src/elements/compare.tsx +110 -0
  379. package/src/elements/compiled.css +1 -1
  380. package/src/elements/composer.tsx +151 -0
  381. package/src/elements/confirm-card.tsx +36 -11
  382. package/src/elements/conversation-list.tsx +80 -11
  383. package/src/elements/default-input.tsx +75 -53
  384. package/src/elements/define.tsx +47 -6
  385. package/src/elements/dialog.tsx +98 -0
  386. package/src/elements/disclosure.ts +73 -0
  387. package/src/elements/editable-label.tsx +125 -0
  388. package/src/elements/element-manifest.json +310 -0
  389. package/src/elements/element-meta.json +5954 -1605
  390. package/src/elements/element-types.d.ts +771 -60
  391. package/src/elements/file-tree.tsx +12 -2
  392. package/src/elements/file-upload.tsx +1 -1
  393. package/src/elements/form.tsx +54 -11
  394. package/src/elements/hover-card.tsx +80 -0
  395. package/src/elements/icon-names.json +48 -0
  396. package/src/elements/icon.tsx +41 -0
  397. package/src/elements/input.tsx +203 -0
  398. package/src/elements/kbd.tsx +45 -0
  399. package/src/elements/menu.tsx +217 -0
  400. package/src/elements/message.tsx +84 -55
  401. package/src/elements/model-switcher.tsx +27 -1
  402. package/src/elements/nav.tsx +87 -0
  403. package/src/elements/notice.tsx +53 -0
  404. package/src/elements/pane-group.tsx +119 -0
  405. package/src/elements/pane.tsx +129 -0
  406. package/src/elements/popover.tsx +39 -17
  407. package/src/elements/progress-bar.tsx +39 -0
  408. package/src/elements/prompt-dock.tsx +81 -0
  409. package/src/elements/prompt-input.tsx +112 -63
  410. package/src/elements/prompt-suggestions.tsx +25 -9
  411. package/src/elements/reasoning.tsx +30 -9
  412. package/src/elements/register-impl.ts +41 -3
  413. package/src/elements/register.ts +20 -3
  414. package/src/elements/remote.tsx +4 -0
  415. package/src/elements/resizable.tsx +48 -11
  416. package/src/elements/screen.tsx +90 -0
  417. package/src/elements/scroll-area.tsx +33 -0
  418. package/src/elements/search.tsx +180 -0
  419. package/src/elements/segmented.tsx +135 -0
  420. package/src/elements/separator.tsx +36 -0
  421. package/src/elements/setting-item.tsx +50 -0
  422. package/src/elements/settings-group.tsx +37 -0
  423. package/src/elements/skeleton.tsx +45 -0
  424. package/src/elements/slots.ts +607 -0
  425. package/src/elements/source.tsx +13 -6
  426. package/src/elements/status.tsx +42 -0
  427. package/src/elements/styles.css +19 -0
  428. package/src/elements/switch.tsx +89 -14
  429. package/src/elements/tabs.tsx +95 -0
  430. package/src/elements/tasks.tsx +70 -14
  431. package/src/elements/toast.tsx +89 -0
  432. package/src/elements/tool.tsx +43 -9
  433. package/src/elements/tooltip.tsx +85 -0
  434. package/src/elements/video-poster.jpg +0 -0
  435. package/src/elements/voice-input.tsx +66 -16
  436. package/src/elements/voice-output.tsx +69 -0
  437. package/src/index.ts +35 -2
  438. package/src/primitives/card-contract.ts +14 -5
  439. package/src/primitives/card-recovery.ts +149 -0
  440. package/src/primitives/card-routing.ts +3 -0
  441. package/src/primitives/card-schemas/choice.schema.json +5 -0
  442. package/src/primitives/card-schemas/tasks.schema.json +7 -2
  443. package/src/primitives/composer-model.ts +49 -0
  444. package/src/primitives/composer-triggers.ts +35 -0
  445. package/src/primitives/create-kai-chat.ts +66 -0
  446. package/src/primitives/message-feedback.ts +123 -0
  447. package/src/primitives/toast-store.ts +276 -0
  448. package/src/primitives/use-speech-recognition.ts +135 -0
  449. package/src/state/index.ts +6 -0
  450. package/src/state/messages.ts +36 -0
  451. package/src/state/stream.ts +92 -0
  452. package/src/state/suggestions.ts +9 -0
  453. package/src/types.ts +4 -0
  454. package/src/ui/agent-card.tsx +212 -0
  455. package/src/ui/button.tsx +16 -5
  456. package/src/ui/card.tsx +245 -0
  457. package/src/ui/collapsible.tsx +30 -4
  458. package/src/ui/command.tsx +99 -0
  459. package/src/ui/dialog.tsx +217 -0
  460. package/src/ui/dropdown.tsx +375 -13
  461. package/src/ui/editable-label.tsx +112 -0
  462. package/src/ui/hover-card.tsx +28 -5
  463. package/src/ui/icon.tsx +110 -0
  464. package/src/ui/input.tsx +132 -0
  465. package/src/ui/kbd.tsx +118 -0
  466. package/src/ui/nav.tsx +282 -0
  467. package/src/ui/notice.tsx +84 -0
  468. package/src/ui/overlay.tsx +108 -2
  469. package/src/ui/pane-grid.tsx +116 -0
  470. package/src/ui/pane-group.tsx +280 -0
  471. package/src/ui/pane.tsx +193 -0
  472. package/src/ui/popover.tsx +16 -2
  473. package/src/ui/progress-bar.tsx +83 -0
  474. package/src/ui/prompt-dock.tsx +145 -0
  475. package/src/ui/resizable.tsx +69 -1
  476. package/src/ui/scroll-area.tsx +14 -3
  477. package/src/ui/segmented.tsx +109 -0
  478. package/src/ui/settings-group.tsx +67 -0
  479. package/src/ui/skeleton.tsx +62 -5
  480. package/src/ui/stat.tsx +41 -0
  481. package/src/ui/status.tsx +48 -0
  482. package/src/ui/switch.tsx +49 -23
  483. package/src/ui/tabs.tsx +168 -0
  484. package/src/ui/tooltip.tsx +57 -7
  485. package/theme.css +113 -0
  486. package/dist/components/slash-command.d.ts +0 -15
  487. package/dist/kitn-chat.es.js +0 -1
  488. package/dist/register-impl-wCsFPoh9.js +0 -77
  489. package/dist/register-ujhr1nBS.js +0 -1
  490. package/src/components/slash-command.tsx +0 -232
  491. package/src/elements/framework-usage.json +0 -563
  492. /package/dist/{kitn-chat-provider.d.ts → kai-provider.d.ts} +0 -0
  493. /package/dist/{kitn-chat-provider.es.js → kai-provider.es.js} +0 -0
@@ -1,21 +1,49 @@
1
+ 'use client';
1
2
  // AUTO-GENERATED by scripts/gen-element-api.mjs — do not edit by hand.
2
3
  // Typed React wrappers for every kitn custom element. Usage:
3
4
  // import { Message } from '@kitn.ai/ui/react';
4
5
  // <Message message={msg} onMessageAction={(e) => …} />
5
- // The built bundle self-registers all kai-* custom elements the elements import is
6
- // injected at build time (see vite.config.react.ts output.banner), so consumers need
7
- // only this one import. It is kept OUT of this .tsx source so the React typecheck
8
- // (tsconfig.react.json) does not walk the Solid element source under react-jsx.
9
- import { createWebComponent, type WebComponentProps } from './runtime';
6
+ // Each wrapper lazy-registers ITS element on first client mount (a dynamic import
7
+ // of '@kitn.ai/ui/elements/<name>'), so a consumer ships only the elements they use
8
+ // not the register-all bundle. SSR-safe: registration fires only in a client effect.
9
+ // For eager all-registration call registerAll() or import '@kitn.ai/ui/elements'.
10
+ import { createWebComponent, registerAll, type WebComponentProps } from './runtime';
11
+ export { registerAll };
12
+ export { useKaiChat } from './use-kai-chat';
13
+ export type { UseKaiChatOptions, KaiChatController, ChatMessage } from './use-kai-chat';
14
+
15
+
16
+ export interface AgentCardProps extends WebComponentProps {
17
+ /** The agent's name — the primary label. Attribute: `name`. */
18
+ name?: string;
19
+ /** Selected / focused state: highlighted border + surface. Attribute: `active`. */
20
+ active?: boolean;
21
+ /** Raise a prominent "Needs you" pill plus a glowing amber edge — the attention-routing signal that pulls focus to this agent. Attribute: `needs-attention`. */
22
+ needsAttention?: boolean;
23
+ /** Run status — a JS PROPERTY (object), not an attribute. Shape: `{ tone, label?, pulse? }`, where `tone` is one of `working` | `idle` | `done` | `error` | `blocked` (maps to the kit's tool hues), `label` is an optional short string beside the dot, and `pulse` animates the dot. Set it with `el.status = { tone: 'working', label: 'Working', pulse: true }`. */
24
+ status?: { tone: "working" | "idle" | "done" | "error" | "blocked"; label?: string; pulse?: boolean };
25
+ /** The card was activated — clicked, or Enter / Space while focused. Promote this agent back to focus. */
26
+ onActivate?: (event: CustomEvent) => void;
27
+ /** The trailing "..." kebab was clicked. The consumer opens its own menu; the card only surfaces the affordance (the click does not also activate the card). */
28
+ onMenu?: (event: CustomEvent) => void;
29
+ }
10
30
 
31
+ export const AgentCard = /*#__PURE__*/ createWebComponent<AgentCardProps>(
32
+ 'kai-agent-card',
33
+ ["theme","name","active","needsAttention","status"],
34
+ { onActivate: 'kai-activate', onMenu: 'kai-menu' },
35
+ () => import('@kitn.ai/ui/elements/agent-card'),
36
+ );
11
37
 
12
38
  export interface ArtifactProps extends WebComponentProps {
13
39
  /** URL the preview iframe frames. Consumer-controlled. */
14
40
  src?: string;
15
41
  /** Files for the Code tab tree + each file's preview `url`. Set as a JS property (array). */
16
- files: { path: string; url?: undefined | string; code?: undefined | string; language?: undefined | string; type?: undefined | "html" | "pdf" | "image" | "other" }[];
17
- /** Active tab: `preview` (default) or `code`. */
42
+ files: { path: string; url?: undefined | string; code?: undefined | string; language?: undefined | string; type?: undefined | "html" | "pdf" | "image" | "other"; additions?: undefined | number; deletions?: undefined | number; status?: undefined | "added" | "modified" | "deleted" | "renamed" | "untracked" }[];
43
+ /** Controlled active tab: `preview` or `code`. When set, the artifact follows it (re-asserted on change). Leave unset for an uncontrolled tab (see `defaultTab`). */
18
44
  tab?: "preview" | "code";
45
+ /** Uncontrolled INITIAL tab (used only when `tab` is unset). Default `preview`. Seeds the starting tab; the user can then switch freely without the consumer re-asserting a controlled `tab`. */
46
+ defaultTab?: "preview" | "code";
19
47
  /** Selected file path — syncs the tree highlight, Code source, and preview. */
20
48
  activeFile?: string;
21
49
  /** iframe `sandbox` override. Secure default `allow-scripts allow-forms` (NOT `allow-same-origin`). */
@@ -42,6 +70,8 @@ export interface ArtifactProps extends WebComponentProps {
42
70
  standalone?: boolean;
43
71
  /** Show the address but make it read-only (visible, nav-tracking, non-editable). */
44
72
  readonlyPath?: boolean;
73
+ /** Friendly address shown in the path field instead of the real current url (read-only, non-navigable). Use when the framed url is not consumer-facing (e.g. a `data:` blob) so a clean address shows instead of leaking it. Scalar string: set as the `display-url` attribute or the `displayUrl` property. */
74
+ displayUrl?: string;
45
75
  /** Fired when a file is selected. `detail.path`. */
46
76
  onFileSelect?: (event: CustomEvent<{ path: string }>) => void;
47
77
  /** Artifact's own maximize button toggled (consumer-observable; non-bubbling). */
@@ -52,10 +82,11 @@ export interface ArtifactProps extends WebComponentProps {
52
82
  onTabChange?: (event: CustomEvent<{ tab: "preview" | "code" }>) => void;
53
83
  }
54
84
 
55
- export const Artifact = createWebComponent<ArtifactProps>(
85
+ export const Artifact = /*#__PURE__*/ createWebComponent<ArtifactProps>(
56
86
  'kai-artifact',
57
- ["theme","src","files","tab","activeFile","sandbox","iframeTitle","maximized","expandable","openInTab","noNav","noReload","noHome","noPathField","noTabs","standalone","readonlyPath"],
87
+ ["theme","src","files","tab","defaultTab","activeFile","sandbox","iframeTitle","maximized","expandable","openInTab","noNav","noReload","noHome","noPathField","noTabs","standalone","readonlyPath","displayUrl"],
58
88
  { onFileSelect: 'kai-file-select', onMaximizeChange: 'kai-maximize-change', onNavigate: 'kai-navigate', onTabChange: 'kai-tab-change' },
89
+ () => import('@kitn.ai/ui/elements/artifact'),
59
90
  );
60
91
 
61
92
  export interface AttachmentsProps extends WebComponentProps {
@@ -75,60 +106,148 @@ export interface AttachmentsProps extends WebComponentProps {
75
106
  onRemove?: (event: CustomEvent<{ id: string }>) => void;
76
107
  }
77
108
 
78
- export const Attachments = createWebComponent<AttachmentsProps>(
109
+ export const Attachments = /*#__PURE__*/ createWebComponent<AttachmentsProps>(
79
110
  'kai-attachments',
80
111
  ["theme","items","variant","hoverCard","removable","showMediaType","emptyText"],
81
112
  { onRemove: 'kai-remove' },
113
+ () => import('@kitn.ai/ui/elements/attachments'),
114
+ );
115
+
116
+ export interface AvatarProps extends WebComponentProps {
117
+ /** Image URL/data-URI. When absent, the `fallback` initials show instead. */
118
+ src?: string;
119
+ /** Alt text for the image. Defaults to `fallback`. */
120
+ alt?: string;
121
+ /** Short text shown when there's no image — usually initials (e.g. "JD", "AI"). */
122
+ fallback?: string;
123
+ /** Size token: `sm` | `md` (default) | `lg`. */
124
+ size?: "sm" | "md" | "lg";
125
+ }
126
+
127
+ export const Avatar = /*#__PURE__*/ createWebComponent<AvatarProps>(
128
+ 'kai-avatar',
129
+ ["theme","src","alt","fallback","size"],
130
+ { },
131
+ () => import('@kitn.ai/ui/elements/avatar'),
132
+ );
133
+
134
+ export interface BadgeProps extends WebComponentProps {
135
+ /** `default` (muted pill) · `count` (compact number badge) · `citation` (filled primary, for inline citation markers). Defaults to `default`. */
136
+ variant?: "default" | "count" | "citation";
137
+ }
138
+
139
+ export const Badge = /*#__PURE__*/ createWebComponent<BadgeProps>(
140
+ 'kai-badge',
141
+ ["theme","variant"],
142
+ { },
143
+ () => import('@kitn.ai/ui/elements/badge'),
144
+ );
145
+
146
+ export interface ButtonProps extends WebComponentProps {
147
+ /** Visual style. `default` (filled), `subtle` (muted text, hover tint — the toolbar icon look), `ghost` (transparent, hover fill), `outline`, or `destructive`. Defaults to `default`. */
148
+ variant?: "default" | "subtle" | "ghost" | "outline" | "destructive";
149
+ /** Size token. `icon` / `icon-sm` are square (for icon-only buttons); `sm` / `md` / `lg` size text buttons. Defaults to `md`. */
150
+ size?: "sm" | "md" | "lg" | "icon" | "icon-sm";
151
+ /** Leading icon: a named icon (e.g. `"mic"`, `"plus"`), an image URL/data-URI, or plain text. Renders before any slotted label. */
152
+ icon?: string;
153
+ /** Trailing icon, after the label (e.g. `"chevron-down"` for a menu affordance). */
154
+ iconTrailing?: string;
155
+ /** Accessible name. REQUIRED for icon-only buttons (no visible text); ignored when you slot visible text, which already names the button. */
156
+ label?: string;
157
+ /** Disable the button (non-interactive, dimmed). */
158
+ disabled?: boolean;
159
+ /** Stretch the button to the full width of its container (a block button) — e.g. a card CTA or a stacked action. Attribute: `full`. */
160
+ full?: boolean;
161
+ /** Justify the button's content: `start`, `center` (default), or `end`. Combine with `full` for a full-width, left-aligned button. */
162
+ align?: "start" | "center" | "end";
163
+ /** Native button `type`. Defaults to `button` (so it never submits a form). */
164
+ type?: "button" | "submit" | "reset";
165
+ /** The button was activated (pointer or keyboard). Carries no detail. The native `click` also bubbles (composed) for consumers who prefer it. */
166
+ onClick?: (event: CustomEvent) => void;
167
+ }
168
+
169
+ export const Button = /*#__PURE__*/ createWebComponent<ButtonProps>(
170
+ 'kai-button',
171
+ ["theme","variant","size","icon","iconTrailing","label","disabled","full","align","type"],
172
+ { onClick: 'kai-click' },
173
+ () => import('@kitn.ai/ui/elements/button'),
82
174
  );
83
175
 
84
176
  export interface CardProps extends WebComponentProps {
85
- /** Heading rendered in the card chrome (= CardEnvelope.title). Attribute: `heading`. */
86
- heading?: string;
87
- /** Supporting text under the heading. Attribute: `description`. */
88
- description?: string;
89
- /** When set, the card renders its inline error state instead of the body. Attribute: `error-message`. */
90
- errorMessage?: string;
91
- /** Compact spacing for dense lists. Attribute: `dense`. */
177
+ /** Surface treatment: `outlined` (default) | `filled` | `plain` | `accent`. Attribute: `appearance`. */
178
+ appearance?: "outlined" | "filled" | "plain" | "accent";
179
+ /** `vertical` (default, media on top) | `horizontal` (media at the start) | `responsive` (horizontal when the card's container is wide enough, else vertical — a container query on the card's own width). Attribute: `orientation`. */
180
+ orientation?: "vertical" | "horizontal" | "responsive";
181
+ /** The card width below which a `responsive` card collapses to vertical and the footer actions stack. A CSS length; default `28rem`. Attribute: `collapse`. */
182
+ collapse?: string;
183
+ /** Tighter spacing for dense lists. Attribute: `dense`. */
92
184
  dense?: boolean;
185
+ /** Show a close (×) that hides the card and emits `kai-dismiss`. Attribute: `dismissible`. Off by default. */
186
+ dismissible?: boolean;
187
+ /** Render the whole card as a link. Attribute: `href`. Wins over `clickable`. */
188
+ href?: string;
189
+ /** `target` for the `href` anchor. Attribute: `target`. */
190
+ target?: string;
191
+ /** `rel` for the `href` anchor. Attribute: `rel`. */
192
+ rel?: string;
193
+ /** Make the whole card a button (`role="button"`, Enter/Space, hover affordance) that emits `kai-card-click`. Attribute: `clickable`. Ignored when `href` is set. */
194
+ clickable?: boolean;
195
+ /** A `clickable`/`href` card was activated (click, or Enter/Space). */
196
+ onCardClick?: (event: CustomEvent) => void;
197
+ /** The card was dismissed via its × (it also hides itself). */
198
+ onDismiss?: (event: CustomEvent) => void;
93
199
  }
94
200
 
95
- export const Card = createWebComponent<CardProps>(
201
+ export const Card = /*#__PURE__*/ createWebComponent<CardProps>(
96
202
  'kai-card',
97
- ["theme","heading","description","errorMessage","dense"],
98
- { },
203
+ ["theme","appearance","orientation","collapse","dense","dismissible","href","target","rel","clickable"],
204
+ { onCardClick: 'kai-card-click', onDismiss: 'kai-dismiss' },
205
+ () => import('@kitn.ai/ui/elements/card'),
99
206
  );
100
207
 
101
208
  export interface CardsProps extends WebComponentProps {
102
209
  /** The stream of card envelopes to render. Set as a JS PROPERTY: `el.cards = [...]`. */
103
- cards?: { type: string; id: string; data: unknown; title?: string; resolution?: { kind: "action"; action: string; payload?: unknown; at?: string } | { kind: "submit"; data: unknown; at?: string } }[];
210
+ cards?: { type: string; id: string; data: unknown; title?: string; resolution?: { kind: "action"; action: string; payload?: unknown; at?: string } | { kind: "submit"; data: unknown; at?: string } | { kind: "dismissed"; at?: string } | { kind: "expired"; reason?: string; at?: string } }[];
104
211
  /** Optional type→tag overrides/additions (merged over the built-ins). Property: `el.types`. Typed as a plain string map (not the `CardTagMap` alias) so the generated React wrapper inlines it instead of emitting an unresolved named type. */
105
212
  types?: Record<string, string>;
106
213
  /** Optional CardPolicy handling child events. Property: `el.policy`. */
107
- policy?: { onSubmit?: (cardId: string, data: unknown) => void; onAction?: (cardId: string, action: string, payload?: unknown) => void; onSendPrompt?: (text: string, opts: { mode: "compose" | "send"; context?: unknown; }) => void; onOpen?: (url: string, target: "tab" | "artifact") => void; onState?: (cardId: string, patch: unknown) => void; onDismiss?: (cardId: string) => void; onError?: (cardId: string, message: string) => void; maxSendPromptMode?: "compose" | "send" };
214
+ policy?: { onSubmit?: (cardId: string, data: unknown) => void; onAction?: (cardId: string, action: string, payload?: unknown) => void; onSendPrompt?: (text: string, opts: { mode: "compose" | "send"; context?: unknown; }) => void; onOpen?: (url: string, target: "tab" | "artifact") => void; onState?: (cardId: string, patch: unknown) => void; onDismiss?: (cardId: string) => void; onReopen?: (cardId: string) => void; onError?: (cardId: string, message: string) => void; maxSendPromptMode?: "compose" | "send" };
215
+ /** A child card transitioned to a resolved/deferred state (an action was chosen, a form/tasks submission landed, or it was dismissed) — re-emitted off the host as a non-bubbling convenience event so a consumer can observe resolution centrally without diffing the cards array. `detail` = `{ cardId, resolution }`. (A `reopen` un-resolves a card and has no `CardResolution`, so it does NOT fire this — observe reopen via the underlying bubbling `kai-card` event.) */
216
+ onCardResolved?: (event: CustomEvent<{ cardId: string; resolution: { kind: "action"; action: string; payload?: unknown; at?: undefined | string } | { kind: "submit"; data: unknown; at?: undefined | string } | { kind: "dismissed"; at?: undefined | string } | { kind: "expired"; reason?: undefined | string; at?: undefined | string } }>) => void;
108
217
  }
109
218
 
110
- export const Cards = createWebComponent<CardsProps>(
219
+ export const Cards = /*#__PURE__*/ createWebComponent<CardsProps>(
111
220
  'kai-cards',
112
221
  ["theme","cards","types","policy"],
113
- { },
222
+ { onCardResolved: 'kai-card-resolved' },
223
+ () => import('@kitn.ai/ui/elements/cards'),
114
224
  );
115
225
 
116
226
  export interface ChainOfThoughtProps extends WebComponentProps {
117
- /** The reasoning steps. Set as a JS property. Compound sub-parts collapse to this one data model (Route 1). */
118
- steps: { label: string; content?: undefined | string }[];
227
+ /** The reasoning steps. Set as a JS property. Compound sub-parts collapse to this one data model (Route 1). Each `{ label, content?, id? }`. */
228
+ steps: { label: string; content?: undefined | string; id?: undefined | string }[];
229
+ /** Open mode: `'multiple'` (default — any number of steps open at once) or `'single'` (at most one open; opening a step closes the others). */
230
+ type?: "single" | "multiple";
231
+ /** Controlled open step key(s). When set, it WINS over user interaction (the consumer owns the open set). String in `single` mode, string[] in `multiple` mode. Set as a JS property. */
232
+ value?: string | string[];
233
+ /** Uncontrolled INITIAL open step key(s) — seeds which steps render expanded. Ignored once `value` is provided. Set as a JS property. */
234
+ defaultValue?: string | string[];
235
+ /** The open set changed — by user click OR an expand()/collapse()/toggle() call. `value` is a string in `single` mode, a string[] in `multiple` mode. (Maps Radix Accordion's onValueChange.) */
236
+ onValueChange?: (event: CustomEvent<{ value: string | string[] }>) => void;
119
237
  }
120
238
 
121
- export const ChainOfThought = createWebComponent<ChainOfThoughtProps>(
239
+ export const ChainOfThought = /*#__PURE__*/ createWebComponent<ChainOfThoughtProps>(
122
240
  'kai-chain-of-thought',
123
- ["theme","steps"],
124
- { },
241
+ ["theme","steps","type","value","defaultValue"],
242
+ { onValueChange: 'kai-value-change' },
243
+ () => import('@kitn.ai/ui/elements/chain-of-thought'),
125
244
  );
126
245
 
127
246
  export interface ChatProps extends WebComponentProps {
128
247
  /** The full message thread to render, newest last. Each entry carries its role, content, and optional reasoning/tools/attachments/actions. Set as a JS property (`el.messages = [...]`). */
129
- messages: { id: string; role: "user" | "assistant"; content: string; reasoning?: undefined | { text: string; label?: undefined | string }; tools?: undefined | { type: string; state: "input-streaming" | "input-available" | "output-available" | "output-error"; input?: undefined | Record<string, unknown>; output?: undefined | Record<string, unknown>; toolCallId?: undefined | string; errorText?: undefined | string }[]; attachments?: undefined | { id: string; type: "file" | "source-document"; filename?: undefined | string; mediaType?: undefined | string; url?: undefined | string; title?: undefined | string }[]; actions?: undefined | ("copy" | "like" | "dislike" | "regenerate" | "edit" | { id: string; label: string; icon?: undefined | string; tooltip?: undefined | string })[]; avatar?: undefined | { src?: undefined | string; fallback?: undefined | string; alt?: undefined | string } }[];
130
- /** Controlled value of the input. When set, the host owns the input text and must update it on `kai-value-change`; leave unset for uncontrolled behavior. */
131
- value?: string;
248
+ messages: { id: string; role: "user" | "assistant"; content: string; reasoning?: undefined | { text: string; label?: undefined | string }; tools?: undefined | { type: string; state: "input-streaming" | "input-available" | "output-available" | "output-error"; input?: undefined | Record<string, unknown>; output?: undefined | Record<string, unknown>; toolCallId?: undefined | string; errorText?: undefined | string }[]; attachments?: undefined | { id: string; type: "file" | "source-document"; filename?: undefined | string; mediaType?: undefined | string; url?: undefined | string; title?: undefined | string }[]; actions?: undefined | ("copy" | "like" | "dislike" | "regenerate" | "edit" | { id: string; label: string; icon?: undefined | string; tooltip?: undefined | string })[]; avatar?: undefined | { src?: undefined | string; fallback?: undefined | string; alt?: undefined | string }; feedback?: undefined | "like" | "dislike" }[];
249
+ /** Value of the input. A **string** is controlled (the host owns the text and updates it on `kai-value-change`). A **ComposerDoc** is a one-time seed that pre-populates pills; the user then edits freely. Leave unset for uncontrolled. */
250
+ value?: string | ({ type: "text"; text: string } | { type: "entity"; entity: { kind: string; id: string; label: string; icon?: string; promptText?: string; data?: Record<string, unknown> } })[];
132
251
  /** Placeholder text shown in the empty input. */
133
252
  placeholder?: string;
134
253
  /** When true, shows the loading/streaming state and disables submit (use while awaiting the assistant's reply). */
@@ -140,7 +259,7 @@ export interface ChatProps extends WebComponentProps {
140
259
  /** Keep suggestions visible after the conversation starts. By default suggestions are conversation starters and hide once `messages` is non-empty; set this to keep them always shown. Default false. */
141
260
  persistSuggestions?: boolean;
142
261
  /** Body/prose font scale for rendered markdown (`'xs' | 'sm' | 'base' | 'lg'`). Defaults to `'sm'`. */
143
- proseSize?: "xs" | "sm" | "base" | "lg";
262
+ proseSize?: "sm" | "lg" | "xs" | "base";
144
263
  /** Shiki theme name for syntax-highlighted code blocks (e.g. `'github-dark-dimmed'`). */
145
264
  codeTheme?: string;
146
265
  /** Enable Shiki syntax highlighting in code blocks. Turn off to render plain `<pre>` blocks (lighter, no highlighter load). Default true. */
@@ -159,26 +278,36 @@ export interface ChatProps extends WebComponentProps {
159
278
  headerStart?: boolean;
160
279
  /** Whether the host has `slot="header-end"` content (right of the controls). */
161
280
  headerEnd?: boolean;
281
+ /** REPLACE — full custom header in place of the built-in title/model/context bar. */
282
+ headerFull?: boolean;
283
+ /** INJECT — left sidebar column (e.g. a conversation list / your own nav). */
284
+ sidebar?: boolean;
285
+ /** REPLACE — custom zero-state rendered in the message area while the thread is empty (replaces the empty message list only; the composer and its suggestions still render). */
286
+ empty?: boolean;
287
+ /** REPLACE — full custom composer in place of the built-in prompt input. The projected content wires its own submit (the data-flow boundary). */
288
+ composer?: boolean;
289
+ /** INJECT — accessory row just above the composer (e.g. extra actions). */
290
+ composerActions?: boolean;
291
+ /** INJECT — footer row below the composer (disclaimers, token meter, …). */
292
+ footer?: boolean;
162
293
  /** Show a Search (Globe) button in the input toolbar; fires a `search` event. */
163
294
  search?: boolean;
164
295
  /** Show a Voice (Mic) button in the input toolbar; fires a `voice` event. */
165
296
  voice?: boolean;
166
- /** Slash commandswhen set, typing `/` in the input opens the command palette and fires `kai-slash-select`. Set as a JS property. */
167
- slashCommands?: { id: string; label: string; description?: string; category?: string }[];
168
- /** Command ids to highlight as active in the palette. */
169
- slashActiveIds?: string[];
170
- /** Single-line palette rows. */
171
- slashCompact?: boolean;
297
+ /** Rich entity triggers each `{ char, kind, items }` opens a caret-anchored menu that inserts an atomic pill (`/` skills, `@` agents/plugins). Set as a JS property; forwarded to the input. */
298
+ triggers?: { char: string; kind: string; items?: { id: string; label: string; icon?: string; description?: string; group?: string; kind?: string; promptText?: string; data?: Record<string, unknown> }[] }[];
299
+ /** Default icon per entity kind (kind image src) for pills/menu items. */
300
+ kindIcons?: Record<string, string>;
172
301
  /** Whether each message's action bar is always visible (`'always'`, default) or only revealed on hover of that message row (`'hover'`). */
173
302
  actionsReveal?: "always" | "hover";
174
- /** An action button on a message was clicked. `action` is the built-in name or custom id. */
175
- onMessageAction?: (event: CustomEvent<{ messageId: string; action: string }>) => void;
303
+ /** The staged attachments changed (file added or removed). Carries the full current list so a consumer can react in real time. */
304
+ onAttachmentsChange?: (event: CustomEvent<{ attachments: { id: string; type: "file" | "source-document"; filename?: undefined | string; mediaType?: undefined | string; url?: undefined | string; title?: undefined | string }[] }>) => void;
305
+ /** An action button on a message was clicked. `action` is the built-in name or custom id. `state` is present only for the toggleable feedback votes: `'on'` when a like/dislike is set, `'off'` when re-tapped to clear. */
306
+ onMessageAction?: (event: CustomEvent<{ messageId: string; action: string; state?: undefined | "on" | "off" }>) => void;
176
307
  /** The header model switcher changed. */
177
308
  onModelChange?: (event: CustomEvent<{ modelId: string }>) => void;
178
309
  /** The Search button was clicked. */
179
310
  onSearch?: (event: CustomEvent<Record<string, never>>) => void;
180
- /** A slash command was chosen from the palette. */
181
- onSlashSelect?: (event: CustomEvent<{ command: { id: string; label: string; description?: undefined | string; category?: undefined | string } }>) => void;
182
311
  /** User submitted a message. */
183
312
  onSubmit?: (event: CustomEvent<{ value: string; attachments: { id: string; type: "file" | "source-document"; filename?: undefined | string; mediaType?: undefined | string; url?: undefined | string; title?: undefined | string }[] }>) => void;
184
313
  /** A suggestion chip was clicked (only in `suggestion-mode="fill"`). */
@@ -189,10 +318,11 @@ export interface ChatProps extends WebComponentProps {
189
318
  onVoice?: (event: CustomEvent<Record<string, never>>) => void;
190
319
  }
191
320
 
192
- export const Chat = createWebComponent<ChatProps>(
321
+ export const Chat = /*#__PURE__*/ createWebComponent<ChatProps>(
193
322
  'kai-chat',
194
- ["theme","messages","value","placeholder","loading","suggestions","suggestionMode","persistSuggestions","proseSize","codeTheme","codeHighlight","chatTitle","models","currentModel","context","scrollButton","headerStart","headerEnd","search","voice","slashCommands","slashActiveIds","slashCompact","actionsReveal"],
195
- { onMessageAction: 'kai-message-action', onModelChange: 'kai-model-change', onSearch: 'kai-search', onSlashSelect: 'kai-slash-select', onSubmit: 'kai-submit', onSuggestionClick: 'kai-suggestion-click', onValueChange: 'kai-value-change', onVoice: 'kai-voice' },
323
+ ["theme","messages","value","placeholder","loading","suggestions","suggestionMode","persistSuggestions","proseSize","codeTheme","codeHighlight","chatTitle","models","currentModel","context","scrollButton","headerStart","headerEnd","headerFull","sidebar","empty","composer","composerActions","footer","search","voice","triggers","kindIcons","actionsReveal"],
324
+ { onAttachmentsChange: 'kai-attachments-change', onMessageAction: 'kai-message-action', onModelChange: 'kai-model-change', onSearch: 'kai-search', onSubmit: 'kai-submit', onSuggestionClick: 'kai-suggestion-click', onValueChange: 'kai-value-change', onVoice: 'kai-voice' },
325
+ () => import('@kitn.ai/ui/elements/chat'),
196
326
  );
197
327
 
198
328
  export interface CheckpointProps extends WebComponentProps {
@@ -201,17 +331,18 @@ export interface CheckpointProps extends WebComponentProps {
201
331
  /** Tooltip on hover. */
202
332
  tooltip?: string;
203
333
  /** Visual button style. */
204
- variant?: "ghost" | "default" | "outline";
334
+ variant?: "default" | "ghost" | "outline";
205
335
  /** Button size (use an `icon*` size for an icon-only checkpoint). */
206
- size?: "sm" | "lg" | "md" | "icon" | "icon-sm";
336
+ size?: "sm" | "md" | "lg" | "icon" | "icon-sm";
207
337
  /** The checkpoint was clicked. */
208
338
  onSelect?: (event: CustomEvent) => void;
209
339
  }
210
340
 
211
- export const Checkpoint = createWebComponent<CheckpointProps>(
341
+ export const Checkpoint = /*#__PURE__*/ createWebComponent<CheckpointProps>(
212
342
  'kai-checkpoint',
213
343
  ["theme","label","tooltip","variant","size"],
214
344
  { onSelect: 'kai-select' },
345
+ () => import('@kitn.ai/ui/elements/checkpoint'),
215
346
  );
216
347
 
217
348
  export interface ChoiceProps extends WebComponentProps {
@@ -223,12 +354,49 @@ export interface ChoiceProps extends WebComponentProps {
223
354
  heading?: string;
224
355
  /** Set when the user resolved this card; renders the read-only view. Property: `el.resolution = { kind:'action', action:'…' }`. */
225
356
  resolution?: Record<string, unknown>;
357
+ /** Controlled selection — the selected option id. When set, the consumer owns the current pick (RadioGroup `value`). Attribute: `value`. */
358
+ value?: string;
359
+ /** Option id to pre-select on mount (uncontrolled seed). Attribute: `default-value`. */
360
+ defaultValue?: string;
361
+ /** Disable the whole radiogroup + Submit (e.g. while the agent is busy). Attribute: `disabled`. */
362
+ disabled?: boolean;
363
+ /** The selection changed BEFORE submit (a row click or the `select()` method). Distinct from the terminal `action` verb on the `kai-card` contract event. */
364
+ onValueChange?: (event: CustomEvent<{ value: string }>) => void;
226
365
  }
227
366
 
228
- export const Choice = createWebComponent<ChoiceProps>(
367
+ export const Choice = /*#__PURE__*/ createWebComponent<ChoiceProps>(
229
368
  'kai-choice',
230
- ["theme","data","cardId","heading","resolution"],
231
- { },
369
+ ["theme","data","cardId","heading","resolution","value","defaultValue","disabled"],
370
+ { onValueChange: 'kai-value-change' },
371
+ () => import('@kitn.ai/ui/elements/choice'),
372
+ );
373
+
374
+ export interface CoachmarkProps extends WebComponentProps {
375
+ /** Drive/observe open state (Shoelace-style: settable + reflected to the `open` attribute; the element still self-manages). Set `el.open = true`, or `<kai-coachmark open>`; listen for `kai-open-change`. */
376
+ open?: boolean;
377
+ /** Initial open state on mount (uncontrolled seed). */
378
+ defaultOpen?: boolean;
379
+ /** The bold title. Named `headline` because `title` collides with the global `HTMLElement.title` attribute (it throws at registration). */
380
+ headline?: string;
381
+ /** A small badge pill beside the headline (e.g. "New"). */
382
+ badge?: string;
383
+ /** Floating placement relative to the anchor (default `bottom`). */
384
+ placement?: string;
385
+ /** Color tone: `primary` (default, theme accent), `info` (blue), `success` (green), `warning` (amber), or `error` (red) — reusing the kit's tool hues. */
386
+ tone?: "error" | "primary" | "info" | "success" | "warning";
387
+ /** Render the arrow that points at the anchor (default `true`). Set `arrow="false"` for a plain bubble with no pointer. */
388
+ arrow?: boolean;
389
+ /** The × dismiss button was pressed. The consumer records that this hint was seen so it won't show again. */
390
+ onDismiss?: (event: CustomEvent<Record<string, never>>) => void;
391
+ /** The coachmark opened or closed (a method, the ×, or a driven `open`). */
392
+ onOpenChange?: (event: CustomEvent<{ open: boolean }>) => void;
393
+ }
394
+
395
+ export const Coachmark = /*#__PURE__*/ createWebComponent<CoachmarkProps>(
396
+ 'kai-coachmark',
397
+ ["theme","open","defaultOpen","headline","badge","placement","tone","arrow"],
398
+ { onDismiss: 'kai-dismiss', onOpenChange: 'kai-open-change' },
399
+ () => import('@kitn.ai/ui/elements/coachmark'),
232
400
  );
233
401
 
234
402
  export interface CodeBlockProps extends WebComponentProps {
@@ -241,13 +409,110 @@ export interface CodeBlockProps extends WebComponentProps {
241
409
  /** Disable syntax highlighting (renders plain text, no Shiki). */
242
410
  codeHighlight?: boolean;
243
411
  /** Code text sizing. */
244
- proseSize?: "xs" | "sm" | "base" | "lg";
412
+ proseSize?: "sm" | "lg" | "xs" | "base";
245
413
  }
246
414
 
247
- export const CodeBlock = createWebComponent<CodeBlockProps>(
415
+ export const CodeBlock = /*#__PURE__*/ createWebComponent<CodeBlockProps>(
248
416
  'kai-code-block',
249
417
  ["theme","code","language","codeTheme","codeHighlight","proseSize"],
250
418
  { },
419
+ () => import('@kitn.ai/ui/elements/code-block'),
420
+ );
421
+
422
+ export interface CommandProps extends WebComponentProps {
423
+ /** Flat list of items. Set as a JS property — not an HTML attribute. */
424
+ items?: { id: string; label: string; icon?: string; description?: string; shortcut?: string; group?: string }[];
425
+ /** Placeholder text for the search input. */
426
+ placeholder?: string;
427
+ /** Label shown when no items match the current query. */
428
+ emptyLabel?: string;
429
+ /** Fired when the highlighted/active item changes — via Arrow keys or when filtering re-clamps the active row. `id` is the newly active item's id, or `undefined` when no item is active (e.g. the filtered list is empty). Lets a host preview the active item without committing a selection. */
430
+ onActiveChange?: (event: CustomEvent<{ id: undefined | string }>) => void;
431
+ /** Fired on every keystroke in the search input. */
432
+ onQueryChange?: (event: CustomEvent<{ value: string }>) => void;
433
+ /** Fired when the user selects an item (click or Enter). */
434
+ onSelect?: (event: CustomEvent<{ id: string }>) => void;
435
+ }
436
+
437
+ export const Command = /*#__PURE__*/ createWebComponent<CommandProps>(
438
+ 'kai-command',
439
+ ["theme","items","placeholder","emptyLabel"],
440
+ { onActiveChange: 'kai-active-change', onQueryChange: 'kai-query-change', onSelect: 'kai-select' },
441
+ () => import('@kitn.ai/ui/elements/command'),
442
+ );
443
+
444
+ export interface CompareProps extends WebComponentProps {
445
+ /** The compare definition (prompt + the two candidates). Set as a JS PROPERTY: `el.data = { prompt, candidates: [A, B], collapse? }`. Import `ResponseCompareData` from `@kitn.ai/ui` for the full shape. */
446
+ data?: Record<string, unknown>;
447
+ /** Stable id correlating every emitted event. Attribute: `compare-id`. */
448
+ compareId?: string;
449
+ /** Re-hydrate / control the user's pick. Set as a JS PROPERTY: `el.selection = { chosenId, rejectedIds }`. Renders the collapsed winner. */
450
+ selection?: Record<string, unknown>;
451
+ /** Layout: `'auto'` (default — columns when wide, tabs when narrow, by CONTAINER width) | `'columns'` (side-by-side) | `'tabs'` (pills to switch). Attribute: `layout`. */
452
+ layout?: "auto" | "columns" | "tabs";
453
+ /** Prose/text size for the rendered candidates. Attribute: `prose-size`. */
454
+ proseSize?: "sm" | "lg" | "xs" | "base";
455
+ /** Shiki theme for code blocks in the candidates. Attribute: `code-theme`. */
456
+ codeTheme?: string;
457
+ /** Whether code blocks are syntax-highlighted. Attribute: `code-highlight`. */
458
+ codeHighlight?: boolean;
459
+ /** The user committed a pick. `detail` = `{ chosenId, rejectedIds, at }`. */
460
+ onCompareSelect?: (event: CustomEvent<{ chosenId: string; rejectedIds: string[]; at?: undefined | number }>) => void;
461
+ /** The definition was unusable. */
462
+ onError?: (event: CustomEvent<{ compareId: string; message: string }>) => void;
463
+ /** Both candidates have settled and the pick is live. */
464
+ onReady?: (event: CustomEvent<{ compareId: string }>) => void;
465
+ }
466
+
467
+ export const Compare = /*#__PURE__*/ createWebComponent<CompareProps>(
468
+ 'kai-compare',
469
+ ["theme","data","compareId","selection","layout","proseSize","codeTheme","codeHighlight"],
470
+ { onCompareSelect: 'kai-compare-select', onError: 'kai-error', onReady: 'kai-ready' },
471
+ () => import('@kitn.ai/ui/elements/compare'),
472
+ );
473
+
474
+ export interface ComposerProps extends WebComponentProps {
475
+ /** Controlled value — string or a full ComposerDoc (set as JS property). */
476
+ value?: string | ({ type: "text"; text: string } | { type: "entity"; entity: { kind: string; id: string; label: string; icon?: string; promptText?: string; data?: Record<string, unknown> } })[];
477
+ /** Placeholder text shown when the composer is empty. */
478
+ placeholder?: string;
479
+ /** Disable the composer entirely (non-interactive). */
480
+ disabled?: boolean;
481
+ /** Show a loading/streaming state and block submit. */
482
+ loading?: boolean;
483
+ /** Maximum height in px before the content scrolls. Default 240. */
484
+ maxHeight?: string | number;
485
+ /** Whether pressing Enter (without Shift) submits. Default true. */
486
+ submitOnEnter?: boolean;
487
+ /** Trigger definitions — set as a JS property. */
488
+ triggers?: { char: string; kind: string; items?: { id: string; label: string; icon?: string; description?: string; group?: string; kind?: string; promptText?: string; data?: Record<string, unknown> }[] }[];
489
+ /** Keyword highlight rules — set as a JS property. */
490
+ highlights?: (string | { pattern: string; flags?: string; class?: string })[];
491
+ /** Default icon per entity kind (kind → image URL/data-URI) for items without their own `icon`. Overrides the built-in agent/plugin glyphs. JS property. */
492
+ kindIcons?: Record<string, string>;
493
+ /** The composer lost focus. */
494
+ onBlur?: (event: CustomEvent<{ originalEvent: FocusEvent }>) => void;
495
+ /** An entity pill was inserted into the composer. */
496
+ onEntityAdd?: (event: CustomEvent<{ entity: { kind: string; id: string; label: string; icon?: undefined | string; promptText?: undefined | string; data?: undefined | Record<string, unknown> } }>) => void;
497
+ /** An entity pill was deleted from the composer. */
498
+ onEntityRemove?: (event: CustomEvent<{ entity: { kind: string; id: string; label: string; icon?: undefined | string; promptText?: undefined | string; data?: undefined | Record<string, unknown> } }>) => void;
499
+ /** The composer gained focus. `focus`/`blur` are NOT composed natively, so they don't escape the shadow root — these re-expose them on the host. (For `keydown`/`paste`/`focusin`/`focusout`, listen NATIVELY on `<kai-composer>`: they're composed and already cross the shadow boundary.) */
500
+ onFocus?: (event: CustomEvent<{ originalEvent: FocusEvent }>) => void;
501
+ /** The user submitted the composer (Enter or programmatic submit). */
502
+ onSubmit?: (event: CustomEvent<{ doc: ({ type: "text"; text: string } | { type: "entity"; entity: { kind: string; id: string; label: string; icon?: undefined | string; promptText?: undefined | string; data?: undefined | Record<string, unknown> } })[]; text: string; entities: { kind: string; id: string; label: string; icon?: undefined | string; promptText?: undefined | string; data?: undefined | Record<string, unknown> }[] }>) => void;
503
+ /** A trigger character was detected at the caret (e.g. `/` or `@`). */
504
+ onTrigger?: (event: CustomEvent<{ char: string; query: string; rect: DOMRect }>) => void;
505
+ /** The active trigger was dismissed (Escape, space, or outside click). */
506
+ onTriggerClose?: (event: CustomEvent<Record<string, never>>) => void;
507
+ /** The content changed (fires on every input event). */
508
+ onValueChange?: (event: CustomEvent<{ doc: ({ type: "text"; text: string } | { type: "entity"; entity: { kind: string; id: string; label: string; icon?: undefined | string; promptText?: undefined | string; data?: undefined | Record<string, unknown> } })[]; text: string; entities: { kind: string; id: string; label: string; icon?: undefined | string; promptText?: undefined | string; data?: undefined | Record<string, unknown> }[] }>) => void;
509
+ }
510
+
511
+ export const Composer = /*#__PURE__*/ createWebComponent<ComposerProps>(
512
+ 'kai-composer',
513
+ ["theme","value","placeholder","disabled","loading","maxHeight","submitOnEnter","triggers","highlights","kindIcons"],
514
+ { onBlur: 'kai-blur', onEntityAdd: 'kai-entity-add', onEntityRemove: 'kai-entity-remove', onFocus: 'kai-focus', onSubmit: 'kai-submit', onTrigger: 'kai-trigger', onTriggerClose: 'kai-trigger-close', onValueChange: 'kai-value-change' },
515
+ () => import('@kitn.ai/ui/elements/composer'),
251
516
  );
252
517
 
253
518
  export interface ConfirmProps extends WebComponentProps {
@@ -263,10 +528,11 @@ export interface ConfirmProps extends WebComponentProps {
263
528
  resolution?: Record<string, unknown>;
264
529
  }
265
530
 
266
- export const Confirm = createWebComponent<ConfirmProps>(
531
+ export const Confirm = /*#__PURE__*/ createWebComponent<ConfirmProps>(
267
532
  'kai-confirm',
268
533
  ["theme","data","cardId","heading","autofocus","resolution"],
269
534
  { },
535
+ () => import('@kitn.ai/ui/elements/confirm-card'),
270
536
  );
271
537
 
272
538
  export interface ContextProps extends WebComponentProps {
@@ -280,31 +546,79 @@ export interface ContextProps extends WebComponentProps {
280
546
  onThresholdChange?: (event: CustomEvent<{ level: "ok" | "warn" | "danger" }>) => void;
281
547
  }
282
548
 
283
- export const Context = createWebComponent<ContextProps>(
549
+ export const Context = /*#__PURE__*/ createWebComponent<ContextProps>(
284
550
  'kai-context',
285
551
  ["theme","context","warnThreshold","dangerThreshold"],
286
552
  { onThresholdChange: 'kai-threshold-change' },
553
+ () => import('@kitn.ai/ui/elements/context-meter'),
287
554
  );
288
555
 
289
556
  export interface ConversationsProps extends WebComponentProps {
290
557
  /** Pre-bucketed conversation groups (e.g. "Today", "Yesterday"), each with its own conversations. Use this when you want to control the grouping/headers yourself; otherwise pass a flat `conversations` array. Set as a JS property. */
291
558
  groups: { id: string; userId?: undefined | string; teamId?: undefined | string; name: string; sortOrder: number; createdAt: string }[];
292
559
  /** A flat list of conversation summaries; the component buckets them by recency for you. Ignored when `groups` is provided. Set as a JS property. */
293
- conversations: { id: string; title: string; groupId?: undefined | string; scope: { type: "document" | "collection"; documentId?: undefined | string; filters?: undefined | { tags?: undefined | string[]; authors?: undefined | string[]; contentType?: undefined | "transcript" | "markdown"; dateRange?: undefined | { from: string; to: string } } }; messageCount: number; lastMessageAt: string; updatedAt: string }[];
560
+ conversations: { id: string; title: string; groupId?: undefined | string; scope: { type: "document" | "collection"; documentId?: undefined | string; filters?: undefined | { tags?: undefined | string[]; authors?: undefined | string[]; contentType?: undefined | "transcript" | "markdown"; dateRange?: undefined | { from: string; to: string } } }; messageCount: number; lastMessageAt: string; updatedAt: string; trailing?: undefined | string }[];
294
561
  /** The id of the currently-open conversation, highlighted in the list. */
295
562
  activeId?: string;
563
+ /** Controlled collapsed state. Set as a JS property (`el.collapsed = true`) to drive the rail from your app, updating it in response to `kai-collapse-toggle`. Omit for uncontrolled (the element manages it). Collapsed shrinks the rail to a floating reopen button. */
564
+ collapsed?: boolean;
565
+ /** Initial collapsed state when uncontrolled (default false). Use the `default-collapsed` attribute to start collapsed in plain HTML. */
566
+ defaultCollapsed?: boolean;
567
+ /** The rail was collapsed or expanded (via the toggle, the reopen button, or a `collapse()`/`expand()`/`toggle()` call). */
568
+ onCollapseToggle?: (event: CustomEvent<{ collapsed: boolean }>) => void;
296
569
  /** A conversation was selected. */
297
570
  onConversationSelect?: (event: CustomEvent<{ id: string }>) => void;
298
571
  /** The "New chat" button was clicked. */
299
572
  onNewChat?: (event: CustomEvent<Record<string, never>>) => void;
573
+ /** The built-in search box query changed (typing, or a programmatic `clear()` which fires it with `''`). Lets a consumer mirror or server-side the filter. */
574
+ onSearch?: (event: CustomEvent<{ query: string }>) => void;
300
575
  /** The sidebar toggle was clicked. */
301
576
  onToggleSidebar?: (event: CustomEvent<Record<string, never>>) => void;
302
577
  }
303
578
 
304
- export const Conversations = createWebComponent<ConversationsProps>(
579
+ export const Conversations = /*#__PURE__*/ createWebComponent<ConversationsProps>(
305
580
  'kai-conversations',
306
- ["theme","groups","conversations","activeId"],
307
- { onConversationSelect: 'kai-conversation-select', onNewChat: 'kai-new-chat', onToggleSidebar: 'kai-toggle-sidebar' },
581
+ ["theme","groups","conversations","activeId","collapsed","defaultCollapsed"],
582
+ { onCollapseToggle: 'kai-collapse-toggle', onConversationSelect: 'kai-conversation-select', onNewChat: 'kai-new-chat', onSearch: 'kai-search', onToggleSidebar: 'kai-toggle-sidebar' },
583
+ () => import('@kitn.ai/ui/elements/conversation-list'),
584
+ );
585
+
586
+ export interface DialogProps extends WebComponentProps {
587
+ /** Drive/observe open state (Shoelace-style: settable + reflected to the `open` attribute; the element still self-manages on Escape/backdrop). Set `el.open = true`, or `<kai-dialog open>`; listen for `kai-open-change`. */
588
+ open?: boolean;
589
+ /** Initial open state on mount (uncontrolled seed). */
590
+ defaultOpen?: boolean;
591
+ /** The dialog opened or closed (Escape, backdrop click, a driven `open`, or a method). */
592
+ onOpenChange?: (event: CustomEvent<{ open: boolean }>) => void;
593
+ }
594
+
595
+ export const Dialog = /*#__PURE__*/ createWebComponent<DialogProps>(
596
+ 'kai-dialog',
597
+ ["theme","open","defaultOpen"],
598
+ { onOpenChange: 'kai-open-change' },
599
+ () => import('@kitn.ai/ui/elements/dialog'),
600
+ );
601
+
602
+ export interface EditableLabelProps extends WebComponentProps {
603
+ /** The label text — settable and reflected to the `value` attribute. Read `el.value` for live state. */
604
+ value?: string;
605
+ /** Controlled edit state. `el.editing = true` opens the field; reflected to the `editing` attribute. */
606
+ editing?: boolean;
607
+ /** Placeholder shown while editing / when the value is empty. */
608
+ placeholder?: string;
609
+ /** Disable entering edit mode. */
610
+ disabled?: boolean;
611
+ /** Edit was cancelled (Esc); the text is restored. */
612
+ onCancel?: (event: CustomEvent<Record<string, never>>) => void;
613
+ /** Committed a changed value (Enter / blur). */
614
+ onRename?: (event: CustomEvent<{ value: string }>) => void;
615
+ }
616
+
617
+ export const EditableLabel = /*#__PURE__*/ createWebComponent<EditableLabelProps>(
618
+ 'kai-editable-label',
619
+ ["theme","value","editing","placeholder","disabled"],
620
+ { onCancel: 'kai-cancel', onRename: 'kai-rename' },
621
+ () => import('@kitn.ai/ui/elements/editable-label'),
308
622
  );
309
623
 
310
624
  export interface EmbedProps extends WebComponentProps {
@@ -314,10 +628,11 @@ export interface EmbedProps extends WebComponentProps {
314
628
  data?: { provider: "youtube" | "vimeo" | "generic"; id?: string; url?: string; title?: string; poster?: string; start?: number; aspectRatio?: "16:9" | "4:3" | "1:1" | "9:16" };
315
629
  }
316
630
 
317
- export const Embed = createWebComponent<EmbedProps>(
631
+ export const Embed = /*#__PURE__*/ createWebComponent<EmbedProps>(
318
632
  'kai-embed',
319
633
  ["theme","cardId","data"],
320
634
  { },
635
+ () => import('@kitn.ai/ui/elements/embed'),
321
636
  );
322
637
 
323
638
  export interface EmptyProps extends WebComponentProps {
@@ -327,10 +642,11 @@ export interface EmptyProps extends WebComponentProps {
327
642
  description?: string;
328
643
  }
329
644
 
330
- export const Empty = createWebComponent<EmptyProps>(
645
+ export const Empty = /*#__PURE__*/ createWebComponent<EmptyProps>(
331
646
  'kai-empty',
332
647
  ["theme","emptyTitle","description"],
333
648
  { },
649
+ () => import('@kitn.ai/ui/elements/empty'),
334
650
  );
335
651
 
336
652
  export interface FeedbackBarProps extends WebComponentProps {
@@ -356,27 +672,31 @@ export interface FeedbackBarProps extends WebComponentProps {
356
672
  onFeedbackDetail?: (event: CustomEvent<{ value: "helpful" | "not-helpful"; category?: undefined | string; comment?: undefined | string }>) => void;
357
673
  }
358
674
 
359
- export const FeedbackBar = createWebComponent<FeedbackBarProps>(
675
+ export const FeedbackBar = /*#__PURE__*/ createWebComponent<FeedbackBarProps>(
360
676
  'kai-feedback-bar',
361
677
  ["theme","barTitle","collectDetail","categories","detailTitle","detailPlaceholder","submitLabel","thanksMessage"],
362
678
  { onClose: 'kai-close', onFeedback: 'kai-feedback', onFeedbackDetail: 'kai-feedback-detail' },
679
+ () => import('@kitn.ai/ui/elements/feedback-bar'),
363
680
  );
364
681
 
365
682
  export interface FileTreeProps extends WebComponentProps {
366
- /** The files to render. Set as a JS property (array of `{ path, url?, code?, language?, type? }`). */
367
- files: { path: string; url?: undefined | string; code?: undefined | string; language?: undefined | string; type?: undefined | "html" | "pdf" | "image" | "other" }[];
683
+ /** The files to render. Set as a JS property (array of `{ path, url?, code?, language?, type?, additions?, deletions?, status? }`). */
684
+ files: { path: string; url?: undefined | string; code?: undefined | string; language?: undefined | string; type?: undefined | "html" | "pdf" | "image" | "other"; additions?: undefined | number; deletions?: undefined | number; status?: undefined | "added" | "modified" | "deleted" | "renamed" | "untracked" }[];
368
685
  /** Selected file path — highlighted in the tree. */
369
686
  activeFile?: string;
370
687
  /** Folder paths expanded initially. Omit to start with all folders open. */
371
688
  defaultExpanded?: string[];
689
+ /** Show a changed-files summary header (file count + summed `+/-` + Collapse-all). Attribute: `summary`. Off by default. */
690
+ summary?: boolean;
372
691
  /** Fired when a file is selected. `detail.path` = the file's path. */
373
692
  onSelect?: (event: CustomEvent<{ path: string }>) => void;
374
693
  }
375
694
 
376
- export const FileTree = createWebComponent<FileTreeProps>(
695
+ export const FileTree = /*#__PURE__*/ createWebComponent<FileTreeProps>(
377
696
  'kai-file-tree',
378
- ["theme","files","activeFile","defaultExpanded"],
697
+ ["theme","files","activeFile","defaultExpanded","summary"],
379
698
  { onSelect: 'kai-select' },
699
+ () => import('@kitn.ai/ui/elements/file-tree'),
380
700
  );
381
701
 
382
702
  export interface FileUploadProps extends WebComponentProps {
@@ -392,10 +712,11 @@ export interface FileUploadProps extends WebComponentProps {
392
712
  onFilesAdded?: (event: CustomEvent<{ files: File[] }>) => void;
393
713
  }
394
714
 
395
- export const FileUpload = createWebComponent<FileUploadProps>(
715
+ export const FileUpload = /*#__PURE__*/ createWebComponent<FileUploadProps>(
396
716
  'kai-file-upload',
397
717
  ["theme","multiple","accept","disabled","label"],
398
718
  { onFilesAdded: 'kai-files-added' },
719
+ () => import('@kitn.ai/ui/elements/file-upload'),
399
720
  );
400
721
 
401
722
  export interface FormProps extends WebComponentProps {
@@ -407,12 +728,59 @@ export interface FormProps extends WebComponentProps {
407
728
  heading?: string;
408
729
  /** Set when the user resolved this card; renders the read-only view. Property: `el.resolution = { kind:'submit', data:{…} }`. */
409
730
  resolution?: Record<string, unknown>;
731
+ /** Controlled field values (JS property). When set, it wins over local edits. */
732
+ values?: Record<string, unknown>;
733
+ /** Initial values overlaying the schema defaults (uncontrolled seed; JS property). */
734
+ defaultValues?: Record<string, unknown>;
735
+ /** Disable all fields + submit. Attribute: `disabled`. */
736
+ disabled?: boolean;
737
+ /** The form's values changed on input — current coerced values + validity. */
738
+ onValuesChange?: (event: CustomEvent<{ values: Record<string, unknown>; valid: boolean }>) => void;
410
739
  }
411
740
 
412
- export const Form = createWebComponent<FormProps>(
741
+ export const Form = /*#__PURE__*/ createWebComponent<FormProps>(
413
742
  'kai-form',
414
- ["theme","data","cardId","heading","resolution"],
743
+ ["theme","data","cardId","heading","resolution","values","defaultValues","disabled"],
744
+ { onValuesChange: 'kai-values-change' },
745
+ () => import('@kitn.ai/ui/elements/form'),
746
+ );
747
+
748
+ export interface HoverCardProps extends WebComponentProps {
749
+ /** Delay (ms) before the card opens on hover. Defaults to 0 (focus opens it immediately too). */
750
+ openDelay?: number;
751
+ /** Delay (ms) before it closes after the pointer leaves. Defaults to 300. */
752
+ closeDelay?: number;
753
+ /** Preferred placement: `'top' | 'bottom' | 'left' | 'right'` (+ optional `-start`/`-end`). Defaults to `'bottom'`; flips to stay in view. */
754
+ placement?: string;
755
+ /** Drive/observe open state (Shoelace-style: settable + reflected to the `open` attribute, the element still self-manages on hover). Set `el.open = true`, or `<kai-hover-card open>`; listen for `kai-open-change`. */
756
+ open?: boolean;
757
+ /** Initial open state on mount (uncontrolled seed). */
758
+ defaultOpen?: boolean;
759
+ /** Suppress the hover behavior entirely without unmounting. */
760
+ disabled?: boolean;
761
+ /** The card opened or closed (by hover/focus, outside-click, or a method). */
762
+ onOpenChange?: (event: CustomEvent<{ open: boolean }>) => void;
763
+ }
764
+
765
+ export const HoverCard = /*#__PURE__*/ createWebComponent<HoverCardProps>(
766
+ 'kai-hover-card',
767
+ ["theme","openDelay","closeDelay","placement","open","defaultOpen","disabled"],
768
+ { onOpenChange: 'kai-open-change' },
769
+ () => import('@kitn.ai/ui/elements/hover-card'),
770
+ );
771
+
772
+ export interface IconProps extends WebComponentProps {
773
+ /** A curated icon name (e.g. `"mic"`, `"globe"`), an image URL/data-URI, or plain text. */
774
+ name?: string;
775
+ /** Size token: `sm` | `md` (default) | `lg`. */
776
+ size?: "sm" | "md" | "lg";
777
+ }
778
+
779
+ export const Icon = /*#__PURE__*/ createWebComponent<IconProps>(
780
+ 'kai-icon',
781
+ ["theme","name","size"],
415
782
  { },
783
+ () => import('@kitn.ai/ui/elements/icon'),
416
784
  );
417
785
 
418
786
  export interface ImageProps extends WebComponentProps {
@@ -426,10 +794,69 @@ export interface ImageProps extends WebComponentProps {
426
794
  mediaType?: string;
427
795
  }
428
796
 
429
- export const Image = createWebComponent<ImageProps>(
797
+ export const Image = /*#__PURE__*/ createWebComponent<ImageProps>(
430
798
  'kai-image',
431
799
  ["theme","base64","bytes","alt","mediaType"],
432
800
  { },
801
+ () => import('@kitn.ai/ui/elements/image'),
802
+ );
803
+
804
+ export interface InputProps extends WebComponentProps {
805
+ /** Native input type: `text` (default) · `email` · `url` · `search` · `tel` · `password` · `number`. Single-line only. */
806
+ type?: string;
807
+ /** Controlled value — settable and reflected to the `value` attribute. `el.value = 'hi'` drives it (no event); typing updates it and fires `kai-input`. Read `el.value` for live state. */
808
+ value?: string;
809
+ /** Placeholder shown when empty. */
810
+ placeholder?: string;
811
+ /** Field label, linked to the input. */
812
+ label?: string;
813
+ /** Helper text below the control. */
814
+ hint?: string;
815
+ /** Error text; flips the field invalid (`aria-invalid` + destructive border). */
816
+ error?: string;
817
+ /** Control density: `sm` or `md`. Defaults to `md`. */
818
+ size?: "sm" | "md";
819
+ /** Disable interaction. */
820
+ disabled?: boolean;
821
+ /** Make the input read-only. */
822
+ readonly?: boolean;
823
+ /** Mark the input required. */
824
+ required?: boolean;
825
+ /** Force the invalid state without an `error` string. */
826
+ invalid?: boolean;
827
+ /** Form-control name. */
828
+ name?: string;
829
+ /** Autofill hint forwarded to the inner input (e.g. `email`, `current-password`). */
830
+ autocomplete?: string;
831
+ /** Virtual-keyboard hint forwarded to the inner input (e.g. `numeric`, `email`). */
832
+ inputmode?: string;
833
+ /** The value was committed (blur). */
834
+ onChange?: (event: CustomEvent<{ value: string }>) => void;
835
+ /** The value changed per keystroke. */
836
+ onInput?: (event: CustomEvent<{ value: string }>) => void;
837
+ }
838
+
839
+ export const Input = /*#__PURE__*/ createWebComponent<InputProps>(
840
+ 'kai-input',
841
+ ["theme","type","value","placeholder","label","hint","error","size","disabled","readonly","required","invalid","name","autocomplete","inputmode"],
842
+ { onChange: 'kai-change', onInput: 'kai-input' },
843
+ () => import('@kitn.ai/ui/elements/input'),
844
+ );
845
+
846
+ export interface KbdProps extends WebComponentProps {
847
+ /** Shortcut spec — tokens joined by `+` (e.g. `Mod+Shift+K`). Omit it to show default-slot content instead. Display only; the element does not bind keys. */
848
+ keys?: string;
849
+ /** `mac` uses ⌘/⌥, `other` uses Ctrl. `auto` (default) sniffs the OS. */
850
+ platform?: "other" | "auto" | "mac";
851
+ /** Cap size: `sm` or `md`. Defaults to `md`. */
852
+ size?: "sm" | "md";
853
+ }
854
+
855
+ export const Kbd = /*#__PURE__*/ createWebComponent<KbdProps>(
856
+ 'kai-kbd',
857
+ ["theme","keys","platform","size"],
858
+ { },
859
+ () => import('@kitn.ai/ui/elements/kbd'),
433
860
  );
434
861
 
435
862
  export interface LinkPreviewProps extends WebComponentProps {
@@ -439,47 +866,82 @@ export interface LinkPreviewProps extends WebComponentProps {
439
866
  data?: { url: string; title?: string; description?: string; image?: string; imageAlt?: string; favicon?: string; domain?: string; siteName?: string };
440
867
  }
441
868
 
442
- export const LinkPreview = createWebComponent<LinkPreviewProps>(
869
+ export const LinkPreview = /*#__PURE__*/ createWebComponent<LinkPreviewProps>(
443
870
  'kai-link-preview',
444
871
  ["theme","cardId","data"],
445
872
  { },
873
+ () => import('@kitn.ai/ui/elements/link-preview'),
446
874
  );
447
875
 
448
876
  export interface LoaderProps extends WebComponentProps {
449
877
  /** The animation style: `'circular' | 'classic' | 'pulse' | 'pulse-dot' | 'dots' | 'typing' | 'wave' | 'bars' | 'terminal' | 'text-blink' | 'text-shimmer' | 'loading-dots'`. Defaults to `'circular'`. */
450
878
  variant?: "circular" | "classic" | "pulse" | "pulse-dot" | "dots" | "typing" | "wave" | "bars" | "terminal" | "text-blink" | "text-shimmer" | "loading-dots";
451
879
  /** Loader size: `'sm' | 'md' | 'lg'`. Defaults to `'md'`. */
452
- size?: "sm" | "lg" | "md";
880
+ size?: "sm" | "md" | "lg";
453
881
  /** Label for the text-based variants. */
454
882
  text?: string;
455
883
  }
456
884
 
457
- export const Loader = createWebComponent<LoaderProps>(
885
+ export const Loader = /*#__PURE__*/ createWebComponent<LoaderProps>(
458
886
  'kai-loader',
459
887
  ["theme","variant","size","text"],
460
888
  { },
889
+ () => import('@kitn.ai/ui/elements/loader'),
461
890
  );
462
891
 
463
892
  export interface MarkdownProps extends WebComponentProps {
464
893
  /** The markdown source to render. */
465
894
  content: string;
466
895
  /** Text/markdown sizing. */
467
- proseSize?: "xs" | "sm" | "base" | "lg";
896
+ proseSize?: "sm" | "lg" | "xs" | "base";
468
897
  /** Shiki theme for fenced code blocks. */
469
898
  codeTheme?: string;
470
899
  /** Disable syntax highlighting (no Shiki loads). */
471
900
  codeHighlight?: boolean;
472
901
  }
473
902
 
474
- export const Markdown = createWebComponent<MarkdownProps>(
903
+ export const Markdown = /*#__PURE__*/ createWebComponent<MarkdownProps>(
475
904
  'kai-markdown',
476
905
  ["theme","content","proseSize","codeTheme","codeHighlight"],
477
906
  { },
907
+ () => import('@kitn.ai/ui/elements/markdown'),
908
+ );
909
+
910
+ export interface MenuProps extends WebComponentProps {
911
+ /** Tree of menu items. Set as a JS property — not an HTML attribute. */
912
+ items?: { id?: string; label?: string; icon?: string; shortcut?: string; checked?: boolean; radioGroup?: string; disabled?: boolean; separator?: boolean; heading?: boolean; items?: Record<string, unknown>[] }[];
913
+ /** Optional placement hint (unused by the underlying Dropdown which always positions bottom-start, kept for future extension). */
914
+ placement?: string;
915
+ /** Built-in trigger: leading icon (a named icon like `"plus"`, an image URL/data-URI, or text). Use this instead of slotting `slot="trigger"` for the common case — a slotted trigger overrides it. */
916
+ triggerIcon?: string;
917
+ /** Built-in trigger: a text label (e.g. `"High"`). */
918
+ triggerLabel?: string;
919
+ /** Built-in trigger: a trailing icon (e.g. `"chevron-down"` for a select look). */
920
+ triggerIconTrailing?: string;
921
+ /** Accessible name for an icon-only trigger (no visible label). */
922
+ label?: string;
923
+ /** Drive/observe open state (Shoelace-style: settable + reflected to the `open` attribute, the menu still self-manages on click/keyboard). Set `el.open = true`, or `<kai-menu open>`; listen for `kai-open-change`. */
924
+ open?: boolean;
925
+ /** Initial open state on mount (uncontrolled seed). */
926
+ defaultOpen?: boolean;
927
+ /** Disable the trigger — click/keyboard and `show()` no longer open the menu. */
928
+ disabled?: boolean;
929
+ /** The menu opened or closed (by click, keyboard, Escape, outside-click, or a method). */
930
+ onOpenChange?: (event: CustomEvent<{ open: boolean }>) => void;
931
+ /** Fired when the user selects a leaf item. - Plain items: `{ id }`. - Checkbox items: `{ id, checked }` where `checked` is the NEW state. - Radio items: `{ id, radioGroup }` — the consumer marks `id` as the selected one in `radioGroup` and clears the others. */
932
+ onSelect?: (event: CustomEvent<{ id: string; checked?: undefined | boolean; radioGroup?: undefined | string }>) => void;
933
+ }
934
+
935
+ export const Menu = /*#__PURE__*/ createWebComponent<MenuProps>(
936
+ 'kai-menu',
937
+ ["theme","items","placement","triggerIcon","triggerLabel","triggerIconTrailing","label","open","defaultOpen","disabled"],
938
+ { onOpenChange: 'kai-open-change', onSelect: 'kai-select' },
939
+ () => import('@kitn.ai/ui/elements/menu'),
478
940
  );
479
941
 
480
942
  export interface MessageProps extends WebComponentProps {
481
943
  /** The full message object. Set as a JS property. */
482
- message?: { id: string; role: "user" | "assistant"; content: string; reasoning?: { text: string; label?: string }; tools?: { type: string; state: "input-streaming" | "input-available" | "output-available" | "output-error"; input?: Record<string, unknown>; output?: Record<string, unknown>; toolCallId?: string; errorText?: string }[]; attachments?: { id: string; type: "file" | "source-document"; filename?: string; mediaType?: string; url?: string; title?: string }[]; actions?: ("copy" | "like" | "dislike" | "regenerate" | "edit" | { id: string; label: string; icon?: string; tooltip?: string })[]; avatar?: { src?: string; fallback?: string; alt?: string } };
944
+ message?: { id: string; role: "user" | "assistant"; content: string; reasoning?: { text: string; label?: string }; tools?: { type: string; state: "input-streaming" | "input-available" | "output-available" | "output-error"; input?: Record<string, unknown>; output?: Record<string, unknown>; toolCallId?: string; errorText?: string }[]; attachments?: { id: string; type: "file" | "source-document"; filename?: string; mediaType?: string; url?: string; title?: string }[]; actions?: ("copy" | "like" | "dislike" | "regenerate" | "edit" | { id: string; label: string; icon?: string; tooltip?: string })[]; avatar?: { src?: string; fallback?: string; alt?: string }; feedback?: "like" | "dislike" };
483
945
  /** Convenience for simple cases when not passing a `message` object. */
484
946
  role?: "user" | "assistant";
485
947
  /** Convenience content (used when `message` is not set). */
@@ -487,7 +949,7 @@ export interface MessageProps extends WebComponentProps {
487
949
  /** Force markdown on/off. Defaults to on for assistant, off for user. */
488
950
  markdown?: boolean;
489
951
  /** Text/markdown sizing for the message body. */
490
- proseSize?: "xs" | "sm" | "base" | "lg";
952
+ proseSize?: "sm" | "lg" | "xs" | "base";
491
953
  /** Shiki theme name used for fenced code blocks in the content. */
492
954
  codeTheme?: string;
493
955
  /** Disable syntax highlighting for code blocks (no Shiki loads). */
@@ -498,14 +960,17 @@ export interface MessageProps extends WebComponentProps {
498
960
  avatarSrc?: string;
499
961
  /** Convenience avatar fallback text (used when `message.avatar` is not set). */
500
962
  avatarFallback?: string;
501
- /** An action button was clicked. `action` is the built-in name or custom id. */
502
- onMessageAction?: (event: CustomEvent<{ messageId: string; action: string }>) => void;
963
+ /** Avatar rail mode. `'none'` omits the avatar rail entirely so the body spans the full row (predictable layout when you never show avatars). Any other value keeps the default behaviour: the built-in avatar when one resolves, or your `slot="avatar"` content when projected (which REPLACES the built-in). */
964
+ avatar?: string;
965
+ /** An action button was clicked. `action` is the built-in name or custom id. `state` is present only for the toggleable feedback votes: `'on'` when a like/dislike is set, `'off'` when re-tapped to clear. */
966
+ onMessageAction?: (event: CustomEvent<{ messageId: string; action: string; state?: undefined | "on" | "off" }>) => void;
503
967
  }
504
968
 
505
- export const Message = createWebComponent<MessageProps>(
969
+ export const Message = /*#__PURE__*/ createWebComponent<MessageProps>(
506
970
  'kai-message',
507
- ["theme","message","role","content","markdown","proseSize","codeTheme","codeHighlight","actionsReveal","avatarSrc","avatarFallback"],
971
+ ["theme","message","role","content","markdown","proseSize","codeTheme","codeHighlight","actionsReveal","avatarSrc","avatarFallback","avatar"],
508
972
  { onMessageAction: 'kai-message-action' },
973
+ () => import('@kitn.ai/ui/elements/message'),
509
974
  );
510
975
 
511
976
  export interface ModelSwitcherProps extends WebComponentProps {
@@ -513,14 +978,119 @@ export interface ModelSwitcherProps extends WebComponentProps {
513
978
  models: { id: string; name: string; provider?: undefined | string; description?: undefined | string; group?: undefined | string }[];
514
979
  /** The currently-selected model id. Defaults to the first model. */
515
980
  currentModel?: string;
981
+ /** Drive/observe the dropdown's open state (Shoelace-style: settable + reflected to the `open` attribute, the dropdown still self-manages on click/keyboard). Set `el.open = true`, or `<kai-model-switcher open>`; listen for `kai-open-change`. */
982
+ open?: boolean;
983
+ /** Initial open state on mount (uncontrolled seed). */
984
+ defaultOpen?: boolean;
985
+ /** Disable the trigger — click/keyboard and `show()` no longer open the dropdown. */
986
+ disabled?: boolean;
516
987
  /** A model was selected. */
517
988
  onModelChange?: (event: CustomEvent<{ modelId: string }>) => void;
989
+ /** The model dropdown opened or closed (by click, keyboard, Escape, outside-click, or a method). */
990
+ onOpenChange?: (event: CustomEvent<{ open: boolean }>) => void;
518
991
  }
519
992
 
520
- export const ModelSwitcher = createWebComponent<ModelSwitcherProps>(
993
+ export const ModelSwitcher = /*#__PURE__*/ createWebComponent<ModelSwitcherProps>(
521
994
  'kai-model-switcher',
522
- ["theme","models","currentModel"],
523
- { onModelChange: 'kai-model-change' },
995
+ ["theme","models","currentModel","open","defaultOpen","disabled"],
996
+ { onModelChange: 'kai-model-change', onOpenChange: 'kai-open-change' },
997
+ () => import('@kitn.ai/ui/elements/model-switcher'),
998
+ );
999
+
1000
+ export interface NavProps extends WebComponentProps {
1001
+ /** The nav items. Set as a JS property (array, not an attribute). Each item may carry `children` (a collapsible group), a `status` dot, and trailing `meta` text. */
1002
+ items?: { id: string; label?: string; icon?: string; badge?: string; trailing?: string; disabled?: boolean; children?: Record<string, unknown>[]; status?: { tone: "error" | "primary" | "info" | "success" | "warning" | "neutral"; label?: string; pulse?: boolean }; meta?: string; action?: { icon: string; label: string }; closable?: boolean }[];
1003
+ /** Active item id (controlled). */
1004
+ value?: string;
1005
+ /** Initial active id when uncontrolled. */
1006
+ defaultValue?: string;
1007
+ /** Ids of group items collapsed on first render (groups default to expanded). Set as a JS property (array). */
1008
+ defaultCollapsed?: string[];
1009
+ /** A row's trailing `action` button was activated (not a select). `value` is the item id; `action` echoes the item's `{ icon, label }`. */
1010
+ onNavItemAction?: (event: CustomEvent<{ value: string; action?: undefined | { icon: string; label: string } }>) => void;
1011
+ /** A `closable` row's trailing close button was activated (not a select). `value` is the item id. */
1012
+ onNavItemClose?: (event: CustomEvent<{ value: string }>) => void;
1013
+ /** A nav item was activated. */
1014
+ onNavSelect?: (event: CustomEvent<{ id: string }>) => void;
1015
+ }
1016
+
1017
+ export const Nav = /*#__PURE__*/ createWebComponent<NavProps>(
1018
+ 'kai-nav',
1019
+ ["theme","items","value","defaultValue","defaultCollapsed"],
1020
+ { onNavItemAction: 'kai-nav-item-action', onNavItemClose: 'kai-nav-item-close', onNavSelect: 'kai-nav-select' },
1021
+ () => import('@kitn.ai/ui/elements/nav'),
1022
+ );
1023
+
1024
+ export interface NoticeProps extends WebComponentProps {
1025
+ /** `neutral` (default) · `info` · `warning` · `error` · `success`. Drives the leading icon's color and the a11y role (`alert` for errors, else `status`). */
1026
+ severity?: "error" | "info" | "success" | "warning" | "neutral";
1027
+ /** Leading icon: omit for the severity default, `"none"` to hide it, or a named icon to override. */
1028
+ icon?: string;
1029
+ /** Show a dismiss (×) that hides the notice and emits `kai-dismiss`. */
1030
+ dismissible?: boolean;
1031
+ /** The notice was dismissed via its × (it also hides itself). */
1032
+ onDismiss?: (event: CustomEvent) => void;
1033
+ }
1034
+
1035
+ export const Notice = /*#__PURE__*/ createWebComponent<NoticeProps>(
1036
+ 'kai-notice',
1037
+ ["theme","severity","icon","dismissible"],
1038
+ { onDismiss: 'kai-dismiss' },
1039
+ () => import('@kitn.ai/ui/elements/notice'),
1040
+ );
1041
+
1042
+ export interface PaneProps extends WebComponentProps {
1043
+ /** The pane title (the agent / window name). Named `headline` because `title` collides with the global `HTMLElement.title` attribute (it throws at registration). Attribute: `headline`. */
1044
+ headline?: string;
1045
+ /** A role / label shown under the title (e.g. "Reviewer", "claude-sonnet"). Attribute: `subtitle`. */
1046
+ subtitle?: string;
1047
+ /** Show the restore glyph instead of maximize, and signal the maximized view-state. Drive it yourself in response to `kai-maximize`. Attribute: `maximized`. */
1048
+ maximized?: boolean;
1049
+ /** Highlight the frame with a ring/border to mark the ACTIVE pane. Attribute: `focused`. */
1050
+ focused?: boolean;
1051
+ /** Show a split-pane window control that fires `kai-split`. Off by default. Attribute: `show-split`. */
1052
+ showSplit?: boolean;
1053
+ /** Show a dock-to-side window control that fires `kai-dock`. Off by default. Attribute: `show-dock`. */
1054
+ showDock?: boolean;
1055
+ /** A tone-colored status dot (+ optional label) in the header. An object `{ tone, label?, pulse? }` set as a JS PROPERTY (not an attribute). */
1056
+ status?: { tone: "working" | "idle" | "done" | "error" | "blocked"; label?: string; pulse?: boolean };
1057
+ /** The close (×) control was clicked. */
1058
+ onClose?: (event: CustomEvent) => void;
1059
+ /** The dock control was clicked (only present when `show-dock`). */
1060
+ onDock?: (event: CustomEvent) => void;
1061
+ /** The maximize/restore control was clicked. `detail.maximized` is the intended NEXT state — drive the `maximized` prop yourself from it. */
1062
+ onMaximize?: (event: CustomEvent<{ maximized: boolean }>) => void;
1063
+ /** The split control was clicked (only present when `show-split`). */
1064
+ onSplit?: (event: CustomEvent) => void;
1065
+ }
1066
+
1067
+ export const Pane = /*#__PURE__*/ createWebComponent<PaneProps>(
1068
+ 'kai-pane',
1069
+ ["theme","headline","subtitle","maximized","focused","showSplit","showDock","status"],
1070
+ { onClose: 'kai-close', onDock: 'kai-dock', onMaximize: 'kai-maximize', onSplit: 'kai-split' },
1071
+ () => import('@kitn.ai/ui/elements/pane'),
1072
+ );
1073
+
1074
+ export interface PaneGroupProps extends WebComponentProps {
1075
+ /** The tabs to render. An array of `{ id, name, status?, needsAttention?, number? }` set as a JS PROPERTY (not an HTML attribute). */
1076
+ tabs?: { id: string; name: string; status?: { tone: "working" | "idle" | "done" | "error" | "blocked"; label?: string; pulse?: boolean }; needsAttention?: boolean; number?: number }[];
1077
+ /** The active tab id (controlled, and reflected to the `active` ATTRIBUTE so `::part`/`[active]` selectors and the per-tab named slot follow it). Set it as the `active` attribute or drive it from `kai-tab-change`; omit for uncontrolled (the first tab). */
1078
+ active?: string;
1079
+ /** Highlight the frame as the ACTIVE group in a multi-group layout. Attribute: `focused`. */
1080
+ focused?: boolean;
1081
+ /** A tab was selected (click, Enter/Space, or arrow-key move). `detail.id` is the tab's id. */
1082
+ onTabChange?: (event: CustomEvent<{ id: string }>) => void;
1083
+ /** A tab's close (×) was clicked. Drop the tab from `tabs` yourself. */
1084
+ onTabClose?: (event: CustomEvent<{ id: string }>) => void;
1085
+ /** A tab's "…" overflow was clicked. Open your own menu from `detail.id`. */
1086
+ onTabMenu?: (event: CustomEvent<{ id: string }>) => void;
1087
+ }
1088
+
1089
+ export const PaneGroup = /*#__PURE__*/ createWebComponent<PaneGroupProps>(
1090
+ 'kai-pane-group',
1091
+ ["theme","tabs","active","focused"],
1092
+ { onTabChange: 'kai-tab-change', onTabClose: 'kai-tab-close', onTabMenu: 'kai-tab-menu' },
1093
+ () => import('@kitn.ai/ui/elements/pane-group'),
524
1094
  );
525
1095
 
526
1096
  export interface PopoverProps extends WebComponentProps {
@@ -528,21 +1098,58 @@ export interface PopoverProps extends WebComponentProps {
528
1098
  placement?: "top" | "right" | "bottom" | "left" | "top-start" | "top-end" | "right-start" | "right-end" | "bottom-start" | "bottom-end" | "left-start" | "left-end";
529
1099
  /** Gap in px between the trigger and the panel. */
530
1100
  gutter?: number;
531
- /** Controlled open state. Set as a JS property (`el.open = true`) to drive the popover from your app; omit for the default click-to-toggle behaviour. */
1101
+ /** Drive/observe open state (Shoelace-style: settable + reflected to the `open` attribute, the element still self-manages on click). Set `el.open = true`, or `<kai-popover open>`; listen for `kai-open-change`. */
532
1102
  open?: boolean;
533
- /** The popover wants to open or close (click, Escape, or outside-click). */
1103
+ /** Initial open state on mount (uncontrolled seed). */
1104
+ defaultOpen?: boolean;
1105
+ /** Turn the popover off while keeping the trigger mounted (clicks and `show()` no longer open it). */
1106
+ disabled?: boolean;
1107
+ /** The popover opened or closed (click, Escape, outside-click, or a method). */
534
1108
  onOpenChange?: (event: CustomEvent<{ open: boolean }>) => void;
535
1109
  }
536
1110
 
537
- export const Popover = createWebComponent<PopoverProps>(
1111
+ export const Popover = /*#__PURE__*/ createWebComponent<PopoverProps>(
538
1112
  'kai-popover',
539
- ["theme","placement","gutter","open"],
1113
+ ["theme","placement","gutter","open","defaultOpen","disabled"],
540
1114
  { onOpenChange: 'kai-open-change' },
1115
+ () => import('@kitn.ai/ui/elements/popover'),
1116
+ );
1117
+
1118
+ export interface ProgressBarProps extends WebComponentProps {
1119
+ /** Current progress value (0..max). Attribute: `value`. */
1120
+ value?: number;
1121
+ /** The value `value` runs to (default 100). Attribute: `max`. */
1122
+ max?: number;
1123
+ /** Optional caption above the track. Attribute: `label`. */
1124
+ label?: string;
1125
+ /** Fill color: `primary` (default), `success`, `warning`, `error`, `info`. Attribute: `tone`. */
1126
+ tone?: string;
1127
+ }
1128
+
1129
+ export const ProgressBar = /*#__PURE__*/ createWebComponent<ProgressBarProps>(
1130
+ 'kai-progress-bar',
1131
+ ["theme","value","max","label","tone"],
1132
+ { },
1133
+ () => import('@kitn.ai/ui/elements/progress-bar'),
1134
+ );
1135
+
1136
+ export interface PromptDockProps extends WebComponentProps {
1137
+ /** How the tray frames the input — the SPATIAL inset axis: `inset` (default, the classic recessed frame on every side) | `edge` (top/bottom inset only; the input sits flush left/right so the lips span the full width) | `none` (no inset; the lips attach directly as a plain stack). Attribute: `frame`. */
1138
+ frame?: "none" | "inset" | "edge";
1139
+ /** How the tray surface looks — the VISUAL axis, orthogonal to `frame`: `soft` (default, sunken surface + border + radius) | `outlined` (transparent + border + radius) | `filled` (sunken, no border, + radius) | `plain` (bare). Attribute: `appearance`. */
1140
+ appearance?: "outlined" | "filled" | "plain" | "soft";
1141
+ }
1142
+
1143
+ export const PromptDock = /*#__PURE__*/ createWebComponent<PromptDockProps>(
1144
+ 'kai-prompt-dock',
1145
+ ["theme","frame","appearance"],
1146
+ { },
1147
+ () => import('@kitn.ai/ui/elements/prompt-dock'),
541
1148
  );
542
1149
 
543
1150
  export interface PromptInputProps extends WebComponentProps {
544
- /** Controlled value of the input. When set, the host owns the text and must update it on `kai-value-change`; leave unset for uncontrolled behavior. */
545
- value?: string;
1151
+ /** Value of the input, as a JS property. A **string** is the controlled text mirror (the host owns it and updates on `kai-value-change`). A **ComposerDoc** (array of text/entity segments) is a one-time **seed** that pre-populates pills (skills/agents/plugins); the user then edits freely. Leave unset for uncontrolled behavior. `kai-submit`/`kai-value-change` always emit `value` as the flattened string (back-compat) plus the structured `doc` + `entities`. */
1152
+ value?: string | ({ type: "text"; text: string } | { type: "entity"; entity: { kind: string; id: string; label: string; icon?: string; promptText?: string; data?: Record<string, unknown> } })[];
546
1153
  /** Placeholder text shown in the empty input. */
547
1154
  placeholder?: string;
548
1155
  /** Disable the input and submit button entirely (non-interactive). */
@@ -553,42 +1160,45 @@ export interface PromptInputProps extends WebComponentProps {
553
1160
  suggestions?: string[];
554
1161
  /** What clicking a suggestion does: `'submit'` (default) sends it immediately as if typed and submitted; `'fill'` just places it in the input. */
555
1162
  suggestionMode?: "submit" | "fill";
556
- /** Slash commands — when set, typing `/` opens the command palette. Set as a JS property. */
557
- slashCommands?: { id: string; label: string; description?: string; category?: string }[];
558
- /** Command ids to highlight as active. */
559
- slashActiveIds?: string[];
560
- /** Single-line palette rows. */
561
- slashCompact?: boolean;
562
1163
  /** Show a Search (Globe) button in the left toolbar; clicking it fires a `search` event. */
563
1164
  search?: boolean;
564
1165
  /** Show a Voice (Mic) button in the left toolbar; clicking it fires a `voice` event. */
565
1166
  voice?: boolean;
566
1167
  /** When set and `loading` is true, the send button is replaced by a Stop button (square icon, "Stop" aria-label). Clicking it fires `kai-stop`. */
567
1168
  stoppable?: boolean;
1169
+ /** Send-button visibility. `'always'` (default) always shows it; `'auto'` shows it only when there's text/attachments (an empty composer hides it — Enter still submits). To hide it entirely (Enter-only), it's pure CSS: `::part(send){display:none}` — no prop needed. Restyle via `::part(send)`. The Stop button (`stoppable` + `loading`) is unaffected. */
1170
+ submit?: "always" | "auto";
1171
+ /** When `false`, hides the built-in paperclip attach button even though the element otherwise supports attachments. Use this when a `+` menu in `toolbar-start` already exposes "Add files", to avoid a duplicate control. Defaults to `true`. */
1172
+ attach?: boolean;
568
1173
  /** Attachments to seed the input with (so a consumer can pre-populate staged files without an upload). Set as a JS property; the element then manages its own attachment state from there (add via the paperclip, remove per chip). */
569
1174
  attachments?: { id: string; type: "file" | "source-document"; filename?: string; mediaType?: string; url?: string; title?: string }[];
1175
+ /** Rich entity triggers — each `{ char, kind, items }` opens a caret-anchored menu that inserts an atomic pill. Convention: `/` → skills, `@` → agents (plugins are the grouping/provenance of those items). Set as a JS property. */
1176
+ triggers?: { char: string; kind: string; items?: { id: string; label: string; icon?: string; description?: string; group?: string; kind?: string; promptText?: string; data?: Record<string, unknown> }[] }[];
1177
+ /** Default icon per entity kind (kind → image URL/data-URI) for pills/menu items without their own `icon`. Overrides the built-in agent/plugin glyphs. JS property. */
1178
+ kindIcons?: Record<string, string>;
1179
+ /** The staged attachments changed — a file was added (via the paperclip) or removed (per-chip ×). Carries the full current list so a consumer can react in real time (validate, show upload progress, toggle the send button). */
1180
+ onAttachmentsChange?: (event: CustomEvent<{ attachments: { id: string; type: "file" | "source-document"; filename?: undefined | string; mediaType?: undefined | string; url?: undefined | string; title?: undefined | string }[] }>) => void;
570
1181
  /** The Search (Globe) toolbar button was clicked. */
571
1182
  onSearch?: (event: CustomEvent<Record<string, never>>) => void;
572
- /** A slash command was chosen from the palette. */
573
- onSlashSelect?: (event: CustomEvent<{ command: { id: string; label: string; description?: undefined | string; category?: undefined | string } }>) => void;
574
1183
  /** The Stop button was clicked while `stoppable` and `loading` are both true. */
575
1184
  onStop?: (event: CustomEvent<Record<string, never>>) => void;
576
- /** The user submitted the prompt (Enter or send button) with its attachments. */
577
- onSubmit?: (event: CustomEvent<{ value: string; attachments: { id: string; type: "file" | "source-document"; filename?: undefined | string; mediaType?: undefined | string; url?: undefined | string; title?: undefined | string }[] }>) => void;
1185
+ /** The user submitted the prompt (Enter or send button). `value` is the flattened text (back-compat); `doc` is the structured document and `entities` the inserted pills (skills/agents) for downstream expansion. */
1186
+ onSubmit?: (event: CustomEvent<{ value: string; doc: ({ type: "text"; text: string } | { type: "entity"; entity: { kind: string; id: string; label: string; icon?: undefined | string; promptText?: undefined | string; data?: undefined | Record<string, unknown> } })[]; entities: { kind: string; id: string; label: string; icon?: undefined | string; promptText?: undefined | string; data?: undefined | Record<string, unknown> }[]; attachments: { id: string; type: "file" | "source-document"; filename?: undefined | string; mediaType?: undefined | string; url?: undefined | string; title?: undefined | string }[] }>) => void;
578
1187
  /** A suggestion was clicked while `suggestion-mode="fill"`. */
579
1188
  onSuggestionClick?: (event: CustomEvent<{ value: string }>) => void;
580
1189
  /** A custom `<kai-action>` toolbar button was clicked. `action` is the `id` of the `<kai-action>` element that was clicked. */
581
1190
  onToolbarAction?: (event: CustomEvent<{ action: string }>) => void;
582
- /** The input text changed (fires on every keystroke). */
583
- onValueChange?: (event: CustomEvent<{ value: string }>) => void;
1191
+ /** The input changed (fires on every edit). Carries the flattened `value` plus the structured `doc` + `entities`. */
1192
+ onValueChange?: (event: CustomEvent<{ value: string; doc: ({ type: "text"; text: string } | { type: "entity"; entity: { kind: string; id: string; label: string; icon?: undefined | string; promptText?: undefined | string; data?: undefined | Record<string, unknown> } })[]; entities: { kind: string; id: string; label: string; icon?: undefined | string; promptText?: undefined | string; data?: undefined | Record<string, unknown> }[] }>) => void;
584
1193
  /** The Voice (Mic) toolbar button was clicked. */
585
1194
  onVoice?: (event: CustomEvent<Record<string, never>>) => void;
586
1195
  }
587
1196
 
588
- export const PromptInput = createWebComponent<PromptInputProps>(
1197
+ export const PromptInput = /*#__PURE__*/ createWebComponent<PromptInputProps>(
589
1198
  'kai-prompt-input',
590
- ["theme","value","placeholder","disabled","loading","suggestions","suggestionMode","slashCommands","slashActiveIds","slashCompact","search","voice","stoppable","attachments"],
591
- { onSearch: 'kai-search', onSlashSelect: 'kai-slash-select', onStop: 'kai-stop', onSubmit: 'kai-submit', onSuggestionClick: 'kai-suggestion-click', onToolbarAction: 'kai-toolbar-action', onValueChange: 'kai-value-change', onVoice: 'kai-voice' },
1199
+ ["theme","value","placeholder","disabled","loading","suggestions","suggestionMode","search","voice","stoppable","submit","attach","attachments","triggers","kindIcons"],
1200
+ { onAttachmentsChange: 'kai-attachments-change', onSearch: 'kai-search', onStop: 'kai-stop', onSubmit: 'kai-submit', onSuggestionClick: 'kai-suggestion-click', onToolbarAction: 'kai-toolbar-action', onValueChange: 'kai-value-change', onVoice: 'kai-voice' },
1201
+ () => import('@kitn.ai/ui/elements/prompt-input'),
592
1202
  );
593
1203
 
594
1204
  export interface ReasoningProps extends WebComponentProps {
@@ -596,20 +1206,25 @@ export interface ReasoningProps extends WebComponentProps {
596
1206
  text: string;
597
1207
  /** Trigger label. */
598
1208
  label?: string;
599
- /** Controlled open state set as a property (`el.open = true`). Omit for uncontrolled (the trigger toggles it). */
1209
+ /** Drive/observe open state (Shoelace-style: settable + reflected to the `open` attribute; the element still self-manages on trigger click + while streaming). Set `el.open = true`; listen for `kai-open-change`. */
600
1210
  open?: boolean;
1211
+ /** Initial open state on mount (uncontrolled seed). */
1212
+ defaultOpen?: boolean;
601
1213
  /** While true, auto-expands (and re-collapses when it flips false). */
602
1214
  streaming?: boolean;
603
1215
  /** Render `text` as markdown. */
604
1216
  markdown?: boolean;
605
- /** Open state changed (via the trigger or streaming auto-open). */
1217
+ /** Gate the disclosure trigger — programmatic `show()/hide()/toggle()` still work, but the trigger click no longer toggles. */
1218
+ disabled?: boolean;
1219
+ /** The reasoning block expanded or collapsed (via the trigger, streaming auto-open, or a method). */
606
1220
  onOpenChange?: (event: CustomEvent<{ open: boolean }>) => void;
607
1221
  }
608
1222
 
609
- export const Reasoning = createWebComponent<ReasoningProps>(
1223
+ export const Reasoning = /*#__PURE__*/ createWebComponent<ReasoningProps>(
610
1224
  'kai-reasoning',
611
- ["theme","text","label","open","streaming","markdown"],
1225
+ ["theme","text","label","open","defaultOpen","streaming","markdown","disabled"],
612
1226
  { onOpenChange: 'kai-open-change' },
1227
+ () => import('@kitn.ai/ui/elements/reasoning'),
613
1228
  );
614
1229
 
615
1230
  export interface RemoteProps extends WebComponentProps {
@@ -623,15 +1238,16 @@ export interface RemoteProps extends WebComponentProps {
623
1238
  policy?: Record<string, unknown>;
624
1239
  }
625
1240
 
626
- export const Remote = createWebComponent<RemoteProps>(
1241
+ export const Remote = /*#__PURE__*/ createWebComponent<RemoteProps>(
627
1242
  'kai-remote',
628
1243
  ["theme","src","providerOrigin","envelope","policy"],
629
1244
  { },
1245
+ () => import('@kitn.ai/ui/elements/remote'),
630
1246
  );
631
1247
 
632
1248
  export interface ResizableProps extends WebComponentProps {
633
1249
  /** Layout axis: `horizontal` (row, default) or `vertical` (column). */
634
- orientation?: "horizontal" | "vertical";
1250
+ orientation?: "vertical" | "horizontal";
635
1251
  /** Which item index is maximized (null = none). Declarative source of truth. */
636
1252
  maximizedIndex?: null | number;
637
1253
  /** Fired on drag-end / keyboard resize / visibility change. `detail.sizes` = panel sizes in percent. */
@@ -640,10 +1256,11 @@ export interface ResizableProps extends WebComponentProps {
640
1256
  onMaximizeChange?: (event: CustomEvent<{ maximized: boolean; index: null | number }>) => void;
641
1257
  }
642
1258
 
643
- export const Resizable = createWebComponent<ResizableProps>(
1259
+ export const Resizable = /*#__PURE__*/ createWebComponent<ResizableProps>(
644
1260
  'kai-resizable',
645
1261
  ["theme","orientation","maximizedIndex"],
646
1262
  { onChange: 'kai-change', onMaximizeChange: 'kai-maximize-change' },
1263
+ () => import('@kitn.ai/ui/elements/resizable'),
647
1264
  );
648
1265
 
649
1266
  export interface ResizableItemProps extends WebComponentProps {
@@ -657,14 +1274,17 @@ export interface ResizableItemProps extends WebComponentProps {
657
1274
  locked?: boolean;
658
1275
  /** Hide this panel; its divider is dropped and the rest reflow. */
659
1276
  hidden?: boolean;
1277
+ /** Collapse this panel — same layout effect as `hidden` (divider dropped, the rest reflow), but it WORKS as a bare boolean from framework JSX. A plain `<kai-resizable-item collapsed>` in React/Solid/Vue/Svelte collapses the panel at the first render; `hidden` does not, because a JSX boolean sets neither the `hidden` attribute nor the IDL property on a custom element, so the parent never sees it. The facade reflects `collapsed` to a `collapsed` attribute the parent reads. Prefer this over `hidden` for declarative collapse. */
1278
+ collapsed?: boolean;
660
1279
  onChange?: (event: CustomEvent<unknown>) => void;
661
1280
  onMaximizeChange?: (event: CustomEvent<unknown>) => void;
662
1281
  }
663
1282
 
664
- export const ResizableItem = createWebComponent<ResizableItemProps>(
1283
+ export const ResizableItem = /*#__PURE__*/ createWebComponent<ResizableItemProps>(
665
1284
  'kai-resizable-item',
666
- ["theme","size","min","max","locked","hidden"],
1285
+ ["theme","size","min","max","locked","hidden","collapsed"],
667
1286
  { onChange: 'kai-change', onMaximizeChange: 'kai-maximize-change' },
1287
+ () => import('@kitn.ai/ui/elements/resizable'),
668
1288
  );
669
1289
 
670
1290
  export interface ResponseStreamProps extends WebComponentProps {
@@ -680,10 +1300,11 @@ export interface ResponseStreamProps extends WebComponentProps {
680
1300
  onComplete?: (event: CustomEvent) => void;
681
1301
  }
682
1302
 
683
- export const ResponseStream = createWebComponent<ResponseStreamProps>(
1303
+ export const ResponseStream = /*#__PURE__*/ createWebComponent<ResponseStreamProps>(
684
1304
  'kai-response-stream',
685
1305
  ["theme","text","mode","speed","as"],
686
1306
  { onComplete: 'kai-complete' },
1307
+ () => import('@kitn.ai/ui/elements/response-stream'),
687
1308
  );
688
1309
 
689
1310
  export interface ScopePickerProps extends WebComponentProps {
@@ -693,31 +1314,181 @@ export interface ScopePickerProps extends WebComponentProps {
693
1314
  availableTags: string[];
694
1315
  /** The label shown on the trigger for the active scope. */
695
1316
  currentLabel?: string;
1317
+ /** Drive/observe the dropdown's open state (Shoelace-style: settable + reflected to the `open` attribute, the dropdown still self-manages on click/keyboard). Set `el.open = true`, or `<kai-scope-picker open>`; listen for `kai-open-change`. */
1318
+ open?: boolean;
1319
+ /** Initial open state on mount (uncontrolled seed). */
1320
+ defaultOpen?: boolean;
1321
+ /** Disable the trigger — click/keyboard and `show()` no longer open the dropdown. */
1322
+ disabled?: boolean;
1323
+ /** The scope dropdown opened or closed (by click, keyboard, Escape, outside-click, or a method). */
1324
+ onOpenChange?: (event: CustomEvent<{ open: boolean }>) => void;
696
1325
  /** A scope was chosen (`undefined` filters = "All Content"). */
697
1326
  onScopeChange?: (event: CustomEvent<{ filters: undefined | { tags?: undefined | string[]; authors?: undefined | string[]; contentType?: undefined | "transcript" | "markdown"; dateRange?: undefined | { from: string; to: string } } }>) => void;
698
1327
  }
699
1328
 
700
- export const ScopePicker = createWebComponent<ScopePickerProps>(
1329
+ export const ScopePicker = /*#__PURE__*/ createWebComponent<ScopePickerProps>(
701
1330
  'kai-scope-picker',
702
- ["theme","availableAuthors","availableTags","currentLabel"],
703
- { onScopeChange: 'kai-scope-change' },
1331
+ ["theme","availableAuthors","availableTags","currentLabel","open","defaultOpen","disabled"],
1332
+ { onOpenChange: 'kai-open-change', onScopeChange: 'kai-scope-change' },
1333
+ () => import('@kitn.ai/ui/elements/chat-scope-picker'),
1334
+ );
1335
+
1336
+ export interface ScreenProps extends WebComponentProps {
1337
+ /** Drive/observe open state (Shoelace-style: settable + reflected to the `open` attribute; the element still self-manages). Set `el.open = true`, or `<kai-screen open>`; listen for `kai-open-change`. */
1338
+ open?: boolean;
1339
+ /** Initial open state on mount (uncontrolled seed). */
1340
+ defaultOpen?: boolean;
1341
+ /** Header title text. A projected `title` slot overrides it. (Named `headline` because `title` collides with the global `HTMLElement.title` attribute.) */
1342
+ headline?: string;
1343
+ /** Show the back button (default true). */
1344
+ back?: boolean;
1345
+ /** Opt out of marking sibling elements inert/aria-hidden while open (for unusual layouts). */
1346
+ noInert?: boolean;
1347
+ /** Back navigation intent: the back button or Escape. The consumer flips their own routing in response (the screen knows nothing about the trigger). */
1348
+ onBack?: (event: CustomEvent<Record<string, never>>) => void;
1349
+ /** The screen opened or closed (a method, `Escape` close, or driven `open`). */
1350
+ onOpenChange?: (event: CustomEvent<{ open: boolean }>) => void;
1351
+ }
1352
+
1353
+ export const Screen = /*#__PURE__*/ createWebComponent<ScreenProps>(
1354
+ 'kai-screen',
1355
+ ["theme","open","defaultOpen","headline","back","noInert"],
1356
+ { onBack: 'kai-back', onOpenChange: 'kai-open-change' },
1357
+ () => import('@kitn.ai/ui/elements/screen'),
1358
+ );
1359
+
1360
+ export interface ScrollAreaProps extends WebComponentProps {
1361
+ /** Which axis scrolls. `vertical` (default) · `horizontal` · `both`. The cross axis is clamped so content can't overflow it. */
1362
+ orientation?: "vertical" | "horizontal" | "both";
1363
+ }
1364
+
1365
+ export const ScrollArea = /*#__PURE__*/ createWebComponent<ScrollAreaProps>(
1366
+ 'kai-scroll-area',
1367
+ ["theme","orientation"],
1368
+ { },
1369
+ () => import('@kitn.ai/ui/elements/scroll-area'),
704
1370
  );
705
1371
 
706
1372
  export interface ScrollButtonProps extends WebComponentProps {
707
1373
  /** CSS id of the scroll container to control. When omitted the element walks up the DOM (outside its own shadow root) to find the nearest scrollable ancestor. Mirrors the `for` convention of `<label for="...">`. */
708
1374
  for?: string;
709
1375
  /** Button visual variant: `'outline' | 'ghost' | 'default'`. Defaults to `'outline'`. */
710
- variant?: "ghost" | "default" | "outline";
1376
+ variant?: "default" | "ghost" | "outline";
711
1377
  /** Button size token. Defaults to `'icon'` (square). */
712
- size?: "sm" | "lg" | "md" | "icon" | "icon-sm";
1378
+ size?: "sm" | "md" | "lg" | "icon" | "icon-sm";
713
1379
  /** Emitted when the user clicks the button and `scrollToBottom()` is called. Carries no detail — consumers use it to know a manual scroll occurred. */
714
1380
  onScroll?: (event: CustomEvent) => void;
715
1381
  }
716
1382
 
717
- export const ScrollButton = createWebComponent<ScrollButtonProps>(
1383
+ export const ScrollButton = /*#__PURE__*/ createWebComponent<ScrollButtonProps>(
718
1384
  'kai-scroll-button',
719
1385
  ["theme","for","variant","size"],
720
1386
  { onScroll: 'kai-scroll' },
1387
+ () => import('@kitn.ai/ui/elements/scroll-button'),
1388
+ );
1389
+
1390
+ export interface SearchProps extends WebComponentProps {
1391
+ /** Controlled query — settable and reflected to the `value` attribute. Read `el.value` for live state. */
1392
+ value?: string;
1393
+ /** Placeholder. Defaults to `Search…`. */
1394
+ placeholder?: string;
1395
+ /** Leading icon-NAME string (a curated name, URL, or text), resolved to a glyph the same way `kai-button`'s `icon` is. Defaults to `search`. */
1396
+ icon?: string;
1397
+ /** Debounce window for `kai-search`, in ms. Defaults to `200`. */
1398
+ debounce?: number;
1399
+ /** Show a spinner in place of the leading icon while results load. */
1400
+ loading?: boolean;
1401
+ /** Optional shortcut hint shown (as a `kai-kbd`) while the field is empty, e.g. `Mod+K`. Display only; it does not bind the key. */
1402
+ shortcut?: string;
1403
+ /** The field committed (blur). */
1404
+ onChange?: (event: CustomEvent<{ value: string }>) => void;
1405
+ /** The query changed (debounced live, and on clear). */
1406
+ onSearch?: (event: CustomEvent<{ value: string }>) => void;
1407
+ /** Enter was pressed. */
1408
+ onSubmit?: (event: CustomEvent<{ value: string }>) => void;
1409
+ }
1410
+
1411
+ export const Search = /*#__PURE__*/ createWebComponent<SearchProps>(
1412
+ 'kai-search',
1413
+ ["theme","value","placeholder","icon","debounce","loading","shortcut"],
1414
+ { onChange: 'kai-change', onSearch: 'kai-search', onSubmit: 'kai-submit' },
1415
+ () => import('@kitn.ai/ui/elements/search'),
1416
+ );
1417
+
1418
+ export interface SegmentedProps extends WebComponentProps {
1419
+ /** The selectable segments, left to right. Set as a JS property (array). */
1420
+ options: { value: string; label: string; icon?: undefined | string }[];
1421
+ /** Controlled selected `value` — settable and reflected to the `value` attribute. `el.value = 'preview'` drives it; choosing a segment updates it and fires `kai-change`. Read `el.value` for live state. */
1422
+ value?: string;
1423
+ /** Control density: `sm` or `md`. Defaults to `md`. */
1424
+ size?: "sm" | "md";
1425
+ /** A segment was chosen. */
1426
+ onChange?: (event: CustomEvent<{ value: string }>) => void;
1427
+ }
1428
+
1429
+ export const Segmented = /*#__PURE__*/ createWebComponent<SegmentedProps>(
1430
+ 'kai-segmented',
1431
+ ["theme","options","value","size"],
1432
+ { onChange: 'kai-change' },
1433
+ () => import('@kitn.ai/ui/elements/segmented'),
1434
+ );
1435
+
1436
+ export interface SeparatorProps extends WebComponentProps {
1437
+ /** `horizontal` (default, block + full-width) or `vertical` (a rule inside a flex/grid row — it stretches to the row height). */
1438
+ orientation?: "vertical" | "horizontal";
1439
+ }
1440
+
1441
+ export const Separator = /*#__PURE__*/ createWebComponent<SeparatorProps>(
1442
+ 'kai-separator',
1443
+ ["theme","orientation"],
1444
+ { },
1445
+ () => import('@kitn.ai/ui/elements/separator'),
1446
+ );
1447
+
1448
+ export interface SettingItemProps extends WebComponentProps {
1449
+ /** Row label (primary text). Attribute: `label`. */
1450
+ label?: string;
1451
+ /** Optional secondary description under the label. Attribute: `description`. */
1452
+ description?: string;
1453
+ }
1454
+
1455
+ export const SettingItem = /*#__PURE__*/ createWebComponent<SettingItemProps>(
1456
+ 'kai-setting-item',
1457
+ ["theme","label","description"],
1458
+ { },
1459
+ () => import('@kitn.ai/ui/elements/setting-item'),
1460
+ );
1461
+
1462
+ export interface SettingsGroupProps extends WebComponentProps {
1463
+ /** Small section heading shown above the card. Attribute: `heading`. */
1464
+ heading?: string;
1465
+ /** Optional muted description under the heading. Attribute: `description`. */
1466
+ description?: string;
1467
+ }
1468
+
1469
+ export const SettingsGroup = /*#__PURE__*/ createWebComponent<SettingsGroupProps>(
1470
+ 'kai-settings-group',
1471
+ ["theme","heading","description"],
1472
+ { },
1473
+ () => import('@kitn.ai/ui/elements/settings-group'),
1474
+ );
1475
+
1476
+ export interface SkeletonProps extends WebComponentProps {
1477
+ /** `text` (one or more lines), `rect` (a block), or `circle` (round). Defaults to `text`. */
1478
+ variant?: "text" | "rect" | "circle";
1479
+ /** CSS width (e.g. `'12rem'`, `'60%'`). Defaults to full width (responsive); for `circle` it is the diameter. */
1480
+ width?: string;
1481
+ /** CSS height. Defaults per variant (a text line height; circle = width). */
1482
+ height?: string;
1483
+ /** `text` only: number of lines; the last is shorter. Defaults to 1. */
1484
+ lines?: number;
1485
+ }
1486
+
1487
+ export const Skeleton = /*#__PURE__*/ createWebComponent<SkeletonProps>(
1488
+ 'kai-skeleton',
1489
+ ["theme","variant","width","height","lines"],
1490
+ { },
1491
+ () => import('@kitn.ai/ui/elements/skeleton'),
721
1492
  );
722
1493
 
723
1494
  export interface SkillsProps extends WebComponentProps {
@@ -725,10 +1496,11 @@ export interface SkillsProps extends WebComponentProps {
725
1496
  skills: { id: string; name: string }[];
726
1497
  }
727
1498
 
728
- export const Skills = createWebComponent<SkillsProps>(
1499
+ export const Skills = /*#__PURE__*/ createWebComponent<SkillsProps>(
729
1500
  'kai-skills',
730
1501
  ["theme","skills"],
731
1502
  { },
1503
+ () => import('@kitn.ai/ui/elements/message-skills'),
732
1504
  );
733
1505
 
734
1506
  export interface SourceProps extends WebComponentProps {
@@ -744,10 +1516,11 @@ export interface SourceProps extends WebComponentProps {
744
1516
  showFavicon?: boolean;
745
1517
  }
746
1518
 
747
- export const Source = createWebComponent<SourceProps>(
1519
+ export const Source = /*#__PURE__*/ createWebComponent<SourceProps>(
748
1520
  'kai-source',
749
1521
  ["theme","href","label","headline","description","showFavicon"],
750
1522
  { },
1523
+ () => import('@kitn.ai/ui/elements/source'),
751
1524
  );
752
1525
 
753
1526
  export interface SourcesProps extends WebComponentProps {
@@ -759,19 +1532,40 @@ export interface SourcesProps extends WebComponentProps {
759
1532
  numbered?: boolean;
760
1533
  }
761
1534
 
762
- export const Sources = createWebComponent<SourcesProps>(
1535
+ export const Sources = /*#__PURE__*/ createWebComponent<SourcesProps>(
763
1536
  'kai-sources',
764
1537
  ["theme","sources","showFavicon","numbered"],
765
1538
  { },
1539
+ () => import('@kitn.ai/ui/elements/source'),
1540
+ );
1541
+
1542
+ export interface StatusProps extends WebComponentProps {
1543
+ /** Presence/notification state → color. `new` (default) maps to the blue hue. */
1544
+ status?: "new" | "online" | "busy" | "away" | "offline";
1545
+ /** Animated ping ring (off by default; respects prefers-reduced-motion). */
1546
+ pulse?: boolean;
1547
+ /** Accessible name. Without it the dot is decorative. */
1548
+ label?: string;
1549
+ /** `sm` (default) or `md`. */
1550
+ size?: "sm" | "md";
1551
+ }
1552
+
1553
+ export const Status = /*#__PURE__*/ createWebComponent<StatusProps>(
1554
+ 'kai-status',
1555
+ ["theme","status","pulse","label","size"],
1556
+ { },
1557
+ () => import('@kitn.ai/ui/elements/status'),
766
1558
  );
767
1559
 
768
1560
  export interface SuggestionsProps extends WebComponentProps {
769
1561
  /** The suggestions. Strings, or `{ label, value }` when the displayed text and the emitted value differ. Set as a JS property. */
770
- suggestions: (string | { label: string; value?: undefined | string })[];
1562
+ suggestions: (string | { label: string; value?: undefined | string; icon?: undefined | string })[];
771
1563
  /** Chip style: `'outline'` (default), `'ghost'`, or `'default'` (filled). */
772
- variant?: "ghost" | "default" | "outline";
773
- /** Size preset for each chip. Defaults to the pill default (`'lg'`); pass `'sm'` for smaller pills (or `'md'`). */
774
- size?: "sm" | "lg" | "md" | "icon" | "icon-sm";
1564
+ variant?: "default" | "ghost" | "outline";
1565
+ /** Row height for `layout="list"`: `'md'` (default) or `'lg'` for taller rows. Chips are unaffected. */
1566
+ size?: "md" | "lg";
1567
+ /** Layout: `'chips'` (default) renders a wrapping row of rounded pills; `'list'` renders a vertical, full-width "Ideas for you" list — each row is left-aligned with a leading `icon`, a label, and a hover background. */
1568
+ layout?: "list" | "chips";
775
1569
  /** Full-width left-aligned rows instead of pills. */
776
1570
  block?: boolean;
777
1571
  /** Substring to highlight within each suggestion. */
@@ -780,27 +1574,59 @@ export interface SuggestionsProps extends WebComponentProps {
780
1574
  onSelect?: (event: CustomEvent<{ value: string }>) => void;
781
1575
  }
782
1576
 
783
- export const Suggestions = createWebComponent<SuggestionsProps>(
1577
+ export const Suggestions = /*#__PURE__*/ createWebComponent<SuggestionsProps>(
784
1578
  'kai-suggestions',
785
- ["theme","suggestions","variant","size","block","highlight"],
1579
+ ["theme","suggestions","variant","size","layout","block","highlight"],
786
1580
  { onSelect: 'kai-select' },
1581
+ () => import('@kitn.ai/ui/elements/prompt-suggestions'),
787
1582
  );
788
1583
 
789
1584
  export interface SwitchProps extends WebComponentProps {
790
- /** Initial checked state. Bare attribute (`<kai-switch checked>`) turns it on. */
1585
+ /** Controlled checked state settable and reflected to the `checked` attribute. `el.checked = true` (or `<kai-switch checked>`) drives it; the toggle UI updates it and fires `kai-change`. Read `el.checked` for live state. */
791
1586
  checked?: boolean;
1587
+ /** Initial checked state on mount (uncontrolled seed). Bare attribute (`<kai-switch default-checked>`) turns it on. */
1588
+ defaultChecked?: boolean;
792
1589
  /** Disable interaction. */
793
1590
  disabled?: boolean;
794
1591
  /** Accessible label. */
795
1592
  label?: string;
1593
+ /** Form-control name (paired with `value`). */
1594
+ name?: string;
1595
+ /** Submitted value when checked (paired with `name`). Defaults to `'on'`. */
1596
+ value?: string;
796
1597
  /** The toggle changed. */
797
1598
  onChange?: (event: CustomEvent<{ checked: boolean }>) => void;
798
1599
  }
799
1600
 
800
- export const Switch = createWebComponent<SwitchProps>(
1601
+ export const Switch = /*#__PURE__*/ createWebComponent<SwitchProps>(
801
1602
  'kai-switch',
802
- ["theme","checked","disabled","label"],
1603
+ ["theme","checked","defaultChecked","disabled","label","name","value"],
803
1604
  { onChange: 'kai-change' },
1605
+ () => import('@kitn.ai/ui/elements/switch'),
1606
+ );
1607
+
1608
+ export interface TabsProps extends WebComponentProps {
1609
+ /** Tabs to render. Set as a JS property, not an HTML attribute. */
1610
+ items?: { id: string; label?: string; icon?: string; disabled?: boolean }[];
1611
+ /** Controlled selected id. Set as a JS property (or the `value` attribute); drive it from your app in response to `kai-tab-change`. Omit for uncontrolled. */
1612
+ value?: string;
1613
+ /** Initial selected id when uncontrolled (use the `default-value` attribute in plain HTML). */
1614
+ defaultValue?: string;
1615
+ /** `segmented` (default, a pill group) or `underline` (an underlined row). */
1616
+ variant?: "segmented" | "underline";
1617
+ /** Stretch the strip to full width, each tab sharing the space equally. */
1618
+ block?: boolean;
1619
+ /** Disable the whole strip. */
1620
+ disabled?: boolean;
1621
+ /** A tab was selected (click, Enter/Space, or arrow-key move). `value` is the item's id. */
1622
+ onTabChange?: (event: CustomEvent<{ value: string }>) => void;
1623
+ }
1624
+
1625
+ export const Tabs = /*#__PURE__*/ createWebComponent<TabsProps>(
1626
+ 'kai-tabs',
1627
+ ["theme","items","value","defaultValue","variant","block","disabled"],
1628
+ { onTabChange: 'kai-tab-change' },
1629
+ () => import('@kitn.ai/ui/elements/tabs'),
804
1630
  );
805
1631
 
806
1632
  export interface TasksProps extends WebComponentProps {
@@ -812,12 +1638,23 @@ export interface TasksProps extends WebComponentProps {
812
1638
  heading?: string;
813
1639
  /** Set when the user resolved this card; renders the read-only view. Property: `el.resolution = { kind:'submit', data:{ selected:[…] } }`. */
814
1640
  resolution?: Record<string, unknown>;
1641
+ /** Controlled selection (task ids; JS property). When set, it wins over local state. */
1642
+ value?: string[];
1643
+ /** Uncontrolled initial selection (task ids; JS property), overlaying per-task `checked`. */
1644
+ defaultValue?: string[];
1645
+ /** Freeze the whole list + Confirm. Attribute: `disabled`. */
1646
+ disabled?: boolean;
1647
+ /** Display-only: rows can't be toggled and show the default cursor (no pointer, hover, or focus affordances). Keeps the look as-is. Attribute: `readonly`. */
1648
+ readonly?: boolean;
1649
+ /** The selection changed on a toggle — the selected ids in input order. */
1650
+ onValueChange?: (event: CustomEvent<{ value: string[] }>) => void;
815
1651
  }
816
1652
 
817
- export const Tasks = createWebComponent<TasksProps>(
1653
+ export const Tasks = /*#__PURE__*/ createWebComponent<TasksProps>(
818
1654
  'kai-tasks',
819
- ["theme","data","cardId","heading","resolution"],
820
- { },
1655
+ ["theme","data","cardId","heading","resolution","value","defaultValue","disabled","readonly"],
1656
+ { onValueChange: 'kai-value-change' },
1657
+ () => import('@kitn.ai/ui/elements/tasks'),
821
1658
  );
822
1659
 
823
1660
  export interface TextShimmerProps extends WebComponentProps {
@@ -831,10 +1668,11 @@ export interface TextShimmerProps extends WebComponentProps {
831
1668
  spread?: number;
832
1669
  }
833
1670
 
834
- export const TextShimmer = createWebComponent<TextShimmerProps>(
1671
+ export const TextShimmer = /*#__PURE__*/ createWebComponent<TextShimmerProps>(
835
1672
  'kai-text-shimmer',
836
1673
  ["theme","text","as","duration","spread"],
837
1674
  { },
1675
+ () => import('@kitn.ai/ui/elements/text-shimmer'),
838
1676
  );
839
1677
 
840
1678
  export interface ThinkingBarProps extends WebComponentProps {
@@ -848,23 +1686,85 @@ export interface ThinkingBarProps extends WebComponentProps {
848
1686
  onStop?: (event: CustomEvent) => void;
849
1687
  }
850
1688
 
851
- export const ThinkingBar = createWebComponent<ThinkingBarProps>(
1689
+ export const ThinkingBar = /*#__PURE__*/ createWebComponent<ThinkingBarProps>(
852
1690
  'kai-thinking-bar',
853
1691
  ["theme","text","stoppable","stopLabel"],
854
1692
  { onStop: 'kai-stop' },
1693
+ () => import('@kitn.ai/ui/elements/thinking-bar'),
1694
+ );
1695
+
1696
+ export interface ToastRegionProps extends WebComponentProps {
1697
+ /** The toasts to render. Newest is shown on top. Set as a JS property (array); pass a new array reference to update. */
1698
+ toasts: { id: string; message: string; variant?: undefined | "error" | "info" | "success" | "warning" | "neutral"; appearance?: undefined | "pill" | "card"; inverse?: undefined | boolean; description?: undefined | string; action?: undefined | { label: string; onAction: () => void | false }; duration?: undefined | number; dismissible?: undefined | boolean; target?: undefined | HTMLElement }[];
1699
+ /** Stack anchor: `'top-center'` (default), `'top-right'`, `'bottom-center'`, … */
1700
+ position?: "top-center" | "top-right" | "top-left" | "bottom-center" | "bottom-right" | "bottom-left";
1701
+ /** Max simultaneously-visible toasts; the rest queue. Defaults to `3`. */
1702
+ max?: number;
1703
+ /** Stacking: 'expanded' (default, full column) | 'collapsed' (Sonner-style pile that expands on hover/focus). Attribute: stack. */
1704
+ stack?: "expanded" | "collapsed";
1705
+ /** Default appearance for this region's toasts: `'pill'` (default, compact) | `'card'` (richer, with a description line). A per-toast `appearance` wins. Attribute: `appearance`. */
1706
+ appearance?: "pill" | "card";
1707
+ /** Default high-contrast inverse treatment for this region's toasts. A per-toast `inverse` wins. Off by default. Attribute: `inverse`. */
1708
+ inverse?: boolean;
1709
+ /** Container element to anchor this region to (JS property). Set by the store for a scoped region; unset = the global viewport region. */
1710
+ target?: HTMLElement;
1711
+ /** A toast's action button was pressed. */
1712
+ onAction?: (event: CustomEvent<{ id: string; label: string }>) => void;
1713
+ /** A toast left the stack. `reason` is `'timeout' | 'close' | 'action'`. */
1714
+ onDismiss?: (event: CustomEvent<{ id: string; reason: "action" | "timeout" | "close" }>) => void;
1715
+ }
1716
+
1717
+ export const ToastRegion = /*#__PURE__*/ createWebComponent<ToastRegionProps>(
1718
+ 'kai-toast-region',
1719
+ ["theme","toasts","position","max","stack","appearance","inverse","target"],
1720
+ { onAction: 'kai-action', onDismiss: 'kai-dismiss' },
1721
+ () => import('@kitn.ai/ui/elements/toast'),
855
1722
  );
856
1723
 
857
1724
  export interface ToolProps extends WebComponentProps {
858
1725
  /** The tool-call to display. Set as a JS property. */
859
1726
  tool?: { type: string; state: "input-streaming" | "input-available" | "output-available" | "output-error"; input?: Record<string, unknown>; output?: Record<string, unknown>; toolCallId?: string; errorText?: string };
860
- /** Start expanded. */
1727
+ /** Drive/observe open state (Shoelace-style: settable + reflected to the `open` attribute; the element still self-manages on trigger click). Set `el.open = true`, or `<kai-tool open>`; listen for `kai-open-change`. */
861
1728
  open?: boolean;
1729
+ /** Initial open state on mount (uncontrolled seed). */
1730
+ defaultOpen?: boolean;
1731
+ /** Gate the disclosure trigger — programmatic `show()/hide()/toggle()` still work, but the trigger click no longer toggles. */
1732
+ disabled?: boolean;
1733
+ /** The panel expanded or collapsed (by trigger click or a method). */
1734
+ onOpenChange?: (event: CustomEvent<{ open: boolean }>) => void;
862
1735
  }
863
1736
 
864
- export const Tool = createWebComponent<ToolProps>(
1737
+ export const Tool = /*#__PURE__*/ createWebComponent<ToolProps>(
865
1738
  'kai-tool',
866
- ["theme","tool","open"],
867
- { },
1739
+ ["theme","tool","open","defaultOpen","disabled"],
1740
+ { onOpenChange: 'kai-open-change' },
1741
+ () => import('@kitn.ai/ui/elements/tool'),
1742
+ );
1743
+
1744
+ export interface TooltipProps extends WebComponentProps {
1745
+ /** The hint text shown on hover/focus of the slotted trigger. */
1746
+ content?: string;
1747
+ /** Delay (ms) before the tooltip appears on hover. Defaults to 600. Focus shows it immediately regardless. */
1748
+ openDelay?: number;
1749
+ /** Delay (ms) before it hides after the pointer leaves. Defaults to 0 (hides immediately). */
1750
+ closeDelay?: number;
1751
+ /** Preferred placement: `'top' | 'bottom' | 'left' | 'right'` (+ optional `-start`/`-end`). Defaults to `'top'`; flips to stay in view. */
1752
+ placement?: string;
1753
+ /** Drive/observe open state (Shoelace-style: settable + reflected to the `open` attribute, the element still self-manages on hover/focus). Set `el.open = true`, or `<kai-tooltip open>`; listen for `kai-open-change`. */
1754
+ open?: boolean;
1755
+ /** Initial open state on mount (uncontrolled seed). */
1756
+ defaultOpen?: boolean;
1757
+ /** Turn the tooltip off while keeping the trigger mounted (hover/focus and `show()` no longer open it). */
1758
+ disabled?: boolean;
1759
+ /** The tooltip opened or closed (by hover/focus, outside-click, or a method). */
1760
+ onOpenChange?: (event: CustomEvent<{ open: boolean }>) => void;
1761
+ }
1762
+
1763
+ export const Tooltip = /*#__PURE__*/ createWebComponent<TooltipProps>(
1764
+ 'kai-tooltip',
1765
+ ["theme","content","openDelay","closeDelay","placement","open","defaultOpen","disabled"],
1766
+ { onOpenChange: 'kai-open-change' },
1767
+ () => import('@kitn.ai/ui/elements/tooltip'),
868
1768
  );
869
1769
 
870
1770
  export interface VoiceInputProps extends WebComponentProps {
@@ -872,33 +1772,64 @@ export interface VoiceInputProps extends WebComponentProps {
872
1772
  transcribe?: (audio: Blob) => Promise<string>;
873
1773
  /** Disable the mic button (non-interactive). */
874
1774
  disabled?: boolean;
875
- /** Raw audio captured (before transcription) for hosts that prefer to handle transcription themselves instead of via the `transcribe` property. */
1775
+ /** BCP-47 language tag for the native `SpeechRecognition` path (e.g. `en-US`). Attribute: `recognition-lang` (the plain `lang` attribute is reserved by `HTMLElement` and can't be a custom-element property). No effect when `transcribe` is set or the browser lacks SpeechRecognition. */
1776
+ recognitionLang?: string;
1777
+ /** Emit live partial transcripts (`kai-transcript-interim`) during native recognition. Attribute: `interim`. No-op on the transcribe/fallback paths. */
1778
+ interim?: boolean;
1779
+ /** Raw audio captured (before transcription) — for hosts that prefer to handle transcription themselves instead of via the `transcribe` property. Also the unsupported-fallback signal: no `transcribe`, no SpeechRecognition, so only the blob is produced (no text). */
876
1780
  onAudioCaptured?: (event: CustomEvent<{ blob: Blob }>) => void;
877
- /** Transcription completed (the `transcribe` property resolved). */
1781
+ /** Recording started or stopped — lets the host drive its own UI (waveform, push-to-talk indicator) in sync with the mic. Fires on real transitions only (manual click and programmatic start()/stop()), never on mount. */
1782
+ onRecordingChange?: (event: CustomEvent<{ recording: boolean }>) => void;
1783
+ /** Live partial transcript during native recognition (only when `interim` is set). Fires repeatedly before the final `kai-transcription`. */
1784
+ onTranscriptInterim?: (event: CustomEvent<{ text: string }>) => void;
1785
+ /** Final transcript — the `transcribe` property resolved, OR native `SpeechRecognition` produced final text (no `transcribe` set). */
878
1786
  onTranscription?: (event: CustomEvent<{ text: string }>) => void;
879
1787
  }
880
1788
 
881
- export const VoiceInput = createWebComponent<VoiceInputProps>(
1789
+ export const VoiceInput = /*#__PURE__*/ createWebComponent<VoiceInputProps>(
882
1790
  'kai-voice-input',
883
- ["theme","transcribe","disabled"],
884
- { onAudioCaptured: 'kai-audio-captured', onTranscription: 'kai-transcription' },
1791
+ ["theme","transcribe","disabled","recognitionLang","interim"],
1792
+ { onAudioCaptured: 'kai-audio-captured', onRecordingChange: 'kai-recording-change', onTranscriptInterim: 'kai-transcript-interim', onTranscription: 'kai-transcription' },
1793
+ () => import('@kitn.ai/ui/elements/voice-input'),
1794
+ );
1795
+
1796
+ export interface VoiceOutputProps extends WebComponentProps {
1797
+ /** The utterance to read aloud. */
1798
+ text?: string;
1799
+ /** Speak automatically when `text` is set/changed. */
1800
+ autoplay?: boolean;
1801
+ /** TTS model seam the host supplies — given text, returns an audio `Blob` to play. This is a **function-valued property** (`el.synthesize = async text => blob`); when set, the native `speechSynthesis` path is bypassed. Mirrors `<kai-voice-input>`'s `transcribe`. A value-returning callback can't be modelled as a fire-and-forget event, hence a property. */
1802
+ synthesize?: (text: string) => Promise<Blob>;
1803
+ /** Disable the button (non-interactive). */
1804
+ disabled?: boolean;
1805
+ /** Playback started or stopped — drive your own UI in sync. Fires on real transitions only (manual click and programmatic speak()/stop()), never on mount. */
1806
+ onSpeakingChange?: (event: CustomEvent<{ speaking: boolean }>) => void;
1807
+ /** The model path (`synthesize`) resolved audio — the raw `Blob` before playback. */
1808
+ onSynthesized?: (event: CustomEvent<{ blob: Blob }>) => void;
1809
+ }
1810
+
1811
+ export const VoiceOutput = /*#__PURE__*/ createWebComponent<VoiceOutputProps>(
1812
+ 'kai-voice-output',
1813
+ ["theme","text","autoplay","synthesize","disabled"],
1814
+ { onSpeakingChange: 'kai-speaking-change', onSynthesized: 'kai-synthesized' },
1815
+ () => import('@kitn.ai/ui/elements/voice-output'),
885
1816
  );
886
1817
 
887
1818
  export interface WorkspaceProps extends WebComponentProps {
888
1819
  /** Pre-bucketed conversation groups for the sidebar. Set as a JS property. */
889
1820
  groups: { id: string; userId?: undefined | string; teamId?: undefined | string; name: string; sortOrder: number; createdAt: string }[];
890
1821
  /** Flat conversation list (auto-bucketed if `groups` is empty). Set as a JS property. */
891
- conversations: { id: string; title: string; groupId?: undefined | string; scope: { type: "document" | "collection"; documentId?: undefined | string; filters?: undefined | { tags?: undefined | string[]; authors?: undefined | string[]; contentType?: undefined | "transcript" | "markdown"; dateRange?: undefined | { from: string; to: string } } }; messageCount: number; lastMessageAt: string; updatedAt: string }[];
1822
+ conversations: { id: string; title: string; groupId?: undefined | string; scope: { type: "document" | "collection"; documentId?: undefined | string; filters?: undefined | { tags?: undefined | string[]; authors?: undefined | string[]; contentType?: undefined | "transcript" | "markdown"; dateRange?: undefined | { from: string; to: string } } }; messageCount: number; lastMessageAt: string; updatedAt: string; trailing?: undefined | string }[];
892
1823
  /** Id of the open conversation, highlighted in the sidebar. */
893
1824
  activeId?: string;
894
1825
  /** The active conversation's message thread, newest last. Set as a JS property. */
895
- messages: { id: string; role: "user" | "assistant"; content: string; reasoning?: undefined | { text: string; label?: undefined | string }; tools?: undefined | { type: string; state: "input-streaming" | "input-available" | "output-available" | "output-error"; input?: undefined | Record<string, unknown>; output?: undefined | Record<string, unknown>; toolCallId?: undefined | string; errorText?: undefined | string }[]; attachments?: undefined | { id: string; type: "file" | "source-document"; filename?: undefined | string; mediaType?: undefined | string; url?: undefined | string; title?: undefined | string }[]; actions?: undefined | ("copy" | "like" | "dislike" | "regenerate" | "edit" | { id: string; label: string; icon?: undefined | string; tooltip?: undefined | string })[]; avatar?: undefined | { src?: undefined | string; fallback?: undefined | string; alt?: undefined | string } }[];
1826
+ messages: { id: string; role: "user" | "assistant"; content: string; reasoning?: undefined | { text: string; label?: undefined | string }; tools?: undefined | { type: string; state: "input-streaming" | "input-available" | "output-available" | "output-error"; input?: undefined | Record<string, unknown>; output?: undefined | Record<string, unknown>; toolCallId?: undefined | string; errorText?: undefined | string }[]; attachments?: undefined | { id: string; type: "file" | "source-document"; filename?: undefined | string; mediaType?: undefined | string; url?: undefined | string; title?: undefined | string }[]; actions?: undefined | ("copy" | "like" | "dislike" | "regenerate" | "edit" | { id: string; label: string; icon?: undefined | string; tooltip?: undefined | string })[]; avatar?: undefined | { src?: undefined | string; fallback?: undefined | string; alt?: undefined | string }; feedback?: undefined | "like" | "dislike" }[];
896
1827
  value?: string;
897
1828
  placeholder?: string;
898
1829
  loading?: boolean;
899
1830
  suggestions?: string[];
900
1831
  suggestionMode?: "submit" | "fill";
901
- proseSize?: "xs" | "sm" | "base" | "lg";
1832
+ proseSize?: "sm" | "lg" | "xs" | "base";
902
1833
  codeTheme?: string;
903
1834
  codeHighlight?: boolean;
904
1835
  chatTitle?: string;
@@ -908,12 +1839,13 @@ export interface WorkspaceProps extends WebComponentProps {
908
1839
  scrollButton?: boolean;
909
1840
  search?: boolean;
910
1841
  voice?: boolean;
911
- slashCommands?: { id: string; label: string; description?: string; category?: string }[];
912
- slashActiveIds?: string[];
913
- slashCompact?: boolean;
914
- /** Sidebar default width as a percent of the workspace (default 22). */
1842
+ /** Rich entity triggers (`/` skills, `@` agents/plugins) forwarded to the input. */
1843
+ triggers?: { char: string; kind: string; items?: { id: string; label: string; icon?: string; description?: string; group?: string; kind?: string; promptText?: string; data?: Record<string, unknown> }[] }[];
1844
+ /** Default icon per entity kind (kind → image src) forwarded to the input. */
1845
+ kindIcons?: Record<string, string>;
1846
+ /** Sidebar default width as a percent of the workspace (default 26). */
915
1847
  sidebarWidth?: number;
916
- /** Sidebar min width in px (default 200). */
1848
+ /** Sidebar min width in px (default 240). */
917
1849
  sidebarMinWidth?: number;
918
1850
  /** Sidebar max width in px (default 420). */
919
1851
  sidebarMaxWidth?: number;
@@ -921,10 +1853,16 @@ export interface WorkspaceProps extends WebComponentProps {
921
1853
  sidebarCollapsed?: boolean;
922
1854
  /** Initial collapsed state when uncontrolled (default false). Use the `default-sidebar-collapsed` attribute to start collapsed in plain HTML. */
923
1855
  defaultSidebarCollapsed?: boolean;
1856
+ /** Auto-collapse the rail when the workspace's own width drops below this many px, and re-expand when it grows back above. Uncontrolled only (it never fights an app-driven `sidebarCollapsed`); omit to disable. Fires `kai-sidebar-toggle`. Attribute: `collapse-below`. */
1857
+ collapseBelow?: number;
1858
+ /** Render Recents as dense single-line rows (a leading dot + title, no count). */
1859
+ compact?: boolean;
1860
+ /** Suppress the built-in ConversationList so the `sidebar-header` slot owns the whole rail flex region (for apps that supply their own rail nav). Default false. Attribute: `no-conversations`. */
1861
+ noConversations?: boolean;
924
1862
  /** A conversation was selected in the sidebar. */
925
1863
  onConversationSelect?: (event: CustomEvent<{ id: string }>) => void;
926
- /** An action button on a message was clicked. */
927
- onMessageAction?: (event: CustomEvent<{ messageId: string; action: string }>) => void;
1864
+ /** An action button on a message was clicked. `state` is present only for the toggleable feedback votes: `'on'` when a like/dislike is set, `'off'` when re-tapped to clear. */
1865
+ onMessageAction?: (event: CustomEvent<{ messageId: string; action: string; state?: undefined | "on" | "off" }>) => void;
928
1866
  /** The header model switcher changed. */
929
1867
  onModelChange?: (event: CustomEvent<{ modelId: string }>) => void;
930
1868
  /** The "New chat" button was clicked. */
@@ -933,8 +1871,6 @@ export interface WorkspaceProps extends WebComponentProps {
933
1871
  onSearch?: (event: CustomEvent<Record<string, never>>) => void;
934
1872
  /** The sidebar was collapsed or expanded. */
935
1873
  onSidebarToggle?: (event: CustomEvent<{ collapsed: boolean }>) => void;
936
- /** A slash command was chosen from the palette. */
937
- onSlashSelect?: (event: CustomEvent<{ command: { id: string; label: string; description?: undefined | string; category?: undefined | string } }>) => void;
938
1874
  /** User submitted a message. */
939
1875
  onSubmit?: (event: CustomEvent<{ value: string; attachments: { id: string; type: "file" | "source-document"; filename?: undefined | string; mediaType?: undefined | string; url?: undefined | string; title?: undefined | string }[] }>) => void;
940
1876
  /** A suggestion chip was clicked (only in `suggestion-mode="fill"`). */
@@ -945,8 +1881,9 @@ export interface WorkspaceProps extends WebComponentProps {
945
1881
  onVoice?: (event: CustomEvent<Record<string, never>>) => void;
946
1882
  }
947
1883
 
948
- export const Workspace = createWebComponent<WorkspaceProps>(
1884
+ export const Workspace = /*#__PURE__*/ createWebComponent<WorkspaceProps>(
949
1885
  'kai-workspace',
950
- ["theme","groups","conversations","activeId","messages","value","placeholder","loading","suggestions","suggestionMode","proseSize","codeTheme","codeHighlight","chatTitle","models","currentModel","context","scrollButton","search","voice","slashCommands","slashActiveIds","slashCompact","sidebarWidth","sidebarMinWidth","sidebarMaxWidth","sidebarCollapsed","defaultSidebarCollapsed"],
951
- { onConversationSelect: 'kai-conversation-select', onMessageAction: 'kai-message-action', onModelChange: 'kai-model-change', onNewChat: 'kai-new-chat', onSearch: 'kai-search', onSidebarToggle: 'kai-sidebar-toggle', onSlashSelect: 'kai-slash-select', onSubmit: 'kai-submit', onSuggestionClick: 'kai-suggestion-click', onValueChange: 'kai-value-change', onVoice: 'kai-voice' },
1886
+ ["theme","groups","conversations","activeId","messages","value","placeholder","loading","suggestions","suggestionMode","proseSize","codeTheme","codeHighlight","chatTitle","models","currentModel","context","scrollButton","search","voice","triggers","kindIcons","sidebarWidth","sidebarMinWidth","sidebarMaxWidth","sidebarCollapsed","defaultSidebarCollapsed","collapseBelow","compact","noConversations"],
1887
+ { onConversationSelect: 'kai-conversation-select', onMessageAction: 'kai-message-action', onModelChange: 'kai-model-change', onNewChat: 'kai-new-chat', onSearch: 'kai-search', onSidebarToggle: 'kai-sidebar-toggle', onSubmit: 'kai-submit', onSuggestionClick: 'kai-suggestion-click', onValueChange: 'kai-value-change', onVoice: 'kai-voice' },
1888
+ () => import('@kitn.ai/ui/elements/chat-workspace'),
952
1889
  );