@kitn.ai/ui 0.20.1 → 0.22.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 (510) hide show
  1. package/README.md +44 -45
  2. package/dist/components/artifact-card.d.ts +51 -0
  3. package/dist/components/artifact.d.ts +1 -1
  4. package/dist/components/attachments.d.ts +2 -2
  5. package/dist/components/audio-visualizer/index.d.ts +3 -3
  6. package/dist/components/audio-visualizer/labs/lab-choreography.d.ts +59 -0
  7. package/dist/components/audio-visualizer/labs/lab-shaders.d.ts +22 -0
  8. package/dist/components/audio-visualizer/labs/lab-visualizer.d.ts +18 -0
  9. package/dist/components/audio-visualizer/variant-aurora.d.ts +2 -2
  10. package/dist/components/audio-visualizer/variant-bar.d.ts +2 -2
  11. package/dist/components/audio-visualizer/variant-custom.d.ts +2 -2
  12. package/dist/components/audio-visualizer/variant-grid.d.ts +1 -1
  13. package/dist/components/audio-visualizer/variant-radial.d.ts +1 -1
  14. package/dist/components/audio-visualizer/variant-wave.d.ts +1 -1
  15. package/dist/components/card-fallback.d.ts +12 -2
  16. package/dist/components/card-renderer.d.ts +63 -2
  17. package/dist/components/chat-container.d.ts +3 -0
  18. package/dist/components/chat-scope-picker.d.ts +2 -2
  19. package/dist/components/chat-thread.d.ts +77 -18
  20. package/dist/components/choice-card.d.ts +3 -28
  21. package/dist/components/composer-dom.d.ts +1 -1
  22. package/dist/components/composer-highlight.d.ts +1 -1
  23. package/dist/components/composer-history.d.ts +1 -1
  24. package/dist/components/composer.d.ts +1 -1
  25. package/dist/components/confirm-card.d.ts +3 -18
  26. package/dist/components/context.d.ts +8 -4
  27. package/dist/components/conversation-item.d.ts +1 -1
  28. package/dist/components/conversation-list.d.ts +4 -3
  29. package/dist/components/embed.d.ts +3 -3
  30. package/dist/components/file-tree.d.ts +11 -22
  31. package/dist/components/form-widgets.d.ts +1 -1
  32. package/dist/components/form.d.ts +3 -44
  33. package/dist/components/link-preview.d.ts +3 -3
  34. package/dist/components/loader.d.ts +30 -48
  35. package/dist/components/message-skills.d.ts +4 -0
  36. package/dist/components/message.d.ts +84 -21
  37. package/dist/components/model-switcher.d.ts +2 -2
  38. package/dist/components/prompt-input.d.ts +2 -2
  39. package/dist/components/response-compare-types.d.ts +11 -2
  40. package/dist/components/response-compare.d.ts +3 -3
  41. package/dist/components/source.d.ts +12 -3
  42. package/dist/components/tasks-card.d.ts +3 -31
  43. package/dist/components/thread.d.ts +17 -5
  44. package/dist/components/toast.d.ts +2 -2
  45. package/dist/components/tool-classify.d.ts +8 -0
  46. package/dist/components/tool-types.d.ts +29 -1
  47. package/dist/components/tool.d.ts +3 -3
  48. package/dist/components/use-card-resolution.d.ts +1 -1
  49. package/dist/create-tween-COnPwAQN.js +338 -0
  50. package/dist/create-tween-DmTUaXWE.js +341 -0
  51. package/dist/create-tween-qs-jjvNA.js +7 -0
  52. package/dist/custom-elements.json +1726 -463
  53. package/dist/elements/agent-card.js +1 -1
  54. package/dist/elements/artifact.js +1 -1
  55. package/dist/elements/attachments.js +1 -1
  56. package/dist/elements/audio-visualizer.js +1 -1
  57. package/dist/elements/avatar.js +1 -1
  58. package/dist/elements/badge.js +1 -1
  59. package/dist/elements/button.js +1 -1
  60. package/dist/elements/card.js +1 -1
  61. package/dist/elements/cards.js +1 -1
  62. package/dist/elements/chain-of-thought.js +1 -1
  63. package/dist/elements/chat-scope-picker.js +1 -1
  64. package/dist/elements/chat-types.d.ts +70 -10
  65. package/dist/elements/chat-workspace.js +1 -1
  66. package/dist/elements/chat.js +1 -1
  67. package/dist/elements/checkpoint.js +1 -1
  68. package/dist/elements/choice.js +1 -1
  69. package/dist/elements/chunks/{Icon-Tj58ES_d.js → Icon-CHG5z5L7.js} +1 -1
  70. package/dist/elements/chunks/{action-icons-ns1Fnedj.js → action-icons-BAtCEEgg.js} +1 -1
  71. package/dist/elements/chunks/arrow-left-CFPTeL1Y.js +1 -0
  72. package/dist/elements/chunks/artifact-fBZOE4SO.js +1 -0
  73. package/dist/elements/chunks/{attachments-mCB5F1Fq.js → attachments-DpYMe5VQ.js} +1 -1
  74. package/dist/elements/chunks/audio-visualizer-DFwzAcuL.js +1 -0
  75. package/dist/elements/chunks/{badge-B4Zuajl2.js → badge-D6zodm6E.js} +1 -1
  76. package/dist/elements/chunks/{button-ZWNif3--.js → button-C42vrGvO.js} +1 -1
  77. package/dist/elements/chunks/card-renderer-DMZsSuvU.js +1 -0
  78. package/dist/elements/chunks/card-tags-D8lZ-C_U.js +1 -0
  79. package/dist/elements/chunks/chat-thread-CNNEhol-.js +1 -0
  80. package/dist/elements/chunks/check-7Q3K-iXE.js +1 -0
  81. package/dist/elements/chunks/chevron-down-CpNYLn7E.js +1 -0
  82. package/dist/elements/chunks/chevron-right-DrH85Fha.js +1 -0
  83. package/dist/elements/chunks/choice-card-YoWjpsFV.js +1 -0
  84. package/dist/elements/chunks/circle-C9KRjKYv.js +1 -0
  85. package/dist/elements/chunks/circle-check-Dmi7Y4zw.js +1 -0
  86. package/dist/elements/chunks/{circle-x-B7faJFlY.js → circle-x-QIxXda6k.js} +1 -1
  87. package/dist/elements/chunks/code-block-CqeugReY.js +1 -0
  88. package/dist/elements/chunks/{collapsible-DM1Ckd4e.js → collapsible-sTv-_5lF.js} +1 -1
  89. package/dist/elements/chunks/{composer-BguS0QL_.js → composer-ldQyeVEB.js} +2 -2
  90. package/dist/elements/chunks/confirm-card-C0RNOwfn.js +1 -0
  91. package/dist/elements/chunks/context-5qgypNHC.js +1 -0
  92. package/dist/elements/chunks/conversation-list-DLzOacXz.js +1 -0
  93. package/dist/elements/chunks/create-tween-V4TXZ93X.js +7 -0
  94. package/dist/elements/chunks/default-input-DeeRSDHc.js +1 -0
  95. package/dist/elements/chunks/define-lE-QvQFn.js +1 -0
  96. package/dist/elements/chunks/{disclosure-CIZ5c8nO.js → disclosure-DZSa9jog.js} +1 -1
  97. package/dist/elements/chunks/{download-Dsbg3ste.js → download-B2ZmnGqW.js} +1 -1
  98. package/dist/elements/chunks/{dropdown-BDd1-Zgi.js → dropdown-R3B7cSRE.js} +1 -1
  99. package/dist/elements/chunks/{ellipsis-Dw6qrss-.js → ellipsis-BmxceY4l.js} +1 -1
  100. package/dist/elements/chunks/embed-BVrtTZPo.js +1 -0
  101. package/dist/elements/chunks/{external-link-Vt74zAoL.js → external-link-BbdR7YO7.js} +1 -1
  102. package/dist/elements/chunks/{file-text-CZrZF6_v.js → file-text-D7dijo1A.js} +1 -1
  103. package/dist/elements/chunks/{file-tree-DF4okKyo.js → file-tree-0upJ5jeb.js} +1 -1
  104. package/dist/elements/chunks/{folder-glP5rha4.js → folder-D8z58t7B.js} +1 -1
  105. package/dist/elements/chunks/form-p5BKJNw5.js +1 -0
  106. package/dist/elements/chunks/hover-card-CN9s2md5.js +1 -0
  107. package/dist/elements/chunks/{icon-BLb8beoi.js → icon-CNiKP37E.js} +1 -1
  108. package/dist/elements/chunks/{info-CIsv92JK.js → info-BSnuJiHI.js} +1 -1
  109. package/dist/elements/chunks/{input-Dds1kFyt.js → input-BauDmzxX.js} +1 -1
  110. package/dist/elements/chunks/{kbd-De_xbgi9.js → kbd-BlHJaP9b.js} +1 -1
  111. package/dist/elements/chunks/{link-i4r_k7z4.js → link-DEi5iUWC.js} +1 -1
  112. package/dist/elements/chunks/link-preview-BaHyM6W4.js +1 -0
  113. package/dist/elements/chunks/{loader-BmQH4s3V.js → loader-CmJG_Fkq.js} +1 -1
  114. package/dist/elements/chunks/{markdown-Zi21WhUz.js → markdown-D2jaMpCN.js} +1 -1
  115. package/dist/elements/chunks/message-C5UfXZ2Z.js +1 -0
  116. package/dist/elements/chunks/message-CXWLmmLn.js +1 -0
  117. package/dist/elements/chunks/message-square-hXylwsy0.js +1 -0
  118. package/dist/elements/chunks/{minimize-2--ifeCGrl.js → minimize-2-C9ytZFMU.js} +1 -1
  119. package/dist/elements/chunks/model-switcher-CivGfD7-.js +1 -0
  120. package/dist/elements/chunks/{overlay-kD8dwRv_.js → overlay-DJL_sbOm.js} +1 -1
  121. package/dist/elements/chunks/{paperclip-q21dYOSK.js → paperclip-CFaB8naM.js} +1 -1
  122. package/dist/elements/chunks/{progress-bar-BrAIIaaJ.js → progress-bar-Br5SksfR.js} +1 -1
  123. package/dist/elements/chunks/{prompt-suggestion-Bjn2K-fR.js → prompt-suggestion-CMIvtAhU.js} +1 -1
  124. package/dist/elements/chunks/reasoning-DpZcNzLq.js +1 -0
  125. package/dist/elements/chunks/{resizable-Dp4JExql.js → resizable-Q8i3T9a_.js} +1 -1
  126. package/dist/elements/chunks/{rotate-cw-CFWWkpj2.js → rotate-cw-B5IHCBFV.js} +1 -1
  127. package/dist/elements/chunks/{scroll-area-Bb0kHH1j.js → scroll-area-eLeydBje.js} +1 -1
  128. package/dist/elements/chunks/scroll-button-DWbz0yA1.js +1 -0
  129. package/dist/elements/chunks/{separator-9kRgr1X9.js → separator-Xic78AD_.js} +1 -1
  130. package/dist/elements/chunks/{settings-B8lmec4D.js → settings-B8H51pAx.js} +1 -1
  131. package/dist/elements/chunks/{settings-group-I0hEuXiN.js → settings-group-CsG9eYLe.js} +1 -1
  132. package/dist/elements/chunks/{share-C3lTiYGt.js → share-CNTx0z__.js} +1 -1
  133. package/dist/elements/chunks/skeleton-CLlHTcMI.js +1 -0
  134. package/dist/elements/chunks/slots-CIw9RlAe.js +1 -0
  135. package/dist/elements/chunks/source-BoVcU5ok.js +1 -0
  136. package/dist/elements/chunks/{star-CSJtGxgv.js → star-CxQVTVhI.js} +1 -1
  137. package/dist/elements/chunks/{store-CHyW95TP.js → store-CLtS5CUG.js} +1 -1
  138. package/dist/elements/chunks/tasks-card-CzlkLmUt.js +1 -0
  139. package/dist/elements/chunks/{text-shimmer-Cn9TmNpI.js → text-shimmer-D5NhpIQ1.js} +1 -1
  140. package/dist/elements/chunks/textarea-x5Uxsmtm.js +1 -0
  141. package/dist/elements/chunks/{thumbs-up-PNVVThEF.js → thumbs-up-UobcJnx9.js} +1 -1
  142. package/dist/elements/chunks/{toast-store-DKbQn3Wn.js → toast-store-BOfs9eXq.js} +1 -1
  143. package/dist/elements/chunks/{tool-DjTRpIpl.js → tool-Be6Dh_dt.js} +1 -1
  144. package/dist/elements/chunks/tooltip-RxMxyCLF.js +1 -0
  145. package/dist/elements/chunks/{triangle-alert-DsHTHCPm.js → triangle-alert-C4yxH2XN.js} +1 -1
  146. package/dist/elements/chunks/use-card-resolution-jva9ehH6.js +1 -0
  147. package/dist/elements/chunks/{variant-aurora-Dc4nQUia.js → variant-aurora-Dx4VRcjS.js} +2 -2
  148. package/dist/elements/chunks/{variant-custom-y_3kVQhS.js → variant-custom-Y1ZTWgEa.js} +1 -1
  149. package/dist/elements/chunks/{variant-wave-D5OR1-9Z.js → variant-wave-B9gml9Cg.js} +2 -2
  150. package/dist/elements/chunks/{video-B7vmenoC.js → video-CrPHsytT.js} +1 -1
  151. package/dist/elements/chunks/x-_-OPHept.js +1 -0
  152. package/dist/elements/coachmark.js +1 -1
  153. package/dist/elements/code-block.js +1 -1
  154. package/dist/elements/command.js +1 -1
  155. package/dist/elements/compare.js +1 -1
  156. package/dist/elements/composer.js +1 -1
  157. package/dist/elements/confirm-card.js +1 -1
  158. package/dist/elements/context-meter.js +1 -1
  159. package/dist/elements/conversation-list.js +1 -1
  160. package/dist/elements/default-input.d.ts +34 -7
  161. package/dist/elements/define.d.ts +1 -0
  162. package/dist/elements/dialog.js +1 -1
  163. package/dist/elements/disclosure.d.ts +1 -1
  164. package/dist/elements/editable-label.js +1 -1
  165. package/dist/elements/element-data-types.d.ts +107 -0
  166. package/dist/elements/embed.js +1 -1
  167. package/dist/elements/empty.js +1 -1
  168. package/dist/elements/feedback-bar.js +1 -1
  169. package/dist/elements/file-tree.js +1 -1
  170. package/dist/elements/file-upload.js +1 -1
  171. package/dist/elements/form.js +1 -1
  172. package/dist/elements/hover-card.js +1 -1
  173. package/dist/elements/icon.js +1 -1
  174. package/dist/elements/image.js +1 -1
  175. package/dist/elements/input.js +1 -1
  176. package/dist/elements/kbd.js +1 -1
  177. package/dist/elements/link-preview.js +1 -1
  178. package/dist/elements/loader.js +1 -1
  179. package/dist/elements/markdown.js +1 -1
  180. package/dist/elements/menu.js +1 -1
  181. package/dist/elements/message-skills.js +1 -1
  182. package/dist/elements/message.js +1 -1
  183. package/dist/elements/model-switcher.js +1 -1
  184. package/dist/elements/nav.js +1 -1
  185. package/dist/elements/notice.js +1 -1
  186. package/dist/elements/pane-group.js +1 -1
  187. package/dist/elements/pane.js +1 -1
  188. package/dist/elements/popover.js +1 -1
  189. package/dist/elements/progress-bar.js +1 -1
  190. package/dist/elements/prompt-dock.js +1 -1
  191. package/dist/elements/prompt-input.js +1 -1
  192. package/dist/elements/prompt-suggestions.js +1 -1
  193. package/dist/elements/reasoning.js +1 -1
  194. package/dist/elements/register.d.ts +8 -6
  195. package/dist/elements/remote.js +1 -1
  196. package/dist/elements/resizable.js +1 -1
  197. package/dist/elements/response-stream.js +1 -1
  198. package/dist/elements/screen.js +1 -1
  199. package/dist/elements/scroll-area.js +1 -1
  200. package/dist/elements/scroll-button.js +1 -1
  201. package/dist/elements/search.js +1 -1
  202. package/dist/elements/segmented.js +1 -1
  203. package/dist/elements/separator.js +1 -1
  204. package/dist/elements/setting-item.js +1 -1
  205. package/dist/elements/settings-group.js +1 -1
  206. package/dist/elements/skeleton.js +1 -1
  207. package/dist/elements/slot-text.d.ts +51 -0
  208. package/dist/elements/slots.d.ts +21 -0
  209. package/dist/elements/source.js +1 -1
  210. package/dist/elements/status.js +1 -1
  211. package/dist/elements/switch.js +1 -1
  212. package/dist/elements/tabs.js +1 -1
  213. package/dist/elements/tasks.js +1 -1
  214. package/dist/elements/text-shimmer.js +1 -1
  215. package/dist/elements/thinking-bar.js +1 -1
  216. package/dist/elements/thread.js +1 -1
  217. package/dist/elements/toast.js +1 -1
  218. package/dist/elements/tool.js +1 -1
  219. package/dist/elements/tooltip.js +1 -1
  220. package/dist/elements/validate-messages.d.ts +25 -0
  221. package/dist/elements/voice-input.js +1 -1
  222. package/dist/elements/voice-output.js +1 -1
  223. package/dist/elements.d.ts +2734 -217
  224. package/dist/index.d.ts +163 -125
  225. package/dist/index.js +6572 -5990
  226. package/dist/index.server.d.ts +5 -0
  227. package/dist/index.server.js +5403 -4860
  228. package/dist/kai-provider.es.d.ts +5 -0
  229. package/dist/kai-provider.es.js +79 -77
  230. package/dist/kai.es.d.ts +5 -0
  231. package/dist/kai.es.js +1 -1
  232. package/dist/llms/llms-full.txt +774 -151
  233. package/dist/llms/llms.txt +57 -5
  234. package/dist/mcp.es.js +4756 -782
  235. package/dist/primitives/card-component-types.d.ts +11 -0
  236. package/dist/primitives/card-data-types.d.ts +196 -0
  237. package/dist/primitives/card-host.d.ts +1 -1
  238. package/dist/primitives/card-recovery.d.ts +3 -3
  239. package/dist/primitives/card-registry.d.ts +4 -14
  240. package/dist/primitives/card-resolution.d.ts +1 -1
  241. package/dist/primitives/card-routing.d.ts +1 -1
  242. package/dist/primitives/card-tags.d.ts +11 -0
  243. package/dist/primitives/card-validate-cards.d.ts +57 -0
  244. package/dist/primitives/card-validate-generator.testlib.d.ts +20 -0
  245. package/dist/primitives/card-validate-schemas.d.ts +17 -0
  246. package/dist/primitives/card-validate.d.ts +24 -0
  247. package/dist/primitives/create-kai-chat.d.ts +3 -3
  248. package/dist/primitives/embed-providers.d.ts +1 -1
  249. package/dist/primitives/link-preview.d.ts +1 -1
  250. package/dist/primitives/message-feedback.d.ts +2 -2
  251. package/dist/primitives/toast-store.d.ts +1 -1
  252. package/dist/react/index.d.ts +730 -302
  253. package/dist/react/use-kai-chat.d.ts +8 -4
  254. package/dist/react.d.ts +5 -0
  255. package/dist/react.js +418 -317
  256. package/dist/register-impl-AxIlqjo7.js +145 -0
  257. package/dist/remote/host-embed.d.ts +1 -1
  258. package/dist/remote/index.d.ts +2 -2
  259. package/dist/remote/provider-runtime.d.ts +2 -2
  260. package/dist/remote/provider.d.ts +2 -2
  261. package/dist/remote/validate.d.ts +1 -1
  262. package/dist/remote/wire.d.ts +1 -1
  263. package/dist/schemas/artifact.schema.json +92 -0
  264. package/dist/schemas/embed.schema.json +0 -2
  265. package/dist/schemas/from-tool-call.d.ts +48 -0
  266. package/dist/schemas/index.d.ts +48 -0
  267. package/dist/schemas/link.schema.json +0 -2
  268. package/dist/schemas/provider-subsets.d.ts +136 -0
  269. package/dist/schemas/registry.d.ts +140 -0
  270. package/dist/schemas/tool-defs.d.ts +121 -0
  271. package/dist/schemas.d.ts +5 -0
  272. package/dist/schemas.js +717 -0
  273. package/dist/solid-BGYSJyHG.js +22960 -0
  274. package/dist/solid-Dt2nEwfl.js +20194 -0
  275. package/dist/solid.d.ts +66 -0
  276. package/dist/solid.js +261 -0
  277. package/dist/solid.server.d.ts +5 -0
  278. package/dist/solid.server.js +261 -0
  279. package/dist/state/index.d.ts +14 -4
  280. package/dist/state/messages.d.ts +8 -3
  281. package/dist/state/mock.d.ts +46 -0
  282. package/dist/state/parts.d.ts +85 -0
  283. package/dist/state/stream.d.ts +15 -9
  284. package/dist/state.d.ts +5 -0
  285. package/dist/state.js +253 -84
  286. package/dist/ui/action-icons.d.ts +1 -1
  287. package/dist/ui/collapsible.d.ts +11 -6
  288. package/dist/ui/dropdown.d.ts +47 -42
  289. package/dist/ui/pane-group.d.ts +1 -1
  290. package/dist/{variant-aurora-DVtGqVH6.js → variant-aurora-B44X69AG.js} +1 -1
  291. package/dist/variant-aurora-BRhV8Flk.js +391 -0
  292. package/dist/variant-aurora-Ds5ou9BH.js +381 -0
  293. package/dist/variant-custom-B20FhtYj.js +170 -0
  294. package/dist/{variant-custom-Dif-IV4u.js → variant-custom-BvA1Schl.js} +1 -1
  295. package/dist/variant-custom-D6Rtvneb.js +200 -0
  296. package/dist/{variant-wave-DbfNdvSi.js → variant-wave-BUQtkryq.js} +1 -1
  297. package/dist/variant-wave-BVYnqy9L.js +218 -0
  298. package/dist/variant-wave-DXC6_LcH.js +208 -0
  299. package/dist/wire/chunk.d.ts +171 -0
  300. package/dist/wire/consume.d.ts +26 -0
  301. package/dist/wire/encode.d.ts +221 -0
  302. package/dist/wire/files.d.ts +116 -0
  303. package/dist/wire/formats/anthropic.d.ts +2 -0
  304. package/dist/wire/formats/openai.d.ts +5 -0
  305. package/dist/wire/index.d.ts +16 -0
  306. package/dist/wire/media-types.d.ts +106 -0
  307. package/dist/wire/read.d.ts +26 -0
  308. package/dist/wire/sink-helpers.d.ts +21 -0
  309. package/dist/wire/sse.d.ts +33 -0
  310. package/dist/wire.d.ts +5 -53
  311. package/dist/wire.js +1126 -0
  312. package/frameworks/react/index.tsx +191 -158
  313. package/frameworks/react/runtime.tsx +21 -1
  314. package/frameworks/react/use-kai-chat.tsx +11 -1
  315. package/llms-full.txt +774 -151
  316. package/llms.txt +57 -5
  317. package/package.json +62 -8
  318. package/src/agent-tooling/archetypes.ts +127 -0
  319. package/src/agent-tooling/integrations/anthropic.ts +436 -0
  320. package/src/agent-tooling/integrations/cloudflare.ts +141 -52
  321. package/src/agent-tooling/integrations/langgraph.ts +80 -13
  322. package/src/agent-tooling/integrations/mastra.ts +161 -12
  323. package/src/agent-tooling/integrations/mock.ts +47 -8
  324. package/src/agent-tooling/integrations/ollama.ts +68 -24
  325. package/src/agent-tooling/integrations/openai.ts +89 -0
  326. package/src/agent-tooling/integrations/openrouter.ts +58 -8
  327. package/src/agent-tooling/integrations/pi.ts +104 -23
  328. package/src/agent-tooling/integrations/pydantic-ai.ts +61 -5
  329. package/src/agent-tooling/integrations/vercel-ai-sdk.ts +120 -13
  330. package/src/agent-tooling/mcp/manifest.ts +206 -25
  331. package/src/agent-tooling/mcp/tools/debug.ts +13 -7
  332. package/src/agent-tooling/mcp/tools/reference.ts +285 -6
  333. package/src/agent-tooling/mcp/tools/scaffold.ts +4152 -661
  334. package/src/agent-tooling/registry.ts +74 -0
  335. package/src/agent-tooling/types.ts +361 -1
  336. package/src/components/artifact-card.tsx +120 -0
  337. package/src/components/audio-visualizer/index.tsx +9 -0
  338. package/src/components/audio-visualizer/labs/lab-choreography.ts +187 -0
  339. package/src/components/audio-visualizer/labs/lab-shaders.ts +363 -0
  340. package/src/components/audio-visualizer/labs/lab-visualizer.tsx +102 -0
  341. package/src/components/audio-visualizer/shader-canvas.tsx +31 -1
  342. package/src/components/card-fallback.tsx +42 -10
  343. package/src/components/card-renderer.tsx +146 -9
  344. package/src/components/chat-container.tsx +4 -0
  345. package/src/components/chat-thread.tsx +128 -52
  346. package/src/components/choice-card.tsx +17 -29
  347. package/src/components/composer.tsx +12 -2
  348. package/src/components/confirm-card.tsx +24 -20
  349. package/src/components/context.tsx +30 -16
  350. package/src/components/conversation-item.tsx +6 -0
  351. package/src/components/conversation-list.tsx +18 -2
  352. package/src/components/file-tree.tsx +11 -22
  353. package/src/components/file-upload.tsx +14 -8
  354. package/src/components/form.tsx +14 -47
  355. package/src/components/loader.tsx +39 -12
  356. package/src/components/message-skills.tsx +4 -0
  357. package/src/components/message.tsx +294 -46
  358. package/src/components/model-switcher.tsx +38 -8
  359. package/src/components/reasoning.tsx +92 -5
  360. package/src/components/response-compare-types.ts +25 -0
  361. package/src/components/response-compare.tsx +4 -9
  362. package/src/components/source.tsx +50 -24
  363. package/src/components/tasks-card.tsx +10 -33
  364. package/src/components/thread.tsx +84 -42
  365. package/src/components/toast.tsx +17 -6
  366. package/src/components/tool-classify.ts +26 -0
  367. package/src/components/tool-types.ts +31 -1
  368. package/src/elements/agent-card.tsx +11 -11
  369. package/src/elements/artifact.tsx +15 -7
  370. package/src/elements/attachments.tsx +6 -4
  371. package/src/elements/avatar.tsx +1 -1
  372. package/src/elements/button.tsx +29 -6
  373. package/src/elements/card.tsx +2 -2
  374. package/src/elements/cards.tsx +109 -14
  375. package/src/elements/chain-of-thought.tsx +14 -10
  376. package/src/elements/chat-scope-picker.tsx +9 -7
  377. package/src/elements/chat-types.ts +59 -6
  378. package/src/elements/chat-workspace.tsx +50 -9
  379. package/src/elements/chat.tsx +90 -3
  380. package/src/elements/choice.tsx +8 -8
  381. package/src/elements/coachmark.tsx +1 -1
  382. package/src/elements/command.tsx +8 -23
  383. package/src/elements/compare.tsx +7 -6
  384. package/src/elements/compiled.css +1 -1
  385. package/src/elements/composer.tsx +8 -8
  386. package/src/elements/confirm-card.tsx +9 -9
  387. package/src/elements/context-meter.tsx +4 -18
  388. package/src/elements/conversation-list.tsx +14 -9
  389. package/src/elements/default-input.tsx +131 -8
  390. package/src/elements/define.tsx +178 -43
  391. package/src/elements/editable-label.tsx +17 -2
  392. package/src/elements/element-data-types.ts +112 -0
  393. package/src/elements/element-meta.json +1624 -306
  394. package/src/elements/element-types.d.ts +2645 -214
  395. package/src/elements/feedback-bar.tsx +1 -1
  396. package/src/elements/file-tree.tsx +1 -1
  397. package/src/elements/file-upload.tsx +1 -1
  398. package/src/elements/form.tsx +14 -6
  399. package/src/elements/input.tsx +1 -1
  400. package/src/elements/kbd.tsx +1 -1
  401. package/src/elements/menu.tsx +40 -32
  402. package/src/elements/message-skills.tsx +7 -9
  403. package/src/elements/message.tsx +200 -32
  404. package/src/elements/model-switcher.tsx +5 -3
  405. package/src/elements/pane.tsx +1 -1
  406. package/src/elements/prompt-dock.tsx +8 -8
  407. package/src/elements/prompt-input.tsx +10 -10
  408. package/src/elements/prompt-suggestions.tsx +7 -4
  409. package/src/elements/reasoning.tsx +1 -1
  410. package/src/elements/register.ts +9 -0
  411. package/src/elements/resizable.globals.d.ts +36 -0
  412. package/src/elements/resizable.tsx +24 -13
  413. package/src/elements/response-stream.tsx +1 -1
  414. package/src/elements/scroll-button.tsx +1 -1
  415. package/src/elements/search.tsx +6 -1
  416. package/src/elements/segmented.tsx +5 -11
  417. package/src/elements/separator.tsx +1 -1
  418. package/src/elements/slot-text.ts +73 -0
  419. package/src/elements/slots.ts +67 -24
  420. package/src/elements/source.tsx +21 -22
  421. package/src/elements/switch.tsx +3 -3
  422. package/src/elements/tasks.tsx +5 -4
  423. package/src/elements/thread.tsx +36 -4
  424. package/src/elements/toast.tsx +3 -2
  425. package/src/elements/tool.tsx +1 -1
  426. package/src/elements/validate-messages.ts +76 -0
  427. package/src/elements/voice-input.tsx +7 -7
  428. package/src/elements/voice-output.tsx +4 -4
  429. package/src/index.ts +145 -6
  430. package/src/primitives/card-component-types.ts +63 -0
  431. package/src/primitives/card-data-types.ts +312 -0
  432. package/src/primitives/card-recovery.ts +13 -2
  433. package/src/primitives/card-registry.tsx +34 -23
  434. package/src/primitives/card-schemas/artifact.schema.json +92 -0
  435. package/src/primitives/card-schemas/embed.schema.json +0 -2
  436. package/src/primitives/card-schemas/link.schema.json +0 -2
  437. package/src/primitives/card-tags.ts +61 -0
  438. package/src/primitives/card-validate-cards.ts +255 -0
  439. package/src/primitives/card-validate-generator.testlib.ts +38 -0
  440. package/src/primitives/card-validate-schemas.ts +58 -0
  441. package/src/primitives/card-validate.ts +48 -20
  442. package/src/primitives/create-tween.ts +54 -2
  443. package/src/primitives/message-feedback.ts +3 -2
  444. package/src/primitives/use-audio-analysis.ts +20 -1
  445. package/src/primitives/use-sequencer.ts +20 -1
  446. package/src/schemas/from-tool-call.ts +151 -0
  447. package/src/schemas/index.ts +340 -0
  448. package/src/schemas/provider-subsets.ts +538 -0
  449. package/src/schemas/registry.ts +355 -0
  450. package/src/schemas/tool-defs.ts +492 -0
  451. package/src/solid.ts +150 -0
  452. package/src/state/index.ts +27 -1
  453. package/src/state/messages.ts +21 -4
  454. package/src/state/mock.ts +211 -0
  455. package/src/state/parts.ts +295 -0
  456. package/src/state/stream.ts +56 -58
  457. package/src/ui/collapsible.tsx +17 -5
  458. package/src/ui/dropdown.tsx +46 -12
  459. package/src/ui/overlay.tsx +10 -4
  460. package/src/wire/chunk.ts +201 -0
  461. package/src/wire/consume.ts +440 -0
  462. package/src/wire/encode.ts +689 -0
  463. package/src/wire/files.ts +342 -0
  464. package/src/wire/formats/anthropic.ts +267 -0
  465. package/src/wire/formats/openai.ts +187 -0
  466. package/src/wire/index.ts +73 -0
  467. package/src/wire/media-types.ts +344 -0
  468. package/src/wire/read.ts +152 -0
  469. package/src/wire/sink-helpers.ts +50 -0
  470. package/src/wire/sse.ts +140 -0
  471. package/dist/create-tween-hvpmSuwW.js +0 -7
  472. package/dist/elements/chunks/arrow-left-DQocUFvy.js +0 -1
  473. package/dist/elements/chunks/audio-visualizer-BqNy7dfm.js +0 -1
  474. package/dist/elements/chunks/card-BkHbp4BA.js +0 -1
  475. package/dist/elements/chunks/chat-thread-CkRN6pZ7.js +0 -1
  476. package/dist/elements/chunks/check-B9-gn6SS.js +0 -1
  477. package/dist/elements/chunks/chevron-down-BNsxc2hk.js +0 -1
  478. package/dist/elements/chunks/chevron-right-Hv00StBO.js +0 -1
  479. package/dist/elements/chunks/circle-0e3KJTDr.js +0 -1
  480. package/dist/elements/chunks/circle-check-BNAS0JEy.js +0 -1
  481. package/dist/elements/chunks/code-block-BFUHn6Va.js +0 -1
  482. package/dist/elements/chunks/context-Cb7k4F-v.js +0 -1
  483. package/dist/elements/chunks/conversation-list-CvoAkWhN.js +0 -1
  484. package/dist/elements/chunks/create-tween-oVvAIG8r.js +0 -7
  485. package/dist/elements/chunks/default-input-Cqqilg9t.js +0 -1
  486. package/dist/elements/chunks/define-D1din7Ld.js +0 -1
  487. package/dist/elements/chunks/hover-card-Cmm6Q53m.js +0 -1
  488. package/dist/elements/chunks/message-BqyXDN3-.js +0 -1
  489. package/dist/elements/chunks/message-feedback-Djr3z6Yb.js +0 -1
  490. package/dist/elements/chunks/message-square-vFAgbDaX.js +0 -1
  491. package/dist/elements/chunks/model-switcher-B94YAKsM.js +0 -1
  492. package/dist/elements/chunks/reasoning-DTpCGtnY.js +0 -1
  493. package/dist/elements/chunks/scroll-button-B0cH5fXf.js +0 -1
  494. package/dist/elements/chunks/skeleton-DSXW5Yya.js +0 -1
  495. package/dist/elements/chunks/slots--V19HwUb.js +0 -1
  496. package/dist/elements/chunks/textarea-CUwqAX0G.js +0 -1
  497. package/dist/elements/chunks/tooltip-CgBZCVKp.js +0 -1
  498. package/dist/elements/chunks/use-card-resolution-BSu_XHjH.js +0 -1
  499. package/dist/elements/chunks/x-GRUeeQFT.js +0 -1
  500. package/dist/host-embed.d.ts +0 -33
  501. package/dist/kai-provider.d.ts +0 -2
  502. package/dist/origin.d.ts +0 -5
  503. package/dist/provider-runtime.d.ts +0 -27
  504. package/dist/register-impl-DQyejdfb.js +0 -145
  505. package/dist/validate.d.ts +0 -4
  506. package/dist/version.d.ts +0 -4
  507. package/src/components/component-meta.json +0 -4550
  508. package/src/elements/card-media.jpg +0 -0
  509. package/src/elements/resizable.d.ts +0 -27
  510. package/src/elements/video-poster.jpg +0 -0
@@ -1,14 +1,44 @@
1
1
  // AUTO-GENERATED by scripts/gen-element-api.mjs — do not edit by hand.
2
2
  // Typed custom-element interfaces + HTMLElementTagNameMap augmentation, so
3
3
  // `document.querySelector('kai-message')` is typed and gets prop autocomplete.
4
-
5
-
6
- // Re-exports for `import { … } from '@kitn.ai/ui/elements'`.
7
- export type { ChatMessage, ChatMessageAction } from './chat-types';
4
+ // Also augments React's JSX.IntrinsicElements (see below) so a raw <kai-chat>
5
+ // written directly in TSX type-checks.
6
+
7
+
8
+ // Local bindings for the two names the DECLARATIONS below reference
9
+ // (`configureCodeHighlighting(options: CodeHighlightingOptions)`, `classifyTool(): ToolKind`).
10
+ // `export type { X } from '…'` re-exports X without binding it in this file's scope,
11
+ // so without these imports both signatures are TS2304 — invisible under
12
+ // `skipLibCheck: true`, which is exactly why this file is now compiled with it off
13
+ // (tests/elements/element-types-lib-check.test.ts).
14
+ import type { CodeHighlightingOptions } from '../primitives/highlighter';
15
+ import type { ToolKind } from '../components/tool-classify';
16
+
17
+ // Re-exports for `import { … } from '@kitn.ai/ui/elements'`. Mirrors the names the
18
+ // shipped dist/elements.d.ts inlines, so both copies expose the same surface.
19
+ export type {
20
+ AvatarData,
21
+ ChatMessage,
22
+ ChatMessageAction,
23
+ CustomAction,
24
+ FeedbackVote,
25
+ MessagePart,
26
+ MessageSource,
27
+ RawOrigin,
28
+ } from './chat-types';
29
+ export type { ToolPart } from '../components/tool-types';
30
+ export type { ToolKind } from '../components/tool-classify';
31
+ export type { AttachmentData } from '../components/attachment-types';
32
+ export type { CardEnvelope, CardResolution } from '../primitives/card-contract';
8
33
  export type { CodeHighlightingOptions } from '../primitives/highlighter';
9
34
  export declare function configureCodeHighlighting(options: CodeHighlightingOptions): void;
10
35
  export declare function isCodeHighlightingEnabled(): boolean;
11
36
 
37
+ /** Classify a tool call by its provider-chosen NAME. Total, deterministic and
38
+ * side-effect free; ALWAYS terminates in `'generic'`. Named by ToolPart.kind's
39
+ * doc comment, so it must stay reachable from this entry. */
40
+ export declare function classifyTool(name: string): ToolKind;
41
+
12
42
  /** Resolves once the kai-* elements are registered (browser); inert on the server. */
13
43
  export declare const elementsReady: Promise<unknown>;
14
44
 
@@ -95,29 +125,29 @@ export declare function configureToasts(config: ToastConfig): void;
95
125
 
