@kitn.ai/ui 0.27.0 → 0.29.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 (612) hide show
  1. package/README.md +10 -2
  2. package/dist/{Icon-BnFKqqtY.js → Icon-DObhsRtm.js} +1 -1
  3. package/dist/{action-icons-CBskfBMz.js → action-icons-CcgNN2oT.js} +1 -1
  4. package/dist/agent-tooling/construct/public.d.ts +15 -0
  5. package/dist/agent-tooling/construct/schema.d.ts +111 -0
  6. package/dist/arrow-down-CjRU3JgV.js +1 -0
  7. package/dist/arrow-left-Bnpb1UEW.js +1 -0
  8. package/dist/{artifact-CvXEm1lS.js → artifact-Bwt7OgcR.js} +1 -1
  9. package/dist/{attachments-C43ZegEq.js → attachments-Qr4kg-2b.js} +1 -1
  10. package/dist/{audio-visualizer-B-79y1Tj.js → audio-visualizer-DToYdfSc.js} +1 -1
  11. package/dist/{badge-BpUbq8c0.js → badge-CdEu_jn2.js} +1 -1
  12. package/dist/{bell-sn17Ip9v.js → bell-DQAAOpDz.js} +1 -1
  13. package/dist/{button-BH6rN0U-.js → button-DkuOnGLy.js} +1 -1
  14. package/dist/{card-renderer-Cb1gQmth.js → card-renderer-Jx70m6_l.js} +1 -1
  15. package/dist/{card-routing-DifQgS7n.js → card-routing-0YidER_3.js} +1 -1
  16. package/dist/check-njkVdZu2.js +1 -0
  17. package/dist/{checkbox-Dc9Yov_B.js → checkbox-D7iRB3nL.js} +1 -1
  18. package/dist/{checkbox-group-B1kDLLYk.js → checkbox-group-B2_rpoPM.js} +1 -1
  19. package/dist/chevron-down-B72s6PXR.js +1 -0
  20. package/dist/chevron-right-BatuHzUm.js +1 -0
  21. package/dist/{choice-card-BT3c1S8g.js → choice-card-m0BYqqOK.js} +1 -1
  22. package/dist/circle-check-B62pODB3.js +1 -0
  23. package/dist/{circle-x-wobWkoSx.js → circle-x-BPG0iPst.js} +1 -1
  24. package/dist/circle-zx0ByzY9.js +1 -0
  25. package/dist/code-block-ClMLKb7C.js +1 -0
  26. package/dist/{collapsible-CPJbf6FM.js → collapsible-B4DlWicL.js} +1 -1
  27. package/dist/components/chat-thread.d.ts +89 -1
  28. package/dist/components/conversation-item.d.ts +16 -0
  29. package/dist/components/conversation-panel.d.ts +29 -0
  30. package/dist/components/home-panel.d.ts +34 -0
  31. package/dist/components/widget-tab-bar.d.ts +16 -0
  32. package/dist/{composer-CjngLzal.js → composer-sQ0HcvyG.js} +3 -3
  33. package/dist/{confirm-card-DCx_A4bU.js → confirm-card-rQWDQsnC.js} +1 -1
  34. package/dist/construct-cli.es.js +185 -17
  35. package/dist/construct.d.ts +5 -0
  36. package/dist/construct.js +327 -0
  37. package/dist/{context-BY8V-Nlp.js → context-0kg4ZX1J.js} +1 -1
  38. package/dist/controllable-CnGpMF6r.js +1 -0
  39. package/dist/conversation-item-BxwQLaFJ.js +1 -0
  40. package/dist/conversation-list-BCfGN1JU.js +1 -0
  41. package/dist/{copy-B6DO4PqB.js → copy-n9u9rqpi.js} +1 -1
  42. package/dist/core-C8fzo39E.js +1 -12
  43. package/dist/{create-tween-CnMHviKB.js → create-tween-C-q-JCM-.js} +1 -1
  44. package/dist/{create-tween-D1aiGZZh.js → create-tween-CRrJXxBd.js} +1 -1
  45. package/dist/{create-tween-BPzaefTp.js → create-tween-DZ3RRDHD.js} +1 -1
  46. package/dist/{create-tween-DUSQUKpr.js → create-tween-uPkArjIG.js} +1 -1
  47. package/dist/custom-elements.json +51 -2
  48. package/dist/{default-input-CucQEOqH.js → default-input-CaMrJkgH.js} +1 -1
  49. package/dist/define-By-uL588.js +1 -0
  50. package/dist/define.js +2 -2
  51. package/dist/define.server.js +2 -2
  52. package/dist/{disclosure-CbLtajUQ.js → disclosure-WUImBbDv.js} +1 -1
  53. package/dist/{dropdown-BwhViJFd.js → dropdown-wZVeJOMd.js} +1 -1
  54. package/dist/elements/agent-card.js +1 -1
  55. package/dist/elements/artifact.js +1 -1
  56. package/dist/elements/attachments.js +1 -1
  57. package/dist/elements/audio-visualizer.js +1 -1
  58. package/dist/elements/avatar.js +1 -1
  59. package/dist/elements/badge.js +1 -1
  60. package/dist/elements/button.js +1 -1
  61. package/dist/elements/card.js +1 -1
  62. package/dist/elements/cards.js +1 -1
  63. package/dist/elements/chain-of-thought.js +1 -1
  64. package/dist/elements/chat-scope-picker.js +1 -1
  65. package/dist/elements/chat-workspace.js +1 -1
  66. package/dist/elements/chat.js +1 -1
  67. package/dist/elements/checkbox-group.js +1 -1
  68. package/dist/elements/checkbox.js +1 -1
  69. package/dist/elements/checkpoint.js +1 -1
  70. package/dist/elements/choice.js +1 -1
  71. package/dist/elements/coachmark.js +1 -1
  72. package/dist/elements/code-block.js +1 -1
  73. package/dist/elements/command.js +1 -1
  74. package/dist/elements/compare.js +1 -1
  75. package/dist/elements/composer.js +1 -1
  76. package/dist/elements/confirm-card.js +1 -1
  77. package/dist/elements/context-meter.js +1 -1
  78. package/dist/elements/conversation-item.js +1 -1
  79. package/dist/elements/conversation-list.js +1 -1
  80. package/dist/elements/dialog.js +1 -1
  81. package/dist/elements/dock.js +3 -3
  82. package/dist/elements/dropdown.js +1 -1
  83. package/dist/elements/editable-label.js +1 -1
  84. package/dist/elements/embed.js +1 -1
  85. package/dist/elements/empty.js +1 -1
  86. package/dist/elements/feedback-bar.js +1 -1
  87. package/dist/elements/file-tree.js +1 -1
  88. package/dist/elements/file-upload.js +1 -1
  89. package/dist/elements/form.js +1 -1
  90. package/dist/elements/hover-card.js +1 -1
  91. package/dist/elements/icon.js +1 -1
  92. package/dist/elements/image.js +1 -1
  93. package/dist/elements/input.js +1 -1
  94. package/dist/elements/kbd.js +1 -1
  95. package/dist/elements/link-preview.js +1 -1
  96. package/dist/elements/loader.js +1 -1
  97. package/dist/elements/markdown.js +1 -1
  98. package/dist/elements/menu.js +1 -1
  99. package/dist/elements/message-skills.js +1 -1
  100. package/dist/elements/message.js +1 -1
  101. package/dist/elements/model-switcher.js +1 -1
  102. package/dist/elements/nav.js +1 -1
  103. package/dist/elements/notice.js +1 -1
  104. package/dist/elements/pane-grid.js +1 -1
  105. package/dist/elements/pane-group.js +1 -1
  106. package/dist/elements/pane.js +1 -1
  107. package/dist/elements/popover.js +1 -1
  108. package/dist/elements/progress-bar.js +1 -1
  109. package/dist/elements/prompt-dock.js +1 -1
  110. package/dist/elements/prompt-input.js +1 -1
  111. package/dist/elements/prompt-suggestions.js +1 -1
  112. package/dist/elements/radio-group.js +1 -1
  113. package/dist/elements/reasoning.js +1 -1
  114. package/dist/elements/remote.js +1 -1
  115. package/dist/elements/resizable.js +1 -1
  116. package/dist/elements/response-stream.js +1 -1
  117. package/dist/elements/screen.js +1 -1
  118. package/dist/elements/scroll-area.js +1 -1
  119. package/dist/elements/scroll-button.js +1 -1
  120. package/dist/elements/search.js +1 -1
  121. package/dist/elements/segmented.js +1 -1
  122. package/dist/elements/select.js +1 -1
  123. package/dist/elements/separator.js +1 -1
  124. package/dist/elements/setting-item.js +1 -1
  125. package/dist/elements/settings-group.js +1 -1
  126. package/dist/elements/skeleton.js +1 -1
  127. package/dist/elements/slider.js +1 -1
  128. package/dist/elements/source.js +1 -1
  129. package/dist/elements/status.js +1 -1
  130. package/dist/elements/switch.js +1 -1
  131. package/dist/elements/tabs.js +1 -1
  132. package/dist/elements/tasks.js +1 -1
  133. package/dist/elements/text-shimmer.js +1 -1
  134. package/dist/elements/thinking-bar.js +1 -1
  135. package/dist/elements/thread.js +1 -1
  136. package/dist/elements/toast.js +1 -1
  137. package/dist/elements/tool.js +1 -1
  138. package/dist/elements/tooltip.js +1 -1
  139. package/dist/elements/voice-input.js +1 -1
  140. package/dist/elements/voice-output.js +1 -1
  141. package/dist/elements.d.ts +20 -4
  142. package/dist/{ellipsis-DFr4Vqr3.js → ellipsis-CbOpJnU3.js} +1 -1
  143. package/dist/{embed-5s_vU4J0.js → embed-CrfjkbUG.js} +1 -1
  144. package/dist/engine-javascript-C1x7zo1_.js +1 -141
  145. package/dist/{external-link-u9d85ORQ.js → external-link-ByXAwBBQ.js} +1 -1
  146. package/dist/{file-text-CX7_x42o.js → file-text-DMib2qwt.js} +1 -1
  147. package/dist/{file-tree-D3kBjXI5.js → file-tree-CJqM2aP7.js} +1 -1
  148. package/dist/{folder-V-YdIL8f.js → folder-_BAb929C.js} +1 -1
  149. package/dist/{form-BRNUMCN2.js → form-DSZgZQZk.js} +1 -1
  150. package/dist/{hover-card-DaeiYrTA.js → hover-card-BQbul9eq.js} +1 -1
  151. package/dist/{icon-BpixdZNq.js → icon-CdcfRhYI.js} +1 -1
  152. package/dist/index.d.ts +3 -1
  153. package/dist/index.js +2842 -2703
  154. package/dist/index.server.js +2820 -2681
  155. package/dist/{info-8mFsIjS3.js → info-DsFjGuI_.js} +1 -1
  156. package/dist/{input-d1Yuu-hz.js → input-DKbmkMos.js} +1 -1
  157. package/dist/kai.es.js +1 -1
  158. package/dist/{kbd-961zMPFB.js → kbd-PvdGhX4s.js} +1 -1
  159. package/dist/{link-preview-DIIbV2Sd.js → link-preview-DbM1866N.js} +1 -1
  160. package/dist/{link-DlZZBGaR.js → link-zF8PzWfF.js} +1 -1
  161. package/dist/{loader-YQszHFaW.js → loader-BM4CEz4G.js} +1 -1
  162. package/dist/{markdown-CVk1MPsj.js → markdown-LMvmAyBk.js} +7 -7
  163. package/dist/mcp.es.js +79 -5
  164. package/dist/{message-CwKVEdZg.js → message-BSsgvHvf.js} +1 -1
  165. package/dist/{message-DS8lzHc1.js → message-BYZECyek.js} +1 -1
  166. package/dist/message-circle-DruwObfX.js +1 -0
  167. package/dist/message-square-BG6q6mlm.js +1 -0
  168. package/dist/{minimize-2-UEZmP2QT.js → minimize-2-BQRoBV1V.js} +1 -1
  169. package/dist/{model-switcher-Kk1jEQ5t.js → model-switcher-CMpCOYcB.js} +1 -1
  170. package/dist/{overlay-C1od6LOz.js → overlay-Cb-MkyDa.js} +1 -1
  171. package/dist/{panel-right-ryET0yyn.js → panel-right-i8warFxT.js} +1 -1
  172. package/dist/{paperclip-BDNoZFJP.js → paperclip-ByY3UVO6.js} +1 -1
  173. package/dist/play-BvKKq3fX.js +1 -0
  174. package/dist/primitives/conversation-store.d.ts +54 -0
  175. package/dist/{progress-bar-BvYX0aoy.js → progress-bar-jVAHvMUf.js} +1 -1
  176. package/dist/{prompt-suggestion-BRFu2lcu.js → prompt-suggestion-CD-qtNgC.js} +1 -1
  177. package/dist/{radio-DcL23cNJ.js → radio-BsoBMhkF.js} +1 -1
  178. package/dist/react/index.d.ts +393 -0
  179. package/dist/react.js +20 -20
  180. package/dist/{reasoning-Cackq4Rh.js → reasoning-4kBPtlTx.js} +1 -1
  181. package/dist/register-impl-B1hLkrI8.js +424 -0
  182. package/dist/{resizable-Cp9HUYih.js → resizable-uPmY9VY-.js} +1 -1
  183. package/dist/{rotate-ccw-0DLRDHH5.js → rotate-ccw-B2xn93py.js} +1 -1
  184. package/dist/{rotate-cw-DOB9IGcU.js → rotate-cw-CMVLoCyH.js} +1 -1
  185. package/dist/{scroll-area-emVmWP4K.js → scroll-area-BqLUo8ZZ.js} +1 -1
  186. package/dist/{scroll-button-CeP_gv1x.js → scroll-button-DslXiJyL.js} +1 -1
  187. package/dist/{select-CWmu00tS.js → select-2cLRtPGT.js} +1 -1
  188. package/dist/{separator-CE6vly6z.js → separator-BWQtNJcM.js} +1 -1
  189. package/dist/{settings-CE-78SvZ.js → settings-BBR63jLg.js} +1 -1
  190. package/dist/{settings-group-ZFWNxFQR.js → settings-group-B2ciy-Iw.js} +1 -1
  191. package/dist/{skeleton-BebdP4mf.js → skeleton-CkHI-HgC.js} +1 -1
  192. package/dist/{slider-BAKRYUlz.js → slider-DDR9U-i0.js} +1 -1
  193. package/dist/{solid-BE5ui6sy.js → solid-BzCFdL25.js} +7720 -7058
  194. package/dist/{solid-DFhsce3O.js → solid-DruVOXnf.js} +5864 -5283
  195. package/dist/solid.d.ts +6 -2
  196. package/dist/solid.js +217 -210
  197. package/dist/solid.server.js +217 -210
  198. package/dist/{source-B0FlguSx.js → source-GEnFF528.js} +1 -1
  199. package/dist/{star-CBMZvLuN.js → star-CilHq8GP.js} +1 -1
  200. package/dist/store-Ciyk6eZG.js +1 -0
  201. package/dist/{switch-CViARZCy.js → switch-KkeQIbuH.js} +1 -1
  202. package/dist/{tasks-card-MjCcOhR_.js → tasks-card-BrN4bggJ.js} +1 -1
  203. package/dist/{text-shimmer-DKlwRF2G.js → text-shimmer-Dcj1MHuq.js} +1 -1
  204. package/dist/{textarea-3ay2Me2-.js → textarea-Dpvbngbg.js} +1 -1
  205. package/dist/theme.tokens.css +28 -0
  206. package/dist/{thumbs-up-DQcu2HMO.js → thumbs-up-CsT9Wzb9.js} +1 -1
  207. package/dist/{toast-store-C6yKOhbk.js → toast-store-tgK6MuMv.js} +1 -1
  208. package/dist/{tool-BCYNlfKy.js → tool-DzUjIBT8.js} +1 -1
  209. package/dist/{tooltip-05zI4hjs.js → tooltip-Bkkg_4t0.js} +1 -1
  210. package/dist/{trash-2-BR1RxGky.js → trash-2-jBKxjGGQ.js} +1 -1
  211. package/dist/{triangle-alert-DHohDOCy.js → triangle-alert-DlQ68ppf.js} +1 -1
  212. package/dist/types.d.ts +48 -3
  213. package/dist/ui/dock.d.ts +29 -0
  214. package/dist/{upload-BbGW6A_u.js → upload-TcAHXv9W.js} +1 -1
  215. package/dist/{url-scheme-policy-DHpoTJwB.js → url-scheme-policy-DR5DgvkM.js} +1 -1
  216. package/dist/{use-card-resolution-CJW4grFa.js → use-card-resolution-DaZqAdWf.js} +1 -1
  217. package/dist/{variant-aurora-xiMPty8f.js → variant-aurora-BhLuYxJR.js} +1 -1
  218. package/dist/{variant-aurora-BUOVgPOB.js → variant-aurora-CNmfHhcx.js} +2 -2
  219. package/dist/{variant-aurora-CUsUJvFI.js → variant-aurora-D6GsdTPA.js} +2 -2
  220. package/dist/{variant-aurora-CW2i4bfr.js → variant-aurora-DbW_OWL2.js} +1 -1
  221. package/dist/{variant-custom-D91HjAKz.js → variant-custom-BRvaNHSi.js} +1 -1
  222. package/dist/{variant-custom-BQtOnmeO.js → variant-custom-BvYHR62b.js} +1 -1
  223. package/dist/{variant-custom-CAnzzppW.js → variant-custom-DMTrEO5w.js} +2 -2
  224. package/dist/{variant-custom-CAm9L-E5.js → variant-custom-DV2x254s.js} +2 -2
  225. package/dist/{variant-wave-Ca1Ls4_y.js → variant-wave-BNMGrDfj.js} +2 -2
  226. package/dist/{variant-wave-uY5crU_K.js → variant-wave-BpDd8t3Z.js} +1 -1
  227. package/dist/{variant-wave-CxX39DKd.js → variant-wave-CyBueXj9.js} +2 -2
  228. package/dist/{variant-wave-DYyzIIZv.js → variant-wave-sp-qwsdI.js} +1 -1
  229. package/dist/x-Z5UntkIJ.js +1 -0
  230. package/frameworks/react/index.tsx +14 -4
  231. package/llms-full.txt +7 -2
  232. package/package.json +16 -16
  233. package/src/elements/element-meta.json +49 -6
  234. package/theme.css +28 -0
  235. package/bin/route.test.js +0 -58
  236. package/dist/arrow-down-Br0qtpsz.js +0 -1
  237. package/dist/arrow-left-Dj7xgE12.js +0 -1
  238. package/dist/check-DPeeMUYx.js +0 -1
  239. package/dist/chevron-down-CHSWk7ZT.js +0 -1
  240. package/dist/chevron-right-B7l_fMgx.js +0 -1
  241. package/dist/circle-Bb0yOpqM.js +0 -1
  242. package/dist/circle-check-BGZpCiz7.js +0 -1
  243. package/dist/code-block-CUQ5mtv0.js +0 -1
  244. package/dist/controllable-D43BKmtX.js +0 -1
  245. package/dist/conversation-list-D4lLU_yS.js +0 -1
  246. package/dist/define-CGGX-7Vg.js +0 -1
  247. package/dist/message-circle-Xf8Q-vZp.js +0 -1
  248. package/dist/message-square-Cxnwgkns.js +0 -1
  249. package/dist/play-OFIvYXUQ.js +0 -1
  250. package/dist/register-impl-C7rENvPK.js +0 -424
  251. package/dist/store-7eoadydQ.js +0 -1
  252. package/dist/x-C5m1JFgi.js +0 -1
  253. package/src/agent-tooling/archetypes.ts +0 -205
  254. package/src/agent-tooling/catalog/README.md +0 -676
  255. package/src/agent-tooling/catalog/catalog-types.ts +0 -231
  256. package/src/agent-tooling/catalog/fabrications.ts +0 -96
  257. package/src/agent-tooling/catalog/invariants.ts +0 -284
  258. package/src/agent-tooling/catalog/labs-titles.ts +0 -114
  259. package/src/agent-tooling/catalog/scenarios.ts +0 -87
  260. package/src/agent-tooling/catalog/surfaces.ts +0 -347
  261. package/src/agent-tooling/construct/cli-entry.ts +0 -8
  262. package/src/agent-tooling/construct/cli.ts +0 -131
  263. package/src/agent-tooling/construct/codegen.ts +0 -1353
  264. package/src/agent-tooling/construct/construct.v1.schema.json +0 -250
  265. package/src/agent-tooling/construct/dev.ts +0 -148
  266. package/src/agent-tooling/construct/fixtures/demo-widget.construct.json +0 -7
  267. package/src/agent-tooling/construct/fixtures/ops-console.construct.json +0 -44
  268. package/src/agent-tooling/construct/fixtures/owner-widget.construct.json +0 -23
  269. package/src/agent-tooling/construct/schema.ts +0 -371
  270. package/src/agent-tooling/integrations/anthropic.ts +0 -442
  271. package/src/agent-tooling/integrations/cloudflare.ts +0 -218
  272. package/src/agent-tooling/integrations/langgraph.ts +0 -133
  273. package/src/agent-tooling/integrations/mastra.ts +0 -182
  274. package/src/agent-tooling/integrations/mock.ts +0 -148
  275. package/src/agent-tooling/integrations/ollama.ts +0 -97
  276. package/src/agent-tooling/integrations/openai.ts +0 -95
  277. package/src/agent-tooling/integrations/openrouter.ts +0 -82
  278. package/src/agent-tooling/integrations/pi.ts +0 -176
  279. package/src/agent-tooling/integrations/pydantic-ai.ts +0 -108
  280. package/src/agent-tooling/integrations/vercel-ai-sdk.ts +0 -398
  281. package/src/agent-tooling/mcp/css-raw.d.ts +0 -12
  282. package/src/agent-tooling/mcp/manifest.ts +0 -422
  283. package/src/agent-tooling/mcp/server.ts +0 -116
  284. package/src/agent-tooling/mcp/stdio.ts +0 -18
  285. package/src/agent-tooling/mcp/tools/construct.ts +0 -130
  286. package/src/agent-tooling/mcp/tools/debug.ts +0 -621
  287. package/src/agent-tooling/mcp/tools/reference.ts +0 -980
  288. package/src/agent-tooling/mcp/tools/scaffold.ts +0 -6708
  289. package/src/agent-tooling/mcp/tools/theme.ts +0 -456
  290. package/src/agent-tooling/mcp/tools/types.ts +0 -14
  291. package/src/agent-tooling/mcp/validate-args.ts +0 -141
  292. package/src/agent-tooling/recipes/composed-thread.ts +0 -714
  293. package/src/agent-tooling/recipes/index.ts +0 -22
  294. package/src/agent-tooling/recipes/types.ts +0 -32
  295. package/src/agent-tooling/registry.ts +0 -132
  296. package/src/agent-tooling/route-emit.ts +0 -305
  297. package/src/agent-tooling/types.ts +0 -390
  298. package/src/components/artifact-card.tsx +0 -120
  299. package/src/components/artifact.tsx +0 -914
  300. package/src/components/attachment-types.ts +0 -66
  301. package/src/components/attachments.tsx +0 -536
  302. package/src/components/audio-visualizer/audio-visualizer.voice-fixture.ts +0 -257
  303. package/src/components/audio-visualizer/aurora.glsl.ts +0 -330
  304. package/src/components/audio-visualizer/fit-scale.ts +0 -112
  305. package/src/components/audio-visualizer/index.tsx +0 -528
  306. package/src/components/audio-visualizer/labs/lab-choreography.ts +0 -187
  307. package/src/components/audio-visualizer/labs/lab-shaders.ts +0 -363
  308. package/src/components/audio-visualizer/labs/lab-visualizer.tsx +0 -102
  309. package/src/components/audio-visualizer/shader-canvas.tsx +0 -876
  310. package/src/components/audio-visualizer/sizes.ts +0 -54
  311. package/src/components/audio-visualizer/variant-aurora.tsx +0 -305
  312. package/src/components/audio-visualizer/variant-bar.tsx +0 -175
  313. package/src/components/audio-visualizer/variant-custom.tsx +0 -344
  314. package/src/components/audio-visualizer/variant-grid.tsx +0 -175
  315. package/src/components/audio-visualizer/variant-radial.tsx +0 -163
  316. package/src/components/audio-visualizer/variant-wave.tsx +0 -130
  317. package/src/components/audio-visualizer/wave.glsl.ts +0 -130
  318. package/src/components/card-fallback.tsx +0 -60
  319. package/src/components/card-renderer.tsx +0 -220
  320. package/src/components/card.tsx +0 -212
  321. package/src/components/chain-of-thought.tsx +0 -348
  322. package/src/components/chat-container.tsx +0 -89
  323. package/src/components/chat-scope-picker.tsx +0 -57
  324. package/src/components/chat-thread.tsx +0 -518
  325. package/src/components/checkpoint.tsx +0 -88
  326. package/src/components/choice-card.tsx +0 -743
  327. package/src/components/coachmark.tsx +0 -249
  328. package/src/components/code-block.tsx +0 -181
  329. package/src/components/composer-dom.ts +0 -159
  330. package/src/components/composer-highlight.ts +0 -242
  331. package/src/components/composer-history.ts +0 -82
  332. package/src/components/composer.tsx +0 -1075
  333. package/src/components/confirm-card.tsx +0 -402
  334. package/src/components/context.tsx +0 -377
  335. package/src/components/conversation-item.tsx +0 -218
  336. package/src/components/conversation-list.tsx +0 -429
  337. package/src/components/dismissed-stub.tsx +0 -80
  338. package/src/components/embed.tsx +0 -200
  339. package/src/components/empty.tsx +0 -177
  340. package/src/components/feedback-bar.tsx +0 -166
  341. package/src/components/file-tree.tsx +0 -530
  342. package/src/components/file-upload.tsx +0 -167
  343. package/src/components/form-widgets.tsx +0 -525
  344. package/src/components/form.tsx +0 -1296
  345. package/src/components/image.tsx +0 -65
  346. package/src/components/link-preview.tsx +0 -195
  347. package/src/components/loader.tsx +0 -367
  348. package/src/components/markdown.tsx +0 -162
  349. package/src/components/message-skills.tsx +0 -40
  350. package/src/components/message.tsx +0 -765
  351. package/src/components/model-switcher.tsx +0 -132
  352. package/src/components/prompt-input.tsx +0 -188
  353. package/src/components/prompt-suggestion.tsx +0 -150
  354. package/src/components/reasoning.tsx +0 -293
  355. package/src/components/response-compare-types.ts +0 -152
  356. package/src/components/response-compare.tsx +0 -455
  357. package/src/components/response-stream.tsx +0 -109
  358. package/src/components/screen.tsx +0 -181
  359. package/src/components/scroll-button.tsx +0 -93
  360. package/src/components/source.tsx +0 -192
  361. package/src/components/tasks-card.tsx +0 -801
  362. package/src/components/text-shimmer.tsx +0 -37
  363. package/src/components/thinking-bar.tsx +0 -50
  364. package/src/components/thread.tsx +0 -228
  365. package/src/components/toast.tsx +0 -503
  366. package/src/components/tool-classify.ts +0 -26
  367. package/src/components/tool-types.ts +0 -49
  368. package/src/components/tool.tsx +0 -190
  369. package/src/components/use-card-resolution.ts +0 -44
  370. package/src/components/voice-input.tsx +0 -222
  371. package/src/components/voice-output.tsx +0 -242
  372. package/src/components/workspace-shell.tsx +0 -285
  373. package/src/diagnostics/hook.ts +0 -352
  374. package/src/diagnostics/index.ts +0 -82
  375. package/src/diagnostics/report-request.ts +0 -296
  376. package/src/elements/agent-card.tsx +0 -67
  377. package/src/elements/artifact.tsx +0 -194
  378. package/src/elements/attachments.tsx +0 -140
  379. package/src/elements/audio-visualizer.tsx +0 -227
  380. package/src/elements/autoloader.ts +0 -89
  381. package/src/elements/avatar.tsx +0 -33
  382. package/src/elements/badge.tsx +0 -32
  383. package/src/elements/button.tsx +0 -149
  384. package/src/elements/card.tsx +0 -133
  385. package/src/elements/cards.tsx +0 -266
  386. package/src/elements/chain-of-thought.tsx +0 -141
  387. package/src/elements/chat-scope-picker.tsx +0 -65
  388. package/src/elements/chat-types.ts +0 -102
  389. package/src/elements/chat-workspace.tsx +0 -188
  390. package/src/elements/chat.tsx +0 -212
  391. package/src/elements/checkbox-group.tsx +0 -164
  392. package/src/elements/checkbox.tsx +0 -134
  393. package/src/elements/checkpoint.tsx +0 -47
  394. package/src/elements/choice.tsx +0 -100
  395. package/src/elements/coachmark.tsx +0 -90
  396. package/src/elements/code-block.tsx +0 -60
  397. package/src/elements/command.tsx +0 -197
  398. package/src/elements/compare.tsx +0 -111
  399. package/src/elements/compiled.css +0 -2
  400. package/src/elements/composer.tsx +0 -162
  401. package/src/elements/confirm-card.tsx +0 -76
  402. package/src/elements/context-meter.tsx +0 -107
  403. package/src/elements/conversation-item.tsx +0 -120
  404. package/src/elements/conversation-list.tsx +0 -203
  405. package/src/elements/css.ts +0 -5
  406. package/src/elements/default-input.tsx +0 -392
  407. package/src/elements/define-entry.ts +0 -12
  408. package/src/elements/define.tsx +0 -563
  409. package/src/elements/diagnostic-events.ts +0 -114
  410. package/src/elements/dialog.tsx +0 -145
  411. package/src/elements/disclosure.ts +0 -95
  412. package/src/elements/dock.tsx +0 -215
  413. package/src/elements/dropdown.tsx +0 -123
  414. package/src/elements/editable-label.tsx +0 -140
  415. package/src/elements/element-data-types.ts +0 -152
  416. package/src/elements/element-diagnostics.ts +0 -392
  417. package/src/elements/element-manifest.json +0 -354
  418. package/src/elements/element-nonscalar.json +0 -185
  419. package/src/elements/element-types.d.ts +0 -4337
  420. package/src/elements/embed.tsx +0 -35
  421. package/src/elements/empty.tsx +0 -29
  422. package/src/elements/feedback-bar.tsx +0 -66
  423. package/src/elements/file-tree.tsx +0 -62
  424. package/src/elements/file-upload.tsx +0 -44
  425. package/src/elements/form.tsx +0 -94
  426. package/src/elements/hover-card.tsx +0 -80
  427. package/src/elements/icon.tsx +0 -41
  428. package/src/elements/image.tsx +0 -32
  429. package/src/elements/input.tsx +0 -492
  430. package/src/elements/kbd.tsx +0 -45
  431. package/src/elements/link-preview.tsx +0 -34
  432. package/src/elements/loader.tsx +0 -25
  433. package/src/elements/markdown.tsx +0 -38
  434. package/src/elements/menu.tsx +0 -241
  435. package/src/elements/message-skills.tsx +0 -83
  436. package/src/elements/message.tsx +0 -361
  437. package/src/elements/model-switcher.tsx +0 -121
  438. package/src/elements/nav.tsx +0 -87
  439. package/src/elements/notice.tsx +0 -53
  440. package/src/elements/pane-grid.tsx +0 -111
  441. package/src/elements/pane-group.tsx +0 -119
  442. package/src/elements/pane.tsx +0 -129
  443. package/src/elements/popover.tsx +0 -81
  444. package/src/elements/progress-bar.tsx +0 -39
  445. package/src/elements/prompt-dock.tsx +0 -82
  446. package/src/elements/prompt-input.tsx +0 -240
  447. package/src/elements/prompt-suggestions.tsx +0 -113
  448. package/src/elements/radio-group.tsx +0 -129
  449. package/src/elements/reasoning.tsx +0 -71
  450. package/src/elements/register-impl.ts +0 -148
  451. package/src/elements/register.ts +0 -76
  452. package/src/elements/remote.tsx +0 -225
  453. package/src/elements/resizable.globals.d.ts +0 -36
  454. package/src/elements/resizable.tsx +0 -704
  455. package/src/elements/response-stream.tsx +0 -40
  456. package/src/elements/screen.tsx +0 -90
  457. package/src/elements/scroll-area.tsx +0 -33
  458. package/src/elements/scroll-button.tsx +0 -179
  459. package/src/elements/search.tsx +0 -185
  460. package/src/elements/segmented.tsx +0 -129
  461. package/src/elements/select.tsx +0 -165
  462. package/src/elements/separator.tsx +0 -36
  463. package/src/elements/setting-item.tsx +0 -50
  464. package/src/elements/settings-group.tsx +0 -37
  465. package/src/elements/skeleton.tsx +0 -45
  466. package/src/elements/slider.tsx +0 -171
  467. package/src/elements/slot-text.ts +0 -73
  468. package/src/elements/slots.ts +0 -787
  469. package/src/elements/source.tsx +0 -126
  470. package/src/elements/status.tsx +0 -42
  471. package/src/elements/styles.css +0 -328
  472. package/src/elements/switch.tsx +0 -118
  473. package/src/elements/tabs.tsx +0 -95
  474. package/src/elements/tasks.tsx +0 -103
  475. package/src/elements/text-shimmer.tsx +0 -28
  476. package/src/elements/thinking-bar.tsx +0 -43
  477. package/src/elements/thread.tsx +0 -139
  478. package/src/elements/toast.tsx +0 -106
  479. package/src/elements/tool.tsx +0 -78
  480. package/src/elements/tooltip.tsx +0 -85
  481. package/src/elements/validate-messages.ts +0 -76
  482. package/src/elements/voice-input.tsx +0 -100
  483. package/src/elements/voice-output.tsx +0 -82
  484. package/src/index.ts +0 -428
  485. package/src/primitives/audio-bands.ts +0 -174
  486. package/src/primitives/card-component-types.ts +0 -63
  487. package/src/primitives/card-contract.ts +0 -80
  488. package/src/primitives/card-data-types.ts +0 -361
  489. package/src/primitives/card-host.tsx +0 -37
  490. package/src/primitives/card-recovery.ts +0 -160
  491. package/src/primitives/card-registry.tsx +0 -78
  492. package/src/primitives/card-resolution.ts +0 -36
  493. package/src/primitives/card-routing.ts +0 -85
  494. package/src/primitives/card-schemas/artifact.schema.json +0 -92
  495. package/src/primitives/card-schemas/card-envelope.schema.json +0 -14
  496. package/src/primitives/card-schemas/card-event.schema.json +0 -12
  497. package/src/primitives/card-schemas/choice.schema.json +0 -75
  498. package/src/primitives/card-schemas/confirm.schema.json +0 -65
  499. package/src/primitives/card-schemas/embed.schema.json +0 -63
  500. package/src/primitives/card-schemas/form.result.schema.json +0 -7
  501. package/src/primitives/card-schemas/form.schema.json +0 -53
  502. package/src/primitives/card-schemas/link.schema.json +0 -54
  503. package/src/primitives/card-schemas/tasks.result.schema.json +0 -16
  504. package/src/primitives/card-schemas/tasks.schema.json +0 -83
  505. package/src/primitives/card-tags.ts +0 -61
  506. package/src/primitives/card-validate-cards.ts +0 -255
  507. package/src/primitives/card-validate-schemas.ts +0 -58
  508. package/src/primitives/card-validate.ts +0 -131
  509. package/src/primitives/chat-config.tsx +0 -103
  510. package/src/primitives/composer-model.ts +0 -49
  511. package/src/primitives/composer-triggers.ts +0 -35
  512. package/src/primitives/controllable.ts +0 -21
  513. package/src/primitives/create-kai-chat.ts +0 -66
  514. package/src/primitives/create-tween.ts +0 -266
  515. package/src/primitives/embed-providers.ts +0 -254
  516. package/src/primitives/field-mask.ts +0 -256
  517. package/src/primitives/field-semantics.ts +0 -115
  518. package/src/primitives/highlighter.ts +0 -157
  519. package/src/primitives/input-mask.ts +0 -853
  520. package/src/primitives/link-preview.ts +0 -87
  521. package/src/primitives/message-feedback.ts +0 -124
  522. package/src/primitives/pdf-preview.ts +0 -121
  523. package/src/primitives/toast-store.ts +0 -338
  524. package/src/primitives/url-scheme-policy.ts +0 -70
  525. package/src/primitives/use-audio-analysis.ts +0 -340
  526. package/src/primitives/use-auto-resize.ts +0 -31
  527. package/src/primitives/use-resize-observer.ts +0 -45
  528. package/src/primitives/use-sequencer.ts +0 -72
  529. package/src/primitives/use-speech-recognition.ts +0 -146
  530. package/src/primitives/use-stick-to-bottom.ts +0 -75
  531. package/src/primitives/use-text-stream.ts +0 -143
  532. package/src/primitives/use-voice-recorder.ts +0 -62
  533. package/src/primitives/visualizer-sequences.ts +0 -350
  534. package/src/remote/host-embed.ts +0 -345
  535. package/src/remote/index.ts +0 -2
  536. package/src/remote/origin.ts +0 -30
  537. package/src/remote/provider-runtime.ts +0 -262
  538. package/src/remote/provider.ts +0 -2
  539. package/src/remote/validate.ts +0 -22
  540. package/src/remote/version.ts +0 -12
  541. package/src/remote/wire.ts +0 -48
  542. package/src/schemas/from-tool-call.ts +0 -151
  543. package/src/schemas/index.ts +0 -341
  544. package/src/schemas/provider-subsets.ts +0 -538
  545. package/src/schemas/registry.ts +0 -355
  546. package/src/schemas/tool-defs.ts +0 -793
  547. package/src/solid.ts +0 -165
  548. package/src/state/index.ts +0 -44
  549. package/src/state/messages.ts +0 -53
  550. package/src/state/mock.ts +0 -297
  551. package/src/state/parts.ts +0 -295
  552. package/src/state/persistence.ts +0 -180
  553. package/src/state/stream.ts +0 -246
  554. package/src/state/suggestions.ts +0 -9
  555. package/src/state/threads.ts +0 -142
  556. package/src/test-utils/fake-clock.ts +0 -88
  557. package/src/types.ts +0 -53
  558. package/src/ui/action-icons.ts +0 -53
  559. package/src/ui/agent-card.tsx +0 -218
  560. package/src/ui/avatar.tsx +0 -23
  561. package/src/ui/badge.tsx +0 -21
  562. package/src/ui/button.tsx +0 -49
  563. package/src/ui/card.tsx +0 -245
  564. package/src/ui/checkbox-group.tsx +0 -153
  565. package/src/ui/checkbox.tsx +0 -63
  566. package/src/ui/collapsible.tsx +0 -163
  567. package/src/ui/command.tsx +0 -103
  568. package/src/ui/dialog.tsx +0 -223
  569. package/src/ui/dock.tsx +0 -584
  570. package/src/ui/dropdown.tsx +0 -636
  571. package/src/ui/editable-label.tsx +0 -112
  572. package/src/ui/hover-card.tsx +0 -345
  573. package/src/ui/icon.tsx +0 -167
  574. package/src/ui/input.tsx +0 -391
  575. package/src/ui/kbd.tsx +0 -118
  576. package/src/ui/nav.tsx +0 -282
  577. package/src/ui/notice.tsx +0 -84
  578. package/src/ui/overlay.tsx +0 -277
  579. package/src/ui/pane-grid.tsx +0 -117
  580. package/src/ui/pane-group.tsx +0 -291
  581. package/src/ui/pane.tsx +0 -193
  582. package/src/ui/popover.tsx +0 -106
  583. package/src/ui/progress-bar.tsx +0 -83
  584. package/src/ui/prompt-dock.tsx +0 -145
  585. package/src/ui/radio.tsx +0 -150
  586. package/src/ui/resizable.tsx +0 -693
  587. package/src/ui/scroll-area.tsx +0 -26
  588. package/src/ui/segmented.tsx +0 -109
  589. package/src/ui/select.tsx +0 -168
  590. package/src/ui/separator.tsx +0 -10
  591. package/src/ui/settings-group.tsx +0 -67
  592. package/src/ui/skeleton.tsx +0 -73
  593. package/src/ui/slider.tsx +0 -178
  594. package/src/ui/status.tsx +0 -48
  595. package/src/ui/switch.tsx +0 -119
  596. package/src/ui/tabs.tsx +0 -168
  597. package/src/ui/textarea.tsx +0 -21
  598. package/src/ui/tooltip.tsx +0 -118
  599. package/src/utils/cn.ts +0 -30
  600. package/src/wire/chunk.ts +0 -248
  601. package/src/wire/consume.ts +0 -599
  602. package/src/wire/diagnostics.ts +0 -727
  603. package/src/wire/encode-probe.ts +0 -214
  604. package/src/wire/encode.ts +0 -947
  605. package/src/wire/files.ts +0 -342
  606. package/src/wire/formats/anthropic.ts +0 -274
  607. package/src/wire/formats/openai.ts +0 -228
  608. package/src/wire/index.ts +0 -95
  609. package/src/wire/media-types.ts +0 -344
  610. package/src/wire/read.ts +0 -396
  611. package/src/wire/sink-helpers.ts +0 -50
  612. package/src/wire/sse.ts +0 -153
