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