96
126
  export interface KaiAgentCardElement extends HTMLElement {
97
127
  /** Color mode (`auto` follows prefers-color-scheme). */
98
- theme?: 'light' | 'dark' | 'auto';
99
- /** The agent's name the primary label. Attribute: `name`. */
128
+ theme?: "light" | "dark" | "auto";
129
+ /** The agent's name, the primary label. Attribute: `name`. */
100
130
  name?: string;
101
131
  /** Selected / focused state: highlighted border + surface. Attribute: `active`. */
102
132
  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`. */
133
+ /** Raise a prominent "Needs you" pill plus a glowing amber edge. This is the attention-routing signal that pulls focus to this agent. Attribute: `needs-attention`. */
104
134
  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 }`. */
135
+ /** 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
136
  status?: { tone: "working" | "idle" | "done" | "error" | "blocked"; label?: string; pulse?: boolean };
107
137
  }
108
138
 
109
139
  export interface KaiArtifactElement extends HTMLElement {
110
140
  /** Color mode (`auto` follows prefers-color-scheme). */
111
- theme?: 'light' | 'dark' | 'auto';
141
+ theme?: "light" | "dark" | "auto";
112
142
  /** URL the preview iframe frames. Consumer-controlled. */
113
143
  src?: string;
114
- /** Files for the Code tab tree + each file's preview `url`. Set as a JS property (array). */
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" }[];
144
+ /** Files for the Code tab tree + each file's preview `url`. Omit for a preview-only artifact (the Code tab then has nothing to show; pair it with `no-tabs` to hide the toggle). Set as a JS property (array). */
145
+ files: { path: string; url?: string; code?: string; language?: string; type?: "html" | "pdf" | "image" | "other"; additions?: number; deletions?: number; status?: "added" | "modified" | "deleted" | "renamed" | "untracked" }[];
116
146
  /** Controlled active tab: `preview` or `code`. When set, the artifact follows it (re-asserted on change). Leave unset for an uncontrolled tab (see `defaultTab`). */
117
147
  tab?: "preview" | "code";
118
148
  /** 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
149
  defaultTab?: "preview" | "code";
120
- /** Selected file path syncs the tree highlight, Code source, and preview. */
150
+ /** Selected file path. Syncs the tree highlight, Code source, and preview. */
121
151
  activeFile?: string;
122
152
  /** iframe `sandbox` override. Secure default `allow-scripts allow-forms` (NOT `allow-same-origin`). */
123
153
  sandbox?: string;
@@ -145,13 +175,31 @@ export interface KaiArtifactElement extends HTMLElement {
145
175
  readonlyPath?: boolean;
146
176
  /** 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
177
  displayUrl?: string;
178
+ /** Go back in the artifact's own history stack (no-op when there's no prior entry). */
179
+ back(): void;
180
+ /** Go forward in the history stack (no-op when there's no forward entry). */
181
+ forward(): void;
182
+ /** Force-reload the current preview url (also re-renders an inline PDF). */
183
+ reload(): void;
184
+ /** Navigate to the `src` home url (no-op when there's no `src`). */
185
+ home(): void;
186
+ /** Push + load a url in the preview, the path-field submit path (fires kai-navigate). */
187
+ navigate(url: string): void;
188
+ /** Select a file by path: highlights the tree, shows its source, navigates the preview (fires kai-file-select + kai-navigate). Named selectFile to avoid the `activeFile` prop. */
189
+ selectFile(path: string): void;
190
+ /** Open the current url in a new browser tab (no-op when there's no concrete url). Named openExternal, NOT openInTab, which is a prop (toolbar button visibility). */
191
+ openExternal(): void;
192
+ /** Enter the maximized view-state (fires kai-maximize-change{maximized:true}). Named maximize, NOT maximized, which is a prop. */
193
+ maximize(): void;
194
+ /** Exit the maximized view-state (fires kai-maximize-change{maximized:false}). */
195
+ restore(): void;
148
196
  }
149
197
 
150
198
  export interface KaiAttachmentsElement extends HTMLElement {
151
199
  /** Color mode (`auto` follows prefers-color-scheme). */
152
- theme?: 'light' | 'dark' | 'auto';
153
- /** The attachments to render. Set as a JS property (array). */
154
- items: { id: string; type: "file" | "source-document"; filename?: undefined | string; mediaType?: undefined | string; url?: undefined | string; title?: undefined | string }[];
200
+ theme?: "light" | "dark" | "auto";
201
+ /** The attachments to render. Omit (or pass an empty array) for the empty state, which shows `emptyText` if set and nothing otherwise. Set as a JS property (array). */
202
+ items: { id: string; type: "file" | "source-document"; filename?: string; mediaType?: string; url?: string; title?: string }[];
155
203
  /** Layout: `grid` = visual tiles, `inline` = icon + label chips, `list` = rows. */
156
204
  variant?: "grid" | "inline" | "list";
157
205
  /** Wrap each item in a hover card that previews its details. */
@@ -166,7 +214,7 @@ export interface KaiAttachmentsElement extends HTMLElement {
166
214
 
167
215
  export interface KaiAudioVisualizerElement extends HTMLElement {
168
216
  /** Color mode (`auto` follows prefers-color-scheme). */
169
- theme?: 'light' | 'dark' | 'auto';
217
+ theme?: "light" | "dark" | "auto";
170
218
  /** Look to render: `bar` (default), `grid`, `radial`, `wave`, `aurora`, `custom`. `aura` is accepted as a LiveKit-markup alias for `aurora`. Attribute: `variant`. */
171
219
  variant?: string;
172
220
  /** `idle` (default), `connecting`, `listening`, `thinking`, `speaking`, `disconnected` (connection down: the dead, flat look). LiveKit's room-lifecycle state names are accepted as aliases. Attribute: `state`. */
@@ -203,12 +251,12 @@ export interface KaiAudioVisualizerElement extends HTMLElement {
203
251
 
204
252
  export interface KaiAvatarElement extends HTMLElement {
205
253
  /** Color mode (`auto` follows prefers-color-scheme). */
206
- theme?: 'light' | 'dark' | 'auto';
254
+ theme?: "light" | "dark" | "auto";
207
255
  /** Image URL/data-URI. When absent, the `fallback` initials show instead. */
208
256
  src?: string;
209
257
  /** Alt text for the image. Defaults to `fallback`. */
210
258
  alt?: string;
211
- /** Short text shown when there's no image usually initials (e.g. "JD", "AI"). */
259
+ /** Short text shown when there's no image, usually initials (e.g. "JD", "AI"). */
212
260
  fallback?: string;
213
261
  /** Size token: `sm` | `md` (default) | `lg`. */
214
262
  size?: "sm" | "md" | "lg";
@@ -216,15 +264,15 @@ export interface KaiAvatarElement extends HTMLElement {
216
264
 
217
265
  export interface KaiBadgeElement extends HTMLElement {
218
266
  /** Color mode (`auto` follows prefers-color-scheme). */
219
- theme?: 'light' | 'dark' | 'auto';
267
+ theme?: "light" | "dark" | "auto";
220
268
  /** `default` (muted pill) · `count` (compact number badge) · `citation` (filled primary, for inline citation markers). Defaults to `default`. */
221
269
  variant?: "default" | "count" | "citation";
222
270
  }
223
271
 
224
272
  export interface KaiButtonElement extends HTMLElement {
225
273
  /** Color mode (`auto` follows prefers-color-scheme). */
226
- theme?: 'light' | 'dark' | 'auto';
227
- /** Visual style. `default` (filled), `subtle` (muted text, hover tint the toolbar icon look), `ghost` (transparent, hover fill), `outline`, or `destructive`. Defaults to `default`. */
274
+ theme?: "light" | "dark" | "auto";
275
+ /** Visual style. `default` (filled), `subtle` (muted text, hover tint, the toolbar icon look), `ghost` (transparent, hover fill), `outline`, or `destructive`. Defaults to `default`. */
228
276
  variant?: "default" | "subtle" | "ghost" | "outline" | "destructive";
229
277
  /** Size token. `icon` / `icon-sm` are square (for icon-only buttons); `sm` / `md` / `lg` size text buttons. Defaults to `md`. */
230
278
  size?: "sm" | "md" | "lg" | "icon" | "icon-sm";
@@ -232,24 +280,30 @@ export interface KaiButtonElement extends HTMLElement {
232
280
  icon?: string;
233
281
  /** Trailing icon, after the label (e.g. `"chevron-down"` for a menu affordance). */
234
282
  iconTrailing?: string;
235
- /** Accessible name. REQUIRED for icon-only buttons (no visible text); ignored when you slot visible text, which already names the button. */
283
+ /** Accessible name. REQUIRED for icon-only buttons (no visible text); ignored when you slot visible text, which already names the button. An `aria-label` on top of visible text REPLACES that name rather than adding to it, so a button reading "Save" that answers to "Submit" is unusable by speech input (WCAG 2.5.3, Label in Name). The visible text wins. An `icon` / `icon-sm` size hides the slot, which makes the button icon-only whatever you slotted, so `label` is what names it there. */
236
284
  label?: string;
237
285
  /** Disable the button (non-interactive, dimmed). */
238
286
  disabled?: boolean;
239
- /** Stretch the button to the full width of its container (a block button) e.g. a card CTA or a stacked action. Attribute: `full`. */
287
+ /** Stretch the button to the full width of its container (a block button), e.g. a card CTA or a stacked action. Attribute: `full`. */
240
288
  full?: boolean;
241
289
  /** Justify the button's content: `start`, `center` (default), or `end`. Combine with `full` for a full-width, left-aligned button. */
242
290
  align?: "start" | "center" | "end";
243
291
  /** Native button `type`. Defaults to `button` (so it never submits a form). */
244
292
  type?: "button" | "submit" | "reset";
293
+ /** Focus the inner `<button>` (host.focus() would focus the wrapper). */
294
+ focus(options?: FocusOptions): void;
295
+ /** Blur the inner `<button>`. */
296
+ blur(): void;
297
+ /** Programmatically activate the button. Runs the same path as a user click and fires kai-click. Forwarding to the inner button means `disabled` is respected automatically. */
298
+ click(): void;
245
299
  }
246
300
 
247
301
  export interface KaiCardElement extends HTMLElement {
248
302
  /** Color mode (`auto` follows prefers-color-scheme). */
249
- theme?: 'light' | 'dark' | 'auto';
303
+ theme?: "light" | "dark" | "auto";
250
304
  /** Surface treatment: `outlined` (default) | `filled` | `plain` | `accent`. Attribute: `appearance`. */
251
305
  appearance?: "outlined" | "filled" | "plain" | "accent";
252
- /** `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`. */
306
+ /** `vertical` (default, media on top) | `horizontal` (media at the start) | `responsive` (horizontal when the card's container is wide enough, else vertical, via a container query on the card's own width). Attribute: `orientation`. */
253
307
  orientation?: "vertical" | "horizontal" | "responsive";
254
308
  /** The card width below which a `responsive` card collapses to vertical and the footer actions stack. A CSS length; default `28rem`. Attribute: `collapse`. */
255
309
  collapse?: string;
@@ -269,33 +323,49 @@ export interface KaiCardElement extends HTMLElement {
269
323
 
270
324
  export interface KaiCardsElement extends HTMLElement {
271
325
  /** Color mode (`auto` follows prefers-color-scheme). */
272
- theme?: 'light' | 'dark' | 'auto';
326
+ theme?: "light" | "dark" | "auto";
273
327
  /** The stream of card envelopes to render. Set as a JS PROPERTY: `el.cards = [...]`. */
274
328
  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 } }[];
275
329
  /** 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. */
276
330
  types?: Record<string, string>;
331
+ /** JSON Schemas for the card types this app renders, keyed by envelope type. The companion of `types`, which says what DRAWS a card while this says what a VALID one looks like. An OBJECT, so it is a JS property only: `el.schemas = { 'pricing-table': pricingSchema }`, never an attribute. `createCardRegistry(...).validationSchemas` is exactly this shape. Without it the kit validates its own seven built-ins and leaves your own card type, the one your app actually cares about, as the only unchecked thing on screen. A schema here WINS over a built-in of the same name, matching `mergeCardTags`, where your entry is spread over ours. Typed `Record<string, object>` rather than `Record<string, JsonSchema>` deliberately: an imported `.json` schema widens `"type"` to `string`, and an authored one carries `$schema`/`title`/`description`/`additionalProperties`, so the tighter type would reject both of the normal ways to supply one. See `CardSchemaMap` in components/card-renderer.tsx. */
332
+ schemas?: Record<string, object>;
277
333
  /** Optional CardPolicy handling child events. Property: `el.policy`. */
278
334
  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" };
335
+ /** Validate each envelope's `data` against the schema for its type before rendering it, using a built-in's own schema or yours from `schemas`. Default `true`; set `validate-cards="false"` (or `el.validateCards = false`) to opt out. A hard failure (wrong type, a missing required field) renders a diagnostic naming the field instead of the card; a soft failure (bounds) renders the card unchanged. Both emit a contract `error` event. On in production too: a model emitting a bad shape is a production failure mode, so stripping the check there would hide it from exactly the person who needs to see it. */
336
+ validateCards?: boolean;
337
+ /** Programmatically resolve a child card by id: set that envelope's `resolution` so the child re-renders into its read-only/resolved view. The imperative twin of the consumer mutating the cards array. No-op for an unknown id. */
338
+ resolve(cardId: string, resolution: { kind: "action"; action: string; payload?: unknown; at?: undefined | string } | { kind: "submit"; data: unknown; at?: undefined | string } | { kind: "dismissed"; at?: undefined | string } | { kind: "expired"; reason?: undefined | string; at?: undefined | string }): void;
339
+ /** Collapse a card to its re-openable stub from the host side. Convenience for `resolve(cardId, { kind: 'dismissed' })`. */
340
+ dismiss(cardId: string): void;
341
+ /** Return the live child element node for a card id (or null) so consumers can call that card's own methods (focus/expand/…) without a shadow-DOM query. */
342
+ getCard(cardId: string): HTMLElement | null;
279
343
  }
280
344
 
281
345
  export interface KaiChainOfThoughtElement extends HTMLElement {
282
346
  /** Color mode (`auto` follows prefers-color-scheme). */
283
- theme?: 'light' | 'dark' | 'auto';
284
- /** The reasoning steps. Set as a JS property. Compound sub-parts collapse to this one data model (Route 1). Each `{ label, content?, id? }`. */
285
- steps: { label: string; content?: undefined | string; id?: undefined | string }[];
286
- /** Open mode: `'multiple'` (default any number of steps open at once) or `'single'` (at most one open; opening a step closes the others). */
347
+ theme?: "light" | "dark" | "auto";
348
+ /** The reasoning steps. Set as a JS property. Compound sub-parts collapse to this one data model (Route 1). Each `{ label, content?, id? }`. Omit to supply the steps as `<kai-step>` light-DOM children instead; when both are present the property's steps come first. */
349
+ steps: { label: string; content?: string; id?: string }[];
350
+ /** Open mode: `'multiple'` (default, any number of steps open at once) or `'single'` (at most one open; opening a step closes the others). */
287
351
  type?: "single" | "multiple";
288
352
  /** 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. */
289
353
  value?: string | string[];
290
- /** Uncontrolled INITIAL open step key(s) seeds which steps render expanded. Ignored once `value` is provided. Set as a JS property. */
354
+ /** Uncontrolled INITIAL open step key(s), seeding which steps render expanded. Ignored once `value` is provided. Set as a JS property. */
291
355
  defaultValue?: string | string[];
356
+ /** Open one step's detail by index, or ALL steps when called with no arg. In `single` mode opening one step closes the others (expand-all keeps the last). */
357
+ expand(index?: number): void;
358
+ /** Close one step's detail by index, or ALL steps when called with no arg. */
359
+ collapse(index?: number): void;
360
+ /** Flip one step's open state by index. */
361
+ toggle(index?: number): void;
292
362
  }
293
363
 
294
364
  export interface KaiChatElement extends HTMLElement {
295
365
  /** Color mode (`auto` follows prefers-color-scheme). */
296
- theme?: 'light' | 'dark' | 'auto';
297
- /** 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 = [...]`). */
298
- 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" }[];
366
+ theme?: "light" | "dark" | "auto";
367
+ /** Show a Search (Globe) button in the input toolbar; fires a `search` event. */
368
+ search?: boolean;
299
369
  /** 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. */
300
370
  value?: string | ({ type: "text"; text: string } | { type: "entity"; entity: { kind: string; id: string; label: string; icon?: string; promptText?: string; data?: Record<string, unknown> } })[];
301
371
  /** Placeholder text shown in the empty input. */
@@ -309,7 +379,7 @@ export interface KaiChatElement extends HTMLElement {
309
379
  /** 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. */
310
380
  persistSuggestions?: boolean;
311
381
  /** Body/prose font scale for rendered markdown (`'xs' | 'sm' | 'base' | 'lg'`). Defaults to `'sm'`. */
312
- proseSize?: "sm" | "lg" | "xs" | "base";
382
+ proseSize?: "xs" | "sm" | "base" | "lg";
313
383
  /** Shiki theme name for syntax-highlighted code blocks (e.g. `'github-dark-dimmed'`). */
314
384
  codeTheme?: string;
315
385
  /** Enable Shiki syntax highlighting in code blocks. Turn off to render plain `<pre>` blocks (lighter, no highlighter load). Default true. */
@@ -324,69 +394,95 @@ export interface KaiChatElement extends HTMLElement {
324
394
  context?: { usedTokens: number; maxTokens: number; inputTokens?: number; outputTokens?: number; estimatedCost?: number };
325
395
  /** Show the scroll-to-bottom button inside the scroll area. Default true. */
326
396
  scrollButton?: boolean;
327
- /** Whether the host has `slot="header-start"` content (left of the title) set by the `<kai-chat>` facade so a custom control forces the header open. */
397
+ /** Whether the host has `slot="header-start"` content (left of the title). Set by the `<kai-chat>` facade so a custom control forces the header open. */
328
398
  headerStart?: boolean;
329
399
  /** Whether the host has `slot="header-end"` content (right of the controls). */
330
400
  headerEnd?: boolean;
331
- /** REPLACE full custom header in place of the built-in title/model/context bar. */
401
+ /** REPLACE: full custom header in place of the built-in title/model/context bar. */
332
402
  headerFull?: boolean;
333
- /** INJECT left sidebar column (e.g. a conversation list / your own nav). */
403
+ /** INJECT: left sidebar column (e.g. a conversation list / your own nav). */
334
404
  sidebar?: boolean;
335
- /** 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). */
405
+ /** 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). */
336
406
  empty?: boolean;
337
- /** REPLACE full custom composer in place of the built-in prompt input. The projected content wires its own submit (the data-flow boundary). */
407
+ /** REPLACE: full custom composer in place of the built-in prompt input. The projected content wires its own submit (the data-flow boundary). */
338
408
  composer?: boolean;
339
- /** INJECT accessory row just above the composer (e.g. extra actions). */
409
+ /** INJECT: accessory row just above the composer (e.g. extra actions). */
340
410
  composerActions?: boolean;
341
- /** INJECT footer row below the composer (disclaimers, token meter, …). */
411
+ /** INJECT: footer row below the composer (disclaimers, token meter, …). */
342
412
  footer?: boolean;
343
- /** Show a Search (Globe) button in the input toolbar; fires a `search` event. */
344
- search?: boolean;
345
413
  /** Show a Voice (Mic) button in the input toolbar; fires a `voice` event. */
346
414
  voice?: boolean;
347
- /** 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. */
415
+ /** 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. */
348
416
  triggers?: { char: string; kind: string; items?: { id: string; label: string; icon?: string; description?: string; group?: string; kind?: string; promptText?: string; data?: Record<string, unknown> }[] }[];
349
417
  /** Default icon per entity kind (kind → image src) for pills/menu items. */
350
418
  kindIcons?: Record<string, string>;
351
419
  /** Whether each message's action bar is always visible (`'always'`, default) or only revealed on hover of that message row (`'hover'`). */
352
420
  actionsReveal?: "always" | "hover";
421
+ /** Which attachment media types the user may stage, in HTML `accept` syntax: `<kai-chat accept="image/*,application/pdf">`. A plain string, so unlike `messages` it DOES work as an attribute. Omitted means no filter. MEDIA TYPES ONLY -- exact (`image/png`) or subtype wildcard (`text/*`). HTML allows a file extension here and this does not: `accept=".py"` THROWS with the entry named, rather than silently resolving to a picker that accepts nothing. It can only NARROW what the kit can already encode: `accept="image/*"` resolves to the four image formats both APIs take, not to every image type the OS offers. Pass the SAME string to `toOpenAIMessages(msgs, { accept })` and the picker and the wire cannot disagree -- both resolve it through `resolveMediaPolicy` against one declaration. That declaration is readable as `encodableMediaTypes()` from `@kitn.ai/ui/wire`, if you would rather build your own picker than use this prop. */
422
+ accept?: string;
423
+ /** The full message thread to render, newest last. Each entry carries its role, ordered `parts`, and optional actions/avatar/feedback. Set as a JS property (`el.messages = [...]`); a NEW array reference per streaming chunk re-renders (mutating in place does not). Omit for an empty thread. Re-declared here (rather than inherited from `ChatThreadProps`) because the ELEMENT registers a `[]` default and renders the empty state without it, while the SolidJS `<ChatThread>` component still requires it. The facade hands it a validated array either way. Matches `<kai-thread>`. */
424
+ messages: { id: string; role: "user" | "assistant"; parts: ({ type: "text"; text: string; raw?: { source: string; payload: unknown } } | { type: "reasoning"; text: string; label?: string; index?: number; streamId?: string; signature?: string; raw?: { source: string; payload: unknown } } | { type: "tool"; tool: { type: string; kind?: "command" | "file-change" | "search" | "fetch" | "mcp" | "image" | "generic"; state: "input-streaming" | "input-available" | "output-available" | "output-error"; input?: Record<string, unknown>; rawInput?: string; output?: Record<string, unknown>; toolCallId?: string; errorText?: string; raw?: { source: string; payload: unknown } }; raw?: { source: string; payload: unknown } } | { type: "card"; envelope: { 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 } }; raw?: { source: string; payload: unknown } } | { type: "source"; source: { id?: string; url?: string; title?: string; snippet?: string; index?: number }; raw?: { source: string; payload: unknown } } | { type: "file"; attachment: { id: string; type: "file" | "source-document"; filename?: string; mediaType?: string; url?: string; title?: string }; raw?: { source: string; payload: unknown } })[]; actions?: ("copy" | "like" | "dislike" | "regenerate" | "edit" | { id: string; label: string; icon?: string; tooltip?: string })[]; avatar?: { src?: string; fallback?: string; alt?: string }; feedback?: "like" | "dislike" }[];
425
+ /** Optional card type -> custom-element tag overrides/additions for `card` parts (merged over the built-ins). Property: `el.cardTypes`. Typed as a plain string map (not the `CardTagMap` alias) so the generated React wrapper inlines it instead of emitting an unresolved named type. */
426
+ cardTypes?: Record<string, string>;
427
+ /** JSON Schemas for the card types this app renders, keyed by envelope type. The companion of `cardTypes`, which says what DRAWS a card while this says what a VALID one looks like. An OBJECT, so it is a JS property only: `el.cardSchemas = { 'pricing-table': pricingSchema }`, never an attribute. `createCardRegistry(...).validationSchemas` is exactly this shape. Without it the kit validates its own seven built-ins and leaves your own card type, the one your app actually cares about, as the only unchecked thing on screen. A schema here WINS over a built-in of the same name. Typed `Record<string, object>` rather than `Record<string, JsonSchema>` deliberately: an imported `.json` schema widens `"type"` to `string`, and an authored one carries `$schema`/`title`/`description`/`additionalProperties`, so the tighter type would reject both of the normal ways to supply one. */
428
+ cardSchemas?: Record<string, object>;
429
+ /** Focus the composer, meaning the contenteditable (or textarea) inside the shadow root. A native `focus()` on the host lands on the host itself and never reaches it, so this is the only way to focus the input programmatically. */
430
+ focus(options?: FocusOptions): void;
431
+ /** Blur whatever currently holds focus inside the shadow root. The companion to `focus()`, for the same reason: a native `blur()` on the host misses the real focus target. */
432
+ blur(): void;
433
+ /** Empty the COMPOSER: drops the draft text and every staged attachment, then fires `kai-value-change` with `''`. It does NOT touch the thread. `messages` is the consumer's own state, so clearing history stays the consumer's call. */
434
+ clear(): void;
435
+ /** Submit whatever the composer currently holds, on the same path as Enter or the send button: fires `kai-submit` with that value plus the staged attachments, then drops the attachments. It takes no argument, so to send text the user never typed, set `el.value` first. There is no empty-check, so an empty composer still fires. The draft is cleared afterwards only when `value` is uncontrolled; a controlled host owns its value and clears it itself. Named `send`, not `submit`, to match the shared vocabulary. */
436
+ send(): void;
437
+ /** Scroll the message viewport to the newest message. Defaults to `'smooth'`; pass `'instant'` to jump without animating. */
438
+ scrollToBottom(behavior?: "auto" | "instant" | "smooth"): void;
353
439
  }
354
440
 
355
441
  export interface KaiCheckpointElement extends HTMLElement {
356
442
  /** Color mode (`auto` follows prefers-color-scheme). */
357
- theme?: 'light' | 'dark' | 'auto';
443
+ theme?: "light" | "dark" | "auto";
358
444
  /** Optional text beside the icon. */
359
445
  label?: string;
360
446
  /** Tooltip on hover. */
361
447
  tooltip?: string;
362
448
  /** Visual button style. */
363
- variant?: "default" | "ghost" | "outline";
449
+ variant?: "ghost" | "default" | "outline";
364
450
  /** Button size (use an `icon*` size for an icon-only checkpoint). */
365
451
  size?: "sm" | "md" | "lg" | "icon" | "icon-sm";
366
452
  }
367
453
 
368
454
  export interface KaiChoiceElement extends HTMLElement {
369
455
  /** Color mode (`auto` follows prefers-color-scheme). */
370
- theme?: 'light' | 'dark' | 'auto';
456
+ theme?: "light" | "dark" | "auto";
371
457
  /** The choice definition (the CardEnvelope.data). Set as a JS PROPERTY: `el.data = { prompt, options:[…], allowOther?, submitLabel? }`. Import `ChoiceCardData` from `@kitn.ai/ui` for the full shape. */
372
- data?: Record<string, unknown>;
458
+ data?: { prompt?: string; options: { id: string; label: string; description?: string; media?: { image?: string; imageAlt?: string; icon?: string }; meta?: string; recommended?: boolean; disabled?: boolean; payload?: unknown }[]; allowOther?: boolean | { label?: string; placeholder?: string }; submitLabel?: string; dismissible?: boolean };
373
459
  /** Stable card id correlating every emitted CardEvent. Attribute: `card-id`. */
374
460
  cardId?: string;
375
461
  /** Heading rendered in the card chrome (= CardEnvelope.title). Attribute: `heading`. */
376
462
  heading?: string;
377
463
  /** Set when the user resolved this card; renders the read-only view. Property: `el.resolution = { kind:'action', action:'…' }`. */
378
464
  resolution?: Record<string, unknown>;
379
- /** Controlled selection the selected option id. When set, the consumer owns the current pick (RadioGroup `value`). Attribute: `value`. */
465
+ /** Controlled selection: the selected option id. When set, the consumer owns the current pick (RadioGroup `value`). Attribute: `value`. */
380
466
  value?: string;
381
467
  /** Option id to pre-select on mount (uncontrolled seed). Attribute: `default-value`. */
382
468
  defaultValue?: string;
383
469
  /** Disable the whole radiogroup + Submit (e.g. while the agent is busy). Attribute: `disabled`. */
384
470
  disabled?: boolean;
471
+ /** Focus the radiogroup roving tab stop (or the Other input when selected). */
472
+ focus(options?: FocusOptions): void;
473
+ /** Select an option by id locally: no emit, fires kai-value-change (same as a row click). Lets a consumer pre-highlight or drive selection externally. */
474
+ select(optionId: string): void;
475
+ /** Submit the current selection: emits the `action` verb on kai-card and resolves the card (single-shot). Named `send`, not `submit`, per the shared vocabulary. */
476
+ send(): void;
477
+ /** Trigger the dismiss path: emits `dismiss` on kai-card and optimistically collapses the card to its re-openable stub. */
478
+ dismiss(): void;
479
+ /** Re-open a dismissed card from its stub: emits `reopen` on kai-card. */
480
+ reopen(): void;
385
481
  }
386
482
 
387
483
  export interface KaiCoachmarkElement extends HTMLElement {
388
484
  /** Color mode (`auto` follows prefers-color-scheme). */
389
- theme?: 'light' | 'dark' | 'auto';
485
+ theme?: "light" | "dark" | "auto";
390
486
  /** 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`. */
391
487
  open?: boolean;
392
488
  /** Initial open state on mount (uncontrolled seed). */
@@ -397,15 +493,21 @@ export interface KaiCoachmarkElement extends HTMLElement {
397
493
  badge?: string;
398
494
  /** Floating placement relative to the anchor (default `bottom`). */
399
495
  placement?: string;
400
- /** Color tone: `primary` (default, theme accent), `info` (blue), `success` (green), `warning` (amber), or `error` (red) reusing the kit's tool hues. */
401
- tone?: "error" | "primary" | "info" | "success" | "warning";
496
+ /** Color tone: `primary` (default, theme accent), `info` (blue), `success` (green), `warning` (amber), or `error` (red), reusing the kit's tool hues. */
497
+ tone?: "primary" | "info" | "success" | "warning" | "error";
402
498
  /** Render the arrow that points at the anchor (default `true`). Set `arrow="false"` for a plain bubble with no pointer. */
403
499
  arrow?: boolean;
500
+ /** Open it programmatically (no-op while disabled). */
501
+ show(): void;
502
+ /** Close it programmatically. */
503
+ hide(): void;
504
+ /** Flip the open state (closes while disabled). */
505
+ toggle(): void;
404
506
  }
405
507
 
406
508
  export interface KaiCodeBlockElement extends HTMLElement {
407
509
  /** Color mode (`auto` follows prefers-color-scheme). */
408
- theme?: 'light' | 'dark' | 'auto';
510
+ theme?: "light" | "dark" | "auto";
409
511
  /** The source code to render. */
410
512
  code: string;
411
513
  /** Language grammar (e.g. `js`, `python`). Defaults to `tsx`. */
@@ -415,43 +517,53 @@ export interface KaiCodeBlockElement extends HTMLElement {
415
517
  /** Disable syntax highlighting (renders plain text, no Shiki). */
416
518
  codeHighlight?: boolean;
417
519
  /** Code text sizing. */
418
- proseSize?: "sm" | "lg" | "xs" | "base";
520
+ proseSize?: "xs" | "sm" | "base" | "lg";
419
521
  }
420
522
 
421
523
  export interface KaiCommandElement extends HTMLElement {
422
524
  /** Color mode (`auto` follows prefers-color-scheme). */
423
- theme?: 'light' | 'dark' | 'auto';
424
- /** Flat list of items. Set as a JS property not an HTML attribute. */
525
+ theme?: "light" | "dark" | "auto";
526
+ /** Flat list of items. Set as a JS property, not an HTML attribute. */
425
527
  items?: { id: string; label: string; icon?: string; description?: string; shortcut?: string; group?: string }[];
426
528
  /** Placeholder text for the search input. */
427
529
  placeholder?: string;
428
530
  /** Label shown when no items match the current query. */
429
531
  emptyLabel?: string;
532
+ /** Focus the search combobox input inside the shadow root so the palette is type-ready on demand (Shadow-DOM autofocus is unreliable, so hosts call this after opening the palette). */
533
+ focus(options?: FocusOptions): void;
534
+ /** Blur the focused search input. */
535
+ blur(): void;
536
+ /** Reset the search query to empty, re-showing all items, and fire `kai-query-change` with `''`. Mirrors the Escape-key behavior. */
537
+ clear(): void;
430
538
  }
431
539
 
432
540
  export interface KaiCompareElement extends HTMLElement {
433
541
  /** Color mode (`auto` follows prefers-color-scheme). */
434
- theme?: 'light' | 'dark' | 'auto';
542
+ theme?: "light" | "dark" | "auto";
435
543
  /** 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. */
436
544
  data?: Record<string, unknown>;
437
545
  /** Stable id correlating every emitted event. Attribute: `compare-id`. */
438
546
  compareId?: string;
439
547
  /** Re-hydrate / control the user's pick. Set as a JS PROPERTY: `el.selection = { chosenId, rejectedIds }`. Renders the collapsed winner. */
440
548
  selection?: Record<string, unknown>;
441
- /** Layout: `'auto'` (default columns when wide, tabs when narrow, by CONTAINER width) | `'columns'` (side-by-side) | `'tabs'` (pills to switch). Attribute: `layout`. */
549
+ /** Layout: `'auto'` (default, columns when wide, tabs when narrow, by CONTAINER width) | `'columns'` (side-by-side) | `'tabs'` (pills to switch). Attribute: `layout`. */
442
550
  layout?: "auto" | "columns" | "tabs";
443
551
  /** Prose/text size for the rendered candidates. Attribute: `prose-size`. */
444
- proseSize?: "sm" | "lg" | "xs" | "base";
552
+ proseSize?: "xs" | "sm" | "base" | "lg";
445
553
  /** Shiki theme for code blocks in the candidates. Attribute: `code-theme`. */
446
554
  codeTheme?: string;
447
555
  /** Whether code blocks are syntax-highlighted. Attribute: `code-highlight`. */
448
556
  codeHighlight?: boolean;
557
+ /** Programmatically commit a pick by candidate id, on the same path as the "Pick this" button: fires kai-compare-select and optimistically collapses (single-shot; inert while streaming or already resolved). `select` does NOT collide with the `selection` prop (distinct identifier). */
558
+ select(candidateId: string): void;
559
+ /** Focus the current roving tab stop (the focused candidate's "Pick this" radio) so a consumer can move keyboard focus into the radiogroup. */
560
+ focus(options?: FocusOptions): void;
449
561
  }
450
562
 
451
563
  export interface KaiComposerElement extends HTMLElement {
452
564
  /** Color mode (`auto` follows prefers-color-scheme). */
453
- theme?: 'light' | 'dark' | 'auto';
454
- /** Controlled value string or a full ComposerDoc (set as JS property). */
565
+ theme?: "light" | "dark" | "auto";
566
+ /** Controlled value: a string or a full ComposerDoc (set as JS property). */
455
567
  value?: string | ({ type: "text"; text: string } | { type: "entity"; entity: { kind: string; id: string; label: string; icon?: string; promptText?: string; data?: Record<string, unknown> } })[];
456
568
  /** Placeholder text shown when the composer is empty. */
457
569
  placeholder?: string;
@@ -460,35 +572,53 @@ export interface KaiComposerElement extends HTMLElement {
460
572
  /** Show a loading/streaming state and block submit. */
461
573
  loading?: boolean;
462
574
  /** Maximum height in px before the content scrolls. Default 240. */
463
- maxHeight?: string | number;
575
+ maxHeight?: number | string;
464
576
  /** Whether pressing Enter (without Shift) submits. Default true. */
465
577
  submitOnEnter?: boolean;
466
- /** Trigger definitions set as a JS property. */
578
+ /** Trigger definitions. Set as a JS property. */
467
579
  triggers?: { char: string; kind: string; items?: { id: string; label: string; icon?: string; description?: string; group?: string; kind?: string; promptText?: string; data?: Record<string, unknown> }[] }[];
468
- /** Keyword highlight rules set as a JS property. */
580
+ /** Keyword highlight rules. Set as a JS property. */
469
581
  highlights?: (string | { pattern: string; flags?: string; class?: string })[];
470
582
  /** 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. */
471
583
  kindIcons?: Record<string, string>;
584
+ /** Focus the editable element. `focus`/`blur` are NOT composed natively, so a host-level focus() can't reach the editable inside the shadow root. This is the only way to focus the composer programmatically. */
585
+ focus(options?: FocusOptions): void;
586
+ /** Blur the editable element. */
587
+ blur(): void;
588
+ /** Empty the composer to a blank doc (resets the internal value + history baseline; fires kai-value-change). */
589
+ clear(): void;
590
+ /** Submit the current content programmatically, on the same path as Enter (fires kai-submit). Named `send`, not `submit`, to match the shared vocabulary and avoid any submit collision. */
591
+ send(): void;
592
+ /** Insert an atomic entity pill (skill/agent/plugin) at the caret without typing a trigger (fires kai-entity-add). */
593
+ insertEntity(entity: { kind: string; id: string; label: string; icon?: undefined | string; promptText?: undefined | string; data?: undefined | Record<string, unknown> }): void;
472
594
  }
473
595
 
474
596
  export interface KaiConfirmElement extends HTMLElement {
475
597
  /** Color mode (`auto` follows prefers-color-scheme). */
476
- theme?: 'light' | 'dark' | 'auto';
598
+ theme?: "light" | "dark" | "auto";
477
599
  /** The confirm definition (the CardEnvelope.data). Set as a JS PROPERTY: `el.data = { body, tone, actions:[…] }`. Import `ConfirmCardData` from `@kitn.ai/ui` for the full shape. */
478
- data?: Record<string, unknown>;
600
+ data?: { heading?: string; body?: string; tone?: "default" | "warning" | "danger"; actions: { id: string; label: string; style?: "primary" | "default" | "destructive"; payload?: unknown; default?: boolean }[]; dismissible?: boolean };
479
601
  /** Stable card id correlating every emitted CardEvent. Attribute: `card-id`. */
480
602
  cardId?: string;
481
603
  /** Heading rendered in the card chrome (= CardEnvelope.title). Attribute: `heading`. */
482
604
  heading?: string;
483
- /** Focus the default action on mount (off by default no focus-stealing). Attribute: `autofocus`. */
484
- autofocus?: boolean;
605
+ /** Focus the default action on mount (off by default, so nothing steals focus). Attribute: `autofocus`. Re-declares the DOM member `HTMLElement.autofocus`, so it is NOT optional here: an interface extending HTMLElement may only narrow it, and the element always carries a value for it. */
606
+ autofocus: boolean;
485
607
  /** Set when the user resolved this card; renders the read-only view. Property: `el.resolution = { kind:'action', action:'…' }`. */
486
608
  resolution?: Record<string, unknown>;
609
+ /** Focus the default action button (or the first action if none is default). The same target `autofocus` focuses on mount, but on demand. */
610
+ focus(options?: FocusOptions): void;
611
+ /** Activate an action by id: emits the `action` verb on kai-card and resolves the card (single-shot). With no id, invokes the default action. */
612
+ confirm(actionId?: string): void;
613
+ /** Trigger the dismiss path: emits `dismiss` on kai-card and optimistically collapses the card to its re-openable stub. */
614
+ dismiss(): void;
615
+ /** Re-open a dismissed card from its stub: emits `reopen` on kai-card. */
616
+ reopen(): void;
487
617
  }
488
618
 
489
619
  export interface KaiContextElement extends HTMLElement {
490
620
  /** Color mode (`auto` follows prefers-color-scheme). */
491
- theme?: 'light' | 'dark' | 'auto';
621
+ theme?: "light" | "dark" | "auto";
492
622
  /** Token-usage data. Set as a JS property. */
493
623
  context?: { usedTokens: number; maxTokens: number; inputTokens?: number; outputTokens?: number; reasoningTokens?: number; cacheTokens?: number; estimatedCost?: number };
494
624
  /** Fraction (0–1) above which the meter turns yellow. Defaults to `0.7` (70%). */
@@ -499,32 +629,52 @@ export interface KaiContextElement extends HTMLElement {
499
629
 
500
630
  export interface KaiConversationsElement extends HTMLElement {
501
631
  /** Color mode (`auto` follows prefers-color-scheme). */
502
- theme?: 'light' | 'dark' | 'auto';
503
- /** 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. */
504
- groups: { id: string; userId?: undefined | string; teamId?: undefined | string; name: string; sortOrder: number; createdAt: string }[];
505
- /** A flat list of conversation summaries; the component buckets them by recency for you. Ignored when `groups` is provided. Set as a JS property. */
506
- 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 }[];
632
+ theme?: "light" | "dark" | "auto";
633
+ /** The list's section headers (`{ id, name, sortOrder, createdAt }`), rendered in array order. A group carries no conversations of its own; it is matched against `conversations` by id, so the two props are complementary rather than alternatives. Omit for an ungrouped list. Set as a JS property. */
634
+ groups: { id: string; userId?: string; teamId?: string; name: string; sortOrder: number; createdAt: string }[];
635
+ /** Every conversation the list renders, flat. Each one is filed under the group whose `id` equals its `groupId`; one with no `groupId`, or with a `groupId` matching no entry in `groups`, falls into a trailing "Ungrouped" section, so nothing you pass in is ever dropped. There is no recency bucketing. Set as a JS property. Omit to supply them as `<kai-conversation>` light-DOM children instead, or for the empty state. */
636
+ conversations: { id: string; title: string; groupId?: string; scope: { type: "document" | "collection"; documentId?: string; filters?: { tags?: string[]; authors?: string[]; contentType?: "transcript" | "markdown"; dateRange?: { from: string; to: string } } }; messageCount: number; lastMessageAt: string; updatedAt: string; trailing?: string }[];
507
637
  /** The id of the currently-open conversation, highlighted in the list. */
508
638
  activeId?: string;
509
639
  /** 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. */
510
640
  collapsed?: boolean;
511
641
  /** Initial collapsed state when uncontrolled (default false). Use the `default-collapsed` attribute to start collapsed in plain HTML. */
512
642
  defaultCollapsed?: boolean;
643
+ /** Focus the built-in search input inside the shadow root. */
644
+ focus(options?: FocusOptions): void;
645
+ /** Clear the internal search query (resets the list filter) and fire kai-search with an empty string. */
646
+ clear(): void;
647
+ /** Programmatically select a conversation by id. The mirror of the kai-conversation-select event (a convenience over driving `activeId`). */
648
+ select(id: string): void;
649
+ /** Collapse the rail to its floating reopen button (fires `kai-collapse-toggle`). */
650
+ collapse(): void;
651
+ /** Expand the rail back to the full list (fires `kai-collapse-toggle`). */
652
+ expand(): void;
653
+ /** Toggle the rail collapsed/expanded (fires `kai-collapse-toggle`). */
654
+ toggle(): void;
513
655
  }
514
656
 
515
657
  export interface KaiDialogElement extends HTMLElement {
516
658
  /** Color mode (`auto` follows prefers-color-scheme). */
517
- theme?: 'light' | 'dark' | 'auto';
659
+ theme?: "light" | "dark" | "auto";
518
660
  /** 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`. */
519
661
  open?: boolean;
520
662
  /** Initial open state on mount (uncontrolled seed). */
521
663
  defaultOpen?: boolean;
664
+ /** Open it programmatically (no-op while disabled). */
665
+ show(): void;
666
+ /** Close it programmatically. */
667
+ hide(): void;
668
+ /** Flip the open state (closes while disabled). */
669
+ toggle(): void;
670
+ /** Move focus to the dialog panel (no-op while closed). */
671
+ focus(options?: FocusOptions): void;
522
672
  }
523
673
 
524
674
  export interface KaiEditableLabelElement extends HTMLElement {
525
675
  /** Color mode (`auto` follows prefers-color-scheme). */
526
- theme?: 'light' | 'dark' | 'auto';
527
- /** The label text settable and reflected to the `value` attribute. Read `el.value` for live state. */
676
+ theme?: "light" | "dark" | "auto";
677
+ /** The label text. Settable and reflected to the `value` attribute. Read `el.value` for live state. */
528
678
  value?: string;
529
679
  /** Controlled edit state. `el.editing = true` opens the field; reflected to the `editing` attribute. */
530
680
  editing?: boolean;
@@ -532,11 +682,17 @@ export interface KaiEditableLabelElement extends HTMLElement {
532
682
  placeholder?: string;
533
683
  /** Disable entering edit mode. */
534
684
  disabled?: boolean;
685
+ /** Switch the label into its editing field, which autofocuses and selects the current text. Same entry point as a user double-click, and a no-op while `disabled`. Commit with `commit()` or by blurring, abandon with `cancel()` or Escape. */
686
+ edit(): void;
687
+ /** Close the field and keep what was typed, exactly as blurring it does. `kai-rename` fires only when the text actually changed, so committing an untouched field is silent. A no-op while the field is closed. */
688
+ commit(): void;
689
+ /** Abandon the edit, exactly as Escape does: the original text is restored, the field closes and `kai-cancel` fires. `kai-rename` never fires, even if the field was edited. Also works when `editing` was set programmatically and the field has not rendered yet. */
690
+ cancel(): void;
535
691
  }
536
692
 
537
693
  export interface KaiEmbedElement extends HTMLElement {
538
694
  /** Color mode (`auto` follows prefers-color-scheme). */
539
- theme?: 'light' | 'dark' | 'auto';
695
+ theme?: "light" | "dark" | "auto";
540
696
  /** Stable card id correlating every emitted event. Set as an attribute or property. */
541
697
  cardId?: string;
542
698
  /** The embed payload (provider + id/url + options). Set as a JS **property** (object). */
@@ -545,7 +701,7 @@ export interface KaiEmbedElement extends HTMLElement {
545
701
 
546
702
  export interface KaiEmptyElement extends HTMLElement {
547
703
  /** Color mode (`auto` follows prefers-color-scheme). */
548
- theme?: 'light' | 'dark' | 'auto';
704
+ theme?: "light" | "dark" | "auto";
549
705
  /** Title text. Attribute: `empty-title` (`title` is a global HTML attribute). */
550
706
  emptyTitle?: string;
551
707
  /** Description text. */
@@ -554,8 +710,8 @@ export interface KaiEmptyElement extends HTMLElement {
554
710
 
555
711
  export interface KaiFeedbackBarElement extends HTMLElement {
556
712
  /** Color mode (`auto` follows prefers-color-scheme). */
557
- theme?: 'light' | 'dark' | 'auto';
558
- /** The banner label (e.g. "Was this helpful?"). Attribute: `bar-title` (`title` is avoided it's a global HTML attribute). */
713
+ theme?: "light" | "dark" | "auto";
714
+ /** The banner label (e.g. "Was this helpful?"). Attribute: `bar-title` (`title` is avoided because it is a global HTML attribute). */
559
715
  barTitle?: string;
560
716
  /** When set, a not-helpful vote opens an optional detail form before the thank-you confirmation. Attribute: `collect-detail`. */
561
717
  collectDetail?: boolean;
@@ -573,10 +729,10 @@ export interface KaiFeedbackBarElement extends HTMLElement {
573
729
 
574
730
  export interface KaiFileTreeElement extends HTMLElement {
575
731
  /** Color mode (`auto` follows prefers-color-scheme). */
576
- theme?: 'light' | 'dark' | 'auto';
732
+ theme?: "light" | "dark" | "auto";
577
733
  /** The files to render. Set as a JS property (array of `{ path, url?, code?, language?, type?, additions?, deletions?, status? }`). */
578
734
  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" }[];
579
- /** Selected file path highlighted in the tree. */
735
+ /** Selected file path, highlighted in the tree. */
580
736
  activeFile?: string;
581
737
  /** Folder paths expanded initially. Omit to start with all folders open. */
582
738
  defaultExpanded?: string[];
@@ -586,12 +742,12 @@ export interface KaiFileTreeElement extends HTMLElement {
586
742
 
587
743
  export interface KaiFileUploadElement extends HTMLElement {
588
744
  /** Color mode (`auto` follows prefers-color-scheme). */
589
- theme?: 'light' | 'dark' | 'auto';
745
+ theme?: "light" | "dark" | "auto";
590
746
  /** Allow selecting multiple files (default true). */
591
747
  multiple?: boolean;
592
748
  /** `accept` attribute for the file picker (e.g. `image/*`). */
593
749
  accept?: string;
594
- /** Disable the dropzone no clicking, no drag-and-drop. */
750
+ /** Disable the dropzone: no clicking, no drag-and-drop. */
595
751
  disabled?: boolean;
596
752
  /** Default dropzone label (overridable via the default slot). */
597
753
  label?: string;
@@ -599,9 +755,9 @@ export interface KaiFileUploadElement extends HTMLElement {
599
755
 
600
756
  export interface KaiFormElement extends HTMLElement {
601
757
  /** Color mode (`auto` follows prefers-color-scheme). */
602
- theme?: 'light' | 'dark' | 'auto';
603
- /** The form definition a JSON Schema (`type:'object'`) + `x-kai-*` UI hints (the CardEnvelope.data). Set as a JS PROPERTY: `el.data = { type:'object', properties:{…} }`. Import the `FormDefinition` type from `@kitn.ai/ui` for the full shape (it is self-referential, so the element types it loosely). */
604
- data?: Record<string, unknown>;
758
+ theme?: "light" | "dark" | "auto";
759
+ /** The form definition: a JSON Schema (`type:'object'`) + `x-kai-*` UI hints (the CardEnvelope.data). Set as a JS PROPERTY: `el.data = { type:'object', properties:{…} }`. Import the `FormDefinition` type from `@kitn.ai/ui` for the full shape. It IS self-referential (`FormField.properties` is another `FormField` map), and the generated `element-types.d.ts` inlines every named type, so the shipped declaration bottoms out in a `Record<string, unknown>` placeholder one level down rather than carrying the recursion. That is why `FormDefinition` is a `type` alias: an interface gets no implicit index signature, so it would not be assignable to that placeholder. */
760
+ data?: { type: "object"; title?: string; description?: string; required?: string[]; properties: Record<string, { type: "string" | "number" | "integer" | "boolean" | "array" | "object"; title?: string; description?: string; default?: unknown; enum?: unknown[]; format?: "email" | "uri" | "url" | "date" | "date-time" | "time"; minimum?: number; maximum?: number; minLength?: number; maxLength?: number; pattern?: string; minItems?: number; maxItems?: number; items?: Record<string, unknown> | { enum: unknown[] }; properties?: Record<string, Record<string, unknown>>; required?: string[]; readOnly?: boolean; "x-kai-widget"?: "textarea" | "slider" | "rating" | "radio" | "select" | "checkbox" | "password" | "switch"; "x-kai-placeholder"?: string; "x-kai-step"?: number }>; "x-kai-order"?: string[]; "x-kai-inlineMax"?: number; "x-kai-submitLabel"?: string; "x-kai-dismissible"?: boolean; "x-kai-actions"?: { id: string; label: string; variant?: "default" | "ghost" | "outline" }[] };
605
761
  /** Stable card id correlating every emitted CardEvent. Attribute: `card-id`. */
606
762
  cardId?: string;
607
763
  /** Heading rendered in the card chrome (= CardEnvelope.title). Attribute: `heading`. */
@@ -614,11 +770,23 @@ export interface KaiFormElement extends HTMLElement {
614
770
  defaultValues?: Record<string, unknown>;
615
771
  /** Disable all fields + submit. Attribute: `disabled`. */
616
772
  disabled?: boolean;
773
+ /** Focus the first control, or the first INVALID control after a failed validation. */
774
+ focus(options?: FocusOptions): void;
775
+ /** Validate + submit programmatically: focus the first invalid field on failure, else emit the `submit` CardEvent and resolve. Named `send`, not `submit`. */
776
+ send(): void;
777
+ /** Run client-side validation now and return `{ valid, errors? }` WITHOUT submitting. */
778
+ validate(): void;
779
+ /** Re-seed the form from each field's `default` and clear errors. */
780
+ reset(): void;
781
+ /** Trigger the dismiss path (emit `dismiss` + collapse to the re-openable stub). */
782
+ dismiss(): void;
783
+ /** Re-open a dismissed card from its stub (emit `reopen`). */
784
+ reopen(): void;
617
785
  }
618
786
 
619
787
  export interface KaiHoverCardElement extends HTMLElement {
620
788
  /** Color mode (`auto` follows prefers-color-scheme). */
621
- theme?: 'light' | 'dark' | 'auto';
789
+ theme?: "light" | "dark" | "auto";
622
790
  /** Delay (ms) before the card opens on hover. Defaults to 0 (focus opens it immediately too). */
623
791
  openDelay?: number;
624
792
  /** Delay (ms) before it closes after the pointer leaves. Defaults to 300. */
@@ -631,11 +799,17 @@ export interface KaiHoverCardElement extends HTMLElement {
631
799
  defaultOpen?: boolean;
632
800
  /** Suppress the hover behavior entirely without unmounting. */
633
801
  disabled?: boolean;
802
+ /** Open it programmatically (no-op while disabled). */
803
+ show(): void;
804
+ /** Close it programmatically. */
805
+ hide(): void;
806
+ /** Flip the open state (closes while disabled). */
807
+ toggle(): void;
634
808
  }
635
809
 
636
810
  export interface KaiIconElement extends HTMLElement {
637
811
  /** Color mode (`auto` follows prefers-color-scheme). */
638
- theme?: 'light' | 'dark' | 'auto';
812
+ theme?: "light" | "dark" | "auto";
639
813
  /** A curated icon name (e.g. `"mic"`, `"globe"`), an image URL/data-URI, or plain text. */
640
814
  name?: string;
641
815
  /** Size token: `sm` | `md` (default) | `lg`. */
@@ -644,7 +818,7 @@ export interface KaiIconElement extends HTMLElement {
644
818
 
645
819
  export interface KaiImageElement extends HTMLElement {
646
820
  /** Color mode (`auto` follows prefers-color-scheme). */
647
- theme?: 'light' | 'dark' | 'auto';
821
+ theme?: "light" | "dark" | "auto";
648
822
  /** Base64-encoded image data (pair with `media-type`). */
649
823
  base64?: string;
650
824
  /** Raw image bytes (set as a JS property). */
@@ -657,10 +831,10 @@ export interface KaiImageElement extends HTMLElement {
657
831
 
658
832
  export interface KaiInputElement extends HTMLElement {
659
833
  /** Color mode (`auto` follows prefers-color-scheme). */
660
- theme?: 'light' | 'dark' | 'auto';
834
+ theme?: "light" | "dark" | "auto";
661
835
  /** Native input type: `text` (default) · `email` · `url` · `search` · `tel` · `password` · `number`. Single-line only. */
662
836
  type?: string;
663
- /** 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. */
837
+ /** 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. */
664
838
  value?: string;
665
839
  /** Placeholder shown when empty. */
666
840
  placeholder?: string;
@@ -686,22 +860,28 @@ export interface KaiInputElement extends HTMLElement {
686
860
  autocomplete?: string;
687
861
  /** Virtual-keyboard hint forwarded to the inner input (e.g. `numeric`, `email`). */
688
862
  inputmode?: string;
863
+ /** Focus the inner input (the host can't reach into the shadow root). */
864
+ focus(options?: FocusOptions): void;
865
+ /** Select the inner input's text. */
866
+ select(): void;
867
+ /** Empty the value and fire `kai-change` with `''`. */
868
+ clear(): void;
689
869
  }
690
870
 
691
871
  export interface KaiKbdElement extends HTMLElement {
692
872
  /** Color mode (`auto` follows prefers-color-scheme). */
693
- theme?: 'light' | 'dark' | 'auto';
694
- /** 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. */
873
+ theme?: "light" | "dark" | "auto";
874
+ /** 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. */
695
875
  keys?: string;
696
876
  /** `mac` uses ⌘/⌥, `other` uses Ctrl. `auto` (default) sniffs the OS. */
697
- platform?: "other" | "auto" | "mac";
877
+ platform?: "auto" | "mac" | "other";
698
878
  /** Cap size: `sm` or `md`. Defaults to `md`. */
699
879
  size?: "sm" | "md";
700
880
  }
701
881
 
702
882
  export interface KaiLinkPreviewElement extends HTMLElement {
703
883
  /** Color mode (`auto` follows prefers-color-scheme). */
704
- theme?: 'light' | 'dark' | 'auto';
884
+ theme?: "light" | "dark" | "auto";
705
885
  /** Stable card id correlating every emitted event. Set as an attribute or property. */
706
886
  cardId?: string;
707
887
  /** The link payload (OG metadata). Set as a JS **property** (object). */
@@ -710,7 +890,7 @@ export interface KaiLinkPreviewElement extends HTMLElement {
710
890
 
711
891
  export interface KaiLoaderElement extends HTMLElement {
712
892
  /** Color mode (`auto` follows prefers-color-scheme). */
713
- theme?: 'light' | 'dark' | 'auto';
893
+ theme?: "light" | "dark" | "auto";
714
894
  /** The animation style: `'circular' | 'classic' | 'pulse' | 'pulse-dot' | 'dots' | 'typing' | 'wave' | 'bars' | 'terminal' | 'text-blink' | 'text-shimmer' | 'loading-dots'`. Defaults to `'circular'`. */
715
895
  variant?: "circular" | "classic" | "pulse" | "pulse-dot" | "dots" | "typing" | "wave" | "bars" | "terminal" | "text-blink" | "text-shimmer" | "loading-dots";
716
896
  /** Loader size: `'sm' | 'md' | 'lg'`. Defaults to `'md'`. */
@@ -721,11 +901,11 @@ export interface KaiLoaderElement extends HTMLElement {
721
901
 
722
902
  export interface KaiMarkdownElement extends HTMLElement {
723
903
  /** Color mode (`auto` follows prefers-color-scheme). */
724
- theme?: 'light' | 'dark' | 'auto';
904
+ theme?: "light" | "dark" | "auto";
725
905
  /** The markdown source to render. */
726
906
  content: string;
727
907
  /** Text/markdown sizing. */
728
- proseSize?: "sm" | "lg" | "xs" | "base";
908
+ proseSize?: "xs" | "sm" | "base" | "lg";
729
909
  /** Shiki theme for fenced code blocks. */
730
910
  codeTheme?: string;
731
911
  /** Disable syntax highlighting (no Shiki loads). */
@@ -734,40 +914,44 @@ export interface KaiMarkdownElement extends HTMLElement {
734
914
 
735
915
  export interface KaiMenuElement extends HTMLElement {
736
916
  /** Color mode (`auto` follows prefers-color-scheme). */
737
- theme?: 'light' | 'dark' | 'auto';
738
- /** Tree of menu items. Set as a JS property not an HTML attribute. */
917
+ theme?: "light" | "dark" | "auto";
918
+ /** Tree of menu items. Set as a JS property, not an HTML attribute. */
739
919
  items?: { id?: string; label?: string; icon?: string; shortcut?: string; checked?: boolean; radioGroup?: string; disabled?: boolean; separator?: boolean; heading?: boolean; items?: Record<string, unknown>[] }[];
740
920
  /** Optional placement hint (unused by the underlying Dropdown which always positions bottom-start, kept for future extension). */
741
921
  placement?: string;
742
- /** 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. */
922
+ /** 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. */
743
923
  triggerIcon?: string;
744
- /** Built-in trigger: a text label (e.g. `"High"`). */
924
+ /** Built-in trigger: a text label (e.g. `"High"`). This is the trigger's VISIBLE text, so it is also its accessible name, and `label` does not override it: an accessible name that does not contain the visible text is unreachable by speech input, which is what WCAG 2.5.3 (Label in Name) exists for. A slotted `slot="trigger"` replaces this built-in trigger entirely and is named differently; see `label`. */
745
925
  triggerLabel?: string;
746
926
  /** Built-in trigger: a trailing icon (e.g. `"chevron-down"` for a select look). */
747
927
  triggerIconTrailing?: string;
748
- /** Accessible name for an icon-only trigger (no visible label). */
928
+ /** Accessible name for a trigger with no visible label. Ignored when `triggerLabel` is set, which is already the visible name. It DOES name a slotted `slot="trigger"`, and that is a difference in what the two slots MEAN, not a limitation. `<kai-button>`'s slot IS the button's label, so text slotted there is the name and `label` steps aside. This slot is VISUAL content, a `+` or an `<svg>`, with the name supplied separately: decoration beside a name, never a second name competing with one. So `label` names the trigger here by design. Slotting a real WORD rather than a glyph makes that word a visible label, and an accessible name has to contain the visible text. Then either drop `label` or make it contain the word you slotted. */
749
929
  label?: string;
750
930
  /** 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`. */
751
931
  open?: boolean;
752
932
  /** Initial open state on mount (uncontrolled seed). */
753
933
  defaultOpen?: boolean;
754
- /** Disable the trigger click/keyboard and `show()` no longer open the menu. */
934
+ /** Disable the trigger: click/keyboard and `show()` no longer open the menu. */
755
935
  disabled?: boolean;
936
+ /** Open it programmatically (no-op while disabled). */
937
+ show(): void;
938
+ /** Close it programmatically. */
939
+ hide(): void;
940
+ /** Flip the open state (closes while disabled). */
941
+ toggle(): void;
756
942
  }
757
943
 
758
944
  export interface KaiMessageElement extends HTMLElement {
759
945
  /** Color mode (`auto` follows prefers-color-scheme). */
760
- theme?: 'light' | 'dark' | 'auto';
946
+ theme?: "light" | "dark" | "auto";
761
947
  /** The full message object. Set as a JS property. */
762
- 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" };
763
- /** Convenience for simple cases when not passing a `message` object. */
764
- role?: "user" | "assistant";
765
- /** Convenience content (used when `message` is not set). */
766
- content?: string;
948
+ message?: { id: string; role: "user" | "assistant"; parts: ({ type: "text"; text: string; raw?: { source: string; payload: unknown } } | { type: "reasoning"; text: string; label?: string; index?: number; streamId?: string; signature?: string; raw?: { source: string; payload: unknown } } | { type: "tool"; tool: { type: string; kind?: "command" | "file-change" | "search" | "fetch" | "mcp" | "image" | "generic"; state: "input-streaming" | "input-available" | "output-available" | "output-error"; input?: Record<string, unknown>; rawInput?: string; output?: Record<string, unknown>; toolCallId?: string; errorText?: string; raw?: { source: string; payload: unknown } }; raw?: { source: string; payload: unknown } } | { type: "card"; envelope: { 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 } }; raw?: { source: string; payload: unknown } } | { type: "source"; source: { id?: string; url?: string; title?: string; snippet?: string; index?: number }; raw?: { source: string; payload: unknown } } | { type: "file"; attachment: { id: string; type: "file" | "source-document"; filename?: string; mediaType?: string; url?: string; title?: string }; raw?: { source: string; payload: unknown } })[]; actions?: ("copy" | "like" | "dislike" | "regenerate" | "edit" | { id: string; label: string; icon?: string; tooltip?: string })[]; avatar?: { src?: string; fallback?: string; alt?: string }; feedback?: "like" | "dislike" };
949
+ /** Who is speaking: `'user'` or `'assistant'`. Convenience for simple cases when not passing a `message` object. This is the SEMANTIC role of the message, not an ARIA role. The name collides with the global ARIA `role` attribute, which is why the facade lifts it off the host (see `liftRoleOffHost`). Neither speaker is a valid ARIA role, so a `role="user"` left on `<kai-message>` is a CRITICAL axe `aria-roles` violation. The accessible role lives on the row inside the shadow root instead: `role="article"` plus an `aria-label` naming the speaker, matching the SolidJS `<Message>` component. Re-declares the DOM member `HTMLElement.role`, so it is NOT optional here: an interface extending HTMLElement may only narrow it, and the element always carries a value for it. */
950
+ role: "user" | "assistant";
767
951
  /** Force markdown on/off. Defaults to on for assistant, off for user. */
768
952
  markdown?: boolean;
769
953
  /** Text/markdown sizing for the message body. */
770
- proseSize?: "sm" | "lg" | "xs" | "base";
954
+ proseSize?: "xs" | "sm" | "base" | "lg";
771
955
  /** Shiki theme name used for fenced code blocks in the content. */
772
956
  codeTheme?: string;
773
957
  /** Disable syntax highlighting for code blocks (no Shiki loads). */
@@ -780,41 +964,55 @@ export interface KaiMessageElement extends HTMLElement {
780
964
  avatarFallback?: string;
781
965
  /** 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). */
782
966
  avatar?: string;
967
+ /** Optional card type -> custom-element tag overrides/additions for `card` parts (merged over the built-ins). Property: `el.cardTypes`. Typed as a plain string map (not the `CardTagMap` alias) so the generated React wrapper inlines it instead of emitting an unresolved named type. */
968
+ cardTypes?: Record<string, string>;
969
+ /** JSON Schemas for the card types this app renders, keyed by envelope type. The companion of `cardTypes`, which says what DRAWS a card while this says what a VALID one looks like. An OBJECT, so it is a JS property only: `el.cardSchemas = { 'pricing-table': pricingSchema }`, never an attribute. `createCardRegistry(...).validationSchemas` is exactly this shape. Without it the kit validates its own seven built-ins and leaves your own card type, the one your app actually cares about, as the only unchecked thing on screen. A schema here WINS over a built-in of the same name. Typed `Record<string, object>` rather than `Record<string, JsonSchema>` deliberately: an imported `.json` schema widens `"type"` to `string`, and an authored one carries `$schema`/`title`/`description`/`additionalProperties`, so the tighter type would reject both of the normal ways to supply one. */
970
+ cardSchemas?: Record<string, object>;
971
+ /** Copy the message content to the clipboard and show the copied check. */
972
+ copy(): void;
783
973
  }
784
974
 
785
975
  export interface KaiModelSwitcherElement extends HTMLElement {
786
976
  /** Color mode (`auto` follows prefers-color-scheme). */
787
- theme?: 'light' | 'dark' | 'auto';
788
- /** The selectable models. Set as a JS property (array). */
789
- models: { id: string; name: string; provider?: undefined | string; description?: undefined | string; group?: undefined | string }[];
977
+ theme?: "light" | "dark" | "auto";
978
+ /** The selectable models. Set as a JS property (array). Omit to supply them as `<kai-model>` light-DOM children instead; when both are present the property's models come first. */
979
+ models: { id: string; name: string; provider?: string; description?: string; group?: string }[];
790
980
  /** The currently-selected model id. Defaults to the first model. */
791
981
  currentModel?: string;
792
982
  /** 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`. */
793
983
  open?: boolean;
794
984
  /** Initial open state on mount (uncontrolled seed). */
795
985
  defaultOpen?: boolean;
796
- /** Disable the trigger click/keyboard and `show()` no longer open the dropdown. */
986
+ /** Disable the trigger: click/keyboard and `show()` no longer open the dropdown. */
797
987
  disabled?: boolean;
988
+ /** Open it programmatically (no-op while disabled). */
989
+ show(): void;
990
+ /** Close it programmatically. */
991
+ hide(): void;
992
+ /** Flip the open state (closes while disabled). */
993
+ toggle(): void;
798
994
  }
799
995
 
800
996
  export interface KaiNavElement extends HTMLElement {
801
997
  /** Color mode (`auto` follows prefers-color-scheme). */
802
- theme?: 'light' | 'dark' | 'auto';
998
+ theme?: "light" | "dark" | "auto";
803
999
  /** 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. */
804
- 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 }[];
1000
+ items?: { id: string; label?: string; icon?: string; badge?: string; trailing?: string; disabled?: boolean; children?: Record<string, unknown>[]; status?: { tone: "primary" | "info" | "success" | "warning" | "error" | "neutral"; label?: string; pulse?: boolean }; meta?: string; action?: { icon: string; label: string }; closable?: boolean }[];
805
1001
  /** Active item id (controlled). */
806
1002
  value?: string;
807
1003
  /** Initial active id when uncontrolled. */
808
1004
  defaultValue?: string;
809
1005
  /** Ids of group items collapsed on first render (groups default to expanded). Set as a JS property (array). */
810
1006
  defaultCollapsed?: string[];
1007
+ /** Activate an item by id (fires kai-nav-select). */
1008
+ select(id: string): void;
811
1009
  }
812
1010
 
813
1011
  export interface KaiNoticeElement extends HTMLElement {
814
1012
  /** Color mode (`auto` follows prefers-color-scheme). */
815
- theme?: 'light' | 'dark' | 'auto';
1013
+ theme?: "light" | "dark" | "auto";
816
1014
  /** `neutral` (default) · `info` · `warning` · `error` · `success`. Drives the leading icon's color and the a11y role (`alert` for errors, else `status`). */
817
- severity?: "error" | "info" | "success" | "warning" | "neutral";
1015
+ severity?: "neutral" | "info" | "warning" | "error" | "success";
818
1016
  /** Leading icon: omit for the severity default, `"none"` to hide it, or a named icon to override. */
819
1017
  icon?: string;
820
1018
  /** Show a dismiss (×) that hides the notice and emits `kai-dismiss`. */
@@ -823,7 +1021,7 @@ export interface KaiNoticeElement extends HTMLElement {
823
1021
 
824
1022
  export interface KaiPaneElement extends HTMLElement {
825
1023
  /** Color mode (`auto` follows prefers-color-scheme). */
826
- theme?: 'light' | 'dark' | 'auto';
1024
+ theme?: "light" | "dark" | "auto";
827
1025
  /** The pane title (the agent / window name). Named `headline` because `title` collides with the global `HTMLElement.title` attribute (it throws at registration). Attribute: `headline`. */
828
1026
  headline?: string;
829
1027
  /** A role / label shown under the title (e.g. "Reviewer", "claude-sonnet"). Attribute: `subtitle`. */
@@ -842,20 +1040,24 @@ export interface KaiPaneElement extends HTMLElement {
842
1040
 
843
1041
  export interface KaiPaneGroupElement extends HTMLElement {
844
1042
  /** Color mode (`auto` follows prefers-color-scheme). */
845
- theme?: 'light' | 'dark' | 'auto';
1043
+ theme?: "light" | "dark" | "auto";
846
1044
  /** The tabs to render. An array of `{ id, name, status?, needsAttention?, number? }` set as a JS PROPERTY (not an HTML attribute). */
847
1045
  tabs?: { id: string; name: string; status?: { tone: "working" | "idle" | "done" | "error" | "blocked"; label?: string; pulse?: boolean }; needsAttention?: boolean; number?: number }[];
848
1046
  /** 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). */
849
1047
  active?: string;
850
1048
  /** Highlight the frame as the ACTIVE group in a multi-group layout. Attribute: `focused`. */
851
1049
  focused?: boolean;
1050
+ /** Select a tab by id (fires `kai-tab-change`). Ignores unknown ids. */
1051
+ select(id: string): void;
1052
+ /** Focus the active tab in the strip. */
1053
+ focus(): void;
852
1054
  }
853
1055
 
854
1056
  export interface KaiPopoverElement extends HTMLElement {
855
1057
  /** Color mode (`auto` follows prefers-color-scheme). */
856
- theme?: 'light' | 'dark' | 'auto';
1058
+ theme?: "light" | "dark" | "auto";
857
1059
  /** Floating placement relative to the trigger (floating-ui placement). */
858
- placement?: "top" | "right" | "bottom" | "left" | "top-start" | "top-end" | "right-start" | "right-end" | "bottom-start" | "bottom-end" | "left-start" | "left-end";
1060
+ placement?: "top" | "right" | "bottom" | "left" | "bottom-end" | "bottom-start" | "left-end" | "left-start" | "right-end" | "right-start" | "top-end" | "top-start";
859
1061
  /** Gap in px between the trigger and the panel. */
860
1062
  gutter?: number;
861
1063
  /** 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`. */
@@ -864,11 +1066,17 @@ export interface KaiPopoverElement extends HTMLElement {
864
1066
  defaultOpen?: boolean;
865
1067
  /** Turn the popover off while keeping the trigger mounted (clicks and `show()` no longer open it). */
866
1068
  disabled?: boolean;
1069
+ /** Open it programmatically (no-op while disabled). */
1070
+ show(): void;
1071
+ /** Close it programmatically. */
1072
+ hide(): void;
1073
+ /** Flip the open state (closes while disabled). */
1074
+ toggle(): void;
867
1075
  }
868
1076
 
869
1077
  export interface KaiProgressBarElement extends HTMLElement {
870
1078
  /** Color mode (`auto` follows prefers-color-scheme). */
871
- theme?: 'light' | 'dark' | 'auto';
1079
+ theme?: "light" | "dark" | "auto";
872
1080
  /** Current progress value (0..max). Attribute: `value`. */
873
1081
  value?: number;
874
1082
  /** The value `value` runs to (default 100). Attribute: `max`. */
@@ -881,16 +1089,16 @@ export interface KaiProgressBarElement extends HTMLElement {
881
1089
 
882
1090
  export interface KaiPromptDockElement extends HTMLElement {
883
1091
  /** Color mode (`auto` follows prefers-color-scheme). */
884
- theme?: 'light' | 'dark' | 'auto';
885
- /** 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`. */
886
- frame?: "none" | "inset" | "edge";
887
- /** 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`. */
888
- appearance?: "outlined" | "filled" | "plain" | "soft";
1092
+ theme?: "light" | "dark" | "auto";
1093
+ /** 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`. */
1094
+ frame?: "inset" | "edge" | "none";
1095
+ /** 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`. */
1096
+ appearance?: "soft" | "outlined" | "filled" | "plain";
889
1097
  }
890
1098
 
891
1099
  export interface KaiPromptInputElement extends HTMLElement {
892
1100
  /** Color mode (`auto` follows prefers-color-scheme). */
893
- theme?: 'light' | 'dark' | 'auto';
1101
+ theme?: "light" | "dark" | "auto";
894
1102
  /** 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`. */
895
1103
  value?: string | ({ type: "text"; text: string } | { type: "entity"; entity: { kind: string; id: string; label: string; icon?: string; promptText?: string; data?: Record<string, unknown> } })[];
896
1104
  /** Placeholder text shown in the empty input. */
@@ -909,21 +1117,29 @@ export interface KaiPromptInputElement extends HTMLElement {
909
1117
  voice?: boolean;
910
1118
  /** 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`. */
911
1119
  stoppable?: boolean;
912
- /** 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. */
1120
+ /** Send-button visibility. `'always'` (default) always shows it; `'auto'` shows it only when there's text/attachments (an empty composer hides it, though 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. */
913
1121
  submit?: "always" | "auto";
914
1122
  /** 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`. */
915
1123
  attach?: boolean;
916
1124
  /** 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). */
917
1125
  attachments?: { id: string; type: "file" | "source-document"; filename?: string; mediaType?: string; url?: string; title?: string }[];
918
- /** 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. */
1126
+ /** 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. */
919
1127
  triggers?: { char: string; kind: string; items?: { id: string; label: string; icon?: string; description?: string; group?: string; kind?: string; promptText?: string; data?: Record<string, unknown> }[] }[];
920
1128
  /** 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. */
921
1129
  kindIcons?: Record<string, string>;
1130
+ /** Focus the text editor inside the shadow root (not the hidden file input). */
1131
+ focus(options?: FocusOptions): void;
1132
+ /** Blur the focused input control. */
1133
+ blur(): void;
1134
+ /** Clear the text and any staged attachments (fires kai-value-change / kai-attachments-change so a controlled consumer can react). */
1135
+ clear(): void;
1136
+ /** Send the current value programmatically, on the same path as Enter / the send button (fires kai-submit, then clears staged attachments). Named `send`, not `submit`, to avoid colliding with the `submit` prop. */
1137
+ send(): void;
922
1138
  }
923
1139
 
924
1140
  export interface KaiReasoningElement extends HTMLElement {
925
1141
  /** Color mode (`auto` follows prefers-color-scheme). */
926
- theme?: 'light' | 'dark' | 'auto';
1142
+ theme?: "light" | "dark" | "auto";
927
1143
  /** The reasoning text to display. */
928
1144
  text: string;
929
1145
  /** Trigger label. */
@@ -936,13 +1152,19 @@ export interface KaiReasoningElement extends HTMLElement {
936
1152
  streaming?: boolean;
937
1153
  /** Render `text` as markdown. */
938
1154
  markdown?: boolean;
939
- /** Gate the disclosure trigger programmatic `show()/hide()/toggle()` still work, but the trigger click no longer toggles. */
1155
+ /** Gate the disclosure trigger: programmatic `show()/hide()/toggle()` still work, but the trigger click no longer toggles. */
940
1156
  disabled?: boolean;
1157
+ /** Open it programmatically (no-op while disabled). */
1158
+ show(): void;
1159
+ /** Close it programmatically. */
1160
+ hide(): void;
1161
+ /** Flip the open state (closes while disabled). */
1162
+ toggle(): void;
941
1163
  }
942
1164
 
943
1165
  export interface KaiRemoteElement extends HTMLElement {
944
1166
  /** Color mode (`auto` follows prefers-color-scheme). */
945
- theme?: 'light' | 'dark' | 'auto';
1167
+ theme?: "light" | "dark" | "auto";
946
1168
  /** The remote card URL. Attribute: `src`. */
947
1169
  src?: string;
948
1170
  /** Exact provider origin (https: or http://localhost for dev). Attribute: `provider-origin`. */
@@ -955,18 +1177,22 @@ export interface KaiRemoteElement extends HTMLElement {
955
1177
 
956
1178
  export interface KaiResizableElement extends HTMLElement {
957
1179
  /** Color mode (`auto` follows prefers-color-scheme). */
958
- theme?: 'light' | 'dark' | 'auto';
1180
+ theme?: "light" | "dark" | "auto";
959
1181
  /** Layout axis: `horizontal` (row, default) or `vertical` (column). */
960
- orientation?: "vertical" | "horizontal";
1182
+ orientation?: "horizontal" | "vertical";
961
1183
  /** Which item index is maximized (null = none). Declarative source of truth. */
962
- maximizedIndex?: null | number;
963
- /** Divider affordance drawn inside each draggable handle's 8px grab zone: - `line` (default) a 1px hairline, transparent at rest, tinting on hover/drag. - `grip` a dotted grip handle. - `none` no visible divider, just the invisible hit-area. The full grab zone and keyboard/ARIA behavior are identical for all three. */
964
- handle?: "none" | "line" | "grip";
1184
+ maximizedIndex: number | null;
1185
+ /** Divider affordance drawn inside each draggable handle's 8px grab zone: - `line` (default): a 1px hairline, transparent at rest, tinting on hover/drag. - `grip`: a dotted grip handle. - `none`: no visible divider, just the invisible hit-area. The full grab zone and keyboard/ARIA behavior are identical for all three. */
1186
+ handle?: "line" | "grip" | "none";
1187
+ /** Imperatively maximize the item at `index` (thin wrapper over `maximizedIndex`). */
1188
+ maximize(index: number): void;
1189
+ /** Imperatively restore from the maximized layout. */
1190
+ restore(): void;
965
1191
  }
966
1192
 
967
1193
  export interface KaiResizableItemElement extends HTMLElement {
968
1194
  /** Color mode (`auto` follows prefers-color-scheme). */
969
- theme?: 'light' | 'dark' | 'auto';
1195
+ theme?: "light" | "dark" | "auto";
970
1196
  /** Initial main-axis size: `"280px"` (fixed) or `"25%"`/`25` (percent). Omitted → flexible. */
971
1197
  size?: string;
972
1198
  /** Minimum size during resize (px or %). */
@@ -975,17 +1201,17 @@ export interface KaiResizableItemElement extends HTMLElement {
975
1201
  max?: string;
976
1202
  /** Fix this panel's size; adjacent dividers become non-draggable. */
977
1203
  locked?: boolean;
978
- /** Hide this panel; its divider is dropped and the rest reflow. */
979
- hidden?: boolean;
980
- /** 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. */
1204
+ /** Hide this panel; its divider is dropped and the rest reflow. Re-declares the DOM member `HTMLElement.hidden`, so it is NOT optional here: an interface extending HTMLElement may only narrow it, and the element always carries a value for it. */
1205
+ hidden: boolean;
1206
+ /** 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. */
981
1207
  collapsed?: boolean;
982
1208
  }
983
1209
 
984
1210
  export interface KaiResponseStreamElement extends HTMLElement {
985
1211
  /** Color mode (`auto` follows prefers-color-scheme). */
986
- theme?: 'light' | 'dark' | 'auto';
987
- /** Text to stream. A string, or an `AsyncIterable<string>` (set as a JS property async iterables can't be HTML attributes). */
988
- text?: string | AsyncIterable<string>;
1212
+ theme?: "light" | "dark" | "auto";
1213
+ /** Text to stream. A string, or an `AsyncIterable<string>` (set as a JS property, since async iterables can't be HTML attributes). */
1214
+ text: string | AsyncIterable<string>;
989
1215
  /** Reveal animation. */
990
1216
  mode?: "typewriter" | "fade";
991
1217
  /** Characters/segments per tick. */
@@ -996,10 +1222,10 @@ export interface KaiResponseStreamElement extends HTMLElement {
996
1222
 
997
1223
  export interface KaiScopePickerElement extends HTMLElement {
998
1224
  /** Color mode (`auto` follows prefers-color-scheme). */
999
- theme?: 'light' | 'dark' | 'auto';
1000
- /** Authors to offer as scope filters. Set as a JS property. */
1225
+ theme?: "light" | "dark" | "auto";
1226
+ /** Authors to offer as scope filters. Omit to drop the Authors section (for a tag-only picker). Set as a JS property. */
1001
1227
  availableAuthors: string[];
1002
- /** Tags to offer as scope filters. Set as a JS property. */
1228
+ /** Tags to offer as scope filters. Omit to drop the Tags section (for an author-only picker). Set as a JS property. */
1003
1229
  availableTags: string[];
1004
1230
  /** The label shown on the trigger for the active scope. */
1005
1231
  currentLabel?: string;
@@ -1007,13 +1233,19 @@ export interface KaiScopePickerElement extends HTMLElement {
1007
1233
  open?: boolean;
1008
1234
  /** Initial open state on mount (uncontrolled seed). */
1009
1235
  defaultOpen?: boolean;
1010
- /** Disable the trigger click/keyboard and `show()` no longer open the dropdown. */
1236
+ /** Disable the trigger: click/keyboard and `show()` no longer open the dropdown. */
1011
1237
  disabled?: boolean;
1238
+ /** Open it programmatically (no-op while disabled). */
1239
+ show(): void;
1240
+ /** Close it programmatically. */
1241
+ hide(): void;
1242
+ /** Flip the open state (closes while disabled). */
1243
+ toggle(): void;
1012
1244
  }
1013
1245
 
1014
1246
  export interface KaiScreenElement extends HTMLElement {
1015
1247
  /** Color mode (`auto` follows prefers-color-scheme). */
1016
- theme?: 'light' | 'dark' | 'auto';
1248
+ theme?: "light" | "dark" | "auto";
1017
1249
  /** 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`. */
1018
1250
  open?: boolean;
1019
1251
  /** Initial open state on mount (uncontrolled seed). */
@@ -1024,30 +1256,38 @@ export interface KaiScreenElement extends HTMLElement {
1024
1256
  back?: boolean;
1025
1257
  /** Opt out of marking sibling elements inert/aria-hidden while open (for unusual layouts). */
1026
1258
  noInert?: boolean;
1259
+ /** Open it programmatically (no-op while disabled). */
1260
+ show(): void;
1261
+ /** Close it programmatically. */
1262
+ hide(): void;
1263
+ /** Flip the open state (closes while disabled). */
1264
+ toggle(): void;
1265
+ /** Move focus to the screen surface (no-op while closed). */
1266
+ focus(options?: FocusOptions): void;
1027
1267
  }
1028
1268
 
1029
1269
  export interface KaiScrollAreaElement extends HTMLElement {
1030
1270
  /** Color mode (`auto` follows prefers-color-scheme). */
1031
- theme?: 'light' | 'dark' | 'auto';
1271
+ theme?: "light" | "dark" | "auto";
1032
1272
  /** Which axis scrolls. `vertical` (default) · `horizontal` · `both`. The cross axis is clamped so content can't overflow it. */
1033
1273
  orientation?: "vertical" | "horizontal" | "both";
1034
1274
  }
1035
1275
 
1036
1276
  export interface KaiScrollButtonElement extends HTMLElement {
1037
1277
  /** Color mode (`auto` follows prefers-color-scheme). */
1038
- theme?: 'light' | 'dark' | 'auto';
1278
+ theme?: "light" | "dark" | "auto";
1039
1279
  /** 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="...">`. */
1040
1280
  for?: string;
1041
1281
  /** Button visual variant: `'outline' | 'ghost' | 'default'`. Defaults to `'outline'`. */
1042
- variant?: "default" | "ghost" | "outline";
1282
+ variant?: "outline" | "ghost" | "default";
1043
1283
  /** Button size token. Defaults to `'icon'` (square). */
1044
1284
  size?: "sm" | "md" | "lg" | "icon" | "icon-sm";
1045
1285
  }
1046
1286
 
1047
1287
  export interface KaiSearchElement extends HTMLElement {
1048
1288
  /** Color mode (`auto` follows prefers-color-scheme). */
1049
- theme?: 'light' | 'dark' | 'auto';
1050
- /** Controlled query settable and reflected to the `value` attribute. Read `el.value` for live state. */
1289
+ theme?: "light" | "dark" | "auto";
1290
+ /** Controlled query. Settable and reflected to the `value` attribute. Read `el.value` for live state. */
1051
1291
  value?: string;
1052
1292
  /** Placeholder. Defaults to `Search…`. */
1053
1293
  placeholder?: string;
@@ -1059,14 +1299,18 @@ export interface KaiSearchElement extends HTMLElement {
1059
1299
  loading?: boolean;
1060
1300
  /** 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. */
1061
1301
  shortcut?: string;
1302
+ /** Focus the search input inside the shadow root. A native `focus()` on the host lands on the host itself and never reaches it. */
1303
+ focus(): void;
1304
+ /** Empty the field and fire `kai-search` with an empty value immediately, cancelling any debounced search still in flight, then return focus to the input. Same path as the trailing clear button. */
1305
+ clear(): void;
1062
1306
  }
1063
1307
 
1064
1308
  export interface KaiSegmentedElement extends HTMLElement {
1065
1309
  /** Color mode (`auto` follows prefers-color-scheme). */
1066
- theme?: 'light' | 'dark' | 'auto';
1310
+ theme?: "light" | "dark" | "auto";
1067
1311
  /** The selectable segments, left to right. Set as a JS property (array). */
1068
1312
  options: { value: string; label: string; icon?: undefined | string }[];
1069
- /** 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. */
1313
+ /** 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. */
1070
1314
  value?: string;
1071
1315
  /** Control density: `sm` or `md`. Defaults to `md`. */
1072
1316
  size?: "sm" | "md";
@@ -1074,14 +1318,14 @@ export interface KaiSegmentedElement extends HTMLElement {
1074
1318
 
1075
1319
  export interface KaiSeparatorElement extends HTMLElement {
1076
1320
  /** Color mode (`auto` follows prefers-color-scheme). */
1077
- theme?: 'light' | 'dark' | 'auto';
1078
- /** `horizontal` (default, block + full-width) or `vertical` (a rule inside a flex/grid row it stretches to the row height). */
1079
- orientation?: "vertical" | "horizontal";
1321
+ theme?: "light" | "dark" | "auto";
1322
+ /** `horizontal` (default, block + full-width) or `vertical` (a rule inside a flex/grid row, stretching to the row height). */
1323
+ orientation?: "horizontal" | "vertical";
1080
1324
  }
1081
1325
 
1082
1326
  export interface KaiSettingItemElement extends HTMLElement {
1083
1327
  /** Color mode (`auto` follows prefers-color-scheme). */
1084
- theme?: 'light' | 'dark' | 'auto';
1328
+ theme?: "light" | "dark" | "auto";
1085
1329
  /** Row label (primary text). Attribute: `label`. */
1086
1330
  label?: string;
1087
1331
  /** Optional secondary description under the label. Attribute: `description`. */
@@ -1090,7 +1334,7 @@ export interface KaiSettingItemElement extends HTMLElement {
1090
1334
 
1091
1335
  export interface KaiSettingsGroupElement extends HTMLElement {
1092
1336
  /** Color mode (`auto` follows prefers-color-scheme). */
1093
- theme?: 'light' | 'dark' | 'auto';
1337
+ theme?: "light" | "dark" | "auto";
1094
1338
  /** Small section heading shown above the card. Attribute: `heading`. */
1095
1339
  heading?: string;
1096
1340
  /** Optional muted description under the heading. Attribute: `description`. */
@@ -1099,7 +1343,7 @@ export interface KaiSettingsGroupElement extends HTMLElement {
1099
1343
 
1100
1344
  export interface KaiSkeletonElement extends HTMLElement {
1101
1345
  /** Color mode (`auto` follows prefers-color-scheme). */
1102
- theme?: 'light' | 'dark' | 'auto';
1346
+ theme?: "light" | "dark" | "auto";
1103
1347
  /** `text` (one or more lines), `rect` (a block), or `circle` (round). Defaults to `text`. */
1104
1348
  variant?: "text" | "rect" | "circle";
1105
1349
  /** CSS width (e.g. `'12rem'`, `'60%'`). Defaults to full width (responsive); for `circle` it is the diameter. */
@@ -1112,19 +1356,19 @@ export interface KaiSkeletonElement extends HTMLElement {
1112
1356
 
1113
1357
  export interface KaiSkillsElement extends HTMLElement {
1114
1358
  /** Color mode (`auto` follows prefers-color-scheme). */
1115
- theme?: 'light' | 'dark' | 'auto';
1116
- /** The active skills to badge. Set as a JS property. */
1359
+ theme?: "light" | "dark" | "auto";
1360
+ /** The active skills to badge. Set as a JS property. Omit to supply them as `<kai-skill>` light-DOM children instead; when both are present the property's skills come first. Nothing renders when there are none. */
1117
1361
  skills: { id: string; name: string }[];
1118
1362
  }
1119
1363
 
1120
1364
  export interface KaiSourceElement extends HTMLElement {
1121
1365
  /** Color mode (`auto` follows prefers-color-scheme). */
1122
- theme?: 'light' | 'dark' | 'auto';
1366
+ theme?: "light" | "dark" | "auto";
1123
1367
  /** The URL this citation links to (the domain also seeds the default label/favicon). */
1124
1368
  href?: string;
1125
1369
  /** Trigger label (defaults to the domain). */
1126
1370
  label?: string;
1127
- /** Hover-card headline. Attribute: `headline` (`title` is avoided it's a global HTML attribute that reflects in a CE constructor and breaks it). */
1371
+ /** Hover-card headline. Attribute: `headline` (`title` is avoided because it is a global HTML attribute that reflects in a CE constructor and breaks it). */
1128
1372
  headline?: string;
1129
1373
  /** Hover-card body text describing the source. */
1130
1374
  description?: string;
@@ -1134,18 +1378,18 @@ export interface KaiSourceElement extends HTMLElement {
1134
1378
 
1135
1379
  export interface KaiSourcesElement extends HTMLElement {
1136
1380
  /** Color mode (`auto` follows prefers-color-scheme). */
1137
- theme?: 'light' | 'dark' | 'auto';
1138
- /** The sources to render. Set as a JS property. */
1139
- sources: { href: string; title?: undefined | string; description?: undefined | string; label?: undefined | string; showFavicon?: undefined | boolean }[];
1381
+ theme?: "light" | "dark" | "auto";
1382
+ /** The sources to render. Set as a JS property. Omit to supply them as `<kai-source>` light-DOM children instead; when both are present the property's sources come first. */
1383
+ sources: { href: string; title?: string; description?: string; label?: string; showFavicon?: boolean }[];
1140
1384
  /** Show favicons on all items (per-item `showFavicon` overrides). */
1141
1385
  showFavicon?: boolean;
1142
- /** When true, each citation chip is labelled with its 1-based index in the merged (prop + declarative-children) list (`[1]`, `[2]`, …) instead of the per-item `label` or domain fallback. HTML attribute: `numbered` (boolean bare attribute or `numbered="true"`). JS property: `el.numbered = true`. */
1386
+ /** When true, each citation chip is labelled with its 1-based index in the merged (prop + declarative-children) list (`[1]`, `[2]`, …) instead of the per-item `label` or domain fallback. HTML attribute: `numbered` (boolean: a bare attribute or `numbered="true"`). JS property: `el.numbered = true`. */
1143
1387
  numbered?: boolean;
1144
1388
  }
1145
1389
 
1146
1390
  export interface KaiStatusElement extends HTMLElement {
1147
1391
  /** Color mode (`auto` follows prefers-color-scheme). */
1148
- theme?: 'light' | 'dark' | 'auto';
1392
+ theme?: "light" | "dark" | "auto";
1149
1393
  /** Presence/notification state → color. `new` (default) maps to the blue hue. */
1150
1394
  status?: "new" | "online" | "busy" | "away" | "offline";
1151
1395
  /** Animated ping ring (off by default; respects prefers-reduced-motion). */
@@ -1158,15 +1402,15 @@ export interface KaiStatusElement extends HTMLElement {
1158
1402
 
1159
1403
  export interface KaiSuggestionsElement extends HTMLElement {
1160
1404
  /** Color mode (`auto` follows prefers-color-scheme). */
1161
- theme?: 'light' | 'dark' | 'auto';
1162
- /** The suggestions. Strings, or `{ label, value }` when the displayed text and the emitted value differ. Set as a JS property. */
1163
- suggestions: (string | { label: string; value?: undefined | string; icon?: undefined | string })[];
1405
+ theme?: "light" | "dark" | "auto";
1406
+ /** The suggestions. Strings, or `{ label, value }` when the displayed text and the emitted value differ. Set as a JS property. Omit to supply them as `<kai-suggestion>` light-DOM children instead; when both are present the property's suggestions come first. */
1407
+ suggestions: (string | { label: string; value?: string; icon?: string })[];
1164
1408
  /** Chip style: `'outline'` (default), `'ghost'`, or `'default'` (filled). */
1165
- variant?: "default" | "ghost" | "outline";
1409
+ variant?: "outline" | "ghost" | "default";
1166
1410
  /** Row height for `layout="list"`: `'md'` (default) or `'lg'` for taller rows. Chips are unaffected. */
1167
1411
  size?: "md" | "lg";
1168
- /** 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. */
1169
- layout?: "list" | "chips";
1412
+ /** Layout: `'chips'` (default) renders a wrapping row of rounded pills; `'list'` renders a vertical, full-width "Ideas for you" list where each row is left-aligned with a leading `icon`, a label, and a hover background. */
1413
+ layout?: "chips" | "list";
1170
1414
  /** Full-width left-aligned rows instead of pills. */
1171
1415
  block?: boolean;
1172
1416
  /** Substring to highlight within each suggestion. */
@@ -1175,8 +1419,8 @@ export interface KaiSuggestionsElement extends HTMLElement {
1175
1419
 
1176
1420
  export interface KaiSwitchElement extends HTMLElement {
1177
1421
  /** Color mode (`auto` follows prefers-color-scheme). */
1178
- theme?: 'light' | 'dark' | 'auto';
1179
- /** 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. */
1422
+ theme?: "light" | "dark" | "auto";
1423
+ /** 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. */
1180
1424
  checked?: boolean;
1181
1425
  /** Initial checked state on mount (uncontrolled seed). Bare attribute (`<kai-switch default-checked>`) turns it on. */
1182
1426
  defaultChecked?: boolean;
@@ -1188,11 +1432,15 @@ export interface KaiSwitchElement extends HTMLElement {
1188
1432
  name?: string;
1189
1433
  /** Submitted value when checked (paired with `name`). Defaults to `'on'`. */
1190
1434
  value?: string;
1435
+ /** Flip the switch and fire `kai-change` (no-op while disabled). */
1436
+ toggle(): void;
1437
+ /** Focus the inner `role="switch"` button (the host element can't reach it). */
1438
+ focus(options?: FocusOptions): void;
1191
1439
  }
1192
1440
 
1193
1441
  export interface KaiTabsElement extends HTMLElement {
1194
1442
  /** Color mode (`auto` follows prefers-color-scheme). */
1195
- theme?: 'light' | 'dark' | 'auto';
1443
+ theme?: "light" | "dark" | "auto";
1196
1444
  /** Tabs to render. Set as a JS property, not an HTML attribute. */
1197
1445
  items?: { id: string; label?: string; icon?: string; disabled?: boolean }[];
1198
1446
  /** 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. */
@@ -1205,13 +1453,17 @@ export interface KaiTabsElement extends HTMLElement {
1205
1453
  block?: boolean;
1206
1454
  /** Disable the whole strip. */
1207
1455
  disabled?: boolean;
1456
+ /** Select a tab by id (fires `kai-tab-change`). Ignores unknown/disabled ids. */
1457
+ select(id: string): void;
1458
+ /** Focus the active tab (or the first focusable tab). */
1459
+ focus(): void;
1208
1460
  }
1209
1461
 
1210
1462
  export interface KaiTasksElement extends HTMLElement {
1211
1463
  /** Color mode (`auto` follows prefers-color-scheme). */
1212
- theme?: 'light' | 'dark' | 'auto';
1464
+ theme?: "light" | "dark" | "auto";
1213
1465
  /** The tasks definition (the CardEnvelope.data). Set as a JS PROPERTY: `el.data = { tasks:[…], selectAll, confirmLabel, … }`. Import `TasksCardData` from `@kitn.ai/ui` for the full shape. */
1214
- data?: Record<string, unknown>;
1466
+ data?: { mode?: "select" | "progress"; heading?: string; tasks: { id: string; label: string; description?: string; checked?: boolean; disabled?: boolean }[]; selectAll?: boolean; confirmLabel?: string; allowEmpty?: boolean; min?: number; max?: number; dismissible?: boolean };
1215
1467
  /** Stable card id correlating every emitted CardEvent. Attribute: `card-id`. */
1216
1468
  cardId?: string;
1217
1469
  /** Heading rendered in the card chrome (= CardEnvelope.title). Attribute: `heading`. */
@@ -1226,11 +1478,23 @@ export interface KaiTasksElement extends HTMLElement {
1226
1478
  disabled?: boolean;
1227
1479
  /** 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`. */
1228
1480
  readonly?: boolean;
1481
+ /** Set the checked task ids (local-only, no emit), respecting disabled/max. With no arg, select all toggleable rows. */
1482
+ select(taskIds?: string[]): void;
1483
+ /** Toggle one task by id, honoring the max gate (no `checked` = flip). */
1484
+ toggle(taskId: string, checked?: boolean): void;
1485
+ /** Confirm the current selection: emits the `submit` CardEvent + resolves (only when the min/max gate passes). Named `send`, not `submit`. */
1486
+ send(): void;
1487
+ /** Focus the task group (select-all checkbox if shown, else the first row). */
1488
+ focus(options?: FocusOptions): void;
1489
+ /** Trigger the dismiss path (emit `dismiss` + collapse to the re-openable stub). */
1490
+ dismiss(): void;
1491
+ /** Re-open a dismissed card from its stub (emit `reopen`). */
1492
+ reopen(): void;
1229
1493
  }
1230
1494
 
1231
1495
  export interface KaiTextShimmerElement extends HTMLElement {
1232
1496
  /** Color mode (`auto` follows prefers-color-scheme). */
1233
- theme?: 'light' | 'dark' | 'auto';
1497
+ theme?: "light" | "dark" | "auto";
1234
1498
  /** The text to shimmer. */
1235
1499
  text?: string;
1236
1500
  /** Element tag to render as (default `span`). */
@@ -1243,7 +1507,7 @@ export interface KaiTextShimmerElement extends HTMLElement {
1243
1507
 
1244
1508
  export interface KaiThinkingBarElement extends HTMLElement {
1245
1509
  /** Color mode (`auto` follows prefers-color-scheme). */
1246
- theme?: 'light' | 'dark' | 'auto';
1510
+ theme?: "light" | "dark" | "auto";
1247
1511
  /** The shimmering label, e.g. "Thinking…". */
1248
1512
  text?: string;
1249
1513
  /** When true, show a "stop" affordance that fires a `stop` event. */
@@ -1254,13 +1518,13 @@ export interface KaiThinkingBarElement extends HTMLElement {
1254
1518
 
1255
1519
  export interface KaiThreadElement extends HTMLElement {
1256
1520
  /** Color mode (`auto` follows prefers-color-scheme). */
1257
- theme?: 'light' | 'dark' | 'auto';
1258
- /** The full message thread to render, newest last. Each entry carries its role, content, and optional reasoning/tools/attachments/actions/avatar. Set as a JS property (`el.messages = [...]`); a NEW array reference per streaming chunk re-renders (mutating in place does not). */
1259
- messages?: { 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" }[];
1260
- /** Show a typing indicator on the pending assistant turn set while awaiting the assistant's reply. */
1521
+ theme?: "light" | "dark" | "auto";
1522
+ /** The full message thread to render, newest last. Each entry carries its role, ordered `parts`, and optional actions/avatar/feedback. Set as a JS property (`el.messages = [...]`); a NEW array reference per streaming chunk re-renders (mutating in place does not). */
1523
+ messages?: { id: string; role: "user" | "assistant"; parts: ({ type: "text"; text: string; raw?: { source: string; payload: unknown } } | { type: "reasoning"; text: string; label?: string; index?: number; streamId?: string; signature?: string; raw?: { source: string; payload: unknown } } | { type: "tool"; tool: { type: string; kind?: "command" | "file-change" | "search" | "fetch" | "mcp" | "image" | "generic"; state: "input-streaming" | "input-available" | "output-available" | "output-error"; input?: Record<string, unknown>; rawInput?: string; output?: Record<string, unknown>; toolCallId?: string; errorText?: string; raw?: { source: string; payload: unknown } }; raw?: { source: string; payload: unknown } } | { type: "card"; envelope: { 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 } }; raw?: { source: string; payload: unknown } } | { type: "source"; source: { id?: string; url?: string; title?: string; snippet?: string; index?: number }; raw?: { source: string; payload: unknown } } | { type: "file"; attachment: { id: string; type: "file" | "source-document"; filename?: string; mediaType?: string; url?: string; title?: string }; raw?: { source: string; payload: unknown } })[]; actions?: ("copy" | "like" | "dislike" | "regenerate" | "edit" | { id: string; label: string; icon?: string; tooltip?: string })[]; avatar?: { src?: string; fallback?: string; alt?: string }; feedback?: "like" | "dislike" }[];
1524
+ /** Show a typing indicator on the pending assistant turn. Set it while awaiting the assistant's reply. */
1261
1525
  loading?: boolean;
1262
1526
  /** Body/prose font scale for rendered markdown (`'xs' | 'sm' | 'base' | 'lg'`). Defaults to `'sm'`. */
1263
- proseSize?: "sm" | "lg" | "xs" | "base";
1527
+ proseSize?: "xs" | "sm" | "base" | "lg";
1264
1528
  /** Shiki theme name for syntax-highlighted code blocks (e.g. `'github-dark-dimmed'`). */
1265
1529
  codeTheme?: string;
1266
1530
  /** Enable Shiki syntax highlighting in code blocks. Turn off to render plain `<pre>` blocks (lighter, no highlighter load). Default true. */
@@ -1271,13 +1535,19 @@ export interface KaiThreadElement extends HTMLElement {
1271
1535
  scrollButton?: boolean;
1272
1536
  /** Extra classes applied to the thread's inner root. */
1273
1537
  class?: string;
1538
+ /** Optional card type -> custom-element tag overrides/additions for `card` parts (merged over the built-ins). Property: `el.cardTypes`. Typed as a plain string map (not the `CardTagMap` alias) so the generated React wrapper inlines it instead of emitting an unresolved named type. */
1539
+ cardTypes?: Record<string, string>;
1540
+ /** JSON Schemas for the card types this app renders, keyed by envelope type. The companion of `cardTypes`, which says what DRAWS a card while this says what a VALID one looks like. An OBJECT, so it is a JS property only: `el.cardSchemas = { 'pricing-table': pricingSchema }`, never an attribute. `createCardRegistry(...).validationSchemas` is exactly this shape. Without it the kit validates its own seven built-ins and leaves your own card type, the one your app actually cares about, as the only unchecked thing on screen. A schema here WINS over a built-in of the same name. Typed `Record<string, object>` rather than `Record<string, JsonSchema>` deliberately: an imported `.json` schema widens `"type"` to `string`, and an authored one carries `$schema`/`title`/`description`/`additionalProperties`, so the tighter type would reject both of the normal ways to supply one. */
1541
+ cardSchemas?: Record<string, object>;
1542
+ /** Scroll the message list to the bottom (default `'smooth'`). */
1543
+ scrollToBottom(behavior?: "auto" | "instant" | "smooth"): void;
1274
1544
  }
1275
1545
 
1276
1546
  export interface KaiToastRegionElement extends HTMLElement {
1277
1547
  /** Color mode (`auto` follows prefers-color-scheme). */
1278
- theme?: 'light' | 'dark' | 'auto';
1279
- /** The toasts to render. Newest is shown on top. Set as a JS property (array); pass a new array reference to update. */
1280
- 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 }[];
1548
+ theme?: "light" | "dark" | "auto";
1549
+ /** The toasts to render. Newest is shown on top. Set as a JS property (array); pass a new array reference to update. Omit for an empty region, which is the normal resting state and how the imperative `toast()` API starts. */
1550
+ toasts: { id: string; message: string; variant?: "neutral" | "success" | "warning" | "error" | "info"; appearance?: "pill" | "card"; inverse?: boolean; description?: string; action?: { label: string; onAction: () => void | false }; duration?: number; dismissible?: boolean; target?: HTMLElement }[];
1281
1551
  /** Stack anchor: `'top-center'` (default), `'top-right'`, `'bottom-center'`, … */
1282
1552
  position?: "top-center" | "top-right" | "top-left" | "bottom-center" | "bottom-right" | "bottom-left";
1283
1553
  /** Max simultaneously-visible toasts; the rest queue. Defaults to `3`. */
@@ -1294,20 +1564,26 @@ export interface KaiToastRegionElement extends HTMLElement {
1294
1564
 
1295
1565
  export interface KaiToolElement extends HTMLElement {
1296
1566
  /** Color mode (`auto` follows prefers-color-scheme). */
1297
- theme?: 'light' | 'dark' | 'auto';
1567
+ theme?: "light" | "dark" | "auto";
1298
1568
  /** The tool-call to display. Set as a JS property. */
1299
- tool?: { type: string; state: "input-streaming" | "input-available" | "output-available" | "output-error"; input?: Record<string, unknown>; output?: Record<string, unknown>; toolCallId?: string; errorText?: string };
1569
+ tool?: { type: string; kind?: "command" | "file-change" | "search" | "fetch" | "mcp" | "image" | "generic"; state: "input-streaming" | "input-available" | "output-available" | "output-error"; input?: Record<string, unknown>; rawInput?: string; output?: Record<string, unknown>; toolCallId?: string; errorText?: string; raw?: { source: string; payload: unknown } };
1300
1570
  /** 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`. */
1301
1571
  open?: boolean;
1302
1572
  /** Initial open state on mount (uncontrolled seed). */
1303
1573
  defaultOpen?: boolean;
1304
- /** Gate the disclosure trigger programmatic `show()/hide()/toggle()` still work, but the trigger click no longer toggles. */
1574
+ /** Gate the disclosure trigger: programmatic `show()/hide()/toggle()` still work, but the trigger click no longer toggles. */
1305
1575
  disabled?: boolean;
1576
+ /** Open it programmatically (no-op while disabled). */
1577
+ show(): void;
1578
+ /** Close it programmatically. */
1579
+ hide(): void;
1580
+ /** Flip the open state (closes while disabled). */
1581
+ toggle(): void;
1306
1582
  }
1307
1583
 
1308
1584
  export interface KaiTooltipElement extends HTMLElement {
1309
1585
  /** Color mode (`auto` follows prefers-color-scheme). */
1310
- theme?: 'light' | 'dark' | 'auto';
1586
+ theme?: "light" | "dark" | "auto";
1311
1587
  /** The hint text shown on hover/focus of the slotted trigger. */
1312
1588
  content?: string;
1313
1589
  /** Delay (ms) before the tooltip appears on hover. Defaults to 600. Focus shows it immediately regardless. */
@@ -1322,12 +1598,18 @@ export interface KaiTooltipElement extends HTMLElement {
1322
1598
  defaultOpen?: boolean;
1323
1599
  /** Turn the tooltip off while keeping the trigger mounted (hover/focus and `show()` no longer open it). */
1324
1600
  disabled?: boolean;
1601
+ /** Open it programmatically (no-op while disabled). */
1602
+ show(): void;
1603
+ /** Close it programmatically. */
1604
+ hide(): void;
1605
+ /** Flip the open state (closes while disabled). */
1606
+ toggle(): void;
1325
1607
  }
1326
1608
 
1327
1609
  export interface KaiVoiceInputElement extends HTMLElement {
1328
1610
  /** Color mode (`auto` follows prefers-color-scheme). */
1329
- theme?: 'light' | 'dark' | 'auto';
1330
- /** Transcriber the host supplies records audio, returns the text. This is a **function-valued property** (`el.transcribe = async blob => '...'`) because a value-returning callback can't be modelled as a fire-and-forget event. */
1611
+ theme?: "light" | "dark" | "auto";
1612
+ /** Transcriber the host supplies: records audio, returns the text. This is a **function-valued property** (`el.transcribe = async blob => '...'`) because a value-returning callback can't be modelled as a fire-and-forget event. */
1331
1613
  transcribe?: (audio: Blob) => Promise<string>;
1332
1614
  /** Disable the mic button (non-interactive). */
1333
1615
  disabled?: boolean;
@@ -1335,38 +1617,50 @@ export interface KaiVoiceInputElement extends HTMLElement {
1335
1617
  recognitionLang?: string;
1336
1618
  /** Emit live partial transcripts (`kai-transcript-interim`) during native recognition. Attribute: `interim`. No-op on the transcribe/fallback paths. */
1337
1619
  interim?: boolean;
1620
+ /** Begin recording programmatically (e.g. push-to-talk bound to a global key). Runs the same getUserMedia path as clicking the mic; no-ops if already recording. */
1621
+ start(): void;
1622
+ /** Stop the in-progress recording, producing the blob (→ kai-audio-captured) and running transcription. Pairs with start() for push-to-talk. */
1623
+ stop(): void;
1338
1624
  }
1339
1625
 
1340
1626
  export interface KaiVoiceOutputElement extends HTMLElement {
1341
1627
  /** Color mode (`auto` follows prefers-color-scheme). */
1342
- theme?: 'light' | 'dark' | 'auto';
1628
+ theme?: "light" | "dark" | "auto";
1343
1629
  /** The utterance to read aloud. */
1344
1630
  text?: string;
1345
1631
  /** Speak automatically when `text` is set/changed. */
1346
1632
  autoplay?: boolean;
1347
- /** 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. */
1633
+ /** 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. */
1348
1634
  synthesize?: (text: string) => Promise<Blob>;
1349
1635
  /** Disable the button (non-interactive). */
1350
1636
  disabled?: boolean;
1637
+ /** Speak the current `text` (native, or via `synthesize` if set). */
1638
+ speak(): void;
1639
+ /** Pause playback (resumable). */
1640
+ pause(): void;
1641
+ /** Resume paused playback. */
1642
+ resume(): void;
1643
+ /** Stop playback and reset. */
1644
+ stop(): void;
1351
1645
  }
1352
1646
 
1353
1647
  export interface KaiWorkspaceElement extends HTMLElement {
1354
1648
  /** Color mode (`auto` follows prefers-color-scheme). */
1355
- theme?: 'light' | 'dark' | 'auto';
1356
- /** Pre-bucketed conversation groups for the sidebar. Set as a JS property. */
1357
- groups: { id: string; userId?: undefined | string; teamId?: undefined | string; name: string; sortOrder: number; createdAt: string }[];
1358
- /** Flat conversation list (auto-bucketed if `groups` is empty). Set as a JS property. */
1359
- 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 }[];
1649
+ theme?: "light" | "dark" | "auto";
1650
+ /** The sidebar's section headers, rendered in array order. A group carries no conversations of its own; it is matched against `conversations` by id, so the two props are complementary rather than alternatives. Omit for an ungrouped sidebar. Set as a JS property. */
1651
+ groups: { id: string; userId?: string; teamId?: string; name: string; sortOrder: number; createdAt: string }[];
1652
+ /** Every conversation in the sidebar, flat. Each one is filed under the group whose `id` equals its `groupId`; one with no `groupId`, or with a `groupId` matching no entry in `groups`, falls into a trailing ungrouped section (headerless when `compact`), so nothing you pass in is ever dropped. There is no recency bucketing. Set as a JS property. Omit for an empty sidebar, or when `no-conversations` replaces the built-in list with your own `sidebar-header` content. */
1653
+ conversations: { id: string; title: string; groupId?: string; scope: { type: "document" | "collection"; documentId?: string; filters?: { tags?: string[]; authors?: string[]; contentType?: "transcript" | "markdown"; dateRange?: { from: string; to: string } } }; messageCount: number; lastMessageAt: string; updatedAt: string; trailing?: string }[];
1360
1654
  /** Id of the open conversation, highlighted in the sidebar. */
1361
1655
  activeId?: string;
1362
- /** The active conversation's message thread, newest last. Set as a JS property. */
1363
- 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" }[];
1656
+ /** The active conversation's message thread, newest last. Set as a JS property (`el.messages = [...]`); a NEW array reference per streaming chunk re-renders (mutating in place does not). Omit for an empty thread. */
1657
+ messages: { id: string; role: "user" | "assistant"; parts: ({ type: "text"; text: string; raw?: { source: string; payload: unknown } } | { type: "reasoning"; text: string; label?: string; index?: number; streamId?: string; signature?: string; raw?: { source: string; payload: unknown } } | { type: "tool"; tool: { type: string; kind?: "command" | "file-change" | "search" | "fetch" | "mcp" | "image" | "generic"; state: "input-streaming" | "input-available" | "output-available" | "output-error"; input?: Record<string, unknown>; rawInput?: string; output?: Record<string, unknown>; toolCallId?: string; errorText?: string; raw?: { source: string; payload: unknown } }; raw?: { source: string; payload: unknown } } | { type: "card"; envelope: { 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 } }; raw?: { source: string; payload: unknown } } | { type: "source"; source: { id?: string; url?: string; title?: string; snippet?: string; index?: number }; raw?: { source: string; payload: unknown } } | { type: "file"; attachment: { id: string; type: "file" | "source-document"; filename?: string; mediaType?: string; url?: string; title?: string }; raw?: { source: string; payload: unknown } })[]; actions?: ("copy" | "like" | "dislike" | "regenerate" | "edit" | { id: string; label: string; icon?: string; tooltip?: string })[]; avatar?: { src?: string; fallback?: string; alt?: string }; feedback?: "like" | "dislike" }[];
1364
1658
  value?: string;
1365
1659
  placeholder?: string;
1366
1660
  loading?: boolean;
1367
1661
  suggestions?: string[];
1368
1662
  suggestionMode?: "submit" | "fill";
1369
- proseSize?: "sm" | "lg" | "xs" | "base";
1663
+ proseSize?: "xs" | "sm" | "base" | "lg";
1370
1664
  codeTheme?: string;
1371
1665
  codeHighlight?: boolean;
1372
1666
  chatTitle?: string;
@@ -1396,6 +1690,24 @@ export interface KaiWorkspaceElement extends HTMLElement {
1396
1690
  compact?: boolean;
1397
1691
  /** 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`. */
1398
1692
  noConversations?: boolean;
1693
+ /** Optional card type -> custom-element tag overrides/additions for `card` parts (merged over the built-ins). Property: `el.cardTypes`. Typed as a plain string map (not the `CardTagMap` alias) so the generated React wrapper inlines it instead of emitting an unresolved named type. */
1694
+ cardTypes?: Record<string, string>;
1695
+ /** JSON Schemas for the card types this app renders, keyed by envelope type. The companion of `cardTypes`, which says what DRAWS a card while this says what a VALID one looks like. An OBJECT, so it is a JS property only: `el.cardSchemas = { 'pricing-table': pricingSchema }`, never an attribute. `createCardRegistry(...).validationSchemas` is exactly this shape. Without it the kit validates its own seven built-ins and leaves your own card type, the one your app actually cares about, as the only unchecked thing on screen. A schema here WINS over a built-in of the same name. Typed `Record<string, object>` rather than `Record<string, JsonSchema>` deliberately: an imported `.json` schema widens `"type"` to `string`, and an authored one carries `$schema`/`title`/`description`/`additionalProperties`, so the tighter type would reject both of the normal ways to supply one. */
1696
+ cardSchemas?: Record<string, object>;
1697
+ /** Collapse/expand the conversation sidebar and fire `kai-sidebar-toggle`. */
1698
+ toggleSidebar(): void;
1699
+ /** Force the conversation sidebar collapsed (fires `kai-sidebar-toggle`). */
1700
+ collapseSidebar(): void;
1701
+ /** Force the conversation sidebar expanded (fires `kai-sidebar-toggle`). */
1702
+ expandSidebar(): void;
1703
+ /** Focus the thread's composer. */
1704
+ focus(options?: FocusOptions): void;
1705
+ /** Clear the thread draft + staged attachments. */
1706
+ clear(): void;
1707
+ /** Submit the current thread draft programmatically (fires `kai-submit`). */
1708
+ send(): void;
1709
+ /** Scroll the thread to the newest message. */
1710
+ scrollToBottom(behavior?: "auto" | "instant" | "smooth"): void;
1399
1711
  }
1400
1712
 
1401
1713
  declare global {
@@ -1482,3 +1794,2122 @@ declare global {
1482
1794
  'kai-workspace': KaiWorkspaceElement;
1483
1795
  }
1484
1796
  }
1797
+
1798
+ interface KaiElementJsxProps {
1799
+ id?: string;
1800
+ class?: string;
1801
+ className?: string;
1802
+ style?: Record<string, string | number> | string;
1803
+ slot?: string;
1804
+ part?: string;
1805
+ children?: unknown;
1806
+ ref?: unknown;
1807
+ [attr: string]: unknown;
1808
+ }
1809
+
1810
+ declare module 'react' {
1811
+ namespace JSX {
1812
+ interface IntrinsicElements {
1813
+ 'kai-agent-card': KaiElementJsxProps;
1814
+ 'kai-artifact': KaiElementJsxProps;
1815
+ 'kai-attachments': KaiElementJsxProps;
1816
+ 'kai-audio-visualizer': KaiElementJsxProps;
1817
+ 'kai-avatar': KaiElementJsxProps;
1818
+ 'kai-badge': KaiElementJsxProps;
1819
+ 'kai-button': KaiElementJsxProps;
1820
+ 'kai-card': KaiElementJsxProps;
1821
+ 'kai-cards': KaiElementJsxProps;
1822
+ 'kai-chain-of-thought': KaiElementJsxProps;
1823
+ 'kai-chat': KaiElementJsxProps;
1824
+ 'kai-checkpoint': KaiElementJsxProps;
1825
+ 'kai-choice': KaiElementJsxProps;
1826
+ 'kai-coachmark': KaiElementJsxProps;
1827
+ 'kai-code-block': KaiElementJsxProps;
1828
+ 'kai-command': KaiElementJsxProps;
1829
+ 'kai-compare': KaiElementJsxProps;
1830
+ 'kai-composer': KaiElementJsxProps;
1831
+ 'kai-confirm': KaiElementJsxProps;
1832
+ 'kai-context': KaiElementJsxProps;
1833
+ 'kai-conversations': KaiElementJsxProps;
1834
+ 'kai-dialog': KaiElementJsxProps;
1835
+ 'kai-editable-label': KaiElementJsxProps;
1836
+ 'kai-embed': KaiElementJsxProps;
1837
+ 'kai-empty': KaiElementJsxProps;
1838
+ 'kai-feedback-bar': KaiElementJsxProps;
1839
+ 'kai-file-tree': KaiElementJsxProps;
1840
+ 'kai-file-upload': KaiElementJsxProps;
1841
+ 'kai-form': KaiElementJsxProps;
1842
+ 'kai-hover-card': KaiElementJsxProps;
1843
+ 'kai-icon': KaiElementJsxProps;
1844
+ 'kai-image': KaiElementJsxProps;
1845
+ 'kai-input': KaiElementJsxProps;
1846
+ 'kai-kbd': KaiElementJsxProps;
1847
+ 'kai-link-preview': KaiElementJsxProps;
1848
+ 'kai-loader': KaiElementJsxProps;
1849
+ 'kai-markdown': KaiElementJsxProps;
1850
+ 'kai-menu': KaiElementJsxProps;
1851
+ 'kai-message': KaiElementJsxProps;
1852
+ 'kai-model-switcher': KaiElementJsxProps;
1853
+ 'kai-nav': KaiElementJsxProps;
1854
+ 'kai-notice': KaiElementJsxProps;
1855
+ 'kai-pane': KaiElementJsxProps;
1856
+ 'kai-pane-group': KaiElementJsxProps;
1857
+ 'kai-popover': KaiElementJsxProps;
1858
+ 'kai-progress-bar': KaiElementJsxProps;
1859
+ 'kai-prompt-dock': KaiElementJsxProps;
1860
+ 'kai-prompt-input': KaiElementJsxProps;
1861
+ 'kai-reasoning': KaiElementJsxProps;
1862
+ 'kai-remote': KaiElementJsxProps;
1863
+ 'kai-resizable': KaiElementJsxProps;
1864
+ 'kai-resizable-item': KaiElementJsxProps;
1865
+ 'kai-response-stream': KaiElementJsxProps;
1866
+ 'kai-scope-picker': KaiElementJsxProps;
1867
+ 'kai-screen': KaiElementJsxProps;
1868
+ 'kai-scroll-area': KaiElementJsxProps;
1869
+ 'kai-scroll-button': KaiElementJsxProps;
1870
+ 'kai-search': KaiElementJsxProps;
1871
+ 'kai-segmented': KaiElementJsxProps;
1872
+ 'kai-separator': KaiElementJsxProps;
1873
+ 'kai-setting-item': KaiElementJsxProps;
1874
+ 'kai-settings-group': KaiElementJsxProps;
1875
+ 'kai-skeleton': KaiElementJsxProps;
1876
+ 'kai-skills': KaiElementJsxProps;
1877
+ 'kai-source': KaiElementJsxProps;
1878
+ 'kai-sources': KaiElementJsxProps;
1879
+ 'kai-status': KaiElementJsxProps;
1880
+ 'kai-suggestions': KaiElementJsxProps;
1881
+ 'kai-switch': KaiElementJsxProps;
1882
+ 'kai-tabs': KaiElementJsxProps;
1883
+ 'kai-tasks': KaiElementJsxProps;
1884
+ 'kai-text-shimmer': KaiElementJsxProps;
1885
+ 'kai-thinking-bar': KaiElementJsxProps;
1886
+ 'kai-thread': KaiElementJsxProps;
1887
+ 'kai-toast-region': KaiElementJsxProps;
1888
+ 'kai-tool': KaiElementJsxProps;
1889
+ 'kai-tooltip': KaiElementJsxProps;
1890
+ 'kai-voice-input': KaiElementJsxProps;
1891
+ 'kai-voice-output': KaiElementJsxProps;
1892
+ 'kai-workspace': KaiElementJsxProps;
1893
+ }
1894
+ }
1895
+ }
1896
+
1897
+ export interface KaiAgentCardElementProps {
1898
+ /** Color mode (`auto` follows prefers-color-scheme). */
1899
+ theme?: "light" | "dark" | "auto";
1900
+ /** The agent's name, the primary label. Attribute: `name`. */
1901
+ name?: string;
1902
+ /** Selected / focused state: highlighted border + surface. Attribute: `active`. */
1903
+ active?: boolean;
1904
+ /** Raise a prominent "Needs you" pill plus a glowing amber edge. This is the attention-routing signal that pulls focus to this agent. Attribute: `needs-attention`. */
1905
+ needsAttention?: boolean;
1906
+ /** 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 }`. */
1907
+ status?: { tone: "working" | "idle" | "done" | "error" | "blocked"; label?: string; pulse?: boolean };
1908
+ }
1909
+
1910
+ export interface KaiArtifactElementProps {
1911
+ /** Color mode (`auto` follows prefers-color-scheme). */
1912
+ theme?: "light" | "dark" | "auto";
1913
+ /** URL the preview iframe frames. Consumer-controlled. */
1914
+ src?: string;
1915
+ /** Files for the Code tab tree + each file's preview `url`. Omit for a preview-only artifact (the Code tab then has nothing to show; pair it with `no-tabs` to hide the toggle). Set as a JS property (array). */
1916
+ files?: { path: string; url?: string; code?: string; language?: string; type?: "html" | "pdf" | "image" | "other"; additions?: number; deletions?: number; status?: "added" | "modified" | "deleted" | "renamed" | "untracked" }[];
1917
+ /** Controlled active tab: `preview` or `code`. When set, the artifact follows it (re-asserted on change). Leave unset for an uncontrolled tab (see `defaultTab`). */
1918
+ tab?: "preview" | "code";
1919
+ /** 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`. */
1920
+ defaultTab?: "preview" | "code";
1921
+ /** Selected file path. Syncs the tree highlight, Code source, and preview. */
1922
+ activeFile?: string;
1923
+ /** iframe `sandbox` override. Secure default `allow-scripts allow-forms` (NOT `allow-same-origin`). */
1924
+ sandbox?: string;
1925
+ /** Accessible title for the preview iframe. */
1926
+ iframeTitle?: string;
1927
+ /** Reflects the artifact's own maximized view-state (usually driven by the protocol). */
1928
+ maximized?: boolean;
1929
+ /** Show the expand-to-fill button (OPT-IN). */
1930
+ expandable?: boolean;
1931
+ /** Show the open-in-new-tab button (OPT-IN). */
1932
+ openInTab?: boolean;
1933
+ /** Hide back/forward. */
1934
+ noNav?: boolean;
1935
+ /** Hide reload. */
1936
+ noReload?: boolean;
1937
+ /** Hide home. */
1938
+ noHome?: boolean;
1939
+ /** Hide the address field. */
1940
+ noPathField?: boolean;
1941
+ /** Hide the Preview|Code toggle. */
1942
+ noTabs?: boolean;
1943
+ /** Standalone chrome: rounded corners + border (else square, borderless in-panel). */
1944
+ standalone?: boolean;
1945
+ /** Show the address but make it read-only (visible, nav-tracking, non-editable). */
1946
+ readonlyPath?: boolean;
1947
+ /** 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. */
1948
+ displayUrl?: string;
1949
+ }
1950
+
1951
+ export interface KaiAttachmentsElementProps {
1952
+ /** Color mode (`auto` follows prefers-color-scheme). */
1953
+ theme?: "light" | "dark" | "auto";
1954
+ /** The attachments to render. Omit (or pass an empty array) for the empty state, which shows `emptyText` if set and nothing otherwise. Set as a JS property (array). */
1955
+ items?: { id: string; type: "file" | "source-document"; filename?: string; mediaType?: string; url?: string; title?: string }[];
1956
+ /** Layout: `grid` = visual tiles, `inline` = icon + label chips, `list` = rows. */
1957
+ variant?: "grid" | "inline" | "list";
1958
+ /** Wrap each item in a hover card that previews its details. */
1959
+ hoverCard?: boolean;
1960
+ /** Show a remove button per item; clicking it fires a `kai-remove` event. */
1961
+ removable?: boolean;
1962
+ /** Also show the media type beneath the filename (non-grid variants). */
1963
+ showMediaType?: boolean;
1964
+ /** Text shown when `items` is empty. */
1965
+ emptyText?: string;
1966
+ }
1967
+
1968
+ export interface KaiAudioVisualizerElementProps {
1969
+ /** Color mode (`auto` follows prefers-color-scheme). */
1970
+ theme?: "light" | "dark" | "auto";
1971
+ /** Look to render: `bar` (default), `grid`, `radial`, `wave`, `aurora`, `custom`. `aura` is accepted as a LiveKit-markup alias for `aurora`. Attribute: `variant`. */
1972
+ variant?: string;
1973
+ /** `idle` (default), `connecting`, `listening`, `thinking`, `speaking`, `disconnected` (connection down: the dead, flat look). LiveKit's room-lifecycle state names are accepted as aliases. Attribute: `state`. */
1974
+ state?: string;
1975
+ /** `icon` | `sm` | `md` (default) | `lg` | `xl`. Attribute: `size`. */
1976
+ size?: string;
1977
+ /** Bars to draw. Bar and radial only. Attribute: `bar-count`. */
1978
+ barCount?: number;
1979
+ /** Grid only: rows and columns of the (always square) grid. Attribute: `count`. */
1980
+ count?: number;
1981
+ /** Radial only: ring distance from center, in px. Attribute: `radius`. */
1982
+ radius?: number;
1983
+ /** Grid only: ring distance for the connecting animation, in cells. Attribute: `spread`. */
1984
+ spread?: number;
1985
+ /** Grid only: ms between scripted frames. Attribute: `interval`. */
1986
+ interval?: number;
1987
+ /** CSS color for the geometry, overriding the inherited `currentColor`. Attribute: `color`. */
1988
+ color?: string;
1989
+ /** Shader variants only: pattern density, 0..1. Attribute: `complexity`. */
1990
+ complexity?: number;
1991
+ /** Setting this makes the element an announced image (`role="img"`) instead of decorative (`aria-hidden`). Attribute: `label`. */
1992
+ label?: string;
1993
+ /** Live microphone or WebRTC audio to analyze. JS property only. */
1994
+ stream?: MediaStream;
1995
+ /** An `<audio>` or `<video>` element to tap for its audio. JS property only. */
1996
+ audioElement?: HTMLMediaElement;
1997
+ /** Pre-computed levels, 0..1. Set this and no AudioContext is ever built, which is what keeps headless/SSR rendering and browser-speech-synthesis playback (which exposes no audio node) free of Web Audio entirely. JS property only. A new array reference is required for each update; mutating the existing array in place will not re-render. */
1998
+ bands?: number[];
1999
+ /** Custom fragment shader for `variant="custom"`. JS property only. */
2000
+ shader?: { fragment: string; uniforms?: Record<string, { type: "1f" | "1i" | "1fv" | "2f" | "3f" | "3fv" | "4f" | "4fv" | "Matrix2fv" | "Matrix3fv" | "Matrix4fv"; value: number | number[] }> };
2001
+ /** Shader variants only: keep animating while scrolled off screen. Off by default, which stops drawing and releases the WebGL context until the element comes back (browsers ration contexts to roughly 16 a page). Does not override `prefers-reduced-motion`. Attribute: `animate-when-not-visible`. */
2002
+ animateWhenNotVisible?: boolean;
2003
+ }
2004
+
2005
+ export interface KaiAvatarElementProps {
2006
+ /** Color mode (`auto` follows prefers-color-scheme). */
2007
+ theme?: "light" | "dark" | "auto";
2008
+ /** Image URL/data-URI. When absent, the `fallback` initials show instead. */
2009
+ src?: string;
2010
+ /** Alt text for the image. Defaults to `fallback`. */
2011
+ alt?: string;
2012
+ /** Short text shown when there's no image, usually initials (e.g. "JD", "AI"). */
2013
+ fallback?: string;
2014
+ /** Size token: `sm` | `md` (default) | `lg`. */
2015
+ size?: "sm" | "md" | "lg";
2016
+ }
2017
+
2018
+ export interface KaiBadgeElementProps {
2019
+ /** Color mode (`auto` follows prefers-color-scheme). */
2020
+ theme?: "light" | "dark" | "auto";
2021
+ /** `default` (muted pill) · `count` (compact number badge) · `citation` (filled primary, for inline citation markers). Defaults to `default`. */
2022
+ variant?: "default" | "count" | "citation";
2023
+ }
2024
+
2025
+ export interface KaiButtonElementProps {
2026
+ /** Color mode (`auto` follows prefers-color-scheme). */
2027
+ theme?: "light" | "dark" | "auto";
2028
+ /** Visual style. `default` (filled), `subtle` (muted text, hover tint, the toolbar icon look), `ghost` (transparent, hover fill), `outline`, or `destructive`. Defaults to `default`. */
2029
+ variant?: "default" | "subtle" | "ghost" | "outline" | "destructive";
2030
+ /** Size token. `icon` / `icon-sm` are square (for icon-only buttons); `sm` / `md` / `lg` size text buttons. Defaults to `md`. */
2031
+ size?: "sm" | "md" | "lg" | "icon" | "icon-sm";
2032
+ /** Leading icon: a named icon (e.g. `"mic"`, `"plus"`), an image URL/data-URI, or plain text. Renders before any slotted label. */
2033
+ icon?: string;
2034
+ /** Trailing icon, after the label (e.g. `"chevron-down"` for a menu affordance). */
2035
+ iconTrailing?: string;
2036
+ /** Accessible name. REQUIRED for icon-only buttons (no visible text); ignored when you slot visible text, which already names the button. An `aria-label` on top of visible text REPLACES that name rather than adding to it, so a button reading "Save" that answers to "Submit" is unusable by speech input (WCAG 2.5.3, Label in Name). The visible text wins. An `icon` / `icon-sm` size hides the slot, which makes the button icon-only whatever you slotted, so `label` is what names it there. */
2037
+ label?: string;
2038
+ /** Disable the button (non-interactive, dimmed). */
2039
+ disabled?: boolean;
2040
+ /** Stretch the button to the full width of its container (a block button), e.g. a card CTA or a stacked action. Attribute: `full`. */
2041
+ full?: boolean;
2042
+ /** Justify the button's content: `start`, `center` (default), or `end`. Combine with `full` for a full-width, left-aligned button. */
2043
+ align?: "start" | "center" | "end";
2044
+ /** Native button `type`. Defaults to `button` (so it never submits a form). */
2045
+ type?: "button" | "submit" | "reset";
2046
+ }
2047
+
2048
+ export interface KaiCardElementProps {
2049
+ /** Color mode (`auto` follows prefers-color-scheme). */
2050
+ theme?: "light" | "dark" | "auto";
2051
+ /** Surface treatment: `outlined` (default) | `filled` | `plain` | `accent`. Attribute: `appearance`. */
2052
+ appearance?: "outlined" | "filled" | "plain" | "accent";
2053
+ /** `vertical` (default, media on top) | `horizontal` (media at the start) | `responsive` (horizontal when the card's container is wide enough, else vertical, via a container query on the card's own width). Attribute: `orientation`. */
2054
+ orientation?: "vertical" | "horizontal" | "responsive";
2055
+ /** The card width below which a `responsive` card collapses to vertical and the footer actions stack. A CSS length; default `28rem`. Attribute: `collapse`. */
2056
+ collapse?: string;
2057
+ /** Tighter spacing for dense lists. Attribute: `dense`. */
2058
+ dense?: boolean;
2059
+ /** Show a close (×) that hides the card and emits `kai-dismiss`. Attribute: `dismissible`. Off by default. */
2060
+ dismissible?: boolean;
2061
+ /** Render the whole card as a link. Attribute: `href`. Wins over `clickable`. */
2062
+ href?: string;
2063
+ /** `target` for the `href` anchor. Attribute: `target`. */
2064
+ target?: string;
2065
+ /** `rel` for the `href` anchor. Attribute: `rel`. */
2066
+ rel?: string;
2067
+ /** Make the whole card a button (`role="button"`, Enter/Space, hover affordance) that emits `kai-card-click`. Attribute: `clickable`. Ignored when `href` is set. */
2068
+ clickable?: boolean;
2069
+ }
2070
+
2071
+ export interface KaiCardsElementProps {
2072
+ /** Color mode (`auto` follows prefers-color-scheme). */
2073
+ theme?: "light" | "dark" | "auto";
2074
+ /** The stream of card envelopes to render. Set as a JS PROPERTY: `el.cards = [...]`. */
2075
+ 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 } }[];
2076
+ /** 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. */
2077
+ types?: Record<string, string>;
2078
+ /** JSON Schemas for the card types this app renders, keyed by envelope type. The companion of `types`, which says what DRAWS a card while this says what a VALID one looks like. An OBJECT, so it is a JS property only: `el.schemas = { 'pricing-table': pricingSchema }`, never an attribute. `createCardRegistry(...).validationSchemas` is exactly this shape. Without it the kit validates its own seven built-ins and leaves your own card type, the one your app actually cares about, as the only unchecked thing on screen. A schema here WINS over a built-in of the same name, matching `mergeCardTags`, where your entry is spread over ours. Typed `Record<string, object>` rather than `Record<string, JsonSchema>` deliberately: an imported `.json` schema widens `"type"` to `string`, and an authored one carries `$schema`/`title`/`description`/`additionalProperties`, so the tighter type would reject both of the normal ways to supply one. See `CardSchemaMap` in components/card-renderer.tsx. */
2079
+ schemas?: Record<string, object>;
2080
+ /** Optional CardPolicy handling child events. Property: `el.policy`. */
2081
+ 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" };
2082
+ /** Validate each envelope's `data` against the schema for its type before rendering it, using a built-in's own schema or yours from `schemas`. Default `true`; set `validate-cards="false"` (or `el.validateCards = false`) to opt out. A hard failure (wrong type, a missing required field) renders a diagnostic naming the field instead of the card; a soft failure (bounds) renders the card unchanged. Both emit a contract `error` event. On in production too: a model emitting a bad shape is a production failure mode, so stripping the check there would hide it from exactly the person who needs to see it. */
2083
+ validateCards?: boolean;
2084
+ }
2085
+
2086
+ export interface KaiChainOfThoughtElementProps {
2087
+ /** Color mode (`auto` follows prefers-color-scheme). */
2088
+ theme?: "light" | "dark" | "auto";
2089
+ /** The reasoning steps. Set as a JS property. Compound sub-parts collapse to this one data model (Route 1). Each `{ label, content?, id? }`. Omit to supply the steps as `<kai-step>` light-DOM children instead; when both are present the property's steps come first. */
2090
+ steps?: { label: string; content?: string; id?: string }[];
2091
+ /** Open mode: `'multiple'` (default, any number of steps open at once) or `'single'` (at most one open; opening a step closes the others). */
2092
+ type?: "single" | "multiple";
2093
+ /** 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. */
2094
+ value?: string | string[];
2095
+ /** Uncontrolled INITIAL open step key(s), seeding which steps render expanded. Ignored once `value` is provided. Set as a JS property. */
2096
+ defaultValue?: string | string[];
2097
+ }
2098
+
2099
+ export interface KaiChatElementProps {
2100
+ /** Color mode (`auto` follows prefers-color-scheme). */
2101
+ theme?: "light" | "dark" | "auto";
2102
+ /** Show a Search (Globe) button in the input toolbar; fires a `search` event. */
2103
+ search?: boolean;
2104
+ /** 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. */
2105
+ value?: string | ({ type: "text"; text: string } | { type: "entity"; entity: { kind: string; id: string; label: string; icon?: string; promptText?: string; data?: Record<string, unknown> } })[];
2106
+ /** Placeholder text shown in the empty input. */
2107
+ placeholder?: string;
2108
+ /** When true, shows the loading/streaming state and disables submit (use while awaiting the assistant's reply). */
2109
+ loading?: boolean;
2110
+ /** Starter prompts shown above the input when the thread is empty. Clicking one follows `suggestionMode`. Set as a JS property. */
2111
+ suggestions?: string[];
2112
+ /** What clicking a suggestion does: `'submit'` (default) sends it immediately as if typed and submitted; `'fill'` just places it in the input. */
2113
+ suggestionMode?: "submit" | "fill";
2114
+ /** 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. */
2115
+ persistSuggestions?: boolean;
2116
+ /** Body/prose font scale for rendered markdown (`'xs' | 'sm' | 'base' | 'lg'`). Defaults to `'sm'`. */
2117
+ proseSize?: "xs" | "sm" | "base" | "lg";
2118
+ /** Shiki theme name for syntax-highlighted code blocks (e.g. `'github-dark-dimmed'`). */
2119
+ codeTheme?: string;
2120
+ /** Enable Shiki syntax highlighting in code blocks. Turn off to render plain `<pre>` blocks (lighter, no highlighter load). Default true. */
2121
+ codeHighlight?: boolean;
2122
+ /** Optional header title shown on the left of the header. */
2123
+ chatTitle?: string;
2124
+ /** Optional model list. When set (>1 model) a ModelSwitcher is shown in the header and a `kai-model-change` event fires on selection. */
2125
+ models?: { id: string; name: string; provider?: string; description?: string; group?: string }[];
2126
+ /** The currently selected model id (pairs with `models`). */
2127
+ currentModel?: string;
2128
+ /** Optional context-window token usage. When set, a Context token meter is shown in the header. */
2129
+ context?: { usedTokens: number; maxTokens: number; inputTokens?: number; outputTokens?: number; estimatedCost?: number };
2130
+ /** Show the scroll-to-bottom button inside the scroll area. Default true. */
2131
+ scrollButton?: boolean;
2132
+ /** Whether the host has `slot="header-start"` content (left of the title). Set by the `<kai-chat>` facade so a custom control forces the header open. */
2133
+ headerStart?: boolean;
2134
+ /** Whether the host has `slot="header-end"` content (right of the controls). */
2135
+ headerEnd?: boolean;
2136
+ /** REPLACE: full custom header in place of the built-in title/model/context bar. */
2137
+ headerFull?: boolean;
2138
+ /** INJECT: left sidebar column (e.g. a conversation list / your own nav). */
2139
+ sidebar?: boolean;
2140
+ /** 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). */
2141
+ empty?: boolean;
2142
+ /** REPLACE: full custom composer in place of the built-in prompt input. The projected content wires its own submit (the data-flow boundary). */
2143
+ composer?: boolean;
2144
+ /** INJECT: accessory row just above the composer (e.g. extra actions). */
2145
+ composerActions?: boolean;
2146
+ /** INJECT: footer row below the composer (disclaimers, token meter, …). */
2147
+ footer?: boolean;
2148
+ /** Show a Voice (Mic) button in the input toolbar; fires a `voice` event. */
2149
+ voice?: boolean;
2150
+ /** 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. */
2151
+ triggers?: { char: string; kind: string; items?: { id: string; label: string; icon?: string; description?: string; group?: string; kind?: string; promptText?: string; data?: Record<string, unknown> }[] }[];
2152
+ /** Default icon per entity kind (kind → image src) for pills/menu items. */
2153
+ kindIcons?: Record<string, string>;
2154
+ /** Whether each message's action bar is always visible (`'always'`, default) or only revealed on hover of that message row (`'hover'`). */
2155
+ actionsReveal?: "always" | "hover";
2156
+ /** Which attachment media types the user may stage, in HTML `accept` syntax: `<kai-chat accept="image/*,application/pdf">`. A plain string, so unlike `messages` it DOES work as an attribute. Omitted means no filter. MEDIA TYPES ONLY -- exact (`image/png`) or subtype wildcard (`text/*`). HTML allows a file extension here and this does not: `accept=".py"` THROWS with the entry named, rather than silently resolving to a picker that accepts nothing. It can only NARROW what the kit can already encode: `accept="image/*"` resolves to the four image formats both APIs take, not to every image type the OS offers. Pass the SAME string to `toOpenAIMessages(msgs, { accept })` and the picker and the wire cannot disagree -- both resolve it through `resolveMediaPolicy` against one declaration. That declaration is readable as `encodableMediaTypes()` from `@kitn.ai/ui/wire`, if you would rather build your own picker than use this prop. */
2157
+ accept?: string;
2158
+ /** The full message thread to render, newest last. Each entry carries its role, ordered `parts`, and optional actions/avatar/feedback. Set as a JS property (`el.messages = [...]`); a NEW array reference per streaming chunk re-renders (mutating in place does not). Omit for an empty thread. Re-declared here (rather than inherited from `ChatThreadProps`) because the ELEMENT registers a `[]` default and renders the empty state without it, while the SolidJS `<ChatThread>` component still requires it. The facade hands it a validated array either way. Matches `<kai-thread>`. */
2159
+ messages?: { id: string; role: "user" | "assistant"; parts: ({ type: "text"; text: string; raw?: { source: string; payload: unknown } } | { type: "reasoning"; text: string; label?: string; index?: number; streamId?: string; signature?: string; raw?: { source: string; payload: unknown } } | { type: "tool"; tool: { type: string; kind?: "command" | "file-change" | "search" | "fetch" | "mcp" | "image" | "generic"; state: "input-streaming" | "input-available" | "output-available" | "output-error"; input?: Record<string, unknown>; rawInput?: string; output?: Record<string, unknown>; toolCallId?: string; errorText?: string; raw?: { source: string; payload: unknown } }; raw?: { source: string; payload: unknown } } | { type: "card"; envelope: { 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 } }; raw?: { source: string; payload: unknown } } | { type: "source"; source: { id?: string; url?: string; title?: string; snippet?: string; index?: number }; raw?: { source: string; payload: unknown } } | { type: "file"; attachment: { id: string; type: "file" | "source-document"; filename?: string; mediaType?: string; url?: string; title?: string }; raw?: { source: string; payload: unknown } })[]; actions?: ("copy" | "like" | "dislike" | "regenerate" | "edit" | { id: string; label: string; icon?: string; tooltip?: string })[]; avatar?: { src?: string; fallback?: string; alt?: string }; feedback?: "like" | "dislike" }[];
2160
+ /** Optional card type -> custom-element tag overrides/additions for `card` parts (merged over the built-ins). Property: `el.cardTypes`. Typed as a plain string map (not the `CardTagMap` alias) so the generated React wrapper inlines it instead of emitting an unresolved named type. */
2161
+ cardTypes?: Record<string, string>;
2162
+ /** JSON Schemas for the card types this app renders, keyed by envelope type. The companion of `cardTypes`, which says what DRAWS a card while this says what a VALID one looks like. An OBJECT, so it is a JS property only: `el.cardSchemas = { 'pricing-table': pricingSchema }`, never an attribute. `createCardRegistry(...).validationSchemas` is exactly this shape. Without it the kit validates its own seven built-ins and leaves your own card type, the one your app actually cares about, as the only unchecked thing on screen. A schema here WINS over a built-in of the same name. Typed `Record<string, object>` rather than `Record<string, JsonSchema>` deliberately: an imported `.json` schema widens `"type"` to `string`, and an authored one carries `$schema`/`title`/`description`/`additionalProperties`, so the tighter type would reject both of the normal ways to supply one. */
2163
+ cardSchemas?: Record<string, object>;
2164
+ }
2165
+
2166
+ export interface KaiCheckpointElementProps {
2167
+ /** Color mode (`auto` follows prefers-color-scheme). */
2168
+ theme?: "light" | "dark" | "auto";
2169
+ /** Optional text beside the icon. */
2170
+ label?: string;
2171
+ /** Tooltip on hover. */
2172
+ tooltip?: string;
2173
+ /** Visual button style. */
2174
+ variant?: "ghost" | "default" | "outline";
2175
+ /** Button size (use an `icon*` size for an icon-only checkpoint). */
2176
+ size?: "sm" | "md" | "lg" | "icon" | "icon-sm";
2177
+ }
2178
+
2179
+ export interface KaiChoiceElementProps {
2180
+ /** Color mode (`auto` follows prefers-color-scheme). */
2181
+ theme?: "light" | "dark" | "auto";
2182
+ /** The choice definition (the CardEnvelope.data). Set as a JS PROPERTY: `el.data = { prompt, options:[…], allowOther?, submitLabel? }`. Import `ChoiceCardData` from `@kitn.ai/ui` for the full shape. */
2183
+ data?: { prompt?: string; options: { id: string; label: string; description?: string; media?: { image?: string; imageAlt?: string; icon?: string }; meta?: string; recommended?: boolean; disabled?: boolean; payload?: unknown }[]; allowOther?: boolean | { label?: string; placeholder?: string }; submitLabel?: string; dismissible?: boolean };
2184
+ /** Stable card id correlating every emitted CardEvent. Attribute: `card-id`. */
2185
+ cardId?: string;
2186
+ /** Heading rendered in the card chrome (= CardEnvelope.title). Attribute: `heading`. */
2187
+ heading?: string;
2188
+ /** Set when the user resolved this card; renders the read-only view. Property: `el.resolution = { kind:'action', action:'…' }`. */
2189
+ resolution?: Record<string, unknown>;
2190
+ /** Controlled selection: the selected option id. When set, the consumer owns the current pick (RadioGroup `value`). Attribute: `value`. */
2191
+ value?: string;
2192
+ /** Option id to pre-select on mount (uncontrolled seed). Attribute: `default-value`. */
2193
+ defaultValue?: string;
2194
+ /** Disable the whole radiogroup + Submit (e.g. while the agent is busy). Attribute: `disabled`. */
2195
+ disabled?: boolean;
2196
+ }
2197
+
2198
+ export interface KaiCoachmarkElementProps {
2199
+ /** Color mode (`auto` follows prefers-color-scheme). */
2200
+ theme?: "light" | "dark" | "auto";
2201
+ /** 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`. */
2202
+ open?: boolean;
2203
+ /** Initial open state on mount (uncontrolled seed). */
2204
+ defaultOpen?: boolean;
2205
+ /** The bold title. Named `headline` because `title` collides with the global `HTMLElement.title` attribute (it throws at registration). */
2206
+ headline?: string;
2207
+ /** A small badge pill beside the headline (e.g. "New"). */
2208
+ badge?: string;
2209
+ /** Floating placement relative to the anchor (default `bottom`). */
2210
+ placement?: string;
2211
+ /** Color tone: `primary` (default, theme accent), `info` (blue), `success` (green), `warning` (amber), or `error` (red), reusing the kit's tool hues. */
2212
+ tone?: "primary" | "info" | "success" | "warning" | "error";
2213
+ /** Render the arrow that points at the anchor (default `true`). Set `arrow="false"` for a plain bubble with no pointer. */
2214
+ arrow?: boolean;
2215
+ }
2216
+
2217
+ export interface KaiCodeBlockElementProps {
2218
+ /** Color mode (`auto` follows prefers-color-scheme). */
2219
+ theme?: "light" | "dark" | "auto";
2220
+ /** The source code to render. */
2221
+ code: string;
2222
+ /** Language grammar (e.g. `js`, `python`). Defaults to `tsx`. */
2223
+ language?: string;
2224
+ /** Shiki theme name. */
2225
+ codeTheme?: string;
2226
+ /** Disable syntax highlighting (renders plain text, no Shiki). */
2227
+ codeHighlight?: boolean;
2228
+ /** Code text sizing. */
2229
+ proseSize?: "xs" | "sm" | "base" | "lg";
2230
+ }
2231
+
2232
+ export interface KaiCommandElementProps {
2233
+ /** Color mode (`auto` follows prefers-color-scheme). */
2234
+ theme?: "light" | "dark" | "auto";
2235
+ /** Flat list of items. Set as a JS property, not an HTML attribute. */
2236
+ items?: { id: string; label: string; icon?: string; description?: string; shortcut?: string; group?: string }[];
2237
+ /** Placeholder text for the search input. */
2238
+ placeholder?: string;
2239
+ /** Label shown when no items match the current query. */
2240
+ emptyLabel?: string;
2241
+ }
2242
+
2243
+ export interface KaiCompareElementProps {
2244
+ /** Color mode (`auto` follows prefers-color-scheme). */
2245
+ theme?: "light" | "dark" | "auto";
2246
+ /** 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. */
2247
+ data?: Record<string, unknown>;
2248
+ /** Stable id correlating every emitted event. Attribute: `compare-id`. */
2249
+ compareId?: string;
2250
+ /** Re-hydrate / control the user's pick. Set as a JS PROPERTY: `el.selection = { chosenId, rejectedIds }`. Renders the collapsed winner. */
2251
+ selection?: Record<string, unknown>;
2252
+ /** Layout: `'auto'` (default, columns when wide, tabs when narrow, by CONTAINER width) | `'columns'` (side-by-side) | `'tabs'` (pills to switch). Attribute: `layout`. */
2253
+ layout?: "auto" | "columns" | "tabs";
2254
+ /** Prose/text size for the rendered candidates. Attribute: `prose-size`. */
2255
+ proseSize?: "xs" | "sm" | "base" | "lg";
2256
+ /** Shiki theme for code blocks in the candidates. Attribute: `code-theme`. */
2257
+ codeTheme?: string;
2258
+ /** Whether code blocks are syntax-highlighted. Attribute: `code-highlight`. */
2259
+ codeHighlight?: boolean;
2260
+ }
2261
+
2262
+ export interface KaiComposerElementProps {
2263
+ /** Color mode (`auto` follows prefers-color-scheme). */
2264
+ theme?: "light" | "dark" | "auto";
2265
+ /** Controlled value: a string or a full ComposerDoc (set as JS property). */
2266
+ value?: string | ({ type: "text"; text: string } | { type: "entity"; entity: { kind: string; id: string; label: string; icon?: string; promptText?: string; data?: Record<string, unknown> } })[];
2267
+ /** Placeholder text shown when the composer is empty. */
2268
+ placeholder?: string;
2269
+ /** Disable the composer entirely (non-interactive). */
2270
+ disabled?: boolean;
2271
+ /** Show a loading/streaming state and block submit. */
2272
+ loading?: boolean;
2273
+ /** Maximum height in px before the content scrolls. Default 240. */
2274
+ maxHeight?: number | string;
2275
+ /** Whether pressing Enter (without Shift) submits. Default true. */
2276
+ submitOnEnter?: boolean;
2277
+ /** Trigger definitions. Set as a JS property. */
2278
+ triggers?: { char: string; kind: string; items?: { id: string; label: string; icon?: string; description?: string; group?: string; kind?: string; promptText?: string; data?: Record<string, unknown> }[] }[];
2279
+ /** Keyword highlight rules. Set as a JS property. */
2280
+ highlights?: (string | { pattern: string; flags?: string; class?: string })[];
2281
+ /** 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. */
2282
+ kindIcons?: Record<string, string>;
2283
+ }
2284
+
2285
+ export interface KaiConfirmElementProps {
2286
+ /** Color mode (`auto` follows prefers-color-scheme). */
2287
+ theme?: "light" | "dark" | "auto";
2288
+ /** The confirm definition (the CardEnvelope.data). Set as a JS PROPERTY: `el.data = { body, tone, actions:[…] }`. Import `ConfirmCardData` from `@kitn.ai/ui` for the full shape. */
2289
+ data?: { heading?: string; body?: string; tone?: "default" | "warning" | "danger"; actions: { id: string; label: string; style?: "primary" | "default" | "destructive"; payload?: unknown; default?: boolean }[]; dismissible?: boolean };
2290
+ /** Stable card id correlating every emitted CardEvent. Attribute: `card-id`. */
2291
+ cardId?: string;
2292
+ /** Heading rendered in the card chrome (= CardEnvelope.title). Attribute: `heading`. */
2293
+ heading?: string;
2294
+ /** Focus the default action on mount (off by default, so nothing steals focus). Attribute: `autofocus`. */
2295
+ autofocus?: boolean;
2296
+ /** Set when the user resolved this card; renders the read-only view. Property: `el.resolution = { kind:'action', action:'…' }`. */
2297
+ resolution?: Record<string, unknown>;
2298
+ }
2299
+
2300
+ export interface KaiContextElementProps {
2301
+ /** Color mode (`auto` follows prefers-color-scheme). */
2302
+ theme?: "light" | "dark" | "auto";
2303
+ /** Token-usage data. Set as a JS property. */
2304
+ context?: { usedTokens: number; maxTokens: number; inputTokens?: number; outputTokens?: number; reasoningTokens?: number; cacheTokens?: number; estimatedCost?: number };
2305
+ /** Fraction (0–1) above which the meter turns yellow. Defaults to `0.7` (70%). */
2306
+ warnThreshold?: number;
2307
+ /** Fraction (0–1) above which the meter turns red. Defaults to `0.9` (90%). */
2308
+ dangerThreshold?: number;
2309
+ }
2310
+
2311
+ export interface KaiConversationsElementProps {
2312
+ /** Color mode (`auto` follows prefers-color-scheme). */
2313
+ theme?: "light" | "dark" | "auto";
2314
+ /** The list's section headers (`{ id, name, sortOrder, createdAt }`), rendered in array order. A group carries no conversations of its own; it is matched against `conversations` by id, so the two props are complementary rather than alternatives. Omit for an ungrouped list. Set as a JS property. */
2315
+ groups?: { id: string; userId?: string; teamId?: string; name: string; sortOrder: number; createdAt: string }[];
2316
+ /** Every conversation the list renders, flat. Each one is filed under the group whose `id` equals its `groupId`; one with no `groupId`, or with a `groupId` matching no entry in `groups`, falls into a trailing "Ungrouped" section, so nothing you pass in is ever dropped. There is no recency bucketing. Set as a JS property. Omit to supply them as `<kai-conversation>` light-DOM children instead, or for the empty state. */
2317
+ conversations?: { id: string; title: string; groupId?: string; scope: { type: "document" | "collection"; documentId?: string; filters?: { tags?: string[]; authors?: string[]; contentType?: "transcript" | "markdown"; dateRange?: { from: string; to: string } } }; messageCount: number; lastMessageAt: string; updatedAt: string; trailing?: string }[];
2318
+ /** The id of the currently-open conversation, highlighted in the list. */
2319
+ activeId?: string;
2320
+ /** 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. */
2321
+ collapsed?: boolean;
2322
+ /** Initial collapsed state when uncontrolled (default false). Use the `default-collapsed` attribute to start collapsed in plain HTML. */
2323
+ defaultCollapsed?: boolean;
2324
+ }
2325
+
2326
+ export interface KaiDialogElementProps {
2327
+ /** Color mode (`auto` follows prefers-color-scheme). */
2328
+ theme?: "light" | "dark" | "auto";
2329
+ /** 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`. */
2330
+ open?: boolean;
2331
+ /** Initial open state on mount (uncontrolled seed). */
2332
+ defaultOpen?: boolean;
2333
+ }
2334
+
2335
+ export interface KaiEditableLabelElementProps {
2336
+ /** Color mode (`auto` follows prefers-color-scheme). */
2337
+ theme?: "light" | "dark" | "auto";
2338
+ /** The label text. Settable and reflected to the `value` attribute. Read `el.value` for live state. */
2339
+ value?: string;
2340
+ /** Controlled edit state. `el.editing = true` opens the field; reflected to the `editing` attribute. */
2341
+ editing?: boolean;
2342
+ /** Placeholder shown while editing / when the value is empty. */
2343
+ placeholder?: string;
2344
+ /** Disable entering edit mode. */
2345
+ disabled?: boolean;
2346
+ }
2347
+
2348
+ export interface KaiEmbedElementProps {
2349
+ /** Color mode (`auto` follows prefers-color-scheme). */
2350
+ theme?: "light" | "dark" | "auto";
2351
+ /** Stable card id correlating every emitted event. Set as an attribute or property. */
2352
+ cardId?: string;
2353
+ /** The embed payload (provider + id/url + options). Set as a JS **property** (object). */
2354
+ data?: { provider: "youtube" | "vimeo" | "generic"; id?: string; url?: string; title?: string; poster?: string; start?: number; aspectRatio?: "16:9" | "4:3" | "1:1" | "9:16" };
2355
+ }
2356
+
2357
+ export interface KaiEmptyElementProps {
2358
+ /** Color mode (`auto` follows prefers-color-scheme). */
2359
+ theme?: "light" | "dark" | "auto";
2360
+ /** Title text. Attribute: `empty-title` (`title` is a global HTML attribute). */
2361
+ emptyTitle?: string;
2362
+ /** Description text. */
2363
+ description?: string;
2364
+ }
2365
+
2366
+ export interface KaiFeedbackBarElementProps {
2367
+ /** Color mode (`auto` follows prefers-color-scheme). */
2368
+ theme?: "light" | "dark" | "auto";
2369
+ /** The banner label (e.g. "Was this helpful?"). Attribute: `bar-title` (`title` is avoided because it is a global HTML attribute). */
2370
+ barTitle?: string;
2371
+ /** When set, a not-helpful vote opens an optional detail form before the thank-you confirmation. Attribute: `collect-detail`. */
2372
+ collectDetail?: boolean;
2373
+ /** Optional category chips for the detail form. Set as a JS property (array). */
2374
+ categories?: string[];
2375
+ /** Heading for the detail form. Attribute: `detail-title`. */
2376
+ detailTitle?: string;
2377
+ /** Placeholder for the detail comment box. Attribute: `detail-placeholder`. */
2378
+ detailPlaceholder?: string;
2379
+ /** Submit button label in the detail form. Attribute: `submit-label`. */
2380
+ submitLabel?: string;
2381
+ /** Confirmation copy shown after a vote/submit. Attribute: `thanks-message`. */
2382
+ thanksMessage?: string;
2383
+ }
2384
+
2385
+ export interface KaiFileTreeElementProps {
2386
+ /** Color mode (`auto` follows prefers-color-scheme). */
2387
+ theme?: "light" | "dark" | "auto";
2388
+ /** The files to render. Set as a JS property (array of `{ path, url?, code?, language?, type?, additions?, deletions?, status? }`). */
2389
+ 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" }[];
2390
+ /** Selected file path, highlighted in the tree. */
2391
+ activeFile?: string;
2392
+ /** Folder paths expanded initially. Omit to start with all folders open. */
2393
+ defaultExpanded?: string[];
2394
+ /** Show a changed-files summary header (file count + summed `+/-` + Collapse-all). Attribute: `summary`. Off by default. */
2395
+ summary?: boolean;
2396
+ }
2397
+
2398
+ export interface KaiFileUploadElementProps {
2399
+ /** Color mode (`auto` follows prefers-color-scheme). */
2400
+ theme?: "light" | "dark" | "auto";
2401
+ /** Allow selecting multiple files (default true). */
2402
+ multiple?: boolean;
2403
+ /** `accept` attribute for the file picker (e.g. `image/*`). */
2404
+ accept?: string;
2405
+ /** Disable the dropzone: no clicking, no drag-and-drop. */
2406
+ disabled?: boolean;
2407
+ /** Default dropzone label (overridable via the default slot). */
2408
+ label?: string;
2409
+ }
2410
+
2411
+ export interface KaiFormElementProps {
2412
+ /** Color mode (`auto` follows prefers-color-scheme). */
2413
+ theme?: "light" | "dark" | "auto";
2414
+ /** The form definition: a JSON Schema (`type:'object'`) + `x-kai-*` UI hints (the CardEnvelope.data). Set as a JS PROPERTY: `el.data = { type:'object', properties:{…} }`. Import the `FormDefinition` type from `@kitn.ai/ui` for the full shape. It IS self-referential (`FormField.properties` is another `FormField` map), and the generated `element-types.d.ts` inlines every named type, so the shipped declaration bottoms out in a `Record<string, unknown>` placeholder one level down rather than carrying the recursion. That is why `FormDefinition` is a `type` alias: an interface gets no implicit index signature, so it would not be assignable to that placeholder. */
2415
+ data?: { type: "object"; title?: string; description?: string; required?: string[]; properties: Record<string, { type: "string" | "number" | "integer" | "boolean" | "array" | "object"; title?: string; description?: string; default?: unknown; enum?: unknown[]; format?: "email" | "uri" | "url" | "date" | "date-time" | "time"; minimum?: number; maximum?: number; minLength?: number; maxLength?: number; pattern?: string; minItems?: number; maxItems?: number; items?: Record<string, unknown> | { enum: unknown[] }; properties?: Record<string, Record<string, unknown>>; required?: string[]; readOnly?: boolean; "x-kai-widget"?: "textarea" | "slider" | "rating" | "radio" | "select" | "checkbox" | "password" | "switch"; "x-kai-placeholder"?: string; "x-kai-step"?: number }>; "x-kai-order"?: string[]; "x-kai-inlineMax"?: number; "x-kai-submitLabel"?: string; "x-kai-dismissible"?: boolean; "x-kai-actions"?: { id: string; label: string; variant?: "default" | "ghost" | "outline" }[] };
2416
+ /** Stable card id correlating every emitted CardEvent. Attribute: `card-id`. */
2417
+ cardId?: string;
2418
+ /** Heading rendered in the card chrome (= CardEnvelope.title). Attribute: `heading`. */
2419
+ heading?: string;
2420
+ /** Set when the user resolved this card; renders the read-only view. Property: `el.resolution = { kind:'submit', data:{…} }`. */
2421
+ resolution?: Record<string, unknown>;
2422
+ /** Controlled field values (JS property). When set, it wins over local edits. */
2423
+ values?: Record<string, unknown>;
2424
+ /** Initial values overlaying the schema defaults (uncontrolled seed; JS property). */
2425
+ defaultValues?: Record<string, unknown>;
2426
+ /** Disable all fields + submit. Attribute: `disabled`. */
2427
+ disabled?: boolean;
2428
+ }
2429
+
2430
+ export interface KaiHoverCardElementProps {
2431
+ /** Color mode (`auto` follows prefers-color-scheme). */
2432
+ theme?: "light" | "dark" | "auto";
2433
+ /** Delay (ms) before the card opens on hover. Defaults to 0 (focus opens it immediately too). */
2434
+ openDelay?: number;
2435
+ /** Delay (ms) before it closes after the pointer leaves. Defaults to 300. */
2436
+ closeDelay?: number;
2437
+ /** Preferred placement: `'top' | 'bottom' | 'left' | 'right'` (+ optional `-start`/`-end`). Defaults to `'bottom'`; flips to stay in view. */
2438
+ placement?: string;
2439
+ /** 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`. */
2440
+ open?: boolean;
2441
+ /** Initial open state on mount (uncontrolled seed). */
2442
+ defaultOpen?: boolean;
2443
+ /** Suppress the hover behavior entirely without unmounting. */
2444
+ disabled?: boolean;
2445
+ }
2446
+
2447
+ export interface KaiIconElementProps {
2448
+ /** Color mode (`auto` follows prefers-color-scheme). */
2449
+ theme?: "light" | "dark" | "auto";
2450
+ /** A curated icon name (e.g. `"mic"`, `"globe"`), an image URL/data-URI, or plain text. */
2451
+ name?: string;
2452
+ /** Size token: `sm` | `md` (default) | `lg`. */
2453
+ size?: "sm" | "md" | "lg";
2454
+ }
2455
+
2456
+ export interface KaiImageElementProps {
2457
+ /** Color mode (`auto` follows prefers-color-scheme). */
2458
+ theme?: "light" | "dark" | "auto";
2459
+ /** Base64-encoded image data (pair with `media-type`). */
2460
+ base64?: string;
2461
+ /** Raw image bytes (set as a JS property). */
2462
+ bytes?: Uint8Array;
2463
+ /** Alt text. */
2464
+ alt?: string;
2465
+ /** MIME type (default `image/png`). */
2466
+ mediaType?: string;
2467
+ }
2468
+
2469
+ export interface KaiInputElementProps {
2470
+ /** Color mode (`auto` follows prefers-color-scheme). */
2471
+ theme?: "light" | "dark" | "auto";
2472
+ /** Native input type: `text` (default) · `email` · `url` · `search` · `tel` · `password` · `number`. Single-line only. */
2473
+ type?: string;
2474
+ /** 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. */
2475
+ value?: string;
2476
+ /** Placeholder shown when empty. */
2477
+ placeholder?: string;
2478
+ /** Field label, linked to the input. */
2479
+ label?: string;
2480
+ /** Helper text below the control. */
2481
+ hint?: string;
2482
+ /** Error text; flips the field invalid (`aria-invalid` + destructive border). */
2483
+ error?: string;
2484
+ /** Control density: `sm` or `md`. Defaults to `md`. */
2485
+ size?: "sm" | "md";
2486
+ /** Disable interaction. */
2487
+ disabled?: boolean;
2488
+ /** Make the input read-only. */
2489
+ readonly?: boolean;
2490
+ /** Mark the input required. */
2491
+ required?: boolean;
2492
+ /** Force the invalid state without an `error` string. */
2493
+ invalid?: boolean;
2494
+ /** Form-control name. */
2495
+ name?: string;
2496
+ /** Autofill hint forwarded to the inner input (e.g. `email`, `current-password`). */
2497
+ autocomplete?: string;
2498
+ /** Virtual-keyboard hint forwarded to the inner input (e.g. `numeric`, `email`). */
2499
+ inputmode?: string;
2500
+ }
2501
+
2502
+ export interface KaiKbdElementProps {
2503
+ /** Color mode (`auto` follows prefers-color-scheme). */
2504
+ theme?: "light" | "dark" | "auto";
2505
+ /** 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. */
2506
+ keys?: string;
2507
+ /** `mac` uses ⌘/⌥, `other` uses Ctrl. `auto` (default) sniffs the OS. */
2508
+ platform?: "auto" | "mac" | "other";
2509
+ /** Cap size: `sm` or `md`. Defaults to `md`. */
2510
+ size?: "sm" | "md";
2511
+ }
2512
+
2513
+ export interface KaiLinkPreviewElementProps {
2514
+ /** Color mode (`auto` follows prefers-color-scheme). */
2515
+ theme?: "light" | "dark" | "auto";
2516
+ /** Stable card id correlating every emitted event. Set as an attribute or property. */
2517
+ cardId?: string;
2518
+ /** The link payload (OG metadata). Set as a JS **property** (object). */
2519
+ data?: { url: string; title?: string; description?: string; image?: string; imageAlt?: string; favicon?: string; domain?: string; siteName?: string };
2520
+ }
2521
+
2522
+ export interface KaiLoaderElementProps {
2523
+ /** Color mode (`auto` follows prefers-color-scheme). */
2524
+ theme?: "light" | "dark" | "auto";
2525
+ /** The animation style: `'circular' | 'classic' | 'pulse' | 'pulse-dot' | 'dots' | 'typing' | 'wave' | 'bars' | 'terminal' | 'text-blink' | 'text-shimmer' | 'loading-dots'`. Defaults to `'circular'`. */
2526
+ variant?: "circular" | "classic" | "pulse" | "pulse-dot" | "dots" | "typing" | "wave" | "bars" | "terminal" | "text-blink" | "text-shimmer" | "loading-dots";
2527
+ /** Loader size: `'sm' | 'md' | 'lg'`. Defaults to `'md'`. */
2528
+ size?: "sm" | "md" | "lg";
2529
+ /** Label for the text-based variants. */
2530
+ text?: string;
2531
+ }
2532
+
2533
+ export interface KaiMarkdownElementProps {
2534
+ /** Color mode (`auto` follows prefers-color-scheme). */
2535
+ theme?: "light" | "dark" | "auto";
2536
+ /** The markdown source to render. */
2537
+ content: string;
2538
+ /** Text/markdown sizing. */
2539
+ proseSize?: "xs" | "sm" | "base" | "lg";
2540
+ /** Shiki theme for fenced code blocks. */
2541
+ codeTheme?: string;
2542
+ /** Disable syntax highlighting (no Shiki loads). */
2543
+ codeHighlight?: boolean;
2544
+ }
2545
+
2546
+ export interface KaiMenuElementProps {
2547
+ /** Color mode (`auto` follows prefers-color-scheme). */
2548
+ theme?: "light" | "dark" | "auto";
2549
+ /** Tree of menu items. Set as a JS property, not an HTML attribute. */
2550
+ items?: { id?: string; label?: string; icon?: string; shortcut?: string; checked?: boolean; radioGroup?: string; disabled?: boolean; separator?: boolean; heading?: boolean; items?: Record<string, unknown>[] }[];
2551
+ /** Optional placement hint (unused by the underlying Dropdown which always positions bottom-start, kept for future extension). */
2552
+ placement?: string;
2553
+ /** 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. */
2554
+ triggerIcon?: string;
2555
+ /** Built-in trigger: a text label (e.g. `"High"`). This is the trigger's VISIBLE text, so it is also its accessible name, and `label` does not override it: an accessible name that does not contain the visible text is unreachable by speech input, which is what WCAG 2.5.3 (Label in Name) exists for. A slotted `slot="trigger"` replaces this built-in trigger entirely and is named differently; see `label`. */
2556
+ triggerLabel?: string;
2557
+ /** Built-in trigger: a trailing icon (e.g. `"chevron-down"` for a select look). */
2558
+ triggerIconTrailing?: string;
2559
+ /** Accessible name for a trigger with no visible label. Ignored when `triggerLabel` is set, which is already the visible name. It DOES name a slotted `slot="trigger"`, and that is a difference in what the two slots MEAN, not a limitation. `<kai-button>`'s slot IS the button's label, so text slotted there is the name and `label` steps aside. This slot is VISUAL content, a `+` or an `<svg>`, with the name supplied separately: decoration beside a name, never a second name competing with one. So `label` names the trigger here by design. Slotting a real WORD rather than a glyph makes that word a visible label, and an accessible name has to contain the visible text. Then either drop `label` or make it contain the word you slotted. */
2560
+ label?: string;
2561
+ /** 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`. */
2562
+ open?: boolean;
2563
+ /** Initial open state on mount (uncontrolled seed). */
2564
+ defaultOpen?: boolean;
2565
+ /** Disable the trigger: click/keyboard and `show()` no longer open the menu. */
2566
+ disabled?: boolean;
2567
+ }
2568
+
2569
+ export interface KaiMessageElementProps {
2570
+ /** Color mode (`auto` follows prefers-color-scheme). */
2571
+ theme?: "light" | "dark" | "auto";
2572
+ /** The full message object. Set as a JS property. */
2573
+ message?: { id: string; role: "user" | "assistant"; parts: ({ type: "text"; text: string; raw?: { source: string; payload: unknown } } | { type: "reasoning"; text: string; label?: string; index?: number; streamId?: string; signature?: string; raw?: { source: string; payload: unknown } } | { type: "tool"; tool: { type: string; kind?: "command" | "file-change" | "search" | "fetch" | "mcp" | "image" | "generic"; state: "input-streaming" | "input-available" | "output-available" | "output-error"; input?: Record<string, unknown>; rawInput?: string; output?: Record<string, unknown>; toolCallId?: string; errorText?: string; raw?: { source: string; payload: unknown } }; raw?: { source: string; payload: unknown } } | { type: "card"; envelope: { 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 } }; raw?: { source: string; payload: unknown } } | { type: "source"; source: { id?: string; url?: string; title?: string; snippet?: string; index?: number }; raw?: { source: string; payload: unknown } } | { type: "file"; attachment: { id: string; type: "file" | "source-document"; filename?: string; mediaType?: string; url?: string; title?: string }; raw?: { source: string; payload: unknown } })[]; actions?: ("copy" | "like" | "dislike" | "regenerate" | "edit" | { id: string; label: string; icon?: string; tooltip?: string })[]; avatar?: { src?: string; fallback?: string; alt?: string }; feedback?: "like" | "dislike" };
2574
+ /** Who is speaking: `'user'` or `'assistant'`. Convenience for simple cases when not passing a `message` object. This is the SEMANTIC role of the message, not an ARIA role. The name collides with the global ARIA `role` attribute, which is why the facade lifts it off the host (see `liftRoleOffHost`). Neither speaker is a valid ARIA role, so a `role="user"` left on `<kai-message>` is a CRITICAL axe `aria-roles` violation. The accessible role lives on the row inside the shadow root instead: `role="article"` plus an `aria-label` naming the speaker, matching the SolidJS `<Message>` component. */
2575
+ role?: "user" | "assistant";
2576
+ /** Force markdown on/off. Defaults to on for assistant, off for user. */
2577
+ markdown?: boolean;
2578
+ /** Text/markdown sizing for the message body. */
2579
+ proseSize?: "xs" | "sm" | "base" | "lg";
2580
+ /** Shiki theme name used for fenced code blocks in the content. */
2581
+ codeTheme?: string;
2582
+ /** Disable syntax highlighting for code blocks (no Shiki loads). */
2583
+ codeHighlight?: boolean;
2584
+ /** Whether the action bar is always visible (`'always'`, default) or only revealed on hover of the message row (`'hover'`). */
2585
+ actionsReveal?: "always" | "hover";
2586
+ /** Convenience avatar image URL (used when `message.avatar` is not set). */
2587
+ avatarSrc?: string;
2588
+ /** Convenience avatar fallback text (used when `message.avatar` is not set). */
2589
+ avatarFallback?: string;
2590
+ /** 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). */
2591
+ avatar?: string;
2592
+ /** Optional card type -> custom-element tag overrides/additions for `card` parts (merged over the built-ins). Property: `el.cardTypes`. Typed as a plain string map (not the `CardTagMap` alias) so the generated React wrapper inlines it instead of emitting an unresolved named type. */
2593
+ cardTypes?: Record<string, string>;
2594
+ /** JSON Schemas for the card types this app renders, keyed by envelope type. The companion of `cardTypes`, which says what DRAWS a card while this says what a VALID one looks like. An OBJECT, so it is a JS property only: `el.cardSchemas = { 'pricing-table': pricingSchema }`, never an attribute. `createCardRegistry(...).validationSchemas` is exactly this shape. Without it the kit validates its own seven built-ins and leaves your own card type, the one your app actually cares about, as the only unchecked thing on screen. A schema here WINS over a built-in of the same name. Typed `Record<string, object>` rather than `Record<string, JsonSchema>` deliberately: an imported `.json` schema widens `"type"` to `string`, and an authored one carries `$schema`/`title`/`description`/`additionalProperties`, so the tighter type would reject both of the normal ways to supply one. */
2595
+ cardSchemas?: Record<string, object>;
2596
+ }
2597
+
2598
+ export interface KaiModelSwitcherElementProps {
2599
+ /** Color mode (`auto` follows prefers-color-scheme). */
2600
+ theme?: "light" | "dark" | "auto";
2601
+ /** The selectable models. Set as a JS property (array). Omit to supply them as `<kai-model>` light-DOM children instead; when both are present the property's models come first. */
2602
+ models?: { id: string; name: string; provider?: string; description?: string; group?: string }[];
2603
+ /** The currently-selected model id. Defaults to the first model. */
2604
+ currentModel?: string;
2605
+ /** 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`. */
2606
+ open?: boolean;
2607
+ /** Initial open state on mount (uncontrolled seed). */
2608
+ defaultOpen?: boolean;
2609
+ /** Disable the trigger: click/keyboard and `show()` no longer open the dropdown. */
2610
+ disabled?: boolean;
2611
+ }
2612
+
2613
+ export interface KaiNavElementProps {
2614
+ /** Color mode (`auto` follows prefers-color-scheme). */
2615
+ theme?: "light" | "dark" | "auto";
2616
+ /** 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. */
2617
+ items?: { id: string; label?: string; icon?: string; badge?: string; trailing?: string; disabled?: boolean; children?: Record<string, unknown>[]; status?: { tone: "primary" | "info" | "success" | "warning" | "error" | "neutral"; label?: string; pulse?: boolean }; meta?: string; action?: { icon: string; label: string }; closable?: boolean }[];
2618
+ /** Active item id (controlled). */
2619
+ value?: string;
2620
+ /** Initial active id when uncontrolled. */
2621
+ defaultValue?: string;
2622
+ /** Ids of group items collapsed on first render (groups default to expanded). Set as a JS property (array). */
2623
+ defaultCollapsed?: string[];
2624
+ }
2625
+
2626
+ export interface KaiNoticeElementProps {
2627
+ /** Color mode (`auto` follows prefers-color-scheme). */
2628
+ theme?: "light" | "dark" | "auto";
2629
+ /** `neutral` (default) · `info` · `warning` · `error` · `success`. Drives the leading icon's color and the a11y role (`alert` for errors, else `status`). */
2630
+ severity?: "neutral" | "info" | "warning" | "error" | "success";
2631
+ /** Leading icon: omit for the severity default, `"none"` to hide it, or a named icon to override. */
2632
+ icon?: string;
2633
+ /** Show a dismiss (×) that hides the notice and emits `kai-dismiss`. */
2634
+ dismissible?: boolean;
2635
+ }
2636
+
2637
+ export interface KaiPaneElementProps {
2638
+ /** Color mode (`auto` follows prefers-color-scheme). */
2639
+ theme?: "light" | "dark" | "auto";
2640
+ /** The pane title (the agent / window name). Named `headline` because `title` collides with the global `HTMLElement.title` attribute (it throws at registration). Attribute: `headline`. */
2641
+ headline?: string;
2642
+ /** A role / label shown under the title (e.g. "Reviewer", "claude-sonnet"). Attribute: `subtitle`. */
2643
+ subtitle?: string;
2644
+ /** Show the restore glyph instead of maximize, and signal the maximized view-state. Drive it yourself in response to `kai-maximize`. Attribute: `maximized`. */
2645
+ maximized?: boolean;
2646
+ /** Highlight the frame with a ring/border to mark the ACTIVE pane. Attribute: `focused`. */
2647
+ focused?: boolean;
2648
+ /** Show a split-pane window control that fires `kai-split`. Off by default. Attribute: `show-split`. */
2649
+ showSplit?: boolean;
2650
+ /** Show a dock-to-side window control that fires `kai-dock`. Off by default. Attribute: `show-dock`. */
2651
+ showDock?: boolean;
2652
+ /** A tone-colored status dot (+ optional label) in the header. An object `{ tone, label?, pulse? }` set as a JS PROPERTY (not an attribute). */
2653
+ status?: { tone: "working" | "idle" | "done" | "error" | "blocked"; label?: string; pulse?: boolean };
2654
+ }
2655
+
2656
+ export interface KaiPaneGroupElementProps {
2657
+ /** Color mode (`auto` follows prefers-color-scheme). */
2658
+ theme?: "light" | "dark" | "auto";
2659
+ /** The tabs to render. An array of `{ id, name, status?, needsAttention?, number? }` set as a JS PROPERTY (not an HTML attribute). */
2660
+ tabs?: { id: string; name: string; status?: { tone: "working" | "idle" | "done" | "error" | "blocked"; label?: string; pulse?: boolean }; needsAttention?: boolean; number?: number }[];
2661
+ /** 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). */
2662
+ active?: string;
2663
+ /** Highlight the frame as the ACTIVE group in a multi-group layout. Attribute: `focused`. */
2664
+ focused?: boolean;
2665
+ }
2666
+
2667
+ export interface KaiPopoverElementProps {
2668
+ /** Color mode (`auto` follows prefers-color-scheme). */
2669
+ theme?: "light" | "dark" | "auto";
2670
+ /** Floating placement relative to the trigger (floating-ui placement). */
2671
+ placement?: "top" | "right" | "bottom" | "left" | "bottom-end" | "bottom-start" | "left-end" | "left-start" | "right-end" | "right-start" | "top-end" | "top-start";
2672
+ /** Gap in px between the trigger and the panel. */
2673
+ gutter?: number;
2674
+ /** 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`. */
2675
+ open?: boolean;
2676
+ /** Initial open state on mount (uncontrolled seed). */
2677
+ defaultOpen?: boolean;
2678
+ /** Turn the popover off while keeping the trigger mounted (clicks and `show()` no longer open it). */
2679
+ disabled?: boolean;
2680
+ }
2681
+
2682
+ export interface KaiProgressBarElementProps {
2683
+ /** Color mode (`auto` follows prefers-color-scheme). */
2684
+ theme?: "light" | "dark" | "auto";
2685
+ /** Current progress value (0..max). Attribute: `value`. */
2686
+ value?: number;
2687
+ /** The value `value` runs to (default 100). Attribute: `max`. */
2688
+ max?: number;
2689
+ /** Optional caption above the track. Attribute: `label`. */
2690
+ label?: string;
2691
+ /** Fill color: `primary` (default), `success`, `warning`, `error`, `info`. Attribute: `tone`. */
2692
+ tone?: string;
2693
+ }
2694
+
2695
+ export interface KaiPromptDockElementProps {
2696
+ /** Color mode (`auto` follows prefers-color-scheme). */
2697
+ theme?: "light" | "dark" | "auto";
2698
+ /** 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`. */
2699
+ frame?: "inset" | "edge" | "none";
2700
+ /** 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`. */
2701
+ appearance?: "soft" | "outlined" | "filled" | "plain";
2702
+ }
2703
+
2704
+ export interface KaiPromptInputElementProps {
2705
+ /** Color mode (`auto` follows prefers-color-scheme). */
2706
+ theme?: "light" | "dark" | "auto";
2707
+ /** 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`. */
2708
+ value?: string | ({ type: "text"; text: string } | { type: "entity"; entity: { kind: string; id: string; label: string; icon?: string; promptText?: string; data?: Record<string, unknown> } })[];
2709
+ /** Placeholder text shown in the empty input. */
2710
+ placeholder?: string;
2711
+ /** Disable the input and submit button entirely (non-interactive). */
2712
+ disabled?: boolean;
2713
+ /** Show the loading/streaming state and block submit (use while awaiting a reply). */
2714
+ loading?: boolean;
2715
+ /** Starter prompts shown above the input. Clicking one follows `suggestionMode`. Set as a JS property. */
2716
+ suggestions?: string[];
2717
+ /** What clicking a suggestion does: `'submit'` (default) sends it immediately as if typed and submitted; `'fill'` just places it in the input. */
2718
+ suggestionMode?: "submit" | "fill";
2719
+ /** Show a Search (Globe) button in the left toolbar; clicking it fires a `search` event. */
2720
+ search?: boolean;
2721
+ /** Show a Voice (Mic) button in the left toolbar; clicking it fires a `voice` event. */
2722
+ voice?: boolean;
2723
+ /** 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`. */
2724
+ stoppable?: boolean;
2725
+ /** Send-button visibility. `'always'` (default) always shows it; `'auto'` shows it only when there's text/attachments (an empty composer hides it, though 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. */
2726
+ submit?: "always" | "auto";
2727
+ /** 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`. */
2728
+ attach?: boolean;
2729
+ /** 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). */
2730
+ attachments?: { id: string; type: "file" | "source-document"; filename?: string; mediaType?: string; url?: string; title?: string }[];
2731
+ /** 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. */
2732
+ triggers?: { char: string; kind: string; items?: { id: string; label: string; icon?: string; description?: string; group?: string; kind?: string; promptText?: string; data?: Record<string, unknown> }[] }[];
2733
+ /** 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. */
2734
+ kindIcons?: Record<string, string>;
2735
+ }
2736
+
2737
+ export interface KaiReasoningElementProps {
2738
+ /** Color mode (`auto` follows prefers-color-scheme). */
2739
+ theme?: "light" | "dark" | "auto";
2740
+ /** The reasoning text to display. */
2741
+ text: string;
2742
+ /** Trigger label. */
2743
+ label?: string;
2744
+ /** 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`. */
2745
+ open?: boolean;
2746
+ /** Initial open state on mount (uncontrolled seed). */
2747
+ defaultOpen?: boolean;
2748
+ /** While true, auto-expands (and re-collapses when it flips false). */
2749
+ streaming?: boolean;
2750
+ /** Render `text` as markdown. */
2751
+ markdown?: boolean;
2752
+ /** Gate the disclosure trigger: programmatic `show()/hide()/toggle()` still work, but the trigger click no longer toggles. */
2753
+ disabled?: boolean;
2754
+ }
2755
+
2756
+ export interface KaiRemoteElementProps {
2757
+ /** Color mode (`auto` follows prefers-color-scheme). */
2758
+ theme?: "light" | "dark" | "auto";
2759
+ /** The remote card URL. Attribute: `src`. */
2760
+ src?: string;
2761
+ /** Exact provider origin (https: or http://localhost for dev). Attribute: `provider-origin`. */
2762
+ providerOrigin?: string;
2763
+ /** The card envelope to render. JS property only. */
2764
+ envelope?: Record<string, unknown>;
2765
+ /** Optional routing policy. JS property only. */
2766
+ policy?: Record<string, unknown>;
2767
+ }
2768
+
2769
+ export interface KaiResizableElementProps {
2770
+ /** Color mode (`auto` follows prefers-color-scheme). */
2771
+ theme?: "light" | "dark" | "auto";
2772
+ /** Layout axis: `horizontal` (row, default) or `vertical` (column). */
2773
+ orientation?: "horizontal" | "vertical";
2774
+ /** Which item index is maximized (null = none). Declarative source of truth. */
2775
+ maximizedIndex?: number | null;
2776
+ /** Divider affordance drawn inside each draggable handle's 8px grab zone: - `line` (default): a 1px hairline, transparent at rest, tinting on hover/drag. - `grip`: a dotted grip handle. - `none`: no visible divider, just the invisible hit-area. The full grab zone and keyboard/ARIA behavior are identical for all three. */
2777
+ handle?: "line" | "grip" | "none";
2778
+ }
2779
+
2780
+ export interface KaiResizableItemElementProps {
2781
+ /** Color mode (`auto` follows prefers-color-scheme). */
2782
+ theme?: "light" | "dark" | "auto";
2783
+ /** Initial main-axis size: `"280px"` (fixed) or `"25%"`/`25` (percent). Omitted → flexible. */
2784
+ size?: string;
2785
+ /** Minimum size during resize (px or %). */
2786
+ min?: string;
2787
+ /** Maximum size during resize (px or %). */
2788
+ max?: string;
2789
+ /** Fix this panel's size; adjacent dividers become non-draggable. */
2790
+ locked?: boolean;
2791
+ /** Hide this panel; its divider is dropped and the rest reflow. */
2792
+ hidden?: boolean;
2793
+ /** 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. */
2794
+ collapsed?: boolean;
2795
+ }
2796
+
2797
+ export interface KaiResponseStreamElementProps {
2798
+ /** Color mode (`auto` follows prefers-color-scheme). */
2799
+ theme?: "light" | "dark" | "auto";
2800
+ /** Text to stream. A string, or an `AsyncIterable<string>` (set as a JS property, since async iterables can't be HTML attributes). */
2801
+ text?: string | AsyncIterable<string>;
2802
+ /** Reveal animation. */
2803
+ mode?: "typewriter" | "fade";
2804
+ /** Characters/segments per tick. */
2805
+ speed?: number;
2806
+ /** Element tag to render as. */
2807
+ as?: string;
2808
+ }
2809
+
2810
+ export interface KaiScopePickerElementProps {
2811
+ /** Color mode (`auto` follows prefers-color-scheme). */
2812
+ theme?: "light" | "dark" | "auto";
2813
+ /** Authors to offer as scope filters. Omit to drop the Authors section (for a tag-only picker). Set as a JS property. */
2814
+ availableAuthors?: string[];
2815
+ /** Tags to offer as scope filters. Omit to drop the Tags section (for an author-only picker). Set as a JS property. */
2816
+ availableTags?: string[];
2817
+ /** The label shown on the trigger for the active scope. */
2818
+ currentLabel?: string;
2819
+ /** 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`. */
2820
+ open?: boolean;
2821
+ /** Initial open state on mount (uncontrolled seed). */
2822
+ defaultOpen?: boolean;
2823
+ /** Disable the trigger: click/keyboard and `show()` no longer open the dropdown. */
2824
+ disabled?: boolean;
2825
+ }
2826
+
2827
+ export interface KaiScreenElementProps {
2828
+ /** Color mode (`auto` follows prefers-color-scheme). */
2829
+ theme?: "light" | "dark" | "auto";
2830
+ /** 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`. */
2831
+ open?: boolean;
2832
+ /** Initial open state on mount (uncontrolled seed). */
2833
+ defaultOpen?: boolean;
2834
+ /** Header title text. A projected `title` slot overrides it. (Named `headline` because `title` collides with the global `HTMLElement.title` attribute.) */
2835
+ headline?: string;
2836
+ /** Show the back button (default true). */
2837
+ back?: boolean;
2838
+ /** Opt out of marking sibling elements inert/aria-hidden while open (for unusual layouts). */
2839
+ noInert?: boolean;
2840
+ }
2841
+
2842
+ export interface KaiScrollAreaElementProps {
2843
+ /** Color mode (`auto` follows prefers-color-scheme). */
2844
+ theme?: "light" | "dark" | "auto";
2845
+ /** Which axis scrolls. `vertical` (default) · `horizontal` · `both`. The cross axis is clamped so content can't overflow it. */
2846
+ orientation?: "vertical" | "horizontal" | "both";
2847
+ }
2848
+
2849
+ export interface KaiScrollButtonElementProps {
2850
+ /** Color mode (`auto` follows prefers-color-scheme). */
2851
+ theme?: "light" | "dark" | "auto";
2852
+ /** 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="...">`. */
2853
+ for?: string;
2854
+ /** Button visual variant: `'outline' | 'ghost' | 'default'`. Defaults to `'outline'`. */
2855
+ variant?: "outline" | "ghost" | "default";
2856
+ /** Button size token. Defaults to `'icon'` (square). */
2857
+ size?: "sm" | "md" | "lg" | "icon" | "icon-sm";
2858
+ }
2859
+
2860
+ export interface KaiSearchElementProps {
2861
+ /** Color mode (`auto` follows prefers-color-scheme). */
2862
+ theme?: "light" | "dark" | "auto";
2863
+ /** Controlled query. Settable and reflected to the `value` attribute. Read `el.value` for live state. */
2864
+ value?: string;
2865
+ /** Placeholder. Defaults to `Search…`. */
2866
+ placeholder?: string;
2867
+ /** 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`. */
2868
+ icon?: string;
2869
+ /** Debounce window for `kai-search`, in ms. Defaults to `200`. */
2870
+ debounce?: number;
2871
+ /** Show a spinner in place of the leading icon while results load. */
2872
+ loading?: boolean;
2873
+ /** 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. */
2874
+ shortcut?: string;
2875
+ }
2876
+
2877
+ export interface KaiSegmentedElementProps {
2878
+ /** Color mode (`auto` follows prefers-color-scheme). */
2879
+ theme?: "light" | "dark" | "auto";
2880
+ /** The selectable segments, left to right. Set as a JS property (array). */
2881
+ options: { value: string; label: string; icon?: undefined | string }[];
2882
+ /** 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. */
2883
+ value?: string;
2884
+ /** Control density: `sm` or `md`. Defaults to `md`. */
2885
+ size?: "sm" | "md";
2886
+ }
2887
+
2888
+ export interface KaiSeparatorElementProps {
2889
+ /** Color mode (`auto` follows prefers-color-scheme). */
2890
+ theme?: "light" | "dark" | "auto";
2891
+ /** `horizontal` (default, block + full-width) or `vertical` (a rule inside a flex/grid row, stretching to the row height). */
2892
+ orientation?: "horizontal" | "vertical";
2893
+ }
2894
+
2895
+ export interface KaiSettingItemElementProps {
2896
+ /** Color mode (`auto` follows prefers-color-scheme). */
2897
+ theme?: "light" | "dark" | "auto";
2898
+ /** Row label (primary text). Attribute: `label`. */
2899
+ label?: string;
2900
+ /** Optional secondary description under the label. Attribute: `description`. */
2901
+ description?: string;
2902
+ }
2903
+
2904
+ export interface KaiSettingsGroupElementProps {
2905
+ /** Color mode (`auto` follows prefers-color-scheme). */
2906
+ theme?: "light" | "dark" | "auto";
2907
+ /** Small section heading shown above the card. Attribute: `heading`. */
2908
+ heading?: string;
2909
+ /** Optional muted description under the heading. Attribute: `description`. */
2910
+ description?: string;
2911
+ }
2912
+
2913
+ export interface KaiSkeletonElementProps {
2914
+ /** Color mode (`auto` follows prefers-color-scheme). */
2915
+ theme?: "light" | "dark" | "auto";
2916
+ /** `text` (one or more lines), `rect` (a block), or `circle` (round). Defaults to `text`. */
2917
+ variant?: "text" | "rect" | "circle";
2918
+ /** CSS width (e.g. `'12rem'`, `'60%'`). Defaults to full width (responsive); for `circle` it is the diameter. */
2919
+ width?: string;
2920
+ /** CSS height. Defaults per variant (a text line height; circle = width). */
2921
+ height?: string;
2922
+ /** `text` only: number of lines; the last is shorter. Defaults to 1. */
2923
+ lines?: number;
2924
+ }
2925
+
2926
+ export interface KaiSkillsElementProps {
2927
+ /** Color mode (`auto` follows prefers-color-scheme). */
2928
+ theme?: "light" | "dark" | "auto";
2929
+ /** The active skills to badge. Set as a JS property. Omit to supply them as `<kai-skill>` light-DOM children instead; when both are present the property's skills come first. Nothing renders when there are none. */
2930
+ skills?: { id: string; name: string }[];
2931
+ }
2932
+
2933
+ export interface KaiSourceElementProps {
2934
+ /** Color mode (`auto` follows prefers-color-scheme). */
2935
+ theme?: "light" | "dark" | "auto";
2936
+ /** The URL this citation links to (the domain also seeds the default label/favicon). */
2937
+ href?: string;
2938
+ /** Trigger label (defaults to the domain). */
2939
+ label?: string;
2940
+ /** Hover-card headline. Attribute: `headline` (`title` is avoided because it is a global HTML attribute that reflects in a CE constructor and breaks it). */
2941
+ headline?: string;
2942
+ /** Hover-card body text describing the source. */
2943
+ description?: string;
2944
+ /** Show the source's favicon next to the trigger label. */
2945
+ showFavicon?: boolean;
2946
+ }
2947
+
2948
+ export interface KaiSourcesElementProps {
2949
+ /** Color mode (`auto` follows prefers-color-scheme). */
2950
+ theme?: "light" | "dark" | "auto";
2951
+ /** The sources to render. Set as a JS property. Omit to supply them as `<kai-source>` light-DOM children instead; when both are present the property's sources come first. */
2952
+ sources?: { href: string; title?: string; description?: string; label?: string; showFavicon?: boolean }[];
2953
+ /** Show favicons on all items (per-item `showFavicon` overrides). */
2954
+ showFavicon?: boolean;
2955
+ /** When true, each citation chip is labelled with its 1-based index in the merged (prop + declarative-children) list (`[1]`, `[2]`, …) instead of the per-item `label` or domain fallback. HTML attribute: `numbered` (boolean: a bare attribute or `numbered="true"`). JS property: `el.numbered = true`. */
2956
+ numbered?: boolean;
2957
+ }
2958
+
2959
+ export interface KaiStatusElementProps {
2960
+ /** Color mode (`auto` follows prefers-color-scheme). */
2961
+ theme?: "light" | "dark" | "auto";
2962
+ /** Presence/notification state → color. `new` (default) maps to the blue hue. */
2963
+ status?: "new" | "online" | "busy" | "away" | "offline";
2964
+ /** Animated ping ring (off by default; respects prefers-reduced-motion). */
2965
+ pulse?: boolean;
2966
+ /** Accessible name. Without it the dot is decorative. */
2967
+ label?: string;
2968
+ /** `sm` (default) or `md`. */
2969
+ size?: "sm" | "md";
2970
+ }
2971
+
2972
+ export interface KaiSuggestionsElementProps {
2973
+ /** Color mode (`auto` follows prefers-color-scheme). */
2974
+ theme?: "light" | "dark" | "auto";
2975
+ /** The suggestions. Strings, or `{ label, value }` when the displayed text and the emitted value differ. Set as a JS property. Omit to supply them as `<kai-suggestion>` light-DOM children instead; when both are present the property's suggestions come first. */
2976
+ suggestions?: (string | { label: string; value?: string; icon?: string })[];
2977
+ /** Chip style: `'outline'` (default), `'ghost'`, or `'default'` (filled). */
2978
+ variant?: "outline" | "ghost" | "default";
2979
+ /** Row height for `layout="list"`: `'md'` (default) or `'lg'` for taller rows. Chips are unaffected. */
2980
+ size?: "md" | "lg";
2981
+ /** Layout: `'chips'` (default) renders a wrapping row of rounded pills; `'list'` renders a vertical, full-width "Ideas for you" list where each row is left-aligned with a leading `icon`, a label, and a hover background. */
2982
+ layout?: "chips" | "list";
2983
+ /** Full-width left-aligned rows instead of pills. */
2984
+ block?: boolean;
2985
+ /** Substring to highlight within each suggestion. */
2986
+ highlight?: string;
2987
+ }
2988
+
2989
+ export interface KaiSwitchElementProps {
2990
+ /** Color mode (`auto` follows prefers-color-scheme). */
2991
+ theme?: "light" | "dark" | "auto";
2992
+ /** 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. */
2993
+ checked?: boolean;
2994
+ /** Initial checked state on mount (uncontrolled seed). Bare attribute (`<kai-switch default-checked>`) turns it on. */
2995
+ defaultChecked?: boolean;
2996
+ /** Disable interaction. */
2997
+ disabled?: boolean;
2998
+ /** Accessible label. */
2999
+ label?: string;
3000
+ /** Form-control name (paired with `value`). */
3001
+ name?: string;
3002
+ /** Submitted value when checked (paired with `name`). Defaults to `'on'`. */
3003
+ value?: string;
3004
+ }
3005
+
3006
+ export interface KaiTabsElementProps {
3007
+ /** Color mode (`auto` follows prefers-color-scheme). */
3008
+ theme?: "light" | "dark" | "auto";
3009
+ /** Tabs to render. Set as a JS property, not an HTML attribute. */
3010
+ items?: { id: string; label?: string; icon?: string; disabled?: boolean }[];
3011
+ /** 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. */
3012
+ value?: string;
3013
+ /** Initial selected id when uncontrolled (use the `default-value` attribute in plain HTML). */
3014
+ defaultValue?: string;
3015
+ /** `segmented` (default, a pill group) or `underline` (an underlined row). */
3016
+ variant?: "segmented" | "underline";
3017
+ /** Stretch the strip to full width, each tab sharing the space equally. */
3018
+ block?: boolean;
3019
+ /** Disable the whole strip. */
3020
+ disabled?: boolean;
3021
+ }
3022
+
3023
+ export interface KaiTasksElementProps {
3024
+ /** Color mode (`auto` follows prefers-color-scheme). */
3025
+ theme?: "light" | "dark" | "auto";
3026
+ /** The tasks definition (the CardEnvelope.data). Set as a JS PROPERTY: `el.data = { tasks:[…], selectAll, confirmLabel, … }`. Import `TasksCardData` from `@kitn.ai/ui` for the full shape. */
3027
+ data?: { mode?: "select" | "progress"; heading?: string; tasks: { id: string; label: string; description?: string; checked?: boolean; disabled?: boolean }[]; selectAll?: boolean; confirmLabel?: string; allowEmpty?: boolean; min?: number; max?: number; dismissible?: boolean };
3028
+ /** Stable card id correlating every emitted CardEvent. Attribute: `card-id`. */
3029
+ cardId?: string;
3030
+ /** Heading rendered in the card chrome (= CardEnvelope.title). Attribute: `heading`. */
3031
+ heading?: string;
3032
+ /** Set when the user resolved this card; renders the read-only view. Property: `el.resolution = { kind:'submit', data:{ selected:[…] } }`. */
3033
+ resolution?: Record<string, unknown>;
3034
+ /** Controlled selection (task ids; JS property). When set, it wins over local state. */
3035
+ value?: string[];
3036
+ /** Uncontrolled initial selection (task ids; JS property), overlaying per-task `checked`. */
3037
+ defaultValue?: string[];
3038
+ /** Freeze the whole list + Confirm. Attribute: `disabled`. */
3039
+ disabled?: boolean;
3040
+ /** 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`. */
3041
+ readonly?: boolean;
3042
+ }
3043
+
3044
+ export interface KaiTextShimmerElementProps {
3045
+ /** Color mode (`auto` follows prefers-color-scheme). */
3046
+ theme?: "light" | "dark" | "auto";
3047
+ /** The text to shimmer. */
3048
+ text?: string;
3049
+ /** Element tag to render as (default `span`). */
3050
+ as?: string;
3051
+ /** Animation duration in seconds. */
3052
+ duration?: number;
3053
+ /** Gradient spread (5–45). */
3054
+ spread?: number;
3055
+ }
3056
+
3057
+ export interface KaiThinkingBarElementProps {
3058
+ /** Color mode (`auto` follows prefers-color-scheme). */
3059
+ theme?: "light" | "dark" | "auto";
3060
+ /** The shimmering label, e.g. "Thinking…". */
3061
+ text?: string;
3062
+ /** When true, show a "stop" affordance that fires a `stop` event. */
3063
+ stoppable?: boolean;
3064
+ /** Label for the stop affordance. */
3065
+ stopLabel?: string;
3066
+ }
3067
+
3068
+ export interface KaiThreadElementProps {
3069
+ /** Color mode (`auto` follows prefers-color-scheme). */
3070
+ theme?: "light" | "dark" | "auto";
3071
+ /** The full message thread to render, newest last. Each entry carries its role, ordered `parts`, and optional actions/avatar/feedback. Set as a JS property (`el.messages = [...]`); a NEW array reference per streaming chunk re-renders (mutating in place does not). */
3072
+ messages?: { id: string; role: "user" | "assistant"; parts: ({ type: "text"; text: string; raw?: { source: string; payload: unknown } } | { type: "reasoning"; text: string; label?: string; index?: number; streamId?: string; signature?: string; raw?: { source: string; payload: unknown } } | { type: "tool"; tool: { type: string; kind?: "command" | "file-change" | "search" | "fetch" | "mcp" | "image" | "generic"; state: "input-streaming" | "input-available" | "output-available" | "output-error"; input?: Record<string, unknown>; rawInput?: string; output?: Record<string, unknown>; toolCallId?: string; errorText?: string; raw?: { source: string; payload: unknown } }; raw?: { source: string; payload: unknown } } | { type: "card"; envelope: { 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 } }; raw?: { source: string; payload: unknown } } | { type: "source"; source: { id?: string; url?: string; title?: string; snippet?: string; index?: number }; raw?: { source: string; payload: unknown } } | { type: "file"; attachment: { id: string; type: "file" | "source-document"; filename?: string; mediaType?: string; url?: string; title?: string }; raw?: { source: string; payload: unknown } })[]; actions?: ("copy" | "like" | "dislike" | "regenerate" | "edit" | { id: string; label: string; icon?: string; tooltip?: string })[]; avatar?: { src?: string; fallback?: string; alt?: string }; feedback?: "like" | "dislike" }[];
3073
+ /** Show a typing indicator on the pending assistant turn. Set it while awaiting the assistant's reply. */
3074
+ loading?: boolean;
3075
+ /** Body/prose font scale for rendered markdown (`'xs' | 'sm' | 'base' | 'lg'`). Defaults to `'sm'`. */
3076
+ proseSize?: "xs" | "sm" | "base" | "lg";
3077
+ /** Shiki theme name for syntax-highlighted code blocks (e.g. `'github-dark-dimmed'`). */
3078
+ codeTheme?: string;
3079
+ /** Enable Shiki syntax highlighting in code blocks. Turn off to render plain `<pre>` blocks (lighter, no highlighter load). Default true. */
3080
+ codeHighlight?: boolean;
3081
+ /** Whether each message's action bar is always visible (`'always'`, default) or only revealed on hover of that message row (`'hover'`). */
3082
+ actionsReveal?: "always" | "hover";
3083
+ /** Show the scroll-to-bottom button inside the scroll area. Default true. */
3084
+ scrollButton?: boolean;
3085
+ /** Extra classes applied to the thread's inner root. */
3086
+ class?: string;
3087
+ /** Optional card type -> custom-element tag overrides/additions for `card` parts (merged over the built-ins). Property: `el.cardTypes`. Typed as a plain string map (not the `CardTagMap` alias) so the generated React wrapper inlines it instead of emitting an unresolved named type. */
3088
+ cardTypes?: Record<string, string>;
3089
+ /** JSON Schemas for the card types this app renders, keyed by envelope type. The companion of `cardTypes`, which says what DRAWS a card while this says what a VALID one looks like. An OBJECT, so it is a JS property only: `el.cardSchemas = { 'pricing-table': pricingSchema }`, never an attribute. `createCardRegistry(...).validationSchemas` is exactly this shape. Without it the kit validates its own seven built-ins and leaves your own card type, the one your app actually cares about, as the only unchecked thing on screen. A schema here WINS over a built-in of the same name. Typed `Record<string, object>` rather than `Record<string, JsonSchema>` deliberately: an imported `.json` schema widens `"type"` to `string`, and an authored one carries `$schema`/`title`/`description`/`additionalProperties`, so the tighter type would reject both of the normal ways to supply one. */
3090
+ cardSchemas?: Record<string, object>;
3091
+ }
3092
+
3093
+ export interface KaiToastRegionElementProps {
3094
+ /** Color mode (`auto` follows prefers-color-scheme). */
3095
+ theme?: "light" | "dark" | "auto";
3096
+ /** The toasts to render. Newest is shown on top. Set as a JS property (array); pass a new array reference to update. Omit for an empty region, which is the normal resting state and how the imperative `toast()` API starts. */
3097
+ toasts?: { id: string; message: string; variant?: "neutral" | "success" | "warning" | "error" | "info"; appearance?: "pill" | "card"; inverse?: boolean; description?: string; action?: { label: string; onAction: () => void | false }; duration?: number; dismissible?: boolean; target?: HTMLElement }[];
3098
+ /** Stack anchor: `'top-center'` (default), `'top-right'`, `'bottom-center'`, … */
3099
+ position?: "top-center" | "top-right" | "top-left" | "bottom-center" | "bottom-right" | "bottom-left";
3100
+ /** Max simultaneously-visible toasts; the rest queue. Defaults to `3`. */
3101
+ max?: number;
3102
+ /** Stacking: 'expanded' (default, full column) | 'collapsed' (Sonner-style pile that expands on hover/focus). Attribute: stack. */
3103
+ stack?: "expanded" | "collapsed";
3104
+ /** Default appearance for this region's toasts: `'pill'` (default, compact) | `'card'` (richer, with a description line). A per-toast `appearance` wins. Attribute: `appearance`. */
3105
+ appearance?: "pill" | "card";
3106
+ /** Default high-contrast inverse treatment for this region's toasts. A per-toast `inverse` wins. Off by default. Attribute: `inverse`. */
3107
+ inverse?: boolean;
3108
+ /** Container element to anchor this region to (JS property). Set by the store for a scoped region; unset = the global viewport region. */
3109
+ target?: HTMLElement;
3110
+ }
3111
+
3112
+ export interface KaiToolElementProps {
3113
+ /** Color mode (`auto` follows prefers-color-scheme). */
3114
+ theme?: "light" | "dark" | "auto";
3115
+ /** The tool-call to display. Set as a JS property. */
3116
+ tool?: { type: string; kind?: "command" | "file-change" | "search" | "fetch" | "mcp" | "image" | "generic"; state: "input-streaming" | "input-available" | "output-available" | "output-error"; input?: Record<string, unknown>; rawInput?: string; output?: Record<string, unknown>; toolCallId?: string; errorText?: string; raw?: { source: string; payload: unknown } };
3117
+ /** 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`. */
3118
+ open?: boolean;
3119
+ /** Initial open state on mount (uncontrolled seed). */
3120
+ defaultOpen?: boolean;
3121
+ /** Gate the disclosure trigger: programmatic `show()/hide()/toggle()` still work, but the trigger click no longer toggles. */
3122
+ disabled?: boolean;
3123
+ }
3124
+
3125
+ export interface KaiTooltipElementProps {
3126
+ /** Color mode (`auto` follows prefers-color-scheme). */
3127
+ theme?: "light" | "dark" | "auto";
3128
+ /** The hint text shown on hover/focus of the slotted trigger. */
3129
+ content?: string;
3130
+ /** Delay (ms) before the tooltip appears on hover. Defaults to 600. Focus shows it immediately regardless. */
3131
+ openDelay?: number;
3132
+ /** Delay (ms) before it hides after the pointer leaves. Defaults to 0 (hides immediately). */
3133
+ closeDelay?: number;
3134
+ /** Preferred placement: `'top' | 'bottom' | 'left' | 'right'` (+ optional `-start`/`-end`). Defaults to `'top'`; flips to stay in view. */
3135
+ placement?: string;
3136
+ /** 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`. */
3137
+ open?: boolean;
3138
+ /** Initial open state on mount (uncontrolled seed). */
3139
+ defaultOpen?: boolean;
3140
+ /** Turn the tooltip off while keeping the trigger mounted (hover/focus and `show()` no longer open it). */
3141
+ disabled?: boolean;
3142
+ }
3143
+
3144
+ export interface KaiVoiceInputElementProps {
3145
+ /** Color mode (`auto` follows prefers-color-scheme). */
3146
+ theme?: "light" | "dark" | "auto";
3147
+ /** Transcriber the host supplies: records audio, returns the text. This is a **function-valued property** (`el.transcribe = async blob => '...'`) because a value-returning callback can't be modelled as a fire-and-forget event. */
3148
+ transcribe?: (audio: Blob) => Promise<string>;
3149
+ /** Disable the mic button (non-interactive). */
3150
+ disabled?: boolean;
3151
+ /** 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. */
3152
+ recognitionLang?: string;
3153
+ /** Emit live partial transcripts (`kai-transcript-interim`) during native recognition. Attribute: `interim`. No-op on the transcribe/fallback paths. */
3154
+ interim?: boolean;
3155
+ }
3156
+
3157
+ export interface KaiVoiceOutputElementProps {
3158
+ /** Color mode (`auto` follows prefers-color-scheme). */
3159
+ theme?: "light" | "dark" | "auto";
3160
+ /** The utterance to read aloud. */
3161
+ text?: string;
3162
+ /** Speak automatically when `text` is set/changed. */
3163
+ autoplay?: boolean;
3164
+ /** 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. */
3165
+ synthesize?: (text: string) => Promise<Blob>;
3166
+ /** Disable the button (non-interactive). */
3167
+ disabled?: boolean;
3168
+ }
3169
+
3170
+ export interface KaiWorkspaceElementProps {
3171
+ /** Color mode (`auto` follows prefers-color-scheme). */
3172
+ theme?: "light" | "dark" | "auto";
3173
+ /** The sidebar's section headers, rendered in array order. A group carries no conversations of its own; it is matched against `conversations` by id, so the two props are complementary rather than alternatives. Omit for an ungrouped sidebar. Set as a JS property. */
3174
+ groups?: { id: string; userId?: string; teamId?: string; name: string; sortOrder: number; createdAt: string }[];
3175
+ /** Every conversation in the sidebar, flat. Each one is filed under the group whose `id` equals its `groupId`; one with no `groupId`, or with a `groupId` matching no entry in `groups`, falls into a trailing ungrouped section (headerless when `compact`), so nothing you pass in is ever dropped. There is no recency bucketing. Set as a JS property. Omit for an empty sidebar, or when `no-conversations` replaces the built-in list with your own `sidebar-header` content. */
3176
+ conversations?: { id: string; title: string; groupId?: string; scope: { type: "document" | "collection"; documentId?: string; filters?: { tags?: string[]; authors?: string[]; contentType?: "transcript" | "markdown"; dateRange?: { from: string; to: string } } }; messageCount: number; lastMessageAt: string; updatedAt: string; trailing?: string }[];
3177
+ /** Id of the open conversation, highlighted in the sidebar. */
3178
+ activeId?: string;
3179
+ /** The active conversation's message thread, newest last. Set as a JS property (`el.messages = [...]`); a NEW array reference per streaming chunk re-renders (mutating in place does not). Omit for an empty thread. */
3180
+ messages?: { id: string; role: "user" | "assistant"; parts: ({ type: "text"; text: string; raw?: { source: string; payload: unknown } } | { type: "reasoning"; text: string; label?: string; index?: number; streamId?: string; signature?: string; raw?: { source: string; payload: unknown } } | { type: "tool"; tool: { type: string; kind?: "command" | "file-change" | "search" | "fetch" | "mcp" | "image" | "generic"; state: "input-streaming" | "input-available" | "output-available" | "output-error"; input?: Record<string, unknown>; rawInput?: string; output?: Record<string, unknown>; toolCallId?: string; errorText?: string; raw?: { source: string; payload: unknown } }; raw?: { source: string; payload: unknown } } | { type: "card"; envelope: { 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 } }; raw?: { source: string; payload: unknown } } | { type: "source"; source: { id?: string; url?: string; title?: string; snippet?: string; index?: number }; raw?: { source: string; payload: unknown } } | { type: "file"; attachment: { id: string; type: "file" | "source-document"; filename?: string; mediaType?: string; url?: string; title?: string }; raw?: { source: string; payload: unknown } })[]; actions?: ("copy" | "like" | "dislike" | "regenerate" | "edit" | { id: string; label: string; icon?: string; tooltip?: string })[]; avatar?: { src?: string; fallback?: string; alt?: string }; feedback?: "like" | "dislike" }[];
3181
+ value?: string;
3182
+ placeholder?: string;
3183
+ loading?: boolean;
3184
+ suggestions?: string[];
3185
+ suggestionMode?: "submit" | "fill";
3186
+ proseSize?: "xs" | "sm" | "base" | "lg";
3187
+ codeTheme?: string;
3188
+ codeHighlight?: boolean;
3189
+ chatTitle?: string;
3190
+ models?: { id: string; name: string; provider?: string; description?: string; group?: string }[];
3191
+ currentModel?: string;
3192
+ context?: { usedTokens: number; maxTokens: number; inputTokens?: number; outputTokens?: number; estimatedCost?: number };
3193
+ scrollButton?: boolean;
3194
+ search?: boolean;
3195
+ voice?: boolean;
3196
+ /** Rich entity triggers (`/` skills, `@` agents/plugins) forwarded to the input. */
3197
+ triggers?: { char: string; kind: string; items?: { id: string; label: string; icon?: string; description?: string; group?: string; kind?: string; promptText?: string; data?: Record<string, unknown> }[] }[];
3198
+ /** Default icon per entity kind (kind → image src) forwarded to the input. */
3199
+ kindIcons?: Record<string, string>;
3200
+ /** Sidebar default width as a percent of the workspace (default 26). */
3201
+ sidebarWidth?: number;
3202
+ /** Sidebar min width in px (default 240). */
3203
+ sidebarMinWidth?: number;
3204
+ /** Sidebar max width in px (default 420). */
3205
+ sidebarMaxWidth?: number;
3206
+ /** Controlled collapsed state. Set this as a JS property (`el.sidebarCollapsed = true`) to drive the sidebar from your app, updating it in response to the `kai-sidebar-toggle` event. Omit for uncontrolled (the element manages it). */
3207
+ sidebarCollapsed?: boolean;
3208
+ /** Initial collapsed state when uncontrolled (default false). Use the `default-sidebar-collapsed` attribute to start collapsed in plain HTML. */
3209
+ defaultSidebarCollapsed?: boolean;
3210
+ /** 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`. */
3211
+ collapseBelow?: number;
3212
+ /** Render Recents as dense single-line rows (a leading dot + title, no count). */
3213
+ compact?: boolean;
3214
+ /** 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`. */
3215
+ noConversations?: boolean;
3216
+ /** Optional card type -> custom-element tag overrides/additions for `card` parts (merged over the built-ins). Property: `el.cardTypes`. Typed as a plain string map (not the `CardTagMap` alias) so the generated React wrapper inlines it instead of emitting an unresolved named type. */
3217
+ cardTypes?: Record<string, string>;
3218
+ /** JSON Schemas for the card types this app renders, keyed by envelope type. The companion of `cardTypes`, which says what DRAWS a card while this says what a VALID one looks like. An OBJECT, so it is a JS property only: `el.cardSchemas = { 'pricing-table': pricingSchema }`, never an attribute. `createCardRegistry(...).validationSchemas` is exactly this shape. Without it the kit validates its own seven built-ins and leaves your own card type, the one your app actually cares about, as the only unchecked thing on screen. A schema here WINS over a built-in of the same name. Typed `Record<string, object>` rather than `Record<string, JsonSchema>` deliberately: an imported `.json` schema widens `"type"` to `string`, and an authored one carries `$schema`/`title`/`description`/`additionalProperties`, so the tighter type would reject both of the normal ways to supply one. */
3219
+ cardSchemas?: Record<string, object>;
3220
+ }
3221
+
3222
+ export interface KaiAgentCardElementEvents {
3223
+ /** The card was activated by a click, or by Enter / Space while focused. Promote this agent back to focus. */
3224
+ onKaiActivate?: (event: CustomEvent) => void;
3225
+ /** The trailing "..." kebab was clicked. The consumer opens its own menu; the card only surfaces the affordance (the click does not also activate the card). */
3226
+ onKaiMenu?: (event: CustomEvent) => void;
3227
+ }
3228
+
3229
+ export interface KaiArtifactElementEvents {
3230
+ /** Fired when a file is selected. `detail.path`. */
3231
+ onKaiFileSelect?: (event: CustomEvent<{ path: string }>) => void;
3232
+ /** Artifact's own maximize button toggled (consumer-observable; non-bubbling). */
3233
+ onKaiMaximizeChange?: (event: CustomEvent<{ maximized: boolean }>) => void;
3234
+ /** The maximize PROTOCOL intent, raised as a raw bubbling + composed CustomEvent (not through `dispatch`) so an enclosing `<kai-resizable>` can catch it and maximize the containing panel. Declared here so it is typed and reaches the generated API. Listen for it to drive maximize from your own chrome, or re-emit it to trigger one. */
3235
+ onKaiMaximizeIntent?: (event: CustomEvent<{ requested: boolean }>) => void;
3236
+ /** Fired when the preview navigates. `detail.url` = the new location. */
3237
+ onKaiNavigate?: (event: CustomEvent<{ url: string }>) => void;
3238
+ /** Fired when the Preview|Code tab changes. `detail.tab`. */
3239
+ onKaiTabChange?: (event: CustomEvent<{ tab: "preview" | "code" }>) => void;
3240
+ }
3241
+
3242
+ export interface KaiAttachmentsElementEvents {
3243
+ /** A remove button was clicked. */
3244
+ onKaiRemove?: (event: CustomEvent<{ id: string }>) => void;
3245
+ }
3246
+
3247
+ export interface KaiAudioVisualizerElementEvents {
3248
+
3249
+ }
3250
+
3251
+ export interface KaiAvatarElementEvents {
3252
+
3253
+ }
3254
+
3255
+ export interface KaiBadgeElementEvents {
3256
+
3257
+ }
3258
+
3259
+ export interface KaiButtonElementEvents {
3260
+ /** The button was activated (pointer or keyboard). Carries no detail. The native `click` also bubbles (composed) for consumers who prefer it. */
3261
+ onKaiClick?: (event: CustomEvent) => void;
3262
+ }
3263
+
3264
+ export interface KaiCardElementEvents {
3265
+ /** A `clickable`/`href` card was activated (click, or Enter/Space). */
3266
+ onKaiCardClick?: (event: CustomEvent) => void;
3267
+ /** The card was dismissed via its × (it also hides itself). */
3268
+ onKaiDismiss?: (event: CustomEvent) => void;
3269
+ }
3270
+
3271
+ export interface KaiCardsElementEvents {
3272
+ /** A child card transitioned to a resolved/deferred state (an action was chosen, a form/tasks submission landed, or it was dismissed). Re-emitted off the host as a non-bubbling convenience event so a consumer can observe resolution centrally without diffing the cards array. `detail` = `{ cardId, resolution }`. (A `reopen` un-resolves a card and has no `CardResolution`, so it does NOT fire this; observe reopen via the underlying bubbling `kai-card` event.) */
3273
+ onKaiCardResolved?: (event: CustomEvent<{ cardId: string; resolution: { kind: "action"; action: string; payload?: unknown; at?: undefined | string } | { kind: "submit"; data: unknown; at?: undefined | string } | { kind: "dismissed"; at?: undefined | string } | { kind: "expired"; reason?: undefined | string; at?: undefined | string } }>) => void;
3274
+ }
3275
+
3276
+ export interface KaiChainOfThoughtElementEvents {
3277
+ /** The open set changed, by user click OR an expand()/collapse()/toggle() call. `value` is a string in `single` mode, a string[] in `multiple` mode. (Maps Radix Accordion's onValueChange.) */
3278
+ onKaiValueChange?: (event: CustomEvent<{ value: string | string[] }>) => void;
3279
+ }
3280
+
3281
+ export interface KaiChatElementEvents {
3282
+ /** The staged attachments changed (file added or removed). Carries the full current list so a consumer can react in real time. */
3283
+ onKaiAttachmentsChange?: (event: CustomEvent<{ attachments: { id: string; type: "file" | "source-document"; filename?: undefined | string; mediaType?: undefined | string; url?: undefined | string; title?: undefined | string }[] }>) => void;
3284
+ /** One or more picked files were refused because `accept` excluded them. The element renders NO message of its own: it reports the facts (name, media type, whether the kit could have sent it) and what the user should see is the application's call. Only ever fires when `accept` is set. */
3285
+ onKaiAttachmentsRejected?: (event: CustomEvent<{ rejected: { filename: string; mediaType: string; reason: "filtered" | "unsupported" }[] }>) => void;
3286
+ /** An action button on a message was clicked. `action` is the built-in name or custom id. `state` is present only for the toggleable feedback votes: `'on'` when a like/dislike is set, `'off'` when re-tapped to clear. */
3287
+ onKaiMessageAction?: (event: CustomEvent<{ messageId: string; action: string; state?: undefined | "on" | "off" }>) => void;
3288
+ /** The header model switcher changed. */
3289
+ onKaiModelChange?: (event: CustomEvent<{ modelId: string }>) => void;
3290
+ /** The Search button was clicked. */
3291
+ onKaiSearch?: (event: CustomEvent<Record<string, never>>) => void;
3292
+ /** User submitted a message. */
3293
+ onKaiSubmit?: (event: CustomEvent<{ value: string; attachments: { id: string; type: "file" | "source-document"; filename?: undefined | string; mediaType?: undefined | string; url?: undefined | string; title?: undefined | string }[] }>) => void;
3294
+ /** A suggestion chip was clicked (only in `suggestion-mode="fill"`). */
3295
+ onKaiSuggestionClick?: (event: CustomEvent<{ value: string }>) => void;
3296
+ /** Fired on every input change. */
3297
+ onKaiValueChange?: (event: CustomEvent<{ value: string }>) => void;
3298
+ /** The Mic / voice button was clicked. */
3299
+ onKaiVoice?: (event: CustomEvent<Record<string, never>>) => void;
3300
+ }
3301
+
3302
+ export interface KaiCheckpointElementEvents {
3303
+ /** The checkpoint was clicked. */
3304
+ onKaiSelect?: (event: CustomEvent) => void;
3305
+ }
3306
+
3307
+ export interface KaiChoiceElementEvents {
3308
+ /** The selection changed BEFORE submit (a row click or the `select()` method). Distinct from the terminal `action` verb on the `kai-card` contract event. */
3309
+ onKaiValueChange?: (event: CustomEvent<{ value: string }>) => void;
3310
+ }
3311
+
3312
+ export interface KaiCoachmarkElementEvents {
3313
+ /** The × dismiss button was pressed. The consumer records that this hint was seen so it won't show again. */
3314
+ onKaiDismiss?: (event: CustomEvent<Record<string, never>>) => void;
3315
+ /** The coachmark opened or closed (a method, the ×, or a driven `open`). */
3316
+ onKaiOpenChange?: (event: CustomEvent<{ open: boolean }>) => void;
3317
+ }
3318
+
3319
+ export interface KaiCodeBlockElementEvents {
3320
+
3321
+ }
3322
+
3323
+ export interface KaiCommandElementEvents {
3324
+ /** Fired when the highlighted/active item changes, via Arrow keys or when filtering re-clamps the active row. `id` is the newly active item's id, or `undefined` when no item is active (e.g. the filtered list is empty). Lets a host preview the active item without committing a selection. */
3325
+ onKaiActiveChange?: (event: CustomEvent<{ id: string | undefined }>) => void;
3326
+ /** Fired on every keystroke in the search input. */
3327
+ onKaiQueryChange?: (event: CustomEvent<{ value: string }>) => void;
3328
+ /** Fired when the user selects an item (click or Enter). */
3329
+ onKaiSelect?: (event: CustomEvent<{ id: string }>) => void;
3330
+ }
3331
+
3332
+ export interface KaiCompareElementEvents {
3333
+ /** The user committed a pick. `detail` = `{ chosenId, rejectedIds, at }`. */
3334
+ onKaiCompareSelect?: (event: CustomEvent<{ chosenId: string; rejectedIds: string[]; at?: undefined | number }>) => void;
3335
+ /** The definition was unusable. */
3336
+ onKaiError?: (event: CustomEvent<{ compareId: string; message: string }>) => void;
3337
+ /** Both candidates have settled and the pick is live. */
3338
+ onKaiReady?: (event: CustomEvent<{ compareId: string }>) => void;
3339
+ }
3340
+
3341
+ export interface KaiComposerElementEvents {
3342
+ /** The composer lost focus. */
3343
+ onKaiBlur?: (event: CustomEvent<{ originalEvent: FocusEvent }>) => void;
3344
+ /** An entity pill was inserted into the composer. */
3345
+ onKaiEntityAdd?: (event: CustomEvent<{ entity: { kind: string; id: string; label: string; icon?: undefined | string; promptText?: undefined | string; data?: undefined | Record<string, unknown> } }>) => void;
3346
+ /** An entity pill was deleted from the composer. */
3347
+ onKaiEntityRemove?: (event: CustomEvent<{ entity: { kind: string; id: string; label: string; icon?: undefined | string; promptText?: undefined | string; data?: undefined | Record<string, unknown> } }>) => void;
3348
+ /** The composer gained focus. `focus`/`blur` are NOT composed natively, so they don't escape the shadow root; these re-expose them on the host. (For `keydown`/`paste`/`focusin`/`focusout`, listen NATIVELY on `<kai-composer>`: they're composed and already cross the shadow boundary.) */
3349
+ onKaiFocus?: (event: CustomEvent<{ originalEvent: FocusEvent }>) => void;
3350
+ /** The user submitted the composer (Enter or programmatic submit). */
3351
+ onKaiSubmit?: (event: CustomEvent<{ doc: ({ type: "text"; text: string } | { type: "entity"; entity: { kind: string; id: string; label: string; icon?: undefined | string; promptText?: undefined | string; data?: undefined | Record<string, unknown> } })[]; text: string; entities: { kind: string; id: string; label: string; icon?: undefined | string; promptText?: undefined | string; data?: undefined | Record<string, unknown> }[] }>) => void;
3352
+ /** A trigger character was detected at the caret (e.g. `/` or `@`). */
3353
+ onKaiTrigger?: (event: CustomEvent<{ char: string; query: string; rect: DOMRect }>) => void;
3354
+ /** The active trigger was dismissed (Escape, space, or outside click). */
3355
+ onKaiTriggerClose?: (event: CustomEvent<Record<string, never>>) => void;
3356
+ /** The content changed (fires on every input event). */
3357
+ onKaiValueChange?: (event: CustomEvent<{ doc: ({ type: "text"; text: string } | { type: "entity"; entity: { kind: string; id: string; label: string; icon?: undefined | string; promptText?: undefined | string; data?: undefined | Record<string, unknown> } })[]; text: string; entities: { kind: string; id: string; label: string; icon?: undefined | string; promptText?: undefined | string; data?: undefined | Record<string, unknown> }[] }>) => void;
3358
+ }
3359
+
3360
+ export interface KaiConfirmElementEvents {
3361
+
3362
+ }
3363
+
3364
+ export interface KaiContextElementEvents {
3365
+ /** Fires when the computed severity level changes (ok → warn → danger or back). `detail.level` is `'ok'`, `'warn'`, or `'danger'`. */
3366
+ onKaiThresholdChange?: (event: CustomEvent<{ level: "ok" | "warn" | "danger" }>) => void;
3367
+ }
3368
+
3369
+ export interface KaiConversationsElementEvents {
3370
+ /** The rail was collapsed or expanded (via the toggle, the reopen button, or a `collapse()`/`expand()`/`toggle()` call). */
3371
+ onKaiCollapseToggle?: (event: CustomEvent<{ collapsed: boolean }>) => void;
3372
+ /** A conversation was selected. */
3373
+ onKaiConversationSelect?: (event: CustomEvent<{ id: string }>) => void;
3374
+ /** The "New chat" button was clicked. */
3375
+ onKaiNewChat?: (event: CustomEvent<Record<string, never>>) => void;
3376
+ /** The built-in search box query changed (typing, or a programmatic `clear()` which fires it with `''`). Lets a consumer mirror or server-side the filter. */
3377
+ onKaiSearch?: (event: CustomEvent<{ query: string }>) => void;
3378
+ /** The sidebar toggle was clicked. */
3379
+ onKaiToggleSidebar?: (event: CustomEvent<Record<string, never>>) => void;
3380
+ }
3381
+
3382
+ export interface KaiDialogElementEvents {
3383
+ /** The dialog opened or closed (Escape, backdrop click, a driven `open`, or a method). */
3384
+ onKaiOpenChange?: (event: CustomEvent<{ open: boolean }>) => void;
3385
+ }
3386
+
3387
+ export interface KaiEditableLabelElementEvents {
3388
+ /** Edit was cancelled (Esc); the text is restored. */
3389
+ onKaiCancel?: (event: CustomEvent<Record<string, never>>) => void;
3390
+ /** Committed a changed value (Enter / blur). */
3391
+ onKaiRename?: (event: CustomEvent<{ value: string }>) => void;
3392
+ }
3393
+
3394
+ export interface KaiEmbedElementEvents {
3395
+
3396
+ }
3397
+
3398
+ export interface KaiEmptyElementEvents {
3399
+
3400
+ }
3401
+
3402
+ export interface KaiFeedbackBarElementEvents {
3403
+ /** The user dismissed the banner. */
3404
+ onKaiClose?: (event: CustomEvent) => void;
3405
+ /** The user rated the response. `value` is `'helpful'` or `'not-helpful'`. */
3406
+ onKaiFeedback?: (event: CustomEvent<{ value: "helpful" | "not-helpful" }>) => void;
3407
+ /** The user submitted the optional detail form (`collect-detail`). */
3408
+ onKaiFeedbackDetail?: (event: CustomEvent<{ value: "helpful" | "not-helpful"; category?: undefined | string; comment?: undefined | string }>) => void;
3409
+ }
3410
+
3411
+ export interface KaiFileTreeElementEvents {
3412
+ /** Fired when a file is selected. `detail.path` = the file's path. */
3413
+ onKaiSelect?: (event: CustomEvent<{ path: string }>) => void;
3414
+ }
3415
+
3416
+ export interface KaiFileUploadElementEvents {
3417
+ /** Files were picked or dropped. */
3418
+ onKaiFilesAdded?: (event: CustomEvent<{ files: File[] }>) => void;
3419
+ }
3420
+
3421
+ export interface KaiFormElementEvents {
3422
+ /** The form's values changed on input. Carries the current coerced values + validity. */
3423
+ onKaiValuesChange?: (event: CustomEvent<{ values: Record<string, unknown>; valid: boolean }>) => void;
3424
+ }
3425
+
3426
+ export interface KaiHoverCardElementEvents {
3427
+ /** The card opened or closed (by hover/focus, outside-click, or a method). */
3428
+ onKaiOpenChange?: (event: CustomEvent<{ open: boolean }>) => void;
3429
+ }
3430
+
3431
+ export interface KaiIconElementEvents {
3432
+
3433
+ }
3434
+
3435
+ export interface KaiImageElementEvents {
3436
+
3437
+ }
3438
+
3439
+ export interface KaiInputElementEvents {
3440
+ /** The value was committed (blur). */
3441
+ onKaiChange?: (event: CustomEvent<{ value: string }>) => void;
3442
+ /** The value changed per keystroke. */
3443
+ onKaiInput?: (event: CustomEvent<{ value: string }>) => void;
3444
+ }
3445
+
3446
+ export interface KaiKbdElementEvents {
3447
+
3448
+ }
3449
+
3450
+ export interface KaiLinkPreviewElementEvents {
3451
+
3452
+ }
3453
+
3454
+ export interface KaiLoaderElementEvents {
3455
+
3456
+ }
3457
+
3458
+ export interface KaiMarkdownElementEvents {
3459
+
3460
+ }
3461
+
3462
+ export interface KaiMenuElementEvents {
3463
+ /** The menu opened or closed (by click, keyboard, Escape, outside-click, or a method). */
3464
+ onKaiOpenChange?: (event: CustomEvent<{ open: boolean }>) => void;
3465
+ /** Fired when the user selects a leaf item. - Plain items: `{ id }`. - Checkbox items: `{ id, checked }` where `checked` is the NEW state. - Radio items: `{ id, radioGroup }`, where the consumer marks `id` as the selected one in `radioGroup` and clears the others. */
3466
+ onKaiSelect?: (event: CustomEvent<{ id: string; checked?: undefined | boolean; radioGroup?: undefined | string }>) => void;
3467
+ }
3468
+
3469
+ export interface KaiMessageElementEvents {
3470
+ /** An action button was clicked. `action` is the built-in name or custom id. `state` is present only for the toggleable feedback votes: `'on'` when a like/dislike is set, `'off'` when re-tapped to clear. */
3471
+ onKaiMessageAction?: (event: CustomEvent<{ messageId: string; action: string; state?: undefined | "on" | "off" }>) => void;
3472
+ }
3473
+
3474
+ export interface KaiModelSwitcherElementEvents {
3475
+ /** A model was selected. */
3476
+ onKaiModelChange?: (event: CustomEvent<{ modelId: string }>) => void;
3477
+ /** The model dropdown opened or closed (by click, keyboard, Escape, outside-click, or a method). */
3478
+ onKaiOpenChange?: (event: CustomEvent<{ open: boolean }>) => void;
3479
+ }
3480
+
3481
+ export interface KaiNavElementEvents {
3482
+ /** A row's trailing `action` button was activated (not a select). `value` is the item id; `action` echoes the item's `{ icon, label }`. */
3483
+ onKaiNavItemAction?: (event: CustomEvent<{ value: string; action?: undefined | { icon: string; label: string } }>) => void;
3484
+ /** A `closable` row's trailing close button was activated (not a select). `value` is the item id. */
3485
+ onKaiNavItemClose?: (event: CustomEvent<{ value: string }>) => void;
3486
+ /** A nav item was activated. */
3487
+ onKaiNavSelect?: (event: CustomEvent<{ id: string }>) => void;
3488
+ }
3489
+
3490
+ export interface KaiNoticeElementEvents {
3491
+ /** The notice was dismissed via its × (it also hides itself). */
3492
+ onKaiDismiss?: (event: CustomEvent) => void;
3493
+ }
3494
+
3495
+ export interface KaiPaneElementEvents {
3496
+ /** The close (×) control was clicked. */
3497
+ onKaiClose?: (event: CustomEvent) => void;
3498
+ /** The dock control was clicked (only present when `show-dock`). */
3499
+ onKaiDock?: (event: CustomEvent) => void;
3500
+ /** The maximize/restore control was clicked. `detail.maximized` is the intended NEXT state. Drive the `maximized` prop yourself from it. */
3501
+ onKaiMaximize?: (event: CustomEvent<{ maximized: boolean }>) => void;
3502
+ /** The split control was clicked (only present when `show-split`). */
3503
+ onKaiSplit?: (event: CustomEvent) => void;
3504
+ }
3505
+
3506
+ export interface KaiPaneGroupElementEvents {
3507
+ /** A tab was selected (click, Enter/Space, or arrow-key move). `detail.id` is the tab's id. */
3508
+ onKaiTabChange?: (event: CustomEvent<{ id: string }>) => void;
3509
+ /** A tab's close (×) was clicked. Drop the tab from `tabs` yourself. */
3510
+ onKaiTabClose?: (event: CustomEvent<{ id: string }>) => void;
3511
+ /** A tab's "…" overflow was clicked. Open your own menu from `detail.id`. */
3512
+ onKaiTabMenu?: (event: CustomEvent<{ id: string }>) => void;
3513
+ }
3514
+
3515
+ export interface KaiPopoverElementEvents {
3516
+ /** The popover opened or closed (click, Escape, outside-click, or a method). */
3517
+ onKaiOpenChange?: (event: CustomEvent<{ open: boolean }>) => void;
3518
+ }
3519
+
3520
+ export interface KaiProgressBarElementEvents {
3521
+
3522
+ }
3523
+
3524
+ export interface KaiPromptDockElementEvents {
3525
+
3526
+ }
3527
+
3528
+ export interface KaiPromptInputElementEvents {
3529
+ /** The staged attachments changed: a file was added (via the paperclip) or removed (per-chip ×). Carries the full current list so a consumer can react in real time (validate, show upload progress, toggle the send button). */
3530
+ onKaiAttachmentsChange?: (event: CustomEvent<{ attachments: { id: string; type: "file" | "source-document"; filename?: undefined | string; mediaType?: undefined | string; url?: undefined | string; title?: undefined | string }[] }>) => void;
3531
+ /** The Search (Globe) toolbar button was clicked. */
3532
+ onKaiSearch?: (event: CustomEvent<Record<string, never>>) => void;
3533
+ /** The Stop button was clicked while `stoppable` and `loading` are both true. */
3534
+ onKaiStop?: (event: CustomEvent<Record<string, never>>) => void;
3535
+ /** The user submitted the prompt (Enter or send button). `value` is the flattened text (back-compat); `doc` is the structured document and `entities` the inserted pills (skills/agents) for downstream expansion. */
3536
+ onKaiSubmit?: (event: CustomEvent<{ value: string; doc: ({ type: "text"; text: string } | { type: "entity"; entity: { kind: string; id: string; label: string; icon?: undefined | string; promptText?: undefined | string; data?: undefined | Record<string, unknown> } })[]; entities: { kind: string; id: string; label: string; icon?: undefined | string; promptText?: undefined | string; data?: undefined | Record<string, unknown> }[]; attachments: { id: string; type: "file" | "source-document"; filename?: undefined | string; mediaType?: undefined | string; url?: undefined | string; title?: undefined | string }[] }>) => void;
3537
+ /** A suggestion was clicked while `suggestion-mode="fill"`. */
3538
+ onKaiSuggestionClick?: (event: CustomEvent<{ value: string }>) => void;
3539
+ /** A custom `<kai-action>` toolbar button was clicked. `action` is the `id` of the `<kai-action>` element that was clicked. */
3540
+ onKaiToolbarAction?: (event: CustomEvent<{ action: string }>) => void;
3541
+ /** The input changed (fires on every edit). Carries the flattened `value` plus the structured `doc` + `entities`. */
3542
+ onKaiValueChange?: (event: CustomEvent<{ value: string; doc: ({ type: "text"; text: string } | { type: "entity"; entity: { kind: string; id: string; label: string; icon?: undefined | string; promptText?: undefined | string; data?: undefined | Record<string, unknown> } })[]; entities: { kind: string; id: string; label: string; icon?: undefined | string; promptText?: undefined | string; data?: undefined | Record<string, unknown> }[] }>) => void;
3543
+ /** The Voice (Mic) toolbar button was clicked. */
3544
+ onKaiVoice?: (event: CustomEvent<Record<string, never>>) => void;
3545
+ }
3546
+
3547
+ export interface KaiReasoningElementEvents {
3548
+ /** The reasoning block expanded or collapsed (via the trigger, streaming auto-open, or a method). */
3549
+ onKaiOpenChange?: (event: CustomEvent<{ open: boolean }>) => void;
3550
+ }
3551
+
3552
+ export interface KaiRemoteElementEvents {
3553
+
3554
+ }
3555
+
3556
+ export interface KaiResizableElementEvents {
3557
+ /** Fired on drag-end / keyboard resize / visibility change. `detail.sizes` = panel sizes in percent. */
3558
+ onKaiChange?: (event: CustomEvent<{ sizes: number[] }>) => void;
3559
+ /** Observe layout maximize state. */
3560
+ onKaiMaximizeChange?: (event: CustomEvent<{ maximized: boolean; index: number | null }>) => void;
3561
+ /** Authoritative maximize state, dispatched as a raw composed CustomEvent (not through `dispatch`) onto the affected `<kai-resizable-item>` and, on restore, onto the group host. A nested element (e.g. `<kai-artifact>`) listens for it to reconcile its own toggle. */
3562
+ onKaiMaximizeState?: (event: CustomEvent<{ maximized: boolean }>) => void;
3563
+ }
3564
+
3565
+ export interface KaiResizableItemElementEvents {
3566
+ onKaiChange?: (event: CustomEvent<unknown>) => void;
3567
+ onKaiMaximizeChange?: (event: CustomEvent<unknown>) => void;
3568
+ onKaiMaximizeState?: (event: CustomEvent<unknown>) => void;
3569
+ }
3570
+
3571
+ export interface KaiResponseStreamElementEvents {
3572
+ /** Streaming finished. */
3573
+ onKaiComplete?: (event: CustomEvent) => void;
3574
+ }
3575
+
3576
+ export interface KaiScopePickerElementEvents {
3577
+ /** The scope dropdown opened or closed (by click, keyboard, Escape, outside-click, or a method). */
3578
+ onKaiOpenChange?: (event: CustomEvent<{ open: boolean }>) => void;
3579
+ /** A scope was chosen (`undefined` filters = "All Content"). */
3580
+ onKaiScopeChange?: (event: CustomEvent<{ filters: { tags?: undefined | string[]; authors?: undefined | string[]; contentType?: undefined | "transcript" | "markdown"; dateRange?: undefined | { from: string; to: string } } | undefined }>) => void;
3581
+ }
3582
+
3583
+ export interface KaiScreenElementEvents {
3584
+ /** Back navigation intent: the back button or Escape. The consumer flips their own routing in response (the screen knows nothing about the trigger). */
3585
+ onKaiBack?: (event: CustomEvent<Record<string, never>>) => void;
3586
+ /** The screen opened or closed (a method, `Escape` close, or driven `open`). */
3587
+ onKaiOpenChange?: (event: CustomEvent<{ open: boolean }>) => void;
3588
+ }
3589
+
3590
+ export interface KaiScrollAreaElementEvents {
3591
+
3592
+ }
3593
+
3594
+ export interface KaiScrollButtonElementEvents {
3595
+ /** Emitted when the user clicks the button and `scrollToBottom()` is called. Carries no detail; consumers use it to know a manual scroll occurred. */
3596
+ onKaiScroll?: (event: CustomEvent) => void;
3597
+ }
3598
+
3599
+ export interface KaiSearchElementEvents {
3600
+ /** The field committed (blur). */
3601
+ onKaiChange?: (event: CustomEvent<{ value: string }>) => void;
3602
+ /** The query changed (debounced live, and on clear). */
3603
+ onKaiSearch?: (event: CustomEvent<{ value: string }>) => void;
3604
+ /** Enter was pressed. */
3605
+ onKaiSubmit?: (event: CustomEvent<{ value: string }>) => void;
3606
+ }
3607
+
3608
+ export interface KaiSegmentedElementEvents {
3609
+ /** A segment was chosen. */
3610
+ onKaiChange?: (event: CustomEvent<{ value: string }>) => void;
3611
+ }
3612
+
3613
+ export interface KaiSeparatorElementEvents {
3614
+
3615
+ }
3616
+
3617
+ export interface KaiSettingItemElementEvents {
3618
+
3619
+ }
3620
+
3621
+ export interface KaiSettingsGroupElementEvents {
3622
+
3623
+ }
3624
+
3625
+ export interface KaiSkeletonElementEvents {
3626
+
3627
+ }
3628
+
3629
+ export interface KaiSkillsElementEvents {
3630
+
3631
+ }
3632
+
3633
+ export interface KaiSourceElementEvents {
3634
+
3635
+ }
3636
+
3637
+ export interface KaiSourcesElementEvents {
3638
+
3639
+ }
3640
+
3641
+ export interface KaiStatusElementEvents {
3642
+
3643
+ }
3644
+
3645
+ export interface KaiSuggestionsElementEvents {
3646
+ /** A suggestion was clicked. */
3647
+ onKaiSelect?: (event: CustomEvent<{ value: string }>) => void;
3648
+ }
3649
+
3650
+ export interface KaiSwitchElementEvents {
3651
+ /** The toggle changed. */
3652
+ onKaiChange?: (event: CustomEvent<{ checked: boolean }>) => void;
3653
+ }
3654
+
3655
+ export interface KaiTabsElementEvents {
3656
+ /** A tab was selected (click, Enter/Space, or arrow-key move). `value` is the item's id. */
3657
+ onKaiTabChange?: (event: CustomEvent<{ value: string }>) => void;
3658
+ }
3659
+
3660
+ export interface KaiTasksElementEvents {
3661
+ /** The selection changed on a toggle. Carries the selected ids in input order. */
3662
+ onKaiValueChange?: (event: CustomEvent<{ value: string[] }>) => void;
3663
+ }
3664
+
3665
+ export interface KaiTextShimmerElementEvents {
3666
+
3667
+ }
3668
+
3669
+ export interface KaiThinkingBarElementEvents {
3670
+ /** The "stop / answer now" affordance was clicked. */
3671
+ onKaiStop?: (event: CustomEvent) => void;
3672
+ }
3673
+
3674
+ export interface KaiThreadElementEvents {
3675
+ /** A message's action button was clicked. `action` is the built-in name (`copy` / `like` / `dislike` / `regenerate` / `edit`) or a custom id. `state` is present only for the toggleable feedback votes: `'on'` when a like/dislike is set, `'off'` when re-tapped to clear. */
3676
+ onKaiMessageAction?: (event: CustomEvent<{ messageId: string; action: string; state?: undefined | "on" | "off" }>) => void;
3677
+ }
3678
+
3679
+ export interface KaiToastRegionElementEvents {
3680
+ /** A toast's action button was pressed. */
3681
+ onKaiAction?: (event: CustomEvent<{ id: string; label: string }>) => void;
3682
+ /** A toast left the stack. `reason` is `'timeout' | 'close' | 'action'`. */
3683
+ onKaiDismiss?: (event: CustomEvent<{ id: string; reason: "timeout" | "close" | "action" }>) => void;
3684
+ }
3685
+
3686
+ export interface KaiToolElementEvents {
3687
+ /** The panel expanded or collapsed (by trigger click or a method). */
3688
+ onKaiOpenChange?: (event: CustomEvent<{ open: boolean }>) => void;
3689
+ }
3690
+
3691
+ export interface KaiTooltipElementEvents {
3692
+ /** The tooltip opened or closed (by hover/focus, outside-click, or a method). */
3693
+ onKaiOpenChange?: (event: CustomEvent<{ open: boolean }>) => void;
3694
+ }
3695
+
3696
+ export interface KaiVoiceInputElementEvents {
3697
+ /** Raw audio captured (before transcription), for hosts that prefer to handle transcription themselves instead of via the `transcribe` property. Also the unsupported-fallback signal: no `transcribe`, no SpeechRecognition, so only the blob is produced (no text). */
3698
+ onKaiAudioCaptured?: (event: CustomEvent<{ blob: Blob }>) => void;
3699
+ /** Recording started or stopped. Lets the host drive its own UI (waveform, push-to-talk indicator) in sync with the mic. Fires on real transitions only (manual click and programmatic start()/stop()), never on mount. */
3700
+ onKaiRecordingChange?: (event: CustomEvent<{ recording: boolean }>) => void;
3701
+ /** Live partial transcript during native recognition (only when `interim` is set). Fires repeatedly before the final `kai-transcription`. */
3702
+ onKaiTranscriptInterim?: (event: CustomEvent<{ text: string }>) => void;
3703
+ /** Final transcript: the `transcribe` property resolved, OR native `SpeechRecognition` produced final text (no `transcribe` set). */
3704
+ onKaiTranscription?: (event: CustomEvent<{ text: string }>) => void;
3705
+ }
3706
+
3707
+ export interface KaiVoiceOutputElementEvents {
3708
+ /** Playback started or stopped. Drive your own UI in sync. Fires on real transitions only (manual click and programmatic speak()/stop()), never on mount. */
3709
+ onKaiSpeakingChange?: (event: CustomEvent<{ speaking: boolean }>) => void;
3710
+ /** The model path (`synthesize`) resolved audio: the raw `Blob` before playback. */
3711
+ onKaiSynthesized?: (event: CustomEvent<{ blob: Blob }>) => void;
3712
+ }
3713
+
3714
+ export interface KaiWorkspaceElementEvents {
3715
+ /** A conversation was selected in the sidebar. */
3716
+ onKaiConversationSelect?: (event: CustomEvent<{ id: string }>) => void;
3717
+ /** An action button on a message was clicked. `state` is present only for the toggleable feedback votes: `'on'` when a like/dislike is set, `'off'` when re-tapped to clear. */
3718
+ onKaiMessageAction?: (event: CustomEvent<{ messageId: string; action: string; state?: undefined | "on" | "off" }>) => void;
3719
+ /** The header model switcher changed. */
3720
+ onKaiModelChange?: (event: CustomEvent<{ modelId: string }>) => void;
3721
+ /** The "New chat" button was clicked. */
3722
+ onKaiNewChat?: (event: CustomEvent<Record<string, never>>) => void;
3723
+ /** The Search button was clicked. */
3724
+ onKaiSearch?: (event: CustomEvent<Record<string, never>>) => void;
3725
+ /** The sidebar was collapsed or expanded. */
3726
+ onKaiSidebarToggle?: (event: CustomEvent<{ collapsed: boolean }>) => void;
3727
+ /** User submitted a message. */
3728
+ onKaiSubmit?: (event: CustomEvent<{ value: string; attachments: { id: string; type: "file" | "source-document"; filename?: undefined | string; mediaType?: undefined | string; url?: undefined | string; title?: undefined | string }[] }>) => void;
3729
+ /** A suggestion chip was clicked (only in `suggestion-mode="fill"`). */
3730
+ onKaiSuggestionClick?: (event: CustomEvent<{ value: string }>) => void;
3731
+ /** Fired on every input change. */
3732
+ onKaiValueChange?: (event: CustomEvent<{ value: string }>) => void;
3733
+ /** The Mic / voice button was clicked. */
3734
+ onKaiVoice?: (event: CustomEvent<Record<string, never>>) => void;
3735
+ }
3736
+
3737
+ /** Attributes every kai-* element tolerates in a Vue template on top of its own
3738
+ * props: `id`, `data-*`, `aria-*`, directives. The index signature keeps those
3739
+ * legal under `strictTemplates` WITHOUT weakening the declared props — an
3740
+ * explicit member always wins over an index signature. */
3741
+ export interface KaiElementVueProps {
3742
+ [attr: string]: unknown;
3743
+ }
3744
+
3745
+ /** A kai-* custom element as Vue's template type-checker sees it. Props are
3746
+ * `Partial` because the kai- contract allows setting any of them imperatively
3747
+ * through a ref instead of in the template. */
3748
+ export type KaiVueElement<Props, Events> = new () => {
3749
+ $props: Partial<Props> & Events & KaiElementVueProps;
3750
+ };
3751
+
3752
+ declare module 'vue' {
3753
+ interface GlobalComponents {
3754
+ 'kai-agent-card': KaiVueElement<KaiAgentCardElementProps, KaiAgentCardElementEvents>;
3755
+ KaiAgentCard: KaiVueElement<KaiAgentCardElementProps, KaiAgentCardElementEvents>;
3756
+ 'kai-artifact': KaiVueElement<KaiArtifactElementProps, KaiArtifactElementEvents>;
3757
+ KaiArtifact: KaiVueElement<KaiArtifactElementProps, KaiArtifactElementEvents>;
3758
+ 'kai-attachments': KaiVueElement<KaiAttachmentsElementProps, KaiAttachmentsElementEvents>;
3759
+ KaiAttachments: KaiVueElement<KaiAttachmentsElementProps, KaiAttachmentsElementEvents>;
3760
+ 'kai-audio-visualizer': KaiVueElement<KaiAudioVisualizerElementProps, KaiAudioVisualizerElementEvents>;
3761
+ KaiAudioVisualizer: KaiVueElement<KaiAudioVisualizerElementProps, KaiAudioVisualizerElementEvents>;
3762
+ 'kai-avatar': KaiVueElement<KaiAvatarElementProps, KaiAvatarElementEvents>;
3763
+ KaiAvatar: KaiVueElement<KaiAvatarElementProps, KaiAvatarElementEvents>;
3764
+ 'kai-badge': KaiVueElement<KaiBadgeElementProps, KaiBadgeElementEvents>;
3765
+ KaiBadge: KaiVueElement<KaiBadgeElementProps, KaiBadgeElementEvents>;
3766
+ 'kai-button': KaiVueElement<KaiButtonElementProps, KaiButtonElementEvents>;
3767
+ KaiButton: KaiVueElement<KaiButtonElementProps, KaiButtonElementEvents>;
3768
+ 'kai-card': KaiVueElement<KaiCardElementProps, KaiCardElementEvents>;
3769
+ KaiCard: KaiVueElement<KaiCardElementProps, KaiCardElementEvents>;
3770
+ 'kai-cards': KaiVueElement<KaiCardsElementProps, KaiCardsElementEvents>;
3771
+ KaiCards: KaiVueElement<KaiCardsElementProps, KaiCardsElementEvents>;
3772
+ 'kai-chain-of-thought': KaiVueElement<KaiChainOfThoughtElementProps, KaiChainOfThoughtElementEvents>;
3773
+ KaiChainOfThought: KaiVueElement<KaiChainOfThoughtElementProps, KaiChainOfThoughtElementEvents>;
3774
+ 'kai-chat': KaiVueElement<KaiChatElementProps, KaiChatElementEvents>;
3775
+ KaiChat: KaiVueElement<KaiChatElementProps, KaiChatElementEvents>;
3776
+ 'kai-checkpoint': KaiVueElement<KaiCheckpointElementProps, KaiCheckpointElementEvents>;
3777
+ KaiCheckpoint: KaiVueElement<KaiCheckpointElementProps, KaiCheckpointElementEvents>;
3778
+ 'kai-choice': KaiVueElement<KaiChoiceElementProps, KaiChoiceElementEvents>;
3779
+ KaiChoice: KaiVueElement<KaiChoiceElementProps, KaiChoiceElementEvents>;
3780
+ 'kai-coachmark': KaiVueElement<KaiCoachmarkElementProps, KaiCoachmarkElementEvents>;
3781
+ KaiCoachmark: KaiVueElement<KaiCoachmarkElementProps, KaiCoachmarkElementEvents>;
3782
+ 'kai-code-block': KaiVueElement<KaiCodeBlockElementProps, KaiCodeBlockElementEvents>;
3783
+ KaiCodeBlock: KaiVueElement<KaiCodeBlockElementProps, KaiCodeBlockElementEvents>;
3784
+ 'kai-command': KaiVueElement<KaiCommandElementProps, KaiCommandElementEvents>;
3785
+ KaiCommand: KaiVueElement<KaiCommandElementProps, KaiCommandElementEvents>;
3786
+ 'kai-compare': KaiVueElement<KaiCompareElementProps, KaiCompareElementEvents>;
3787
+ KaiCompare: KaiVueElement<KaiCompareElementProps, KaiCompareElementEvents>;
3788
+ 'kai-composer': KaiVueElement<KaiComposerElementProps, KaiComposerElementEvents>;
3789
+ KaiComposer: KaiVueElement<KaiComposerElementProps, KaiComposerElementEvents>;
3790
+ 'kai-confirm': KaiVueElement<KaiConfirmElementProps, KaiConfirmElementEvents>;
3791
+ KaiConfirm: KaiVueElement<KaiConfirmElementProps, KaiConfirmElementEvents>;
3792
+ 'kai-context': KaiVueElement<KaiContextElementProps, KaiContextElementEvents>;
3793
+ KaiContext: KaiVueElement<KaiContextElementProps, KaiContextElementEvents>;
3794
+ 'kai-conversations': KaiVueElement<KaiConversationsElementProps, KaiConversationsElementEvents>;
3795
+ KaiConversations: KaiVueElement<KaiConversationsElementProps, KaiConversationsElementEvents>;
3796
+ 'kai-dialog': KaiVueElement<KaiDialogElementProps, KaiDialogElementEvents>;
3797
+ KaiDialog: KaiVueElement<KaiDialogElementProps, KaiDialogElementEvents>;
3798
+ 'kai-editable-label': KaiVueElement<KaiEditableLabelElementProps, KaiEditableLabelElementEvents>;
3799
+ KaiEditableLabel: KaiVueElement<KaiEditableLabelElementProps, KaiEditableLabelElementEvents>;
3800
+ 'kai-embed': KaiVueElement<KaiEmbedElementProps, KaiEmbedElementEvents>;
3801
+ KaiEmbed: KaiVueElement<KaiEmbedElementProps, KaiEmbedElementEvents>;
3802
+ 'kai-empty': KaiVueElement<KaiEmptyElementProps, KaiEmptyElementEvents>;
3803
+ KaiEmpty: KaiVueElement<KaiEmptyElementProps, KaiEmptyElementEvents>;
3804
+ 'kai-feedback-bar': KaiVueElement<KaiFeedbackBarElementProps, KaiFeedbackBarElementEvents>;
3805
+ KaiFeedbackBar: KaiVueElement<KaiFeedbackBarElementProps, KaiFeedbackBarElementEvents>;
3806
+ 'kai-file-tree': KaiVueElement<KaiFileTreeElementProps, KaiFileTreeElementEvents>;
3807
+ KaiFileTree: KaiVueElement<KaiFileTreeElementProps, KaiFileTreeElementEvents>;
3808
+ 'kai-file-upload': KaiVueElement<KaiFileUploadElementProps, KaiFileUploadElementEvents>;
3809
+ KaiFileUpload: KaiVueElement<KaiFileUploadElementProps, KaiFileUploadElementEvents>;
3810
+ 'kai-form': KaiVueElement<KaiFormElementProps, KaiFormElementEvents>;
3811
+ KaiForm: KaiVueElement<KaiFormElementProps, KaiFormElementEvents>;
3812
+ 'kai-hover-card': KaiVueElement<KaiHoverCardElementProps, KaiHoverCardElementEvents>;
3813
+ KaiHoverCard: KaiVueElement<KaiHoverCardElementProps, KaiHoverCardElementEvents>;
3814
+ 'kai-icon': KaiVueElement<KaiIconElementProps, KaiIconElementEvents>;
3815
+ KaiIcon: KaiVueElement<KaiIconElementProps, KaiIconElementEvents>;
3816
+ 'kai-image': KaiVueElement<KaiImageElementProps, KaiImageElementEvents>;
3817
+ KaiImage: KaiVueElement<KaiImageElementProps, KaiImageElementEvents>;
3818
+ 'kai-input': KaiVueElement<KaiInputElementProps, KaiInputElementEvents>;
3819
+ KaiInput: KaiVueElement<KaiInputElementProps, KaiInputElementEvents>;
3820
+ 'kai-kbd': KaiVueElement<KaiKbdElementProps, KaiKbdElementEvents>;
3821
+ KaiKbd: KaiVueElement<KaiKbdElementProps, KaiKbdElementEvents>;
3822
+ 'kai-link-preview': KaiVueElement<KaiLinkPreviewElementProps, KaiLinkPreviewElementEvents>;
3823
+ KaiLinkPreview: KaiVueElement<KaiLinkPreviewElementProps, KaiLinkPreviewElementEvents>;
3824
+ 'kai-loader': KaiVueElement<KaiLoaderElementProps, KaiLoaderElementEvents>;
3825
+ KaiLoader: KaiVueElement<KaiLoaderElementProps, KaiLoaderElementEvents>;
3826
+ 'kai-markdown': KaiVueElement<KaiMarkdownElementProps, KaiMarkdownElementEvents>;
3827
+ KaiMarkdown: KaiVueElement<KaiMarkdownElementProps, KaiMarkdownElementEvents>;
3828
+ 'kai-menu': KaiVueElement<KaiMenuElementProps, KaiMenuElementEvents>;
3829
+ KaiMenu: KaiVueElement<KaiMenuElementProps, KaiMenuElementEvents>;
3830
+ 'kai-message': KaiVueElement<KaiMessageElementProps, KaiMessageElementEvents>;
3831
+ KaiMessage: KaiVueElement<KaiMessageElementProps, KaiMessageElementEvents>;
3832
+ 'kai-model-switcher': KaiVueElement<KaiModelSwitcherElementProps, KaiModelSwitcherElementEvents>;
3833
+ KaiModelSwitcher: KaiVueElement<KaiModelSwitcherElementProps, KaiModelSwitcherElementEvents>;
3834
+ 'kai-nav': KaiVueElement<KaiNavElementProps, KaiNavElementEvents>;
3835
+ KaiNav: KaiVueElement<KaiNavElementProps, KaiNavElementEvents>;
3836
+ 'kai-notice': KaiVueElement<KaiNoticeElementProps, KaiNoticeElementEvents>;
3837
+ KaiNotice: KaiVueElement<KaiNoticeElementProps, KaiNoticeElementEvents>;
3838
+ 'kai-pane': KaiVueElement<KaiPaneElementProps, KaiPaneElementEvents>;
3839
+ KaiPane: KaiVueElement<KaiPaneElementProps, KaiPaneElementEvents>;
3840
+ 'kai-pane-group': KaiVueElement<KaiPaneGroupElementProps, KaiPaneGroupElementEvents>;
3841
+ KaiPaneGroup: KaiVueElement<KaiPaneGroupElementProps, KaiPaneGroupElementEvents>;
3842
+ 'kai-popover': KaiVueElement<KaiPopoverElementProps, KaiPopoverElementEvents>;
3843
+ KaiPopover: KaiVueElement<KaiPopoverElementProps, KaiPopoverElementEvents>;
3844
+ 'kai-progress-bar': KaiVueElement<KaiProgressBarElementProps, KaiProgressBarElementEvents>;
3845
+ KaiProgressBar: KaiVueElement<KaiProgressBarElementProps, KaiProgressBarElementEvents>;
3846
+ 'kai-prompt-dock': KaiVueElement<KaiPromptDockElementProps, KaiPromptDockElementEvents>;
3847
+ KaiPromptDock: KaiVueElement<KaiPromptDockElementProps, KaiPromptDockElementEvents>;
3848
+ 'kai-prompt-input': KaiVueElement<KaiPromptInputElementProps, KaiPromptInputElementEvents>;
3849
+ KaiPromptInput: KaiVueElement<KaiPromptInputElementProps, KaiPromptInputElementEvents>;
3850
+ 'kai-reasoning': KaiVueElement<KaiReasoningElementProps, KaiReasoningElementEvents>;
3851
+ KaiReasoning: KaiVueElement<KaiReasoningElementProps, KaiReasoningElementEvents>;
3852
+ 'kai-remote': KaiVueElement<KaiRemoteElementProps, KaiRemoteElementEvents>;
3853
+ KaiRemote: KaiVueElement<KaiRemoteElementProps, KaiRemoteElementEvents>;
3854
+ 'kai-resizable': KaiVueElement<KaiResizableElementProps, KaiResizableElementEvents>;
3855
+ KaiResizable: KaiVueElement<KaiResizableElementProps, KaiResizableElementEvents>;
3856
+ 'kai-resizable-item': KaiVueElement<KaiResizableItemElementProps, KaiResizableItemElementEvents>;
3857
+ KaiResizableItem: KaiVueElement<KaiResizableItemElementProps, KaiResizableItemElementEvents>;
3858
+ 'kai-response-stream': KaiVueElement<KaiResponseStreamElementProps, KaiResponseStreamElementEvents>;
3859
+ KaiResponseStream: KaiVueElement<KaiResponseStreamElementProps, KaiResponseStreamElementEvents>;
3860
+ 'kai-scope-picker': KaiVueElement<KaiScopePickerElementProps, KaiScopePickerElementEvents>;
3861
+ KaiScopePicker: KaiVueElement<KaiScopePickerElementProps, KaiScopePickerElementEvents>;
3862
+ 'kai-screen': KaiVueElement<KaiScreenElementProps, KaiScreenElementEvents>;
3863
+ KaiScreen: KaiVueElement<KaiScreenElementProps, KaiScreenElementEvents>;
3864
+ 'kai-scroll-area': KaiVueElement<KaiScrollAreaElementProps, KaiScrollAreaElementEvents>;
3865
+ KaiScrollArea: KaiVueElement<KaiScrollAreaElementProps, KaiScrollAreaElementEvents>;
3866
+ 'kai-scroll-button': KaiVueElement<KaiScrollButtonElementProps, KaiScrollButtonElementEvents>;
3867
+ KaiScrollButton: KaiVueElement<KaiScrollButtonElementProps, KaiScrollButtonElementEvents>;
3868
+ 'kai-search': KaiVueElement<KaiSearchElementProps, KaiSearchElementEvents>;
3869
+ KaiSearch: KaiVueElement<KaiSearchElementProps, KaiSearchElementEvents>;
3870
+ 'kai-segmented': KaiVueElement<KaiSegmentedElementProps, KaiSegmentedElementEvents>;
3871
+ KaiSegmented: KaiVueElement<KaiSegmentedElementProps, KaiSegmentedElementEvents>;
3872
+ 'kai-separator': KaiVueElement<KaiSeparatorElementProps, KaiSeparatorElementEvents>;
3873
+ KaiSeparator: KaiVueElement<KaiSeparatorElementProps, KaiSeparatorElementEvents>;
3874
+ 'kai-setting-item': KaiVueElement<KaiSettingItemElementProps, KaiSettingItemElementEvents>;
3875
+ KaiSettingItem: KaiVueElement<KaiSettingItemElementProps, KaiSettingItemElementEvents>;
3876
+ 'kai-settings-group': KaiVueElement<KaiSettingsGroupElementProps, KaiSettingsGroupElementEvents>;
3877
+ KaiSettingsGroup: KaiVueElement<KaiSettingsGroupElementProps, KaiSettingsGroupElementEvents>;
3878
+ 'kai-skeleton': KaiVueElement<KaiSkeletonElementProps, KaiSkeletonElementEvents>;
3879
+ KaiSkeleton: KaiVueElement<KaiSkeletonElementProps, KaiSkeletonElementEvents>;
3880
+ 'kai-skills': KaiVueElement<KaiSkillsElementProps, KaiSkillsElementEvents>;
3881
+ KaiSkills: KaiVueElement<KaiSkillsElementProps, KaiSkillsElementEvents>;
3882
+ 'kai-source': KaiVueElement<KaiSourceElementProps, KaiSourceElementEvents>;
3883
+ KaiSource: KaiVueElement<KaiSourceElementProps, KaiSourceElementEvents>;
3884
+ 'kai-sources': KaiVueElement<KaiSourcesElementProps, KaiSourcesElementEvents>;
3885
+ KaiSources: KaiVueElement<KaiSourcesElementProps, KaiSourcesElementEvents>;
3886
+ 'kai-status': KaiVueElement<KaiStatusElementProps, KaiStatusElementEvents>;
3887
+ KaiStatus: KaiVueElement<KaiStatusElementProps, KaiStatusElementEvents>;
3888
+ 'kai-suggestions': KaiVueElement<KaiSuggestionsElementProps, KaiSuggestionsElementEvents>;
3889
+ KaiSuggestions: KaiVueElement<KaiSuggestionsElementProps, KaiSuggestionsElementEvents>;
3890
+ 'kai-switch': KaiVueElement<KaiSwitchElementProps, KaiSwitchElementEvents>;
3891
+ KaiSwitch: KaiVueElement<KaiSwitchElementProps, KaiSwitchElementEvents>;
3892
+ 'kai-tabs': KaiVueElement<KaiTabsElementProps, KaiTabsElementEvents>;
3893
+ KaiTabs: KaiVueElement<KaiTabsElementProps, KaiTabsElementEvents>;
3894
+ 'kai-tasks': KaiVueElement<KaiTasksElementProps, KaiTasksElementEvents>;
3895
+ KaiTasks: KaiVueElement<KaiTasksElementProps, KaiTasksElementEvents>;
3896
+ 'kai-text-shimmer': KaiVueElement<KaiTextShimmerElementProps, KaiTextShimmerElementEvents>;
3897
+ KaiTextShimmer: KaiVueElement<KaiTextShimmerElementProps, KaiTextShimmerElementEvents>;
3898
+ 'kai-thinking-bar': KaiVueElement<KaiThinkingBarElementProps, KaiThinkingBarElementEvents>;
3899
+ KaiThinkingBar: KaiVueElement<KaiThinkingBarElementProps, KaiThinkingBarElementEvents>;
3900
+ 'kai-thread': KaiVueElement<KaiThreadElementProps, KaiThreadElementEvents>;
3901
+ KaiThread: KaiVueElement<KaiThreadElementProps, KaiThreadElementEvents>;
3902
+ 'kai-toast-region': KaiVueElement<KaiToastRegionElementProps, KaiToastRegionElementEvents>;
3903
+ KaiToastRegion: KaiVueElement<KaiToastRegionElementProps, KaiToastRegionElementEvents>;
3904
+ 'kai-tool': KaiVueElement<KaiToolElementProps, KaiToolElementEvents>;
3905
+ KaiTool: KaiVueElement<KaiToolElementProps, KaiToolElementEvents>;
3906
+ 'kai-tooltip': KaiVueElement<KaiTooltipElementProps, KaiTooltipElementEvents>;
3907
+ KaiTooltip: KaiVueElement<KaiTooltipElementProps, KaiTooltipElementEvents>;
3908
+ 'kai-voice-input': KaiVueElement<KaiVoiceInputElementProps, KaiVoiceInputElementEvents>;
3909
+ KaiVoiceInput: KaiVueElement<KaiVoiceInputElementProps, KaiVoiceInputElementEvents>;
3910
+ 'kai-voice-output': KaiVueElement<KaiVoiceOutputElementProps, KaiVoiceOutputElementEvents>;
3911
+ KaiVoiceOutput: KaiVueElement<KaiVoiceOutputElementProps, KaiVoiceOutputElementEvents>;
3912
+ 'kai-workspace': KaiVueElement<KaiWorkspaceElementProps, KaiWorkspaceElementEvents>;
3913
+ KaiWorkspace: KaiVueElement<KaiWorkspaceElementProps, KaiWorkspaceElementEvents>;
3914
+ }
3915
+ }