@@ -1,4337 +0,0 @@
1
- // AUTO-GENERATED by scripts/gen-element-api.mjs — do not edit by hand.
2
- // Typed custom-element interfaces + HTMLElementTagNameMap augmentation, so
3
- // `document.querySelector('kai-message')` is typed and gets prop autocomplete.
4
- // Also augments React's JSX.IntrinsicElements (see below) so a raw <kai-chat>
5
- // written directly in TSX type-checks.
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';
33
- export type { CodeHighlightingOptions } from '../primitives/highlighter';
34
- export declare function configureCodeHighlighting(options: CodeHighlightingOptions): void;
35
- export declare function isCodeHighlightingEnabled(): boolean;
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
-
42
- /** Resolves once the kai-* elements are registered (browser); inert on the server. */
43
- export declare const elementsReady: Promise<unknown>;
44
-
45
- // --- Inlined from src/primitives/toast-store.ts (kept self-contained: no source imports) ---
46
- export type ToastVariant = 'neutral' | 'success' | 'warning' | 'error' | 'info';
47
-
48
- export interface ToastConfig {
49
- stack?: 'expanded' | 'collapsed';
50
- position?: 'top-center' | 'top-right' | 'top-left' | 'bottom-center' | 'bottom-right' | 'bottom-left';
51
- max?: number;
52
- /** Default appearance for imperatively-raised toasts. Defaults to `'pill'`. */
53
- appearance?: 'pill' | 'card';
54
- /** Default high-contrast inverse treatment. Defaults to `false`. */
55
- inverse?: boolean;
56
- }
57
-
58
- /** An action button rendered inside the toast. Returning `false` from `onAction`
59
- * keeps the toast open; any other return value dismisses it. */
60
- export interface ToastAction {
61
- label: string;
62
- onAction: () => void | false;
63
- }
64
-
65
- export interface ToastItem {
66
- id: string;
67
- message: string;
68
- variant?: ToastVariant;
69
- /** Visual treatment: `'pill'` (default) or `'card'`. */
70
- appearance?: 'pill' | 'card';
71
- /** High-contrast inverse surface. Defaults to `false`. */
72
- inverse?: boolean;
73
- /** Secondary line shown below the message in the `'card'` appearance. */
74
- description?: string;
75
- action?: ToastAction;
76
- /** Auto-dismiss delay in ms. `0` = sticky. */
77
- duration?: number;
78
- /** Whether the close affordance is shown. Defaults to `true`. */
79
- dismissible?: boolean;
80
- /** Container to scope this toast within instead of the viewport. */
81
- target?: HTMLElement;
82
- }
83
-
84
- /** Options accepted by `toast()` — everything but the message. */
85
- export interface ToastOptions {
86
- id?: string;
87
- variant?: ToastVariant;
88
- appearance?: 'pill' | 'card';
89
- inverse?: boolean;
90
- description?: string;
91
- action?: ToastAction;
92
- duration?: number;
93
- dismissible?: boolean;
94
- target?: HTMLElement;
95
- }
96
-
97
- /** Handle returned from `toast()` for imperative control. */
98
- export interface ToastHandle {
99
- id: string;
100
- dismiss: () => void;
101
- update: (patch: Partial<Omit<ToastItem, 'id'>>) => void;
102
- }
103
-
104
- // Runtime values live in the compiled `default` (dist/kai.es.js); we only
105
- // DECLARE their signatures here so the .d.ts pulls no source.
106
- /** Raise a transient toast. `toast('Saved')`, `toast.success('Copied')`,
107
- * `toast.dismiss(id)`. Returns a `{ id, dismiss, update }` handle. */
108
- export declare const toast: {
109
- (message: string, opts?: ToastOptions): ToastHandle;
110
- /** Raise a success (green check) toast. */
111
- success: (message: string, opts?: ToastOptions) => ToastHandle;
112
- /** Raise a warning (amber) toast. */
113
- warning: (message: string, opts?: ToastOptions) => ToastHandle;
114
- /** Raise an error (destructive/red) toast. */
115
- error: (message: string, opts?: ToastOptions) => ToastHandle;
116
- /** Raise an info (blue) toast. */
117
- info: (message: string, opts?: ToastOptions) => ToastHandle;
118
- /** Dismiss a toast by id. */
119
- dismiss: (id: string) => void;
120
- /** Dismiss every active toast. */
121
- clear: () => void;
122
- };
123
- /** Configure the imperative `toast()` singleton — call once at app start. */
124
- export declare function configureToasts(config: ToastConfig): void;
125
-
126
- export interface KaiAgentCardElement extends HTMLElement {
127
- /** Color mode (`auto` follows prefers-color-scheme). */
128
- theme?: "light" | "dark" | "auto";
129
- /** The agent's name, the primary label. Attribute: `name`. */
130
- name?: string;
131
- /** Selected / focused state: highlighted border + surface. Attribute: `active`. */
132
- active?: boolean;
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`. */
134
- needsAttention?: boolean;
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 }`. */
136
- status?: { tone: "working" | "idle" | "done" | "error" | "blocked"; label?: string; pulse?: boolean };
137
- }
138
-
139
- export interface KaiArtifactElement extends HTMLElement {
140
- /** Color mode (`auto` follows prefers-color-scheme). */
141
- theme?: "light" | "dark" | "auto";
142
- /** URL the preview iframe frames. Consumer-controlled. */
143
- src?: string;
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" }[];
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`). */
147
- tab?: "preview" | "code";
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`. */
149
- defaultTab?: "preview" | "code";
150
- /** Selected file path. Syncs the tree highlight, Code source, and preview. */
151
- activeFile?: string;
152
- /** iframe `sandbox` override. Secure default `allow-scripts allow-forms` (NOT `allow-same-origin`). */
153
- sandbox?: string;
154
- /** Accessible title for the preview iframe. */
155
- iframeTitle?: string;
156
- /** Reflects the artifact's own maximized view-state (usually driven by the protocol). */
157
- maximized?: boolean;
158
- /** Show the expand-to-fill button (OPT-IN). */
159
- expandable?: boolean;
160
- /** Show the open-in-new-tab button (OPT-IN). */
161
- openInTab?: boolean;
162
- /** Hide back/forward. */
163
- noNav?: boolean;
164
- /** Hide reload. */
165
- noReload?: boolean;
166
- /** Hide home. */
167
- noHome?: boolean;
168
- /** Hide the address field. */
169
- noPathField?: boolean;
170
- /** Hide the Preview|Code toggle. */
171
- noTabs?: boolean;
172
- /** Standalone chrome: rounded corners + border (else square, borderless in-panel). */
173
- standalone?: boolean;
174
- /** Show the address but make it read-only (visible, nav-tracking, non-editable). */
175
- readonlyPath?: boolean;
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. */
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;
196
- }
197
-
198
- export interface KaiAttachmentsElement extends HTMLElement {
199
- /** Color mode (`auto` follows prefers-color-scheme). */
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). Each item's `url` must be a `data:` URI or an https URL, never `URL.createObjectURL`: a `blob:` URL previews here but the wire encoders (`toOpenAIMessages`/`toAnthropicMessages`) refuse it. */
202
- items: { id: string; type: "file" | "source-document"; filename?: string; mediaType?: string; url?: string; title?: string }[];
203
- /** Layout: `grid` = visual tiles, `inline` = icon + label chips, `list` = rows. */
204
- variant?: "grid" | "inline" | "list";
205
- /** Wrap each item in a hover card that previews its details. */
206
- hoverCard?: boolean;
207
- /** Show a remove button per item; clicking it fires a `kai-remove` event. */
208
- removable?: boolean;
209
- /** Also show the media type beneath the filename (non-grid variants). */
210
- showMediaType?: boolean;
211
- /** Text shown when `items` is empty. */
212
- emptyText?: string;
213
- }
214
-
215
- export interface KaiAudioVisualizerElement extends HTMLElement {
216
- /** Color mode (`auto` follows prefers-color-scheme). */
217
- theme?: "light" | "dark" | "auto";
218
- /** Look to render: `bar` (default), `grid`, `radial`, `wave`, `aurora`, `custom`. `aura` is accepted as a LiveKit-markup alias for `aurora`. Attribute: `variant`. */
219
- variant?: string;
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`. */
221
- state?: string;
222
- /** `icon` | `sm` | `md` (default) | `lg` | `xl`. Attribute: `size`. */
223
- size?: string;
224
- /** Bars to draw. Bar and radial only. Attribute: `bar-count`. */
225
- barCount?: number;
226
- /** Grid only: rows and columns of the (always square) grid. Attribute: `count`. */
227
- count?: number;
228
- /** Radial only: ring distance from center, in px. Attribute: `radius`. */
229
- radius?: number;
230
- /** Grid only: ring distance for the connecting animation, in cells. Attribute: `spread`. */
231
- spread?: number;
232
- /** Grid only: ms between scripted frames. Attribute: `interval`. */
233
- interval?: number;
234
- /** CSS color for the geometry, overriding the inherited `currentColor`. Attribute: `color`. */
235
- color?: string;
236
- /** Shader variants only: pattern density, 0..1. Attribute: `complexity`. */
237
- complexity?: number;
238
- /** Setting this makes the element an announced image (`role="img"`) instead of decorative (`aria-hidden`). Attribute: `label`. */
239
- label?: string;
240
- /** Live microphone or WebRTC audio to analyze. JS property only. NOTE: amplitude renders only while state is "speaking" unless listening-amplitude is set; every other state plays its scripted animation and ignores the audio. */
241
- stream?: MediaStream;
242
- /** An `<audio>` or `<video>` element to tap for its audio. JS property only. NOTE: amplitude renders only while state is "speaking" unless listening-amplitude is set; every other state plays its scripted animation and ignores the audio. */
243
- audioElement?: HTMLMediaElement;
244
- /** 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. NOTE: amplitude renders only while state is "speaking" unless listening-amplitude is set; every other state plays its scripted animation and ignores the audio. */
245
- bands?: number[];
246
- /** Render live amplitude during the listening state as well, using the same presentation as speaking. Off by default, which keeps LiveKit parity: amplitude from stream, audio-element or bands renders only while state is "speaking". Set it to show a real mic-level picture while the user is the one talking. Boolean. Attribute: `listening-amplitude` (a bare attribute means true; reflected, so the property reads back what the attribute set). */
247
- listeningAmplitude?: boolean;
248
- /** Custom fragment shader for `variant="custom"`. JS property only. */
249
- shader?: { fragment: string; uniforms?: Record<string, { type: "1f" | "1i" | "1fv" | "2f" | "3f" | "3fv" | "4f" | "4fv" | "Matrix2fv" | "Matrix3fv" | "Matrix4fv"; value: number | number[] }> };
250
- /** 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`. */
251
- animateWhenNotVisible?: boolean;
252
- }
253
-
254
- export interface KaiAvatarElement extends HTMLElement {
255
- /** Color mode (`auto` follows prefers-color-scheme). */
256
- theme?: "light" | "dark" | "auto";
257
- /** Image URL/data-URI. When absent, the `fallback` initials show instead. */
258
- src?: string;
259
- /** Alt text for the image. Defaults to `fallback`. */
260
- alt?: string;
261
- /** Short text shown when there's no image, usually initials (e.g. "JD", "AI"). */
262
- fallback?: string;
263
- /** Size token: `sm` | `md` (default) | `lg`. */
264
- size?: "sm" | "md" | "lg";
265
- }
266
-
267
- export interface KaiBadgeElement extends HTMLElement {
268
- /** Color mode (`auto` follows prefers-color-scheme). */
269
- theme?: "light" | "dark" | "auto";
270
- /** `default` (muted pill) · `count` (compact number badge) · `citation` (filled primary, for inline citation markers). Defaults to `default`. */
271
- variant?: "default" | "count" | "citation";
272
- }
273
-
274
- export interface KaiButtonElement extends HTMLElement {
275
- /** Color mode (`auto` follows prefers-color-scheme). */
276
- theme?: "light" | "dark" | "auto";
277
- /** Visual style. `default` (filled), `subtle` (muted text, hover tint, the toolbar icon look), `ghost` (transparent, hover fill), `outline`, or `destructive`. Defaults to `default`. */
278
- variant?: "default" | "subtle" | "ghost" | "outline" | "destructive";
279
- /** Size token. `icon` / `icon-sm` are square (for icon-only buttons); `sm` / `md` / `lg` size text buttons. Defaults to `md`. */
280
- size?: "sm" | "md" | "lg" | "icon" | "icon-sm";
281
- /** Leading icon: a named icon (e.g. `"mic"`, `"plus"`), an image URL/data-URI, or plain text. Renders before any slotted label. */
282
- icon?: string;
283
- /** Trailing icon, after the label (e.g. `"chevron-down"` for a menu affordance). */
284
- iconTrailing?: string;
285
- /** Accessible name. REQUIRED for icon-only buttons (no visible text); ignored when you slot visible text, which already names the button. An `aria-label` on top of visible text REPLACES that name rather than adding to it, so a button reading "Save" that answers to "Submit" is unusable by speech input (WCAG 2.5.3, Label in Name). The visible text wins. An `icon` / `icon-sm` size hides the slot, which makes the button icon-only whatever you slotted, so `label` is what names it there. */
286
- label?: string;
287
- /** Disable the button (non-interactive, dimmed). */
288
- disabled?: boolean;
289
- /** Stretch the button to the full width of its container (a block button), e.g. a card CTA or a stacked action. Attribute: `full`. */
290
- full?: boolean;
291
- /** Justify the button's content: `start`, `center` (default), or `end`. Combine with `full` for a full-width, left-aligned button. */
292
- align?: "start" | "center" | "end";
293
- /** Native button `type`. Defaults to `button` (so it never submits a form). */
294
- type?: "button" | "submit" | "reset";
295
- /** Focus the inner `<button>` (host.focus() would focus the wrapper). */
296
- focus(options?: FocusOptions): void;
297
- /** Blur the inner `<button>`. */
298
- blur(): void;
299
- /** 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. */
300
- click(): void;
301
- }
302
-
303
- export interface KaiCardElement extends HTMLElement {
304
- /** Color mode (`auto` follows prefers-color-scheme). */
305
- theme?: "light" | "dark" | "auto";
306
- /** Surface treatment: `outlined` (default) | `filled` | `plain` | `accent`. Attribute: `appearance`. */
307
- appearance?: "outlined" | "filled" | "plain" | "accent";
308
- /** `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`. */
309
- orientation?: "vertical" | "horizontal" | "responsive";
310
- /** The card width below which a `responsive` card collapses to vertical and the footer actions stack. A CSS length; default `28rem`. Attribute: `collapse`. */
311
- collapse?: string;
312
- /** Tighter spacing for dense lists. Attribute: `dense`. */
313
- dense?: boolean;
314
- /** Show a close (×) that hides the card and emits `kai-dismiss`. Attribute: `dismissible`. Off by default. */
315
- dismissible?: boolean;
316
- /** Render the whole card as a link. Attribute: `href`. Wins over `clickable`. */
317
- href?: string;
318
- /** `target` for the `href` anchor. Attribute: `target`. */
319
- target?: string;
320
- /** `rel` for the `href` anchor. Attribute: `rel`. */
321
- rel?: string;
322
- /** Make the whole card a button (`role="button"`, Enter/Space, hover affordance) that emits `kai-card-click`. Attribute: `clickable`. Ignored when `href` is set. */
323
- clickable?: boolean;
324
- }
325
-
326
- export interface KaiCardsElement extends HTMLElement {
327
- /** Color mode (`auto` follows prefers-color-scheme). */
328
- theme?: "light" | "dark" | "auto";
329
- /** The stream of card envelopes to render. Set as a JS PROPERTY: `el.cards = [...]`. */
330
- 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 } }[];
331
- /** 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. */
332
- types?: Record<string, string>;
333
- /** 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. */
334
- schemas?: Record<string, object>;
335
- /** Optional CardPolicy handling child events. Property: `el.policy`. */
336
- 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" };
337
- /** 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. */
338
- validateCards?: boolean;
339
- /** 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. */
340
- 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;
341
- /** Collapse a card to its re-openable stub from the host side. Convenience for `resolve(cardId, { kind: 'dismissed' })`. */
342
- dismiss(cardId: string): void;
343
- /** 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. */
344
- getCard(cardId: string): HTMLElement | null;
345
- }
346
-
347
- export interface KaiChainOfThoughtElement extends HTMLElement {
348
- /** Color mode (`auto` follows prefers-color-scheme). */
349
- theme?: "light" | "dark" | "auto";
350
- /** 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. */
351
- steps: { label: string; content?: string; id?: string }[];
352
- /** Open mode: `'multiple'` (default, any number of steps open at once) or `'single'` (at most one open; opening a step closes the others). */
353
- type?: "single" | "multiple";
354
- /** 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. */
355
- value?: string | string[];
356
- /** Uncontrolled INITIAL open step key(s), seeding which steps render expanded. Ignored once `value` is provided. Set as a JS property. */
357
- defaultValue?: string | string[];
358
- /** 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). */
359
- expand(index?: number): void;
360
- /** Close one step's detail by index, or ALL steps when called with no arg. */
361
- collapse(index?: number): void;
362
- /** Flip one step's open state by index. */
363
- toggle(index?: number): void;
364
- }
365
-
366
- export interface KaiChatElement extends HTMLElement {
367
- /** Color mode (`auto` follows prefers-color-scheme). */
368
- theme?: "light" | "dark" | "auto";
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. */
370
- value?: string | ({ type: "text"; text: string } | { type: "entity"; entity: { kind: string; id: string; label: string; icon?: string; promptText?: string; data?: Record<string, unknown> } })[];
371
- /** Placeholder text shown in the empty input. */
372
- placeholder?: string;
373
- /** When true, shows the loading/streaming state and disables submit (use while awaiting the assistant's reply). */
374
- loading?: boolean;
375
- /** Starter prompts shown above the input when the thread is empty. Clicking one follows `suggestionMode`. Set as a JS property. */
376
- suggestions?: string[];
377
- /** What clicking a suggestion does: `'submit'` (default) sends it immediately as if typed and submitted; `'fill'` just places it in the input. */
378
- suggestionMode?: "submit" | "fill";
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. */
380
- persistSuggestions?: boolean;
381
- /** Body/prose font scale for rendered markdown (`'xs' | 'sm' | 'base' | 'lg'`). Defaults to `'sm'`. */
382
- proseSize?: "xs" | "sm" | "base" | "lg";
383
- /** Shiki theme name for syntax-highlighted code blocks (e.g. `'github-dark-dimmed'`). */
384
- codeTheme?: string;
385
- /** Enable Shiki syntax highlighting in code blocks. Turn off to render plain `<pre>` blocks (lighter, no highlighter load). Default true. */
386
- codeHighlight?: boolean;
387
- /** How `reasoning` parts render across the thread. `'full'` (default) is the current collapsible-disclosure behavior; `'compact'` shows only a shimmer loader while a reasoning part streams and nothing once it settles (no expandable detail); `'off'` renders reasoning parts not at all. Forwarded to every `MessageBody` as `reasoningMode`. */
388
- reasoning?: "full" | "compact" | "off";
389
- /** Seeds the reasoning disclosure open AND keeps it tracking the stream (open while streaming, closes when it settles): the pre-Task-19f `full` behavior. Default false/absent: the panel starts closed (just the "Thinking" shimmer chip) and only opens on click, the current default (owner ruling, 2026-08-26). Meaningless when `reasoning` is `'compact'` or `'off'`. Forwarded to every `MessageBody` as `reasoningDefaultOpen`. */
390
- reasoningOpen?: boolean;
391
- /** Optional header title shown on the left of the header. */
392
- chatTitle?: string;
393
- /** Optional model list. When set (>1 model) a ModelSwitcher is shown in the header and a `kai-model-change` event fires on selection. */
394
- models?: { id: string; name: string; provider?: string; description?: string; group?: string }[];
395
- /** The currently selected model id (pairs with `models`). */
396
- currentModel?: string;
397
- /** Optional context-window token usage. When set, a Context token meter is shown in the header. */
398
- context?: { usedTokens: number; maxTokens: number; inputTokens?: number; outputTokens?: number; estimatedCost?: number };
399
- /** Show the scroll-to-bottom button inside the scroll area. Default true. */
400
- scrollButton?: boolean;
401
- /** 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. */
402
- headerStart?: boolean;
403
- /** Whether the host has `slot="header-end"` content (right of the controls). */
404
- headerEnd?: boolean;
405
- /** REPLACE: full custom header in place of the built-in title/model/context bar. */
406
- headerFull?: boolean;
407
- /** INJECT: left sidebar column (e.g. a conversation list / your own nav). */
408
- sidebar?: boolean;
409
- /** 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). */
410
- empty?: boolean;
411
- /** REPLACE: full custom composer in place of the built-in prompt input. The projected content wires its own submit (the data-flow boundary). */
412
- composer?: boolean;
413
- /** INJECT: accessory row just above the composer (e.g. extra actions). */
414
- composerActions?: boolean;
415
- /** INJECT: footer row below the composer (disclaimers, token meter, …). */
416
- footer?: boolean;
417
- /** When `false`, hides the built-in paperclip attach button. Defaults to `true` (undeclared keeps today's behavior: attach visible), matching `DefaultPromptInput`'s own default: only an explicit `false` hides it. */
418
- attach?: boolean;
419
- /** Show a web-search (Globe) button in the input toolbar; calls `onWebSearch`. */
420
- webSearch?: boolean;
421
- /** Show a Voice (Mic) button in the input toolbar; fires a `voice` event. */
422
- voice?: boolean;
423
- /** 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. */
424
- triggers?: { char: string; kind: string; items?: { id: string; label: string; icon?: string; description?: string; group?: string; kind?: string; promptText?: string; data?: Record<string, unknown> }[] }[];
425
- /** Default icon per entity kind (kind → image src) for pills/menu items. */
426
- kindIcons?: Record<string, string>;
427
- /** Whether each message's action bar is always visible (`'always'`, default) or only revealed on hover of that message row (`'hover'`). */
428
- actionsReveal?: "always" | "hover";
429
- /** Which attachment media types the user may stage, in HTML `accept` syntax: `<kai-chat accept="image/*,application/pdf">`. A plain string, so unlike `messages` it DOES work as an attribute. Omitted means no filter. MEDIA TYPES ONLY -- exact (`image/png`) or subtype wildcard (`text/*`). HTML allows a file extension here and this does not: `accept=".py"` THROWS with the entry named, rather than silently resolving to a picker that accepts nothing. It can only NARROW what the kit can already encode: `accept="image/*"` resolves to the four image formats both APIs take, not to every image type the OS offers. Pass the SAME string to `toOpenAIMessages(msgs, { accept })` and the picker and the wire cannot disagree -- both resolve it through `resolveMediaPolicy` against one declaration. That declaration is readable as `encodableMediaTypes()` from `@kitn.ai/ui/wire`, if you would rather build your own picker than use this prop. */
430
- accept?: string;
431
- /** 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>`. */
432
- 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" }[];
433
- /** 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. */
434
- cardTypes?: Record<string, string>;
435
- /** 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. */
436
- cardSchemas?: Record<string, object>;
437
- /** 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. */
438
- focus(options?: FocusOptions): void;
439
- /** 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. */
440
- blur(): void;
441
- /** 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. */
442
- clear(): void;
443
- /** 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. */
444
- send(): void;
445
- /** Scroll the message viewport to the newest message. Defaults to `'smooth'`; pass `'instant'` to jump without animating. */
446
- scrollToBottom(behavior?: "auto" | "instant" | "smooth"): void;
447
- }
448
-
449
- export interface KaiCheckboxElement extends HTMLElement {
450
- /** Color mode (`auto` follows prefers-color-scheme). */
451
- theme?: "light" | "dark" | "auto";
452
- /** Controlled checked state. Settable and reflected to the `checked` attribute. `el.checked = true` (or `<kai-checkbox checked>`) drives it; ticking the box updates it and fires `kai-change`. Read `el.checked` for live state. */
453
- checked?: boolean;
454
- /** Initial checked state on mount (uncontrolled seed). Bare attribute (`<kai-checkbox default-checked>`) turns it on. */
455
- defaultChecked?: boolean;
456
- /** The mixed state, for a parent box whose children are partly ticked. Visual plus an accessibility hint: the box still reports `checked === false`. */
457
- indeterminate?: boolean;
458
- /** Disable interaction. */
459
- disabled?: boolean;
460
- /** Set the native `required` attribute, and nothing more. Whether an unticked box is an error is the application's rule, not the kit's. */
461
- required?: boolean;
462
- /** Accessible label. The visible text beside the box is the consumer's to render. */
463
- label?: string;
464
- /** Form-control name (paired with `value`). */
465
- name?: string;
466
- /** Submitted value when checked (paired with `name`). Defaults to `'on'`. */
467
- value?: string;
468
- /** Flip the box and fire `kai-change` (no-op while disabled). */
469
- toggle(): void;
470
- /** Focus the inner input (the host element can't reach it). */
471
- focus(options?: FocusOptions): void;
472
- }
473
-
474
- export interface KaiCheckboxGroupElement extends HTMLElement {
475
- /** Color mode (`auto` follows prefers-color-scheme). */
476
- theme?: "light" | "dark" | "auto";
477
- /** The choices, top to bottom. Set as a JS PROPERTY (array), never an attribute. Rendered in full: the kit never truncates, re-orders or de-duplicates them. */
478
- options: { value: string; label: string; description?: undefined | string; disabled?: undefined | boolean }[];
479
- /** The FIRST selected value. Settable and reflected to the `value` attribute, so `:host([value])` and `el.value` see live state, and a seed can be written in markup. Writing it makes that the whole selection; to read or drive the rest, use `el.values`. */
480
- value?: string;
481
- /** The shared form-control name every box carries, so `FormData.getAll(name)` reads the whole selection back under one key. NO DEFAULT, unlike `<kai-radio-group>`. A radio set needs a shared `name` for the browser to make it exclusive and arrow-navigable, so one is generated when none is given; checkboxes are independent controls and behave correctly with no name at all. Generating one here would submit the selection under a random key, which is worse than submitting nothing. The element is NOT form-associated (no `ElementInternals`, no `setFormValue()`), the same known gap `<kai-input>` records: the boxes live in a shadow root, so a surrounding `<form>` collects nothing from them whether or not `name` is set. Read `el.values`. The name still lands on every inner input, so it is right the day form association arrives. */
482
- name?: string;
483
- /** Disable every row. Individual rows carry their own `disabled`. */
484
- disabled?: boolean;
485
- /** Accessible name for the group. */
486
- label?: string;
487
- /** Focus the group's first box. Not "the first ticked one", which is `<kai-radio-group>`'s rule: a radio group is ONE tab stop that lands on the selection, while every checkbox here is its own tab stop, so the entry point is simply the top of the list. */
488
- focus(options?: FocusOptions): void;
489
- }
490
-
491
- export interface KaiCheckpointElement extends HTMLElement {
492
- /** Color mode (`auto` follows prefers-color-scheme). */
493
- theme?: "light" | "dark" | "auto";
494
- /** Optional text beside the icon. */
495
- label?: string;
496
- /** Tooltip on hover. */
497
- tooltip?: string;
498
- /** Visual button style. */
499
- variant?: "ghost" | "default" | "outline";
500
- /** Button size (use an `icon*` size for an icon-only checkpoint). */
501
- size?: "sm" | "md" | "lg" | "icon" | "icon-sm";
502
- }
503
-
504
- export interface KaiChoiceElement extends HTMLElement {
505
- /** Color mode (`auto` follows prefers-color-scheme). */
506
- theme?: "light" | "dark" | "auto";
507
- /** 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. */
508
- 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 };
509
- /** Stable card id correlating every emitted CardEvent. Attribute: `card-id`. */
510
- cardId?: string;
511
- /** Heading rendered in the card chrome (= CardEnvelope.title). Attribute: `heading`. */
512
- heading?: string;
513
- /** Set when the user resolved this card; renders the read-only view. Property: `el.resolution = { kind:'action', action:'…' }`. */
514
- resolution?: Record<string, unknown>;
515
- /** Controlled selection: the selected option id. When set, the consumer owns the current pick (RadioGroup `value`). Attribute: `value`. */
516
- value?: string;
517
- /** Option id to pre-select on mount (uncontrolled seed). Attribute: `default-value`. */
518
- defaultValue?: string;
519
- /** Disable the whole radiogroup + Submit (e.g. while the agent is busy). Attribute: `disabled`. */
520
- disabled?: boolean;
521
- /** Focus the radiogroup roving tab stop (or the Other input when selected). */
522
- focus(options?: FocusOptions): void;
523
- /** 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. */
524
- select(optionId: string): void;
525
- /** 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. */
526
- send(): void;
527
- /** Trigger the dismiss path: emits `dismiss` on kai-card and optimistically collapses the card to its re-openable stub. */
528
- dismiss(): void;
529
- /** Re-open a dismissed card from its stub: emits `reopen` on kai-card. */
530
- reopen(): void;
531
- }
532
-
533
- export interface KaiCoachmarkElement extends HTMLElement {
534
- /** Color mode (`auto` follows prefers-color-scheme). */
535
- theme?: "light" | "dark" | "auto";
536
- /** 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`. */
537
- open?: boolean;
538
- /** Initial open state on mount (uncontrolled seed). */
539
- defaultOpen?: boolean;
540
- /** The bold title. Named `headline` because `title` collides with the global `HTMLElement.title` attribute (it throws at registration). */
541
- headline?: string;
542
- /** A small badge pill beside the headline (e.g. "New"). */
543
- badge?: string;
544
- /** Floating placement relative to the anchor (default `bottom`). */
545
- placement?: string;
546
- /** Color tone: `primary` (default, theme accent), `info` (blue), `success` (green), `warning` (amber), or `error` (red), reusing the kit's tool hues. */
547
- tone?: "primary" | "info" | "success" | "warning" | "error";
548
- /** Render the arrow that points at the anchor (default `true`). Set `arrow="false"` for a plain bubble with no pointer. */
549
- arrow?: boolean;
550
- /** Open it programmatically (no-op while disabled). */
551
- show(): void;
552
- /** Close it programmatically. */
553
- hide(): void;
554
- /** Flip the open state (closes while disabled). */
555
- toggle(): void;
556
- }
557
-
558
- export interface KaiCodeBlockElement extends HTMLElement {
559
- /** Color mode (`auto` follows prefers-color-scheme). */
560
- theme?: "light" | "dark" | "auto";
561
- /** The source code to render. */
562
- code: string;
563
- /** Language grammar (e.g. `js`, `python`). Defaults to `tsx`. */
564
- language?: string;
565
- /** Shiki theme name. */
566
- codeTheme?: string;
567
- /** Disable syntax highlighting (renders plain text, no Shiki). */
568
- codeHighlight?: boolean;
569
- /** Show the copy button. **Defaults to ON**, because this element is documented as shipping one. Opt out with `copy="false"` or `el.copy = false`. */
570
- copy?: boolean;
571
- /** Code text sizing. */
572
- proseSize?: "xs" | "sm" | "base" | "lg";
573
- }
574
-
575
- export interface KaiCommandElement extends HTMLElement {
576
- /** Color mode (`auto` follows prefers-color-scheme). */
577
- theme?: "light" | "dark" | "auto";
578
- /** Flat list of items. Set as a JS property, not an HTML attribute. */
579
- items?: { id: string; label: string; icon?: string; description?: string; shortcut?: string; group?: string }[];
580
- /** Placeholder text for the search input. */
581
- placeholder?: string;
582
- /** Label shown when no items match the current query. */
583
- emptyLabel?: string;
584
- /** 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). */
585
- focus(options?: FocusOptions): void;
586
- /** Blur the focused search input. */
587
- blur(): void;
588
- /** Reset the search query to empty, re-showing all items, and fire `kai-query-change` with `''`. Mirrors the Escape-key behavior. */
589
- clear(): void;
590
- }
591
-
592
- export interface KaiCompareElement extends HTMLElement {
593
- /** Color mode (`auto` follows prefers-color-scheme). */
594
- theme?: "light" | "dark" | "auto";
595
- /** 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. */
596
- data?: Record<string, unknown>;
597
- /** Stable id correlating every emitted event. Attribute: `compare-id`. */
598
- compareId?: string;
599
- /** Re-hydrate / control the user's pick. Set as a JS PROPERTY: `el.selection = { chosenId, rejectedIds }`. Renders the collapsed winner. */
600
- selection?: Record<string, unknown>;
601
- /** Layout: `'auto'` (default, columns when wide, tabs when narrow, by CONTAINER width) | `'columns'` (side-by-side) | `'tabs'` (pills to switch). Attribute: `layout`. */
602
- layout?: "auto" | "columns" | "tabs";
603
- /** Prose/text size for the rendered candidates. Attribute: `prose-size`. */
604
- proseSize?: "xs" | "sm" | "base" | "lg";
605
- /** Shiki theme for code blocks in the candidates. Attribute: `code-theme`. */
606
- codeTheme?: string;
607
- /** Whether code blocks are syntax-highlighted. Attribute: `code-highlight`. */
608
- codeHighlight?: boolean;
609
- /** 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). */
610
- select(candidateId: string): void;
611
- /** Focus the current roving tab stop (the focused candidate's "Pick this" radio) so a consumer can move keyboard focus into the radiogroup. */
612
- focus(options?: FocusOptions): void;
613
- }
614
-
615
- export interface KaiComposerElement extends HTMLElement {
616
- /** Color mode (`auto` follows prefers-color-scheme). */
617
- theme?: "light" | "dark" | "auto";
618
- /** Controlled value: a string or a full ComposerDoc (set as JS property). */
619
- value?: string | ({ type: "text"; text: string } | { type: "entity"; entity: { kind: string; id: string; label: string; icon?: string; promptText?: string; data?: Record<string, unknown> } })[];
620
- /** Placeholder text shown when the composer is empty. */
621
- placeholder?: string;
622
- /** Disable the composer entirely (non-interactive). */
623
- disabled?: boolean;
624
- /** Show a loading/streaming state and block submit. */
625
- loading?: boolean;
626
- /** Maximum height in px before the content scrolls. Default 240. */
627
- maxHeight?: number | string;
628
- /** Whether pressing Enter (without Shift) submits. Default true. */
629
- submitOnEnter?: boolean;
630
- /** Trigger definitions. Set as a JS property. */
631
- triggers?: { char: string; kind: string; items?: { id: string; label: string; icon?: string; description?: string; group?: string; kind?: string; promptText?: string; data?: Record<string, unknown> }[] }[];
632
- /** Keyword highlight rules. Set as a JS property. */
633
- highlights?: (string | { pattern: string; flags?: string; class?: string })[];
634
- /** 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. */
635
- kindIcons?: Record<string, string>;
636
- /** 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. */
637
- focus(options?: FocusOptions): void;
638
- /** Blur the editable element. */
639
- blur(): void;
640
- /** Empty the composer to a blank doc (resets the internal value + history baseline; fires kai-value-change). */
641
- clear(): void;
642
- /** 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. */
643
- send(): void;
644
- /** Insert an atomic entity pill (skill/agent/plugin) at the caret without typing a trigger (fires kai-entity-add). */
645
- insertEntity(entity: { kind: string; id: string; label: string; icon?: undefined | string; promptText?: undefined | string; data?: undefined | Record<string, unknown> }): void;
646
- }
647
-
648
- export interface KaiConfirmElement extends HTMLElement {
649
- /** Color mode (`auto` follows prefers-color-scheme). */
650
- theme?: "light" | "dark" | "auto";
651
- /** 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. */
652
- data?: { heading?: string; body?: string; tone?: "default" | "warning" | "danger"; actions: { id: string; label: string; style?: "primary" | "default" | "destructive"; payload?: unknown; default?: boolean }[]; dismissible?: boolean };
653
- /** Stable card id correlating every emitted CardEvent. Attribute: `card-id`. */
654
- cardId?: string;
655
- /** Heading rendered in the card chrome (= CardEnvelope.title). Attribute: `heading`. */
656
- heading?: string;
657
- /** 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. */
658
- autofocus: boolean;
659
- /** Set when the user resolved this card; renders the read-only view. Property: `el.resolution = { kind:'action', action:'…' }`. */
660
- resolution?: Record<string, unknown>;
661
- /** Focus the default action button (or the first action if none is default). The same target `autofocus` focuses on mount, but on demand. */
662
- focus(options?: FocusOptions): void;
663
- /** 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. */
664
- confirm(actionId?: string): void;
665
- /** Trigger the dismiss path: emits `dismiss` on kai-card and optimistically collapses the card to its re-openable stub. */
666
- dismiss(): void;
667
- /** Re-open a dismissed card from its stub: emits `reopen` on kai-card. */
668
- reopen(): void;
669
- }
670
-
671
- export interface KaiContextElement extends HTMLElement {
672
- /** Color mode (`auto` follows prefers-color-scheme). */
673
- theme?: "light" | "dark" | "auto";
674
- /** Token-usage data. Set as a JS property. */
675
- context?: { usedTokens: number; maxTokens: number; inputTokens?: number; outputTokens?: number; reasoningTokens?: number; cacheTokens?: number; estimatedCost?: number };
676
- /** Fraction (0–1) above which the meter turns yellow. Defaults to `0.7` (70%). */
677
- warnThreshold?: number;
678
- /** Fraction (0–1) above which the meter turns red. Defaults to `0.9` (90%). */
679
- dangerThreshold?: number;
680
- }
681
-
682
- export interface KaiConversationItemElement extends HTMLElement {
683
- /** Color mode (`auto` follows prefers-color-scheme). */
684
- theme?: "light" | "dark" | "auto";
685
- /** The row's identity: the `conversation-id` attribute (host `id` is the fallback). Inside `<kai-conversations>` it is handed to the container's selection contract (`kai-conversation-select`); standalone it is the `id` in this element's own `kai-select` detail. */
686
- conversationId?: string;
687
- /** Selected state. Reflected as `aria-current` on the row body and a `data-active` styling hook on the row; inside a container the container drives it from its `activeId`, standalone you set it yourself. */
688
- active?: boolean;
689
- /** Dense single-line row padding. */
690
- compact?: boolean;
691
- }
692
-
693
- export interface KaiConversationsElement extends HTMLElement {
694
- /** Color mode (`auto` follows prefers-color-scheme). */
695
- theme?: "light" | "dark" | "auto";
696
- /** 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. */
697
- groups: { id: string; userId?: string; teamId?: string; name: string; sortOrder: number; createdAt: string }[];
698
- /** 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. A search query that matches nothing shows a visible "No conversations match your search" state, distinct from the zero-conversations empty state. Slotted `<kai-conversation-item>` children switch the list into item mode instead: your own rows win and this array is not rendered. */
699
- 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 }[];
700
- /** The id of the currently-open conversation, highlighted in the list. */
701
- activeId?: string;
702
- /** 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. */
703
- collapsed?: boolean;
704
- /** Initial collapsed state when uncontrolled (default false). Use the `default-collapsed` attribute to start collapsed in plain HTML. */
705
- defaultCollapsed?: boolean;
706
- /** Dense single-line rows (a leading dot + title, no message count). */
707
- compact?: boolean;
708
- /** Focus the built-in search input inside the shadow root. */
709
- focus(options?: FocusOptions): void;
710
- /** Clear the internal search query (resets the list filter) and fire kai-search with an empty string. */
711
- clear(): void;
712
- /** Programmatically select a conversation by id. The mirror of the kai-conversation-select event (a convenience over driving `activeId`). */
713
- select(id: string): void;
714
- /** Collapse the rail to its floating reopen button (fires `kai-collapse-toggle`). */
715
- collapse(): void;
716
- /** Expand the rail back to the full list (fires `kai-collapse-toggle`). */
717
- expand(): void;
718
- /** Toggle the rail collapsed/expanded (fires `kai-collapse-toggle`). */
719
- toggle(): void;
720
- }
721
-
722
- export interface KaiDialogElement extends HTMLElement {
723
- /** Color mode (`auto` follows prefers-color-scheme). */
724
- theme?: "light" | "dark" | "auto";
725
- /** 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`. */
726
- open?: boolean;
727
- /** Initial open state on mount (uncontrolled seed). */
728
- defaultOpen?: boolean;
729
- /** Accessible name for the modal, used when no `header` slot is projected: `<kai-dialog label="Delete workspace">`. A projected `header` WINS over this (it becomes `aria-labelledby`), because ARIA resolves `aria-labelledby` ahead of `aria-label` and the visible heading is the name both a sighted and a screen-reader user can be talked through. Defaults to `Dialog` so a modal is never nameless. */
730
- label?: string;
731
- /** Open it programmatically (no-op while disabled). */
732
- show(): void;
733
- /** Close it programmatically. */
734
- hide(): void;
735
- /** Flip the open state (closes while disabled). */
736
- toggle(): void;
737
- /** Move focus to the dialog panel (no-op while closed). */
738
- focus(options?: FocusOptions): void;
739
- }
740
-
741
- export interface KaiDockElement extends HTMLElement {
742
- /** Color mode (`auto` follows prefers-color-scheme). */
743
- theme?: "light" | "dark" | "auto";
744
- /** Drive/observe open state (Shoelace-style: settable + reflected to the `open` attribute; the element still self-manages on the launcher and Escape). Set `el.open = true`, or `<kai-dock open>`; listen for `kai-open-change`. */
745
- open?: boolean;
746
- /** Initial open state on mount (uncontrolled seed). */
747
- defaultOpen?: boolean;
748
- /** Which corner the dock sits in. Logical, so `-end` follows the writing direction and an RTL page docks on the left. Attribute: `position`. */
749
- position?: "bottom-end" | "bottom-start" | "top-end" | "top-start";
750
- /** The widget's NAME. Derives the panel's accessible name and both launcher names (`Open ${label}` / `Close ${label}`). Defaults to `Chat`. */
751
- label?: string;
752
- /** i18n override for the launcher's name while closed (default `Open ${label}`). */
753
- openLabel?: string;
754
- /** i18n override for the launcher's name while open (default `Close ${label}`). */
755
- closeLabel?: string;
756
- /** Show the unread dot. YOURS: it renders only while closed, and the dock never writes it back. Clear it in your `kai-open-change` handler. */
757
- unread?: boolean;
758
- /** Disable the launcher; `show()` and `toggle()` are gated on it. */
759
- disabled?: boolean;
760
- /** Suppress the dock's own built-in mobile close X. Set this when your slotted panel content supplies its own close affordance (e.g. a `<kai-chat slot="header-end">` close button), otherwise the two stack. TRADEOFF: the mobile panel reserves a padding band above its content so the built-in X never paints over slotted content; that band stays reserved unless you set this true, so only set it once your own control is actually in place. Attribute: `hide-close`. */
761
- hideClose?: boolean;
762
- /** Where focus lands on open: `content` (default, the first element you slotted), `panel`, or `none`. Attribute: `focus-on-open`. */
763
- focusOnOpen?: "content" | "panel" | "none";
764
- /** Open it programmatically (no-op while disabled). */
765
- show(): void;
766
- /** Close it programmatically. */
767
- hide(): void;
768
- /** Flip the open state (closes while disabled). */
769
- toggle(): void;
770
- /** Move focus to the panel while open, or to the launcher while closed. */
771
- focus(options?: FocusOptions): void;
772
- }
773
-
774
- export interface KaiDropdownElement extends HTMLElement {
775
- /** Color mode (`auto` follows prefers-color-scheme). */
776
- theme?: "light" | "dark" | "auto";
777
- /** Built-in trigger: leading icon (a named icon like `"plus"`, an image URL/data-URI, or text). A slotted `slot="trigger"` overrides it. */
778
- triggerIcon?: string;
779
- /** Built-in trigger: a text label. This is the trigger's VISIBLE text, so it is also its accessible name, and `label` does not override it: an accessible name that does not contain the visible text is unreachable by speech input (WCAG 2.5.3, Label in Name). Same rule `kai-menu` follows. */
780
- triggerLabel?: string;
781
- /** Built-in trigger: a trailing icon (e.g. `"chevron-down"` for a select look). */
782
- triggerIconTrailing?: string;
783
- /** Accessible name for a trigger with no visible label. Ignored when `triggerLabel` is set, which is already the visible name. It DOES name a slotted `slot="trigger"`, which is VISUAL content with the name supplied separately: the same two-slot distinction `kai-menu` documents. */
784
- label?: string;
785
- /** Stretch the trigger to the full width of its container (a block row). Attribute: `full`. */
786
- full?: boolean;
787
- /** 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-dropdown open>`; listen for `kai-open-change`. */
788
- open?: boolean;
789
- /** Initial open state on mount (uncontrolled seed). */
790
- defaultOpen?: boolean;
791
- /** Disable the trigger: click/keyboard and `show()` no longer open the menu. */
792
- disabled?: boolean;
793
- /** Open it programmatically (no-op while disabled). */
794
- show(): void;
795
- /** Close it programmatically. */
796
- hide(): void;
797
- /** Flip the open state (closes while disabled). */
798
- toggle(): void;
799
- }
800
-
801
- export interface KaiEditableLabelElement extends HTMLElement {
802
- /** Color mode (`auto` follows prefers-color-scheme). */
803
- theme?: "light" | "dark" | "auto";
804
- /** The label text. Settable and reflected to the `value` attribute. Read `el.value` for live state. */
805
- value?: string;
806
- /** Controlled edit state. `el.editing = true` opens the field; reflected to the `editing` attribute. */
807
- editing?: boolean;
808
- /** Placeholder shown while editing / when the value is empty. */
809
- placeholder?: string;
810
- /** Disable entering edit mode. */
811
- disabled?: boolean;
812
- /** 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. */
813
- edit(): void;
814
- /** 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. */
815
- commit(): void;
816
- /** 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. */
817
- cancel(): void;
818
- }
819
-
820
- export interface KaiEmbedElement extends HTMLElement {
821
- /** Color mode (`auto` follows prefers-color-scheme). */
822
- theme?: "light" | "dark" | "auto";
823
- /** Stable card id correlating every emitted event. Set as an attribute or property. */
824
- cardId?: string;
825
- /** The embed payload (provider + id/url + options). Set as a JS **property** (object). */
826
- data?: { provider: "youtube" | "vimeo" | "generic"; id?: string; url?: string; title?: string; poster?: string; start?: number; aspectRatio?: "16:9" | "4:3" | "1:1" | "9:16" };
827
- }
828
-
829
- export interface KaiEmptyElement extends HTMLElement {
830
- /** Color mode (`auto` follows prefers-color-scheme). */
831
- theme?: "light" | "dark" | "auto";
832
- /** Title text. Attribute: `empty-title` (`title` is a global HTML attribute). */
833
- emptyTitle?: string;
834
- /** Description text. */
835
- description?: string;
836
- }
837
-
838
- export interface KaiFeedbackBarElement extends HTMLElement {
839
- /** Color mode (`auto` follows prefers-color-scheme). */
840
- theme?: "light" | "dark" | "auto";
841
- /** The banner label (e.g. "Was this helpful?"). Attribute: `bar-title` (`title` is avoided because it is a global HTML attribute). */
842
- barTitle?: string;
843
- /** When set, a not-helpful vote opens an optional detail form before the thank-you confirmation. Attribute: `collect-detail`. */
844
- collectDetail?: boolean;
845
- /** Optional category chips for the detail form. Set as a JS property (array). */
846
- categories?: string[];
847
- /** Heading for the detail form. Attribute: `detail-title`. */
848
- detailTitle?: string;
849
- /** Placeholder for the detail comment box. Attribute: `detail-placeholder`. */
850
- detailPlaceholder?: string;
851
- /** Submit button label in the detail form. Attribute: `submit-label`. */
852
- submitLabel?: string;
853
- /** Confirmation copy shown after a vote/submit. Attribute: `thanks-message`. */
854
- thanksMessage?: string;
855
- }
856
-
857
- export interface KaiFileTreeElement extends HTMLElement {
858
- /** Color mode (`auto` follows prefers-color-scheme). */
859
- theme?: "light" | "dark" | "auto";
860
- /** The files to render. Set as a JS property (array of `{ path, url?, code?, language?, type?, additions?, deletions?, status? }`). */
861
- 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" }[];
862
- /** Selected file path, highlighted in the tree. */
863
- activeFile?: string;
864
- /** Folder paths expanded initially. Omit to start with all folders open. */
865
- defaultExpanded?: string[];
866
- /** Show a changed-files summary header (file count + summed `+/-` + Collapse-all). Attribute: `summary`. Off by default. */
867
- summary?: boolean;
868
- }
869
-
870
- export interface KaiFileUploadElement extends HTMLElement {
871
- /** Color mode (`auto` follows prefers-color-scheme). */
872
- theme?: "light" | "dark" | "auto";
873
- /** Allow selecting multiple files (default true). */
874
- multiple?: boolean;
875
- /** `accept` attribute for the file picker (e.g. `image/*`). */
876
- accept?: string;
877
- /** Disable the dropzone: no clicking, no drag-and-drop. */
878
- disabled?: boolean;
879
- /** Default dropzone label (overridable via the default slot). */
880
- label?: string;
881
- }
882
-
883
- export interface KaiFormElement extends HTMLElement {
884
- /** Color mode (`auto` follows prefers-color-scheme). */
885
- theme?: "light" | "dark" | "auto";
886
- /** 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. */
887
- 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-format"?: "tel" | "ssn" | "credit-card" | "custom"; "x-kai-mask"?: string; "x-kai-mask-guide"?: string }>; "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" }[] };
888
- /** Stable card id correlating every emitted CardEvent. Attribute: `card-id`. */
889
- cardId?: string;
890
- /** Heading rendered in the card chrome (= CardEnvelope.title). Attribute: `heading`. */
891
- heading?: string;
892
- /** Set when the user resolved this card; renders the read-only view. Property: `el.resolution = { kind:'submit', data:{…} }`. */
893
- resolution?: Record<string, unknown>;
894
- /** Controlled field values (JS property). When set, it wins over local edits. */
895
- values?: Record<string, unknown>;
896
- /** Initial values overlaying the schema defaults (uncontrolled seed; JS property). */
897
- defaultValues?: Record<string, unknown>;
898
- /** Disable all fields + submit. Attribute: `disabled`. */
899
- disabled?: boolean;
900
- /** Focus the first control, or the first INVALID control after a failed validation. */
901
- focus(options?: FocusOptions): void;
902
- /** Validate + submit programmatically: focus the first invalid field on failure, else emit the `submit` CardEvent and resolve. Named `send`, not `submit`. */
903
- send(): void;
904
- /** Run client-side validation now and return `{ valid, errors? }` WITHOUT submitting. */
905
- validate(): void;
906
- /** Re-seed the form from each field's `default` and clear errors. */
907
- reset(): void;
908
- /** Trigger the dismiss path (emit `dismiss` + collapse to the re-openable stub). */
909
- dismiss(): void;
910
- /** Re-open a dismissed card from its stub (emit `reopen`). */
911
- reopen(): void;
912
- }
913
-
914
- export interface KaiHoverCardElement extends HTMLElement {
915
- /** Color mode (`auto` follows prefers-color-scheme). */
916
- theme?: "light" | "dark" | "auto";
917
- /** Delay (ms) before the card opens on hover. Defaults to 0 (focus opens it immediately too). */
918
- openDelay?: number;
919
- /** Delay (ms) before it closes after the pointer leaves. Defaults to 300. */
920
- closeDelay?: number;
921
- /** Preferred placement: `'top' | 'bottom' | 'left' | 'right'` (+ optional `-start`/`-end`). Defaults to `'bottom'`; flips to stay in view. */
922
- placement?: string;
923
- /** 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`. */
924
- open?: boolean;
925
- /** Initial open state on mount (uncontrolled seed). */
926
- defaultOpen?: boolean;
927
- /** Suppress the hover behavior entirely without unmounting. */
928
- disabled?: boolean;
929
- /** Open it programmatically (no-op while disabled). */
930
- show(): void;
931
- /** Close it programmatically. */
932
- hide(): void;
933
- /** Flip the open state (closes while disabled). */
934
- toggle(): void;
935
- }
936
-
937
- export interface KaiIconElement extends HTMLElement {
938
- /** Color mode (`auto` follows prefers-color-scheme). */
939
- theme?: "light" | "dark" | "auto";
940
- /** A curated icon name (e.g. `"mic"`, `"globe"`), an image URL/data-URI, or plain text. */
941
- name?: string;
942
- /** Size token: `sm` | `md` (default) | `lg`. */
943
- size?: "sm" | "md" | "lg";
944
- }
945
-
946
- export interface KaiImageElement extends HTMLElement {
947
- /** Color mode (`auto` follows prefers-color-scheme). */
948
- theme?: "light" | "dark" | "auto";
949
- /** Base64-encoded image data (pair with `media-type`). */
950
- base64?: string;
951
- /** Raw image bytes (set as a JS property). */
952
- bytes?: Uint8Array;
953
- /** Alt text. */
954
- alt?: string;
955
- /** MIME type (default `image/png`). */
956
- mediaType?: string;
957
- }
958
-
959
- export interface KaiInputElement extends HTMLElement {
960
- /** Color mode (`auto` follows prefers-color-scheme). */
961
- theme?: "light" | "dark" | "auto";
962
- /** Native input type: `text` (default) · `email` · `url` · `search` · `tel` · `password` · `number`. Single-line only. */
963
- type?: string;
964
- /** Controlled value, and always the CANONICAL one when a mask is active: digits for `tel` / `ssn` / `credit-card`, the formatted text for `custom`. Settable and reflected to the `value` attribute. `el.value = '5551234567'` drives it (no event) and is re-fitted to the mask on the way in, so the field shows `555-123-4567`. Read `el.value` for live state; the formatted text rides along on every `kai-input` / `kai-change` detail as `formattedValue`. */
965
- value?: string;
966
- /** Placeholder shown when empty. */
967
- placeholder?: string;
968
- /** Field label, linked to the input. */
969
- label?: string;
970
- /** Helper text below the control. */
971
- hint?: string;
972
- /** Error text; flips the field invalid (`aria-invalid` + destructive border). */
973
- error?: string;
974
- /** Control density: `sm` or `md`. Defaults to `md`. */
975
- size?: "sm" | "md";
976
- /** Disable interaction. */
977
- disabled?: boolean;
978
- /** Make the input read-only. */
979
- readonly?: boolean;
980
- /** Mark the input required. */
981
- required?: boolean;
982
- /** Force the invalid state without an `error` string. */
983
- invalid?: boolean;
984
- /** Form-control name. */
985
- name?: string;
986
- /** Autofill hint forwarded to the inner input (e.g. `email`, `current-password`). */
987
- autocomplete?: string;
988
- /** Virtual-keyboard hint forwarded to the inner input (e.g. `numeric`, `email`). */
989
- inputmode?: string;
990
- /** Mask pattern: `#` a digit, `@` a letter or digit, `*` an obscurable letter or digit, and every other character a positional literal (`@@@-####` → `CHG-4821`). The literal `default` is the opt-in sentinel: it resolves to the default format of `semantic` (`tel` → `###-###-####`). A bare `semantic` never starts masking on its own, so an opt-in token is what turns tier 2 on. */
991
- format?: string;
992
- /** Placeholder guide shown at unfilled positions, aligned position for position with `format`: `mm/dd/yyyy` against `##/##/####`. Spaces are a valid guide character, so a guide of blanks and separators is how a phone field shows its shape without showing letters. Without a guide the field shows only up to the last typed character. A guide is a visual aid, never an accessible name: keep the `hint` text as well. */
993
- guide?: string;
994
- /** Semantic field type: `tel` · `ssn` · `credit-card` · `custom`. On its own it sets `inputmode` / `autocomplete` / `spellcheck` / `autocorrect` / `autocapitalize` and decides the canonical value; it never starts masking by itself. */
995
- semantic?: "credit-card" | "custom" | "ssn" | "tel";
996
- /** Case folding applied to typed and pasted text: `preserve` (default) · `upper` · `lower`. Attribute: `case-mode`. */
997
- caseMode?: "preserve" | "upper" | "lower";
998
- /** What a copy or cut of a masked field puts on the clipboard: `canonical` (default) · `formatted` · `obscured` · `blocked`. Attribute: `copy-policy`. */
999
- copyPolicy?: "formatted" | "canonical" | "obscured" | "blocked";
1000
- /** Focus the inner input (the host can't reach into the shadow root). */
1001
- focus(options?: FocusOptions): void;
1002
- /** Select the inner input's text. */
1003
- select(): void;
1004
- /** The canonical value: digits for `tel` / `ssn` / `credit-card`, the formatted text for `custom`, and the field text when no mask is on. Identical to reading `el.value`, under the name backends use for the submitted form of a masked field. The mask engine has a third, narrower notion of raw (the fill characters with no literals at all) and that one is internal: it is not what any backend wants and it is not exposed here. */
1005
- getRawValue(): string;
1006
- /** The text on screen, literals and guide included. The counterpart to `formattedValue` on the `kai-input` / `kai-change` details, for a consumer that needs it outside an event. */
1007
- getFormattedValue(): string;
1008
- /** Empty the value and fire `kai-change` with `''`. On a masked field this resets the mask itself, not just the text on screen, so the next character starts over. */
1009
- clear(): void;
1010
- }
1011
-
1012
- export interface KaiKbdElement extends HTMLElement {
1013
- /** Color mode (`auto` follows prefers-color-scheme). */
1014
- theme?: "light" | "dark" | "auto";
1015
- /** 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. */
1016
- keys?: string;
1017
- /** `mac` uses ⌘/⌥, `other` uses Ctrl. `auto` (default) sniffs the OS. */
1018
- platform?: "auto" | "mac" | "other";
1019
- /** Cap size: `sm` or `md`. Defaults to `md`. */
1020
- size?: "sm" | "md";
1021
- }
1022
-
1023
- export interface KaiLinkPreviewElement extends HTMLElement {
1024
- /** Color mode (`auto` follows prefers-color-scheme). */
1025
- theme?: "light" | "dark" | "auto";
1026
- /** Stable card id correlating every emitted event. Set as an attribute or property. */
1027
- cardId?: string;
1028
- /** The link payload (OG metadata). Set as a JS **property** (object). */
1029
- data?: { url: string; title?: string; description?: string; image?: string; imageAlt?: string; favicon?: string; domain?: string; siteName?: string };
1030
- }
1031
-
1032
- export interface KaiLoaderElement extends HTMLElement {
1033
- /** Color mode (`auto` follows prefers-color-scheme). */
1034
- theme?: "light" | "dark" | "auto";
1035
- /** The animation style: `'circular' | 'classic' | 'pulse' | 'pulse-dot' | 'dots' | 'typing' | 'wave' | 'bars' | 'terminal' | 'text-blink' | 'text-shimmer' | 'loading-dots'`. Defaults to `'circular'`. */
1036
- variant?: "circular" | "classic" | "pulse" | "pulse-dot" | "dots" | "typing" | "wave" | "bars" | "terminal" | "text-blink" | "text-shimmer" | "loading-dots";
1037
- /** Loader size: `'sm' | 'md' | 'lg'`. Defaults to `'md'`. */
1038
- size?: "sm" | "md" | "lg";
1039
- /** Label for the text-based variants. */
1040
- text?: string;
1041
- }
1042
-
1043
- export interface KaiMarkdownElement extends HTMLElement {
1044
- /** Color mode (`auto` follows prefers-color-scheme). */
1045
- theme?: "light" | "dark" | "auto";
1046
- /** The markdown source to render. */
1047
- content: string;
1048
- /** Text/markdown sizing. */
1049
- proseSize?: "xs" | "sm" | "base" | "lg";
1050
- /** Shiki theme for fenced code blocks. */
1051
- codeTheme?: string;
1052
- /** Disable syntax highlighting (no Shiki loads). */
1053
- codeHighlight?: boolean;
1054
- }
1055
-
1056
- export interface KaiMenuElement extends HTMLElement {
1057
- /** Color mode (`auto` follows prefers-color-scheme). */
1058
- theme?: "light" | "dark" | "auto";
1059
- /** Tree of menu items. Set as a JS property, not an HTML attribute. */
1060
- items?: { id?: string; label?: string; icon?: string; shortcut?: string; checked?: boolean; radioGroup?: string; disabled?: boolean; separator?: boolean; heading?: boolean; items?: Record<string, unknown>[] }[];
1061
- /** Optional placement hint (unused by the underlying Dropdown which always positions bottom-start, kept for future extension). */
1062
- placement?: string;
1063
- /** 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. */
1064
- triggerIcon?: string;
1065
- /** Built-in trigger: a text label (e.g. `"High"`). This is the trigger's VISIBLE text, so it is also its accessible name, and `label` does not override it: an accessible name that does not contain the visible text is unreachable by speech input, which is what WCAG 2.5.3 (Label in Name) exists for. A slotted `slot="trigger"` replaces this built-in trigger entirely and is named differently; see `label`. */
1066
- triggerLabel?: string;
1067
- /** Built-in trigger: a trailing icon (e.g. `"chevron-down"` for a select look). */
1068
- triggerIconTrailing?: string;
1069
- /** Accessible name for a trigger with no visible label. Ignored when `triggerLabel` is set, which is already the visible name. It DOES name a slotted `slot="trigger"`, and that is a difference in what the two slots MEAN, not a limitation. `<kai-button>`'s slot IS the button's label, so text slotted there is the name and `label` steps aside. This slot is VISUAL content, a `+` or an `<svg>`, with the name supplied separately: decoration beside a name, never a second name competing with one. So `label` names the trigger here by design. Slotting a real WORD rather than a glyph makes that word a visible label, and an accessible name has to contain the visible text. Then either drop `label` or make it contain the word you slotted. */
1070
- label?: string;
1071
- /** Stretch the trigger to the full width of the menu's container (a block row), e.g. a sidebar-footer account row. Same affordance as `<kai-button full>`. Attribute: `full`. */
1072
- full?: boolean;
1073
- /** 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`. */
1074
- open?: boolean;
1075
- /** Initial open state on mount (uncontrolled seed). */
1076
- defaultOpen?: boolean;
1077
- /** Disable the trigger: click/keyboard and `show()` no longer open the menu. */
1078
- disabled?: boolean;
1079
- /** Open it programmatically (no-op while disabled). */
1080
- show(): void;
1081
- /** Close it programmatically. */
1082
- hide(): void;
1083
- /** Flip the open state (closes while disabled). */
1084
- toggle(): void;
1085
- }
1086
-
1087
- export interface KaiMessageElement extends HTMLElement {
1088
- /** Color mode (`auto` follows prefers-color-scheme). */
1089
- theme?: "light" | "dark" | "auto";
1090
- /** The full message object. Set as a JS property. */
1091
- 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" };
1092
- /** 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. */
1093
- role: "user" | "assistant";
1094
- /** Force markdown on/off. Defaults to on for assistant, off for user. */
1095
- markdown?: boolean;
1096
- /** Text/markdown sizing for the message body. */
1097
- proseSize?: "xs" | "sm" | "base" | "lg";
1098
- /** Shiki theme name used for fenced code blocks in the content. */
1099
- codeTheme?: string;
1100
- /** Disable syntax highlighting for code blocks (no Shiki loads). */
1101
- codeHighlight?: boolean;
1102
- /** Whether the action bar is always visible (`'always'`, default) or only revealed on hover of the message row (`'hover'`). */
1103
- actionsReveal?: "always" | "hover";
1104
- /** Convenience avatar image URL (used when `message.avatar` is not set). */
1105
- avatarSrc?: string;
1106
- /** Convenience avatar fallback text (used when `message.avatar` is not set). */
1107
- avatarFallback?: string;
1108
- /** 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). */
1109
- avatar?: string;
1110
- /** 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. */
1111
- cardTypes?: Record<string, string>;
1112
- /** 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. */
1113
- cardSchemas?: Record<string, object>;
1114
- /** Copy the message content to the clipboard and show the copied check. */
1115
- copy(): void;
1116
- }
1117
-
1118
- export interface KaiModelSwitcherElement extends HTMLElement {
1119
- /** Color mode (`auto` follows prefers-color-scheme). */
1120
- theme?: "light" | "dark" | "auto";
1121
- /** 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. */
1122
- models: { id: string; name: string; provider?: string; description?: string; group?: string }[];
1123
- /** The currently-selected model id. Defaults to the first model. */
1124
- currentModel?: string;
1125
- /** 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`. */
1126
- open?: boolean;
1127
- /** Initial open state on mount (uncontrolled seed). */
1128
- defaultOpen?: boolean;
1129
- /** Disable the trigger: click/keyboard and `show()` no longer open the dropdown. */
1130
- disabled?: boolean;
1131
- /** Open it programmatically (no-op while disabled). */
1132
- show(): void;
1133
- /** Close it programmatically. */
1134
- hide(): void;
1135
- /** Flip the open state (closes while disabled). */
1136
- toggle(): void;
1137
- }
1138
-
1139
- export interface KaiNavElement extends HTMLElement {
1140
- /** Color mode (`auto` follows prefers-color-scheme). */
1141
- theme?: "light" | "dark" | "auto";
1142
- /** 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. */
1143
- 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 }[];
1144
- /** Active item id (controlled). */
1145
- value?: string;
1146
- /** Initial active id when uncontrolled. */
1147
- defaultValue?: string;
1148
- /** Ids of group items collapsed on first render (groups default to expanded). Set as a JS property (array). */
1149
- defaultCollapsed?: string[];
1150
- /** Activate an item by id (fires kai-nav-select). */
1151
- select(id: string): void;
1152
- }
1153
-
1154
- export interface KaiNoticeElement extends HTMLElement {
1155
- /** Color mode (`auto` follows prefers-color-scheme). */
1156
- theme?: "light" | "dark" | "auto";
1157
- /** `neutral` (default) · `info` · `warning` · `error` · `success`. Drives the leading icon's color and the a11y role (`alert` for errors, else `status`). */
1158
- severity?: "neutral" | "info" | "warning" | "error" | "success";
1159
- /** Leading icon: omit for the severity default, `"none"` to hide it, or a named icon to override. */
1160
- icon?: string;
1161
- /** Show a dismiss (×) that hides the notice and emits `kai-dismiss`. */
1162
- dismissible?: boolean;
1163
- }
1164
-
1165
- export interface KaiPaneElement extends HTMLElement {
1166
- /** Color mode (`auto` follows prefers-color-scheme). */
1167
- theme?: "light" | "dark" | "auto";
1168
- /** The pane title (the agent / window name). Named `headline` because `title` collides with the global `HTMLElement.title` attribute (it throws at registration). Attribute: `headline`. */
1169
- headline?: string;
1170
- /** A role / label shown under the title (e.g. "Reviewer", "claude-sonnet"). Attribute: `subtitle`. */
1171
- subtitle?: string;
1172
- /** Show the restore glyph instead of maximize, and signal the maximized view-state. Drive it yourself in response to `kai-maximize`. Attribute: `maximized`. */
1173
- maximized?: boolean;
1174
- /** Highlight the frame with a ring/border to mark the ACTIVE pane. Attribute: `focused`. */
1175
- focused?: boolean;
1176
- /** Show a split-pane window control that fires `kai-split`. Off by default. Attribute: `show-split`. */
1177
- showSplit?: boolean;
1178
- /** Show a dock-to-side window control that fires `kai-dock`. Off by default. Attribute: `show-dock`. */
1179
- showDock?: boolean;
1180
- /** A tone-colored status dot (+ optional label) in the header. An object `{ tone, label?, pulse? }` set as a JS PROPERTY (not an attribute). */
1181
- status?: { tone: "working" | "idle" | "done" | "error" | "blocked"; label?: string; pulse?: boolean };
1182
- }
1183
-
1184
- export interface KaiPaneGridElement extends HTMLElement {
1185
- /** Color mode (`auto` follows prefers-color-scheme). */
1186
- theme?: "light" | "dark" | "auto";
1187
- /** Minimum width of every pane, in px, before columns drop / the grid scrolls. Defaults to `280`. Attribute: `min-pane-width`. */
1188
- minPaneWidth?: number;
1189
- /** Minimum height of every pane, in px, before the grid scrolls vertically. Defaults to `200`. Attribute: `min-pane-height`. */
1190
- minPaneHeight?: number;
1191
- /** Column cap when the container is wide (default `3`). Attribute: `max-columns`. */
1192
- maxColumns?: number;
1193
- /** Gap between panes, any CSS length. Defaults to the kit gap (`var(--kai-pane-grid-gap, 0.5rem)`). Attribute: `gap`. */
1194
- gap?: string;
1195
- /** When set to a valid child index, render ONLY that pane full-bleed: a simple maximize hook the consumer drives (pair it with `<kai-pane>`'s `kai-maximize` event). Clear it (or point out of range) for the full tiled grid. Attribute: `maximized-index`. */
1196
- maximizedIndex?: number | null;
1197
- }
1198
-
1199
- export interface KaiPaneGroupElement extends HTMLElement {
1200
- /** Color mode (`auto` follows prefers-color-scheme). */
1201
- theme?: "light" | "dark" | "auto";
1202
- /** The tabs to render. An array of `{ id, name, status?, needsAttention?, number? }` set as a JS PROPERTY (not an HTML attribute). */
1203
- tabs?: { id: string; name: string; status?: { tone: "working" | "idle" | "done" | "error" | "blocked"; label?: string; pulse?: boolean }; needsAttention?: boolean; number?: number }[];
1204
- /** 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). */
1205
- active?: string;
1206
- /** Highlight the frame as the ACTIVE group in a multi-group layout. Attribute: `focused`. */
1207
- focused?: boolean;
1208
- /** Select a tab by id (fires `kai-tab-change`). Ignores unknown ids. */
1209
- select(id: string): void;
1210
- /** Focus the active tab in the strip. */
1211
- focus(): void;
1212
- }
1213
-
1214
- export interface KaiPopoverElement extends HTMLElement {
1215
- /** Color mode (`auto` follows prefers-color-scheme). */
1216
- theme?: "light" | "dark" | "auto";
1217
- /** Floating placement relative to the trigger (floating-ui placement). */
1218
- placement?: "top" | "right" | "bottom" | "left" | "bottom-end" | "bottom-start" | "left-end" | "left-start" | "right-end" | "right-start" | "top-end" | "top-start";
1219
- /** Gap in px between the trigger and the panel. */
1220
- gutter?: number;
1221
- /** 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`. */
1222
- open?: boolean;
1223
- /** Initial open state on mount (uncontrolled seed). */
1224
- defaultOpen?: boolean;
1225
- /** Turn the popover off while keeping the trigger mounted (clicks and `show()` no longer open it). */
1226
- disabled?: boolean;
1227
- /** Open it programmatically (no-op while disabled). */
1228
- show(): void;
1229
- /** Close it programmatically. */
1230
- hide(): void;
1231
- /** Flip the open state (closes while disabled). */
1232
- toggle(): void;
1233
- }
1234
-
1235
- export interface KaiProgressBarElement extends HTMLElement {
1236
- /** Color mode (`auto` follows prefers-color-scheme). */
1237
- theme?: "light" | "dark" | "auto";
1238
- /** Current progress value (0..max). Attribute: `value`. */
1239
- value?: number;
1240
- /** The value `value` runs to (default 100). Attribute: `max`. */
1241
- max?: number;
1242
- /** Optional caption above the track. Attribute: `label`. */
1243
- label?: string;
1244
- /** Fill color: `primary` (default), `success`, `warning`, `error`, `info`. Attribute: `tone`. */
1245
- tone?: string;
1246
- }
1247
-
1248
- export interface KaiPromptDockElement extends HTMLElement {
1249
- /** Color mode (`auto` follows prefers-color-scheme). */
1250
- theme?: "light" | "dark" | "auto";
1251
- /** 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`. */
1252
- frame?: "inset" | "edge" | "none";
1253
- /** 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`. */
1254
- appearance?: "soft" | "outlined" | "filled" | "plain";
1255
- }
1256
-
1257
- export interface KaiPromptInputElement extends HTMLElement {
1258
- /** Color mode (`auto` follows prefers-color-scheme). */
1259
- theme?: "light" | "dark" | "auto";
1260
- /** 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`. */
1261
- value?: string | ({ type: "text"; text: string } | { type: "entity"; entity: { kind: string; id: string; label: string; icon?: string; promptText?: string; data?: Record<string, unknown> } })[];
1262
- /** Placeholder text shown in the empty input. */
1263
- placeholder?: string;
1264
- /** Disable the input and submit button entirely (non-interactive). */
1265
- disabled?: boolean;
1266
- /** Show the loading/streaming state and block submit (use while awaiting a reply). */
1267
- loading?: boolean;
1268
- /** Starter prompts shown above the input. Clicking one follows `suggestionMode`. Set as a JS property. */
1269
- suggestions?: string[];
1270
- /** What clicking a suggestion does: `'submit'` (default) sends it immediately as if typed and submitted; `'fill'` just places it in the input. */
1271
- suggestionMode?: "submit" | "fill";
1272
- /** Show a web-search (Globe) button in the left toolbar; clicking it fires a `kai-web-search` event. Attribute: `web-search`. */
1273
- webSearch?: boolean;
1274
- /** Show a Voice (Mic) button in the left toolbar; clicking it fires a `voice` event. */
1275
- voice?: boolean;
1276
- /** 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`. */
1277
- stoppable?: boolean;
1278
- /** 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. */
1279
- submit?: "always" | "auto";
1280
- /** 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`. */
1281
- attach?: boolean;
1282
- /** 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). Each item's `url` must be a `data:` URI or an https URL, never `URL.createObjectURL`: a `blob:` URL previews perfectly and is meaningless outside this tab, so `toOpenAIMessages`/`toAnthropicMessages` refuse it. (The built-in paperclip already stages files as `data:` URIs.) */
1283
- attachments?: { id: string; type: "file" | "source-document"; filename?: string; mediaType?: string; url?: string; title?: string }[];
1284
- /** 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. */
1285
- triggers?: { char: string; kind: string; items?: { id: string; label: string; icon?: string; description?: string; group?: string; kind?: string; promptText?: string; data?: Record<string, unknown> }[] }[];
1286
- /** 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. */
1287
- kindIcons?: Record<string, string>;
1288
- /** Focus the text editor inside the shadow root (not the hidden file input). */
1289
- focus(options?: FocusOptions): void;
1290
- /** Blur the focused input control. */
1291
- blur(): void;
1292
- /** Clear the text and any staged attachments (fires kai-value-change / kai-attachments-change so a controlled consumer can react). */
1293
- clear(): void;
1294
- /** 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. */
1295
- send(): void;
1296
- }
1297
-
1298
- export interface KaiRadioGroupElement extends HTMLElement {
1299
- /** Color mode (`auto` follows prefers-color-scheme). */
1300
- theme?: "light" | "dark" | "auto";
1301
- /** The choices, top to bottom. Set as a JS PROPERTY (array), never an attribute. */
1302
- options: { value: string; label: string; description?: undefined | string; disabled?: undefined | boolean }[];
1303
- /** Controlled selected `value`. Settable and reflected to the `value` attribute. `el.value = 'degraded'` drives it; choosing a row updates it and fires `kai-change`. Read `el.value` for live state. */
1304
- value?: string;
1305
- /** Shared form-control name for every radio in the group. Defaults to a generated id, so the group is exclusive and keyboard-navigable even when nothing is submitted. */
1306
- name?: string;
1307
- /** Disable every row. Individual rows carry their own `disabled`. */
1308
- disabled?: boolean;
1309
- /** Accessible name for the group. */
1310
- label?: string;
1311
- /** Focus the group's tab stop. That is the selected radio, or the first row when nothing is selected yet. */
1312
- focus(options?: FocusOptions): void;
1313
- }
1314
-
1315
- export interface KaiReasoningElement extends HTMLElement {
1316
- /** Color mode (`auto` follows prefers-color-scheme). */
1317
- theme?: "light" | "dark" | "auto";
1318
- /** The reasoning text to display. */
1319
- text: string;
1320
- /** Trigger label. */
1321
- label?: string;
1322
- /** 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`. */
1323
- open?: boolean;
1324
- /** Initial open state on mount (uncontrolled seed). */
1325
- defaultOpen?: boolean;
1326
- /** While true, auto-expands (and re-collapses when it flips false). */
1327
- streaming?: boolean;
1328
- /** Render `text` as markdown. */
1329
- markdown?: boolean;
1330
- /** Gate the disclosure trigger: programmatic `show()/hide()/toggle()` still work, but the trigger click no longer toggles. */
1331
- disabled?: boolean;
1332
- /** Open it programmatically (no-op while disabled). */
1333
- show(): void;
1334
- /** Close it programmatically. */
1335
- hide(): void;
1336
- /** Flip the open state (closes while disabled). */
1337
- toggle(): void;
1338
- }
1339
-
1340
- export interface KaiRemoteElement extends HTMLElement {
1341
- /** Color mode (`auto` follows prefers-color-scheme). */
1342
- theme?: "light" | "dark" | "auto";
1343
- /** The remote card URL. Attribute: `src`. */
1344
- src?: string;
1345
- /** Exact provider origin (https: or http://localhost for dev). Attribute: `provider-origin`. */
1346
- providerOrigin?: string;
1347
- /** The card envelope to render. JS property only. */
1348
- envelope?: Record<string, unknown>;
1349
- /** Optional routing policy. JS property only. */
1350
- policy?: Record<string, unknown>;
1351
- }
1352
-
1353
- export interface KaiResizableElement extends HTMLElement {
1354
- /** Color mode (`auto` follows prefers-color-scheme). */
1355
- theme?: "light" | "dark" | "auto";
1356
- /** Layout axis: `horizontal` (row, default) or `vertical` (column). */
1357
- orientation?: "horizontal" | "vertical";
1358
- /** Which item index is maximized (null = none). Declarative source of truth. */
1359
- maximizedIndex: number | null;
1360
- /** 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. */
1361
- handle?: "line" | "grip" | "none";
1362
- /** Imperatively maximize the item at `index` (thin wrapper over `maximizedIndex`). */
1363
- maximize(index: number): void;
1364
- /** Imperatively restore from the maximized layout. */
1365
- restore(): void;
1366
- }
1367
-
1368
- export interface KaiResizableItemElement extends HTMLElement {
1369
- /** Color mode (`auto` follows prefers-color-scheme). */
1370
- theme?: "light" | "dark" | "auto";
1371
- /** Initial main-axis size: `"280px"` (fixed) or `"25%"`/`25` (percent). Omitted → flexible. */
1372
- size?: string;
1373
- /** Minimum size during resize (px or %). */
1374
- min?: string;
1375
- /** Maximum size during resize (px or %). */
1376
- max?: string;
1377
- /** Fix this panel's size; adjacent dividers become non-draggable. */
1378
- locked?: boolean;
1379
- /** 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. */
1380
- hidden: boolean;
1381
- /** 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. */
1382
- collapsed?: boolean;
1383
- }
1384
-
1385
- export interface KaiResponseStreamElement extends HTMLElement {
1386
- /** Color mode (`auto` follows prefers-color-scheme). */
1387
- theme?: "light" | "dark" | "auto";
1388
- /** Text to stream. A string, or an `AsyncIterable<string>` (set as a JS property, since async iterables can't be HTML attributes). */
1389
- text: string | AsyncIterable<string>;
1390
- /** Reveal animation. */
1391
- mode?: "typewriter" | "fade";
1392
- /** Characters/segments per tick. */
1393
- speed?: number;
1394
- /** Element tag to render as. */
1395
- as?: string;
1396
- }
1397
-
1398
- export interface KaiScopePickerElement extends HTMLElement {
1399
- /** Color mode (`auto` follows prefers-color-scheme). */
1400
- theme?: "light" | "dark" | "auto";
1401
- /** Authors to offer as scope filters. Omit to drop the Authors section (for a tag-only picker). Set as a JS property. */
1402
- availableAuthors: string[];
1403
- /** Tags to offer as scope filters. Omit to drop the Tags section (for an author-only picker). Set as a JS property. */
1404
- availableTags: string[];
1405
- /** The label shown on the trigger for the active scope. */
1406
- currentLabel?: string;
1407
- /** 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`. */
1408
- open?: boolean;
1409
- /** Initial open state on mount (uncontrolled seed). */
1410
- defaultOpen?: boolean;
1411
- /** Disable the trigger: click/keyboard and `show()` no longer open the dropdown. */
1412
- disabled?: boolean;
1413
- /** Open it programmatically (no-op while disabled). */
1414
- show(): void;
1415
- /** Close it programmatically. */
1416
- hide(): void;
1417
- /** Flip the open state (closes while disabled). */
1418
- toggle(): void;
1419
- }
1420
-
1421
- export interface KaiScreenElement extends HTMLElement {
1422
- /** Color mode (`auto` follows prefers-color-scheme). */
1423
- theme?: "light" | "dark" | "auto";
1424
- /** 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`. */
1425
- open?: boolean;
1426
- /** Initial open state on mount (uncontrolled seed). */
1427
- defaultOpen?: boolean;
1428
- /** Header title text. A projected `title` slot overrides it. (Named `headline` because `title` collides with the global `HTMLElement.title` attribute.) */
1429
- headline?: string;
1430
- /** Show the back button (default true). */
1431
- back?: boolean;
1432
- /** Opt out of marking sibling elements inert/aria-hidden while open (for unusual layouts). */
1433
- noInert?: boolean;
1434
- /** Open it programmatically (no-op while disabled). */
1435
- show(): void;
1436
- /** Close it programmatically. */
1437
- hide(): void;
1438
- /** Flip the open state (closes while disabled). */
1439
- toggle(): void;
1440
- /** Move focus to the screen surface (no-op while closed). */
1441
- focus(options?: FocusOptions): void;
1442
- }
1443
-
1444
- export interface KaiScrollAreaElement extends HTMLElement {
1445
- /** Color mode (`auto` follows prefers-color-scheme). */
1446
- theme?: "light" | "dark" | "auto";
1447
- /** Which axis scrolls. `vertical` (default) · `horizontal` · `both`. The cross axis is clamped so content can't overflow it. */
1448
- orientation?: "vertical" | "horizontal" | "both";
1449
- }
1450
-
1451
- export interface KaiScrollButtonElement extends HTMLElement {
1452
- /** Color mode (`auto` follows prefers-color-scheme). */
1453
- theme?: "light" | "dark" | "auto";
1454
- /** 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="...">`. */
1455
- for?: string;
1456
- /** Button visual variant: `'outline' | 'ghost' | 'default'`. Defaults to `'outline'`. */
1457
- variant?: "outline" | "ghost" | "default";
1458
- /** Button size token. Defaults to `'icon'` (square). */
1459
- size?: "sm" | "md" | "lg" | "icon" | "icon-sm";
1460
- /** The button's accessible name. It is announced whether or not the label is visible, so the text is always localisable. Defaults to `'Scroll to bottom'`. */
1461
- label?: string;
1462
- /** Also render `label` visibly beside the icon. Defaults to `false`, which is the icon-only button. When the text is visible it IS the accessible name, so nothing gets announced twice. */
1463
- showLabel?: boolean;
1464
- }
1465
-
1466
- export interface KaiSearchElement extends HTMLElement {
1467
- /** Color mode (`auto` follows prefers-color-scheme). */
1468
- theme?: "light" | "dark" | "auto";
1469
- /** Controlled query. Settable and reflected to the `value` attribute. Read `el.value` for live state. */
1470
- value?: string;
1471
- /** Placeholder. Defaults to `Search…`. */
1472
- placeholder?: string;
1473
- /** 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`. */
1474
- icon?: string;
1475
- /** Debounce window for `kai-search`, in ms. Defaults to `200`. */
1476
- debounce?: number;
1477
- /** Show a spinner in place of the leading icon while results load. */
1478
- loading?: boolean;
1479
- /** 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. */
1480
- shortcut?: string;
1481
- /** Focus the search input inside the shadow root. A native `focus()` on the host lands on the host itself and never reaches it. */
1482
- focus(): void;
1483
- /** 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. */
1484
- clear(): void;
1485
- }
1486
-
1487
- export interface KaiSegmentedElement extends HTMLElement {
1488
- /** Color mode (`auto` follows prefers-color-scheme). */
1489
- theme?: "light" | "dark" | "auto";
1490
- /** The selectable segments, left to right. Set as a JS property (array). */
1491
- options: { value: string; label: string; icon?: undefined | string }[];
1492
- /** 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. */
1493
- value?: string;
1494
- /** Control density: `sm` or `md`. Defaults to `md`. */
1495
- size?: "sm" | "md";
1496
- }
1497
-
1498
- export interface KaiSelectElement extends HTMLElement {
1499
- /** Color mode (`auto` follows prefers-color-scheme). */
1500
- theme?: "light" | "dark" | "auto";
1501
- /** The choices, in display order. Set as a JS PROPERTY (array), never an attribute. Rendered in full: the kit never truncates, re-orders or de-duplicates them. */
1502
- options: { value: string; label?: undefined | string; disabled?: undefined | boolean }[];
1503
- /** Controlled selected value. Settable and reflected to the `value` attribute. `el.value = 'high'` drives it; choosing an option updates it and fires `kai-change`. Read `el.value` for live state; for a `multiple` select read `el.values` instead. */
1504
- value?: string;
1505
- /** Text for a leading, disabled, empty option: the "nothing chosen yet" row. Omitted means no such row at all; there is no default wording, because inventing one would put words in your UI. */
1506
- placeholder?: string;
1507
- /** Allow more than one selection. Turns the control into the platform's list box, so the kit's chevron is not drawn. */
1508
- multiple?: boolean;
1509
- /** Force the invalid (destructive-border) state. */
1510
- invalid?: boolean;
1511
- /** Disable interaction. */
1512
- disabled?: boolean;
1513
- /** Set the native `required` attribute, and nothing more. Whether an empty select is an error is the application's rule, not the kit's. */
1514
- required?: boolean;
1515
- /** Accessible label for the control. */
1516
- label?: string;
1517
- /** Form-control name, for a native form submit. */
1518
- name?: string;
1519
- /** Focus the inner select (the host element can't reach it). */
1520
- focus(options?: FocusOptions): void;
1521
- }
1522
-
1523
- export interface KaiSeparatorElement extends HTMLElement {
1524
- /** Color mode (`auto` follows prefers-color-scheme). */
1525
- theme?: "light" | "dark" | "auto";
1526
- /** `horizontal` (default, block + full-width) or `vertical` (a rule inside a flex/grid row, stretching to the row height). */
1527
- orientation?: "horizontal" | "vertical";
1528
- }
1529
-
1530
- export interface KaiSettingItemElement extends HTMLElement {
1531
- /** Color mode (`auto` follows prefers-color-scheme). */
1532
- theme?: "light" | "dark" | "auto";
1533
- /** Row label (primary text). Attribute: `label`. */
1534
- label?: string;
1535
- /** Optional secondary description under the label. Attribute: `description`. */
1536
- description?: string;
1537
- }
1538
-
1539
- export interface KaiSettingsGroupElement extends HTMLElement {
1540
- /** Color mode (`auto` follows prefers-color-scheme). */
1541
- theme?: "light" | "dark" | "auto";
1542
- /** Small section heading shown above the card. Attribute: `heading`. */
1543
- heading?: string;
1544
- /** Optional muted description under the heading. Attribute: `description`. */
1545
- description?: string;
1546
- }
1547
-
1548
- export interface KaiSkeletonElement extends HTMLElement {
1549
- /** Color mode (`auto` follows prefers-color-scheme). */
1550
- theme?: "light" | "dark" | "auto";
1551
- /** `text` (one or more lines), `rect` (a block), or `circle` (round). Defaults to `text`. */
1552
- variant?: "text" | "rect" | "circle";
1553
- /** CSS width (e.g. `'12rem'`, `'60%'`). Defaults to full width (responsive); for `circle` it is the diameter. */
1554
- width?: string;
1555
- /** CSS height. Defaults per variant (a text line height; circle = width). */
1556
- height?: string;
1557
- /** `text` only: number of lines; the last is shorter. Defaults to 1. */
1558
- lines?: number;
1559
- }
1560
-
1561
- export interface KaiSkillsElement extends HTMLElement {
1562
- /** Color mode (`auto` follows prefers-color-scheme). */
1563
- theme?: "light" | "dark" | "auto";
1564
- /** 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. */
1565
- skills: { id: string; name: string }[];
1566
- }
1567
-
1568
- export interface KaiSliderElement extends HTMLElement {
1569
- /** Color mode (`auto` follows prefers-color-scheme). */
1570
- theme?: "light" | "dark" | "auto";
1571
- /** Lowest selectable value. Required: a range with no bounds is a guess, and the guess belongs to whoever knows what the number means. */
1572
- min?: number;
1573
- /** Highest selectable value. Required, for the same reason as `min`. */
1574
- max?: number;
1575
- /** Granularity. Omitted means the native default of 1; `any` means continuous. */
1576
- step?: number | "any";
1577
- /** Controlled value. Settable and reflected to the `value` attribute. `el.value = 40` drives it; dragging updates it and fires `kai-input` per step, `kai-change` on release. Read `el.value` for live state. */
1578
- value?: number;
1579
- /** Disable interaction. */
1580
- disabled?: boolean;
1581
- /** Accessible label for the slider. */
1582
- label?: string;
1583
- /** Form-control name, for a native form submit. */
1584
- name?: string;
1585
- /** Show the current value beside the track. Off by default. Two ways in, because one of them is not a scalar. As a bare ATTRIBUTE (`<kai-slider value-label>`) it renders the raw number. As a JS PROPERTY it also accepts a formatter function (`el.valueLabel = (v) => v + '%'`), for a slider that is not counting bare numbers. A function cannot survive an attribute, so that half is property-only. The readout is hidden from assistive tech: the slider already reports the same number, and an exposed copy would be announced twice. */
1586
- valueLabel?: boolean | ((value: number) => string);
1587
- /** Focus the inner range input (the host element can't reach it). */
1588
- focus(options?: FocusOptions): void;
1589
- }
1590
-
1591
- export interface KaiSourceElement extends HTMLElement {
1592
- /** Color mode (`auto` follows prefers-color-scheme). */
1593
- theme?: "light" | "dark" | "auto";
1594
- /** The URL this citation links to (the domain also seeds the default label/favicon). */
1595
- href?: string;
1596
- /** Trigger label (defaults to the domain). */
1597
- label?: string;
1598
- /** Hover-card headline. Attribute: `headline` (`title` is avoided because it is a global HTML attribute that reflects in a CE constructor and breaks it). */
1599
- headline?: string;
1600
- /** Hover-card body text describing the source. */
1601
- description?: string;
1602
- /** Show the source's favicon next to the trigger label. */
1603
- showFavicon?: boolean;
1604
- }
1605
-
1606
- export interface KaiSourcesElement extends HTMLElement {
1607
- /** Color mode (`auto` follows prefers-color-scheme). */
1608
- theme?: "light" | "dark" | "auto";
1609
- /** 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. */
1610
- sources: { href: string; title?: string; description?: string; label?: string; showFavicon?: boolean }[];
1611
- /** Show favicons on all items (per-item `showFavicon` overrides). */
1612
- showFavicon?: boolean;
1613
- /** 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`. */
1614
- numbered?: boolean;
1615
- }
1616
-
1617
- export interface KaiStatusElement extends HTMLElement {
1618
- /** Color mode (`auto` follows prefers-color-scheme). */
1619
- theme?: "light" | "dark" | "auto";
1620
- /** Presence/notification state → color. `new` (default) maps to the blue hue. */
1621
- status?: "new" | "online" | "busy" | "away" | "offline";
1622
- /** Animated ping ring (off by default; respects prefers-reduced-motion). */
1623
- pulse?: boolean;
1624
- /** Accessible name. Without it the dot is decorative. */
1625
- label?: string;
1626
- /** `sm` (default) or `md`. */
1627
- size?: "sm" | "md";
1628
- }
1629
-
1630
- export interface KaiSuggestionsElement extends HTMLElement {
1631
- /** Color mode (`auto` follows prefers-color-scheme). */
1632
- theme?: "light" | "dark" | "auto";
1633
- /** 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. */
1634
- suggestions: (string | { label: string; value?: string; icon?: string })[];
1635
- /** Chip style: `'outline'` (default), `'ghost'`, or `'default'` (filled). */
1636
- variant?: "outline" | "ghost" | "default";
1637
- /** Row height for `layout="list"`: `'md'` (default) or `'lg'` for taller rows. Chips are unaffected. */
1638
- size?: "md" | "lg";
1639
- /** 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. */
1640
- layout?: "chips" | "list";
1641
- /** Full-width left-aligned rows instead of pills. */
1642
- block?: boolean;
1643
- /** Substring to highlight within each suggestion. */
1644
- highlight?: string;
1645
- }
1646
-
1647
- export interface KaiSwitchElement extends HTMLElement {
1648
- /** Color mode (`auto` follows prefers-color-scheme). */
1649
- theme?: "light" | "dark" | "auto";
1650
- /** 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. */
1651
- checked?: boolean;
1652
- /** Initial checked state on mount (uncontrolled seed). Bare attribute (`<kai-switch default-checked>`) turns it on. */
1653
- defaultChecked?: boolean;
1654
- /** Disable interaction. */
1655
- disabled?: boolean;
1656
- /** Accessible label. */
1657
- label?: string;
1658
- /** Form-control name (paired with `value`). */
1659
- name?: string;
1660
- /** Submitted value when checked (paired with `name`). Defaults to `'on'`. */
1661
- value?: string;
1662
- /** Flip the switch and fire `kai-change` (no-op while disabled). */
1663
- toggle(): void;
1664
- /** Focus the inner `role="switch"` button (the host element can't reach it). */
1665
- focus(options?: FocusOptions): void;
1666
- }
1667
-
1668
- export interface KaiTabsElement extends HTMLElement {
1669
- /** Color mode (`auto` follows prefers-color-scheme). */
1670
- theme?: "light" | "dark" | "auto";
1671
- /** Tabs to render. Set as a JS property, not an HTML attribute. */
1672
- items?: { id: string; label?: string; icon?: string; disabled?: boolean }[];
1673
- /** 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. */
1674
- value?: string;
1675
- /** Initial selected id when uncontrolled (use the `default-value` attribute in plain HTML). */
1676
- defaultValue?: string;
1677
- /** `segmented` (default, a pill group) or `underline` (an underlined row). */
1678
- variant?: "segmented" | "underline";
1679
- /** Stretch the strip to full width, each tab sharing the space equally. */
1680
- block?: boolean;
1681
- /** Disable the whole strip. */
1682
- disabled?: boolean;
1683
- /** Select a tab by id (fires `kai-tab-change`). Ignores unknown/disabled ids. */
1684
- select(id: string): void;
1685
- /** Focus the active tab (or the first focusable tab). */
1686
- focus(): void;
1687
- }
1688
-
1689
- export interface KaiTasksElement extends HTMLElement {
1690
- /** Color mode (`auto` follows prefers-color-scheme). */
1691
- theme?: "light" | "dark" | "auto";
1692
- /** 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. */
1693
- 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 };
1694
- /** Stable card id correlating every emitted CardEvent. Attribute: `card-id`. */
1695
- cardId?: string;
1696
- /** Heading rendered in the card chrome (= CardEnvelope.title). Attribute: `heading`. */
1697
- heading?: string;
1698
- /** Set when the user resolved this card; renders the read-only view. Property: `el.resolution = { kind:'submit', data:{ selected:[…] } }`. */
1699
- resolution?: Record<string, unknown>;
1700
- /** Controlled selection (task ids; JS property). When set, it wins over local state. */
1701
- value?: string[];
1702
- /** Uncontrolled initial selection (task ids; JS property), overlaying per-task `checked`. */
1703
- defaultValue?: string[];
1704
- /** Freeze the whole list + Confirm. Attribute: `disabled`. */
1705
- disabled?: boolean;
1706
- /** 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`. */
1707
- readonly?: boolean;
1708
- /** Set the checked task ids (local-only, no emit), respecting disabled/max. With no arg, select all toggleable rows. */
1709
- select(taskIds?: string[]): void;
1710
- /** Toggle one task by id, honoring the max gate (no `checked` = flip). */
1711
- toggle(taskId: string, checked?: boolean): void;
1712
- /** Confirm the current selection: emits the `submit` CardEvent + resolves (only when the min/max gate passes). Named `send`, not `submit`. */
1713
- send(): void;
1714
- /** Focus the task group (select-all checkbox if shown, else the first row). */
1715
- focus(options?: FocusOptions): void;
1716
- /** Trigger the dismiss path (emit `dismiss` + collapse to the re-openable stub). */
1717
- dismiss(): void;
1718
- /** Re-open a dismissed card from its stub (emit `reopen`). */
1719
- reopen(): void;
1720
- }
1721
-
1722
- export interface KaiTextShimmerElement extends HTMLElement {
1723
- /** Color mode (`auto` follows prefers-color-scheme). */
1724
- theme?: "light" | "dark" | "auto";
1725
- /** The text to shimmer. */
1726
- text?: string;
1727
- /** Element tag to render as (default `span`). */
1728
- as?: string;
1729
- /** Animation duration in seconds. */
1730
- duration?: number;
1731
- /** Gradient spread (5–45). */
1732
- spread?: number;
1733
- }
1734
-
1735
- export interface KaiThinkingBarElement extends HTMLElement {
1736
- /** Color mode (`auto` follows prefers-color-scheme). */
1737
- theme?: "light" | "dark" | "auto";
1738
- /** The shimmering label, e.g. "Thinking…". */
1739
- text?: string;
1740
- /** When true, show a "stop" affordance that fires a `stop` event. */
1741
- stoppable?: boolean;
1742
- /** Label for the stop affordance. */
1743
- stopLabel?: string;
1744
- }
1745
-
1746
- export interface KaiThreadElement extends HTMLElement {
1747
- /** Color mode (`auto` follows prefers-color-scheme). */
1748
- theme?: "light" | "dark" | "auto";
1749
- /** 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). */
1750
- 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" }[];
1751
- /** Show a typing indicator on the pending assistant turn. Set it while awaiting the assistant's reply. */
1752
- loading?: boolean;
1753
- /** Body/prose font scale for rendered markdown (`'xs' | 'sm' | 'base' | 'lg'`). Defaults to `'sm'`. */
1754
- proseSize?: "xs" | "sm" | "base" | "lg";
1755
- /** Shiki theme name for syntax-highlighted code blocks (e.g. `'github-dark-dimmed'`). */
1756
- codeTheme?: string;
1757
- /** Enable Shiki syntax highlighting in code blocks. Turn off to render plain `<pre>` blocks (lighter, no highlighter load). Default true. */
1758
- codeHighlight?: boolean;
1759
- /** Whether each message's action bar is always visible (`'always'`, default) or only revealed on hover of that message row (`'hover'`). */
1760
- actionsReveal?: "always" | "hover";
1761
- /** Show the scroll-to-bottom button inside the scroll area. Default true. */
1762
- scrollButton?: boolean;
1763
- /** Extra classes applied to the thread's inner root. */
1764
- class?: string;
1765
- /** 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. */
1766
- cardTypes?: Record<string, string>;
1767
- /** 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. */
1768
- cardSchemas?: Record<string, object>;
1769
- /** Scroll the message list to the bottom (default `'smooth'`). */
1770
- scrollToBottom(behavior?: "auto" | "instant" | "smooth"): void;
1771
- }
1772
-
1773
- export interface KaiToastRegionElement extends HTMLElement {
1774
- /** Color mode (`auto` follows prefers-color-scheme). */
1775
- theme?: "light" | "dark" | "auto";
1776
- /** 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. Note the handover: the first `toast()` call ADOPTS a region you placed in markup (no second region mounts) and binds the imperative store to this property, replacing any array you set. Drive a region as data OR via `toast()`, not both at once. */
1777
- 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 }[];
1778
- /** Stack anchor: `'top-center'` (default), `'top-right'`, `'bottom-center'`, … */
1779
- position?: "top-center" | "top-right" | "top-left" | "bottom-center" | "bottom-right" | "bottom-left";
1780
- /** Max simultaneously-visible toasts; the rest queue. Defaults to `3`. */
1781
- max?: number;
1782
- /** Stacking: 'expanded' (default, full column) | 'collapsed' (Sonner-style pile that expands on hover/focus). Attribute: stack. */
1783
- stack?: "expanded" | "collapsed";
1784
- /** Default appearance for this region's toasts: `'pill'` (default, compact) | `'card'` (richer, with a description line). A per-toast `appearance` wins. Attribute: `appearance`. */
1785
- appearance?: "pill" | "card";
1786
- /** Default high-contrast inverse treatment for this region's toasts. A per-toast `inverse` wins. Off by default. Attribute: `inverse`. */
1787
- inverse?: boolean;
1788
- /** Container element to anchor this region to (JS property). Set by the store for a scoped region; unset = the global viewport region. */
1789
- target?: HTMLElement;
1790
- }
1791
-
1792
- export interface KaiToolElement extends HTMLElement {
1793
- /** Color mode (`auto` follows prefers-color-scheme). */
1794
- theme?: "light" | "dark" | "auto";
1795
- /** The tool-call to display. Set as a JS property. */
1796
- 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 } };
1797
- /** 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`. */
1798
- open?: boolean;
1799
- /** Initial open state on mount (uncontrolled seed). */
1800
- defaultOpen?: boolean;
1801
- /** Gate the disclosure trigger: programmatic `show()/hide()/toggle()` still work, but the trigger click no longer toggles. */
1802
- disabled?: boolean;
1803
- /** Open it programmatically (no-op while disabled). */
1804
- show(): void;
1805
- /** Close it programmatically. */
1806
- hide(): void;
1807
- /** Flip the open state (closes while disabled). */
1808
- toggle(): void;
1809
- }
1810
-
1811
- export interface KaiTooltipElement extends HTMLElement {
1812
- /** Color mode (`auto` follows prefers-color-scheme). */
1813
- theme?: "light" | "dark" | "auto";
1814
- /** The hint text shown on hover/focus of the slotted trigger. */
1815
- content?: string;
1816
- /** Delay (ms) before the tooltip appears on hover. Defaults to 600. Focus shows it immediately regardless. */
1817
- openDelay?: number;
1818
- /** Delay (ms) before it hides after the pointer leaves. Defaults to 0 (hides immediately). */
1819
- closeDelay?: number;
1820
- /** Preferred placement: `'top' | 'bottom' | 'left' | 'right'` (+ optional `-start`/`-end`). Defaults to `'top'`; flips to stay in view. */
1821
- placement?: string;
1822
- /** 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`. */
1823
- open?: boolean;
1824
- /** Initial open state on mount (uncontrolled seed). */
1825
- defaultOpen?: boolean;
1826
- /** Turn the tooltip off while keeping the trigger mounted (hover/focus and `show()` no longer open it). */
1827
- disabled?: boolean;
1828
- /** Open it programmatically (no-op while disabled). */
1829
- show(): void;
1830
- /** Close it programmatically. */
1831
- hide(): void;
1832
- /** Flip the open state (closes while disabled). */
1833
- toggle(): void;
1834
- }
1835
-
1836
- export interface KaiVoiceInputElement extends HTMLElement {
1837
- /** Color mode (`auto` follows prefers-color-scheme). */
1838
- theme?: "light" | "dark" | "auto";
1839
- /** 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. */
1840
- transcribe?: (audio: Blob) => Promise<string>;
1841
- /** Disable the mic button (non-interactive). */
1842
- disabled?: boolean;
1843
- /** 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. */
1844
- recognitionLang?: string;
1845
- /** Emit live partial transcripts (`kai-transcript-interim`) during native recognition. Attribute: `interim`. No-op on the transcribe/fallback paths. */
1846
- interim?: boolean;
1847
- /** 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. */
1848
- start(): void;
1849
- /** Stop the in-progress recording, producing the blob (→ kai-audio-captured) and running transcription. Pairs with start() for push-to-talk. */
1850
- stop(): void;
1851
- }
1852
-
1853
- export interface KaiVoiceOutputElement extends HTMLElement {
1854
- /** Color mode (`auto` follows prefers-color-scheme). */
1855
- theme?: "light" | "dark" | "auto";
1856
- /** The utterance to read aloud. */
1857
- text?: string;
1858
- /** Speak automatically when `text` is set/changed. */
1859
- autoplay?: boolean;
1860
- /** 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. */
1861
- synthesize?: (text: string) => Promise<Blob>;
1862
- /** Disable the button (non-interactive). */
1863
- disabled?: boolean;
1864
- /** Speak the current `text` (native, or via `synthesize` if set). */
1865
- speak(): void;
1866
- /** Pause playback (resumable). */
1867
- pause(): void;
1868
- /** Resume paused playback. */
1869
- resume(): void;
1870
- /** Stop playback and reset. */
1871
- stop(): void;
1872
- }
1873
-
1874
- export interface KaiWorkspaceElement extends HTMLElement {
1875
- /** Color mode (`auto` follows prefers-color-scheme). */
1876
- theme?: "light" | "dark" | "auto";
1877
- /** Controlled collapsed state of the start aside. Set this as a JS property (`el.startCollapsed = true`) to drive the aside from your app, updating it in response to the `kai-aside-toggle` event. Omit for uncontrolled (the element manages it). */
1878
- startCollapsed?: boolean;
1879
- /** Initial collapsed state of the start aside when uncontrolled (default false). Use the `default-start-collapsed` attribute to start collapsed in plain HTML. */
1880
- defaultStartCollapsed?: boolean;
1881
- /** Controlled collapsed state of the end aside. Set this as a JS property (`el.endCollapsed = true`) to drive the aside from your app, updating it in response to the `kai-aside-toggle` event. Omit for uncontrolled (the element manages it). */
1882
- endCollapsed?: boolean;
1883
- /** Initial collapsed state of the end aside when uncontrolled (default false). Use the `default-end-collapsed` attribute to start collapsed in plain HTML. */
1884
- defaultEndCollapsed?: boolean;
1885
- /** Auto-collapse both asides when the shell's own width drops below this many px, and re-expand when it grows back above. Applies to uncontrolled asides only (it never fights an app-driven collapsed prop); omit to disable. Fires `kai-aside-toggle`. Attribute: `collapse-below`. */
1886
- collapseBelow?: number;
1887
- /** Below this shell width in px, an expanded aside renders as an overlay drawer over the main region instead of a column beside it. Escape inside the drawer closes it and returns focus to the element focused before it opened. Omit to disable. Attribute: `drawer-below`. */
1888
- drawerBelow?: number;
1889
- /** Density hint. Reflected as a `data-compact` hook on the root (and as the `compact` attribute on the element) for your CSS and slotted content; the shell itself keeps no other opinion about density. */
1890
- compact?: boolean;
1891
- /** Collapse/expand one aside (fires `kai-aside-toggle`). */
1892
- toggleAside(side: "start" | "end"): void;
1893
- /** Force one aside collapsed (fires `kai-aside-toggle`). */
1894
- collapseAside(side: "start" | "end"): void;
1895
- /** Force one aside expanded (fires `kai-aside-toggle`). */
1896
- expandAside(side: "start" | "end"): void;
1897
- }
1898
-
1899
- declare global {
1900
- interface HTMLElementTagNameMap {
1901
- 'kai-agent-card': KaiAgentCardElement;
1902
- 'kai-artifact': KaiArtifactElement;
1903
- 'kai-attachments': KaiAttachmentsElement;
1904
- 'kai-audio-visualizer': KaiAudioVisualizerElement;
1905
- 'kai-avatar': KaiAvatarElement;
1906
- 'kai-badge': KaiBadgeElement;
1907
- 'kai-button': KaiButtonElement;
1908
- 'kai-card': KaiCardElement;
1909
- 'kai-cards': KaiCardsElement;
1910
- 'kai-chain-of-thought': KaiChainOfThoughtElement;
1911
- 'kai-chat': KaiChatElement;
1912
- 'kai-checkbox': KaiCheckboxElement;
1913
- 'kai-checkbox-group': KaiCheckboxGroupElement;
1914
- 'kai-checkpoint': KaiCheckpointElement;
1915
- 'kai-choice': KaiChoiceElement;
1916
- 'kai-coachmark': KaiCoachmarkElement;
1917
- 'kai-code-block': KaiCodeBlockElement;
1918
- 'kai-command': KaiCommandElement;
1919
- 'kai-compare': KaiCompareElement;
1920
- 'kai-composer': KaiComposerElement;
1921
- 'kai-confirm': KaiConfirmElement;
1922
- 'kai-context': KaiContextElement;
1923
- 'kai-conversation-item': KaiConversationItemElement;
1924
- 'kai-conversations': KaiConversationsElement;
1925
- 'kai-dialog': KaiDialogElement;
1926
- 'kai-dock': KaiDockElement;
1927
- 'kai-dropdown': KaiDropdownElement;
1928
- 'kai-editable-label': KaiEditableLabelElement;
1929
- 'kai-embed': KaiEmbedElement;
1930
- 'kai-empty': KaiEmptyElement;
1931
- 'kai-feedback-bar': KaiFeedbackBarElement;
1932
- 'kai-file-tree': KaiFileTreeElement;
1933
- 'kai-file-upload': KaiFileUploadElement;
1934
- 'kai-form': KaiFormElement;
1935
- 'kai-hover-card': KaiHoverCardElement;
1936
- 'kai-icon': KaiIconElement;
1937
- 'kai-image': KaiImageElement;
1938
- 'kai-input': KaiInputElement;
1939
- 'kai-kbd': KaiKbdElement;
1940
- 'kai-link-preview': KaiLinkPreviewElement;
1941
- 'kai-loader': KaiLoaderElement;
1942
- 'kai-markdown': KaiMarkdownElement;
1943
- 'kai-menu': KaiMenuElement;
1944
- 'kai-message': KaiMessageElement;
1945
- 'kai-model-switcher': KaiModelSwitcherElement;
1946
- 'kai-nav': KaiNavElement;
1947
- 'kai-notice': KaiNoticeElement;
1948
- 'kai-pane': KaiPaneElement;
1949
- 'kai-pane-grid': KaiPaneGridElement;
1950
- 'kai-pane-group': KaiPaneGroupElement;
1951
- 'kai-popover': KaiPopoverElement;
1952
- 'kai-progress-bar': KaiProgressBarElement;
1953
- 'kai-prompt-dock': KaiPromptDockElement;
1954
- 'kai-prompt-input': KaiPromptInputElement;
1955
- 'kai-radio-group': KaiRadioGroupElement;
1956
- 'kai-reasoning': KaiReasoningElement;
1957
- 'kai-remote': KaiRemoteElement;
1958
- 'kai-resizable': KaiResizableElement;
1959
- 'kai-resizable-item': KaiResizableItemElement;
1960
- 'kai-response-stream': KaiResponseStreamElement;
1961
- 'kai-scope-picker': KaiScopePickerElement;
1962
- 'kai-screen': KaiScreenElement;
1963
- 'kai-scroll-area': KaiScrollAreaElement;
1964
- 'kai-scroll-button': KaiScrollButtonElement;
1965
- 'kai-search': KaiSearchElement;
1966
- 'kai-segmented': KaiSegmentedElement;
1967
- 'kai-select': KaiSelectElement;
1968
- 'kai-separator': KaiSeparatorElement;
1969
- 'kai-setting-item': KaiSettingItemElement;
1970
- 'kai-settings-group': KaiSettingsGroupElement;
1971
- 'kai-skeleton': KaiSkeletonElement;
1972
- 'kai-skills': KaiSkillsElement;
1973
- 'kai-slider': KaiSliderElement;
1974
- 'kai-source': KaiSourceElement;
1975
- 'kai-sources': KaiSourcesElement;
1976
- 'kai-status': KaiStatusElement;
1977
- 'kai-suggestions': KaiSuggestionsElement;
1978
- 'kai-switch': KaiSwitchElement;
1979
- 'kai-tabs': KaiTabsElement;
1980
- 'kai-tasks': KaiTasksElement;
1981
- 'kai-text-shimmer': KaiTextShimmerElement;
1982
- 'kai-thinking-bar': KaiThinkingBarElement;
1983
- 'kai-thread': KaiThreadElement;
1984
- 'kai-toast-region': KaiToastRegionElement;
1985
- 'kai-tool': KaiToolElement;
1986
- 'kai-tooltip': KaiTooltipElement;
1987
- 'kai-voice-input': KaiVoiceInputElement;
1988
- 'kai-voice-output': KaiVoiceOutputElement;
1989
- 'kai-workspace': KaiWorkspaceElement;
1990
- }
1991
- }
1992
-
1993
- interface KaiElementJsxProps {
1994
- id?: string;
1995
- class?: string;
1996
- className?: string;
1997
- style?: Record<string, string | number> | string;
1998
- slot?: string;
1999
- part?: string;
2000
- children?: unknown;
2001
- ref?: unknown;
2002
- [attr: string]: unknown;
2003
- }
2004
-
2005
- declare module 'react' {
2006
- namespace JSX {
2007
- interface IntrinsicElements {
2008
- 'kai-agent-card': KaiElementJsxProps;
2009
- 'kai-artifact': KaiElementJsxProps;
2010
- 'kai-attachments': KaiElementJsxProps;
2011
- 'kai-audio-visualizer': KaiElementJsxProps;
2012
- 'kai-avatar': KaiElementJsxProps;
2013
- 'kai-badge': KaiElementJsxProps;
2014
- 'kai-button': KaiElementJsxProps;
2015
- 'kai-card': KaiElementJsxProps;
2016
- 'kai-cards': KaiElementJsxProps;
2017
- 'kai-chain-of-thought': KaiElementJsxProps;
2018
- 'kai-chat': KaiElementJsxProps;
2019
- 'kai-checkbox': KaiElementJsxProps;
2020
- 'kai-checkbox-group': KaiElementJsxProps;
2021
- 'kai-checkpoint': KaiElementJsxProps;
2022
- 'kai-choice': KaiElementJsxProps;
2023
- 'kai-coachmark': KaiElementJsxProps;
2024
- 'kai-code-block': KaiElementJsxProps;
2025
- 'kai-command': KaiElementJsxProps;
2026
- 'kai-compare': KaiElementJsxProps;
2027
- 'kai-composer': KaiElementJsxProps;
2028
- 'kai-confirm': KaiElementJsxProps;
2029
- 'kai-context': KaiElementJsxProps;
2030
- 'kai-conversation-item': KaiElementJsxProps;
2031
- 'kai-conversations': KaiElementJsxProps;
2032
- 'kai-dialog': KaiElementJsxProps;
2033
- 'kai-dock': KaiElementJsxProps;
2034
- 'kai-dropdown': KaiElementJsxProps;
2035
- 'kai-editable-label': KaiElementJsxProps;
2036
- 'kai-embed': KaiElementJsxProps;
2037
- 'kai-empty': KaiElementJsxProps;
2038
- 'kai-feedback-bar': KaiElementJsxProps;
2039
- 'kai-file-tree': KaiElementJsxProps;
2040
- 'kai-file-upload': KaiElementJsxProps;
2041
- 'kai-form': KaiElementJsxProps;
2042
- 'kai-hover-card': KaiElementJsxProps;
2043
- 'kai-icon': KaiElementJsxProps;
2044
- 'kai-image': KaiElementJsxProps;
2045
- 'kai-input': KaiElementJsxProps;
2046
- 'kai-kbd': KaiElementJsxProps;
2047
- 'kai-link-preview': KaiElementJsxProps;
2048
- 'kai-loader': KaiElementJsxProps;
2049
- 'kai-markdown': KaiElementJsxProps;
2050
- 'kai-menu': KaiElementJsxProps;
2051
- 'kai-message': KaiElementJsxProps;
2052
- 'kai-model-switcher': KaiElementJsxProps;
2053
- 'kai-nav': KaiElementJsxProps;
2054
- 'kai-notice': KaiElementJsxProps;
2055
- 'kai-pane': KaiElementJsxProps;
2056
- 'kai-pane-grid': KaiElementJsxProps;
2057
- 'kai-pane-group': KaiElementJsxProps;
2058
- 'kai-popover': KaiElementJsxProps;
2059
- 'kai-progress-bar': KaiElementJsxProps;
2060
- 'kai-prompt-dock': KaiElementJsxProps;
2061
- 'kai-prompt-input': KaiElementJsxProps;
2062
- 'kai-radio-group': KaiElementJsxProps;
2063
- 'kai-reasoning': KaiElementJsxProps;
2064
- 'kai-remote': KaiElementJsxProps;
2065
- 'kai-resizable': KaiElementJsxProps;
2066
- 'kai-resizable-item': KaiElementJsxProps;
2067
- 'kai-response-stream': KaiElementJsxProps;
2068
- 'kai-scope-picker': KaiElementJsxProps;
2069
- 'kai-screen': KaiElementJsxProps;
2070
- 'kai-scroll-area': KaiElementJsxProps;
2071
- 'kai-scroll-button': KaiElementJsxProps;
2072
- 'kai-search': KaiElementJsxProps;
2073
- 'kai-segmented': KaiElementJsxProps;
2074
- 'kai-select': KaiElementJsxProps;
2075
- 'kai-separator': KaiElementJsxProps;
2076
- 'kai-setting-item': KaiElementJsxProps;
2077
- 'kai-settings-group': KaiElementJsxProps;
2078
- 'kai-skeleton': KaiElementJsxProps;
2079
- 'kai-skills': KaiElementJsxProps;
2080
- 'kai-slider': KaiElementJsxProps;
2081
- 'kai-source': KaiElementJsxProps;
2082
- 'kai-sources': KaiElementJsxProps;
2083
- 'kai-status': KaiElementJsxProps;
2084
- 'kai-suggestions': KaiElementJsxProps;
2085
- 'kai-switch': KaiElementJsxProps;
2086
- 'kai-tabs': KaiElementJsxProps;
2087
- 'kai-tasks': KaiElementJsxProps;
2088
- 'kai-text-shimmer': KaiElementJsxProps;
2089
- 'kai-thinking-bar': KaiElementJsxProps;
2090
- 'kai-thread': KaiElementJsxProps;
2091
- 'kai-toast-region': KaiElementJsxProps;
2092
- 'kai-tool': KaiElementJsxProps;
2093
- 'kai-tooltip': KaiElementJsxProps;
2094
- 'kai-voice-input': KaiElementJsxProps;
2095
- 'kai-voice-output': KaiElementJsxProps;
2096
- 'kai-workspace': KaiElementJsxProps;
2097
- }
2098
- }
2099
- }
2100
-
2101
- export interface KaiAgentCardElementProps {
2102
- /** Color mode (`auto` follows prefers-color-scheme). */
2103
- theme?: "light" | "dark" | "auto";
2104
- /** The agent's name, the primary label. Attribute: `name`. */
2105
- name?: string;
2106
- /** Selected / focused state: highlighted border + surface. Attribute: `active`. */
2107
- active?: boolean;
2108
- /** 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`. */
2109
- needsAttention?: boolean;
2110
- /** 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 }`. */
2111
- status?: { tone: "working" | "idle" | "done" | "error" | "blocked"; label?: string; pulse?: boolean };
2112
- }
2113
-
2114
- export interface KaiArtifactElementProps {
2115
- /** Color mode (`auto` follows prefers-color-scheme). */
2116
- theme?: "light" | "dark" | "auto";
2117
- /** URL the preview iframe frames. Consumer-controlled. */
2118
- src?: string;
2119
- /** 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). */
2120
- files?: { path: string; url?: string; code?: string; language?: string; type?: "html" | "pdf" | "image" | "other"; additions?: number; deletions?: number; status?: "added" | "modified" | "deleted" | "renamed" | "untracked" }[];
2121
- /** Controlled active tab: `preview` or `code`. When set, the artifact follows it (re-asserted on change). Leave unset for an uncontrolled tab (see `defaultTab`). */
2122
- tab?: "preview" | "code";
2123
- /** 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`. */
2124
- defaultTab?: "preview" | "code";
2125
- /** Selected file path. Syncs the tree highlight, Code source, and preview. */
2126
- activeFile?: string;
2127
- /** iframe `sandbox` override. Secure default `allow-scripts allow-forms` (NOT `allow-same-origin`). */
2128
- sandbox?: string;
2129
- /** Accessible title for the preview iframe. */
2130
- iframeTitle?: string;
2131
- /** Reflects the artifact's own maximized view-state (usually driven by the protocol). */
2132
- maximized?: boolean;
2133
- /** Show the expand-to-fill button (OPT-IN). */
2134
- expandable?: boolean;
2135
- /** Show the open-in-new-tab button (OPT-IN). */
2136
- openInTab?: boolean;
2137
- /** Hide back/forward. */
2138
- noNav?: boolean;
2139
- /** Hide reload. */
2140
- noReload?: boolean;
2141
- /** Hide home. */
2142
- noHome?: boolean;
2143
- /** Hide the address field. */
2144
- noPathField?: boolean;
2145
- /** Hide the Preview|Code toggle. */
2146
- noTabs?: boolean;
2147
- /** Standalone chrome: rounded corners + border (else square, borderless in-panel). */
2148
- standalone?: boolean;
2149
- /** Show the address but make it read-only (visible, nav-tracking, non-editable). */
2150
- readonlyPath?: boolean;
2151
- /** 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. */
2152
- displayUrl?: string;
2153
- }
2154
-
2155
- export interface KaiAttachmentsElementProps {
2156
- /** Color mode (`auto` follows prefers-color-scheme). */
2157
- theme?: "light" | "dark" | "auto";
2158
- /** 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). Each item's `url` must be a `data:` URI or an https URL, never `URL.createObjectURL`: a `blob:` URL previews here but the wire encoders (`toOpenAIMessages`/`toAnthropicMessages`) refuse it. */
2159
- items?: { id: string; type: "file" | "source-document"; filename?: string; mediaType?: string; url?: string; title?: string }[];
2160
- /** Layout: `grid` = visual tiles, `inline` = icon + label chips, `list` = rows. */
2161
- variant?: "grid" | "inline" | "list";
2162
- /** Wrap each item in a hover card that previews its details. */
2163
- hoverCard?: boolean;
2164
- /** Show a remove button per item; clicking it fires a `kai-remove` event. */
2165
- removable?: boolean;
2166
- /** Also show the media type beneath the filename (non-grid variants). */
2167
- showMediaType?: boolean;
2168
- /** Text shown when `items` is empty. */
2169
- emptyText?: string;
2170
- }
2171
-
2172
- export interface KaiAudioVisualizerElementProps {
2173
- /** Color mode (`auto` follows prefers-color-scheme). */
2174
- theme?: "light" | "dark" | "auto";
2175
- /** Look to render: `bar` (default), `grid`, `radial`, `wave`, `aurora`, `custom`. `aura` is accepted as a LiveKit-markup alias for `aurora`. Attribute: `variant`. */
2176
- variant?: string;
2177
- /** `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`. */
2178
- state?: string;
2179
- /** `icon` | `sm` | `md` (default) | `lg` | `xl`. Attribute: `size`. */
2180
- size?: string;
2181
- /** Bars to draw. Bar and radial only. Attribute: `bar-count`. */
2182
- barCount?: number;
2183
- /** Grid only: rows and columns of the (always square) grid. Attribute: `count`. */
2184
- count?: number;
2185
- /** Radial only: ring distance from center, in px. Attribute: `radius`. */
2186
- radius?: number;
2187
- /** Grid only: ring distance for the connecting animation, in cells. Attribute: `spread`. */
2188
- spread?: number;
2189
- /** Grid only: ms between scripted frames. Attribute: `interval`. */
2190
- interval?: number;
2191
- /** CSS color for the geometry, overriding the inherited `currentColor`. Attribute: `color`. */
2192
- color?: string;
2193
- /** Shader variants only: pattern density, 0..1. Attribute: `complexity`. */
2194
- complexity?: number;
2195
- /** Setting this makes the element an announced image (`role="img"`) instead of decorative (`aria-hidden`). Attribute: `label`. */
2196
- label?: string;
2197
- /** Live microphone or WebRTC audio to analyze. JS property only. NOTE: amplitude renders only while state is "speaking" unless listening-amplitude is set; every other state plays its scripted animation and ignores the audio. */
2198
- stream?: MediaStream;
2199
- /** An `<audio>` or `<video>` element to tap for its audio. JS property only. NOTE: amplitude renders only while state is "speaking" unless listening-amplitude is set; every other state plays its scripted animation and ignores the audio. */
2200
- audioElement?: HTMLMediaElement;
2201
- /** 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. NOTE: amplitude renders only while state is "speaking" unless listening-amplitude is set; every other state plays its scripted animation and ignores the audio. */
2202
- bands?: number[];
2203
- /** Render live amplitude during the listening state as well, using the same presentation as speaking. Off by default, which keeps LiveKit parity: amplitude from stream, audio-element or bands renders only while state is "speaking". Set it to show a real mic-level picture while the user is the one talking. Boolean. Attribute: `listening-amplitude` (a bare attribute means true; reflected, so the property reads back what the attribute set). */
2204
- listeningAmplitude?: boolean;
2205
- /** Custom fragment shader for `variant="custom"`. JS property only. */
2206
- shader?: { fragment: string; uniforms?: Record<string, { type: "1f" | "1i" | "1fv" | "2f" | "3f" | "3fv" | "4f" | "4fv" | "Matrix2fv" | "Matrix3fv" | "Matrix4fv"; value: number | number[] }> };
2207
- /** 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`. */
2208
- animateWhenNotVisible?: boolean;
2209
- }
2210
-
2211
- export interface KaiAvatarElementProps {
2212
- /** Color mode (`auto` follows prefers-color-scheme). */
2213
- theme?: "light" | "dark" | "auto";
2214
- /** Image URL/data-URI. When absent, the `fallback` initials show instead. */
2215
- src?: string;
2216
- /** Alt text for the image. Defaults to `fallback`. */
2217
- alt?: string;
2218
- /** Short text shown when there's no image, usually initials (e.g. "JD", "AI"). */
2219
- fallback?: string;
2220
- /** Size token: `sm` | `md` (default) | `lg`. */
2221
- size?: "sm" | "md" | "lg";
2222
- }
2223
-
2224
- export interface KaiBadgeElementProps {
2225
- /** Color mode (`auto` follows prefers-color-scheme). */
2226
- theme?: "light" | "dark" | "auto";
2227
- /** `default` (muted pill) · `count` (compact number badge) · `citation` (filled primary, for inline citation markers). Defaults to `default`. */
2228
- variant?: "default" | "count" | "citation";
2229
- }
2230
-
2231
- export interface KaiButtonElementProps {
2232
- /** Color mode (`auto` follows prefers-color-scheme). */
2233
- theme?: "light" | "dark" | "auto";
2234
- /** Visual style. `default` (filled), `subtle` (muted text, hover tint, the toolbar icon look), `ghost` (transparent, hover fill), `outline`, or `destructive`. Defaults to `default`. */
2235
- variant?: "default" | "subtle" | "ghost" | "outline" | "destructive";
2236
- /** Size token. `icon` / `icon-sm` are square (for icon-only buttons); `sm` / `md` / `lg` size text buttons. Defaults to `md`. */
2237
- size?: "sm" | "md" | "lg" | "icon" | "icon-sm";
2238
- /** Leading icon: a named icon (e.g. `"mic"`, `"plus"`), an image URL/data-URI, or plain text. Renders before any slotted label. */
2239
- icon?: string;
2240
- /** Trailing icon, after the label (e.g. `"chevron-down"` for a menu affordance). */
2241
- iconTrailing?: string;
2242
- /** Accessible name. REQUIRED for icon-only buttons (no visible text); ignored when you slot visible text, which already names the button. An `aria-label` on top of visible text REPLACES that name rather than adding to it, so a button reading "Save" that answers to "Submit" is unusable by speech input (WCAG 2.5.3, Label in Name). The visible text wins. An `icon` / `icon-sm` size hides the slot, which makes the button icon-only whatever you slotted, so `label` is what names it there. */
2243
- label?: string;
2244
- /** Disable the button (non-interactive, dimmed). */
2245
- disabled?: boolean;
2246
- /** Stretch the button to the full width of its container (a block button), e.g. a card CTA or a stacked action. Attribute: `full`. */
2247
- full?: boolean;
2248
- /** Justify the button's content: `start`, `center` (default), or `end`. Combine with `full` for a full-width, left-aligned button. */
2249
- align?: "start" | "center" | "end";
2250
- /** Native button `type`. Defaults to `button` (so it never submits a form). */
2251
- type?: "button" | "submit" | "reset";
2252
- }
2253
-
2254
- export interface KaiCardElementProps {
2255
- /** Color mode (`auto` follows prefers-color-scheme). */
2256
- theme?: "light" | "dark" | "auto";
2257
- /** Surface treatment: `outlined` (default) | `filled` | `plain` | `accent`. Attribute: `appearance`. */
2258
- appearance?: "outlined" | "filled" | "plain" | "accent";
2259
- /** `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`. */
2260
- orientation?: "vertical" | "horizontal" | "responsive";
2261
- /** The card width below which a `responsive` card collapses to vertical and the footer actions stack. A CSS length; default `28rem`. Attribute: `collapse`. */
2262
- collapse?: string;
2263
- /** Tighter spacing for dense lists. Attribute: `dense`. */
2264
- dense?: boolean;
2265
- /** Show a close (×) that hides the card and emits `kai-dismiss`. Attribute: `dismissible`. Off by default. */
2266
- dismissible?: boolean;
2267
- /** Render the whole card as a link. Attribute: `href`. Wins over `clickable`. */
2268
- href?: string;
2269
- /** `target` for the `href` anchor. Attribute: `target`. */
2270
- target?: string;
2271
- /** `rel` for the `href` anchor. Attribute: `rel`. */
2272
- rel?: string;
2273
- /** Make the whole card a button (`role="button"`, Enter/Space, hover affordance) that emits `kai-card-click`. Attribute: `clickable`. Ignored when `href` is set. */
2274
- clickable?: boolean;
2275
- }
2276
-
2277
- export interface KaiCardsElementProps {
2278
- /** Color mode (`auto` follows prefers-color-scheme). */
2279
- theme?: "light" | "dark" | "auto";
2280
- /** The stream of card envelopes to render. Set as a JS PROPERTY: `el.cards = [...]`. */
2281
- 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 } }[];
2282
- /** 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. */
2283
- types?: Record<string, string>;
2284
- /** 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. */
2285
- schemas?: Record<string, object>;
2286
- /** Optional CardPolicy handling child events. Property: `el.policy`. */
2287
- 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" };
2288
- /** 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. */
2289
- validateCards?: boolean;
2290
- }
2291
-
2292
- export interface KaiChainOfThoughtElementProps {
2293
- /** Color mode (`auto` follows prefers-color-scheme). */
2294
- theme?: "light" | "dark" | "auto";
2295
- /** 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. */
2296
- steps?: { label: string; content?: string; id?: string }[];
2297
- /** Open mode: `'multiple'` (default, any number of steps open at once) or `'single'` (at most one open; opening a step closes the others). */
2298
- type?: "single" | "multiple";
2299
- /** 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. */
2300
- value?: string | string[];
2301
- /** Uncontrolled INITIAL open step key(s), seeding which steps render expanded. Ignored once `value` is provided. Set as a JS property. */
2302
- defaultValue?: string | string[];
2303
- }
2304
-
2305
- export interface KaiChatElementProps {
2306
- /** Color mode (`auto` follows prefers-color-scheme). */
2307
- theme?: "light" | "dark" | "auto";
2308
- /** 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. */
2309
- value?: string | ({ type: "text"; text: string } | { type: "entity"; entity: { kind: string; id: string; label: string; icon?: string; promptText?: string; data?: Record<string, unknown> } })[];
2310
- /** Placeholder text shown in the empty input. */
2311
- placeholder?: string;
2312
- /** When true, shows the loading/streaming state and disables submit (use while awaiting the assistant's reply). */
2313
- loading?: boolean;
2314
- /** Starter prompts shown above the input when the thread is empty. Clicking one follows `suggestionMode`. Set as a JS property. */
2315
- suggestions?: string[];
2316
- /** What clicking a suggestion does: `'submit'` (default) sends it immediately as if typed and submitted; `'fill'` just places it in the input. */
2317
- suggestionMode?: "submit" | "fill";
2318
- /** 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. */
2319
- persistSuggestions?: boolean;
2320
- /** Body/prose font scale for rendered markdown (`'xs' | 'sm' | 'base' | 'lg'`). Defaults to `'sm'`. */
2321
- proseSize?: "xs" | "sm" | "base" | "lg";
2322
- /** Shiki theme name for syntax-highlighted code blocks (e.g. `'github-dark-dimmed'`). */
2323
- codeTheme?: string;
2324
- /** Enable Shiki syntax highlighting in code blocks. Turn off to render plain `<pre>` blocks (lighter, no highlighter load). Default true. */
2325
- codeHighlight?: boolean;
2326
- /** How `reasoning` parts render across the thread. `'full'` (default) is the current collapsible-disclosure behavior; `'compact'` shows only a shimmer loader while a reasoning part streams and nothing once it settles (no expandable detail); `'off'` renders reasoning parts not at all. Forwarded to every `MessageBody` as `reasoningMode`. */
2327
- reasoning?: "full" | "compact" | "off";
2328
- /** Seeds the reasoning disclosure open AND keeps it tracking the stream (open while streaming, closes when it settles): the pre-Task-19f `full` behavior. Default false/absent: the panel starts closed (just the "Thinking" shimmer chip) and only opens on click, the current default (owner ruling, 2026-08-26). Meaningless when `reasoning` is `'compact'` or `'off'`. Forwarded to every `MessageBody` as `reasoningDefaultOpen`. */
2329
- reasoningOpen?: boolean;
2330
- /** Optional header title shown on the left of the header. */
2331
- chatTitle?: string;
2332
- /** Optional model list. When set (>1 model) a ModelSwitcher is shown in the header and a `kai-model-change` event fires on selection. */
2333
- models?: { id: string; name: string; provider?: string; description?: string; group?: string }[];
2334
- /** The currently selected model id (pairs with `models`). */
2335
- currentModel?: string;
2336
- /** Optional context-window token usage. When set, a Context token meter is shown in the header. */
2337
- context?: { usedTokens: number; maxTokens: number; inputTokens?: number; outputTokens?: number; estimatedCost?: number };
2338
- /** Show the scroll-to-bottom button inside the scroll area. Default true. */
2339
- scrollButton?: boolean;
2340
- /** 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. */
2341
- headerStart?: boolean;
2342
- /** Whether the host has `slot="header-end"` content (right of the controls). */
2343
- headerEnd?: boolean;
2344
- /** REPLACE: full custom header in place of the built-in title/model/context bar. */
2345
- headerFull?: boolean;
2346
- /** INJECT: left sidebar column (e.g. a conversation list / your own nav). */
2347
- sidebar?: boolean;
2348
- /** 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). */
2349
- empty?: boolean;
2350
- /** REPLACE: full custom composer in place of the built-in prompt input. The projected content wires its own submit (the data-flow boundary). */
2351
- composer?: boolean;
2352
- /** INJECT: accessory row just above the composer (e.g. extra actions). */
2353
- composerActions?: boolean;
2354
- /** INJECT: footer row below the composer (disclaimers, token meter, …). */
2355
- footer?: boolean;
2356
- /** When `false`, hides the built-in paperclip attach button. Defaults to `true` (undeclared keeps today's behavior: attach visible), matching `DefaultPromptInput`'s own default: only an explicit `false` hides it. */
2357
- attach?: boolean;
2358
- /** Show a web-search (Globe) button in the input toolbar; calls `onWebSearch`. */
2359
- webSearch?: boolean;
2360
- /** Show a Voice (Mic) button in the input toolbar; fires a `voice` event. */
2361
- voice?: boolean;
2362
- /** 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. */
2363
- triggers?: { char: string; kind: string; items?: { id: string; label: string; icon?: string; description?: string; group?: string; kind?: string; promptText?: string; data?: Record<string, unknown> }[] }[];
2364
- /** Default icon per entity kind (kind → image src) for pills/menu items. */
2365
- kindIcons?: Record<string, string>;
2366
- /** Whether each message's action bar is always visible (`'always'`, default) or only revealed on hover of that message row (`'hover'`). */
2367
- actionsReveal?: "always" | "hover";
2368
- /** Which attachment media types the user may stage, in HTML `accept` syntax: `<kai-chat accept="image/*,application/pdf">`. A plain string, so unlike `messages` it DOES work as an attribute. Omitted means no filter. MEDIA TYPES ONLY -- exact (`image/png`) or subtype wildcard (`text/*`). HTML allows a file extension here and this does not: `accept=".py"` THROWS with the entry named, rather than silently resolving to a picker that accepts nothing. It can only NARROW what the kit can already encode: `accept="image/*"` resolves to the four image formats both APIs take, not to every image type the OS offers. Pass the SAME string to `toOpenAIMessages(msgs, { accept })` and the picker and the wire cannot disagree -- both resolve it through `resolveMediaPolicy` against one declaration. That declaration is readable as `encodableMediaTypes()` from `@kitn.ai/ui/wire`, if you would rather build your own picker than use this prop. */
2369
- accept?: string;
2370
- /** 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>`. */
2371
- 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" }[];
2372
- /** 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. */
2373
- cardTypes?: Record<string, string>;
2374
- /** 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. */
2375
- cardSchemas?: Record<string, object>;
2376
- }
2377
-
2378
- export interface KaiCheckboxElementProps {
2379
- /** Color mode (`auto` follows prefers-color-scheme). */
2380
- theme?: "light" | "dark" | "auto";
2381
- /** Controlled checked state. Settable and reflected to the `checked` attribute. `el.checked = true` (or `<kai-checkbox checked>`) drives it; ticking the box updates it and fires `kai-change`. Read `el.checked` for live state. */
2382
- checked?: boolean;
2383
- /** Initial checked state on mount (uncontrolled seed). Bare attribute (`<kai-checkbox default-checked>`) turns it on. */
2384
- defaultChecked?: boolean;
2385
- /** The mixed state, for a parent box whose children are partly ticked. Visual plus an accessibility hint: the box still reports `checked === false`. */
2386
- indeterminate?: boolean;
2387
- /** Disable interaction. */
2388
- disabled?: boolean;
2389
- /** Set the native `required` attribute, and nothing more. Whether an unticked box is an error is the application's rule, not the kit's. */
2390
- required?: boolean;
2391
- /** Accessible label. The visible text beside the box is the consumer's to render. */
2392
- label?: string;
2393
- /** Form-control name (paired with `value`). */
2394
- name?: string;
2395
- /** Submitted value when checked (paired with `name`). Defaults to `'on'`. */
2396
- value?: string;
2397
- }
2398
-
2399
- export interface KaiCheckboxGroupElementProps {
2400
- /** Color mode (`auto` follows prefers-color-scheme). */
2401
- theme?: "light" | "dark" | "auto";
2402
- /** The choices, top to bottom. Set as a JS PROPERTY (array), never an attribute. Rendered in full: the kit never truncates, re-orders or de-duplicates them. */
2403
- options: { value: string; label: string; description?: undefined | string; disabled?: undefined | boolean }[];
2404
- /** The FIRST selected value. Settable and reflected to the `value` attribute, so `:host([value])` and `el.value` see live state, and a seed can be written in markup. Writing it makes that the whole selection; to read or drive the rest, use `el.values`. */
2405
- value?: string;
2406
- /** The shared form-control name every box carries, so `FormData.getAll(name)` reads the whole selection back under one key. NO DEFAULT, unlike `<kai-radio-group>`. A radio set needs a shared `name` for the browser to make it exclusive and arrow-navigable, so one is generated when none is given; checkboxes are independent controls and behave correctly with no name at all. Generating one here would submit the selection under a random key, which is worse than submitting nothing. The element is NOT form-associated (no `ElementInternals`, no `setFormValue()`), the same known gap `<kai-input>` records: the boxes live in a shadow root, so a surrounding `<form>` collects nothing from them whether or not `name` is set. Read `el.values`. The name still lands on every inner input, so it is right the day form association arrives. */
2407
- name?: string;
2408
- /** Disable every row. Individual rows carry their own `disabled`. */
2409
- disabled?: boolean;
2410
- /** Accessible name for the group. */
2411
- label?: string;
2412
- }
2413
-
2414
- export interface KaiCheckpointElementProps {
2415
- /** Color mode (`auto` follows prefers-color-scheme). */
2416
- theme?: "light" | "dark" | "auto";
2417
- /** Optional text beside the icon. */
2418
- label?: string;
2419
- /** Tooltip on hover. */
2420
- tooltip?: string;
2421
- /** Visual button style. */
2422
- variant?: "ghost" | "default" | "outline";
2423
- /** Button size (use an `icon*` size for an icon-only checkpoint). */
2424
- size?: "sm" | "md" | "lg" | "icon" | "icon-sm";
2425
- }
2426
-
2427
- export interface KaiChoiceElementProps {
2428
- /** Color mode (`auto` follows prefers-color-scheme). */
2429
- theme?: "light" | "dark" | "auto";
2430
- /** 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. */
2431
- 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 };
2432
- /** Stable card id correlating every emitted CardEvent. Attribute: `card-id`. */
2433
- cardId?: string;
2434
- /** Heading rendered in the card chrome (= CardEnvelope.title). Attribute: `heading`. */
2435
- heading?: string;
2436
- /** Set when the user resolved this card; renders the read-only view. Property: `el.resolution = { kind:'action', action:'…' }`. */
2437
- resolution?: Record<string, unknown>;
2438
- /** Controlled selection: the selected option id. When set, the consumer owns the current pick (RadioGroup `value`). Attribute: `value`. */
2439
- value?: string;
2440
- /** Option id to pre-select on mount (uncontrolled seed). Attribute: `default-value`. */
2441
- defaultValue?: string;
2442
- /** Disable the whole radiogroup + Submit (e.g. while the agent is busy). Attribute: `disabled`. */
2443
- disabled?: boolean;
2444
- }
2445
-
2446
- export interface KaiCoachmarkElementProps {
2447
- /** Color mode (`auto` follows prefers-color-scheme). */
2448
- theme?: "light" | "dark" | "auto";
2449
- /** 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`. */
2450
- open?: boolean;
2451
- /** Initial open state on mount (uncontrolled seed). */
2452
- defaultOpen?: boolean;
2453
- /** The bold title. Named `headline` because `title` collides with the global `HTMLElement.title` attribute (it throws at registration). */
2454
- headline?: string;
2455
- /** A small badge pill beside the headline (e.g. "New"). */
2456
- badge?: string;
2457
- /** Floating placement relative to the anchor (default `bottom`). */
2458
- placement?: string;
2459
- /** Color tone: `primary` (default, theme accent), `info` (blue), `success` (green), `warning` (amber), or `error` (red), reusing the kit's tool hues. */
2460
- tone?: "primary" | "info" | "success" | "warning" | "error";
2461
- /** Render the arrow that points at the anchor (default `true`). Set `arrow="false"` for a plain bubble with no pointer. */
2462
- arrow?: boolean;
2463
- }
2464
-
2465
- export interface KaiCodeBlockElementProps {
2466
- /** Color mode (`auto` follows prefers-color-scheme). */
2467
- theme?: "light" | "dark" | "auto";
2468
- /** The source code to render. */
2469
- code: string;
2470
- /** Language grammar (e.g. `js`, `python`). Defaults to `tsx`. */
2471
- language?: string;
2472
- /** Shiki theme name. */
2473
- codeTheme?: string;
2474
- /** Disable syntax highlighting (renders plain text, no Shiki). */
2475
- codeHighlight?: boolean;
2476
- /** Show the copy button. **Defaults to ON**, because this element is documented as shipping one. Opt out with `copy="false"` or `el.copy = false`. */
2477
- copy?: boolean;
2478
- /** Code text sizing. */
2479
- proseSize?: "xs" | "sm" | "base" | "lg";
2480
- }
2481
-
2482
- export interface KaiCommandElementProps {
2483
- /** Color mode (`auto` follows prefers-color-scheme). */
2484
- theme?: "light" | "dark" | "auto";
2485
- /** Flat list of items. Set as a JS property, not an HTML attribute. */
2486
- items?: { id: string; label: string; icon?: string; description?: string; shortcut?: string; group?: string }[];
2487
- /** Placeholder text for the search input. */
2488
- placeholder?: string;
2489
- /** Label shown when no items match the current query. */
2490
- emptyLabel?: string;
2491
- }
2492
-
2493
- export interface KaiCompareElementProps {
2494
- /** Color mode (`auto` follows prefers-color-scheme). */
2495
- theme?: "light" | "dark" | "auto";
2496
- /** 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. */
2497
- data?: Record<string, unknown>;
2498
- /** Stable id correlating every emitted event. Attribute: `compare-id`. */
2499
- compareId?: string;
2500
- /** Re-hydrate / control the user's pick. Set as a JS PROPERTY: `el.selection = { chosenId, rejectedIds }`. Renders the collapsed winner. */
2501
- selection?: Record<string, unknown>;
2502
- /** Layout: `'auto'` (default, columns when wide, tabs when narrow, by CONTAINER width) | `'columns'` (side-by-side) | `'tabs'` (pills to switch). Attribute: `layout`. */
2503
- layout?: "auto" | "columns" | "tabs";
2504
- /** Prose/text size for the rendered candidates. Attribute: `prose-size`. */
2505
- proseSize?: "xs" | "sm" | "base" | "lg";
2506
- /** Shiki theme for code blocks in the candidates. Attribute: `code-theme`. */
2507
- codeTheme?: string;
2508
- /** Whether code blocks are syntax-highlighted. Attribute: `code-highlight`. */
2509
- codeHighlight?: boolean;
2510
- }
2511
-
2512
- export interface KaiComposerElementProps {
2513
- /** Color mode (`auto` follows prefers-color-scheme). */
2514
- theme?: "light" | "dark" | "auto";
2515
- /** Controlled value: a string or a full ComposerDoc (set as JS property). */
2516
- value?: string | ({ type: "text"; text: string } | { type: "entity"; entity: { kind: string; id: string; label: string; icon?: string; promptText?: string; data?: Record<string, unknown> } })[];
2517
- /** Placeholder text shown when the composer is empty. */
2518
- placeholder?: string;
2519
- /** Disable the composer entirely (non-interactive). */
2520
- disabled?: boolean;
2521
- /** Show a loading/streaming state and block submit. */
2522
- loading?: boolean;
2523
- /** Maximum height in px before the content scrolls. Default 240. */
2524
- maxHeight?: number | string;
2525
- /** Whether pressing Enter (without Shift) submits. Default true. */
2526
- submitOnEnter?: boolean;
2527
- /** Trigger definitions. Set as a JS property. */
2528
- triggers?: { char: string; kind: string; items?: { id: string; label: string; icon?: string; description?: string; group?: string; kind?: string; promptText?: string; data?: Record<string, unknown> }[] }[];
2529
- /** Keyword highlight rules. Set as a JS property. */
2530
- highlights?: (string | { pattern: string; flags?: string; class?: string })[];
2531
- /** 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. */
2532
- kindIcons?: Record<string, string>;
2533
- }
2534
-
2535
- export interface KaiConfirmElementProps {
2536
- /** Color mode (`auto` follows prefers-color-scheme). */
2537
- theme?: "light" | "dark" | "auto";
2538
- /** 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. */
2539
- data?: { heading?: string; body?: string; tone?: "default" | "warning" | "danger"; actions: { id: string; label: string; style?: "primary" | "default" | "destructive"; payload?: unknown; default?: boolean }[]; dismissible?: boolean };
2540
- /** Stable card id correlating every emitted CardEvent. Attribute: `card-id`. */
2541
- cardId?: string;
2542
- /** Heading rendered in the card chrome (= CardEnvelope.title). Attribute: `heading`. */
2543
- heading?: string;
2544
- /** Focus the default action on mount (off by default, so nothing steals focus). Attribute: `autofocus`. */
2545
- autofocus?: boolean;
2546
- /** Set when the user resolved this card; renders the read-only view. Property: `el.resolution = { kind:'action', action:'…' }`. */
2547
- resolution?: Record<string, unknown>;
2548
- }
2549
-
2550
- export interface KaiContextElementProps {
2551
- /** Color mode (`auto` follows prefers-color-scheme). */
2552
- theme?: "light" | "dark" | "auto";
2553
- /** Token-usage data. Set as a JS property. */
2554
- context?: { usedTokens: number; maxTokens: number; inputTokens?: number; outputTokens?: number; reasoningTokens?: number; cacheTokens?: number; estimatedCost?: number };
2555
- /** Fraction (0–1) above which the meter turns yellow. Defaults to `0.7` (70%). */
2556
- warnThreshold?: number;
2557
- /** Fraction (0–1) above which the meter turns red. Defaults to `0.9` (90%). */
2558
- dangerThreshold?: number;
2559
- }
2560
-
2561
- export interface KaiConversationItemElementProps {
2562
- /** Color mode (`auto` follows prefers-color-scheme). */
2563
- theme?: "light" | "dark" | "auto";
2564
- /** The row's identity: the `conversation-id` attribute (host `id` is the fallback). Inside `<kai-conversations>` it is handed to the container's selection contract (`kai-conversation-select`); standalone it is the `id` in this element's own `kai-select` detail. */
2565
- conversationId?: string;
2566
- /** Selected state. Reflected as `aria-current` on the row body and a `data-active` styling hook on the row; inside a container the container drives it from its `activeId`, standalone you set it yourself. */
2567
- active?: boolean;
2568
- /** Dense single-line row padding. */
2569
- compact?: boolean;
2570
- }
2571
-
2572
- export interface KaiConversationsElementProps {
2573
- /** Color mode (`auto` follows prefers-color-scheme). */
2574
- theme?: "light" | "dark" | "auto";
2575
- /** 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. */
2576
- groups?: { id: string; userId?: string; teamId?: string; name: string; sortOrder: number; createdAt: string }[];
2577
- /** 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. A search query that matches nothing shows a visible "No conversations match your search" state, distinct from the zero-conversations empty state. Slotted `<kai-conversation-item>` children switch the list into item mode instead: your own rows win and this array is not rendered. */
2578
- 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 }[];
2579
- /** The id of the currently-open conversation, highlighted in the list. */
2580
- activeId?: string;
2581
- /** 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. */
2582
- collapsed?: boolean;
2583
- /** Initial collapsed state when uncontrolled (default false). Use the `default-collapsed` attribute to start collapsed in plain HTML. */
2584
- defaultCollapsed?: boolean;
2585
- /** Dense single-line rows (a leading dot + title, no message count). */
2586
- compact?: boolean;
2587
- }
2588
-
2589
- export interface KaiDialogElementProps {
2590
- /** Color mode (`auto` follows prefers-color-scheme). */
2591
- theme?: "light" | "dark" | "auto";
2592
- /** 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`. */
2593
- open?: boolean;
2594
- /** Initial open state on mount (uncontrolled seed). */
2595
- defaultOpen?: boolean;
2596
- /** Accessible name for the modal, used when no `header` slot is projected: `<kai-dialog label="Delete workspace">`. A projected `header` WINS over this (it becomes `aria-labelledby`), because ARIA resolves `aria-labelledby` ahead of `aria-label` and the visible heading is the name both a sighted and a screen-reader user can be talked through. Defaults to `Dialog` so a modal is never nameless. */
2597
- label?: string;
2598
- }
2599
-
2600
- export interface KaiDockElementProps {
2601
- /** Color mode (`auto` follows prefers-color-scheme). */
2602
- theme?: "light" | "dark" | "auto";
2603
- /** Drive/observe open state (Shoelace-style: settable + reflected to the `open` attribute; the element still self-manages on the launcher and Escape). Set `el.open = true`, or `<kai-dock open>`; listen for `kai-open-change`. */
2604
- open?: boolean;
2605
- /** Initial open state on mount (uncontrolled seed). */
2606
- defaultOpen?: boolean;
2607
- /** Which corner the dock sits in. Logical, so `-end` follows the writing direction and an RTL page docks on the left. Attribute: `position`. */
2608
- position?: "bottom-end" | "bottom-start" | "top-end" | "top-start";
2609
- /** The widget's NAME. Derives the panel's accessible name and both launcher names (`Open ${label}` / `Close ${label}`). Defaults to `Chat`. */
2610
- label?: string;
2611
- /** i18n override for the launcher's name while closed (default `Open ${label}`). */
2612
- openLabel?: string;
2613
- /** i18n override for the launcher's name while open (default `Close ${label}`). */
2614
- closeLabel?: string;
2615
- /** Show the unread dot. YOURS: it renders only while closed, and the dock never writes it back. Clear it in your `kai-open-change` handler. */
2616
- unread?: boolean;
2617
- /** Disable the launcher; `show()` and `toggle()` are gated on it. */
2618
- disabled?: boolean;
2619
- /** Suppress the dock's own built-in mobile close X. Set this when your slotted panel content supplies its own close affordance (e.g. a `<kai-chat slot="header-end">` close button), otherwise the two stack. TRADEOFF: the mobile panel reserves a padding band above its content so the built-in X never paints over slotted content; that band stays reserved unless you set this true, so only set it once your own control is actually in place. Attribute: `hide-close`. */
2620
- hideClose?: boolean;
2621
- /** Where focus lands on open: `content` (default, the first element you slotted), `panel`, or `none`. Attribute: `focus-on-open`. */
2622
- focusOnOpen?: "content" | "panel" | "none";
2623
- }
2624
-
2625
- export interface KaiDropdownElementProps {
2626
- /** Color mode (`auto` follows prefers-color-scheme). */
2627
- theme?: "light" | "dark" | "auto";
2628
- /** Built-in trigger: leading icon (a named icon like `"plus"`, an image URL/data-URI, or text). A slotted `slot="trigger"` overrides it. */
2629
- triggerIcon?: string;
2630
- /** Built-in trigger: a text label. This is the trigger's VISIBLE text, so it is also its accessible name, and `label` does not override it: an accessible name that does not contain the visible text is unreachable by speech input (WCAG 2.5.3, Label in Name). Same rule `kai-menu` follows. */
2631
- triggerLabel?: string;
2632
- /** Built-in trigger: a trailing icon (e.g. `"chevron-down"` for a select look). */
2633
- triggerIconTrailing?: string;
2634
- /** Accessible name for a trigger with no visible label. Ignored when `triggerLabel` is set, which is already the visible name. It DOES name a slotted `slot="trigger"`, which is VISUAL content with the name supplied separately: the same two-slot distinction `kai-menu` documents. */
2635
- label?: string;
2636
- /** Stretch the trigger to the full width of its container (a block row). Attribute: `full`. */
2637
- full?: boolean;
2638
- /** 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-dropdown open>`; listen for `kai-open-change`. */
2639
- open?: boolean;
2640
- /** Initial open state on mount (uncontrolled seed). */
2641
- defaultOpen?: boolean;
2642
- /** Disable the trigger: click/keyboard and `show()` no longer open the menu. */
2643
- disabled?: boolean;
2644
- }
2645
-
2646
- export interface KaiEditableLabelElementProps {
2647
- /** Color mode (`auto` follows prefers-color-scheme). */
2648
- theme?: "light" | "dark" | "auto";
2649
- /** The label text. Settable and reflected to the `value` attribute. Read `el.value` for live state. */
2650
- value?: string;
2651
- /** Controlled edit state. `el.editing = true` opens the field; reflected to the `editing` attribute. */
2652
- editing?: boolean;
2653
- /** Placeholder shown while editing / when the value is empty. */
2654
- placeholder?: string;
2655
- /** Disable entering edit mode. */
2656
- disabled?: boolean;
2657
- }
2658
-
2659
- export interface KaiEmbedElementProps {
2660
- /** Color mode (`auto` follows prefers-color-scheme). */
2661
- theme?: "light" | "dark" | "auto";
2662
- /** Stable card id correlating every emitted event. Set as an attribute or property. */
2663
- cardId?: string;
2664
- /** The embed payload (provider + id/url + options). Set as a JS **property** (object). */
2665
- data?: { provider: "youtube" | "vimeo" | "generic"; id?: string; url?: string; title?: string; poster?: string; start?: number; aspectRatio?: "16:9" | "4:3" | "1:1" | "9:16" };
2666
- }
2667
-
2668
- export interface KaiEmptyElementProps {
2669
- /** Color mode (`auto` follows prefers-color-scheme). */
2670
- theme?: "light" | "dark" | "auto";
2671
- /** Title text. Attribute: `empty-title` (`title` is a global HTML attribute). */
2672
- emptyTitle?: string;
2673
- /** Description text. */
2674
- description?: string;
2675
- }
2676
-
2677
- export interface KaiFeedbackBarElementProps {
2678
- /** Color mode (`auto` follows prefers-color-scheme). */
2679
- theme?: "light" | "dark" | "auto";
2680
- /** The banner label (e.g. "Was this helpful?"). Attribute: `bar-title` (`title` is avoided because it is a global HTML attribute). */
2681
- barTitle?: string;
2682
- /** When set, a not-helpful vote opens an optional detail form before the thank-you confirmation. Attribute: `collect-detail`. */
2683
- collectDetail?: boolean;
2684
- /** Optional category chips for the detail form. Set as a JS property (array). */
2685
- categories?: string[];
2686
- /** Heading for the detail form. Attribute: `detail-title`. */
2687
- detailTitle?: string;
2688
- /** Placeholder for the detail comment box. Attribute: `detail-placeholder`. */
2689
- detailPlaceholder?: string;
2690
- /** Submit button label in the detail form. Attribute: `submit-label`. */
2691
- submitLabel?: string;
2692
- /** Confirmation copy shown after a vote/submit. Attribute: `thanks-message`. */
2693
- thanksMessage?: string;
2694
- }
2695
-
2696
- export interface KaiFileTreeElementProps {
2697
- /** Color mode (`auto` follows prefers-color-scheme). */
2698
- theme?: "light" | "dark" | "auto";
2699
- /** The files to render. Set as a JS property (array of `{ path, url?, code?, language?, type?, additions?, deletions?, status? }`). */
2700
- 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" }[];
2701
- /** Selected file path, highlighted in the tree. */
2702
- activeFile?: string;
2703
- /** Folder paths expanded initially. Omit to start with all folders open. */
2704
- defaultExpanded?: string[];
2705
- /** Show a changed-files summary header (file count + summed `+/-` + Collapse-all). Attribute: `summary`. Off by default. */
2706
- summary?: boolean;
2707
- }
2708
-
2709
- export interface KaiFileUploadElementProps {
2710
- /** Color mode (`auto` follows prefers-color-scheme). */
2711
- theme?: "light" | "dark" | "auto";
2712
- /** Allow selecting multiple files (default true). */
2713
- multiple?: boolean;
2714
- /** `accept` attribute for the file picker (e.g. `image/*`). */
2715
- accept?: string;
2716
- /** Disable the dropzone: no clicking, no drag-and-drop. */
2717
- disabled?: boolean;
2718
- /** Default dropzone label (overridable via the default slot). */
2719
- label?: string;
2720
- }
2721
-
2722
- export interface KaiFormElementProps {
2723
- /** Color mode (`auto` follows prefers-color-scheme). */
2724
- theme?: "light" | "dark" | "auto";
2725
- /** 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. */
2726
- 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-format"?: "tel" | "ssn" | "credit-card" | "custom"; "x-kai-mask"?: string; "x-kai-mask-guide"?: string }>; "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" }[] };
2727
- /** Stable card id correlating every emitted CardEvent. Attribute: `card-id`. */
2728
- cardId?: string;
2729
- /** Heading rendered in the card chrome (= CardEnvelope.title). Attribute: `heading`. */
2730
- heading?: string;
2731
- /** Set when the user resolved this card; renders the read-only view. Property: `el.resolution = { kind:'submit', data:{…} }`. */
2732
- resolution?: Record<string, unknown>;
2733
- /** Controlled field values (JS property). When set, it wins over local edits. */
2734
- values?: Record<string, unknown>;
2735
- /** Initial values overlaying the schema defaults (uncontrolled seed; JS property). */
2736
- defaultValues?: Record<string, unknown>;
2737
- /** Disable all fields + submit. Attribute: `disabled`. */
2738
- disabled?: boolean;
2739
- }
2740
-
2741
- export interface KaiHoverCardElementProps {
2742
- /** Color mode (`auto` follows prefers-color-scheme). */
2743
- theme?: "light" | "dark" | "auto";
2744
- /** Delay (ms) before the card opens on hover. Defaults to 0 (focus opens it immediately too). */
2745
- openDelay?: number;
2746
- /** Delay (ms) before it closes after the pointer leaves. Defaults to 300. */
2747
- closeDelay?: number;
2748
- /** Preferred placement: `'top' | 'bottom' | 'left' | 'right'` (+ optional `-start`/`-end`). Defaults to `'bottom'`; flips to stay in view. */
2749
- placement?: string;
2750
- /** 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`. */
2751
- open?: boolean;
2752
- /** Initial open state on mount (uncontrolled seed). */
2753
- defaultOpen?: boolean;
2754
- /** Suppress the hover behavior entirely without unmounting. */
2755
- disabled?: boolean;
2756
- }
2757
-
2758
- export interface KaiIconElementProps {
2759
- /** Color mode (`auto` follows prefers-color-scheme). */
2760
- theme?: "light" | "dark" | "auto";
2761
- /** A curated icon name (e.g. `"mic"`, `"globe"`), an image URL/data-URI, or plain text. */
2762
- name?: string;
2763
- /** Size token: `sm` | `md` (default) | `lg`. */
2764
- size?: "sm" | "md" | "lg";
2765
- }
2766
-
2767
- export interface KaiImageElementProps {
2768
- /** Color mode (`auto` follows prefers-color-scheme). */
2769
- theme?: "light" | "dark" | "auto";
2770
- /** Base64-encoded image data (pair with `media-type`). */
2771
- base64?: string;
2772
- /** Raw image bytes (set as a JS property). */
2773
- bytes?: Uint8Array;
2774
- /** Alt text. */
2775
- alt?: string;
2776
- /** MIME type (default `image/png`). */
2777
- mediaType?: string;
2778
- }
2779
-
2780
- export interface KaiInputElementProps {
2781
- /** Color mode (`auto` follows prefers-color-scheme). */
2782
- theme?: "light" | "dark" | "auto";
2783
- /** Native input type: `text` (default) · `email` · `url` · `search` · `tel` · `password` · `number`. Single-line only. */
2784
- type?: string;
2785
- /** Controlled value, and always the CANONICAL one when a mask is active: digits for `tel` / `ssn` / `credit-card`, the formatted text for `custom`. Settable and reflected to the `value` attribute. `el.value = '5551234567'` drives it (no event) and is re-fitted to the mask on the way in, so the field shows `555-123-4567`. Read `el.value` for live state; the formatted text rides along on every `kai-input` / `kai-change` detail as `formattedValue`. */
2786
- value?: string;
2787
- /** Placeholder shown when empty. */
2788
- placeholder?: string;
2789
- /** Field label, linked to the input. */
2790
- label?: string;
2791
- /** Helper text below the control. */
2792
- hint?: string;
2793
- /** Error text; flips the field invalid (`aria-invalid` + destructive border). */
2794
- error?: string;
2795
- /** Control density: `sm` or `md`. Defaults to `md`. */
2796
- size?: "sm" | "md";
2797
- /** Disable interaction. */
2798
- disabled?: boolean;
2799
- /** Make the input read-only. */
2800
- readonly?: boolean;
2801
- /** Mark the input required. */
2802
- required?: boolean;
2803
- /** Force the invalid state without an `error` string. */
2804
- invalid?: boolean;
2805
- /** Form-control name. */
2806
- name?: string;
2807
- /** Autofill hint forwarded to the inner input (e.g. `email`, `current-password`). */
2808
- autocomplete?: string;
2809
- /** Virtual-keyboard hint forwarded to the inner input (e.g. `numeric`, `email`). */
2810
- inputmode?: string;
2811
- /** Mask pattern: `#` a digit, `@` a letter or digit, `*` an obscurable letter or digit, and every other character a positional literal (`@@@-####` → `CHG-4821`). The literal `default` is the opt-in sentinel: it resolves to the default format of `semantic` (`tel` → `###-###-####`). A bare `semantic` never starts masking on its own, so an opt-in token is what turns tier 2 on. */
2812
- format?: string;
2813
- /** Placeholder guide shown at unfilled positions, aligned position for position with `format`: `mm/dd/yyyy` against `##/##/####`. Spaces are a valid guide character, so a guide of blanks and separators is how a phone field shows its shape without showing letters. Without a guide the field shows only up to the last typed character. A guide is a visual aid, never an accessible name: keep the `hint` text as well. */
2814
- guide?: string;
2815
- /** Semantic field type: `tel` · `ssn` · `credit-card` · `custom`. On its own it sets `inputmode` / `autocomplete` / `spellcheck` / `autocorrect` / `autocapitalize` and decides the canonical value; it never starts masking by itself. */
2816
- semantic?: "credit-card" | "custom" | "ssn" | "tel";
2817
- /** Case folding applied to typed and pasted text: `preserve` (default) · `upper` · `lower`. Attribute: `case-mode`. */
2818
- caseMode?: "preserve" | "upper" | "lower";
2819
- /** What a copy or cut of a masked field puts on the clipboard: `canonical` (default) · `formatted` · `obscured` · `blocked`. Attribute: `copy-policy`. */
2820
- copyPolicy?: "formatted" | "canonical" | "obscured" | "blocked";
2821
- }
2822
-
2823
- export interface KaiKbdElementProps {
2824
- /** Color mode (`auto` follows prefers-color-scheme). */
2825
- theme?: "light" | "dark" | "auto";
2826
- /** 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. */
2827
- keys?: string;
2828
- /** `mac` uses ⌘/⌥, `other` uses Ctrl. `auto` (default) sniffs the OS. */
2829
- platform?: "auto" | "mac" | "other";
2830
- /** Cap size: `sm` or `md`. Defaults to `md`. */
2831
- size?: "sm" | "md";
2832
- }
2833
-
2834
- export interface KaiLinkPreviewElementProps {
2835
- /** Color mode (`auto` follows prefers-color-scheme). */
2836
- theme?: "light" | "dark" | "auto";
2837
- /** Stable card id correlating every emitted event. Set as an attribute or property. */
2838
- cardId?: string;
2839
- /** The link payload (OG metadata). Set as a JS **property** (object). */
2840
- data?: { url: string; title?: string; description?: string; image?: string; imageAlt?: string; favicon?: string; domain?: string; siteName?: string };
2841
- }
2842
-
2843
- export interface KaiLoaderElementProps {
2844
- /** Color mode (`auto` follows prefers-color-scheme). */
2845
- theme?: "light" | "dark" | "auto";
2846
- /** The animation style: `'circular' | 'classic' | 'pulse' | 'pulse-dot' | 'dots' | 'typing' | 'wave' | 'bars' | 'terminal' | 'text-blink' | 'text-shimmer' | 'loading-dots'`. Defaults to `'circular'`. */
2847
- variant?: "circular" | "classic" | "pulse" | "pulse-dot" | "dots" | "typing" | "wave" | "bars" | "terminal" | "text-blink" | "text-shimmer" | "loading-dots";
2848
- /** Loader size: `'sm' | 'md' | 'lg'`. Defaults to `'md'`. */
2849
- size?: "sm" | "md" | "lg";
2850
- /** Label for the text-based variants. */
2851
- text?: string;
2852
- }
2853
-
2854
- export interface KaiMarkdownElementProps {
2855
- /** Color mode (`auto` follows prefers-color-scheme). */
2856
- theme?: "light" | "dark" | "auto";
2857
- /** The markdown source to render. */
2858
- content: string;
2859
- /** Text/markdown sizing. */
2860
- proseSize?: "xs" | "sm" | "base" | "lg";
2861
- /** Shiki theme for fenced code blocks. */
2862
- codeTheme?: string;
2863
- /** Disable syntax highlighting (no Shiki loads). */
2864
- codeHighlight?: boolean;
2865
- }
2866
-
2867
- export interface KaiMenuElementProps {
2868
- /** Color mode (`auto` follows prefers-color-scheme). */
2869
- theme?: "light" | "dark" | "auto";
2870
- /** Tree of menu items. Set as a JS property, not an HTML attribute. */
2871
- items?: { id?: string; label?: string; icon?: string; shortcut?: string; checked?: boolean; radioGroup?: string; disabled?: boolean; separator?: boolean; heading?: boolean; items?: Record<string, unknown>[] }[];
2872
- /** Optional placement hint (unused by the underlying Dropdown which always positions bottom-start, kept for future extension). */
2873
- placement?: string;
2874
- /** 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. */
2875
- triggerIcon?: string;
2876
- /** Built-in trigger: a text label (e.g. `"High"`). This is the trigger's VISIBLE text, so it is also its accessible name, and `label` does not override it: an accessible name that does not contain the visible text is unreachable by speech input, which is what WCAG 2.5.3 (Label in Name) exists for. A slotted `slot="trigger"` replaces this built-in trigger entirely and is named differently; see `label`. */
2877
- triggerLabel?: string;
2878
- /** Built-in trigger: a trailing icon (e.g. `"chevron-down"` for a select look). */
2879
- triggerIconTrailing?: string;
2880
- /** Accessible name for a trigger with no visible label. Ignored when `triggerLabel` is set, which is already the visible name. It DOES name a slotted `slot="trigger"`, and that is a difference in what the two slots MEAN, not a limitation. `<kai-button>`'s slot IS the button's label, so text slotted there is the name and `label` steps aside. This slot is VISUAL content, a `+` or an `<svg>`, with the name supplied separately: decoration beside a name, never a second name competing with one. So `label` names the trigger here by design. Slotting a real WORD rather than a glyph makes that word a visible label, and an accessible name has to contain the visible text. Then either drop `label` or make it contain the word you slotted. */
2881
- label?: string;
2882
- /** Stretch the trigger to the full width of the menu's container (a block row), e.g. a sidebar-footer account row. Same affordance as `<kai-button full>`. Attribute: `full`. */
2883
- full?: boolean;
2884
- /** 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`. */
2885
- open?: boolean;
2886
- /** Initial open state on mount (uncontrolled seed). */
2887
- defaultOpen?: boolean;
2888
- /** Disable the trigger: click/keyboard and `show()` no longer open the menu. */
2889
- disabled?: boolean;
2890
- }
2891
-
2892
- export interface KaiMessageElementProps {
2893
- /** Color mode (`auto` follows prefers-color-scheme). */
2894
- theme?: "light" | "dark" | "auto";
2895
- /** The full message object. Set as a JS property. */
2896
- 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" };
2897
- /** 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. */
2898
- role?: "user" | "assistant";
2899
- /** Force markdown on/off. Defaults to on for assistant, off for user. */
2900
- markdown?: boolean;
2901
- /** Text/markdown sizing for the message body. */
2902
- proseSize?: "xs" | "sm" | "base" | "lg";
2903
- /** Shiki theme name used for fenced code blocks in the content. */
2904
- codeTheme?: string;
2905
- /** Disable syntax highlighting for code blocks (no Shiki loads). */
2906
- codeHighlight?: boolean;
2907
- /** Whether the action bar is always visible (`'always'`, default) or only revealed on hover of the message row (`'hover'`). */
2908
- actionsReveal?: "always" | "hover";
2909
- /** Convenience avatar image URL (used when `message.avatar` is not set). */
2910
- avatarSrc?: string;
2911
- /** Convenience avatar fallback text (used when `message.avatar` is not set). */
2912
- avatarFallback?: string;
2913
- /** 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). */
2914
- avatar?: string;
2915
- /** 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. */
2916
- cardTypes?: Record<string, string>;
2917
- /** 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. */
2918
- cardSchemas?: Record<string, object>;
2919
- }
2920
-
2921
- export interface KaiModelSwitcherElementProps {
2922
- /** Color mode (`auto` follows prefers-color-scheme). */
2923
- theme?: "light" | "dark" | "auto";
2924
- /** 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. */
2925
- models?: { id: string; name: string; provider?: string; description?: string; group?: string }[];
2926
- /** The currently-selected model id. Defaults to the first model. */
2927
- currentModel?: string;
2928
- /** 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`. */
2929
- open?: boolean;
2930
- /** Initial open state on mount (uncontrolled seed). */
2931
- defaultOpen?: boolean;
2932
- /** Disable the trigger: click/keyboard and `show()` no longer open the dropdown. */
2933
- disabled?: boolean;
2934
- }
2935
-
2936
- export interface KaiNavElementProps {
2937
- /** Color mode (`auto` follows prefers-color-scheme). */
2938
- theme?: "light" | "dark" | "auto";
2939
- /** 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. */
2940
- 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 }[];
2941
- /** Active item id (controlled). */
2942
- value?: string;
2943
- /** Initial active id when uncontrolled. */
2944
- defaultValue?: string;
2945
- /** Ids of group items collapsed on first render (groups default to expanded). Set as a JS property (array). */
2946
- defaultCollapsed?: string[];
2947
- }
2948
-
2949
- export interface KaiNoticeElementProps {
2950
- /** Color mode (`auto` follows prefers-color-scheme). */
2951
- theme?: "light" | "dark" | "auto";
2952
- /** `neutral` (default) · `info` · `warning` · `error` · `success`. Drives the leading icon's color and the a11y role (`alert` for errors, else `status`). */
2953
- severity?: "neutral" | "info" | "warning" | "error" | "success";
2954
- /** Leading icon: omit for the severity default, `"none"` to hide it, or a named icon to override. */
2955
- icon?: string;
2956
- /** Show a dismiss (×) that hides the notice and emits `kai-dismiss`. */
2957
- dismissible?: boolean;
2958
- }
2959
-
2960
- export interface KaiPaneElementProps {
2961
- /** Color mode (`auto` follows prefers-color-scheme). */
2962
- theme?: "light" | "dark" | "auto";
2963
- /** The pane title (the agent / window name). Named `headline` because `title` collides with the global `HTMLElement.title` attribute (it throws at registration). Attribute: `headline`. */
2964
- headline?: string;
2965
- /** A role / label shown under the title (e.g. "Reviewer", "claude-sonnet"). Attribute: `subtitle`. */
2966
- subtitle?: string;
2967
- /** Show the restore glyph instead of maximize, and signal the maximized view-state. Drive it yourself in response to `kai-maximize`. Attribute: `maximized`. */
2968
- maximized?: boolean;
2969
- /** Highlight the frame with a ring/border to mark the ACTIVE pane. Attribute: `focused`. */
2970
- focused?: boolean;
2971
- /** Show a split-pane window control that fires `kai-split`. Off by default. Attribute: `show-split`. */
2972
- showSplit?: boolean;
2973
- /** Show a dock-to-side window control that fires `kai-dock`. Off by default. Attribute: `show-dock`. */
2974
- showDock?: boolean;
2975
- /** A tone-colored status dot (+ optional label) in the header. An object `{ tone, label?, pulse? }` set as a JS PROPERTY (not an attribute). */
2976
- status?: { tone: "working" | "idle" | "done" | "error" | "blocked"; label?: string; pulse?: boolean };
2977
- }
2978
-
2979
- export interface KaiPaneGridElementProps {
2980
- /** Color mode (`auto` follows prefers-color-scheme). */
2981
- theme?: "light" | "dark" | "auto";
2982
- /** Minimum width of every pane, in px, before columns drop / the grid scrolls. Defaults to `280`. Attribute: `min-pane-width`. */
2983
- minPaneWidth?: number;
2984
- /** Minimum height of every pane, in px, before the grid scrolls vertically. Defaults to `200`. Attribute: `min-pane-height`. */
2985
- minPaneHeight?: number;
2986
- /** Column cap when the container is wide (default `3`). Attribute: `max-columns`. */
2987
- maxColumns?: number;
2988
- /** Gap between panes, any CSS length. Defaults to the kit gap (`var(--kai-pane-grid-gap, 0.5rem)`). Attribute: `gap`. */
2989
- gap?: string;
2990
- /** When set to a valid child index, render ONLY that pane full-bleed: a simple maximize hook the consumer drives (pair it with `<kai-pane>`'s `kai-maximize` event). Clear it (or point out of range) for the full tiled grid. Attribute: `maximized-index`. */
2991
- maximizedIndex?: number | null;
2992
- }
2993
-
2994
- export interface KaiPaneGroupElementProps {
2995
- /** Color mode (`auto` follows prefers-color-scheme). */
2996
- theme?: "light" | "dark" | "auto";
2997
- /** The tabs to render. An array of `{ id, name, status?, needsAttention?, number? }` set as a JS PROPERTY (not an HTML attribute). */
2998
- tabs?: { id: string; name: string; status?: { tone: "working" | "idle" | "done" | "error" | "blocked"; label?: string; pulse?: boolean }; needsAttention?: boolean; number?: number }[];
2999
- /** 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). */
3000
- active?: string;
3001
- /** Highlight the frame as the ACTIVE group in a multi-group layout. Attribute: `focused`. */
3002
- focused?: boolean;
3003
- }
3004
-
3005
- export interface KaiPopoverElementProps {
3006
- /** Color mode (`auto` follows prefers-color-scheme). */
3007
- theme?: "light" | "dark" | "auto";
3008
- /** Floating placement relative to the trigger (floating-ui placement). */
3009
- placement?: "top" | "right" | "bottom" | "left" | "bottom-end" | "bottom-start" | "left-end" | "left-start" | "right-end" | "right-start" | "top-end" | "top-start";
3010
- /** Gap in px between the trigger and the panel. */
3011
- gutter?: number;
3012
- /** 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`. */
3013
- open?: boolean;
3014
- /** Initial open state on mount (uncontrolled seed). */
3015
- defaultOpen?: boolean;
3016
- /** Turn the popover off while keeping the trigger mounted (clicks and `show()` no longer open it). */
3017
- disabled?: boolean;
3018
- }
3019
-
3020
- export interface KaiProgressBarElementProps {
3021
- /** Color mode (`auto` follows prefers-color-scheme). */
3022
- theme?: "light" | "dark" | "auto";
3023
- /** Current progress value (0..max). Attribute: `value`. */
3024
- value?: number;
3025
- /** The value `value` runs to (default 100). Attribute: `max`. */
3026
- max?: number;
3027
- /** Optional caption above the track. Attribute: `label`. */
3028
- label?: string;
3029
- /** Fill color: `primary` (default), `success`, `warning`, `error`, `info`. Attribute: `tone`. */
3030
- tone?: string;
3031
- }
3032
-
3033
- export interface KaiPromptDockElementProps {
3034
- /** Color mode (`auto` follows prefers-color-scheme). */
3035
- theme?: "light" | "dark" | "auto";
3036
- /** 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`. */
3037
- frame?: "inset" | "edge" | "none";
3038
- /** 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`. */
3039
- appearance?: "soft" | "outlined" | "filled" | "plain";
3040
- }
3041
-
3042
- export interface KaiPromptInputElementProps {
3043
- /** Color mode (`auto` follows prefers-color-scheme). */
3044
- theme?: "light" | "dark" | "auto";
3045
- /** 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`. */
3046
- value?: string | ({ type: "text"; text: string } | { type: "entity"; entity: { kind: string; id: string; label: string; icon?: string; promptText?: string; data?: Record<string, unknown> } })[];
3047
- /** Placeholder text shown in the empty input. */
3048
- placeholder?: string;
3049
- /** Disable the input and submit button entirely (non-interactive). */
3050
- disabled?: boolean;
3051
- /** Show the loading/streaming state and block submit (use while awaiting a reply). */
3052
- loading?: boolean;
3053
- /** Starter prompts shown above the input. Clicking one follows `suggestionMode`. Set as a JS property. */
3054
- suggestions?: string[];
3055
- /** What clicking a suggestion does: `'submit'` (default) sends it immediately as if typed and submitted; `'fill'` just places it in the input. */
3056
- suggestionMode?: "submit" | "fill";
3057
- /** Show a web-search (Globe) button in the left toolbar; clicking it fires a `kai-web-search` event. Attribute: `web-search`. */
3058
- webSearch?: boolean;
3059
- /** Show a Voice (Mic) button in the left toolbar; clicking it fires a `voice` event. */
3060
- voice?: boolean;
3061
- /** 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`. */
3062
- stoppable?: boolean;
3063
- /** 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. */
3064
- submit?: "always" | "auto";
3065
- /** 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`. */
3066
- attach?: boolean;
3067
- /** 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). Each item's `url` must be a `data:` URI or an https URL, never `URL.createObjectURL`: a `blob:` URL previews perfectly and is meaningless outside this tab, so `toOpenAIMessages`/`toAnthropicMessages` refuse it. (The built-in paperclip already stages files as `data:` URIs.) */
3068
- attachments?: { id: string; type: "file" | "source-document"; filename?: string; mediaType?: string; url?: string; title?: string }[];
3069
- /** 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. */
3070
- triggers?: { char: string; kind: string; items?: { id: string; label: string; icon?: string; description?: string; group?: string; kind?: string; promptText?: string; data?: Record<string, unknown> }[] }[];
3071
- /** 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. */
3072
- kindIcons?: Record<string, string>;
3073
- }
3074
-
3075
- export interface KaiRadioGroupElementProps {
3076
- /** Color mode (`auto` follows prefers-color-scheme). */
3077
- theme?: "light" | "dark" | "auto";
3078
- /** The choices, top to bottom. Set as a JS PROPERTY (array), never an attribute. */
3079
- options: { value: string; label: string; description?: undefined | string; disabled?: undefined | boolean }[];
3080
- /** Controlled selected `value`. Settable and reflected to the `value` attribute. `el.value = 'degraded'` drives it; choosing a row updates it and fires `kai-change`. Read `el.value` for live state. */
3081
- value?: string;
3082
- /** Shared form-control name for every radio in the group. Defaults to a generated id, so the group is exclusive and keyboard-navigable even when nothing is submitted. */
3083
- name?: string;
3084
- /** Disable every row. Individual rows carry their own `disabled`. */
3085
- disabled?: boolean;
3086
- /** Accessible name for the group. */
3087
- label?: string;
3088
- }
3089
-
3090
- export interface KaiReasoningElementProps {
3091
- /** Color mode (`auto` follows prefers-color-scheme). */
3092
- theme?: "light" | "dark" | "auto";
3093
- /** The reasoning text to display. */
3094
- text: string;
3095
- /** Trigger label. */
3096
- label?: string;
3097
- /** 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`. */
3098
- open?: boolean;
3099
- /** Initial open state on mount (uncontrolled seed). */
3100
- defaultOpen?: boolean;
3101
- /** While true, auto-expands (and re-collapses when it flips false). */
3102
- streaming?: boolean;
3103
- /** Render `text` as markdown. */
3104
- markdown?: boolean;
3105
- /** Gate the disclosure trigger: programmatic `show()/hide()/toggle()` still work, but the trigger click no longer toggles. */
3106
- disabled?: boolean;
3107
- }
3108
-
3109
- export interface KaiRemoteElementProps {
3110
- /** Color mode (`auto` follows prefers-color-scheme). */
3111
- theme?: "light" | "dark" | "auto";
3112
- /** The remote card URL. Attribute: `src`. */
3113
- src?: string;
3114
- /** Exact provider origin (https: or http://localhost for dev). Attribute: `provider-origin`. */
3115
- providerOrigin?: string;
3116
- /** The card envelope to render. JS property only. */
3117
- envelope?: Record<string, unknown>;
3118
- /** Optional routing policy. JS property only. */
3119
- policy?: Record<string, unknown>;
3120
- }
3121
-
3122
- export interface KaiResizableElementProps {
3123
- /** Color mode (`auto` follows prefers-color-scheme). */
3124
- theme?: "light" | "dark" | "auto";
3125
- /** Layout axis: `horizontal` (row, default) or `vertical` (column). */
3126
- orientation?: "horizontal" | "vertical";
3127
- /** Which item index is maximized (null = none). Declarative source of truth. */
3128
- maximizedIndex?: number | null;
3129
- /** 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. */
3130
- handle?: "line" | "grip" | "none";
3131
- }
3132
-
3133
- export interface KaiResizableItemElementProps {
3134
- /** Color mode (`auto` follows prefers-color-scheme). */
3135
- theme?: "light" | "dark" | "auto";
3136
- /** Initial main-axis size: `"280px"` (fixed) or `"25%"`/`25` (percent). Omitted → flexible. */
3137
- size?: string;
3138
- /** Minimum size during resize (px or %). */
3139
- min?: string;
3140
- /** Maximum size during resize (px or %). */
3141
- max?: string;
3142
- /** Fix this panel's size; adjacent dividers become non-draggable. */
3143
- locked?: boolean;
3144
- /** Hide this panel; its divider is dropped and the rest reflow. */
3145
- hidden?: boolean;
3146
- /** 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. */
3147
- collapsed?: boolean;
3148
- }
3149
-
3150
- export interface KaiResponseStreamElementProps {
3151
- /** Color mode (`auto` follows prefers-color-scheme). */
3152
- theme?: "light" | "dark" | "auto";
3153
- /** Text to stream. A string, or an `AsyncIterable<string>` (set as a JS property, since async iterables can't be HTML attributes). */
3154
- text?: string | AsyncIterable<string>;
3155
- /** Reveal animation. */
3156
- mode?: "typewriter" | "fade";
3157
- /** Characters/segments per tick. */
3158
- speed?: number;
3159
- /** Element tag to render as. */
3160
- as?: string;
3161
- }
3162
-
3163
- export interface KaiScopePickerElementProps {
3164
- /** Color mode (`auto` follows prefers-color-scheme). */
3165
- theme?: "light" | "dark" | "auto";
3166
- /** Authors to offer as scope filters. Omit to drop the Authors section (for a tag-only picker). Set as a JS property. */
3167
- availableAuthors?: string[];
3168
- /** Tags to offer as scope filters. Omit to drop the Tags section (for an author-only picker). Set as a JS property. */
3169
- availableTags?: string[];
3170
- /** The label shown on the trigger for the active scope. */
3171
- currentLabel?: string;
3172
- /** 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`. */
3173
- open?: boolean;
3174
- /** Initial open state on mount (uncontrolled seed). */
3175
- defaultOpen?: boolean;
3176
- /** Disable the trigger: click/keyboard and `show()` no longer open the dropdown. */
3177
- disabled?: boolean;
3178
- }
3179
-
3180
- export interface KaiScreenElementProps {
3181
- /** Color mode (`auto` follows prefers-color-scheme). */
3182
- theme?: "light" | "dark" | "auto";
3183
- /** 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`. */
3184
- open?: boolean;
3185
- /** Initial open state on mount (uncontrolled seed). */
3186
- defaultOpen?: boolean;
3187
- /** Header title text. A projected `title` slot overrides it. (Named `headline` because `title` collides with the global `HTMLElement.title` attribute.) */
3188
- headline?: string;
3189
- /** Show the back button (default true). */
3190
- back?: boolean;
3191
- /** Opt out of marking sibling elements inert/aria-hidden while open (for unusual layouts). */
3192
- noInert?: boolean;
3193
- }
3194
-
3195
- export interface KaiScrollAreaElementProps {
3196
- /** Color mode (`auto` follows prefers-color-scheme). */
3197
- theme?: "light" | "dark" | "auto";
3198
- /** Which axis scrolls. `vertical` (default) · `horizontal` · `both`. The cross axis is clamped so content can't overflow it. */
3199
- orientation?: "vertical" | "horizontal" | "both";
3200
- }
3201
-
3202
- export interface KaiScrollButtonElementProps {
3203
- /** Color mode (`auto` follows prefers-color-scheme). */
3204
- theme?: "light" | "dark" | "auto";
3205
- /** 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="...">`. */
3206
- for?: string;
3207
- /** Button visual variant: `'outline' | 'ghost' | 'default'`. Defaults to `'outline'`. */
3208
- variant?: "outline" | "ghost" | "default";
3209
- /** Button size token. Defaults to `'icon'` (square). */
3210
- size?: "sm" | "md" | "lg" | "icon" | "icon-sm";
3211
- /** The button's accessible name. It is announced whether or not the label is visible, so the text is always localisable. Defaults to `'Scroll to bottom'`. */
3212
- label?: string;
3213
- /** Also render `label` visibly beside the icon. Defaults to `false`, which is the icon-only button. When the text is visible it IS the accessible name, so nothing gets announced twice. */
3214
- showLabel?: boolean;
3215
- }
3216
-
3217
- export interface KaiSearchElementProps {
3218
- /** Color mode (`auto` follows prefers-color-scheme). */
3219
- theme?: "light" | "dark" | "auto";
3220
- /** Controlled query. Settable and reflected to the `value` attribute. Read `el.value` for live state. */
3221
- value?: string;
3222
- /** Placeholder. Defaults to `Search…`. */
3223
- placeholder?: string;
3224
- /** 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`. */
3225
- icon?: string;
3226
- /** Debounce window for `kai-search`, in ms. Defaults to `200`. */
3227
- debounce?: number;
3228
- /** Show a spinner in place of the leading icon while results load. */
3229
- loading?: boolean;
3230
- /** 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. */
3231
- shortcut?: string;
3232
- }
3233
-
3234
- export interface KaiSegmentedElementProps {
3235
- /** Color mode (`auto` follows prefers-color-scheme). */
3236
- theme?: "light" | "dark" | "auto";
3237
- /** The selectable segments, left to right. Set as a JS property (array). */
3238
- options: { value: string; label: string; icon?: undefined | string }[];
3239
- /** 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. */
3240
- value?: string;
3241
- /** Control density: `sm` or `md`. Defaults to `md`. */
3242
- size?: "sm" | "md";
3243
- }
3244
-
3245
- export interface KaiSelectElementProps {
3246
- /** Color mode (`auto` follows prefers-color-scheme). */
3247
- theme?: "light" | "dark" | "auto";
3248
- /** The choices, in display order. Set as a JS PROPERTY (array), never an attribute. Rendered in full: the kit never truncates, re-orders or de-duplicates them. */
3249
- options: { value: string; label?: undefined | string; disabled?: undefined | boolean }[];
3250
- /** Controlled selected value. Settable and reflected to the `value` attribute. `el.value = 'high'` drives it; choosing an option updates it and fires `kai-change`. Read `el.value` for live state; for a `multiple` select read `el.values` instead. */
3251
- value?: string;
3252
- /** Text for a leading, disabled, empty option: the "nothing chosen yet" row. Omitted means no such row at all; there is no default wording, because inventing one would put words in your UI. */
3253
- placeholder?: string;
3254
- /** Allow more than one selection. Turns the control into the platform's list box, so the kit's chevron is not drawn. */
3255
- multiple?: boolean;
3256
- /** Force the invalid (destructive-border) state. */
3257
- invalid?: boolean;
3258
- /** Disable interaction. */
3259
- disabled?: boolean;
3260
- /** Set the native `required` attribute, and nothing more. Whether an empty select is an error is the application's rule, not the kit's. */
3261
- required?: boolean;
3262
- /** Accessible label for the control. */
3263
- label?: string;
3264
- /** Form-control name, for a native form submit. */
3265
- name?: string;
3266
- }
3267
-
3268
- export interface KaiSeparatorElementProps {
3269
- /** Color mode (`auto` follows prefers-color-scheme). */
3270
- theme?: "light" | "dark" | "auto";
3271
- /** `horizontal` (default, block + full-width) or `vertical` (a rule inside a flex/grid row, stretching to the row height). */
3272
- orientation?: "horizontal" | "vertical";
3273
- }
3274
-
3275
- export interface KaiSettingItemElementProps {
3276
- /** Color mode (`auto` follows prefers-color-scheme). */
3277
- theme?: "light" | "dark" | "auto";
3278
- /** Row label (primary text). Attribute: `label`. */
3279
- label?: string;
3280
- /** Optional secondary description under the label. Attribute: `description`. */
3281
- description?: string;
3282
- }
3283
-
3284
- export interface KaiSettingsGroupElementProps {
3285
- /** Color mode (`auto` follows prefers-color-scheme). */
3286
- theme?: "light" | "dark" | "auto";
3287
- /** Small section heading shown above the card. Attribute: `heading`. */
3288
- heading?: string;
3289
- /** Optional muted description under the heading. Attribute: `description`. */
3290
- description?: string;
3291
- }
3292
-
3293
- export interface KaiSkeletonElementProps {
3294
- /** Color mode (`auto` follows prefers-color-scheme). */
3295
- theme?: "light" | "dark" | "auto";
3296
- /** `text` (one or more lines), `rect` (a block), or `circle` (round). Defaults to `text`. */
3297
- variant?: "text" | "rect" | "circle";
3298
- /** CSS width (e.g. `'12rem'`, `'60%'`). Defaults to full width (responsive); for `circle` it is the diameter. */
3299
- width?: string;
3300
- /** CSS height. Defaults per variant (a text line height; circle = width). */
3301
- height?: string;
3302
- /** `text` only: number of lines; the last is shorter. Defaults to 1. */
3303
- lines?: number;
3304
- }
3305
-
3306
- export interface KaiSkillsElementProps {
3307
- /** Color mode (`auto` follows prefers-color-scheme). */
3308
- theme?: "light" | "dark" | "auto";
3309
- /** 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. */
3310
- skills?: { id: string; name: string }[];
3311
- }
3312
-
3313
- export interface KaiSliderElementProps {
3314
- /** Color mode (`auto` follows prefers-color-scheme). */
3315
- theme?: "light" | "dark" | "auto";
3316
- /** Lowest selectable value. Required: a range with no bounds is a guess, and the guess belongs to whoever knows what the number means. */
3317
- min?: number;
3318
- /** Highest selectable value. Required, for the same reason as `min`. */
3319
- max?: number;
3320
- /** Granularity. Omitted means the native default of 1; `any` means continuous. */
3321
- step?: number | "any";
3322
- /** Controlled value. Settable and reflected to the `value` attribute. `el.value = 40` drives it; dragging updates it and fires `kai-input` per step, `kai-change` on release. Read `el.value` for live state. */
3323
- value?: number;
3324
- /** Disable interaction. */
3325
- disabled?: boolean;
3326
- /** Accessible label for the slider. */
3327
- label?: string;
3328
- /** Form-control name, for a native form submit. */
3329
- name?: string;
3330
- /** Show the current value beside the track. Off by default. Two ways in, because one of them is not a scalar. As a bare ATTRIBUTE (`<kai-slider value-label>`) it renders the raw number. As a JS PROPERTY it also accepts a formatter function (`el.valueLabel = (v) => v + '%'`), for a slider that is not counting bare numbers. A function cannot survive an attribute, so that half is property-only. The readout is hidden from assistive tech: the slider already reports the same number, and an exposed copy would be announced twice. */
3331
- valueLabel?: boolean | ((value: number) => string);
3332
- }
3333
-
3334
- export interface KaiSourceElementProps {
3335
- /** Color mode (`auto` follows prefers-color-scheme). */
3336
- theme?: "light" | "dark" | "auto";
3337
- /** The URL this citation links to (the domain also seeds the default label/favicon). */
3338
- href?: string;
3339
- /** Trigger label (defaults to the domain). */
3340
- label?: string;
3341
- /** Hover-card headline. Attribute: `headline` (`title` is avoided because it is a global HTML attribute that reflects in a CE constructor and breaks it). */
3342
- headline?: string;
3343
- /** Hover-card body text describing the source. */
3344
- description?: string;
3345
- /** Show the source's favicon next to the trigger label. */
3346
- showFavicon?: boolean;
3347
- }
3348
-
3349
- export interface KaiSourcesElementProps {
3350
- /** Color mode (`auto` follows prefers-color-scheme). */
3351
- theme?: "light" | "dark" | "auto";
3352
- /** 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. */
3353
- sources?: { href: string; title?: string; description?: string; label?: string; showFavicon?: boolean }[];
3354
- /** Show favicons on all items (per-item `showFavicon` overrides). */
3355
- showFavicon?: boolean;
3356
- /** 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`. */
3357
- numbered?: boolean;
3358
- }
3359
-
3360
- export interface KaiStatusElementProps {
3361
- /** Color mode (`auto` follows prefers-color-scheme). */
3362
- theme?: "light" | "dark" | "auto";
3363
- /** Presence/notification state → color. `new` (default) maps to the blue hue. */
3364
- status?: "new" | "online" | "busy" | "away" | "offline";
3365
- /** Animated ping ring (off by default; respects prefers-reduced-motion). */
3366
- pulse?: boolean;
3367
- /** Accessible name. Without it the dot is decorative. */
3368
- label?: string;
3369
- /** `sm` (default) or `md`. */
3370
- size?: "sm" | "md";
3371
- }
3372
-
3373
- export interface KaiSuggestionsElementProps {
3374
- /** Color mode (`auto` follows prefers-color-scheme). */
3375
- theme?: "light" | "dark" | "auto";
3376
- /** 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. */
3377
- suggestions?: (string | { label: string; value?: string; icon?: string })[];
3378
- /** Chip style: `'outline'` (default), `'ghost'`, or `'default'` (filled). */
3379
- variant?: "outline" | "ghost" | "default";
3380
- /** Row height for `layout="list"`: `'md'` (default) or `'lg'` for taller rows. Chips are unaffected. */
3381
- size?: "md" | "lg";
3382
- /** 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. */
3383
- layout?: "chips" | "list";
3384
- /** Full-width left-aligned rows instead of pills. */
3385
- block?: boolean;
3386
- /** Substring to highlight within each suggestion. */
3387
- highlight?: string;
3388
- }
3389
-
3390
- export interface KaiSwitchElementProps {
3391
- /** Color mode (`auto` follows prefers-color-scheme). */
3392
- theme?: "light" | "dark" | "auto";
3393
- /** 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. */
3394
- checked?: boolean;
3395
- /** Initial checked state on mount (uncontrolled seed). Bare attribute (`<kai-switch default-checked>`) turns it on. */
3396
- defaultChecked?: boolean;
3397
- /** Disable interaction. */
3398
- disabled?: boolean;
3399
- /** Accessible label. */
3400
- label?: string;
3401
- /** Form-control name (paired with `value`). */
3402
- name?: string;
3403
- /** Submitted value when checked (paired with `name`). Defaults to `'on'`. */
3404
- value?: string;
3405
- }
3406
-
3407
- export interface KaiTabsElementProps {
3408
- /** Color mode (`auto` follows prefers-color-scheme). */
3409
- theme?: "light" | "dark" | "auto";
3410
- /** Tabs to render. Set as a JS property, not an HTML attribute. */
3411
- items?: { id: string; label?: string; icon?: string; disabled?: boolean }[];
3412
- /** 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. */
3413
- value?: string;
3414
- /** Initial selected id when uncontrolled (use the `default-value` attribute in plain HTML). */
3415
- defaultValue?: string;
3416
- /** `segmented` (default, a pill group) or `underline` (an underlined row). */
3417
- variant?: "segmented" | "underline";
3418
- /** Stretch the strip to full width, each tab sharing the space equally. */
3419
- block?: boolean;
3420
- /** Disable the whole strip. */
3421
- disabled?: boolean;
3422
- }
3423
-
3424
- export interface KaiTasksElementProps {
3425
- /** Color mode (`auto` follows prefers-color-scheme). */
3426
- theme?: "light" | "dark" | "auto";
3427
- /** 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. */
3428
- 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 };
3429
- /** Stable card id correlating every emitted CardEvent. Attribute: `card-id`. */
3430
- cardId?: string;
3431
- /** Heading rendered in the card chrome (= CardEnvelope.title). Attribute: `heading`. */
3432
- heading?: string;
3433
- /** Set when the user resolved this card; renders the read-only view. Property: `el.resolution = { kind:'submit', data:{ selected:[…] } }`. */
3434
- resolution?: Record<string, unknown>;
3435
- /** Controlled selection (task ids; JS property). When set, it wins over local state. */
3436
- value?: string[];
3437
- /** Uncontrolled initial selection (task ids; JS property), overlaying per-task `checked`. */
3438
- defaultValue?: string[];
3439
- /** Freeze the whole list + Confirm. Attribute: `disabled`. */
3440
- disabled?: boolean;
3441
- /** 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`. */
3442
- readonly?: boolean;
3443
- }
3444
-
3445
- export interface KaiTextShimmerElementProps {
3446
- /** Color mode (`auto` follows prefers-color-scheme). */
3447
- theme?: "light" | "dark" | "auto";
3448
- /** The text to shimmer. */
3449
- text?: string;
3450
- /** Element tag to render as (default `span`). */
3451
- as?: string;
3452
- /** Animation duration in seconds. */
3453
- duration?: number;
3454
- /** Gradient spread (5–45). */
3455
- spread?: number;
3456
- }
3457
-
3458
- export interface KaiThinkingBarElementProps {
3459
- /** Color mode (`auto` follows prefers-color-scheme). */
3460
- theme?: "light" | "dark" | "auto";
3461
- /** The shimmering label, e.g. "Thinking…". */
3462
- text?: string;
3463
- /** When true, show a "stop" affordance that fires a `stop` event. */
3464
- stoppable?: boolean;
3465
- /** Label for the stop affordance. */
3466
- stopLabel?: string;
3467
- }
3468
-
3469
- export interface KaiThreadElementProps {
3470
- /** Color mode (`auto` follows prefers-color-scheme). */
3471
- theme?: "light" | "dark" | "auto";
3472
- /** 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). */
3473
- 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" }[];
3474
- /** Show a typing indicator on the pending assistant turn. Set it while awaiting the assistant's reply. */
3475
- loading?: boolean;
3476
- /** Body/prose font scale for rendered markdown (`'xs' | 'sm' | 'base' | 'lg'`). Defaults to `'sm'`. */
3477
- proseSize?: "xs" | "sm" | "base" | "lg";
3478
- /** Shiki theme name for syntax-highlighted code blocks (e.g. `'github-dark-dimmed'`). */
3479
- codeTheme?: string;
3480
- /** Enable Shiki syntax highlighting in code blocks. Turn off to render plain `<pre>` blocks (lighter, no highlighter load). Default true. */
3481
- codeHighlight?: boolean;
3482
- /** Whether each message's action bar is always visible (`'always'`, default) or only revealed on hover of that message row (`'hover'`). */
3483
- actionsReveal?: "always" | "hover";
3484
- /** Show the scroll-to-bottom button inside the scroll area. Default true. */
3485
- scrollButton?: boolean;
3486
- /** Extra classes applied to the thread's inner root. */
3487
- class?: string;
3488
- /** 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. */
3489
- cardTypes?: Record<string, string>;
3490
- /** 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. */
3491
- cardSchemas?: Record<string, object>;
3492
- }
3493
-
3494
- export interface KaiToastRegionElementProps {
3495
- /** Color mode (`auto` follows prefers-color-scheme). */
3496
- theme?: "light" | "dark" | "auto";
3497
- /** 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. Note the handover: the first `toast()` call ADOPTS a region you placed in markup (no second region mounts) and binds the imperative store to this property, replacing any array you set. Drive a region as data OR via `toast()`, not both at once. */
3498
- 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 }[];
3499
- /** Stack anchor: `'top-center'` (default), `'top-right'`, `'bottom-center'`, … */
3500
- position?: "top-center" | "top-right" | "top-left" | "bottom-center" | "bottom-right" | "bottom-left";
3501
- /** Max simultaneously-visible toasts; the rest queue. Defaults to `3`. */
3502
- max?: number;
3503
- /** Stacking: 'expanded' (default, full column) | 'collapsed' (Sonner-style pile that expands on hover/focus). Attribute: stack. */
3504
- stack?: "expanded" | "collapsed";
3505
- /** Default appearance for this region's toasts: `'pill'` (default, compact) | `'card'` (richer, with a description line). A per-toast `appearance` wins. Attribute: `appearance`. */
3506
- appearance?: "pill" | "card";
3507
- /** Default high-contrast inverse treatment for this region's toasts. A per-toast `inverse` wins. Off by default. Attribute: `inverse`. */
3508
- inverse?: boolean;
3509
- /** Container element to anchor this region to (JS property). Set by the store for a scoped region; unset = the global viewport region. */
3510
- target?: HTMLElement;
3511
- }
3512
-
3513
- export interface KaiToolElementProps {
3514
- /** Color mode (`auto` follows prefers-color-scheme). */
3515
- theme?: "light" | "dark" | "auto";
3516
- /** The tool-call to display. Set as a JS property. */
3517
- 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 } };
3518
- /** 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`. */
3519
- open?: boolean;
3520
- /** Initial open state on mount (uncontrolled seed). */
3521
- defaultOpen?: boolean;
3522
- /** Gate the disclosure trigger: programmatic `show()/hide()/toggle()` still work, but the trigger click no longer toggles. */
3523
- disabled?: boolean;
3524
- }
3525
-
3526
- export interface KaiTooltipElementProps {
3527
- /** Color mode (`auto` follows prefers-color-scheme). */
3528
- theme?: "light" | "dark" | "auto";
3529
- /** The hint text shown on hover/focus of the slotted trigger. */
3530
- content?: string;
3531
- /** Delay (ms) before the tooltip appears on hover. Defaults to 600. Focus shows it immediately regardless. */
3532
- openDelay?: number;
3533
- /** Delay (ms) before it hides after the pointer leaves. Defaults to 0 (hides immediately). */
3534
- closeDelay?: number;
3535
- /** Preferred placement: `'top' | 'bottom' | 'left' | 'right'` (+ optional `-start`/`-end`). Defaults to `'top'`; flips to stay in view. */
3536
- placement?: string;
3537
- /** 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`. */
3538
- open?: boolean;
3539
- /** Initial open state on mount (uncontrolled seed). */
3540
- defaultOpen?: boolean;
3541
- /** Turn the tooltip off while keeping the trigger mounted (hover/focus and `show()` no longer open it). */
3542
- disabled?: boolean;
3543
- }
3544
-
3545
- export interface KaiVoiceInputElementProps {
3546
- /** Color mode (`auto` follows prefers-color-scheme). */
3547
- theme?: "light" | "dark" | "auto";
3548
- /** 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. */
3549
- transcribe?: (audio: Blob) => Promise<string>;
3550
- /** Disable the mic button (non-interactive). */
3551
- disabled?: boolean;
3552
- /** 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. */
3553
- recognitionLang?: string;
3554
- /** Emit live partial transcripts (`kai-transcript-interim`) during native recognition. Attribute: `interim`. No-op on the transcribe/fallback paths. */
3555
- interim?: boolean;
3556
- }
3557
-
3558
- export interface KaiVoiceOutputElementProps {
3559
- /** Color mode (`auto` follows prefers-color-scheme). */
3560
- theme?: "light" | "dark" | "auto";
3561
- /** The utterance to read aloud. */
3562
- text?: string;
3563
- /** Speak automatically when `text` is set/changed. */
3564
- autoplay?: boolean;
3565
- /** 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. */
3566
- synthesize?: (text: string) => Promise<Blob>;
3567
- /** Disable the button (non-interactive). */
3568
- disabled?: boolean;
3569
- }
3570
-
3571
- export interface KaiWorkspaceElementProps {
3572
- /** Color mode (`auto` follows prefers-color-scheme). */
3573
- theme?: "light" | "dark" | "auto";
3574
- /** Controlled collapsed state of the start aside. Set this as a JS property (`el.startCollapsed = true`) to drive the aside from your app, updating it in response to the `kai-aside-toggle` event. Omit for uncontrolled (the element manages it). */
3575
- startCollapsed?: boolean;
3576
- /** Initial collapsed state of the start aside when uncontrolled (default false). Use the `default-start-collapsed` attribute to start collapsed in plain HTML. */
3577
- defaultStartCollapsed?: boolean;
3578
- /** Controlled collapsed state of the end aside. Set this as a JS property (`el.endCollapsed = true`) to drive the aside from your app, updating it in response to the `kai-aside-toggle` event. Omit for uncontrolled (the element manages it). */
3579
- endCollapsed?: boolean;
3580
- /** Initial collapsed state of the end aside when uncontrolled (default false). Use the `default-end-collapsed` attribute to start collapsed in plain HTML. */
3581
- defaultEndCollapsed?: boolean;
3582
- /** Auto-collapse both asides when the shell's own width drops below this many px, and re-expand when it grows back above. Applies to uncontrolled asides only (it never fights an app-driven collapsed prop); omit to disable. Fires `kai-aside-toggle`. Attribute: `collapse-below`. */
3583
- collapseBelow?: number;
3584
- /** Below this shell width in px, an expanded aside renders as an overlay drawer over the main region instead of a column beside it. Escape inside the drawer closes it and returns focus to the element focused before it opened. Omit to disable. Attribute: `drawer-below`. */
3585
- drawerBelow?: number;
3586
- /** Density hint. Reflected as a `data-compact` hook on the root (and as the `compact` attribute on the element) for your CSS and slotted content; the shell itself keeps no other opinion about density. */
3587
- compact?: boolean;
3588
- }
3589
-
3590
- export interface KaiAgentCardElementEvents {
3591
- /** The card was activated by a click, or by Enter / Space while focused. Promote this agent back to focus. */
3592
- onKaiActivate?: (event: CustomEvent) => void;
3593
- /** 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). */
3594
- onKaiMenu?: (event: CustomEvent) => void;
3595
- }
3596
-
3597
- export interface KaiArtifactElementEvents {
3598
- /** Fired when a file is selected. `detail.path`. */
3599
- onKaiFileSelect?: (event: CustomEvent<{ path: string }>) => void;
3600
- /** Artifact's own maximize button toggled (consumer-observable; non-bubbling). */
3601
- onKaiMaximizeChange?: (event: CustomEvent<{ maximized: boolean }>) => void;
3602
- /** 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. */
3603
- onKaiMaximizeIntent?: (event: CustomEvent<{ requested: boolean }>) => void;
3604
- /** Fired when the preview navigates. `detail.url` = the new location. */
3605
- onKaiNavigate?: (event: CustomEvent<{ url: string }>) => void;
3606
- /** Fired when the Preview|Code tab changes. `detail.tab`. */
3607
- onKaiTabChange?: (event: CustomEvent<{ tab: "preview" | "code" }>) => void;
3608
- }
3609
-
3610
- export interface KaiAttachmentsElementEvents {
3611
- /** A remove button was clicked. */
3612
- onKaiRemove?: (event: CustomEvent<{ id: string }>) => void;
3613
- }
3614
-
3615
- export interface KaiAudioVisualizerElementEvents {
3616
-
3617
- }
3618
-
3619
- export interface KaiAvatarElementEvents {
3620
-
3621
- }
3622
-
3623
- export interface KaiBadgeElementEvents {
3624
-
3625
- }
3626
-
3627
- export interface KaiButtonElementEvents {
3628
- /** The button was activated (pointer or keyboard). Carries no detail. The native `click` also bubbles (composed) for consumers who prefer it. */
3629
- onKaiClick?: (event: CustomEvent) => void;
3630
- }
3631
-
3632
- export interface KaiCardElementEvents {
3633
- /** A `clickable`/`href` card was activated (click, or Enter/Space). */
3634
- onKaiCardClick?: (event: CustomEvent) => void;
3635
- /** The card was dismissed via its × (it also hides itself). */
3636
- onKaiDismiss?: (event: CustomEvent) => void;
3637
- }
3638
-
3639
- export interface KaiCardsElementEvents {
3640
- /** 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.) */
3641
- 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;
3642
- }
3643
-
3644
- export interface KaiChainOfThoughtElementEvents {
3645
- /** 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.) */
3646
- onKaiValueChange?: (event: CustomEvent<{ value: string | string[] }>) => void;
3647
- }
3648
-
3649
- export interface KaiChatElementEvents {
3650
- /** The staged attachments changed (file added or removed). Carries the full current list so a consumer can react in real time. */
3651
- onKaiAttachmentsChange?: (event: CustomEvent<{ attachments: { id: string; type: "file" | "source-document"; filename?: undefined | string; mediaType?: undefined | string; url?: undefined | string; title?: undefined | string }[] }>) => void;
3652
- /** One or more picked files were refused because `accept` excluded them. The element renders NO message of its own: it reports the facts (name, media type, whether the kit could have sent it) and what the user should see is the application's call. Only ever fires when `accept` is set. */
3653
- onKaiAttachmentsRejected?: (event: CustomEvent<{ rejected: { filename: string; mediaType: string; reason: "filtered" | "unsupported" }[] }>) => void;
3654
- /** 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. */
3655
- onKaiMessageAction?: (event: CustomEvent<{ messageId: string; action: string; state?: undefined | "on" | "off" }>) => void;
3656
- /** The header model switcher changed. */
3657
- onKaiModelChange?: (event: CustomEvent<{ modelId: string }>) => void;
3658
- /** User submitted a message. */
3659
- 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;
3660
- /** A suggestion chip was clicked (only in `suggestion-mode="fill"`). */
3661
- onKaiSuggestionClick?: (event: CustomEvent<{ value: string }>) => void;
3662
- /** Fired on every input change. */
3663
- onKaiValueChange?: (event: CustomEvent<{ value: string }>) => void;
3664
- /** The Mic / voice button was clicked. */
3665
- onKaiVoice?: (event: CustomEvent<Record<string, never>>) => void;
3666
- /** The web-search (Globe) toolbar button was clicked. */
3667
- onKaiWebSearch?: (event: CustomEvent<Record<string, never>>) => void;
3668
- }
3669
-
3670
- export interface KaiCheckboxElementEvents {
3671
- /** The box was ticked or unticked. */
3672
- onKaiChange?: (event: CustomEvent<{ checked: boolean }>) => void;
3673
- }
3674
-
3675
- export interface KaiCheckboxGroupElementEvents {
3676
- /** A row was ticked or unticked. `values` is the whole selection after the change, which is what a multi-select control needs; `value` is the first of them (empty when nothing is selected). Both are always present, so neither shape silently loses the other. This is `<kai-select>`'s detail, deliberately. */
3677
- onKaiChange?: (event: CustomEvent<{ value: string; values: string[] }>) => void;
3678
- }
3679
-
3680
- export interface KaiCheckpointElementEvents {
3681
- /** The checkpoint was clicked. */
3682
- onKaiSelect?: (event: CustomEvent) => void;
3683
- }
3684
-
3685
- export interface KaiChoiceElementEvents {
3686
- /** The selection changed BEFORE submit (a row click or the `select()` method). Distinct from the terminal `action` verb on the `kai-card` contract event. */
3687
- onKaiValueChange?: (event: CustomEvent<{ value: string }>) => void;
3688
- }
3689
-
3690
- export interface KaiCoachmarkElementEvents {
3691
- /** The × dismiss button was pressed. The consumer records that this hint was seen so it won't show again. */
3692
- onKaiDismiss?: (event: CustomEvent<Record<string, never>>) => void;
3693
- /** The coachmark opened or closed (a method, the ×, or a driven `open`). */
3694
- onKaiOpenChange?: (event: CustomEvent<{ open: boolean }>) => void;
3695
- }
3696
-
3697
- export interface KaiCodeBlockElementEvents {
3698
-
3699
- }
3700
-
3701
- export interface KaiCommandElementEvents {
3702
- /** 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. */
3703
- onKaiActiveChange?: (event: CustomEvent<{ id: string | undefined }>) => void;
3704
- /** Fired on every keystroke in the search input. */
3705
- onKaiQueryChange?: (event: CustomEvent<{ value: string }>) => void;
3706
- /** Fired when the user selects an item (click or Enter). */
3707
- onKaiSelect?: (event: CustomEvent<{ id: string }>) => void;
3708
- }
3709
-
3710
- export interface KaiCompareElementEvents {
3711
- /** The user committed a pick. `detail` = `{ chosenId, rejectedIds, at }`. */
3712
- onKaiCompareSelect?: (event: CustomEvent<{ chosenId: string; rejectedIds: string[]; at?: undefined | number }>) => void;
3713
- /** The definition was unusable. */
3714
- onKaiError?: (event: CustomEvent<{ compareId: string; message: string }>) => void;
3715
- /** Both candidates have settled and the pick is live. */
3716
- onKaiReady?: (event: CustomEvent<{ compareId: string }>) => void;
3717
- }
3718
-
3719
- export interface KaiComposerElementEvents {
3720
- /** The composer lost focus. */
3721
- onKaiBlur?: (event: CustomEvent<{ originalEvent: FocusEvent }>) => void;
3722
- /** An entity pill was inserted into the composer. */
3723
- onKaiEntityAdd?: (event: CustomEvent<{ entity: { kind: string; id: string; label: string; icon?: undefined | string; promptText?: undefined | string; data?: undefined | Record<string, unknown> } }>) => void;
3724
- /** An entity pill was deleted from the composer. */
3725
- onKaiEntityRemove?: (event: CustomEvent<{ entity: { kind: string; id: string; label: string; icon?: undefined | string; promptText?: undefined | string; data?: undefined | Record<string, unknown> } }>) => void;
3726
- /** 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.) */
3727
- onKaiFocus?: (event: CustomEvent<{ originalEvent: FocusEvent }>) => void;
3728
- /** The user submitted the composer (Enter or programmatic submit). Note the detail carries no `attachments`; `<kai-composer>` is the bare editing surface: no send button, toolbar, or attachments. For a drop-in composer row with all three, reach for `<kai-prompt-input>`, which is built on this. */
3729
- 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;
3730
- /** A trigger character was detected at the caret (e.g. `/` or `@`). */
3731
- onKaiTrigger?: (event: CustomEvent<{ char: string; query: string; rect: DOMRect }>) => void;
3732
- /** The active trigger was dismissed (Escape, space, or outside click). */
3733
- onKaiTriggerClose?: (event: CustomEvent<Record<string, never>>) => void;
3734
- /** The content changed (fires on every input event). */
3735
- 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;
3736
- }
3737
-
3738
- export interface KaiConfirmElementEvents {
3739
-
3740
- }
3741
-
3742
- export interface KaiContextElementEvents {
3743
- /** Fires when the computed severity level changes (ok → warn → danger or back). `detail.level` is `'ok'`, `'warn'`, or `'danger'`. */
3744
- onKaiThresholdChange?: (event: CustomEvent<{ level: "ok" | "warn" | "danger" }>) => void;
3745
- }
3746
-
3747
- export interface KaiConversationItemElementEvents {
3748
- /** STANDALONE activation only: the row was activated (click, Enter or Space on its body) while the item is NOT a direct child of `<kai-conversations>`. `id` is the row's identity: the `conversation-id` attribute, else the host `id`. Inside a container this never fires: activation surfaces once, as `kai-conversation-select` on the container. */
3749
- onKaiSelect?: (event: CustomEvent<{ id: string }>) => void;
3750
- }
3751
-
3752
- export interface KaiConversationsElementEvents {
3753
- /** The rail was collapsed or expanded (via the toggle, the reopen button, or a `collapse()`/`expand()`/`toggle()` call). */
3754
- onKaiCollapseToggle?: (event: CustomEvent<{ collapsed: boolean }>) => void;
3755
- /** A conversation was selected. The selection event in BOTH modes: a batteries data row, or an activated `<kai-conversation-item>` child (click, Enter or Space). */
3756
- onKaiConversationSelect?: (event: CustomEvent<{ id: string }>) => void;
3757
- /** The "New chat" button was clicked. */
3758
- onKaiNewChat?: (event: CustomEvent<Record<string, never>>) => void;
3759
- /** 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. */
3760
- onKaiSearch?: (event: CustomEvent<{ query: string }>) => void;
3761
- /** The sidebar toggle was clicked. */
3762
- onKaiToggleSidebar?: (event: CustomEvent<Record<string, never>>) => void;
3763
- }
3764
-
3765
- export interface KaiDialogElementEvents {
3766
- /** The dialog opened or closed (Escape, backdrop click, a driven `open`, or a method). */
3767
- onKaiOpenChange?: (event: CustomEvent<{ open: boolean }>) => void;
3768
- }
3769
-
3770
- export interface KaiDockElementEvents {
3771
- /** The dock opened or closed (the launcher, Escape, a driven `open`, or a method). */
3772
- onKaiOpenChange?: (event: CustomEvent<{ open: boolean }>) => void;
3773
- }
3774
-
3775
- export interface KaiDropdownElementEvents {
3776
- /** The menu opened or closed (click, keyboard, Escape, outside-click, or a method). */
3777
- onKaiOpenChange?: (event: CustomEvent<{ open: boolean }>) => void;
3778
- }
3779
-
3780
- export interface KaiEditableLabelElementEvents {
3781
- /** Edit was cancelled (Esc); the text is restored. */
3782
- onKaiCancel?: (event: CustomEvent<Record<string, never>>) => void;
3783
- /** Committed a changed value (Enter / blur). */
3784
- onKaiRename?: (event: CustomEvent<{ value: string }>) => void;
3785
- }
3786
-
3787
- export interface KaiEmbedElementEvents {
3788
-
3789
- }
3790
-
3791
- export interface KaiEmptyElementEvents {
3792
-
3793
- }
3794
-
3795
- export interface KaiFeedbackBarElementEvents {
3796
- /** The user dismissed the banner. */
3797
- onKaiClose?: (event: CustomEvent) => void;
3798
- /** The user rated the response. `value` is `'helpful'` or `'not-helpful'`. */
3799
- onKaiFeedback?: (event: CustomEvent<{ value: "helpful" | "not-helpful" }>) => void;
3800
- /** The user submitted the optional detail form (`collect-detail`). */
3801
- onKaiFeedbackDetail?: (event: CustomEvent<{ value: "helpful" | "not-helpful"; category?: undefined | string; comment?: undefined | string }>) => void;
3802
- }
3803
-
3804
- export interface KaiFileTreeElementEvents {
3805
- /** Fired when a file is selected. `detail.path` = the file's path. */
3806
- onKaiSelect?: (event: CustomEvent<{ path: string }>) => void;
3807
- }
3808
-
3809
- export interface KaiFileUploadElementEvents {
3810
- /** Files were picked or dropped. */
3811
- onKaiFilesAdded?: (event: CustomEvent<{ files: File[] }>) => void;
3812
- }
3813
-
3814
- export interface KaiFormElementEvents {
3815
- /** The form's values changed on input. Carries the current coerced values + validity. */
3816
- onKaiValuesChange?: (event: CustomEvent<{ values: Record<string, unknown>; valid: boolean }>) => void;
3817
- }
3818
-
3819
- export interface KaiHoverCardElementEvents {
3820
- /** The card opened or closed (by hover/focus, outside-click, or a method). */
3821
- onKaiOpenChange?: (event: CustomEvent<{ open: boolean }>) => void;
3822
- }
3823
-
3824
- export interface KaiIconElementEvents {
3825
-
3826
- }
3827
-
3828
- export interface KaiImageElementEvents {
3829
-
3830
- }
3831
-
3832
- export interface KaiInputElementEvents {
3833
- /** The value was committed (blur). Same detail shape as `kai-input`. */
3834
- onKaiChange?: (event: CustomEvent<{ value: string; formattedValue: string }>) => void;
3835
- /** The value changed per keystroke. `value` is the canonical value (what a backend wants); `formattedValue` is the text on screen. With no mask the two are equal. */
3836
- onKaiInput?: (event: CustomEvent<{ value: string; formattedValue: string }>) => void;
3837
- /** A mask refused, or partly refused, some content. The reasons are `full` (no free position left), `wrong-class` (a letter into a digit position), `over-capacity` (a paste longer than the mask holds; what fits was kept), and `format-change-clipped` (the `format` changed under a value that no longer fits). `data` is the content that was refused. The first three are USER-INPUT errors, and are the ones worth announcing in a polite live region. `format-change-clipped` is not one: it follows the app changing its own configuration, so it reports and nothing more. None of the four touches validity, so `invalid` and `error` stay the consumer decision. */
3838
- onKaiInputRejected?: (event: CustomEvent<{ reason: "full" | "wrong-class" | "over-capacity" | "format-change-clipped"; data: string }>) => void;
3839
- }
3840
-
3841
- export interface KaiKbdElementEvents {
3842
-
3843
- }
3844
-
3845
- export interface KaiLinkPreviewElementEvents {
3846
-
3847
- }
3848
-
3849
- export interface KaiLoaderElementEvents {
3850
-
3851
- }
3852
-
3853
- export interface KaiMarkdownElementEvents {
3854
-
3855
- }
3856
-
3857
- export interface KaiMenuElementEvents {
3858
- /** The menu opened or closed (by click, keyboard, Escape, outside-click, or a method). */
3859
- onKaiOpenChange?: (event: CustomEvent<{ open: boolean }>) => void;
3860
- /** 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. */
3861
- onKaiSelect?: (event: CustomEvent<{ id: string; checked?: undefined | boolean; radioGroup?: undefined | string }>) => void;
3862
- }
3863
-
3864
- export interface KaiMessageElementEvents {
3865
- /** 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. */
3866
- onKaiMessageAction?: (event: CustomEvent<{ messageId: string; action: string; state?: undefined | "on" | "off" }>) => void;
3867
- }
3868
-
3869
- export interface KaiModelSwitcherElementEvents {
3870
- /** A model was selected. */
3871
- onKaiModelChange?: (event: CustomEvent<{ modelId: string }>) => void;
3872
- /** The model dropdown opened or closed (by click, keyboard, Escape, outside-click, or a method). */
3873
- onKaiOpenChange?: (event: CustomEvent<{ open: boolean }>) => void;
3874
- }
3875
-
3876
- export interface KaiNavElementEvents {
3877
- /** A row's trailing `action` button was activated (not a select). `value` is the item id; `action` echoes the item's `{ icon, label }`. */
3878
- onKaiNavItemAction?: (event: CustomEvent<{ value: string; action?: undefined | { icon: string; label: string } }>) => void;
3879
- /** A `closable` row's trailing close button was activated (not a select). `value` is the item id. */
3880
- onKaiNavItemClose?: (event: CustomEvent<{ value: string }>) => void;
3881
- /** A nav item was activated. */
3882
- onKaiNavSelect?: (event: CustomEvent<{ id: string }>) => void;
3883
- }
3884
-
3885
- export interface KaiNoticeElementEvents {
3886
- /** The notice was dismissed via its × (it also hides itself). */
3887
- onKaiDismiss?: (event: CustomEvent) => void;
3888
- }
3889
-
3890
- export interface KaiPaneElementEvents {
3891
- /** The close (×) control was clicked. */
3892
- onKaiClose?: (event: CustomEvent) => void;
3893
- /** The dock control was clicked (only present when `show-dock`). */
3894
- onKaiDock?: (event: CustomEvent) => void;
3895
- /** The maximize/restore control was clicked. `detail.maximized` is the intended NEXT state. Drive the `maximized` prop yourself from it. */
3896
- onKaiMaximize?: (event: CustomEvent<{ maximized: boolean }>) => void;
3897
- /** The split control was clicked (only present when `show-split`). */
3898
- onKaiSplit?: (event: CustomEvent) => void;
3899
- }
3900
-
3901
- export interface KaiPaneGridElementEvents {
3902
-
3903
- }
3904
-
3905
- export interface KaiPaneGroupElementEvents {
3906
- /** A tab was selected (click, Enter/Space, or arrow-key move). `detail.id` is the tab's id. */
3907
- onKaiTabChange?: (event: CustomEvent<{ id: string }>) => void;
3908
- /** A tab's close (×) was clicked. Drop the tab from `tabs` yourself. */
3909
- onKaiTabClose?: (event: CustomEvent<{ id: string }>) => void;
3910
- /** A tab's "…" overflow was clicked. Open your own menu from `detail.id`. */
3911
- onKaiTabMenu?: (event: CustomEvent<{ id: string }>) => void;
3912
- }
3913
-
3914
- export interface KaiPopoverElementEvents {
3915
- /** The popover opened or closed (click, Escape, outside-click, or a method). */
3916
- onKaiOpenChange?: (event: CustomEvent<{ open: boolean }>) => void;
3917
- }
3918
-
3919
- export interface KaiProgressBarElementEvents {
3920
-
3921
- }
3922
-
3923
- export interface KaiPromptDockElementEvents {
3924
-
3925
- }
3926
-
3927
- export interface KaiPromptInputElementEvents {
3928
- /** 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). */
3929
- onKaiAttachmentsChange?: (event: CustomEvent<{ attachments: { id: string; type: "file" | "source-document"; filename?: undefined | string; mediaType?: undefined | string; url?: undefined | string; title?: undefined | string }[] }>) => void;
3930
- /** The Stop button was clicked while `stoppable` and `loading` are both true. */
3931
- onKaiStop?: (event: CustomEvent<Record<string, never>>) => void;
3932
- /** 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. `<kai-prompt-input>` is the batteries-included composer row (send button, toolbar, attachment staging) built on `<kai-composer>`, the bare editor. */
3933
- 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;
3934
- /** A suggestion was clicked while `suggestion-mode="fill"`. */
3935
- onKaiSuggestionClick?: (event: CustomEvent<{ value: string }>) => void;
3936
- /** A custom `<kai-action>` toolbar button was clicked. `action` is the `id` of the `<kai-action>` element that was clicked. */
3937
- onKaiToolbarAction?: (event: CustomEvent<{ action: string }>) => void;
3938
- /** The input changed (fires on every edit). Carries the flattened `value` plus the structured `doc` + `entities`. */
3939
- 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;
3940
- /** The Voice (Mic) toolbar button was clicked. */
3941
- onKaiVoice?: (event: CustomEvent<Record<string, never>>) => void;
3942
- /** The web-search (Globe) toolbar button was clicked. */
3943
- onKaiWebSearch?: (event: CustomEvent<Record<string, never>>) => void;
3944
- }
3945
-
3946
- export interface KaiRadioGroupElementEvents {
3947
- /** A row was chosen. */
3948
- onKaiChange?: (event: CustomEvent<{ value: string }>) => void;
3949
- }
3950
-
3951
- export interface KaiReasoningElementEvents {
3952
- /** The reasoning block expanded or collapsed (via the trigger, streaming auto-open, or a method). */
3953
- onKaiOpenChange?: (event: CustomEvent<{ open: boolean }>) => void;
3954
- }
3955
-
3956
- export interface KaiRemoteElementEvents {
3957
-
3958
- }
3959
-
3960
- export interface KaiResizableElementEvents {
3961
- /** Fired on drag-end / keyboard resize / visibility change. `detail.sizes` = panel sizes in percent. */
3962
- onKaiChange?: (event: CustomEvent<{ sizes: number[] }>) => void;
3963
- /** Observe layout maximize state. */
3964
- onKaiMaximizeChange?: (event: CustomEvent<{ maximized: boolean; index: number | null }>) => void;
3965
- /** 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. */
3966
- onKaiMaximizeState?: (event: CustomEvent<{ maximized: boolean }>) => void;
3967
- }
3968
-
3969
- export interface KaiResizableItemElementEvents {
3970
- onKaiChange?: (event: CustomEvent<unknown>) => void;
3971
- onKaiMaximizeChange?: (event: CustomEvent<unknown>) => void;
3972
- onKaiMaximizeState?: (event: CustomEvent<unknown>) => void;
3973
- }
3974
-
3975
- export interface KaiResponseStreamElementEvents {
3976
- /** Streaming finished. */
3977
- onKaiComplete?: (event: CustomEvent) => void;
3978
- }
3979
-
3980
- export interface KaiScopePickerElementEvents {
3981
- /** The scope dropdown opened or closed (by click, keyboard, Escape, outside-click, or a method). */
3982
- onKaiOpenChange?: (event: CustomEvent<{ open: boolean }>) => void;
3983
- /** A scope was chosen (`undefined` filters = "All Content"). */
3984
- onKaiScopeChange?: (event: CustomEvent<{ filters: { tags?: undefined | string[]; authors?: undefined | string[]; contentType?: undefined | "transcript" | "markdown"; dateRange?: undefined | { from: string; to: string } } | undefined }>) => void;
3985
- }
3986
-
3987
- export interface KaiScreenElementEvents {
3988
- /** Back navigation intent: the back button or Escape. The consumer flips their own routing in response (the screen knows nothing about the trigger). */
3989
- onKaiBack?: (event: CustomEvent<Record<string, never>>) => void;
3990
- /** The screen opened or closed (a method, `Escape` close, or driven `open`). */
3991
- onKaiOpenChange?: (event: CustomEvent<{ open: boolean }>) => void;
3992
- }
3993
-
3994
- export interface KaiScrollAreaElementEvents {
3995
-
3996
- }
3997
-
3998
- export interface KaiScrollButtonElementEvents {
3999
- /** Emitted when the user clicks the button and `scrollToBottom()` is called. Carries no detail; consumers use it to know a manual scroll occurred. */
4000
- onKaiScroll?: (event: CustomEvent) => void;
4001
- }
4002
-
4003
- export interface KaiSearchElementEvents {
4004
- /** The field committed (blur). */
4005
- onKaiChange?: (event: CustomEvent<{ value: string }>) => void;
4006
- /** The query changed (debounced live, and on clear). */
4007
- onKaiSearch?: (event: CustomEvent<{ value: string }>) => void;
4008
- /** Enter was pressed. */
4009
- onKaiSubmit?: (event: CustomEvent<{ value: string }>) => void;
4010
- }
4011
-
4012
- export interface KaiSegmentedElementEvents {
4013
- /** A segment was chosen. */
4014
- onKaiChange?: (event: CustomEvent<{ value: string }>) => void;
4015
- }
4016
-
4017
- export interface KaiSelectElementEvents {
4018
- /** A choice was made. `value` is the first selected option (empty when nothing is selected); `values` is every selected option, which is what a `multiple` select needs. Both are always present, so neither shape silently loses the other. */
4019
- onKaiChange?: (event: CustomEvent<{ value: string; values: string[] }>) => void;
4020
- }
4021
-
4022
- export interface KaiSeparatorElementEvents {
4023
-
4024
- }
4025
-
4026
- export interface KaiSettingItemElementEvents {
4027
-
4028
- }
4029
-
4030
- export interface KaiSettingsGroupElementEvents {
4031
-
4032
- }
4033
-
4034
- export interface KaiSkeletonElementEvents {
4035
-
4036
- }
4037
-
4038
- export interface KaiSkillsElementEvents {
4039
-
4040
- }
4041
-
4042
- export interface KaiSliderElementEvents {
4043
- /** The value was committed: pointer released, or a key press finished. */
4044
- onKaiChange?: (event: CustomEvent<{ value: number }>) => void;
4045
- /** The thumb moved. Fires per step during a drag or a key press. */
4046
- onKaiInput?: (event: CustomEvent<{ value: number }>) => void;
4047
- }
4048
-
4049
- export interface KaiSourceElementEvents {
4050
-
4051
- }
4052
-
4053
- export interface KaiSourcesElementEvents {
4054
-
4055
- }
4056
-
4057
- export interface KaiStatusElementEvents {
4058
-
4059
- }
4060
-
4061
- export interface KaiSuggestionsElementEvents {
4062
- /** A suggestion was clicked. */
4063
- onKaiSelect?: (event: CustomEvent<{ value: string }>) => void;
4064
- }
4065
-
4066
- export interface KaiSwitchElementEvents {
4067
- /** The toggle changed. */
4068
- onKaiChange?: (event: CustomEvent<{ checked: boolean }>) => void;
4069
- }
4070
-
4071
- export interface KaiTabsElementEvents {
4072
- /** A tab was selected (click, Enter/Space, or arrow-key move). `value` is the item's id. */
4073
- onKaiTabChange?: (event: CustomEvent<{ value: string }>) => void;
4074
- }
4075
-
4076
- export interface KaiTasksElementEvents {
4077
- /** The selection changed on a toggle. Carries the selected ids in input order. */
4078
- onKaiValueChange?: (event: CustomEvent<{ value: string[] }>) => void;
4079
- }
4080
-
4081
- export interface KaiTextShimmerElementEvents {
4082
-
4083
- }
4084
-
4085
- export interface KaiThinkingBarElementEvents {
4086
- /** The "stop / answer now" affordance was clicked. */
4087
- onKaiStop?: (event: CustomEvent) => void;
4088
- }
4089
-
4090
- export interface KaiThreadElementEvents {
4091
- /** 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. */
4092
- onKaiMessageAction?: (event: CustomEvent<{ messageId: string; action: string; state?: undefined | "on" | "off" }>) => void;
4093
- }
4094
-
4095
- export interface KaiToastRegionElementEvents {
4096
- /** A toast's action button was pressed. */
4097
- onKaiAction?: (event: CustomEvent<{ id: string; label: string }>) => void;
4098
- /** A toast left the stack. `reason` is `'timeout' | 'close' | 'action'`. */
4099
- onKaiDismiss?: (event: CustomEvent<{ id: string; reason: "timeout" | "close" | "action" }>) => void;
4100
- }
4101
-
4102
- export interface KaiToolElementEvents {
4103
- /** The panel expanded or collapsed (by trigger click or a method). */
4104
- onKaiOpenChange?: (event: CustomEvent<{ open: boolean }>) => void;
4105
- }
4106
-
4107
- export interface KaiTooltipElementEvents {
4108
- /** The tooltip opened or closed (by hover/focus, outside-click, or a method). */
4109
- onKaiOpenChange?: (event: CustomEvent<{ open: boolean }>) => void;
4110
- }
4111
-
4112
- export interface KaiVoiceInputElementEvents {
4113
- /** 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). */
4114
- onKaiAudioCaptured?: (event: CustomEvent<{ blob: Blob }>) => void;
4115
- /** 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. */
4116
- onKaiRecordingChange?: (event: CustomEvent<{ recording: boolean }>) => void;
4117
- /** Live partial transcript during native recognition (only when `interim` is set). Fires repeatedly before the final `kai-transcription`. */
4118
- onKaiTranscriptInterim?: (event: CustomEvent<{ text: string }>) => void;
4119
- /** Final transcript: the `transcribe` property resolved, OR native `SpeechRecognition` produced final text (no `transcribe` set). */
4120
- onKaiTranscription?: (event: CustomEvent<{ text: string }>) => void;
4121
- /** A voice session failed, so no failure is ever silent. `detail.source` names the failing side (`recognition` on `<kai-voice-input>`, `synthesis` on `<kai-voice-output>`), `detail.error` carries the platform error code, the thrown exception's name, or `no-result` when recognition ended with no error and no text (the user said nothing), and `detail.message` is human-readable. Deliberate cancellation does not fire. */
4122
- onKaiVoiceError?: (event: CustomEvent<{ source: "recognition"; error: string; message: string }>) => void;
4123
- }
4124
-
4125
- export interface KaiVoiceOutputElementEvents {
4126
- /** Playback started or stopped. Drive your own UI in sync. `speaking: true` fires when audio actually starts (utterance.onstart natively; audio playback beginning on the `synthesize` path), not when speak() is called; earlier releases fired it optimistically inside speak() itself. Fires on real transitions only (manual click and programmatic speak()/stop()), never on mount. */
4127
- onKaiSpeakingChange?: (event: CustomEvent<{ speaking: boolean }>) => void;
4128
- /** The model path (`synthesize`) resolved audio: the raw `Blob` before playback. */
4129
- onKaiSynthesized?: (event: CustomEvent<{ blob: Blob }>) => void;
4130
- /** A voice session failed, so no failure is ever silent. `detail.source` names the failing side (`recognition` on `<kai-voice-input>`, `synthesis` on `<kai-voice-output>`), `detail.error` carries the platform error code, the thrown exception's name, or `no-result` when recognition ended with no error and no text (the user said nothing), and `detail.message` is human-readable. Deliberate cancellation does not fire. */
4131
- onKaiVoiceError?: (event: CustomEvent<{ source: "synthesis"; error: string; message: string }>) => void;
4132
- }
4133
-
4134
- export interface KaiWorkspaceElementEvents {
4135
- /** The aside was resized (fires per drag step, keyboard nudge, or a handle double-click reset), width in px. */
4136
- onKaiAsideResize?: (event: CustomEvent<{ side: "start" | "end"; width: number }>) => void;
4137
- /** An aside collapsed or expanded (a method, the breakpoint, the drawer's Escape). */
4138
- onKaiAsideToggle?: (event: CustomEvent<{ side: "start" | "end"; collapsed: boolean }>) => void;
4139
- }
4140
-
4141
- /** Attributes every kai-* element tolerates in a Vue template on top of its own
4142
- * props: `id`, `data-*`, `aria-*`, directives. The index signature keeps those
4143
- * legal under `strictTemplates` WITHOUT weakening the declared props — an
4144
- * explicit member always wins over an index signature. */
4145
- export interface KaiElementVueProps {
4146
- [attr: string]: unknown;
4147
- }
4148
-
4149
- /** A kai-* custom element as Vue's template type-checker sees it. Props are
4150
- * `Partial` because the kai- contract allows setting any of them imperatively
4151
- * through a ref instead of in the template. */
4152
- export type KaiVueElement<Props, Events> = new () => {
4153
- $props: Partial<Props> & Events & KaiElementVueProps;
4154
- };
4155
-
4156
- declare module 'vue' {
4157
- interface GlobalComponents {
4158
- 'kai-agent-card': KaiVueElement<KaiAgentCardElementProps, KaiAgentCardElementEvents>;
4159
- KaiAgentCard: KaiVueElement<KaiAgentCardElementProps, KaiAgentCardElementEvents>;
4160
- 'kai-artifact': KaiVueElement<KaiArtifactElementProps, KaiArtifactElementEvents>;
4161
- KaiArtifact: KaiVueElement<KaiArtifactElementProps, KaiArtifactElementEvents>;
4162
- 'kai-attachments': KaiVueElement<KaiAttachmentsElementProps, KaiAttachmentsElementEvents>;
4163
- KaiAttachments: KaiVueElement<KaiAttachmentsElementProps, KaiAttachmentsElementEvents>;
4164
- 'kai-audio-visualizer': KaiVueElement<KaiAudioVisualizerElementProps, KaiAudioVisualizerElementEvents>;
4165
- KaiAudioVisualizer: KaiVueElement<KaiAudioVisualizerElementProps, KaiAudioVisualizerElementEvents>;
4166
- 'kai-avatar': KaiVueElement<KaiAvatarElementProps, KaiAvatarElementEvents>;
4167
- KaiAvatar: KaiVueElement<KaiAvatarElementProps, KaiAvatarElementEvents>;
4168
- 'kai-badge': KaiVueElement<KaiBadgeElementProps, KaiBadgeElementEvents>;
4169
- KaiBadge: KaiVueElement<KaiBadgeElementProps, KaiBadgeElementEvents>;
4170
- 'kai-button': KaiVueElement<KaiButtonElementProps, KaiButtonElementEvents>;
4171
- KaiButton: KaiVueElement<KaiButtonElementProps, KaiButtonElementEvents>;
4172
- 'kai-card': KaiVueElement<KaiCardElementProps, KaiCardElementEvents>;
4173
- KaiCard: KaiVueElement<KaiCardElementProps, KaiCardElementEvents>;
4174
- 'kai-cards': KaiVueElement<KaiCardsElementProps, KaiCardsElementEvents>;
4175
- KaiCards: KaiVueElement<KaiCardsElementProps, KaiCardsElementEvents>;
4176
- 'kai-chain-of-thought': KaiVueElement<KaiChainOfThoughtElementProps, KaiChainOfThoughtElementEvents>;
4177
- KaiChainOfThought: KaiVueElement<KaiChainOfThoughtElementProps, KaiChainOfThoughtElementEvents>;
4178
- 'kai-chat': KaiVueElement<KaiChatElementProps, KaiChatElementEvents>;
4179
- KaiChat: KaiVueElement<KaiChatElementProps, KaiChatElementEvents>;
4180
- 'kai-checkbox': KaiVueElement<KaiCheckboxElementProps, KaiCheckboxElementEvents>;
4181
- KaiCheckbox: KaiVueElement<KaiCheckboxElementProps, KaiCheckboxElementEvents>;
4182
- 'kai-checkbox-group': KaiVueElement<KaiCheckboxGroupElementProps, KaiCheckboxGroupElementEvents>;
4183
- KaiCheckboxGroup: KaiVueElement<KaiCheckboxGroupElementProps, KaiCheckboxGroupElementEvents>;
4184
- 'kai-checkpoint': KaiVueElement<KaiCheckpointElementProps, KaiCheckpointElementEvents>;
4185
- KaiCheckpoint: KaiVueElement<KaiCheckpointElementProps, KaiCheckpointElementEvents>;
4186
- 'kai-choice': KaiVueElement<KaiChoiceElementProps, KaiChoiceElementEvents>;
4187
- KaiChoice: KaiVueElement<KaiChoiceElementProps, KaiChoiceElementEvents>;
4188
- 'kai-coachmark': KaiVueElement<KaiCoachmarkElementProps, KaiCoachmarkElementEvents>;
4189
- KaiCoachmark: KaiVueElement<KaiCoachmarkElementProps, KaiCoachmarkElementEvents>;
4190
- 'kai-code-block': KaiVueElement<KaiCodeBlockElementProps, KaiCodeBlockElementEvents>;
4191
- KaiCodeBlock: KaiVueElement<KaiCodeBlockElementProps, KaiCodeBlockElementEvents>;
4192
- 'kai-command': KaiVueElement<KaiCommandElementProps, KaiCommandElementEvents>;
4193
- KaiCommand: KaiVueElement<KaiCommandElementProps, KaiCommandElementEvents>;
4194
- 'kai-compare': KaiVueElement<KaiCompareElementProps, KaiCompareElementEvents>;
4195
- KaiCompare: KaiVueElement<KaiCompareElementProps, KaiCompareElementEvents>;
4196
- 'kai-composer': KaiVueElement<KaiComposerElementProps, KaiComposerElementEvents>;
4197
- KaiComposer: KaiVueElement<KaiComposerElementProps, KaiComposerElementEvents>;
4198
- 'kai-confirm': KaiVueElement<KaiConfirmElementProps, KaiConfirmElementEvents>;
4199
- KaiConfirm: KaiVueElement<KaiConfirmElementProps, KaiConfirmElementEvents>;
4200
- 'kai-context': KaiVueElement<KaiContextElementProps, KaiContextElementEvents>;
4201
- KaiContext: KaiVueElement<KaiContextElementProps, KaiContextElementEvents>;
4202
- 'kai-conversation-item': KaiVueElement<KaiConversationItemElementProps, KaiConversationItemElementEvents>;
4203
- KaiConversationItem: KaiVueElement<KaiConversationItemElementProps, KaiConversationItemElementEvents>;
4204
- 'kai-conversations': KaiVueElement<KaiConversationsElementProps, KaiConversationsElementEvents>;
4205
- KaiConversations: KaiVueElement<KaiConversationsElementProps, KaiConversationsElementEvents>;
4206
- 'kai-dialog': KaiVueElement<KaiDialogElementProps, KaiDialogElementEvents>;
4207
- KaiDialog: KaiVueElement<KaiDialogElementProps, KaiDialogElementEvents>;
4208
- 'kai-dock': KaiVueElement<KaiDockElementProps, KaiDockElementEvents>;
4209
- KaiDock: KaiVueElement<KaiDockElementProps, KaiDockElementEvents>;
4210
- 'kai-dropdown': KaiVueElement<KaiDropdownElementProps, KaiDropdownElementEvents>;
4211
- KaiDropdown: KaiVueElement<KaiDropdownElementProps, KaiDropdownElementEvents>;
4212
- 'kai-editable-label': KaiVueElement<KaiEditableLabelElementProps, KaiEditableLabelElementEvents>;
4213
- KaiEditableLabel: KaiVueElement<KaiEditableLabelElementProps, KaiEditableLabelElementEvents>;
4214
- 'kai-embed': KaiVueElement<KaiEmbedElementProps, KaiEmbedElementEvents>;
4215
- KaiEmbed: KaiVueElement<KaiEmbedElementProps, KaiEmbedElementEvents>;
4216
- 'kai-empty': KaiVueElement<KaiEmptyElementProps, KaiEmptyElementEvents>;
4217
- KaiEmpty: KaiVueElement<KaiEmptyElementProps, KaiEmptyElementEvents>;
4218
- 'kai-feedback-bar': KaiVueElement<KaiFeedbackBarElementProps, KaiFeedbackBarElementEvents>;
4219
- KaiFeedbackBar: KaiVueElement<KaiFeedbackBarElementProps, KaiFeedbackBarElementEvents>;
4220
- 'kai-file-tree': KaiVueElement<KaiFileTreeElementProps, KaiFileTreeElementEvents>;
4221
- KaiFileTree: KaiVueElement<KaiFileTreeElementProps, KaiFileTreeElementEvents>;
4222
- 'kai-file-upload': KaiVueElement<KaiFileUploadElementProps, KaiFileUploadElementEvents>;
4223
- KaiFileUpload: KaiVueElement<KaiFileUploadElementProps, KaiFileUploadElementEvents>;
4224
- 'kai-form': KaiVueElement<KaiFormElementProps, KaiFormElementEvents>;
4225
- KaiForm: KaiVueElement<KaiFormElementProps, KaiFormElementEvents>;
4226
- 'kai-hover-card': KaiVueElement<KaiHoverCardElementProps, KaiHoverCardElementEvents>;
4227
- KaiHoverCard: KaiVueElement<KaiHoverCardElementProps, KaiHoverCardElementEvents>;
4228
- 'kai-icon': KaiVueElement<KaiIconElementProps, KaiIconElementEvents>;
4229
- KaiIcon: KaiVueElement<KaiIconElementProps, KaiIconElementEvents>;
4230
- 'kai-image': KaiVueElement<KaiImageElementProps, KaiImageElementEvents>;
4231
- KaiImage: KaiVueElement<KaiImageElementProps, KaiImageElementEvents>;
4232
- 'kai-input': KaiVueElement<KaiInputElementProps, KaiInputElementEvents>;
4233
- KaiInput: KaiVueElement<KaiInputElementProps, KaiInputElementEvents>;
4234
- 'kai-kbd': KaiVueElement<KaiKbdElementProps, KaiKbdElementEvents>;
4235
- KaiKbd: KaiVueElement<KaiKbdElementProps, KaiKbdElementEvents>;
4236
- 'kai-link-preview': KaiVueElement<KaiLinkPreviewElementProps, KaiLinkPreviewElementEvents>;
4237
- KaiLinkPreview: KaiVueElement<KaiLinkPreviewElementProps, KaiLinkPreviewElementEvents>;
4238
- 'kai-loader': KaiVueElement<KaiLoaderElementProps, KaiLoaderElementEvents>;
4239
- KaiLoader: KaiVueElement<KaiLoaderElementProps, KaiLoaderElementEvents>;
4240
- 'kai-markdown': KaiVueElement<KaiMarkdownElementProps, KaiMarkdownElementEvents>;
4241
- KaiMarkdown: KaiVueElement<KaiMarkdownElementProps, KaiMarkdownElementEvents>;
4242
- 'kai-menu': KaiVueElement<KaiMenuElementProps, KaiMenuElementEvents>;
4243
- KaiMenu: KaiVueElement<KaiMenuElementProps, KaiMenuElementEvents>;
4244
- 'kai-message': KaiVueElement<KaiMessageElementProps, KaiMessageElementEvents>;
4245
- KaiMessage: KaiVueElement<KaiMessageElementProps, KaiMessageElementEvents>;
4246
- 'kai-model-switcher': KaiVueElement<KaiModelSwitcherElementProps, KaiModelSwitcherElementEvents>;
4247
- KaiModelSwitcher: KaiVueElement<KaiModelSwitcherElementProps, KaiModelSwitcherElementEvents>;
4248
- 'kai-nav': KaiVueElement<KaiNavElementProps, KaiNavElementEvents>;
4249
- KaiNav: KaiVueElement<KaiNavElementProps, KaiNavElementEvents>;
4250
- 'kai-notice': KaiVueElement<KaiNoticeElementProps, KaiNoticeElementEvents>;
4251
- KaiNotice: KaiVueElement<KaiNoticeElementProps, KaiNoticeElementEvents>;
4252
- 'kai-pane': KaiVueElement<KaiPaneElementProps, KaiPaneElementEvents>;
4253
- KaiPane: KaiVueElement<KaiPaneElementProps, KaiPaneElementEvents>;
4254
- 'kai-pane-grid': KaiVueElement<KaiPaneGridElementProps, KaiPaneGridElementEvents>;
4255
- KaiPaneGrid: KaiVueElement<KaiPaneGridElementProps, KaiPaneGridElementEvents>;
4256
- 'kai-pane-group': KaiVueElement<KaiPaneGroupElementProps, KaiPaneGroupElementEvents>;
4257
- KaiPaneGroup: KaiVueElement<KaiPaneGroupElementProps, KaiPaneGroupElementEvents>;
4258
- 'kai-popover': KaiVueElement<KaiPopoverElementProps, KaiPopoverElementEvents>;
4259
- KaiPopover: KaiVueElement<KaiPopoverElementProps, KaiPopoverElementEvents>;
4260
- 'kai-progress-bar': KaiVueElement<KaiProgressBarElementProps, KaiProgressBarElementEvents>;
4261
- KaiProgressBar: KaiVueElement<KaiProgressBarElementProps, KaiProgressBarElementEvents>;
4262
- 'kai-prompt-dock': KaiVueElement<KaiPromptDockElementProps, KaiPromptDockElementEvents>;
4263
- KaiPromptDock: KaiVueElement<KaiPromptDockElementProps, KaiPromptDockElementEvents>;
4264
- 'kai-prompt-input': KaiVueElement<KaiPromptInputElementProps, KaiPromptInputElementEvents>;
4265
- KaiPromptInput: KaiVueElement<KaiPromptInputElementProps, KaiPromptInputElementEvents>;
4266
- 'kai-radio-group': KaiVueElement<KaiRadioGroupElementProps, KaiRadioGroupElementEvents>;
4267
- KaiRadioGroup: KaiVueElement<KaiRadioGroupElementProps, KaiRadioGroupElementEvents>;
4268
- 'kai-reasoning': KaiVueElement<KaiReasoningElementProps, KaiReasoningElementEvents>;
4269
- KaiReasoning: KaiVueElement<KaiReasoningElementProps, KaiReasoningElementEvents>;
4270
- 'kai-remote': KaiVueElement<KaiRemoteElementProps, KaiRemoteElementEvents>;
4271
- KaiRemote: KaiVueElement<KaiRemoteElementProps, KaiRemoteElementEvents>;
4272
- 'kai-resizable': KaiVueElement<KaiResizableElementProps, KaiResizableElementEvents>;
4273
- KaiResizable: KaiVueElement<KaiResizableElementProps, KaiResizableElementEvents>;
4274
- 'kai-resizable-item': KaiVueElement<KaiResizableItemElementProps, KaiResizableItemElementEvents>;
4275
- KaiResizableItem: KaiVueElement<KaiResizableItemElementProps, KaiResizableItemElementEvents>;
4276
- 'kai-response-stream': KaiVueElement<KaiResponseStreamElementProps, KaiResponseStreamElementEvents>;
4277
- KaiResponseStream: KaiVueElement<KaiResponseStreamElementProps, KaiResponseStreamElementEvents>;
4278
- 'kai-scope-picker': KaiVueElement<KaiScopePickerElementProps, KaiScopePickerElementEvents>;
4279
- KaiScopePicker: KaiVueElement<KaiScopePickerElementProps, KaiScopePickerElementEvents>;
4280
- 'kai-screen': KaiVueElement<KaiScreenElementProps, KaiScreenElementEvents>;
4281
- KaiScreen: KaiVueElement<KaiScreenElementProps, KaiScreenElementEvents>;
4282
- 'kai-scroll-area': KaiVueElement<KaiScrollAreaElementProps, KaiScrollAreaElementEvents>;
4283
- KaiScrollArea: KaiVueElement<KaiScrollAreaElementProps, KaiScrollAreaElementEvents>;
4284
- 'kai-scroll-button': KaiVueElement<KaiScrollButtonElementProps, KaiScrollButtonElementEvents>;
4285
- KaiScrollButton: KaiVueElement<KaiScrollButtonElementProps, KaiScrollButtonElementEvents>;
4286
- 'kai-search': KaiVueElement<KaiSearchElementProps, KaiSearchElementEvents>;
4287
- KaiSearch: KaiVueElement<KaiSearchElementProps, KaiSearchElementEvents>;
4288
- 'kai-segmented': KaiVueElement<KaiSegmentedElementProps, KaiSegmentedElementEvents>;
4289
- KaiSegmented: KaiVueElement<KaiSegmentedElementProps, KaiSegmentedElementEvents>;
4290
- 'kai-select': KaiVueElement<KaiSelectElementProps, KaiSelectElementEvents>;
4291
- KaiSelect: KaiVueElement<KaiSelectElementProps, KaiSelectElementEvents>;
4292
- 'kai-separator': KaiVueElement<KaiSeparatorElementProps, KaiSeparatorElementEvents>;
4293
- KaiSeparator: KaiVueElement<KaiSeparatorElementProps, KaiSeparatorElementEvents>;
4294
- 'kai-setting-item': KaiVueElement<KaiSettingItemElementProps, KaiSettingItemElementEvents>;
4295
- KaiSettingItem: KaiVueElement<KaiSettingItemElementProps, KaiSettingItemElementEvents>;
4296
- 'kai-settings-group': KaiVueElement<KaiSettingsGroupElementProps, KaiSettingsGroupElementEvents>;
4297
- KaiSettingsGroup: KaiVueElement<KaiSettingsGroupElementProps, KaiSettingsGroupElementEvents>;
4298
- 'kai-skeleton': KaiVueElement<KaiSkeletonElementProps, KaiSkeletonElementEvents>;
4299
- KaiSkeleton: KaiVueElement<KaiSkeletonElementProps, KaiSkeletonElementEvents>;
4300
- 'kai-skills': KaiVueElement<KaiSkillsElementProps, KaiSkillsElementEvents>;
4301
- KaiSkills: KaiVueElement<KaiSkillsElementProps, KaiSkillsElementEvents>;
4302
- 'kai-slider': KaiVueElement<KaiSliderElementProps, KaiSliderElementEvents>;
4303
- KaiSlider: KaiVueElement<KaiSliderElementProps, KaiSliderElementEvents>;
4304
- 'kai-source': KaiVueElement<KaiSourceElementProps, KaiSourceElementEvents>;
4305
- KaiSource: KaiVueElement<KaiSourceElementProps, KaiSourceElementEvents>;
4306
- 'kai-sources': KaiVueElement<KaiSourcesElementProps, KaiSourcesElementEvents>;
4307
- KaiSources: KaiVueElement<KaiSourcesElementProps, KaiSourcesElementEvents>;
4308
- 'kai-status': KaiVueElement<KaiStatusElementProps, KaiStatusElementEvents>;
4309
- KaiStatus: KaiVueElement<KaiStatusElementProps, KaiStatusElementEvents>;
4310
- 'kai-suggestions': KaiVueElement<KaiSuggestionsElementProps, KaiSuggestionsElementEvents>;
4311
- KaiSuggestions: KaiVueElement<KaiSuggestionsElementProps, KaiSuggestionsElementEvents>;
4312
- 'kai-switch': KaiVueElement<KaiSwitchElementProps, KaiSwitchElementEvents>;
4313
- KaiSwitch: KaiVueElement<KaiSwitchElementProps, KaiSwitchElementEvents>;
4314
- 'kai-tabs': KaiVueElement<KaiTabsElementProps, KaiTabsElementEvents>;
4315
- KaiTabs: KaiVueElement<KaiTabsElementProps, KaiTabsElementEvents>;
4316
- 'kai-tasks': KaiVueElement<KaiTasksElementProps, KaiTasksElementEvents>;
4317
- KaiTasks: KaiVueElement<KaiTasksElementProps, KaiTasksElementEvents>;
4318
- 'kai-text-shimmer': KaiVueElement<KaiTextShimmerElementProps, KaiTextShimmerElementEvents>;
4319
- KaiTextShimmer: KaiVueElement<KaiTextShimmerElementProps, KaiTextShimmerElementEvents>;
4320
- 'kai-thinking-bar': KaiVueElement<KaiThinkingBarElementProps, KaiThinkingBarElementEvents>;
4321
- KaiThinkingBar: KaiVueElement<KaiThinkingBarElementProps, KaiThinkingBarElementEvents>;
4322
- 'kai-thread': KaiVueElement<KaiThreadElementProps, KaiThreadElementEvents>;
4323
- KaiThread: KaiVueElement<KaiThreadElementProps, KaiThreadElementEvents>;
4324
- 'kai-toast-region': KaiVueElement<KaiToastRegionElementProps, KaiToastRegionElementEvents>;
4325
- KaiToastRegion: KaiVueElement<KaiToastRegionElementProps, KaiToastRegionElementEvents>;
4326
- 'kai-tool': KaiVueElement<KaiToolElementProps, KaiToolElementEvents>;
4327
- KaiTool: KaiVueElement<KaiToolElementProps, KaiToolElementEvents>;
4328
- 'kai-tooltip': KaiVueElement<KaiTooltipElementProps, KaiTooltipElementEvents>;
4329
- KaiTooltip: KaiVueElement<KaiTooltipElementProps, KaiTooltipElementEvents>;
4330
- 'kai-voice-input': KaiVueElement<KaiVoiceInputElementProps, KaiVoiceInputElementEvents>;
4331
- KaiVoiceInput: KaiVueElement<KaiVoiceInputElementProps, KaiVoiceInputElementEvents>;
4332
- 'kai-voice-output': KaiVueElement<KaiVoiceOutputElementProps, KaiVoiceOutputElementEvents>;
4333
- KaiVoiceOutput: KaiVueElement<KaiVoiceOutputElementProps, KaiVoiceOutputElementEvents>;
4334
- 'kai-workspace': KaiVueElement<KaiWorkspaceElementProps, KaiWorkspaceElementEvents>;
4335
- KaiWorkspace: KaiVueElement<KaiWorkspaceElementProps, KaiWorkspaceElementEvents>;
4336
- }
4337
- }