meowtail 0.2.0-alpha.2 → 0.4.0-alpha.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/AGENT-COMPONENTS.md +4 -3
- package/ASSISTANT.md +7 -2
- package/CHANGELOG.md +96 -0
- package/COMPONENTS.md +342 -0
- package/JSON.md +1 -1
- package/README.md +177 -40
- package/THIRD_PARTY_NOTICES.md +47 -0
- package/dist/src/chat/assistant-composer.d.ts +10 -6
- package/dist/src/chat/assistant-composer.js +56 -93
- package/dist/src/chat/assistant-content.d.ts +29 -12
- package/dist/src/chat/assistant-content.js +87 -71
- package/dist/src/chat/assistant-markdown.d.ts +11 -7
- package/dist/src/chat/assistant-markdown.js +6 -5
- package/dist/src/chat/assistant-question.d.ts +10 -7
- package/dist/src/chat/assistant-question.js +34 -64
- package/dist/src/chat/assistant-scroll.d.ts +2 -0
- package/dist/src/chat/assistant-scroll.js +28 -1
- package/dist/src/chat/assistant-types.d.ts +24 -2
- package/dist/src/chat/assistant-types.js +7 -0
- package/dist/src/chat/assistant.d.ts +9 -6
- package/dist/src/chat/assistant.js +226 -193
- package/dist/src/chat/attachments.d.ts +10 -7
- package/dist/src/chat/attachments.js +46 -60
- package/dist/src/chat/bubble.d.ts +12 -13
- package/dist/src/chat/bubble.js +8 -13
- package/dist/src/chat/bubble.options.d.ts +3 -0
- package/dist/src/chat/bubble.options.js +4 -0
- package/dist/src/chat/composer-panel.d.ts +9 -8
- package/dist/src/chat/composer-panel.js +12 -6
- package/dist/src/chat/composer.d.ts +17 -18
- package/dist/src/chat/composer.js +52 -63
- package/dist/src/chat/composer.options.d.ts +4 -0
- package/dist/src/chat/composer.options.js +5 -0
- package/dist/src/chat/conversation.d.ts +19 -10
- package/dist/src/chat/conversation.js +24 -17
- package/dist/src/chat/frame.d.ts +10 -7
- package/dist/src/chat/frame.js +6 -3
- package/dist/src/chat/header.d.ts +10 -7
- package/dist/src/chat/header.js +14 -12
- package/dist/src/chat/index.d.ts +21 -17
- package/dist/src/chat/index.js +21 -17
- package/dist/src/chat/message-actions.d.ts +10 -7
- package/dist/src/chat/message-actions.js +6 -3
- package/dist/src/chat/message-context.d.ts +1 -1
- package/dist/src/chat/message-list.d.ts +32 -14
- package/dist/src/chat/message-list.js +19 -18
- package/dist/src/chat/message.d.ts +9 -7
- package/dist/src/chat/message.js +26 -19
- package/dist/src/chat/process.d.ts +9 -6
- package/dist/src/chat/process.js +13 -5
- package/dist/src/chat/question.d.ts +12 -7
- package/dist/src/chat/question.js +17 -4
- package/dist/src/chat/reasoning.d.ts +24 -0
- package/dist/src/chat/reasoning.js +29 -0
- package/dist/src/chat/sources.d.ts +12 -9
- package/dist/src/chat/sources.js +17 -8
- package/dist/src/chat/status.d.ts +13 -13
- package/dist/src/chat/status.js +11 -12
- package/dist/src/chat/status.options.d.ts +3 -0
- package/dist/src/chat/status.options.js +4 -0
- package/dist/src/chat/task.d.ts +9 -7
- package/dist/src/chat/task.js +46 -28
- package/dist/src/chat/tool-call.d.ts +11 -8
- package/dist/src/chat/tool-call.js +61 -51
- package/dist/src/components/accordion.d.ts +10 -7
- package/dist/src/components/accordion.js +10 -15
- package/dist/src/components/action-rail.d.ts +9 -7
- package/dist/src/components/action-rail.js +11 -8
- package/dist/src/components/action-row.d.ts +22 -0
- package/dist/src/components/action-row.js +18 -0
- package/dist/src/components/action-row.options.d.ts +4 -0
- package/dist/src/components/action-row.options.js +5 -0
- package/dist/src/components/alert.d.ts +20 -16
- package/dist/src/components/alert.js +16 -11
- package/dist/src/components/alert.options.d.ts +6 -0
- package/dist/src/components/alert.options.js +7 -0
- package/dist/src/components/app-bar.d.ts +9 -7
- package/dist/src/components/app-bar.js +12 -6
- package/dist/src/components/aspect-ratio.d.ts +13 -8
- package/dist/src/components/aspect-ratio.js +10 -14
- package/dist/src/components/avatar.d.ts +14 -13
- package/dist/src/components/avatar.js +16 -28
- package/dist/src/components/avatar.options.d.ts +3 -0
- package/dist/src/components/avatar.options.js +4 -0
- package/dist/src/components/badge.d.ts +16 -15
- package/dist/src/components/badge.js +9 -12
- package/dist/src/components/badge.options.d.ts +4 -0
- package/dist/src/components/badge.options.js +5 -0
- package/dist/src/components/breadcrumb.d.ts +10 -7
- package/dist/src/components/breadcrumb.js +9 -7
- package/dist/src/components/button.d.ts +16 -25
- package/dist/src/components/button.js +9 -20
- package/dist/src/components/button.options.d.ts +9 -0
- package/dist/src/components/button.options.js +10 -0
- package/dist/src/components/card-action.d.ts +10 -7
- package/dist/src/components/card-action.js +6 -6
- package/dist/src/components/card-content.d.ts +10 -7
- package/dist/src/components/card-content.js +6 -6
- package/dist/src/components/card-description.d.ts +10 -7
- package/dist/src/components/card-description.js +6 -6
- package/dist/src/components/card-footer.d.ts +10 -7
- package/dist/src/components/card-footer.js +7 -6
- package/dist/src/components/card-header.d.ts +10 -7
- package/dist/src/components/card-header.js +6 -6
- package/dist/src/components/card-title.d.ts +10 -7
- package/dist/src/components/card-title.js +6 -6
- package/dist/src/components/card.d.ts +15 -13
- package/dist/src/components/card.js +13 -11
- package/dist/src/components/card.options.d.ts +3 -0
- package/dist/src/components/card.options.js +2 -0
- package/dist/src/components/checkbox.d.ts +11 -7
- package/dist/src/components/checkbox.js +43 -39
- package/dist/src/components/choice-group.d.ts +10 -7
- package/dist/src/components/choice-group.js +37 -40
- package/dist/src/components/choice-select.d.ts +10 -7
- package/dist/src/components/choice-select.js +106 -147
- package/dist/src/components/code-block.d.ts +28 -6
- package/dist/src/components/code-block.js +40 -21
- package/dist/src/components/container.d.ts +15 -13
- package/dist/src/components/container.js +13 -11
- package/dist/src/components/container.options.d.ts +3 -0
- package/dist/src/components/container.options.js +4 -0
- package/dist/src/components/context-menu.d.ts +10 -7
- package/dist/src/components/context-menu.js +9 -21
- package/dist/src/components/credential-source.js +4 -10
- package/dist/src/components/description-list.d.ts +17 -13
- package/dist/src/components/description-list.js +11 -11
- package/dist/src/components/detail-section.d.ts +9 -7
- package/dist/src/components/detail-section.js +12 -8
- package/dist/src/components/dialog-actions.d.ts +12 -0
- package/dist/src/components/dialog-actions.js +7 -0
- package/dist/src/components/dialog-header.d.ts +18 -0
- package/dist/src/components/dialog-header.js +14 -0
- package/dist/src/components/dialog-panel.d.ts +14 -0
- package/dist/src/components/dialog-panel.js +8 -0
- package/dist/src/components/dialog.d.ts +12 -38
- package/dist/src/components/dialog.js +10 -29
- package/dist/src/components/diff-block.d.ts +12 -7
- package/dist/src/components/diff-block.js +12 -15
- package/dist/src/components/disclosure.d.ts +16 -10
- package/dist/src/components/disclosure.js +14 -13
- package/dist/src/components/drawer.d.ts +10 -7
- package/dist/src/components/drawer.js +37 -38
- package/dist/src/components/empty-state.d.ts +23 -13
- package/dist/src/components/empty-state.js +18 -7
- package/dist/src/components/empty-state.options.d.ts +3 -0
- package/dist/src/components/empty-state.options.js +2 -0
- package/dist/src/components/field-group.d.ts +10 -7
- package/dist/src/components/field-group.js +12 -15
- package/dist/src/components/field.d.ts +13 -8
- package/dist/src/components/field.js +56 -22
- package/dist/src/components/grid.d.ts +18 -20
- package/dist/src/components/grid.js +21 -23
- package/dist/src/components/grid.options.d.ts +7 -0
- package/dist/src/components/grid.options.js +8 -0
- package/dist/src/components/hover-card.d.ts +13 -8
- package/dist/src/components/hover-card.js +29 -38
- package/dist/src/components/icon-button.d.ts +18 -14
- package/dist/src/components/icon-button.js +9 -13
- package/dist/src/components/icon-button.options.d.ts +3 -0
- package/dist/src/components/icon-button.options.js +4 -0
- package/dist/src/components/icon-rail.d.ts +10 -7
- package/dist/src/components/icon-rail.js +15 -10
- package/dist/src/components/image-lightbox.d.ts +12 -7
- package/dist/src/components/image-lightbox.js +38 -43
- package/dist/src/components/image-preview.d.ts +8 -6
- package/dist/src/components/image-preview.js +25 -34
- package/dist/src/components/index.d.ts +104 -95
- package/dist/src/components/index.js +104 -95
- package/dist/src/components/inline.d.ts +14 -10
- package/dist/src/components/inline.js +20 -17
- package/dist/src/components/input.d.ts +10 -7
- package/dist/src/components/input.js +6 -6
- package/dist/src/components/item.d.ts +15 -15
- package/dist/src/components/item.js +17 -15
- package/dist/src/components/item.options.d.ts +4 -0
- package/dist/src/components/item.options.js +5 -0
- package/dist/src/components/json-block.d.ts +12 -7
- package/dist/src/components/json-block.js +16 -16
- package/dist/src/components/json-tree.d.ts +12 -7
- package/dist/src/components/json-tree.js +35 -35
- package/dist/src/components/layout-item.d.ts +9 -6
- package/dist/src/components/layout-item.js +17 -16
- package/dist/src/components/layout-types.d.ts +2 -6
- package/dist/src/components/layout-types.js +1 -6
- package/dist/src/components/layout.options.d.ts +5 -0
- package/dist/src/components/layout.options.js +6 -0
- package/dist/src/components/link.d.ts +9 -7
- package/dist/src/components/link.js +5 -6
- package/dist/src/components/list-group.d.ts +17 -13
- package/dist/src/components/list-group.js +19 -17
- package/dist/src/components/menu-button.d.ts +2 -1
- package/dist/src/components/menu.d.ts +11 -7
- package/dist/src/components/menu.js +49 -70
- package/dist/src/components/mermaid-diagram.d.ts +42 -0
- package/dist/src/components/mermaid-diagram.js +128 -0
- package/dist/src/components/meta-row.d.ts +16 -15
- package/dist/src/components/meta-row.js +30 -32
- package/dist/src/components/meta-row.options.d.ts +4 -0
- package/dist/src/components/meta-row.options.js +5 -0
- package/dist/src/components/modal.d.ts +42 -0
- package/dist/src/components/modal.js +104 -0
- package/dist/src/components/nav-item.d.ts +14 -7
- package/dist/src/components/nav-item.js +13 -15
- package/dist/src/components/nav-list.d.ts +51 -0
- package/dist/src/components/nav-list.js +54 -0
- package/dist/src/components/number-input.d.ts +10 -7
- package/dist/src/components/number-input.js +44 -71
- package/dist/src/components/output-block.d.ts +9 -6
- package/dist/src/components/output-block.js +22 -26
- package/dist/src/components/page-frame.d.ts +19 -16
- package/dist/src/components/page-frame.js +17 -10
- package/dist/src/components/page-frame.options.d.ts +4 -0
- package/dist/src/components/page-frame.options.js +5 -0
- package/dist/src/components/page-header.d.ts +15 -7
- package/dist/src/components/page-header.js +18 -7
- package/dist/src/components/page.d.ts +54 -0
- package/dist/src/components/page.js +27 -0
- package/dist/src/components/path-label.d.ts +13 -8
- package/dist/src/components/path-label.js +37 -36
- package/dist/src/components/path-picker.d.ts +10 -7
- package/dist/src/components/path-picker.js +18 -19
- package/dist/src/components/pill.d.ts +10 -7
- package/dist/src/components/pill.js +7 -9
- package/dist/src/components/popover.d.ts +11 -7
- package/dist/src/components/popover.js +171 -173
- package/dist/src/components/process-group.d.ts +14 -9
- package/dist/src/components/process-group.js +13 -4
- package/dist/src/components/process-step.d.ts +9 -7
- package/dist/src/components/process-step.js +8 -6
- package/dist/src/components/progress.d.ts +10 -7
- package/dist/src/components/progress.js +6 -11
- package/dist/src/components/prose.d.ts +23 -0
- package/dist/src/components/prose.js +17 -0
- package/dist/src/components/prose.options.d.ts +4 -0
- package/dist/src/components/prose.options.js +5 -0
- package/dist/src/components/rail-item.d.ts +9 -7
- package/dist/src/components/rail-item.js +10 -15
- package/dist/src/components/rail-section.d.ts +9 -7
- package/dist/src/components/rail-section.js +12 -6
- package/dist/src/components/read-block.d.ts +8 -6
- package/dist/src/components/read-block.js +53 -57
- package/dist/src/components/region-layout.d.ts +23 -4
- package/dist/src/components/region-layout.js +76 -72
- package/dist/src/components/resource-card.d.ts +9 -7
- package/dist/src/components/resource-card.js +17 -6
- package/dist/src/components/resource-link.d.ts +9 -7
- package/dist/src/components/resource-link.js +13 -10
- package/dist/src/components/risk-confirmation.d.ts +10 -7
- package/dist/src/components/risk-confirmation.js +7 -9
- package/dist/src/components/search-block.d.ts +9 -6
- package/dist/src/components/search-block.js +14 -16
- package/dist/src/components/search-input.d.ts +15 -9
- package/dist/src/components/search-input.js +12 -12
- package/dist/src/components/section.d.ts +44 -0
- package/dist/src/components/section.js +45 -0
- package/dist/src/components/segmented-control.d.ts +10 -7
- package/dist/src/components/segmented-control.js +50 -54
- package/dist/src/components/select.d.ts +11 -7
- package/dist/src/components/select.js +6 -6
- package/dist/src/components/separator.d.ts +10 -7
- package/dist/src/components/separator.js +6 -11
- package/dist/src/components/shortcut-keys.d.ts +13 -8
- package/dist/src/components/shortcut-keys.js +9 -7
- package/dist/src/components/skeleton-boundary.d.ts +14 -8
- package/dist/src/components/skeleton-boundary.js +30 -27
- package/dist/src/components/skeleton.d.ts +14 -13
- package/dist/src/components/skeleton.js +9 -11
- package/dist/src/components/skeleton.options.d.ts +3 -0
- package/dist/src/components/skeleton.options.js +2 -0
- package/dist/src/components/slider.d.ts +10 -7
- package/dist/src/components/slider.js +10 -24
- package/dist/src/components/spinner.d.ts +10 -7
- package/dist/src/components/spinner.js +8 -6
- package/dist/src/components/stack.d.ts +14 -10
- package/dist/src/components/stack.js +19 -16
- package/dist/src/components/state-dot.d.ts +13 -8
- package/dist/src/components/state-dot.js +23 -27
- package/dist/src/components/status-dot.d.ts +18 -26
- package/dist/src/components/status-dot.js +12 -21
- package/dist/src/components/status-dot.options.d.ts +9 -0
- package/dist/src/components/status-dot.options.js +10 -0
- package/dist/src/components/status.d.ts +10 -8
- package/dist/src/components/status.js +8 -7
- package/dist/src/components/switch.d.ts +8 -5
- package/dist/src/components/switch.js +9 -6
- package/dist/src/components/table.d.ts +15 -7
- package/dist/src/components/table.js +68 -75
- package/dist/src/components/table.options.d.ts +2 -0
- package/dist/src/components/table.options.js +3 -0
- package/dist/src/components/tabs.d.ts +11 -9
- package/dist/src/components/tabs.js +17 -37
- package/dist/src/components/tabs.options.d.ts +2 -0
- package/dist/src/components/tabs.options.js +3 -0
- package/dist/src/components/tag.d.ts +15 -19
- package/dist/src/components/tag.js +9 -12
- package/dist/src/components/tag.options.d.ts +6 -0
- package/dist/src/components/tag.options.js +7 -0
- package/dist/src/components/task-list.d.ts +35 -0
- package/dist/src/components/task-list.js +82 -0
- package/dist/src/components/terminal-block.d.ts +9 -6
- package/dist/src/components/terminal-block.js +32 -39
- package/dist/src/components/text-shimmer.d.ts +14 -8
- package/dist/src/components/text-shimmer.js +16 -10
- package/dist/src/components/text.d.ts +30 -0
- package/dist/src/components/text.js +24 -0
- package/dist/src/components/text.options.d.ts +3 -0
- package/dist/src/components/text.options.js +4 -0
- package/dist/src/components/textarea.d.ts +10 -7
- package/dist/src/components/textarea.js +6 -6
- package/dist/src/components/timeline.d.ts +18 -13
- package/dist/src/components/timeline.js +19 -12
- package/dist/src/components/toast.d.ts +13 -8
- package/dist/src/components/toast.js +12 -7
- package/dist/src/components/toolbar.d.ts +10 -7
- package/dist/src/components/toolbar.js +6 -22
- package/dist/src/components/tooltip.d.ts +9 -7
- package/dist/src/components/tooltip.js +19 -35
- package/dist/src/components/web-block.d.ts +9 -6
- package/dist/src/components/web-block.js +19 -21
- package/dist/src/components/window-title-bar.d.ts +9 -7
- package/dist/src/components/window-title-bar.js +11 -6
- package/dist/src/components/work-card.d.ts +10 -7
- package/dist/src/components/work-card.js +17 -6
- package/dist/src/icons/README.md +81 -1
- package/dist/src/icons/assistant-mark.d.ts +9 -0
- package/dist/src/icons/assistant-mark.js +10 -0
- package/dist/src/icons/doodle-cat.d.ts +2 -2
- package/dist/src/icons/doodle-cat.js +1 -1
- package/dist/src/icons/empty-stack.d.ts +10 -0
- package/dist/src/icons/empty-stack.js +16 -0
- package/dist/src/icons/file-type-icon.d.ts +2 -2
- package/dist/src/icons/icon-frame.d.ts +2 -2
- package/dist/src/icons/icon-frame.js +1 -1
- package/dist/src/icons/icon-source.d.ts +2 -2
- package/dist/src/icons/icon.d.ts +9 -3
- package/dist/src/icons/icon.js +8 -2
- package/dist/src/icons/index.d.ts +2 -0
- package/dist/src/icons/index.js +2 -0
- package/dist/src/icons/meowland-mark.d.ts +2 -2
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.js +2 -0
- package/dist/src/json/catalog.d.ts +2 -0
- package/dist/src/json/catalog.js +1 -0
- package/dist/src/registry/factory.d.ts +9 -0
- package/dist/src/registry/factory.js +9 -0
- package/dist/src/registry/index.d.ts +174 -596
- package/dist/src/registry/index.js +267 -261
- package/dist/src/shared/action-row-fit.d.ts +19 -0
- package/dist/src/shared/action-row-fit.js +59 -0
- package/dist/src/theme/audit.d.ts +2 -0
- package/dist/src/theme/audit.js +60 -0
- package/dist/src/theme/base.styles.d.ts +3 -2
- package/dist/src/theme/base.styles.js +43 -5
- package/dist/src/theme/chat/assistant.styles.d.ts +1 -1
- package/dist/src/theme/chat/assistant.styles.js +240 -133
- package/dist/src/theme/chat/attachments.styles.d.ts +1 -1
- package/dist/src/theme/chat/attachments.styles.js +96 -96
- package/dist/src/theme/chat/composer-panel.styles.d.ts +1 -1
- package/dist/src/theme/chat/composer-panel.styles.js +22 -22
- package/dist/src/theme/chat/composer.styles.d.ts +1 -1
- package/dist/src/theme/chat/composer.styles.js +256 -168
- package/dist/src/theme/chat/conversation.styles.d.ts +1 -1
- package/dist/src/theme/chat/conversation.styles.js +24 -25
- package/dist/src/theme/chat/frame.styles.d.ts +1 -1
- package/dist/src/theme/chat/frame.styles.js +35 -34
- package/dist/src/theme/chat/header.styles.d.ts +1 -1
- package/dist/src/theme/chat/header.styles.js +37 -37
- package/dist/src/theme/chat/message.styles.d.ts +1 -1
- package/dist/src/theme/chat/message.styles.js +132 -190
- package/dist/src/theme/chat/question.styles.d.ts +1 -1
- package/dist/src/theme/chat/question.styles.js +34 -33
- package/dist/src/theme/chat/reasoning.styles.d.ts +1 -0
- package/dist/src/theme/chat/reasoning.styles.js +142 -0
- package/dist/src/theme/chat/records.styles.d.ts +1 -1
- package/dist/src/theme/chat/records.styles.js +200 -243
- package/dist/src/theme/chat/status.styles.d.ts +1 -1
- package/dist/src/theme/chat/status.styles.js +14 -58
- package/dist/src/theme/chat/task.styles.d.ts +1 -1
- package/dist/src/theme/chat/task.styles.js +28 -29
- package/dist/src/theme/components/accordion.styles.d.ts +1 -1
- package/dist/src/theme/components/accordion.styles.js +29 -28
- package/dist/src/theme/components/action-rail.styles.d.ts +1 -1
- package/dist/src/theme/components/action-rail.styles.js +10 -10
- package/dist/src/theme/components/alert.styles.d.ts +1 -1
- package/dist/src/theme/components/alert.styles.js +37 -28
- package/dist/src/theme/components/app-bar.styles.d.ts +1 -1
- package/dist/src/theme/components/app-bar.styles.js +19 -18
- package/dist/src/theme/components/avatar.styles.d.ts +1 -1
- package/dist/src/theme/components/avatar.styles.js +18 -16
- package/dist/src/theme/components/badge.styles.d.ts +1 -1
- package/dist/src/theme/components/badge.styles.js +31 -30
- package/dist/src/theme/components/breadcrumb.styles.d.ts +1 -1
- package/dist/src/theme/components/breadcrumb.styles.js +21 -21
- package/dist/src/theme/components/button.styles.d.ts +1 -1
- package/dist/src/theme/components/button.styles.js +90 -78
- package/dist/src/theme/components/card.styles.d.ts +1 -1
- package/dist/src/theme/components/card.styles.js +52 -53
- package/dist/src/theme/components/choice-group.styles.d.ts +1 -1
- package/dist/src/theme/components/choice-group.styles.js +39 -38
- package/dist/src/theme/components/choice-select.styles.d.ts +1 -1
- package/dist/src/theme/components/choice-select.styles.js +79 -98
- package/dist/src/theme/components/code-block.styles.d.ts +1 -1
- package/dist/src/theme/components/code-block.styles.js +50 -32
- package/dist/src/theme/components/context-menu.styles.d.ts +1 -1
- package/dist/src/theme/components/context-menu.styles.js +7 -7
- package/dist/src/theme/components/description-list.styles.d.ts +1 -1
- package/dist/src/theme/components/description-list.styles.js +11 -10
- package/dist/src/theme/components/detail-section.styles.d.ts +1 -1
- package/dist/src/theme/components/detail-section.styles.js +15 -13
- package/dist/src/theme/components/dialog.styles.d.ts +1 -1
- package/dist/src/theme/components/dialog.styles.js +76 -42
- package/dist/src/theme/components/disclosure.styles.d.ts +1 -1
- package/dist/src/theme/components/disclosure.styles.js +31 -31
- package/dist/src/theme/components/drawer.styles.d.ts +1 -1
- package/dist/src/theme/components/drawer.styles.js +13 -13
- package/dist/src/theme/components/empty-state.styles.d.ts +1 -1
- package/dist/src/theme/components/empty-state.styles.js +30 -26
- package/dist/src/theme/components/field-group.styles.d.ts +1 -1
- package/dist/src/theme/components/field-group.styles.js +15 -15
- package/dist/src/theme/components/field.styles.d.ts +1 -1
- package/dist/src/theme/components/field.styles.js +17 -17
- package/dist/src/theme/components/hover-card.styles.d.ts +1 -1
- package/dist/src/theme/components/hover-card.styles.js +23 -23
- package/dist/src/theme/components/icon-rail.styles.d.ts +1 -1
- package/dist/src/theme/components/icon-rail.styles.js +50 -50
- package/dist/src/theme/components/image-lightbox.styles.d.ts +1 -1
- package/dist/src/theme/components/image-lightbox.styles.js +27 -27
- package/dist/src/theme/components/image-preview.styles.d.ts +1 -1
- package/dist/src/theme/components/image-preview.styles.js +23 -18
- package/dist/src/theme/components/item.styles.d.ts +1 -1
- package/dist/src/theme/components/item.styles.js +49 -44
- package/dist/src/theme/components/json.styles.d.ts +1 -1
- package/dist/src/theme/components/json.styles.js +82 -53
- package/dist/src/theme/components/layout.styles.d.ts +1 -1
- package/dist/src/theme/components/layout.styles.js +50 -48
- package/dist/src/theme/components/link.styles.d.ts +1 -1
- package/dist/src/theme/components/link.styles.js +12 -13
- package/dist/src/theme/components/list-group.styles.d.ts +1 -1
- package/dist/src/theme/components/list-group.styles.js +25 -24
- package/dist/src/theme/components/menu.styles.d.ts +1 -1
- package/dist/src/theme/components/menu.styles.js +44 -38
- package/dist/src/theme/components/mermaid-diagram.styles.d.ts +1 -0
- package/dist/src/theme/components/mermaid-diagram.styles.js +162 -0
- package/dist/src/theme/components/meta-row.styles.d.ts +1 -1
- package/dist/src/theme/components/meta-row.styles.js +25 -24
- package/dist/src/theme/components/modal.styles.d.ts +5 -0
- package/dist/src/theme/components/modal.styles.js +11 -0
- package/dist/src/theme/components/native-input.styles.d.ts +1 -1
- package/dist/src/theme/components/native-input.styles.js +38 -83
- package/dist/src/theme/components/nav-item.styles.d.ts +1 -1
- package/dist/src/theme/components/nav-item.styles.js +30 -30
- package/dist/src/theme/components/nav-list.styles.d.ts +1 -0
- package/dist/src/theme/components/nav-list.styles.js +155 -0
- package/dist/src/theme/components/number-input.styles.d.ts +1 -1
- package/dist/src/theme/components/number-input.styles.js +24 -47
- package/dist/src/theme/components/output-block.styles.d.ts +1 -1
- package/dist/src/theme/components/output-block.styles.js +129 -104
- package/dist/src/theme/components/page-frame.styles.d.ts +1 -1
- package/dist/src/theme/components/page-frame.styles.js +53 -17
- package/dist/src/theme/components/page-header.styles.d.ts +1 -1
- package/dist/src/theme/components/page-header.styles.js +34 -14
- package/dist/src/theme/components/page.styles.d.ts +1 -0
- package/dist/src/theme/components/page.styles.js +55 -0
- package/dist/src/theme/components/path-label.styles.d.ts +1 -1
- package/dist/src/theme/components/path-label.styles.js +10 -10
- package/dist/src/theme/components/path-picker.styles.d.ts +1 -1
- package/dist/src/theme/components/path-picker.styles.js +13 -13
- package/dist/src/theme/components/pill.styles.d.ts +1 -1
- package/dist/src/theme/components/pill.styles.js +22 -18
- package/dist/src/theme/components/popover.styles.d.ts +1 -1
- package/dist/src/theme/components/popover.styles.js +17 -17
- package/dist/src/theme/components/process-group.styles.d.ts +1 -1
- package/dist/src/theme/components/process-group.styles.js +56 -60
- package/dist/src/theme/components/progress.styles.d.ts +1 -1
- package/dist/src/theme/components/progress.styles.js +12 -13
- package/dist/src/theme/components/region-layout.styles.d.ts +1 -1
- package/dist/src/theme/components/region-layout.styles.js +18 -18
- package/dist/src/theme/components/resource-card.styles.d.ts +1 -1
- package/dist/src/theme/components/resource-card.styles.js +37 -37
- package/dist/src/theme/components/resource-link.styles.d.ts +1 -1
- package/dist/src/theme/components/resource-link.styles.js +21 -21
- package/dist/src/theme/components/risk-confirmation.styles.d.ts +1 -1
- package/dist/src/theme/components/risk-confirmation.styles.js +4 -4
- package/dist/src/theme/components/search-input.styles.d.ts +1 -1
- package/dist/src/theme/components/search-input.styles.js +17 -38
- package/dist/src/theme/components/section.styles.d.ts +1 -0
- package/dist/src/theme/components/section.styles.js +100 -0
- package/dist/src/theme/components/segmented-control.styles.d.ts +1 -1
- package/dist/src/theme/components/segmented-control.styles.js +32 -26
- package/dist/src/theme/components/separator.styles.d.ts +1 -1
- package/dist/src/theme/components/separator.styles.js +5 -5
- package/dist/src/theme/components/shortcut-keys.styles.d.ts +1 -1
- package/dist/src/theme/components/shortcut-keys.styles.js +15 -13
- package/dist/src/theme/components/skeleton.styles.d.ts +1 -1
- package/dist/src/theme/components/skeleton.styles.js +13 -12
- package/dist/src/theme/components/slider.styles.d.ts +1 -1
- package/dist/src/theme/components/slider.styles.js +25 -28
- package/dist/src/theme/components/spinner.styles.d.ts +1 -1
- package/dist/src/theme/components/spinner.styles.js +10 -10
- package/dist/src/theme/components/state-dot.styles.d.ts +1 -1
- package/dist/src/theme/components/state-dot.styles.js +23 -23
- package/dist/src/theme/components/status-dot.styles.d.ts +1 -1
- package/dist/src/theme/components/status-dot.styles.js +16 -15
- package/dist/src/theme/components/status.styles.d.ts +1 -1
- package/dist/src/theme/components/status.styles.js +4 -20
- package/dist/src/theme/components/table.styles.d.ts +1 -1
- package/dist/src/theme/components/table.styles.js +30 -30
- package/dist/src/theme/components/tabs.styles.d.ts +1 -1
- package/dist/src/theme/components/tabs.styles.js +48 -45
- package/dist/src/theme/components/tag.styles.d.ts +1 -1
- package/dist/src/theme/components/tag.styles.js +24 -24
- package/dist/src/theme/components/task-list.styles.d.ts +1 -0
- package/dist/src/theme/components/task-list.styles.js +223 -0
- package/dist/src/theme/components/text-shimmer.styles.d.ts +1 -1
- package/dist/src/theme/components/text-shimmer.styles.js +29 -25
- package/dist/src/theme/components/text.styles.d.ts +1 -0
- package/dist/src/theme/components/text.styles.js +34 -0
- package/dist/src/theme/components/timeline.styles.d.ts +1 -1
- package/dist/src/theme/components/timeline.styles.js +14 -26
- package/dist/src/theme/components/toast.styles.d.ts +1 -1
- package/dist/src/theme/components/toast.styles.js +28 -15
- package/dist/src/theme/components/toggle.styles.d.ts +1 -1
- package/dist/src/theme/components/toggle.styles.js +30 -30
- package/dist/src/theme/components/toolbar.styles.d.ts +1 -1
- package/dist/src/theme/components/toolbar.styles.js +8 -8
- package/dist/src/theme/components/tooltip.styles.d.ts +1 -1
- package/dist/src/theme/components/tooltip.styles.js +11 -11
- package/dist/src/theme/components/web-block.styles.d.ts +1 -1
- package/dist/src/theme/components/web-block.styles.js +19 -19
- package/dist/src/theme/components/window-title-bar.styles.d.ts +1 -1
- package/dist/src/theme/components/window-title-bar.styles.js +10 -10
- package/dist/src/theme/components/work-card.styles.d.ts +1 -1
- package/dist/src/theme/components/work-card.styles.js +37 -34
- package/dist/src/theme/icons/icons.styles.d.ts +1 -1
- package/dist/src/theme/icons/icons.styles.js +52 -2
- package/dist/src/theme/index.d.ts +206 -134
- package/dist/src/theme/index.js +62 -13
- package/dist/src/theme/selectors.d.ts +3 -0
- package/dist/src/theme/selectors.js +7 -0
- package/dist/src/theme/shared/action-row.styles.d.ts +1 -0
- package/dist/src/theme/shared/action-row.styles.js +52 -0
- package/dist/src/theme/shared/chart.tokens.d.ts +18 -0
- package/dist/src/theme/shared/chart.tokens.js +19 -0
- package/dist/src/theme/shared/code-highlight.styles.d.ts +1 -1
- package/dist/src/theme/shared/code-highlight.styles.js +6 -6
- package/dist/src/theme/shared/field-surface.styles.d.ts +1 -0
- package/dist/src/theme/shared/field-surface.styles.js +90 -0
- package/dist/src/theme/shared/prose.styles.d.ts +1 -0
- package/dist/src/theme/shared/prose.styles.js +152 -0
- package/dist/src/theme/shared/state-badge.styles.d.ts +1 -0
- package/dist/src/theme/shared/state-badge.styles.js +80 -0
- package/dist/src/theme/tokens.d.ts +259 -93
- package/dist/src/theme/tokens.js +284 -116
- package/dist/src/theme/utilities.d.ts +19 -0
- package/dist/src/theme/utilities.js +233 -0
- package/package.json +12 -8
- package/dist/src/theme/components/resource-card.tokens.d.ts +0 -5
- package/dist/src/theme/components/resource-card.tokens.js +0 -6
- package/dist/src/theme/palette.d.ts +0 -55
- package/dist/src/theme/palette.js +0 -56
|
@@ -51,19 +51,46 @@ export function assistantScroll(viewport, content, onLatest) {
|
|
|
51
51
|
};
|
|
52
52
|
viewport.addEventListener("scroll", scroll, { passive: true });
|
|
53
53
|
viewport.addEventListener("click", inspectDisclosure);
|
|
54
|
-
|
|
54
|
+
let frame = 0;
|
|
55
|
+
const scheduleRestore = () => {
|
|
56
|
+
if (frame)
|
|
57
|
+
return;
|
|
58
|
+
frame = requestAnimationFrame(() => {
|
|
59
|
+
frame = 0;
|
|
60
|
+
restore();
|
|
61
|
+
});
|
|
62
|
+
};
|
|
63
|
+
const observer = new ResizeObserver(scheduleRestore);
|
|
55
64
|
observer.observe(viewport);
|
|
56
65
|
observer.observe(content);
|
|
57
66
|
restore();
|
|
58
67
|
return {
|
|
59
68
|
beforeUpdate: capture,
|
|
60
69
|
afterUpdate: restore,
|
|
70
|
+
/** Bring one message to the top of the reading area and keep it there as rows resize. */
|
|
71
|
+
reveal(id) {
|
|
72
|
+
const row = rows().find((item) => item.dataset.assistantMessageId === id);
|
|
73
|
+
if (!row)
|
|
74
|
+
return;
|
|
75
|
+
following = false;
|
|
76
|
+
restoring = true;
|
|
77
|
+
viewport.scrollTop +=
|
|
78
|
+
row.getBoundingClientRect().top -
|
|
79
|
+
viewport.getBoundingClientRect().top -
|
|
80
|
+
Math.min(viewport.clientHeight / 6, 48);
|
|
81
|
+
capture();
|
|
82
|
+
onLatest(atLatest());
|
|
83
|
+
restoring = false;
|
|
84
|
+
viewport.focus({ preventScroll: true });
|
|
85
|
+
},
|
|
61
86
|
latest() {
|
|
62
87
|
following = true;
|
|
63
88
|
restore();
|
|
64
89
|
viewport.focus({ preventScroll: true });
|
|
65
90
|
},
|
|
66
91
|
dispose() {
|
|
92
|
+
if (frame)
|
|
93
|
+
cancelAnimationFrame(frame);
|
|
67
94
|
observer.disconnect();
|
|
68
95
|
viewport.removeEventListener("scroll", scroll);
|
|
69
96
|
viewport.removeEventListener("click", inspectDisclosure);
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { IconName } from "../icons/icon.js";
|
|
2
|
+
import type { Child, Props } from "meowjsx";
|
|
3
|
+
import type { MaybeSignal } from "meowjsx/signal";
|
|
2
4
|
import type { ChatAttachmentItem } from "./attachments.js";
|
|
3
5
|
import type { ChatMessageRole, ChatMessageStatus } from "./message.js";
|
|
4
6
|
import type { StatusDotState } from "../components/status-dot.js";
|
|
@@ -23,6 +25,8 @@ export interface AssistantToolPart {
|
|
|
23
25
|
id: string;
|
|
24
26
|
kind: "tool";
|
|
25
27
|
label: string;
|
|
28
|
+
/** The tool's type glyph (terminal, file-text, search…); the generic tool glyph otherwise. */
|
|
29
|
+
icon?: IconName;
|
|
26
30
|
summary?: string;
|
|
27
31
|
state?: ChatExecutionState;
|
|
28
32
|
statusLabel?: string;
|
|
@@ -66,6 +70,13 @@ export type AssistantMessagePart = AssistantToolPart | AssistantTaskPart | {
|
|
|
66
70
|
id: string;
|
|
67
71
|
kind: "process";
|
|
68
72
|
title: string;
|
|
73
|
+
/**
|
|
74
|
+
* The group's lifecycle, shown as the shared state badge after the title. Whether the
|
|
75
|
+
* badge exists is fixed by the part's first value; later values update it in place.
|
|
76
|
+
* Omit it to keep the title and `statusText` alone.
|
|
77
|
+
*/
|
|
78
|
+
state?: ChatExecutionState;
|
|
79
|
+
/** A quiet fact after the badge (or alone), such as "3 steps · returned". */
|
|
69
80
|
statusText?: string;
|
|
70
81
|
steps: readonly AssistantProcessStep[];
|
|
71
82
|
defaultOpen?: boolean;
|
|
@@ -119,6 +130,7 @@ export interface AssistantChoice {
|
|
|
119
130
|
label: string;
|
|
120
131
|
disabled?: boolean;
|
|
121
132
|
}
|
|
133
|
+
export type AssistantMessageAction = "good" | "bad" | "regenerate";
|
|
122
134
|
export interface AssistantViewProps extends Props {
|
|
123
135
|
title?: string;
|
|
124
136
|
description?: string;
|
|
@@ -156,6 +168,10 @@ export interface AssistantViewProps extends Props {
|
|
|
156
168
|
onDismissQuestion?: (questionId: string) => void;
|
|
157
169
|
/** An explicit host intent. The host owns availability, execution and subsequent state. */
|
|
158
170
|
onToolAction?: (messageId: string, partId: string, action: "retry" | "cancel") => void;
|
|
171
|
+
/** Feedback and regeneration intents on a finished reply; supplying it shows those actions. Copy is built in. */
|
|
172
|
+
onMessageAction?: (messageId: string, action: AssistantMessageAction) => void;
|
|
173
|
+
/** The column of the reader's own messages over the transcript; on by default. */
|
|
174
|
+
history?: boolean;
|
|
159
175
|
onRefreshWork?: (workId: string) => void;
|
|
160
176
|
onLoadOlder?: () => void;
|
|
161
177
|
loadingOlder?: MaybeSignal<boolean>;
|
|
@@ -164,7 +180,6 @@ export interface AssistantViewProps extends Props {
|
|
|
164
180
|
renderWorkDetail?: (work: AssistantWork) => Child | undefined;
|
|
165
181
|
composerTrailing?: Child;
|
|
166
182
|
headerActions?: Child;
|
|
167
|
-
className?: string;
|
|
168
183
|
labels?: Partial<AssistantLabels>;
|
|
169
184
|
}
|
|
170
185
|
/** Central default copy, overridable through the component's data and localized host wrappers. */
|
|
@@ -206,6 +221,13 @@ export declare const assistantCopy: {
|
|
|
206
221
|
readonly workUnavailable: "These details are no longer available.";
|
|
207
222
|
readonly refresh: "Refresh details";
|
|
208
223
|
readonly details: "Details";
|
|
224
|
+
readonly copy: "Copy reply";
|
|
225
|
+
readonly copied: "Copied";
|
|
226
|
+
readonly good: "Good response";
|
|
227
|
+
readonly bad: "Bad response";
|
|
228
|
+
readonly regenerate: "Regenerate";
|
|
229
|
+
readonly history: "Your messages";
|
|
230
|
+
readonly closeHistory: "Close your messages";
|
|
209
231
|
};
|
|
210
232
|
export type AssistantLabels = {
|
|
211
233
|
readonly [Key in keyof typeof assistantCopy]: string;
|
|
@@ -37,4 +37,11 @@ export const assistantCopy = {
|
|
|
37
37
|
workUnavailable: "These details are no longer available.",
|
|
38
38
|
refresh: "Refresh details",
|
|
39
39
|
details: "Details",
|
|
40
|
+
copy: "Copy reply",
|
|
41
|
+
copied: "Copied",
|
|
42
|
+
good: "Good response",
|
|
43
|
+
bad: "Bad response",
|
|
44
|
+
regenerate: "Regenerate",
|
|
45
|
+
history: "Your messages",
|
|
46
|
+
closeHistory: "Close your messages",
|
|
40
47
|
};
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
import { type Context } from "meowjsx";
|
|
1
2
|
import { type AssistantViewProps } from "./assistant-types.js";
|
|
2
|
-
export declare const assistantViewContract: {
|
|
3
|
-
readonly name: "assistant-view";
|
|
4
|
-
readonly parts: readonly ["root", "layout", "messages", "viewport", "content", "latest", "composer", "feedback", "empty", "activity", "activityHeader", "activityBody", "section", "workDetail", "status"];
|
|
5
|
-
};
|
|
6
3
|
/** A complete default Assistant surface. Data, permissions, network and business lifetime stay with the host. */
|
|
7
|
-
export declare
|
|
8
|
-
export
|
|
4
|
+
export declare function AssistantView(options: AssistantViewProps, context: Context<typeof AssistantView>): import("meowjsx").VNode;
|
|
5
|
+
export declare namespace AssistantView {
|
|
6
|
+
var meta: {
|
|
7
|
+
readonly name: "assistant-view";
|
|
8
|
+
readonly parts: readonly ["root", "layout", "messages", "viewport", "content", "latest", "composer", "feedback", "empty", "activity", "activityHeader", "activityBody", "section", "workDetail", "status", "history", "historyItem", "historyTrigger"];
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
export type { AssistantViewProps, AssistantDraft, AssistantAttachment, AssistantMessage, AssistantMessagePart, AssistantMessageAction, AssistantToolPart, AssistantTaskPart, AssistantProcessStep, AssistantActivity, AssistantWork, AssistantQuestion, AssistantChoice, AssistantLabels, } from "./assistant-types.js";
|
|
9
12
|
export { assistantCopy } from "./assistant-types.js";
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { h, keyed } from "meowjsx";
|
|
2
|
+
import { derived, signal, unwrap } from "meowjsx/signal";
|
|
3
|
+
// Fragment is required by the classic JSX transform for header actions.
|
|
4
|
+
// eslint-disable-next-line no-unused-vars
|
|
5
|
+
import { Fragment } from "meowjsx";
|
|
2
6
|
import { PageFrame } from "../components/page-frame.js";
|
|
3
7
|
import { Button } from "../components/button.js";
|
|
4
8
|
import { WorkCard } from "../components/work-card.js";
|
|
@@ -11,36 +15,14 @@ import { AssistantMessageView, AssistantSteps } from "./assistant-content.js";
|
|
|
11
15
|
import { AssistantQuestionView } from "./assistant-question.js";
|
|
12
16
|
import { AssistantMarkdown } from "./assistant-markdown.js";
|
|
13
17
|
import { assistantScroll } from "./assistant-scroll.js";
|
|
18
|
+
import { IconButton } from "../components/icon-button.js";
|
|
19
|
+
import { Icon } from "../icons/icon.js";
|
|
14
20
|
import { assistantCopy as defaultAssistantCopy, } from "./assistant-types.js";
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
"messages",
|
|
21
|
-
"viewport",
|
|
22
|
-
"content",
|
|
23
|
-
"latest",
|
|
24
|
-
"composer",
|
|
25
|
-
"feedback",
|
|
26
|
-
"empty",
|
|
27
|
-
"activity",
|
|
28
|
-
"activityHeader",
|
|
29
|
-
"activityBody",
|
|
30
|
-
"section",
|
|
31
|
-
"workDetail",
|
|
32
|
-
"status",
|
|
33
|
-
],
|
|
34
|
-
};
|
|
35
|
-
const AssistantWorkRow = defineComponent({ name: "assistant-work-row", parts: ["root"] }, ({ value, onOpen, actionLabel }) => h(WorkCard, {
|
|
36
|
-
action: actionLabel,
|
|
37
|
-
title: derived(() => value.value.title),
|
|
38
|
-
state: derived(() => value.value.tone ?? "unknown"),
|
|
39
|
-
status: derived(() => value.value.statusText),
|
|
40
|
-
detail: derived(() => [value.value.executionText, value.value.replyText].filter(Boolean).join(" · ")),
|
|
41
|
-
onClick: (event) => onOpen(value.value.id, event.currentTarget),
|
|
42
|
-
}));
|
|
43
|
-
const AssistantWorkDetail = defineComponent({ name: "assistant-work-detail", parts: ["root", "feedback", "facts"] }, ({ value, options }, context) => {
|
|
21
|
+
function AssistantWorkRow({ value, actionLabel, onOpen, }) {
|
|
22
|
+
return (h(WorkCard, { action: actionLabel, title: derived(() => value.value.title), state: derived(() => value.value.tone ?? "unknown"), status: derived(() => value.value.statusText), detail: derived(() => [value.value.executionText, value.value.replyText].filter(Boolean).join(" · ")), onClick: (event) => onOpen(value.value.id, event.currentTarget) }));
|
|
23
|
+
}
|
|
24
|
+
AssistantWorkRow.meta = { name: "assistant-work-row", parts: ["root"] };
|
|
25
|
+
function AssistantWorkDetail({ value, options }, context) {
|
|
44
26
|
const assistantCopy = { ...defaultAssistantCopy, ...options.labels };
|
|
45
27
|
const hidden = derived(() => value.value?.readState === "unavailable");
|
|
46
28
|
const feedback = derived(() => {
|
|
@@ -54,40 +36,75 @@ const AssistantWorkDetail = defineComponent({ name: "assistant-work-detail", par
|
|
|
54
36
|
? assistantCopy.workError
|
|
55
37
|
: ""));
|
|
56
38
|
});
|
|
57
|
-
const detail = h(AssistantMarkdown, {
|
|
58
|
-
text: derived(() => value.value?.readState === "unavailable"
|
|
39
|
+
const detail = (h(AssistantMarkdown, { text: derived(() => value.value?.readState === "unavailable"
|
|
59
40
|
? ""
|
|
60
|
-
: (value.value?.detail ?? value.value?.summary ?? ""))
|
|
61
|
-
});
|
|
62
|
-
// The host detail slot may return a node. The default markdown view stays mounted otherwise.
|
|
41
|
+
: (value.value?.detail ?? value.value?.summary ?? "")) }));
|
|
63
42
|
const custom = options.renderWorkDetail
|
|
64
43
|
? derived(() => value.value && value.value.readState !== "unavailable"
|
|
65
44
|
? (options.renderWorkDetail(value.value) ?? detail)
|
|
66
45
|
: null)
|
|
67
46
|
: detail;
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
47
|
+
const parts = context.parts;
|
|
48
|
+
return (h("section", { ref: parts.root },
|
|
49
|
+
h("p", { role: "status", hidden: derived(() => !feedback.value), ref: parts.feedback }, feedback),
|
|
50
|
+
h("div", { hidden: hidden, ref: parts.facts },
|
|
51
|
+
h("h3", null, derived(() => value.value?.title ?? "")),
|
|
52
|
+
h("p", null,
|
|
53
|
+
h(StatusDot, { state: derived(() => value.value?.tone ?? "unknown") }),
|
|
54
|
+
" ",
|
|
55
|
+
derived(() => value.value?.statusText ?? "")),
|
|
56
|
+
h("p", null, derived(() => value.value?.executionText ?? "")),
|
|
57
|
+
h("p", null, derived(() => value.value?.replyText ?? "")),
|
|
58
|
+
custom,
|
|
59
|
+
h(AssistantSteps, { steps: derived(() => value.value?.steps ?? []) })),
|
|
60
|
+
options.onRefreshWork ? (h(Button, { variant: "outline", size: "small", onClick: () => {
|
|
73
61
|
if (value.value)
|
|
74
62
|
options.onRefreshWork(value.value.id);
|
|
75
|
-
},
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
63
|
+
} }, assistantCopy.refresh)) : null));
|
|
64
|
+
}
|
|
65
|
+
AssistantWorkDetail.meta = {
|
|
66
|
+
name: "assistant-work-detail",
|
|
67
|
+
parts: ["root", "feedback", "facts"],
|
|
68
|
+
};
|
|
80
69
|
/** A complete default Assistant surface. Data, permissions, network and business lifetime stay with the host. */
|
|
81
|
-
export
|
|
70
|
+
export function AssistantView(options, context) {
|
|
82
71
|
const assistantCopy = { ...defaultAssistantCopy, ...options.labels };
|
|
83
72
|
const messages = derived(() => unwrap(options.messages));
|
|
84
73
|
const work = derived(() => unwrap(options.work ?? []));
|
|
85
74
|
const questions = derived(() => unwrap(options.questions ?? []));
|
|
86
75
|
const activity = derived(() => unwrap(options.activity));
|
|
87
|
-
const panelOpen =
|
|
88
|
-
const selected =
|
|
76
|
+
const panelOpen = signal(false);
|
|
77
|
+
const selected = signal("");
|
|
89
78
|
const selectedWork = derived(() => work.value.find((item) => item.id === selected.value));
|
|
90
|
-
const latestHidden =
|
|
79
|
+
const latestHidden = signal(true);
|
|
80
|
+
const historyOpen = signal(false);
|
|
81
|
+
const asked = derived(() => messages.value.flatMap((message) => {
|
|
82
|
+
if (message.role !== "user")
|
|
83
|
+
return [];
|
|
84
|
+
const text = message.parts
|
|
85
|
+
.flatMap((part) => (part.kind === "text" ? [part.text] : []))
|
|
86
|
+
.join(" ")
|
|
87
|
+
.trim();
|
|
88
|
+
return text ? [{ id: message.id, text }] : [];
|
|
89
|
+
}));
|
|
90
|
+
const historyEnabled = options.history !== false;
|
|
91
|
+
const historyId = options.id ? `${options.id}-history` : undefined;
|
|
92
|
+
let historyList;
|
|
93
|
+
let historyTrigger;
|
|
94
|
+
const closeHistory = (restoreFocus = true) => {
|
|
95
|
+
if (!historyOpen.value)
|
|
96
|
+
return;
|
|
97
|
+
historyOpen.value = false;
|
|
98
|
+
if (restoreFocus)
|
|
99
|
+
queueMicrotask(() => {
|
|
100
|
+
if (!disposed && historyTrigger?.isConnected)
|
|
101
|
+
historyTrigger.focus({ preventScroll: true });
|
|
102
|
+
});
|
|
103
|
+
};
|
|
104
|
+
const jumpTo = (id) => {
|
|
105
|
+
closeHistory(false);
|
|
106
|
+
scroll?.reveal(id);
|
|
107
|
+
};
|
|
91
108
|
const bodyHidden = derived(() => !!selected.value);
|
|
92
109
|
const detailHidden = derived(() => !selected.value);
|
|
93
110
|
let content;
|
|
@@ -142,157 +159,173 @@ export const AssistantView = defineComponent(assistantViewContract, (options, co
|
|
|
142
159
|
if (dialog?.open)
|
|
143
160
|
dialog.close();
|
|
144
161
|
});
|
|
145
|
-
const transcript = keyed(messages, (message) => message.id, (value) => h(AssistantMessageView, {
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
if (disposed || !content)
|
|
157
|
-
return;
|
|
158
|
-
scroll = assistantScroll(element, content, (latest) => {
|
|
159
|
-
latestHidden.value = latest;
|
|
160
|
-
});
|
|
161
|
-
let queued = false;
|
|
162
|
-
const stop = messages.subscribe(() => {
|
|
163
|
-
// Signal item changes patch synchronously. A microtask handles final layout once.
|
|
164
|
-
if (!queued) {
|
|
165
|
-
queued = true;
|
|
166
|
-
queueMicrotask(() => {
|
|
167
|
-
queued = false;
|
|
168
|
-
if (!disposed)
|
|
169
|
-
scroll?.afterUpdate();
|
|
162
|
+
const transcript = keyed(messages, (message) => message.id, (value) => (h(AssistantMessageView, { value: value, renderPart: options.renderPart, onToolAction: options.onToolAction, onMessageAction: options.onMessageAction, labels: assistantCopy })));
|
|
163
|
+
const parts = context.parts;
|
|
164
|
+
const messagesRegion = (h("section", { ref: parts.messages },
|
|
165
|
+
h("div", { role: "region", "aria-label": assistantCopy.messages, tabIndex: 0, ref: [
|
|
166
|
+
parts.viewport,
|
|
167
|
+
(element) => {
|
|
168
|
+
queueMicrotask(() => {
|
|
169
|
+
if (disposed || !content)
|
|
170
|
+
return;
|
|
171
|
+
scroll = assistantScroll(element, content, (latest) => {
|
|
172
|
+
latestHidden.value = latest;
|
|
170
173
|
});
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
if (
|
|
213
|
-
|
|
214
|
-
})
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
const
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
174
|
+
let queued = false;
|
|
175
|
+
const stop = messages.subscribe(() => {
|
|
176
|
+
if (!queued) {
|
|
177
|
+
queued = true;
|
|
178
|
+
queueMicrotask(() => {
|
|
179
|
+
queued = false;
|
|
180
|
+
if (!disposed)
|
|
181
|
+
scroll?.afterUpdate();
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
});
|
|
185
|
+
context.onCleanup(stop);
|
|
186
|
+
});
|
|
187
|
+
},
|
|
188
|
+
] },
|
|
189
|
+
h("div", { ref: [
|
|
190
|
+
parts.content,
|
|
191
|
+
(element) => {
|
|
192
|
+
content = element;
|
|
193
|
+
},
|
|
194
|
+
] },
|
|
195
|
+
options.onLoadOlder ? (h(Button, { variant: "quiet", size: "small", disabled: options.loadingOlder, onClick: () => {
|
|
196
|
+
scroll?.beforeUpdate();
|
|
197
|
+
options.onLoadOlder();
|
|
198
|
+
} }, assistantCopy.older)) : null,
|
|
199
|
+
h("p", { role: "status", hidden: derived(() => unwrap(options.readState ?? "ready") === "ready"), ref: parts.feedback }, derived(() => unwrap(options.readFeedback ?? "") ||
|
|
200
|
+
(unwrap(options.readState ?? "ready") === "loading"
|
|
201
|
+
? assistantCopy.loading
|
|
202
|
+
: assistantCopy.readError))),
|
|
203
|
+
h("div", { hidden: derived(() => messages.value.length > 0 || unwrap(options.readState ?? "ready") !== "ready"), ref: parts.empty },
|
|
204
|
+
h("h2", null, assistantCopy.empty),
|
|
205
|
+
h("p", null, assistantCopy.emptyDescription)),
|
|
206
|
+
h(ChatMessageList, { ariaLabel: assistantCopy.messages }, transcript))),
|
|
207
|
+
h("div", { hidden: latestHidden, ref: parts.latest },
|
|
208
|
+
h(Button, { variant: "outline", size: "small", onClick: () => scroll?.latest() }, assistantCopy.latest)),
|
|
209
|
+
historyEnabled ? (h("nav", { id: historyId, "aria-label": assistantCopy.history, ref: [
|
|
210
|
+
parts.history,
|
|
211
|
+
(element) => {
|
|
212
|
+
historyList = element;
|
|
213
|
+
},
|
|
214
|
+
], "data-open": derived(() => String(historyOpen.value)), inert: derived(() => !historyOpen.value), onClick: (event) => {
|
|
215
|
+
if (event.target === event.currentTarget)
|
|
216
|
+
closeHistory();
|
|
217
|
+
}, onKeyDown: (event) => {
|
|
218
|
+
if (event.key === "Escape") {
|
|
219
|
+
event.preventDefault();
|
|
220
|
+
closeHistory();
|
|
221
|
+
}
|
|
222
|
+
} },
|
|
223
|
+
h("ol", null, keyed(asked, (item) => item.id, (item) => (h("li", null,
|
|
224
|
+
h("button", { type: "button", onClick: () => jumpTo(item.value.id), ref: parts.historyItem }, derived(() => item.value.text)))))))) : null));
|
|
225
|
+
const activityList = (h("div", { hidden: bodyHidden, ref: parts.activityBody },
|
|
226
|
+
h("section", { ref: parts.section },
|
|
227
|
+
h("h3", null, assistantCopy.current),
|
|
228
|
+
h("p", { ref: parts.status },
|
|
229
|
+
h(StatusDot, { state: derived(() => activity.value?.tone ?? "idle") }),
|
|
230
|
+
derived(() => activity.value?.statusText ?? assistantCopy.noActivity)),
|
|
231
|
+
h("strong", null, derived(() => activity.value?.title ?? "")),
|
|
232
|
+
h("p", null, derived(() => activity.value?.description ?? "")),
|
|
233
|
+
h(AssistantSteps, { steps: derived(() => activity.value?.steps ?? []) })),
|
|
234
|
+
h("section", { ref: parts.section },
|
|
235
|
+
h("h3", null, assistantCopy.background),
|
|
236
|
+
h("p", { hidden: derived(() => work.value.length > 0) }, assistantCopy.noWork),
|
|
237
|
+
keyed(work, (item) => item.id, (value) => (h(AssistantWorkRow, { value: value, actionLabel: assistantCopy.details, onOpen: (id, button) => {
|
|
238
|
+
detailOpener = button;
|
|
239
|
+
selected.value = id;
|
|
240
|
+
queueMicrotask(() => {
|
|
241
|
+
if (!disposed && panelOpen.value && selected.value === id)
|
|
242
|
+
dialog?.querySelector("[data-assistant-back]")?.focus();
|
|
243
|
+
});
|
|
244
|
+
} })))),
|
|
245
|
+
h("section", { hidden: derived(() => questions.value.length === 0), ref: parts.section },
|
|
246
|
+
h("h3", null, assistantCopy.questions),
|
|
247
|
+
keyed(questions, (question) => question.id, (value) => (h(AssistantQuestionView, { value: value, labels: options.labels, onAnswer: options.onAnswer, onDismiss: options.onDismissQuestion }))))));
|
|
248
|
+
const activityPanel = (h(Dialog, { labelledBy: undefined, "aria-label": assistantCopy.activity, "data-assistant-panel": true, ref: (element) => {
|
|
227
249
|
dialog = element;
|
|
228
250
|
queueMicrotask(syncDialog);
|
|
229
|
-
},
|
|
230
|
-
onCancel: (event) => {
|
|
251
|
+
}, onCancel: (event) => {
|
|
231
252
|
event.preventDefault();
|
|
232
253
|
close();
|
|
233
|
-
},
|
|
234
|
-
onKeyDown: (event) => {
|
|
254
|
+
}, onKeyDown: (event) => {
|
|
235
255
|
if (event.key === "Escape" && !compact && !event.defaultPrevented) {
|
|
236
256
|
event.preventDefault();
|
|
237
257
|
close();
|
|
238
258
|
}
|
|
239
|
-
},
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
259
|
+
} },
|
|
260
|
+
h("header", { ref: parts.activityHeader },
|
|
261
|
+
h(Button, { variant: "quiet", size: "small", "data-assistant-back": true, hidden: detailHidden, onClick: back }, assistantCopy.back),
|
|
262
|
+
h("h2", null, assistantCopy.activity),
|
|
263
|
+
h(Button, { variant: "quiet", size: "small", onClick: close, "aria-label": assistantCopy.close }, "\u00D7")),
|
|
264
|
+
activityList,
|
|
265
|
+
h("div", { hidden: detailHidden, ref: parts.workDetail },
|
|
266
|
+
h(AssistantWorkDetail, { value: selectedWork, options: options }))));
|
|
267
|
+
const rootRef = (element) => {
|
|
268
|
+
root = element;
|
|
269
|
+
const observer = new ResizeObserver(syncDialog);
|
|
270
|
+
observer.observe(element);
|
|
271
|
+
return () => {
|
|
272
|
+
observer.disconnect();
|
|
273
|
+
root = undefined;
|
|
274
|
+
};
|
|
275
|
+
};
|
|
276
|
+
return (h("section", { id: options.id, style: options.style, "aria-label": options["aria-label"], className: options.className, "data-activity-open": derived(() => String(panelOpen.value)), "data-history-open": derived(() => String(historyOpen.value)), ref: [parts.root, rootRef, options.ref] },
|
|
277
|
+
h(PageFrame, { variant: "workspace", header: h(ChatHeader, { title: options.title ?? assistantCopy.title, description: options.description, actions: h(Fragment, null,
|
|
278
|
+
options.headerActions,
|
|
279
|
+
h(Button, { variant: "quiet", size: "small", "aria-expanded": derived(() => String(panelOpen.value)), ref: (element) => {
|
|
280
|
+
activityTrigger = element;
|
|
281
|
+
}, onClick: () => {
|
|
282
|
+
panelOpen.value = !panelOpen.value;
|
|
283
|
+
} }, assistantCopy.activity)) }) },
|
|
284
|
+
h("div", { ref: parts.layout },
|
|
285
|
+
messagesRegion,
|
|
286
|
+
h("div", { ref: parts.composer, onKeyDown: (event) => {
|
|
287
|
+
if (event.key === "Escape" && historyOpen.value) {
|
|
288
|
+
event.preventDefault();
|
|
289
|
+
closeHistory();
|
|
290
|
+
}
|
|
291
|
+
} }, h(AssistantComposer, { options: options, trailing: historyEnabled ? (h("span", { hidden: derived(() => asked.value.length === 0), ref: parts.historyTrigger },
|
|
292
|
+
h(IconButton, { label: derived(() => historyOpen.value ? assistantCopy.closeHistory : assistantCopy.history), "aria-expanded": derived(() => String(historyOpen.value)), "aria-controls": historyId, ref: (element) => {
|
|
293
|
+
historyTrigger = element;
|
|
294
|
+
}, onClick: () => {
|
|
295
|
+
historyOpen.value = !historyOpen.value;
|
|
296
|
+
if (historyOpen.value)
|
|
297
|
+
queueMicrotask(() => {
|
|
298
|
+
if (disposed)
|
|
299
|
+
return;
|
|
300
|
+
const items = historyList?.querySelectorAll("button");
|
|
301
|
+
items?.[items.length - 1]?.focus({ preventScroll: true });
|
|
302
|
+
});
|
|
303
|
+
} },
|
|
304
|
+
h(Icon, { name: "history", className: "assistant-history-closed" }),
|
|
305
|
+
h(Icon, { name: "x", className: "assistant-history-open" })))) : undefined })),
|
|
306
|
+
activityPanel))));
|
|
307
|
+
}
|
|
308
|
+
AssistantView.meta = {
|
|
309
|
+
name: "assistant-view",
|
|
310
|
+
parts: [
|
|
311
|
+
"root",
|
|
312
|
+
"layout",
|
|
313
|
+
"messages",
|
|
314
|
+
"viewport",
|
|
315
|
+
"content",
|
|
316
|
+
"latest",
|
|
317
|
+
"composer",
|
|
318
|
+
"feedback",
|
|
319
|
+
"empty",
|
|
320
|
+
"activity",
|
|
321
|
+
"activityHeader",
|
|
322
|
+
"activityBody",
|
|
323
|
+
"section",
|
|
324
|
+
"workDetail",
|
|
325
|
+
"status",
|
|
326
|
+
"history",
|
|
327
|
+
"historyItem",
|
|
328
|
+
"historyTrigger",
|
|
329
|
+
],
|
|
330
|
+
};
|
|
298
331
|
export { assistantCopy } from "./assistant-types.js";
|