@kitn.ai/ui 0.16.0 → 0.18.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 +55 -17
- package/dist/components/artifact.d.ts +39 -1
- package/dist/components/attachment-types.d.ts +12 -0
- package/dist/components/attachments.d.ts +2 -10
- package/dist/components/card.d.ts +27 -0
- package/dist/components/chain-of-thought.d.ts +78 -2
- package/dist/components/chat-scope-picker.d.ts +7 -0
- package/dist/components/chat-thread.d.ts +39 -16
- package/dist/components/choice-card.d.ts +27 -0
- package/dist/components/coachmark.d.ts +49 -0
- package/dist/components/composer-dom.d.ts +35 -0
- package/dist/components/composer-highlight.d.ts +48 -0
- package/dist/components/composer-history.d.ts +34 -0
- package/dist/components/composer.d.ts +86 -0
- package/dist/components/confirm-card.d.ts +17 -0
- package/dist/components/conversation-item.d.ts +9 -0
- package/dist/components/conversation-list.d.ts +36 -1
- package/dist/components/dismissed-stub.d.ts +22 -0
- package/dist/components/file-tree.d.ts +15 -0
- package/dist/components/form.d.ts +34 -0
- package/dist/components/markdown.d.ts +3 -0
- package/dist/components/message.d.ts +71 -2
- package/dist/components/model-switcher.d.ts +7 -0
- package/dist/components/prompt-input.d.ts +13 -4
- package/dist/components/prompt-suggestion.d.ts +9 -1
- package/dist/components/reasoning.d.ts +14 -1
- package/dist/components/response-compare-types.d.ts +66 -0
- package/dist/components/response-compare.d.ts +65 -0
- package/dist/components/screen.d.ts +46 -0
- package/dist/components/tasks-card.d.ts +50 -1
- package/dist/components/toast.d.ts +58 -0
- package/dist/components/tool-types.d.ts +10 -0
- package/dist/components/tool.d.ts +8 -8
- package/dist/components/use-card-resolution.d.ts +10 -6
- package/dist/components/voice-input.d.ts +27 -0
- package/dist/components/voice-output.d.ts +33 -0
- package/dist/core-C8fzo39E.js +12 -0
- package/dist/custom-elements.json +8472 -1691
- package/dist/elements/agent-card.d.ts +1 -0
- package/dist/elements/agent-card.js +1 -0
- package/dist/elements/artifact.js +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/avatar.d.ts +1 -0
- package/dist/elements/avatar.js +1 -0
- package/dist/elements/badge.d.ts +1 -0
- package/dist/elements/badge.js +1 -0
- package/dist/elements/button.d.ts +1 -0
- package/dist/elements/button.js +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 +0 -12
- package/dist/elements/chain-of-thought.js +1 -0
- package/dist/elements/chat-scope-picker.js +1 -0
- package/dist/elements/chat-types.d.ts +8 -2
- package/dist/elements/chat-workspace.js +1 -0
- package/dist/elements/chat.js +1 -0
- package/dist/elements/checkpoint.js +1 -0
- package/dist/elements/choice.js +1 -0
- package/dist/elements/chunks/Icon-DLLBeLG5.js +1 -0
- package/dist/elements/chunks/action-icons-UB4V5FNq.js +1 -0
- package/dist/elements/chunks/arrow-left-C-gwlUmx.js +1 -0
- package/dist/elements/chunks/attachments-CgbErf1r.js +1 -0
- package/dist/elements/chunks/badge-DTQpgB6N.js +1 -0
- package/dist/elements/chunks/bash-InADTalH.js +1 -0
- package/dist/elements/chunks/button-XDUM6lXs.js +1 -0
- package/dist/elements/chunks/card-CBlFZ-7I.js +1 -0
- package/dist/elements/chunks/card-routing-C986KuUA.js +1 -0
- package/dist/elements/chunks/chat-thread-BIhmqwNL.js +1 -0
- package/dist/elements/chunks/check-hGUoVIKb.js +1 -0
- package/dist/elements/chunks/chevron-down-DDoaSUtO.js +1 -0
- package/dist/elements/chunks/chevron-right-CdGEUakB.js +1 -0
- package/dist/elements/chunks/circle-BKAZdmzb.js +1 -0
- package/dist/elements/chunks/circle-check-CmYG-y3I.js +1 -0
- package/dist/elements/chunks/circle-x-DewgAEym.js +1 -0
- package/dist/elements/chunks/cn-CU7UAWzk.js +1 -0
- package/dist/elements/chunks/code-block-DedwxwFI.js +1 -0
- package/dist/elements/chunks/collapsible-FfgmTHtM.js +1 -0
- package/dist/elements/chunks/composer-Cfbw5HKT.js +65 -0
- package/dist/elements/chunks/context-DwJmxlRE.js +1 -0
- package/dist/elements/chunks/conversation-list-DsCQMfPq.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-BuqsoENC.js +1 -0
- package/dist/elements/chunks/define-rGsaWsLL.js +1 -0
- package/dist/elements/chunks/disclosure-CwoAkpMH.js +1 -0
- package/dist/elements/chunks/download-DJ06G3Bz.js +1 -0
- package/dist/elements/chunks/dropdown-BFg8ri_R.js +1 -0
- package/dist/elements/chunks/ellipsis-dlN6YvGw.js +1 -0
- package/dist/elements/chunks/engine-javascript-vq0WuIJl.js +141 -0
- package/dist/elements/chunks/external-link-DBX2lc_R.js +1 -0
- package/dist/elements/chunks/file-text-HfwUx4F9.js +1 -0
- package/dist/elements/chunks/file-tree-C6Toj71u.js +1 -0
- package/dist/elements/chunks/folder-MYuqa9Xp.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-gE7iyXdW.js +1 -0
- package/dist/elements/chunks/html-CPZ3oZQ7.js +1 -0
- package/dist/elements/chunks/icon-Vqz4ivrY.js +1 -0
- package/dist/elements/chunks/index-BCRhi84a.js +1 -0
- package/dist/elements/chunks/info-B_toFS0l.js +1 -0
- package/dist/elements/chunks/input-gzbHYZvQ.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/kbd-n49c4KZm.js +1 -0
- package/dist/elements/chunks/link-CKPs9yM0.js +1 -0
- package/dist/elements/chunks/loader-q6MamGus.js +1 -0
- package/dist/elements/chunks/markdown-DBrcqq4S.js +64 -0
- package/dist/elements/chunks/message-CTqaYI0s.js +1 -0
- package/dist/elements/chunks/message-feedback-Cvzm03w0.js +1 -0
- package/dist/elements/chunks/message-square-CUg9eRCi.js +1 -0
- package/dist/elements/chunks/minimize-2-l2klxP6K.js +1 -0
- package/dist/elements/chunks/model-switcher-CmyjiHO1.js +1 -0
- package/dist/elements/chunks/overlay-C8sOYqjT.js +1 -0
- package/dist/elements/chunks/paperclip-42Ia7xHD.js +1 -0
- package/dist/elements/chunks/progress-bar-tzKMWAwO.js +1 -0
- package/dist/elements/chunks/prompt-suggestion-D3F6vP_A.js +1 -0
- package/dist/elements/chunks/reasoning-BJNmmyov.js +1 -0
- package/dist/elements/chunks/resizable-BRsk19qI.js +1 -0
- package/dist/elements/chunks/rotate-cw-BgcggLHC.js +1 -0
- package/dist/elements/chunks/scroll-area-CgGbFFbT.js +1 -0
- package/dist/elements/chunks/separator-8hM4GdHE.js +1 -0
- package/dist/elements/chunks/settings-CaUIYOg-.js +1 -0
- package/dist/elements/chunks/settings-group-CYjOVIZQ.js +1 -0
- package/dist/elements/chunks/share-BTYM3Ddt.js +1 -0
- package/dist/elements/chunks/skeleton-DsTYrPUe.js +1 -0
- package/dist/elements/chunks/slots-DkZ-Cmha.js +1 -0
- package/dist/elements/chunks/star-9R3LBQ9n.js +1 -0
- package/dist/elements/chunks/store-CYl5Y0_u.js +1 -0
- package/dist/elements/chunks/svelte--5p79yCD.js +1 -0
- package/dist/elements/chunks/text-shimmer-CaYGv8Se.js +1 -0
- package/dist/elements/chunks/textarea-NEr2SLcD.js +1 -0
- package/dist/elements/chunks/thumbs-up-DZYZkFfc.js +1 -0
- package/dist/elements/chunks/toast-store-ClxVZRcc.js +1 -0
- package/dist/elements/chunks/tool-CHZOmoe9.js +1 -0
- package/dist/elements/chunks/tooltip-WpHElELC.js +1 -0
- package/dist/elements/chunks/triangle-alert-BlS80PUg.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-VSVoxDeJ.js +1 -0
- package/dist/elements/chunks/video-DxTPZqT8.js +1 -0
- package/dist/elements/chunks/vue-BmIZj4XD.js +1 -0
- package/dist/elements/chunks/x-C1qtndxn.js +1 -0
- package/dist/elements/coachmark.d.ts +1 -0
- package/dist/elements/coachmark.js +1 -0
- package/dist/elements/code-block.js +1 -0
- package/dist/elements/command.d.ts +1 -0
- package/dist/elements/command.js +1 -0
- package/dist/elements/compare.d.ts +1 -0
- package/dist/elements/compare.js +1 -0
- package/dist/elements/composer.d.ts +1 -0
- package/dist/elements/composer.js +1 -0
- package/dist/elements/confirm-card.js +1 -0
- package/dist/elements/context-meter.js +1 -0
- package/dist/elements/conversation-list.d.ts +1 -11
- package/dist/elements/conversation-list.js +1 -0
- package/dist/elements/default-input.d.ts +20 -9
- package/dist/elements/define.d.ts +11 -0
- package/dist/elements/dialog.d.ts +1 -0
- package/dist/elements/dialog.js +1 -0
- package/dist/elements/disclosure.d.ts +37 -0
- package/dist/elements/editable-label.d.ts +1 -0
- package/dist/elements/editable-label.js +1 -0
- package/dist/elements/embed.js +1 -0
- package/dist/elements/empty.js +1 -0
- package/dist/elements/feedback-bar.js +1 -0
- package/dist/elements/file-tree.js +1 -0
- package/dist/elements/file-upload.js +1 -0
- package/dist/elements/form.js +1 -0
- package/dist/elements/hover-card.d.ts +1 -0
- package/dist/elements/hover-card.js +1 -0
- package/dist/elements/icon.d.ts +1 -0
- package/dist/elements/icon.js +1 -0
- package/dist/elements/image.js +1 -0
- package/dist/elements/input.d.ts +1 -0
- package/dist/elements/input.js +1 -0
- package/dist/elements/kbd.d.ts +1 -0
- package/dist/elements/kbd.js +1 -0
- package/dist/elements/link-preview.js +1 -0
- package/dist/elements/loader.js +1 -0
- package/dist/elements/markdown.js +1 -0
- package/dist/elements/menu.d.ts +1 -0
- package/dist/elements/menu.js +1 -0
- package/dist/elements/message-skills.d.ts +0 -16
- package/dist/elements/message-skills.js +1 -0
- package/dist/elements/message.js +1 -0
- package/dist/elements/model-switcher.d.ts +1 -11
- package/dist/elements/model-switcher.js +1 -0
- package/dist/elements/nav.d.ts +1 -0
- package/dist/elements/nav.js +1 -0
- package/dist/elements/notice.d.ts +1 -0
- package/dist/elements/notice.js +1 -0
- package/dist/elements/pane-group.d.ts +1 -0
- package/dist/elements/pane-group.js +1 -0
- package/dist/elements/pane.d.ts +1 -0
- package/dist/elements/pane.js +1 -0
- package/dist/elements/popover.js +1 -0
- package/dist/elements/progress-bar.d.ts +1 -0
- package/dist/elements/progress-bar.js +1 -0
- package/dist/elements/prompt-dock.d.ts +1 -0
- package/dist/elements/prompt-dock.js +1 -0
- package/dist/elements/prompt-input.d.ts +1 -9
- package/dist/elements/prompt-input.js +1 -0
- package/dist/elements/prompt-suggestions.d.ts +0 -6
- package/dist/elements/prompt-suggestions.js +1 -0
- package/dist/elements/reasoning.js +1 -0
- package/dist/elements/register.d.ts +10 -0
- package/dist/elements/remote.js +1 -0
- package/dist/elements/resizable.d.ts +1 -17
- package/dist/elements/resizable.js +1 -0
- package/dist/elements/response-stream.js +14 -0
- package/dist/elements/screen.d.ts +1 -0
- package/dist/elements/screen.js +1 -0
- package/dist/elements/scroll-area.d.ts +1 -0
- package/dist/elements/scroll-area.js +1 -0
- package/dist/elements/scroll-button.js +1 -0
- package/dist/elements/search.d.ts +1 -0
- package/dist/elements/search.js +1 -0
- package/dist/elements/segmented.d.ts +1 -0
- package/dist/elements/segmented.js +1 -0
- package/dist/elements/separator.d.ts +1 -0
- package/dist/elements/separator.js +1 -0
- package/dist/elements/setting-item.d.ts +1 -0
- package/dist/elements/setting-item.js +1 -0
- package/dist/elements/settings-group.d.ts +1 -0
- package/dist/elements/settings-group.js +1 -0
- package/dist/elements/skeleton.d.ts +1 -0
- package/dist/elements/skeleton.js +1 -0
- package/dist/elements/slots.d.ts +176 -0
- package/dist/elements/source.d.ts +0 -17
- package/dist/elements/source.js +1 -0
- package/dist/elements/status.d.ts +1 -0
- package/dist/elements/status.js +1 -0
- package/dist/elements/switch.js +1 -0
- package/dist/elements/tabs.d.ts +1 -0
- package/dist/elements/tabs.js +1 -0
- package/dist/elements/tasks.js +1 -0
- package/dist/elements/text-shimmer.js +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.js +1 -0
- package/dist/elements/tooltip.d.ts +1 -0
- package/dist/elements/tooltip.js +1 -0
- package/dist/elements/voice-input.js +1 -0
- package/dist/elements/voice-output.d.ts +1 -0
- package/dist/elements/voice-output.js +1 -0
- package/dist/elements.d.ts +772 -61
- package/dist/engine-javascript-C1x7zo1_.js +141 -0
- package/dist/index.d.ts +15 -2
- package/dist/index.js +14405 -9810
- package/dist/kai.es.js +1 -0
- package/dist/llms/llms-full.txt +1234 -107
- package/dist/llms/llms.txt +4 -4
- package/dist/mcp.es.js +217 -6
- package/dist/primitives/card-contract.d.ts +20 -4
- package/dist/primitives/card-recovery.d.ts +55 -0
- package/dist/primitives/composer-model.d.ts +22 -0
- package/dist/primitives/composer-triggers.d.ts +19 -0
- package/dist/primitives/create-kai-chat.d.ts +38 -0
- package/dist/primitives/message-feedback.d.ts +35 -0
- package/dist/primitives/toast-store.d.ts +118 -0
- package/dist/primitives/use-speech-recognition.d.ts +26 -0
- package/dist/react/index.d.ts +1166 -98
- package/dist/react/runtime.d.ts +9 -2
- package/dist/react/use-kai-chat.d.ts +41 -0
- package/dist/react.js +575 -186
- package/dist/register-impl-CYWGkgbI.js +141 -0
- package/dist/schemas/choice.schema.json +5 -0
- package/dist/schemas/tasks.schema.json +7 -2
- package/dist/state/index.d.ts +4 -0
- package/dist/state/messages.d.ts +11 -0
- package/dist/state/stream.d.ts +22 -0
- package/dist/state/suggestions.d.ts +4 -0
- package/dist/state.js +117 -0
- package/dist/theme.tokens.css +87 -0
- package/dist/types.d.ts +4 -0
- package/dist/ui/agent-card.d.ts +61 -0
- package/dist/ui/button.d.ts +5 -2
- package/dist/ui/card.d.ts +61 -0
- package/dist/ui/collapsible.d.ts +15 -1
- package/dist/ui/command.d.ts +33 -0
- package/dist/ui/dialog.d.ts +42 -0
- package/dist/ui/dropdown.d.ts +95 -1
- package/dist/ui/editable-label.d.ts +26 -0
- package/dist/ui/hover-card.d.ts +13 -1
- package/dist/ui/icon.d.ts +18 -0
- package/dist/ui/input.d.ts +33 -0
- package/dist/ui/kbd.d.ts +21 -0
- package/dist/ui/nav.d.ts +62 -0
- package/dist/ui/notice.d.ts +31 -0
- package/dist/ui/overlay.d.ts +12 -0
- package/dist/ui/pane-grid.d.ts +58 -0
- package/dist/ui/pane-group.d.ts +75 -0
- package/dist/ui/pane.d.ts +78 -0
- package/dist/ui/popover.d.ts +11 -1
- package/dist/ui/progress-bar.d.ts +23 -0
- package/dist/ui/prompt-dock.d.ts +96 -0
- package/dist/ui/resizable.d.ts +12 -0
- package/dist/ui/scroll-area.d.ts +4 -0
- package/dist/ui/segmented.d.ts +28 -0
- package/dist/ui/settings-group.d.ts +32 -0
- package/dist/ui/skeleton.d.ts +12 -0
- package/dist/ui/stat.d.ts +16 -0
- package/dist/ui/status.d.ts +13 -0
- package/dist/ui/switch.d.ts +8 -1
- package/dist/ui/tabs.d.ts +35 -0
- package/dist/ui/tooltip.d.ts +20 -1
- package/frameworks/react/index.tsx +1100 -163
- package/frameworks/react/runtime.tsx +30 -1
- package/frameworks/react/use-kai-chat.tsx +87 -0
- package/llms-full.txt +1234 -107
- package/llms.txt +4 -4
- package/package.json +36 -12
- package/src/agent-tooling/mcp/manifest.ts +14 -0
- package/src/agent-tooling/mcp/tools/debug.ts +194 -6
- package/src/agent-tooling/mcp/tools/reference.ts +32 -0
- package/src/agent-tooling/mcp/tools/scaffold.ts +162 -1
- package/src/components/artifact.tsx +98 -13
- package/src/components/attachment-types.ts +13 -0
- package/src/components/attachments.tsx +4 -14
- package/src/components/card.tsx +109 -15
- package/src/components/chain-of-thought.tsx +210 -1
- package/src/components/chat-scope-picker.tsx +13 -3
- package/src/components/chat-thread.tsx +238 -137
- package/src/components/choice-card.tsx +136 -15
- package/src/components/coachmark.tsx +245 -0
- package/src/components/component-meta.json +921 -108
- package/src/components/composer-dom.ts +159 -0
- package/src/components/composer-highlight.ts +242 -0
- package/src/components/composer-history.ts +82 -0
- package/src/components/composer.tsx +979 -0
- package/src/components/confirm-card.tsx +69 -2
- package/src/components/conversation-item.tsx +69 -7
- package/src/components/conversation-list.tsx +134 -37
- package/src/components/dismissed-stub.tsx +80 -0
- package/src/components/file-tree.tsx +197 -47
- package/src/components/form-widgets.tsx +9 -7
- package/src/components/form.tsx +161 -20
- package/src/components/image.tsx +3 -5
- package/src/components/link-preview.tsx +5 -4
- package/src/components/markdown.tsx +5 -2
- package/src/components/message.tsx +174 -14
- package/src/components/model-switcher.tsx +19 -4
- package/src/components/prompt-input.tsx +46 -75
- package/src/components/prompt-suggestion.tsx +48 -16
- package/src/components/reasoning.tsx +29 -6
- package/src/components/response-compare-types.ts +127 -0
- package/src/components/response-compare.tsx +460 -0
- package/src/components/screen.tsx +176 -0
- package/src/components/tasks-card.tsx +374 -23
- package/src/components/toast.tsx +486 -0
- package/src/components/tool-types.ts +10 -0
- package/src/components/tool.tsx +22 -16
- package/src/components/use-card-resolution.ts +24 -8
- package/src/components/voice-input.tsx +102 -19
- package/src/components/voice-output.tsx +202 -0
- package/src/elements/agent-card.tsx +67 -0
- package/src/elements/artifact.tsx +53 -4
- package/src/elements/attachments.tsx +1 -0
- package/src/elements/autoloader.ts +89 -0
- package/src/elements/avatar.tsx +33 -0
- package/src/elements/badge.tsx +32 -0
- package/src/elements/button.tsx +126 -0
- package/src/elements/card-media.jpg +0 -0
- package/src/elements/card.tsx +124 -31
- package/src/elements/cards.tsx +81 -7
- package/src/elements/chain-of-thought.tsx +77 -32
- package/src/elements/chat-scope-picker.tsx +35 -8
- package/src/elements/chat-types.ts +9 -2
- package/src/elements/chat-workspace.tsx +157 -43
- package/src/elements/chat.tsx +49 -25
- package/src/elements/choice.tsx +71 -19
- package/src/elements/coachmark.tsx +90 -0
- package/src/elements/command.tsx +209 -0
- package/src/elements/compare.tsx +110 -0
- package/src/elements/compiled.css +1 -1
- package/src/elements/composer.tsx +151 -0
- package/src/elements/confirm-card.tsx +36 -11
- package/src/elements/conversation-list.tsx +80 -11
- package/src/elements/default-input.tsx +75 -53
- package/src/elements/define.tsx +47 -6
- package/src/elements/dialog.tsx +98 -0
- package/src/elements/disclosure.ts +73 -0
- package/src/elements/editable-label.tsx +125 -0
- package/src/elements/element-manifest.json +310 -0
- package/src/elements/element-meta.json +5954 -1605
- package/src/elements/element-types.d.ts +771 -60
- package/src/elements/file-tree.tsx +12 -2
- package/src/elements/file-upload.tsx +1 -1
- package/src/elements/form.tsx +54 -11
- package/src/elements/hover-card.tsx +80 -0
- package/src/elements/icon-names.json +48 -0
- package/src/elements/icon.tsx +41 -0
- package/src/elements/input.tsx +203 -0
- package/src/elements/kbd.tsx +45 -0
- package/src/elements/menu.tsx +217 -0
- package/src/elements/message.tsx +84 -55
- package/src/elements/model-switcher.tsx +27 -1
- package/src/elements/nav.tsx +87 -0
- package/src/elements/notice.tsx +53 -0
- package/src/elements/pane-group.tsx +119 -0
- package/src/elements/pane.tsx +129 -0
- package/src/elements/popover.tsx +39 -17
- package/src/elements/progress-bar.tsx +39 -0
- package/src/elements/prompt-dock.tsx +81 -0
- package/src/elements/prompt-input.tsx +112 -63
- package/src/elements/prompt-suggestions.tsx +25 -9
- package/src/elements/reasoning.tsx +30 -9
- package/src/elements/register-impl.ts +41 -3
- package/src/elements/register.ts +20 -3
- package/src/elements/remote.tsx +4 -0
- package/src/elements/resizable.tsx +48 -11
- package/src/elements/screen.tsx +90 -0
- package/src/elements/scroll-area.tsx +33 -0
- package/src/elements/search.tsx +180 -0
- package/src/elements/segmented.tsx +135 -0
- package/src/elements/separator.tsx +36 -0
- package/src/elements/setting-item.tsx +50 -0
- package/src/elements/settings-group.tsx +37 -0
- package/src/elements/skeleton.tsx +45 -0
- package/src/elements/slots.ts +607 -0
- package/src/elements/source.tsx +13 -6
- package/src/elements/status.tsx +42 -0
- package/src/elements/styles.css +19 -0
- package/src/elements/switch.tsx +89 -14
- package/src/elements/tabs.tsx +95 -0
- package/src/elements/tasks.tsx +70 -14
- package/src/elements/toast.tsx +89 -0
- package/src/elements/tool.tsx +43 -9
- package/src/elements/tooltip.tsx +85 -0
- package/src/elements/video-poster.jpg +0 -0
- package/src/elements/voice-input.tsx +66 -16
- package/src/elements/voice-output.tsx +69 -0
- package/src/index.ts +35 -2
- 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 +7 -2
- package/src/primitives/composer-model.ts +49 -0
- package/src/primitives/composer-triggers.ts +35 -0
- package/src/primitives/create-kai-chat.ts +66 -0
- package/src/primitives/message-feedback.ts +123 -0
- package/src/primitives/toast-store.ts +276 -0
- package/src/primitives/use-speech-recognition.ts +135 -0
- package/src/state/index.ts +6 -0
- package/src/state/messages.ts +36 -0
- package/src/state/stream.ts +92 -0
- package/src/state/suggestions.ts +9 -0
- package/src/types.ts +4 -0
- package/src/ui/agent-card.tsx +212 -0
- package/src/ui/button.tsx +16 -5
- package/src/ui/card.tsx +245 -0
- package/src/ui/collapsible.tsx +30 -4
- package/src/ui/command.tsx +99 -0
- package/src/ui/dialog.tsx +217 -0
- package/src/ui/dropdown.tsx +375 -13
- package/src/ui/editable-label.tsx +112 -0
- package/src/ui/hover-card.tsx +28 -5
- package/src/ui/icon.tsx +110 -0
- package/src/ui/input.tsx +132 -0
- package/src/ui/kbd.tsx +118 -0
- package/src/ui/nav.tsx +282 -0
- package/src/ui/notice.tsx +84 -0
- package/src/ui/overlay.tsx +108 -2
- package/src/ui/pane-grid.tsx +116 -0
- package/src/ui/pane-group.tsx +280 -0
- package/src/ui/pane.tsx +193 -0
- package/src/ui/popover.tsx +16 -2
- package/src/ui/progress-bar.tsx +83 -0
- package/src/ui/prompt-dock.tsx +145 -0
- package/src/ui/resizable.tsx +69 -1
- package/src/ui/scroll-area.tsx +14 -3
- package/src/ui/segmented.tsx +109 -0
- package/src/ui/settings-group.tsx +67 -0
- package/src/ui/skeleton.tsx +62 -5
- package/src/ui/stat.tsx +41 -0
- package/src/ui/status.tsx +48 -0
- package/src/ui/switch.tsx +49 -23
- package/src/ui/tabs.tsx +168 -0
- package/src/ui/tooltip.tsx +57 -7
- package/theme.css +113 -0
- package/dist/components/slash-command.d.ts +0 -15
- package/dist/kitn-chat.es.js +0 -1
- package/dist/register-impl-wCsFPoh9.js +0 -77
- package/dist/register-ujhr1nBS.js +0 -1
- package/src/components/slash-command.tsx +0 -232
- package/src/elements/framework-usage.json +0 -563
- /package/dist/{kitn-chat-provider.d.ts → kai-provider.d.ts} +0 -0
- /package/dist/{kitn-chat-provider.es.js → kai-provider.es.js} +0 -0
|
@@ -65,6 +65,11 @@
|
|
|
65
65
|
"allowOther": {
|
|
66
66
|
"description": "Optional free-text escape ('none of these / specify'). `true` appends a final 'Other…' option; an object customizes its `label`/`placeholder`. Selecting it reveals a text input; the shared Submit button then emits `{ kind:'action', action:'__other__', payload:{ text } }`.",
|
|
67
67
|
"x-kai-control": "allow-other"
|
|
68
|
+
},
|
|
69
|
+
"dismissible": {
|
|
70
|
+
"type": "boolean",
|
|
71
|
+
"default": false,
|
|
72
|
+
"description": "Show a close affordance that emits the `dismiss` verb. The card collapses to a re-openable 'dismissed' stub; the host decides via `onReopen` whether it comes back live or `expired`."
|
|
68
73
|
}
|
|
69
74
|
}
|
|
70
75
|
}
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
"properties": {
|
|
9
9
|
"mode": {
|
|
10
10
|
"type": "string",
|
|
11
|
-
"enum": ["select"],
|
|
11
|
+
"enum": ["select", "progress"],
|
|
12
12
|
"default": "select",
|
|
13
|
-
"description": "
|
|
13
|
+
"description": "'select' (default) = toggle + a confirm button that emits `submit`. 'progress' = an onboarding-checklist look (header `done / total` count, circular indicators, per-item title/description, no confirm button, where checking a row IS the action). Both share the selection model.",
|
|
14
14
|
"x-kai-mode": true
|
|
15
15
|
},
|
|
16
16
|
"heading": {
|
|
@@ -73,6 +73,11 @@
|
|
|
73
73
|
"minimum": 1,
|
|
74
74
|
"description": "Optional maximum selectable; further toggles are blocked once reached.",
|
|
75
75
|
"x-kai-select-max": true
|
|
76
|
+
},
|
|
77
|
+
"dismissible": {
|
|
78
|
+
"type": "boolean",
|
|
79
|
+
"default": false,
|
|
80
|
+
"description": "Show a close affordance that emits the `dismiss` verb. The card collapses to a re-openable 'dismissed' stub; the host decides via `onReopen` whether it comes back live or `expired`."
|
|
76
81
|
}
|
|
77
82
|
}
|
|
78
83
|
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { appendMessage, upsertMessage, updateMessage, removeMessage, appendContent } from './messages';
|
|
2
|
+
export { addSuggestion, removeSuggestion } from './suggestions';
|
|
3
|
+
export { createAssistantStream, onStreamSettled } from './stream';
|
|
4
|
+
export type { SetMessages, AssistantStream } from './stream';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ChatMessage } from '../elements/chat-types';
|
|
2
|
+
/** Append a message; returns a new array. */
|
|
3
|
+
export declare function appendMessage(messages: ChatMessage[], msg: ChatMessage): ChatMessage[];
|
|
4
|
+
/** Replace a same-id message, or append when absent. */
|
|
5
|
+
export declare function upsertMessage(messages: ChatMessage[], msg: ChatMessage): ChatMessage[];
|
|
6
|
+
/** Patch the matched message (object patch or updater). Untouched items keep their reference. */
|
|
7
|
+
export declare function updateMessage(messages: ChatMessage[], id: string, patch: Partial<ChatMessage> | ((m: ChatMessage) => ChatMessage)): ChatMessage[];
|
|
8
|
+
/** Remove the matched message. */
|
|
9
|
+
export declare function removeMessage(messages: ChatMessage[], id: string): ChatMessage[];
|
|
10
|
+
/** Streaming primitive: concatenate `delta` onto the matched message's content. */
|
|
11
|
+
export declare function appendContent(messages: ChatMessage[], id: string, delta: string): ChatMessage[];
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ChatMessage } from '../elements/chat-types';
|
|
2
|
+
import { ToolPart } from '../components/tool-types';
|
|
3
|
+
/** The one universal contract: a functional-updater setter (React setState shape). */
|
|
4
|
+
export type SetMessages = (updater: (prev: ChatMessage[]) => ChatMessage[]) => void;
|
|
5
|
+
/** A fluent builder for one in-flight assistant message. Owns no state. */
|
|
6
|
+
export interface AssistantStream {
|
|
7
|
+
readonly id: string;
|
|
8
|
+
appendText(delta: string): AssistantStream;
|
|
9
|
+
setText(content: string): AssistantStream;
|
|
10
|
+
appendReasoning(delta: string, label?: string): AssistantStream;
|
|
11
|
+
setReasoning(text: string, label?: string): AssistantStream;
|
|
12
|
+
upsertTool(tool: ToolPart): AssistantStream;
|
|
13
|
+
updateTool(toolCallId: string, patch: Partial<ToolPart>): AssistantStream;
|
|
14
|
+
patch(patch: Partial<ChatMessage>): AssistantStream;
|
|
15
|
+
done(final?: Partial<ChatMessage>): void;
|
|
16
|
+
abort(reason?: string): void;
|
|
17
|
+
}
|
|
18
|
+
/** Start an assistant message and drive it through `set`. New refs on every mutation. */
|
|
19
|
+
export declare function createAssistantStream(set: SetMessages, init?: Partial<ChatMessage>): AssistantStream;
|
|
20
|
+
/** Wrap a stream so `onSettle` fires on done/abort (used to toggle a `loading` flag).
|
|
21
|
+
* Preserves the fluent chain by returning the wrapper from every mutator. */
|
|
22
|
+
export declare function onStreamSettled(inner: AssistantStream, onSettle: () => void): AssistantStream;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** Append a suggestion; no-op when already present. Returns a new array. */
|
|
2
|
+
export declare function addSuggestion(suggestions: string[], s: string): string[];
|
|
3
|
+
/** Remove a suggestion by value. */
|
|
4
|
+
export declare function removeSuggestion(suggestions: string[], s: string): string[];
|
package/dist/state.js
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
function c(t, u) {
|
|
2
|
+
return [...t, u];
|
|
3
|
+
}
|
|
4
|
+
function f(t, u) {
|
|
5
|
+
const o = t.findIndex((d) => d.id === u.id);
|
|
6
|
+
if (o === -1) return [...t, u];
|
|
7
|
+
const e = t.slice();
|
|
8
|
+
return e[o] = u, e;
|
|
9
|
+
}
|
|
10
|
+
function T(t, u, o) {
|
|
11
|
+
return t.map(
|
|
12
|
+
(e) => e.id === u ? typeof o == "function" ? o(e) : { ...e, ...o } : e
|
|
13
|
+
);
|
|
14
|
+
}
|
|
15
|
+
function g(t, u) {
|
|
16
|
+
return t.filter((o) => o.id !== u);
|
|
17
|
+
}
|
|
18
|
+
function I(t, u, o) {
|
|
19
|
+
return t.map((e) => e.id === u ? { ...e, content: e.content + o } : e);
|
|
20
|
+
}
|
|
21
|
+
function x(t, u) {
|
|
22
|
+
return t.includes(u) ? t.slice() : [...t, u];
|
|
23
|
+
}
|
|
24
|
+
function y(t, u) {
|
|
25
|
+
return t.filter((o) => o !== u);
|
|
26
|
+
}
|
|
27
|
+
function l() {
|
|
28
|
+
return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : "kai-" + Math.random().toString(36).slice(2);
|
|
29
|
+
}
|
|
30
|
+
function b(t, u = {}) {
|
|
31
|
+
const o = u.id ?? l(), e = { id: o, role: "assistant", content: "", ...u };
|
|
32
|
+
t((n) => [...n, e]);
|
|
33
|
+
const d = (n) => t((r) => r.map((a) => a.id === o ? n(a) : a)), i = {
|
|
34
|
+
id: o,
|
|
35
|
+
appendText(n) {
|
|
36
|
+
return d((r) => ({ ...r, content: r.content + n })), i;
|
|
37
|
+
},
|
|
38
|
+
setText(n) {
|
|
39
|
+
return d((r) => ({ ...r, content: n })), i;
|
|
40
|
+
},
|
|
41
|
+
appendReasoning(n, r) {
|
|
42
|
+
return d((a) => {
|
|
43
|
+
var s, p;
|
|
44
|
+
return { ...a, reasoning: { text: (((s = a.reasoning) == null ? void 0 : s.text) ?? "") + n, label: r ?? ((p = a.reasoning) == null ? void 0 : p.label) } };
|
|
45
|
+
}), i;
|
|
46
|
+
},
|
|
47
|
+
setReasoning(n, r) {
|
|
48
|
+
return d((a) => {
|
|
49
|
+
var s;
|
|
50
|
+
return { ...a, reasoning: { text: n, label: r ?? ((s = a.reasoning) == null ? void 0 : s.label) } };
|
|
51
|
+
}), i;
|
|
52
|
+
},
|
|
53
|
+
upsertTool(n) {
|
|
54
|
+
return d((r) => {
|
|
55
|
+
const a = r.tools ? r.tools.slice() : [], s = n.toolCallId != null ? a.findIndex((p) => p.toolCallId === n.toolCallId) : a.findIndex((p) => p.type === n.type);
|
|
56
|
+
return s === -1 ? a.push(n) : a[s] = n, { ...r, tools: a };
|
|
57
|
+
}), i;
|
|
58
|
+
},
|
|
59
|
+
updateTool(n, r) {
|
|
60
|
+
return d((a) => ({ ...a, tools: (a.tools ?? []).map((s) => s.toolCallId === n ? { ...s, ...r } : s) })), i;
|
|
61
|
+
},
|
|
62
|
+
patch(n) {
|
|
63
|
+
return d((r) => ({ ...r, ...n })), i;
|
|
64
|
+
},
|
|
65
|
+
done(n) {
|
|
66
|
+
n && d((r) => ({ ...r, ...n }));
|
|
67
|
+
},
|
|
68
|
+
abort(n) {
|
|
69
|
+
n ? d((r) => ({ ...r, tools: (r.tools ?? []).map((a) => ({ ...a, state: "output-error", errorText: n })) })) : t((r) => r.filter((a) => a.id !== o));
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
return i;
|
|
73
|
+
}
|
|
74
|
+
function R(t, u) {
|
|
75
|
+
const o = {
|
|
76
|
+
id: t.id,
|
|
77
|
+
appendText(e) {
|
|
78
|
+
return t.appendText(e), o;
|
|
79
|
+
},
|
|
80
|
+
setText(e) {
|
|
81
|
+
return t.setText(e), o;
|
|
82
|
+
},
|
|
83
|
+
appendReasoning(e, d) {
|
|
84
|
+
return t.appendReasoning(e, d), o;
|
|
85
|
+
},
|
|
86
|
+
setReasoning(e, d) {
|
|
87
|
+
return t.setReasoning(e, d), o;
|
|
88
|
+
},
|
|
89
|
+
upsertTool(e) {
|
|
90
|
+
return t.upsertTool(e), o;
|
|
91
|
+
},
|
|
92
|
+
updateTool(e, d) {
|
|
93
|
+
return t.updateTool(e, d), o;
|
|
94
|
+
},
|
|
95
|
+
patch(e) {
|
|
96
|
+
return t.patch(e), o;
|
|
97
|
+
},
|
|
98
|
+
done(e) {
|
|
99
|
+
t.done(e), u();
|
|
100
|
+
},
|
|
101
|
+
abort(e) {
|
|
102
|
+
t.abort(e), u();
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
return o;
|
|
106
|
+
}
|
|
107
|
+
export {
|
|
108
|
+
x as addSuggestion,
|
|
109
|
+
I as appendContent,
|
|
110
|
+
c as appendMessage,
|
|
111
|
+
b as createAssistantStream,
|
|
112
|
+
R as onStreamSettled,
|
|
113
|
+
g as removeMessage,
|
|
114
|
+
y as removeSuggestion,
|
|
115
|
+
T as updateMessage,
|
|
116
|
+
f as upsertMessage
|
|
117
|
+
};
|
package/dist/theme.tokens.css
CHANGED
|
@@ -15,10 +15,57 @@
|
|
|
15
15
|
--color-secondary-foreground: var(--kai-color-secondary-foreground, hsl(240 5.9% 10%));
|
|
16
16
|
--color-muted: var(--kai-color-muted, hsl(240 4.8% 95.9%));
|
|
17
17
|
--color-muted-foreground: var(--kai-color-muted-foreground, hsl(240 3.8% 43%));
|
|
18
|
+
/* Subtle SURFACE — an opaque "muted panel" for things that sit OVER content
|
|
19
|
+
(the prompt input, message bubbles, artifact/card headers, chips). CALCULATED
|
|
20
|
+
from existing tokens — `--color-muted` blended 40% onto `--color-background`
|
|
21
|
+
— so it tracks the theme (incl. dark) automatically and needs no hand-picked
|
|
22
|
+
value. SOLID (no alpha), so nothing behind it bleeds through. This replaces
|
|
23
|
+
ad-hoc `bg-muted/40` surfaces. Retint via the --kai-color-surface knob (or a
|
|
24
|
+
bare value); --color-surface-strong is the stronger step (hover/raised) and
|
|
25
|
+
--color-surface-sunken is recessed BELOW the base surface (wells, or a banner
|
|
26
|
+
that sits behind a card). Sunken is theme-specific: "darker than the card"
|
|
27
|
+
means a LOWER muted% in dark but a HIGHER one in light, so the two scopes
|
|
28
|
+
can't share a number — see the .dark block. */
|
|
29
|
+
--color-surface: var(--kai-color-surface, color-mix(in srgb, var(--color-muted) 40%, var(--color-background)));
|
|
30
|
+
--color-surface-strong: var(--kai-color-surface-strong, color-mix(in srgb, var(--color-muted) 60%, var(--color-background)));
|
|
31
|
+
--color-surface-sunken: var(--kai-color-surface-sunken, color-mix(in srgb, var(--color-muted) 85%, var(--color-background)));
|
|
18
32
|
--color-accent: var(--kai-color-accent, hsl(240 4.8% 95.9%));
|
|
19
33
|
--color-accent-foreground: var(--kai-color-accent-foreground, hsl(240 5.9% 10%));
|
|
20
34
|
--color-destructive: var(--kai-color-destructive, hsl(0 72% 45%));
|
|
21
35
|
--color-destructive-foreground: var(--kai-color-destructive-foreground, hsl(0 0% 98%));
|
|
36
|
+
/* Semantic status colors - solid fills with a legible foreground, matched to
|
|
37
|
+
the kit's tool-green / -amber / -blue hues so they read on-brand. Use
|
|
38
|
+
bg-success / bg-warning / bg-info with the matching -foreground for badges,
|
|
39
|
+
banners, and buttons; or text-success / -warning / -info on a soft tint
|
|
40
|
+
(below). destructive (above) is the danger/error member of the same family.
|
|
41
|
+
Light uses darker hues so the color carries a light foreground AND stays
|
|
42
|
+
legible as text on a pale tint; dark (see .dark) flips to brighter hues over
|
|
43
|
+
a near-black foreground. Override via --kai-color-success / -warning / -info
|
|
44
|
+
(+ -foreground). */
|
|
45
|
+
--color-success: var(--kai-color-success, hsl(142 71% 30%));
|
|
46
|
+
--color-success-foreground: var(--kai-color-success-foreground, hsl(0 0% 98%));
|
|
47
|
+
--color-warning: var(--kai-color-warning, hsl(38 92% 30%));
|
|
48
|
+
--color-warning-foreground: var(--kai-color-warning-foreground, hsl(0 0% 98%));
|
|
49
|
+
--color-info: var(--kai-color-info, hsl(217 91% 42%));
|
|
50
|
+
--color-info-foreground: var(--kai-color-info-foreground, hsl(0 0% 98%));
|
|
51
|
+
/* Soft tinted status surfaces - OPAQUE, theme-tracking fills derived as ~14% of
|
|
52
|
+
the status hue blended onto the background. Use these for subtle callouts /
|
|
53
|
+
banners instead of an eyeballed bg-success/10; pair with text-success /
|
|
54
|
+
-warning / -info / -destructive. Derived, so declared in BOTH light and dark
|
|
55
|
+
(a color-mix resolves where it's declared - see the surface tokens above). A
|
|
56
|
+
bare bg- utility for a color-mix token is added at the bottom (see bg-surface). */
|
|
57
|
+
--color-success-soft: var(--kai-color-success-soft, color-mix(in oklab, var(--color-success) 14%, var(--color-background)));
|
|
58
|
+
--color-warning-soft: var(--kai-color-warning-soft, color-mix(in oklab, var(--color-warning) 14%, var(--color-background)));
|
|
59
|
+
--color-info-soft: var(--kai-color-info-soft, color-mix(in oklab, var(--color-info) 14%, var(--color-background)));
|
|
60
|
+
--color-destructive-soft: var(--kai-color-destructive-soft, color-mix(in oklab, var(--color-destructive) 14%, var(--color-background)));
|
|
61
|
+
/* Interaction-state backgrounds - opaque, theme-tracking fills for row/control
|
|
62
|
+
states so consumers stop eyeballing /10 opacities. --color-hover is a subtle
|
|
63
|
+
neutral (a little --color-muted on the background); --color-selected is a
|
|
64
|
+
faint --color-primary tint so a selected row tracks the brand. Use bg-hover /
|
|
65
|
+
bg-selected. Derived, so declared in BOTH light and dark; bare bg- utilities
|
|
66
|
+
added at the bottom. */
|
|
67
|
+
--color-hover: var(--kai-color-hover, color-mix(in oklab, var(--color-muted) 60%, var(--color-background)));
|
|
68
|
+
--color-selected: var(--kai-color-selected, color-mix(in oklab, var(--color-primary) 8%, var(--color-background)));
|
|
22
69
|
--color-border: var(--kai-color-border, hsl(240 5.9% 90%));
|
|
23
70
|
--color-input: var(--kai-color-input, hsl(240 5.9% 90%));
|
|
24
71
|
/* Focus ring — a deliberate blue (not a neutral) so keyboard focus is always
|
|
@@ -90,10 +137,36 @@
|
|
|
90
137
|
--color-secondary-foreground: var(--kai-color-secondary-foreground, hsl(0 0% 98%));
|
|
91
138
|
--color-muted: var(--kai-color-muted, hsl(45 4% 17%));
|
|
92
139
|
--color-muted-foreground: var(--kai-color-muted-foreground, hsl(45 4% 64%));
|
|
140
|
+
/* Re-declared in the dark scope so the color-mix recomputes with the DARK
|
|
141
|
+
muted/background (a derived token is computed where it's declared, not where
|
|
142
|
+
it's used — see the light --color-surface for the full note). */
|
|
143
|
+
--color-surface: var(--kai-color-surface, color-mix(in srgb, var(--color-muted) 40%, var(--color-background)));
|
|
144
|
+
--color-surface-strong: var(--kai-color-surface-strong, color-mix(in srgb, var(--color-muted) 60%, var(--color-background)));
|
|
145
|
+
/* Sunken: in dark a LOWER muted% is darker (blends toward the dark background). */
|
|
146
|
+
--color-surface-sunken: var(--kai-color-surface-sunken, color-mix(in srgb, var(--color-muted) 18%, var(--color-background)));
|
|
93
147
|
--color-accent: var(--kai-color-accent, hsl(45 4% 17%));
|
|
94
148
|
--color-accent-foreground: var(--kai-color-accent-foreground, hsl(0 0% 98%));
|
|
95
149
|
--color-destructive: var(--kai-color-destructive, hsl(0 62.8% 30.6%));
|
|
96
150
|
--color-destructive-foreground: var(--kai-color-destructive-foreground, hsl(0 0% 98%));
|
|
151
|
+
/* Semantic status colors - dark mode flips to the brighter tool-* dark hues
|
|
152
|
+
(matching the chip values) carried over a near-black foreground, so the color
|
|
153
|
+
both reads as text on a dark soft tint AND backs a legible foreground. See
|
|
154
|
+
the light @theme note. */
|
|
155
|
+
--color-success: var(--kai-color-success, hsl(142 71% 45%));
|
|
156
|
+
--color-success-foreground: var(--kai-color-success-foreground, hsl(45 4% 11%));
|
|
157
|
+
--color-warning: var(--kai-color-warning, hsl(38 92% 50%));
|
|
158
|
+
--color-warning-foreground: var(--kai-color-warning-foreground, hsl(45 4% 11%));
|
|
159
|
+
--color-info: var(--kai-color-info, hsl(217 91% 70%));
|
|
160
|
+
--color-info-foreground: var(--kai-color-info-foreground, hsl(45 4% 11%));
|
|
161
|
+
/* Soft status surfaces + interaction states - re-declared so each color-mix
|
|
162
|
+
recomputes with the DARK hues/background (a derived token resolves where it's
|
|
163
|
+
declared; see the light block for the full note). */
|
|
164
|
+
--color-success-soft: var(--kai-color-success-soft, color-mix(in oklab, var(--color-success) 14%, var(--color-background)));
|
|
165
|
+
--color-warning-soft: var(--kai-color-warning-soft, color-mix(in oklab, var(--color-warning) 14%, var(--color-background)));
|
|
166
|
+
--color-info-soft: var(--kai-color-info-soft, color-mix(in oklab, var(--color-info) 14%, var(--color-background)));
|
|
167
|
+
--color-destructive-soft: var(--kai-color-destructive-soft, color-mix(in oklab, var(--color-destructive) 14%, var(--color-background)));
|
|
168
|
+
--color-hover: var(--kai-color-hover, color-mix(in oklab, var(--color-muted) 60%, var(--color-background)));
|
|
169
|
+
--color-selected: var(--kai-color-selected, color-mix(in oklab, var(--color-primary) 8%, var(--color-background)));
|
|
97
170
|
--color-border: var(--kai-color-border, hsl(45 4% 17%));
|
|
98
171
|
--color-input: var(--kai-color-input, hsl(45 4% 17%));
|
|
99
172
|
--color-ring: var(--kai-color-ring, hsl(217 91% 68%));
|
|
@@ -174,3 +247,17 @@
|
|
|
174
247
|
}
|
|
175
248
|
.scrollbar-thin::-webkit-scrollbar-thumb:hover { background-color: var(--color-scrollbar-thumb-hover); }
|
|
176
249
|
.scrollbar-thin::-webkit-scrollbar-corner { background: transparent; }
|
|
250
|
+
|
|
251
|
+
/* Surface utilities — `bg-surface` / `bg-surface-strong` paint the opaque,
|
|
252
|
+
theme-derived surface tokens (see --color-surface above). Defined explicitly
|
|
253
|
+
because a color-mix-valued @theme token does NOT emit a bare `bg-` utility on
|
|
254
|
+
its own (only opacity variants). Use these for panels that sit OVER content
|
|
255
|
+
instead of `bg-muted/NN`. */
|
|
256
|
+
|
|
257
|
+
/* Soft-status + interaction-state utilities. Same reason as bg-surface above: a
|
|
258
|
+
color-mix-valued @theme token does NOT emit a bare `bg-` utility on its own, so
|
|
259
|
+
bg-success-soft / bg-warning-soft / bg-info-soft / bg-destructive-soft and
|
|
260
|
+
bg-hover / bg-selected are declared here. (The SOLID tokens - success / warning
|
|
261
|
+
/ info + their -foreground - are plain hsl values, so bg-success / text-success
|
|
262
|
+
etc. ARE auto-generated by @theme and need no explicit utility.) */
|
|
263
|
+
|
package/dist/types.d.ts
CHANGED
|
@@ -31,6 +31,10 @@ export interface ConversationSummary {
|
|
|
31
31
|
messageCount: number;
|
|
32
32
|
lastMessageAt: string;
|
|
33
33
|
updatedAt: string;
|
|
34
|
+
/** Right-aligned trailing text on the row — a count, status, or "days ago".
|
|
35
|
+
* When omitted, a short relative time is auto-derived from `updatedAt`
|
|
36
|
+
* (fallback `lastMessageAt`). */
|
|
37
|
+
trailing?: string;
|
|
34
38
|
}
|
|
35
39
|
export interface ConversationGroup {
|
|
36
40
|
id: string;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { JSX } from 'solid-js';
|
|
2
|
+
/** The run state of an agent, mapped to the kit's tool / status hues.
|
|
3
|
+
* - `working` (blue) the agent is actively running.
|
|
4
|
+
* - `idle` (muted) waiting, no current activity.
|
|
5
|
+
* - `done` (green) finished its turn.
|
|
6
|
+
* - `error` (red) failed.
|
|
7
|
+
* - `blocked` (amber) stalled, usually waiting on something. */
|
|
8
|
+
export type AgentStatusTone = 'working' | 'idle' | 'done' | 'error' | 'blocked';
|
|
9
|
+
export interface AgentStatus {
|
|
10
|
+
/** Which hue the status dot takes. */
|
|
11
|
+
tone: AgentStatusTone;
|
|
12
|
+
/** Optional short label rendered next to the dot (e.g. "Working", "Blocked on you"). */
|
|
13
|
+
label?: string;
|
|
14
|
+
/** Animate the dot with a ping ring (off under prefers-reduced-motion). */
|
|
15
|
+
pulse?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export interface AgentCardProps {
|
|
18
|
+
/** @deprecated No longer rendered. Kept for back-compat with existing callers. */
|
|
19
|
+
leading?: JSX.Element;
|
|
20
|
+
/** The agent's name. The primary label. */
|
|
21
|
+
name: string;
|
|
22
|
+
/** @deprecated No longer rendered. Kept for back-compat with existing callers. */
|
|
23
|
+
subtitle?: string;
|
|
24
|
+
/** @deprecated No longer rendered. Kept for back-compat with existing callers. */
|
|
25
|
+
lastLine?: string;
|
|
26
|
+
/** Run status: a tone-colored dot, an optional small label, optionally pulsing. */
|
|
27
|
+
status: AgentStatus;
|
|
28
|
+
/** Raise a prominent "needs you" pill plus a glowing amber edge. The
|
|
29
|
+
* attention-routing signal that pulls focus to this agent. */
|
|
30
|
+
needsAttention?: boolean;
|
|
31
|
+
/** Selected / focused state. Highlighted border and surface. */
|
|
32
|
+
active?: boolean;
|
|
33
|
+
/** Promote this agent to focus. Fires on click and on Enter / Space. */
|
|
34
|
+
onActivate?: () => void;
|
|
35
|
+
/** Alias for {@link AgentCardProps.onActivate}. Both fire if both are set. */
|
|
36
|
+
onClick?: () => void;
|
|
37
|
+
/** Show a trailing "..." overflow button and fire this on click. The consumer
|
|
38
|
+
* wires the actual menu; the card only surfaces the affordance. Click is
|
|
39
|
+
* stopped from also activating the card. */
|
|
40
|
+
onMenu?: (e: MouseEvent) => void;
|
|
41
|
+
/** Extra classes merged over the card. */
|
|
42
|
+
class?: string;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* AgentCard - the compact representation of one agent in a multi-agent workspace.
|
|
46
|
+
*
|
|
47
|
+
* In a focus + periphery layout the agents you are not focused on collapse to these
|
|
48
|
+
* glanceable cards, arranged as a narrow side RAIL or a wide LIST. The card stays
|
|
49
|
+
* deliberately minimal: the agent name, a tone-colored status dot, a "needs you"
|
|
50
|
+
* affordance when the agent wants your attention, and a trailing "..." overflow
|
|
51
|
+
* button for per-agent actions. Clicking the card promotes the agent back to focus.
|
|
52
|
+
*
|
|
53
|
+
* It is `w-full` and lets the name truncate, so the same component works in both a
|
|
54
|
+
* narrow rail and a wide list without changes - the content adapts to the box.
|
|
55
|
+
*
|
|
56
|
+
* Status maps to the kit's tool hues so it reads in light and dark from tokens alone:
|
|
57
|
+
* working = blue, idle = muted, done = green, error = red, blocked = amber. Setting
|
|
58
|
+
* `needsAttention` raises an amber "Needs you" pill and a glowing amber ring so the
|
|
59
|
+
* card jumps out of the periphery - the attention-routing signal.
|
|
60
|
+
*/
|
|
61
|
+
export declare function AgentCard(props: AgentCardProps): JSX.Element;
|
package/dist/ui/button.d.ts
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { JSX } from 'solid-js';
|
|
2
2
|
import { VariantProps } from 'class-variance-authority';
|
|
3
3
|
declare const buttonVariants: (props?: ({
|
|
4
|
-
variant?: "default" | "ghost" | "outline" | "destructive" | null | undefined;
|
|
5
|
-
size?: "sm" | "
|
|
4
|
+
variant?: "default" | "ghost" | "subtle" | "outline" | "destructive" | null | undefined;
|
|
5
|
+
size?: "sm" | "md" | "lg" | "icon" | "icon-sm" | null | undefined;
|
|
6
|
+
align?: "end" | "start" | "center" | null | undefined;
|
|
6
7
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
8
|
export interface ButtonProps extends JSX.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
9
|
+
/** Stretch to the full width of the container (a block button). */
|
|
10
|
+
full?: boolean;
|
|
8
11
|
}
|
|
9
12
|
export declare function Button(props: ButtonProps): JSX.Element;
|
|
10
13
|
export { buttonVariants };
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { JSX } from 'solid-js';
|
|
2
|
+
export type CardAppearance = 'outlined' | 'filled' | 'plain' | 'accent';
|
|
3
|
+
/** `vertical` (media on top), `horizontal` (media at the start), or `responsive`
|
|
4
|
+
* (horizontal when the card's container is at least ~28rem wide, else vertical —
|
|
5
|
+
* a CSS container query on the card's own width, NOT the viewport). */
|
|
6
|
+
export type CardOrientation = 'vertical' | 'horizontal' | 'responsive';
|
|
7
|
+
export interface CardProps extends JSX.HTMLAttributes<HTMLDivElement> {
|
|
8
|
+
/** Surface treatment: `outlined` | `filled` | `plain` | `accent`. */
|
|
9
|
+
appearance?: CardAppearance;
|
|
10
|
+
/** `vertical` (media on top) or `horizontal` (media at the start). */
|
|
11
|
+
orientation?: CardOrientation;
|
|
12
|
+
/** The card width below which a `responsive` card collapses to vertical and the
|
|
13
|
+
* footer action cluster stacks. A CSS length (e.g. `'24rem'`); default `'28rem'`.
|
|
14
|
+
* Container-query breakpoints can't be CSS variables, so this prop is baked into
|
|
15
|
+
* a per-card `@container` rule. */
|
|
16
|
+
collapse?: string;
|
|
17
|
+
/** Tighter spacing for dense lists (shrinks `--kai-card-spacing`). */
|
|
18
|
+
dense?: boolean;
|
|
19
|
+
/** Full-bleed media region (image/video/illustration) at the top (vertical) or
|
|
20
|
+
* start (horizontal). Clipped to the card's corners. */
|
|
21
|
+
media?: JSX.Element;
|
|
22
|
+
/** Header content (e.g. a title). Rendered above the body, padded. */
|
|
23
|
+
header?: JSX.Element;
|
|
24
|
+
/** An actions cluster pinned to the end of the header row. */
|
|
25
|
+
headerActions?: JSX.Element;
|
|
26
|
+
/** Footer content. Rendered below the body, padded. */
|
|
27
|
+
footer?: JSX.Element;
|
|
28
|
+
/** An actions cluster pinned to the end of the footer row. */
|
|
29
|
+
footerActions?: JSX.Element;
|
|
30
|
+
/** Whether the default slot (body) has content — the facade computes this so an
|
|
31
|
+
* empty body region isn't rendered (an empty `<slot>` is always truthy). */
|
|
32
|
+
hasBody?: boolean;
|
|
33
|
+
/** Render a dismiss (×) that hides the card and calls `onDismiss`. Off by default. */
|
|
34
|
+
dismissible?: boolean;
|
|
35
|
+
onDismiss?: () => void;
|
|
36
|
+
/** Render the whole card as a link (`<a>`). Wins over `clickable`. */
|
|
37
|
+
href?: string;
|
|
38
|
+
target?: string;
|
|
39
|
+
rel?: string;
|
|
40
|
+
/** Make the whole card a `role="button"` with Enter/Space activation. A
|
|
41
|
+
* clickable/href card must NOT also contain footer action buttons. */
|
|
42
|
+
clickable?: boolean;
|
|
43
|
+
onCardClick?: (event: MouseEvent | KeyboardEvent) => void;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* `Card` — the kit's presentational card surface (the `<kai-card>` primitive),
|
|
47
|
+
* modeled on the WebAwesome card: ONE element whose flexibility comes from a few
|
|
48
|
+
* structural slots (`media`, `header` + actions, `footer` + actions; body is the
|
|
49
|
+
* default slot), `appearance` + `orientation` variants, `::part` styling, and a
|
|
50
|
+
* single `--kai-card-spacing` knob. The title/description are NOT slots — they are
|
|
51
|
+
* body/header content the consumer marks up, because a slot earns its place only
|
|
52
|
+
* where the shadow boundary blocks the consumer (a pinned media/footer region),
|
|
53
|
+
* not for a text node.
|
|
54
|
+
*
|
|
55
|
+
* Distinct from the generative-UI contract chrome in `../components/card.tsx`
|
|
56
|
+
* (which the Card Contract cards compose); this one is purely presentational.
|
|
57
|
+
*
|
|
58
|
+
* a11y: a `clickable`/`href` card MUST NOT also contain action buttons — that
|
|
59
|
+
* nests interactive controls inside a button/link.
|
|
60
|
+
*/
|
|
61
|
+
export declare function Card(props: CardProps): JSX.Element;
|
package/dist/ui/collapsible.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { JSX } from 'solid-js';
|
|
1
|
+
import { JSX, Accessor } from 'solid-js';
|
|
2
2
|
declare module 'solid-js' {
|
|
3
3
|
namespace JSX {
|
|
4
4
|
interface ExplicitBoolAttributes {
|
|
@@ -6,10 +6,24 @@ declare module 'solid-js' {
|
|
|
6
6
|
}
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
|
+
/** Imperative open controller, handed to a parent (e.g. the kai-tool facade)
|
|
10
|
+
* via `controllerRef` so it can drive/observe open state — mirrors
|
|
11
|
+
* HoverCardController. Only available when the Collapsible is UNCONTROLLED
|
|
12
|
+
* (no `open` prop); in controlled mode the parent already owns the state. */
|
|
13
|
+
export interface CollapsibleController {
|
|
14
|
+
open: Accessor<boolean>;
|
|
15
|
+
setOpen: (v: boolean) => void;
|
|
16
|
+
}
|
|
9
17
|
export declare function Collapsible(props: {
|
|
10
18
|
open?: boolean;
|
|
11
19
|
defaultOpen?: boolean;
|
|
12
20
|
onOpenChange?: (open: boolean) => void;
|
|
21
|
+
/** When true, the trigger no longer toggles (programmatic show/hide still work
|
|
22
|
+
* via the controller; this only gates the user-facing trigger). */
|
|
23
|
+
disabled?: boolean;
|
|
24
|
+
/** Receive the open controller (open accessor + setOpen) once mounted.
|
|
25
|
+
* Only meaningful in uncontrolled mode (no `open` prop). */
|
|
26
|
+
controllerRef?: (api: CollapsibleController) => void;
|
|
13
27
|
children: JSX.Element;
|
|
14
28
|
class?: string;
|
|
15
29
|
}): JSX.Element;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { JSX } from 'solid-js';
|
|
2
|
+
export interface CommandRow {
|
|
3
|
+
id: string;
|
|
4
|
+
label: string;
|
|
5
|
+
icon?: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
/** Optional keyboard shortcut shown as right-aligned key caps; uses the
|
|
8
|
+
* kai-kbd `keys` syntax (e.g. "Mod+K", "Alt+1"). */
|
|
9
|
+
shortcut?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface CommandGroup {
|
|
12
|
+
group?: string;
|
|
13
|
+
items: CommandRow[];
|
|
14
|
+
}
|
|
15
|
+
export interface CommandListProps {
|
|
16
|
+
groups: CommandGroup[];
|
|
17
|
+
activeId?: string;
|
|
18
|
+
onSelect: (id: string) => void;
|
|
19
|
+
emptyLabel?: string;
|
|
20
|
+
/** Accessible label for the listbox container. Defaults to 'Command palette'. */
|
|
21
|
+
ariaLabel?: string;
|
|
22
|
+
/** id applied to the listbox container, for aria-controls wiring. */
|
|
23
|
+
id?: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* `CommandList` — a presentational grouped listbox for command/mention palettes.
|
|
27
|
+
*
|
|
28
|
+
* Renders a `role="listbox"` container. Groups with a `group` name get a muted
|
|
29
|
+
* section header. Each row is a `role="option"` button with icon, label, and
|
|
30
|
+
* optional description. Clicking a row calls `onSelect(id)`. When there are no
|
|
31
|
+
* groups/items it renders `emptyLabel` (default "No results").
|
|
32
|
+
*/
|
|
33
|
+
export declare function CommandList(props: CommandListProps): JSX.Element;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { Accessor, JSX } from 'solid-js';
|
|
2
|
+
/** Imperative open controller, handed to a parent (e.g. the kai-dialog facade)
|
|
3
|
+
* via `controllerRef` so it can drive/observe open state with `wireDisclosure`. */
|
|
4
|
+
export interface DialogController {
|
|
5
|
+
open: Accessor<boolean>;
|
|
6
|
+
setOpen: (v: boolean) => void;
|
|
7
|
+
}
|
|
8
|
+
export interface DialogProps {
|
|
9
|
+
/** Dialog body — the default slot / main content. */
|
|
10
|
+
children?: JSX.Element;
|
|
11
|
+
/** Optional header region (e.g. a title). Rendered above the body with a divider. */
|
|
12
|
+
header?: JSX.Element;
|
|
13
|
+
/** Optional footer region (e.g. action buttons). Rendered below the body with a divider. */
|
|
14
|
+
footer?: JSX.Element;
|
|
15
|
+
/** Controlled open state. When set, the component never changes it itself —
|
|
16
|
+
* drive it from `onOpenChange`. Omit for uncontrolled (internal) state. */
|
|
17
|
+
open?: boolean;
|
|
18
|
+
/** Initial open state when uncontrolled. */
|
|
19
|
+
defaultOpen?: boolean;
|
|
20
|
+
/** Fires whenever the dialog wants to open or close (Escape / backdrop / method). */
|
|
21
|
+
onOpenChange?: (open: boolean) => void;
|
|
22
|
+
/** Receive the open controller (open accessor + setOpen) once mounted. */
|
|
23
|
+
controllerRef?: (api: DialogController) => void;
|
|
24
|
+
/** Receive the focusable panel node so a facade's `focus()` can target it. */
|
|
25
|
+
panelRef?: (el: HTMLElement) => void;
|
|
26
|
+
/** Accessible name for the dialog when no `header` is provided. */
|
|
27
|
+
'aria-label'?: string;
|
|
28
|
+
/** Extra class applied to the panel (e.g. a wider `max-w-*`). */
|
|
29
|
+
class?: string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Dialog is the presentational centered modal surface. It renders through a Portal
|
|
33
|
+
* (so it escapes any clipping/stacking ancestor), dims the page with a backdrop,
|
|
34
|
+
* and centers a panel with a sensible max width/height and internal scroll. It
|
|
35
|
+
* closes on Escape and on a backdrop click (never on a panel click), moves focus
|
|
36
|
+
* into the panel on open and restores it on close, and runs a basic Tab focus
|
|
37
|
+
* trap so keyboard focus cycles within the panel while open. The developer owns
|
|
38
|
+
* when it opens (drive `open` / `defaultOpen`); this owns being the modal.
|
|
39
|
+
*
|
|
40
|
+
* Styleable parts: `backdrop` · `panel` · `header` · `body` · `footer`.
|
|
41
|
+
*/
|
|
42
|
+
export declare function Dialog(props: DialogProps): JSX.Element;
|