@kitn.ai/ui 0.15.1 → 0.17.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 +37 -13
- package/bin/mcp.js +22 -0
- package/dist/bash-InADTalH.js +6 -1
- package/dist/components/artifact.d.ts +58 -0
- package/dist/components/attachments.d.ts +67 -0
- package/dist/components/card-fallback.d.ts +10 -0
- package/dist/components/card-renderer.d.ts +13 -0
- package/dist/components/card.d.ts +28 -0
- package/dist/components/chain-of-thought.d.ts +29 -0
- package/dist/components/chat-container.d.ts +19 -0
- package/dist/components/chat-scope-picker.d.ts +9 -0
- package/dist/components/chat-thread.d.ts +91 -0
- package/dist/components/checkpoint.d.ts +20 -0
- package/dist/components/choice-card.d.ts +78 -0
- package/dist/components/code-block.d.ts +16 -0
- package/dist/components/confirm-card.d.ts +57 -0
- package/dist/components/context.d.ts +65 -0
- package/dist/components/conversation-item.d.ts +8 -0
- package/dist/components/conversation-list.d.ts +11 -0
- package/dist/components/dismissed-stub.d.ts +22 -0
- package/dist/components/embed.d.ts +21 -0
- package/dist/components/empty.d.ts +43 -0
- package/dist/components/feedback-bar.d.ts +45 -0
- package/dist/components/file-tree.d.ts +57 -0
- package/dist/components/file-upload.d.ts +16 -0
- package/dist/components/form-widgets.d.ts +31 -0
- package/dist/components/form.d.ts +103 -0
- package/dist/components/image.d.ts +12 -0
- package/dist/components/link-preview.d.ts +23 -0
- package/dist/components/loader.d.ts +60 -0
- package/dist/components/markdown.d.ts +8 -0
- package/dist/components/message-skills.d.ts +15 -0
- package/dist/components/message.d.ts +111 -0
- package/dist/components/model-switcher.d.ts +8 -0
- package/dist/components/prompt-input.d.ts +38 -0
- package/dist/components/prompt-suggestion.d.ts +13 -0
- package/dist/components/reasoning.d.ts +20 -0
- package/dist/components/response-compare-types.d.ts +66 -0
- package/dist/components/response-compare.d.ts +51 -0
- package/dist/components/response-stream.d.ts +14 -0
- package/dist/components/scroll-button.d.ts +7 -0
- package/dist/components/slash-command.d.ts +15 -0
- package/dist/components/source.d.ts +23 -0
- package/dist/components/tasks-card.d.ts +72 -0
- package/dist/components/text-shimmer.d.ts +9 -0
- package/dist/components/thinking-bar.d.ts +10 -0
- package/dist/components/toast.d.ts +48 -0
- package/dist/components/tool.d.ts +16 -0
- package/dist/components/use-card-resolution.d.ts +16 -0
- package/dist/components/voice-input.d.ts +7 -0
- package/dist/core-AYMC6_lb.js +5874 -12
- package/dist/css-M7EaDHN_.js +6 -1
- package/dist/custom-elements.json +260 -11
- package/dist/elements/artifact.d.ts +1 -0
- package/dist/elements/artifact.js +1 -0
- package/dist/elements/attachments.d.ts +1 -0
- package/dist/elements/attachments.js +1 -0
- package/dist/elements/autoloader.d.ts +2 -0
- package/dist/elements/autoloader.js +1 -0
- package/dist/elements/card.d.ts +1 -0
- package/dist/elements/card.js +1 -0
- package/dist/elements/cards.d.ts +1 -0
- package/dist/elements/cards.js +1 -0
- package/dist/elements/chain-of-thought.d.ts +1 -0
- package/dist/elements/chain-of-thought.js +1 -0
- package/dist/elements/chat-scope-picker.d.ts +1 -0
- package/dist/elements/chat-scope-picker.js +1 -0
- package/dist/elements/chat-workspace.d.ts +1 -0
- package/dist/elements/chat-workspace.js +1 -0
- package/dist/elements/chat.d.ts +1 -0
- package/dist/elements/chat.js +1 -0
- package/dist/elements/checkpoint.d.ts +1 -0
- package/dist/elements/checkpoint.js +1 -0
- package/dist/elements/choice.d.ts +1 -0
- package/dist/elements/choice.js +1 -0
- package/dist/elements/chunks/Icon-D_Zmwmwh.js +1 -0
- package/dist/elements/chunks/action-icons-PVfIvcuG.js +1 -0
- package/dist/elements/chunks/attachments-Dp6vqtrc.js +1 -0
- package/dist/elements/chunks/bash-InADTalH.js +1 -0
- package/dist/elements/chunks/button-CKyYD9G4.js +1 -0
- package/dist/elements/chunks/card-Cjho-PYk.js +1 -0
- package/dist/elements/chunks/card-routing-C986KuUA.js +1 -0
- package/dist/elements/chunks/chat-thread-RT808iPf.js +1 -0
- package/dist/elements/chunks/check-CDYaMYrM.js +1 -0
- package/dist/elements/chunks/chevron-down-3SBiq8HF.js +1 -0
- package/dist/elements/chunks/chevron-right-k2UFlIVK.js +1 -0
- package/dist/elements/chunks/cn-Dogu6PbV.js +1 -0
- package/dist/elements/chunks/code-block-BYUmfFSd.js +1 -0
- package/dist/elements/chunks/collapsible-BiNwdOn6.js +1 -0
- package/dist/elements/chunks/context-18g6oi4J.js +1 -0
- package/dist/elements/chunks/conversation-list-D9Y0NVdo.js +1 -0
- package/dist/elements/chunks/core-AYMC6_lb.js +12 -0
- package/dist/elements/chunks/css-M7EaDHN_.js +1 -0
- package/dist/elements/chunks/default-input-CSAoYYMd.js +1 -0
- package/dist/elements/chunks/download-D8K0Je8r.js +1 -0
- package/dist/elements/chunks/dropdown-bUs2iTia.js +1 -0
- package/dist/elements/chunks/engine-javascript-vq0WuIJl.js +141 -0
- package/dist/elements/chunks/external-link-6mA0wxab.js +1 -0
- package/dist/elements/chunks/file-text-DnaYk3Dm.js +1 -0
- package/dist/elements/chunks/file-tree-CgtRLlxK.js +1 -0
- package/dist/elements/chunks/github-dark-dimmed-DUshB20C.js +1 -0
- package/dist/elements/chunks/github-light-JYsPkUQd.js +1 -0
- package/dist/elements/chunks/hover-card-CIGw62gP.js +1 -0
- package/dist/elements/chunks/html-CPZ3oZQ7.js +1 -0
- package/dist/elements/chunks/index-CTBEJeo6.js +1 -0
- package/dist/elements/chunks/javascript-C25yR2R2.js +1 -0
- package/dist/elements/chunks/json-DxJze_jm.js +1 -0
- package/dist/elements/chunks/link-BlGSeoPy.js +1 -0
- package/dist/elements/chunks/loader-DvhR4qa0.js +1 -0
- package/dist/elements/chunks/markdown-CMTGx9r8.js +64 -0
- package/dist/elements/chunks/message-CDZwXjhL.js +1 -0
- package/dist/elements/chunks/message-feedback-CYx81QiA.js +1 -0
- package/dist/elements/chunks/model-switcher-O_tUhoOT.js +1 -0
- package/dist/elements/chunks/overlay-DydXYMQW.js +1 -0
- package/dist/elements/chunks/prompt-suggestion-ldlWV5kd.js +1 -0
- package/dist/elements/chunks/reasoning-2PUnHlmr.js +1 -0
- package/dist/elements/chunks/resizable-B5WNbSeb.js +1 -0
- package/dist/elements/chunks/star-t9tI-P0q.js +1 -0
- package/dist/elements/chunks/store-C6rIooZz.js +1 -0
- package/dist/elements/chunks/svelte--5p79yCD.js +1 -0
- package/dist/elements/chunks/text-shimmer-uh9V_KUh.js +1 -0
- package/dist/elements/chunks/textarea-3nm6Ia9U.js +1 -0
- package/dist/elements/chunks/thumbs-up-BBtguGld.js +1 -0
- package/dist/elements/chunks/toast-store-D8cL3fWl.js +1 -0
- package/dist/elements/chunks/tool-GJ3vwp1U.js +1 -0
- package/dist/elements/chunks/tooltip-DwKAz4XR.js +1 -0
- package/dist/elements/chunks/triangle-alert-Ct1zt2JL.js +1 -0
- package/dist/elements/chunks/tsx-B8rCNbgL.js +1 -0
- package/dist/elements/chunks/typescript-RycA9KXf.js +1 -0
- package/dist/elements/chunks/use-card-resolution-D-_0Alzy.js +1 -0
- package/dist/elements/chunks/video-mVYiM99-.js +1 -0
- package/dist/elements/chunks/vue-BmIZj4XD.js +1 -0
- package/dist/elements/chunks/x-CzxL27Ch.js +1 -0
- package/dist/elements/code-block.d.ts +1 -0
- package/dist/elements/code-block.js +1 -0
- package/dist/elements/compare.d.ts +1 -0
- package/dist/elements/compare.js +1 -0
- package/dist/elements/confirm-card.d.ts +1 -0
- package/dist/elements/confirm-card.js +1 -0
- package/dist/elements/context-meter.d.ts +1 -0
- package/dist/elements/context-meter.js +1 -0
- package/dist/elements/conversation-list.d.ts +1 -0
- package/dist/elements/conversation-list.js +1 -0
- package/dist/elements/embed.d.ts +1 -0
- package/dist/elements/embed.js +1 -0
- package/dist/elements/empty.d.ts +1 -0
- package/dist/elements/empty.js +1 -0
- package/dist/elements/feedback-bar.d.ts +1 -0
- package/dist/elements/feedback-bar.js +1 -0
- package/dist/elements/file-tree.d.ts +1 -0
- package/dist/elements/file-tree.js +1 -0
- package/dist/elements/file-upload.d.ts +1 -0
- package/dist/elements/file-upload.js +1 -0
- package/dist/elements/form.d.ts +1 -0
- package/dist/elements/form.js +1 -0
- package/dist/elements/image.d.ts +1 -0
- package/dist/elements/image.js +1 -0
- package/dist/elements/link-preview.d.ts +1 -0
- package/dist/elements/link-preview.js +1 -0
- package/dist/elements/loader.d.ts +1 -0
- package/dist/elements/loader.js +1 -0
- package/dist/elements/markdown.d.ts +1 -0
- package/dist/elements/markdown.js +1 -0
- package/dist/elements/message-skills.d.ts +1 -0
- package/dist/elements/message-skills.js +1 -0
- package/dist/elements/message.d.ts +1 -0
- package/dist/elements/message.js +1 -0
- package/dist/elements/model-switcher.d.ts +1 -0
- package/dist/elements/model-switcher.js +1 -0
- package/dist/elements/popover.d.ts +1 -0
- package/dist/elements/popover.js +1 -0
- package/dist/elements/prompt-input.d.ts +1 -0
- package/dist/elements/prompt-input.js +1 -0
- package/dist/elements/prompt-suggestions.d.ts +1 -0
- package/dist/elements/prompt-suggestions.js +1 -0
- package/dist/elements/reasoning.d.ts +1 -0
- package/dist/elements/reasoning.js +1 -0
- package/dist/elements/resizable.d.ts +1 -0
- package/dist/elements/resizable.js +1 -0
- package/dist/elements/response-stream.d.ts +1 -0
- package/dist/elements/response-stream.js +14 -0
- package/dist/elements/scroll-button.d.ts +1 -0
- package/dist/elements/scroll-button.js +1 -0
- package/dist/elements/source.d.ts +1 -0
- package/dist/elements/source.js +1 -0
- package/dist/elements/switch.d.ts +1 -0
- package/dist/elements/switch.js +1 -0
- package/dist/elements/tasks.d.ts +1 -0
- package/dist/elements/tasks.js +1 -0
- package/dist/elements/text-shimmer.d.ts +1 -0
- package/dist/elements/text-shimmer.js +1 -0
- package/dist/elements/thinking-bar.d.ts +1 -0
- package/dist/elements/thinking-bar.js +1 -0
- package/dist/elements/toast.d.ts +1 -0
- package/dist/elements/toast.js +1 -0
- package/dist/elements/tool.d.ts +1 -0
- package/dist/elements/tool.js +1 -0
- package/dist/elements/voice-input.d.ts +1 -0
- package/dist/elements/voice-input.js +1 -0
- package/dist/elements.d.ts +768 -0
- package/dist/engine-javascript-vq0WuIJl.js +2516 -14
- package/dist/github-dark-dimmed-DUshB20C.js +4 -1
- package/dist/github-light-JYsPkUQd.js +4 -1
- package/dist/html-CPZ3oZQ7.js +10 -1
- package/dist/index.d.ts +124 -2
- package/dist/index.js +15593 -0
- package/dist/javascript-C25yR2R2.js +6 -1
- package/dist/json-DxJze_jm.js +6 -1
- package/dist/kitn-chat.es.js +1 -77
- package/dist/llms/llms-full.txt +57 -12
- package/dist/llms/llms.txt +3 -3
- package/dist/mcp.es.js +2296 -0
- package/dist/primitives/card-contract.d.ts +119 -0
- package/dist/primitives/card-host.d.ts +12 -0
- package/dist/primitives/card-recovery.d.ts +55 -0
- package/dist/primitives/card-registry.d.ts +17 -0
- package/dist/primitives/card-resolution.d.ts +8 -0
- package/dist/primitives/card-routing.d.ts +12 -0
- package/dist/primitives/card-validate.d.ts +25 -0
- package/dist/primitives/chat-config.d.ts +31 -0
- package/dist/primitives/controllable.d.ts +13 -0
- package/dist/primitives/embed-providers.d.ts +65 -0
- package/dist/primitives/highlighter.d.ts +23 -0
- package/dist/primitives/link-preview.d.ts +47 -0
- package/dist/primitives/message-feedback.d.ts +35 -0
- package/dist/primitives/pdf-preview.d.ts +50 -0
- package/dist/primitives/toast-store.d.ts +88 -0
- package/dist/primitives/use-auto-resize.d.ts +8 -0
- package/dist/primitives/use-resize-observer.d.ts +1 -0
- package/dist/primitives/use-stick-to-bottom.d.ts +5 -0
- package/dist/primitives/use-text-stream.d.ts +19 -0
- package/dist/primitives/use-voice-recorder.d.ts +9 -0
- package/dist/react/index.d.ts +1198 -0
- package/dist/react/runtime.d.ts +15 -0
- package/dist/react.js +275 -0
- package/dist/register-JyTglR6m.js +1 -0
- package/dist/register-impl-C6wlSsts.js +77 -0
- package/dist/remote/host-embed.d.ts +33 -0
- package/dist/remote/index.d.ts +2 -0
- package/dist/remote/origin.d.ts +5 -0
- package/dist/remote/provider-runtime.d.ts +27 -0
- package/dist/remote/provider.d.ts +2 -0
- package/dist/remote/validate.d.ts +4 -0
- package/dist/remote/version.d.ts +4 -0
- package/dist/remote/wire.d.ts +53 -0
- package/dist/schemas/choice.schema.json +5 -0
- package/dist/schemas/tasks.schema.json +5 -0
- package/dist/svelte--5p79yCD.js +15 -1
- package/dist/tsx-B8rCNbgL.js +6 -1
- package/dist/types.d.ts +42 -0
- package/dist/typescript-RycA9KXf.js +6 -1
- package/dist/ui/action-icons.d.ts +11 -0
- package/dist/ui/avatar.d.ts +8 -0
- package/dist/ui/badge.d.ts +9 -0
- package/dist/ui/button.d.ts +10 -0
- package/dist/ui/collapsible.d.ts +27 -0
- package/dist/ui/dropdown.d.ts +20 -0
- package/dist/ui/hover-card.d.ts +28 -0
- package/dist/ui/overlay.d.ts +67 -0
- package/dist/ui/popover.d.ts +32 -0
- package/dist/ui/resizable.d.ts +76 -0
- package/dist/ui/scroll-area.d.ts +5 -0
- package/dist/ui/separator.d.ts +5 -0
- package/dist/ui/skeleton.d.ts +5 -0
- package/dist/ui/switch.d.ts +19 -0
- package/dist/ui/textarea.d.ts +6 -0
- package/dist/ui/tooltip.d.ts +9 -0
- package/dist/utils/cn.d.ts +2 -0
- package/dist/vue-BmIZj4XD.js +33 -1
- package/frameworks/react/index.tsx +67 -11
- package/frameworks/react/runtime.tsx +16 -2
- package/llms-full.txt +57 -12
- package/llms.txt +3 -3
- package/package.json +36 -14
- package/src/agent-tooling/archetypes.ts +46 -0
- package/src/agent-tooling/integrations/cloudflare.ts +88 -0
- package/src/agent-tooling/integrations/langgraph.ts +60 -0
- package/src/agent-tooling/integrations/mastra.ts +27 -0
- package/src/agent-tooling/integrations/mock.ts +34 -0
- package/src/agent-tooling/integrations/ollama.ts +47 -0
- package/src/agent-tooling/integrations/openrouter.ts +26 -0
- package/src/agent-tooling/integrations/pi.ts +40 -0
- package/src/agent-tooling/integrations/pydantic-ai.ts +52 -0
- package/src/agent-tooling/integrations/vercel-ai-sdk.ts +44 -0
- package/src/agent-tooling/mcp/manifest.ts +128 -0
- package/src/agent-tooling/mcp/server.ts +59 -0
- package/src/agent-tooling/mcp/stdio.ts +18 -0
- package/src/agent-tooling/mcp/tools/debug.ts +489 -0
- package/src/agent-tooling/mcp/tools/reference.ts +132 -0
- package/src/agent-tooling/mcp/tools/scaffold.ts +1759 -0
- package/src/agent-tooling/mcp/tools/theme.ts +340 -0
- package/src/agent-tooling/mcp/tools/types.ts +14 -0
- package/src/agent-tooling/registry.ts +41 -0
- package/src/agent-tooling/types.ts +30 -0
- package/src/components/chat-thread.tsx +27 -35
- package/src/components/choice-card.tsx +33 -4
- package/src/components/component-meta.json +250 -26
- package/src/components/confirm-card.tsx +15 -1
- package/src/components/dismissed-stub.tsx +80 -0
- package/src/components/form.tsx +21 -3
- package/src/components/message.tsx +151 -10
- package/src/components/response-compare-types.ts +127 -0
- package/src/components/response-compare.tsx +431 -0
- package/src/components/tasks-card.tsx +33 -3
- package/src/components/toast.tsx +398 -0
- package/src/components/use-card-resolution.ts +24 -8
- package/src/elements/autoloader.ts +89 -0
- package/src/elements/chat-types.ts +7 -0
- package/src/elements/chat-workspace.tsx +4 -2
- package/src/elements/chat.tsx +4 -2
- package/src/elements/compare.tsx +88 -0
- package/src/elements/compiled.css +1 -1
- package/src/elements/define.tsx +7 -1
- package/src/elements/element-manifest.json +182 -0
- package/src/elements/element-meta.json +191 -68
- package/src/elements/element-types.d.ts +43 -6
- package/src/elements/framework-usage.json +25 -0
- package/src/elements/message.tsx +27 -45
- package/src/elements/register-impl.ts +58 -0
- package/src/elements/register.ts +26 -51
- package/src/elements/remote.tsx +4 -0
- package/src/elements/styles.css +19 -0
- package/src/elements/toast.tsx +74 -0
- package/src/index.ts +30 -0
- package/src/primitives/card-contract.ts +14 -5
- package/src/primitives/card-recovery.ts +149 -0
- package/src/primitives/card-routing.ts +3 -0
- package/src/primitives/card-schemas/choice.schema.json +5 -0
- package/src/primitives/card-schemas/tasks.schema.json +5 -0
- package/src/primitives/message-feedback.ts +123 -0
- package/src/primitives/toast-store.ts +235 -0
- package/src/ui/tooltip.tsx +8 -2
- package/theme.css +4 -2
|
@@ -540,7 +540,7 @@
|
|
|
540
540
|
"kind": "field",
|
|
541
541
|
"name": "cards",
|
|
542
542
|
"type": {
|
|
543
|
-
"text": "undefined | { type: string; id: string; data: unknown; title?: undefined | string; resolution?: undefined | { kind: \"action\"; action: string; payload?: unknown; at?: undefined | string } | { kind: \"submit\"; data: unknown; at?: undefined | string } }[]"
|
|
543
|
+
"text": "undefined | { type: string; id: string; data: unknown; title?: undefined | string; resolution?: undefined | { kind: \"action\"; action: string; payload?: unknown; at?: undefined | string } | { kind: \"submit\"; data: unknown; at?: undefined | string } | { kind: \"dismissed\"; at?: undefined | string } | { kind: \"expired\"; reason?: undefined | string; at?: undefined | string } }[]"
|
|
544
544
|
},
|
|
545
545
|
"description": "The stream of card envelopes to render. Set as a JS PROPERTY: `el.cards = [...]`.",
|
|
546
546
|
"privacy": "public"
|
|
@@ -558,7 +558,7 @@
|
|
|
558
558
|
"kind": "field",
|
|
559
559
|
"name": "policy",
|
|
560
560
|
"type": {
|
|
561
|
-
"text": "undefined | { onSubmit?: undefined | (cardId: string, data: unknown) => void; onAction?: undefined | (cardId: string, action: string, payload?: unknown) => void; onSendPrompt?: undefined | (text: string, opts: { mode: \"compose\" | \"send\"; context?: unknown; }) => void; onOpen?: undefined | (url: string, target: \"tab\" | \"artifact\") => void; onState?: undefined | (cardId: string, patch: unknown) => void; onDismiss?: undefined | (cardId: string) => void; onError?: undefined | (cardId: string, message: string) => void; maxSendPromptMode?: undefined | \"compose\" | \"send\" }"
|
|
561
|
+
"text": "undefined | { onSubmit?: undefined | (cardId: string, data: unknown) => void; onAction?: undefined | (cardId: string, action: string, payload?: unknown) => void; onSendPrompt?: undefined | (text: string, opts: { mode: \"compose\" | \"send\"; context?: unknown; }) => void; onOpen?: undefined | (url: string, target: \"tab\" | \"artifact\") => void; onState?: undefined | (cardId: string, patch: unknown) => void; onDismiss?: undefined | (cardId: string) => void; onReopen?: undefined | (cardId: string) => void; onError?: undefined | (cardId: string, message: string) => void; maxSendPromptMode?: undefined | \"compose\" | \"send\" }"
|
|
562
562
|
},
|
|
563
563
|
"description": "Optional CardPolicy handling child events. Property: `el.policy`.",
|
|
564
564
|
"privacy": "public"
|
|
@@ -616,7 +616,7 @@
|
|
|
616
616
|
"kind": "field",
|
|
617
617
|
"name": "messages",
|
|
618
618
|
"type": {
|
|
619
|
-
"text": "{ id: string; role: \"user\" | \"assistant\"; content: string; reasoning?: undefined | { text: string; label?: undefined | string }; tools?: undefined | { type: string; state: \"input-streaming\" | \"input-available\" | \"output-available\" | \"output-error\"; input?: undefined | Record<string, unknown>; output?: undefined | Record<string, unknown>; toolCallId?: undefined | string; errorText?: undefined | string }[]; attachments?: undefined | { id: string; type: \"file\" | \"source-document\"; filename?: undefined | string; mediaType?: undefined | string; url?: undefined | string; title?: undefined | string }[]; actions?: undefined | (\"copy\" | \"like\" | \"dislike\" | \"regenerate\" | \"edit\" | { id: string; label: string; icon?: undefined | string; tooltip?: undefined | string })[]; avatar?: undefined | { src?: undefined | string; fallback?: undefined | string; alt?: undefined | string } }[]"
|
|
619
|
+
"text": "{ id: string; role: \"user\" | \"assistant\"; content: string; reasoning?: undefined | { text: string; label?: undefined | string }; tools?: undefined | { type: string; state: \"input-streaming\" | \"input-available\" | \"output-available\" | \"output-error\"; input?: undefined | Record<string, unknown>; output?: undefined | Record<string, unknown>; toolCallId?: undefined | string; errorText?: undefined | string }[]; attachments?: undefined | { id: string; type: \"file\" | \"source-document\"; filename?: undefined | string; mediaType?: undefined | string; url?: undefined | string; title?: undefined | string }[]; actions?: undefined | (\"copy\" | \"like\" | \"dislike\" | \"regenerate\" | \"edit\" | { id: string; label: string; icon?: undefined | string; tooltip?: undefined | string })[]; avatar?: undefined | { src?: undefined | string; fallback?: undefined | string; alt?: undefined | string }; feedback?: undefined | \"like\" | \"dislike\" }[]"
|
|
620
620
|
},
|
|
621
621
|
"description": "The full message thread to render, newest last. Each entry carries its role, content, and optional reasoning/tools/attachments/actions. Set as a JS property (`el.messages = [...]`).",
|
|
622
622
|
"privacy": "public"
|
|
@@ -969,9 +969,9 @@
|
|
|
969
969
|
{
|
|
970
970
|
"name": "kai-message-action",
|
|
971
971
|
"type": {
|
|
972
|
-
"text": "CustomEvent<{ messageId: string; action: string }>"
|
|
972
|
+
"text": "CustomEvent<{ messageId: string; action: string; state?: undefined | \"on\" | \"off\" }>"
|
|
973
973
|
},
|
|
974
|
-
"description": "An action button on a message was clicked. `action` is the built-in name or custom id."
|
|
974
|
+
"description": "An action button on a message was clicked. `action` is the built-in name or custom id. `state` is present only for the toggleable feedback votes: `'on'` when a like/dislike is set, `'off'` when re-tapped to clear."
|
|
975
975
|
},
|
|
976
976
|
{
|
|
977
977
|
"name": "kai-model-change",
|
|
@@ -1302,6 +1302,151 @@
|
|
|
1302
1302
|
}
|
|
1303
1303
|
]
|
|
1304
1304
|
},
|
|
1305
|
+
{
|
|
1306
|
+
"kind": "class",
|
|
1307
|
+
"customElement": true,
|
|
1308
|
+
"tagName": "kai-compare",
|
|
1309
|
+
"name": "KaiCompareElement",
|
|
1310
|
+
"description": "",
|
|
1311
|
+
"members": [
|
|
1312
|
+
{
|
|
1313
|
+
"kind": "field",
|
|
1314
|
+
"name": "data",
|
|
1315
|
+
"type": {
|
|
1316
|
+
"text": "undefined | Record<string, unknown>"
|
|
1317
|
+
},
|
|
1318
|
+
"description": "The compare definition (prompt + the two candidates). Set as a JS PROPERTY: `el.data = { prompt, candidates: [A, B], collapse? }`. Import `ResponseCompareData` from `@kitn.ai/ui` for the full shape.",
|
|
1319
|
+
"privacy": "public"
|
|
1320
|
+
},
|
|
1321
|
+
{
|
|
1322
|
+
"kind": "field",
|
|
1323
|
+
"name": "compareId",
|
|
1324
|
+
"type": {
|
|
1325
|
+
"text": "undefined | string"
|
|
1326
|
+
},
|
|
1327
|
+
"description": "Stable id correlating every emitted event. Attribute: `compare-id`.",
|
|
1328
|
+
"privacy": "public"
|
|
1329
|
+
},
|
|
1330
|
+
{
|
|
1331
|
+
"kind": "field",
|
|
1332
|
+
"name": "selection",
|
|
1333
|
+
"type": {
|
|
1334
|
+
"text": "undefined | Record<string, unknown>"
|
|
1335
|
+
},
|
|
1336
|
+
"description": "Re-hydrate / control the user's pick. Set as a JS PROPERTY: `el.selection = { chosenId, rejectedIds }`. Renders the collapsed winner.",
|
|
1337
|
+
"privacy": "public"
|
|
1338
|
+
},
|
|
1339
|
+
{
|
|
1340
|
+
"kind": "field",
|
|
1341
|
+
"name": "layout",
|
|
1342
|
+
"type": {
|
|
1343
|
+
"text": "undefined | \"auto\" | \"columns\" | \"tabs\""
|
|
1344
|
+
},
|
|
1345
|
+
"description": "Layout: `'auto'` (default — columns when wide, tabs when narrow, by CONTAINER width) | `'columns'` (side-by-side) | `'tabs'` (pills to switch). Attribute: `layout`.",
|
|
1346
|
+
"privacy": "public"
|
|
1347
|
+
},
|
|
1348
|
+
{
|
|
1349
|
+
"kind": "field",
|
|
1350
|
+
"name": "proseSize",
|
|
1351
|
+
"type": {
|
|
1352
|
+
"text": "undefined | \"xs\" | \"sm\" | \"base\" | \"lg\""
|
|
1353
|
+
},
|
|
1354
|
+
"description": "Prose/text size for the rendered candidates. Attribute: `prose-size`.",
|
|
1355
|
+
"privacy": "public"
|
|
1356
|
+
},
|
|
1357
|
+
{
|
|
1358
|
+
"kind": "field",
|
|
1359
|
+
"name": "codeTheme",
|
|
1360
|
+
"type": {
|
|
1361
|
+
"text": "undefined | string"
|
|
1362
|
+
},
|
|
1363
|
+
"description": "Shiki theme for code blocks in the candidates. Attribute: `code-theme`.",
|
|
1364
|
+
"privacy": "public"
|
|
1365
|
+
},
|
|
1366
|
+
{
|
|
1367
|
+
"kind": "field",
|
|
1368
|
+
"name": "codeHighlight",
|
|
1369
|
+
"type": {
|
|
1370
|
+
"text": "undefined | false | true"
|
|
1371
|
+
},
|
|
1372
|
+
"description": "Whether code blocks are syntax-highlighted. Attribute: `code-highlight`.",
|
|
1373
|
+
"privacy": "public"
|
|
1374
|
+
}
|
|
1375
|
+
],
|
|
1376
|
+
"attributes": [
|
|
1377
|
+
{
|
|
1378
|
+
"name": "theme",
|
|
1379
|
+
"type": {
|
|
1380
|
+
"text": "'light' | 'dark' | 'auto'"
|
|
1381
|
+
},
|
|
1382
|
+
"description": "Color mode (auto follows prefers-color-scheme)."
|
|
1383
|
+
},
|
|
1384
|
+
{
|
|
1385
|
+
"name": "compare-id",
|
|
1386
|
+
"fieldName": "compareId",
|
|
1387
|
+
"type": {
|
|
1388
|
+
"text": "undefined | string"
|
|
1389
|
+
},
|
|
1390
|
+
"description": "Stable id correlating every emitted event. Attribute: `compare-id`."
|
|
1391
|
+
},
|
|
1392
|
+
{
|
|
1393
|
+
"name": "layout",
|
|
1394
|
+
"fieldName": "layout",
|
|
1395
|
+
"type": {
|
|
1396
|
+
"text": "undefined | \"auto\" | \"columns\" | \"tabs\""
|
|
1397
|
+
},
|
|
1398
|
+
"description": "Layout: `'auto'` (default — columns when wide, tabs when narrow, by CONTAINER width) | `'columns'` (side-by-side) | `'tabs'` (pills to switch). Attribute: `layout`."
|
|
1399
|
+
},
|
|
1400
|
+
{
|
|
1401
|
+
"name": "prose-size",
|
|
1402
|
+
"fieldName": "proseSize",
|
|
1403
|
+
"type": {
|
|
1404
|
+
"text": "undefined | \"xs\" | \"sm\" | \"base\" | \"lg\""
|
|
1405
|
+
},
|
|
1406
|
+
"description": "Prose/text size for the rendered candidates. Attribute: `prose-size`."
|
|
1407
|
+
},
|
|
1408
|
+
{
|
|
1409
|
+
"name": "code-theme",
|
|
1410
|
+
"fieldName": "codeTheme",
|
|
1411
|
+
"type": {
|
|
1412
|
+
"text": "undefined | string"
|
|
1413
|
+
},
|
|
1414
|
+
"description": "Shiki theme for code blocks in the candidates. Attribute: `code-theme`."
|
|
1415
|
+
},
|
|
1416
|
+
{
|
|
1417
|
+
"name": "code-highlight",
|
|
1418
|
+
"fieldName": "codeHighlight",
|
|
1419
|
+
"type": {
|
|
1420
|
+
"text": "undefined | false | true"
|
|
1421
|
+
},
|
|
1422
|
+
"description": "Whether code blocks are syntax-highlighted. Attribute: `code-highlight`."
|
|
1423
|
+
}
|
|
1424
|
+
],
|
|
1425
|
+
"events": [
|
|
1426
|
+
{
|
|
1427
|
+
"name": "kai-compare-select",
|
|
1428
|
+
"type": {
|
|
1429
|
+
"text": "CustomEvent<{ chosenId: string; rejectedIds: string[]; at?: undefined | number }>"
|
|
1430
|
+
},
|
|
1431
|
+
"description": "The user committed a pick. `detail` = `{ chosenId, rejectedIds, at }`."
|
|
1432
|
+
},
|
|
1433
|
+
{
|
|
1434
|
+
"name": "kai-error",
|
|
1435
|
+
"type": {
|
|
1436
|
+
"text": "CustomEvent<{ compareId: string; message: string }>"
|
|
1437
|
+
},
|
|
1438
|
+
"description": "The definition was unusable."
|
|
1439
|
+
},
|
|
1440
|
+
{
|
|
1441
|
+
"name": "kai-ready",
|
|
1442
|
+
"type": {
|
|
1443
|
+
"text": "CustomEvent<{ compareId: string }>"
|
|
1444
|
+
},
|
|
1445
|
+
"description": "Both candidates have settled and the pick is live."
|
|
1446
|
+
}
|
|
1447
|
+
],
|
|
1448
|
+
"cssProperties": []
|
|
1449
|
+
},
|
|
1305
1450
|
{
|
|
1306
1451
|
"kind": "class",
|
|
1307
1452
|
"customElement": true,
|
|
@@ -2326,7 +2471,7 @@
|
|
|
2326
2471
|
"kind": "field",
|
|
2327
2472
|
"name": "message",
|
|
2328
2473
|
"type": {
|
|
2329
|
-
"text": "undefined | { id: string; role: \"user\" | \"assistant\"; content: string; reasoning?: undefined | { text: string; label?: undefined | string }; tools?: undefined | { type: string; state: \"input-streaming\" | \"input-available\" | \"output-available\" | \"output-error\"; input?: undefined | Record<string, unknown>; output?: undefined | Record<string, unknown>; toolCallId?: undefined | string; errorText?: undefined | string }[]; attachments?: undefined | { id: string; type: \"file\" | \"source-document\"; filename?: undefined | string; mediaType?: undefined | string; url?: undefined | string; title?: undefined | string }[]; actions?: undefined | (\"copy\" | \"like\" | \"dislike\" | \"regenerate\" | \"edit\" | { id: string; label: string; icon?: undefined | string; tooltip?: undefined | string })[]; avatar?: undefined | { src?: undefined | string; fallback?: undefined | string; alt?: undefined | string } }"
|
|
2474
|
+
"text": "undefined | { id: string; role: \"user\" | \"assistant\"; content: string; reasoning?: undefined | { text: string; label?: undefined | string }; tools?: undefined | { type: string; state: \"input-streaming\" | \"input-available\" | \"output-available\" | \"output-error\"; input?: undefined | Record<string, unknown>; output?: undefined | Record<string, unknown>; toolCallId?: undefined | string; errorText?: undefined | string }[]; attachments?: undefined | { id: string; type: \"file\" | \"source-document\"; filename?: undefined | string; mediaType?: undefined | string; url?: undefined | string; title?: undefined | string }[]; actions?: undefined | (\"copy\" | \"like\" | \"dislike\" | \"regenerate\" | \"edit\" | { id: string; label: string; icon?: undefined | string; tooltip?: undefined | string })[]; avatar?: undefined | { src?: undefined | string; fallback?: undefined | string; alt?: undefined | string }; feedback?: undefined | \"like\" | \"dislike\" }"
|
|
2330
2475
|
},
|
|
2331
2476
|
"description": "The full message object. Set as a JS property.",
|
|
2332
2477
|
"privacy": "public"
|
|
@@ -2498,9 +2643,9 @@
|
|
|
2498
2643
|
{
|
|
2499
2644
|
"name": "kai-message-action",
|
|
2500
2645
|
"type": {
|
|
2501
|
-
"text": "CustomEvent<{ messageId: string; action: string }>"
|
|
2646
|
+
"text": "CustomEvent<{ messageId: string; action: string; state?: undefined | \"on\" | \"off\" }>"
|
|
2502
2647
|
},
|
|
2503
|
-
"description": "An action button was clicked. `action` is the built-in name or custom id."
|
|
2648
|
+
"description": "An action button was clicked. `action` is the built-in name or custom id. `state` is present only for the toggleable feedback votes: `'on'` when a like/dislike is set, `'off'` when re-tapped to clear."
|
|
2504
2649
|
}
|
|
2505
2650
|
],
|
|
2506
2651
|
"cssProperties": []
|
|
@@ -4120,6 +4265,110 @@
|
|
|
4120
4265
|
],
|
|
4121
4266
|
"cssProperties": []
|
|
4122
4267
|
},
|
|
4268
|
+
{
|
|
4269
|
+
"kind": "class",
|
|
4270
|
+
"customElement": true,
|
|
4271
|
+
"tagName": "kai-toast-region",
|
|
4272
|
+
"name": "KaiToastRegionElement",
|
|
4273
|
+
"description": "",
|
|
4274
|
+
"members": [
|
|
4275
|
+
{
|
|
4276
|
+
"kind": "field",
|
|
4277
|
+
"name": "toasts",
|
|
4278
|
+
"type": {
|
|
4279
|
+
"text": "{ id: string; message: string; variant?: undefined | \"neutral\" | \"success\"; action?: undefined | { label: string; onAction: () => void | false }; duration?: undefined | number; dismissible?: undefined | false | true; target?: undefined | HTMLElement }[]"
|
|
4280
|
+
},
|
|
4281
|
+
"description": "The toasts to render. Newest is shown on top. Set as a JS property (array); pass a new array reference to update.",
|
|
4282
|
+
"privacy": "public"
|
|
4283
|
+
},
|
|
4284
|
+
{
|
|
4285
|
+
"kind": "field",
|
|
4286
|
+
"name": "position",
|
|
4287
|
+
"type": {
|
|
4288
|
+
"text": "undefined | \"top-center\" | \"top-right\" | \"top-left\" | \"bottom-center\" | \"bottom-right\" | \"bottom-left\""
|
|
4289
|
+
},
|
|
4290
|
+
"description": "Stack anchor: `'top-center'` (default), `'top-right'`, `'bottom-center'`, …",
|
|
4291
|
+
"privacy": "public"
|
|
4292
|
+
},
|
|
4293
|
+
{
|
|
4294
|
+
"kind": "field",
|
|
4295
|
+
"name": "max",
|
|
4296
|
+
"type": {
|
|
4297
|
+
"text": "undefined | number"
|
|
4298
|
+
},
|
|
4299
|
+
"description": "Max simultaneously-visible toasts; the rest queue. Defaults to `3`.",
|
|
4300
|
+
"privacy": "public"
|
|
4301
|
+
},
|
|
4302
|
+
{
|
|
4303
|
+
"kind": "field",
|
|
4304
|
+
"name": "stack",
|
|
4305
|
+
"type": {
|
|
4306
|
+
"text": "undefined | \"expanded\" | \"collapsed\""
|
|
4307
|
+
},
|
|
4308
|
+
"description": "Stacking: 'expanded' (default, full column) | 'collapsed' (Sonner-style pile that expands on hover/focus). Attribute: stack.",
|
|
4309
|
+
"privacy": "public"
|
|
4310
|
+
},
|
|
4311
|
+
{
|
|
4312
|
+
"kind": "field",
|
|
4313
|
+
"name": "target",
|
|
4314
|
+
"type": {
|
|
4315
|
+
"text": "undefined | HTMLElement"
|
|
4316
|
+
},
|
|
4317
|
+
"description": "Container element to anchor this region to (JS property). Set by the store for a scoped region; unset = the global viewport region.",
|
|
4318
|
+
"privacy": "public"
|
|
4319
|
+
}
|
|
4320
|
+
],
|
|
4321
|
+
"attributes": [
|
|
4322
|
+
{
|
|
4323
|
+
"name": "theme",
|
|
4324
|
+
"type": {
|
|
4325
|
+
"text": "'light' | 'dark' | 'auto'"
|
|
4326
|
+
},
|
|
4327
|
+
"description": "Color mode (auto follows prefers-color-scheme)."
|
|
4328
|
+
},
|
|
4329
|
+
{
|
|
4330
|
+
"name": "position",
|
|
4331
|
+
"fieldName": "position",
|
|
4332
|
+
"type": {
|
|
4333
|
+
"text": "undefined | \"top-center\" | \"top-right\" | \"top-left\" | \"bottom-center\" | \"bottom-right\" | \"bottom-left\""
|
|
4334
|
+
},
|
|
4335
|
+
"description": "Stack anchor: `'top-center'` (default), `'top-right'`, `'bottom-center'`, …"
|
|
4336
|
+
},
|
|
4337
|
+
{
|
|
4338
|
+
"name": "max",
|
|
4339
|
+
"fieldName": "max",
|
|
4340
|
+
"type": {
|
|
4341
|
+
"text": "undefined | number"
|
|
4342
|
+
},
|
|
4343
|
+
"description": "Max simultaneously-visible toasts; the rest queue. Defaults to `3`."
|
|
4344
|
+
},
|
|
4345
|
+
{
|
|
4346
|
+
"name": "stack",
|
|
4347
|
+
"fieldName": "stack",
|
|
4348
|
+
"type": {
|
|
4349
|
+
"text": "undefined | \"expanded\" | \"collapsed\""
|
|
4350
|
+
},
|
|
4351
|
+
"description": "Stacking: 'expanded' (default, full column) | 'collapsed' (Sonner-style pile that expands on hover/focus). Attribute: stack."
|
|
4352
|
+
}
|
|
4353
|
+
],
|
|
4354
|
+
"events": [
|
|
4355
|
+
{
|
|
4356
|
+
"name": "kai-action",
|
|
4357
|
+
"type": {
|
|
4358
|
+
"text": "CustomEvent<{ id: string; label: string }>"
|
|
4359
|
+
},
|
|
4360
|
+
"description": "A toast's action button was pressed."
|
|
4361
|
+
},
|
|
4362
|
+
{
|
|
4363
|
+
"name": "kai-dismiss",
|
|
4364
|
+
"type": {
|
|
4365
|
+
"text": "CustomEvent<{ id: string; reason: \"action\" | \"timeout\" | \"close\" }>"
|
|
4366
|
+
},
|
|
4367
|
+
"description": "A toast left the stack. `reason` is `'timeout' | 'close' | 'action'`."
|
|
4368
|
+
}
|
|
4369
|
+
],
|
|
4370
|
+
"cssProperties": []
|
|
4371
|
+
},
|
|
4123
4372
|
{
|
|
4124
4373
|
"kind": "class",
|
|
4125
4374
|
"customElement": true,
|
|
@@ -4278,7 +4527,7 @@
|
|
|
4278
4527
|
"kind": "field",
|
|
4279
4528
|
"name": "messages",
|
|
4280
4529
|
"type": {
|
|
4281
|
-
"text": "{ id: string; role: \"user\" | \"assistant\"; content: string; reasoning?: undefined | { text: string; label?: undefined | string }; tools?: undefined | { type: string; state: \"input-streaming\" | \"input-available\" | \"output-available\" | \"output-error\"; input?: undefined | Record<string, unknown>; output?: undefined | Record<string, unknown>; toolCallId?: undefined | string; errorText?: undefined | string }[]; attachments?: undefined | { id: string; type: \"file\" | \"source-document\"; filename?: undefined | string; mediaType?: undefined | string; url?: undefined | string; title?: undefined | string }[]; actions?: undefined | (\"copy\" | \"like\" | \"dislike\" | \"regenerate\" | \"edit\" | { id: string; label: string; icon?: undefined | string; tooltip?: undefined | string })[]; avatar?: undefined | { src?: undefined | string; fallback?: undefined | string; alt?: undefined | string } }[]"
|
|
4530
|
+
"text": "{ id: string; role: \"user\" | \"assistant\"; content: string; reasoning?: undefined | { text: string; label?: undefined | string }; tools?: undefined | { type: string; state: \"input-streaming\" | \"input-available\" | \"output-available\" | \"output-error\"; input?: undefined | Record<string, unknown>; output?: undefined | Record<string, unknown>; toolCallId?: undefined | string; errorText?: undefined | string }[]; attachments?: undefined | { id: string; type: \"file\" | \"source-document\"; filename?: undefined | string; mediaType?: undefined | string; url?: undefined | string; title?: undefined | string }[]; actions?: undefined | (\"copy\" | \"like\" | \"dislike\" | \"regenerate\" | \"edit\" | { id: string; label: string; icon?: undefined | string; tooltip?: undefined | string })[]; avatar?: undefined | { src?: undefined | string; fallback?: undefined | string; alt?: undefined | string }; feedback?: undefined | \"like\" | \"dislike\" }[]"
|
|
4282
4531
|
},
|
|
4283
4532
|
"description": "The active conversation's message thread, newest last. Set as a JS property.",
|
|
4284
4533
|
"privacy": "public"
|
|
@@ -4663,9 +4912,9 @@
|
|
|
4663
4912
|
{
|
|
4664
4913
|
"name": "kai-message-action",
|
|
4665
4914
|
"type": {
|
|
4666
|
-
"text": "CustomEvent<{ messageId: string; action: string }>"
|
|
4915
|
+
"text": "CustomEvent<{ messageId: string; action: string; state?: undefined | \"on\" | \"off\" }>"
|
|
4667
4916
|
},
|
|
4668
|
-
"description": "An action button on a message was clicked."
|
|
4917
|
+
"description": "An action button on a message was clicked. `state` is present only for the toggleable feedback votes: `'on'` when a like/dislike is set, `'off'` when re-tapped to clear."
|
|
4669
4918
|
},
|
|
4670
4919
|
{
|
|
4671
4920
|
"name": "kai-model-change",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as r,m as p,d as ue,s as ce,a as k,b as C,e as P,o as q,f as he,i as h,S as b,t as m,g as w,h as T,j as M,k as V,l as W,u as K,n as ge,p as U,q as be}from"./chunks/cn-Dogu6PbV.js";import{B as F}from"./chunks/button-CKyYD9G4.js";import{C as fe,a as me}from"./chunks/code-block-BYUmfFSd.js";import{F as ve}from"./chunks/file-tree-CgtRLlxK.js";import{L as pe}from"./chunks/loader-DvhR4qa0.js";import{I as z}from"./chunks/Icon-D_Zmwmwh.js";import{d as we}from"./chunks/download-D8K0Je8r.js";import{e as _}from"./chunks/external-link-6mA0wxab.js";import{f as xe}from"./chunks/file-text-DnaYk3Dm.js";var ye=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],ke=e=>r(z,p(e,{name:"ArrowLeft",iconNode:ye})),ze=ke,Te=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],Fe=e=>r(z,p(e,{name:"ArrowRight",iconNode:Te})),Ce=Fe,Pe=[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]],Ne=e=>r(z,p(e,{name:"Code",iconNode:Pe})),Re=Ne,Se=[["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"}]],Me=e=>r(z,p(e,{name:"Eye",iconNode:Se})),Oe=Me,He=[["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"}]],Ie=e=>r(z,p(e,{name:"House",iconNode:He})),je=Ie,Ee=[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]],Le=e=>r(z,p(e,{name:"Maximize2",iconNode:Ee})),Ae=Le,$e=[["polyline",{points:"4 14 10 14 10 20",key:"11kfnr"}],["polyline",{points:"20 10 14 10 14 4",key:"rlmsce"}],["line",{x1:"14",x2:"21",y1:"10",y2:"3",key:"o5lafz"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]],Be=e=>r(z,p(e,{name:"Minimize2",iconNode:$e})),De=Be,qe=[["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"}]],Ve=e=>r(z,p(e,{name:"RotateCw",iconNode:qe})),We=Ve;const Ke="6.0.227",G=`https://cdn.jsdelivr.net/npm/pdfjs-dist@${Ke}/build`,Ue=()=>import(`${G}/pdf.min.mjs`),_e=`${G}/pdf.worker.min.mjs`;let Ge=Ue,Ze=_e,O=null;function Je(){if(!O){const e=Ge;O=(async()=>{const n=await e(),t=n.default??n;return t.GlobalWorkerOptions.workerSrc=Ze,t})()}return O}async function Qe(e,n,t){const i=await(await Je()).getDocument({url:e}).promise;n.replaceChildren();const l=typeof window<"u"&&window.devicePixelRatio?window.devicePixelRatio:1;for(let s=1;s<=i.numPages;s++){const c=await i.getPage(s),o=c.getViewport({scale:1}),d=o.width>0?t/o.width:1,g=c.getViewport({scale:d*l}),f=document.createElement("canvas");f.width=Math.max(1,Math.floor(g.width)),f.height=Math.max(1,Math.floor(g.height)),f.setAttribute("role","img"),f.setAttribute("aria-label",`Page ${s}`),f.style.width="100%",f.style.height="auto",f.style.display="block";const x=f.getContext("2d");n.appendChild(f),await c.render({canvasContext:x,viewport:g}).promise}return{pages:i.numPages}}var Xe=m('<div><div class="relative min-h-0 flex-1">'),Ye=m('<form class="min-w-0 flex-1"><label class=sr-only for=kai-artifact-path>Address</label><input id=kai-artifact-path name=kai-artifact-path type=text autocomplete=off placeholder="Enter a path or URL\u2026">'),et=m("<div class=flex-1 aria-hidden=true>"),tt=m('<div role=tablist aria-label=View class="flex shrink-0 items-center gap-0.5 rounded-md bg-muted p-0.5">'),rt=m('<div data-artifact-toolbar class="flex shrink-0 items-center gap-1.5 border-b border-border bg-muted/40 px-2 py-1.5">'),nt=m("<button type=button role=tab>"),at=m('<iframe class="absolute inset-0 h-full w-full border-0 bg-white">'),it=m('<div class="absolute inset-0 flex"><div class="w-56 shrink-0 overflow-auto border-r border-border bg-muted/20 py-1.5 scrollbar-thin"></div><div class="min-w-0 flex-1 overflow-auto scrollbar-thin">'),ot=m('<div class="flex h-full items-center justify-center p-6 text-sm text-muted-foreground">Select a file to view its source.'),lt=m('<div class="flex h-full items-center justify-center p-6 text-sm text-muted-foreground">No source \u2014 this file (<!>) has no code view.'),st=m(`<div role=region aria-label="PDF preview unavailable"class="absolute inset-0 flex flex-col items-center justify-center gap-3 bg-card p-6 text-center"><div class="text-sm font-medium text-foreground"></div><div class="text-xs text-muted-foreground">Can't preview this PDF inline.</div><div class="flex flex-wrap items-center justify-center gap-2"><a class="inline-flex h-8 items-center gap-1.5 rounded-md border border-border bg-background px-3 text-xs font-medium text-foreground transition-colors hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"target=_blank rel="noopener noreferrer">Open in new tab</a><a class="inline-flex h-8 items-center gap-1.5 rounded-md border border-border bg-background px-3 text-xs font-medium text-foreground transition-colors hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"download>Download`),dt=m('<div class="pointer-events-none absolute inset-0 flex items-center justify-center">'),ut=m('<div class="absolute inset-0"><div role=region aria-label="PDF preview"tabindex=0 class="absolute inset-0 flex flex-col items-center gap-3 overflow-auto bg-muted/20 p-3 scrollbar-thin focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset">');const ct="allow-scripts allow-forms";function ht(e,n){if(e.url)return e.url;if(!n)return e.path;try{return new URL(e.path,n).href}catch{return e.path}}function gt(e,n){if(!e)return!1;const t=n.find(l=>l.url===e||l.path===e);if(t?.type==="pdf")return!0;const i=e.split(/[?#]/)[0];return/\.pdf$/i.test(i)}function bt(e){const n=p({files:[],tab:"preview",sandbox:ct,showNav:!0,showReload:!0,showHome:!0,showPathField:!0,showTabs:!0,expandable:!1,openInTab:!1,standalone:!1,readonlyPath:!1,maximized:!1},e),[t,i]=ce(n,["src","files","tab","activeFile","sandbox","iframeTitle","onNavigate","onTabChange","onFileSelect","maximized","onMaximizeChange","showNav","showReload","showHome","showPathField","showTabs","expandable","openInTab","standalone","readonlyPath","class"]),[l,s]=k(t.src?[t.src]:[]),[c,o]=k(t.src?0:-1),d=()=>l()[c()]??"",g=()=>c()>0,f=()=>c()<l().length-1,[x,H]=k(t.tab),[I,j]=k(t.activeFile),[J,Q]=k(0),[E,L]=k(t.maximized??!1);C(()=>L(t.maximized??!1));const X=()=>{var a;const u=!E();L(u),(a=t.onMaximizeChange)==null||a.call(t,u)},A=P(()=>{const a=d();return!!a&&a!=="about:blank"}),Y=()=>{A()&&window.open(d(),"_blank","noopener,noreferrer")},$=P(()=>t.expandable&&!t.standalone),ee=P(()=>t.showNav||t.showReload||t.showHome||t.showPathField||t.showTabs||$()||t.openInTab);let y;C(()=>H(t.tab)),C(()=>j(t.activeFile)),C(q(()=>t.src,a=>{a&&a!==d()&&N(a)},{defer:!0}));const te=a=>a===void 0?void 0:t.files.find(u=>u.path===a),B=P(()=>te(I())),re=P(()=>{const a=B();return!!a&&a.type!=="image"&&a.type!=="pdf"&&typeof a.code=="string"});function N(a){if(a===d()){D();return}s(u=>[...u.slice(0,c()+1),a]),o(u=>u+1),R()}function R(){var a;const u=d();y&&(y.src=u||"about:blank"),(a=t.onNavigate)==null||a.call(t,u)}function ne(a){var u;a!==x()&&(H(a),(u=t.onTabChange)==null||u.call(t,a))}function ae(a,u){var v;j(a),(v=t.onFileSelect)==null||v.call(t,a),N(ht(u,t.src))}const ie=()=>{g()&&(o(a=>a-1),R())},oe=()=>{f()&&(o(a=>a+1),R())};function D(){var a;const u=d();y&&(y.src="about:blank",y.src=u||"about:blank"),Q(v=>v+1),(a=t.onNavigate)==null||a.call(t,u)}const le=()=>{t.src&&N(t.src)},se=()=>{var a,u;try{const v=(a=y?.contentWindow)==null?void 0:a.location.href;v&&v!=="about:blank"&&v!==d()&&(s(S=>[...S.slice(0,c()+1),v]),o(S=>S+1),(u=t.onNavigate)==null||u.call(t,v))}catch{}},de=a=>{a.preventDefault();const u=a.currentTarget.elements.namedItem("kai-artifact-path");if(t.readonlyPath){u&&(u.value=d());return}u&&u.value&&N(u.value)};return(()=>{var a=Xe(),u=a.firstChild;return he(a,p({get class(){return M("flex h-full w-full flex-col overflow-hidden bg-card text-card-foreground",t.standalone&&"rounded-xl border border-border",t.class)}},i),!1,!0),h(a,r(b,{get when(){return ee()},get children(){return r(ft,{url:d,tab:x,canBack:g,canForward:f,canHome:()=>!!t.src,onBack:ie,onForward:oe,onReload:D,onHome:le,onSubmitPath:de,onTab:ne,showNav:()=>t.showNav,showReload:()=>t.showReload,showHome:()=>t.showHome,showPathField:()=>t.showPathField,showTabs:()=>t.showTabs,showExpand:$,showOpenInTab:()=>t.openInTab,maximized:E,onToggleMaximize:X,canOpenInTab:A,onOpenInTab:Y,readonlyPath:()=>t.readonlyPath})}}),u),h(u,r(b,{get when(){return x()==="preview"},get fallback(){return r(vt,{get files(){return t.files},activeFile:I,activeFileObj:B,hasSource:re,onSelect:ae})},get children(){return r(b,{get when(){return gt(d(),t.files)},get fallback(){return r(mt,{ref:v=>y=v,src:d,get sandbox(){return t.sandbox},get title(){return t.iframeTitle??"Artifact preview"},onLoad:se})},get children(){return r(wt,{get url(){return d()},get reloadKey(){return J()}})}})}})),a})()}function ft(e){return(()=>{var n=rt();return h(n,r(b,{get when(){return e.showNav()},get children(){return[r(F,{variant:"ghost",size:"icon-sm","aria-label":"Back",get disabled(){return!e.canBack()},onClick:()=>e.onBack(),get children(){return r(ze,{size:16,"aria-hidden":"true"})}}),r(F,{variant:"ghost",size:"icon-sm","aria-label":"Forward",get disabled(){return!e.canForward()},onClick:()=>e.onForward(),get children(){return r(Ce,{size:16,"aria-hidden":"true"})}})]}}),null),h(n,r(b,{get when(){return e.showReload()},get children(){return r(F,{variant:"ghost",size:"icon-sm","aria-label":"Reload",onClick:()=>e.onReload(),get children(){return r(We,{size:15,"aria-hidden":"true"})}})}}),null),h(n,r(b,{get when(){return e.showHome()},get children(){return r(F,{variant:"ghost",size:"icon-sm","aria-label":"Home",get disabled(){return!e.canHome()},onClick:()=>e.onHome(),get children(){return r(je,{size:15,"aria-hidden":"true"})}})}}),null),h(n,r(b,{get when(){return e.showPathField()},get children(){var t=Ye(),i=t.firstChild,l=i.nextSibling;return t.addEventListener("submit",s=>e.onSubmitPath(s)),w(l,"spellcheck",!1),T(s=>{var c=e.readonlyPath()||void 0,o=e.readonlyPath()?"true":void 0,d=M("h-7 w-full rounded-md border border-border px-2.5 text-xs text-foreground font-mono outline-none",e.readonlyPath()?"bg-muted/40 cursor-default":"bg-background focus-visible:ring-2 focus-visible:ring-ring");return c!==s.e&&(l.readOnly=s.e=c),o!==s.t&&w(l,"aria-readonly",s.t=o),d!==s.a&&V(l,s.a=d),s},{e:void 0,t:void 0,a:void 0}),T(()=>l.value=e.url()),t}}),null),h(n,r(b,{get when(){return!e.showPathField()},get children(){return et()}}),null),h(n,r(b,{get when(){return e.showExpand()},get children(){return r(F,{variant:"ghost",size:"icon-sm",get"aria-label"(){return e.maximized()?"Collapse":"Expand"},get"aria-expanded"(){return e.maximized()},onClick:()=>e.onToggleMaximize(),get children(){return r(b,{get when(){return e.maximized()},get fallback(){return r(Ae,{size:15,"aria-hidden":"true"})},get children(){return r(De,{size:15,"aria-hidden":"true"})}})}})}}),null),h(n,r(b,{get when(){return e.showOpenInTab()},get children(){return r(F,{variant:"ghost",size:"icon-sm","aria-label":"Open in new tab",get disabled(){return!e.canOpenInTab()},onClick:()=>e.onOpenInTab(),get children(){return r(_,{size:15,"aria-hidden":"true"})}})}}),null),h(n,r(b,{get when(){return e.showTabs()},get children(){var t=tt();return h(t,r(Z,{label:"Preview",get icon(){return r(Oe,{size:14,"aria-hidden":"true"})},get selected(){return e.tab()==="preview"},onClick:()=>e.onTab("preview")}),null),h(t,r(Z,{label:"Code",get icon(){return r(Re,{size:14,"aria-hidden":"true"})},get selected(){return e.tab()==="code"},onClick:()=>e.onTab("code")}),null),t}}),null),n})()}function Z(e){return(()=>{var n=nt();return n.$$click=()=>e.onClick(),h(n,()=>e.icon,null),h(n,()=>e.label,null),T(t=>{var i=e.selected,l=M("inline-flex h-6 items-center gap-1.5 rounded px-2 text-xs font-medium transition-colors outline-none","focus-visible:ring-2 focus-visible:ring-ring",e.selected?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground");return i!==t.e&&w(n,"aria-selected",t.e=i),l!==t.t&&V(n,t.t=l),t},{e:void 0,t:void 0}),n})()}function mt(e){return(()=>{var n=at();n.addEventListener("load",()=>e.onLoad());var t=e.ref;return typeof t=="function"?K(t,n):e.ref=n,T(i=>{var l=e.src()||"about:blank",s=e.sandbox,c=e.title;return l!==i.e&&w(n,"src",i.e=l),s!==i.t&&w(n,"sandbox",i.t=s),c!==i.a&&w(n,"title",i.a=c),i},{e:void 0,t:void 0,a:void 0}),n})()}function vt(e){return(()=>{var n=it(),t=n.firstChild,i=t.nextSibling;return h(t,r(ve,{get files(){return e.files},get activeFile(){return e.activeFile()},onSelect:(l,s)=>e.onSelect(l,s)})),h(i,r(b,{get when(){return e.activeFileObj()},get fallback(){return ot()},get children(){return r(b,{get when(){return e.hasSource()},get fallback(){return(()=>{var l=lt(),s=l.firstChild,c=s.nextSibling;return c.nextSibling,h(l,()=>e.activeFileObj().type??"binary",c),l})()},get children(){return r(fe,{class:"h-full rounded-none border-0",get children(){return r(me,{get code(){return e.activeFileObj().code??""},get language(){return e.activeFileObj().language}})}})}})}})),n})()}function pt(e){const n=()=>{const t=e.url.split(/[?#]/)[0];return t.slice(t.lastIndexOf("/")+1)||"document.pdf"};return(()=>{var t=st(),i=t.firstChild,l=i.nextSibling,s=l.nextSibling,c=s.firstChild;c.firstChild;var o=c.nextSibling,d=o.firstChild;return h(t,r(xe,{size:40,class:"text-muted-foreground","aria-hidden":"true"}),i),h(i,n),h(c,r(_,{size:13,"aria-hidden":"true"}),null),h(o,r(we,{size:13,"aria-hidden":"true"}),d),T(g=>{var f=e.url,x=e.url;return f!==g.e&&w(c,"href",g.e=f),x!==g.t&&w(o,"href",g.t=x),g},{e:void 0,t:void 0}),t})()}function wt(e){const[n,t]=k("loading");let i,l=0,s;const c=async()=>{if(!i){t("error");return}const o=++l;t("loading");try{const d=i.clientWidth||600;await Qe(e.url,i,d),o===l&&t("success")}catch{o===l&&t("error")}};return C(q(()=>[e.url,e.reloadKey],()=>{c()})),W(()=>{if(!i||typeof ResizeObserver>"u")return;const o=new ResizeObserver(()=>{n()==="success"&&(clearTimeout(s),s=setTimeout(()=>{c()},200))});o.observe(i),U(()=>{o.disconnect(),clearTimeout(s),l++})}),(()=>{var o=ut(),d=o.firstChild;return K(g=>i=g,d),h(o,r(b,{get when(){return ge(()=>!0)()&&n()==="loading"},get children(){var g=dt();return h(g,r(pe,{variant:"circular",size:"md"})),g}}),null),h(o,r(b,{get when(){return n()==="error"},get children(){return r(pt,{get url(){return e.url}})}}),null),T(()=>w(d,"aria-busy",n()==="loading")),o})()}ue(["click"]);var xt=m("<style>:host{display:block;height:100%;min-height:0}"),yt=m('<div style="display:grid;grid-template-rows:minmax(0, 1fr);grid-template-columns:minmax(0, 1fr);height:100%;min-height:0">');be("kai-artifact",{src:void 0,files:[],tab:"preview",activeFile:void 0,sandbox:"allow-scripts allow-forms",iframeTitle:void 0,maximized:!1,expandable:!1,openInTab:!1,noNav:!1,noReload:!1,noHome:!1,noPathField:!1,noTabs:!1,standalone:!1,readonlyPath:!1},(e,{element:n,dispatch:t,flag:i})=>{const[l,s]=k(i("maximized")),c=o=>{s(o),n.dispatchEvent(new CustomEvent("kai-maximize-intent",{detail:{requested:o},bubbles:!0,composed:!0})),t("kai-maximize-change",{maximized:o})};return W(()=>{const o=d=>s(d.detail.maximized);n.addEventListener("kai-maximize-state",o),U(()=>n.removeEventListener("kai-maximize-state",o))}),[xt(),(()=>{var o=yt();return h(o,r(bt,{get src(){return e.src},get files(){return e.files},get tab(){return e.tab},get activeFile(){return e.activeFile},get sandbox(){return e.sandbox},get iframeTitle(){return e.iframeTitle},get maximized(){return l()},get expandable(){return i("expandable")},get openInTab(){return i("openInTab")},get showNav(){return!i("noNav")},get showReload(){return!i("noReload")},get showHome(){return!i("noHome")},get showPathField(){return!i("noPathField")},get showTabs(){return!i("noTabs")},get standalone(){return i("standalone")},get readonlyPath(){return i("readonlyPath")},onMaximizeChange:c,onNavigate:d=>t("kai-navigate",{url:d}),onTabChange:d=>t("kai-tab-change",{tab:d}),onFileSelect:d=>t("kai-file-select",{path:d})})),o})()]});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{q as b,c as e,F as T,S as n,n as c,h as k,g as o,i as m,t as l}from"./chunks/cn-Dogu6PbV.js";import{A as M,a as C,b as j,c as A,d as v,e as p,f as F,g as f,h as R,i as S,j as $}from"./chunks/attachments-Dp6vqtrc.js";var q=l('<img class="block max-h-64 max-w-xs rounded object-contain">'),z=l('<div class="text-body font-medium">'),E=l('<div class="text-muted-foreground text-caption">');b("kai-attachments",{items:[],variant:"grid",hoverCard:!1,removable:!1,showMediaType:!1,emptyText:void 0},(a,{dispatch:w,flag:s})=>{const i=()=>a.variant??"grid",y=()=>s("hoverCard"),x=()=>s("removable"),u=()=>s("showMediaType");return e(n,{get when(){return a.items.length},get fallback(){return e(n,{get when(){return a.emptyText},get children(){return e($,{get children(){return a.emptyText}})}})},get children(){return e(M,{get variant(){return i()},get children(){return e(T,{get each(){return a.items},children:r=>e(C,{data:r,get onRemove(){return x()?()=>w("kai-remove",{id:r.id}):void 0},get children(){return[e(n,{get when(){return y()},get fallback(){return[e(v,{}),e(n,{get when(){return i()!=="grid"},get children(){return e(p,{get showMediaType(){return u()}})}})]},get children(){return e(j,{get children(){return[e(A,{get class(){return c(()=>i()==="grid")()?"block size-full":`flex items-center gap-1.5${i()==="list"?" w-full":""}`},get children(){return[e(v,{}),e(n,{get when(){return i()!=="grid"},get children(){return e(p,{get showMediaType(){return u()}})}})]}}),e(F,{get children(){return e(n,{get when(){return c(()=>R(r)==="image"&&r.type==="file")()&&r.url},get fallback(){return[(()=>{var t=z();return m(t,()=>f(r)),t})(),e(n,{get when(){return r.mediaType},get children(){var t=E();return m(t,()=>r.mediaType),t}})]},get children(){var t=q();return k(g=>{var d=r.url,h=f(r);return d!==g.e&&o(t,"src",g.e=d),h!==g.t&&o(t,"alt",g.t=h),g},{e:void 0,t:void 0}),t}})}})]}})}}),e(S,{})]}})})}})}})});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const p={"kai-conversations":"conversation-list","kai-prompt-input":"prompt-input","kai-chat":"chat","kai-workspace":"chat-workspace","kai-thinking-bar":"thinking-bar","kai-model-switcher":"model-switcher","kai-attachments":"attachments","kai-message":"message","kai-markdown":"markdown","kai-code-block":"code-block","kai-reasoning":"reasoning","kai-tool":"tool","kai-context":"context-meter","kai-feedback-bar":"feedback-bar","kai-scope-picker":"chat-scope-picker","kai-suggestions":"prompt-suggestions","kai-file-upload":"file-upload","kai-voice-input":"voice-input","kai-loader":"loader","kai-text-shimmer":"text-shimmer","kai-image":"image","kai-checkpoint":"checkpoint","kai-skills":"message-skills","kai-source":"source","kai-sources":"source","kai-response-stream":"response-stream","kai-empty":"empty","kai-chain-of-thought":"chain-of-thought","kai-resizable":"resizable","kai-resizable-item":"resizable","kai-file-tree":"file-tree","kai-artifact":"artifact","kai-scroll-button":"scroll-button","kai-popover":"popover","kai-switch":"switch","kai-toast-region":"toast","kai-card":"card","kai-form":"form","kai-link-preview":"link-preview","kai-embed":"embed","kai-confirm":"confirm-card","kai-tasks":"tasks","kai-choice":"choice","kai-cards":"cards","kai-compare":"compare"},h={tags:p},r=h.tags,n=new Set,f=import.meta.url.slice(0,import.meta.url.lastIndexOf("/")+1);let l=null;function g(e){l=e.endsWith("/")?e:e+"/"}async function b(e){if(customElements.get(e)||n.has(e))return;const a=r[e];if(a){n.add(e);try{await import(`${l??f}${a}.js`)}catch(t){n.delete(e),w(e,t)}}}let k=!1;function w(e,a){if(k)return;k=!0;const t=a?.message??String(a);console.warn(`[kai-autoloader] could not load "${e}" (${t}). The autoloader is a CDN / static-file tool \u2014 load it from a <script type="module" src=".../@kitn.ai/ui/dist/elements/autoloader.js">. It is NOT importable through a bundler. In a bundled app, register elements with per-element imports (import '@kitn.ai/ui/elements/<el>') or the register-all bundle (import '@kitn.ai/ui/elements'). To drive the autoloader from a bundler, host dist/elements/ and call setAutoloaderBasePath('<url>/') before use.`)}function d(e){var a,t,i;const s=new Set,o=(t=(a=e.tagName)==null?void 0:a.toLowerCase)==null?void 0:t.call(a);o&&o in r&&!customElements.get(o)&&s.add(o),(i=e.querySelectorAll)==null||i.call(e,":not(:defined)").forEach(u=>{const c=u.tagName.toLowerCase();c in r&&s.add(c)}),s.forEach(b)}function m(e=document){d(e),new MutationObserver(a=>{for(const t of a)for(const i of t.addedNodes)i.nodeType===1&&d(i)}).observe(document.documentElement,{childList:!0,subtree:!0})}typeof document<"u"&&queueMicrotask(()=>m());export{g as setAutoloaderBasePath,m as startAutoloader};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{q as s,c as o,r as t,t as n}from"./chunks/cn-Dogu6PbV.js";import{C as i}from"./chunks/card-Cjho-PYk.js";var d=n("<slot>"),g=n("<slot name=media>"),m=n("<slot name=actions>");s("kai-card",{heading:void 0,description:void 0,errorMessage:void 0,dense:!1},(r,{flag:a})=>o(i,{get heading(){return r.heading},get description(){return r.description},get errorMessage(){return r.errorMessage},get dense(){return a("dense")},get media(){return(()=>{var e=g();return e._$owner=t(),e})()},get actions(){return(()=>{var e=m();return e._$owner=t(),e})()},get children(){var e=d();return e._$owner=t(),e}}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as n,i as s,t as d,q as u,l as p,p as v,F as f,b as g,D as h,S as k}from"./chunks/cn-Dogu6PbV.js";import{C as l,r as y,e as x}from"./chunks/card-routing-C986KuUA.js";import"./form.js";import"./confirm-card.js";import"./tasks.js";import"./choice.js";import"./link-preview.js";import"./embed.js";import{C as b}from"./chunks/card-Cjho-PYk.js";import{t as C}from"./chunks/triangle-alert-Ct1zt2JL.js";const c={form:"kai-form",confirm:"kai-confirm",tasks:"kai-tasks",choice:"kai-choice",link:"kai-link-preview",embed:"kai-embed"};function I(e){return e?{...c,...e}:{...c}}var E=d('<div role=alert class="flex items-center gap-2 p-4 text-sm text-muted-foreground"><span>Unsupported card type: <code class=font-mono>');function w(e){return n(b,{get children(){var t=E(),i=t.firstChild,a=i.firstChild,r=a.nextSibling;return s(t,n(C,{class:"size-4 shrink-0 text-destructive dark:text-red-400","aria-hidden":"true"}),i),s(r,()=>e.type),t}})}var A=d('<div class="flex flex-col gap-3">');function L(e){let t;return g(()=>{t&&(t.data=e.envelope.data,t.cardId=e.envelope.id,e.envelope.title!=null&&(t.heading=e.envelope.title),t.resolution=e.envelope.resolution,t.setAttribute("theme",e.theme))}),p(()=>{e.tag||e.emit({kind:"error",cardId:e.envelope.id,message:`Unsupported card type: ${e.envelope.type}`})}),n(k,{get when(){return e.tag},get fallback(){return n(w,{get type(){return e.envelope.type},get cardId(){return e.envelope.id}})},children:i=>n(h,{get component(){return i()},ref(a){var r=t;typeof r=="function"?r(a):t=a}})})}u("kai-cards",{cards:void 0,types:void 0,policy:void 0},(e,{element:t})=>{p(()=>{const r=o=>y(e.policy??{},o.detail);t.addEventListener(l,r),v(()=>t.removeEventListener(l,r))});const i=()=>e.theme??"auto",a=()=>I(e.types);return(()=>{var r=A();return s(r,n(f,{get each(){return e.cards??[]},children:o=>n(L,{envelope:o,get tag(){return a()[o.type]},get theme(){return i()},emit:m=>x(t,m)})})),r})()});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as r,m as g,n as b,j as c,i as l,S as d,h as p,k as h,s as y,f as w,t as o,q as C,a as j,l as k,p as z,F as I}from"./chunks/cn-Dogu6PbV.js";import{C as S,a as L,b as q}from"./chunks/collapsible-BiNwdOn6.js";import{c as f}from"./chunks/chevron-down-3SBiq8HF.js";import{I as A}from"./chunks/Icon-D_Zmwmwh.js";var O=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],E=t=>r(A,g(t,{name:"Circle",iconNode:O})),F=E,m=o("<div>"),H=o('<span class="relative inline-flex size-4 items-center justify-center"><span>'),K=o('<div class="flex items-center gap-2"><span>'),M=o('<span class="relative inline-flex size-4 items-center justify-center">'),N=o('<div class="grid grid-cols-[min-content_minmax(0,1fr)] gap-x-4"><div class="bg-primary/20 ml-1.75 h-full w-px group-data-[last=true]:hidden"></div><div class="ml-1.75 h-full w-px bg-transparent group-data-[last=false]:hidden"></div><div class="mt-2 space-y-2">'),_=o('<div class="flex justify-start group-data-[last=true]:hidden"><div class="bg-primary/20 ml-1.75 h-4 w-px">');function P(t){const[e,s]=y(t,["children","class"]);return(()=>{var a=m();return w(a,g({get class(){return c("text-muted-foreground text-sm",e.class)}},s),!1,!0),l(a,()=>e.children),a})()}function R(t){const e=()=>t.swapIconOnHover??!0;return r(L,{get class(){return c("group text-muted-foreground hover:text-foreground flex cursor-pointer items-center justify-start gap-1 text-left text-meta transition-colors",t.class)},get children(){return[(()=>{var s=K(),a=s.firstChild;return l(s,r(d,{get when(){return t.leftIcon},get fallback(){return(()=>{var n=M();return l(n,r(F,{class:"size-2 fill-current"})),n})()},get children(){var n=H(),i=n.firstChild;return l(i,()=>t.leftIcon),l(n,r(d,{get when(){return e()},get children(){return r(f,{class:"absolute size-4 opacity-0 transition-opacity group-hover:opacity-100 group-data-[state=open]:rotate-180"})}}),null),p(()=>h(i,c("transition-opacity",e()&&"group-hover:opacity-0"))),n}}),a),l(a,()=>t.children),s})(),r(d,{get when(){return!t.leftIcon},get children(){return r(f,{class:"size-4 transition-transform group-data-[state=open]:rotate-180"})}})]}})}function T(t){return r(q,{get class(){return c("text-popover-foreground data-[state=closed]:animate-collapsible-up data-[state=open]:animate-collapsible-down overflow-hidden",t.class)},get children(){var e=N(),s=e.firstChild,a=s.nextSibling,n=a.nextSibling;return l(n,()=>t.children),e}})}function W(t){return(()=>{var e=m();return l(e,()=>t.children),p(()=>h(e,c("space-y-0",t.class))),e})()}function $(t){return r(S,{get class(){return c("group",t.class)},get"data-last"(){return t.isLast??!1},get children(){return[b(()=>t.children),_()]}})}function v(t){var e;return{label:t.getAttribute("label")??"",content:((e=t.textContent)==null?void 0:e.trim())||void 0}}C("kai-chain-of-thought",{steps:[]},(t,{element:e})=>{const[s,a]=j([]);k(()=>{const i=()=>{const x=[...e.querySelectorAll("kai-step")];a(x.map(v))};i();const u=new MutationObserver(i);u.observe(e,{childList:!0,attributes:!0,subtree:!0}),z(()=>u.disconnect())});const n=()=>[...t.steps,...s()];return r(W,{get children(){return r(I,{get each(){return n()},children:(i,u)=>r($,{get isLast(){return u()===n().length-1},get children(){return[r(R,{get children(){return i.label}}),r(d,{get when(){return i.content},get children(){return r(T,{get children(){return r(P,{get children(){return i.content}})}})}})]}})})}})});export{v as parseKaiStepElement};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{s as i,c as a,m as c,n as g,j as h,S as s,F as o,t as n,q as u}from"./chunks/cn-Dogu6PbV.js";import{D as p,a as d,b as l,c as v}from"./chunks/dropdown-bUs2iTia.js";import{B as b}from"./chunks/button-CKyYD9G4.js";var x=n('<div class="px-2 py-1 text-[10px] uppercase tracking-wider text-muted-foreground">Authors'),m=n('<div class="px-2 py-1 text-[10px] uppercase tracking-wider text-muted-foreground">Tags'),w=n('<svg width=12 height=12 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2><polygon points="22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3">'),C=n('<svg width=12 height=12 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2><polyline points="6 9 12 15 18 9">');function A(r){const[t]=i(r,["currentLabel","onScopeChange","availableAuthors","availableTags","class"]);return a(v,{get children(){return[a(p,{as:e=>a(b,c({variant:"ghost",size:"sm",get class(){return h("gap-1 text-xs",t.class)}},e,{get children(){return[w(),g(()=>t.currentLabel),C()]}}))}),a(d,{class:"min-w-[180px]",get children(){return[a(l,{onSelect:()=>t.onScopeChange(void 0),children:"All Content"}),a(s,{get when(){var e;return(e=t.availableAuthors)==null?void 0:e.length},get children(){return[x(),a(o,{get each(){return t.availableAuthors},children:e=>a(l,{onSelect:()=>t.onScopeChange({authors:[e]}),children:e})})]}}),a(s,{get when(){var e;return(e=t.availableTags)==null?void 0:e.length},get children(){return[m(),a(o,{get each(){return t.availableTags},children:e=>a(l,{onSelect:()=>t.onScopeChange({tags:[e]}),children:e})})]}})]}})]}})}u("kai-scope-picker",{availableAuthors:[],availableTags:[],currentLabel:"All Content"},(r,{dispatch:t})=>a(A,{get currentLabel(){return r.currentLabel??"All Content"},get availableAuthors(){return r.availableAuthors},get availableTags(){return r.availableTags},onScopeChange:e=>t("kai-scope-change",{filters:e})}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as a,m as h,a as m,q as v,i as l,S as p,t as g}from"./chunks/cn-Dogu6PbV.js";import{C as b}from"./chunks/chat-thread-RT808iPf.js";import{C as k}from"./chunks/conversation-list-D9Y0NVdo.js";import{R as f,a as u,b as C}from"./chunks/resizable-B5WNbSeb.js";import{B as S}from"./chunks/button-CKyYD9G4.js";import{I as M}from"./chunks/Icon-D_Zmwmwh.js";var z=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m14 9 3 3-3 3",key:"8010ee"}]],w=e=>a(M,h(e,{name:"PanelLeftOpen",iconNode:z})),x=w;function I(e,r){const[s,i]=m(r);return[()=>e()??s(),n=>i(n)]}var T=g('<div class="h-full w-full overflow-hidden bg-background">'),W=g('<div class="relative h-full">');v("kai-workspace",{groups:[],conversations:[],activeId:void 0,messages:[],value:void 0,placeholder:"Send a message...",loading:!1,suggestions:void 0,suggestionMode:"submit",proseSize:"sm",codeTheme:"github-dark-dimmed",codeHighlight:!0,chatTitle:void 0,models:void 0,currentModel:void 0,context:void 0,scrollButton:!0,search:!1,voice:!1,slashCommands:void 0,slashActiveIds:void 0,slashCompact:!1,sidebarWidth:22,sidebarMinWidth:200,sidebarMaxWidth:420,sidebarCollapsed:void 0,defaultSidebarCollapsed:void 0},(e,{dispatch:r,flag:s})=>{const[i,n]=I(()=>e.sidebarCollapsed,s("defaultSidebarCollapsed")),d=()=>{const t=!i();n(t),r("kai-sidebar-toggle",{collapsed:t})},c=a(b,{get messages(){return e.messages},get value(){return e.value},get placeholder(){return e.placeholder},get loading(){return s("loading")},get suggestions(){return e.suggestions},get suggestionMode(){return e.suggestionMode},get proseSize(){return e.proseSize},get codeTheme(){return e.codeTheme},get codeHighlight(){return s("codeHighlight")},get chatTitle(){return e.chatTitle},get models(){return e.models},get currentModel(){return e.currentModel},get context(){return e.context},get scrollButton(){return e.scrollButton!==!1},get search(){return s("search")},get voice(){return s("voice")},get slashCommands(){return e.slashCommands},get slashActiveIds(){return e.slashActiveIds},get slashCompact(){return s("slashCompact")},onValueChange:t=>r("kai-value-change",{value:t}),onSubmit:t=>r("kai-submit",t),onSuggestionClick:t=>r("kai-suggestion-click",{value:t}),onModelChange:t=>r("kai-model-change",{modelId:t}),onMessageAction:t=>r("kai-message-action",t),onSearch:()=>r("kai-search",{}),onVoice:()=>r("kai-voice",{}),onSlashSelect:t=>r("kai-slash-select",{command:t})});return(()=>{var t=T();return l(t,a(p,{get when(){return!i()},get fallback(){return(()=>{var o=W();return l(o,a(S,{variant:"ghost",size:"icon-sm","aria-label":"Open sidebar",class:"absolute left-2 top-2 z-10 rounded-full bg-card/80 shadow-sm backdrop-blur",onClick:d,get children(){return a(x,{class:"size-4"})}}),null),l(o,c,null),o})()},get children(){return a(f,{orientation:"horizontal",get children(){return[a(u,{get defaultSize(){return e.sidebarWidth},get"data-min-size"(){return String(e.sidebarMinWidth)},get"data-max-size"(){return String(e.sidebarMaxWidth)},get children(){return a(k,{get groups(){return e.groups},get conversations(){return e.conversations},get activeId(){return e.activeId},onSelect:o=>r("kai-conversation-select",{id:o}),onNewChat:()=>r("kai-new-chat",{}),onToggleSidebar:d})}}),a(C,{withHandle:!0}),a(u,{children:c})]}})}})),t})()});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{q as u,a as n,l as d,p as h,c as m}from"./chunks/cn-Dogu6PbV.js";import{C as v}from"./chunks/chat-thread-RT808iPf.js";u("kai-chat",{messages:[],value:void 0,placeholder:"Send a message...",loading:!1,suggestions:void 0,suggestionMode:"submit",persistSuggestions:!1,proseSize:"sm",codeTheme:"github-dark-dimmed",codeHighlight:!0,chatTitle:void 0,models:void 0,currentModel:void 0,context:void 0,scrollButton:!0,search:!1,voice:!1,slashCommands:void 0,slashActiveIds:void 0,slashCompact:!1,actionsReveal:"always"},(e,{dispatch:s,flag:o,element:r})=>{const[i,g]=n(!1),[l,c]=n(!1);return d(()=>{const t=()=>{g(!!r.querySelector(':scope > [slot="header-start"]')),c(!!r.querySelector(':scope > [slot="header-end"]'))};t();const a=new MutationObserver(t);a.observe(r,{childList:!0}),h(()=>a.disconnect())}),m(v,{get messages(){return e.messages},get value(){return e.value},get placeholder(){return e.placeholder},get loading(){return o("loading")},get suggestions(){return e.suggestions},get suggestionMode(){return e.suggestionMode},get persistSuggestions(){return o("persistSuggestions")},get proseSize(){return e.proseSize},get codeTheme(){return e.codeTheme},get codeHighlight(){return o("codeHighlight")},get chatTitle(){return e.chatTitle},get models(){return e.models},get currentModel(){return e.currentModel},get context(){return e.context},get scrollButton(){return e.scrollButton!==!1},get search(){return o("search")},get voice(){return o("voice")},get slashCommands(){return e.slashCommands},get slashActiveIds(){return e.slashActiveIds},get slashCompact(){return o("slashCompact")},get actionsReveal(){return e.actionsReveal},onValueChange:t=>s("kai-value-change",{value:t}),onSubmit:t=>s("kai-submit",t),onSuggestionClick:t=>s("kai-suggestion-click",{value:t}),onModelChange:t=>s("kai-model-change",{modelId:t}),onMessageAction:t=>s("kai-message-action",t),onSearch:()=>s("kai-search",{}),onVoice:()=>s("kai-voice",{}),onSlashSelect:t=>s("kai-slash-select",{command:t}),get headerStart(){return i()},get headerEnd(){return l()}})});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{s as u,f as g,m as h,j as i,t as l,c as n,S as s,h as d,g as v,i as o,q as p,n as f}from"./chunks/cn-Dogu6PbV.js";import{B as k}from"./chunks/button-CKyYD9G4.js";import{T as b}from"./chunks/tooltip-DwKAz4XR.js";var m=l("<div role=separator>");function w(r){const[t,a]=u(r,["orientation","class"]),e=()=>t.orientation==="vertical";return(()=>{var c=m();return g(c,h({get class(){return i("shrink-0 bg-border",e()?"h-full w-px":"h-px w-full",t.class)}},a),!1,!1),c})()}var z=l("<div>"),x=l('<svg width=16 height=16 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2><path d="M19 21l-7-5-7 5V5a2 2 0 012-2h10a2 2 0 012 2z">');function C(r){const[t,a]=u(r,["class","children"]);return(()=>{var e=z();return g(e,h({get class(){return i("flex items-center gap-0.5 overflow-hidden text-muted-foreground",t.class)}},a),!1,!0),o(e,()=>t.children,null),o(e,n(w,{}),null),e})()}function B(r){return n(s,{get when(){return!r.children},get fallback(){return r.children},get children(){var t=x();return d(()=>v(t,"class",i("size-4 shrink-0",r.class))),t}})}function j(r){const t=()=>r.variant??"ghost",a=()=>r.size??"sm",e=()=>n(k,{get variant(){return t()},get size(){return a()},type:"button",get"aria-label"(){return r["aria-label"]},get onClick(){return r.onClick},get class(){return r.class},get children(){return r.children}});return n(s,{get when(){return r.tooltip},get fallback(){return e()},get children(){return n(b,{get content(){return r.tooltip},get children(){return e()}})}})}var q=l("<span class=ml-1.5>");p("kai-checkpoint",{label:void 0,tooltip:void 0,variant:"ghost",size:"sm"},(r,{dispatch:t})=>n(C,{get children(){return n(j,{get tooltip(){return r.tooltip},get"aria-label"(){return f(()=>!!r.label)()?void 0:r.tooltip??"Checkpoint"},get variant(){return r.variant},get size(){return r.size},onClick:()=>t("kai-select"),get children(){return[n(B,{}),n(s,{get when(){return r.label},get children(){var a=q();return o(a,()=>r.label),a}})]}})}}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as ue,m as pe,s as ge,y as me,e as x,a as q,b as F,o as V,c as l,E as ve,S as b,i as p,g as m,F as he,h as w,u as W,k as M,j as T,t as v,z as fe,n as R,q as be}from"./chunks/cn-Dogu6PbV.js";import{B as Y}from"./chunks/button-CKyYD9G4.js";import{H as ye}from"./chunks/hover-card-CIGw62gP.js";import{C as H}from"./chunks/card-Cjho-PYk.js";import{u as xe,a as ke,D as we}from"./chunks/use-card-resolution-D-_0Alzy.js";import{e as Ie}from"./chunks/card-routing-C986KuUA.js";import{x as Ae}from"./chunks/x-CzxL27Ch.js";import{c as $e}from"./chunks/check-CDYaMYrM.js";var De=v('<p class="text-sm text-foreground">'),Ce=v('<div role=radiogroup class="divide-y divide-border overflow-hidden rounded-lg border border-input">'),Re=v('<div class="flex flex-col gap-2"><label class=sr-only></label><input type=text class="w-full rounded-md border border-input bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring">'),je=v('<div class="flex w-full flex-wrap items-center justify-between gap-2">'),Se=v("<div>"),Ee=v('<span class="inline-flex items-center rounded-full bg-[var(--color-primary)] px-1.5 py-0.5 text-[0.625rem] font-medium uppercase leading-none tracking-wide text-[var(--color-primary-foreground,white)]">Recommended'),Le=v("<img>"),_e=v('<span aria-hidden=true class="flex h-9 w-9 shrink-0 items-center justify-center rounded-md bg-muted text-sm font-medium text-muted-foreground">'),Me=v('<img class="max-h-80 max-w-80 rounded-md object-contain">'),Te=v('<span class="h-2 w-2 rounded-full bg-[var(--color-primary)]">'),ze=v('<span class="text-xs font-normal text-muted-foreground">'),Oe=v('<span class="ml-auto shrink-0 text-xs font-normal text-muted-foreground">'),qe=v('<div role=radio><span aria-hidden=true></span><span class="flex min-w-0 flex-col gap-0.5"><span class="flex items-center gap-2"><span class=truncate>'),Fe=v("<span>"),He=v('<span class="ml-auto text-xs font-normal text-muted-foreground">'),Pe=v('<div class="flex items-center gap-3 rounded-lg border border-input bg-accent px-3 py-2.5 text-sm font-medium text-accent-foreground">'),Be=v("<span>Other: ");const Ue="choice",A="__other__",P="Other\u2026";function Ge(e){if(!Array.isArray(e)||e.length===0)return{options:[],error:"This card couldn't be displayed."};const i=new Set,t=[];for(const s of e){if(!s||typeof s!="object")continue;const o=s;if(typeof o.id!="string"||o.id.length===0||typeof o.label!="string"||o.label.length===0)continue;if(i.has(o.id)){console.warn(`[kai-choice] duplicate option id "${o.id}" ignored`);continue}i.add(o.id);const u=o.media&&typeof o.media=="object"?{image:typeof o.media.image=="string"?o.media.image:void 0,imageAlt:typeof o.media.imageAlt=="string"?o.media.imageAlt:void 0,icon:typeof o.media.icon=="string"?o.media.icon:void 0}:void 0;t.push({id:o.id,label:o.label,description:typeof o.description=="string"?o.description:void 0,media:u,meta:typeof o.meta=="string"?o.meta:void 0,recommended:o.recommended===!0,disabled:o.disabled===!0,payload:o.payload})}return t.length===0?{options:[],error:"This card couldn't be displayed."}:{options:t}}function Je(e){return e?e===!0?{label:P,placeholder:void 0}:typeof e=="object"?{label:typeof e.label=="string"&&e.label.length>0?e.label:P,placeholder:typeof e.placeholder=="string"?e.placeholder:void 0}:null:null}function X(e,i,t){const s=e.length;if(s===0)return i;for(let o=1;o<=s;o+=1){const u=((i+t*o)%s+s)%s;if(!e[u].disabled)return u}return i}function Z(e){return e.findIndex(i=>!i.disabled)}function Ke(e){const i=pe({cardId:"kai-choice"},e),[t]=ge(i,["data","cardId","heading","host","hostElement","class","resolution"]),s=xe(),o=me(),u=r=>{const n=t.host??s;n?n.emit(r):t.hostElement&&Ie(t.hostElement,r)},a=x(()=>{var r;return Ge((r=t.data)==null?void 0:r.options)}),f=x(()=>a().error===void 0),I=x(()=>a().error??""),y=x(()=>a().options),$=x(()=>{var r;return Je((r=t.data)==null?void 0:r.allowOther)}),D=x(()=>{const r=$();return r?[...y(),{id:A,label:r.label}]:y()}),g=ke({prop:()=>t.resolution,data:()=>t.data}),j=x(()=>{const r=g.resolution();return r&&r.kind==="action"?r.action:void 0}),[B,C]=q(0),[S,U]=q(void 0),[z,G]=q("");let E,L;const ee=x(()=>S()===A);F(V(()=>t.data,()=>{U(void 0),G(""),C(Math.max(0,Z(D())))}));const re=x(()=>{var r;const n=g.resolution();return!n||n.kind!=="action"?void 0:n.action===A?{other:!0,text:((r=n.payload)==null?void 0:r.text)??""}:{other:!1,opt:y().find(c=>c.id===n.action),id:n.action}});F(V(f,r=>{u(r?{kind:"ready",cardId:t.cardId}:{kind:"error",cardId:t.cardId,message:I()})})),F(()=>{const r=t.hostElement;if(!r)return;const n=j();n!==void 0?r.setAttribute("data-kai-resolved",n):r.removeAttribute("data-kai-resolved")});const te=r=>r.id===A,J=r=>{g.isResolved()||r.disabled||(U(r.id),te(r)&&queueMicrotask(()=>L?.focus()))},ne=x(()=>{if(g.isResolved())return!1;const r=S();return r===void 0?!1:r===A?z().trim().length>0:!0}),ie=()=>{var r;return((r=t.data)==null?void 0:r.submitLabel)??"Submit"},K=()=>{if(g.isResolved())return;const r=S();if(r===void 0)return;if(r===A){const c=z().trim();if(c.length===0)return;u({kind:"action",cardId:t.cardId,action:A,payload:{text:c}}),g.setLocal({kind:"action",action:A,payload:{text:c}});return}const n=y().find(c=>c.id===r);n&&(u({kind:"action",cardId:t.cardId,action:n.id,...n.payload!==void 0?{payload:n.payload}:{}}),g.setLocal({kind:"action",action:n.id,...n.payload!==void 0?{payload:n.payload}:{}}))},oe=()=>{g.isResolved()||(u({kind:"dismiss",cardId:t.cardId}),g.setLocal({kind:"dismissed"}))},ae=()=>u({kind:"reopen",cardId:t.cardId}),O=r=>{var n;const c=E?.querySelectorAll('[role="radio"]');(n=c?.[r])==null||n.focus()},de=r=>{if(g.isResolved())return;const n=D(),c=B();if(r.key==="ArrowDown"||r.key==="ArrowRight"){r.preventDefault();const d=X(n,c,1);C(d),O(d)}else if(r.key==="ArrowUp"||r.key==="ArrowLeft"){r.preventDefault();const d=X(n,c,-1);C(d),O(d)}else if(r.key==="Home"){r.preventDefault();const d=Math.max(0,Z(n));C(d),O(d)}else if(r.key===" "||r.key==="Enter"){r.preventDefault();const d=n[c];d&&J(d)}},le=()=>{var r;return t.heading??((r=t.data)==null?void 0:r.prompt)??"Choose an option"},N=`kai-choice-prompt-${o}`,Q=`kai-choice-other-${o}`;return l(b,{get when(){return f()},get fallback(){return l(H,{get heading(){return t.heading},get errorMessage(){return I()}})},get children(){return l(ve,{fallback:()=>(u({kind:"error",cardId:t.cardId,message:"The card failed to render."}),l(H,{get heading(){return t.heading},errorMessage:"The card failed to render."})),get children(){return l(b,{get when(){return!g.isDeferred()},get fallback(){return l(we,{type:Ue,get title(){return t.heading},onReopen:ae})},get children(){return l(H,{get heading(){return t.heading},get children(){var r=Se();return p(r,l(b,{get when(){var n;return(n=t.data)==null?void 0:n.prompt},get children(){var n=De();return m(n,"id",N),p(n,()=>{var c;return(c=t.data)==null?void 0:c.prompt}),n}}),null),p(r,l(b,{get when(){return!g.isResolved()},get fallback(){return l(Ye,{get choice(){return re()},get optimistic(){return g.isOptimistic()}})},get children(){return[(()=>{var n=Ce();n.$$keydown=de;var c=E;return typeof c=="function"?W(c,n):E=n,p(n,l(he,{get each(){return D()},children:(d,k)=>{const h=()=>S()===d.id,_=()=>!d.disabled&&k()===B()&&!g.isResolved(),se=`kai-choice-desc-${o}-${d.id}`,ce=()=>!!d.description;return l(We,{opt:d,get checked(){return h()},get tabStop(){return _()},descId:se,get hasDesc(){return ce()},onPick:()=>{C(k()),J(d)},onFocus:()=>C(k())})}})),w(d=>{var k,h=le(),_=(k=t.data)!=null&&k.prompt?N:void 0;return h!==d.e&&m(n,"aria-label",d.e=h),_!==d.t&&m(n,"aria-describedby",d.t=_),d},{e:void 0,t:void 0}),n})(),l(b,{get when(){return ee()},get children(){var n=Re(),c=n.firstChild,d=c.nextSibling;m(c,"for",Q),p(c,()=>{var h;return((h=$())==null?void 0:h.label)??P}),d.$$keydown=h=>{h.key==="Enter"&&(h.preventDefault(),K())},d.$$input=h=>G(h.currentTarget.value);var k=L;return typeof k=="function"?W(k,d):L=d,m(d,"id",Q),w(()=>{var h;return m(d,"placeholder",(h=$())==null?void 0:h.placeholder)}),w(()=>d.value=z()),n}}),(()=>{var n=je();return p(n,l(b,{get when(){var c;return((c=t.data)==null?void 0:c.dismissible)===!0},get children(){return l(Y,{type:"button",variant:"ghost",size:"icon-sm","aria-label":"Dismiss",onClick:oe,get children(){return l(Ae,{size:16,"aria-hidden":"true"})}})}}),null),p(n,l(Y,{type:"button",class:"ml-auto",get disabled(){return!ne()},onClick:K,get children(){return ie()}}),null),n})()]}}),null),w(()=>M(r,T("flex flex-col gap-3",t.class))),r}})}})}})}})}function Ne(){return Ee()}function Qe(e){return(()=>{var i=Le();return w(t=>{var s=e.media.image,o=e.media.imageAlt??"",u=T("shrink-0 rounded-md object-cover",e.class);return s!==t.e&&m(i,"src",t.e=s),o!==t.t&&m(i,"alt",t.t=o),u!==t.a&&M(i,t.a=u),t},{e:void 0,t:void 0,a:void 0}),i})()}function Ve(e){return(()=>{var i=_e();return p(i,()=>e.name.slice(0,2)),i})()}function We(e){return(()=>{var i=qe(),t=i.firstChild,s=t.nextSibling,o=s.firstChild,u=o.firstChild;return fe(i,"focus",e.onFocus),i.$$click=()=>!e.opt.disabled&&e.onPick(),p(i,l(b,{get when(){var a;return(a=e.opt.media)==null?void 0:a.image},get children(){return l(ye,{openDelay:150,class:"p-1 w-auto",placement:"right-start",get trigger(){return l(Qe,{get media(){return e.opt.media},class:"h-9 w-9"})},get children(){var a=Me();return w(f=>{var I=e.opt.media.image,y=e.opt.media.imageAlt??"";return I!==f.e&&m(a,"src",f.e=I),y!==f.t&&m(a,"alt",f.t=y),f},{e:void 0,t:void 0}),a}})}}),t),p(i,l(b,{get when(){var a;return R(()=>{var f;return!((f=e.opt.media)!=null&&f.image)})()&&((a=e.opt.media)==null?void 0:a.icon)},get children(){return l(Ve,{get name(){return e.opt.media.icon}})}}),t),p(t,l(b,{get when(){return e.checked},get children(){return Te()}})),p(u,()=>e.opt.label),p(o,l(b,{get when(){return e.opt.recommended},get children(){return l(Ne,{})}}),null),p(s,l(b,{get when(){return e.opt.description},get children(){var a=ze();return p(a,()=>e.opt.description),w(()=>m(a,"id",e.descId)),a}}),null),p(i,l(b,{get when(){return e.opt.meta},get children(){var a=Oe();return p(a,()=>e.opt.meta),a}}),null),w(a=>{var f=e.checked,I=e.opt.disabled?"true":void 0,y=e.hasDesc?e.descId:void 0,$=e.opt.id,D=e.opt.disabled?-1:e.tabStop?0:-1,g=T("flex items-center gap-3 px-3 py-2.5 text-sm outline-none transition-colors focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring",e.opt.disabled?"cursor-not-allowed opacity-60 text-foreground":"cursor-pointer hover:bg-muted/50",e.checked?"bg-accent font-medium text-accent-foreground":"text-foreground"),j=T("flex h-[1.125rem] w-[1.125rem] shrink-0 items-center justify-center rounded-full border-[1.5px] transition-colors",e.checked?"border-[var(--color-primary)]":"border-input bg-background");return f!==a.e&&m(i,"aria-checked",a.e=f),I!==a.t&&m(i,"aria-disabled",a.t=I),y!==a.a&&m(i,"aria-describedby",a.a=y),$!==a.o&&m(i,"data-option-id",a.o=$),D!==a.i&&m(i,"tabindex",a.i=D),g!==a.n&&M(i,a.n=g),j!==a.s&&M(t,a.s=j),a},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0}),i})()}function Ye(e){const i=e.choice;return(()=>{var t=Pe();return p(t,l($e,{size:16,"aria-hidden":"true"}),null),p(t,l(b,{get when(){return!i.other},get fallback(){return(()=>{var s=Be();return s.firstChild,p(s,(()=>{var o=R(()=>!!i.other);return()=>o()?i.text:""})(),null),s})()},get children(){return[(()=>{var s=Fe();return p(s,(()=>{var o=R(()=>!i.other);return()=>{var u;return o()?((u=i.opt)==null?void 0:u.label)??i.id:""}})()),s})(),l(b,{get when(){var s;return R(()=>!i.other)()&&((s=i.opt)==null?void 0:s.meta)},get children(){var s=He();return p(s,(()=>{var o=R(()=>!i.other);return()=>{var u;return o()?(u=i.opt)==null?void 0:u.meta:""}})()),s}})]}}),null),w(()=>m(t,"role",e.optimistic?"status":void 0)),t})()}ue(["keydown","input","click"]),be("kai-choice",{data:void 0,cardId:void 0,heading:void 0,resolution:void 0},(e,{element:i})=>l(Ke,{get data(){return e.data},get cardId(){return e.cardId??(i.id||"kai-choice")},get heading(){return e.heading},get resolution(){return e.resolution},hostElement:i}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{s as d,f as h,m as i,n as u,i as c,c as n,D as k,F as g,t as w}from"./cn-Dogu6PbV.js";var m={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"},t=m,v=w("<svg>"),p=r=>r.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),b=(...r)=>r.filter((e,s,o)=>!!e&&o.indexOf(e)===s).join(" "),f=r=>{const[e,s]=d(r,["color","size","strokeWidth","children","class","name","iconNode","absoluteStrokeWidth"]);return(()=>{var o=v();return h(o,i(t,{get width(){return e.size??t.width},get height(){return e.size??t.height},get stroke(){return e.color??t.stroke},get"stroke-width"(){return u(()=>!!e.absoluteStrokeWidth)()?Number(e.strokeWidth??t["stroke-width"])*24/Number(e.size):Number(e.strokeWidth??t["stroke-width"])},get class(){return b("lucide","lucide-icon",e.name!=null?`lucide-${p(e?.name)}`:void 0,e.class!=null?e.class:"")}},s),!0,!0),c(o,n(g,{get each(){return e.iconNode},children:([l,a])=>n(k,i({component:l},a))})),o})()},z=f;export{z as I};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{I as a}from"./Icon-D_Zmwmwh.js";import{c as o,m as i}from"./cn-Dogu6PbV.js";import{c as r}from"./check-CDYaMYrM.js";import{d as y}from"./download-D8K0Je8r.js";import{l as c}from"./link-BlGSeoPy.js";import{s as t}from"./star-t9tI-P0q.js";import{a as k,t as n}from"./thumbs-up-BBtguGld.js";import{x as p}from"./x-CzxL27Ch.js";var m=[["path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z",key:"1fy3hk"}]],h=e=>o(a,i(e,{name:"Bookmark",iconNode:m})),d=h,l=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],s=e=>o(a,i(e,{name:"Copy",iconNode:l})),x=s,f=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],v=e=>o(a,i(e,{name:"Ellipsis",iconNode:f})),M=v,N=[["path",{d:"M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1z",key:"i9b6wo"}],["line",{x1:"4",x2:"4",y1:"22",y2:"15",key:"1cm3nv"}]],u=e=>o(a,i(e,{name:"Flag",iconNode:N})),g=u,w=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],z=e=>o(a,i(e,{name:"Pencil",iconNode:w})),V=z,j=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],L=e=>o(a,i(e,{name:"RefreshCw",iconNode:j})),b=L,C=[["polyline",{points:"9 17 4 12 9 7",key:"hvgpf2"}],["path",{d:"M20 18v-2a4 4 0 0 0-4-4H4",key:"5vmcpk"}]],H=e=>o(a,i(e,{name:"Reply",iconNode:C})),R=H,B=[["path",{d:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8",key:"1b2hhj"}],["polyline",{points:"16 6 12 2 8 6",key:"m901s6"}],["line",{x1:"12",x2:"12",y1:"2",y2:"15",key:"1p0rca"}]],E=e=>o(a,i(e,{name:"Share",iconNode:B})),I=E,P=[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]],T=e=>o(a,i(e,{name:"Trash2",iconNode:P})),q=T;const D={copy:x,like:n,dislike:k,regenerate:b,edit:V,share:I,bookmark:d,download:y,link:c,trash:q,check:r,x:p,star:t,flag:g,reply:R,more:M};function F(e){if(e)return D[e]}const J={copy:"Copy",like:"Like",dislike:"Dislike",regenerate:"Regenerate",edit:"Edit"};export{J as B,F as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as a,m as u,s as p,f,j as d,i as g,S as w,n as I,t as m,v as R,w as M,h as z,g as y}from"./cn-Dogu6PbV.js";import{B as P}from"./button-CKyYD9G4.js";import{a as S,b as B,c as E}from"./hover-card-CIGw62gP.js";import{x as G}from"./x-CzxL27Ch.js";import{f as L}from"./file-text-DnaYk3Dm.js";import{I as b}from"./Icon-D_Zmwmwh.js";import{v as V}from"./video-mVYiM99-.js";var q=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],F=e=>a(b,u(e,{name:"Globe",iconNode:q})),A=F,H=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],J=e=>a(b,u(e,{name:"Image",iconNode:H})),K=J,O=[["circle",{cx:"8",cy:"18",r:"4",key:"1fc0mg"}],["path",{d:"M12 18V2l7 4",key:"g04rme"}]],Q=e=>a(b,u(e,{name:"Music2",iconNode:O})),U=Q,X=[["path",{d:"m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48",key:"1u3ebp"}]],Y=e=>a(b,u(e,{name:"Paperclip",iconNode:X})),N=Y,x=m("<div>"),Z=m('<img class="size-full object-cover"height=96 width=96>'),_=m('<img class="size-full rounded object-cover"height=20 width=20>'),$=m('<video class="size-full object-cover"muted>'),ee=m('<span class="text-muted-foreground text-caption block truncate">'),te=m('<div><span class="block truncate">'),re=m("<span class=sr-only>");const ae={audio:U,document:L,image:K,source:A,unknown:N,video:V},j=e=>{if(e.type==="source-document")return"source";const r=e.mediaType??"";return r.startsWith("image/")?"image":r.startsWith("video/")?"video":r.startsWith("audio/")?"audio":r.startsWith("application/")||r.startsWith("text/")?"document":"unknown"},T=e=>{if(e.type==="source-document")return e.title||e.filename||"Source";const r=j(e);return e.filename||(r==="image"?"Image":"Attachment")},W=R(),D=R(),ne=()=>M(W)??{variant:"grid"},C=()=>{const e=M(D);if(!e)throw new Error("Attachment components must be used within <Attachment>");return e};function ie(e){const[r,i]=p(e,["variant","class","children"]),t=()=>r.variant??"grid";return a(W.Provider,{value:{get variant(){return t()}},get children(){var n=x();return f(n,u({get class(){return d("flex items-start",t()==="list"?"flex-col gap-2":"flex-wrap gap-2",t()==="grid"&&"w-fit",r.class)}},i),!1,!0),g(n,()=>r.children),n}})}function se(e){const[r,i]=p(e,["data","onRemove","class","children"]),t=ne(),n=()=>j(r.data);return a(D.Provider,{value:{get data(){return r.data},get mediaCategory(){return n()},get onRemove(){return r.onRemove},get variant(){return t.variant}},get children(){var o=x();return f(o,u({get class(){return d("group relative",t.variant==="grid"&&"size-24 overflow-hidden rounded-lg",t.variant==="inline"&&["flex h-8 cursor-pointer select-none items-center gap-1.5","rounded-md bg-muted/50 px-1.5 text-foreground","font-medium text-sm transition-all","hover:bg-muted"],t.variant==="list"&&["flex w-full items-center gap-3 rounded-lg bg-muted/30 p-3 text-foreground","hover:bg-muted/50"],r.class)}},i),!1,!0),g(o,()=>r.children),o}})}function oe(e){const[r,i]=p(e,["fallbackIcon","class"]),t=C(),n=()=>t.variant==="inline"?"size-3":"size-4",o=c=>a(c,{get class(){return d(n(),"text-muted-foreground")}}),k=()=>{if(t.mediaCategory==="image"&&t.data.type==="file"&&t.data.url)return t.variant==="grid"?(()=>{var l=Z();return z(s=>{var v=t.data.filename||"Image",h=t.data.url;return v!==s.e&&y(l,"alt",s.e=v),h!==s.t&&y(l,"src",s.t=h),s},{e:void 0,t:void 0}),l})():(()=>{var l=_();return z(s=>{var v=t.data.filename||"Image",h=t.data.url;return v!==s.e&&y(l,"alt",s.e=v),h!==s.t&&y(l,"src",s.t=h),s},{e:void 0,t:void 0}),l})();if(t.mediaCategory==="video"&&t.data.type==="file"&&t.data.url)return(()=>{var l=$();return z(()=>y(l,"src",t.data.url)),l})();const c=ae[t.mediaCategory];return r.fallbackIcon??o(c)};return(()=>{var c=x();return f(c,u({get class(){return d("flex shrink-0 items-center justify-center overflow-hidden",t.variant==="grid"&&"size-full bg-muted",t.variant==="inline"&&"size-5 rounded bg-background",t.variant==="list"&&"size-12 rounded bg-muted",r.class)}},i),!1,!0),g(c,k),c})()}function ce(e){const[r,i]=p(e,["showMediaType","class"]),t=C(),n=()=>T(t.data);return a(w,{get when(){return t.variant!=="grid"},get children(){var o=te(),k=o.firstChild;return f(o,u({get class(){return d("min-w-0 flex-1",r.class)}},i),!1,!0),g(k,n),g(o,a(w,{get when(){return I(()=>!!(r.showMediaType&&t.variant==="list"))()&&t.data.mediaType},get children(){var c=ee();return g(c,()=>t.data.mediaType),c}}),null),o}})}function le(e){const r=C(),i=t=>{var n;t.stopPropagation(),(n=r.onRemove)==null||n.call(r)};return a(w,{get when(){return r.onRemove},get children(){return a(P,{get"aria-label"(){return e.label??"Remove"},get class(){return d(r.variant==="grid"&&["absolute top-2 right-2 size-6 rounded-full p-0","bg-background/80 backdrop-blur-sm","opacity-0 transition-opacity group-hover:opacity-100","hover:bg-background","[&>svg]:size-3"],r.variant==="inline"&&["size-5 rounded p-0","opacity-0 transition-opacity group-hover:opacity-100","[&>svg]:size-2.5"],r.variant==="list"&&["size-8 shrink-0 rounded p-0","[&>svg]:size-4"],e.class)},onClick:i,type:"button",variant:"ghost",get children(){return[I(()=>e.children??a(G,{})),(()=>{var t=re();return g(t,()=>e.label??"Remove"),t})()]}})}})}function ue(e){return a(S,{get openDelay(){return e.openDelay??0},get closeDelay(){return e.closeDelay??0},get children(){return e.children}})}function de(e){return a(B,{get class(){return e.class},get children(){return e.children}})}function ge(e){return a(E,{get class(){return d("w-auto p-2",e.class)},get children(){return e.children}})}function me(e){const[r,i]=p(e,["class","children"]);return(()=>{var t=x();return f(t,u({get class(){return d("flex items-center justify-center p-4 text-muted-foreground text-sm",r.class)}},i),!1,!0),g(t,()=>r.children??"No attachments"),t})()}export{ie as A,se as a,ue as b,de as c,oe as d,ce as e,ge as f,T as g,j as h,le as i,me as j,A as k,N as p};
|