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