@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
@@ -25,20 +25,119 @@ export interface CodeHighlightingOptions {
25
25
  aliases?: Record<string, string>;
26
26
  }
27
27
 
28
- // Runtime values live in the compiled `default` (dist/kitn-chat.es.js); we only
28
+ // Runtime values live in the compiled `default` (dist/kai.es.js); we only
29
29
  // DECLARE their signatures here so the .d.ts pulls no source.
30
30
  export declare function configureCodeHighlighting(options: CodeHighlightingOptions): void;
31
31
  export declare function isCodeHighlightingEnabled(): boolean;
32
32
 
33
+ /** Resolves once the kai-* elements are registered (browser); inert on the server. */
34
+ export declare const elementsReady: Promise<unknown>;
35
+
36
+ // --- Inlined from src/primitives/toast-store.ts (kept self-contained: no source imports) ---
37
+ export type ToastVariant = 'neutral' | 'success' | 'warning' | 'error' | 'info';
38
+
39
+ export interface ToastConfig {
40
+ stack?: 'expanded' | 'collapsed';
41
+ position?: 'top-center' | 'top-right' | 'top-left' | 'bottom-center' | 'bottom-right' | 'bottom-left';
42
+ max?: number;
43
+ /** Default appearance for imperatively-raised toasts. Defaults to `'pill'`. */
44
+ appearance?: 'pill' | 'card';
45
+ /** Default high-contrast inverse treatment. Defaults to `false`. */
46
+ inverse?: boolean;
47
+ }
48
+
49
+ /** An action button rendered inside the toast. Returning `false` from `onAction`
50
+ * keeps the toast open; any other return value dismisses it. */
51
+ export interface ToastAction {
52
+ label: string;
53
+ onAction: () => void | false;
54
+ }
55
+
56
+ export interface ToastItem {
57
+ id: string;
58
+ message: string;
59
+ variant?: ToastVariant;
60
+ /** Visual treatment: `'pill'` (default) or `'card'`. */
61
+ appearance?: 'pill' | 'card';
62
+ /** High-contrast inverse surface. Defaults to `false`. */
63
+ inverse?: boolean;
64
+ /** Secondary line shown below the message in the `'card'` appearance. */
65
+ description?: string;
66
+ action?: ToastAction;
67
+ /** Auto-dismiss delay in ms. `0` = sticky. */
68
+ duration?: number;
69
+ /** Whether the close affordance is shown. Defaults to `true`. */
70
+ dismissible?: boolean;
71
+ /** Container to scope this toast within instead of the viewport. */
72
+ target?: HTMLElement;
73
+ }
74
+
75
+ /** Options accepted by `toast()` — everything but the message. */
76
+ export interface ToastOptions {
77
+ id?: string;
78
+ variant?: ToastVariant;
79
+ appearance?: 'pill' | 'card';
80
+ inverse?: boolean;
81
+ description?: string;
82
+ action?: ToastAction;
83
+ duration?: number;
84
+ dismissible?: boolean;
85
+ target?: HTMLElement;
86
+ }
87
+
88
+ /** Handle returned from `toast()` for imperative control. */
89
+ export interface ToastHandle {
90
+ id: string;
91
+ dismiss: () => void;
92
+ update: (patch: Partial<Omit<ToastItem, 'id'>>) => void;
93
+ }
94
+
95
+ // Runtime values live in the compiled `default` (dist/kai.es.js); we only
96
+ // DECLARE their signatures here so the .d.ts pulls no source.
97
+ /** Raise a transient toast. `toast('Saved')`, `toast.success('Copied')`,
98
+ * `toast.dismiss(id)`. Returns a `{ id, dismiss, update }` handle. */
99
+ export declare const toast: {
100
+ (message: string, opts?: ToastOptions): ToastHandle;
101
+ /** Raise a success (green check) toast. */
102
+ success: (message: string, opts?: ToastOptions) => ToastHandle;
103
+ /** Raise a warning (amber) toast. */
104
+ warning: (message: string, opts?: ToastOptions) => ToastHandle;
105
+ /** Raise an error (destructive/red) toast. */
106
+ error: (message: string, opts?: ToastOptions) => ToastHandle;
107
+ /** Raise an info (blue) toast. */
108
+ info: (message: string, opts?: ToastOptions) => ToastHandle;
109
+ /** Dismiss a toast by id. */
110
+ dismiss: (id: string) => void;
111
+ /** Dismiss every active toast. */
112
+ clear: () => void;
113
+ };
114
+ /** Configure the imperative `toast()` singleton — call once at app start. */
115
+ export declare function configureToasts(config: ToastConfig): void;
116
+
117
+ export interface KaiAgentCardElement extends HTMLElement {
118
+ /** Color mode (`auto` follows prefers-color-scheme). */
119
+ theme?: 'light' | 'dark' | 'auto';
120
+ /** The agent's name — the primary label. Attribute: `name`. */
121
+ name?: string;
122
+ /** Selected / focused state: highlighted border + surface. Attribute: `active`. */
123
+ active?: boolean;
124
+ /** Raise a prominent "Needs you" pill plus a glowing amber edge — the attention-routing signal that pulls focus to this agent. Attribute: `needs-attention`. */
125
+ needsAttention?: boolean;
126
+ /** 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 }`. */
127
+ status?: { tone: "working" | "idle" | "done" | "error" | "blocked"; label?: string; pulse?: boolean };
128
+ }
129
+
33
130
  export interface KaiArtifactElement extends HTMLElement {
34
131
  /** Color mode (`auto` follows prefers-color-scheme). */
35
132
  theme?: 'light' | 'dark' | 'auto';
36
133
  /** URL the preview iframe frames. Consumer-controlled. */
37
134
  src?: string;
38
135
  /** Files for the Code tab tree + each file's preview `url`. Set as a JS property (array). */
39
- files: { path: string; url?: undefined | string; code?: undefined | string; language?: undefined | string; type?: undefined | "html" | "pdf" | "image" | "other" }[];
40
- /** Active tab: `preview` (default) or `code`. */
136
+ 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" }[];
137
+ /** Controlled active tab: `preview` or `code`. When set, the artifact follows it (re-asserted on change). Leave unset for an uncontrolled tab (see `defaultTab`). */
41
138
  tab?: "preview" | "code";
139
+ /** 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`. */
140
+ defaultTab?: "preview" | "code";
42
141
  /** Selected file path — syncs the tree highlight, Code source, and preview. */
43
142
  activeFile?: string;
44
143
  /** iframe `sandbox` override. Secure default `allow-scripts allow-forms` (NOT `allow-same-origin`). */
@@ -65,6 +164,8 @@ export interface KaiArtifactElement extends HTMLElement {
65
164
  standalone?: boolean;
66
165
  /** Show the address but make it read-only (visible, nav-tracking, non-editable). */
67
166
  readonlyPath?: boolean;
167
+ /** 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. */
168
+ displayUrl?: string;
68
169
  }
69
170
 
70
171
  export interface KaiAttachmentsElement extends HTMLElement {
@@ -84,44 +185,103 @@ export interface KaiAttachmentsElement extends HTMLElement {
84
185
  emptyText?: string;
85
186
  }
86
187
 
188
+ export interface KaiAvatarElement extends HTMLElement {
189
+ /** Color mode (`auto` follows prefers-color-scheme). */
190
+ theme?: 'light' | 'dark' | 'auto';
191
+ /** Image URL/data-URI. When absent, the `fallback` initials show instead. */
192
+ src?: string;
193
+ /** Alt text for the image. Defaults to `fallback`. */
194
+ alt?: string;
195
+ /** Short text shown when there's no image — usually initials (e.g. "JD", "AI"). */
196
+ fallback?: string;
197
+ /** Size token: `sm` | `md` (default) | `lg`. */
198
+ size?: "sm" | "md" | "lg";
199
+ }
200
+
201
+ export interface KaiBadgeElement extends HTMLElement {
202
+ /** Color mode (`auto` follows prefers-color-scheme). */
203
+ theme?: 'light' | 'dark' | 'auto';
204
+ /** `default` (muted pill) · `count` (compact number badge) · `citation` (filled primary, for inline citation markers). Defaults to `default`. */
205
+ variant?: "default" | "count" | "citation";
206
+ }
207
+
208
+ export interface KaiButtonElement extends HTMLElement {
209
+ /** Color mode (`auto` follows prefers-color-scheme). */
210
+ theme?: 'light' | 'dark' | 'auto';
211
+ /** Visual style. `default` (filled), `subtle` (muted text, hover tint — the toolbar icon look), `ghost` (transparent, hover fill), `outline`, or `destructive`. Defaults to `default`. */
212
+ variant?: "default" | "subtle" | "ghost" | "outline" | "destructive";
213
+ /** Size token. `icon` / `icon-sm` are square (for icon-only buttons); `sm` / `md` / `lg` size text buttons. Defaults to `md`. */
214
+ size?: "sm" | "md" | "lg" | "icon" | "icon-sm";
215
+ /** Leading icon: a named icon (e.g. `"mic"`, `"plus"`), an image URL/data-URI, or plain text. Renders before any slotted label. */
216
+ icon?: string;
217
+ /** Trailing icon, after the label (e.g. `"chevron-down"` for a menu affordance). */
218
+ iconTrailing?: string;
219
+ /** Accessible name. REQUIRED for icon-only buttons (no visible text); ignored when you slot visible text, which already names the button. */
220
+ label?: string;
221
+ /** Disable the button (non-interactive, dimmed). */
222
+ disabled?: boolean;
223
+ /** Stretch the button to the full width of its container (a block button) — e.g. a card CTA or a stacked action. Attribute: `full`. */
224
+ full?: boolean;
225
+ /** Justify the button's content: `start`, `center` (default), or `end`. Combine with `full` for a full-width, left-aligned button. */
226
+ align?: "start" | "center" | "end";
227
+ /** Native button `type`. Defaults to `button` (so it never submits a form). */
228
+ type?: "button" | "submit" | "reset";
229
+ }
230
+
87
231
  export interface KaiCardElement extends HTMLElement {
88
232
  /** Color mode (`auto` follows prefers-color-scheme). */
89
233
  theme?: 'light' | 'dark' | 'auto';
90
- /** Heading rendered in the card chrome (= CardEnvelope.title). Attribute: `heading`. */
91
- heading?: string;
92
- /** Supporting text under the heading. Attribute: `description`. */
93
- description?: string;
94
- /** When set, the card renders its inline error state instead of the body. Attribute: `error-message`. */
95
- errorMessage?: string;
96
- /** Compact spacing for dense lists. Attribute: `dense`. */
234
+ /** Surface treatment: `outlined` (default) | `filled` | `plain` | `accent`. Attribute: `appearance`. */
235
+ appearance?: "outlined" | "filled" | "plain" | "accent";
236
+ /** `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`. */
237
+ orientation?: "vertical" | "horizontal" | "responsive";
238
+ /** The card width below which a `responsive` card collapses to vertical and the footer actions stack. A CSS length; default `28rem`. Attribute: `collapse`. */
239
+ collapse?: string;
240
+ /** Tighter spacing for dense lists. Attribute: `dense`. */
97
241
  dense?: boolean;
242
+ /** Show a close (×) that hides the card and emits `kai-dismiss`. Attribute: `dismissible`. Off by default. */
243
+ dismissible?: boolean;
244
+ /** Render the whole card as a link. Attribute: `href`. Wins over `clickable`. */
245
+ href?: string;
246
+ /** `target` for the `href` anchor. Attribute: `target`. */
247
+ target?: string;
248
+ /** `rel` for the `href` anchor. Attribute: `rel`. */
249
+ rel?: string;
250
+ /** Make the whole card a button (`role="button"`, Enter/Space, hover affordance) that emits `kai-card-click`. Attribute: `clickable`. Ignored when `href` is set. */
251
+ clickable?: boolean;
98
252
  }
99
253
 
100
254
  export interface KaiCardsElement extends HTMLElement {
101
255
  /** Color mode (`auto` follows prefers-color-scheme). */
102
256
  theme?: 'light' | 'dark' | 'auto';
103
257
  /** The stream of card envelopes to render. Set as a JS PROPERTY: `el.cards = [...]`. */
104
- cards?: { type: string; id: string; data: unknown; title?: string; resolution?: { kind: "action"; action: string; payload?: unknown; at?: string } | { kind: "submit"; data: unknown; at?: string } }[];
258
+ 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 } }[];
105
259
  /** 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. */
106
260
  types?: Record<string, string>;
107
261
  /** Optional CardPolicy handling child events. Property: `el.policy`. */
108
- 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" };
262
+ 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" };
109
263
  }
