@kitn.ai/ui 0.20.1 → 0.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +77 -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-COnPwAQN.js +338 -0
- package/dist/create-tween-DmTUaXWE.js +341 -0
- package/dist/create-tween-qs-jjvNA.js +7 -0
- package/dist/custom-elements.json +1726 -463
- 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-CHG5z5L7.js} +1 -1
- package/dist/elements/chunks/{action-icons-ns1Fnedj.js → action-icons-BAtCEEgg.js} +1 -1
- package/dist/elements/chunks/arrow-left-CFPTeL1Y.js +1 -0
- package/dist/elements/chunks/artifact-fBZOE4SO.js +1 -0
- package/dist/elements/chunks/{attachments-mCB5F1Fq.js → attachments-DpYMe5VQ.js} +1 -1
- package/dist/elements/chunks/audio-visualizer-DFwzAcuL.js +1 -0
- package/dist/elements/chunks/{badge-B4Zuajl2.js → badge-D6zodm6E.js} +1 -1
- package/dist/elements/chunks/{button-ZWNif3--.js → button-C42vrGvO.js} +1 -1
- package/dist/elements/chunks/card-renderer-DMZsSuvU.js +1 -0
- package/dist/elements/chunks/card-tags-D8lZ-C_U.js +1 -0
- package/dist/elements/chunks/chat-thread-CNNEhol-.js +1 -0
- package/dist/elements/chunks/check-7Q3K-iXE.js +1 -0
- package/dist/elements/chunks/chevron-down-CpNYLn7E.js +1 -0
- package/dist/elements/chunks/chevron-right-DrH85Fha.js +1 -0
- package/dist/elements/chunks/choice-card-YoWjpsFV.js +1 -0
- package/dist/elements/chunks/circle-C9KRjKYv.js +1 -0
- package/dist/elements/chunks/circle-check-Dmi7Y4zw.js +1 -0
- package/dist/elements/chunks/{circle-x-B7faJFlY.js → circle-x-QIxXda6k.js} +1 -1
- package/dist/elements/chunks/code-block-CqeugReY.js +1 -0
- package/dist/elements/chunks/{collapsible-DM1Ckd4e.js → collapsible-sTv-_5lF.js} +1 -1
- package/dist/elements/chunks/{composer-BguS0QL_.js → composer-ldQyeVEB.js} +2 -2
- package/dist/elements/chunks/confirm-card-C0RNOwfn.js +1 -0
- package/dist/elements/chunks/context-5qgypNHC.js +1 -0
- package/dist/elements/chunks/conversation-list-DLzOacXz.js +1 -0
- package/dist/elements/chunks/create-tween-V4TXZ93X.js +7 -0
- package/dist/elements/chunks/default-input-DeeRSDHc.js +1 -0
- package/dist/elements/chunks/define-lE-QvQFn.js +1 -0
- package/dist/elements/chunks/{disclosure-CIZ5c8nO.js → disclosure-DZSa9jog.js} +1 -1
- package/dist/elements/chunks/{download-Dsbg3ste.js → download-B2ZmnGqW.js} +1 -1
- package/dist/elements/chunks/{dropdown-BDd1-Zgi.js → dropdown-R3B7cSRE.js} +1 -1
- package/dist/elements/chunks/{ellipsis-Dw6qrss-.js → ellipsis-BmxceY4l.js} +1 -1
- package/dist/elements/chunks/embed-BVrtTZPo.js +1 -0
- package/dist/elements/chunks/{external-link-Vt74zAoL.js → external-link-BbdR7YO7.js} +1 -1
- package/dist/elements/chunks/{file-text-CZrZF6_v.js → file-text-D7dijo1A.js} +1 -1
- package/dist/elements/chunks/{file-tree-DF4okKyo.js → file-tree-0upJ5jeb.js} +1 -1
- package/dist/elements/chunks/{folder-glP5rha4.js → folder-D8z58t7B.js} +1 -1
- package/dist/elements/chunks/form-p5BKJNw5.js +1 -0
- package/dist/elements/chunks/hover-card-CN9s2md5.js +1 -0
- package/dist/elements/chunks/{icon-BLb8beoi.js → icon-CNiKP37E.js} +1 -1
- package/dist/elements/chunks/{info-CIsv92JK.js → info-BSnuJiHI.js} +1 -1
- package/dist/elements/chunks/{input-Dds1kFyt.js → input-BauDmzxX.js} +1 -1
- package/dist/elements/chunks/{kbd-De_xbgi9.js → kbd-BlHJaP9b.js} +1 -1
- package/dist/elements/chunks/{link-i4r_k7z4.js → link-DEi5iUWC.js} +1 -1
- package/dist/elements/chunks/link-preview-BaHyM6W4.js +1 -0
- package/dist/elements/chunks/{loader-BmQH4s3V.js → loader-CmJG_Fkq.js} +1 -1
- package/dist/elements/chunks/{markdown-Zi21WhUz.js → markdown-D2jaMpCN.js} +1 -1
- package/dist/elements/chunks/message-C5UfXZ2Z.js +1 -0
- package/dist/elements/chunks/message-CXWLmmLn.js +1 -0
- package/dist/elements/chunks/message-square-hXylwsy0.js +1 -0
- package/dist/elements/chunks/{minimize-2--ifeCGrl.js → minimize-2-C9ytZFMU.js} +1 -1
- package/dist/elements/chunks/model-switcher-CivGfD7-.js +1 -0
- package/dist/elements/chunks/{overlay-kD8dwRv_.js → overlay-DJL_sbOm.js} +1 -1
- package/dist/elements/chunks/{paperclip-q21dYOSK.js → paperclip-CFaB8naM.js} +1 -1
- package/dist/elements/chunks/{progress-bar-BrAIIaaJ.js → progress-bar-Br5SksfR.js} +1 -1
- package/dist/elements/chunks/{prompt-suggestion-Bjn2K-fR.js → prompt-suggestion-CMIvtAhU.js} +1 -1
- package/dist/elements/chunks/reasoning-DpZcNzLq.js +1 -0
- package/dist/elements/chunks/{resizable-Dp4JExql.js → resizable-Q8i3T9a_.js} +1 -1
- package/dist/elements/chunks/{rotate-cw-CFWWkpj2.js → rotate-cw-B5IHCBFV.js} +1 -1
- package/dist/elements/chunks/{scroll-area-Bb0kHH1j.js → scroll-area-eLeydBje.js} +1 -1
- package/dist/elements/chunks/scroll-button-DWbz0yA1.js +1 -0
- package/dist/elements/chunks/{separator-9kRgr1X9.js → separator-Xic78AD_.js} +1 -1
- package/dist/elements/chunks/{settings-B8lmec4D.js → settings-B8H51pAx.js} +1 -1
- package/dist/elements/chunks/{settings-group-I0hEuXiN.js → settings-group-CsG9eYLe.js} +1 -1
- package/dist/elements/chunks/{share-C3lTiYGt.js → share-CNTx0z__.js} +1 -1
- package/dist/elements/chunks/skeleton-CLlHTcMI.js +1 -0
- package/dist/elements/chunks/slots-CIw9RlAe.js +1 -0
- package/dist/elements/chunks/source-BoVcU5ok.js +1 -0
- package/dist/elements/chunks/{star-CSJtGxgv.js → star-CxQVTVhI.js} +1 -1
- package/dist/elements/chunks/{store-CHyW95TP.js → store-CLtS5CUG.js} +1 -1
- package/dist/elements/chunks/tasks-card-CzlkLmUt.js +1 -0
- package/dist/elements/chunks/{text-shimmer-Cn9TmNpI.js → text-shimmer-D5NhpIQ1.js} +1 -1
- package/dist/elements/chunks/textarea-x5Uxsmtm.js +1 -0
- package/dist/elements/chunks/{thumbs-up-PNVVThEF.js → thumbs-up-UobcJnx9.js} +1 -1
- package/dist/elements/chunks/{toast-store-DKbQn3Wn.js → toast-store-BOfs9eXq.js} +1 -1
- package/dist/elements/chunks/{tool-DjTRpIpl.js → tool-Be6Dh_dt.js} +1 -1
- package/dist/elements/chunks/tooltip-RxMxyCLF.js +1 -0
- package/dist/elements/chunks/{triangle-alert-DsHTHCPm.js → triangle-alert-C4yxH2XN.js} +1 -1
- package/dist/elements/chunks/use-card-resolution-jva9ehH6.js +1 -0
- package/dist/elements/chunks/{variant-aurora-Dc4nQUia.js → variant-aurora-Dx4VRcjS.js} +2 -2
- package/dist/elements/chunks/{variant-custom-y_3kVQhS.js → variant-custom-Y1ZTWgEa.js} +1 -1
- package/dist/elements/chunks/{variant-wave-D5OR1-9Z.js → variant-wave-B9gml9Cg.js} +2 -2
- package/dist/elements/chunks/{video-B7vmenoC.js → video-CrPHsytT.js} +1 -1
- package/dist/elements/chunks/x-_-OPHept.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 +34 -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 +1 -1
- 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/slot-text.d.ts +51 -0
- package/dist/elements/slots.d.ts +21 -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 +2734 -217
- package/dist/index.d.ts +163 -125
- package/dist/index.js +6572 -5990
- package/dist/index.server.d.ts +5 -0
- package/dist/index.server.js +5403 -4860
- 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 +774 -151
- package/dist/llms/llms.txt +57 -5
- package/dist/mcp.es.js +4756 -782
- 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 +730 -302
- package/dist/react/use-kai-chat.d.ts +8 -4
- package/dist/react.d.ts +5 -0
- package/dist/react.js +418 -317
- package/dist/register-impl-AxIlqjo7.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-BGYSJyHG.js +22960 -0
- package/dist/solid-Dt2nEwfl.js +20194 -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-DVtGqVH6.js → variant-aurora-B44X69AG.js} +1 -1
- package/dist/variant-aurora-BRhV8Flk.js +391 -0
- package/dist/variant-aurora-Ds5ou9BH.js +381 -0
- package/dist/variant-custom-B20FhtYj.js +170 -0
- package/dist/{variant-custom-Dif-IV4u.js → variant-custom-BvA1Schl.js} +1 -1
- package/dist/variant-custom-D6Rtvneb.js +200 -0
- package/dist/{variant-wave-DbfNdvSi.js → variant-wave-BUQtkryq.js} +1 -1
- package/dist/variant-wave-BVYnqy9L.js +218 -0
- package/dist/variant-wave-DXC6_LcH.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 +221 -0
- package/dist/wire/files.d.ts +116 -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 +16 -0
- package/dist/wire/media-types.d.ts +106 -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 +1126 -0
- package/frameworks/react/index.tsx +191 -158
- package/frameworks/react/runtime.tsx +21 -1
- package/frameworks/react/use-kai-chat.tsx +11 -1
- package/llms-full.txt +774 -151
- package/llms.txt +57 -5
- package/package.json +62 -8
- package/src/agent-tooling/archetypes.ts +127 -0
- package/src/agent-tooling/integrations/anthropic.ts +436 -0
- package/src/agent-tooling/integrations/cloudflare.ts +141 -52
- package/src/agent-tooling/integrations/langgraph.ts +80 -13
- package/src/agent-tooling/integrations/mastra.ts +161 -12
- package/src/agent-tooling/integrations/mock.ts +47 -8
- package/src/agent-tooling/integrations/ollama.ts +68 -24
- package/src/agent-tooling/integrations/openai.ts +89 -0
- package/src/agent-tooling/integrations/openrouter.ts +58 -8
- package/src/agent-tooling/integrations/pi.ts +104 -23
- package/src/agent-tooling/integrations/pydantic-ai.ts +61 -5
- package/src/agent-tooling/integrations/vercel-ai-sdk.ts +120 -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 +4152 -661
- package/src/agent-tooling/registry.ts +74 -0
- package/src/agent-tooling/types.ts +361 -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 +128 -52
- 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 +30 -16
- package/src/components/conversation-item.tsx +6 -0
- 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/model-switcher.tsx +38 -8
- 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 +17 -6
- 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 +29 -6
- 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 +90 -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 +131 -8
- 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 +1624 -306
- package/src/elements/element-types.d.ts +2645 -214
- 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 +40 -32
- 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/slot-text.ts +73 -0
- package/src/elements/slots.ts +67 -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 +145 -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 +689 -0
- package/src/wire/files.ts +342 -0
- package/src/wire/formats/anthropic.ts +267 -0
- package/src/wire/formats/openai.ts +187 -0
- package/src/wire/index.ts +73 -0
- package/src/wire/media-types.ts +344 -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/default-input-Cqqilg9t.js +0 -1
- 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/model-switcher-B94YAKsM.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/schemas.js
ADDED
|
@@ -0,0 +1,717 @@
|
|
|
1
|
+
var R = Object.defineProperty;
|
|
2
|
+
var P = (e, t, i) => t in e ? R(e, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : e[t] = i;
|
|
3
|
+
var w = (e, t, i) => P(e, typeof t != "symbol" ? t + "" : t, i);
|
|
4
|
+
const N = "https://json-schema.org/draft/2020-12/schema", _ = "https://kitn.ai/schemas/card/artifact.schema.json", D = "ArtifactCardData", z = "Generated-artifact viewer payload: a framed preview plus the source files behind it. A deliberately NARROW subset of the Artifact component's props — it says WHAT to show, never how the viewer behaves. Toolbar composition, view-state and the iframe `sandbox` are host-owned and stay off the wire, so a model cannot widen its own sandbox or hide the chrome the user needs to inspect what it built.", M = "object";
|
|
5
|
+
const U = [{ required: ["src"] }, { required: ["files"] }], F = { src: { type: "string", format: "uri", description: "URL the preview iframe frames, and the target of the Home button. Omit for a source-only artifact (`tab: 'code'` with `files`).", "x-kai-format": "url" }, files: { type: "array", description: "Files behind the artifact: the Code tab's tree, each optionally carrying its own preview url and source.", maxItems: 500, items: { type: "object", required: ["path"], additionalProperties: !1, properties: { path: { type: "string", description: "Tree label/key. Folders are built from `/`-delimited segments.", maxLength: 1024 }, url: { type: "string", format: "uri", description: "Where the preview loads this file. Defaults to `path` resolved against `src`.", "x-kai-format": "url" }, code: { type: "string", description: "Source shown in the Code tab. Omit for binary files (image/pdf), which have no code view." }, language: { type: "string", description: "Language id for syntax highlighting (e.g. 'html', 'css', 'tsx').", maxLength: 40 }, type: { type: "string", enum: ["html", "pdf", "image", "other"], description: "File kind. Drives the tree icon and whether the Code view applies; 'pdf' also routes the preview to the inline PDF viewer.", "x-kai-control": "select" }, additions: { type: "integer", minimum: 0, description: "Lines added vs the base. Rendered as a trailing '+N' stat." }, deletions: { type: "integer", minimum: 0, description: "Lines removed vs the base. Rendered as a trailing '-N' stat." }, status: { type: "string", enum: ["added", "modified", "deleted", "renamed", "untracked"], description: "Change status vs the base. Drives a trailing status letter in the conventional VCS hue.", "x-kai-control": "select" } } } }, tab: { type: "string", enum: ["preview", "code"], default: "preview", description: "Which view the card OPENS on. SEED ONLY: the user can switch freely afterwards and a revision of this card will NOT move them back, because the user's choice wins over the model's. A switch is reported back as a `state` patch.", "x-kai-control": "select" }, activeFile: { type: "string", description: "Path of the file selected in the tree when the card FIRST renders (must match a `files[].path`). Seeds the tree highlight, the Code source and the preview. SEED ONLY, like `tab`: revising this card will not move a user who has since selected a different file.", maxLength: 1024 }, displayUrl: { type: "string", description: "Friendly address shown in the path field INSTEAD of the real url, which also makes the field read-only. Use when `src` is not consumer-facing (e.g. a `data:` blob) so a clean address is shown rather than leaking it.", maxLength: 2048 }, height: { description: "Frame height. A bare number is px; a string is any CSS length. Defaults to 420px. REQUIRED CONCEPT, not decoration: the viewer is built to fill its container, and a message thread supplies no height, so the card sets one explicitly or the artifact collapses to zero and renders invisible.", oneOf: [{ type: "number", minimum: 1 }, { type: "string", maxLength: 32 }] } }, J = {
|
|
6
|
+
$schema: N,
|
|
7
|
+
$id: _,
|
|
8
|
+
title: D,
|
|
9
|
+
description: z,
|
|
10
|
+
type: M,
|
|
11
|
+
additionalProperties: !1,
|
|
12
|
+
anyOf: U,
|
|
13
|
+
properties: F
|
|
14
|
+
}, Y = "https://json-schema.org/draft/2020-12/schema", B = "https://kitn.ai/schemas/card/card-envelope.schema.json", H = "CardEnvelope", K = "A card the agent/server asks the chat to render. `data` validates against the per-type schema.", W = "object", V = ["type", "id", "data"], G = { type: { type: "string", minLength: 1 }, id: { type: "string", minLength: 1 }, data: {}, title: { type: "string" } }, Q = {
|
|
15
|
+
$schema: Y,
|
|
16
|
+
$id: B,
|
|
17
|
+
title: H,
|
|
18
|
+
description: K,
|
|
19
|
+
type: W,
|
|
20
|
+
required: V,
|
|
21
|
+
properties: G
|
|
22
|
+
}, X = "https://json-schema.org/draft/2020-12/schema", Z = "https://kitn.ai/schemas/card/card-event.schema.json", ee = "CardEvent", te = "An event a card emits up to the host. `kind` discriminates the payload.", ie = "object", ne = ["kind"], se = { kind: { enum: ["ready", "submit", "action", "send-prompt", "open", "resize", "state", "dismiss", "error"] }, cardId: { type: "string" } }, oe = {
|
|
23
|
+
$schema: X,
|
|
24
|
+
$id: Z,
|
|
25
|
+
title: ee,
|
|
26
|
+
description: te,
|
|
27
|
+
type: ie,
|
|
28
|
+
required: ne,
|
|
29
|
+
properties: se
|
|
30
|
+
}, re = "https://json-schema.org/draft/2020-12/schema", ae = "https://kitn.ai/schemas/card/choice.schema.json", pe = "ChoiceCardData", de = "Data payload for a `choice` card (CardEnvelope.data when type='choice'). A single-select 'pick one of N rich options' card; activating an option emits the `action` verb.", ce = "object", ue = ["options"], le = { prompt: { type: "string", description: "Optional question/body text rendered above the options. Distinct from CardEnvelope.title (the card chrome heading)." }, submitLabel: { type: "string", description: "Label for the Submit button; default 'Submit'." }, options: { type: "array", minItems: 1, description: "The selectable options, rendered in order. Exactly one can be chosen.", items: { type: "object", required: ["id", "label"], properties: { id: { type: "string", minLength: 1, description: "Emitted as CardEvent.action. Must be unique within `options`. (The reserved id '__other__' is used by the allowOther escape.)", "x-kai-unique": !0 }, label: { type: "string", minLength: 1, description: "Visible option label." }, description: { type: "string", description: "Optional secondary line under the label." }, media: { type: "object", description: "Optional leading media: an image URL or a named icon.", properties: { image: { type: "string", description: "Image URL rendered as a leading thumbnail in the row." }, imageAlt: { type: "string", description: "Accessible alt text for `image` (decorative if omitted)." }, icon: { type: "string", description: "Named icon rendered as a leading glyph." } } }, meta: { type: "string", description: "Trailing freeform text (e.g. a price or badge), right-aligned in the row." }, recommended: { type: "boolean", default: !1, description: "Renders a small 'Recommended' pill near the label." }, disabled: { type: "boolean", default: !1, description: "Option is shown but not selectable, and skipped in keyboard nav." }, payload: { description: "Optional opaque payload echoed back in CardEvent.payload (any JSON)." } } } }, allowOther: { description: "Optional free-text escape ('none of these / specify'). `true` appends a final 'Other…' option; an object customizes its `label`/`placeholder`. Selecting it reveals a text input; the shared Submit button then emits `{ kind:'action', action:'__other__', payload:{ text } }`.", "x-kai-control": "allow-other" }, dismissible: { type: "boolean", default: !1, description: "Show a close affordance that emits the `dismiss` verb. The card collapses to a re-openable 'dismissed' stub; the host decides via `onReopen` whether it comes back live or `expired`." } }, me = {
|
|
31
|
+
$schema: re,
|
|
32
|
+
$id: ae,
|
|
33
|
+
title: pe,
|
|
34
|
+
description: de,
|
|
35
|
+
type: ce,
|
|
36
|
+
required: ue,
|
|
37
|
+
properties: le
|
|
38
|
+
}, he = "https://json-schema.org/draft/2020-12/schema", ye = "https://kitn.ai/schemas/card/confirm.schema.json", fe = "ConfirmCardData", ge = "Data payload for a `confirm` card (CardEnvelope.data when type='confirm').", be = "object", $e = ["actions"], ve = { heading: { type: "string", description: "Optional in-body heading. Distinct from CardEnvelope.title (the card chrome title)." }, body: { type: "string", description: "Body text. Plain text in v1 (rendered safely; no HTML injection)." }, tone: { type: "string", enum: ["default", "warning", "danger"], default: "default", description: "Overall card tone; 'danger' adds a warning icon + accent for destructive approvals.", "x-kai-control": "tone" }, actions: { type: "array", minItems: 1, maxItems: 4, description: "The choice set. Rendered as buttons in order; max 4 keeps it a decision, not a menu.", items: { type: "object", required: ["id", "label"], properties: { id: { type: "string", minLength: 1, description: "Emitted as CardEvent.action. Must be unique within `actions`.", "x-kai-unique": !0 }, label: { type: "string", minLength: 1, description: "Visible button label." }, style: { type: "string", enum: ["primary", "default", "destructive"], default: "default", description: "Button emphasis. 'destructive' = red/danger; 'primary' = filled accent.", "x-kai-control": "button-style" }, payload: { description: "Optional opaque payload echoed back in CardEvent.payload (any JSON)." }, default: { type: "boolean", default: !1, description: "If true, this action is the keyboard default (Enter) and gets initial focus. At most one should be true; the card uses the first if several are.", "x-kai-default-action": !0 } } } }, dismissible: { type: "boolean", default: !1, description: "Show a close affordance that emits the `dismiss` verb." } }, we = {
|
|
39
|
+
$schema: he,
|
|
40
|
+
$id: ye,
|
|
41
|
+
title: fe,
|
|
42
|
+
description: ge,
|
|
43
|
+
type: be,
|
|
44
|
+
required: $e,
|
|
45
|
+
properties: ve
|
|
46
|
+
}, xe = "https://json-schema.org/draft/2020-12/schema", ke = "https://kitn.ai/schemas/card/embed.schema.json", Oe = "EmbedCardData", je = "Lazy media-embed payload (YouTube / Vimeo / generic player URL).", Se = "object", Ae = ["provider"], Ie = !1, qe = { provider: { type: "string", enum: ["youtube", "vimeo", "generic"], description: "Media provider. 'generic' frames `url` directly (must be an https embeddable player URL whose origin is app-allowlisted).", "x-kai-control": "select" }, id: { type: "string", description: "Provider video id (required for youtube/vimeo when `url` is absent). e.g. 'dQw4w9WgXcQ'.", maxLength: 64, pattern: "^[A-Za-z0-9_-]+$" }, url: { type: "string", format: "uri", description: "Full media/watch URL. For youtube/vimeo it is parsed to an id; for 'generic' it is the embeddable player src (https only).", "x-kai-format": "url" }, title: { type: "string", description: "Accessible title for the player iframe + the poster label. Strongly recommended for a11y.", maxLength: 300 }, poster: { type: "string", format: "uri", description: "Thumbnail shown before play. When omitted, youtube/vimeo derive a default thumbnail; 'generic' shows a neutral play placeholder.", "x-kai-format": "url" }, start: { type: "integer", minimum: 0, description: "Optional start offset in seconds.", "x-kai-unit": "seconds" }, aspectRatio: { type: "string", enum: ["16:9", "4:3", "1:1", "9:16"], default: "16:9", description: "Player box aspect ratio (CSS aspect-ratio).", "x-kai-control": "select" } }, Le = [{ if: { properties: { provider: { const: "generic" } } }, then: { required: ["url"] } }, { if: { properties: { provider: { enum: ["youtube", "vimeo"] } } }, then: { anyOf: [{ required: ["id"] }, { required: ["url"] }] } }], Ce = {
|
|
47
|
+
$schema: xe,
|
|
48
|
+
$id: ke,
|
|
49
|
+
title: Oe,
|
|
50
|
+
description: je,
|
|
51
|
+
type: Se,
|
|
52
|
+
required: Ae,
|
|
53
|
+
additionalProperties: Ie,
|
|
54
|
+
properties: qe,
|
|
55
|
+
allOf: Le
|
|
56
|
+
}, Ee = "https://json-schema.org/draft/2020-12/schema", Te = "https://kitn.ai/schemas/card/form.result.schema.json", Re = "kai-form submit payload", Pe = "The CardEvent {kind:'submit'} `data` for a form card: an object that validates against the form-definition schema that was sent down in CardEnvelope.data. Standard JSON Schema validation (type/enum/required/min-max/length/pattern) holds. Optional empty strings are omitted.", Ne = "object", _e = {
|
|
57
|
+
$schema: Ee,
|
|
58
|
+
$id: Te,
|
|
59
|
+
title: Re,
|
|
60
|
+
description: Pe,
|
|
61
|
+
type: Ne
|
|
62
|
+
}, De = "https://json-schema.org/draft/2020-12/schema", ze = "https://kitn.ai/schemas/card/form.schema.json", Me = "kai-form data (a form definition)", Ue = "The CardEnvelope.data for a card of type 'form': a JSON Schema (type:'object') describing the fields kai-form renders, plus optional x-kai-* UI hints. The same schema validates the submission.", Fe = "object", Je = ["type", "properties"], Ye = { type: { const: "object" }, title: { type: "string" }, description: { type: "string" }, required: { type: "array", items: { type: "string" } }, properties: { type: "object" }, "x-kai-order": { type: "array", items: { type: "string" } }, "x-kai-inlineMax": { type: "integer", minimum: 1 }, "x-kai-submitLabel": { type: "string" }, "x-kai-dismissible": { type: "boolean" }, "x-kai-actions": { type: "array", items: { type: "object", required: ["id", "label"], properties: { id: { type: "string" }, label: { type: "string" }, variant: { enum: ["default", "ghost", "outline"] } } } } }, Be = {
|
|
63
|
+
$schema: De,
|
|
64
|
+
$id: ze,
|
|
65
|
+
title: Me,
|
|
66
|
+
description: Ue,
|
|
67
|
+
type: Fe,
|
|
68
|
+
required: Je,
|
|
69
|
+
properties: Ye
|
|
70
|
+
}, He = "https://json-schema.org/draft/2020-12/schema", Ke = "https://kitn.ai/schemas/card/link.schema.json", We = "LinkPreviewData", Ve = "Rich link / Open-Graph preview payload. The card renders from this; it never fetches.", Ge = "object", Qe = ["url"], Xe = !1, Ze = { url: { type: "string", format: "uri", description: "Canonical destination. Opened via the contract `open` verb (target 'tab').", "x-kai-format": "url" }, title: { type: "string", description: "OG title (og:title). Falls back to the domain when absent.", maxLength: 300 }, description: { type: "string", description: "OG description (og:description). Clamped to 3 lines in the UI.", maxLength: 1e3 }, image: { type: "string", format: "uri", description: "Preview image (og:image). Optional; the card degrades gracefully when missing or it fails to load.", "x-kai-format": "url" }, imageAlt: { type: "string", description: "Alt text for the preview image. Defaults to the title (or empty = decorative) when omitted.", maxLength: 300 }, favicon: { type: "string", format: "uri", description: "Site favicon shown next to the domain.", "x-kai-format": "url" }, domain: { type: "string", description: "Display domain (e.g. 'example.com'). Derived from `url` when omitted.", maxLength: 253 }, siteName: { type: "string", description: "OG site name (og:site_name). Shown in place of the domain when present.", maxLength: 200 } }, et = {
|
|
71
|
+
$schema: He,
|
|
72
|
+
$id: Ke,
|
|
73
|
+
title: We,
|
|
74
|
+
description: Ve,
|
|
75
|
+
type: Ge,
|
|
76
|
+
required: Qe,
|
|
77
|
+
additionalProperties: Xe,
|
|
78
|
+
properties: Ze
|
|
79
|
+
}, tt = "https://json-schema.org/draft/2020-12/schema", it = "https://kitn.ai/schemas/card/tasks.result.schema.json", nt = "TasksCardResult", st = "Payload of CardEvent { kind: 'submit' } from a tasks card.", ot = "object", rt = ["selected"], at = { selected: { type: "array", description: "Ids of the checked tasks, in the order they appear in `tasks`. Subset of the input task ids.", items: { type: "string", minLength: 1 }, uniqueItems: !0 } }, pt = {
|
|
80
|
+
$schema: tt,
|
|
81
|
+
$id: it,
|
|
82
|
+
title: nt,
|
|
83
|
+
description: st,
|
|
84
|
+
type: ot,
|
|
85
|
+
required: rt,
|
|
86
|
+
properties: at
|
|
87
|
+
}, dt = "https://json-schema.org/draft/2020-12/schema", ct = "https://kitn.ai/schemas/card/tasks.schema.json", ut = "TasksCardData", lt = "Data payload for a `tasks` card (CardEnvelope.data when type='tasks').", mt = "object", ht = ["tasks"], yt = { mode: { type: "string", enum: ["select", "progress"], default: "select", description: "'select' (default) = toggle + a confirm button that emits `submit`. 'progress' = an onboarding-checklist look (header `done / total` count, circular indicators, per-item title/description, no confirm button, where checking a row IS the action). Both share the selection model.", "x-kai-mode": !0 }, heading: { type: "string", description: "Optional in-body heading; distinct from CardEnvelope.title." }, tasks: { type: "array", minItems: 1, description: "The selectable rows, rendered in order.", items: { type: "object", required: ["id", "label"], properties: { id: { type: "string", minLength: 1, description: "Stable id; the selected ids are returned in the result. Unique within `tasks`.", "x-kai-unique": !0 }, label: { type: "string", minLength: 1, description: "Row label." }, description: { type: "string", description: "Optional secondary line under the label." }, checked: { type: "boolean", default: !1, description: "Initial checked state of the row." }, disabled: { type: "boolean", default: !1, description: "Row is shown but not toggleable (and excluded from select-all)." } } } }, selectAll: { type: "boolean", default: !1, description: "Render a master select-all checkbox above the list.", "x-kai-control": "select-all" }, confirmLabel: { type: "string", default: "Confirm", description: "Label for the confirm button." }, allowEmpty: { type: "boolean", default: !1, description: "If true, confirm is enabled with zero selected (emits { selected: [] }). If false, confirm is disabled until >=1 selected." }, min: { type: "integer", minimum: 0, description: "Optional minimum number that must be selected to confirm.", "x-kai-select-min": !0 }, max: { type: "integer", minimum: 1, description: "Optional maximum selectable; further toggles are blocked once reached.", "x-kai-select-max": !0 }, dismissible: { type: "boolean", default: !1, description: "Show a close affordance that emits the `dismiss` verb. The card collapses to a re-openable 'dismissed' stub; the host decides via `onReopen` whether it comes back live or `expired`." } }, ft = {
|
|
88
|
+
$schema: dt,
|
|
89
|
+
$id: ct,
|
|
90
|
+
title: ut,
|
|
91
|
+
description: lt,
|
|
92
|
+
type: mt,
|
|
93
|
+
required: ht,
|
|
94
|
+
properties: yt
|
|
95
|
+
}, S = "kai_";
|
|
96
|
+
function q(e) {
|
|
97
|
+
if (!e.startsWith(S)) return null;
|
|
98
|
+
const t = e.slice(S.length);
|
|
99
|
+
return t.length > 0 ? t : null;
|
|
100
|
+
}
|
|
101
|
+
function gt(e) {
|
|
102
|
+
return `${S}${e}`;
|
|
103
|
+
}
|
|
104
|
+
function Ht(e) {
|
|
105
|
+
return q(e) !== null;
|
|
106
|
+
}
|
|
107
|
+
function Kt(e, t, i) {
|
|
108
|
+
const s = q(e);
|
|
109
|
+
return s === null ? null : { type: s, id: i.id, data: t === void 0 ? {} : t };
|
|
110
|
+
}
|
|
111
|
+
const L = (e) => Object.freeze(e), C = Object.freeze({
|
|
112
|
+
id: "openai",
|
|
113
|
+
label: "OpenAI strict",
|
|
114
|
+
source: "https://developers.openai.com/api/docs/guides/structured-outputs",
|
|
115
|
+
checkedOn: "2026-08-11",
|
|
116
|
+
requireAdditionalPropertiesFalse: !0,
|
|
117
|
+
requireAllPropertiesRequired: !0,
|
|
118
|
+
allowRootAnyOf: !1,
|
|
119
|
+
allowRecursion: !0,
|
|
120
|
+
keywords: L({
|
|
121
|
+
// core
|
|
122
|
+
type: { status: "supported", note: "String, Number, Boolean, Integer, Object, Array are the supported types" },
|
|
123
|
+
properties: { status: "supported", note: "objects are a supported type" },
|
|
124
|
+
items: { status: "supported", note: "arrays are a supported type" },
|
|
125
|
+
required: { status: "supported", note: "required; every property must appear in it" },
|
|
126
|
+
additionalProperties: {
|
|
127
|
+
status: "supported",
|
|
128
|
+
note: "must always be set to false on objects",
|
|
129
|
+
value: (e) => e === !1 ? null : "must be exactly `false` on every object"
|
|
130
|
+
},
|
|
131
|
+
enum: { status: "supported", note: "Enum is a supported type; up to 1000 values across the schema" },
|
|
132
|
+
const: { status: "supported", note: "const values are counted by the documented 120,000-char name/value budget" },
|
|
133
|
+
$ref: { status: "supported", note: "internal $ref and $defs are supported, including recursive schemas" },
|
|
134
|
+
$defs: { status: "supported", note: "definition names are counted by the documented char budget" },
|
|
135
|
+
definitions: { status: "supported", note: "draft-07 spelling of $defs" },
|
|
136
|
+
$anchor: { status: "unsupported", note: "not documented in the supported subset" },
|
|
137
|
+
$schema: { status: "unsupported", note: "meta keyword, not part of the documented subset (the projection strips it)" },
|
|
138
|
+
$id: { status: "unsupported", note: "meta keyword, not part of the documented subset (the projection strips it)" },
|
|
139
|
+
// annotations: cannot constrain an instance, so cannot change the grammar
|
|
140
|
+
title: { status: "annotation", note: "annotation only; cannot constrain an instance" },
|
|
141
|
+
description: { status: "annotation", note: "annotation only; this is how the model learns the field, keep it" },
|
|
142
|
+
default: {
|
|
143
|
+
status: "annotation",
|
|
144
|
+
note: "not in the supported list, but an annotation under the JSON Schema spec, so it cannot change the compiled grammar"
|
|
145
|
+
},
|
|
146
|
+
examples: { status: "annotation", note: "annotation only" },
|
|
147
|
+
deprecated: { status: "annotation", note: "annotation only" },
|
|
148
|
+
readOnly: { status: "annotation", note: "annotation only" },
|
|
149
|
+
writeOnly: { status: "annotation", note: "annotation only" },
|
|
150
|
+
$comment: { status: "annotation", note: "annotation only" },
|
|
151
|
+
// strings
|
|
152
|
+
pattern: { status: "supported", note: "listed under supported String properties" },
|
|
153
|
+
format: {
|
|
154
|
+
status: "supported",
|
|
155
|
+
note: "listed under supported String properties, for a CLOSED list of format values",
|
|
156
|
+
// Note the absence of `uri`. Anthropic's list has it; OpenAI's does not, and
|
|
157
|
+
// the kit's link/embed/artifact schemas all use `format: "uri"`.
|
|
158
|
+
value: (e) => {
|
|
159
|
+
const t = ["date-time", "time", "date", "duration", "email", "hostname", "ipv4", "ipv6", "uuid"];
|
|
160
|
+
return typeof e == "string" && t.includes(e) ? null : `format ${JSON.stringify(e)} is outside the supported list (${t.join(", ")})`;
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
minLength: { status: "unsupported", note: 'absent from "Supported properties" for strings; see the coin-flip note above this table' },
|
|
164
|
+
maxLength: { status: "unsupported", note: 'absent from "Supported properties" for strings; see the coin-flip note above this table' },
|
|
165
|
+
// numbers
|
|
166
|
+
minimum: { status: "supported", note: "listed under supported Number properties" },
|
|
167
|
+
maximum: { status: "supported", note: "listed under supported Number properties" },
|
|
168
|
+
exclusiveMinimum: { status: "supported", note: "listed under supported Number properties" },
|
|
169
|
+
exclusiveMaximum: { status: "supported", note: "listed under supported Number properties" },
|
|
170
|
+
multipleOf: { status: "supported", note: "listed under supported Number properties" },
|
|
171
|
+
// arrays
|
|
172
|
+
// THE TELL. Any value is fine here; Anthropic accepts only 0 and 1.
|
|
173
|
+
minItems: { status: "supported", note: "listed under supported Array properties, at any value" },
|
|
174
|
+
maxItems: { status: "supported", note: "listed under supported Array properties" },
|
|
175
|
+
uniqueItems: { status: "unsupported", note: "not listed under supported Array properties" },
|
|
176
|
+
contains: { status: "unsupported", note: "not listed under supported Array properties" },
|
|
177
|
+
minContains: { status: "unsupported", note: "not listed under supported Array properties" },
|
|
178
|
+
maxContains: { status: "unsupported", note: "not listed under supported Array properties" },
|
|
179
|
+
prefixItems: { status: "unsupported", note: "not listed under supported Array properties" },
|
|
180
|
+
unevaluatedItems: { status: "unsupported", note: "not listed under supported Array properties" },
|
|
181
|
+
additionalItems: { status: "unsupported", note: "not listed under supported Array properties" },
|
|
182
|
+
// objects
|
|
183
|
+
patternProperties: { status: "unsupported", note: "explicitly listed as not yet supported" },
|
|
184
|
+
propertyNames: { status: "unsupported", note: "not listed under supported Object properties" },
|
|
185
|
+
minProperties: { status: "unsupported", note: "not listed under supported Object properties" },
|
|
186
|
+
maxProperties: { status: "unsupported", note: "not listed under supported Object properties" },
|
|
187
|
+
unevaluatedProperties: { status: "unsupported", note: "not listed under supported Object properties" },
|
|
188
|
+
// composition
|
|
189
|
+
anyOf: { status: "supported", note: "a supported type; every nested schema must itself stay in subset, and it may not be at the root" },
|
|
190
|
+
allOf: { status: "unsupported", note: "explicitly listed as not supported under Composition" },
|
|
191
|
+
oneOf: { status: "unsupported", note: "not among the supported types (only `anyOf` is)" },
|
|
192
|
+
not: { status: "unsupported", note: "explicitly listed as not supported under Composition" },
|
|
193
|
+
if: { status: "unsupported", note: "explicitly listed as not supported under Composition" },
|
|
194
|
+
then: { status: "unsupported", note: "explicitly listed as not supported under Composition" },
|
|
195
|
+
else: { status: "unsupported", note: "explicitly listed as not supported under Composition" },
|
|
196
|
+
dependentRequired: { status: "unsupported", note: "explicitly listed as not supported under Composition" },
|
|
197
|
+
dependentSchemas: { status: "unsupported", note: "explicitly listed as not supported under Composition" }
|
|
198
|
+
})
|
|
199
|
+
}), E = Object.freeze({
|
|
200
|
+
id: "anthropic",
|
|
201
|
+
label: "Anthropic strict",
|
|
202
|
+
source: "https://platform.claude.com/docs/en/build-with-claude/structured-outputs#json-schema-limitations",
|
|
203
|
+
checkedOn: "2026-08-11",
|
|
204
|
+
requireAdditionalPropertiesFalse: !0,
|
|
205
|
+
// Anthropic's own example leaves `unit` out of `required`. Optional is legal.
|
|
206
|
+
requireAllPropertiesRequired: !1,
|
|
207
|
+
allowRootAnyOf: !0,
|
|
208
|
+
allowRecursion: !1,
|
|
209
|
+
keywords: L({
|
|
210
|
+
// core
|
|
211
|
+
type: { status: "supported", note: "all basic types: object, array, string, integer, number, boolean, null" },
|
|
212
|
+
properties: { status: "supported", note: "objects are a supported type" },
|
|
213
|
+
items: { status: "supported", note: "arrays are a supported type" },
|
|
214
|
+
required: { status: "supported", note: "explicitly supported; leaving a property out of it is legal" },
|
|
215
|
+
additionalProperties: {
|
|
216
|
+
status: "supported",
|
|
217
|
+
note: "must be set to false for objects; anything else is explicitly unsupported",
|
|
218
|
+
value: (e) => e === !1 ? null : 'must be exactly `false` ("additionalProperties set to anything other than false" is unsupported)'
|
|
219
|
+
},
|
|
220
|
+
enum: { status: "supported", note: "strings, numbers, bools or nulls only; complex types within enums are unsupported" },
|
|
221
|
+
const: { status: "supported", note: "explicitly supported" },
|
|
222
|
+
$ref: { status: "supported", note: "internal only; external $ref and recursive schemas are unsupported" },
|
|
223
|
+
$defs: { status: "supported", note: '"$ref, $def, and definitions" are supported' },
|
|
224
|
+
definitions: { status: "supported", note: '"$ref, $def, and definitions" are supported' },
|
|
225
|
+
$anchor: { status: "unsupported", note: "not in the supported list" },
|
|
226
|
+
$schema: { status: "unsupported", note: "meta keyword, not in the supported list (the projection strips it)" },
|
|
227
|
+
$id: { status: "unsupported", note: "meta keyword, not in the supported list (the projection strips it)" },
|
|
228
|
+
// annotations
|
|
229
|
+
title: { status: "annotation", note: "annotation only; cannot constrain an instance" },
|
|
230
|
+
description: { status: "annotation", note: "annotation only; this is how the model learns the field, keep it" },
|
|
231
|
+
default: { status: "supported", note: 'explicitly supported: "default property for all supported types"' },
|
|
232
|
+
examples: { status: "annotation", note: "annotation only" },
|
|
233
|
+
deprecated: { status: "annotation", note: "annotation only" },
|
|
234
|
+
readOnly: { status: "annotation", note: "annotation only" },
|
|
235
|
+
writeOnly: { status: "annotation", note: "annotation only" },
|
|
236
|
+
$comment: { status: "annotation", note: "annotation only" },
|
|
237
|
+
// strings
|
|
238
|
+
// OpenAI supports `pattern`. This subset does not list it at all.
|
|
239
|
+
pattern: { status: "unsupported", note: "not in the supported list; `format` is the only supported string constraint" },
|
|
240
|
+
format: {
|
|
241
|
+
status: "supported",
|
|
242
|
+
note: "supported for a CLOSED list of format values",
|
|
243
|
+
// Note `uri` IS here. It is absent from OpenAI's list.
|
|
244
|
+
value: (e) => {
|
|
245
|
+
const t = ["date-time", "time", "date", "duration", "email", "hostname", "uri", "ipv4", "ipv6", "uuid"];
|
|
246
|
+
return typeof e == "string" && t.includes(e) ? null : `format ${JSON.stringify(e)} is outside the supported list (${t.join(", ")})`;
|
|
247
|
+
}
|
|
248
|
+
},
|
|
249
|
+
minLength: { status: "unsupported", note: 'explicitly unsupported: "String constraints (minLength, maxLength)"' },
|
|
250
|
+
maxLength: { status: "unsupported", note: 'explicitly unsupported: "String constraints (minLength, maxLength)"' },
|
|
251
|
+
// numbers: all explicitly unsupported here, all supported on OpenAI
|
|
252
|
+
minimum: { status: "unsupported", note: 'explicitly unsupported: "Numerical constraints (such as minimum, maximum, multipleOf)"' },
|
|
253
|
+
maximum: { status: "unsupported", note: 'explicitly unsupported: "Numerical constraints (such as minimum, maximum, multipleOf)"' },
|
|
254
|
+
exclusiveMinimum: { status: "unsupported", note: "a numerical constraint; explicitly unsupported" },
|
|
255
|
+
exclusiveMaximum: { status: "unsupported", note: "a numerical constraint; explicitly unsupported" },
|
|
256
|
+
multipleOf: { status: "unsupported", note: 'explicitly unsupported: "Numerical constraints (such as minimum, maximum, multipleOf)"' },
|
|
257
|
+
// arrays
|
|
258
|
+
// THE TELL. OpenAI takes any value; this takes 0 or 1 and 400s on 2.
|
|
259
|
+
minItems: {
|
|
260
|
+
status: "supported",
|
|
261
|
+
note: 'supported for values 0 and 1 ONLY: "Array minItems (only values 0 and 1 supported)"',
|
|
262
|
+
value: (e) => e === 0 || e === 1 ? null : `minItems ${JSON.stringify(e)} is unsupported; only 0 and 1 are`
|
|
263
|
+
},
|
|
264
|
+
maxItems: { status: "unsupported", note: 'explicitly unsupported: "Array constraints beyond minItems of 0 or 1"' },
|
|
265
|
+
uniqueItems: { status: "unsupported", note: "an array constraint beyond minItems 0 or 1; explicitly unsupported" },
|
|
266
|
+
contains: { status: "unsupported", note: "an array constraint beyond minItems 0 or 1; explicitly unsupported" },
|
|
267
|
+
minContains: { status: "unsupported", note: "an array constraint beyond minItems 0 or 1; explicitly unsupported" },
|
|
268
|
+
maxContains: { status: "unsupported", note: "an array constraint beyond minItems 0 or 1; explicitly unsupported" },
|
|
269
|
+
prefixItems: { status: "unsupported", note: "not in the supported list" },
|
|
270
|
+
unevaluatedItems: { status: "unsupported", note: "not in the supported list" },
|
|
271
|
+
additionalItems: { status: "unsupported", note: "not in the supported list" },
|
|
272
|
+
// objects
|
|
273
|
+
patternProperties: { status: "unsupported", note: "not in the supported list" },
|
|
274
|
+
propertyNames: { status: "unsupported", note: "not in the supported list" },
|
|
275
|
+
minProperties: { status: "unsupported", note: "not in the supported list" },
|
|
276
|
+
maxProperties: { status: "unsupported", note: "not in the supported list" },
|
|
277
|
+
unevaluatedProperties: { status: "unsupported", note: "not in the supported list" },
|
|
278
|
+
// composition
|
|
279
|
+
anyOf: { status: "supported", note: "explicitly supported, including at the root" },
|
|
280
|
+
allOf: { status: "supported", note: "explicitly supported, EXCEPT in combination with $ref" },
|
|
281
|
+
oneOf: { status: "unsupported", note: "not in the supported list (only anyOf and allOf are)" },
|
|
282
|
+
not: { status: "unsupported", note: "not in the supported list" },
|
|
283
|
+
if: { status: "unsupported", note: "not in the supported list; conditional application has no supported spelling" },
|
|
284
|
+
then: { status: "unsupported", note: "not in the supported list; conditional application has no supported spelling" },
|
|
285
|
+
else: { status: "unsupported", note: "not in the supported list; conditional application has no supported spelling" },
|
|
286
|
+
dependentRequired: { status: "unsupported", note: "not in the supported list" },
|
|
287
|
+
dependentSchemas: { status: "unsupported", note: "not in the supported list" }
|
|
288
|
+
})
|
|
289
|
+
}), Wt = Object.freeze({
|
|
290
|
+
openai: C,
|
|
291
|
+
anthropic: E
|
|
292
|
+
}), bt = ["items", "if", "then", "else", "not", "contains", "propertyNames", "unevaluatedItems", "additionalItems"], $t = ["properties", "patternProperties", "$defs", "definitions", "dependentSchemas"], vt = ["allOf", "anyOf", "oneOf", "prefixItems"], O = (e) => typeof e == "object" && e !== null && !Array.isArray(e);
|
|
293
|
+
function wt(e, t) {
|
|
294
|
+
return e === "(root)" ? t : `${e}.${t}`;
|
|
295
|
+
}
|
|
296
|
+
function xt(e, t) {
|
|
297
|
+
const i = [];
|
|
298
|
+
return x(e, t, "(root)", !0, i), i;
|
|
299
|
+
}
|
|
300
|
+
function x(e, t, i, s, a) {
|
|
301
|
+
if (typeof e == "boolean") return;
|
|
302
|
+
if (!O(e)) {
|
|
303
|
+
a.push({ path: i, keyword: "(schema)", reason: `expected a schema object, got ${e === null ? "null" : typeof e}` });
|
|
304
|
+
return;
|
|
305
|
+
}
|
|
306
|
+
for (const [p, c] of Object.entries(e)) {
|
|
307
|
+
const u = t.keywords[p];
|
|
308
|
+
if (!u) {
|
|
309
|
+
a.push({
|
|
310
|
+
path: i,
|
|
311
|
+
keyword: p,
|
|
312
|
+
reason: p.startsWith("x-") ? `vendor extension keyword, not in the ${t.label} subset` : `unknown keyword, not classified by the ${t.label} subset`
|
|
313
|
+
});
|
|
314
|
+
continue;
|
|
315
|
+
}
|
|
316
|
+
if (u.status === "unsupported") {
|
|
317
|
+
a.push({ path: i, keyword: p, reason: `not supported (${u.note})` });
|
|
318
|
+
continue;
|
|
319
|
+
}
|
|
320
|
+
if (u.status === "supported" && u.value) {
|
|
321
|
+
const h = u.value(c);
|
|
322
|
+
h && a.push({ path: i, keyword: p, reason: h });
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
const n = O(e.properties), r = e.type === "object" || n;
|
|
326
|
+
if (r && t.requireAdditionalPropertiesFalse && e.additionalProperties !== !1 && a.push({
|
|
327
|
+
path: i,
|
|
328
|
+
keyword: "additionalProperties",
|
|
329
|
+
reason: `missing; ${t.label} requires \`additionalProperties: false\` on every object`
|
|
330
|
+
}), r && !n && a.push({
|
|
331
|
+
path: i,
|
|
332
|
+
keyword: "properties",
|
|
333
|
+
reason: `a free-form object (\`type: "object"\` with no \`properties\`) has no grammar under ${t.label}; with the mandatory \`additionalProperties: false\` it can only ever be \`{}\`, which is not what the schema means`
|
|
334
|
+
}), r && t.requireAllPropertiesRequired && n) {
|
|
335
|
+
const p = Array.isArray(e.required) ? e.required.map(String) : [], c = Object.keys(e.properties).filter((u) => !p.includes(u));
|
|
336
|
+
c.length > 0 && a.push({
|
|
337
|
+
path: i,
|
|
338
|
+
keyword: "required",
|
|
339
|
+
reason: `${t.label} requires every property in \`required\`; missing ${c.map((u) => `\`${u}\``).join(", ")} (emulate optional with a \`null\` union)`
|
|
340
|
+
});
|
|
341
|
+
}
|
|
342
|
+
s && !t.allowRootAnyOf && "anyOf" in e && a.push({
|
|
343
|
+
path: i,
|
|
344
|
+
keyword: "anyOf",
|
|
345
|
+
reason: `${t.label} forbids \`anyOf\` at the ROOT ("Root level object of a schema must be an object, and not use anyOf")`
|
|
346
|
+
}), Object.keys(e).filter((p) => {
|
|
347
|
+
var c;
|
|
348
|
+
return ((c = t.keywords[p]) == null ? void 0 : c.status) !== "annotation";
|
|
349
|
+
}).length === 0 && a.push({
|
|
350
|
+
path: i,
|
|
351
|
+
keyword: "type",
|
|
352
|
+
reason: `unconstrained subschema (annotations only); ${t.label} compiles the schema to a grammar and has no way to express "any JSON". Give it a \`type\``
|
|
353
|
+
});
|
|
354
|
+
const m = (p) => {
|
|
355
|
+
var c;
|
|
356
|
+
return ((c = t.keywords[p]) == null ? void 0 : c.status) === "unsupported";
|
|
357
|
+
};
|
|
358
|
+
for (const p of $t) {
|
|
359
|
+
const c = e[p];
|
|
360
|
+
if (!(!O(c) || m(p)))
|
|
361
|
+
for (const [u, h] of Object.entries(c))
|
|
362
|
+
x(h, t, p === "properties" ? wt(i, u) : `${i}/${p}[${u}]`, !1, a);
|
|
363
|
+
}
|
|
364
|
+
for (const p of bt) {
|
|
365
|
+
if (!(p in e) || m(p)) continue;
|
|
366
|
+
const c = e[p];
|
|
367
|
+
typeof c != "boolean" && x(c, t, p === "items" ? `${i === "(root)" ? "(root)" : i}[]` : `${i}/${p}`, !1, a);
|
|
368
|
+
}
|
|
369
|
+
O(e.additionalProperties) && x(e.additionalProperties, t, `${i}/additionalProperties`, !1, a);
|
|
370
|
+
for (const p of vt) {
|
|
371
|
+
const c = e[p];
|
|
372
|
+
!Array.isArray(c) || m(p) || c.forEach((u, h) => x(u, t, `${i}/${p}[${h}]`, !1, a));
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
const kt = Object.freeze({
|
|
376
|
+
confirm: "Show the user an approval card and wait for their decision before you act. Use this whenever you are about to do something consequential, destructive or irreversible.",
|
|
377
|
+
choice: "Ask the user to pick exactly one option from a list of rich choices. Use this instead of asking in prose when the options are known and finite.",
|
|
378
|
+
tasks: "Show the user a checklist they can tick, either to select several items for you to act on or to track progress through a sequence of steps.",
|
|
379
|
+
form: "Ask the user for structured input by rendering a form. The data is itself a JSON Schema describing the fields to collect.",
|
|
380
|
+
link: "Show a rich preview of a web page: title, description, image and domain. The card renders what you supply and never fetches the page itself.",
|
|
381
|
+
embed: "Embed a video player (YouTube, Vimeo, or a direct player URL) inline in the conversation.",
|
|
382
|
+
artifact: "Show something you built (a page, an app, a set of files) in a framed preview with its source alongside, so the user can look at both."
|
|
383
|
+
});
|
|
384
|
+
class Ot extends Error {
|
|
385
|
+
constructor(i, s) {
|
|
386
|
+
super(jt(i, s));
|
|
387
|
+
w(this, "name", "UnsupportedCardToolSchemaError");
|
|
388
|
+
w(this, "provider");
|
|
389
|
+
w(this, "source");
|
|
390
|
+
w(this, "cards");
|
|
391
|
+
this.provider = i.id, this.source = i.source, this.cards = s;
|
|
392
|
+
}
|
|
393
|
+
/** Every distinct keyword named across every failing card, deduped, in order. */
|
|
394
|
+
get keywords() {
|
|
395
|
+
const i = /* @__PURE__ */ new Set();
|
|
396
|
+
for (const s of this.cards) for (const a of s.violations) i.add(a.keyword);
|
|
397
|
+
return [...i];
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
function jt(e, t) {
|
|
401
|
+
const i = [], s = t.length === 1 ? "card type" : "card types";
|
|
402
|
+
i.push(`${t.length} ${s} cannot be a STRICT tool definition under ${e.label}:`);
|
|
403
|
+
for (const a of t) {
|
|
404
|
+
i.push(""), i.push(` ${a.toolName} (card type "${a.cardType}") — ${a.violations.length} problem(s):`);
|
|
405
|
+
for (const n of a.violations)
|
|
406
|
+
i.push(` ${n.path}: \`${n.keyword}\` — ${n.reason}`);
|
|
407
|
+
}
|
|
408
|
+
return i.push(""), i.push(` subset source: ${e.source} (read ${e.checkedOn})`), i.push(
|
|
409
|
+
" Fix: drop `strict: true`. Non-strict is the default and is the mode the kit's cards are proven in; both providers accept a loose schema there and ignore what they do not compile. Rewriting a built-in card schema to fit a strict subset would change what a valid card IS, which is a card-contract change, not a projection setting."
|
|
410
|
+
), i.join(`
|
|
411
|
+
`);
|
|
412
|
+
}
|
|
413
|
+
const g = (e) => typeof e == "object" && e !== null && !Array.isArray(e);
|
|
414
|
+
function St(e) {
|
|
415
|
+
return e === "$schema" || e === "$id" || e.startsWith("x-");
|
|
416
|
+
}
|
|
417
|
+
const At = ["items", "if", "then", "else", "not", "contains", "propertyNames", "unevaluatedItems", "additionalItems"], It = ["properties", "patternProperties", "$defs", "definitions", "dependentSchemas"], qt = ["allOf", "anyOf", "oneOf", "prefixItems"];
|
|
418
|
+
function k(e, t) {
|
|
419
|
+
if (!g(e)) return e;
|
|
420
|
+
const i = {};
|
|
421
|
+
for (const [n, r] of Object.entries(e))
|
|
422
|
+
St(n) || (i[n] = r);
|
|
423
|
+
for (const n of It) {
|
|
424
|
+
const r = i[n];
|
|
425
|
+
if (!g(r)) continue;
|
|
426
|
+
const o = {};
|
|
427
|
+
for (const [m, p] of Object.entries(r)) o[m] = k(p, t);
|
|
428
|
+
i[n] = o;
|
|
429
|
+
}
|
|
430
|
+
for (const n of At)
|
|
431
|
+
!(n in i) || typeof i[n] == "boolean" || (i[n] = k(i[n], t));
|
|
432
|
+
g(i.additionalProperties) && (i.additionalProperties = k(i.additionalProperties, t));
|
|
433
|
+
for (const n of qt) {
|
|
434
|
+
const r = i[n];
|
|
435
|
+
Array.isArray(r) && (i[n] = r.map((o) => k(o, t)));
|
|
436
|
+
}
|
|
437
|
+
const s = g(i.properties) ? i.properties : void 0, a = i.type === "object" || s !== void 0;
|
|
438
|
+
if (a && t.closeObjects && !("additionalProperties" in i) && (i.additionalProperties = !1), a && t.requireEveryProperty && s) {
|
|
439
|
+
const n = Array.isArray(i.required) ? i.required.map(String) : [], r = Object.keys(s);
|
|
440
|
+
for (const o of r)
|
|
441
|
+
n.includes(o) || (s[o] = Lt(s[o]));
|
|
442
|
+
i.required = r;
|
|
443
|
+
}
|
|
444
|
+
return i;
|
|
445
|
+
}
|
|
446
|
+
function Lt(e) {
|
|
447
|
+
if (!g(e)) return e;
|
|
448
|
+
const t = { ...e };
|
|
449
|
+
if ("type" in t) {
|
|
450
|
+
const i = Array.isArray(t.type) ? t.type.map(String) : [String(t.type)];
|
|
451
|
+
i.includes("null") || (t.type = [...i, "null"]);
|
|
452
|
+
} else if (Array.isArray(t.anyOf))
|
|
453
|
+
t.anyOf.some((i) => g(i) && i.type === "null") || (t.anyOf = [...t.anyOf, { type: "null" }]);
|
|
454
|
+
else
|
|
455
|
+
return t;
|
|
456
|
+
return Array.isArray(t.enum) && !t.enum.includes(null) && (t.enum = [...t.enum, null]), t;
|
|
457
|
+
}
|
|
458
|
+
function Ct(e) {
|
|
459
|
+
const t = e;
|
|
460
|
+
return g(t.schemas) ? { schemas: t.schemas, descriptions: t.descriptions ?? {} } : { schemas: e, descriptions: {} };
|
|
461
|
+
}
|
|
462
|
+
function Et(e, t, i) {
|
|
463
|
+
const s = i[e];
|
|
464
|
+
if (typeof s == "string" && s.length > 0) return s;
|
|
465
|
+
const a = kt[e];
|
|
466
|
+
if (typeof a == "string" && a.length > 0) return a;
|
|
467
|
+
const n = t.description;
|
|
468
|
+
return typeof n == "string" && n.length > 0 ? n : `Render a \`${e}\` card.`;
|
|
469
|
+
}
|
|
470
|
+
function v(e, t) {
|
|
471
|
+
const i = t === void 0, s = i ? e : t;
|
|
472
|
+
if (!g(s) || typeof s.provider != "string")
|
|
473
|
+
throw new TypeError('cardTools: an options object with a `provider` is required, e.g. cardTools({ provider: "openai" })');
|
|
474
|
+
const { schemas: a, descriptions: n } = Ct(
|
|
475
|
+
i ? Tt() : e
|
|
476
|
+
), r = s.strict === !0;
|
|
477
|
+
if (s.provider === "jsonschema" && r)
|
|
478
|
+
throw new TypeError(
|
|
479
|
+
'cardTools: `strict: true` is provider-specific and cannot be checked for `provider: "jsonschema"`, because the two documented strict subsets differ (see @kitn.ai/ui/schemas provider-subsets). Pass provider "openai" or "anthropic" to project and check strictly, or drop `strict`.'
|
|
480
|
+
);
|
|
481
|
+
const o = r ? s.provider === "openai" ? C : E : null, m = {
|
|
482
|
+
closeObjects: o !== null,
|
|
483
|
+
requireEveryProperty: o !== null && o.requireAllPropertiesRequired
|
|
484
|
+
}, p = [], c = [];
|
|
485
|
+
for (const [u, h] of Object.entries(a)) {
|
|
486
|
+
const b = gt(u), f = Et(u, h, n), $ = k(h, m);
|
|
487
|
+
if (o) {
|
|
488
|
+
const d = xt($, o);
|
|
489
|
+
if (d.length > 0) {
|
|
490
|
+
c.push({ cardType: u, toolName: b, violations: d });
|
|
491
|
+
continue;
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
s.provider === "openai" ? p.push({ type: "function", function: { name: b, description: f, parameters: $, ...r ? { strict: !0 } : {} } }) : s.provider === "anthropic" ? p.push({ name: b, description: f, input_schema: $, ...r ? { strict: !0 } : {} }) : p.push({ name: b, description: f, schema: $ });
|
|
495
|
+
}
|
|
496
|
+
if (o && c.length > 0) throw new Ot(o, c);
|
|
497
|
+
return p;
|
|
498
|
+
}
|
|
499
|
+
function Tt() {
|
|
500
|
+
return j;
|
|
501
|
+
}
|
|
502
|
+
function Vt(e, t) {
|
|
503
|
+
return e === void 0 ? v({ provider: "openai", strict: t == null ? void 0 : t.strict }) : v(e, { provider: "openai", strict: t == null ? void 0 : t.strict });
|
|
504
|
+
}
|
|
505
|
+
function Gt(e, t) {
|
|
506
|
+
return e === void 0 ? v({ provider: "anthropic", strict: t == null ? void 0 : t.strict }) : v(e, { provider: "anthropic", strict: t == null ? void 0 : t.strict });
|
|
507
|
+
}
|
|
508
|
+
function Qt(e) {
|
|
509
|
+
return e === void 0 ? v({ provider: "jsonschema" }) : v(e, { provider: "jsonschema" });
|
|
510
|
+
}
|
|
511
|
+
function A(e) {
|
|
512
|
+
return e === null ? "null" : Array.isArray(e) ? "array" : typeof e;
|
|
513
|
+
}
|
|
514
|
+
function Rt(e, t) {
|
|
515
|
+
switch (t) {
|
|
516
|
+
case "integer":
|
|
517
|
+
return typeof e == "number" && Number.isInteger(e);
|
|
518
|
+
case "number":
|
|
519
|
+
return typeof e == "number" && Number.isFinite(e);
|
|
520
|
+
case "array":
|
|
521
|
+
return Array.isArray(e);
|
|
522
|
+
case "null":
|
|
523
|
+
return e === null;
|
|
524
|
+
case "object":
|
|
525
|
+
return A(e) === "object";
|
|
526
|
+
default:
|
|
527
|
+
return typeof e === t;
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
function I(e, t, i, s) {
|
|
531
|
+
const a = i || "(root)", n = (r, o, m = a) => {
|
|
532
|
+
s.push({ path: m, keyword: r, message: `${m}: ${o}` });
|
|
533
|
+
};
|
|
534
|
+
if (e.type && !Rt(t, e.type)) {
|
|
535
|
+
n("type", `expected ${e.type}, got ${A(t)}`);
|
|
536
|
+
return;
|
|
537
|
+
}
|
|
538
|
+
if ("const" in e && JSON.stringify(t) !== JSON.stringify(e.const) && n("const", `must equal const ${JSON.stringify(e.const)}`), e.enum && !e.enum.some((r) => JSON.stringify(r) === JSON.stringify(t)) && n("enum", `must be one of ${JSON.stringify(e.enum)}`), typeof t == "number" && (e.minimum !== void 0 && t < e.minimum && n("minimum", `< minimum ${e.minimum}`), e.maximum !== void 0 && t > e.maximum && n("maximum", `> maximum ${e.maximum}`), e.exclusiveMinimum !== void 0 && t <= e.exclusiveMinimum && n("exclusiveMinimum", "<= exclusiveMinimum"), e.exclusiveMaximum !== void 0 && t >= e.exclusiveMaximum && n("exclusiveMaximum", ">= exclusiveMaximum")), typeof t == "string" && (e.minLength !== void 0 && t.length < e.minLength && n("minLength", `shorter than minLength ${e.minLength}`), e.maxLength !== void 0 && t.length > e.maxLength && n("maxLength", `longer than maxLength ${e.maxLength}`), e.pattern !== void 0 && !new RegExp(e.pattern).test(t) && n("pattern", "does not match pattern")), Array.isArray(t) && (e.minItems !== void 0 && t.length < e.minItems && n("minItems", `fewer than minItems ${e.minItems}`), e.maxItems !== void 0 && t.length > e.maxItems && n("maxItems", `more than maxItems ${e.maxItems}`), e.uniqueItems && new Set(t.map((o) => JSON.stringify(o))).size !== t.length && n("uniqueItems", "items not unique"), e.items && t.forEach((r, o) => I(e.items, r, `${a}[${o}]`, s))), A(t) === "object") {
|
|
539
|
+
const r = t;
|
|
540
|
+
for (const o of e.required ?? [])
|
|
541
|
+
(!(o in r) || r[o] === void 0) && n("required", "required", `${a}.${o}`);
|
|
542
|
+
if (e.properties)
|
|
543
|
+
for (const [o, m] of Object.entries(e.properties))
|
|
544
|
+
o in r && r[o] !== void 0 && I(m, r[o], `${a}.${o}`, s);
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
function Pt(e, t) {
|
|
548
|
+
const i = [];
|
|
549
|
+
return I(e, t, "", i), { valid: i.length === 0, errors: i.map((s) => s.message), issues: i };
|
|
550
|
+
}
|
|
551
|
+
const T = {
|
|
552
|
+
artifact: { type: "object", properties: { src: { type: "string" }, files: { type: "array", maxItems: 500, items: { type: "object", required: ["path"], properties: { path: { type: "string", maxLength: 1024 }, url: { type: "string" }, code: { type: "string" }, language: { type: "string", maxLength: 40 }, type: { type: "string", enum: ["html", "pdf", "image", "other"] }, additions: { type: "integer", minimum: 0 }, deletions: { type: "integer", minimum: 0 }, status: { type: "string", enum: ["added", "modified", "deleted", "renamed", "untracked"] } } } }, tab: { type: "string", enum: ["preview", "code"] }, activeFile: { type: "string", maxLength: 1024 }, displayUrl: { type: "string", maxLength: 2048 } } },
|
|
553
|
+
choice: { type: "object", required: ["options"], properties: { prompt: { type: "string" }, submitLabel: { type: "string" }, options: { type: "array", minItems: 1, items: { type: "object", required: ["id", "label"], properties: { id: { type: "string", minLength: 1 }, label: { type: "string", minLength: 1 }, description: { type: "string" }, media: { type: "object", properties: { image: { type: "string" }, imageAlt: { type: "string" }, icon: { type: "string" } } }, meta: { type: "string" }, recommended: { type: "boolean" }, disabled: { type: "boolean" } } } }, dismissible: { type: "boolean" } } },
|
|
554
|
+
confirm: { type: "object", required: ["actions"], properties: { heading: { type: "string" }, body: { type: "string" }, tone: { type: "string", enum: ["default", "warning", "danger"] }, actions: { type: "array", minItems: 1, maxItems: 4, items: { type: "object", required: ["id", "label"], properties: { id: { type: "string", minLength: 1 }, label: { type: "string", minLength: 1 }, style: { type: "string", enum: ["primary", "default", "destructive"] }, default: { type: "boolean" } } } }, dismissible: { type: "boolean" } } },
|
|
555
|
+
embed: { type: "object", required: ["provider"], properties: { provider: { type: "string", enum: ["youtube", "vimeo", "generic"] }, id: { type: "string", maxLength: 64, pattern: "^[A-Za-z0-9_-]+$" }, url: { type: "string" }, title: { type: "string", maxLength: 300 }, poster: { type: "string" }, start: { type: "integer", minimum: 0 }, aspectRatio: { type: "string", enum: ["16:9", "4:3", "1:1", "9:16"] } } },
|
|
556
|
+
form: { type: "object", required: ["type", "properties"], properties: { type: { const: "object" }, title: { type: "string" }, description: { type: "string" }, required: { type: "array", items: { type: "string" } }, properties: { type: "object" }, "x-kai-order": { type: "array", items: { type: "string" } }, "x-kai-inlineMax": { type: "integer", minimum: 1 }, "x-kai-submitLabel": { type: "string" }, "x-kai-dismissible": { type: "boolean" }, "x-kai-actions": { type: "array", items: { type: "object", required: ["id", "label"], properties: { id: { type: "string" }, label: { type: "string" }, variant: { enum: ["default", "ghost", "outline"] } } } } } },
|
|
557
|
+
link: { type: "object", required: ["url"], properties: { url: { type: "string" }, title: { type: "string", maxLength: 300 }, description: { type: "string", maxLength: 1e3 }, image: { type: "string" }, imageAlt: { type: "string", maxLength: 300 }, favicon: { type: "string" }, domain: { type: "string", maxLength: 253 }, siteName: { type: "string", maxLength: 200 } } },
|
|
558
|
+
tasks: { type: "object", required: ["tasks"], properties: { mode: { type: "string", enum: ["select", "progress"] }, heading: { type: "string" }, tasks: { type: "array", minItems: 1, items: { type: "object", required: ["id", "label"], properties: { id: { type: "string", minLength: 1 }, label: { type: "string", minLength: 1 }, description: { type: "string" }, checked: { type: "boolean" }, disabled: { type: "boolean" } } } }, selectAll: { type: "boolean" }, confirmLabel: { type: "string" }, allowEmpty: { type: "boolean" }, min: { type: "integer", minimum: 0 }, max: { type: "integer", minimum: 1 }, dismissible: { type: "boolean" } } }
|
|
559
|
+
}, Nt = Object.freeze({
|
|
560
|
+
// hard: nothing to render
|
|
561
|
+
type: "hard",
|
|
562
|
+
required: "hard",
|
|
563
|
+
const: "hard",
|
|
564
|
+
// pins a discriminator (`form.data.type` must be `"object"`)
|
|
565
|
+
minItems: "hard",
|
|
566
|
+
// soft: content is present, bounds are not respected
|
|
567
|
+
enum: "soft",
|
|
568
|
+
// cards fall back to their default variant for an unknown value
|
|
569
|
+
maxItems: "soft",
|
|
570
|
+
minLength: "soft",
|
|
571
|
+
maxLength: "soft",
|
|
572
|
+
pattern: "soft",
|
|
573
|
+
minimum: "soft",
|
|
574
|
+
maximum: "soft",
|
|
575
|
+
exclusiveMinimum: "soft",
|
|
576
|
+
exclusiveMaximum: "soft",
|
|
577
|
+
uniqueItems: "soft"
|
|
578
|
+
}), _t = "soft";
|
|
579
|
+
function Dt(e) {
|
|
580
|
+
return Object.prototype.hasOwnProperty.call(T, e);
|
|
581
|
+
}
|
|
582
|
+
function zt(e, t) {
|
|
583
|
+
if (t && Object.prototype.hasOwnProperty.call(t, e)) {
|
|
584
|
+
const i = t[e];
|
|
585
|
+
if (i && typeof i == "object") return i;
|
|
586
|
+
}
|
|
587
|
+
return Dt(e) ? T[e] : null;
|
|
588
|
+
}
|
|
589
|
+
function Mt(e) {
|
|
590
|
+
const t = e.slice(0, 3).map((s) => s.message), i = e.length - t.length;
|
|
591
|
+
return t.join("; ") + (i > 0 ? `; and ${i} more` : "");
|
|
592
|
+
}
|
|
593
|
+
function Ut(e, t, i) {
|
|
594
|
+
const s = zt(e, i);
|
|
595
|
+
if (s === null) return null;
|
|
596
|
+
const a = Pt(s, t);
|
|
597
|
+
if (a.valid) return { ok: !0, tier: "ok", issues: [], hard: [], summary: "" };
|
|
598
|
+
const n = a.issues.map((o) => ({
|
|
599
|
+
...o,
|
|
600
|
+
tier: Nt[o.keyword] ?? _t
|
|
601
|
+
})), r = n.filter((o) => o.tier === "hard");
|
|
602
|
+
return {
|
|
603
|
+
ok: !1,
|
|
604
|
+
tier: r.length > 0 ? "hard" : "soft",
|
|
605
|
+
issues: n,
|
|
606
|
+
hard: r,
|
|
607
|
+
summary: Mt(r.length > 0 ? r : n)
|
|
608
|
+
};
|
|
609
|
+
}
|
|
610
|
+
function Xt(e) {
|
|
611
|
+
return `invalid card data (${e.tier}): ${e.summary}`;
|
|
612
|
+
}
|
|
613
|
+
const Ft = (e) => typeof e == "object" && e !== null && !Array.isArray(e);
|
|
614
|
+
function Jt(e) {
|
|
615
|
+
const t = e.map((s) => `"${s}"`).join(", "), i = e.length === 1 ? "type" : "types";
|
|
616
|
+
return [
|
|
617
|
+
`createCardRegistry: ${e.length} custom card ${i} registered with no \`schema\`: ${t}.`,
|
|
618
|
+
" They will still RENDER (their tag/component is registered), but:",
|
|
619
|
+
" - cardTools() skips them, so the model is never told the type exists and will never emit one;",
|
|
620
|
+
" - registry.validate() returns null for them, so nothing checks what does arrive.",
|
|
621
|
+
" A card type the model is never told about and that nothing validates is a silent hole.",
|
|
622
|
+
" Fix: give each one a `schema`. If the type is populated by your own code and never by a",
|
|
623
|
+
" model, say so with `onIncomplete: 'silent'`; use `onIncomplete: 'throw'` to make it fatal."
|
|
624
|
+
].join(`
|
|
625
|
+
`);
|
|
626
|
+
}
|
|
627
|
+
function Zt(e = {}) {
|
|
628
|
+
if (typeof e != "object" || e === null || Array.isArray(e))
|
|
629
|
+
throw new TypeError('createCardRegistry: expected a spec object, e.g. createCardRegistry({ use: ["confirm"] })');
|
|
630
|
+
const t = j, i = e.use ?? Object.keys(t), s = i.filter((d) => !Yt(d));
|
|
631
|
+
if (s.length > 0)
|
|
632
|
+
throw new TypeError(
|
|
633
|
+
`createCardRegistry: \`use\` names ${s.length} type(s) that are not built in: ${s.map((d) => `"${d}"`).join(", ")}. The built-in types are ${Object.keys(t).join(", ")}. A card type of your own goes in \`custom\`, with its schema, not in \`use\`.`
|
|
634
|
+
);
|
|
635
|
+
const a = new Set(i), n = Object.keys(t).filter((d) => a.has(d)), r = e.custom ?? {}, o = Object.keys(r);
|
|
636
|
+
if (o.find((d) => d.trim().length === 0) !== void 0)
|
|
637
|
+
throw new TypeError("createCardRegistry: a custom card type name must be a non-empty string; it becomes `CardEnvelope.type` and the `kai_<type>` tool name.");
|
|
638
|
+
const p = {};
|
|
639
|
+
for (const d of n) p[d] = t[d];
|
|
640
|
+
const c = {}, u = {}, h = {}, b = {}, f = [];
|
|
641
|
+
for (const d of o) {
|
|
642
|
+
const l = r[d];
|
|
643
|
+
if (typeof l != "object" || l === null || Array.isArray(l))
|
|
644
|
+
throw new TypeError(`createCardRegistry: custom card type "${d}" must be an object, e.g. { schema, tag }.`);
|
|
645
|
+
Ft(l.schema) ? (p[d] = l.schema, b[d] = l.schema) : (delete p[d], f.push(d)), typeof l.tag == "string" && l.tag.length > 0 && (u[d] = l.tag), typeof l.component == "function" && (h[d] = l.component), typeof l.description == "string" && l.description.length > 0 && (c[d] = l.description);
|
|
646
|
+
}
|
|
647
|
+
if (f.length > 0) {
|
|
648
|
+
const d = e.onIncomplete ?? "warn", l = Jt(f);
|
|
649
|
+
if (d === "throw") throw new TypeError(l);
|
|
650
|
+
d !== "silent" && console.warn(l);
|
|
651
|
+
}
|
|
652
|
+
const $ = Object.freeze({ ...b });
|
|
653
|
+
return Object.freeze({
|
|
654
|
+
schemas: Object.freeze(p),
|
|
655
|
+
descriptions: Object.freeze(c),
|
|
656
|
+
tags: Object.freeze(u),
|
|
657
|
+
components: Object.freeze(h),
|
|
658
|
+
types: Object.freeze([...n, ...o]),
|
|
659
|
+
builtIn: Object.freeze(n),
|
|
660
|
+
custom: Object.freeze([...o]),
|
|
661
|
+
incomplete: Object.freeze([...f]),
|
|
662
|
+
validationSchemas: $,
|
|
663
|
+
validate: (d, l) => Ut(d, l, $)
|
|
664
|
+
});
|
|
665
|
+
}
|
|
666
|
+
const ei = {
|
|
667
|
+
form: "kai-form",
|
|
668
|
+
confirm: "kai-confirm",
|
|
669
|
+
tasks: "kai-tasks",
|
|
670
|
+
choice: "kai-choice",
|
|
671
|
+
link: "kai-link-preview",
|
|
672
|
+
embed: "kai-embed",
|
|
673
|
+
artifact: "kai-artifact"
|
|
674
|
+
}, y = (e) => e, j = Object.freeze({
|
|
675
|
+
artifact: y(J),
|
|
676
|
+
choice: y(me),
|
|
677
|
+
confirm: y(we),
|
|
678
|
+
embed: y(Ce),
|
|
679
|
+
form: y(Be),
|
|
680
|
+
link: y(et),
|
|
681
|
+
tasks: y(ft)
|
|
682
|
+
}), ti = Object.freeze({
|
|
683
|
+
"card-envelope": y(Q),
|
|
684
|
+
"card-event": y(oe),
|
|
685
|
+
"form.result": y(_e),
|
|
686
|
+
"tasks.result": y(pt)
|
|
687
|
+
}), ii = Object.freeze(
|
|
688
|
+
Object.keys(j)
|
|
689
|
+
);
|
|
690
|
+
function Yt(e) {
|
|
691
|
+
return Object.prototype.hasOwnProperty.call(j, e);
|
|
692
|
+
}
|
|
693
|
+
export {
|
|
694
|
+
E as ANTHROPIC_STRICT,
|
|
695
|
+
ei as BUILTIN_CARD_TAGS,
|
|
696
|
+
kt as CARD_TOOL_DESCRIPTIONS,
|
|
697
|
+
S as KAI_TOOL_PREFIX,
|
|
698
|
+
C as OPENAI_STRICT,
|
|
699
|
+
Ot as UnsupportedCardToolSchemaError,
|
|
700
|
+
Kt as cardFromToolCall,
|
|
701
|
+
ii as cardSchemaNames,
|
|
702
|
+
j as cardSchemas,
|
|
703
|
+
v as cardTools,
|
|
704
|
+
q as cardTypeFromToolName,
|
|
705
|
+
Xt as cardValidationMessage,
|
|
706
|
+
xt as checkProviderSubset,
|
|
707
|
+
ti as contractSchemas,
|
|
708
|
+
Zt as createCardRegistry,
|
|
709
|
+
Yt as isCardSchemaName,
|
|
710
|
+
Ht as isCardTool,
|
|
711
|
+
Wt as providerSubsets,
|
|
712
|
+
Gt as toAnthropicTools,
|
|
713
|
+
Qt as toJsonSchemaTools,
|
|
714
|
+
Vt as toOpenAITools,
|
|
715
|
+
gt as toolNameForCardType,
|
|
716
|
+
Ut as validateCardData
|
|
717
|
+
};
|