meowtail 0.0.0-stage → 0.1.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/ASSISTANT.md +52 -0
- package/JSON.md +48 -0
- package/LICENSE +21 -0
- package/README.md +474 -2
- package/THIRD_PARTY_NOTICES.md +27 -0
- package/dist/src/chat/assistant-composer.d.ts +8 -0
- package/dist/src/chat/assistant-composer.js +246 -0
- package/dist/src/chat/assistant-content.d.ts +20 -0
- package/dist/src/chat/assistant-content.js +66 -0
- package/dist/src/chat/assistant-draft.d.ts +5 -0
- package/dist/src/chat/assistant-draft.js +23 -0
- package/dist/src/chat/assistant-markdown.d.ts +11 -0
- package/dist/src/chat/assistant-markdown.js +33 -0
- package/dist/src/chat/assistant-question.d.ts +12 -0
- package/dist/src/chat/assistant-question.js +95 -0
- package/dist/src/chat/assistant-scroll.d.ts +7 -0
- package/dist/src/chat/assistant-scroll.js +72 -0
- package/dist/src/chat/assistant-types.d.ts +174 -0
- package/dist/src/chat/assistant-types.js +40 -0
- package/dist/src/chat/assistant.d.ts +9 -0
- package/dist/src/chat/assistant.js +294 -0
- package/dist/src/chat/attachments.d.ts +23 -0
- package/dist/src/chat/attachments.js +81 -0
- package/dist/src/chat/bubble.d.ts +17 -0
- package/dist/src/chat/bubble.js +18 -0
- package/dist/src/chat/composer.d.ts +36 -0
- package/dist/src/chat/composer.js +31 -0
- package/dist/src/chat/conversation-scroll.d.ts +9 -0
- package/dist/src/chat/conversation-scroll.js +36 -0
- package/dist/src/chat/conversation.d.ts +16 -0
- package/dist/src/chat/conversation.js +62 -0
- package/dist/src/chat/frame.d.ts +9 -0
- package/dist/src/chat/frame.js +6 -0
- package/dist/src/chat/header.d.ts +14 -0
- package/dist/src/chat/header.js +15 -0
- package/dist/src/chat/index.d.ts +15 -0
- package/dist/src/chat/index.js +15 -0
- package/dist/src/chat/message-actions.d.ts +9 -0
- package/dist/src/chat/message-actions.js +6 -0
- package/dist/src/chat/message-context.d.ts +2 -0
- package/dist/src/chat/message-context.js +2 -0
- package/dist/src/chat/message-list.d.ts +25 -0
- package/dist/src/chat/message-list.js +23 -0
- package/dist/src/chat/message.d.ts +24 -0
- package/dist/src/chat/message.js +36 -0
- package/dist/src/chat/process.d.ts +11 -0
- package/dist/src/chat/process.js +9 -0
- package/dist/src/chat/question.d.ts +15 -0
- package/dist/src/chat/question.js +7 -0
- package/dist/src/chat/sources.d.ts +15 -0
- package/dist/src/chat/sources.js +19 -0
- package/dist/src/chat/status.d.ts +18 -0
- package/dist/src/chat/status.js +16 -0
- package/dist/src/chat/tool-call.d.ts +21 -0
- package/dist/src/chat/tool-call.js +40 -0
- package/dist/src/clipboard.d.ts +2 -0
- package/dist/src/clipboard.js +44 -0
- package/dist/src/components/add-button.d.ts +4 -0
- package/dist/src/components/add-button.js +8 -0
- package/dist/src/components/alert.d.ts +20 -0
- package/dist/src/components/alert.js +16 -0
- package/dist/src/components/aspect-ratio.d.ts +11 -0
- package/dist/src/components/aspect-ratio.js +19 -0
- package/dist/src/components/badge.d.ts +18 -0
- package/dist/src/components/badge.js +16 -0
- package/dist/src/components/breadcrumb.d.ts +15 -0
- package/dist/src/components/breadcrumb.js +10 -0
- package/dist/src/components/button.d.ts +31 -0
- package/dist/src/components/button.js +26 -0
- package/dist/src/components/card-action.d.ts +9 -0
- package/dist/src/components/card-action.js +6 -0
- package/dist/src/components/card-content.d.ts +9 -0
- package/dist/src/components/card-content.js +6 -0
- package/dist/src/components/card-description.d.ts +9 -0
- package/dist/src/components/card-description.js +6 -0
- package/dist/src/components/card-footer.d.ts +9 -0
- package/dist/src/components/card-footer.js +6 -0
- package/dist/src/components/card-header.d.ts +9 -0
- package/dist/src/components/card-header.js +6 -0
- package/dist/src/components/card-title.d.ts +10 -0
- package/dist/src/components/card-title.js +6 -0
- package/dist/src/components/card.d.ts +17 -0
- package/dist/src/components/card.js +19 -0
- package/dist/src/components/checkbox.d.ts +18 -0
- package/dist/src/components/checkbox.js +44 -0
- package/dist/src/components/choice-group.d.ts +27 -0
- package/dist/src/components/choice-group.js +85 -0
- package/dist/src/components/choice-select.d.ts +31 -0
- package/dist/src/components/choice-select.js +353 -0
- package/dist/src/components/code-block.d.ts +13 -0
- package/dist/src/components/code-block.js +71 -0
- package/dist/src/components/container.d.ts +17 -0
- package/dist/src/components/container.js +16 -0
- package/dist/src/components/credential-source.d.ts +22 -0
- package/dist/src/components/credential-source.js +34 -0
- package/dist/src/components/description-list.d.ts +20 -0
- package/dist/src/components/description-list.js +13 -0
- package/dist/src/components/detail-section.d.ts +16 -0
- package/dist/src/components/detail-section.js +12 -0
- package/dist/src/components/dialog.d.ts +43 -0
- package/dist/src/components/dialog.js +29 -0
- package/dist/src/components/diff-block.d.ts +21 -0
- package/dist/src/components/diff-block.js +24 -0
- package/dist/src/components/disclosure.d.ts +15 -0
- package/dist/src/components/disclosure.js +14 -0
- package/dist/src/components/drawer.d.ts +19 -0
- package/dist/src/components/drawer.js +56 -0
- package/dist/src/components/empty-state.d.ts +19 -0
- package/dist/src/components/empty-state.js +11 -0
- package/dist/src/components/field-group.d.ts +13 -0
- package/dist/src/components/field-group.js +20 -0
- package/dist/src/components/field.d.ts +16 -0
- package/dist/src/components/field.js +48 -0
- package/dist/src/components/grid.d.ts +27 -0
- package/dist/src/components/grid.js +29 -0
- package/dist/src/components/hover-card.d.ts +22 -0
- package/dist/src/components/hover-card.js +147 -0
- package/dist/src/components/icon-button.d.ts +17 -0
- package/dist/src/components/icon-button.js +17 -0
- package/dist/src/components/icon-rail.d.ts +20 -0
- package/dist/src/components/icon-rail.js +14 -0
- package/dist/src/components/image-lightbox.d.ts +14 -0
- package/dist/src/components/image-lightbox.js +51 -0
- package/dist/src/components/image-preview.d.ts +16 -0
- package/dist/src/components/image-preview.js +42 -0
- package/dist/src/components/index.d.ts +88 -0
- package/dist/src/components/index.js +87 -0
- package/dist/src/components/inline.d.ts +14 -0
- package/dist/src/components/inline.js +23 -0
- package/dist/src/components/input.d.ts +10 -0
- package/dist/src/components/input.js +6 -0
- package/dist/src/components/item.d.ts +26 -0
- package/dist/src/components/item.js +19 -0
- package/dist/src/components/json-block.d.ts +18 -0
- package/dist/src/components/json-block.js +49 -0
- package/dist/src/components/json-tree.d.ts +16 -0
- package/dist/src/components/json-tree.js +76 -0
- package/dist/src/components/layout-item.d.ts +15 -0
- package/dist/src/components/layout-item.js +16 -0
- package/dist/src/components/layout-types.d.ts +18 -0
- package/dist/src/components/layout-types.js +13 -0
- package/dist/src/components/list-group.d.ts +30 -0
- package/dist/src/components/list-group.js +32 -0
- package/dist/src/components/menu.d.ts +45 -0
- package/dist/src/components/menu.js +227 -0
- package/dist/src/components/nav-item.d.ts +13 -0
- package/dist/src/components/nav-item.js +19 -0
- package/dist/src/components/output-block.d.ts +20 -0
- package/dist/src/components/output-block.js +66 -0
- package/dist/src/components/page-frame.d.ts +21 -0
- package/dist/src/components/page-frame.js +16 -0
- package/dist/src/components/page-header.d.ts +15 -0
- package/dist/src/components/page-header.js +9 -0
- package/dist/src/components/path-label.d.ts +11 -0
- package/dist/src/components/path-label.js +37 -0
- package/dist/src/components/path-picker.d.ts +18 -0
- package/dist/src/components/path-picker.js +83 -0
- package/dist/src/components/pill.d.ts +11 -0
- package/dist/src/components/pill.js +14 -0
- package/dist/src/components/popover.d.ts +31 -0
- package/dist/src/components/popover.js +232 -0
- package/dist/src/components/process-group.d.ts +17 -0
- package/dist/src/components/process-group.js +8 -0
- package/dist/src/components/process-step.d.ts +13 -0
- package/dist/src/components/process-step.js +7 -0
- package/dist/src/components/rail-item.d.ts +25 -0
- package/dist/src/components/rail-item.js +16 -0
- package/dist/src/components/rail-section.d.ts +18 -0
- package/dist/src/components/rail-section.js +11 -0
- package/dist/src/components/read-block.d.ts +24 -0
- package/dist/src/components/read-block.js +82 -0
- package/dist/src/components/region-layout-types.d.ts +19 -0
- package/dist/src/components/region-layout-types.js +78 -0
- package/dist/src/components/region-layout.d.ts +19 -0
- package/dist/src/components/region-layout.js +254 -0
- package/dist/src/components/resource-card.d.ts +22 -0
- package/dist/src/components/resource-card.js +20 -0
- package/dist/src/components/resource-link.d.ts +18 -0
- package/dist/src/components/resource-link.js +14 -0
- package/dist/src/components/risk-confirmation.d.ts +22 -0
- package/dist/src/components/risk-confirmation.js +45 -0
- package/dist/src/components/search-block.d.ts +28 -0
- package/dist/src/components/search-block.js +40 -0
- package/dist/src/components/search-input.d.ts +18 -0
- package/dist/src/components/search-input.js +13 -0
- package/dist/src/components/segmented-control.d.ts +24 -0
- package/dist/src/components/segmented-control.js +63 -0
- package/dist/src/components/select.d.ts +17 -0
- package/dist/src/components/select.js +6 -0
- package/dist/src/components/separator.d.ts +10 -0
- package/dist/src/components/separator.js +11 -0
- package/dist/src/components/shortcut-keys.d.ts +12 -0
- package/dist/src/components/shortcut-keys.js +7 -0
- package/dist/src/components/skeleton-boundary.d.ts +12 -0
- package/dist/src/components/skeleton-boundary.js +73 -0
- package/dist/src/components/skeleton.d.ts +17 -0
- package/dist/src/components/skeleton.js +15 -0
- package/dist/src/components/spinner.d.ts +10 -0
- package/dist/src/components/spinner.js +7 -0
- package/dist/src/components/stack.d.ts +13 -0
- package/dist/src/components/stack.js +22 -0
- package/dist/src/components/state-dot.d.ts +14 -0
- package/dist/src/components/state-dot.js +28 -0
- package/dist/src/components/status-dot.d.ts +34 -0
- package/dist/src/components/status-dot.js +25 -0
- package/dist/src/components/switch.d.ts +9 -0
- package/dist/src/components/switch.js +8 -0
- package/dist/src/components/tabs.d.ts +24 -0
- package/dist/src/components/tabs.js +90 -0
- package/dist/src/components/tag.d.ts +23 -0
- package/dist/src/components/tag.js +16 -0
- package/dist/src/components/terminal-block.d.ts +24 -0
- package/dist/src/components/terminal-block.js +103 -0
- package/dist/src/components/text-shimmer.d.ts +15 -0
- package/dist/src/components/text-shimmer.js +17 -0
- package/dist/src/components/textarea.d.ts +9 -0
- package/dist/src/components/textarea.js +6 -0
- package/dist/src/components/timeline.d.ts +26 -0
- package/dist/src/components/timeline.js +17 -0
- package/dist/src/components/toast.d.ts +14 -0
- package/dist/src/components/toast.js +7 -0
- package/dist/src/components/toolbar.d.ts +12 -0
- package/dist/src/components/toolbar.js +155 -0
- package/dist/src/components/tooltip.d.ts +19 -0
- package/dist/src/components/tooltip.js +81 -0
- package/dist/src/components/web-block.d.ts +24 -0
- package/dist/src/components/web-block.js +40 -0
- package/dist/src/components/window-title-bar.d.ts +25 -0
- package/dist/src/components/window-title-bar.js +16 -0
- package/dist/src/components/work-card.d.ts +21 -0
- package/dist/src/components/work-card.js +11 -0
- package/dist/src/icons/LUCIDE-LICENSE +43 -0
- package/dist/src/icons/README.md +9 -0
- package/dist/src/icons/doodle-cat.d.ts +5 -0
- package/dist/src/icons/doodle-cat.js +8 -0
- package/dist/src/icons/external-arrow.d.ts +2 -0
- package/dist/src/icons/external-arrow.js +5 -0
- package/dist/src/icons/file-type-icon.d.ts +29 -0
- package/dist/src/icons/file-type-icon.js +211 -0
- package/dist/src/icons/github.d.ts +2 -0
- package/dist/src/icons/github.js +5 -0
- package/dist/src/icons/icon.d.ts +51 -0
- package/dist/src/icons/icon.js +135 -0
- package/dist/src/icons/index.d.ts +10 -0
- package/dist/src/icons/index.js +10 -0
- package/dist/src/icons/meowland-mark.d.ts +5 -0
- package/dist/src/icons/meowland-mark.js +5 -0
- package/dist/src/icons/notes.d.ts +2 -0
- package/dist/src/icons/notes.js +5 -0
- package/dist/src/icons/plus.d.ts +2 -0
- package/dist/src/icons/plus.js +5 -0
- package/dist/src/icons/search.d.ts +2 -0
- package/dist/src/icons/search.js +5 -0
- package/dist/src/icons/tasks.d.ts +2 -0
- package/dist/src/icons/tasks.js +5 -0
- package/dist/src/index.d.ts +5 -0
- package/dist/src/index.js +5 -0
- package/dist/src/json/catalog.d.ts +169 -0
- package/dist/src/json/catalog.js +164 -0
- package/dist/src/json/index.d.ts +1 -0
- package/dist/src/json/index.js +1 -0
- package/dist/src/registry/index.d.ts +833 -0
- package/dist/src/registry/index.js +235 -0
- package/dist/src/registry.d.ts +1 -0
- package/dist/src/registry.js +1 -0
- package/dist/src/shared/dom-root.d.ts +3 -0
- package/dist/src/shared/dom-root.js +8 -0
- package/dist/src/shared/layout-style.d.ts +4 -0
- package/dist/src/shared/layout-style.js +13 -0
- package/dist/src/syntax-highlight.d.ts +26 -0
- package/dist/src/syntax-highlight.js +116 -0
- package/dist/src/theme/base.styles.d.ts +2 -0
- package/dist/src/theme/base.styles.js +26 -0
- package/dist/src/theme/chat/assistant.styles.d.ts +2 -0
- package/dist/src/theme/chat/assistant.styles.js +289 -0
- package/dist/src/theme/chat/attachments.styles.d.ts +1 -0
- package/dist/src/theme/chat/attachments.styles.js +255 -0
- package/dist/src/theme/chat/composer.styles.d.ts +1 -0
- package/dist/src/theme/chat/composer.styles.js +519 -0
- package/dist/src/theme/chat/conversation.styles.d.ts +1 -0
- package/dist/src/theme/chat/conversation.styles.js +57 -0
- package/dist/src/theme/chat/frame.styles.d.ts +1 -0
- package/dist/src/theme/chat/frame.styles.js +107 -0
- package/dist/src/theme/chat/header.styles.d.ts +1 -0
- package/dist/src/theme/chat/header.styles.js +93 -0
- package/dist/src/theme/chat/message.styles.d.ts +1 -0
- package/dist/src/theme/chat/message.styles.js +423 -0
- package/dist/src/theme/chat/question.styles.d.ts +1 -0
- package/dist/src/theme/chat/question.styles.js +57 -0
- package/dist/src/theme/chat/records.styles.d.ts +1 -0
- package/dist/src/theme/chat/records.styles.js +546 -0
- package/dist/src/theme/chat/status.styles.d.ts +1 -0
- package/dist/src/theme/chat/status.styles.js +75 -0
- package/dist/src/theme/components/alert.styles.d.ts +1 -0
- package/dist/src/theme/components/alert.styles.js +28 -0
- package/dist/src/theme/components/badge.styles.d.ts +1 -0
- package/dist/src/theme/components/badge.styles.js +66 -0
- package/dist/src/theme/components/breadcrumb.styles.d.ts +1 -0
- package/dist/src/theme/components/breadcrumb.styles.js +44 -0
- package/dist/src/theme/components/button.styles.d.ts +1 -0
- package/dist/src/theme/components/button.styles.js +143 -0
- package/dist/src/theme/components/card.styles.d.ts +1 -0
- package/dist/src/theme/components/card.styles.js +108 -0
- package/dist/src/theme/components/choice-group.styles.d.ts +1 -0
- package/dist/src/theme/components/choice-group.styles.js +87 -0
- package/dist/src/theme/components/choice-select.styles.d.ts +1 -0
- package/dist/src/theme/components/choice-select.styles.js +182 -0
- package/dist/src/theme/components/code-block.styles.d.ts +1 -0
- package/dist/src/theme/components/code-block.styles.js +77 -0
- package/dist/src/theme/components/description-list.styles.d.ts +1 -0
- package/dist/src/theme/components/description-list.styles.js +39 -0
- package/dist/src/theme/components/detail-section.styles.d.ts +1 -0
- package/dist/src/theme/components/detail-section.styles.js +43 -0
- package/dist/src/theme/components/dialog.styles.d.ts +1 -0
- package/dist/src/theme/components/dialog.styles.js +91 -0
- package/dist/src/theme/components/disclosure.styles.d.ts +1 -0
- package/dist/src/theme/components/disclosure.styles.js +79 -0
- package/dist/src/theme/components/drawer.styles.d.ts +2 -0
- package/dist/src/theme/components/drawer.styles.js +67 -0
- package/dist/src/theme/components/empty-state.styles.d.ts +1 -0
- package/dist/src/theme/components/empty-state.styles.js +51 -0
- package/dist/src/theme/components/field-group.styles.d.ts +1 -0
- package/dist/src/theme/components/field-group.styles.js +31 -0
- package/dist/src/theme/components/field.styles.d.ts +1 -0
- package/dist/src/theme/components/field.styles.js +31 -0
- package/dist/src/theme/components/hover-card.styles.d.ts +1 -0
- package/dist/src/theme/components/hover-card.styles.js +59 -0
- package/dist/src/theme/components/icon-rail.styles.d.ts +1 -0
- package/dist/src/theme/components/icon-rail.styles.js +236 -0
- package/dist/src/theme/components/image-lightbox.styles.d.ts +1 -0
- package/dist/src/theme/components/image-lightbox.styles.js +67 -0
- package/dist/src/theme/components/image-preview.styles.d.ts +1 -0
- package/dist/src/theme/components/image-preview.styles.js +68 -0
- package/dist/src/theme/components/item.styles.d.ts +1 -0
- package/dist/src/theme/components/item.styles.js +101 -0
- package/dist/src/theme/components/json.styles.d.ts +1 -0
- package/dist/src/theme/components/json.styles.js +127 -0
- package/dist/src/theme/components/layout.styles.d.ts +1 -0
- package/dist/src/theme/components/layout.styles.js +103 -0
- package/dist/src/theme/components/list-group.styles.d.ts +1 -0
- package/dist/src/theme/components/list-group.styles.js +98 -0
- package/dist/src/theme/components/menu.styles.d.ts +1 -0
- package/dist/src/theme/components/menu.styles.js +77 -0
- package/dist/src/theme/components/native-input.styles.d.ts +1 -0
- package/dist/src/theme/components/native-input.styles.js +113 -0
- package/dist/src/theme/components/nav-item.styles.d.ts +1 -0
- package/dist/src/theme/components/nav-item.styles.js +68 -0
- package/dist/src/theme/components/output-block.styles.d.ts +1 -0
- package/dist/src/theme/components/output-block.styles.js +226 -0
- package/dist/src/theme/components/page-frame.styles.d.ts +1 -0
- package/dist/src/theme/components/page-frame.styles.js +57 -0
- package/dist/src/theme/components/page-header.styles.d.ts +1 -0
- package/dist/src/theme/components/page-header.styles.js +39 -0
- package/dist/src/theme/components/path-label.styles.d.ts +1 -0
- package/dist/src/theme/components/path-label.styles.js +27 -0
- package/dist/src/theme/components/path-picker.styles.d.ts +1 -0
- package/dist/src/theme/components/path-picker.styles.js +33 -0
- package/dist/src/theme/components/pill.styles.d.ts +1 -0
- package/dist/src/theme/components/pill.styles.js +39 -0
- package/dist/src/theme/components/popover.styles.d.ts +1 -0
- package/dist/src/theme/components/popover.styles.js +49 -0
- package/dist/src/theme/components/process-group.styles.d.ts +1 -0
- package/dist/src/theme/components/process-group.styles.js +141 -0
- package/dist/src/theme/components/region-layout.styles.d.ts +1 -0
- package/dist/src/theme/components/region-layout.styles.js +57 -0
- package/dist/src/theme/components/resource-card.styles.d.ts +1 -0
- package/dist/src/theme/components/resource-card.styles.js +105 -0
- package/dist/src/theme/components/resource-card.tokens.d.ts +5 -0
- package/dist/src/theme/components/resource-card.tokens.js +6 -0
- package/dist/src/theme/components/resource-link.styles.d.ts +1 -0
- package/dist/src/theme/components/resource-link.styles.js +78 -0
- package/dist/src/theme/components/risk-confirmation.styles.d.ts +1 -0
- package/dist/src/theme/components/risk-confirmation.styles.js +9 -0
- package/dist/src/theme/components/search-input.styles.d.ts +1 -0
- package/dist/src/theme/components/search-input.styles.js +63 -0
- package/dist/src/theme/components/segmented-control.styles.d.ts +1 -0
- package/dist/src/theme/components/segmented-control.styles.js +63 -0
- package/dist/src/theme/components/separator.styles.d.ts +1 -0
- package/dist/src/theme/components/separator.styles.js +15 -0
- package/dist/src/theme/components/shortcut-keys.styles.d.ts +1 -0
- package/dist/src/theme/components/shortcut-keys.styles.js +34 -0
- package/dist/src/theme/components/skeleton.styles.d.ts +1 -0
- package/dist/src/theme/components/skeleton.styles.js +43 -0
- package/dist/src/theme/components/spinner.styles.d.ts +1 -0
- package/dist/src/theme/components/spinner.styles.js +27 -0
- package/dist/src/theme/components/state-dot.styles.d.ts +1 -0
- package/dist/src/theme/components/state-dot.styles.js +68 -0
- package/dist/src/theme/components/status-dot.styles.d.ts +1 -0
- package/dist/src/theme/components/status-dot.styles.js +72 -0
- package/dist/src/theme/components/tabs.styles.d.ts +1 -0
- package/dist/src/theme/components/tabs.styles.js +93 -0
- package/dist/src/theme/components/tag.styles.d.ts +1 -0
- package/dist/src/theme/components/tag.styles.js +55 -0
- package/dist/src/theme/components/text-shimmer.styles.d.ts +1 -0
- package/dist/src/theme/components/text-shimmer.styles.js +59 -0
- package/dist/src/theme/components/timeline.styles.d.ts +1 -0
- package/dist/src/theme/components/timeline.styles.js +87 -0
- package/dist/src/theme/components/toast.styles.d.ts +1 -0
- package/dist/src/theme/components/toast.styles.js +48 -0
- package/dist/src/theme/components/toggle.styles.d.ts +1 -0
- package/dist/src/theme/components/toggle.styles.js +85 -0
- package/dist/src/theme/components/toolbar.styles.d.ts +1 -0
- package/dist/src/theme/components/toolbar.styles.js +22 -0
- package/dist/src/theme/components/tooltip.styles.d.ts +1 -0
- package/dist/src/theme/components/tooltip.styles.js +26 -0
- package/dist/src/theme/components/web-block.styles.d.ts +1 -0
- package/dist/src/theme/components/web-block.styles.js +48 -0
- package/dist/src/theme/components/window-title-bar.styles.d.ts +6 -0
- package/dist/src/theme/components/window-title-bar.styles.js +57 -0
- package/dist/src/theme/components/work-card.styles.d.ts +1 -0
- package/dist/src/theme/components/work-card.styles.js +78 -0
- package/dist/src/theme/icons/icons.styles.d.ts +1 -0
- package/dist/src/theme/icons/icons.styles.js +29 -0
- package/dist/src/theme/index.d.ts +3 -0
- package/dist/src/theme/index.js +168 -0
- package/dist/src/theme/palette.d.ts +55 -0
- package/dist/src/theme/palette.js +56 -0
- package/dist/src/theme/shared/code-highlight.styles.d.ts +1 -0
- package/dist/src/theme/shared/code-highlight.styles.js +20 -0
- package/dist/src/theme/shared/code-highlight.tokens.d.ts +12 -0
- package/dist/src/theme/shared/code-highlight.tokens.js +13 -0
- package/dist/src/theme/tokens.d.ts +111 -0
- package/dist/src/theme/tokens.js +128 -0
- package/package.json +62 -4
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { type ThemedProps } from "meowcss/meowjsx";
|
|
2
|
+
import { type Child, type MaybeSignal, type Props } from "meowjsx";
|
|
3
|
+
export declare const chatComposerOptions: import("meowcss").Options<{
|
|
4
|
+
readonly layout: readonly ["stacked", "inline", "hero"];
|
|
5
|
+
}>;
|
|
6
|
+
export declare const chatComposerContract: {
|
|
7
|
+
readonly name: "chat-composer";
|
|
8
|
+
readonly parts: readonly ["root", "attachments", "field", "input", "hint", "actions", "trailing", "submit"];
|
|
9
|
+
readonly styleProps: import("meowcss/meowjsx").StylePropsBinding<import("meowcss").Options<{
|
|
10
|
+
readonly layout: readonly ["stacked", "inline", "hero"];
|
|
11
|
+
}>>;
|
|
12
|
+
};
|
|
13
|
+
export type ChatComposerSubmit = (event: SubmitEvent) => void;
|
|
14
|
+
export type ChatComposerInput = (event: Event) => void;
|
|
15
|
+
export interface ChatComposerProps extends Props, ThemedProps<typeof chatComposerOptions> {
|
|
16
|
+
value?: MaybeSignal<string>;
|
|
17
|
+
placeholder?: string;
|
|
18
|
+
inputLabel?: string;
|
|
19
|
+
/** Inline keeps a short draft and its actions on one row; long drafts still grow. */
|
|
20
|
+
/** Draft attachments belong to the same writing surface; upload ownership stays with the host. */
|
|
21
|
+
attachments?: Child;
|
|
22
|
+
/** Model/provider selection beside the send action; options and state belong to the host. */
|
|
23
|
+
trailing?: Child;
|
|
24
|
+
hint?: Child;
|
|
25
|
+
hintId?: string;
|
|
26
|
+
submitLabel?: string;
|
|
27
|
+
/** Visible action content; the accessible name always comes from submitLabel. */
|
|
28
|
+
submitContent?: Child;
|
|
29
|
+
disabled?: boolean;
|
|
30
|
+
/** Prevent another submission while keeping the draft editable. */
|
|
31
|
+
submitDisabled?: MaybeSignal<boolean>;
|
|
32
|
+
onSubmit?: ChatComposerSubmit;
|
|
33
|
+
onInput?: ChatComposerInput;
|
|
34
|
+
className?: string;
|
|
35
|
+
}
|
|
36
|
+
export declare const ChatComposer: import("meowjsx").Component<ChatComposerProps, "chat-composer", "actions" | "attachments" | "field" | "hint" | "input" | "root" | "submit" | "trailing">;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { defineOptions } from "meowcss";
|
|
2
|
+
import { defineStyleProps } from "meowcss/meowjsx";
|
|
3
|
+
import { defineComponent, h } from "meowjsx";
|
|
4
|
+
import { Icon } from "../icons/icon.js";
|
|
5
|
+
export const chatComposerOptions = defineOptions("chat-composer", {
|
|
6
|
+
layout: ["stacked", "inline", "hero"],
|
|
7
|
+
});
|
|
8
|
+
export const chatComposerContract = {
|
|
9
|
+
name: "chat-composer",
|
|
10
|
+
parts: ["root", "attachments", "field", "input", "hint", "actions", "trailing", "submit"],
|
|
11
|
+
styleProps: defineStyleProps(chatComposerOptions, { defaults: { layout: "stacked" } }),
|
|
12
|
+
};
|
|
13
|
+
export const ChatComposer = defineComponent(chatComposerContract, ({ value = "", placeholder = "写下消息…", inputLabel = "消息", attachments, trailing, hint, hintId, submitLabel = "发送", submitContent, disabled = false, submitDisabled = false, onSubmit, onInput, children, className, ...props }, context) => context.part("root", "form", {
|
|
14
|
+
...props,
|
|
15
|
+
className,
|
|
16
|
+
onSubmit,
|
|
17
|
+
}, attachments ? context.part("attachments", "div", null, attachments) : null, context.part("field", "div", null, context.part("input", "textarea", {
|
|
18
|
+
"data-chat-input": true,
|
|
19
|
+
name: "message",
|
|
20
|
+
rows: 1,
|
|
21
|
+
value,
|
|
22
|
+
placeholder,
|
|
23
|
+
"aria-label": inputLabel,
|
|
24
|
+
"aria-describedby": hint && hintId ? hintId : undefined,
|
|
25
|
+
disabled,
|
|
26
|
+
onInput,
|
|
27
|
+
}), hint ? context.part("hint", "span", hintId ? { id: hintId } : null, hint) : null), context.part("actions", "div", null, children, trailing ? context.part("trailing", "div", null, trailing) : null, context.part("submit", "button", {
|
|
28
|
+
type: "submit",
|
|
29
|
+
disabled: disabled ? true : submitDisabled,
|
|
30
|
+
"aria-label": submitLabel,
|
|
31
|
+
}, submitContent ?? h(Icon, { name: "arrow-up" })))));
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
type Viewport = Pick<HTMLElement, "scrollTop" | "scrollHeight" | "clientHeight">;
|
|
2
|
+
/** Append-only reading continuity. History insertion and transcript restoration belong to the host. */
|
|
3
|
+
export declare function createChatScroll(viewport: Viewport): {
|
|
4
|
+
atLatest: () => boolean;
|
|
5
|
+
restore: () => void;
|
|
6
|
+
read(): void;
|
|
7
|
+
latest(): void;
|
|
8
|
+
};
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/** Append-only reading continuity. History insertion and transcript restoration belong to the host. */
|
|
2
|
+
export function createChatScroll(viewport) {
|
|
3
|
+
let following = true;
|
|
4
|
+
let readingTop = viewport.scrollTop;
|
|
5
|
+
let height = viewport.clientHeight;
|
|
6
|
+
let contentHeight = viewport.scrollHeight;
|
|
7
|
+
const atLatest = () => viewport.scrollHeight - viewport.clientHeight - viewport.scrollTop <= 24;
|
|
8
|
+
const restore = () => {
|
|
9
|
+
if (!viewport.clientHeight)
|
|
10
|
+
return;
|
|
11
|
+
viewport.scrollTop = following
|
|
12
|
+
? Math.max(0, viewport.scrollHeight - viewport.clientHeight)
|
|
13
|
+
: readingTop;
|
|
14
|
+
readingTop = viewport.scrollTop;
|
|
15
|
+
height = viewport.clientHeight;
|
|
16
|
+
contentHeight = viewport.scrollHeight;
|
|
17
|
+
};
|
|
18
|
+
return {
|
|
19
|
+
atLatest,
|
|
20
|
+
restore,
|
|
21
|
+
read() {
|
|
22
|
+
if (!viewport.clientHeight)
|
|
23
|
+
return;
|
|
24
|
+
if (height !== viewport.clientHeight || contentHeight !== viewport.scrollHeight) {
|
|
25
|
+
restore();
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
readingTop = viewport.scrollTop;
|
|
29
|
+
following = atLatest();
|
|
30
|
+
},
|
|
31
|
+
latest() {
|
|
32
|
+
following = true;
|
|
33
|
+
restore();
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type Props } from "meowjsx";
|
|
2
|
+
export declare const chatConversationContract: {
|
|
3
|
+
readonly name: "chat-conversation";
|
|
4
|
+
readonly parts: readonly ["root", "viewport", "content", "latest"];
|
|
5
|
+
};
|
|
6
|
+
export interface ChatConversationProps extends Props {
|
|
7
|
+
ariaLabel?: string;
|
|
8
|
+
latestLabel?: string;
|
|
9
|
+
className?: string;
|
|
10
|
+
}
|
|
11
|
+
/** Presentation only, for hosts that already own transcript scrolling. */
|
|
12
|
+
export declare const ChatConversationLatest: import("meowjsx").Component<Props, "chat-conversation", "content" | "latest" | "root" | "viewport">;
|
|
13
|
+
/** Optional scroll owner for append-only transcripts. Give the root a constrained height.
|
|
14
|
+
* Do not combine with an application-owned scroll controller. Children can use ChatMessageList.
|
|
15
|
+
*/
|
|
16
|
+
export declare const ChatConversation: import("meowjsx").Component<ChatConversationProps, "chat-conversation", "content" | "latest" | "root" | "viewport">;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { defineComponent } from "meowjsx";
|
|
2
|
+
import { createChatScroll } from "./conversation-scroll.js";
|
|
3
|
+
export const chatConversationContract = {
|
|
4
|
+
name: "chat-conversation",
|
|
5
|
+
parts: ["root", "viewport", "content", "latest"],
|
|
6
|
+
};
|
|
7
|
+
/** Presentation only, for hosts that already own transcript scrolling. */
|
|
8
|
+
export const ChatConversationLatest = defineComponent(chatConversationContract, ({ children, ...props }, context) => context.part("latest", "button", { type: "button", ...props }, children ?? "回到最新消息"));
|
|
9
|
+
/** Optional scroll owner for append-only transcripts. Give the root a constrained height.
|
|
10
|
+
* Do not combine with an application-owned scroll controller. Children can use ChatMessageList.
|
|
11
|
+
*/
|
|
12
|
+
export const ChatConversation = defineComponent(chatConversationContract, ({ children, ariaLabel = "对话阅读区", latestLabel = "回到最新消息", className, ...props }, context) => {
|
|
13
|
+
const hidden = context.signal(true);
|
|
14
|
+
let jump;
|
|
15
|
+
const mount = (root) => {
|
|
16
|
+
let disposed = false;
|
|
17
|
+
let cleanup;
|
|
18
|
+
queueMicrotask(() => {
|
|
19
|
+
if (disposed || !root.isConnected)
|
|
20
|
+
return;
|
|
21
|
+
const viewport = root.children[0];
|
|
22
|
+
const content = viewport.firstElementChild;
|
|
23
|
+
const position = createChatScroll(viewport);
|
|
24
|
+
const update = () => {
|
|
25
|
+
hidden.value = position.atLatest();
|
|
26
|
+
};
|
|
27
|
+
const resize = () => {
|
|
28
|
+
position.restore();
|
|
29
|
+
update();
|
|
30
|
+
};
|
|
31
|
+
const scroll = () => {
|
|
32
|
+
position.read();
|
|
33
|
+
update();
|
|
34
|
+
};
|
|
35
|
+
jump = () => {
|
|
36
|
+
viewport.focus({ preventScroll: true });
|
|
37
|
+
position.latest();
|
|
38
|
+
update();
|
|
39
|
+
};
|
|
40
|
+
viewport.addEventListener("scroll", scroll, { passive: true });
|
|
41
|
+
const observer = new ResizeObserver(resize);
|
|
42
|
+
observer.observe(viewport);
|
|
43
|
+
observer.observe(content);
|
|
44
|
+
resize();
|
|
45
|
+
cleanup = () => {
|
|
46
|
+
observer.disconnect();
|
|
47
|
+
viewport.removeEventListener("scroll", scroll);
|
|
48
|
+
jump = undefined;
|
|
49
|
+
};
|
|
50
|
+
});
|
|
51
|
+
return () => {
|
|
52
|
+
disposed = true;
|
|
53
|
+
cleanup?.();
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
return context.part("root", "div", { ...props, className, ref: mount }, context.part("viewport", "div", {
|
|
57
|
+
role: "region",
|
|
58
|
+
"aria-label": ariaLabel,
|
|
59
|
+
tabIndex: 0,
|
|
60
|
+
style: { overflowY: "auto", minHeight: 0, height: "100%", overflowAnchor: "none" },
|
|
61
|
+
}, context.part("content", "div", { style: { display: "flow-root" } }, children)), context.part("latest", "button", { type: "button", hidden, onClick: () => jump?.() }, latestLabel));
|
|
62
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type Props } from "meowjsx";
|
|
2
|
+
export declare const chatFrameContract: {
|
|
3
|
+
readonly name: "chat-frame";
|
|
4
|
+
readonly parts: readonly ["root"];
|
|
5
|
+
};
|
|
6
|
+
export interface ChatFrameProps extends Props {
|
|
7
|
+
className?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const ChatFrame: import("meowjsx").Component<ChatFrameProps, "chat-frame", "root">;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { defineComponent } from "meowjsx";
|
|
2
|
+
export const chatFrameContract = {
|
|
3
|
+
name: "chat-frame",
|
|
4
|
+
parts: ["root"],
|
|
5
|
+
};
|
|
6
|
+
export const ChatFrame = defineComponent(chatFrameContract, ({ children, className, ...props }, context) => context.part("root", "section", { ...props, className }, children));
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type Child, type Props } from "meowjsx";
|
|
2
|
+
export declare const chatHeaderContract: {
|
|
3
|
+
readonly name: "chat-header";
|
|
4
|
+
readonly parts: readonly ["root", "identity", "eyebrow", "title", "description", "controls", "status", "actions"];
|
|
5
|
+
};
|
|
6
|
+
export interface ChatHeaderProps extends Props {
|
|
7
|
+
eyebrow?: string;
|
|
8
|
+
title: string;
|
|
9
|
+
description?: Child;
|
|
10
|
+
status?: Child;
|
|
11
|
+
actions?: Child;
|
|
12
|
+
className?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare const ChatHeader: import("meowjsx").Component<ChatHeaderProps, "chat-header", "actions" | "controls" | "description" | "eyebrow" | "identity" | "root" | "status" | "title">;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { defineComponent } from "meowjsx";
|
|
2
|
+
export const chatHeaderContract = {
|
|
3
|
+
name: "chat-header",
|
|
4
|
+
parts: ["root", "identity", "eyebrow", "title", "description", "controls", "status", "actions"],
|
|
5
|
+
};
|
|
6
|
+
export const ChatHeader = defineComponent(chatHeaderContract, ({ eyebrow, title, description, status, actions, className, ...props }, context) => context.part("root", "header", { ...props, className }, context.part("identity", "div", null, [
|
|
7
|
+
eyebrow ? context.part("eyebrow", "span", null, eyebrow) : null,
|
|
8
|
+
context.part("title", "h2", null, title),
|
|
9
|
+
description ? context.part("description", "p", null, description) : null,
|
|
10
|
+
]), status || actions
|
|
11
|
+
? context.part("controls", "div", null, [
|
|
12
|
+
status ? context.part("status", "div", null, status) : null,
|
|
13
|
+
actions ? context.part("actions", "div", null, actions) : null,
|
|
14
|
+
])
|
|
15
|
+
: null));
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export { ChatAttachments, type ChatAttachmentItem, type ChatAttachmentsProps, chatAttachmentsContract, } from "./attachments.js";
|
|
2
|
+
export { ChatComposer, type ChatComposerProps, type ChatComposerInput, type ChatComposerSubmit, chatComposerContract, chatComposerOptions, } from "./composer.js";
|
|
3
|
+
export { ChatFrame, type ChatFrameProps, chatFrameContract } from "./frame.js";
|
|
4
|
+
export { AssistantView, assistantViewContract, assistantCopy, type AssistantViewProps, type AssistantDraft, type AssistantAttachment, type AssistantMessage, type AssistantMessagePart, type AssistantProcessStep, type AssistantActivity, type AssistantWork, type AssistantQuestion, type AssistantChoice, type AssistantLabels, } from "./assistant.js";
|
|
5
|
+
export { ChatHeader, type ChatHeaderProps, chatHeaderContract } from "./header.js";
|
|
6
|
+
export { ChatMessage, type ChatMessageProps, type ChatMessageRole, type ChatMessageStatus, chatMessageContract, } from "./message.js";
|
|
7
|
+
export { ChatMessageActions, type ChatMessageActionsProps, chatMessageActionsContract, } from "./message-actions.js";
|
|
8
|
+
export { ChatMessageList, ChatMessageListContent, ChatMessageListItem, ChatMessageListDate, type ChatMessageListContentProps, type ChatMessageListDateProps, type ChatMessageListProps, chatMessageListContract, } from "./message-list.js";
|
|
9
|
+
export { ChatStatus, type ChatStatusProps, type ChatStatusTone, chatStatusContract, chatStatusOptions, } from "./status.js";
|
|
10
|
+
export { ChatToolCall, type ChatToolCallProps, type ChatToolCallState, chatToolCallContract, } from "./tool-call.js";
|
|
11
|
+
export { ChatProcess, chatProcessContract, type ChatProcessProps } from "./process.js";
|
|
12
|
+
export { ChatQuestion, chatQuestionContract, type ChatQuestionProps } from "./question.js";
|
|
13
|
+
export { ChatSources, chatSourcesContract, type ChatSourcesProps, type ChatSource, } from "./sources.js";
|
|
14
|
+
export { ChatBubble, chatBubbleContract, chatBubbleOptions, type ChatBubbleProps } from "./bubble.js";
|
|
15
|
+
export { ChatConversation, ChatConversationLatest, type ChatConversationProps, chatConversationContract, } from "./conversation.js";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export { ChatAttachments, chatAttachmentsContract, } from "./attachments.js";
|
|
2
|
+
export { ChatComposer, chatComposerContract, chatComposerOptions, } from "./composer.js";
|
|
3
|
+
export { ChatFrame, chatFrameContract } from "./frame.js";
|
|
4
|
+
export { AssistantView, assistantViewContract, assistantCopy, } from "./assistant.js";
|
|
5
|
+
export { ChatHeader, chatHeaderContract } from "./header.js";
|
|
6
|
+
export { ChatMessage, chatMessageContract, } from "./message.js";
|
|
7
|
+
export { ChatMessageActions, chatMessageActionsContract, } from "./message-actions.js";
|
|
8
|
+
export { ChatMessageList, ChatMessageListContent, ChatMessageListItem, ChatMessageListDate, chatMessageListContract, } from "./message-list.js";
|
|
9
|
+
export { ChatStatus, chatStatusContract, chatStatusOptions, } from "./status.js";
|
|
10
|
+
export { ChatToolCall, chatToolCallContract, } from "./tool-call.js";
|
|
11
|
+
export { ChatProcess, chatProcessContract } from "./process.js";
|
|
12
|
+
export { ChatQuestion, chatQuestionContract } from "./question.js";
|
|
13
|
+
export { ChatSources, chatSourcesContract, } from "./sources.js";
|
|
14
|
+
export { ChatBubble, chatBubbleContract, chatBubbleOptions } from "./bubble.js";
|
|
15
|
+
export { ChatConversation, ChatConversationLatest, chatConversationContract, } from "./conversation.js";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type Props } from "meowjsx";
|
|
2
|
+
export declare const chatMessageActionsContract: {
|
|
3
|
+
readonly name: "chat-message-actions";
|
|
4
|
+
readonly parts: readonly ["root"];
|
|
5
|
+
};
|
|
6
|
+
export interface ChatMessageActionsProps extends Props {
|
|
7
|
+
className?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const ChatMessageActions: import("meowjsx").Component<ChatMessageActionsProps, "chat-message-actions", "root">;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { defineComponent } from "meowjsx";
|
|
2
|
+
export const chatMessageActionsContract = {
|
|
3
|
+
name: "chat-message-actions",
|
|
4
|
+
parts: ["root"],
|
|
5
|
+
};
|
|
6
|
+
export const ChatMessageActions = defineComponent(chatMessageActionsContract, ({ children, className, ...props }, context) => context.part("root", "div", { ...props, className }, children));
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type Props } from "meowjsx";
|
|
2
|
+
export declare const chatMessageListContract: {
|
|
3
|
+
readonly name: "chat-message-list";
|
|
4
|
+
readonly parts: readonly ["root", "content", "item", "date"];
|
|
5
|
+
};
|
|
6
|
+
export interface ChatMessageListProps extends Props {
|
|
7
|
+
className?: string;
|
|
8
|
+
ariaLabel?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare const ChatMessageList: import("meowjsx").Component<ChatMessageListProps, "chat-message-list", "content" | "date" | "item" | "root">;
|
|
11
|
+
export interface ChatMessageListContentProps extends Props {
|
|
12
|
+
className?: string;
|
|
13
|
+
}
|
|
14
|
+
/** The independently rendered message target inside a ChatMessageList. */
|
|
15
|
+
export declare const ChatMessageListContent: import("meowjsx").Component<ChatMessageListContentProps, "chat-message-list", "content" | "date" | "item" | "root">;
|
|
16
|
+
export interface ChatMessageListDateProps extends Props {
|
|
17
|
+
label: string;
|
|
18
|
+
className?: string;
|
|
19
|
+
}
|
|
20
|
+
/** Hosts one message; the caller determines continuity from its own message identity. */
|
|
21
|
+
export declare const ChatMessageListItem: import("meowjsx").Component<Props & {
|
|
22
|
+
continuation?: boolean;
|
|
23
|
+
}, "chat-message-list", "content" | "date" | "item" | "root">;
|
|
24
|
+
/** A date separator that keeps its visual treatment in the Chat theme. */
|
|
25
|
+
export declare const ChatMessageListDate: import("meowjsx").Component<ChatMessageListDateProps, "chat-message-list", "content" | "date" | "item" | "root">;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { defineComponent } from "meowjsx";
|
|
2
|
+
export const chatMessageListContract = {
|
|
3
|
+
name: "chat-message-list",
|
|
4
|
+
parts: ["root", "content", "item", "date"],
|
|
5
|
+
};
|
|
6
|
+
export const ChatMessageList = defineComponent(chatMessageListContract, ({ children, className, ariaLabel = "消息记录", ...props }, context) => context.part("root", "div", {
|
|
7
|
+
...props,
|
|
8
|
+
className,
|
|
9
|
+
role: "log",
|
|
10
|
+
"aria-label": ariaLabel,
|
|
11
|
+
"aria-live": "polite",
|
|
12
|
+
}, children));
|
|
13
|
+
/** The independently rendered message target inside a ChatMessageList. */
|
|
14
|
+
export const ChatMessageListContent = defineComponent(chatMessageListContract, ({ children, className, ...props }, context) => context.part("content", "div", { ...props, className }, children));
|
|
15
|
+
/** Hosts one message; the caller determines continuity from its own message identity. */
|
|
16
|
+
export const ChatMessageListItem = defineComponent(chatMessageListContract, ({ children, continuation = false, ...props }, context) => context.part("item", "div", { ...props, "data-chat-continuation": String(continuation) }, children));
|
|
17
|
+
/** A date separator that keeps its visual treatment in the Chat theme. */
|
|
18
|
+
export const ChatMessageListDate = defineComponent(chatMessageListContract, ({ label, children, className, ...props }, context) => context.part("date", "div", {
|
|
19
|
+
...props,
|
|
20
|
+
className,
|
|
21
|
+
role: "separator",
|
|
22
|
+
"aria-label": props["aria-label"] ?? label,
|
|
23
|
+
}, children ?? label));
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type Child, type Props } from "meowjsx";
|
|
2
|
+
export declare const chatMessageContract: {
|
|
3
|
+
readonly name: "chat-message";
|
|
4
|
+
readonly parts: readonly ["root", "avatar", "body", "meta", "author", "time", "status", "content", "actions", "header", "footer"];
|
|
5
|
+
};
|
|
6
|
+
export type ChatMessageRole = "user" | "assistant" | "system" | "tool";
|
|
7
|
+
export type ChatMessageStatus = "complete" | "streaming" | "error" | "pending";
|
|
8
|
+
export interface ChatMessageProps extends Props {
|
|
9
|
+
role: ChatMessageRole;
|
|
10
|
+
author: string;
|
|
11
|
+
timestamp?: string;
|
|
12
|
+
dateTime?: string;
|
|
13
|
+
status?: ChatMessageStatus;
|
|
14
|
+
avatar?: Child;
|
|
15
|
+
actions?: Child;
|
|
16
|
+
header?: Child;
|
|
17
|
+
footer?: Child;
|
|
18
|
+
/** Omit the automatic surface when composing multiple bubbles, files or process blocks. */
|
|
19
|
+
surface?: "auto" | "none";
|
|
20
|
+
className?: string;
|
|
21
|
+
/** Joins a reply, retaining its author and the column of a supplied avatar. */
|
|
22
|
+
continuation?: boolean;
|
|
23
|
+
}
|
|
24
|
+
export declare const ChatMessage: import("meowjsx").Component<ChatMessageProps, "chat-message", "actions" | "author" | "avatar" | "body" | "content" | "footer" | "header" | "meta" | "root" | "status" | "time">;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { h, defineComponent } from "meowjsx";
|
|
2
|
+
import { ChatBubble } from "./bubble.js";
|
|
3
|
+
import { messageRoleContext } from "./message-context.js";
|
|
4
|
+
export const chatMessageContract = {
|
|
5
|
+
name: "chat-message",
|
|
6
|
+
parts: [
|
|
7
|
+
"root",
|
|
8
|
+
"avatar",
|
|
9
|
+
"body",
|
|
10
|
+
"meta",
|
|
11
|
+
"author",
|
|
12
|
+
"time",
|
|
13
|
+
"status",
|
|
14
|
+
"content",
|
|
15
|
+
"actions",
|
|
16
|
+
"header",
|
|
17
|
+
"footer",
|
|
18
|
+
],
|
|
19
|
+
};
|
|
20
|
+
export const ChatMessage = defineComponent(chatMessageContract, ({ children, role, author, timestamp, dateTime, status = "complete", avatar, actions, header, footer, surface = "auto", className, continuation = false, ...props }, context) => (h(messageRoleContext.Provider, { value: role }, context.part("root", "article", {
|
|
21
|
+
...props,
|
|
22
|
+
className,
|
|
23
|
+
"data-chat-role": role,
|
|
24
|
+
"data-chat-status": status,
|
|
25
|
+
"data-chat-continuation": continuation,
|
|
26
|
+
}, avatar !== undefined && avatar !== null
|
|
27
|
+
? context.part("avatar", "div", null, avatar)
|
|
28
|
+
: null, context.part("body", "div", null, header !== undefined
|
|
29
|
+
? context.part("header", "div", null, header)
|
|
30
|
+
: context.part("meta", "div", null, context.part("author", "strong", null, author), timestamp ? context.part("time", "time", { datetime: dateTime }, timestamp) : null, status !== "complete"
|
|
31
|
+
? context.part("status", "span", null, status === "streaming"
|
|
32
|
+
? "生成中"
|
|
33
|
+
: status === "pending"
|
|
34
|
+
? "等待中"
|
|
35
|
+
: "未完成")
|
|
36
|
+
: null), context.part("content", "div", null, surface === "none" ? children : h(ChatBubble, null, children)), footer !== undefined ? context.part("footer", "div", null, footer) : null, actions ? context.part("actions", "div", null, actions) : null)))));
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type Child, type Props } from "meowjsx";
|
|
2
|
+
export declare const chatProcessContract: {
|
|
3
|
+
readonly name: "chat-process";
|
|
4
|
+
readonly parts: readonly ["root", "summary", "icon", "expandedIcon", "label", "body"];
|
|
5
|
+
};
|
|
6
|
+
export interface ChatProcessProps extends Props {
|
|
7
|
+
label: string;
|
|
8
|
+
icon?: Child;
|
|
9
|
+
open?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare const ChatProcess: import("meowjsx").Component<ChatProcessProps, "chat-process", "body" | "expandedIcon" | "icon" | "label" | "root" | "summary">;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { h, defineComponent } from "meowjsx";
|
|
2
|
+
import { Icon } from "../icons/icon.js";
|
|
3
|
+
export const chatProcessContract = {
|
|
4
|
+
name: "chat-process",
|
|
5
|
+
parts: ["root", "summary", "icon", "expandedIcon", "label", "body"],
|
|
6
|
+
};
|
|
7
|
+
export const ChatProcess = defineComponent(chatProcessContract, ({ label, icon, children, open = false, ...props }, context) => context.part("root", "details", { ...props, open, "data-process-icon": icon ? "custom" : undefined }, context.part("summary", "summary", null, context.part("icon", "span", { "aria-hidden": "true" }, icon ?? h(Icon, { name: "chevron-right" })), icon
|
|
8
|
+
? context.part("expandedIcon", "span", { "aria-hidden": "true" }, h(Icon, { name: "chevron-up" }))
|
|
9
|
+
: null, context.part("label", "span", null, label)), context.part("body", "div", null, children)));
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type Child, type Props } from "meowjsx";
|
|
2
|
+
export declare const chatQuestionContract: {
|
|
3
|
+
readonly name: "chat-question";
|
|
4
|
+
readonly parts: readonly ["root", "eyebrow", "title", "description", "content", "feedback", "actions"];
|
|
5
|
+
};
|
|
6
|
+
export interface ChatQuestionProps extends Props {
|
|
7
|
+
label?: Child;
|
|
8
|
+
question?: Child;
|
|
9
|
+
questionId?: string;
|
|
10
|
+
description?: Child;
|
|
11
|
+
feedback?: Child;
|
|
12
|
+
actions?: Child;
|
|
13
|
+
}
|
|
14
|
+
/** Presentation only: submission, cancellation and question lifetime belong to the host. */
|
|
15
|
+
export declare const ChatQuestion: import("meowjsx").Component<ChatQuestionProps, "chat-question", "actions" | "content" | "description" | "eyebrow" | "feedback" | "root" | "title">;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { defineComponent } from "meowjsx";
|
|
2
|
+
export const chatQuestionContract = {
|
|
3
|
+
name: "chat-question",
|
|
4
|
+
parts: ["root", "eyebrow", "title", "description", "content", "feedback", "actions"],
|
|
5
|
+
};
|
|
6
|
+
/** Presentation only: submission, cancellation and question lifetime belong to the host. */
|
|
7
|
+
export const ChatQuestion = defineComponent(chatQuestionContract, ({ label = "需要你回答", question, questionId, description, feedback, actions, children, ...props }, context) => context.part("root", "section", { ...props, "aria-labelledby": questionId ?? props["aria-labelledby"] }, context.part("eyebrow", "div", null, label), question ? context.part("title", "p", { id: questionId }, question) : null, description ? context.part("description", "p", null, description) : null, context.part("content", "div", null, children), feedback ? context.part("feedback", "div", { role: "status" }, feedback) : null, actions ? context.part("actions", "div", null, actions) : null));
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type Props } from "meowjsx";
|
|
2
|
+
export declare const chatSourcesContract: {
|
|
3
|
+
readonly name: "chat-sources";
|
|
4
|
+
readonly parts: readonly ["root", "summary", "icon", "list", "item", "link", "description"];
|
|
5
|
+
};
|
|
6
|
+
export interface ChatSource {
|
|
7
|
+
title: string;
|
|
8
|
+
url: string;
|
|
9
|
+
description?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface ChatSourcesProps extends Props {
|
|
12
|
+
items: readonly ChatSource[];
|
|
13
|
+
label?: string;
|
|
14
|
+
}
|
|
15
|
+
export declare const ChatSources: import("meowjsx").Component<ChatSourcesProps, "chat-sources", "description" | "icon" | "item" | "link" | "list" | "root" | "summary">;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { h, defineComponent } from "meowjsx";
|
|
2
|
+
import { Icon } from "../icons/icon.js";
|
|
3
|
+
export const chatSourcesContract = {
|
|
4
|
+
name: "chat-sources",
|
|
5
|
+
parts: ["root", "summary", "icon", "list", "item", "link", "description"],
|
|
6
|
+
};
|
|
7
|
+
export const ChatSources = defineComponent(chatSourcesContract, ({ items, label = "来源", ...props }, context) => {
|
|
8
|
+
const links = items.filter(({ url }) => {
|
|
9
|
+
try {
|
|
10
|
+
return ["http:", "https:"].includes(new URL(url).protocol);
|
|
11
|
+
}
|
|
12
|
+
catch {
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
if (!links.length)
|
|
17
|
+
return null;
|
|
18
|
+
return context.part("root", "details", props, context.part("summary", "summary", null, context.part("icon", "span", { "aria-hidden": "true" }, h(Icon, { name: "chevron-right" })), `${label} · ${links.length}`), context.part("list", "ul", null, links.map(({ title, url, description }) => context.part("item", "li", null, context.part("link", "a", { href: url, target: "_blank", rel: "noreferrer" }, title), description ? context.part("description", "small", null, description) : null))));
|
|
19
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type ThemedProps } from "meowcss/meowjsx";
|
|
2
|
+
import { type Props } from "meowjsx";
|
|
3
|
+
export declare const chatStatusOptions: import("meowcss").Options<{
|
|
4
|
+
readonly tone: readonly ["online", "busy", "waiting", "error", "idle"];
|
|
5
|
+
}>;
|
|
6
|
+
export declare const chatStatusContract: {
|
|
7
|
+
readonly name: "chat-status";
|
|
8
|
+
readonly parts: readonly ["root", "dot", "label"];
|
|
9
|
+
readonly styleProps: import("meowcss/meowjsx").StylePropsBinding<import("meowcss").Options<{
|
|
10
|
+
readonly tone: readonly ["online", "busy", "waiting", "error", "idle"];
|
|
11
|
+
}>>;
|
|
12
|
+
};
|
|
13
|
+
export type ChatStatusTone = (typeof chatStatusOptions.axes.tone)[number];
|
|
14
|
+
export interface ChatStatusProps extends Props, ThemedProps<typeof chatStatusOptions> {
|
|
15
|
+
label: string;
|
|
16
|
+
className?: string;
|
|
17
|
+
}
|
|
18
|
+
export declare const ChatStatus: import("meowjsx").Component<ChatStatusProps, "chat-status", "dot" | "label" | "root">;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { defineOptions } from "meowcss";
|
|
2
|
+
import { defineStyleProps } from "meowcss/meowjsx";
|
|
3
|
+
import { defineComponent } from "meowjsx";
|
|
4
|
+
export const chatStatusOptions = defineOptions("chat-status", {
|
|
5
|
+
tone: ["online", "busy", "waiting", "error", "idle"],
|
|
6
|
+
});
|
|
7
|
+
export const chatStatusContract = {
|
|
8
|
+
name: "chat-status",
|
|
9
|
+
parts: ["root", "dot", "label"],
|
|
10
|
+
styleProps: defineStyleProps(chatStatusOptions, { defaults: { tone: "idle" } }),
|
|
11
|
+
};
|
|
12
|
+
export const ChatStatus = defineComponent(chatStatusContract, ({ label, className, ...props }, context) => context.part("root", "span", {
|
|
13
|
+
...props,
|
|
14
|
+
className,
|
|
15
|
+
role: "status",
|
|
16
|
+
}, context.part("dot", "i", { "aria-hidden": "true" }), context.part("label", "span", { "data-chat-status-label": true }, label)));
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type Child, type Props } from "meowjsx";
|
|
2
|
+
export declare const chatToolCallContract: {
|
|
3
|
+
readonly name: "chat-tool-call";
|
|
4
|
+
readonly parts: readonly ["root", "header", "icon", "label", "summary", "status", "chevron", "detail", "body"];
|
|
5
|
+
};
|
|
6
|
+
export type ChatToolCallState = "running" | "complete" | "waiting" | "error" | "unknown";
|
|
7
|
+
export interface ChatToolCallProps extends Props {
|
|
8
|
+
label: string;
|
|
9
|
+
/** Short target or action summary, visible while collapsed. */
|
|
10
|
+
summary?: string;
|
|
11
|
+
state?: ChatToolCallState;
|
|
12
|
+
statusLabel?: string;
|
|
13
|
+
detail?: Child;
|
|
14
|
+
icon?: Child;
|
|
15
|
+
/** Reveals this row's own body in place. */
|
|
16
|
+
collapsible?: boolean;
|
|
17
|
+
/** Runs the host's own action instead of revealing a body; the row keeps the row chrome. */
|
|
18
|
+
onActivate?: () => void;
|
|
19
|
+
className?: string;
|
|
20
|
+
}
|
|
21
|
+
export declare const ChatToolCall: import("meowjsx").Component<ChatToolCallProps, "chat-tool-call", "body" | "chevron" | "detail" | "header" | "icon" | "label" | "root" | "status" | "summary">;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { defineComponent, h } from "meowjsx";
|
|
2
|
+
import { Icon } from "../icons/icon.js";
|
|
3
|
+
export const chatToolCallContract = {
|
|
4
|
+
name: "chat-tool-call",
|
|
5
|
+
parts: ["root", "header", "icon", "label", "summary", "status", "chevron", "detail", "body"],
|
|
6
|
+
};
|
|
7
|
+
export const ChatToolCall = defineComponent(chatToolCallContract, ({ children, label, summary, state = "complete", statusLabel, detail, icon, collapsible = false, onActivate, className, ...props }, context) => {
|
|
8
|
+
const status = statusLabel ?? stateLabel(state);
|
|
9
|
+
// A completed row already shows its outcome in the leading glyph, so a status the caller
|
|
10
|
+
// did not spell out stays out of the reading column; it remains as the row's description.
|
|
11
|
+
const quietStatus = state === "complete" && !statusLabel;
|
|
12
|
+
// An activating row is an action of its own, so it never reveals a body: one interactive
|
|
13
|
+
// header, the same chrome, and the host decides what the action is.
|
|
14
|
+
const reveals = collapsible && onActivate === undefined;
|
|
15
|
+
const interactive = reveals || onActivate !== undefined;
|
|
16
|
+
return context.part("root", reveals ? "details" : "div", {
|
|
17
|
+
...props,
|
|
18
|
+
className,
|
|
19
|
+
"data-tool-state": state,
|
|
20
|
+
"data-tool-default-complete": quietStatus ? "true" : undefined,
|
|
21
|
+
"data-tool-interactive": interactive ? "true" : undefined,
|
|
22
|
+
"data-tool-collapsible": reveals ? "true" : undefined,
|
|
23
|
+
}, context.part("header", onActivate !== undefined ? "button" : reveals ? "summary" : "div", onActivate !== undefined ? { type: "button", onClick: onActivate } : null, context.part("icon", "span", { "aria-hidden": "true" }, icon ?? h(Icon, { name: "wrench" })), context.part("label", "strong", null, label), summary ? context.part("summary", "span", { title: summary }, summary) : null, context.part("status", "span", null, status), interactive
|
|
24
|
+
? context.part("chevron", "span", { "aria-hidden": "true" }, h(Icon, { name: "chevron-right" }))
|
|
25
|
+
: null), detail ? context.part("detail", "p", null, detail) : null, children ? context.part("body", "div", null, children) : null);
|
|
26
|
+
});
|
|
27
|
+
function stateLabel(state) {
|
|
28
|
+
switch (state) {
|
|
29
|
+
case "running":
|
|
30
|
+
return "运行中";
|
|
31
|
+
case "waiting":
|
|
32
|
+
return "等待中";
|
|
33
|
+
case "error":
|
|
34
|
+
return "出错";
|
|
35
|
+
case "unknown":
|
|
36
|
+
return "结果未确认";
|
|
37
|
+
default:
|
|
38
|
+
return "已完成";
|
|
39
|
+
}
|
|
40
|
+
}
|