@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
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { HighlightRule } from './composer';
|
|
2
|
+
export interface HighlightMatch {
|
|
3
|
+
start: number;
|
|
4
|
+
end: number;
|
|
5
|
+
class: string | undefined;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Find all non-overlapping highlight ranges in `text` for the given rules.
|
|
9
|
+
*
|
|
10
|
+
* - A string rule is matched as a case-insensitive literal (regex metachars are escaped).
|
|
11
|
+
* - An object rule uses `new RegExp(pattern, flags ?? 'gi')`.
|
|
12
|
+
* - Overlapping ranges are resolved in earliest-start order; later ranges that
|
|
13
|
+
* overlap an already-claimed span are dropped.
|
|
14
|
+
* - Zero-width matches are skipped to avoid infinite loops.
|
|
15
|
+
* - Returns `[]` when nothing matches.
|
|
16
|
+
*/
|
|
17
|
+
export declare function findHighlightMatches(text: string, rules: HighlightRule[]): HighlightMatch[];
|
|
18
|
+
declare global {
|
|
19
|
+
interface CSSNamespace {
|
|
20
|
+
highlights?: HighlightRegistry;
|
|
21
|
+
}
|
|
22
|
+
interface HighlightRegistry {
|
|
23
|
+
set(name: string, highlight: CSSHighlight): void;
|
|
24
|
+
delete(name: string): boolean;
|
|
25
|
+
has(name: string): boolean;
|
|
26
|
+
}
|
|
27
|
+
class CSSHighlight {
|
|
28
|
+
constructor(...ranges: Range[]);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Feature-detect whether the CSS Custom Highlight API is available in the
|
|
33
|
+
* current environment. Returns false in jsdom (decoration no-op).
|
|
34
|
+
*/
|
|
35
|
+
export declare function supportsHighlightAPI(): boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Apply highlight matches to a contenteditable element using the CSS Custom
|
|
38
|
+
* Highlight API. Maps text offsets (ZWSP-stripped concatenated text) to DOM
|
|
39
|
+
* Ranges spanning across text nodes, builds a `Highlight`, and registers it.
|
|
40
|
+
*
|
|
41
|
+
* If the API is unavailable (jsdom, older browsers), this is a strict no-op.
|
|
42
|
+
*
|
|
43
|
+
* @param root The contenteditable element.
|
|
44
|
+
* @param matches Pre-computed non-overlapping `{start, end}` ranges.
|
|
45
|
+
* @param zwsp The ZWSP character used in the editable (passed to avoid
|
|
46
|
+
* a circular import; callers pass ZWSP from composer-dom).
|
|
47
|
+
*/
|
|
48
|
+
export declare function applyHighlights(root: HTMLElement, matches: HighlightMatch[], zwsp: string, name?: string): void;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { ComposerDoc } from '../primitives/composer-model';
|
|
2
|
+
/**
|
|
3
|
+
* Undo/redo history for the composer.
|
|
4
|
+
*
|
|
5
|
+
* The browser's native contenteditable undo stack can't track our programmatic
|
|
6
|
+
* pill insertion/deletion — it leaves pills stuck and replays text edits against
|
|
7
|
+
* a DOM we changed underneath it, corrupting the content. So we own the history:
|
|
8
|
+
* a stack of document-model snapshots. Restoring a snapshot re-renders the doc
|
|
9
|
+
* (pills included, since each snapshot holds full EntityRefs) and the caret.
|
|
10
|
+
*
|
|
11
|
+
* Pure module — no DOM. The caller computes `coalesce` (true to merge a run of
|
|
12
|
+
* consecutive typing into one undo step; false for a structural edit like a pill
|
|
13
|
+
* insert/delete, which gets its own step).
|
|
14
|
+
*/
|
|
15
|
+
export interface Snapshot {
|
|
16
|
+
doc: ComposerDoc;
|
|
17
|
+
caret: number;
|
|
18
|
+
}
|
|
19
|
+
export interface ComposerHistory {
|
|
20
|
+
/** Record a new state. `coalesce` merges it into the current entry instead of
|
|
21
|
+
* pushing a new one (used for consecutive typing). */
|
|
22
|
+
record(snap: Snapshot, coalesce: boolean): void;
|
|
23
|
+
/** Step back; returns the snapshot to restore, or null if nothing to undo. */
|
|
24
|
+
undo(): Snapshot | null;
|
|
25
|
+
/** Step forward; returns the snapshot to restore, or null if nothing to redo. */
|
|
26
|
+
redo(): Snapshot | null;
|
|
27
|
+
/** Replace all history with a single baseline entry (e.g. external value set). */
|
|
28
|
+
reset(snap: Snapshot): void;
|
|
29
|
+
canUndo(): boolean;
|
|
30
|
+
canRedo(): boolean;
|
|
31
|
+
/** Current entry count (for tests/debugging). */
|
|
32
|
+
size(): number;
|
|
33
|
+
}
|
|
34
|
+
export declare function createHistory(initial: Snapshot, limit?: number): ComposerHistory;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { JSX } from 'solid-js';
|
|
2
|
+
import { ComposerDoc, EntityRef } from '../primitives/composer-model';
|
|
3
|
+
export interface TriggerItem {
|
|
4
|
+
id: string;
|
|
5
|
+
label: string;
|
|
6
|
+
icon?: string;
|
|
7
|
+
/** Secondary muted text shown beside the label in the menu (Codex-style). */
|
|
8
|
+
description?: string;
|
|
9
|
+
/** Section header to group this item under in the menu (e.g. 'Plugins', 'Agents'). */
|
|
10
|
+
group?: string;
|
|
11
|
+
/** Entity kind for the inserted pill; overrides the trigger's default `kind` so
|
|
12
|
+
* one trigger can mix kinds across sections (e.g. agents + plugins under `@`). */
|
|
13
|
+
kind?: string;
|
|
14
|
+
promptText?: string;
|
|
15
|
+
data?: Record<string, unknown>;
|
|
16
|
+
}
|
|
17
|
+
export interface TriggerDef {
|
|
18
|
+
char: string;
|
|
19
|
+
kind: string;
|
|
20
|
+
items?: TriggerItem[];
|
|
21
|
+
}
|
|
22
|
+
export type HighlightRule = string | {
|
|
23
|
+
pattern: string;
|
|
24
|
+
flags?: string;
|
|
25
|
+
class?: string;
|
|
26
|
+
};
|
|
27
|
+
export interface ComposerChange {
|
|
28
|
+
doc: ComposerDoc;
|
|
29
|
+
text: string;
|
|
30
|
+
entities: EntityRef[];
|
|
31
|
+
}
|
|
32
|
+
/** Imperative handle exposed via `controllerRef` — surfaces the composer's latent
|
|
33
|
+
* capabilities (focus/blur the editable, clear the doc, submit, insert a pill) so
|
|
34
|
+
* the `<kai-composer>` facade can forward them as instance methods. */
|
|
35
|
+
export interface ComposerController {
|
|
36
|
+
focus(options?: FocusOptions): void;
|
|
37
|
+
blur(): void;
|
|
38
|
+
clear(): void;
|
|
39
|
+
send(): void;
|
|
40
|
+
insertEntity(entity: EntityRef): void;
|
|
41
|
+
}
|
|
42
|
+
export interface ComposerProps {
|
|
43
|
+
value?: string | ComposerDoc;
|
|
44
|
+
placeholder?: string;
|
|
45
|
+
disabled?: boolean;
|
|
46
|
+
loading?: boolean;
|
|
47
|
+
maxHeight?: number | string;
|
|
48
|
+
submitOnEnter?: boolean;
|
|
49
|
+
triggers?: TriggerDef[];
|
|
50
|
+
highlights?: HighlightRule[];
|
|
51
|
+
/** Default icon per entity kind (kind → image URL/data-URI), shown on a pill +
|
|
52
|
+
* menu item when the item has no `icon` of its own. Overrides the built-in
|
|
53
|
+
* glyphs (agent/plugin). Example: `{ agent: '/icons/bot.svg' }`. */
|
|
54
|
+
kindIcons?: Record<string, string>;
|
|
55
|
+
/** Render WITHOUT the rounded frame/background/padding — just the editable +
|
|
56
|
+
* placeholder + menu. For embedding inside another frame (e.g. PromptInput). */
|
|
57
|
+
bare?: boolean;
|
|
58
|
+
/** Override the editable element's classes (used in `bare` mode to match an
|
|
59
|
+
* existing input's exact look). The placeholder mirrors these for alignment. */
|
|
60
|
+
editableClass?: string;
|
|
61
|
+
/** Accessible name for the editable (role=textbox). Falls back to the
|
|
62
|
+
* placeholder, then "Message input". */
|
|
63
|
+
ariaLabel?: string;
|
|
64
|
+
/** Receive the editable element (e.g. to register it for click-to-focus). */
|
|
65
|
+
editableRef?: (el: HTMLDivElement) => void;
|
|
66
|
+
/** Receive the imperative controller once mounted. The `<kai-composer>` facade
|
|
67
|
+
* forwards these as element methods (focus/blur/clear/send/insertEntity). */
|
|
68
|
+
controllerRef?: (controller: ComposerController) => void;
|
|
69
|
+
onChange?: (change: ComposerChange) => void;
|
|
70
|
+
onSubmit?: (change: ComposerChange) => void;
|
|
71
|
+
onTrigger?: (info: {
|
|
72
|
+
char: string;
|
|
73
|
+
query: string;
|
|
74
|
+
rect: DOMRect;
|
|
75
|
+
}) => void;
|
|
76
|
+
onTriggerClose?: () => void;
|
|
77
|
+
onEntityAdd?: (entity: EntityRef) => void;
|
|
78
|
+
onEntityRemove?: (entity: EntityRef) => void;
|
|
79
|
+
/** The editable gained focus. `focus`/`blur` are NOT composed, so they don't
|
|
80
|
+
* escape the shadow root — this re-exposes them. (keydown/paste/focusin/focusout
|
|
81
|
+
* are composed and already reach the host as native events; no wrapper needed.) */
|
|
82
|
+
onFocus?: (e: FocusEvent) => void;
|
|
83
|
+
/** The editable lost focus. */
|
|
84
|
+
onBlur?: (e: FocusEvent) => void;
|
|
85
|
+
}
|
|
86
|
+
export declare function Composer(props: ComposerProps): JSX.Element;
|
|
@@ -28,6 +28,20 @@ export declare function normalizeActions(actions: unknown): {
|
|
|
28
28
|
};
|
|
29
29
|
/** The id of the default action (first with `default:true`), if any. */
|
|
30
30
|
export declare function defaultActionId(actions: ConfirmAction[]): string | undefined;
|
|
31
|
+
/** Imperative handle exposed via `controllerRef` — surfaces the confirm card's
|
|
32
|
+
* latent action/dismiss capabilities so the `<kai-confirm>` facade can forward
|
|
33
|
+
* them as instance methods (focus/confirm/dismiss/reopen). */
|
|
34
|
+
export interface ConfirmController {
|
|
35
|
+
/** Focus the default action button (or the first action if none default). */
|
|
36
|
+
focus(options?: FocusOptions): void;
|
|
37
|
+
/** Activate an action by id (or the default action when omitted) — emits the
|
|
38
|
+
* `action` verb + resolves single-shot. */
|
|
39
|
+
confirm(actionId?: string): void;
|
|
40
|
+
/** Dismiss the card — emits `dismiss` + optimistically collapses to the stub. */
|
|
41
|
+
dismiss(): void;
|
|
42
|
+
/** Re-open a dismissed card from its stub — emits `reopen`. */
|
|
43
|
+
reopen(): void;
|
|
44
|
+
}
|
|
31
45
|
export interface ConfirmCardProps {
|
|
32
46
|
/** The confirm definition (CardEnvelope.data). */
|
|
33
47
|
data?: ConfirmCardData;
|
|
@@ -45,6 +59,9 @@ export interface ConfirmCardProps {
|
|
|
45
59
|
class?: string;
|
|
46
60
|
/** When set, render the chromed read-only view instead of the buttons. */
|
|
47
61
|
resolution?: CardResolution;
|
|
62
|
+
/** Receive the imperative controller once mounted. The `<kai-confirm>` facade
|
|
63
|
+
* forwards these as element methods (focus/confirm/dismiss/reopen). */
|
|
64
|
+
controllerRef?: (controller: ConfirmController) => void;
|
|
48
65
|
}
|
|
49
66
|
/**
|
|
50
67
|
* `ConfirmCard` — a named-intent approval card. Renders a title + body + a small
|
|
@@ -3,6 +3,15 @@ export interface ConversationItemProps {
|
|
|
3
3
|
conversation: ConversationSummary;
|
|
4
4
|
isActive: boolean;
|
|
5
5
|
onSelect: (id: string) => void;
|
|
6
|
+
/** Dense single-line row: a leading dot + title, no message count. */
|
|
7
|
+
compact?: boolean;
|
|
6
8
|
class?: string;
|
|
7
9
|
}
|
|
10
|
+
/**
|
|
11
|
+
* Short relative time from an ISO date string: "just now", "5m ago", "3h ago",
|
|
12
|
+
* "2d ago", "24d ago". Pure — it snapshots `now` (defaults to `Date.now()`) at
|
|
13
|
+
* call time, so it re-derives whenever the list re-renders; there is no internal
|
|
14
|
+
* ticking clock. Returns '' for a missing or unparseable date.
|
|
15
|
+
*/
|
|
16
|
+
export declare function relativeTimeShort(iso?: string, now?: number): string;
|
|
8
17
|
export declare function ConversationItem(props: ConversationItemProps): import("solid-js").JSX.Element;
|
|
@@ -1,4 +1,17 @@
|
|
|
1
|
+
import { JSX } from 'solid-js';
|
|
1
2
|
import { ConversationSummary, ConversationGroup } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* The collapsed-rail fallback: a floating reopen button shown when the
|
|
5
|
+
* conversation sidebar is collapsed. Shared by `kai-workspace` (its collapsed
|
|
6
|
+
* branch) and the standalone `kai-conversations` (collapsed mode), so the rail
|
|
7
|
+
* collapses identically in both. Renders only the button; the host owns the
|
|
8
|
+
* surrounding region (the workspace puts the thread beside it, the standalone
|
|
9
|
+
* element stands alone). `onExpand` reopens the rail.
|
|
10
|
+
*/
|
|
11
|
+
export declare function CollapsedRail(props: {
|
|
12
|
+
onExpand: () => void;
|
|
13
|
+
class?: string;
|
|
14
|
+
}): JSX.Element;
|
|
2
15
|
export interface ConversationListProps {
|
|
3
16
|
groups: ConversationGroup[];
|
|
4
17
|
conversations: ConversationSummary[];
|
|
@@ -6,6 +19,28 @@ export interface ConversationListProps {
|
|
|
6
19
|
onSelect: (id: string) => void;
|
|
7
20
|
onNewChat: () => void;
|
|
8
21
|
onToggleSidebar?: () => void;
|
|
22
|
+
/** Replaces the built-in title bar (toggle / "Chats" / New chat). */
|
|
23
|
+
header?: JSX.Element;
|
|
24
|
+
/** A row below the list (e.g. account / settings / usage). */
|
|
25
|
+
footer?: JSX.Element;
|
|
26
|
+
/** Replaces the built-in "no conversations yet" state. */
|
|
27
|
+
empty?: JSX.Element;
|
|
28
|
+
/** Dense single-line rows (a leading dot + title, no message count). */
|
|
29
|
+
compact?: boolean;
|
|
30
|
+
/** Fired whenever the built-in search box query changes (typing or a
|
|
31
|
+
* programmatic `clear()`). Lets the facade surface a `kai-search` event. */
|
|
32
|
+
onSearchChange?: (query: string) => void;
|
|
33
|
+
/** Receive the imperative controller once mounted. The `kai-conversations`
|
|
34
|
+
* facade uses it to focus / clear the internal search input. */
|
|
35
|
+
controllerRef?: (controller: ConversationListController) => void;
|
|
9
36
|
class?: string;
|
|
10
37
|
}
|
|
11
|
-
|
|
38
|
+
/** Imperative handle exposed via `controllerRef` — surfaces the internal search
|
|
39
|
+
* box to the `kai-conversations` facade (the searchQuery signal lives here). */
|
|
40
|
+
export interface ConversationListController {
|
|
41
|
+
/** Focus the built-in search `<input>`. */
|
|
42
|
+
focus(options?: FocusOptions): void;
|
|
43
|
+
/** Clear the internal search query (resets the list filter). */
|
|
44
|
+
clearSearch(): void;
|
|
45
|
+
}
|
|
46
|
+
export declare function ConversationList(props: ConversationListProps): JSX.Element;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { JSX } from 'solid-js';
|
|
2
|
+
/** The card types that render a dismissed stub, mapped to their intent verb. */
|
|
3
|
+
export type DismissedCardType = 'confirm' | 'choice' | 'form' | 'tasks';
|
|
4
|
+
/** Map a card `type` to its dismissed-stub intent label ("Proposed:", "Choose:",
|
|
5
|
+
* "Form:", "Tasks:"). Falls back to a capitalized type for unknown card types. */
|
|
6
|
+
export declare function stubIntent(type: string): string;
|
|
7
|
+
export interface DismissedStubProps {
|
|
8
|
+
/** The card type, used to derive the intent label ("Proposed:" etc.). */
|
|
9
|
+
type: string;
|
|
10
|
+
/** The card's title/heading; shown after the intent label. Falls back gracefully. */
|
|
11
|
+
title?: string;
|
|
12
|
+
/** Re-open handler. The owning card emits `{ kind:'reopen', cardId }`. */
|
|
13
|
+
onReopen: () => void;
|
|
14
|
+
/** The Reopen button label. Default 'Reopen'. */
|
|
15
|
+
reopenLabel?: string;
|
|
16
|
+
class?: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* `DismissedStub` — the compact stub a card collapses to after it's been dismissed.
|
|
20
|
+
* Group-labelled for a11y; the Reopen affordance is a ghost button.
|
|
21
|
+
*/
|
|
22
|
+
export declare function DismissedStub(props: DismissedStubProps): JSX.Element;
|
|
@@ -11,7 +11,18 @@ export interface FileTreeFile {
|
|
|
11
11
|
language?: string;
|
|
12
12
|
/** Kind — drives the icon + whether Code applies. */
|
|
13
13
|
type?: 'html' | 'pdf' | 'image' | 'other';
|
|
14
|
+
/** Lines added vs the base. Rendered as a trailing `+N` stat (success hue,
|
|
15
|
+
* tabular-nums). Only shown when present; omit for a plain file row. */
|
|
16
|
+
additions?: number;
|
|
17
|
+
/** Lines removed vs the base. Rendered as a trailing `-N` stat (error hue). */
|
|
18
|
+
deletions?: number;
|
|
19
|
+
/** Change status vs the base. Drives a small trailing status letter in the
|
|
20
|
+
* conventional VCS hue (added=green, modified=amber, deleted=red,
|
|
21
|
+
* renamed=blue, untracked=muted). Only shown when present. */
|
|
22
|
+
status?: 'added' | 'modified' | 'deleted' | 'renamed' | 'untracked';
|
|
14
23
|
}
|
|
24
|
+
/** A change status a file can carry. */
|
|
25
|
+
export type FileStatus = NonNullable<FileTreeFile['status']>;
|
|
15
26
|
/** A folder node in the built tree. */
|
|
16
27
|
export interface FileTreeFolderNode {
|
|
17
28
|
kind: 'folder';
|
|
@@ -48,6 +59,10 @@ export interface FileTreeProps extends Omit<JSX.HTMLAttributes<HTMLDivElement>,
|
|
|
48
59
|
onSelect?: (path: string, file: FileTreeFile) => void;
|
|
49
60
|
/** Folder paths expanded by default. When omitted, all folders start open. */
|
|
50
61
|
defaultExpanded?: string[];
|
|
62
|
+
/** Show a summary header above the tree: the changed-file count, the summed
|
|
63
|
+
* `+additions / -deletions`, and a Collapse-all/Expand-all toggle wired to the
|
|
64
|
+
* folder-expand state. Off by default (no header — unchanged behavior). */
|
|
65
|
+
summary?: boolean;
|
|
51
66
|
}
|
|
52
67
|
/**
|
|
53
68
|
* `FileTree` — a collapsible, keyboard-navigable file explorer built from a flat
|
|
@@ -77,6 +77,27 @@ export declare function summarizeForm(def: FormDefinition, data: Record<string,
|
|
|
77
77
|
/** Build the result object: coerced values with empty optional fields omitted.
|
|
78
78
|
* `false` and `0` are kept (they are real values, not "empty"). */
|
|
79
79
|
export declare function buildResult(def: FormDefinition, values: Record<string, unknown>): Record<string, unknown>;
|
|
80
|
+
/** Imperative handle exposed via `controllerRef` — surfaces the form's latent
|
|
81
|
+
* capabilities (focus the first/first-invalid control, validate, programmatic
|
|
82
|
+
* send, reset to defaults, dismiss/reopen) so the `<kai-form>` facade can forward
|
|
83
|
+
* them as instance methods. */
|
|
84
|
+
export interface FormController {
|
|
85
|
+
/** Focus the first control, or the first INVALID control after a failed validation. */
|
|
86
|
+
focus(options?: FocusOptions): void;
|
|
87
|
+
/** Run full validation + submit: focus the first invalid field on failure, else emit `submit`. */
|
|
88
|
+
send(): void;
|
|
89
|
+
/** Run client-side validation now and return per-field errors WITHOUT submitting. */
|
|
90
|
+
validate(): {
|
|
91
|
+
valid: boolean;
|
|
92
|
+
errors?: Record<string, string>;
|
|
93
|
+
};
|
|
94
|
+
/** Re-seed from each field's `default` and clear errors. */
|
|
95
|
+
reset(): void;
|
|
96
|
+
/** Trigger the dismiss path (emit `dismiss` + collapse to the re-openable stub). */
|
|
97
|
+
dismiss(): void;
|
|
98
|
+
/** Re-open a dismissed card from its stub (emit `reopen`). */
|
|
99
|
+
reopen(): void;
|
|
100
|
+
}
|
|
80
101
|
export interface FormProps {
|
|
81
102
|
/** The form definition (CardEnvelope.data). */
|
|
82
103
|
data?: FormDefinition;
|
|
@@ -92,6 +113,19 @@ export interface FormProps {
|
|
|
92
113
|
class?: string;
|
|
93
114
|
/** When set, render the chromed read-only view instead of the form inputs. */
|
|
94
115
|
resolution?: CardResolution;
|
|
116
|
+
/** Controlled field values — when set, this wins over internal/uncontrolled state. */
|
|
117
|
+
values?: Record<string, unknown>;
|
|
118
|
+
/** Initial values overlaying the schema defaults (uncontrolled seed). */
|
|
119
|
+
defaultValues?: Record<string, unknown>;
|
|
120
|
+
/** Disable all fields + submit. */
|
|
121
|
+
disabled?: boolean;
|
|
122
|
+
/** Fires on input with the current coerced values + validity (distinct from submit). */
|
|
123
|
+
onValuesChange?: (payload: {
|
|
124
|
+
values: Record<string, unknown>;
|
|
125
|
+
valid: boolean;
|
|
126
|
+
}) => void;
|
|
127
|
+
/** Receive the imperative controller once mounted. */
|
|
128
|
+
controllerRef?: (controller: FormController) => void;
|
|
95
129
|
}
|
|
96
130
|
/**
|
|
97
131
|
* `Form` — renders a JSON-Schema form definition into themed, accessible widgets
|
|
@@ -3,6 +3,9 @@ export interface MarkdownProps {
|
|
|
3
3
|
id?: string;
|
|
4
4
|
class?: string;
|
|
5
5
|
codeTheme?: string;
|
|
6
|
+
/** Optional `::part` name(s) to expose on the rendered root. Lets callers
|
|
7
|
+
* (e.g. the message bubble) surface a styleable part through the shadow. */
|
|
8
|
+
part?: string;
|
|
6
9
|
}
|
|
7
10
|
declare function Markdown(props: MarkdownProps): import("solid-js").JSX.Element;
|
|
8
11
|
export { Markdown };
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { JSX } from 'solid-js';
|
|
2
|
-
import { ChatMessageAction, CustomAction } from '../elements/chat-types';
|
|
2
|
+
import { ChatMessageAction, CustomAction, FeedbackVote } from '../elements/chat-types';
|
|
3
|
+
import { ToolPart } from './tool';
|
|
4
|
+
import { AttachmentData } from './attachments';
|
|
3
5
|
export interface MessageProps extends JSX.HTMLAttributes<HTMLDivElement> {
|
|
4
6
|
children: JSX.Element;
|
|
5
7
|
}
|
|
@@ -14,6 +16,10 @@ declare function MessageAvatar(props: MessageAvatarProps): JSX.Element;
|
|
|
14
16
|
export interface MessageContentProps extends JSX.HTMLAttributes<HTMLDivElement> {
|
|
15
17
|
children: JSX.Element | string;
|
|
16
18
|
markdown?: boolean;
|
|
19
|
+
/** `::part` name(s) exposed on the content node. The body passes
|
|
20
|
+
* `"bubble content"` so consumers can target either the rounded bubble or the
|
|
21
|
+
* text region from outside the shadow boundary. */
|
|
22
|
+
part?: string;
|
|
17
23
|
}
|
|
18
24
|
declare function MessageContent(props: MessageContentProps): JSX.Element;
|
|
19
25
|
export interface MessageActionsProps extends JSX.HTMLAttributes<HTMLDivElement> {
|
|
@@ -28,6 +34,13 @@ export interface MessageActionBarProps {
|
|
|
28
34
|
reveal?: 'always' | 'hover';
|
|
29
35
|
/** Fired with the built-in name or the custom action id when a button is clicked. */
|
|
30
36
|
onAction: (id: string) => void;
|
|
37
|
+
/** The active feedback vote. When `'like'`/`'dislike'` is set, that button is
|
|
38
|
+
* marked pressed (filled) and the OTHER vote button animates out. `undefined`
|
|
39
|
+
* shows both. Pure/prop-driven so the bar survives re-renders. */
|
|
40
|
+
activeFeedback?: FeedbackVote;
|
|
41
|
+
/** When true, the `copy` button shows its emerald check icon instead of the
|
|
42
|
+
* copy glyph (cleared by the owner after ~2s). */
|
|
43
|
+
copied?: boolean;
|
|
31
44
|
class?: string;
|
|
32
45
|
}
|
|
33
46
|
/**
|
|
@@ -36,8 +49,64 @@ export interface MessageActionBarProps {
|
|
|
36
49
|
* descriptors use their `label` plus `actionIcon(icon)` (label-only when the
|
|
37
50
|
* icon is unknown or absent). `reveal="hover"` makes the bar fade in on the
|
|
38
51
|
* parent `.group`'s hover.
|
|
52
|
+
*
|
|
53
|
+
* Pure/prop-driven: feedback (`activeFeedback`) and copy (`copied`) state are
|
|
54
|
+
* owned by the parent facade and passed in — the bar holds no internal signals,
|
|
55
|
+
* so it survives the new-array-per-chunk re-renders of a streaming thread. With
|
|
56
|
+
* a vote active, the chosen `like`/`dislike` button is marked `aria-pressed` +
|
|
57
|
+
* filled and the other vote button collapses its width (sliding the active thumb
|
|
58
|
+
* into its place) via a 0fr↔1fr grid transition. The
|
|
59
|
+
* `copy` button swaps to an emerald check while `copied`.
|
|
39
60
|
*/
|
|
40
61
|
declare function MessageActionBar(props: MessageActionBarProps): JSX.Element;
|
|
62
|
+
export interface MessageBodyProps {
|
|
63
|
+
/** The message text/markdown. */
|
|
64
|
+
content: string;
|
|
65
|
+
/** Optional collapsible reasoning block, rendered above the content. */
|
|
66
|
+
reasoning?: {
|
|
67
|
+
text: string;
|
|
68
|
+
label?: string;
|
|
69
|
+
};
|
|
70
|
+
/** Tool-call parts, rendered above the content. */
|
|
71
|
+
tools?: ToolPart[];
|
|
72
|
+
/** Inline attachment previews, rendered above the content. */
|
|
73
|
+
attachments?: AttachmentData[];
|
|
74
|
+
/** Whether this is a user message (right-aligned bubble) vs an assistant
|
|
75
|
+
* message (full-width transparent). */
|
|
76
|
+
isUser: boolean;
|
|
77
|
+
/** Whether the content renders as markdown. */
|
|
78
|
+
markdown: boolean;
|
|
79
|
+
/** Action-bar entries — built-in names and/or custom descriptors. When empty
|
|
80
|
+
* the bar is not rendered. */
|
|
81
|
+
actions?: (ChatMessageAction | CustomAction)[];
|
|
82
|
+
/** `'always'` (default) keeps the bar visible; `'hover'` reveals it on parent
|
|
83
|
+
* `.group` hover. */
|
|
84
|
+
actionsReveal?: 'always' | 'hover';
|
|
85
|
+
/** Fired with the built-in name or custom id when an action is clicked. */
|
|
86
|
+
onAction?: (id: string) => void;
|
|
87
|
+
/** The currently-active feedback vote, so the bar can mark like/dislike and
|
|
88
|
+
* hide the other. */
|
|
89
|
+
activeFeedback?: FeedbackVote;
|
|
90
|
+
/** When true, the copy button shows its "copied" check icon. */
|
|
91
|
+
copied?: boolean;
|
|
92
|
+
/** INJECT slot projected at the TOP of the body — above the reasoning / tools /
|
|
93
|
+
* content. A per-message header: a model-name label, a role + timestamp line.
|
|
94
|
+
* In the `<kai-message>` shadow this is `<slot name="before-body" />`. */
|
|
95
|
+
beforeBody?: JSX.Element;
|
|
96
|
+
/** INJECT slot projected at the BOTTOM of the body — below the action bar. A
|
|
97
|
+
* citation / sources row, a token-cost / latency line. In the `<kai-message>`
|
|
98
|
+
* shadow this is `<slot name="after-body" />`. */
|
|
99
|
+
afterBody?: JSX.Element;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* The shared message body: an optional reasoning block, tool calls, inline
|
|
103
|
+
* attachments, the content bubble, and the action bar — in that order. This is
|
|
104
|
+
* the single source of truth for how a message renders, consumed by `ChatThread`
|
|
105
|
+
* (the `<For>` over `messages`), the standalone `<kai-message>` facade, and (in
|
|
106
|
+
* future) `kai-compare` for each candidate. Pure/prop-driven: all interaction
|
|
107
|
+
* state (copied, feedback vote) is owned above and passed in.
|
|
108
|
+
*/
|
|
109
|
+
declare function MessageBody(props: MessageBodyProps): JSX.Element;
|
|
41
110
|
export interface MessageActionProps {
|
|
42
111
|
tooltip: string;
|
|
43
112
|
children: JSX.Element;
|
|
@@ -51,4 +120,4 @@ export interface MessageCopyButtonProps {
|
|
|
51
120
|
class?: string;
|
|
52
121
|
}
|
|
53
122
|
declare function MessageCopyButton(props: MessageCopyButtonProps): JSX.Element;
|
|
54
|
-
export { Message, MessageAvatar, MessageContent, MessageActions, MessageActionBar, MessageAction, MessageCopyButton };
|
|
123
|
+
export { Message, MessageAvatar, MessageContent, MessageActions, MessageActionBar, MessageBody, MessageAction, MessageCopyButton };
|
|
@@ -1,8 +1,15 @@
|
|
|
1
|
+
import { DropdownController } from '../ui/dropdown';
|
|
1
2
|
import { ModelOption } from '../types';
|
|
2
3
|
export interface ModelSwitcherProps {
|
|
3
4
|
models: ModelOption[];
|
|
4
5
|
currentModelId: string;
|
|
5
6
|
onModelChange: (modelId: string) => void;
|
|
6
7
|
class?: string;
|
|
8
|
+
/** Initial open state of the dropdown (uncontrolled seed). */
|
|
9
|
+
defaultOpen?: boolean;
|
|
10
|
+
/** Disable the trigger — click/keyboard no longer open the dropdown. */
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
/** Receive the dropdown's open controller (forwarded from the inner Dropdown). */
|
|
13
|
+
controllerRef?: (api: DropdownController) => void;
|
|
7
14
|
}
|
|
8
15
|
export declare function ModelSwitcher(props: ModelSwitcherProps): import("solid-js").JSX.Element;
|
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
import { JSX } from 'solid-js';
|
|
2
|
+
import { TriggerDef, ComposerChange } from './composer';
|
|
3
|
+
import { ComposerDoc } from '../primitives/composer-model';
|
|
2
4
|
interface PromptInputContextType {
|
|
3
5
|
isLoading: boolean;
|
|
4
|
-
value: () => string;
|
|
6
|
+
value: () => string | ComposerDoc;
|
|
5
7
|
setValue: (value: string) => void;
|
|
6
8
|
maxHeight: number | string;
|
|
7
9
|
onSubmit?: () => void;
|
|
8
10
|
disabled?: boolean;
|
|
9
|
-
textareaRef:
|
|
10
|
-
setTextareaRef: (el:
|
|
11
|
+
textareaRef: HTMLElement | undefined;
|
|
12
|
+
setTextareaRef: (el: HTMLElement) => void;
|
|
11
13
|
}
|
|
12
14
|
declare function usePromptInput(): PromptInputContextType;
|
|
13
15
|
export interface PromptInputProps extends JSX.HTMLAttributes<HTMLDivElement> {
|
|
14
16
|
isLoading?: boolean;
|
|
15
|
-
|
|
17
|
+
/** String = controlled text; ComposerDoc = a seed that pre-populates pills. */
|
|
18
|
+
value?: string | ComposerDoc;
|
|
16
19
|
onValueChange?: (value: string) => void;
|
|
17
20
|
maxHeight?: number | string;
|
|
18
21
|
onSubmit?: () => void;
|
|
@@ -22,6 +25,12 @@ export interface PromptInputProps extends JSX.HTMLAttributes<HTMLDivElement> {
|
|
|
22
25
|
declare function PromptInput(props: PromptInputProps): JSX.Element;
|
|
23
26
|
export interface PromptInputTextareaProps extends JSX.TextareaHTMLAttributes<HTMLTextAreaElement> {
|
|
24
27
|
disableAutosize?: boolean;
|
|
28
|
+
/** Rich entity triggers (`/`, `@`) forwarded to the composer. */
|
|
29
|
+
triggers?: TriggerDef[];
|
|
30
|
+
/** Default icon per entity kind (kind → image src), forwarded to the composer. */
|
|
31
|
+
kindIcons?: Record<string, string>;
|
|
32
|
+
/** Structured change (doc + entities) from the composer, on every edit. */
|
|
33
|
+
onComposerChange?: (change: ComposerChange) => void;
|
|
25
34
|
}
|
|
26
35
|
declare function PromptInputTextarea(props: PromptInputTextareaProps): JSX.Element;
|
|
27
36
|
export interface PromptInputActionsProps extends JSX.HTMLAttributes<HTMLDivElement> {
|
|
@@ -2,12 +2,20 @@ import { JSX } from 'solid-js';
|
|
|
2
2
|
export interface PromptSuggestionProps extends JSX.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
3
3
|
children: JSX.Element | string;
|
|
4
4
|
variant?: 'outline' | 'ghost' | 'default';
|
|
5
|
-
|
|
5
|
+
/** Row height for the `list` layout: `'md'` (default) or `'lg'` for taller
|
|
6
|
+
* rows (more vertical padding). Chips/block/highlight are unaffected. */
|
|
7
|
+
size?: 'md' | 'lg';
|
|
8
|
+
/** Optional leading icon (named icon, image URL/data-URI, or text). */
|
|
9
|
+
icon?: string;
|
|
6
10
|
highlight?: string;
|
|
7
11
|
/** Render as a full-width, left-aligned list row (the "suggested questions"
|
|
8
12
|
* idiom) instead of a rounded pill. Wraps long text. Ignored in highlight
|
|
9
13
|
* mode, which is always a list row. */
|
|
10
14
|
block?: boolean;
|
|
15
|
+
/** Render as a full-width "Ideas for you" list row: a leading icon, a
|
|
16
|
+
* left-aligned label, and a hover background. Like `block`, but keeps the
|
|
17
|
+
* leading icon. Ignored in highlight mode. */
|
|
18
|
+
list?: boolean;
|
|
11
19
|
}
|
|
12
20
|
declare function PromptSuggestion(props: PromptSuggestionProps): JSX.Element;
|
|
13
21
|
export { PromptSuggestion };
|
|
@@ -1,10 +1,23 @@
|
|
|
1
|
-
import { JSX } from 'solid-js';
|
|
1
|
+
import { JSX, Accessor } from 'solid-js';
|
|
2
|
+
/** Imperative open controller, handed to a parent (the kai-reasoning facade) via
|
|
3
|
+
* `controllerRef` so it can drive/observe open state — mirrors
|
|
4
|
+
* CollapsibleController/HoverCardController. */
|
|
5
|
+
export interface ReasoningController {
|
|
6
|
+
open: Accessor<boolean>;
|
|
7
|
+
setOpen: (v: boolean) => void;
|
|
8
|
+
}
|
|
2
9
|
export interface ReasoningProps {
|
|
3
10
|
children: JSX.Element;
|
|
4
11
|
class?: string;
|
|
5
12
|
open?: boolean;
|
|
13
|
+
/** Initial open state (uncontrolled seed). */
|
|
14
|
+
defaultOpen?: boolean;
|
|
6
15
|
onOpenChange?: (open: boolean) => void;
|
|
7
16
|
isStreaming?: boolean;
|
|
17
|
+
/** Gate the trigger — programmatic control via the controller still works. */
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
/** Receive the open controller (open accessor + setOpen) once mounted. */
|
|
20
|
+
controllerRef?: (api: ReasoningController) => void;
|
|
8
21
|
}
|
|
9
22
|
declare function Reasoning(props: ReasoningProps): JSX.Element;
|
|
10
23
|
export interface ReasoningTriggerProps extends JSX.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { ToolPart } from './tool';
|
|
2
|
+
import { AttachmentData } from './attachments';
|
|
3
|
+
/** One assistant response in a comparison. Rendered identically to an assistant
|
|
4
|
+
* message (reasoning + tools + attachments + markdown content) via `MessageBody`. */
|
|
5
|
+
export interface CompareCandidate {
|
|
6
|
+
/** Stable id, unique within the pair; echoed back in the selection. */
|
|
7
|
+
id: string;
|
|
8
|
+
/** The response text/markdown. */
|
|
9
|
+
content: string;
|
|
10
|
+
/** Optional collapsible reasoning block. */
|
|
11
|
+
reasoning?: {
|
|
12
|
+
text: string;
|
|
13
|
+
label?: string;
|
|
14
|
+
};
|
|
15
|
+
/** Tool-call parts rendered above the content. */
|
|
16
|
+
tools?: ToolPart[];
|
|
17
|
+
/** Inline attachment previews rendered above the content. */
|
|
18
|
+
attachments?: AttachmentData[];
|
|
19
|
+
/** Optional short column label (e.g. "A" / "B" / "Concise"). */
|
|
20
|
+
label?: string;
|
|
21
|
+
/** Optional model name shown as a sub-label. */
|
|
22
|
+
model?: string;
|
|
23
|
+
/** When true this candidate is still streaming — its pick control is disabled
|
|
24
|
+
* and a per-column shimmer shows until it (and its sibling) settle. */
|
|
25
|
+
streaming?: boolean;
|
|
26
|
+
}
|
|
27
|
+
/** The two-candidate tuple. Enforced at the type level; validated at runtime by
|
|
28
|
+
* `normalizeCandidates`. */
|
|
29
|
+
export type ComparePair = [CompareCandidate, CompareCandidate];
|
|
30
|
+
/** How the card collapses once the user picks. `'winner'` (default) shows just the
|
|
31
|
+
* chosen candidate's body; `'none'` keeps both columns but marks the choice. */
|
|
32
|
+
export type CompareCollapse = 'winner' | 'none';
|
|
33
|
+
/** The compare definition (set as the `data` JS property on `<kai-compare>`). */
|
|
34
|
+
export interface ResponseCompareData {
|
|
35
|
+
/** Optional prompt/question shown above the two columns. */
|
|
36
|
+
prompt?: string;
|
|
37
|
+
/** Exactly two candidates: [A, B]. */
|
|
38
|
+
candidates: ComparePair;
|
|
39
|
+
/** Collapse behaviour after a pick. Default `'winner'`. */
|
|
40
|
+
collapse?: CompareCollapse;
|
|
41
|
+
}
|
|
42
|
+
/** Emitted (and re-hydratable) when the user picks. The consumer pairs
|
|
43
|
+
* `(prompt, chosenId, rejectedIds)` for preference capture / RLHF. */
|
|
44
|
+
export interface CompareSelection {
|
|
45
|
+
/** The id of the chosen candidate. */
|
|
46
|
+
chosenId: string;
|
|
47
|
+
/** The id(s) of the rejected candidate(s) — for a pair, the other one. */
|
|
48
|
+
rejectedIds: string[];
|
|
49
|
+
/** Epoch ms when the pick was made. */
|
|
50
|
+
at?: number;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Validate + normalize the candidate list. A compare requires EXACTLY two
|
|
54
|
+
* candidates with unique, non-empty string ids. Returns the usable pair, or an
|
|
55
|
+
* error message when the definition is unusable (rendered as an inline error /
|
|
56
|
+
* emitted as a `kai-error`). Modeled on `normalizeOptions`.
|
|
57
|
+
*/
|
|
58
|
+
export declare function normalizeCandidates(candidates: unknown): {
|
|
59
|
+
candidates: ComparePair | null;
|
|
60
|
+
error?: string;
|
|
61
|
+
};
|
|
62
|
+
/** Build the selection payload for choosing `chosenId` out of the pair (the other
|
|
63
|
+
* candidate is the rejected one). Stamps `at` with the current time. */
|
|
64
|
+
export declare function buildSelection(pair: ComparePair, chosenId: string): CompareSelection;
|
|
65
|
+
/** Whether any candidate in the pair is still streaming (pick stays disabled). */
|
|
66
|
+
export declare function isAnyStreaming(pair: ComparePair | null): boolean;
|