@cueplusplus/ui 0.2.0 → 0.5.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/CHANGELOG.md +2250 -0
- package/dist/agent-runtime/_glyphs.js +43 -0
- package/dist/agent-runtime/branch-picker.d.ts +45 -0
- package/dist/agent-runtime/branch-picker.js +87 -0
- package/dist/agent-runtime/index.d.ts +4 -0
- package/dist/agent-runtime/index.js +4 -0
- package/dist/agent-runtime/tool-call-card.d.ts +69 -0
- package/dist/agent-runtime/tool-call-card.js +187 -0
- package/dist/agent-runtime/use-agent-thread.d.ts +164 -0
- package/dist/agent-runtime/use-agent-thread.js +251 -0
- package/dist/brand/_chassis.d.ts +1 -1
- package/dist/brand/cue-mark.d.ts +1 -1
- package/dist/brand/cue-mark.js +1 -1
- package/dist/chat/index.d.ts +2 -2
- package/dist/chat/message-list.d.ts +6 -0
- package/dist/chat/message-list.js +35 -0
- package/dist/chrome/_edge-scroller.js +12 -1
- package/dist/chrome/_tabs-scroll.d.ts +1 -1
- package/dist/chrome/_tabs-scroll.js +1 -1
- package/dist/chrome/app-shell.d.ts +52 -2
- package/dist/chrome/app-shell.js +80 -8
- package/dist/chrome/index.d.ts +2 -2
- package/dist/configurator/_export.js +3 -2
- package/dist/configurator/_overrides.d.ts +1 -1
- package/dist/configurator/_overrides.js +18 -6
- package/dist/configurator/token-editor.js +4 -1
- package/dist/date/_segments.js +37 -2
- package/dist/elements/activity-graph.d.ts +40 -0
- package/dist/elements/activity-graph.js +81 -0
- package/dist/elements/agent-card.d.ts +49 -0
- package/dist/elements/agent-card.js +91 -0
- package/dist/elements/agent-handoff.d.ts +24 -0
- package/dist/elements/agent-handoff.js +53 -0
- package/dist/elements/agent-mode-badge.d.ts +72 -0
- package/dist/elements/agent-mode-badge.js +110 -0
- package/dist/elements/agent-plan.d.ts +24 -0
- package/dist/elements/agent-plan.js +74 -0
- package/dist/elements/agent-status.d.ts +29 -0
- package/dist/elements/agent-status.js +46 -0
- package/dist/elements/agent-surface.d.ts +65 -0
- package/dist/elements/agent-surface.js +68 -0
- package/dist/elements/animated-number.d.ts +86 -0
- package/dist/elements/animated-number.js +118 -0
- package/dist/elements/approval-card.d.ts +40 -0
- package/dist/elements/approval-card.js +78 -0
- package/dist/elements/artifact-card.d.ts +30 -0
- package/dist/elements/artifact-card.js +58 -0
- package/dist/elements/background-inbox.d.ts +39 -0
- package/dist/elements/background-inbox.js +60 -0
- package/dist/elements/canvas-split.d.ts +77 -0
- package/dist/elements/canvas-split.js +138 -0
- package/dist/elements/chart.d.ts +41 -0
- package/dist/elements/chart.js +117 -0
- package/dist/elements/chat-panel.d.ts +46 -0
- package/dist/elements/chat-panel.js +104 -0
- package/dist/elements/checkpoint-history.d.ts +31 -0
- package/dist/elements/checkpoint-history.js +65 -0
- package/dist/elements/clamp.d.ts +90 -0
- package/dist/elements/clamp.js +109 -0
- package/dist/elements/code-diff.d.ts +42 -0
- package/dist/elements/code-diff.js +69 -0
- package/dist/elements/code-runner.d.ts +38 -0
- package/dist/elements/code-runner.js +84 -0
- package/dist/elements/command-palette.d.ts +48 -0
- package/dist/elements/command-palette.js +129 -0
- package/dist/elements/compaction-row.d.ts +63 -0
- package/dist/elements/compaction-row.js +110 -0
- package/dist/elements/comparison-card.d.ts +47 -0
- package/dist/elements/comparison-card.js +69 -0
- package/dist/elements/composer.d.ts +274 -0
- package/dist/elements/composer.js +505 -0
- package/dist/elements/computer-use.d.ts +40 -0
- package/dist/elements/computer-use.js +92 -0
- package/dist/elements/confidence-marker.d.ts +39 -0
- package/dist/elements/confidence-marker.js +64 -0
- package/dist/elements/connection-state.d.ts +29 -0
- package/dist/elements/connection-state.js +66 -0
- package/dist/elements/context-breakdown.d.ts +30 -0
- package/dist/elements/context-breakdown.js +86 -0
- package/dist/elements/context-usage.d.ts +99 -0
- package/dist/elements/context-usage.js +225 -0
- package/dist/elements/conversation-search.d.ts +48 -0
- package/dist/elements/conversation-search.js +88 -0
- package/dist/elements/cost-meter.d.ts +33 -0
- package/dist/elements/cost-meter.js +75 -0
- package/dist/elements/data-table.d.ts +31 -0
- package/dist/elements/data-table.js +67 -0
- package/dist/elements/day-separator.d.ts +34 -0
- package/dist/elements/day-separator.js +50 -0
- package/dist/elements/diagram.d.ts +34 -0
- package/dist/elements/diagram.js +75 -0
- package/dist/elements/document-reference.d.ts +37 -0
- package/dist/elements/document-reference.js +66 -0
- package/dist/elements/draft-restore.d.ts +27 -0
- package/dist/elements/draft-restore.js +54 -0
- package/dist/elements/edit-message.d.ts +36 -0
- package/dist/elements/edit-message.js +77 -0
- package/dist/elements/elements.css +459 -0
- package/dist/elements/elicitation-form.d.ts +48 -0
- package/dist/elements/elicitation-form.js +106 -0
- package/dist/elements/empty-state.d.ts +52 -0
- package/dist/elements/empty-state.js +98 -0
- package/dist/elements/end-of-turn-summary.d.ts +60 -0
- package/dist/elements/end-of-turn-summary.js +75 -0
- package/dist/elements/error-state.d.ts +29 -0
- package/dist/elements/error-state.js +55 -0
- package/dist/elements/feedback-dialog.d.ts +36 -0
- package/dist/elements/feedback-dialog.js +81 -0
- package/dist/elements/file-tree.d.ts +45 -0
- package/dist/elements/file-tree.js +84 -0
- package/dist/elements/flow-graph.d.ts +45 -0
- package/dist/elements/flow-graph.js +78 -0
- package/dist/elements/generative/chart.js +200 -0
- package/dist/elements/generative/faults.js +111 -0
- package/dist/elements/generative/icons.d.ts +41 -0
- package/dist/elements/generative/icons.js +190 -0
- package/dist/elements/generative/intrinsics.js +483 -0
- package/dist/elements/generative/spec.d.ts +110 -0
- package/dist/elements/generative/spec.js +366 -0
- package/dist/elements/generative.css +1145 -0
- package/dist/elements/generative.d.ts +144 -0
- package/dist/elements/generative.js +126 -0
- package/dist/elements/guardrail-notice.d.ts +29 -0
- package/dist/elements/guardrail-notice.js +63 -0
- package/dist/elements/image-generation.d.ts +18 -0
- package/dist/elements/image-generation.js +64 -0
- package/dist/elements/index.d.ts +116 -0
- package/dist/elements/index.js +115 -0
- package/dist/elements/inline-citation.d.ts +43 -0
- package/dist/elements/inline-citation.js +93 -0
- package/dist/elements/job-progress.d.ts +49 -0
- package/dist/elements/job-progress.js +74 -0
- package/dist/elements/launcher-bubble.d.ts +34 -0
- package/dist/elements/launcher-bubble.js +72 -0
- package/dist/elements/live-region-announcer.d.ts +130 -0
- package/dist/elements/live-region-announcer.js +230 -0
- package/dist/elements/loading-state.d.ts +27 -0
- package/dist/elements/loading-state.js +36 -0
- package/dist/elements/map-answer.d.ts +38 -0
- package/dist/elements/map-answer.js +93 -0
- package/dist/elements/markdown.d.ts +131 -0
- package/dist/elements/markdown.js +528 -0
- package/dist/elements/math-block.d.ts +51 -0
- package/dist/elements/math-block.js +70 -0
- package/dist/elements/mcp-server-panel.d.ts +41 -0
- package/dist/elements/mcp-server-panel.js +115 -0
- package/dist/elements/memory-chips.d.ts +30 -0
- package/dist/elements/memory-chips.js +43 -0
- package/dist/elements/message-actions.d.ts +38 -0
- package/dist/elements/message-actions.js +71 -0
- package/dist/elements/message-attachment.d.ts +48 -0
- package/dist/elements/message-attachment.js +63 -0
- package/dist/elements/message-branches.d.ts +25 -0
- package/dist/elements/message-branches.js +65 -0
- package/dist/elements/message-pair.d.ts +33 -0
- package/dist/elements/message-pair.js +65 -0
- package/dist/elements/message-queue.d.ts +31 -0
- package/dist/elements/message-queue.js +80 -0
- package/dist/elements/message-timing.d.ts +33 -0
- package/dist/elements/message-timing.js +37 -0
- package/dist/elements/mobile-composer.d.ts +44 -0
- package/dist/elements/mobile-composer.js +88 -0
- package/dist/elements/model-picker.d.ts +38 -0
- package/dist/elements/model-picker.js +69 -0
- package/dist/elements/number-ticker.d.ts +18 -0
- package/dist/elements/number-ticker.js +47 -0
- package/dist/elements/onboarding.d.ts +30 -0
- package/dist/elements/onboarding.js +75 -0
- package/dist/elements/permission-grant.d.ts +35 -0
- package/dist/elements/permission-grant.js +86 -0
- package/dist/elements/permission-scopes.d.ts +215 -0
- package/dist/elements/permission-scopes.js +249 -0
- package/dist/elements/prompt-library.d.ts +43 -0
- package/dist/elements/prompt-library.js +117 -0
- package/dist/elements/queue-dock.d.ts +101 -0
- package/dist/elements/queue-dock.js +132 -0
- package/dist/elements/quota-banner.d.ts +26 -0
- package/dist/elements/quota-banner.js +66 -0
- package/dist/elements/quote-reply.d.ts +44 -0
- package/dist/elements/quote-reply.js +79 -0
- package/dist/elements/range.d.ts +29 -0
- package/dist/elements/range.js +45 -0
- package/dist/elements/read-aloud.d.ts +45 -0
- package/dist/elements/read-aloud.js +75 -0
- package/dist/elements/reasoning-effort.d.ts +36 -0
- package/dist/elements/reasoning-effort.js +67 -0
- package/dist/elements/reasoning-panel.d.ts +46 -0
- package/dist/elements/reasoning-panel.js +75 -0
- package/dist/elements/recommendation-card.d.ts +45 -0
- package/dist/elements/recommendation-card.js +83 -0
- package/dist/elements/regenerate-menu.d.ts +45 -0
- package/dist/elements/regenerate-menu.js +51 -0
- package/dist/elements/replay.d.ts +217 -0
- package/dist/elements/replay.js +498 -0
- package/dist/elements/research-report.d.ts +38 -0
- package/dist/elements/research-report.js +69 -0
- package/dist/elements/retrieval-chunks.d.ts +43 -0
- package/dist/elements/retrieval-chunks.js +81 -0
- package/dist/elements/revert-dock.d.ts +159 -0
- package/dist/elements/revert-dock.js +327 -0
- package/dist/elements/reviewable-diff.d.ts +45 -0
- package/dist/elements/reviewable-diff.js +110 -0
- package/dist/elements/risk-badge.d.ts +52 -0
- package/dist/elements/risk-badge.js +91 -0
- package/dist/elements/schedule-card.d.ts +42 -0
- package/dist/elements/schedule-card.js +90 -0
- package/dist/elements/score-breakdown.d.ts +47 -0
- package/dist/elements/score-breakdown.js +82 -0
- package/dist/elements/scroll-anchor.d.ts +32 -0
- package/dist/elements/scroll-anchor.js +121 -0
- package/dist/elements/settings-panel.d.ts +52 -0
- package/dist/elements/settings-panel.js +107 -0
- package/dist/elements/shared-conversation.d.ts +39 -0
- package/dist/elements/shared-conversation.js +68 -0
- package/dist/elements/sources.d.ts +33 -0
- package/dist/elements/sources.js +61 -0
- package/dist/elements/speaker-identity.d.ts +32 -0
- package/dist/elements/speaker-identity.js +51 -0
- package/dist/elements/spec-sheet.d.ts +31 -0
- package/dist/elements/spec-sheet.js +45 -0
- package/dist/elements/stopped-run.d.ts +22 -0
- package/dist/elements/stopped-run.js +50 -0
- package/dist/elements/streaming-text.d.ts +31 -0
- package/dist/elements/streaming-text.js +45 -0
- package/dist/elements/subagent-list.d.ts +37 -0
- package/dist/elements/subagent-list.js +79 -0
- package/dist/elements/suggestions.d.ts +30 -0
- package/dist/elements/suggestions.js +36 -0
- package/dist/elements/surfaces.d.ts +85 -0
- package/dist/elements/surfaces.js +107 -0
- package/dist/elements/tail-status.d.ts +131 -0
- package/dist/elements/tail-status.js +94 -0
- package/dist/elements/terminal-block.d.ts +29 -0
- package/dist/elements/terminal-block.js +54 -0
- package/dist/elements/thinking-indicator.d.ts +18 -0
- package/dist/elements/thinking-indicator.js +36 -0
- package/dist/elements/thread-list.d.ts +35 -0
- package/dist/elements/thread-list.js +68 -0
- package/dist/elements/thread-search.d.ts +42 -0
- package/dist/elements/thread-search.js +99 -0
- package/dist/elements/timeline.d.ts +37 -0
- package/dist/elements/timeline.js +46 -0
- package/dist/elements/todo-list.d.ts +42 -0
- package/dist/elements/todo-list.js +59 -0
- package/dist/elements/tool-call.d.ts +41 -0
- package/dist/elements/tool-call.js +85 -0
- package/dist/elements/tool-error.d.ts +39 -0
- package/dist/elements/tool-error.js +76 -0
- package/dist/elements/tool-group.d.ts +45 -0
- package/dist/elements/tool-group.js +71 -0
- package/dist/elements/tool-timeline.d.ts +65 -0
- package/dist/elements/tool-timeline.js +88 -0
- package/dist/elements/trace-waterfall.d.ts +37 -0
- package/dist/elements/trace-waterfall.js +69 -0
- package/dist/elements/transcript-rules.d.ts +67 -0
- package/dist/elements/transcript-rules.js +95 -0
- package/dist/elements/turn-footer.d.ts +74 -0
- package/dist/elements/turn-footer.js +101 -0
- package/dist/elements/typing-indicator.d.ts +16 -0
- package/dist/elements/typing-indicator.js +51 -0
- package/dist/elements/verdict-row.d.ts +89 -0
- package/dist/elements/verdict-row.js +150 -0
- package/dist/elements/vocabulary.d.ts +612 -0
- package/dist/elements/vocabulary.js +611 -0
- package/dist/elements/voice-conversation.d.ts +49 -0
- package/dist/elements/voice-conversation.js +123 -0
- package/dist/elements/web-preview.d.ts +32 -0
- package/dist/elements/web-preview.js +66 -0
- package/dist/elements/web-search.d.ts +37 -0
- package/dist/elements/web-search.js +66 -0
- package/dist/elements/work-collapse.d.ts +103 -0
- package/dist/elements/work-collapse.js +131 -0
- package/dist/icons/containers.d.ts +89 -0
- package/dist/icons/containers.js +295 -0
- package/dist/icons/index.d.ts +2 -0
- package/dist/index.d.ts +9 -7
- package/dist/index.js +3 -2
- package/dist/instruments/index.d.ts +2 -2
- package/dist/instruments/index.js +2 -2
- package/dist/instruments/table.d.ts +14 -1
- package/dist/instruments/table.js +20 -1
- package/dist/instruments/two-step-button.js +25 -6
- package/dist/layout/sidebar.d.ts +19 -1
- package/dist/layout/sidebar.js +19 -1
- package/dist/primitives/button.js +11 -1
- package/dist/primitives/chip.d.ts +34 -8
- package/dist/primitives/chip.js +97 -11
- package/dist/styles.css +11 -1
- package/dist/system/agent-skin.d.ts +27 -0
- package/dist/system/agent-skin.js +20 -0
- package/dist/system/index.d.ts +3 -3
- package/dist/system/portal.d.ts +5 -3
- package/dist/system/portal.js +36 -8
- package/dist/system/prepaint.d.ts +20 -2
- package/dist/system/prepaint.js +39 -33
- package/dist/system/theme-provider.d.ts +13 -2
- package/dist/system/theme-provider.js +107 -26
- package/dist/system/use-density.d.ts +9 -0
- package/dist/system/use-density.js +9 -0
- package/dist/system/use-isomorphic-layout-effect.js +19 -1
- package/dist/theming/_presets.d.ts +1 -1
- package/dist/theming/_presets.js +124 -8
- package/dist/theming/contrast.d.ts +16 -4
- package/dist/theming/contrast.js +33 -6
- package/dist/theming/create-theme.d.ts +8 -4
- package/dist/theming/create-theme.js +56 -20
- package/dist/theming/serialize.d.ts +11 -2
- package/dist/theming/serialize.js +87 -9
- package/manifest/components/accordion.json +154 -0
- package/manifest/components/activity-graph.json +88 -0
- package/manifest/components/agent-card.json +120 -0
- package/manifest/components/agent-handoff.json +87 -0
- package/manifest/components/agent-mode-badge.json +84 -0
- package/manifest/components/agent-pile.json +116 -0
- package/manifest/components/agent-plan.json +67 -0
- package/manifest/components/agent-status.json +73 -0
- package/manifest/components/agent-surface.json +78 -0
- package/manifest/components/alert-dialog.json +190 -0
- package/manifest/components/animated-number.json +67 -0
- package/manifest/components/app-bar.json +244 -0
- package/manifest/components/app-shell.json +383 -0
- package/manifest/components/app-window-frame.json +102 -0
- package/manifest/components/approval-card.json +106 -0
- package/manifest/components/artifact-card.json +81 -0
- package/manifest/components/ask-box.json +209 -0
- package/manifest/components/audience-icon.json +52 -0
- package/manifest/components/autocomplete.json +197 -0
- package/manifest/components/avatar-group.json +72 -0
- package/manifest/components/avatar.json +95 -0
- package/manifest/components/background-inbox.json +71 -0
- package/manifest/components/branch-picker.json +124 -0
- package/manifest/components/breadcrumb.json +74 -0
- package/manifest/components/button-group.json +74 -0
- package/manifest/components/button.json +126 -0
- package/manifest/components/calendar.json +65 -0
- package/manifest/components/canvas-split-body.json +62 -0
- package/manifest/components/canvas-split-document.json +54 -0
- package/manifest/components/canvas-split-header.json +83 -0
- package/manifest/components/canvas-split-line.json +62 -0
- package/manifest/components/canvas-split-message.json +62 -0
- package/manifest/components/canvas-split-thread.json +54 -0
- package/manifest/components/canvas-split.json +60 -0
- package/manifest/components/card.json +140 -0
- package/manifest/components/carousel.json +200 -0
- package/manifest/components/catalogue-icon.json +52 -0
- package/manifest/components/channel-beta-icon.json +52 -0
- package/manifest/components/channel-matrix.json +173 -0
- package/manifest/components/channel-released-icon.json +52 -0
- package/manifest/components/chart-container.json +111 -0
- package/manifest/components/chart-ramp.json +72 -0
- package/manifest/components/chart-swatch.json +65 -0
- package/manifest/components/chart-tooltip-content.json +114 -0
- package/manifest/components/chart.json +93 -0
- package/manifest/components/chat-empty-state.json +55 -0
- package/manifest/components/chat-panel-assistant-message.json +51 -0
- package/manifest/components/chat-panel-composer.json +66 -0
- package/manifest/components/chat-panel-messages.json +51 -0
- package/manifest/components/chat-panel-typing.json +51 -0
- package/manifest/components/chat-panel-user-message.json +51 -0
- package/manifest/components/chat-panel.json +57 -0
- package/manifest/components/checkbox-group.json +68 -0
- package/manifest/components/checkbox.json +93 -0
- package/manifest/components/checkpoint-history.json +80 -0
- package/manifest/components/chip.json +144 -0
- package/manifest/components/clamp.json +102 -0
- package/manifest/components/cli-tool-icon.json +52 -0
- package/manifest/components/code-diff.json +87 -0
- package/manifest/components/code-runner.json +97 -0
- package/manifest/components/collapsible.json +120 -0
- package/manifest/components/color-area.json +59 -0
- package/manifest/components/color-field.json +79 -0
- package/manifest/components/color-picker.json +175 -0
- package/manifest/components/color-slider.json +75 -0
- package/manifest/components/color-swatch.json +68 -0
- package/manifest/components/colors-section.json +66 -0
- package/manifest/components/combobox.json +198 -0
- package/manifest/components/command-palette.json +177 -0
- package/manifest/components/compaction-row.json +100 -0
- package/manifest/components/comparison-card.json +83 -0
- package/manifest/components/composer-actions.json +65 -0
- package/manifest/components/composer-attach-button.json +65 -0
- package/manifest/components/composer-attachment-chip.json +75 -0
- package/manifest/components/composer-attachments.json +60 -0
- package/manifest/components/composer-bar.json +73 -0
- package/manifest/components/composer-command-item.json +79 -0
- package/manifest/components/composer-context.json +67 -0
- package/manifest/components/composer-input.json +73 -0
- package/manifest/components/composer-menu-item.json +72 -0
- package/manifest/components/composer-menu.json +79 -0
- package/manifest/components/composer-model-item.json +75 -0
- package/manifest/components/composer-model-trigger.json +75 -0
- package/manifest/components/composer-person-item.json +79 -0
- package/manifest/components/composer-send.json +80 -0
- package/manifest/components/composer-toolbar.json +65 -0
- package/manifest/components/composer-voice-button.json +68 -0
- package/manifest/components/composer-voice.json +75 -0
- package/manifest/components/composer.json +176 -0
- package/manifest/components/computer-use.json +84 -0
- package/manifest/components/confidence-marker.json +74 -0
- package/manifest/components/connection-state.json +84 -0
- package/manifest/components/container.json +60 -0
- package/manifest/components/context-breakdown.json +65 -0
- package/manifest/components/context-menu.json +121 -0
- package/manifest/components/context-usage.json +85 -0
- package/manifest/components/conversation-search.json +92 -0
- package/manifest/components/copy-button.json +93 -0
- package/manifest/components/cost-meter.json +74 -0
- package/manifest/components/cue-logotype.json +96 -0
- package/manifest/components/cue-mark.json +97 -0
- package/manifest/components/cue-portal-frame.json +55 -0
- package/manifest/components/data-table-pagination.json +83 -0
- package/manifest/components/data-table-toolbar.json +104 -0
- package/manifest/components/date-field.json +80 -0
- package/manifest/components/date-picker.json +191 -0
- package/manifest/components/date-range-picker.json +191 -0
- package/manifest/components/day-separator.json +58 -0
- package/manifest/components/delegation-card.json +144 -0
- package/manifest/components/density.json +58 -0
- package/manifest/components/description-list.json +84 -0
- package/manifest/components/diagram.json +100 -0
- package/manifest/components/dialog.json +198 -0
- package/manifest/components/disclosure.json +109 -0
- package/manifest/components/dmx-bar.json +94 -0
- package/manifest/components/dmx-strip.json +101 -0
- package/manifest/components/document-reference.json +90 -0
- package/manifest/components/draft-restore.json +82 -0
- package/manifest/components/drawer.json +179 -0
- package/manifest/components/dropdown-menu.json +229 -0
- package/manifest/components/edit-message.json +105 -0
- package/manifest/components/elements-command-palette.json +100 -0
- package/manifest/components/elements-composer.json +71 -0
- package/manifest/components/elements-data-table.json +68 -0
- package/manifest/components/elements-timeline.json +69 -0
- package/manifest/components/elicitation-form.json +103 -0
- package/manifest/components/empty-state-composer.json +64 -0
- package/manifest/components/empty-state-greeting.json +49 -0
- package/manifest/components/empty-state-suggestion.json +57 -0
- package/manifest/components/empty-state-suggestions.json +49 -0
- package/manifest/components/empty-state.json +90 -0
- package/manifest/components/end-of-turn-summary.json +77 -0
- package/manifest/components/env-var-input.json +150 -0
- package/manifest/components/error-state.json +80 -0
- package/manifest/components/export-dialog.json +84 -0
- package/manifest/components/eyebrow.json +56 -0
- package/manifest/components/feedback-dialog.json +107 -0
- package/manifest/components/field-description.json +63 -0
- package/manifest/components/field-error.json +77 -0
- package/manifest/components/field-label.json +63 -0
- package/manifest/components/field.json +79 -0
- package/manifest/components/file-tree.json +83 -0
- package/manifest/components/file-upload.json +159 -0
- package/manifest/components/flow-background.json +50 -0
- package/manifest/components/flow-controls.json +50 -0
- package/manifest/components/flow-graph.json +75 -0
- package/manifest/components/folder-icon.json +52 -0
- package/manifest/components/footer.json +112 -0
- package/manifest/components/frac.json +59 -0
- package/manifest/components/generation-loader.json +64 -0
- package/manifest/components/generative-ui.json +93 -0
- package/manifest/components/grid.json +81 -0
- package/manifest/components/group-bar.json +102 -0
- package/manifest/components/guardrail-notice.json +91 -0
- package/manifest/components/hover-card.json +151 -0
- package/manifest/components/icon-button.json +88 -0
- package/manifest/components/image-generation.json +67 -0
- package/manifest/components/info-tip.json +98 -0
- package/manifest/components/inline-citation.json +77 -0
- package/manifest/components/input-group.json +91 -0
- package/manifest/components/input.json +89 -0
- package/manifest/components/item.json +129 -0
- package/manifest/components/job-progress.json +96 -0
- package/manifest/components/kbd.json +52 -0
- package/manifest/components/launcher-bubble.json +105 -0
- package/manifest/components/link.json +81 -0
- package/manifest/components/live-region-announcer.json +79 -0
- package/manifest/components/log-viewer.json +139 -0
- package/manifest/components/map-answer.json +83 -0
- package/manifest/components/markdown-text.json +94 -0
- package/manifest/components/math-block.json +74 -0
- package/manifest/components/mcp-server-icon.json +52 -0
- package/manifest/components/mcp-server-panel.json +87 -0
- package/manifest/components/memory-chips.json +65 -0
- package/manifest/components/menubar.json +157 -0
- package/manifest/components/message-actions.json +99 -0
- package/manifest/components/message-attachments.json +63 -0
- package/manifest/components/message-branches.json +71 -0
- package/manifest/components/message-list.json +100 -0
- package/manifest/components/message-pair.json +86 -0
- package/manifest/components/message-queue.json +74 -0
- package/manifest/components/message-timing.json +62 -0
- package/manifest/components/message.json +116 -0
- package/manifest/components/meter.json +114 -0
- package/manifest/components/mobile-composer.json +126 -0
- package/manifest/components/model-picker.json +76 -0
- package/manifest/components/multi-select.json +190 -0
- package/manifest/components/musical-time-input.json +113 -0
- package/manifest/components/navigation-menu.json +226 -0
- package/manifest/components/node-card.json +109 -0
- package/manifest/components/node-handle.json +69 -0
- package/manifest/components/number-field.json +107 -0
- package/manifest/components/number-ticker.json +61 -0
- package/manifest/components/onboarding.json +84 -0
- package/manifest/components/otp-field.json +128 -0
- package/manifest/components/page-shell.json +96 -0
- package/manifest/components/pagination.json +92 -0
- package/manifest/components/panel-header.json +77 -0
- package/manifest/components/panel.json +71 -0
- package/manifest/components/password-input.json +119 -0
- package/manifest/components/permission-grant.json +92 -0
- package/manifest/components/permission-scopes.json +139 -0
- package/manifest/components/piano-keyboard.json +120 -0
- package/manifest/components/plussie.json +111 -0
- package/manifest/components/popover.json +193 -0
- package/manifest/components/preset-section.json +73 -0
- package/manifest/components/progress.json +95 -0
- package/manifest/components/prompt-library.json +99 -0
- package/manifest/components/queue-dock.json +110 -0
- package/manifest/components/quota-banner.json +94 -0
- package/manifest/components/quote-reply.json +105 -0
- package/manifest/components/radio-group.json +73 -0
- package/manifest/components/radio.json +80 -0
- package/manifest/components/rating.json +141 -0
- package/manifest/components/read-aloud.json +111 -0
- package/manifest/components/reasoning-effort.json +81 -0
- package/manifest/components/reasoning-panel.json +108 -0
- package/manifest/components/recommendation-card.json +107 -0
- package/manifest/components/regenerate-menu.json +89 -0
- package/manifest/components/replay-player.json +102 -0
- package/manifest/components/research-report.json +76 -0
- package/manifest/components/resizable.json +88 -0
- package/manifest/components/retrieval-chunks.json +84 -0
- package/manifest/components/revert-dock.json +150 -0
- package/manifest/components/reviewable-diff.json +93 -0
- package/manifest/components/risk-badge.json +74 -0
- package/manifest/components/row.json +109 -0
- package/manifest/components/schedule-card.json +101 -0
- package/manifest/components/score-breakdown.json +91 -0
- package/manifest/components/scroll-anchor.json +72 -0
- package/manifest/components/scroll-area.json +91 -0
- package/manifest/components/scrollable-tabs-list.json +83 -0
- package/manifest/components/scrub-input.json +200 -0
- package/manifest/components/seam-cell.json +75 -0
- package/manifest/components/seam-grid.json +75 -0
- package/manifest/components/seam-list.json +56 -0
- package/manifest/components/search-input.json +134 -0
- package/manifest/components/section-header.json +112 -0
- package/manifest/components/segmented-control.json +138 -0
- package/manifest/components/select.json +194 -0
- package/manifest/components/separator.json +53 -0
- package/manifest/components/settings-panel.json +118 -0
- package/manifest/components/shape-section.json +66 -0
- package/manifest/components/shared-conversation.json +89 -0
- package/manifest/components/sheet.json +186 -0
- package/manifest/components/shimmer-label.json +59 -0
- package/manifest/components/sidebar.json +198 -0
- package/manifest/components/signal-edge.json +56 -0
- package/manifest/components/skeleton.json +46 -0
- package/manifest/components/skill-icon.json +52 -0
- package/manifest/components/slider.json +89 -0
- package/manifest/components/sources.json +83 -0
- package/manifest/components/sparkline.json +76 -0
- package/manifest/components/speaker-identity.json +61 -0
- package/manifest/components/spec-sheet.json +80 -0
- package/manifest/components/spectrum-visualizer.json +115 -0
- package/manifest/components/spinner.json +61 -0
- package/manifest/components/stack-icon.json +52 -0
- package/manifest/components/stack.json +96 -0
- package/manifest/components/stacks-matrix-icon.json +52 -0
- package/manifest/components/stat.json +87 -0
- package/manifest/components/status-bar.json +58 -0
- package/manifest/components/status-dot.json +78 -0
- package/manifest/components/stepper.json +89 -0
- package/manifest/components/stopped-run.json +81 -0
- package/manifest/components/streaming-text.json +71 -0
- package/manifest/components/sub.json +44 -0
- package/manifest/components/subagent-list.json +88 -0
- package/manifest/components/suggestions.json +84 -0
- package/manifest/components/sup.json +44 -0
- package/manifest/components/swap-label.json +71 -0
- package/manifest/components/switch.json +87 -0
- package/manifest/components/table-scroll-region.json +69 -0
- package/manifest/components/table.json +155 -0
- package/manifest/components/tabs.json +145 -0
- package/manifest/components/tags-input.json +190 -0
- package/manifest/components/tail-status.json +109 -0
- package/manifest/components/terminal-block.json +91 -0
- package/manifest/components/terminal-frame.json +119 -0
- package/manifest/components/textarea.json +76 -0
- package/manifest/components/theme-configurator.json +124 -0
- package/manifest/components/theme-provider.json +134 -0
- package/manifest/components/thinking-indicator.json +63 -0
- package/manifest/components/thread-list.json +76 -0
- package/manifest/components/thread-search.json +90 -0
- package/manifest/components/threshold-rail.json +160 -0
- package/manifest/components/time-boundary.json +62 -0
- package/manifest/components/time-field.json +80 -0
- package/manifest/components/timeline-ruler.json +139 -0
- package/manifest/components/timeline.json +115 -0
- package/manifest/components/title-bar.json +82 -0
- package/manifest/components/toast.json +130 -0
- package/manifest/components/todo-list.json +69 -0
- package/manifest/components/toggle-group.json +106 -0
- package/manifest/components/toggle.json +109 -0
- package/manifest/components/token-editor.json +90 -0
- package/manifest/components/tool-call-card.json +200 -0
- package/manifest/components/tool-call.json +119 -0
- package/manifest/components/tool-error.json +114 -0
- package/manifest/components/tool-group.json +83 -0
- package/manifest/components/tool-timeline.json +119 -0
- package/manifest/components/toolbar.json +163 -0
- package/manifest/components/tooltip.json +164 -0
- package/manifest/components/trace-waterfall.json +74 -0
- package/manifest/components/tree-visibility-toggle.json +84 -0
- package/manifest/components/tree.json +140 -0
- package/manifest/components/turn-footer.json +105 -0
- package/manifest/components/two-step-button.json +113 -0
- package/manifest/components/typing-indicator.json +53 -0
- package/manifest/components/universe-grid.json +127 -0
- package/manifest/components/unread-divider.json +55 -0
- package/manifest/components/usage-chart.json +124 -0
- package/manifest/components/verdict-row.json +91 -0
- package/manifest/components/voice-conversation.json +109 -0
- package/manifest/components/web-preview.json +87 -0
- package/manifest/components/web-search.json +92 -0
- package/manifest/components/work-collapse.json +102 -0
- package/manifest/manifest.json +4779 -0
- package/manifest/tokens.json +159 -0
- package/package.json +54 -5
|
@@ -0,0 +1,505 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../lib/cn.js";
|
|
3
|
+
import { ShimmerLabel, field, floating, ghostButton, iconSwap, iconSwapIn, iconSwapOut, inkButton, mono, paper } from "./surfaces.js";
|
|
4
|
+
import { clamp, pct } from "./range.js";
|
|
5
|
+
import { useMemo } from "react";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { ArrowUpIcon, CheckIcon, ChevronDownIcon, FileArchiveIcon, FileImageIcon, FileTextIcon, Loader2Icon, MicIcon, PlusIcon, SquareIcon, XIcon } from "lucide-react";
|
|
8
|
+
//#region src/elements/composer.tsx
|
|
9
|
+
const ATTACHMENT_ICONS = {
|
|
10
|
+
image: FileImageIcon,
|
|
11
|
+
text: FileTextIcon,
|
|
12
|
+
archive: FileArchiveIcon
|
|
13
|
+
};
|
|
14
|
+
const BARS = Array.from({ length: 14 }, (_, i) => i);
|
|
15
|
+
function barHeight(bar, tick) {
|
|
16
|
+
return 5 + Math.abs(Math.sin(bar * 1.35 + tick * .55)) * 13;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Commands whose name starts with the slash query, or none when not typing one.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* import { ComposerCommandItem, ComposerMenu, useSlashMatches } from "@cueplusplus/ui/elements";
|
|
23
|
+
*
|
|
24
|
+
* const matches = useSlashMatches(value, commands);
|
|
25
|
+
*
|
|
26
|
+
* <ComposerMenu open={matches.length > 0}>
|
|
27
|
+
* {matches.map((command, index) => (
|
|
28
|
+
* <ComposerCommandItem
|
|
29
|
+
* key={command.name}
|
|
30
|
+
* command={command}
|
|
31
|
+
* active={index === active}
|
|
32
|
+
* onClick={() => setValue(`/${command.name} `)}
|
|
33
|
+
* />
|
|
34
|
+
* ))}
|
|
35
|
+
* </ComposerMenu>
|
|
36
|
+
*/
|
|
37
|
+
function useSlashMatches(value, commands) {
|
|
38
|
+
return useMemo(() => {
|
|
39
|
+
if (!commands || !value.startsWith("/")) return [];
|
|
40
|
+
const query = value.slice(1).toLowerCase();
|
|
41
|
+
return commands.filter((command) => command.name.startsWith(query));
|
|
42
|
+
}, [commands, value]);
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* People matching a trailing @mention, or none when the caret is not in one.
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* import { ComposerMenu, ComposerPersonItem, applyMention, useMentionMatches } from "@cueplusplus/ui/elements";
|
|
49
|
+
*
|
|
50
|
+
* const matches = useMentionMatches(value, people);
|
|
51
|
+
*
|
|
52
|
+
* <ComposerMenu open={matches.length > 0} align="end">
|
|
53
|
+
* {matches.map((person, index) => (
|
|
54
|
+
* <ComposerPersonItem
|
|
55
|
+
* key={person.name}
|
|
56
|
+
* person={person}
|
|
57
|
+
* active={index === active}
|
|
58
|
+
* onClick={() => setValue(applyMention(value, person.name))}
|
|
59
|
+
* />
|
|
60
|
+
* ))}
|
|
61
|
+
* </ComposerMenu>
|
|
62
|
+
*/
|
|
63
|
+
function useMentionMatches(value, people) {
|
|
64
|
+
return useMemo(() => {
|
|
65
|
+
if (!people) return [];
|
|
66
|
+
const match = /@([\w]*)$/.exec(value);
|
|
67
|
+
if (!match) return [];
|
|
68
|
+
const query = match[1]?.toLowerCase() ?? "";
|
|
69
|
+
return people.filter((person) => person.name.toLowerCase().startsWith(query));
|
|
70
|
+
}, [people, value]);
|
|
71
|
+
}
|
|
72
|
+
/** Replaces the trailing @mention with the chosen name. */
|
|
73
|
+
function applyMention(value, name) {
|
|
74
|
+
return value.replace(/@[\w]*$/, `@${name} `);
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* The unified input: attachments, commands, mentions, models, voice, and context in
|
|
78
|
+
* one surface.
|
|
79
|
+
*
|
|
80
|
+
* @example
|
|
81
|
+
* import {
|
|
82
|
+
* Composer,
|
|
83
|
+
* ComposerActions,
|
|
84
|
+
* ComposerAttachButton,
|
|
85
|
+
* ComposerBar,
|
|
86
|
+
* ComposerInput,
|
|
87
|
+
* ComposerSend,
|
|
88
|
+
* ComposerToolbar,
|
|
89
|
+
* } from "@cueplusplus/ui/elements";
|
|
90
|
+
*
|
|
91
|
+
* <Composer>
|
|
92
|
+
* <ComposerBar>
|
|
93
|
+
* <ComposerInput value={value} placeholder="Ask anything" onChange={onChange} onSubmit={send} />
|
|
94
|
+
* <ComposerToolbar>
|
|
95
|
+
* <ComposerActions><ComposerAttachButton onClick={pick} /></ComposerActions>
|
|
96
|
+
* <ComposerActions><ComposerSend streaming={false} idle={!value} onClick={send} /></ComposerActions>
|
|
97
|
+
* </ComposerToolbar>
|
|
98
|
+
* </ComposerBar>
|
|
99
|
+
* </Composer>
|
|
100
|
+
*/
|
|
101
|
+
function ElementsComposer({ className, ...props }) {
|
|
102
|
+
return /* @__PURE__ */ jsx("div", {
|
|
103
|
+
"data-slot": "composer",
|
|
104
|
+
className: cn("relative w-full max-w-lg", className),
|
|
105
|
+
...props
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* The bar itself: the paper the input, the attachments and the toolbar sit on.
|
|
110
|
+
* `dragActive` tints it while a file is over it, which is the only feedback a drop
|
|
111
|
+
* target gets before the drop.
|
|
112
|
+
*/
|
|
113
|
+
function ComposerBar({ dragActive = false, className, ...props }) {
|
|
114
|
+
return /* @__PURE__ */ jsx("div", {
|
|
115
|
+
"data-slot": "composer-bar",
|
|
116
|
+
"data-drag-active": dragActive || void 0,
|
|
117
|
+
className: cn(paper, "flex w-full flex-col gap-2 rounded-(--radius-overlay) p-2.5 transition-colors", dragActive && "bg-stream/10", className),
|
|
118
|
+
...props
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* The popover the slash and mention menus are drawn in, anchored above the bar. It
|
|
123
|
+
* animates open rather than mounting, so the caret never moves under it.
|
|
124
|
+
*/
|
|
125
|
+
function ComposerMenu({ open, align = "start", className, ...props }) {
|
|
126
|
+
return /* @__PURE__ */ jsx("div", {
|
|
127
|
+
"data-slot": "composer-menu",
|
|
128
|
+
"data-open": open || void 0,
|
|
129
|
+
className: cn(floating, "absolute bottom-full z-10 mb-2 flex w-72 flex-col gap-0.5 rounded-(--radius-overlay) p-1.5", align === "start" ? "start-0 origin-bottom-left" : "end-0 origin-bottom-right", "transition-[opacity,scale] duration-200 ease-[cubic-bezier(0.23,1,0.32,1)] motion-reduce:transition-none", open ? "scale-100 opacity-100" : "pointer-events-none scale-[0.97] opacity-0", className),
|
|
130
|
+
...props
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* One row of a `ComposerMenu`, and the chassis the command, person and model rows are
|
|
135
|
+
* built on.
|
|
136
|
+
*/
|
|
137
|
+
function ComposerMenuItem({ active = false, className, ...props }) {
|
|
138
|
+
return /* @__PURE__ */ jsx("button", {
|
|
139
|
+
type: "button",
|
|
140
|
+
"data-slot": "composer-menu-item",
|
|
141
|
+
"data-active": active || void 0,
|
|
142
|
+
className: cn("flex w-full items-center gap-2.5 rounded-(--radius-surface) px-2.5 py-2 text-(length:--cue-text-body) transition-colors", active ? field : "hover:bg-surface-1", className),
|
|
143
|
+
...props
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* A slash command in the menu: its icon, `/name`, what it does, and the return key on
|
|
148
|
+
* the active row.
|
|
149
|
+
*/
|
|
150
|
+
function ComposerCommandItem({ command, active, ...props }) {
|
|
151
|
+
return /* @__PURE__ */ jsxs(ComposerMenuItem, {
|
|
152
|
+
active,
|
|
153
|
+
...props,
|
|
154
|
+
children: [
|
|
155
|
+
/* @__PURE__ */ jsx(command.icon, { className: "text-fg-subtle size-3.5 shrink-0" }),
|
|
156
|
+
/* @__PURE__ */ jsxs("span", {
|
|
157
|
+
className: "font-medium",
|
|
158
|
+
children: ["/", command.name]
|
|
159
|
+
}),
|
|
160
|
+
/* @__PURE__ */ jsx("span", {
|
|
161
|
+
className: "text-fg-muted flex-1 truncate text-start text-(length:--cue-text-ui)",
|
|
162
|
+
children: command.description
|
|
163
|
+
}),
|
|
164
|
+
active && /* @__PURE__ */ jsx("kbd", {
|
|
165
|
+
className: "bg-surface-2 text-fg-muted rounded-(--radius-control) px-1 font-mono text-(length:--cue-text-micro)",
|
|
166
|
+
children: "↵"
|
|
167
|
+
})
|
|
168
|
+
]
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* A mentionable person in the menu: their initial, their name, and whether they are an
|
|
173
|
+
* agent or a human.
|
|
174
|
+
*/
|
|
175
|
+
function ComposerPersonItem({ person, active, ...props }) {
|
|
176
|
+
return /* @__PURE__ */ jsxs(ComposerMenuItem, {
|
|
177
|
+
active,
|
|
178
|
+
...props,
|
|
179
|
+
children: [
|
|
180
|
+
/* @__PURE__ */ jsx("span", {
|
|
181
|
+
className: "bg-surface-2 text-fg-muted flex size-5 shrink-0 items-center justify-center rounded-full text-(length:--cue-text-micro) font-medium",
|
|
182
|
+
children: person.name[0]
|
|
183
|
+
}),
|
|
184
|
+
/* @__PURE__ */ jsx("span", {
|
|
185
|
+
className: "flex-1 truncate text-start",
|
|
186
|
+
children: person.name
|
|
187
|
+
}),
|
|
188
|
+
/* @__PURE__ */ jsx("span", {
|
|
189
|
+
className: cn(mono, "text-fg-subtle"),
|
|
190
|
+
children: person.role
|
|
191
|
+
})
|
|
192
|
+
]
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
/** The rail the attachment chips wrap in, above the input. */
|
|
196
|
+
function ComposerAttachments({ className, ...props }) {
|
|
197
|
+
return /* @__PURE__ */ jsx("div", {
|
|
198
|
+
"data-slot": "composer-attachments",
|
|
199
|
+
className: cn("flex flex-wrap gap-2", className),
|
|
200
|
+
...props
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* One attached file as a chip: an icon for its kind, its name and size, and — while it
|
|
205
|
+
* uploads — a progress hairline along the bottom edge. A finished one offers remove, a
|
|
206
|
+
* failed one says so in its meta line.
|
|
207
|
+
*/
|
|
208
|
+
function ComposerAttachmentChip({ attachment, onRemove, className, ...props }) {
|
|
209
|
+
const Icon = ATTACHMENT_ICONS[attachment.kind ?? "text"];
|
|
210
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
211
|
+
"data-slot": "composer-attachment",
|
|
212
|
+
"data-state": attachment.state,
|
|
213
|
+
className: cn(field, "relative flex items-center gap-2.5 overflow-hidden rounded-(--radius-surface) py-1.5 ps-1.5 pe-2.5", className),
|
|
214
|
+
...props,
|
|
215
|
+
children: [
|
|
216
|
+
/* @__PURE__ */ jsx("span", {
|
|
217
|
+
className: "bg-surface-2 text-fg-muted flex size-8 shrink-0 items-center justify-center rounded-(--radius-surface)",
|
|
218
|
+
children: /* @__PURE__ */ jsx(Icon, { className: "size-4" })
|
|
219
|
+
}),
|
|
220
|
+
/* @__PURE__ */ jsxs("span", {
|
|
221
|
+
className: "flex flex-col",
|
|
222
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
223
|
+
className: "max-w-36 truncate text-(length:--cue-text-ui) font-medium",
|
|
224
|
+
children: attachment.name
|
|
225
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
226
|
+
className: cn("text-(length:--cue-text-label)", attachment.state === "error" ? "text-danger/80" : "text-fg-subtle"),
|
|
227
|
+
children: attachment.meta
|
|
228
|
+
})]
|
|
229
|
+
}),
|
|
230
|
+
/* @__PURE__ */ jsx("span", {
|
|
231
|
+
className: "ms-1 flex w-5 items-center justify-end",
|
|
232
|
+
children: attachment.state === "uploading" ? /* @__PURE__ */ jsx(Loader2Icon, { className: "text-fg-subtle size-3.5 animate-spin motion-reduce:animate-none" }) : attachment.state === "done" && onRemove ? /* @__PURE__ */ jsx("button", {
|
|
233
|
+
type: "button",
|
|
234
|
+
"aria-label": `Remove ${attachment.name}`,
|
|
235
|
+
onClick: () => onRemove(attachment.name),
|
|
236
|
+
className: cn(ghostButton, "size-5 [&_svg]:size-3"),
|
|
237
|
+
children: /* @__PURE__ */ jsx(XIcon, {})
|
|
238
|
+
}) : attachment.state === "done" ? /* @__PURE__ */ jsx(CheckIcon, { className: "size-3.5 text-ok" }) : null
|
|
239
|
+
}),
|
|
240
|
+
attachment.state === "uploading" && /* @__PURE__ */ jsx("span", {
|
|
241
|
+
"aria-hidden": true,
|
|
242
|
+
className: "absolute inset-x-0 bottom-0 h-0.5 bg-stream/70 transition-[width] duration-300",
|
|
243
|
+
style: { width: `${pct(attachment.progress ?? 0, 100)}%` }
|
|
244
|
+
})
|
|
245
|
+
]
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* The text field. Enter submits, guarded against IME composition so accepting a
|
|
250
|
+
* candidate does not send the message.
|
|
251
|
+
*/
|
|
252
|
+
function ComposerInput({ onSubmit, onKeyDown, className, ...props }) {
|
|
253
|
+
return /* @__PURE__ */ jsx("input", {
|
|
254
|
+
"data-slot": "composer-input",
|
|
255
|
+
onKeyDown: (event) => {
|
|
256
|
+
onKeyDown?.(event);
|
|
257
|
+
if (event.defaultPrevented) return;
|
|
258
|
+
if (event.key !== "Enter" || event.nativeEvent.isComposing) return;
|
|
259
|
+
onSubmit?.();
|
|
260
|
+
},
|
|
261
|
+
className: cn("placeholder:text-fg-subtle min-h-11 w-full bg-transparent px-3 text-(length:--cue-text-emphasis) caret-stream outline-none focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-offset-1 focus-visible:outline-accent", className),
|
|
262
|
+
...props
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
/**
|
|
266
|
+
* What replaces the input while the microphone is open: a level meter, a running clock
|
|
267
|
+
* while recording, and a shimmering `Transcribing` once it stops.
|
|
268
|
+
*/
|
|
269
|
+
function ComposerVoice({ recording, seconds, className, ...props }) {
|
|
270
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
271
|
+
"data-slot": "composer-voice",
|
|
272
|
+
"data-recording": recording || void 0,
|
|
273
|
+
className: cn("flex min-h-11 items-center gap-3 ps-3", className),
|
|
274
|
+
...props,
|
|
275
|
+
children: [
|
|
276
|
+
recording && /* @__PURE__ */ jsx("span", {
|
|
277
|
+
"aria-hidden": true,
|
|
278
|
+
className: "size-1.5 animate-pulse rounded-full bg-stream"
|
|
279
|
+
}),
|
|
280
|
+
/* @__PURE__ */ jsx("div", {
|
|
281
|
+
className: "flex h-6 items-center gap-[3px]",
|
|
282
|
+
"aria-hidden": true,
|
|
283
|
+
children: BARS.map((bar) => /* @__PURE__ */ jsx("span", {
|
|
284
|
+
className: cn("w-0.5 rounded-full transition-[height,background-color] duration-150 motion-reduce:transition-none", recording ? "bg-accent" : "bg-surface-3"),
|
|
285
|
+
style: { height: recording ? barHeight(bar, seconds * 10) : 3 }
|
|
286
|
+
}, bar))
|
|
287
|
+
}),
|
|
288
|
+
recording ? /* @__PURE__ */ jsxs("span", {
|
|
289
|
+
className: cn(mono, "text-fg-subtle tabular-nums"),
|
|
290
|
+
children: ["0:", String(seconds).padStart(2, "0")]
|
|
291
|
+
}) : /* @__PURE__ */ jsx(ShimmerLabel, {
|
|
292
|
+
className: "text-fg-muted relative text-(length:--cue-text-body)",
|
|
293
|
+
children: "Transcribing"
|
|
294
|
+
})
|
|
295
|
+
]
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
/** The row under the input, which holds the two `ComposerActions` clusters. */
|
|
299
|
+
function ComposerToolbar({ className, ...props }) {
|
|
300
|
+
return /* @__PURE__ */ jsx("div", {
|
|
301
|
+
"data-slot": "composer-toolbar",
|
|
302
|
+
className: cn("flex items-center justify-between", className),
|
|
303
|
+
...props
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
/** One cluster of controls in the toolbar. Two of them, one at each end. */
|
|
307
|
+
function ComposerActions({ className, ...props }) {
|
|
308
|
+
return /* @__PURE__ */ jsx("div", {
|
|
309
|
+
"data-slot": "composer-actions",
|
|
310
|
+
className: cn("flex items-center gap-1.5", className),
|
|
311
|
+
...props
|
|
312
|
+
});
|
|
313
|
+
}
|
|
314
|
+
/**
|
|
315
|
+
* The paperclip, as a plus. Disabled when no handler is given, rather than rendering a
|
|
316
|
+
* control that does nothing.
|
|
317
|
+
*/
|
|
318
|
+
function ComposerAttachButton({ className, ...props }) {
|
|
319
|
+
return /* @__PURE__ */ jsx("button", {
|
|
320
|
+
type: "button",
|
|
321
|
+
"aria-label": "Add attachment",
|
|
322
|
+
"data-slot": "composer-attach",
|
|
323
|
+
disabled: !props.onClick,
|
|
324
|
+
className: cn(ghostButton, "size-8 disabled:pointer-events-none disabled:opacity-30", className),
|
|
325
|
+
...props,
|
|
326
|
+
children: /* @__PURE__ */ jsx(PlusIcon, { className: "size-4" })
|
|
327
|
+
});
|
|
328
|
+
}
|
|
329
|
+
/**
|
|
330
|
+
* The model name in the toolbar, which opens the model menu. Carries `aria-expanded`
|
|
331
|
+
* for it.
|
|
332
|
+
*/
|
|
333
|
+
function ComposerModelTrigger({ model, open, className, ...props }) {
|
|
334
|
+
return /* @__PURE__ */ jsxs("button", {
|
|
335
|
+
type: "button",
|
|
336
|
+
"aria-expanded": open,
|
|
337
|
+
"data-slot": "composer-model-trigger",
|
|
338
|
+
className: cn("text-fg-muted hover:bg-surface-2 hover:text-fg flex h-8 items-center gap-1.5 rounded-full px-3 text-(length:--cue-text-body) transition-colors", className),
|
|
339
|
+
...props,
|
|
340
|
+
children: [model, /* @__PURE__ */ jsx(ChevronDownIcon, { className: "size-3 opacity-60" })]
|
|
341
|
+
});
|
|
342
|
+
}
|
|
343
|
+
/** One model in the menu, with its metadata and a tick on the chosen one. */
|
|
344
|
+
function ComposerModelItem({ entry, selected, ...props }) {
|
|
345
|
+
return /* @__PURE__ */ jsxs(ComposerMenuItem, {
|
|
346
|
+
active: selected,
|
|
347
|
+
...props,
|
|
348
|
+
children: [
|
|
349
|
+
/* @__PURE__ */ jsx("span", {
|
|
350
|
+
className: "flex-1 text-start",
|
|
351
|
+
children: entry.name
|
|
352
|
+
}),
|
|
353
|
+
/* @__PURE__ */ jsx("span", {
|
|
354
|
+
className: cn(mono, "text-fg-subtle tabular-nums"),
|
|
355
|
+
children: entry.meta
|
|
356
|
+
}),
|
|
357
|
+
/* @__PURE__ */ jsx("span", {
|
|
358
|
+
className: "flex w-4 justify-end",
|
|
359
|
+
children: selected && /* @__PURE__ */ jsx(CheckIcon, { className: "cue-elements-fade-in cue-elements-zoom-in-90 cue-elements-animate-in size-3.5 duration-200" })
|
|
360
|
+
})
|
|
361
|
+
]
|
|
362
|
+
});
|
|
363
|
+
}
|
|
364
|
+
/**
|
|
365
|
+
* The context-window dial in the toolbar, with the breakdown on hover or focus. It
|
|
366
|
+
* turns danger-coloured past 85%, which is the point where the next long tool result
|
|
367
|
+
* starts costing the conversation its own history.
|
|
368
|
+
*/
|
|
369
|
+
function ComposerContext({ usage, className, ...props }) {
|
|
370
|
+
const used = usage.system + usage.tools + usage.messages;
|
|
371
|
+
const fraction = usage.total === 0 ? 0 : used / usage.total;
|
|
372
|
+
const warn = fraction > .85;
|
|
373
|
+
const circumference = 2 * Math.PI * 6;
|
|
374
|
+
const segments = [
|
|
375
|
+
{
|
|
376
|
+
label: "System",
|
|
377
|
+
value: usage.system,
|
|
378
|
+
className: "bg-surface-3"
|
|
379
|
+
},
|
|
380
|
+
{
|
|
381
|
+
label: "Tools",
|
|
382
|
+
value: usage.tools,
|
|
383
|
+
className: "bg-surface-3"
|
|
384
|
+
},
|
|
385
|
+
{
|
|
386
|
+
label: "Messages",
|
|
387
|
+
value: usage.messages,
|
|
388
|
+
className: "bg-accent"
|
|
389
|
+
}
|
|
390
|
+
];
|
|
391
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
392
|
+
"data-slot": "composer-context",
|
|
393
|
+
className: cn("group/ctx relative", className),
|
|
394
|
+
...props,
|
|
395
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
396
|
+
className: cn(floating, "absolute end-0 bottom-full z-10 mb-2 flex w-60 origin-bottom-right flex-col gap-3.5 rounded-(--radius-overlay) p-4", "transition-[opacity,scale] duration-200 ease-[cubic-bezier(0.23,1,0.32,1)] motion-reduce:transition-none", "pointer-events-none scale-[0.97] opacity-0", "group-hover/ctx:pointer-events-auto group-hover/ctx:scale-100 group-hover/ctx:opacity-100", "group-focus-within/ctx:pointer-events-auto group-focus-within/ctx:scale-100 group-focus-within/ctx:opacity-100"),
|
|
397
|
+
children: [
|
|
398
|
+
/* @__PURE__ */ jsxs("div", {
|
|
399
|
+
className: "flex items-baseline justify-between",
|
|
400
|
+
children: [/* @__PURE__ */ jsx("p", {
|
|
401
|
+
className: "text-(length:--cue-text-body) font-medium",
|
|
402
|
+
children: "Context"
|
|
403
|
+
}), /* @__PURE__ */ jsxs("p", {
|
|
404
|
+
className: cn(mono, "tabular-nums", warn ? "text-danger" : "text-fg-subtle"),
|
|
405
|
+
children: [Math.round(fraction * 100), "%"]
|
|
406
|
+
})]
|
|
407
|
+
}),
|
|
408
|
+
/* @__PURE__ */ jsx("div", {
|
|
409
|
+
className: "bg-surface-2 flex h-[5px] w-full gap-px overflow-hidden rounded-full",
|
|
410
|
+
children: segments.map((segment) => /* @__PURE__ */ jsx("span", {
|
|
411
|
+
className: cn("h-full transition-[width] duration-700 motion-reduce:transition-none", segment.className),
|
|
412
|
+
style: { width: `${pct(segment.value, usage.total)}%` }
|
|
413
|
+
}, segment.label))
|
|
414
|
+
}),
|
|
415
|
+
/* @__PURE__ */ jsx("div", {
|
|
416
|
+
className: "flex flex-col gap-2",
|
|
417
|
+
children: segments.map((segment) => /* @__PURE__ */ jsxs("div", {
|
|
418
|
+
className: "text-fg-muted flex items-center gap-2.5 text-(length:--cue-text-body)",
|
|
419
|
+
children: [
|
|
420
|
+
/* @__PURE__ */ jsx("span", {
|
|
421
|
+
"aria-hidden": true,
|
|
422
|
+
className: cn("size-1.5 rounded-full", segment.className)
|
|
423
|
+
}),
|
|
424
|
+
/* @__PURE__ */ jsx("span", {
|
|
425
|
+
className: "flex-1",
|
|
426
|
+
children: segment.label
|
|
427
|
+
}),
|
|
428
|
+
/* @__PURE__ */ jsxs("span", {
|
|
429
|
+
className: cn(mono, "text-fg-subtle tabular-nums"),
|
|
430
|
+
children: [segment.value, "k"]
|
|
431
|
+
})
|
|
432
|
+
]
|
|
433
|
+
}, segment.label))
|
|
434
|
+
}),
|
|
435
|
+
/* @__PURE__ */ jsx("div", { className: "bg-surface-2 h-px" }),
|
|
436
|
+
/* @__PURE__ */ jsxs("div", {
|
|
437
|
+
className: "text-fg-muted flex items-center justify-between text-(length:--cue-text-body)",
|
|
438
|
+
children: [/* @__PURE__ */ jsx("span", { children: "Total" }), /* @__PURE__ */ jsxs("span", {
|
|
439
|
+
className: cn(mono, "text-fg-subtle tabular-nums"),
|
|
440
|
+
children: [
|
|
441
|
+
used,
|
|
442
|
+
"k / ",
|
|
443
|
+
usage.total,
|
|
444
|
+
"k"
|
|
445
|
+
]
|
|
446
|
+
})]
|
|
447
|
+
})
|
|
448
|
+
]
|
|
449
|
+
}), /* @__PURE__ */ jsx("button", {
|
|
450
|
+
type: "button",
|
|
451
|
+
"aria-label": "Context usage",
|
|
452
|
+
className: cn(ghostButton, "size-8", warn && "text-danger"),
|
|
453
|
+
children: /* @__PURE__ */ jsxs("svg", {
|
|
454
|
+
viewBox: "0 0 16 16",
|
|
455
|
+
className: "size-4 -rotate-90",
|
|
456
|
+
"aria-hidden": true,
|
|
457
|
+
children: [/* @__PURE__ */ jsx("circle", {
|
|
458
|
+
cx: "8",
|
|
459
|
+
cy: "8",
|
|
460
|
+
r: "6",
|
|
461
|
+
fill: "none",
|
|
462
|
+
strokeWidth: "2.5",
|
|
463
|
+
className: "stroke-fg-subtle"
|
|
464
|
+
}), /* @__PURE__ */ jsx("circle", {
|
|
465
|
+
cx: "8",
|
|
466
|
+
cy: "8",
|
|
467
|
+
r: "6",
|
|
468
|
+
fill: "none",
|
|
469
|
+
strokeWidth: "2.5",
|
|
470
|
+
strokeLinecap: "round",
|
|
471
|
+
className: "stroke-current transition-[stroke-dashoffset] duration-700 motion-reduce:transition-none",
|
|
472
|
+
strokeDasharray: circumference,
|
|
473
|
+
strokeDashoffset: circumference * (1 - clamp(fraction, 0, 1))
|
|
474
|
+
})]
|
|
475
|
+
})
|
|
476
|
+
})]
|
|
477
|
+
});
|
|
478
|
+
}
|
|
479
|
+
/** The microphone, which becomes a filled stop while recording. */
|
|
480
|
+
function ComposerVoiceButton({ active, className, ...props }) {
|
|
481
|
+
return /* @__PURE__ */ jsx("button", {
|
|
482
|
+
type: "button",
|
|
483
|
+
"aria-label": active ? "Stop recording" : "Start voice input",
|
|
484
|
+
"data-slot": "composer-voice-button",
|
|
485
|
+
className: cn(active ? cn(inkButton, "flex size-8 items-center justify-center rounded-full") : cn(ghostButton, "size-8"), className),
|
|
486
|
+
...props,
|
|
487
|
+
children: active ? /* @__PURE__ */ jsx(SquareIcon, { className: "size-3 fill-current" }) : /* @__PURE__ */ jsx(MicIcon, { className: "size-4" })
|
|
488
|
+
});
|
|
489
|
+
}
|
|
490
|
+
/**
|
|
491
|
+
* Send, which becomes stop while the model is streaming. Dim when the input is empty
|
|
492
|
+
* and there is nothing to send; the arrow and the square cross-fade rather than swap.
|
|
493
|
+
*/
|
|
494
|
+
function ComposerSend({ streaming, idle, className, ...props }) {
|
|
495
|
+
return /* @__PURE__ */ jsxs("button", {
|
|
496
|
+
type: "button",
|
|
497
|
+
"aria-label": streaming ? "Stop generating" : "Send message",
|
|
498
|
+
"data-slot": "composer-send",
|
|
499
|
+
className: cn("grid size-8 place-items-center rounded-full", streaming || !idle ? inkButton : "bg-surface-2 text-fg-subtle transition-colors", className),
|
|
500
|
+
...props,
|
|
501
|
+
children: [/* @__PURE__ */ jsx(ArrowUpIcon, { className: cn(iconSwap, "size-4", streaming ? iconSwapOut : iconSwapIn) }), /* @__PURE__ */ jsx(SquareIcon, { className: cn(iconSwap, "size-3 fill-current", streaming ? iconSwapIn : iconSwapOut) })]
|
|
502
|
+
});
|
|
503
|
+
}
|
|
504
|
+
//#endregion
|
|
505
|
+
export { ComposerActions, ComposerAttachButton, ComposerAttachmentChip, ComposerAttachments, ComposerBar, ComposerCommandItem, ComposerContext, ComposerInput, ComposerMenu, ComposerMenuItem, ComposerModelItem, ComposerModelTrigger, ComposerPersonItem, ComposerSend, ComposerToolbar, ComposerVoice, ComposerVoiceButton, ElementsComposer, applyMention, useMentionMatches, useSlashMatches };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { ComponentProps } from "react";
|
|
2
|
+
//#region src/elements/computer-use.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* One thing the agent did to the screen, and where it did it. `x` and `y` are
|
|
5
|
+
* percentages of the frame, so the trail survives a resize.
|
|
6
|
+
*/
|
|
7
|
+
interface ComputerStep {
|
|
8
|
+
/** Stable identity for the step key. */
|
|
9
|
+
id: string;
|
|
10
|
+
/** Verb the agent performed: click, type, scroll. */
|
|
11
|
+
action: string;
|
|
12
|
+
/** What it acted on. */
|
|
13
|
+
target: string;
|
|
14
|
+
/** Horizontal position as a percentage of the viewport width. */
|
|
15
|
+
x: number;
|
|
16
|
+
/** Vertical position as a percentage of the viewport height. */
|
|
17
|
+
y: number;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* The screen the agent is driving, with a cursor trail and what it is doing right now.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* import { ComputerUse } from "@cueplusplus/ui/elements";
|
|
24
|
+
*
|
|
25
|
+
* <ComputerUse url="github.com/..." steps={steps} activeIndex={2}>
|
|
26
|
+
* <iframe title="Session" src={streamUrl} />
|
|
27
|
+
* </ComputerUse>
|
|
28
|
+
*/
|
|
29
|
+
declare function ComputerUse({ url, steps, activeIndex, children, className, ...props }: Omit<ComponentProps<"div">, "url" | "steps" | "activeIndex" | "children"> & {
|
|
30
|
+
/** What the session is pointed at. */
|
|
31
|
+
url: string;
|
|
32
|
+
/** Actions taken, in order. Each carries the coordinates the cursor moved to. */
|
|
33
|
+
steps: readonly ComputerStep[];
|
|
34
|
+
/** Which step is happening now. The two before it stay as a fading trail. */
|
|
35
|
+
activeIndex: number;
|
|
36
|
+
/** The viewport being driven: a video stream, a screenshot, an iframe. */
|
|
37
|
+
children: React.ReactNode;
|
|
38
|
+
}): import("react").JSX.Element;
|
|
39
|
+
//#endregion
|
|
40
|
+
export { ComputerStep, ComputerUse };
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../lib/cn.js";
|
|
3
|
+
import { field, mono, paper } from "./surfaces.js";
|
|
4
|
+
import { at, indexIn } from "./range.js";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { MousePointer2Icon } from "lucide-react";
|
|
7
|
+
//#region src/elements/computer-use.tsx
|
|
8
|
+
/**
|
|
9
|
+
* The screen the agent is driving, with a cursor trail and what it is doing right now.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* import { ComputerUse } from "@cueplusplus/ui/elements";
|
|
13
|
+
*
|
|
14
|
+
* <ComputerUse url="github.com/..." steps={steps} activeIndex={2}>
|
|
15
|
+
* <iframe title="Session" src={streamUrl} />
|
|
16
|
+
* </ComputerUse>
|
|
17
|
+
*/
|
|
18
|
+
function ComputerUse({ url, steps, activeIndex, children, className, ...props }) {
|
|
19
|
+
const index = indexIn(steps, activeIndex);
|
|
20
|
+
const active = at(steps, index);
|
|
21
|
+
const trail = steps.slice(Math.max(0, index - 2), index + 1);
|
|
22
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
23
|
+
"data-slot": "computer-use",
|
|
24
|
+
className: cn(paper, "flex w-full max-w-md flex-col overflow-hidden rounded-(--radius-overlay)", className),
|
|
25
|
+
...props,
|
|
26
|
+
children: [
|
|
27
|
+
/* @__PURE__ */ jsxs("div", {
|
|
28
|
+
className: "flex items-center gap-2 px-3 py-2",
|
|
29
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
30
|
+
className: "flex shrink-0 gap-1",
|
|
31
|
+
children: [
|
|
32
|
+
"bg-danger/50",
|
|
33
|
+
"bg-warn/50",
|
|
34
|
+
"bg-ok/50"
|
|
35
|
+
].map((tint) => /* @__PURE__ */ jsx("span", {
|
|
36
|
+
"aria-hidden": true,
|
|
37
|
+
className: cn("size-2 rounded-full", tint)
|
|
38
|
+
}, tint))
|
|
39
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
40
|
+
className: cn(field, mono, "text-fg-muted min-w-0 flex-1 truncate rounded-full px-2.5 py-1"),
|
|
41
|
+
children: url
|
|
42
|
+
})]
|
|
43
|
+
}),
|
|
44
|
+
/* @__PURE__ */ jsxs("div", {
|
|
45
|
+
className: "border-border relative min-h-[8.5rem] overflow-hidden border-t",
|
|
46
|
+
children: [
|
|
47
|
+
children,
|
|
48
|
+
trail.map((step, i) => /* @__PURE__ */ jsx("span", {
|
|
49
|
+
"aria-hidden": true,
|
|
50
|
+
className: "pointer-events-none absolute size-2 rounded-full bg-stream transition-opacity duration-300",
|
|
51
|
+
style: {
|
|
52
|
+
left: `${step.x}%`,
|
|
53
|
+
top: `${step.y}%`,
|
|
54
|
+
opacity: .18 * (i + 1)
|
|
55
|
+
}
|
|
56
|
+
}, step.id)),
|
|
57
|
+
active && /* @__PURE__ */ jsx(MousePointer2Icon, {
|
|
58
|
+
"aria-hidden": true,
|
|
59
|
+
className: "pointer-events-none absolute size-4 fill-stream text-stream transition-[left,top] duration-500 ease-out motion-reduce:transition-none",
|
|
60
|
+
style: {
|
|
61
|
+
left: `${active.x}%`,
|
|
62
|
+
top: `${active.y}%`
|
|
63
|
+
}
|
|
64
|
+
})
|
|
65
|
+
]
|
|
66
|
+
}),
|
|
67
|
+
active && /* @__PURE__ */ jsxs("div", {
|
|
68
|
+
className: "border-border flex items-center gap-2 border-t px-3.5 py-2",
|
|
69
|
+
children: [
|
|
70
|
+
/* @__PURE__ */ jsx("span", {
|
|
71
|
+
className: cn("font-mono text-(length:--cue-text-label) tracking-tight", "text-fg-muted shrink-0"),
|
|
72
|
+
children: active.action
|
|
73
|
+
}),
|
|
74
|
+
/* @__PURE__ */ jsx("span", {
|
|
75
|
+
className: "text-fg-muted min-w-0 flex-1 truncate text-(length:--cue-text-body)",
|
|
76
|
+
children: active.target
|
|
77
|
+
}),
|
|
78
|
+
/* @__PURE__ */ jsxs("span", {
|
|
79
|
+
className: cn("font-mono text-(length:--cue-text-label) tracking-tight", "text-fg-subtle shrink-0 tabular-nums"),
|
|
80
|
+
children: [
|
|
81
|
+
index + 1,
|
|
82
|
+
"/",
|
|
83
|
+
steps.length
|
|
84
|
+
]
|
|
85
|
+
})
|
|
86
|
+
]
|
|
87
|
+
})
|
|
88
|
+
]
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
//#endregion
|
|
92
|
+
export { ComputerUse };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { ComponentProps } from "react";
|
|
2
|
+
//#region src/elements/confidence-marker.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* How far a claim can be trusted: `grounded` in a source, `inferred` from one, or
|
|
5
|
+
* `uncertain` — the model's own guess. It decides the underline and the basis chip.
|
|
6
|
+
*/
|
|
7
|
+
type Confidence = "grounded" | "inferred" | "uncertain";
|
|
8
|
+
/** One clause of an answer, with how far it can be trusted and what it rests on. */
|
|
9
|
+
interface ConfidenceClaim {
|
|
10
|
+
/** Stable identity, compared against hoveredId. */
|
|
11
|
+
id: string;
|
|
12
|
+
/** The claim, rendered inline with its confidence underline. */
|
|
13
|
+
text: string;
|
|
14
|
+
/** Drives the underline: solid green, solid amber, dotted red. */
|
|
15
|
+
confidence: Confidence;
|
|
16
|
+
/** What backs the claim, shown in the hover pill. */
|
|
17
|
+
basis: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Which claims came from a source, which were inferred, and which are guesses.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* import { ConfidenceMarker } from "@cueplusplus/ui/elements";
|
|
24
|
+
*
|
|
25
|
+
* <ConfidenceMarker claims={claims} hoveredId={hoveredId} onHover={setHoveredId} />
|
|
26
|
+
*/
|
|
27
|
+
declare function ConfidenceMarker({ claims, hoveredId, onHover, className, ...props }: Omit<ComponentProps<"div">, "children" | "claims" | "hoveredId" | "onHover"> & {
|
|
28
|
+
/**
|
|
29
|
+
* The answer split into claims. Each is underlined according to how well it is
|
|
30
|
+
* supported.
|
|
31
|
+
*/
|
|
32
|
+
claims: readonly ConfidenceClaim[];
|
|
33
|
+
/** Which claim is hovered. Pass an empty string for none. */
|
|
34
|
+
hoveredId: string;
|
|
35
|
+
/** Called with the hovered claim id, or an empty string on exit. */
|
|
36
|
+
onHover?: (id: string) => void;
|
|
37
|
+
}): import("react").JSX.Element;
|
|
38
|
+
//#endregion
|
|
39
|
+
export { Confidence, ConfidenceClaim, ConfidenceMarker };
|