110
264
 
111
265
  export interface KaiChainOfThoughtElement extends HTMLElement {
112
266
  /** Color mode (`auto` follows prefers-color-scheme). */
113
267
  theme?: 'light' | 'dark' | 'auto';
114
- /** The reasoning steps. Set as a JS property. Compound sub-parts collapse to this one data model (Route 1). */
115
- steps: { label: string; content?: undefined | string }[];
268
+ /** The reasoning steps. Set as a JS property. Compound sub-parts collapse to this one data model (Route 1). Each `{ label, content?, id? }`. */
269
+ steps: { label: string; content?: undefined | string; id?: undefined | string }[];
270
+ /** Open mode: `'multiple'` (default — any number of steps open at once) or `'single'` (at most one open; opening a step closes the others). */
271
+ type?: "single" | "multiple";
272
+ /** 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. */
273
+ value?: string | string[];
274
+ /** Uncontrolled INITIAL open step key(s) — seeds which steps render expanded. Ignored once `value` is provided. Set as a JS property. */
275
+ defaultValue?: string | string[];
116
276
  }
117
277
 
118
278
  export interface KaiChatElement extends HTMLElement {
119
279
  /** Color mode (`auto` follows prefers-color-scheme). */
120
280
  theme?: 'light' | 'dark' | 'auto';
121
281
  /** 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 = [...]`). */
122
- 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 } }[];
123
- /** 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. */
124
- value?: string;
282
+ 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" }[];
283
+ /** 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. */
284
+ value?: string | ({ type: "text"; text: string } | { type: "entity"; entity: { kind: string; id: string; label: string; icon?: string; promptText?: string; data?: Record<string, unknown> } })[];
125
285
  /** Placeholder text shown in the empty input. */
126
286
  placeholder?: string;
127
287
  /** When true, shows the loading/streaming state and disables submit (use while awaiting the assistant's reply). */
