@cueplusplus/ui 0.3.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 +2229 -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/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/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/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 +6 -4
- package/dist/index.js +2 -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 +35 -9
- package/dist/primitives/chip.js +97 -11
- package/dist/system/agent-skin.d.ts +27 -0
- package/dist/system/agent-skin.js +20 -0
- package/dist/system/portal.d.ts +5 -3
- package/dist/system/portal.js +19 -5
- package/dist/system/theme-provider.js +54 -9
- 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 +71 -8
- package/dist/theming/contrast.d.ts +16 -4
- package/dist/theming/contrast.js +33 -6
- package/dist/theming/create-theme.d.ts +6 -2
- package/dist/theming/create-theme.js +32 -5
- package/dist/theming/serialize.d.ts +10 -1
- package/dist/theming/serialize.js +62 -8
- 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-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 +1 -1
- package/manifest/components/animated-number.json +67 -0
- package/manifest/components/app-shell.json +99 -7
- package/manifest/components/approval-card.json +106 -0
- package/manifest/components/artifact-card.json +81 -0
- package/manifest/components/audience-icon.json +52 -0
- package/manifest/components/background-inbox.json +71 -0
- package/manifest/components/branch-picker.json +124 -0
- package/manifest/components/button.json +1 -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/catalogue-icon.json +52 -0
- package/manifest/components/channel-beta-icon.json +52 -0
- package/manifest/components/channel-released-icon.json +52 -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/checkpoint-history.json +80 -0
- package/manifest/components/chip.json +24 -12
- 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/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/computer-use.json +84 -0
- package/manifest/components/confidence-marker.json +74 -0
- package/manifest/components/connection-state.json +84 -0
- package/manifest/components/context-breakdown.json +65 -0
- package/manifest/components/context-usage.json +85 -0
- package/manifest/components/conversation-search.json +92 -0
- package/manifest/components/cost-meter.json +74 -0
- package/manifest/components/cue-portal-frame.json +1 -1
- package/manifest/components/day-separator.json +58 -0
- package/manifest/components/delegation-card.json +1 -1
- package/manifest/components/density.json +1 -1
- package/manifest/components/diagram.json +100 -0
- package/manifest/components/document-reference.json +90 -0
- package/manifest/components/draft-restore.json +82 -0
- package/manifest/components/drawer.json +1 -1
- package/manifest/components/dropdown-menu.json +1 -1
- 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/end-of-turn-summary.json +77 -0
- package/manifest/components/error-state.json +80 -0
- package/manifest/components/feedback-dialog.json +107 -0
- package/manifest/components/file-tree.json +83 -0
- package/manifest/components/flow-graph.json +75 -0
- package/manifest/components/folder-icon.json +52 -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/guardrail-notice.json +91 -0
- package/manifest/components/hover-card.json +1 -1
- package/manifest/components/image-generation.json +67 -0
- package/manifest/components/info-tip.json +1 -1
- package/manifest/components/inline-citation.json +77 -0
- package/manifest/components/job-progress.json +96 -0
- package/manifest/components/launcher-bubble.json +105 -0
- package/manifest/components/live-region-announcer.json +79 -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/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 +1 -1
- 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/mobile-composer.json +126 -0
- package/manifest/components/model-picker.json +76 -0
- package/manifest/components/node-card.json +1 -1
- package/manifest/components/node-handle.json +1 -1
- package/manifest/components/number-ticker.json +61 -0
- package/manifest/components/onboarding.json +84 -0
- package/manifest/components/otp-field.json +7 -7
- package/manifest/components/permission-grant.json +92 -0
- package/manifest/components/permission-scopes.json +139 -0
- package/manifest/components/popover.json +1 -1
- 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/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/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/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 +7 -7
- package/manifest/components/search-input.json +7 -7
- package/manifest/components/segmented-control.json +21 -21
- package/manifest/components/settings-panel.json +118 -0
- package/manifest/components/shared-conversation.json +89 -0
- package/manifest/components/shimmer-label.json +59 -0
- package/manifest/components/skill-icon.json +52 -0
- package/manifest/components/sources.json +83 -0
- package/manifest/components/speaker-identity.json +61 -0
- package/manifest/components/spec-sheet.json +80 -0
- package/manifest/components/stack-icon.json +52 -0
- package/manifest/components/stacks-matrix-icon.json +52 -0
- package/manifest/components/stat.json +1 -1
- package/manifest/components/status-dot.json +1 -1
- 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/tail-status.json +109 -0
- package/manifest/components/terminal-block.json +91 -0
- package/manifest/components/theme-provider.json +2 -2
- 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 +2 -2
- package/manifest/components/time-boundary.json +62 -0
- package/manifest/components/timeline.json +1 -1
- package/manifest/components/todo-list.json +69 -0
- package/manifest/components/toggle-group.json +7 -7
- package/manifest/components/token-editor.json +1 -1
- 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 +7 -7
- package/manifest/components/tooltip.json +1 -1
- package/manifest/components/trace-waterfall.json +74 -0
- package/manifest/components/turn-footer.json +105 -0
- package/manifest/components/typing-indicator.json +53 -0
- package/manifest/components/unread-divider.json +55 -0
- package/manifest/components/usage-chart.json +1 -1
- 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 +2670 -33
- package/manifest/tokens.json +22 -1
- package/package.json +46 -4
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../lib/cn.js";
|
|
3
|
+
import "./surfaces.js";
|
|
4
|
+
import { useId } from "react";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
//#region src/elements/confidence-marker.tsx
|
|
7
|
+
const UNDERLINE = {
|
|
8
|
+
grounded: "decoration-ok/50",
|
|
9
|
+
inferred: "decoration-warn/60",
|
|
10
|
+
uncertain: "decoration-danger/50 decoration-dotted"
|
|
11
|
+
};
|
|
12
|
+
const LABEL = {
|
|
13
|
+
grounded: "from a source",
|
|
14
|
+
inferred: "inferred",
|
|
15
|
+
uncertain: "unverified"
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Which claims came from a source, which were inferred, and which are guesses.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* import { ConfidenceMarker } from "@cueplusplus/ui/elements";
|
|
22
|
+
*
|
|
23
|
+
* <ConfidenceMarker claims={claims} hoveredId={hoveredId} onHover={setHoveredId} />
|
|
24
|
+
*/
|
|
25
|
+
function ConfidenceMarker({ claims, hoveredId, onHover, className, ...props }) {
|
|
26
|
+
const basisId = useId();
|
|
27
|
+
const hovered = claims.find((claim) => claim.id === hoveredId);
|
|
28
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
29
|
+
"data-slot": "confidence-marker",
|
|
30
|
+
className: cn("flex w-full max-w-sm flex-col gap-2.5", className),
|
|
31
|
+
...props,
|
|
32
|
+
children: [/* @__PURE__ */ jsx("p", {
|
|
33
|
+
className: "text-(length:--cue-text-body) leading-relaxed",
|
|
34
|
+
children: claims.map((claim) => /* @__PURE__ */ jsxs("button", {
|
|
35
|
+
type: "button",
|
|
36
|
+
"aria-describedby": hoveredId === claim.id ? basisId : void 0,
|
|
37
|
+
onMouseEnter: () => onHover?.(claim.id),
|
|
38
|
+
onMouseLeave: () => onHover?.(""),
|
|
39
|
+
onFocus: () => onHover?.(claim.id),
|
|
40
|
+
onBlur: () => onHover?.(""),
|
|
41
|
+
className: cn("focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-offset-1 focus-visible:outline-accent inline cursor-help rounded-(--radius-control) text-start underline decoration-2 underline-offset-[3px] transition-colors outline-none", UNDERLINE[claim.confidence], hoveredId === claim.id ? "text-fg" : "text-fg-muted"),
|
|
42
|
+
children: [claim.text, " "]
|
|
43
|
+
}, claim.id))
|
|
44
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
45
|
+
className: "flex h-9 items-start",
|
|
46
|
+
children: hovered && /* @__PURE__ */ jsxs("span", {
|
|
47
|
+
id: basisId,
|
|
48
|
+
role: "status",
|
|
49
|
+
className: cn("bg-surface-2 border border-border-overlay", "font-mono text-(length:--cue-text-label) tracking-tight", "cue-elements-fade-in cue-elements-zoom-in-95 cue-elements-animate-in text-fg-muted flex items-center gap-1.5 rounded-full px-2.5 py-1.5 duration-150"),
|
|
50
|
+
children: [
|
|
51
|
+
/* @__PURE__ */ jsx("span", {
|
|
52
|
+
"aria-hidden": true,
|
|
53
|
+
className: cn("size-1.5 rounded-full", hovered.confidence === "grounded" && "bg-ok", hovered.confidence === "inferred" && "bg-warn", hovered.confidence === "uncertain" && "bg-danger")
|
|
54
|
+
}),
|
|
55
|
+
LABEL[hovered.confidence],
|
|
56
|
+
" · ",
|
|
57
|
+
hovered.basis
|
|
58
|
+
]
|
|
59
|
+
})
|
|
60
|
+
})]
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
//#endregion
|
|
64
|
+
export { ConfidenceMarker };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ComponentProps } from "react";
|
|
2
|
+
//#region src/elements/connection-state.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* Where the stream is: `online`, `dropped`, `reconnecting`, or `resumed` — the beat
|
|
5
|
+
* after a reconnect where the tokens that arrived while the socket was down are handed
|
|
6
|
+
* over. The run itself never stopped; only the transport did.
|
|
7
|
+
*/
|
|
8
|
+
type ConnectionPhase = "online" | "dropped" | "reconnecting" | "resumed";
|
|
9
|
+
/**
|
|
10
|
+
* The socket drops, the run keeps going on the server, and the stream is picked back
|
|
11
|
+
* up.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* import { ConnectionState } from "@cueplusplus/ui/elements";
|
|
15
|
+
*
|
|
16
|
+
* <ConnectionState phase="reconnecting" attempt={2} onRetry={reconnect} />
|
|
17
|
+
*/
|
|
18
|
+
declare function ConnectionState({ phase, attempt, resumedTokens, onRetry, className, ...props }: Omit<ComponentProps<"div">, "children" | "phase" | "attempt" | "resumedTokens" | "onRetry"> & {
|
|
19
|
+
/** Which banner to show. online renders nothing, so the element can stay mounted. */
|
|
20
|
+
phase: ConnectionPhase;
|
|
21
|
+
/** Retry number, shown while reconnecting. */
|
|
22
|
+
attempt?: number;
|
|
23
|
+
/** How much of the stream was recovered, shown once resumed. */
|
|
24
|
+
resumedTokens?: number;
|
|
25
|
+
/** Called from the Reconnect button while dropped. */
|
|
26
|
+
onRetry?: () => void;
|
|
27
|
+
}): import("react").JSX.Element | null;
|
|
28
|
+
//#endregion
|
|
29
|
+
export { ConnectionPhase, ConnectionState };
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../lib/cn.js";
|
|
3
|
+
import { paper } from "./surfaces.js";
|
|
4
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { CheckIcon, CloudOffIcon, Loader2Icon } from "lucide-react";
|
|
6
|
+
//#region src/elements/connection-state.tsx
|
|
7
|
+
/**
|
|
8
|
+
* The socket drops, the run keeps going on the server, and the stream is picked back
|
|
9
|
+
* up.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* import { ConnectionState } from "@cueplusplus/ui/elements";
|
|
13
|
+
*
|
|
14
|
+
* <ConnectionState phase="reconnecting" attempt={2} onRetry={reconnect} />
|
|
15
|
+
*/
|
|
16
|
+
function ConnectionState({ phase, attempt, resumedTokens, onRetry, className, ...props }) {
|
|
17
|
+
if (phase === "online") return null;
|
|
18
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
19
|
+
"data-slot": "connection-state",
|
|
20
|
+
className: cn(paper, "cue-elements-fade-in cue-elements-slide-in-from-top-1 cue-elements-animate-in flex w-full max-w-sm items-center gap-2.5 rounded-(--radius-overlay) px-3.5 py-2.5 duration-300", className),
|
|
21
|
+
...props,
|
|
22
|
+
children: [
|
|
23
|
+
phase === "dropped" && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
24
|
+
/* @__PURE__ */ jsx(CloudOffIcon, { className: "size-3.5 shrink-0 text-warn" }),
|
|
25
|
+
/* @__PURE__ */ jsx("span", {
|
|
26
|
+
className: "min-w-0 flex-1 text-(length:--cue-text-body)",
|
|
27
|
+
children: "Connection lost. The run kept going on the server."
|
|
28
|
+
}),
|
|
29
|
+
/* @__PURE__ */ jsx("button", {
|
|
30
|
+
type: "button",
|
|
31
|
+
onClick: onRetry,
|
|
32
|
+
className: "text-fg-muted hover:bg-surface-2 hover:text-fg shrink-0 rounded-full px-2.5 py-1 text-(length:--cue-text-ui) font-medium transition-[background-color,color,scale] duration-150 active:scale-[0.96]",
|
|
33
|
+
children: "Reconnect"
|
|
34
|
+
})
|
|
35
|
+
] }),
|
|
36
|
+
phase === "reconnecting" && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
37
|
+
/* @__PURE__ */ jsx(Loader2Icon, { className: "text-fg-subtle size-3.5 shrink-0 animate-spin motion-reduce:animate-none" }),
|
|
38
|
+
/* @__PURE__ */ jsx("span", {
|
|
39
|
+
className: "min-w-0 flex-1 text-(length:--cue-text-body)",
|
|
40
|
+
children: "Reconnecting"
|
|
41
|
+
}),
|
|
42
|
+
attempt !== void 0 && /* @__PURE__ */ jsxs("span", {
|
|
43
|
+
className: cn("font-mono text-(length:--cue-text-label) tracking-tight", "text-fg-subtle shrink-0 tabular-nums"),
|
|
44
|
+
children: ["attempt ", attempt]
|
|
45
|
+
})
|
|
46
|
+
] }),
|
|
47
|
+
phase === "resumed" && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
48
|
+
/* @__PURE__ */ jsx(CheckIcon, { className: "size-3.5 shrink-0 text-ok" }),
|
|
49
|
+
/* @__PURE__ */ jsx("span", {
|
|
50
|
+
className: "min-w-0 flex-1 text-(length:--cue-text-body)",
|
|
51
|
+
children: "Picked the stream back up."
|
|
52
|
+
}),
|
|
53
|
+
resumedTokens !== void 0 && /* @__PURE__ */ jsxs("span", {
|
|
54
|
+
className: cn("font-mono text-(length:--cue-text-label) tracking-tight", "text-fg-subtle shrink-0 tabular-nums"),
|
|
55
|
+
children: [
|
|
56
|
+
"+",
|
|
57
|
+
resumedTokens,
|
|
58
|
+
" tokens"
|
|
59
|
+
]
|
|
60
|
+
})
|
|
61
|
+
] })
|
|
62
|
+
]
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
//#endregion
|
|
66
|
+
export { ConnectionState };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ComponentProps } from "react";
|
|
2
|
+
//#region src/elements/context-breakdown.d.ts
|
|
3
|
+
/** One occupant of the context window, in the bar and in the legend under it. */
|
|
4
|
+
interface ContextSegment {
|
|
5
|
+
/** What this slice of the window is, shown in the legend. */
|
|
6
|
+
label: string;
|
|
7
|
+
/** Raw token count. The element formats it. */
|
|
8
|
+
tokens: number;
|
|
9
|
+
/** Background class shared by the bar slice and the legend dot, so the two always agree. */
|
|
10
|
+
tint: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Where the window actually went: prompt, tools, files, conversation, and what's left.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* import { ContextBreakdown } from "@cueplusplus/ui/elements";
|
|
17
|
+
*
|
|
18
|
+
* <ContextBreakdown segments={segments} limit={128000} />
|
|
19
|
+
*/
|
|
20
|
+
declare function ContextBreakdown({ segments, limit, className, ...props }: Omit<ComponentProps<"div">, "children" | "segments" | "limit"> & {
|
|
21
|
+
/** What is occupying the window, in stacking order. Headroom is derived, not passed. */
|
|
22
|
+
segments: readonly ContextSegment[];
|
|
23
|
+
/**
|
|
24
|
+
* Window size. The header turns amber once the segments pass 85 percent of it. A
|
|
25
|
+
* zero limit is treated as zero pressure rather than dividing by it.
|
|
26
|
+
*/
|
|
27
|
+
limit: number;
|
|
28
|
+
}): import("react").JSX.Element;
|
|
29
|
+
//#endregion
|
|
30
|
+
export { ContextBreakdown, ContextSegment };
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../lib/cn.js";
|
|
3
|
+
import { mono, paper } from "./surfaces.js";
|
|
4
|
+
import { pct } from "./range.js";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
//#region src/elements/context-breakdown.tsx
|
|
7
|
+
const fmt = (n) => n.toLocaleString("en-US");
|
|
8
|
+
/**
|
|
9
|
+
* Where the window actually went: prompt, tools, files, conversation, and what's left.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* import { ContextBreakdown } from "@cueplusplus/ui/elements";
|
|
13
|
+
*
|
|
14
|
+
* <ContextBreakdown segments={segments} limit={128000} />
|
|
15
|
+
*/
|
|
16
|
+
function ContextBreakdown({ segments, limit, className, ...props }) {
|
|
17
|
+
const used = segments.reduce((sum, segment) => sum + segment.tokens, 0);
|
|
18
|
+
const pressure = limit === 0 ? 0 : used / limit;
|
|
19
|
+
const share = (tokens) => pct(tokens, limit);
|
|
20
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
21
|
+
"data-slot": "context-breakdown",
|
|
22
|
+
className: cn(paper, "flex w-full max-w-sm flex-col gap-3 rounded-(--radius-overlay) p-4", className),
|
|
23
|
+
...props,
|
|
24
|
+
children: [
|
|
25
|
+
/* @__PURE__ */ jsxs("div", {
|
|
26
|
+
className: "flex items-baseline justify-between",
|
|
27
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
28
|
+
className: "text-(length:--cue-text-body) font-medium",
|
|
29
|
+
children: "Context"
|
|
30
|
+
}), /* @__PURE__ */ jsxs("span", {
|
|
31
|
+
className: cn(mono, "tabular-nums", pressure > .85 ? "text-warn" : "text-fg-subtle"),
|
|
32
|
+
children: [
|
|
33
|
+
fmt(used),
|
|
34
|
+
" / ",
|
|
35
|
+
fmt(limit)
|
|
36
|
+
]
|
|
37
|
+
})]
|
|
38
|
+
}),
|
|
39
|
+
/* @__PURE__ */ jsx("div", {
|
|
40
|
+
className: "bg-surface-2 flex h-2 w-full overflow-hidden rounded-full",
|
|
41
|
+
children: segments.map((segment) => /* @__PURE__ */ jsx("span", {
|
|
42
|
+
className: cn("h-full transition-[width] duration-500 ease-out motion-reduce:transition-none", segment.tint),
|
|
43
|
+
style: { width: `${share(segment.tokens)}%` }
|
|
44
|
+
}, segment.label))
|
|
45
|
+
}),
|
|
46
|
+
/* @__PURE__ */ jsxs("div", {
|
|
47
|
+
className: "flex flex-col gap-1.5",
|
|
48
|
+
children: [segments.map((segment) => /* @__PURE__ */ jsxs("div", {
|
|
49
|
+
className: "flex items-center gap-2",
|
|
50
|
+
children: [
|
|
51
|
+
/* @__PURE__ */ jsx("span", {
|
|
52
|
+
"aria-hidden": true,
|
|
53
|
+
className: cn("size-2 shrink-0 rounded-full", segment.tint)
|
|
54
|
+
}),
|
|
55
|
+
/* @__PURE__ */ jsx("span", {
|
|
56
|
+
className: "text-fg-muted min-w-0 flex-1 truncate text-(length:--cue-text-body)",
|
|
57
|
+
children: segment.label
|
|
58
|
+
}),
|
|
59
|
+
/* @__PURE__ */ jsx("span", {
|
|
60
|
+
className: cn(mono, "text-fg-subtle shrink-0 tabular-nums"),
|
|
61
|
+
children: fmt(segment.tokens)
|
|
62
|
+
})
|
|
63
|
+
]
|
|
64
|
+
}, segment.label)), /* @__PURE__ */ jsxs("div", {
|
|
65
|
+
className: "flex items-center gap-2",
|
|
66
|
+
children: [
|
|
67
|
+
/* @__PURE__ */ jsx("span", {
|
|
68
|
+
"aria-hidden": true,
|
|
69
|
+
className: "bg-surface-2 size-2 shrink-0 rounded-full"
|
|
70
|
+
}),
|
|
71
|
+
/* @__PURE__ */ jsx("span", {
|
|
72
|
+
className: "text-fg-subtle min-w-0 flex-1 truncate text-(length:--cue-text-body)",
|
|
73
|
+
children: "Headroom"
|
|
74
|
+
}),
|
|
75
|
+
/* @__PURE__ */ jsx("span", {
|
|
76
|
+
className: cn(mono, "text-fg-subtle shrink-0 tabular-nums"),
|
|
77
|
+
children: fmt(Math.max(0, limit - used))
|
|
78
|
+
})
|
|
79
|
+
]
|
|
80
|
+
})]
|
|
81
|
+
})
|
|
82
|
+
]
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
//#endregion
|
|
86
|
+
export { ContextBreakdown };
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { ContextLabels } from "./vocabulary.js";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
//#region src/elements/context-usage.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Which hue a slice of the window takes.
|
|
6
|
+
*
|
|
7
|
+
* Cursor's `data-color`, narrowed to the tokens this family paints from. It is
|
|
8
|
+
* a closed set rather than a class name because the attribute is also stamped
|
|
9
|
+
* on the DOM: `[data-color="warn"]` is reachable from a stylesheet, so a
|
|
10
|
+
* console that wants its own palette for the bar restyles it from outside
|
|
11
|
+
* instead of passing paint in.
|
|
12
|
+
*/
|
|
13
|
+
type ContextTone = "stream" | "ok" | "warn" | "danger" | "accent" | "neutral";
|
|
14
|
+
/** One occupant of the context window: a slice of the bar and a row under it. */
|
|
15
|
+
interface ContextCategory {
|
|
16
|
+
/** What this part of the window is. `CONTEXT_CATEGORY_LABELS` is the shipped set. */
|
|
17
|
+
label: string;
|
|
18
|
+
/** Raw token count. The element formats it and works out its share. */
|
|
19
|
+
tokens: number;
|
|
20
|
+
/**
|
|
21
|
+
* Which hue it takes. Omit and it takes the next one in the family's
|
|
22
|
+
* rotation, by its position in the list.
|
|
23
|
+
*/
|
|
24
|
+
tone?: ContextTone;
|
|
25
|
+
}
|
|
26
|
+
/** One number under the bar: a token count, a limit, a cost. */
|
|
27
|
+
interface ContextStat {
|
|
28
|
+
/** What it is. `CONTEXT_STAT_LABELS` is the shipped set. */
|
|
29
|
+
label: string;
|
|
30
|
+
/**
|
|
31
|
+
* The value, already formatted. The element does no currency maths and no
|
|
32
|
+
* rounding, so a meter and a billing page cannot disagree about `$3.12`.
|
|
33
|
+
*/
|
|
34
|
+
value: string;
|
|
35
|
+
}
|
|
36
|
+
interface ContextUsageProps extends Omit<React.ComponentPropsWithoutRef<"div">, "children"> {
|
|
37
|
+
/**
|
|
38
|
+
* What is occupying the window, in the order it stacks in the bar. Headroom
|
|
39
|
+
* is derived from the limit, never passed.
|
|
40
|
+
*/
|
|
41
|
+
categories: readonly ContextCategory[];
|
|
42
|
+
/**
|
|
43
|
+
* The window's size, in tokens. A limit of zero is treated as no pressure
|
|
44
|
+
* rather than divided by.
|
|
45
|
+
*/
|
|
46
|
+
limit: number;
|
|
47
|
+
/**
|
|
48
|
+
* The numbers under the bar: input, output, reasoning and cache tokens, the
|
|
49
|
+
* limit, the cost. Pre-formatted, and drawn in the order given.
|
|
50
|
+
* `CONTEXT_STAT_LABELS` carries opencode's names for them.
|
|
51
|
+
*/
|
|
52
|
+
stats?: readonly ContextStat[];
|
|
53
|
+
/**
|
|
54
|
+
* The meter's own six strings, merged over `CONTEXT_LABELS`: its title, the
|
|
55
|
+
* three column headings, the headroom row and the phrase after the
|
|
56
|
+
* percentage.
|
|
57
|
+
*/
|
|
58
|
+
labels?: Partial<ContextLabels>;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Where the window went, what share each part of it took, and what that cost.
|
|
62
|
+
*
|
|
63
|
+
* A context limit tells a reader nothing they can act on. This says which four
|
|
64
|
+
* things are holding the window open, so the answer to "why did it forget the
|
|
65
|
+
* thing I said an hour ago" can be *the venue's documents are 38k of it* rather
|
|
66
|
+
* than a number going up. The bar is the shape, the table is the argument, and
|
|
67
|
+
* the stat rows underneath are what turn it from a gauge into a bill.
|
|
68
|
+
*
|
|
69
|
+
* The breakdown is a real table with real column headers, which is Claude
|
|
70
|
+
* Code's own shape and the right one: three columns of numbers whose meaning is
|
|
71
|
+
* carried by the heading above them is exactly what a `<table>` is for, and a
|
|
72
|
+
* grid of `<div>`s says none of it to a screen reader.
|
|
73
|
+
*
|
|
74
|
+
* Pressure is stated on the element as `data-pressure` — `ok`, `high` past 85
|
|
75
|
+
* per cent, `over` past the limit — and the header figure takes the warning hue
|
|
76
|
+
* with it. Past the limit the bar simply fills: there is no headroom left to
|
|
77
|
+
* draw, and a segment hanging off the end would be a picture of a number rather
|
|
78
|
+
* than of a window.
|
|
79
|
+
*
|
|
80
|
+
* @example
|
|
81
|
+
* import { ContextUsage, CONTEXT_CATEGORY_LABELS } from "@cueplusplus/ui/elements";
|
|
82
|
+
*
|
|
83
|
+
* <ContextUsage
|
|
84
|
+
* limit={200_000}
|
|
85
|
+
* categories={[
|
|
86
|
+
* { label: CONTEXT_CATEGORY_LABELS.system, tokens: 11_800 },
|
|
87
|
+
* { label: CONTEXT_CATEGORY_LABELS.tools, tokens: 38_400 },
|
|
88
|
+
* { label: CONTEXT_CATEGORY_LABELS.assistant, tokens: 21_100 },
|
|
89
|
+
* ]}
|
|
90
|
+
* stats={[{ label: "Total cost", value: "$3.12" }]}
|
|
91
|
+
* />
|
|
92
|
+
* @example
|
|
93
|
+
* // Over the limit: the bar is full, the headroom row is zero, and the header
|
|
94
|
+
* // figure says so in the danger hue.
|
|
95
|
+
* <ContextUsage limit={128_000} categories={categories} />
|
|
96
|
+
*/
|
|
97
|
+
declare const ContextUsage: React.ForwardRefExoticComponent<ContextUsageProps & React.RefAttributes<HTMLDivElement>>;
|
|
98
|
+
//#endregion
|
|
99
|
+
export { ContextCategory, ContextStat, ContextTone, ContextUsage, ContextUsageProps };
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../lib/cn.js";
|
|
3
|
+
import { mono, paper } from "./surfaces.js";
|
|
4
|
+
import { CONTEXT_LABELS } from "./vocabulary.js";
|
|
5
|
+
import { pct } from "./range.js";
|
|
6
|
+
import * as React from "react";
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
//#region src/elements/context-usage.tsx
|
|
9
|
+
/** What a `tone` paints, in the bar and in the swatch beside its row. */
|
|
10
|
+
const TONE_FILL = {
|
|
11
|
+
stream: "bg-stream/70",
|
|
12
|
+
ok: "bg-ok/60",
|
|
13
|
+
warn: "bg-warn/60",
|
|
14
|
+
danger: "bg-danger/60",
|
|
15
|
+
accent: "bg-accent/60",
|
|
16
|
+
neutral: "bg-fg/25"
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* The rotation a category takes when it does not name a tone.
|
|
20
|
+
*
|
|
21
|
+
* Five categories is opencode's whole breakdown, and a caller who has to pick
|
|
22
|
+
* five colours to see a bar at all will pick five that fight. The order is the
|
|
23
|
+
* family's usual reading: what is live, what is settled, what is heavy.
|
|
24
|
+
*/
|
|
25
|
+
const TONE_ROTATION = [
|
|
26
|
+
"stream",
|
|
27
|
+
"ok",
|
|
28
|
+
"warn",
|
|
29
|
+
"accent",
|
|
30
|
+
"neutral"
|
|
31
|
+
];
|
|
32
|
+
/** Counts, the way a window's own numbers are written: `24,300`. */
|
|
33
|
+
const fmt = (value) => Math.max(0, Math.round(value)).toLocaleString("en-US");
|
|
34
|
+
/** A share as a meter says it: whole percents, and `<1%` for the ones that round to nothing. */
|
|
35
|
+
function share(tokens, limit) {
|
|
36
|
+
const value = pct(tokens, limit);
|
|
37
|
+
if (value > 0 && value < 1) return "<1%";
|
|
38
|
+
return `${Math.round(value)}%`;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Where the window went, what share each part of it took, and what that cost.
|
|
42
|
+
*
|
|
43
|
+
* A context limit tells a reader nothing they can act on. This says which four
|
|
44
|
+
* things are holding the window open, so the answer to "why did it forget the
|
|
45
|
+
* thing I said an hour ago" can be *the venue's documents are 38k of it* rather
|
|
46
|
+
* than a number going up. The bar is the shape, the table is the argument, and
|
|
47
|
+
* the stat rows underneath are what turn it from a gauge into a bill.
|
|
48
|
+
*
|
|
49
|
+
* The breakdown is a real table with real column headers, which is Claude
|
|
50
|
+
* Code's own shape and the right one: three columns of numbers whose meaning is
|
|
51
|
+
* carried by the heading above them is exactly what a `<table>` is for, and a
|
|
52
|
+
* grid of `<div>`s says none of it to a screen reader.
|
|
53
|
+
*
|
|
54
|
+
* Pressure is stated on the element as `data-pressure` — `ok`, `high` past 85
|
|
55
|
+
* per cent, `over` past the limit — and the header figure takes the warning hue
|
|
56
|
+
* with it. Past the limit the bar simply fills: there is no headroom left to
|
|
57
|
+
* draw, and a segment hanging off the end would be a picture of a number rather
|
|
58
|
+
* than of a window.
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* import { ContextUsage, CONTEXT_CATEGORY_LABELS } from "@cueplusplus/ui/elements";
|
|
62
|
+
*
|
|
63
|
+
* <ContextUsage
|
|
64
|
+
* limit={200_000}
|
|
65
|
+
* categories={[
|
|
66
|
+
* { label: CONTEXT_CATEGORY_LABELS.system, tokens: 11_800 },
|
|
67
|
+
* { label: CONTEXT_CATEGORY_LABELS.tools, tokens: 38_400 },
|
|
68
|
+
* { label: CONTEXT_CATEGORY_LABELS.assistant, tokens: 21_100 },
|
|
69
|
+
* ]}
|
|
70
|
+
* stats={[{ label: "Total cost", value: "$3.12" }]}
|
|
71
|
+
* />
|
|
72
|
+
* @example
|
|
73
|
+
* // Over the limit: the bar is full, the headroom row is zero, and the header
|
|
74
|
+
* // figure says so in the danger hue.
|
|
75
|
+
* <ContextUsage limit={128_000} categories={categories} />
|
|
76
|
+
*/
|
|
77
|
+
const ContextUsage = React.forwardRef(function ContextUsage({ categories, limit, stats, labels, className, ...elementProps }, ref) {
|
|
78
|
+
const copy = {
|
|
79
|
+
...CONTEXT_LABELS,
|
|
80
|
+
...labels
|
|
81
|
+
};
|
|
82
|
+
const used = categories.reduce((sum, category) => sum + Math.max(0, category.tokens), 0);
|
|
83
|
+
const ratio = limit > 0 ? used / limit : 0;
|
|
84
|
+
const pressure = ratio > 1 ? "over" : ratio >= .85 ? "high" : "ok";
|
|
85
|
+
const headroom = Math.max(0, limit - used);
|
|
86
|
+
const rows = categories.map((category, index) => ({
|
|
87
|
+
category,
|
|
88
|
+
tone: category.tone ?? TONE_ROTATION[index % TONE_ROTATION.length]
|
|
89
|
+
}));
|
|
90
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
91
|
+
ref,
|
|
92
|
+
"data-slot": "context-usage",
|
|
93
|
+
"data-pressure": pressure,
|
|
94
|
+
className: cn(paper, "flex w-full max-w-sm flex-col gap-3 rounded-(--radius-overlay) p-4", className),
|
|
95
|
+
...elementProps,
|
|
96
|
+
children: [
|
|
97
|
+
/* @__PURE__ */ jsxs("div", {
|
|
98
|
+
className: "flex items-baseline justify-between gap-2",
|
|
99
|
+
children: [/* @__PURE__ */ jsxs("span", {
|
|
100
|
+
className: "flex min-w-0 flex-col",
|
|
101
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
102
|
+
className: "text-(length:--cue-text-body) font-medium",
|
|
103
|
+
children: copy.title
|
|
104
|
+
}), /* @__PURE__ */ jsxs("span", {
|
|
105
|
+
className: cn(mono, "text-fg-subtle truncate tabular-nums"),
|
|
106
|
+
children: [
|
|
107
|
+
share(used, limit),
|
|
108
|
+
" ",
|
|
109
|
+
copy.used
|
|
110
|
+
]
|
|
111
|
+
})]
|
|
112
|
+
}), /* @__PURE__ */ jsxs("span", {
|
|
113
|
+
className: cn(mono, "shrink-0 tabular-nums", pressure === "over" ? "text-danger" : pressure === "high" ? "text-warn" : "text-fg-subtle"),
|
|
114
|
+
children: [
|
|
115
|
+
fmt(used),
|
|
116
|
+
" / ",
|
|
117
|
+
fmt(limit)
|
|
118
|
+
]
|
|
119
|
+
})]
|
|
120
|
+
}),
|
|
121
|
+
/* @__PURE__ */ jsx("div", {
|
|
122
|
+
"aria-hidden": true,
|
|
123
|
+
className: "bg-surface-2 flex h-2 w-full overflow-hidden rounded-full",
|
|
124
|
+
children: rows.map(({ category, tone }) => /* @__PURE__ */ jsx("span", {
|
|
125
|
+
"data-slot": "context-usage-segment",
|
|
126
|
+
"data-color": tone,
|
|
127
|
+
className: cn("h-full transition-[width] duration-500 ease-out motion-reduce:transition-none", TONE_FILL[tone]),
|
|
128
|
+
style: { width: `${pct(category.tokens, limit)}%` }
|
|
129
|
+
}, category.label))
|
|
130
|
+
}),
|
|
131
|
+
/* @__PURE__ */ jsxs("table", {
|
|
132
|
+
"data-slot": "context-usage-breakdown",
|
|
133
|
+
className: "w-full border-collapse",
|
|
134
|
+
children: [/* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", {
|
|
135
|
+
className: cn(mono, "text-fg-subtle uppercase"),
|
|
136
|
+
children: [
|
|
137
|
+
/* @__PURE__ */ jsx("th", {
|
|
138
|
+
scope: "col",
|
|
139
|
+
className: "pb-1 text-start font-normal tracking-[0.12em]",
|
|
140
|
+
children: copy.category
|
|
141
|
+
}),
|
|
142
|
+
/* @__PURE__ */ jsx("th", {
|
|
143
|
+
scope: "col",
|
|
144
|
+
className: "pb-1 text-end font-normal tracking-[0.12em]",
|
|
145
|
+
children: copy.tokens
|
|
146
|
+
}),
|
|
147
|
+
/* @__PURE__ */ jsx("th", {
|
|
148
|
+
scope: "col",
|
|
149
|
+
className: "pb-1 text-end font-normal tracking-[0.12em]",
|
|
150
|
+
children: copy.usage
|
|
151
|
+
})
|
|
152
|
+
]
|
|
153
|
+
}) }), /* @__PURE__ */ jsxs("tbody", {
|
|
154
|
+
className: "text-(length:--cue-text-body)",
|
|
155
|
+
children: [rows.map(({ category, tone }) => /* @__PURE__ */ jsxs("tr", { children: [
|
|
156
|
+
/* @__PURE__ */ jsx("th", {
|
|
157
|
+
scope: "row",
|
|
158
|
+
className: "py-0.5 text-start font-normal",
|
|
159
|
+
children: /* @__PURE__ */ jsxs("span", {
|
|
160
|
+
className: "flex items-center gap-2",
|
|
161
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
162
|
+
"aria-hidden": true,
|
|
163
|
+
className: cn("size-2 shrink-0 rounded-full", TONE_FILL[tone])
|
|
164
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
165
|
+
className: "text-fg-muted min-w-0 truncate",
|
|
166
|
+
children: category.label
|
|
167
|
+
})]
|
|
168
|
+
})
|
|
169
|
+
}),
|
|
170
|
+
/* @__PURE__ */ jsx("td", {
|
|
171
|
+
className: cn(mono, "text-fg-subtle py-0.5 text-end tabular-nums"),
|
|
172
|
+
children: fmt(category.tokens)
|
|
173
|
+
}),
|
|
174
|
+
/* @__PURE__ */ jsx("td", {
|
|
175
|
+
className: cn(mono, "text-fg-subtle py-0.5 text-end tabular-nums"),
|
|
176
|
+
children: share(category.tokens, limit)
|
|
177
|
+
})
|
|
178
|
+
] }, category.label)), /* @__PURE__ */ jsxs("tr", {
|
|
179
|
+
"data-slot": "context-usage-headroom",
|
|
180
|
+
children: [
|
|
181
|
+
/* @__PURE__ */ jsx("th", {
|
|
182
|
+
scope: "row",
|
|
183
|
+
className: "py-0.5 text-start font-normal",
|
|
184
|
+
children: /* @__PURE__ */ jsxs("span", {
|
|
185
|
+
className: "flex items-center gap-2",
|
|
186
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
187
|
+
"aria-hidden": true,
|
|
188
|
+
className: "bg-surface-2 size-2 shrink-0 rounded-full"
|
|
189
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
190
|
+
className: "text-fg-subtle min-w-0 truncate",
|
|
191
|
+
children: copy.headroom
|
|
192
|
+
})]
|
|
193
|
+
})
|
|
194
|
+
}),
|
|
195
|
+
/* @__PURE__ */ jsx("td", {
|
|
196
|
+
className: cn(mono, "text-fg-subtle py-0.5 text-end tabular-nums"),
|
|
197
|
+
children: fmt(headroom)
|
|
198
|
+
}),
|
|
199
|
+
/* @__PURE__ */ jsx("td", {
|
|
200
|
+
className: cn(mono, "text-fg-subtle py-0.5 text-end tabular-nums"),
|
|
201
|
+
children: share(headroom, limit)
|
|
202
|
+
})
|
|
203
|
+
]
|
|
204
|
+
})]
|
|
205
|
+
})]
|
|
206
|
+
}),
|
|
207
|
+
stats === void 0 || stats.length === 0 ? null : /* @__PURE__ */ jsx("dl", {
|
|
208
|
+
"data-slot": "context-usage-stats",
|
|
209
|
+
className: "border-border flex flex-col gap-1 border-t pt-3",
|
|
210
|
+
children: stats.map((stat) => /* @__PURE__ */ jsxs("div", {
|
|
211
|
+
className: "flex items-baseline justify-between gap-2",
|
|
212
|
+
children: [/* @__PURE__ */ jsx("dt", {
|
|
213
|
+
className: "text-fg-muted min-w-0 truncate text-(length:--cue-text-body)",
|
|
214
|
+
children: stat.label
|
|
215
|
+
}), /* @__PURE__ */ jsx("dd", {
|
|
216
|
+
className: cn(mono, "text-fg-subtle shrink-0 tabular-nums"),
|
|
217
|
+
children: stat.value
|
|
218
|
+
})]
|
|
219
|
+
}, stat.label))
|
|
220
|
+
})
|
|
221
|
+
]
|
|
222
|
+
});
|
|
223
|
+
});
|
|
224
|
+
//#endregion
|
|
225
|
+
export { ContextUsage };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { ComponentProps } from "react";
|
|
2
|
+
//#region src/elements/conversation-search.d.ts
|
|
3
|
+
interface SearchHit {
|
|
4
|
+
/** Stable identity for the rail mark. */
|
|
5
|
+
id: string;
|
|
6
|
+
/** Text preceding the match, for the preview. */
|
|
7
|
+
before: string;
|
|
8
|
+
/** The matched run, highlighted between before and after. */
|
|
9
|
+
match: string;
|
|
10
|
+
/** Text following the match. */
|
|
11
|
+
after: string;
|
|
12
|
+
/** Where the hit sits in the thread, as a percentage. Drives the scrollbar marks. */
|
|
13
|
+
position: number;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Find inside a long thread, with every hit marked down the scrollbar.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* import { ConversationSearch } from "@cueplusplus/ui/elements";
|
|
20
|
+
*
|
|
21
|
+
* <ConversationSearch
|
|
22
|
+
* query={query}
|
|
23
|
+
* hits={hits}
|
|
24
|
+
* activeIndex={0}
|
|
25
|
+
* onQueryChange={setQuery}
|
|
26
|
+
* onStep={step}
|
|
27
|
+
* />
|
|
28
|
+
*/
|
|
29
|
+
declare function ConversationSearch({ query, hits, activeIndex, onQueryChange, onStep, className, ...props }: Omit<ComponentProps<"div">, "children" | "query" | "hits" | "activeIndex" | "onQueryChange" | "onStep"> & {
|
|
30
|
+
/** Current search text. */
|
|
31
|
+
query: string;
|
|
32
|
+
/**
|
|
33
|
+
* Matches in document order. Each carries its own surrounding text so no lookup is
|
|
34
|
+
* needed to render the preview.
|
|
35
|
+
*/
|
|
36
|
+
hits: readonly SearchHit[];
|
|
37
|
+
/**
|
|
38
|
+
* Which hit is current, in both the counter and the rail. Clamped to the current hit
|
|
39
|
+
* set, so narrowing the results cannot strand it out of range.
|
|
40
|
+
*/
|
|
41
|
+
activeIndex: number;
|
|
42
|
+
/** Called as the search is typed. */
|
|
43
|
+
onQueryChange?: (query: string) => void;
|
|
44
|
+
/** Called with -1 or 1 to walk the matches. Wrap the index yourself. */
|
|
45
|
+
onStep?: (delta: number) => void;
|
|
46
|
+
}): import("react").JSX.Element;
|
|
47
|
+
//#endregion
|
|
48
|
+
export { ConversationSearch, SearchHit };
|