@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,152 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { __exportAll } from "../../../_virtual/_rolldown/runtime.js";
|
|
3
|
+
import { cn } from "../../../lib/utils.js";
|
|
4
|
+
import { TooltipIconButton } from "./tooltip-icon-button.js";
|
|
5
|
+
import { useCopyToClipboard } from "../../../hooks/use-copy-to-clipboard.js";
|
|
6
|
+
import { memo, useMemo, useRef } from "react";
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
import { CheckIcon, CopyIcon } from "lucide-react";
|
|
9
|
+
import { MarkdownTextPrimitive, unstable_memoizeMarkdownComponents, useIsMarkdownCodeBlock } from "@assistant-ui/react-markdown";
|
|
10
|
+
import remarkGfm from "remark-gfm";
|
|
11
|
+
//#region src/components/assistant-ui/elements/markdown-text.tsx
|
|
12
|
+
var markdown_text_exports = /* @__PURE__ */ __exportAll({ MarkdownText: () => MarkdownText });
|
|
13
|
+
const useShallowStable = (value) => {
|
|
14
|
+
const ref = useRef(value);
|
|
15
|
+
if (value !== ref.current) {
|
|
16
|
+
const prev = ref.current;
|
|
17
|
+
if (!(value !== void 0 && prev !== void 0 && Object.keys(prev).length === Object.keys(value).length && Object.keys(value).every((key) => prev[key] === value[key]))) ref.current = value;
|
|
18
|
+
}
|
|
19
|
+
return ref.current;
|
|
20
|
+
};
|
|
21
|
+
const MarkdownTextImpl = ({ components }) => {
|
|
22
|
+
const stableComponents = useShallowStable(components);
|
|
23
|
+
const markdownComponents = useMemo(() => {
|
|
24
|
+
if (!stableComponents) return defaultComponents;
|
|
25
|
+
return {
|
|
26
|
+
...defaultComponents,
|
|
27
|
+
...unstable_memoizeMarkdownComponents(stableComponents)
|
|
28
|
+
};
|
|
29
|
+
}, [stableComponents]);
|
|
30
|
+
return /* @__PURE__ */ jsx(MarkdownTextPrimitive, {
|
|
31
|
+
remarkPlugins: [remarkGfm],
|
|
32
|
+
className: "aui-md",
|
|
33
|
+
components: markdownComponents,
|
|
34
|
+
defer: true
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
const MarkdownText = memo(MarkdownTextImpl);
|
|
38
|
+
const CodeHeader = ({ language, code }) => {
|
|
39
|
+
const { isCopied, copyToClipboard } = useCopyToClipboard();
|
|
40
|
+
const onCopy = () => {
|
|
41
|
+
if (!code || isCopied) return;
|
|
42
|
+
copyToClipboard(code);
|
|
43
|
+
};
|
|
44
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
45
|
+
className: "aui-code-header-root border-border/50 bg-muted/50 mt-3 flex items-center justify-between rounded-t-xl border border-b-0 px-3.5 py-1.5 text-xs",
|
|
46
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
47
|
+
className: "aui-code-header-language text-muted-foreground font-medium lowercase",
|
|
48
|
+
children: language
|
|
49
|
+
}), /* @__PURE__ */ jsxs(TooltipIconButton, {
|
|
50
|
+
tooltip: "Copy",
|
|
51
|
+
onClick: onCopy,
|
|
52
|
+
children: [!isCopied && /* @__PURE__ */ jsx(CopyIcon, { className: "animate-in zoom-in-75 fade-in duration-150" }), isCopied && /* @__PURE__ */ jsx(CheckIcon, { className: "animate-in zoom-in-50 fade-in duration-200 ease-out" })]
|
|
53
|
+
})]
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
const defaultComponents = unstable_memoizeMarkdownComponents({
|
|
57
|
+
h1: ({ className, ...props }) => /* @__PURE__ */ jsx("h1", {
|
|
58
|
+
className: cn("aui-md-h1 mt-5 mb-2 scroll-m-20 text-xl font-semibold first:mt-0 last:mb-0", className),
|
|
59
|
+
...props
|
|
60
|
+
}),
|
|
61
|
+
h2: ({ className, ...props }) => /* @__PURE__ */ jsx("h2", {
|
|
62
|
+
className: cn("aui-md-h2 mt-5 mb-2 scroll-m-20 text-lg font-semibold first:mt-0 last:mb-0", className),
|
|
63
|
+
...props
|
|
64
|
+
}),
|
|
65
|
+
h3: ({ className, ...props }) => /* @__PURE__ */ jsx("h3", {
|
|
66
|
+
className: cn("aui-md-h3 mt-4 mb-1.5 scroll-m-20 text-base font-semibold first:mt-0 last:mb-0", className),
|
|
67
|
+
...props
|
|
68
|
+
}),
|
|
69
|
+
h4: ({ className, ...props }) => /* @__PURE__ */ jsx("h4", {
|
|
70
|
+
className: cn("aui-md-h4 mt-3.5 mb-1 scroll-m-20 text-base font-medium first:mt-0 last:mb-0", className),
|
|
71
|
+
...props
|
|
72
|
+
}),
|
|
73
|
+
h5: ({ className, ...props }) => /* @__PURE__ */ jsx("h5", {
|
|
74
|
+
className: cn("aui-md-h5 mt-3 mb-1 text-sm font-semibold first:mt-0 last:mb-0", className),
|
|
75
|
+
...props
|
|
76
|
+
}),
|
|
77
|
+
h6: ({ className, ...props }) => /* @__PURE__ */ jsx("h6", {
|
|
78
|
+
className: cn("aui-md-h6 mt-3 mb-1 text-sm font-medium first:mt-0 last:mb-0", className),
|
|
79
|
+
...props
|
|
80
|
+
}),
|
|
81
|
+
p: ({ className, ...props }) => /* @__PURE__ */ jsx("p", {
|
|
82
|
+
className: cn("aui-md-p my-3 leading-relaxed first:mt-0 last:mb-0", className),
|
|
83
|
+
...props
|
|
84
|
+
}),
|
|
85
|
+
a: ({ className, ...props }) => /* @__PURE__ */ jsx("a", {
|
|
86
|
+
className: cn("aui-md-a text-primary hover:text-primary/80 underline underline-offset-2", className),
|
|
87
|
+
...props,
|
|
88
|
+
rel: "noopener noreferrer"
|
|
89
|
+
}),
|
|
90
|
+
blockquote: ({ className, ...props }) => /* @__PURE__ */ jsx("blockquote", {
|
|
91
|
+
className: cn("aui-md-blockquote border-muted-foreground/30 text-muted-foreground my-3 border-s-2 ps-4", className),
|
|
92
|
+
...props
|
|
93
|
+
}),
|
|
94
|
+
ul: ({ className, ...props }) => /* @__PURE__ */ jsx("ul", {
|
|
95
|
+
className: cn("aui-md-ul marker:text-muted-foreground my-3 ms-5 list-disc [&>li]:mt-1", className),
|
|
96
|
+
...props
|
|
97
|
+
}),
|
|
98
|
+
ol: ({ className, ...props }) => /* @__PURE__ */ jsx("ol", {
|
|
99
|
+
className: cn("aui-md-ol marker:text-muted-foreground my-3 ms-5 list-decimal [&>li]:mt-1", className),
|
|
100
|
+
...props
|
|
101
|
+
}),
|
|
102
|
+
hr: ({ className, ...props }) => /* @__PURE__ */ jsx("hr", {
|
|
103
|
+
className: cn("aui-md-hr border-muted-foreground/20 my-3", className),
|
|
104
|
+
...props
|
|
105
|
+
}),
|
|
106
|
+
table: ({ className, ...props }) => /* @__PURE__ */ jsx("div", {
|
|
107
|
+
className: "aui-md-table-wrapper my-3 overflow-x-auto",
|
|
108
|
+
children: /* @__PURE__ */ jsx("table", {
|
|
109
|
+
className: cn("aui-md-table w-full border-separate border-spacing-0", className),
|
|
110
|
+
...props
|
|
111
|
+
})
|
|
112
|
+
}),
|
|
113
|
+
th: ({ className, ...props }) => /* @__PURE__ */ jsx("th", {
|
|
114
|
+
className: cn("aui-md-th bg-muted px-3 py-1.5 text-start font-medium first:rounded-ss-lg last:rounded-se-lg [[align=center]]:text-center [[align=right]]:text-right", className),
|
|
115
|
+
...props
|
|
116
|
+
}),
|
|
117
|
+
td: ({ className, ...props }) => /* @__PURE__ */ jsx("td", {
|
|
118
|
+
className: cn("aui-md-td border-muted-foreground/20 border-s border-b px-3 py-1.5 text-start last:border-e [[align=center]]:text-center [[align=right]]:text-right", className),
|
|
119
|
+
...props
|
|
120
|
+
}),
|
|
121
|
+
tr: ({ className, ...props }) => /* @__PURE__ */ jsx("tr", {
|
|
122
|
+
className: cn("aui-md-tr m-0 border-b p-0 first:border-t [&:last-child>td:first-child]:rounded-es-lg [&:last-child>td:last-child]:rounded-ee-lg", className),
|
|
123
|
+
...props
|
|
124
|
+
}),
|
|
125
|
+
li: ({ className, ...props }) => /* @__PURE__ */ jsx("li", {
|
|
126
|
+
className: cn("aui-md-li leading-relaxed", className),
|
|
127
|
+
...props
|
|
128
|
+
}),
|
|
129
|
+
strong: ({ className, ...props }) => /* @__PURE__ */ jsx("strong", {
|
|
130
|
+
className: cn("aui-md-strong font-semibold", className),
|
|
131
|
+
...props
|
|
132
|
+
}),
|
|
133
|
+
sup: ({ className, ...props }) => /* @__PURE__ */ jsx("sup", {
|
|
134
|
+
className: cn("aui-md-sup [&>a]:text-xs [&>a]:no-underline", className),
|
|
135
|
+
...props
|
|
136
|
+
}),
|
|
137
|
+
pre: ({ className, ...props }) => /* @__PURE__ */ jsx("pre", {
|
|
138
|
+
tabIndex: 0,
|
|
139
|
+
className: cn("aui-md-pre border-border/50 bg-muted/30 overflow-x-auto rounded-t-none rounded-b-xl border border-t-0 p-3.5 text-[13px] leading-relaxed", className),
|
|
140
|
+
...props
|
|
141
|
+
}),
|
|
142
|
+
code: function Code({ className, ...props }) {
|
|
143
|
+
const isCodeBlock = useIsMarkdownCodeBlock();
|
|
144
|
+
return /* @__PURE__ */ jsx("code", {
|
|
145
|
+
className: cn(!isCodeBlock && "aui-md-inline-code bg-muted rounded-md px-1.5 py-0.5 font-mono text-[0.85em]", className),
|
|
146
|
+
...props
|
|
147
|
+
});
|
|
148
|
+
},
|
|
149
|
+
CodeHeader
|
|
150
|
+
});
|
|
151
|
+
//#endregion
|
|
152
|
+
export { MarkdownText, markdown_text_exports };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ComponentProps } from "react";
|
|
2
|
+
declare namespace math_block_d_exports {
|
|
3
|
+
export { Frac, MathBlock, MathStep, Sub, Sup };
|
|
4
|
+
}
|
|
5
|
+
export interface MathStep {
|
|
6
|
+
expression: React.ReactNode;
|
|
7
|
+
note?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function MathBlock({ label, steps, visibleSteps, className, ...props }: Omit<ComponentProps<"div">, "children" | "label" | "steps" | "visibleSteps"> & {
|
|
10
|
+
label?: string;
|
|
11
|
+
steps: readonly MathStep[];
|
|
12
|
+
visibleSteps: number;
|
|
13
|
+
}): import("react").JSX.Element;
|
|
14
|
+
export declare function Frac({ over, under }: {
|
|
15
|
+
over: React.ReactNode;
|
|
16
|
+
under: React.ReactNode;
|
|
17
|
+
}): import("react").JSX.Element;
|
|
18
|
+
export declare function Sup({ children }: {
|
|
19
|
+
children: React.ReactNode;
|
|
20
|
+
}): import("react").JSX.Element;
|
|
21
|
+
export declare function Sub({ children }: {
|
|
22
|
+
children: React.ReactNode;
|
|
23
|
+
}): import("react").JSX.Element;
|
|
24
|
+
//#endregion
|
|
25
|
+
export { math_block_d_exports };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { __exportAll } from "../../../_virtual/_rolldown/runtime.js";
|
|
3
|
+
import { cn } from "../../../lib/utils.js";
|
|
4
|
+
import { paper } from "./surfaces.js";
|
|
5
|
+
import { take } from "../utils/range.js";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
//#region src/components/assistant-ui/elements/math-block.tsx
|
|
8
|
+
var math_block_exports = /* @__PURE__ */ __exportAll({
|
|
9
|
+
Frac: () => Frac,
|
|
10
|
+
MathBlock: () => MathBlock,
|
|
11
|
+
Sub: () => Sub,
|
|
12
|
+
Sup: () => Sup
|
|
13
|
+
});
|
|
14
|
+
function MathBlock({ label, steps, visibleSteps, className, ...props }) {
|
|
15
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
16
|
+
"data-slot": "math-block",
|
|
17
|
+
className: cn(paper, "flex w-full max-w-sm flex-col gap-2.5 rounded-2xl p-4", className),
|
|
18
|
+
...props,
|
|
19
|
+
children: [label && /* @__PURE__ */ jsx("span", {
|
|
20
|
+
className: cn("font-mono text-[11px] tracking-tight", "text-muted-foreground"),
|
|
21
|
+
children: label
|
|
22
|
+
}), take(steps, visibleSteps).map((step, i) => /* @__PURE__ */ jsxs("div", {
|
|
23
|
+
className: "fade-in slide-in-from-bottom-1 animate-in fill-mode-both flex flex-col gap-1 duration-300",
|
|
24
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
25
|
+
className: "text-foreground/90 overflow-x-auto py-1 text-center font-serif text-[17px] leading-relaxed italic",
|
|
26
|
+
children: step.expression
|
|
27
|
+
}), step.note && /* @__PURE__ */ jsx("span", {
|
|
28
|
+
className: cn("font-mono text-[11px] tracking-tight", "text-muted-foreground text-center"),
|
|
29
|
+
children: step.note
|
|
30
|
+
})]
|
|
31
|
+
}, i))]
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
function Frac({ over, under }) {
|
|
35
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
36
|
+
"data-slot": "frac",
|
|
37
|
+
className: "inline-flex flex-col items-center align-middle text-[1em] leading-tight",
|
|
38
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
39
|
+
className: "px-1",
|
|
40
|
+
children: over
|
|
41
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
42
|
+
className: "border-foreground/40 w-full border-t px-1",
|
|
43
|
+
children: under
|
|
44
|
+
})]
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
function Sup({ children }) {
|
|
48
|
+
return /* @__PURE__ */ jsx("sup", {
|
|
49
|
+
className: "text-[0.65em] not-italic",
|
|
50
|
+
children
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
function Sub({ children }) {
|
|
54
|
+
return /* @__PURE__ */ jsx("sub", {
|
|
55
|
+
className: "text-[0.65em] not-italic",
|
|
56
|
+
children
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
//#endregion
|
|
60
|
+
export { Frac, MathBlock, Sub, Sup, math_block_exports };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { FC, ReactNode } from "react";
|
|
2
|
+
declare namespace mcp_config_aui_d_exports {
|
|
3
|
+
export { McpConfigDialog };
|
|
4
|
+
}
|
|
5
|
+
export declare namespace McpConfigDialog {
|
|
6
|
+
type Props = {
|
|
7
|
+
/** Trigger element. Defaults to a ghost button with a plug icon. */
|
|
8
|
+
children?: ReactNode;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Drop-in MCP server configuration dialog. Lists app-defined connectors and
|
|
13
|
+
* user-added custom servers, with inline auth controls and an add form.
|
|
14
|
+
*
|
|
15
|
+
* Mount the manager once at the root of your app, on the runtime provider
|
|
16
|
+
* itself:
|
|
17
|
+
* ```tsx
|
|
18
|
+
* const config = AuiConfig({ mcp: McpManagerResource({ connectors }) });
|
|
19
|
+
*
|
|
20
|
+
* <AssistantRuntimeProvider runtime={runtime} config={config}>
|
|
21
|
+
* {children}
|
|
22
|
+
* </AssistantRuntimeProvider>;
|
|
23
|
+
* ```
|
|
24
|
+
* then render `<McpConfigDialog />` anywhere inside it.
|
|
25
|
+
*/
|
|
26
|
+
export declare const McpConfigDialog: FC<McpConfigDialog.Props>;
|
|
27
|
+
//#endregion
|
|
28
|
+
export { mcp_config_aui_d_exports };
|
|
@@ -0,0 +1,380 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { __exportAll } from "../../../_virtual/_rolldown/runtime.js";
|
|
3
|
+
import { Button, buttonVariants } from "../../ui/button.js";
|
|
4
|
+
import { Separator } from "../../ui/separator.js";
|
|
5
|
+
import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle, DialogTrigger } from "../../ui/dialog.js";
|
|
6
|
+
import { cn } from "../../../lib/utils.js";
|
|
7
|
+
import { Label } from "../../ui/label.js";
|
|
8
|
+
import { isValidElement, useEffect, useId, useRef, useState } from "react";
|
|
9
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
import { ChevronDownIcon, Loader2Icon, PlugIcon, PlugZapIcon, PlusIcon, ServerIcon, ShieldAlertIcon, Trash2Icon, XIcon } from "lucide-react";
|
|
11
|
+
import { useAuiState } from "@assistant-ui/react";
|
|
12
|
+
import { McpAddFormPrimitive, McpManagerPrimitive, McpServerPrimitive } from "@assistant-ui/react-mcp";
|
|
13
|
+
//#region src/components/assistant-ui/elements/mcp-config.aui.tsx
|
|
14
|
+
var mcp_config_aui_exports = /* @__PURE__ */ __exportAll({ McpConfigDialog: () => McpConfigDialog });
|
|
15
|
+
const inputClassName = "border-input selection:bg-primary selection:text-primary-foreground file:text-foreground placeholder:text-muted-foreground dark:bg-input/30 h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base transition-colors outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-1 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40";
|
|
16
|
+
const FOCUSABLE_SELECTOR = "button:not([disabled]), a[href]";
|
|
17
|
+
const firstFocusable = (element) => element?.matches(FOCUSABLE_SELECTOR) ? element : element?.querySelector(FOCUSABLE_SELECTOR);
|
|
18
|
+
const indexOfServer = (list, element) => [...list.children].findIndex((card) => card.contains(element));
|
|
19
|
+
const isFocusLost = () => {
|
|
20
|
+
const active = document.activeElement;
|
|
21
|
+
return !active || active === document.body || active.getAttribute("role") === "dialog";
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Drop-in MCP server configuration dialog. Lists app-defined connectors and
|
|
25
|
+
* user-added custom servers, with inline auth controls and an add form.
|
|
26
|
+
*
|
|
27
|
+
* Mount the manager once at the root of your app, on the runtime provider
|
|
28
|
+
* itself:
|
|
29
|
+
* ```tsx
|
|
30
|
+
* const config = AuiConfig({ mcp: McpManagerResource({ connectors }) });
|
|
31
|
+
*
|
|
32
|
+
* <AssistantRuntimeProvider runtime={runtime} config={config}>
|
|
33
|
+
* {children}
|
|
34
|
+
* </AssistantRuntimeProvider>;
|
|
35
|
+
* ```
|
|
36
|
+
* then render `<McpConfigDialog />` anywhere inside it.
|
|
37
|
+
*/
|
|
38
|
+
const McpConfigDialog = ({ children }) => {
|
|
39
|
+
return /* @__PURE__ */ jsxs(Dialog, { children: [isValidElement(children) ? /* @__PURE__ */ jsx(DialogTrigger, { render: children }) : /* @__PURE__ */ jsxs(DialogTrigger, {
|
|
40
|
+
render: /* @__PURE__ */ jsx(Button, {
|
|
41
|
+
variant: "outline",
|
|
42
|
+
size: "sm",
|
|
43
|
+
className: "aui-mcp-config-trigger gap-2"
|
|
44
|
+
}),
|
|
45
|
+
children: [/* @__PURE__ */ jsx(PlugIcon, { className: "size-4" }), "MCP servers"]
|
|
46
|
+
}), /* @__PURE__ */ jsxs(DialogContent, {
|
|
47
|
+
className: "aui-mcp-config-content sm:max-w-lg",
|
|
48
|
+
children: [/* @__PURE__ */ jsxs(DialogHeader, { children: [/* @__PURE__ */ jsx(DialogTitle, { children: "MCP servers" }), /* @__PURE__ */ jsx(DialogDescription, { children: "Connect to Model Context Protocol servers to expose their tools to this assistant." })] }), /* @__PURE__ */ jsx(McpManagerPrimitive.Root, { children: /* @__PURE__ */ jsxs("div", {
|
|
49
|
+
className: "flex flex-col gap-4",
|
|
50
|
+
children: [
|
|
51
|
+
/* @__PURE__ */ jsx(ConnectorsSection, {}),
|
|
52
|
+
/* @__PURE__ */ jsx(Separator, {}),
|
|
53
|
+
/* @__PURE__ */ jsx(CustomServersSection, {})
|
|
54
|
+
]
|
|
55
|
+
}) })]
|
|
56
|
+
})] });
|
|
57
|
+
};
|
|
58
|
+
McpConfigDialog.displayName = "McpConfigDialog";
|
|
59
|
+
const ConnectorsSection = () => {
|
|
60
|
+
return /* @__PURE__ */ jsxs("section", {
|
|
61
|
+
className: "aui-mcp-connectors flex flex-col gap-2",
|
|
62
|
+
children: [/* @__PURE__ */ jsx(SectionTitle, { children: "Connectors" }), /* @__PURE__ */ jsx("div", {
|
|
63
|
+
className: "flex flex-col gap-2",
|
|
64
|
+
children: /* @__PURE__ */ jsx(McpManagerPrimitive.Connectors, { children: () => /* @__PURE__ */ jsx(ServerCard, {}) })
|
|
65
|
+
})]
|
|
66
|
+
});
|
|
67
|
+
};
|
|
68
|
+
const CustomServersSection = () => {
|
|
69
|
+
const serverIds = useAuiState((s) => s.mcp.customServers.map((server) => server.id).join(""));
|
|
70
|
+
const [showForm, setShowForm] = useState(false);
|
|
71
|
+
const listRef = useRef(null);
|
|
72
|
+
const focusedServerRef = useRef(null);
|
|
73
|
+
const addTriggerRef = useRef(null);
|
|
74
|
+
const restoreFocusRef = useRef(false);
|
|
75
|
+
useEffect(() => {
|
|
76
|
+
if (showForm || !restoreFocusRef.current) return;
|
|
77
|
+
restoreFocusRef.current = false;
|
|
78
|
+
addTriggerRef.current?.focus();
|
|
79
|
+
}, [showForm]);
|
|
80
|
+
useEffect(() => {
|
|
81
|
+
const list = listRef.current;
|
|
82
|
+
const focused = focusedServerRef.current;
|
|
83
|
+
if (!list || !focused) return;
|
|
84
|
+
if (focused.element.isConnected) {
|
|
85
|
+
focused.index = indexOfServer(list, focused.element);
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
focusedServerRef.current = null;
|
|
89
|
+
if (!isFocusLost()) return;
|
|
90
|
+
(firstFocusable(list.children[focused.index]) ?? firstFocusable(list.nextElementSibling))?.focus();
|
|
91
|
+
}, [serverIds]);
|
|
92
|
+
const handleClose = () => {
|
|
93
|
+
restoreFocusRef.current = true;
|
|
94
|
+
setShowForm(false);
|
|
95
|
+
};
|
|
96
|
+
return /* @__PURE__ */ jsxs("section", {
|
|
97
|
+
className: "aui-mcp-custom-servers flex flex-col gap-2",
|
|
98
|
+
children: [
|
|
99
|
+
/* @__PURE__ */ jsx(SectionTitle, { children: "Custom servers" }),
|
|
100
|
+
/* @__PURE__ */ jsx("div", {
|
|
101
|
+
ref: listRef,
|
|
102
|
+
className: "flex flex-col gap-2",
|
|
103
|
+
onFocus: (e) => {
|
|
104
|
+
focusedServerRef.current = {
|
|
105
|
+
element: e.target,
|
|
106
|
+
index: indexOfServer(e.currentTarget, e.target)
|
|
107
|
+
};
|
|
108
|
+
},
|
|
109
|
+
children: /* @__PURE__ */ jsx(McpManagerPrimitive.CustomServers, { children: () => /* @__PURE__ */ jsx(ServerCard, {}) })
|
|
110
|
+
}),
|
|
111
|
+
!showForm && /* @__PURE__ */ jsxs(McpManagerPrimitive.AddCustomTrigger, {
|
|
112
|
+
ref: addTriggerRef,
|
|
113
|
+
className: cn(buttonVariants({ variant: "outline" }), "aui-mcp-add-trigger h-9 justify-start gap-2 rounded-lg px-3 text-sm"),
|
|
114
|
+
onClick: () => setShowForm(true),
|
|
115
|
+
children: [/* @__PURE__ */ jsx(PlusIcon, { className: "size-4" }), "Add server"]
|
|
116
|
+
}),
|
|
117
|
+
showForm && /* @__PURE__ */ jsx(AddServerForm, { onClose: handleClose })
|
|
118
|
+
]
|
|
119
|
+
});
|
|
120
|
+
};
|
|
121
|
+
const SectionTitle = ({ children }) => /* @__PURE__ */ jsx("h3", {
|
|
122
|
+
className: "text-muted-foreground text-xs font-medium tracking-wide uppercase",
|
|
123
|
+
children
|
|
124
|
+
});
|
|
125
|
+
const ServerCard = () => {
|
|
126
|
+
return /* @__PURE__ */ jsxs(McpServerPrimitive.Root, {
|
|
127
|
+
className: cn("aui-mcp-server-card flex flex-col gap-2 rounded-lg border p-3", "data-[connection-state=error]:border-destructive/40"),
|
|
128
|
+
children: [
|
|
129
|
+
/* @__PURE__ */ jsxs("div", {
|
|
130
|
+
className: "flex items-center gap-3",
|
|
131
|
+
children: [
|
|
132
|
+
/* @__PURE__ */ jsx(ServerAvatar, {}),
|
|
133
|
+
/* @__PURE__ */ jsxs("div", {
|
|
134
|
+
className: "flex min-w-0 flex-1 flex-col gap-0.5",
|
|
135
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
136
|
+
className: "truncate text-sm font-medium",
|
|
137
|
+
children: /* @__PURE__ */ jsx(McpServerPrimitive.Name, {})
|
|
138
|
+
}), /* @__PURE__ */ jsx(StatusLine, {})]
|
|
139
|
+
}),
|
|
140
|
+
/* @__PURE__ */ jsxs("div", {
|
|
141
|
+
className: "flex items-center gap-1",
|
|
142
|
+
children: [/* @__PURE__ */ jsx(ServerActions, {}), /* @__PURE__ */ jsxs(McpServerPrimitive.RemoveButton, {
|
|
143
|
+
className: cn(buttonVariants({
|
|
144
|
+
variant: "ghost",
|
|
145
|
+
size: "icon"
|
|
146
|
+
}), "aui-mcp-server-remove text-muted-foreground hover:text-destructive size-7"),
|
|
147
|
+
children: [/* @__PURE__ */ jsx(Trash2Icon, { className: "size-4" }), /* @__PURE__ */ jsx("span", {
|
|
148
|
+
className: "sr-only",
|
|
149
|
+
children: "Remove"
|
|
150
|
+
})]
|
|
151
|
+
})]
|
|
152
|
+
})
|
|
153
|
+
]
|
|
154
|
+
}),
|
|
155
|
+
/* @__PURE__ */ jsx(ServerError, {}),
|
|
156
|
+
/* @__PURE__ */ jsx(ServerAnnouncement, {})
|
|
157
|
+
]
|
|
158
|
+
});
|
|
159
|
+
};
|
|
160
|
+
const ServerAvatar = () => {
|
|
161
|
+
const icon = useAuiState((s) => s.mcpServer.icon ?? null);
|
|
162
|
+
const name = useAuiState((s) => s.mcpServer.name);
|
|
163
|
+
return /* @__PURE__ */ jsx("div", {
|
|
164
|
+
className: "bg-muted text-muted-foreground flex size-8 shrink-0 items-center justify-center overflow-hidden rounded-md border",
|
|
165
|
+
children: icon ? /* @__PURE__ */ jsx("img", {
|
|
166
|
+
src: icon,
|
|
167
|
+
alt: name,
|
|
168
|
+
className: "size-full object-cover"
|
|
169
|
+
}) : /* @__PURE__ */ jsx(ServerIcon, { className: "size-4" })
|
|
170
|
+
});
|
|
171
|
+
};
|
|
172
|
+
const STATUS_DOT = {
|
|
173
|
+
connected: "bg-chart-2",
|
|
174
|
+
connecting: "bg-muted-foreground",
|
|
175
|
+
authRequired: "bg-muted-foreground",
|
|
176
|
+
authPending: "bg-muted-foreground",
|
|
177
|
+
error: "bg-destructive",
|
|
178
|
+
disconnected: "bg-muted-foreground/60"
|
|
179
|
+
};
|
|
180
|
+
const STATUS_LABEL = {
|
|
181
|
+
connected: "Connected",
|
|
182
|
+
connecting: "Connecting…",
|
|
183
|
+
authRequired: "Auth required",
|
|
184
|
+
authPending: "Authorizing…",
|
|
185
|
+
error: "Error",
|
|
186
|
+
disconnected: "Disconnected"
|
|
187
|
+
};
|
|
188
|
+
const StatusLine = () => {
|
|
189
|
+
const status = useAuiState((s) => s.mcpServer.connectionState);
|
|
190
|
+
const label = STATUS_LABEL[status];
|
|
191
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
192
|
+
className: cn("flex items-center gap-1.5 text-xs", status === "error" ? "text-destructive" : "text-muted-foreground"),
|
|
193
|
+
children: [status === "connecting" || status === "authPending" ? /* @__PURE__ */ jsx(Loader2Icon, {
|
|
194
|
+
"aria-hidden": "true",
|
|
195
|
+
className: "size-3 animate-spin"
|
|
196
|
+
}) : /* @__PURE__ */ jsx("span", {
|
|
197
|
+
"aria-hidden": "true",
|
|
198
|
+
className: cn("size-1.5 shrink-0 rounded-full", STATUS_DOT[status])
|
|
199
|
+
}), label]
|
|
200
|
+
});
|
|
201
|
+
};
|
|
202
|
+
const ServerAnnouncement = () => {
|
|
203
|
+
const status = useAuiState((s) => s.mcpServer.connectionState);
|
|
204
|
+
const message = useAuiState((s) => s.mcpServer.lastError?.message ?? null);
|
|
205
|
+
const [seen, setSeen] = useState({
|
|
206
|
+
status,
|
|
207
|
+
message
|
|
208
|
+
});
|
|
209
|
+
const [announcement, setAnnouncement] = useState("");
|
|
210
|
+
if (seen.status !== status || seen.message !== message) {
|
|
211
|
+
setSeen({
|
|
212
|
+
status,
|
|
213
|
+
message
|
|
214
|
+
});
|
|
215
|
+
if (message && message !== seen.message) setAnnouncement(`${STATUS_LABEL.error}: ${message}`);
|
|
216
|
+
else if (status !== seen.status) setAnnouncement(STATUS_LABEL[status]);
|
|
217
|
+
}
|
|
218
|
+
useEffect(() => {
|
|
219
|
+
if (!announcement) return;
|
|
220
|
+
const timeout = setTimeout(() => setAnnouncement(""), 1e3);
|
|
221
|
+
return () => clearTimeout(timeout);
|
|
222
|
+
}, [announcement]);
|
|
223
|
+
return /* @__PURE__ */ jsx("div", {
|
|
224
|
+
role: "status",
|
|
225
|
+
className: "sr-only",
|
|
226
|
+
children: announcement
|
|
227
|
+
});
|
|
228
|
+
};
|
|
229
|
+
const ServerError = () => {
|
|
230
|
+
const message = useAuiState((s) => s.mcpServer.lastError?.message ?? null);
|
|
231
|
+
if (!message) return null;
|
|
232
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
233
|
+
className: "border-destructive/40 bg-destructive/5 text-destructive flex items-start gap-2 rounded-md border px-2 py-1.5 text-xs",
|
|
234
|
+
children: [/* @__PURE__ */ jsx(ShieldAlertIcon, { className: "mt-0.5 size-3.5 shrink-0" }), /* @__PURE__ */ jsx("span", {
|
|
235
|
+
className: "break-words",
|
|
236
|
+
children: message
|
|
237
|
+
})]
|
|
238
|
+
});
|
|
239
|
+
};
|
|
240
|
+
const ServerActions = () => {
|
|
241
|
+
const state = useAuiState((s) => s.mcpServer.connectionState);
|
|
242
|
+
const actionRef = useRef(null);
|
|
243
|
+
const focusedRef = useRef(null);
|
|
244
|
+
useEffect(() => {
|
|
245
|
+
const focused = focusedRef.current;
|
|
246
|
+
if (!focused || focused.isConnected) return;
|
|
247
|
+
focusedRef.current = null;
|
|
248
|
+
if (isFocusLost()) actionRef.current?.focus();
|
|
249
|
+
}, [state]);
|
|
250
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
251
|
+
className: "flex flex-wrap gap-2",
|
|
252
|
+
onFocus: (e) => {
|
|
253
|
+
focusedRef.current = e.target;
|
|
254
|
+
},
|
|
255
|
+
children: [
|
|
256
|
+
/* @__PURE__ */ jsxs(McpServerPrimitive.ConnectButton, {
|
|
257
|
+
ref: actionRef,
|
|
258
|
+
className: cn(buttonVariants({
|
|
259
|
+
variant: "default",
|
|
260
|
+
size: "sm"
|
|
261
|
+
}), "aui-mcp-server-connect h-8 gap-2 text-xs"),
|
|
262
|
+
children: [/* @__PURE__ */ jsx(PlugZapIcon, { className: "size-3.5" }), "Connect"]
|
|
263
|
+
}),
|
|
264
|
+
/* @__PURE__ */ jsx(McpServerPrimitive.OAuthLink, {
|
|
265
|
+
className: cn(buttonVariants({
|
|
266
|
+
variant: "default",
|
|
267
|
+
size: "sm"
|
|
268
|
+
}), "aui-mcp-server-authorize h-8 gap-2 text-xs"),
|
|
269
|
+
children: "Authorize"
|
|
270
|
+
}),
|
|
271
|
+
/* @__PURE__ */ jsx(McpServerPrimitive.DisconnectButton, {
|
|
272
|
+
ref: actionRef,
|
|
273
|
+
className: cn(buttonVariants({
|
|
274
|
+
variant: "outline",
|
|
275
|
+
size: "sm"
|
|
276
|
+
}), "aui-mcp-server-disconnect h-8 text-xs"),
|
|
277
|
+
children: "Disconnect"
|
|
278
|
+
})
|
|
279
|
+
]
|
|
280
|
+
});
|
|
281
|
+
};
|
|
282
|
+
const AddServerForm = ({ onClose }) => {
|
|
283
|
+
const formId = useId();
|
|
284
|
+
const fieldIds = {
|
|
285
|
+
name: `${formId}-name`,
|
|
286
|
+
url: `${formId}-url`,
|
|
287
|
+
auth: `${formId}-auth`
|
|
288
|
+
};
|
|
289
|
+
return /* @__PURE__ */ jsx(McpAddFormPrimitive.Root, {
|
|
290
|
+
onSubmitted: onClose,
|
|
291
|
+
onCancel: onClose,
|
|
292
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
293
|
+
className: "aui-mcp-add-form flex flex-col gap-3 rounded-lg border p-3",
|
|
294
|
+
children: [
|
|
295
|
+
/* @__PURE__ */ jsxs("div", {
|
|
296
|
+
className: "flex items-center justify-between",
|
|
297
|
+
children: [/* @__PURE__ */ jsx("h4", {
|
|
298
|
+
className: "text-sm font-medium",
|
|
299
|
+
children: "New server"
|
|
300
|
+
}), /* @__PURE__ */ jsxs(McpAddFormPrimitive.Cancel, {
|
|
301
|
+
type: "button",
|
|
302
|
+
className: cn(buttonVariants({
|
|
303
|
+
variant: "ghost",
|
|
304
|
+
size: "icon"
|
|
305
|
+
}), "text-muted-foreground size-7"),
|
|
306
|
+
children: [/* @__PURE__ */ jsx(XIcon, { className: "size-4" }), /* @__PURE__ */ jsx("span", {
|
|
307
|
+
className: "sr-only",
|
|
308
|
+
children: "Close form"
|
|
309
|
+
})]
|
|
310
|
+
})]
|
|
311
|
+
}),
|
|
312
|
+
/* @__PURE__ */ jsx(FormRow, {
|
|
313
|
+
label: "Name",
|
|
314
|
+
htmlFor: fieldIds.name,
|
|
315
|
+
children: /* @__PURE__ */ jsx(McpAddFormPrimitive.NameField, {
|
|
316
|
+
autoFocus: true,
|
|
317
|
+
id: fieldIds.name,
|
|
318
|
+
placeholder: "My MCP server",
|
|
319
|
+
className: inputClassName
|
|
320
|
+
})
|
|
321
|
+
}),
|
|
322
|
+
/* @__PURE__ */ jsx(FormRow, {
|
|
323
|
+
label: "URL",
|
|
324
|
+
htmlFor: fieldIds.url,
|
|
325
|
+
children: /* @__PURE__ */ jsx(McpAddFormPrimitive.UrlField, {
|
|
326
|
+
id: fieldIds.url,
|
|
327
|
+
placeholder: "https://example.com/mcp",
|
|
328
|
+
className: inputClassName
|
|
329
|
+
})
|
|
330
|
+
}),
|
|
331
|
+
/* @__PURE__ */ jsxs(FormRow, {
|
|
332
|
+
label: "Auth",
|
|
333
|
+
htmlFor: fieldIds.auth,
|
|
334
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
335
|
+
className: "relative w-full",
|
|
336
|
+
children: [/* @__PURE__ */ jsx(McpAddFormPrimitive.AuthSelect, {
|
|
337
|
+
id: fieldIds.auth,
|
|
338
|
+
className: "aui-mcp-auth-select border-input dark:bg-input/30 h-9 w-full min-w-0 cursor-pointer appearance-none rounded-md border bg-input/20 px-3 py-1 pr-8 text-base transition-colors outline-none md:text-sm focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-1"
|
|
339
|
+
}), /* @__PURE__ */ jsx(ChevronDownIcon, {
|
|
340
|
+
"aria-hidden": true,
|
|
341
|
+
className: "text-muted-foreground pointer-events-none absolute end-2.5 top-1/2 size-4 -translate-y-1/2"
|
|
342
|
+
})]
|
|
343
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
344
|
+
className: cn("[&_[data-mcp-auth-field-label]]:text-xs [&_[data-mcp-auth-field-label]]:font-medium [&>div]:flex [&>div]:flex-col [&>div]:gap-1.5", "[&_input]:border-input empty:hidden [&_input]:flex [&_input]:h-9 [&_input]:w-full [&_input]:rounded-md [&_input]:border [&_input]:bg-transparent [&_input]:px-3 [&_input]:py-1 [&_input]:text-sm [&_input]:transition-colors [&_input]:outline-none", "[&_input:focus-visible]:border-ring [&_input:focus-visible]:ring-ring/50 [&_input:focus-visible]:ring-[3px]", "[&_input[aria-invalid=true]]:border-destructive [&_input[aria-invalid=true]]:ring-destructive/20 dark:[&_input[aria-invalid=true]]:ring-destructive/40", "[&_input::placeholder]:text-muted-foreground"),
|
|
345
|
+
children: /* @__PURE__ */ jsx(McpAddFormPrimitive.AuthFields, {})
|
|
346
|
+
})]
|
|
347
|
+
}),
|
|
348
|
+
/* @__PURE__ */ jsx(McpAddFormPrimitive.Error, { className: "text-destructive text-xs" }),
|
|
349
|
+
/* @__PURE__ */ jsxs("div", {
|
|
350
|
+
className: "flex justify-end gap-2",
|
|
351
|
+
children: [/* @__PURE__ */ jsx(McpAddFormPrimitive.Cancel, {
|
|
352
|
+
type: "button",
|
|
353
|
+
className: cn(buttonVariants({
|
|
354
|
+
variant: "ghost",
|
|
355
|
+
size: "sm"
|
|
356
|
+
})),
|
|
357
|
+
children: "Cancel"
|
|
358
|
+
}), /* @__PURE__ */ jsx(McpAddFormPrimitive.Submit, {
|
|
359
|
+
type: "submit",
|
|
360
|
+
className: cn(buttonVariants({ size: "sm" })),
|
|
361
|
+
children: "Add server"
|
|
362
|
+
})]
|
|
363
|
+
})
|
|
364
|
+
]
|
|
365
|
+
})
|
|
366
|
+
});
|
|
367
|
+
};
|
|
368
|
+
const FormRow = ({ label, htmlFor, children }) => /* @__PURE__ */ jsxs("div", {
|
|
369
|
+
className: "flex flex-col gap-1.5",
|
|
370
|
+
children: [/* @__PURE__ */ jsx(Label, {
|
|
371
|
+
className: "text-xs",
|
|
372
|
+
htmlFor,
|
|
373
|
+
children: label
|
|
374
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
375
|
+
className: "flex flex-col gap-2",
|
|
376
|
+
children
|
|
377
|
+
})]
|
|
378
|
+
});
|
|
379
|
+
//#endregion
|
|
380
|
+
export { McpConfigDialog, mcp_config_aui_exports };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ComponentProps } from "react";
|
|
2
|
+
declare namespace mcp_server_panel_d_exports {
|
|
3
|
+
export { McpServer, McpServerPanel, McpServerStatus };
|
|
4
|
+
}
|
|
5
|
+
export type McpServerStatus = "connected" | "connecting" | "needs-auth" | "failed";
|
|
6
|
+
export interface McpServer {
|
|
7
|
+
id: string;
|
|
8
|
+
name: string;
|
|
9
|
+
transport: string;
|
|
10
|
+
status: McpServerStatus;
|
|
11
|
+
tools: readonly string[];
|
|
12
|
+
}
|
|
13
|
+
export declare function McpServerPanel({ servers, expandedId, onToggle, onAuthorize, className, ...props }: Omit<ComponentProps<"div">, "children" | "servers" | "expandedId" | "onToggle" | "onAuthorize"> & {
|
|
14
|
+
servers: readonly McpServer[];
|
|
15
|
+
expandedId?: string;
|
|
16
|
+
onToggle?: (id: string) => void;
|
|
17
|
+
onAuthorize?: (id: string) => void;
|
|
18
|
+
}): import("react").JSX.Element;
|
|
19
|
+
//#endregion
|
|
20
|
+
export { mcp_server_panel_d_exports };
|