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