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