@@ -133,7 +293,7 @@ export interface KaiChatElement extends HTMLElement {
133
293
  /** 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. */
134
294
  persistSuggestions?: boolean;
135
295
  /** Body/prose font scale for rendered markdown (`'xs' | 'sm' | 'base' | 'lg'`). Defaults to `'sm'`. */
136
- proseSize?: "xs" | "sm" | "base" | "lg";
296
+ proseSize?: "sm" | "lg" | "xs" | "base";
137
297
  /** Shiki theme name for syntax-highlighted code blocks (e.g. `'github-dark-dimmed'`). */
138
298
  codeTheme?: string;
139
299
  /** Enable Shiki syntax highlighting in code blocks. Turn off to render plain `<pre>` blocks (lighter, no highlighter load). Default true. */
@@ -152,16 +312,26 @@ export interface KaiChatElement extends HTMLElement {
152
312
  headerStart?: boolean;
153
313
  /** Whether the host has `slot="header-end"` content (right of the controls). */
154
314
  headerEnd?: boolean;
315
+ /** REPLACE — full custom header in place of the built-in title/model/context bar. */
316
+ headerFull?: boolean;
317
+ /** INJECT — left sidebar column (e.g. a conversation list / your own nav). */
318
+ sidebar?: boolean;
319
+ /** 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). */
320
+ empty?: boolean;
321
+ /** REPLACE — full custom composer in place of the built-in prompt input. The projected content wires its own submit (the data-flow boundary). */
322
+ composer?: boolean;
323
+ /** INJECT — accessory row just above the composer (e.g. extra actions). */
324
+ composerActions?: boolean;
325
+ /** INJECT — footer row below the composer (disclaimers, token meter, …). */
326
+ footer?: boolean;
155
327
  /** Show a Search (Globe) button in the input toolbar; fires a `search` event. */
156
328
  search?: boolean;
157
329
  /** Show a Voice (Mic) button in the input toolbar; fires a `voice` event. */
158
330
  voice?: boolean;
159
- /** Slash commandswhen set, typing `/` in the input opens the command palette and fires `kai-slash-select`. Set as a JS property. */
160
- slashCommands?: { id: string; label: string; description?: string; category?: string }[];
161
- /** Command ids to highlight as active in the palette. */
162
- slashActiveIds?: string[];
163
- /** Single-line palette rows. */
164
- slashCompact?: boolean;
331
+ /** 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. */
332
+ triggers?: { char: string; kind: string; items?: { id: string; label: string; icon?: string; description?: string; group?: string; kind?: string; promptText?: string; data?: Record<string, unknown> }[] }[];
333
+ /** Default icon per entity kind (kind image src) for pills/menu items. */
334
+ kindIcons?: Record<string, string>;
165
335
  /** Whether each message's action bar is always visible (`'always'`, default) or only revealed on hover of that message row (`'hover'`). */
166
336
  actionsReveal?: "always" | "hover";
167
337
  }
@@ -174,9 +344,9 @@ export interface KaiCheckpointElement extends HTMLElement {
174
344
  /** Tooltip on hover. */
175
345
  tooltip?: string;
176
346
  /** Visual button style. */
177
- variant?: "ghost" | "default" | "outline";
347
+ variant?: "default" | "ghost" | "outline";
178
348
  /** Button size (use an `icon*` size for an icon-only checkpoint). */
179
- size?: "sm" | "lg" | "md" | "icon" | "icon-sm";
349
+ size?: "sm" | "md" | "lg" | "icon" | "icon-sm";
180
350
  }
181
351
 
182
352
  export interface KaiChoiceElement extends HTMLElement {
@@ -190,6 +360,31 @@ export interface KaiChoiceElement extends HTMLElement {
190
360
  heading?: string;
191
361
  /** Set when the user resolved this card; renders the read-only view. Property: `el.resolution = { kind:'action', action:'…' }`. */
192
362
  resolution?: Record<string, unknown>;
363
+ /** Controlled selection — the selected option id. When set, the consumer owns the current pick (RadioGroup `value`). Attribute: `value`. */
364
+ value?: string;
365
+ /** Option id to pre-select on mount (uncontrolled seed). Attribute: `default-value`. */
366
+ defaultValue?: string;
367
+ /** Disable the whole radiogroup + Submit (e.g. while the agent is busy). Attribute: `disabled`. */
368
+ disabled?: boolean;
369
+ }
370
+
371
+ export interface KaiCoachmarkElement extends HTMLElement {
372
+ /** Color mode (`auto` follows prefers-color-scheme). */
373
+ theme?: 'light' | 'dark' | 'auto';
374
+ /** 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`. */
375
+ open?: boolean;
376
+ /** Initial open state on mount (uncontrolled seed). */
377
+ defaultOpen?: boolean;
378
+ /** The bold title. Named `headline` because `title` collides with the global `HTMLElement.title` attribute (it throws at registration). */
379
+ headline?: string;
380
+ /** A small badge pill beside the headline (e.g. "New"). */
381
+ badge?: string;
382
+ /** Floating placement relative to the anchor (default `bottom`). */
383
+ placement?: string;
384
+ /** Color tone: `primary` (default, theme accent), `info` (blue), `success` (green), `warning` (amber), or `error` (red) — reusing the kit's tool hues. */
385
+ tone?: "error" | "primary" | "info" | "success" | "warning";
386
+ /** Render the arrow that points at the anchor (default `true`). Set `arrow="false"` for a plain bubble with no pointer. */
387
+ arrow?: boolean;
193
388
  }
194
389
 
195
390
  export interface KaiCodeBlockElement extends HTMLElement {
@@ -204,7 +399,60 @@ export interface KaiCodeBlockElement extends HTMLElement {
204
399
  /** Disable syntax highlighting (renders plain text, no Shiki). */
205
400
  codeHighlight?: boolean;
206
401
  /** Code text sizing. */
207
- proseSize?: "xs" | "sm" | "base" | "lg";
402
+ proseSize?: "sm" | "lg" | "xs" | "base";
403
+ }
404
+
405
+ export interface KaiCommandElement extends HTMLElement {
406
+ /** Color mode (`auto` follows prefers-color-scheme). */
407
+ theme?: 'light' | 'dark' | 'auto';
408
+ /** Flat list of items. Set as a JS property — not an HTML attribute. */
409
+ items?: { id: string; label: string; icon?: string; description?: string; shortcut?: string; group?: string }[];
410
+ /** Placeholder text for the search input. */
411
+ placeholder?: string;
412
+ /** Label shown when no items match the current query. */
413
+ emptyLabel?: string;
414
+ }
415
+
416
+ export interface KaiCompareElement extends HTMLElement {
417
+ /** Color mode (`auto` follows prefers-color-scheme). */
418
+ theme?: 'light' | 'dark' | 'auto';
419
+ /** 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. */
420
+ data?: Record<string, unknown>;
421
+ /** Stable id correlating every emitted event. Attribute: `compare-id`. */
422
+ compareId?: string;
423
+ /** Re-hydrate / control the user's pick. Set as a JS PROPERTY: `el.selection = { chosenId, rejectedIds }`. Renders the collapsed winner. */
424
+ selection?: Record<string, unknown>;
425
+ /** Layout: `'auto'` (default — columns when wide, tabs when narrow, by CONTAINER width) | `'columns'` (side-by-side) | `'tabs'` (pills to switch). Attribute: `layout`. */
426
+ layout?: "auto" | "columns" | "tabs";
427
+ /** Prose/text size for the rendered candidates. Attribute: `prose-size`. */
428
+ proseSize?: "sm" | "lg" | "xs" | "base";
429
+ /** Shiki theme for code blocks in the candidates. Attribute: `code-theme`. */
430
+ codeTheme?: string;
431
+ /** Whether code blocks are syntax-highlighted. Attribute: `code-highlight`. */
432
+ codeHighlight?: boolean;
433
+ }
434
+
435
+ export interface KaiComposerElement extends HTMLElement {
436
+ /** Color mode (`auto` follows prefers-color-scheme). */
437
+ theme?: 'light' | 'dark' | 'auto';
438
+ /** Controlled value — string or a full ComposerDoc (set as JS property). */
439
+ value?: string | ({ type: "text"; text: string } | { type: "entity"; entity: { kind: string; id: string; label: string; icon?: string; promptText?: string; data?: Record<string, unknown> } })[];
440
+ /** Placeholder text shown when the composer is empty. */
441
+ placeholder?: string;
442
+ /** Disable the composer entirely (non-interactive). */
443
+ disabled?: boolean;
444
+ /** Show a loading/streaming state and block submit. */
445
+ loading?: boolean;
446
+ /** Maximum height in px before the content scrolls. Default 240. */
447
+ maxHeight?: string | number;
448
+ /** Whether pressing Enter (without Shift) submits. Default true. */
449
+ submitOnEnter?: boolean;
450
+ /** Trigger definitions — set as a JS property. */
451
+ triggers?: { char: string; kind: string; items?: { id: string; label: string; icon?: string; description?: string; group?: string; kind?: string; promptText?: string; data?: Record<string, unknown> }[] }[];
452
+ /** Keyword highlight rules — set as a JS property. */
453
+ highlights?: (string | { pattern: string; flags?: string; class?: string })[];
454
+ /** 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. */
455
+ kindIcons?: Record<string, string>;
208
456
  }
209
457
 
210
458
  export interface KaiConfirmElement extends HTMLElement {
@@ -239,9 +487,35 @@ export interface KaiConversationsElement extends HTMLElement {
239
487
  /** 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. */
240
488
  groups: { id: string; userId?: undefined | string; teamId?: undefined | string; name: string; sortOrder: number; createdAt: string }[];
241
489
  /** A flat list of conversation summaries; the component buckets them by recency for you. Ignored when `groups` is provided. Set as a JS property. */
242
- 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 }[];
490
+ 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 }[];
243
491
  /** The id of the currently-open conversation, highlighted in the list. */
244
492
  activeId?: string;
493
+ /** 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. */
494
+ collapsed?: boolean;
495
+ /** Initial collapsed state when uncontrolled (default false). Use the `default-collapsed` attribute to start collapsed in plain HTML. */
496
+ defaultCollapsed?: boolean;
497
+ }
498
+
499
+ export interface KaiDialogElement extends HTMLElement {
500
+ /** Color mode (`auto` follows prefers-color-scheme). */
501
+ theme?: 'light' | 'dark' | 'auto';
502
+ /** 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`. */
503
+ open?: boolean;
504
+ /** Initial open state on mount (uncontrolled seed). */
505
+ defaultOpen?: boolean;
506
+ }
507
+
508
+ export interface KaiEditableLabelElement extends HTMLElement {
509
+ /** Color mode (`auto` follows prefers-color-scheme). */
510
+ theme?: 'light' | 'dark' | 'auto';
511
+ /** The label text — settable and reflected to the `value` attribute. Read `el.value` for live state. */
512
+ value?: string;
513
+ /** Controlled edit state. `el.editing = true` opens the field; reflected to the `editing` attribute. */
514
+ editing?: boolean;
515
+ /** Placeholder shown while editing / when the value is empty. */
516
+ placeholder?: string;
517
+ /** Disable entering edit mode. */
518
+ disabled?: boolean;
245
519
  }
246
520
 
247
521
  export interface KaiEmbedElement extends HTMLElement {
@@ -284,12 +558,14 @@ export interface KaiFeedbackBarElement extends HTMLElement {
284
558
  export interface KaiFileTreeElement extends HTMLElement {
285
559
  /** Color mode (`auto` follows prefers-color-scheme). */
286
560
  theme?: 'light' | 'dark' | 'auto';
287
- /** The files to render. Set as a JS property (array of `{ path, url?, code?, language?, type? }`). */
288
- files: { path: string; url?: undefined | string; code?: undefined | string; language?: undefined | string; type?: undefined | "html" | "pdf" | "image" | "other" }[];
561
+ /** The files to render. Set as a JS property (array of `{ path, url?, code?, language?, type?, additions?, deletions?, status? }`). */
562
+ 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" }[];
289
563
  /** Selected file path — highlighted in the tree. */
290
564
  activeFile?: string;
291
565
  /** Folder paths expanded initially. Omit to start with all folders open. */
292
566
  defaultExpanded?: string[];
567
+ /** Show a changed-files summary header (file count + summed `+/-` + Collapse-all). Attribute: `summary`. Off by default. */
568
+ summary?: boolean;
293
569
  }
294
570
 
295
571
  export interface KaiFileUploadElement extends HTMLElement {
@@ -316,6 +592,38 @@ export interface KaiFormElement extends HTMLElement {
316
592
  heading?: string;
317
593
  /** Set when the user resolved this card; renders the read-only view. Property: `el.resolution = { kind:'submit', data:{…} }`. */
318
594
  resolution?: Record<string, unknown>;
595
+ /** Controlled field values (JS property). When set, it wins over local edits. */
596
+ values?: Record<string, unknown>;
597
+ /** Initial values overlaying the schema defaults (uncontrolled seed; JS property). */
598
+ defaultValues?: Record<string, unknown>;
599
+ /** Disable all fields + submit. Attribute: `disabled`. */
600
+ disabled?: boolean;
601
+ }
602
+
603
+ export interface KaiHoverCardElement extends HTMLElement {
604
+ /** Color mode (`auto` follows prefers-color-scheme). */
605
+ theme?: 'light' | 'dark' | 'auto';
606
+ /** Delay (ms) before the card opens on hover. Defaults to 0 (focus opens it immediately too). */
607
+ openDelay?: number;
608
+ /** Delay (ms) before it closes after the pointer leaves. Defaults to 300. */
609
+ closeDelay?: number;
610
+ /** Preferred placement: `'top' | 'bottom' | 'left' | 'right'` (+ optional `-start`/`-end`). Defaults to `'bottom'`; flips to stay in view. */
611
+ placement?: string;
612
+ /** 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`. */
613
+ open?: boolean;
614
+ /** Initial open state on mount (uncontrolled seed). */
615
+ defaultOpen?: boolean;
616
+ /** Suppress the hover behavior entirely without unmounting. */
617
+ disabled?: boolean;
618
+ }
619
+
620
+ export interface KaiIconElement extends HTMLElement {
621
+ /** Color mode (`auto` follows prefers-color-scheme). */
622
+ theme?: 'light' | 'dark' | 'auto';
623
+ /** A curated icon name (e.g. `"mic"`, `"globe"`), an image URL/data-URI, or plain text. */
624
+ name?: string;
625
+ /** Size token: `sm` | `md` (default) | `lg`. */
626
+ size?: "sm" | "md" | "lg";
319
627
  }
320
628
 
321
629
  export interface KaiImageElement extends HTMLElement {
@@ -331,6 +639,50 @@ export interface KaiImageElement extends HTMLElement {
331
639
  mediaType?: string;
332
640
  }
333
641
 
642
+ export interface KaiInputElement extends HTMLElement {
643
+ /** Color mode (`auto` follows prefers-color-scheme). */
644
+ theme?: 'light' | 'dark' | 'auto';
645
+ /** Native input type: `text` (default) · `email` · `url` · `search` · `tel` · `password` · `number`. Single-line only. */
646
+ type?: string;
647
+ /** 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. */
648
+ value?: string;
649
+ /** Placeholder shown when empty. */
650
+ placeholder?: string;
651
+ /** Field label, linked to the input. */
652
+ label?: string;
653
+ /** Helper text below the control. */
654
+ hint?: string;
655
+ /** Error text; flips the field invalid (`aria-invalid` + destructive border). */
656
+ error?: string;
657
+ /** Control density: `sm` or `md`. Defaults to `md`. */
658
+ size?: "sm" | "md";
659
+ /** Disable interaction. */
660
+ disabled?: boolean;
661
+ /** Make the input read-only. */
662
+ readonly?: boolean;
663
+ /** Mark the input required. */
664
+ required?: boolean;
665
+ /** Force the invalid state without an `error` string. */
666
+ invalid?: boolean;
667
+ /** Form-control name. */
668
+ name?: string;
669
+ /** Autofill hint forwarded to the inner input (e.g. `email`, `current-password`). */
670
+ autocomplete?: string;
671
+ /** Virtual-keyboard hint forwarded to the inner input (e.g. `numeric`, `email`). */
672
+ inputmode?: string;
673
+ }
674
+
675
+ export interface KaiKbdElement extends HTMLElement {
676
+ /** Color mode (`auto` follows prefers-color-scheme). */
677
+ theme?: 'light' | 'dark' | 'auto';
678
+ /** 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. */
679
+ keys?: string;
680
+ /** `mac` uses ⌘/⌥, `other` uses Ctrl. `auto` (default) sniffs the OS. */
681
+ platform?: "other" | "auto" | "mac";
682
+ /** Cap size: `sm` or `md`. Defaults to `md`. */
683
+ size?: "sm" | "md";
684
+ }
685
+
334
686
  export interface KaiLinkPreviewElement extends HTMLElement {
335
687
  /** Color mode (`auto` follows prefers-color-scheme). */
336
688
  theme?: 'light' | 'dark' | 'auto';
@@ -346,7 +698,7 @@ export interface KaiLoaderElement extends HTMLElement {
346
698
  /** The animation style: `'circular' | 'classic' | 'pulse' | 'pulse-dot' | 'dots' | 'typing' | 'wave' | 'bars' | 'terminal' | 'text-blink' | 'text-shimmer' | 'loading-dots'`. Defaults to `'circular'`. */
347
699
  variant?: "circular" | "classic" | "pulse" | "pulse-dot" | "dots" | "typing" | "wave" | "bars" | "terminal" | "text-blink" | "text-shimmer" | "loading-dots";
348
700
  /** Loader size: `'sm' | 'md' | 'lg'`. Defaults to `'md'`. */
349
- size?: "sm" | "lg" | "md";
701
+ size?: "sm" | "md" | "lg";
350
702
  /** Label for the text-based variants. */
351
703
  text?: string;
352
704
  }
@@ -357,18 +709,41 @@ export interface KaiMarkdownElement extends HTMLElement {
357
709
  /** The markdown source to render. */
358
710
  content: string;
359
711
  /** Text/markdown sizing. */
360
- proseSize?: "xs" | "sm" | "base" | "lg";
712
+ proseSize?: "sm" | "lg" | "xs" | "base";
361
713
  /** Shiki theme for fenced code blocks. */
362
714
  codeTheme?: string;
363
715
  /** Disable syntax highlighting (no Shiki loads). */
364
716
  codeHighlight?: boolean;
365
717
  }
366
718
 
719
+ export interface KaiMenuElement extends HTMLElement {
720
+ /** Color mode (`auto` follows prefers-color-scheme). */
721
+ theme?: 'light' | 'dark' | 'auto';
722
+ /** Tree of menu items. Set as a JS property — not an HTML attribute. */
723
+ items?: { id?: string; label?: string; icon?: string; shortcut?: string; checked?: boolean; radioGroup?: string; disabled?: boolean; separator?: boolean; heading?: boolean; items?: Record<string, unknown>[] }[];
724
+ /** Optional placement hint (unused by the underlying Dropdown which always positions bottom-start, kept for future extension). */
725
+ placement?: string;
726
+ /** 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. */
727
+ triggerIcon?: string;
728
+ /** Built-in trigger: a text label (e.g. `"High"`). */
729
+ triggerLabel?: string;
730
+ /** Built-in trigger: a trailing icon (e.g. `"chevron-down"` for a select look). */
731
+ triggerIconTrailing?: string;
732
+ /** Accessible name for an icon-only trigger (no visible label). */
733
+ label?: string;
734
+ /** 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`. */
735
+ open?: boolean;
736
+ /** Initial open state on mount (uncontrolled seed). */
737
+ defaultOpen?: boolean;
738
+ /** Disable the trigger — click/keyboard and `show()` no longer open the menu. */
739
+ disabled?: boolean;
740
+ }
741
+
367
742
  export interface KaiMessageElement extends HTMLElement {
368
743
  /** Color mode (`auto` follows prefers-color-scheme). */
369
744
  theme?: 'light' | 'dark' | 'auto';
370
745
  /** The full message object. Set as a JS property. */
371
- 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 } };
746
+ 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" };
372
747
  /** Convenience for simple cases when not passing a `message` object. */
373
748
  role?: "user" | "assistant";
374
749
  /** Convenience content (used when `message` is not set). */
@@ -376,7 +751,7 @@ export interface KaiMessageElement extends HTMLElement {
376
751
  /** Force markdown on/off. Defaults to on for assistant, off for user. */
377
752
  markdown?: boolean;
378
753
  /** Text/markdown sizing for the message body. */
379
- proseSize?: "xs" | "sm" | "base" | "lg";
754
+ proseSize?: "sm" | "lg" | "xs" | "base";
380
755
  /** Shiki theme name used for fenced code blocks in the content. */
381
756
  codeTheme?: string;
382
757
  /** Disable syntax highlighting for code blocks (no Shiki loads). */
@@ -387,6 +762,8 @@ export interface KaiMessageElement extends HTMLElement {
387
762
  avatarSrc?: string;
388
763
  /** Convenience avatar fallback text (used when `message.avatar` is not set). */
389
764
  avatarFallback?: string;
765
+ /** 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). */
766
+ avatar?: string;
390
767
  }
391
768
 
392
769
  export interface KaiModelSwitcherElement extends HTMLElement {
@@ -396,6 +773,66 @@ export interface KaiModelSwitcherElement extends HTMLElement {
396
773
  models: { id: string; name: string; provider?: undefined | string; description?: undefined | string; group?: undefined | string }[];
397
774
  /** The currently-selected model id. Defaults to the first model. */
398
775
  currentModel?: string;
776
+ /** 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`. */
777
+ open?: boolean;
778
+ /** Initial open state on mount (uncontrolled seed). */
779
+ defaultOpen?: boolean;
780
+ /** Disable the trigger — click/keyboard and `show()` no longer open the dropdown. */
781
+ disabled?: boolean;
782
+ }
783
+
784
+ export interface KaiNavElement extends HTMLElement {
785
+ /** Color mode (`auto` follows prefers-color-scheme). */
786
+ theme?: 'light' | 'dark' | 'auto';
787
+ /** 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. */
788
+ 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 }[];
789
+ /** Active item id (controlled). */
790
+ value?: string;
791
+ /** Initial active id when uncontrolled. */
792
+ defaultValue?: string;
793
+ /** Ids of group items collapsed on first render (groups default to expanded). Set as a JS property (array). */
794
+ defaultCollapsed?: string[];
795
+ }
796
+
797
+ export interface KaiNoticeElement extends HTMLElement {
798
+ /** Color mode (`auto` follows prefers-color-scheme). */
799
+ theme?: 'light' | 'dark' | 'auto';
800
+ /** `neutral` (default) · `info` · `warning` · `error` · `success`. Drives the leading icon's color and the a11y role (`alert` for errors, else `status`). */
801
+ severity?: "error" | "info" | "success" | "warning" | "neutral";
802
+ /** Leading icon: omit for the severity default, `"none"` to hide it, or a named icon to override. */
803
+ icon?: string;
804
+ /** Show a dismiss (×) that hides the notice and emits `kai-dismiss`. */
805
+ dismissible?: boolean;
806
+ }
807
+
808
+ export interface KaiPaneElement extends HTMLElement {
809
+ /** Color mode (`auto` follows prefers-color-scheme). */
810
+ theme?: 'light' | 'dark' | 'auto';
811
+ /** The pane title (the agent / window name). Named `headline` because `title` collides with the global `HTMLElement.title` attribute (it throws at registration). Attribute: `headline`. */
812
+ headline?: string;
813
+ /** A role / label shown under the title (e.g. "Reviewer", "claude-sonnet"). Attribute: `subtitle`. */
814
+ subtitle?: string;
815
+ /** Show the restore glyph instead of maximize, and signal the maximized view-state. Drive it yourself in response to `kai-maximize`. Attribute: `maximized`. */
816
+ maximized?: boolean;
817
+ /** Highlight the frame with a ring/border to mark the ACTIVE pane. Attribute: `focused`. */
818
+ focused?: boolean;
819
+ /** Show a split-pane window control that fires `kai-split`. Off by default. Attribute: `show-split`. */
820
+ showSplit?: boolean;
821
+ /** Show a dock-to-side window control that fires `kai-dock`. Off by default. Attribute: `show-dock`. */
822
+ showDock?: boolean;
823
+ /** A tone-colored status dot (+ optional label) in the header. An object `{ tone, label?, pulse? }` set as a JS PROPERTY (not an attribute). */
824
+ status?: { tone: "working" | "idle" | "done" | "error" | "blocked"; label?: string; pulse?: boolean };
825
+ }
826
+
827
+ export interface KaiPaneGroupElement extends HTMLElement {
828
+ /** Color mode (`auto` follows prefers-color-scheme). */
829
+ theme?: 'light' | 'dark' | 'auto';
830
+ /** The tabs to render. An array of `{ id, name, status?, needsAttention?, number? }` set as a JS PROPERTY (not an HTML attribute). */
831
+ tabs?: { id: string; name: string; status?: { tone: "working" | "idle" | "done" | "error" | "blocked"; label?: string; pulse?: boolean }; needsAttention?: boolean; number?: number }[];
832
+ /** 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). */
833
+ active?: string;
834
+ /** Highlight the frame as the ACTIVE group in a multi-group layout. Attribute: `focused`. */
835
+ focused?: boolean;
399
836
  }
400
837
 
401
838
  export interface KaiPopoverElement extends HTMLElement {
@@ -405,15 +842,41 @@ export interface KaiPopoverElement extends HTMLElement {
405
842
  placement?: "top" | "right" | "bottom" | "left" | "top-start" | "top-end" | "right-start" | "right-end" | "bottom-start" | "bottom-end" | "left-start" | "left-end";
406
843
  /** Gap in px between the trigger and the panel. */
407
844
  gutter?: number;
408
- /** 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. */
845
+ /** 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`. */
409
846
  open?: boolean;
847
+ /** Initial open state on mount (uncontrolled seed). */
848
+ defaultOpen?: boolean;
849
+ /** Turn the popover off while keeping the trigger mounted (clicks and `show()` no longer open it). */
850
+ disabled?: boolean;
851
+ }
852
+
853
+ export interface KaiProgressBarElement extends HTMLElement {
854
+ /** Color mode (`auto` follows prefers-color-scheme). */
855
+ theme?: 'light' | 'dark' | 'auto';
856
+ /** Current progress value (0..max). Attribute: `value`. */
857
+ value?: number;
858
+ /** The value `value` runs to (default 100). Attribute: `max`. */
859
+ max?: number;
860
+ /** Optional caption above the track. Attribute: `label`. */
861
+ label?: string;
862
+ /** Fill color: `primary` (default), `success`, `warning`, `error`, `info`. Attribute: `tone`. */
863
+ tone?: string;
864
+ }
865
+
866
+ export interface KaiPromptDockElement extends HTMLElement {
867
+ /** Color mode (`auto` follows prefers-color-scheme). */
868
+ theme?: 'light' | 'dark' | 'auto';
869
+ /** 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`. */
870
+ frame?: "none" | "inset" | "edge";
871
+ /** 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`. */
872
+ appearance?: "outlined" | "filled" | "plain" | "soft";
410
873
  }
411
874
 
412
875
  export interface KaiPromptInputElement extends HTMLElement {
413
876
  /** Color mode (`auto` follows prefers-color-scheme). */
414
877
  theme?: 'light' | 'dark' | 'auto';
415
- /** 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. */
416
- value?: string;
878
+ /** 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`. */
879
+ value?: string | ({ type: "text"; text: string } | { type: "entity"; entity: { kind: string; id: string; label: string; icon?: string; promptText?: string; data?: Record<string, unknown> } })[];
417
880
  /** Placeholder text shown in the empty input. */
418
881
  placeholder?: string;
419
882
  /** Disable the input and submit button entirely (non-interactive). */
@@ -424,20 +887,22 @@ export interface KaiPromptInputElement extends HTMLElement {
424
887
  suggestions?: string[];
425
888
  /** What clicking a suggestion does: `'submit'` (default) sends it immediately as if typed and submitted; `'fill'` just places it in the input. */
426
889
  suggestionMode?: "submit" | "fill";
427
- /** Slash commands — when set, typing `/` opens the command palette. Set as a JS property. */
428
- slashCommands?: { id: string; label: string; description?: string; category?: string }[];
429
- /** Command ids to highlight as active. */
430
- slashActiveIds?: string[];
431
- /** Single-line palette rows. */
432
- slashCompact?: boolean;
433
890
  /** Show a Search (Globe) button in the left toolbar; clicking it fires a `search` event. */
434
891
  search?: boolean;
435
892
  /** Show a Voice (Mic) button in the left toolbar; clicking it fires a `voice` event. */
436
893
  voice?: boolean;
437
894
  /** 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`. */
438
895
  stoppable?: boolean;
896
+ /** 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. */
897
+ submit?: "always" | "auto";
898
+ /** 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`. */
899
+ attach?: boolean;
439
900
  /** 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). */
440
901
  attachments?: { id: string; type: "file" | "source-document"; filename?: string; mediaType?: string; url?: string; title?: string }[];
902
+ /** 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. */
903
+ triggers?: { char: string; kind: string; items?: { id: string; label: string; icon?: string; description?: string; group?: string; kind?: string; promptText?: string; data?: Record<string, unknown> }[] }[];
904
+ /** 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. */
905
+ kindIcons?: Record<string, string>;
441
906
  }
442
907
 
443
908
  export interface KaiReasoningElement extends HTMLElement {
@@ -447,12 +912,16 @@ export interface KaiReasoningElement extends HTMLElement {
447
912
  text: string;
448
913
  /** Trigger label. */
449
914
  label?: string;
450
- /** Controlled open state set as a property (`el.open = true`). Omit for uncontrolled (the trigger toggles it). */
915
+ /** 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`. */
451
916
  open?: boolean;
917
+ /** Initial open state on mount (uncontrolled seed). */
918
+ defaultOpen?: boolean;
452
919
  /** While true, auto-expands (and re-collapses when it flips false). */
453
920
  streaming?: boolean;
454
921
  /** Render `text` as markdown. */
455
922
  markdown?: boolean;
923
+ /** Gate the disclosure trigger — programmatic `show()/hide()/toggle()` still work, but the trigger click no longer toggles. */
924
+ disabled?: boolean;
456
925
  }
457
926
 
458
927
  export interface KaiRemoteElement extends HTMLElement {
@@ -472,7 +941,7 @@ export interface KaiResizableElement extends HTMLElement {
472
941
  /** Color mode (`auto` follows prefers-color-scheme). */
473
942
  theme?: 'light' | 'dark' | 'auto';
474
943
  /** Layout axis: `horizontal` (row, default) or `vertical` (column). */
475
- orientation?: "horizontal" | "vertical";
944
+ orientation?: "vertical" | "horizontal";
476
945
  /** Which item index is maximized (null = none). Declarative source of truth. */
477
946
  maximizedIndex?: null | number;
478
947
  }
@@ -490,6 +959,8 @@ export interface KaiResizableItemElement extends HTMLElement {
490
959
  locked?: boolean;
491
960
  /** Hide this panel; its divider is dropped and the rest reflow. */
492
961
  hidden?: boolean;
962
+ /** 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. */
963
+ collapsed?: boolean;
493
964
  }
494
965
 
495
966
  export interface KaiResponseStreamElement extends HTMLElement {
@@ -514,6 +985,34 @@ export interface KaiScopePickerElement extends HTMLElement {
514
985
  availableTags: string[];
515
986
  /** The label shown on the trigger for the active scope. */
516
987
  currentLabel?: string;
988
+ /** 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`. */
989
+ open?: boolean;
990
+ /** Initial open state on mount (uncontrolled seed). */
991
+ defaultOpen?: boolean;
992
+ /** Disable the trigger — click/keyboard and `show()` no longer open the dropdown. */
993
+ disabled?: boolean;
994
+ }
995
+
996
+ export interface KaiScreenElement extends HTMLElement {
997
+ /** Color mode (`auto` follows prefers-color-scheme). */
998
+ theme?: 'light' | 'dark' | 'auto';
999
+ /** 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`. */
1000
+ open?: boolean;
1001
+ /** Initial open state on mount (uncontrolled seed). */
1002
+ defaultOpen?: boolean;
1003
+ /** Header title text. A projected `title` slot overrides it. (Named `headline` because `title` collides with the global `HTMLElement.title` attribute.) */
1004
+ headline?: string;
1005
+ /** Show the back button (default true). */
1006
+ back?: boolean;
1007
+ /** Opt out of marking sibling elements inert/aria-hidden while open (for unusual layouts). */
1008
+ noInert?: boolean;
1009
+ }
1010
+
1011
+ export interface KaiScrollAreaElement extends HTMLElement {
1012
+ /** Color mode (`auto` follows prefers-color-scheme). */
1013
+ theme?: 'light' | 'dark' | 'auto';
1014
+ /** Which axis scrolls. `vertical` (default) · `horizontal` · `both`. The cross axis is clamped so content can't overflow it. */
1015
+ orientation?: "vertical" | "horizontal" | "both";
517
1016
  }
518
1017
 
519
1018
  export interface KaiScrollButtonElement extends HTMLElement {
@@ -522,9 +1021,75 @@ export interface KaiScrollButtonElement extends HTMLElement {
522
1021
  /** 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="...">`. */
523
1022
  for?: string;
524
1023
  /** Button visual variant: `'outline' | 'ghost' | 'default'`. Defaults to `'outline'`. */
525
- variant?: "ghost" | "default" | "outline";
1024
+ variant?: "default" | "ghost" | "outline";
526
1025
  /** Button size token. Defaults to `'icon'` (square). */
527
- size?: "sm" | "lg" | "md" | "icon" | "icon-sm";
1026
+ size?: "sm" | "md" | "lg" | "icon" | "icon-sm";
1027
+ }
1028
+
1029
+ export interface KaiSearchElement extends HTMLElement {
1030
+ /** Color mode (`auto` follows prefers-color-scheme). */
1031
+ theme?: 'light' | 'dark' | 'auto';
1032
+ /** Controlled query — settable and reflected to the `value` attribute. Read `el.value` for live state. */
1033
+ value?: string;
1034
+ /** Placeholder. Defaults to `Search…`. */
1035
+ placeholder?: string;
1036
+ /** 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`. */
1037
+ icon?: string;
1038
+ /** Debounce window for `kai-search`, in ms. Defaults to `200`. */
1039
+ debounce?: number;
1040
+ /** Show a spinner in place of the leading icon while results load. */
1041
+ loading?: boolean;
1042
+ /** 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. */
1043
+ shortcut?: string;
1044
+ }
1045
+
1046
+ export interface KaiSegmentedElement extends HTMLElement {
1047
+ /** Color mode (`auto` follows prefers-color-scheme). */
1048
+ theme?: 'light' | 'dark' | 'auto';
1049
+ /** The selectable segments, left to right. Set as a JS property (array). */
1050
+ options: { value: string; label: string; icon?: undefined | string }[];
1051
+ /** 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. */
1052
+ value?: string;
1053
+ /** Control density: `sm` or `md`. Defaults to `md`. */
1054
+ size?: "sm" | "md";
1055
+ }
1056
+
1057
+ export interface KaiSeparatorElement extends HTMLElement {
1058
+ /** Color mode (`auto` follows prefers-color-scheme). */
1059
+ theme?: 'light' | 'dark' | 'auto';
1060
+ /** `horizontal` (default, block + full-width) or `vertical` (a rule inside a flex/grid row — it stretches to the row height). */
1061
+ orientation?: "vertical" | "horizontal";
1062
+ }
1063
+
1064
+ export interface KaiSettingItemElement extends HTMLElement {
1065
+ /** Color mode (`auto` follows prefers-color-scheme). */
1066
+ theme?: 'light' | 'dark' | 'auto';
1067
+ /** Row label (primary text). Attribute: `label`. */
1068
+ label?: string;
1069
+ /** Optional secondary description under the label. Attribute: `description`. */
1070
+ description?: string;
1071
+ }
1072
+
1073
+ export interface KaiSettingsGroupElement extends HTMLElement {
1074
+ /** Color mode (`auto` follows prefers-color-scheme). */
1075
+ theme?: 'light' | 'dark' | 'auto';
1076
+ /** Small section heading shown above the card. Attribute: `heading`. */
1077
+ heading?: string;
1078
+ /** Optional muted description under the heading. Attribute: `description`. */
1079
+ description?: string;
1080
+ }
1081
+
1082
+ export interface KaiSkeletonElement extends HTMLElement {
1083
+ /** Color mode (`auto` follows prefers-color-scheme). */
1084
+ theme?: 'light' | 'dark' | 'auto';
1085
+ /** `text` (one or more lines), `rect` (a block), or `circle` (round). Defaults to `text`. */
1086
+ variant?: "text" | "rect" | "circle";
1087
+ /** CSS width (e.g. `'12rem'`, `'60%'`). Defaults to full width (responsive); for `circle` it is the diameter. */
1088
+ width?: string;
1089
+ /** CSS height. Defaults per variant (a text line height; circle = width). */
1090
+ height?: string;
1091
+ /** `text` only: number of lines; the last is shorter. Defaults to 1. */
1092
+ lines?: number;
528
1093
  }
529
1094
 
530
1095
  export interface KaiSkillsElement extends HTMLElement {
@@ -560,15 +1125,30 @@ export interface KaiSourcesElement extends HTMLElement {
560
1125
  numbered?: boolean;
561
1126
  }
562
1127
 
1128
+ export interface KaiStatusElement extends HTMLElement {
1129
+ /** Color mode (`auto` follows prefers-color-scheme). */
1130
+ theme?: 'light' | 'dark' | 'auto';
1131
+ /** Presence/notification state → color. `new` (default) maps to the blue hue. */
1132
+ status?: "new" | "online" | "busy" | "away" | "offline";
1133
+ /** Animated ping ring (off by default; respects prefers-reduced-motion). */
1134
+ pulse?: boolean;
1135
+ /** Accessible name. Without it the dot is decorative. */
1136
+ label?: string;
1137
+ /** `sm` (default) or `md`. */
1138
+ size?: "sm" | "md";
1139
+ }
1140
+
563
1141
  export interface KaiSuggestionsElement extends HTMLElement {
564
1142
  /** Color mode (`auto` follows prefers-color-scheme). */
565
1143
  theme?: 'light' | 'dark' | 'auto';
566
1144
  /** The suggestions. Strings, or `{ label, value }` when the displayed text and the emitted value differ. Set as a JS property. */
567
- suggestions: (string | { label: string; value?: undefined | string })[];
1145
+ suggestions: (string | { label: string; value?: undefined | string; icon?: undefined | string })[];
568
1146
  /** Chip style: `'outline'` (default), `'ghost'`, or `'default'` (filled). */
569
- variant?: "ghost" | "default" | "outline";
570
- /** Size preset for each chip. Defaults to the pill default (`'lg'`); pass `'sm'` for smaller pills (or `'md'`). */
571
- size?: "sm" | "lg" | "md" | "icon" | "icon-sm";
1147
+ variant?: "default" | "ghost" | "outline";
1148
+ /** Row height for `layout="list"`: `'md'` (default) or `'lg'` for taller rows. Chips are unaffected. */
1149
+ size?: "md" | "lg";
1150
+ /** 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. */
1151
+ layout?: "list" | "chips";
572
1152
  /** Full-width left-aligned rows instead of pills. */
573
1153
  block?: boolean;
574
1154
  /** Substring to highlight within each suggestion. */
@@ -578,12 +1158,35 @@ export interface KaiSuggestionsElement extends HTMLElement {
578
1158
  export interface KaiSwitchElement extends HTMLElement {
579
1159
  /** Color mode (`auto` follows prefers-color-scheme). */
580
1160
  theme?: 'light' | 'dark' | 'auto';
581
- /** Initial checked state. Bare attribute (`<kai-switch checked>`) turns it on. */
1161
+ /** 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. */
582
1162
  checked?: boolean;
1163
+ /** Initial checked state on mount (uncontrolled seed). Bare attribute (`<kai-switch default-checked>`) turns it on. */
1164
+ defaultChecked?: boolean;
583
1165
  /** Disable interaction. */
584
1166
  disabled?: boolean;
585
1167
  /** Accessible label. */
586
1168
  label?: string;
1169
+ /** Form-control name (paired with `value`). */
1170
+ name?: string;
1171
+ /** Submitted value when checked (paired with `name`). Defaults to `'on'`. */
1172
+ value?: string;
1173
+ }
1174
+
1175
+ export interface KaiTabsElement extends HTMLElement {
1176
+ /** Color mode (`auto` follows prefers-color-scheme). */
1177
+ theme?: 'light' | 'dark' | 'auto';
1178
+ /** Tabs to render. Set as a JS property, not an HTML attribute. */
1179
+ items?: { id: string; label?: string; icon?: string; disabled?: boolean }[];
1180
+ /** 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. */
1181
+ value?: string;
1182
+ /** Initial selected id when uncontrolled (use the `default-value` attribute in plain HTML). */
1183
+ defaultValue?: string;
1184
+ /** `segmented` (default, a pill group) or `underline` (an underlined row). */
1185
+ variant?: "segmented" | "underline";
1186
+ /** Stretch the strip to full width, each tab sharing the space equally. */
1187
+ block?: boolean;
1188
+ /** Disable the whole strip. */
1189
+ disabled?: boolean;
587
1190
  }
588
1191
 
589
1192
  export interface KaiTasksElement extends HTMLElement {
@@ -597,6 +1200,14 @@ export interface KaiTasksElement extends HTMLElement {
597
1200
  heading?: string;
598
1201
  /** Set when the user resolved this card; renders the read-only view. Property: `el.resolution = { kind:'submit', data:{ selected:[…] } }`. */
599
1202
  resolution?: Record<string, unknown>;
1203
+ /** Controlled selection (task ids; JS property). When set, it wins over local state. */
1204
+ value?: string[];
1205
+ /** Uncontrolled initial selection (task ids; JS property), overlaying per-task `checked`. */
1206
+ defaultValue?: string[];
1207
+ /** Freeze the whole list + Confirm. Attribute: `disabled`. */
1208
+ disabled?: boolean;
1209
+ /** 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`. */
1210
+ readonly?: boolean;
600
1211
  }
601
1212
 
602
1213
  export interface KaiTextShimmerElement extends HTMLElement {
@@ -623,13 +1234,55 @@ export interface KaiThinkingBarElement extends HTMLElement {
623
1234
  stopLabel?: string;
624
1235
  }
625
1236
 
1237
+ export interface KaiToastRegionElement extends HTMLElement {
1238
+ /** Color mode (`auto` follows prefers-color-scheme). */
1239
+ theme?: 'light' | 'dark' | 'auto';
1240
+ /** The toasts to render. Newest is shown on top. Set as a JS property (array); pass a new array reference to update. */
1241
+ 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 }[];
1242
+ /** Stack anchor: `'top-center'` (default), `'top-right'`, `'bottom-center'`, … */
1243
+ position?: "top-center" | "top-right" | "top-left" | "bottom-center" | "bottom-right" | "bottom-left";
1244
+ /** Max simultaneously-visible toasts; the rest queue. Defaults to `3`. */
1245
+ max?: number;
1246
+ /** Stacking: 'expanded' (default, full column) | 'collapsed' (Sonner-style pile that expands on hover/focus). Attribute: stack. */
1247
+ stack?: "expanded" | "collapsed";
1248
+ /** Default appearance for this region's toasts: `'pill'` (default, compact) | `'card'` (richer, with a description line). A per-toast `appearance` wins. Attribute: `appearance`. */
1249
+ appearance?: "pill" | "card";
1250
+ /** Default high-contrast inverse treatment for this region's toasts. A per-toast `inverse` wins. Off by default. Attribute: `inverse`. */
1251
+ inverse?: boolean;
1252
+ /** Container element to anchor this region to (JS property). Set by the store for a scoped region; unset = the global viewport region. */
1253
+ target?: HTMLElement;
1254
+ }
1255
+
626
1256
  export interface KaiToolElement extends HTMLElement {
627
1257
  /** Color mode (`auto` follows prefers-color-scheme). */
628
1258
  theme?: 'light' | 'dark' | 'auto';
629
1259
  /** The tool-call to display. Set as a JS property. */
630
1260
  tool?: { type: string; state: "input-streaming" | "input-available" | "output-available" | "output-error"; input?: Record<string, unknown>; output?: Record<string, unknown>; toolCallId?: string; errorText?: string };
631
- /** Start expanded. */
1261
+ /** 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`. */
632
1262
  open?: boolean;
1263
+ /** Initial open state on mount (uncontrolled seed). */
1264
+ defaultOpen?: boolean;
1265
+ /** Gate the disclosure trigger — programmatic `show()/hide()/toggle()` still work, but the trigger click no longer toggles. */
1266
+ disabled?: boolean;
1267
+ }
1268
+
1269
+ export interface KaiTooltipElement extends HTMLElement {
1270
+ /** Color mode (`auto` follows prefers-color-scheme). */
1271
+ theme?: 'light' | 'dark' | 'auto';
1272
+ /** The hint text shown on hover/focus of the slotted trigger. */
1273
+ content?: string;
1274
+ /** Delay (ms) before the tooltip appears on hover. Defaults to 600. Focus shows it immediately regardless. */
1275
+ openDelay?: number;
1276
+ /** Delay (ms) before it hides after the pointer leaves. Defaults to 0 (hides immediately). */
1277
+ closeDelay?: number;
1278
+ /** Preferred placement: `'top' | 'bottom' | 'left' | 'right'` (+ optional `-start`/`-end`). Defaults to `'top'`; flips to stay in view. */
1279
+ placement?: string;
1280
+ /** 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`. */
1281
+ open?: boolean;
1282
+ /** Initial open state on mount (uncontrolled seed). */
1283
+ defaultOpen?: boolean;
1284
+ /** Turn the tooltip off while keeping the trigger mounted (hover/focus and `show()` no longer open it). */
1285
+ disabled?: boolean;
633
1286
  }
634
1287
 
635
1288
  export interface KaiVoiceInputElement extends HTMLElement {
@@ -639,6 +1292,23 @@ export interface KaiVoiceInputElement extends HTMLElement {
639
1292
  transcribe?: (audio: Blob) => Promise<string>;
640
1293
  /** Disable the mic button (non-interactive). */
641
1294
  disabled?: boolean;
1295
+ /** 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. */
1296
+ recognitionLang?: string;
1297
+ /** Emit live partial transcripts (`kai-transcript-interim`) during native recognition. Attribute: `interim`. No-op on the transcribe/fallback paths. */
1298
+ interim?: boolean;
1299
+ }
1300
+
1301
+ export interface KaiVoiceOutputElement extends HTMLElement {
1302
+ /** Color mode (`auto` follows prefers-color-scheme). */
1303
+ theme?: 'light' | 'dark' | 'auto';
1304
+ /** The utterance to read aloud. */
1305
+ text?: string;
1306
+ /** Speak automatically when `text` is set/changed. */
1307
+ autoplay?: boolean;
1308
+ /** 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. */
1309
+ synthesize?: (text: string) => Promise<Blob>;
1310
+ /** Disable the button (non-interactive). */
1311
+ disabled?: boolean;
642
1312
  }
643
1313
 
644
1314
  export interface KaiWorkspaceElement extends HTMLElement {
@@ -647,17 +1317,17 @@ export interface KaiWorkspaceElement extends HTMLElement {
647
1317
  /** Pre-bucketed conversation groups for the sidebar. Set as a JS property. */
648
1318
  groups: { id: string; userId?: undefined | string; teamId?: undefined | string; name: string; sortOrder: number; createdAt: string }[];
649
1319
  /** Flat conversation list (auto-bucketed if `groups` is empty). Set as a JS property. */
650
- 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 }[];
1320
+ 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 }[];
651
1321
  /** Id of the open conversation, highlighted in the sidebar. */
652
1322
  activeId?: string;
653
1323
  /** The active conversation's message thread, newest last. Set as a JS property. */
654
- 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 } }[];
1324
+ 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" }[];
655
1325
  value?: string;
656
1326
  placeholder?: string;
657
1327
  loading?: boolean;
658
1328
  suggestions?: string[];
659
1329
  suggestionMode?: "submit" | "fill";
660
- proseSize?: "xs" | "sm" | "base" | "lg";
1330
+ proseSize?: "sm" | "lg" | "xs" | "base";
661
1331
  codeTheme?: string;
662
1332
  codeHighlight?: boolean;
663
1333
  chatTitle?: string;
@@ -667,12 +1337,13 @@ export interface KaiWorkspaceElement extends HTMLElement {
667
1337
  scrollButton?: boolean;
668
1338
  search?: boolean;
669
1339
  voice?: boolean;
670
- slashCommands?: { id: string; label: string; description?: string; category?: string }[];
671
- slashActiveIds?: string[];
672
- slashCompact?: boolean;
673
- /** Sidebar default width as a percent of the workspace (default 22). */
1340
+ /** Rich entity triggers (`/` skills, `@` agents/plugins) forwarded to the input. */
1341
+ triggers?: { char: string; kind: string; items?: { id: string; label: string; icon?: string; description?: string; group?: string; kind?: string; promptText?: string; data?: Record<string, unknown> }[] }[];
1342
+ /** Default icon per entity kind (kind → image src) forwarded to the input. */
1343
+ kindIcons?: Record<string, string>;
1344
+ /** Sidebar default width as a percent of the workspace (default 26). */
674
1345
  sidebarWidth?: number;
675
- /** Sidebar min width in px (default 200). */
1346
+ /** Sidebar min width in px (default 240). */
676
1347
  sidebarMinWidth?: number;
677
1348
  /** Sidebar max width in px (default 420). */
678
1349
  sidebarMaxWidth?: number;
@@ -680,35 +1351,62 @@ export interface KaiWorkspaceElement extends HTMLElement {
680
1351
  sidebarCollapsed?: boolean;
681
1352
  /** Initial collapsed state when uncontrolled (default false). Use the `default-sidebar-collapsed` attribute to start collapsed in plain HTML. */
682
1353
  defaultSidebarCollapsed?: boolean;
1354
+ /** 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`. */
1355
+ collapseBelow?: number;
1356
+ /** Render Recents as dense single-line rows (a leading dot + title, no count). */
1357
+ compact?: boolean;
1358
+ /** 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`. */
1359
+ noConversations?: boolean;
683
1360
  }
684
1361
 
685
1362
  declare global {
686
1363
  interface HTMLElementTagNameMap {
1364
+ 'kai-agent-card': KaiAgentCardElement;
687
1365
  'kai-artifact': KaiArtifactElement;
688
1366
  'kai-attachments': KaiAttachmentsElement;
1367
+ 'kai-avatar': KaiAvatarElement;
1368
+ 'kai-badge': KaiBadgeElement;
1369
+ 'kai-button': KaiButtonElement;
689
1370
  'kai-card': KaiCardElement;
690
1371
  'kai-cards': KaiCardsElement;
691
1372
  'kai-chain-of-thought': KaiChainOfThoughtElement;
692
1373
  'kai-chat': KaiChatElement;
693
1374
  'kai-checkpoint': KaiCheckpointElement;
694
1375
  'kai-choice': KaiChoiceElement;
1376
+ 'kai-coachmark': KaiCoachmarkElement;
695
1377
  'kai-code-block': KaiCodeBlockElement;
1378
+ 'kai-command': KaiCommandElement;
1379
+ 'kai-compare': KaiCompareElement;
1380
+ 'kai-composer': KaiComposerElement;
696
1381
  'kai-confirm': KaiConfirmElement;
697
1382
  'kai-context': KaiContextElement;
698
1383
  'kai-conversations': KaiConversationsElement;
1384
+ 'kai-dialog': KaiDialogElement;
1385
+ 'kai-editable-label': KaiEditableLabelElement;
699
1386
  'kai-embed': KaiEmbedElement;
700
1387
  'kai-empty': KaiEmptyElement;
701
1388
  'kai-feedback-bar': KaiFeedbackBarElement;
702
1389
  'kai-file-tree': KaiFileTreeElement;
703
1390
  'kai-file-upload': KaiFileUploadElement;
704
1391
  'kai-form': KaiFormElement;
1392
+ 'kai-hover-card': KaiHoverCardElement;
1393
+ 'kai-icon': KaiIconElement;
705
1394
  'kai-image': KaiImageElement;
1395
+ 'kai-input': KaiInputElement;
1396
+ 'kai-kbd': KaiKbdElement;
706
1397
  'kai-link-preview': KaiLinkPreviewElement;
707
1398
  'kai-loader': KaiLoaderElement;
708
1399
  'kai-markdown': KaiMarkdownElement;
1400
+ 'kai-menu': KaiMenuElement;
709
1401
  'kai-message': KaiMessageElement;
710
1402
  'kai-model-switcher': KaiModelSwitcherElement;
1403
+ 'kai-nav': KaiNavElement;
1404
+ 'kai-notice': KaiNoticeElement;
1405
+ 'kai-pane': KaiPaneElement;
1406
+ 'kai-pane-group': KaiPaneGroupElement;
711
1407
  'kai-popover': KaiPopoverElement;
1408
+ 'kai-progress-bar': KaiProgressBarElement;
1409
+ 'kai-prompt-dock': KaiPromptDockElement;
712
1410
  'kai-prompt-input': KaiPromptInputElement;
713
1411
  'kai-reasoning': KaiReasoningElement;
714
1412
  'kai-remote': KaiRemoteElement;
@@ -716,17 +1414,30 @@ declare global {
716
1414
  'kai-resizable-item': KaiResizableItemElement;
717
1415
  'kai-response-stream': KaiResponseStreamElement;
718
1416
  'kai-scope-picker': KaiScopePickerElement;
1417
+ 'kai-screen': KaiScreenElement;
1418
+ 'kai-scroll-area': KaiScrollAreaElement;
719
1419
  'kai-scroll-button': KaiScrollButtonElement;
1420
+ 'kai-search': KaiSearchElement;
1421
+ 'kai-segmented': KaiSegmentedElement;
1422
+ 'kai-separator': KaiSeparatorElement;
1423
+ 'kai-setting-item': KaiSettingItemElement;
1424
+ 'kai-settings-group': KaiSettingsGroupElement;
1425
+ 'kai-skeleton': KaiSkeletonElement;
720
1426
  'kai-skills': KaiSkillsElement;
721
1427
  'kai-source': KaiSourceElement;
722
1428
  'kai-sources': KaiSourcesElement;
1429
+ 'kai-status': KaiStatusElement;
723
1430
  'kai-suggestions': KaiSuggestionsElement;
724
1431
  'kai-switch': KaiSwitchElement;
1432
+ 'kai-tabs': KaiTabsElement;
725
1433
  'kai-tasks': KaiTasksElement;
726
1434
  'kai-text-shimmer': KaiTextShimmerElement;
727
1435
  'kai-thinking-bar': KaiThinkingBarElement;
1436
+ 'kai-toast-region': KaiToastRegionElement;
728
1437
  'kai-tool': KaiToolElement;
1438
+ 'kai-tooltip': KaiTooltipElement;
729
1439
  'kai-voice-input': KaiVoiceInputElement;
1440
+ 'kai-voice-output': KaiVoiceOutputElement;
730
1441
  'kai-workspace': KaiWorkspaceElement;
731
1442
  }
732
1443
  }