@dungle-scrubs/admin-ui-soft 0.0.0-stage → 0.0.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/GUIDE.md +110 -0
- package/LICENSE +21 -0
- package/README.md +36 -2
- package/THIRD-PARTY-NOTICES.md +25 -0
- package/UPSTREAM-VENDORED-CHANGES.md +317 -0
- package/VENDORED-CHANGES.md +60 -0
- package/dist/_virtual/_rolldown/runtime.js +13 -0
- package/dist/ai/compositions/agent-console/agent-console.d.ts +109 -0
- package/dist/ai/compositions/agent-console/agent-console.js +644 -0
- package/dist/ai/compositions/attention-feed/attention-feed.d.ts +127 -0
- package/dist/ai/compositions/attention-feed/attention-feed.js +626 -0
- package/dist/ai/compositions/conversation-browser/conversation-browser.d.ts +126 -0
- package/dist/ai/compositions/conversation-browser/conversation-browser.js +364 -0
- package/dist/ai/compositions/redaction-marker/redaction-marker.d.ts +42 -0
- package/dist/ai/compositions/redaction-marker/redaction-marker.js +202 -0
- package/dist/ai/compositions/run-inspector/json-view.js +164 -0
- package/dist/ai/compositions/run-inspector/run-inspector.d.ts +66 -0
- package/dist/ai/compositions/run-inspector/run-inspector.js +703 -0
- package/dist/ai/compositions/run-inspector/run-model.js +155 -0
- package/dist/ai/compositions/tool-approval/json-args.js +54 -0
- package/dist/ai/compositions/tool-approval/tool-approval.d.ts +57 -0
- package/dist/ai/compositions/tool-approval/tool-approval.js +331 -0
- package/dist/ai/compositions/tool-call-row/tool-call-row.js +74 -0
- package/dist/ai/compositions/transcript-viewer/to-thread-messages.js +65 -0
- package/dist/ai/compositions/transcript-viewer/transcript-viewer.d.ts +63 -0
- package/dist/ai/compositions/transcript-viewer/transcript-viewer.js +471 -0
- package/dist/ai/compositions/usage-meter/usage-format.js +107 -0
- package/dist/ai/compositions/usage-meter/usage-meter.d.ts +32 -0
- package/dist/ai/compositions/usage-meter/usage-meter.js +258 -0
- package/dist/ai/testing/mock-clock.d.ts +31 -0
- package/dist/ai/testing/mock-clock.js +66 -0
- package/dist/ai/testing/mock-reply.d.ts +70 -0
- package/dist/ai/testing/mock-reply.js +100 -0
- package/dist/ai/testing/mock-runtime.d.ts +86 -0
- package/dist/ai/testing/mock-runtime.js +384 -0
- package/dist/ai/types.d.ts +323 -0
- package/dist/ai.css +1088 -0
- package/dist/ai.d.ts +160 -0
- package/dist/ai.js +158 -0
- package/dist/components/assistant-ui/elements/activity-graph.d.ts +14 -0
- package/dist/components/assistant-ui/elements/activity-graph.js +69 -0
- package/dist/components/assistant-ui/elements/agent-card.d.ts +21 -0
- package/dist/components/assistant-ui/elements/agent-card.js +75 -0
- package/dist/components/assistant-ui/elements/agent-handoff.d.ts +13 -0
- package/dist/components/assistant-ui/elements/agent-handoff.js +47 -0
- package/dist/components/assistant-ui/elements/agent-plan.d.ts +16 -0
- package/dist/components/assistant-ui/elements/agent-plan.js +93 -0
- package/dist/components/assistant-ui/elements/agent-status.aui.d.ts +24 -0
- package/dist/components/assistant-ui/elements/agent-status.aui.js +161 -0
- package/dist/components/assistant-ui/elements/agent-status.d.ts +17 -0
- package/dist/components/assistant-ui/elements/agent-status.js +47 -0
- package/dist/components/assistant-ui/elements/approval-card.d.ts +31 -0
- package/dist/components/assistant-ui/elements/approval-card.js +99 -0
- package/dist/components/assistant-ui/elements/artifact-card.d.ts +12 -0
- package/dist/components/assistant-ui/elements/artifact-card.js +47 -0
- package/dist/components/assistant-ui/elements/assistant-modal.aui.d.ts +7 -0
- package/dist/components/assistant-ui/elements/assistant-modal.aui.js +276 -0
- package/dist/components/assistant-ui/elements/assistant-sidebar.aui.d.ts +7 -0
- package/dist/components/assistant-ui/elements/assistant-sidebar.aui.js +18 -0
- package/dist/components/assistant-ui/elements/attachment.aui.d.ts +9 -0
- package/dist/components/assistant-ui/elements/attachment.aui.js +143 -0
- package/dist/components/assistant-ui/elements/background-inbox.d.ts +18 -0
- package/dist/components/assistant-ui/elements/background-inbox.js +65 -0
- package/dist/components/assistant-ui/elements/canvas-split.d.ts +25 -0
- package/dist/components/assistant-ui/elements/canvas-split.js +106 -0
- package/dist/components/assistant-ui/elements/chart.d.ts +19 -0
- package/dist/components/assistant-ui/elements/chart.js +105 -0
- package/dist/components/assistant-ui/elements/chat-panel.d.ts +15 -0
- package/dist/components/assistant-ui/elements/chat-panel.js +82 -0
- package/dist/components/assistant-ui/elements/checkpoint-history.d.ts +17 -0
- package/dist/components/assistant-ui/elements/checkpoint-history.js +60 -0
- package/dist/components/assistant-ui/elements/code-diff.d.ts +18 -0
- package/dist/components/assistant-ui/elements/code-diff.js +89 -0
- package/dist/components/assistant-ui/elements/code-runner.d.ts +15 -0
- package/dist/components/assistant-ui/elements/code-runner.js +108 -0
- package/dist/components/assistant-ui/elements/command-palette.d.ts +20 -0
- package/dist/components/assistant-ui/elements/command-palette.js +129 -0
- package/dist/components/assistant-ui/elements/comparison-card.d.ts +18 -0
- package/dist/components/assistant-ui/elements/comparison-card.js +58 -0
- package/dist/components/assistant-ui/elements/composer-trigger-popover.aui.d.ts +51 -0
- package/dist/components/assistant-ui/elements/composer-trigger-popover.aui.js +104 -0
- package/dist/components/assistant-ui/elements/composer.d.ts +91 -0
- package/dist/components/assistant-ui/elements/composer.js +416 -0
- package/dist/components/assistant-ui/elements/computer-use.d.ts +19 -0
- package/dist/components/assistant-ui/elements/computer-use.js +84 -0
- package/dist/components/assistant-ui/elements/confidence-marker.d.ts +20 -0
- package/dist/components/assistant-ui/elements/confidence-marker.js +58 -0
- package/dist/components/assistant-ui/elements/connection-state.d.ts +13 -0
- package/dist/components/assistant-ui/elements/connection-state.js +59 -0
- package/dist/components/assistant-ui/elements/context-breakdown.d.ts +15 -0
- package/dist/components/assistant-ui/elements/context-breakdown.js +91 -0
- package/dist/components/assistant-ui/elements/context-display.aui.d.ts +25 -0
- package/dist/components/assistant-ui/elements/context-display.aui.js +26 -0
- package/dist/components/assistant-ui/elements/context-display.d.ts +43 -0
- package/dist/components/assistant-ui/elements/context-display.js +300 -0
- package/dist/components/assistant-ui/elements/conversation-map.aui.d.ts +9 -0
- package/dist/components/assistant-ui/elements/conversation-map.aui.js +177 -0
- package/dist/components/assistant-ui/elements/conversation-map.d.ts +19 -0
- package/dist/components/assistant-ui/elements/conversation-map.js +84 -0
- package/dist/components/assistant-ui/elements/conversation-search.d.ts +20 -0
- package/dist/components/assistant-ui/elements/conversation-search.js +75 -0
- package/dist/components/assistant-ui/elements/cost-meter.d.ts +19 -0
- package/dist/components/assistant-ui/elements/cost-meter.js +76 -0
- package/dist/components/assistant-ui/elements/data-table.d.ts +72 -0
- package/dist/components/assistant-ui/elements/data-table.js +368 -0
- package/dist/components/assistant-ui/elements/day-separator.d.ts +16 -0
- package/dist/components/assistant-ui/elements/day-separator.js +44 -0
- package/dist/components/assistant-ui/elements/diagram.d.ts +15 -0
- package/dist/components/assistant-ui/elements/diagram.js +65 -0
- package/dist/components/assistant-ui/elements/directive-text.aui.d.ts +11 -0
- package/dist/components/assistant-ui/elements/directive-text.aui.js +18 -0
- package/dist/components/assistant-ui/elements/directive-text.d.ts +32 -0
- package/dist/components/assistant-ui/elements/directive-text.js +35 -0
- package/dist/components/assistant-ui/elements/document-reference.d.ts +17 -0
- package/dist/components/assistant-ui/elements/document-reference.js +62 -0
- package/dist/components/assistant-ui/elements/draft-restore.d.ts +12 -0
- package/dist/components/assistant-ui/elements/draft-restore.js +43 -0
- package/dist/components/assistant-ui/elements/edit-message.d.ts +15 -0
- package/dist/components/assistant-ui/elements/edit-message.js +63 -0
- package/dist/components/assistant-ui/elements/elicitation-form.d.ts +23 -0
- package/dist/components/assistant-ui/elements/elicitation-form.js +112 -0
- package/dist/components/assistant-ui/elements/empty-state.d.ts +16 -0
- package/dist/components/assistant-ui/elements/empty-state.js +71 -0
- package/dist/components/assistant-ui/elements/error-state.d.ts +13 -0
- package/dist/components/assistant-ui/elements/error-state.js +52 -0
- package/dist/components/assistant-ui/elements/feedback-dialog.d.ts +15 -0
- package/dist/components/assistant-ui/elements/feedback-dialog.js +77 -0
- package/dist/components/assistant-ui/elements/file-tree.d.ts +20 -0
- package/dist/components/assistant-ui/elements/file-tree.js +74 -0
- package/dist/components/assistant-ui/elements/file.d.ts +52 -0
- package/dist/components/assistant-ui/elements/file.js +222 -0
- package/dist/components/assistant-ui/elements/flow-graph.d.ts +23 -0
- package/dist/components/assistant-ui/elements/flow-graph.js +72 -0
- package/dist/components/assistant-ui/elements/follow-up-suggestions.aui.d.ts +7 -0
- package/dist/components/assistant-ui/elements/follow-up-suggestions.aui.js +30 -0
- package/dist/components/assistant-ui/elements/generative-ui.d.ts +8 -0
- package/dist/components/assistant-ui/elements/generative-ui.js +27 -0
- package/dist/components/assistant-ui/elements/geo-map.d.ts +29 -0
- package/dist/components/assistant-ui/elements/geo-map.js +190 -0
- package/dist/components/assistant-ui/elements/guardrail-notice.d.ts +15 -0
- package/dist/components/assistant-ui/elements/guardrail-notice.js +59 -0
- package/dist/components/assistant-ui/elements/heat-graph.d.ts +9 -0
- package/dist/components/assistant-ui/elements/heat-graph.js +90 -0
- package/dist/components/assistant-ui/elements/image-gallery.d.ts +22 -0
- package/dist/components/assistant-ui/elements/image-gallery.js +192 -0
- package/dist/components/assistant-ui/elements/image-generation.d.ts +11 -0
- package/dist/components/assistant-ui/elements/image-generation.js +64 -0
- package/dist/components/assistant-ui/elements/image.d.ts +59 -0
- package/dist/components/assistant-ui/elements/image.js +416 -0
- package/dist/components/assistant-ui/elements/inline-citation.d.ts +23 -0
- package/dist/components/assistant-ui/elements/inline-citation.js +90 -0
- package/dist/components/assistant-ui/elements/job-progress.d.ts +25 -0
- package/dist/components/assistant-ui/elements/job-progress.js +102 -0
- package/dist/components/assistant-ui/elements/launcher-bubble.d.ts +15 -0
- package/dist/components/assistant-ui/elements/launcher-bubble.js +71 -0
- package/dist/components/assistant-ui/elements/link-preview.d.ts +17 -0
- package/dist/components/assistant-ui/elements/link-preview.js +77 -0
- package/dist/components/assistant-ui/elements/loading-state.d.ts +13 -0
- package/dist/components/assistant-ui/elements/loading-state.js +33 -0
- package/dist/components/assistant-ui/elements/logos.d.ts +10 -0
- package/dist/components/assistant-ui/elements/logos.js +63 -0
- package/dist/components/assistant-ui/elements/map-answer.d.ts +19 -0
- package/dist/components/assistant-ui/elements/map-answer.js +120 -0
- package/dist/components/assistant-ui/elements/markdown-text.d.ts +11 -0
- package/dist/components/assistant-ui/elements/markdown-text.js +152 -0
- package/dist/components/assistant-ui/elements/math-block.d.ts +25 -0
- package/dist/components/assistant-ui/elements/math-block.js +60 -0
- package/dist/components/assistant-ui/elements/mcp-config.aui.d.ts +28 -0
- package/dist/components/assistant-ui/elements/mcp-config.aui.js +380 -0
- package/dist/components/assistant-ui/elements/mcp-server-panel.d.ts +20 -0
- package/dist/components/assistant-ui/elements/mcp-server-panel.js +114 -0
- package/dist/components/assistant-ui/elements/media-player.d.ts +21 -0
- package/dist/components/assistant-ui/elements/media-player.js +302 -0
- package/dist/components/assistant-ui/elements/memory-chips.d.ts +16 -0
- package/dist/components/assistant-ui/elements/memory-chips.js +44 -0
- package/dist/components/assistant-ui/elements/mermaid-diagram.aui.d.ts +14 -0
- package/dist/components/assistant-ui/elements/mermaid-diagram.aui.js +43 -0
- package/dist/components/assistant-ui/elements/mermaid-diagram.d.ts +20 -0
- package/dist/components/assistant-ui/elements/mermaid-diagram.js +258 -0
- package/dist/components/assistant-ui/elements/message-actions.d.ts +17 -0
- package/dist/components/assistant-ui/elements/message-actions.js +57 -0
- package/dist/components/assistant-ui/elements/message-attachment.d.ts +18 -0
- package/dist/components/assistant-ui/elements/message-attachment.js +58 -0
- package/dist/components/assistant-ui/elements/message-branches.d.ts +12 -0
- package/dist/components/assistant-ui/elements/message-branches.js +55 -0
- package/dist/components/assistant-ui/elements/message-pair.d.ts +16 -0
- package/dist/components/assistant-ui/elements/message-pair.js +63 -0
- package/dist/components/assistant-ui/elements/message-queue.d.ts +15 -0
- package/dist/components/assistant-ui/elements/message-queue.js +70 -0
- package/dist/components/assistant-ui/elements/message-timing.aui.d.ts +30 -0
- package/dist/components/assistant-ui/elements/message-timing.aui.js +98 -0
- package/dist/components/assistant-ui/elements/message-timing.d.ts +14 -0
- package/dist/components/assistant-ui/elements/message-timing.js +26 -0
- package/dist/components/assistant-ui/elements/mobile-composer.d.ts +18 -0
- package/dist/components/assistant-ui/elements/mobile-composer.js +76 -0
- package/dist/components/assistant-ui/elements/model-picker.d.ts +19 -0
- package/dist/components/assistant-ui/elements/model-picker.js +68 -0
- package/dist/components/assistant-ui/elements/model-selector.aui.d.ts +23 -0
- package/dist/components/assistant-ui/elements/model-selector.aui.js +79 -0
- package/dist/components/assistant-ui/elements/model-selector.d.ts +130 -0
- package/dist/components/assistant-ui/elements/model-selector.js +399 -0
- package/dist/components/assistant-ui/elements/number-ticker.d.ts +10 -0
- package/dist/components/assistant-ui/elements/number-ticker.js +41 -0
- package/dist/components/assistant-ui/elements/onboarding.d.ts +17 -0
- package/dist/components/assistant-ui/elements/onboarding.js +69 -0
- package/dist/components/assistant-ui/elements/option-list.d.ts +39 -0
- package/dist/components/assistant-ui/elements/option-list.js +176 -0
- package/dist/components/assistant-ui/elements/permission-grant.d.ts +14 -0
- package/dist/components/assistant-ui/elements/permission-grant.js +84 -0
- package/dist/components/assistant-ui/elements/prompt-library.d.ts +20 -0
- package/dist/components/assistant-ui/elements/prompt-library.js +121 -0
- package/dist/components/assistant-ui/elements/question-flow.d.ts +24 -0
- package/dist/components/assistant-ui/elements/question-flow.js +180 -0
- package/dist/components/assistant-ui/elements/quota-banner.d.ts +14 -0
- package/dist/components/assistant-ui/elements/quota-banner.js +68 -0
- package/dist/components/assistant-ui/elements/quote-reply.d.ts +20 -0
- package/dist/components/assistant-ui/elements/quote-reply.js +66 -0
- package/dist/components/assistant-ui/elements/quote.aui.d.ts +61 -0
- package/dist/components/assistant-ui/elements/quote.aui.js +170 -0
- package/dist/components/assistant-ui/elements/read-aloud.d.ts +16 -0
- package/dist/components/assistant-ui/elements/read-aloud.js +66 -0
- package/dist/components/assistant-ui/elements/reasoning-effort.d.ts +17 -0
- package/dist/components/assistant-ui/elements/reasoning-effort.js +67 -0
- package/dist/components/assistant-ui/elements/reasoning-panel.d.ts +20 -0
- package/dist/components/assistant-ui/elements/reasoning-panel.js +60 -0
- package/dist/components/assistant-ui/elements/reasoning.aui.d.ts +24 -0
- package/dist/components/assistant-ui/elements/reasoning.aui.js +70 -0
- package/dist/components/assistant-ui/elements/reasoning.d.ts +38 -0
- package/dist/components/assistant-ui/elements/reasoning.js +194 -0
- package/dist/components/assistant-ui/elements/recommendation-card.d.ts +16 -0
- package/dist/components/assistant-ui/elements/recommendation-card.js +65 -0
- package/dist/components/assistant-ui/elements/regenerate-menu.d.ts +18 -0
- package/dist/components/assistant-ui/elements/regenerate-menu.js +46 -0
- package/dist/components/assistant-ui/elements/research-report.d.ts +19 -0
- package/dist/components/assistant-ui/elements/research-report.js +63 -0
- package/dist/components/assistant-ui/elements/retrieval-chunks.d.ts +19 -0
- package/dist/components/assistant-ui/elements/retrieval-chunks.js +86 -0
- package/dist/components/assistant-ui/elements/reviewable-diff.d.ts +21 -0
- package/dist/components/assistant-ui/elements/reviewable-diff.js +104 -0
- package/dist/components/assistant-ui/elements/schedule-card.d.ts +19 -0
- package/dist/components/assistant-ui/elements/schedule-card.js +80 -0
- package/dist/components/assistant-ui/elements/score-breakdown.d.ts +19 -0
- package/dist/components/assistant-ui/elements/score-breakdown.js +107 -0
- package/dist/components/assistant-ui/elements/scroll-anchor.d.ts +15 -0
- package/dist/components/assistant-ui/elements/scroll-anchor.js +104 -0
- package/dist/components/assistant-ui/elements/settings-panel.d.ts +23 -0
- package/dist/components/assistant-ui/elements/settings-panel.js +108 -0
- package/dist/components/assistant-ui/elements/shared-conversation.d.ts +18 -0
- package/dist/components/assistant-ui/elements/shared-conversation.js +56 -0
- package/dist/components/assistant-ui/elements/shiki-highlighter.aui.d.ts +29 -0
- package/dist/components/assistant-ui/elements/shiki-highlighter.aui.js +31 -0
- package/dist/components/assistant-ui/elements/shiki-highlighter.d.ts +26 -0
- package/dist/components/assistant-ui/elements/shiki-highlighter.js +49 -0
- package/dist/components/assistant-ui/elements/sources.aui.d.ts +24 -0
- package/dist/components/assistant-ui/elements/sources.aui.js +121 -0
- package/dist/components/assistant-ui/elements/sources.d.ts +21 -0
- package/dist/components/assistant-ui/elements/sources.js +109 -0
- package/dist/components/assistant-ui/elements/speaker-identity.d.ts +17 -0
- package/dist/components/assistant-ui/elements/speaker-identity.js +45 -0
- package/dist/components/assistant-ui/elements/spec-sheet.d.ts +17 -0
- package/dist/components/assistant-ui/elements/spec-sheet.js +39 -0
- package/dist/components/assistant-ui/elements/stopped-run.d.ts +12 -0
- package/dist/components/assistant-ui/elements/stopped-run.js +44 -0
- package/dist/components/assistant-ui/elements/streaming-text.d.ts +15 -0
- package/dist/components/assistant-ui/elements/streaming-text.js +45 -0
- package/dist/components/assistant-ui/elements/subagent-list.d.ts +17 -0
- package/dist/components/assistant-ui/elements/subagent-list.js +74 -0
- package/dist/components/assistant-ui/elements/suggestions.d.ts +14 -0
- package/dist/components/assistant-ui/elements/suggestions.js +25 -0
- package/dist/components/assistant-ui/elements/surfaces.d.ts +42 -0
- package/dist/components/assistant-ui/elements/surfaces.js +87 -0
- package/dist/components/assistant-ui/elements/syntax-highlighter.d.ts +7 -0
- package/dist/components/assistant-ui/elements/syntax-highlighter.js +41 -0
- package/dist/components/assistant-ui/elements/task-card.aui.d.ts +24 -0
- package/dist/components/assistant-ui/elements/task-card.aui.js +136 -0
- package/dist/components/assistant-ui/elements/task-card.d.ts +22 -0
- package/dist/components/assistant-ui/elements/task-card.js +104 -0
- package/dist/components/assistant-ui/elements/terminal-block.d.ts +27 -0
- package/dist/components/assistant-ui/elements/terminal-block.js +266 -0
- package/dist/components/assistant-ui/elements/thinking-indicator.d.ts +10 -0
- package/dist/components/assistant-ui/elements/thinking-indicator.js +30 -0
- package/dist/components/assistant-ui/elements/thread-list.aui.d.ts +39 -0
- package/dist/components/assistant-ui/elements/thread-list.aui.js +331 -0
- package/dist/components/assistant-ui/elements/thread-list.d.ts +19 -0
- package/dist/components/assistant-ui/elements/thread-list.js +72 -0
- package/dist/components/assistant-ui/elements/thread-search.d.ts +20 -0
- package/dist/components/assistant-ui/elements/thread-search.js +94 -0
- package/dist/components/assistant-ui/elements/thread.aui.d.ts +36 -0
- package/dist/components/assistant-ui/elements/thread.aui.js +625 -0
- package/dist/components/assistant-ui/elements/threadlist-sidebar.aui.d.ts +19 -0
- package/dist/components/assistant-ui/elements/threadlist-sidebar.aui.js +75 -0
- package/dist/components/assistant-ui/elements/timeline.d.ts +18 -0
- package/dist/components/assistant-ui/elements/timeline.js +40 -0
- package/dist/components/assistant-ui/elements/todo-list.d.ts +21 -0
- package/dist/components/assistant-ui/elements/todo-list.js +100 -0
- package/dist/components/assistant-ui/elements/tool-call.d.ts +17 -0
- package/dist/components/assistant-ui/elements/tool-call.js +70 -0
- package/dist/components/assistant-ui/elements/tool-error.d.ts +16 -0
- package/dist/components/assistant-ui/elements/tool-error.js +62 -0
- package/dist/components/assistant-ui/elements/tool-fallback.aui.d.ts +44 -0
- package/dist/components/assistant-ui/elements/tool-fallback.aui.js +542 -0
- package/dist/components/assistant-ui/elements/tool-group.aui.d.ts +37 -0
- package/dist/components/assistant-ui/elements/tool-group.aui.js +104 -0
- package/dist/components/assistant-ui/elements/tool-group.d.ts +20 -0
- package/dist/components/assistant-ui/elements/tool-group.js +71 -0
- package/dist/components/assistant-ui/elements/tool-timeline.d.ts +44 -0
- package/dist/components/assistant-ui/elements/tool-timeline.js +109 -0
- package/dist/components/assistant-ui/elements/tooltip-icon-button.d.ts +12 -0
- package/dist/components/assistant-ui/elements/tooltip-icon-button.js +30 -0
- package/dist/components/assistant-ui/elements/trace-waterfall.d.ts +33 -0
- package/dist/components/assistant-ui/elements/trace-waterfall.js +102 -0
- package/dist/components/assistant-ui/elements/typing-indicator.d.ts +9 -0
- package/dist/components/assistant-ui/elements/typing-indicator.js +45 -0
- package/dist/components/assistant-ui/elements/voice-conversation.aui.d.ts +11 -0
- package/dist/components/assistant-ui/elements/voice-conversation.aui.js +54 -0
- package/dist/components/assistant-ui/elements/voice-conversation.d.ts +21 -0
- package/dist/components/assistant-ui/elements/voice-conversation.js +110 -0
- package/dist/components/assistant-ui/elements/voice.aui.d.ts +22 -0
- package/dist/components/assistant-ui/elements/voice.aui.js +100 -0
- package/dist/components/assistant-ui/elements/voice.d.ts +15 -0
- package/dist/components/assistant-ui/elements/voice.js +400 -0
- package/dist/components/assistant-ui/elements/web-preview.d.ts +18 -0
- package/dist/components/assistant-ui/elements/web-preview.js +61 -0
- package/dist/components/assistant-ui/elements/web-search.d.ts +17 -0
- package/dist/components/assistant-ui/elements/web-search.js +54 -0
- package/dist/components/assistant-ui/utils/href.d.ts +13 -0
- package/dist/components/assistant-ui/utils/href.js +39 -0
- package/dist/components/assistant-ui/utils/range.d.ts +22 -0
- package/dist/components/assistant-ui/utils/range.js +48 -0
- package/dist/components/assistant-ui/utils/task.d.ts +14 -0
- package/dist/components/assistant-ui/utils/task.js +75 -0
- package/dist/components/icons/github.js +13 -0
- package/dist/components/theme-provider.d.ts +16 -0
- package/dist/components/theme-provider.js +116 -0
- package/dist/components/ui/accordion.d.ts +8 -0
- package/dist/components/ui/accordion.js +53 -0
- package/dist/components/ui/alert-dialog.d.ts +20 -0
- package/dist/components/ui/alert-dialog.js +93 -0
- package/dist/components/ui/alert.d.ts +12 -0
- package/dist/components/ui/alert.js +42 -0
- package/dist/components/ui/aspect-ratio.d.ts +6 -0
- package/dist/components/ui/aspect-ratio.js +13 -0
- package/dist/components/ui/attachment.d.ts +25 -0
- package/dist/components/ui/attachment.js +103 -0
- package/dist/components/ui/avatar.d.ts +13 -0
- package/dist/components/ui/avatar.js +50 -0
- package/dist/components/ui/badge.d.ts +14 -0
- package/dist/components/ui/badge.js +30 -0
- package/dist/components/ui/breadcrumb.d.ts +12 -0
- package/dist/components/ui/breadcrumb.js +71 -0
- package/dist/components/ui/bubble.d.ts +18 -0
- package/dist/components/ui/bubble.js +72 -0
- package/dist/components/ui/button-group.d.ts +12 -0
- package/dist/components/ui/button-group.js +41 -0
- package/dist/components/ui/button.d.ts +19 -0
- package/dist/components/ui/button.js +71 -0
- package/dist/components/ui/calendar.d.ts +12 -0
- package/dist/components/ui/calendar.js +108 -0
- package/dist/components/ui/card.d.ts +13 -0
- package/dist/components/ui/card.js +55 -0
- package/dist/components/ui/carousel.d.ts +30 -0
- package/dist/components/ui/carousel.js +131 -0
- package/dist/components/ui/chart.d.ts +46 -0
- package/dist/components/ui/chart.js +148 -0
- package/dist/components/ui/checkbox.d.ts +5 -0
- package/dist/components/ui/checkbox.js +20 -0
- package/dist/components/ui/collapsible.d.ts +7 -0
- package/dist/components/ui/collapsible.js +23 -0
- package/dist/components/ui/combobox.d.ts +26 -0
- package/dist/components/ui/combobox.js +161 -0
- package/dist/components/ui/command.d.ts +21 -0
- package/dist/components/ui/command.js +87 -0
- package/dist/components/ui/context-menu.d.ts +31 -0
- package/dist/components/ui/context-menu.js +132 -0
- package/dist/components/ui/dialog.d.ts +19 -0
- package/dist/components/ui/dialog.js +91 -0
- package/dist/components/ui/diff-viewer.d.ts +100 -0
- package/dist/components/ui/diff-viewer.js +461 -0
- package/dist/components/ui/direction.d.ts +2 -0
- package/dist/components/ui/direction.js +2 -0
- package/dist/components/ui/dot-matrix.d.ts +150 -0
- package/dist/components/ui/dot-matrix.js +248 -0
- package/dist/components/ui/drawer.d.ts +18 -0
- package/dist/components/ui/drawer.js +123 -0
- package/dist/components/ui/dropdown-menu.d.ts +31 -0
- package/dist/components/ui/dropdown-menu.js +136 -0
- package/dist/components/ui/empty.d.ts +13 -0
- package/dist/components/ui/empty.js +59 -0
- package/dist/components/ui/field.d.ts +26 -0
- package/dist/components/ui/field.js +109 -0
- package/dist/components/ui/hover-card.d.ts +7 -0
- package/dist/components/ui/hover-card.js +36 -0
- package/dist/components/ui/input-group.d.ts +20 -0
- package/dist/components/ui/input-group.js +77 -0
- package/dist/components/ui/input-otp.d.ts +13 -0
- package/dist/components/ui/input-otp.js +46 -0
- package/dist/components/ui/input.d.ts +5 -0
- package/dist/components/ui/input.js +14 -0
- package/dist/components/ui/item.d.ts +24 -0
- package/dist/components/ui/item.js +120 -0
- package/dist/components/ui/kbd.d.ts +5 -0
- package/dist/components/ui/kbd.js +19 -0
- package/dist/components/ui/label.d.ts +5 -0
- package/dist/components/ui/label.js +12 -0
- package/dist/components/ui/marker.d.ts +12 -0
- package/dist/components/ui/marker.js +42 -0
- package/dist/components/ui/menubar.d.ts +31 -0
- package/dist/components/ui/menubar.js +135 -0
- package/dist/components/ui/message-scroller.d.ts +12 -0
- package/dist/components/ui/message-scroller.js +59 -0
- package/dist/components/ui/message.d.ts +12 -0
- package/dist/components/ui/message.js +48 -0
- package/dist/components/ui/native-select.d.ts +10 -0
- package/dist/components/ui/native-select.js +37 -0
- package/dist/components/ui/navigation-menu.d.ts +13 -0
- package/dist/components/ui/navigation-menu.js +82 -0
- package/dist/components/ui/number-roll.d.ts +21 -0
- package/dist/components/ui/number-roll.js +269 -0
- package/dist/components/ui/pagination.d.ts +19 -0
- package/dist/components/ui/pagination.js +79 -0
- package/dist/components/ui/popover.d.ts +11 -0
- package/dist/components/ui/popover.js +54 -0
- package/dist/components/ui/progress.d.ts +9 -0
- package/dist/components/ui/progress.js +44 -0
- package/dist/components/ui/questionnaire.d.ts +21 -0
- package/dist/components/ui/questionnaire.js +169 -0
- package/dist/components/ui/radio-group.d.ts +7 -0
- package/dist/components/ui/radio-group.js +26 -0
- package/dist/components/ui/resizable.d.ts +9 -0
- package/dist/components/ui/resizable.js +28 -0
- package/dist/components/ui/scroll-area.d.ts +6 -0
- package/dist/components/ui/scroll-area.js +35 -0
- package/dist/components/ui/select.d.ts +17 -0
- package/dist/components/ui/select.js +96 -0
- package/dist/components/ui/separator.d.ts +5 -0
- package/dist/components/ui/separator.js +14 -0
- package/dist/components/ui/sheet.d.ts +16 -0
- package/dist/components/ui/sheet.js +87 -0
- package/dist/components/ui/sidebar.d.ts +65 -0
- package/dist/components/ui/sidebar.js +386 -0
- package/dist/components/ui/skeleton.d.ts +4 -0
- package/dist/components/ui/skeleton.js +12 -0
- package/dist/components/ui/slider.d.ts +5 -0
- package/dist/components/ui/slider.js +33 -0
- package/dist/components/ui/spinner.d.ts +4 -0
- package/dist/components/ui/spinner.js +15 -0
- package/dist/components/ui/switch.d.ts +7 -0
- package/dist/components/ui/switch.js +19 -0
- package/dist/components/ui/table.d.ts +12 -0
- package/dist/components/ui/table.js +65 -0
- package/dist/components/ui/tabs.d.ts +12 -0
- package/dist/components/ui/tabs.js +45 -0
- package/dist/components/ui/textarea.d.ts +5 -0
- package/dist/components/ui/textarea.js +12 -0
- package/dist/components/ui/toast.d.ts +18 -0
- package/dist/components/ui/toast.js +121 -0
- package/dist/components/ui/toggle-group.d.ts +13 -0
- package/dist/components/ui/toggle-group.js +51 -0
- package/dist/components/ui/toggle.d.ts +10 -0
- package/dist/components/ui/toggle.js +35 -0
- package/dist/components/ui/tooltip.d.ts +8 -0
- package/dist/components/ui/tooltip.js +43 -0
- package/dist/compositions/app-rail/app-rail.d.ts +19 -0
- package/dist/compositions/app-rail/app-rail.js +58 -0
- package/dist/compositions/app-shell/app-shell.d.ts +56 -0
- package/dist/compositions/app-shell/app-shell.js +143 -0
- package/dist/compositions/app-shell/theme-toggle.d.ts +10 -0
- package/dist/compositions/app-shell/theme-toggle.js +65 -0
- package/dist/compositions/confirm-action/confirm-action.d.ts +48 -0
- package/dist/compositions/confirm-action/confirm-action.js +48 -0
- package/dist/compositions/data-table/data-table-state.d.ts +23 -0
- package/dist/compositions/data-table/data-table-state.js +46 -0
- package/dist/compositions/data-table/data-table.d.ts +185 -0
- package/dist/compositions/data-table/data-table.js +615 -0
- package/dist/compositions/date-range-picker/date-range-options.d.ts +28 -0
- package/dist/compositions/date-range-picker/date-range-options.js +61 -0
- package/dist/compositions/date-range-picker/date-range-picker.d.ts +55 -0
- package/dist/compositions/date-range-picker/date-range-picker.js +409 -0
- package/dist/compositions/decision-queue/decision-queue.d.ts +114 -0
- package/dist/compositions/decision-queue/decision-queue.js +478 -0
- package/dist/compositions/event-feed/event-feed.d.ts +59 -0
- package/dist/compositions/event-feed/event-feed.js +105 -0
- package/dist/compositions/feedback.d.ts +20 -0
- package/dist/compositions/feedback.js +49 -0
- package/dist/compositions/fields.d.ts +64 -0
- package/dist/compositions/fields.js +293 -0
- package/dist/compositions/form-kit/form-context.d.ts +10 -0
- package/dist/compositions/form-kit/form-context.js +12 -0
- package/dist/compositions/form-kit/form-fields.d.ts +95 -0
- package/dist/compositions/form-kit/form-fields.js +233 -0
- package/dist/compositions/form-kit/form-kit.d.ts +128 -0
- package/dist/compositions/form-kit/form-kit.js +119 -0
- package/dist/compositions/inspector/inspector.d.ts +53 -0
- package/dist/compositions/inspector/inspector.js +80 -0
- package/dist/compositions/layout.d.ts +36 -0
- package/dist/compositions/layout.js +86 -0
- package/dist/compositions/state-blocks/state-blocks.d.ts +42 -0
- package/dist/compositions/state-blocks/state-blocks.js +81 -0
- package/dist/compositions/status-panel/status-panel.d.ts +94 -0
- package/dist/compositions/status-panel/status-panel.js +189 -0
- package/dist/fonts/InterVariable.woff2 +0 -0
- package/dist/fonts/inter.css +15 -0
- package/dist/hooks/use-attachment-src.js +35 -0
- package/dist/hooks/use-copy-to-clipboard.js +34 -0
- package/dist/hooks/use-mobile.d.ts +3 -0
- package/dist/hooks/use-mobile.js +18 -0
- package/dist/index.d.ts +102 -0
- package/dist/index.js +102 -0
- package/dist/lib/context-level.js +7 -0
- package/dist/lib/elapsed.js +61 -0
- package/dist/lib/iso-date.js +30 -0
- package/dist/lib/motion-loop.js +41 -0
- package/dist/lib/pointer.js +14 -0
- package/dist/lib/status-tone.d.ts +7 -0
- package/dist/lib/status-tone.js +55 -0
- package/dist/lib/triage-keys.js +229 -0
- package/dist/lib/utils.js +2 -0
- package/dist/motion/alert-toast/alert-toast.d.ts +51 -0
- package/dist/motion/alert-toast/alert-toast.js +226 -0
- package/dist/motion/branch-menu/branch-menu.d.ts +47 -0
- package/dist/motion/branch-menu/branch-menu.js +287 -0
- package/dist/motion/check-item/check-item.d.ts +24 -0
- package/dist/motion/check-item/check-item.js +110 -0
- package/dist/motion/dial/dial.d.ts +39 -0
- package/dist/motion/dial/dial.js +290 -0
- package/dist/motion/dictation-button/dictation-button.d.ts +45 -0
- package/dist/motion/dictation-button/dictation-button.js +232 -0
- package/dist/motion/hold-button/hold-button.d.ts +37 -0
- package/dist/motion/hold-button/hold-button.js +192 -0
- package/dist/motion/masonry-grid/masonry-grid.d.ts +42 -0
- package/dist/motion/masonry-grid/masonry-grid.js +145 -0
- package/dist/motion/prompt-composer/prompt-composer.d.ts +90 -0
- package/dist/motion/prompt-composer/prompt-composer.js +374 -0
- package/dist/motion/scrub-select/scrub-select.d.ts +33 -0
- package/dist/motion/scrub-select/scrub-select.js +346 -0
- package/dist/motion/spotlight-grid/spotlight-grid.d.ts +40 -0
- package/dist/motion/spotlight-grid/spotlight-grid.js +171 -0
- package/dist/motion/star-rating/star-rating.d.ts +32 -0
- package/dist/motion/star-rating/star-rating.js +191 -0
- package/dist/motion/status-glyph/status-glyph.d.ts +28 -0
- package/dist/motion/status-glyph/status-glyph.js +171 -0
- package/dist/motion/stepper/stepper.d.ts +56 -0
- package/dist/motion/stepper/stepper.js +211 -0
- package/dist/motion/swipe-row/swipe-row.d.ts +52 -0
- package/dist/motion/swipe-row/swipe-row.js +208 -0
- package/dist/motion/thinking-trace/thinking-trace.d.ts +32 -0
- package/dist/motion/thinking-trace/thinking-trace.js +186 -0
- package/dist/motion/tool-call-chip/tool-call-chip.d.ts +36 -0
- package/dist/motion/tool-call-chip/tool-call-chip.js +135 -0
- package/dist/motion/working-indicator/working-indicator.d.ts +38 -0
- package/dist/motion/working-indicator/working-indicator.js +171 -0
- package/dist/styles.css +828 -0
- package/dist/tokens.css +230 -0
- package/licenses/Inter-OFL.txt +92 -0
- package/licenses/assistant-ui-MIT.txt +21 -0
- package/licenses/shadcn-MIT.md +21 -0
- package/package.json +133 -4
|
@@ -0,0 +1,400 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { __exportAll } from "../../../_virtual/_rolldown/runtime.js";
|
|
3
|
+
import { cn } from "../../../lib/utils.js";
|
|
4
|
+
import { memo, useCallback, useEffect, useRef, useState } from "react";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
//#region src/components/assistant-ui/elements/voice.tsx
|
|
7
|
+
var voice_exports = /* @__PURE__ */ __exportAll({ VoiceOrb: () => VoiceOrb });
|
|
8
|
+
const VARIANT_COLORS = {
|
|
9
|
+
default: [
|
|
10
|
+
[
|
|
11
|
+
.55,
|
|
12
|
+
.55,
|
|
13
|
+
.6
|
|
14
|
+
],
|
|
15
|
+
[
|
|
16
|
+
.7,
|
|
17
|
+
.7,
|
|
18
|
+
.75
|
|
19
|
+
],
|
|
20
|
+
[
|
|
21
|
+
.4,
|
|
22
|
+
.4,
|
|
23
|
+
.45
|
|
24
|
+
]
|
|
25
|
+
],
|
|
26
|
+
blue: [
|
|
27
|
+
[
|
|
28
|
+
.2,
|
|
29
|
+
.5,
|
|
30
|
+
1
|
|
31
|
+
],
|
|
32
|
+
[
|
|
33
|
+
.4,
|
|
34
|
+
.7,
|
|
35
|
+
1
|
|
36
|
+
],
|
|
37
|
+
[
|
|
38
|
+
.1,
|
|
39
|
+
.3,
|
|
40
|
+
.8
|
|
41
|
+
]
|
|
42
|
+
],
|
|
43
|
+
violet: [
|
|
44
|
+
[
|
|
45
|
+
.6,
|
|
46
|
+
.3,
|
|
47
|
+
1
|
|
48
|
+
],
|
|
49
|
+
[
|
|
50
|
+
.8,
|
|
51
|
+
.5,
|
|
52
|
+
1
|
|
53
|
+
],
|
|
54
|
+
[
|
|
55
|
+
.4,
|
|
56
|
+
.15,
|
|
57
|
+
.8
|
|
58
|
+
]
|
|
59
|
+
],
|
|
60
|
+
emerald: [
|
|
61
|
+
[
|
|
62
|
+
.15,
|
|
63
|
+
.75,
|
|
64
|
+
.55
|
|
65
|
+
],
|
|
66
|
+
[
|
|
67
|
+
.3,
|
|
68
|
+
.9,
|
|
69
|
+
.7
|
|
70
|
+
],
|
|
71
|
+
[
|
|
72
|
+
.1,
|
|
73
|
+
.55,
|
|
74
|
+
.4
|
|
75
|
+
]
|
|
76
|
+
]
|
|
77
|
+
};
|
|
78
|
+
const STATE_PARAMS = {
|
|
79
|
+
idle: {
|
|
80
|
+
speed: .15,
|
|
81
|
+
amplitude: .04,
|
|
82
|
+
glow: .15,
|
|
83
|
+
brightness: .55,
|
|
84
|
+
pulse: 0,
|
|
85
|
+
saturation: .7
|
|
86
|
+
},
|
|
87
|
+
connecting: {
|
|
88
|
+
speed: .5,
|
|
89
|
+
amplitude: .1,
|
|
90
|
+
glow: .45,
|
|
91
|
+
brightness: .75,
|
|
92
|
+
pulse: 1,
|
|
93
|
+
saturation: .9
|
|
94
|
+
},
|
|
95
|
+
listening: {
|
|
96
|
+
speed: .4,
|
|
97
|
+
amplitude: .14,
|
|
98
|
+
glow: .5,
|
|
99
|
+
brightness: .85,
|
|
100
|
+
pulse: 0,
|
|
101
|
+
saturation: 1
|
|
102
|
+
},
|
|
103
|
+
speaking: {
|
|
104
|
+
speed: 1.4,
|
|
105
|
+
amplitude: .35,
|
|
106
|
+
glow: .9,
|
|
107
|
+
brightness: 1,
|
|
108
|
+
pulse: 0,
|
|
109
|
+
saturation: 1
|
|
110
|
+
},
|
|
111
|
+
muted: {
|
|
112
|
+
speed: .06,
|
|
113
|
+
amplitude: .015,
|
|
114
|
+
glow: .08,
|
|
115
|
+
brightness: .35,
|
|
116
|
+
pulse: 0,
|
|
117
|
+
saturation: .2
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
const VERT_SRC = `#version 300 es
|
|
121
|
+
in vec2 a_position;
|
|
122
|
+
out vec2 v_uv;
|
|
123
|
+
void main() {
|
|
124
|
+
v_uv = a_position * 0.5 + 0.5;
|
|
125
|
+
gl_Position = vec4(a_position, 0.0, 1.0);
|
|
126
|
+
}`;
|
|
127
|
+
const FRAG_SRC = `#version 300 es
|
|
128
|
+
precision highp float;
|
|
129
|
+
|
|
130
|
+
in vec2 v_uv;
|
|
131
|
+
out vec4 fragColor;
|
|
132
|
+
|
|
133
|
+
uniform float u_time;
|
|
134
|
+
uniform float u_speed;
|
|
135
|
+
uniform float u_amplitude;
|
|
136
|
+
uniform float u_glow;
|
|
137
|
+
uniform float u_brightness;
|
|
138
|
+
uniform float u_pulse;
|
|
139
|
+
uniform float u_saturation;
|
|
140
|
+
uniform vec3 u_color0;
|
|
141
|
+
uniform vec3 u_color1;
|
|
142
|
+
uniform vec3 u_color2;
|
|
143
|
+
uniform float u_dpr;
|
|
144
|
+
|
|
145
|
+
// Simplex-like noise (3D)
|
|
146
|
+
vec3 mod289(vec3 x) { return x - floor(x / 289.0) * 289.0; }
|
|
147
|
+
vec4 mod289(vec4 x) { return x - floor(x / 289.0) * 289.0; }
|
|
148
|
+
vec4 permute(vec4 x) { return mod289((x * 34.0 + 1.0) * x); }
|
|
149
|
+
vec4 taylorInvSqrt(vec4 r) { return 1.79284291400159 - 0.85373472095314 * r; }
|
|
150
|
+
|
|
151
|
+
float snoise(vec3 v) {
|
|
152
|
+
const vec2 C = vec2(1.0 / 6.0, 1.0 / 3.0);
|
|
153
|
+
vec3 i = floor(v + dot(v, vec3(C.y)));
|
|
154
|
+
vec3 x0 = v - i + dot(i, vec3(C.x));
|
|
155
|
+
vec3 g = step(x0.yzx, x0.xyz);
|
|
156
|
+
vec3 l = 1.0 - g;
|
|
157
|
+
vec3 i1 = min(g, l.zxy);
|
|
158
|
+
vec3 i2 = max(g, l.zxy);
|
|
159
|
+
vec3 x1 = x0 - i1 + C.x;
|
|
160
|
+
vec3 x2 = x0 - i2 + C.y;
|
|
161
|
+
vec3 x3 = x0 - 0.5;
|
|
162
|
+
i = mod289(i);
|
|
163
|
+
vec4 p = permute(permute(permute(
|
|
164
|
+
i.z + vec4(0.0, i1.z, i2.z, 1.0))
|
|
165
|
+
+ i.y + vec4(0.0, i1.y, i2.y, 1.0))
|
|
166
|
+
+ i.x + vec4(0.0, i1.x, i2.x, 1.0));
|
|
167
|
+
vec4 j = p - 49.0 * floor(p / 49.0);
|
|
168
|
+
vec4 x_ = floor(j / 7.0);
|
|
169
|
+
vec4 y_ = floor(j - 7.0 * x_);
|
|
170
|
+
vec4 x = (x_ * 2.0 + 0.5) / 7.0 - 1.0;
|
|
171
|
+
vec4 y = (y_ * 2.0 + 0.5) / 7.0 - 1.0;
|
|
172
|
+
vec4 h = 1.0 - abs(x) - abs(y);
|
|
173
|
+
vec4 b0 = vec4(x.xy, y.xy);
|
|
174
|
+
vec4 b1 = vec4(x.zw, y.zw);
|
|
175
|
+
vec4 s0 = floor(b0) * 2.0 + 1.0;
|
|
176
|
+
vec4 s1 = floor(b1) * 2.0 + 1.0;
|
|
177
|
+
vec4 sh = -step(h, vec4(0.0));
|
|
178
|
+
vec4 a0 = b0.xzyw + s0.xzyw * sh.xxyy;
|
|
179
|
+
vec4 a1 = b1.xzyw + s1.xzyw * sh.zzww;
|
|
180
|
+
vec3 g0 = vec3(a0.xy, h.x);
|
|
181
|
+
vec3 g1 = vec3(a0.zw, h.y);
|
|
182
|
+
vec3 g2 = vec3(a1.xy, h.z);
|
|
183
|
+
vec3 g3 = vec3(a1.zw, h.w);
|
|
184
|
+
vec4 norm = taylorInvSqrt(vec4(dot(g0,g0), dot(g1,g1), dot(g2,g2), dot(g3,g3)));
|
|
185
|
+
g0 *= norm.x; g1 *= norm.y; g2 *= norm.z; g3 *= norm.w;
|
|
186
|
+
vec4 m = max(0.6 - vec4(dot(x0,x0), dot(x1,x1), dot(x2,x2), dot(x3,x3)), 0.0);
|
|
187
|
+
m = m * m;
|
|
188
|
+
return 42.0 * dot(m * m, vec4(dot(g0,x0), dot(g1,x1), dot(g2,x2), dot(g3,x3)));
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
void main() {
|
|
192
|
+
vec2 uv = v_uv * 2.0 - 1.0;
|
|
193
|
+
float dist = length(uv);
|
|
194
|
+
float t = u_time * u_speed;
|
|
195
|
+
|
|
196
|
+
// Perfect circle — hard boundary, soft anti-aliased edge
|
|
197
|
+
float radius = 0.44;
|
|
198
|
+
float circle = 1.0 - smoothstep(radius - 0.008, radius + 0.008, dist);
|
|
199
|
+
|
|
200
|
+
if (circle < 0.001) {
|
|
201
|
+
// Outer glow only
|
|
202
|
+
float glowDist = dist - radius;
|
|
203
|
+
float glow = exp(-glowDist * 12.0) * u_glow * 0.4;
|
|
204
|
+
vec3 glowColor = mix(u_color0, u_color1, 0.5);
|
|
205
|
+
fragColor = vec4(glowColor * glow, glow);
|
|
206
|
+
return;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
float n1 = snoise(vec3(uv * 2.0, t * 0.6)) * 0.5 + 0.5;
|
|
210
|
+
float n2 = snoise(vec3(uv * 3.5 + 7.0, t * 0.9)) * 0.5 + 0.5;
|
|
211
|
+
float n3 = snoise(vec3(uv * 1.5 - 3.0, t * 0.4 + 10.0)) * 0.5 + 0.5;
|
|
212
|
+
|
|
213
|
+
vec2 distort = vec2(
|
|
214
|
+
snoise(vec3(uv * 2.0 + 5.0, t * 0.7)),
|
|
215
|
+
snoise(vec3(uv * 2.0 + 15.0, t * 0.7))
|
|
216
|
+
) * u_amplitude * 2.0;
|
|
217
|
+
float n4 = snoise(vec3((uv + distort) * 3.0, t * 0.5)) * 0.5 + 0.5;
|
|
218
|
+
|
|
219
|
+
vec3 col = mix(u_color0, u_color1, n1);
|
|
220
|
+
col = mix(col, u_color2, n2 * 0.5);
|
|
221
|
+
col = mix(col, u_color1 * 1.3, n4 * 0.4);
|
|
222
|
+
|
|
223
|
+
float vein = pow(n3, 3.0) * u_amplitude * 6.0;
|
|
224
|
+
col += vein * mix(u_color1, vec3(1.0), 0.3);
|
|
225
|
+
|
|
226
|
+
float centerDist = dist / radius;
|
|
227
|
+
float depthShade = 1.0 - centerDist * centerDist * 0.4;
|
|
228
|
+
col *= depthShade;
|
|
229
|
+
|
|
230
|
+
float rim = pow(centerDist, 4.0) * 0.6;
|
|
231
|
+
col += rim * mix(u_color0, vec3(1.0), 0.5);
|
|
232
|
+
|
|
233
|
+
vec2 lightPos = vec2(-0.15, -0.18);
|
|
234
|
+
float specDist = length(uv - lightPos);
|
|
235
|
+
float spec = exp(-specDist * specDist * 30.0) * 0.7;
|
|
236
|
+
col += spec * vec3(1.0);
|
|
237
|
+
|
|
238
|
+
vec2 lightPos2 = vec2(0.2, 0.25);
|
|
239
|
+
float spec2 = exp(-length(uv - lightPos2) * 8.0) * 0.15;
|
|
240
|
+
col += spec2 * u_color1;
|
|
241
|
+
|
|
242
|
+
float pulseFactor = 1.0 + u_pulse * sin(u_time * 3.5) * 0.35;
|
|
243
|
+
|
|
244
|
+
float lum = dot(col, vec3(0.299, 0.587, 0.114));
|
|
245
|
+
col = mix(vec3(lum), col, u_saturation);
|
|
246
|
+
|
|
247
|
+
col *= u_brightness * pulseFactor;
|
|
248
|
+
|
|
249
|
+
fragColor = vec4(col, circle);
|
|
250
|
+
}`;
|
|
251
|
+
function createShader(gl, type, source) {
|
|
252
|
+
const shader = gl.createShader(type);
|
|
253
|
+
if (!shader) return null;
|
|
254
|
+
gl.shaderSource(shader, source);
|
|
255
|
+
gl.compileShader(shader);
|
|
256
|
+
if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
|
|
257
|
+
gl.deleteShader(shader);
|
|
258
|
+
return null;
|
|
259
|
+
}
|
|
260
|
+
return shader;
|
|
261
|
+
}
|
|
262
|
+
function initWebGL(canvas) {
|
|
263
|
+
const gl = canvas.getContext("webgl2", {
|
|
264
|
+
alpha: true,
|
|
265
|
+
premultipliedAlpha: false,
|
|
266
|
+
antialias: true
|
|
267
|
+
});
|
|
268
|
+
if (!gl) return null;
|
|
269
|
+
const vs = createShader(gl, gl.VERTEX_SHADER, VERT_SRC);
|
|
270
|
+
const fs = createShader(gl, gl.FRAGMENT_SHADER, FRAG_SRC);
|
|
271
|
+
if (!vs || !fs) return null;
|
|
272
|
+
const program = gl.createProgram();
|
|
273
|
+
gl.attachShader(program, vs);
|
|
274
|
+
gl.attachShader(program, fs);
|
|
275
|
+
gl.linkProgram(program);
|
|
276
|
+
if (!gl.getProgramParameter(program, gl.LINK_STATUS)) return null;
|
|
277
|
+
gl.useProgram(program);
|
|
278
|
+
const buf = gl.createBuffer();
|
|
279
|
+
gl.bindBuffer(gl.ARRAY_BUFFER, buf);
|
|
280
|
+
gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([
|
|
281
|
+
-1,
|
|
282
|
+
-1,
|
|
283
|
+
1,
|
|
284
|
+
-1,
|
|
285
|
+
-1,
|
|
286
|
+
1,
|
|
287
|
+
1,
|
|
288
|
+
1
|
|
289
|
+
]), gl.STATIC_DRAW);
|
|
290
|
+
const loc = gl.getAttribLocation(program, "a_position");
|
|
291
|
+
gl.enableVertexAttribArray(loc);
|
|
292
|
+
gl.vertexAttribPointer(loc, 2, gl.FLOAT, false, 0, 0);
|
|
293
|
+
gl.enable(gl.BLEND);
|
|
294
|
+
gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA);
|
|
295
|
+
return {
|
|
296
|
+
gl,
|
|
297
|
+
uniforms: {
|
|
298
|
+
u_time: gl.getUniformLocation(program, "u_time"),
|
|
299
|
+
u_speed: gl.getUniformLocation(program, "u_speed"),
|
|
300
|
+
u_amplitude: gl.getUniformLocation(program, "u_amplitude"),
|
|
301
|
+
u_glow: gl.getUniformLocation(program, "u_glow"),
|
|
302
|
+
u_brightness: gl.getUniformLocation(program, "u_brightness"),
|
|
303
|
+
u_pulse: gl.getUniformLocation(program, "u_pulse"),
|
|
304
|
+
u_saturation: gl.getUniformLocation(program, "u_saturation"),
|
|
305
|
+
u_color0: gl.getUniformLocation(program, "u_color0"),
|
|
306
|
+
u_color1: gl.getUniformLocation(program, "u_color1"),
|
|
307
|
+
u_color2: gl.getUniformLocation(program, "u_color2"),
|
|
308
|
+
u_dpr: gl.getUniformLocation(program, "u_dpr")
|
|
309
|
+
}
|
|
310
|
+
};
|
|
311
|
+
}
|
|
312
|
+
function lerp(a, b, t) {
|
|
313
|
+
return a + (b - a) * t;
|
|
314
|
+
}
|
|
315
|
+
const VoiceOrb = memo(({ state = "idle", volume = 0, variant = "default", className }) => {
|
|
316
|
+
const volumeRef = useRef(0);
|
|
317
|
+
volumeRef.current = volume;
|
|
318
|
+
const canvasRef = useRef(null);
|
|
319
|
+
const glRef = useRef(null);
|
|
320
|
+
const animRef = useRef(0);
|
|
321
|
+
const startTime = useRef(performance.now());
|
|
322
|
+
const currentParams = useRef({ ...STATE_PARAMS.idle });
|
|
323
|
+
const targetParams = useRef({ ...STATE_PARAMS.idle });
|
|
324
|
+
useEffect(() => {
|
|
325
|
+
targetParams.current = { ...STATE_PARAMS[state] };
|
|
326
|
+
}, [state]);
|
|
327
|
+
const colors = VARIANT_COLORS[variant];
|
|
328
|
+
const [ready, setReady] = useState(false);
|
|
329
|
+
useEffect(() => {
|
|
330
|
+
const id = requestAnimationFrame(() => setReady(true));
|
|
331
|
+
return () => {
|
|
332
|
+
cancelAnimationFrame(id);
|
|
333
|
+
setReady(false);
|
|
334
|
+
};
|
|
335
|
+
}, []);
|
|
336
|
+
const render = useCallback(() => {
|
|
337
|
+
const ctx = glRef.current;
|
|
338
|
+
if (!ctx) return;
|
|
339
|
+
const { gl, uniforms } = ctx;
|
|
340
|
+
const canvas = canvasRef.current;
|
|
341
|
+
if (!canvas) return;
|
|
342
|
+
const p = currentParams.current;
|
|
343
|
+
const tp = targetParams.current;
|
|
344
|
+
const s = .045;
|
|
345
|
+
p.speed = lerp(p.speed, tp.speed, s);
|
|
346
|
+
p.amplitude = lerp(p.amplitude, tp.amplitude, s);
|
|
347
|
+
p.glow = lerp(p.glow, tp.glow, s);
|
|
348
|
+
p.brightness = lerp(p.brightness, tp.brightness, s);
|
|
349
|
+
p.pulse = lerp(p.pulse, tp.pulse, s);
|
|
350
|
+
p.saturation = lerp(p.saturation, tp.saturation, s);
|
|
351
|
+
const elapsed = (performance.now() - startTime.current) / 1e3;
|
|
352
|
+
const dpr = window.devicePixelRatio || 1;
|
|
353
|
+
const rect = canvas.getBoundingClientRect();
|
|
354
|
+
const w = Math.round(rect.width * dpr);
|
|
355
|
+
const h = Math.round(rect.height * dpr);
|
|
356
|
+
if (canvas.width !== w || canvas.height !== h) {
|
|
357
|
+
canvas.width = w;
|
|
358
|
+
canvas.height = h;
|
|
359
|
+
}
|
|
360
|
+
gl.viewport(0, 0, w, h);
|
|
361
|
+
gl.clearColor(0, 0, 0, 0);
|
|
362
|
+
gl.clear(gl.COLOR_BUFFER_BIT);
|
|
363
|
+
const vol = volumeRef.current;
|
|
364
|
+
gl.uniform1f(uniforms.u_time, elapsed);
|
|
365
|
+
gl.uniform1f(uniforms.u_speed, p.speed + vol * .4);
|
|
366
|
+
gl.uniform1f(uniforms.u_amplitude, p.amplitude + vol * .12);
|
|
367
|
+
gl.uniform1f(uniforms.u_glow, p.glow + vol * .2);
|
|
368
|
+
gl.uniform1f(uniforms.u_brightness, p.brightness);
|
|
369
|
+
gl.uniform1f(uniforms.u_pulse, p.pulse);
|
|
370
|
+
gl.uniform1f(uniforms.u_saturation, p.saturation);
|
|
371
|
+
gl.uniform3fv(uniforms.u_color0, colors[0]);
|
|
372
|
+
gl.uniform3fv(uniforms.u_color1, colors[1]);
|
|
373
|
+
gl.uniform3fv(uniforms.u_color2, colors[2]);
|
|
374
|
+
gl.uniform1f(uniforms.u_dpr, dpr);
|
|
375
|
+
gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4);
|
|
376
|
+
animRef.current = requestAnimationFrame(render);
|
|
377
|
+
}, [colors]);
|
|
378
|
+
useEffect(() => {
|
|
379
|
+
if (!ready) return;
|
|
380
|
+
const canvas = canvasRef.current;
|
|
381
|
+
if (!canvas) return;
|
|
382
|
+
glRef.current = initWebGL(canvas);
|
|
383
|
+
if (!glRef.current) return;
|
|
384
|
+
animRef.current = requestAnimationFrame(render);
|
|
385
|
+
return () => {
|
|
386
|
+
cancelAnimationFrame(animRef.current);
|
|
387
|
+
const ctx = glRef.current;
|
|
388
|
+
if (ctx) ctx.gl.getExtension("WEBGL_lose_context")?.loseContext();
|
|
389
|
+
glRef.current = null;
|
|
390
|
+
};
|
|
391
|
+
}, [ready, render]);
|
|
392
|
+
return /* @__PURE__ */ jsx("canvas", {
|
|
393
|
+
ref: canvasRef,
|
|
394
|
+
className: cn("aui-voice-orb size-16 shrink-0", className),
|
|
395
|
+
"data-state": state
|
|
396
|
+
});
|
|
397
|
+
});
|
|
398
|
+
VoiceOrb.displayName = "VoiceOrb";
|
|
399
|
+
//#endregion
|
|
400
|
+
export { VoiceOrb, voice_exports };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ComponentProps } from "react";
|
|
2
|
+
declare namespace web_preview_d_exports {
|
|
3
|
+
export { WebPreview };
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Chrome around a preview: a URL bar, reload, and open-in-new. It renders
|
|
7
|
+
* `children` as given and enforces no isolation of its own, so the caller is
|
|
8
|
+
* responsible for passing an already-sandboxed frame.
|
|
9
|
+
*/
|
|
10
|
+
export declare function WebPreview({ origin, loading, children, onReload, onOpenExternal, className, ...props }: Omit<ComponentProps<"div">, "origin" | "loading" | "children" | "onReload" | "onOpenExternal"> & {
|
|
11
|
+
origin: string;
|
|
12
|
+
loading: boolean;
|
|
13
|
+
children: React.ReactNode;
|
|
14
|
+
onReload?: () => void;
|
|
15
|
+
onOpenExternal?: () => void;
|
|
16
|
+
}): import("react").JSX.Element;
|
|
17
|
+
//#endregion
|
|
18
|
+
export { web_preview_d_exports };
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { __exportAll } from "../../../_virtual/_rolldown/runtime.js";
|
|
3
|
+
import { cn } from "../../../lib/utils.js";
|
|
4
|
+
import { ShimmerLabel, field, ghostButton, mono, paper } from "./surfaces.js";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { ExternalLinkIcon, RotateCwIcon } from "lucide-react";
|
|
7
|
+
//#region src/components/assistant-ui/elements/web-preview.tsx
|
|
8
|
+
var web_preview_exports = /* @__PURE__ */ __exportAll({ WebPreview: () => WebPreview });
|
|
9
|
+
/**
|
|
10
|
+
* Chrome around a preview: a URL bar, reload, and open-in-new. It renders
|
|
11
|
+
* `children` as given and enforces no isolation of its own, so the caller is
|
|
12
|
+
* responsible for passing an already-sandboxed frame.
|
|
13
|
+
*/
|
|
14
|
+
function WebPreview({ origin, loading, children, onReload, onOpenExternal, className, ...props }) {
|
|
15
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
16
|
+
"data-slot": "web-preview",
|
|
17
|
+
className: cn(paper, "flex w-full max-w-md flex-col overflow-hidden rounded-2xl", className),
|
|
18
|
+
...props,
|
|
19
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
20
|
+
className: "flex items-center gap-1.5 px-2.5 py-2",
|
|
21
|
+
children: [
|
|
22
|
+
/* @__PURE__ */ jsx("button", {
|
|
23
|
+
type: "button",
|
|
24
|
+
"aria-label": "Reload the preview",
|
|
25
|
+
onClick: onReload,
|
|
26
|
+
className: cn(ghostButton, "size-7 shrink-0"),
|
|
27
|
+
children: /* @__PURE__ */ jsx(RotateCwIcon, { className: cn("size-3.5", loading && "animate-spin motion-reduce:animate-none") })
|
|
28
|
+
}),
|
|
29
|
+
/* @__PURE__ */ jsx("span", {
|
|
30
|
+
className: cn(field, "flex min-w-0 flex-1 items-center gap-1.5 rounded-full px-2.5 py-1"),
|
|
31
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
32
|
+
className: cn(mono, "text-muted-foreground min-w-0 truncate"),
|
|
33
|
+
children: origin
|
|
34
|
+
})
|
|
35
|
+
}),
|
|
36
|
+
/* @__PURE__ */ jsx("button", {
|
|
37
|
+
type: "button",
|
|
38
|
+
"aria-label": "Open the preview in a new tab",
|
|
39
|
+
onClick: onOpenExternal,
|
|
40
|
+
className: cn(ghostButton, "size-7 shrink-0"),
|
|
41
|
+
children: /* @__PURE__ */ jsx(ExternalLinkIcon, { className: "size-3.5" })
|
|
42
|
+
})
|
|
43
|
+
]
|
|
44
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
45
|
+
className: "border-foreground/[0.07] relative min-h-[9rem] border-t",
|
|
46
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
47
|
+
"aria-hidden": loading,
|
|
48
|
+
className: cn("transition-opacity duration-300 motion-reduce:transition-none", loading && "invisible opacity-0"),
|
|
49
|
+
children
|
|
50
|
+
}), loading && /* @__PURE__ */ jsx("div", {
|
|
51
|
+
className: "absolute inset-0 flex items-center justify-center",
|
|
52
|
+
children: /* @__PURE__ */ jsx(ShimmerLabel, {
|
|
53
|
+
className: "text-muted-foreground relative inline-block text-xs leading-none",
|
|
54
|
+
children: "Loading preview"
|
|
55
|
+
})
|
|
56
|
+
})]
|
|
57
|
+
})]
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
//#endregion
|
|
61
|
+
export { WebPreview, web_preview_exports };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ComponentProps } from "react";
|
|
2
|
+
declare namespace web_search_d_exports {
|
|
3
|
+
export { WebSearch, WebSearchResult };
|
|
4
|
+
}
|
|
5
|
+
export interface WebSearchResult {
|
|
6
|
+
title: string;
|
|
7
|
+
domain: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function WebSearch({ query, results, visibleResults, searching, cycle, className, ...props }: Omit<ComponentProps<"div">, "children" | "query" | "results" | "visibleResults" | "searching" | "cycle"> & {
|
|
10
|
+
query: string;
|
|
11
|
+
results: readonly WebSearchResult[];
|
|
12
|
+
visibleResults: number;
|
|
13
|
+
searching: boolean;
|
|
14
|
+
cycle: number;
|
|
15
|
+
}): import("react").JSX.Element;
|
|
16
|
+
//#endregion
|
|
17
|
+
export { web_search_d_exports };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { __exportAll } from "../../../_virtual/_rolldown/runtime.js";
|
|
3
|
+
import { cn } from "../../../lib/utils.js";
|
|
4
|
+
import { ShimmerLabel, field, mono } from "./surfaces.js";
|
|
5
|
+
import { take } from "../utils/range.js";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { SearchIcon } from "lucide-react";
|
|
8
|
+
//#region src/components/assistant-ui/elements/web-search.tsx
|
|
9
|
+
var web_search_exports = /* @__PURE__ */ __exportAll({ WebSearch: () => WebSearch });
|
|
10
|
+
function WebSearch({ query, results, visibleResults, searching, cycle, className, ...props }) {
|
|
11
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
12
|
+
"data-slot": "web-search",
|
|
13
|
+
className: cn("flex w-full max-w-sm flex-col gap-2.5", className),
|
|
14
|
+
...props,
|
|
15
|
+
children: [
|
|
16
|
+
/* @__PURE__ */ jsxs("span", {
|
|
17
|
+
className: cn(field, "text-muted-foreground inline-flex w-fit items-center gap-1.5 rounded-full px-3.5 py-2 text-xs"),
|
|
18
|
+
children: [/* @__PURE__ */ jsx(SearchIcon, { className: "text-muted-foreground size-3" }), query]
|
|
19
|
+
}),
|
|
20
|
+
/* @__PURE__ */ jsx("div", {
|
|
21
|
+
className: "text-muted-foreground text-xs",
|
|
22
|
+
children: searching ? /* @__PURE__ */ jsx(ShimmerLabel, {
|
|
23
|
+
className: "relative inline-block leading-none",
|
|
24
|
+
children: "Searching"
|
|
25
|
+
}) : /* @__PURE__ */ jsx("span", {
|
|
26
|
+
className: "fade-in animate-in duration-300",
|
|
27
|
+
children: "Read 3 sources"
|
|
28
|
+
})
|
|
29
|
+
}),
|
|
30
|
+
/* @__PURE__ */ jsx("div", {
|
|
31
|
+
className: "flex min-h-[5.75rem] flex-col",
|
|
32
|
+
children: take(results, visibleResults).map((result) => /* @__PURE__ */ jsxs("div", {
|
|
33
|
+
className: "fade-in slide-in-from-bottom-1 animate-in fill-mode-both hover:bg-foreground/[0.03] -mx-2.5 flex items-center gap-2.5 rounded-xl px-2.5 py-1.5 transition-colors duration-300",
|
|
34
|
+
children: [
|
|
35
|
+
/* @__PURE__ */ jsx("span", {
|
|
36
|
+
className: "bg-foreground/[0.06] text-muted-foreground flex size-4 shrink-0 items-center justify-center rounded text-[9px] font-medium",
|
|
37
|
+
children: result.domain.charAt(0).toUpperCase()
|
|
38
|
+
}),
|
|
39
|
+
/* @__PURE__ */ jsx("span", {
|
|
40
|
+
className: "text-foreground/90 min-w-0 flex-1 truncate text-[13.5px]",
|
|
41
|
+
children: result.title
|
|
42
|
+
}),
|
|
43
|
+
/* @__PURE__ */ jsx("span", {
|
|
44
|
+
className: cn(mono, "text-muted-foreground shrink-0"),
|
|
45
|
+
children: result.domain
|
|
46
|
+
})
|
|
47
|
+
]
|
|
48
|
+
}, `${cycle}-${result.domain}`))
|
|
49
|
+
})
|
|
50
|
+
]
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
//#endregion
|
|
54
|
+
export { WebSearch, web_search_exports };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
declare namespace href_d_exports {
|
|
2
|
+
export { hostOf, safeHref };
|
|
3
|
+
}
|
|
4
|
+
/**
|
|
5
|
+
* `url` when a browser following it runs no script: an `http:`, `https:`, or
|
|
6
|
+
* `mailto:` URL, or one relative to the page. Anything else, including a
|
|
7
|
+
* string that is not a URL at all, is `undefined`.
|
|
8
|
+
*/
|
|
9
|
+
export declare function safeHref(url: string | undefined): string | undefined;
|
|
10
|
+
/** The host `url` points at, without a leading `www.`, or `undefined`. */
|
|
11
|
+
export declare function hostOf(url: string | undefined): string | undefined;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { href_d_exports };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { __exportAll } from "../../../_virtual/_rolldown/runtime.js";
|
|
2
|
+
//#region src/components/assistant-ui/utils/href.ts
|
|
3
|
+
var href_exports = /* @__PURE__ */ __exportAll({
|
|
4
|
+
hostOf: () => hostOf,
|
|
5
|
+
safeHref: () => safeHref
|
|
6
|
+
});
|
|
7
|
+
const RELATIVE = /^(?:[/?#]|\.{1,2}\/)/;
|
|
8
|
+
const ALLOWED_PROTOCOLS = /* @__PURE__ */ new Set([
|
|
9
|
+
"http:",
|
|
10
|
+
"https:",
|
|
11
|
+
"mailto:"
|
|
12
|
+
]);
|
|
13
|
+
const parse = (url) => {
|
|
14
|
+
try {
|
|
15
|
+
return new URL(url);
|
|
16
|
+
} catch {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* `url` when a browser following it runs no script: an `http:`, `https:`, or
|
|
22
|
+
* `mailto:` URL, or one relative to the page. Anything else, including a
|
|
23
|
+
* string that is not a URL at all, is `undefined`.
|
|
24
|
+
*/
|
|
25
|
+
function safeHref(url) {
|
|
26
|
+
if (typeof url !== "string") return void 0;
|
|
27
|
+
const trimmed = url.trim();
|
|
28
|
+
if (trimmed === "") return void 0;
|
|
29
|
+
const parsed = parse(trimmed);
|
|
30
|
+
if (parsed) return ALLOWED_PROTOCOLS.has(parsed.protocol) ? trimmed : void 0;
|
|
31
|
+
return RELATIVE.test(trimmed) ? trimmed : void 0;
|
|
32
|
+
}
|
|
33
|
+
/** The host `url` points at, without a leading `www.`, or `undefined`. */
|
|
34
|
+
function hostOf(url) {
|
|
35
|
+
const href = safeHref(url);
|
|
36
|
+
return (href === void 0 ? "" : parse(href)?.hostname ?? "").replace(/^www\./, "") || void 0;
|
|
37
|
+
}
|
|
38
|
+
//#endregion
|
|
39
|
+
export { hostOf, href_exports, safeHref };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
declare namespace range_d_exports {
|
|
2
|
+
export { announced, at, clamp, indexIn, pct, progressOf, take };
|
|
3
|
+
}
|
|
4
|
+
export declare function clamp(value: number, min: number, max: number): number;
|
|
5
|
+
/** The first `count` items, for a `count` that may be out of range. */
|
|
6
|
+
export declare function take<T>(items: readonly T[], count: number): T[];
|
|
7
|
+
/** The position `index` names in `items`, for an `index` out of range. */
|
|
8
|
+
export declare function indexIn<T>(items: readonly T[], index: number): number;
|
|
9
|
+
/** The item at `index`, for an `index` that may be out of range. */
|
|
10
|
+
export declare function at<T>(items: readonly T[], index: number): T | undefined;
|
|
11
|
+
/** `value` as a share of `total`, as a percentage in `0…100`. */
|
|
12
|
+
export declare function pct(value: number, total: number): number;
|
|
13
|
+
/**
|
|
14
|
+
* A `0…100` share as it should be announced. `pct` divides, so a share that
|
|
15
|
+
* reads as a whole number on screen can still reach `aria-valuenow` carrying
|
|
16
|
+
* float error, which a screen reader reads out in full.
|
|
17
|
+
*/
|
|
18
|
+
export declare function announced(share: number): number;
|
|
19
|
+
/** A count of completed items out of `total`, in `0…total`. */
|
|
20
|
+
export declare function progressOf(index: number, total: number): number;
|
|
21
|
+
//#endregion
|
|
22
|
+
export { range_d_exports };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { __exportAll } from "../../../_virtual/_rolldown/runtime.js";
|
|
2
|
+
//#region src/components/assistant-ui/utils/range.ts
|
|
3
|
+
var range_exports = /* @__PURE__ */ __exportAll({
|
|
4
|
+
announced: () => announced,
|
|
5
|
+
at: () => at,
|
|
6
|
+
clamp: () => clamp,
|
|
7
|
+
indexIn: () => indexIn,
|
|
8
|
+
pct: () => pct,
|
|
9
|
+
progressOf: () => progressOf,
|
|
10
|
+
take: () => take
|
|
11
|
+
});
|
|
12
|
+
function clamp(value, min, max) {
|
|
13
|
+
if (Number.isNaN(value)) return min;
|
|
14
|
+
return Math.min(max, Math.max(min, value));
|
|
15
|
+
}
|
|
16
|
+
/** The first `count` items, for a `count` that may be out of range. */
|
|
17
|
+
function take(items, count) {
|
|
18
|
+
return items.slice(0, Math.floor(clamp(count, 0, items.length)));
|
|
19
|
+
}
|
|
20
|
+
/** The position `index` names in `items`, for an `index` out of range. */
|
|
21
|
+
function indexIn(items, index) {
|
|
22
|
+
return Math.floor(clamp(index, 0, Math.max(0, items.length - 1)));
|
|
23
|
+
}
|
|
24
|
+
/** The item at `index`, for an `index` that may be out of range. */
|
|
25
|
+
function at(items, index) {
|
|
26
|
+
if (items.length === 0) return void 0;
|
|
27
|
+
return items[indexIn(items, index)];
|
|
28
|
+
}
|
|
29
|
+
/** `value` as a share of `total`, as a percentage in `0…100`. */
|
|
30
|
+
function pct(value, total) {
|
|
31
|
+
if (!(total > 0)) return 0;
|
|
32
|
+
return clamp(value / total * 100, 0, 100);
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* A `0…100` share as it should be announced. `pct` divides, so a share that
|
|
36
|
+
* reads as a whole number on screen can still reach `aria-valuenow` carrying
|
|
37
|
+
* float error, which a screen reader reads out in full.
|
|
38
|
+
*/
|
|
39
|
+
function announced(share) {
|
|
40
|
+
return Math.round(share * 10) / 10;
|
|
41
|
+
}
|
|
42
|
+
/** A count of completed items out of `total`, in `0…total`. */
|
|
43
|
+
function progressOf(index, total) {
|
|
44
|
+
if (!(total > 0)) return 0;
|
|
45
|
+
return Math.floor(clamp(index, 0, total));
|
|
46
|
+
}
|
|
47
|
+
//#endregion
|
|
48
|
+
export { announced, at, clamp, indexIn, pct, progressOf, range_exports, take };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ToolCallMessagePart, ToolCallMessagePartStatus } from "@assistant-ui/react";
|
|
2
|
+
declare namespace task_d_exports {
|
|
3
|
+
export { TASK_PAGE_SIZE, TaskTiming, TaskViewState, formatElapsed, taskLabel, taskMeta, taskStateOf, useTaskElapsed };
|
|
4
|
+
}
|
|
5
|
+
export type TaskViewState = "working" | "waiting" | "done" | "failed" | "cancelled";
|
|
6
|
+
export type TaskTiming = NonNullable<ToolCallMessagePart["timing"]>;
|
|
7
|
+
export declare const TASK_PAGE_SIZE = 4;
|
|
8
|
+
export declare function taskStateOf(status: ToolCallMessagePartStatus, isError?: boolean): TaskViewState;
|
|
9
|
+
export declare function taskLabel(toolName: string, args: unknown): string;
|
|
10
|
+
export declare function taskMeta(args: unknown): string | undefined;
|
|
11
|
+
export declare function formatElapsed(ms: number): string;
|
|
12
|
+
export declare function useTaskElapsed(timing: TaskTiming | undefined, running: boolean): number | undefined;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { task_d_exports };
|