@kitn.ai/ui 0.26.0 → 0.27.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 +16 -5
- package/bin/mcp.js +16 -3
- package/bin/route.js +23 -0
- package/bin/route.test.js +58 -0
- package/dist/{elements/chunks/Icon--Y8vsFal.js → Icon-BnFKqqtY.js} +1 -1
- package/dist/action-icons-CBskfBMz.js +1 -0
- package/dist/arrow-down-Br0qtpsz.js +1 -0
- package/dist/arrow-left-Dj7xgE12.js +1 -0
- package/dist/artifact-CvXEm1lS.js +1 -0
- package/dist/assets/dev-5XzXYR21.js +91 -0
- package/dist/attachments-C43ZegEq.js +1 -0
- package/dist/{elements/chunks/audio-visualizer-D7lB6mvR.js → audio-visualizer-B-79y1Tj.js} +1 -1
- package/dist/badge-BpUbq8c0.js +1 -0
- package/dist/bash-InADTalH.js +1 -6
- package/dist/bell-sn17Ip9v.js +1 -0
- package/dist/{elements/chunks/button-flUbeufF.js → button-BH6rN0U-.js} +1 -1
- package/dist/card-renderer-Cb1gQmth.js +1 -0
- package/dist/card-routing-DifQgS7n.js +1 -0
- package/dist/check-DPeeMUYx.js +1 -0
- package/dist/checkbox-Dc9Yov_B.js +1 -0
- package/dist/checkbox-group-B1kDLLYk.js +1 -0
- package/dist/chevron-down-CHSWk7ZT.js +1 -0
- package/dist/chevron-right-B7l_fMgx.js +1 -0
- package/dist/choice-card-BT3c1S8g.js +1 -0
- package/dist/circle-Bb0yOpqM.js +1 -0
- package/dist/circle-check-BGZpCiz7.js +1 -0
- package/dist/circle-x-wobWkoSx.js +1 -0
- package/dist/{elements/chunks/cn-CU7UAWzk.js → cn-DN5AWfiS.js} +1 -1
- package/dist/{elements/chunks/code-block-BdLiTitd.js → code-block-CUQ5mtv0.js} +1 -1
- package/dist/{elements/chunks/collapsible-BzbXpPzr.js → collapsible-CPJbf6FM.js} +1 -1
- package/dist/components/attachment-types.d.ts +7 -0
- package/dist/components/audio-visualizer/fit-scale.d.ts +1 -1
- package/dist/components/card-renderer.d.ts +13 -0
- package/dist/components/card.d.ts +4 -0
- package/dist/components/chat-thread.d.ts +46 -1
- package/dist/components/conversation-item.d.ts +19 -7
- package/dist/components/conversation-list.d.ts +17 -5
- package/dist/components/form-widgets.d.ts +67 -2
- package/dist/components/form.d.ts +48 -1
- package/dist/components/message.d.ts +25 -3
- package/dist/components/reasoning.d.ts +6 -0
- package/dist/components/scroll-button.d.ts +11 -0
- package/dist/components/thread.d.ts +5 -0
- package/dist/components/tool-types.d.ts +9 -0
- package/dist/composer-CjngLzal.js +106 -0
- package/dist/confirm-card-DCx_A4bU.js +1 -0
- package/dist/construct-cli.es.js +1169 -0
- package/dist/{elements/chunks/context-VLIL3sJ-.js → context-BY8V-Nlp.js} +1 -1
- package/dist/controllable-D43BKmtX.js +1 -0
- package/dist/conversation-list-D4lLU_yS.js +1 -0
- package/dist/copy-B6DO4PqB.js +1 -0
- package/dist/core-AYMC6_lb.js +12 -5874
- package/dist/{create-tween-CQED4T0g.js → create-tween-BPzaefTp.js} +1 -1
- package/dist/{create-tween-BFT6c-Y8.js → create-tween-CnMHviKB.js} +1 -1
- package/dist/{create-tween-CJNlzoaO.js → create-tween-D1aiGZZh.js} +1 -1
- package/dist/{elements/chunks/create-tween-c4Z8TDYz.js → create-tween-DUSQUKpr.js} +2 -2
- package/dist/css-M7EaDHN_.js +1 -6
- package/dist/custom-elements.json +1400 -218
- package/dist/default-input-CucQEOqH.js +1 -0
- package/dist/define-CGGX-7Vg.js +1 -0
- package/dist/define.d.ts +4 -0
- package/dist/define.js +510 -0
- package/dist/define.server.d.ts +5 -0
- package/dist/define.server.js +506 -0
- package/dist/{elements/chunks/disclosure-CcNbyLy0.js → disclosure-CbLtajUQ.js} +1 -1
- package/dist/{elements/chunks/dropdown-BgWTthUx.js → dropdown-BwhViJFd.js} +1 -1
- 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/autoloader.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-workspace.js +1 -1
- package/dist/elements/chat.js +1 -1
- package/dist/elements/checkbox-group.d.ts +1 -0
- package/dist/elements/checkbox-group.js +1 -0
- package/dist/elements/checkbox.d.ts +1 -0
- package/dist/elements/checkbox.js +1 -0
- package/dist/elements/checkpoint.js +1 -1
- package/dist/elements/choice.js +1 -1
- 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-item.js +1 -1
- package/dist/elements/conversation-list.js +1 -1
- package/dist/elements/define-entry.d.ts +12 -0
- package/dist/elements/dialog.js +1 -1
- package/dist/elements/dock.js +101 -7
- package/dist/elements/dropdown.js +1 -1
- package/dist/elements/editable-label.js +1 -1
- package/dist/elements/element-data-types.d.ts +37 -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-grid.d.ts +1 -0
- package/dist/elements/pane-grid.js +1 -0
- 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/radio-group.d.ts +1 -0
- package/dist/elements/radio-group.js +1 -0
- package/dist/elements/reasoning.js +1 -1
- 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/select.d.ts +1 -0
- package/dist/elements/select.js +1 -0
- 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/slider.d.ts +1 -0
- package/dist/elements/slider.js +1 -0
- package/dist/elements/slots.d.ts +1 -1
- 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/voice-input.js +1 -1
- package/dist/elements/voice-output.js +1 -1
- package/dist/elements.d.ts +362 -24
- package/dist/{elements/chunks/ellipsis-7gU33mL2.js → ellipsis-DFr4Vqr3.js} +1 -1
- package/dist/embed-5s_vU4J0.js +1 -0
- package/dist/engine-javascript-vq0WuIJl.js +14 -2516
- package/dist/{elements/chunks/external-link-CSOEsNlx.js → external-link-u9d85ORQ.js} +1 -1
- package/dist/file-text-CX7_x42o.js +1 -0
- package/dist/{elements/chunks/file-tree-zvB2i7P9.js → file-tree-D3kBjXI5.js} +1 -1
- package/dist/folder-V-YdIL8f.js +1 -0
- package/dist/form-BRNUMCN2.js +1 -0
- package/dist/github-dark-dimmed-DUshB20C.js +1 -4
- package/dist/github-light-JYsPkUQd.js +1 -4
- package/dist/hover-card-DaeiYrTA.js +1 -0
- package/dist/html-CPZ3oZQ7.js +1 -10
- package/dist/icon-BpixdZNq.js +1 -0
- package/dist/{elements/chunks/index-BCRhi84a.js → index-xu_pdcPi.js} +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +7330 -5852
- package/dist/index.server.js +5823 -4759
- package/dist/info-8mFsIjS3.js +1 -0
- package/dist/input-d1Yuu-hz.js +1 -0
- package/dist/javascript-C25yR2R2.js +1 -6
- package/dist/json-DxJze_jm.js +1 -6
- package/dist/kai.es.js +1 -1
- package/dist/kbd-961zMPFB.js +1 -0
- package/dist/link-DlZZBGaR.js +1 -0
- package/dist/{elements/chunks/link-preview-OQ9IEq0f.js → link-preview-DIIbV2Sd.js} +1 -1
- package/dist/loader-YQszHFaW.js +1 -0
- package/dist/{elements/chunks/markdown-DgBFaGAz.js → markdown-CVk1MPsj.js} +1 -1
- package/dist/mcp.es.js +1285 -79
- package/dist/message-CwKVEdZg.js +1 -0
- package/dist/message-DS8lzHc1.js +1 -0
- package/dist/message-circle-Xf8Q-vZp.js +1 -0
- package/dist/message-square-Cxnwgkns.js +1 -0
- package/dist/{elements/chunks/minimize-2-DPIUKTrT.js → minimize-2-UEZmP2QT.js} +1 -1
- package/dist/{elements/chunks/model-switcher-DsT8tFB0.js → model-switcher-Kk1jEQ5t.js} +1 -1
- package/dist/{elements/chunks/overlay-DuiwdXjm.js → overlay-C1od6LOz.js} +1 -1
- package/dist/panel-right-ryET0yyn.js +1 -0
- package/dist/paperclip-BDNoZFJP.js +1 -0
- package/dist/play-OFIvYXUQ.js +1 -0
- package/dist/primitives/card-data-types.d.ts +49 -0
- package/dist/primitives/card-routing.d.ts +1 -33
- package/dist/primitives/card-validate.d.ts +2 -2
- package/dist/primitives/chat-config.d.ts +29 -2
- package/dist/primitives/field-mask.d.ts +96 -0
- package/dist/primitives/field-semantics.d.ts +36 -0
- package/dist/primitives/input-mask.d.ts +46 -0
- package/dist/primitives/url-scheme-policy.d.ts +34 -0
- package/dist/primitives/use-resize-observer.d.ts +2 -2
- package/dist/progress-bar-BvYX0aoy.js +1 -0
- package/dist/prompt-suggestion-BRFu2lcu.js +1 -0
- package/dist/radio-DcL23cNJ.js +1 -0
- package/dist/react/index.d.ts +193 -19
- package/dist/react.js +216 -180
- package/dist/reasoning-Cackq4Rh.js +1 -0
- package/dist/register-impl-C7rENvPK.js +424 -0
- package/dist/{elements/chunks/resizable-D181b4fM.js → resizable-Cp9HUYih.js} +1 -1
- package/dist/rotate-ccw-0DLRDHH5.js +1 -0
- package/dist/rotate-cw-DOB9IGcU.js +1 -0
- package/dist/schemas/form.schema.json +21 -1
- package/dist/schemas/tool-defs.d.ts +11 -1
- package/dist/schemas.js +81 -81
- package/dist/scroll-area-emVmWP4K.js +1 -0
- package/dist/scroll-button-CeP_gv1x.js +1 -0
- package/dist/select-CWmu00tS.js +1 -0
- package/dist/{elements/chunks/separator-CeJHQqLW.js → separator-CE6vly6z.js} +1 -1
- package/dist/{elements/chunks/settings-CqaHgJF9.js → settings-CE-78SvZ.js} +1 -1
- package/dist/{elements/chunks/settings-group-CjqjLCOn.js → settings-group-ZFWNxFQR.js} +1 -1
- package/dist/{elements/chunks/skeleton-D8akBnKS.js → skeleton-BebdP4mf.js} +1 -1
- package/dist/slider-BAKRYUlz.js +1 -0
- package/dist/{solid-BtdqNZI7.js → solid-BE5ui6sy.js} +8727 -7212
- package/dist/{solid-CnavwBye.js → solid-DFhsce3O.js} +7015 -5886
- package/dist/solid.d.ts +10 -0
- package/dist/solid.js +240 -234
- package/dist/solid.server.js +240 -234
- package/dist/source-B0FlguSx.js +1 -0
- package/dist/star-CBMZvLuN.js +1 -0
- package/dist/state/index.d.ts +1 -1
- package/dist/state/mock.d.ts +32 -2
- package/dist/state.js +133 -108
- package/dist/{elements/chunks/store-Cjq0qwYN.js → store-7eoadydQ.js} +1 -1
- package/dist/svelte--5p79yCD.js +1 -15
- package/dist/switch-CViARZCy.js +1 -0
- package/dist/tasks-card-MjCcOhR_.js +1 -0
- package/dist/text-shimmer-DKlwRF2G.js +1 -0
- package/dist/textarea-3ay2Me2-.js +1 -0
- package/dist/theme.tokens.css +82 -13
- package/dist/{elements/chunks/thumbs-up-DX2Ijk3H.js → thumbs-up-DQcu2HMO.js} +1 -1
- package/dist/toast-store-C6yKOhbk.js +1 -0
- package/dist/{elements/chunks/tool-DKQ2D1DP.js → tool-BCYNlfKy.js} +1 -1
- package/dist/{elements/chunks/tooltip-B0G99y8w.js → tooltip-05zI4hjs.js} +1 -1
- package/dist/trash-2-BR1RxGky.js +1 -0
- package/dist/{elements/chunks/triangle-alert-F9cyUEyy.js → triangle-alert-DHohDOCy.js} +1 -1
- package/dist/tsx-B8rCNbgL.js +1 -6
- package/dist/typescript-RycA9KXf.js +1 -6
- package/dist/ui/checkbox-group.d.ts +83 -0
- package/dist/ui/checkbox.d.ts +40 -0
- package/dist/ui/dock.d.ts +22 -0
- package/dist/ui/icon.d.ts +3 -0
- package/dist/ui/input.d.ts +48 -2
- package/dist/ui/radio.d.ts +85 -0
- package/dist/ui/select.d.ts +71 -0
- package/dist/ui/slider.d.ts +65 -0
- package/dist/ui/switch.d.ts +9 -2
- package/dist/upload-BbGW6A_u.js +1 -0
- package/dist/url-scheme-policy-DHpoTJwB.js +1 -0
- package/dist/use-card-resolution-CJW4grFa.js +1 -0
- package/dist/{variant-aurora-B8II3-I1.js → variant-aurora-BUOVgPOB.js} +2 -2
- package/dist/{variant-aurora-CMNWOSJR.js → variant-aurora-CUsUJvFI.js} +2 -2
- package/dist/{variant-aurora-CcuDMWwQ.js → variant-aurora-CW2i4bfr.js} +1 -1
- package/dist/{elements/chunks/variant-aurora-qt6Zct8M.js → variant-aurora-xiMPty8f.js} +1 -1
- package/dist/{variant-custom-L16JLLZy.js → variant-custom-BQtOnmeO.js} +1 -1
- package/dist/{variant-custom-C714mqKl.js → variant-custom-CAm9L-E5.js} +2 -2
- package/dist/{variant-custom-BdvYC7af.js → variant-custom-CAnzzppW.js} +2 -2
- package/dist/{elements/chunks/variant-custom-tJp22_BQ.js → variant-custom-D91HjAKz.js} +1 -1
- package/dist/{variant-wave-ecwykeyL.js → variant-wave-Ca1Ls4_y.js} +2 -2
- package/dist/{variant-wave-D7ruiA1W.js → variant-wave-CxX39DKd.js} +2 -2
- package/dist/{elements/chunks/variant-wave-CaQ5ti39.js → variant-wave-DYyzIIZv.js} +1 -1
- package/dist/{variant-wave-2S4La2Ka.js → variant-wave-uY5crU_K.js} +1 -1
- package/dist/vue-BmIZj4XD.js +1 -33
- package/dist/x-C5m1JFgi.js +1 -0
- package/frameworks/react/index.tsx +198 -20
- package/llms-full.txt +1178 -21
- package/llms.txt +6 -3
- package/package.json +17 -4
- package/src/agent-tooling/catalog/invariants.ts +1 -1
- package/src/agent-tooling/catalog/surfaces.ts +72 -0
- package/src/agent-tooling/construct/cli-entry.ts +8 -0
- package/src/agent-tooling/construct/cli.ts +131 -0
- package/src/agent-tooling/construct/codegen.ts +1353 -0
- package/src/agent-tooling/construct/construct.v1.schema.json +250 -0
- package/src/agent-tooling/construct/dev.ts +148 -0
- package/src/agent-tooling/construct/fixtures/demo-widget.construct.json +7 -0
- package/src/agent-tooling/construct/fixtures/ops-console.construct.json +44 -0
- package/src/agent-tooling/construct/fixtures/owner-widget.construct.json +23 -0
- package/src/agent-tooling/construct/schema.ts +371 -0
- package/src/agent-tooling/mcp/server.ts +2 -1
- package/src/agent-tooling/mcp/tools/construct.ts +130 -0
- package/src/agent-tooling/mcp/tools/debug.ts +126 -4
- package/src/agent-tooling/mcp/tools/reference.ts +104 -3
- package/src/agent-tooling/recipes/composed-thread.ts +714 -0
- package/src/agent-tooling/recipes/index.ts +22 -0
- package/src/agent-tooling/recipes/types.ts +32 -0
- package/src/agent-tooling/registry.ts +5 -0
- package/src/components/attachment-types.ts +7 -0
- package/src/components/audio-visualizer/fit-scale.ts +1 -1
- package/src/components/card-renderer.tsx +39 -8
- package/src/components/card.tsx +10 -2
- package/src/components/chat-scope-picker.tsx +2 -2
- package/src/components/chat-thread.tsx +72 -9
- package/src/components/choice-card.tsx +102 -37
- package/src/components/coachmark.tsx +1 -1
- package/src/components/code-block.tsx +2 -2
- package/src/components/composer.tsx +89 -15
- package/src/components/confirm-card.tsx +20 -4
- package/src/components/conversation-item.tsx +33 -9
- package/src/components/conversation-list.tsx +25 -10
- package/src/components/empty.tsx +14 -3
- package/src/components/file-tree.tsx +5 -1
- package/src/components/form-widgets.tsx +257 -195
- package/src/components/form.tsx +297 -9
- package/src/components/loader.tsx +12 -5
- package/src/components/message-skills.tsx +1 -1
- package/src/components/message.tsx +71 -11
- package/src/components/prompt-input.tsx +7 -1
- package/src/components/prompt-suggestion.tsx +4 -1
- package/src/components/reasoning.tsx +30 -3
- package/src/components/response-compare.tsx +2 -2
- package/src/components/scroll-button.tsx +56 -4
- package/src/components/source.tsx +6 -1
- package/src/components/tasks-card.tsx +58 -16
- package/src/components/thread.tsx +10 -1
- package/src/components/toast.tsx +1 -1
- package/src/components/tool-types.ts +9 -0
- package/src/elements/attachments.tsx +3 -1
- package/src/elements/chat-workspace.tsx +1 -1
- package/src/elements/chat.tsx +22 -4
- package/src/elements/checkbox-group.tsx +164 -0
- package/src/elements/checkbox.tsx +134 -0
- package/src/elements/compiled.css +1 -1
- package/src/elements/composer.tsx +12 -1
- package/src/elements/conversation-item.tsx +62 -22
- package/src/elements/conversation-list.tsx +2 -2
- package/src/elements/define-entry.ts +12 -0
- package/src/elements/dock.tsx +11 -0
- package/src/elements/element-data-types.ts +40 -0
- package/src/elements/element-manifest.json +24 -0
- package/src/elements/element-meta.json +736 -46
- package/src/elements/element-nonscalar.json +15 -0
- package/src/elements/element-types.d.ts +362 -24
- package/src/elements/feedback-bar.tsx +5 -0
- package/src/elements/icon-names.json +29 -0
- package/src/elements/input.tsx +312 -23
- package/src/elements/message.tsx +2 -0
- package/src/elements/pane-grid.tsx +111 -0
- package/src/elements/prompt-input.tsx +8 -2
- package/src/elements/radio-group.tsx +129 -0
- package/src/elements/register-impl.ts +6 -0
- package/src/elements/scroll-button.tsx +54 -6
- package/src/elements/select.tsx +165 -0
- package/src/elements/slider.tsx +171 -0
- package/src/elements/slots.ts +1 -1
- package/src/elements/styles.css +89 -3
- package/src/elements/thread.tsx +2 -0
- package/src/elements/toast.tsx +14 -1
- package/src/index.ts +2 -1
- package/src/primitives/card-data-types.ts +49 -0
- package/src/primitives/card-host.tsx +4 -2
- package/src/primitives/card-routing.ts +7 -56
- package/src/primitives/card-schemas/form.schema.json +21 -1
- package/src/primitives/card-validate.ts +10 -2
- package/src/primitives/chat-config.tsx +33 -6
- package/src/primitives/field-mask.ts +256 -0
- package/src/primitives/field-semantics.ts +115 -0
- package/src/primitives/input-mask.ts +853 -0
- package/src/primitives/toast-store.ts +66 -4
- package/src/primitives/url-scheme-policy.ts +70 -0
- package/src/primitives/use-resize-observer.ts +2 -2
- package/src/schemas/tool-defs.ts +12 -2
- package/src/solid.ts +10 -0
- package/src/state/index.ts +1 -1
- package/src/state/mock.ts +92 -6
- package/src/ui/agent-card.tsx +2 -2
- package/src/ui/avatar.tsx +1 -1
- package/src/ui/checkbox-group.tsx +153 -0
- package/src/ui/checkbox.tsx +63 -0
- package/src/ui/dock.tsx +145 -6
- package/src/ui/icon.tsx +53 -0
- package/src/ui/input.tsx +249 -9
- package/src/ui/kbd.tsx +1 -1
- package/src/ui/nav.tsx +1 -1
- package/src/ui/pane-group.tsx +2 -2
- package/src/ui/radio.tsx +150 -0
- package/src/ui/select.tsx +168 -0
- package/src/ui/slider.tsx +178 -0
- package/src/ui/switch.tsx +49 -18
- package/src/utils/cn.ts +11 -5
- package/theme.css +84 -13
- package/dist/elements/chunks/action-icons-D9u3OzYW.js +0 -1
- package/dist/elements/chunks/arrow-left-CVh1TeN7.js +0 -1
- package/dist/elements/chunks/artifact-BkYcfIlZ.js +0 -1
- package/dist/elements/chunks/attachments-DwfNlubq.js +0 -1
- package/dist/elements/chunks/badge-Q0-Cmwzz.js +0 -1
- package/dist/elements/chunks/bash-InADTalH.js +0 -1
- package/dist/elements/chunks/card-renderer-3Dyl-FpN.js +0 -1
- package/dist/elements/chunks/card-routing-BK09BdmL.js +0 -1
- package/dist/elements/chunks/check-B5kBPKeo.js +0 -1
- package/dist/elements/chunks/chevron-down-DZ1GS39h.js +0 -1
- package/dist/elements/chunks/chevron-right-CvP7OUd2.js +0 -1
- package/dist/elements/chunks/choice-card-D4QUIOWZ.js +0 -1
- package/dist/elements/chunks/circle-CDf9g6MQ.js +0 -1
- package/dist/elements/chunks/circle-check-CA47Nqbz.js +0 -1
- package/dist/elements/chunks/circle-x-CJ_HVbC8.js +0 -1
- package/dist/elements/chunks/composer-Byve-n8K.js +0 -69
- package/dist/elements/chunks/confirm-card-B0flE3MN.js +0 -1
- package/dist/elements/chunks/controllable-DTwTIlwp.js +0 -1
- package/dist/elements/chunks/conversation-item-BDztezOG.js +0 -1
- package/dist/elements/chunks/copy-Nf-kqxXH.js +0 -1
- package/dist/elements/chunks/core-AYMC6_lb.js +0 -12
- package/dist/elements/chunks/css-M7EaDHN_.js +0 -1
- package/dist/elements/chunks/default-input-C2iLFq0b.js +0 -1
- package/dist/elements/chunks/define-wjHR1MkU.js +0 -1
- package/dist/elements/chunks/download-C4V7tBdb.js +0 -1
- package/dist/elements/chunks/embed-D3KewsIJ.js +0 -1
- package/dist/elements/chunks/engine-javascript-vq0WuIJl.js +0 -141
- package/dist/elements/chunks/file-text-D1G8khle.js +0 -1
- package/dist/elements/chunks/folder-WW2LGLid.js +0 -1
- package/dist/elements/chunks/form-CQirdC4W.js +0 -1
- package/dist/elements/chunks/github-dark-dimmed-DUshB20C.js +0 -1
- package/dist/elements/chunks/github-light-JYsPkUQd.js +0 -1
- package/dist/elements/chunks/hover-card-CJJkfHTK.js +0 -1
- package/dist/elements/chunks/html-CPZ3oZQ7.js +0 -1
- package/dist/elements/chunks/icon-Cfgmf4fa.js +0 -1
- package/dist/elements/chunks/info-DX3YMOt6.js +0 -1
- package/dist/elements/chunks/input-BtW9U6Sq.js +0 -1
- package/dist/elements/chunks/javascript-C25yR2R2.js +0 -1
- package/dist/elements/chunks/json-DxJze_jm.js +0 -1
- package/dist/elements/chunks/kbd-LGXwuT_V.js +0 -1
- package/dist/elements/chunks/link-2My69BqT.js +0 -1
- package/dist/elements/chunks/loader-iOxc_Tu-.js +0 -1
- package/dist/elements/chunks/message-VMZohrXx.js +0 -1
- package/dist/elements/chunks/message-circle-CpXMM-_n.js +0 -1
- package/dist/elements/chunks/message-square-DxcWtETQ.js +0 -1
- package/dist/elements/chunks/message-tZmV2A3p.js +0 -1
- package/dist/elements/chunks/paperclip-CRZVp4z_.js +0 -1
- package/dist/elements/chunks/progress-bar-DNy66e_E.js +0 -1
- package/dist/elements/chunks/prompt-suggestion-Bn64Nl7L.js +0 -1
- package/dist/elements/chunks/reasoning-Emn9N4-T.js +0 -1
- package/dist/elements/chunks/rotate-cw-CPWe37D9.js +0 -1
- package/dist/elements/chunks/scroll-area-ClZkZxIk.js +0 -1
- package/dist/elements/chunks/scroll-button-DPE-t3x_.js +0 -1
- package/dist/elements/chunks/share-CyfnNEqp.js +0 -1
- package/dist/elements/chunks/source-UWCvmVak.js +0 -1
- package/dist/elements/chunks/star-DoHFAikQ.js +0 -1
- package/dist/elements/chunks/svelte--5p79yCD.js +0 -1
- package/dist/elements/chunks/tasks-card-CmZ5xh6v.js +0 -1
- package/dist/elements/chunks/text-shimmer-DYn09zrz.js +0 -1
- package/dist/elements/chunks/textarea-skiGHURM.js +0 -1
- package/dist/elements/chunks/toast-store-CFnQpThX.js +0 -1
- package/dist/elements/chunks/tsx-B8rCNbgL.js +0 -1
- package/dist/elements/chunks/typescript-RycA9KXf.js +0 -1
- package/dist/elements/chunks/use-card-resolution-DoA2f_EU.js +0 -1
- package/dist/elements/chunks/vue-BmIZj4XD.js +0 -1
- package/dist/elements/chunks/x-B6UnOiLw.js +0 -1
- package/dist/llms/llms-full.txt +0 -2949
- package/dist/llms/llms.txt +0 -156
- package/dist/register-impl-DpE7icIb.js +0 -293
- package/dist/ui/stat.d.ts +0 -16
- package/src/ui/stat.tsx +0 -41
- /package/dist/{elements/chunks/card-tags-D8lZ-C_U.js → card-tags-D8lZ-C_U.js} +0 -0
- /package/dist/{elements/chunks/link-preview-DNILK391.js → link-preview-DNILK391.js} +0 -0
- /package/dist/{elements/chunks/slots-DaNjX0rc.js → slots-DaNjX0rc.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as G,G as se,g as A,
|
|
1
|
+
import{s as G,G as se,g as A,p as D,q as W,i as P,c as j,a as q,b as ce,d as ue,S as H,n as de,B as fe,t as M,e as me}from"./define-CGGX-7Vg.js";import{c as E}from"./cn-DN5AWfiS.js";var U=M("<div>"),xe=M('<div><svg viewBox="0 0 4 8"fill=currentColor><circle cx=1 cy=1.5 r=0.6></circle><circle cx=3 cy=1.5 r=0.6></circle><circle cx=1 cy=4 r=0.6></circle><circle cx=3 cy=4 r=0.6></circle><circle cx=1 cy=6.5 r=0.6></circle><circle cx=3 cy=6.5 r=0.6>'),ge=M("<div class=pointer-events-none data-handle-line style=position:absolute>"),pe=M("<div role=separator aria-valuemin=0 aria-valuemax=100>");const J=fe();function L(l){if(l==null||l==="")return;if(typeof l=="number")return Number.isFinite(l)?`${l}%`:void 0;const t=l.trim();if(t==="")return;if(t.endsWith("%")||t.endsWith("px"))return t;const o=Number(t);return Number.isFinite(o)?`${o}%`:void 0}function T(l){const t=/^\s*(-?\d*\.?\d+)(px|%)\s*$/.exec(l);return t?{n:parseFloat(t[1]),unit:t[2]}:null}function K(l,t,o){if(l===void 0)return;const u=T(l),d=t===void 0?void 0:T(t),f=o===void 0?void 0:T(o);if(u&&(t===void 0||d?.unit===u.unit)&&(o===void 0||f?.unit===u.unit)){let i=u.n;return f&&(i=Math.min(i,f.n)),d&&(i=Math.max(i,d.n)),`${i}${u.unit}`}return t!==void 0&&o!==void 0?`clamp(${t}, ${l}, ${o})`:o!==void 0?`min(${l}, ${o})`:t!==void 0?`max(${t}, ${l})`:l}function ve(l){const[t,o]=G(l,["orientation","children","class"]),u=()=>t.orientation??"horizontal";return j(J.Provider,{get value(){return{orientation:u()}},get children(){var d=U();return D(d,W({get class(){return E("flex h-full w-full",u()==="vertical"?"flex-col":"flex-row",t.class)},get"data-orientation"(){return u()}},o),!1,!0),P(d,()=>t.children),d}})}function he(l){const[t,o]=G(l,["defaultSize","minSize","maxSize","locked","hidden","children","class","style"]),u=(i,v,x)=>{const m=L(i);if(m!==void 0)return m;const h=v==null?"":String(v).trim();if(h!==""){const n=parseFloat(h);if(Number.isFinite(n))return`${n}px`}const g=x==null?"":String(x).trim();if(g!==""){const n=parseFloat(g);if(Number.isFinite(n))return`${n}%`}},d=()=>{const i=o,v=u(t.minSize,i["data-min-size"],i["data-min-size-pct"]),x=u(t.maxSize,i["data-max-size"],i["data-max-size-pct"]),m=K(L(t.defaultSize),v,x);return{...m!==void 0?{"flex-basis":m,"flex-grow":"0","flex-shrink":"0"}:{flex:"1 1 0%"},display:"grid","grid-template-rows":"minmax(0, 1fr)","grid-template-columns":"minmax(0, 1fr)","min-width":"0","min-height":"0"}},f=()=>{const i={},v=(x,m,h)=>{if(x==null||x==="")return;if(typeof x=="number"){i[h]=String(x);return}const g=x.trim();g.endsWith("px")?i[m]=String(parseFloat(g)):g.endsWith("%")?i[h]=String(parseFloat(g)):Number.isFinite(Number(g))&&(i[h]=g)};return v(t.minSize,"data-min-size","data-min-size-pct"),v(t.maxSize,"data-max-size","data-max-size-pct"),v(t.defaultSize,"data-default-size","data-default-size-pct"),i};return(()=>{var i=U();return D(i,W({get class(){return E("overflow-hidden",t.class)},get style(){return{...d(),...typeof t.style=="object"?t.style:{}}},get"data-locked"(){return t.locked?"":void 0},get hidden(){return t.hidden||void 0}},f,o),!1,!0),P(i,()=>t.children),i})()}function R(l,t,o,u){const d=l.dataset[t==="min"?"minSize":"maxSize"];if(d!==void 0&&d!==""){const i=parseFloat(d);if(Number.isFinite(i))return i}const f=l.dataset[t==="min"?"minSizePct":"maxSizePct"];if(f!==void 0&&f!==""){const i=parseFloat(f);if(Number.isFinite(i))return i/100*o}return u}function ye(l){const[t,o]=G(l,["handle","onPanelResize","class","keyboardStep","static","orientation"]),u=se(J),d=()=>t.orientation??u?.orientation??"horizontal",[f,i]=A(!1),[v,x]=A(!1),m=()=>!!t.static,h=()=>t.handle??"line";let g=0,n=null,s=null,$=0,C=0;const y=()=>d()==="horizontal",p=()=>y()?"width":"height",O=e=>{if(m())return;const r=e.currentTarget;n=r.previousElementSibling,s=r.nextElementSibling,!(!n||!s)&&(e.preventDefault(),i(!0),r.setPointerCapture(e.pointerId),g=y()?e.clientX:e.clientY,$=n.getBoundingClientRect()[p()],C=s.getBoundingClientRect()[p()])},Q=e=>{if(!f()||!n||!s)return;const r=(y()?e.clientX:e.clientY)-g;F(r)};function F(e){var r;if(!n||!s)return!1;const a=n.parentElement,c=a?a.getBoundingClientRect()[p()]:0,z=R(n,"min",c,0),k=R(n,"max",c,999999),b=R(s,"min",c,0),B=R(s,"max",c,999999);let S=-1/0,w=1/0;if(S=Math.max(S,z-$),w=Math.min(w,k-$),S=Math.max(S,C-B),w=Math.min(w,C-b),S>w)return!1;const N=Math.max(S,Math.min(w,e)),ae=$+N,oe=C-N;return n.style.flexBasis=`${ae}px`,n.style.flexGrow="0",n.style.flexShrink="0",s.style.flexBasis=`${oe}px`,s.style.flexGrow="0",s.style.flexShrink="0",(r=t.onPanelResize)==null||r.call(t,N),!0}function X(){if(!n||!s)return;const e=n.parentElement;if(!e)return;const r=e.getBoundingClientRect()[p()];if(r<=0)return;const a=n.getBoundingClientRect()[p()]/r*100,c=s.getBoundingClientRect()[p()]/r*100;n.style.flexBasis=`${a}%`,s.style.flexBasis=`${c}%`}const V=()=>{X(),i(!1),n=null,s=null};function Y(e){const r=e.dataset.defaultSize,a=e.dataset.defaultSizePct;r!==void 0&&r!==""?(e.style.flexBasis=`${r}px`,e.style.flexGrow="0",e.style.flexShrink="0"):a!==void 0&&a!==""?(e.style.flexBasis=`${a}%`,e.style.flexGrow="0",e.style.flexShrink="0"):(e.style.flexBasis="",e.style.flexGrow="1",e.style.flexShrink="1")}const Z=e=>{var r;if(m())return;const a=e.currentTarget,c=a.previousElementSibling,z=a.nextElementSibling;!c||!z||(e.preventDefault(),Y(c),Y(z),(r=t.onPanelResize)==null||r.call(t,0))},_=A(50),[ee,te]=_;function ne(e){return n=e.previousElementSibling,s=e.nextElementSibling,!n||!s?!1:($=n.getBoundingClientRect()[p()],C=s.getBoundingClientRect()[p()],!0)}function ie(){if(!n)return;const e=n.parentElement;if(!e)return;const r=e.getBoundingClientRect()[p()];if(r<=0)return;const a=n.getBoundingClientRect()[p()]/r*100;te(Math.round(a))}const re=e=>{if(m())return;const r=e.currentTarget,a=t.keyboardStep??16,c=y(),z=c?"ArrowLeft":"ArrowUp",k=c?"ArrowRight":"ArrowDown";let b=null;if(e.key===z)b=-a;else if(e.key===k)b=a;else if(e.key==="Home")b="min";else if(e.key==="End")b="max";else return;if(e.preventDefault(),!!ne(r)){if(b==="min"){const B=n.parentElement,S=B?B.getBoundingClientRect()[p()]:0,w=R(n,"min",S,0);F(w-$)}else if(b==="max"){const B=n.parentElement,S=B?B.getBoundingClientRect()[p()]:0,w=R(n,"max",S,999999);F(w-$)}else F(b);ie(),X(),n=null,s=null}},I=()=>f()&&h()!=="line",le=()=>f()?"var(--color-muted, #f4f4f5)":v()?"var(--color-border, #e4e4e7)":"transparent";return(()=>{var e=pe();return e.$$keydown=re,e.$$dblclick=Z,e.addEventListener("pointerleave",()=>x(!1)),e.addEventListener("pointerenter",()=>x(!0)),e.$$pointerup=V,e.$$pointermove=Q,e.$$pointerdown=O,D(e,W({get class(){return E("relative flex items-center justify-center",t.class)},get style(){return{cursor:m()?"default":y()?"col-resize":"row-resize",[y()?"width":"height"]:"8px","flex-shrink":"0",background:I()?"var(--color-muted-foreground, #98989f)":"transparent",opacity:I()?"0.3":"1"}},get tabIndex(){return m()?void 0:0},get"data-orientation"(){return d()},get"data-static"(){return m()?"":void 0},get"aria-orientation"(){return y()?"vertical":"horizontal"},get"aria-valuenow"(){return ee()}},o),!1,!0),P(e,j(H,{get when(){return h()==="grip"},get children(){var r=xe(),a=r.firstChild;return q(c=>{var z=E("z-10 flex items-center justify-center",y()?"h-6 w-3 flex-col":"h-3 w-6 flex-row"),k=E("text-muted-foreground/40",y()?"h-3 w-2":"h-2 w-3 rotate-90");return z!==c.e&&ce(r,c.e=z),k!==c.t&&ue(a,"class",c.t=k),c},{e:void 0,t:void 0}),r}}),null),P(e,j(H,{get when(){return h()==="line"},get children(){var r=ge();return q(a=>de(r,{background:le(),...y()?{top:"0",bottom:"0",left:"50%",width:"1px",transform:"translateX(-0.5px)"}:{left:"0",right:"0",top:"50%",height:"1px",transform:"translateY(-0.5px)"}},a)),r}}),null),e})()}me(["pointerdown","pointermove","pointerup","dblclick","keydown"]);export{ye as R,he as a,ve as b,K as c,L as n};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{I as o}from"./Icon-BnFKqqtY.js";import{c as e,q as r}from"./define-CGGX-7Vg.js";var t=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],m=a=>e(o,r(a,{name:"RotateCcw",iconNode:t})),p=m;export{p as r};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{I as a}from"./Icon-BnFKqqtY.js";import{c as o,q as y}from"./define-CGGX-7Vg.js";var n=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],d=e=>o(a,y(e,{name:"ArrowRight",iconNode:n})),t=d,i=[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]],p=e=>o(a,y(e,{name:"Code",iconNode:i})),h=p,k=[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]],s=e=>o(a,y(e,{name:"Download",iconNode:k})),c=s,r=[["path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z",key:"rwhkz3"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],l=e=>o(a,y(e,{name:"Eye",iconNode:r})),m=l,v=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]],M=e=>o(a,y(e,{name:"House",iconNode:v})),w=M,N=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],g=e=>o(a,y(e,{name:"RotateCw",iconNode:N})),f=g;export{t as a,h as c,c as d,m as e,w as h,f as r};
|
|
@@ -11,7 +11,27 @@
|
|
|
11
11
|
"description": { "type": "string" },
|
|
12
12
|
"required": { "type": "array", "items": { "type": "string" } },
|
|
13
13
|
"properties": {
|
|
14
|
-
"type": "object"
|
|
14
|
+
"type": "object",
|
|
15
|
+
"description": "The fields to collect, keyed by property name. Each value is a JSON Schema field definition (type, title, description, enum, minimum/maximum, minLength/maxLength, pattern, items) plus optional x-kai-* UI hints. Only the display-format hints are spelled out below; the rest of a field definition is ordinary JSON Schema.",
|
|
16
|
+
"additionalProperties": {
|
|
17
|
+
"type": "object",
|
|
18
|
+
"properties": {
|
|
19
|
+
"x-kai-format": {
|
|
20
|
+
"description": "Display format for a string field. `tel`, `ssn` and `credit-card` apply that type's standard mask and submit digits only; `custom` masks with `x-kai-mask` and submits the formatted value. Omit it for a plain text field.",
|
|
21
|
+
"enum": ["tel", "ssn", "credit-card", "custom"]
|
|
22
|
+
},
|
|
23
|
+
"x-kai-mask": {
|
|
24
|
+
"description": "The mask pattern, used only with `x-kai-format: \"custom\"`: `#` one digit, `@` one letter or digit, `*` one letter or digit that may be obscured; every other character is a literal shown as typed, e.g. `CHG-####`.",
|
|
25
|
+
"type": "string",
|
|
26
|
+
"maxLength": 64
|
|
27
|
+
},
|
|
28
|
+
"x-kai-mask-guide": {
|
|
29
|
+
"description": "Placeholder text shown at the unfilled positions of the mask, aligned character for character with the pattern (`mm/dd/yyyy` for `##/##/####`). Derived from the pattern when omitted.",
|
|
30
|
+
"type": "string",
|
|
31
|
+
"maxLength": 64
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
15
35
|
},
|
|
16
36
|
"x-kai-order": { "type": "array", "items": { "type": "string" } },
|
|
17
37
|
"x-kai-inlineMax": { "type": "integer", "minimum": 1 },
|
|
@@ -46,7 +46,7 @@ export interface CardToolOptions<P extends ToolProvider = ToolProvider> {
|
|
|
46
46
|
*/
|
|
47
47
|
readonly strict?: boolean;
|
|
48
48
|
/**
|
|
49
|
-
* Narrow the DERIVED tool schema per card type, after projection
|
|
49
|
+
* Narrow the DERIVED tool schema per card type, after projection.
|
|
50
50
|
*
|
|
51
51
|
* A card's authored schema is deliberately permissive — `files` is optional on an
|
|
52
52
|
* artifact, its items need only a `path` — because the card CONTRACT must accept
|
|
@@ -61,6 +61,16 @@ export interface CardToolOptions<P extends ToolProvider = ToolProvider> {
|
|
|
61
61
|
* unknown path or a required name the node has no property for is a TypeError
|
|
62
62
|
* naming the card, the path and the field, because a tool that can never be
|
|
63
63
|
* satisfied must not ship quietly.
|
|
64
|
+
*
|
|
65
|
+
* IT CANNOT REACH A FORM CARD'S FIELDS, and that is a known limitation rather
|
|
66
|
+
* than an oversight. The form
|
|
67
|
+
* card's payload IS a JSON Schema, so `form.schema.json` describes `properties`
|
|
68
|
+
* as a map of field definitions and there is no node at `properties.ticketId`
|
|
69
|
+
* for a rule to land on — `require: { form: [{ path: 'properties.ticketId' }] }`
|
|
70
|
+
* raises the TypeError above, correctly. So an app cannot pin
|
|
71
|
+
* `x-kai-format: 'custom'` onto one field of a form the model authors. The
|
|
72
|
+
* enum on that hint is what makes a small model pick a valid token; an app that
|
|
73
|
+
* needs a guarantee checks the envelope when it arrives.
|
|
64
74
|
*/
|
|
65
75
|
readonly require?: Readonly<Record<string, readonly CardRequireRule[]>>;
|
|
66
76
|
}
|
package/dist/schemas.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
var z = Object.defineProperty;
|
|
2
2
|
var M = (e, t, i) => t in e ? z(e, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : e[t] = i;
|
|
3
|
-
var
|
|
4
|
-
const U = "https://json-schema.org/draft/2020-12/schema", F = "https://kitn.ai/schemas/card/artifact.schema.json", J = "ArtifactCardData", B = "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.",
|
|
5
|
-
const
|
|
3
|
+
var $ = (e, t, i) => M(e, typeof t != "symbol" ? t + "" : t, i);
|
|
4
|
+
const U = "https://json-schema.org/draft/2020-12/schema", F = "https://kitn.ai/schemas/card/artifact.schema.json", J = "ArtifactCardData", B = "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.", H = "object";
|
|
5
|
+
const Y = [{ required: ["src"] }, { required: ["files"] }], K = { 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 }] } }, W = {
|
|
6
6
|
$schema: U,
|
|
7
7
|
$id: F,
|
|
8
8
|
title: J,
|
|
9
9
|
description: B,
|
|
10
|
-
type:
|
|
10
|
+
type: H,
|
|
11
11
|
additionalProperties: !1,
|
|
12
|
-
anyOf:
|
|
12
|
+
anyOf: Y,
|
|
13
13
|
properties: K
|
|
14
|
-
},
|
|
15
|
-
$schema:
|
|
16
|
-
$id:
|
|
14
|
+
}, G = "https://json-schema.org/draft/2020-12/schema", V = "https://kitn.ai/schemas/card/card-envelope.schema.json", X = "CardEnvelope", Q = "A card the agent/server asks the chat to render. `data` validates against the per-type schema.", Z = "object", ee = ["type", "id", "data"], te = { type: { type: "string", minLength: 1 }, id: { type: "string", minLength: 1 }, data: {}, title: { type: "string" } }, ie = {
|
|
15
|
+
$schema: G,
|
|
16
|
+
$id: V,
|
|
17
17
|
title: X,
|
|
18
18
|
description: Q,
|
|
19
19
|
type: Z,
|
|
@@ -27,18 +27,18 @@ const H = [{ required: ["src"] }, { required: ["files"] }], K = { src: { type: "
|
|
|
27
27
|
type: ae,
|
|
28
28
|
required: pe,
|
|
29
29
|
properties: de
|
|
30
|
-
},
|
|
31
|
-
$schema:
|
|
32
|
-
$id:
|
|
30
|
+
}, le = "https://json-schema.org/draft/2020-12/schema", ue = "https://kitn.ai/schemas/card/choice.schema.json", me = "ChoiceCardData", he = "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.", fe = "object", ye = ["options"], ge = { 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`." } }, be = {
|
|
31
|
+
$schema: le,
|
|
32
|
+
$id: ue,
|
|
33
33
|
title: me,
|
|
34
34
|
description: he,
|
|
35
35
|
type: fe,
|
|
36
36
|
required: ye,
|
|
37
37
|
properties: ge
|
|
38
|
-
}, ve = "https://json-schema.org/draft/2020-12/schema",
|
|
38
|
+
}, ve = "https://json-schema.org/draft/2020-12/schema", we = "https://kitn.ai/schemas/card/confirm.schema.json", $e = "ConfirmCardData", xe = "Data payload for a `confirm` card (CardEnvelope.data when type='confirm').", ke = "object", Oe = ["actions"], je = { 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." } }, Se = {
|
|
39
39
|
$schema: ve,
|
|
40
|
-
$id:
|
|
41
|
-
title:
|
|
40
|
+
$id: we,
|
|
41
|
+
title: $e,
|
|
42
42
|
description: xe,
|
|
43
43
|
type: ke,
|
|
44
44
|
required: Oe,
|
|
@@ -59,14 +59,14 @@ const H = [{ required: ["src"] }, { required: ["files"] }], K = { src: { type: "
|
|
|
59
59
|
title: ze,
|
|
60
60
|
description: Me,
|
|
61
61
|
type: Ue
|
|
62
|
-
}, Je = "https://json-schema.org/draft/2020-12/schema", Be = "https://kitn.ai/schemas/card/form.schema.json",
|
|
62
|
+
}, Je = "https://json-schema.org/draft/2020-12/schema", Be = "https://kitn.ai/schemas/card/form.schema.json", He = "kai-form data (a form definition)", Ye = "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.", Ke = "object", We = ["type", "properties"], Ge = { type: { const: "object" }, title: { type: "string" }, description: { type: "string" }, required: { type: "array", items: { type: "string" } }, properties: { type: "object", description: "The fields to collect, keyed by property name. Each value is a JSON Schema field definition (type, title, description, enum, minimum/maximum, minLength/maxLength, pattern, items) plus optional x-kai-* UI hints. Only the display-format hints are spelled out below; the rest of a field definition is ordinary JSON Schema.", additionalProperties: { type: "object", properties: { "x-kai-format": { description: "Display format for a string field. `tel`, `ssn` and `credit-card` apply that type's standard mask and submit digits only; `custom` masks with `x-kai-mask` and submits the formatted value. Omit it for a plain text field.", enum: ["tel", "ssn", "credit-card", "custom"] }, "x-kai-mask": { description: 'The mask pattern, used only with `x-kai-format: "custom"`: `#` one digit, `@` one letter or digit, `*` one letter or digit that may be obscured; every other character is a literal shown as typed, e.g. `CHG-####`.', type: "string", maxLength: 64 }, "x-kai-mask-guide": { description: "Placeholder text shown at the unfilled positions of the mask, aligned character for character with the pattern (`mm/dd/yyyy` for `##/##/####`). Derived from the pattern when omitted.", type: "string", maxLength: 64 } } } }, "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"] } } } } }, Ve = {
|
|
63
63
|
$schema: Je,
|
|
64
64
|
$id: Be,
|
|
65
|
-
title:
|
|
66
|
-
description:
|
|
65
|
+
title: He,
|
|
66
|
+
description: Ye,
|
|
67
67
|
type: Ke,
|
|
68
68
|
required: We,
|
|
69
|
-
properties:
|
|
69
|
+
properties: Ge
|
|
70
70
|
}, Xe = "https://json-schema.org/draft/2020-12/schema", Qe = "https://kitn.ai/schemas/card/link.schema.json", Ze = "LinkPreviewData", et = "Rich link / Open-Graph preview payload. The card renders from this; it never fetches.", tt = "object", it = ["url"], nt = !1, ot = { 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 } }, rt = {
|
|
71
71
|
$schema: Xe,
|
|
72
72
|
$id: Qe,
|
|
@@ -76,22 +76,22 @@ const H = [{ required: ["src"] }, { required: ["files"] }], K = { src: { type: "
|
|
|
76
76
|
required: it,
|
|
77
77
|
additionalProperties: nt,
|
|
78
78
|
properties: ot
|
|
79
|
-
}, st = "https://json-schema.org/draft/2020-12/schema", at = "https://kitn.ai/schemas/card/tasks.result.schema.json", pt = "TasksCardResult", dt = "Payload of CardEvent { kind: 'submit' } from a tasks card.", ct = "object",
|
|
79
|
+
}, st = "https://json-schema.org/draft/2020-12/schema", at = "https://kitn.ai/schemas/card/tasks.result.schema.json", pt = "TasksCardResult", dt = "Payload of CardEvent { kind: 'submit' } from a tasks card.", ct = "object", lt = ["selected"], ut = { 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 } }, mt = {
|
|
80
80
|
$schema: st,
|
|
81
81
|
$id: at,
|
|
82
82
|
title: pt,
|
|
83
83
|
description: dt,
|
|
84
84
|
type: ct,
|
|
85
|
-
required:
|
|
86
|
-
properties:
|
|
87
|
-
}, ht = "https://json-schema.org/draft/2020-12/schema", ft = "https://kitn.ai/schemas/card/tasks.schema.json", yt = "TasksCardData", gt = "Data payload for a `tasks` card (CardEnvelope.data when type='tasks').", bt = "object", vt = ["tasks"],
|
|
85
|
+
required: lt,
|
|
86
|
+
properties: ut
|
|
87
|
+
}, ht = "https://json-schema.org/draft/2020-12/schema", ft = "https://kitn.ai/schemas/card/tasks.schema.json", yt = "TasksCardData", gt = "Data payload for a `tasks` card (CardEnvelope.data when type='tasks').", bt = "object", vt = ["tasks"], wt = { 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`." } }, $t = {
|
|
88
88
|
$schema: ht,
|
|
89
89
|
$id: ft,
|
|
90
90
|
title: yt,
|
|
91
91
|
description: gt,
|
|
92
92
|
type: bt,
|
|
93
93
|
required: vt,
|
|
94
|
-
properties:
|
|
94
|
+
properties: wt
|
|
95
95
|
}, S = "kai_";
|
|
96
96
|
function C(e) {
|
|
97
97
|
if (!e.startsWith(S)) return null;
|
|
@@ -304,8 +304,8 @@ function x(e, t, i, n, r) {
|
|
|
304
304
|
return;
|
|
305
305
|
}
|
|
306
306
|
for (const [p, c] of Object.entries(e)) {
|
|
307
|
-
const
|
|
308
|
-
if (!
|
|
307
|
+
const u = t.keywords[p];
|
|
308
|
+
if (!u) {
|
|
309
309
|
r.push({
|
|
310
310
|
path: i,
|
|
311
311
|
keyword: p,
|
|
@@ -313,12 +313,12 @@ function x(e, t, i, n, r) {
|
|
|
313
313
|
});
|
|
314
314
|
continue;
|
|
315
315
|
}
|
|
316
|
-
if (
|
|
317
|
-
r.push({ path: i, keyword: p, reason: `not supported (${
|
|
316
|
+
if (u.status === "unsupported") {
|
|
317
|
+
r.push({ path: i, keyword: p, reason: `not supported (${u.note})` });
|
|
318
318
|
continue;
|
|
319
319
|
}
|
|
320
|
-
if (
|
|
321
|
-
const h =
|
|
320
|
+
if (u.status === "supported" && u.value) {
|
|
321
|
+
const h = u.value(c);
|
|
322
322
|
h && r.push({ path: i, keyword: p, reason: h });
|
|
323
323
|
}
|
|
324
324
|
}
|
|
@@ -332,11 +332,11 @@ function x(e, t, i, n, r) {
|
|
|
332
332
|
keyword: "properties",
|
|
333
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
334
|
}), a && t.requireAllPropertiesRequired && o) {
|
|
335
|
-
const p = Array.isArray(e.required) ? e.required.map(String) : [], c = Object.keys(e.properties).filter((
|
|
335
|
+
const p = Array.isArray(e.required) ? e.required.map(String) : [], c = Object.keys(e.properties).filter((u) => !p.includes(u));
|
|
336
336
|
c.length > 0 && r.push({
|
|
337
337
|
path: i,
|
|
338
338
|
keyword: "required",
|
|
339
|
-
reason: `${t.label} requires every property in \`required\`; missing ${c.map((
|
|
339
|
+
reason: `${t.label} requires every property in \`required\`; missing ${c.map((u) => `\`${u}\``).join(", ")} (emulate optional with a \`null\` union)`
|
|
340
340
|
});
|
|
341
341
|
}
|
|
342
342
|
n && !t.allowRootAnyOf && "anyOf" in e && r.push({
|
|
@@ -351,25 +351,25 @@ function x(e, t, i, n, r) {
|
|
|
351
351
|
keyword: "type",
|
|
352
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
353
|
});
|
|
354
|
-
const
|
|
354
|
+
const l = (p) => {
|
|
355
355
|
var c;
|
|
356
356
|
return ((c = t.keywords[p]) == null ? void 0 : c.status) === "unsupported";
|
|
357
357
|
};
|
|
358
358
|
for (const p of kt) {
|
|
359
359
|
const c = e[p];
|
|
360
|
-
if (!(!O(c) ||
|
|
361
|
-
for (const [
|
|
362
|
-
x(h, t, p === "properties" ? jt(i,
|
|
360
|
+
if (!(!O(c) || l(p)))
|
|
361
|
+
for (const [u, h] of Object.entries(c))
|
|
362
|
+
x(h, t, p === "properties" ? jt(i, u) : `${i}/${p}[${u}]`, !1, r);
|
|
363
363
|
}
|
|
364
364
|
for (const p of xt) {
|
|
365
|
-
if (!(p in e) ||
|
|
365
|
+
if (!(p in e) || l(p)) continue;
|
|
366
366
|
const c = e[p];
|
|
367
367
|
typeof c != "boolean" && x(c, t, p === "items" ? `${i === "(root)" ? "(root)" : i}[]` : `${i}/${p}`, !1, r);
|
|
368
368
|
}
|
|
369
369
|
O(e.additionalProperties) && x(e.additionalProperties, t, `${i}/additionalProperties`, !1, r);
|
|
370
370
|
for (const p of Ot) {
|
|
371
371
|
const c = e[p];
|
|
372
|
-
!Array.isArray(c) ||
|
|
372
|
+
!Array.isArray(c) || l(p) || c.forEach((u, h) => x(u, t, `${i}/${p}[${h}]`, !1, r));
|
|
373
373
|
}
|
|
374
374
|
}
|
|
375
375
|
const At = Object.freeze({
|
|
@@ -384,10 +384,10 @@ const At = Object.freeze({
|
|
|
384
384
|
class qt extends Error {
|
|
385
385
|
constructor(i, n) {
|
|
386
386
|
super(It(i, n));
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
387
|
+
$(this, "name", "UnsupportedCardToolSchemaError");
|
|
388
|
+
$(this, "provider");
|
|
389
|
+
$(this, "source");
|
|
390
|
+
$(this, "cards");
|
|
391
391
|
this.provider = i.id, this.source = i.source, this.cards = n;
|
|
392
392
|
}
|
|
393
393
|
/** Every distinct keyword named across every failing card, deduped, in order. */
|
|
@@ -430,19 +430,19 @@ function Rt(e, t) {
|
|
|
430
430
|
for (const o of t) {
|
|
431
431
|
const a = Ct(o, e[o]);
|
|
432
432
|
if (a.length === 0) continue;
|
|
433
|
-
for (const
|
|
434
|
-
if (f(
|
|
435
|
-
for (const [p, c] of Object.entries(
|
|
433
|
+
for (const l of a)
|
|
434
|
+
if (f(l.properties))
|
|
435
|
+
for (const [p, c] of Object.entries(l.properties))
|
|
436
436
|
p in i || (i[p] = c);
|
|
437
437
|
const s = a.map(
|
|
438
|
-
(
|
|
438
|
+
(l) => new Set(Array.isArray(l.required) ? l.required.map(String) : [])
|
|
439
439
|
);
|
|
440
440
|
if (o === "allOf")
|
|
441
|
-
for (const
|
|
441
|
+
for (const l of s) for (const p of l) n.add(p);
|
|
442
442
|
else {
|
|
443
|
-
const [
|
|
444
|
-
for (const c of
|
|
445
|
-
p.every((
|
|
443
|
+
const [l, ...p] = s;
|
|
444
|
+
for (const c of l)
|
|
445
|
+
p.every((u) => u.has(c)) && n.add(c);
|
|
446
446
|
}
|
|
447
447
|
}
|
|
448
448
|
Object.keys(i).length > 0 && (e.properties = i);
|
|
@@ -472,12 +472,12 @@ function _t(e, t, i) {
|
|
|
472
472
|
let r = e;
|
|
473
473
|
if (n.path !== "")
|
|
474
474
|
for (const a of n.path.split(".")) {
|
|
475
|
-
const s = f(r.properties) ? r.properties : void 0,
|
|
476
|
-
if (!f(
|
|
475
|
+
const s = f(r.properties) ? r.properties : void 0, l = s == null ? void 0 : s[a];
|
|
476
|
+
if (!f(l))
|
|
477
477
|
throw new TypeError(
|
|
478
478
|
`cardTools: require on '${t}': path '${n.path}' does not resolve in the schema`
|
|
479
479
|
);
|
|
480
|
-
r =
|
|
480
|
+
r = l;
|
|
481
481
|
}
|
|
482
482
|
const o = r.type === "array" || r.type === void 0 && "items" in r;
|
|
483
483
|
if (o && n.minItems !== void 0 && (r.minItems = n.minItems), !o && n.minItems !== void 0)
|
|
@@ -491,8 +491,8 @@ function _t(e, t, i) {
|
|
|
491
491
|
throw new TypeError(
|
|
492
492
|
`cardTools: require on '${t}' at path '${n.path}': '${p}' is not a property of that node — a required name with no property would make the tool unsatisfiable`
|
|
493
493
|
);
|
|
494
|
-
const
|
|
495
|
-
a.required = [.../* @__PURE__ */ new Set([...
|
|
494
|
+
const l = Array.isArray(a.required) ? a.required.map(String) : [];
|
|
495
|
+
a.required = [.../* @__PURE__ */ new Set([...l, ...n.required])];
|
|
496
496
|
}
|
|
497
497
|
}
|
|
498
498
|
}
|
|
@@ -509,7 +509,7 @@ function k(e, t) {
|
|
|
509
509
|
const a = i[o];
|
|
510
510
|
if (!f(a)) continue;
|
|
511
511
|
const s = {};
|
|
512
|
-
for (const [
|
|
512
|
+
for (const [l, p] of Object.entries(a)) s[l] = k(p, t);
|
|
513
513
|
i[o] = s;
|
|
514
514
|
}
|
|
515
515
|
for (const o of zt)
|
|
@@ -553,18 +553,18 @@ function Bt(e, t, i) {
|
|
|
553
553
|
return typeof o == "string" && o.length > 0 ? o : `Render a \`${e}\` card.`;
|
|
554
554
|
}
|
|
555
555
|
function v(e, t) {
|
|
556
|
-
var
|
|
556
|
+
var u;
|
|
557
557
|
const i = t === void 0, n = i ? e : t;
|
|
558
558
|
if (!f(n) || typeof n.provider != "string")
|
|
559
559
|
throw new TypeError('cardTools: an options object with a `provider` is required, e.g. cardTools({ provider: "openai" })');
|
|
560
560
|
const { schemas: r, descriptions: o } = Jt(
|
|
561
|
-
i ?
|
|
561
|
+
i ? Ht() : e
|
|
562
562
|
), a = n.strict === !0;
|
|
563
563
|
if (n.provider === "jsonschema" && a)
|
|
564
564
|
throw new TypeError(
|
|
565
565
|
'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`.'
|
|
566
566
|
);
|
|
567
|
-
const s = a ? n.provider === "openai" ? P : _ : null,
|
|
567
|
+
const s = a ? n.provider === "openai" ? P : _ : null, l = {
|
|
568
568
|
closeObjects: s !== null,
|
|
569
569
|
requireEveryProperty: s !== null && s.requireAllPropertiesRequired
|
|
570
570
|
}, p = [], c = [];
|
|
@@ -575,8 +575,8 @@ function v(e, t) {
|
|
|
575
575
|
`cardTools: require names card type '${h}', which this call does not carry (carries: ${Object.keys(r).join(", ") || "none"})`
|
|
576
576
|
);
|
|
577
577
|
}
|
|
578
|
-
for (const [h,
|
|
579
|
-
const g = R(h), b = Bt(h,
|
|
578
|
+
for (const [h, w] of Object.entries(r)) {
|
|
579
|
+
const g = R(h), b = Bt(h, w, o), d = k(w, l), m = s === null && n.provider !== "jsonschema" ? Pt(d, h) : void 0, I = m ? `${b} ${m}` : b, L = (u = n.require) == null ? void 0 : u[h];
|
|
580
580
|
if (L !== void 0 && _t(d, h, L), s) {
|
|
581
581
|
const E = St(d, s);
|
|
582
582
|
if (E.length > 0) {
|
|
@@ -589,7 +589,7 @@ function v(e, t) {
|
|
|
589
589
|
if (s && c.length > 0) throw new qt(s, c);
|
|
590
590
|
return p;
|
|
591
591
|
}
|
|
592
|
-
function
|
|
592
|
+
function Ht() {
|
|
593
593
|
return j;
|
|
594
594
|
}
|
|
595
595
|
function ai(e, t) {
|
|
@@ -604,7 +604,7 @@ function di(e) {
|
|
|
604
604
|
function A(e) {
|
|
605
605
|
return e === null ? "null" : Array.isArray(e) ? "array" : typeof e;
|
|
606
606
|
}
|
|
607
|
-
function
|
|
607
|
+
function Yt(e, t) {
|
|
608
608
|
switch (t) {
|
|
609
609
|
case "integer":
|
|
610
610
|
return typeof e == "number" && Number.isInteger(e);
|
|
@@ -621,10 +621,10 @@ function Ht(e, t) {
|
|
|
621
621
|
}
|
|
622
622
|
}
|
|
623
623
|
function q(e, t, i, n) {
|
|
624
|
-
const r = i || "(root)", o = (a, s,
|
|
625
|
-
n.push({ path:
|
|
624
|
+
const r = i || "(root)", o = (a, s, l = r) => {
|
|
625
|
+
n.push({ path: l, keyword: a, message: `${l}: ${s}` });
|
|
626
626
|
};
|
|
627
|
-
if (e.type && !
|
|
627
|
+
if (e.type && !Yt(t, e.type)) {
|
|
628
628
|
o("type", `expected ${e.type}, got ${A(t)}`);
|
|
629
629
|
return;
|
|
630
630
|
}
|
|
@@ -633,8 +633,8 @@ function q(e, t, i, n) {
|
|
|
633
633
|
for (const s of e.required ?? [])
|
|
634
634
|
(!(s in a) || a[s] === void 0) && o("required", "required", `${r}.${s}`);
|
|
635
635
|
if (e.properties)
|
|
636
|
-
for (const [s,
|
|
637
|
-
s in a && a[s] !== void 0 && q(
|
|
636
|
+
for (const [s, l] of Object.entries(e.properties))
|
|
637
|
+
s in a && a[s] !== void 0 && q(l, a[s], `${r}.${s}`, n);
|
|
638
638
|
}
|
|
639
639
|
}
|
|
640
640
|
function Kt(e, t) {
|
|
@@ -668,8 +668,8 @@ const D = {
|
|
|
668
668
|
exclusiveMinimum: "soft",
|
|
669
669
|
exclusiveMaximum: "soft",
|
|
670
670
|
uniqueItems: "soft"
|
|
671
|
-
}),
|
|
672
|
-
function
|
|
671
|
+
}), Gt = "soft";
|
|
672
|
+
function Vt(e) {
|
|
673
673
|
return Object.prototype.hasOwnProperty.call(D, e);
|
|
674
674
|
}
|
|
675
675
|
function Xt(e, t) {
|
|
@@ -677,7 +677,7 @@ function Xt(e, t) {
|
|
|
677
677
|
const i = t[e];
|
|
678
678
|
if (i && typeof i == "object") return i;
|
|
679
679
|
}
|
|
680
|
-
return
|
|
680
|
+
return Vt(e) ? D[e] : null;
|
|
681
681
|
}
|
|
682
682
|
function Qt(e) {
|
|
683
683
|
const t = e.slice(0, 3).map((n) => n.message), i = e.length - t.length;
|
|
@@ -690,7 +690,7 @@ function Zt(e, t, i) {
|
|
|
690
690
|
if (r.valid) return { ok: !0, tier: "ok", issues: [], hard: [], summary: "" };
|
|
691
691
|
const o = r.issues.map((s) => ({
|
|
692
692
|
...s,
|
|
693
|
-
tier: Wt[s.keyword] ??
|
|
693
|
+
tier: Wt[s.keyword] ?? Gt
|
|
694
694
|
})), a = o.filter((s) => s.tier === "hard");
|
|
695
695
|
return {
|
|
696
696
|
ok: !1,
|
|
@@ -717,7 +717,7 @@ function ti(e) {
|
|
|
717
717
|
].join(`
|
|
718
718
|
`);
|
|
719
719
|
}
|
|
720
|
-
function
|
|
720
|
+
function li(e = {}) {
|
|
721
721
|
if (typeof e != "object" || e === null || Array.isArray(e))
|
|
722
722
|
throw new TypeError('createCardRegistry: expected a spec object, e.g. createCardRegistry({ use: ["confirm"] })');
|
|
723
723
|
const t = j, i = e.use ?? Object.keys(t), n = i.filter((d) => !ii(d));
|
|
@@ -730,23 +730,23 @@ function ui(e = {}) {
|
|
|
730
730
|
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.");
|
|
731
731
|
const p = {};
|
|
732
732
|
for (const d of o) p[d] = t[d];
|
|
733
|
-
const c = {},
|
|
733
|
+
const c = {}, u = {}, h = {}, w = {}, g = [];
|
|
734
734
|
for (const d of s) {
|
|
735
735
|
const m = a[d];
|
|
736
736
|
if (typeof m != "object" || m === null || Array.isArray(m))
|
|
737
737
|
throw new TypeError(`createCardRegistry: custom card type "${d}" must be an object, e.g. { schema, tag }.`);
|
|
738
|
-
ei(m.schema) ? (p[d] = m.schema,
|
|
738
|
+
ei(m.schema) ? (p[d] = m.schema, w[d] = m.schema) : (delete p[d], g.push(d)), typeof m.tag == "string" && m.tag.length > 0 && (u[d] = m.tag), typeof m.component == "function" && (h[d] = m.component), typeof m.description == "string" && m.description.length > 0 && (c[d] = m.description);
|
|
739
739
|
}
|
|
740
740
|
if (g.length > 0) {
|
|
741
741
|
const d = e.onIncomplete ?? "warn", m = ti(g);
|
|
742
742
|
if (d === "throw") throw new TypeError(m);
|
|
743
743
|
d !== "silent" && console.warn(m);
|
|
744
744
|
}
|
|
745
|
-
const b = Object.freeze({
|
|
745
|
+
const b = Object.freeze({ ...w });
|
|
746
746
|
return Object.freeze({
|
|
747
747
|
schemas: Object.freeze(p),
|
|
748
748
|
descriptions: Object.freeze(c),
|
|
749
|
-
tags: Object.freeze(
|
|
749
|
+
tags: Object.freeze(u),
|
|
750
750
|
components: Object.freeze(h),
|
|
751
751
|
types: Object.freeze([...o, ...s]),
|
|
752
752
|
builtIn: Object.freeze(o),
|
|
@@ -756,7 +756,7 @@ function ui(e = {}) {
|
|
|
756
756
|
validate: (d, m) => Zt(d, m, b)
|
|
757
757
|
});
|
|
758
758
|
}
|
|
759
|
-
const
|
|
759
|
+
const ui = {
|
|
760
760
|
form: "kai-form",
|
|
761
761
|
confirm: "kai-confirm",
|
|
762
762
|
tasks: "kai-tasks",
|
|
@@ -769,9 +769,9 @@ const li = {
|
|
|
769
769
|
choice: y(be),
|
|
770
770
|
confirm: y(Se),
|
|
771
771
|
embed: y(Pe),
|
|
772
|
-
form: y(
|
|
772
|
+
form: y(Ve),
|
|
773
773
|
link: y(rt),
|
|
774
|
-
tasks: y(
|
|
774
|
+
tasks: y($t)
|
|
775
775
|
}), mi = Object.freeze({
|
|
776
776
|
"card-envelope": y(ie),
|
|
777
777
|
"card-event": y(ce),
|
|
@@ -785,7 +785,7 @@ function ii(e) {
|
|
|
785
785
|
}
|
|
786
786
|
export {
|
|
787
787
|
_ as ANTHROPIC_STRICT,
|
|
788
|
-
|
|
788
|
+
ui as BUILTIN_CARD_TAGS,
|
|
789
789
|
At as CARD_TOOL_DESCRIPTIONS,
|
|
790
790
|
S as KAI_TOOL_PREFIX,
|
|
791
791
|
P as OPENAI_STRICT,
|
|
@@ -798,7 +798,7 @@ export {
|
|
|
798
798
|
ci as cardValidationMessage,
|
|
799
799
|
St as checkProviderSubset,
|
|
800
800
|
mi as contractSchemas,
|
|
801
|
-
|
|
801
|
+
li as createCardRegistry,
|
|
802
802
|
ii as isCardSchemaName,
|
|
803
803
|
oi as isCardTool,
|
|
804
804
|
si as providerSubsets,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{s as e,p as i,q as l,i as s,t as c}from"./define-CGGX-7Vg.js";import{c as f}from"./cn-DN5AWfiS.js";var d=c("<div tabindex=0>");function u(t){const[o,a]=e(t,["children","class","orientation"]),n=()=>o.orientation==="horizontal"?"overflow-x-auto overflow-y-hidden":o.orientation==="both"?"overflow-auto":"overflow-y-auto overflow-x-hidden";return(()=>{var r=d();return i(r,l({get class(){return f(n(),"scrollbar-thin",o.class)}},a),!1,!0),s(r,()=>o.children),r})()}export{u as S};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{g as T,h as y,s as f,c,u as A,p as h,q as m,i as v,t as u,B as k,G as C,S as H,m as L}from"./define-CGGX-7Vg.js";import{c as d}from"./cn-DN5AWfiS.js";import{B as E}from"./button-BH6rN0U-.js";import{a as F}from"./arrow-down-Br0qtpsz.js";const S=50;function q(){const[t,n]=T(!0);let r,e=!0;function a(){if(!r)return;const{scrollTop:s,scrollHeight:l,clientHeight:B}=r,g=l-s-B<S;n(g),e=g}function i(s="smooth"){r&&(typeof r.scrollTo=="function"?r.scrollTo({top:r.scrollHeight,behavior:s}):r.scrollTop=r.scrollHeight,e=!0,n(!0))}let o;const b=typeof cancelAnimationFrame=="function"?cancelAnimationFrame.bind(globalThis):()=>{};function w(){e&&(o=requestAnimationFrame(()=>{o=void 0,i("instant")}))}function x(s){r=s,s.addEventListener("scroll",a,{passive:!0});const l=new MutationObserver(w);l.observe(s,{childList:!0,subtree:!0,characterData:!0}),y(()=>{s.removeEventListener("scroll",a),l.disconnect(),o!==void 0&&(b(o),o=void 0)})}return{ref:x,isAtBottom:t,scrollToBottom:i}}var z=u("<div role=log tabindex=0>"),D=u("<div>"),O=u("<div aria-hidden=true>");const p=k();function P(){const t=C(p);if(!t)throw new Error("useChatContainer must be used within ChatContainer");return t}function j(t){const[n,r]=f(t,["children","class"]),{ref:e,isAtBottom:a,scrollToBottom:i}=q();return c(p.Provider,{value:{isAtBottom:a,scrollToBottom:i},get children(){var o=z();return A(e,o),h(o,m({get class(){return d("flex flex-col overflow-y-auto kai-focus-inset",n.class)}},r),!1,!0),v(o,()=>n.children),o}})}function G(t){const[n,r]=f(t,["children","class"]);return(()=>{var e=D();return h(e,m({get class(){return d("flex w-full flex-col",n.class)}},r),!1,!0),v(e,()=>n.children),e})()}function J(t){const[n,r]=f(t,["class"]);return(()=>{var e=O();return h(e,m({get class(){return d("h-px w-full shrink-0 scroll-mt-4",n.class)}},r),!1,!1),e})()}var K=u("<span>");const M="Scroll to bottom";function R(t){return(t??"outline")==="outline"?"border border-input bg-card text-card-foreground kai-elevation":"kai-elevation"}function U(t){const{isAtBottom:n,scrollToBottom:r}=P(),e=()=>t.label??M,a=()=>t.showLabel===!0;return c(E,{get variant(){return t.variant??"outline"},get size(){return t.size??"sm"},get"aria-label"(){return L(()=>!!a())()?void 0:e()},get tabindex(){return n()?-1:0},get"aria-hidden"(){return n()?"true":void 0},get class(){return d("rounded-lg transition-all duration-150 ease-out",R(t.variant),a()?"h-10 w-auto gap-1.5 px-3.5 text-sm":"h-10 w-10 px-0",n()?"pointer-events-none translate-y-4 scale-95 opacity-0":"translate-y-0 scale-100 opacity-100",t.class)},onClick:()=>r(),get children(){return[c(F,{class:"h-4 w-4 shrink-0","aria-hidden":"true"}),c(H,{get when(){return a()},get children(){var i=K();return v(i,e),i}})]}})}export{j as C,U as S,G as a,J as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{s as b,u as S,j as A,p as w,q as C,i as s,c as u,a as c,S as f,F as x,b as F,t as d}from"./define-CGGX-7Vg.js";import{c as h}from"./cn-DN5AWfiS.js";import{e as q,F as j}from"./input-d1Yuu-hz.js";import{c as k}from"./chevron-down-CHSWk7ZT.js";var z=d("<option value disabled>"),D=d("<div><select>"),E=d("<option>");function I(g){const[r,p]=b(g,["class","containerClass","options","value","placeholder","invalid","children","ref"]),v=()=>!!p.multiple,m=t=>{const a=r.value;return Array.isArray(a)?a.includes(t):a===t},y=()=>{const t=r.value;return Array.isArray(t)?t.length===0:t==null||t===""};return(()=>{var t=D(),a=t.firstChild;return S(e=>{const l=r.ref;typeof l=="function"&&l(e),A(()=>{if(r.children===void 0)return;const n=r.value;if(n!=null)if(Array.isArray(n)){const o=new Set(n.map(String));for(const i of e.options)i.selected=o.has(i.value)}else e.value=String(n)})},a),w(a,C(p,{get class(){return h(j,"peer",!v()&&"cursor-pointer appearance-none pr-9",r.invalid&&q,r.class)}}),!1,!0),s(a,u(f,{get when(){return r.placeholder!==void 0},get children(){var e=z();return s(e,()=>r.placeholder),c(()=>e.selected=y()),e}}),null),s(a,u(x,{get each(){return r.options},children:e=>(()=>{var l=E();return s(l,()=>e.label??String(e.value)),c(n=>{var o=e.disabled,i=m(e.value);return o!==n.e&&(l.disabled=n.e=o),i!==n.t&&(l.selected=n.t=i),n},{e:void 0,t:void 0}),c(()=>l.value=String(e.value)),l})()}),null),s(a,()=>r.children,null),s(t,u(f,{get when(){return!v()},get children(){return u(k,{"aria-hidden":"true",class:"pointer-events-none absolute right-3 top-1/2 size-4 -translate-y-1/2 text-muted-foreground peer-disabled:opacity-50"})}}),null),c(()=>F(t,h("relative block w-full",r.containerClass))),t})()}export{I as S};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as e,
|
|
1
|
+
import{s as e,p as n,q as i,t as l}from"./define-CGGX-7Vg.js";import{c}from"./cn-DN5AWfiS.js";var p=l("<div role=separator>");function u(t){const[r,a]=e(t,["orientation","class"]),o=()=>r.orientation==="vertical";return(()=>{var s=p();return n(s,i({get class(){return c("shrink-0 bg-border",o()?"h-full w-px":"h-px w-full",r.class)}},a),!1,!1),s})()}export{u as S};
|