@dungle-scrubs/admin-ui-soft 0.0.0-stage → 0.1.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 +131 -3
|
@@ -0,0 +1,542 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { __exportAll } from "../../../_virtual/_rolldown/runtime.js";
|
|
3
|
+
import { Button } from "../../ui/button.js";
|
|
4
|
+
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "../../ui/collapsible.js";
|
|
5
|
+
import { Textarea } from "../../ui/textarea.js";
|
|
6
|
+
import { cn } from "../../../lib/utils.js";
|
|
7
|
+
import { memo, useCallback, useRef, useState } from "react";
|
|
8
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
import { AlertCircleIcon, CheckIcon, ChevronDownIcon, CircleMinusIcon, LoaderIcon, XCircleIcon } from "lucide-react";
|
|
10
|
+
import { toolApprovalAcceptsText, useAuiState, useScrollLock, useToolCallElapsed } from "@assistant-ui/react";
|
|
11
|
+
//#region src/components/assistant-ui/elements/tool-fallback.aui.tsx
|
|
12
|
+
var tool_fallback_aui_exports = /* @__PURE__ */ __exportAll({
|
|
13
|
+
ToolFallback: () => ToolFallback,
|
|
14
|
+
ToolFallbackApproval: () => ToolFallbackApproval,
|
|
15
|
+
ToolFallbackArgs: () => ToolFallbackArgs,
|
|
16
|
+
ToolFallbackContent: () => ToolFallbackContent,
|
|
17
|
+
ToolFallbackError: () => ToolFallbackError,
|
|
18
|
+
ToolFallbackResult: () => ToolFallbackResult,
|
|
19
|
+
ToolFallbackRoot: () => ToolFallbackRoot,
|
|
20
|
+
ToolFallbackTrigger: () => ToolFallbackTrigger,
|
|
21
|
+
formatUnknownValue: () => formatUnknownValue,
|
|
22
|
+
offersInterruptAction: () => offersInterruptAction
|
|
23
|
+
});
|
|
24
|
+
const ANIMATION_DURATION = 200;
|
|
25
|
+
const pressable = "active:scale-[0.98]";
|
|
26
|
+
function ToolFallbackRoot({ className, open: controlledOpen, onOpenChange: controlledOnOpenChange, defaultOpen = false, children, ...props }) {
|
|
27
|
+
const collapsibleRef = useRef(null);
|
|
28
|
+
const [uncontrolledOpen, setUncontrolledOpen] = useState(defaultOpen);
|
|
29
|
+
const lockScroll = useScrollLock(collapsibleRef, ANIMATION_DURATION);
|
|
30
|
+
const isControlled = controlledOpen !== void 0;
|
|
31
|
+
const isOpen = isControlled ? controlledOpen : uncontrolledOpen;
|
|
32
|
+
const handleOpenChange = useCallback((open) => {
|
|
33
|
+
lockScroll();
|
|
34
|
+
if (!isControlled) setUncontrolledOpen(open);
|
|
35
|
+
controlledOnOpenChange?.(open);
|
|
36
|
+
}, [
|
|
37
|
+
lockScroll,
|
|
38
|
+
isControlled,
|
|
39
|
+
controlledOnOpenChange
|
|
40
|
+
]);
|
|
41
|
+
return /* @__PURE__ */ jsx(Collapsible, {
|
|
42
|
+
ref: collapsibleRef,
|
|
43
|
+
"data-slot": "tool-fallback-root",
|
|
44
|
+
open: isOpen,
|
|
45
|
+
onOpenChange: handleOpenChange,
|
|
46
|
+
className: cn("aui-tool-fallback-root group/tool-fallback-root w-full", className),
|
|
47
|
+
style: { "--animation-duration": `${ANIMATION_DURATION}ms` },
|
|
48
|
+
...props,
|
|
49
|
+
children
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
const statusIconMap = {
|
|
53
|
+
running: LoaderIcon,
|
|
54
|
+
complete: CheckIcon,
|
|
55
|
+
incomplete: XCircleIcon,
|
|
56
|
+
"requires-action": AlertCircleIcon
|
|
57
|
+
};
|
|
58
|
+
const formatToolDuration = (ms) => {
|
|
59
|
+
if (ms < 1e3) return "<1s";
|
|
60
|
+
const seconds = ms / 1e3;
|
|
61
|
+
if (seconds < 10) return `${(Math.floor(seconds * 10) / 10).toFixed(1)}s`;
|
|
62
|
+
if (seconds < 60) return `${Math.floor(seconds)}s`;
|
|
63
|
+
return `${Math.floor(seconds / 60)}m ${Math.floor(seconds % 60)}s`;
|
|
64
|
+
};
|
|
65
|
+
function ToolFallbackDuration({ className, ...props }) {
|
|
66
|
+
const elapsedMs = useToolCallElapsed();
|
|
67
|
+
if (elapsedMs === void 0) return null;
|
|
68
|
+
return /* @__PURE__ */ jsx("span", {
|
|
69
|
+
"data-slot": "tool-fallback-duration",
|
|
70
|
+
className: cn("aui-tool-fallback-duration text-muted-foreground text-xs tabular-nums", className),
|
|
71
|
+
...props,
|
|
72
|
+
children: formatToolDuration(elapsedMs)
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
function ToolFallbackTrigger({ toolName, status, denied, className, ...props }) {
|
|
76
|
+
const statusType = status?.type ?? "complete";
|
|
77
|
+
const isRunning = statusType === "running";
|
|
78
|
+
const isCancelled = status?.type === "incomplete" && status.reason === "cancelled";
|
|
79
|
+
const Icon = denied ? XCircleIcon : statusIconMap[statusType];
|
|
80
|
+
const label = denied ? "Denied tool" : statusType === "running" ? "Running tool" : statusType === "requires-action" ? "Waiting on tool" : statusType === "incomplete" ? `${isCancelled ? "Cancelled" : "Failed"} tool` : "Used tool";
|
|
81
|
+
return /* @__PURE__ */ jsxs(CollapsibleTrigger, {
|
|
82
|
+
"data-slot": "tool-fallback-trigger",
|
|
83
|
+
className: cn("aui-tool-fallback-trigger group/trigger text-muted-foreground hover:text-foreground focus-visible:ring-ring/50 flex w-fit origin-left items-center gap-2 rounded-md py-1.5 ps-1 -ms-1 text-sm transition-[color,scale] outline-none active:scale-[0.98] focus-visible:ring-[3px]", className),
|
|
84
|
+
...props,
|
|
85
|
+
children: [
|
|
86
|
+
/* @__PURE__ */ jsx(Icon, {
|
|
87
|
+
"data-slot": "tool-fallback-trigger-icon",
|
|
88
|
+
className: cn("aui-tool-fallback-trigger-icon size-4 shrink-0", isCancelled && "text-muted-foreground", isRunning && "animate-spin [animation-duration:0.6s]")
|
|
89
|
+
}),
|
|
90
|
+
/* @__PURE__ */ jsxs("span", {
|
|
91
|
+
"data-slot": "tool-fallback-trigger-label",
|
|
92
|
+
className: cn("aui-tool-fallback-trigger-label-wrapper inline-block text-start leading-none", isCancelled && "text-muted-foreground line-through", isRunning && "shimmer motion-reduce:animate-none"),
|
|
93
|
+
children: [
|
|
94
|
+
label,
|
|
95
|
+
": ",
|
|
96
|
+
/* @__PURE__ */ jsx("b", { children: toolName })
|
|
97
|
+
]
|
|
98
|
+
}),
|
|
99
|
+
/* @__PURE__ */ jsx(ToolFallbackDuration, {}),
|
|
100
|
+
/* @__PURE__ */ jsx(ChevronDownIcon, {
|
|
101
|
+
"data-slot": "tool-fallback-trigger-chevron",
|
|
102
|
+
className: cn("aui-tool-fallback-trigger-chevron size-4 shrink-0", "transition-transform duration-(--animation-duration) ease-[cubic-bezier(0.32,0.72,0,1)] motion-reduce:transition-none", "-rotate-90", "group-data-open/trigger:rotate-0", "group-data-panel-open/trigger:rotate-0")
|
|
103
|
+
})
|
|
104
|
+
]
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
function ToolFallbackContent({ className, children, ...props }) {
|
|
108
|
+
return /* @__PURE__ */ jsx(CollapsibleContent, {
|
|
109
|
+
"data-slot": "tool-fallback-content",
|
|
110
|
+
className: cn("aui-tool-fallback-content relative overflow-hidden text-sm outline-none", "group/collapsible-content ease-[cubic-bezier(0.32,0.72,0,1)] motion-reduce:animate-none", "data-closed:animate-collapsible-up", "data-open:animate-collapsible-down", "data-closed:fill-mode-forwards", "data-closed:pointer-events-none", "[--tw-duration:var(--animation-duration)]", className),
|
|
111
|
+
...props,
|
|
112
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
113
|
+
className: cn("flex flex-col gap-2 ps-6 pt-1 pb-2 ease-[cubic-bezier(0.32,0.72,0,1)] motion-reduce:animate-none", "group-data-open/collapsible-content:animate-in group-data-open/collapsible-content:fade-in-0 group-data-open/collapsible-content:blur-in-[2px] group-data-open/collapsible-content:slide-in-from-top-1", "group-data-closed/collapsible-content:animate-out group-data-closed/collapsible-content:fade-out-0 group-data-closed/collapsible-content:blur-out-[2px] group-data-closed/collapsible-content:slide-out-to-top-1", "group-data-closed/collapsible-content:animation-duration-(--animation-duration) group-data-open/collapsible-content:animation-duration-(--animation-duration)"),
|
|
114
|
+
children
|
|
115
|
+
})
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
function ToolFallbackArgs({ argsText, className, ...props }) {
|
|
119
|
+
if (!argsText) return null;
|
|
120
|
+
return /* @__PURE__ */ jsx("div", {
|
|
121
|
+
"data-slot": "tool-fallback-args",
|
|
122
|
+
className: cn("aui-tool-fallback-args", className),
|
|
123
|
+
...props,
|
|
124
|
+
children: /* @__PURE__ */ jsx("pre", {
|
|
125
|
+
className: "aui-tool-fallback-args-value bg-muted/50 text-foreground/90 rounded-md p-2.5 text-xs whitespace-pre-wrap",
|
|
126
|
+
children: argsText
|
|
127
|
+
})
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
const formatUnknownValue = (value, space) => {
|
|
131
|
+
if (typeof value === "string") return value;
|
|
132
|
+
try {
|
|
133
|
+
if (value instanceof Error) return String(value);
|
|
134
|
+
const json = JSON.stringify(value, null, space);
|
|
135
|
+
if (json !== void 0) return json;
|
|
136
|
+
} catch {}
|
|
137
|
+
try {
|
|
138
|
+
return String(value);
|
|
139
|
+
} catch {
|
|
140
|
+
return "[Unserializable value]";
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
function ToolFallbackResult({ result, className, ...props }) {
|
|
144
|
+
if (result === void 0) return null;
|
|
145
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
146
|
+
"data-slot": "tool-fallback-result",
|
|
147
|
+
className: cn("aui-tool-fallback-result", className),
|
|
148
|
+
...props,
|
|
149
|
+
children: [/* @__PURE__ */ jsx("p", {
|
|
150
|
+
className: "aui-tool-fallback-result-header text-muted-foreground text-xs font-medium",
|
|
151
|
+
children: "Result:"
|
|
152
|
+
}), /* @__PURE__ */ jsx("pre", {
|
|
153
|
+
className: "aui-tool-fallback-result-content bg-muted/50 text-foreground/90 mt-1 rounded-md p-2.5 text-xs whitespace-pre-wrap",
|
|
154
|
+
children: formatUnknownValue(result, 2)
|
|
155
|
+
})]
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
function ToolFallbackError({ status, className, ...props }) {
|
|
159
|
+
if (status?.type !== "incomplete") return null;
|
|
160
|
+
const error = status.error;
|
|
161
|
+
const errorText = error === void 0 || error === null ? null : formatUnknownValue(error);
|
|
162
|
+
if (!errorText) return null;
|
|
163
|
+
const headerText = status.reason === "cancelled" ? "Cancelled reason:" : "Error:";
|
|
164
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
165
|
+
"data-slot": "tool-fallback-error",
|
|
166
|
+
className: cn("aui-tool-fallback-error", className),
|
|
167
|
+
...props,
|
|
168
|
+
children: [/* @__PURE__ */ jsx("p", {
|
|
169
|
+
className: "aui-tool-fallback-error-header text-muted-foreground font-semibold",
|
|
170
|
+
children: headerText
|
|
171
|
+
}), /* @__PURE__ */ jsx("p", {
|
|
172
|
+
className: "aui-tool-fallback-error-reason text-muted-foreground whitespace-pre-line",
|
|
173
|
+
children: errorText
|
|
174
|
+
})]
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
const APPROVED_RESULT = "Approved by user";
|
|
178
|
+
const DENIED_RESULT = "User denied tool execution";
|
|
179
|
+
const APPROVAL_OPTION_DEFAULT_LABELS = {
|
|
180
|
+
"allow-once": "Allow",
|
|
181
|
+
"allow-always": "Always allow",
|
|
182
|
+
"reject-once": "Deny",
|
|
183
|
+
"reject-always": "Always deny"
|
|
184
|
+
};
|
|
185
|
+
const isKnownKind = (kind) => Object.hasOwn(APPROVAL_OPTION_DEFAULT_LABELS, kind);
|
|
186
|
+
const isAllowKind = (kind) => kind === "allow-once" || kind === "allow-always";
|
|
187
|
+
const approvalOptionLabel = (option) => option.label ?? (isKnownKind(option.kind) ? APPROVAL_OPTION_DEFAULT_LABELS[option.kind] : void 0) ?? option.id;
|
|
188
|
+
/**
|
|
189
|
+
* A request that declares how it wants to be presented is asking a question,
|
|
190
|
+
* not gating an action, so a refusal is not one of the answers it accepts
|
|
191
|
+
* unless the request declares itself dismissible.
|
|
192
|
+
*/
|
|
193
|
+
const isQuestion = (approval) => approval?.display === "select" || approval?.display === "text";
|
|
194
|
+
const isSettled = (approval) => approval != null && (approval.approved !== void 0 || approval.resolution !== void 0);
|
|
195
|
+
/**
|
|
196
|
+
* A settled request reads as a past-tense record of what happened to it, so
|
|
197
|
+
* scrolling back never shows a live control for a decision already made.
|
|
198
|
+
*/
|
|
199
|
+
const approvalReceipt = (approval) => {
|
|
200
|
+
if (approval.resolution !== void 0) return {
|
|
201
|
+
outcome: "closed",
|
|
202
|
+
label: approval.resolution === "cancelled" ? "Cancelled before a decision" : "Expired before a decision"
|
|
203
|
+
};
|
|
204
|
+
const chosen = approval.optionId === void 0 ? void 0 : approval.options?.find((option) => option.id === approval.optionId);
|
|
205
|
+
const option = chosen !== void 0 ? approvalOptionLabel(chosen) : approval.optionId === void 0 ? void 0 : approval.optionId;
|
|
206
|
+
const answered = isQuestion(approval) || chosen !== void 0 && !isKnownKind(chosen.kind);
|
|
207
|
+
const automatic = approval.isAutomatic ? " automatically" : "";
|
|
208
|
+
if (approval.approved) return {
|
|
209
|
+
outcome: "allowed",
|
|
210
|
+
label: `${answered ? "Answered" : "Allowed"}${automatic}`,
|
|
211
|
+
option
|
|
212
|
+
};
|
|
213
|
+
return {
|
|
214
|
+
outcome: "refused",
|
|
215
|
+
label: `${answered ? "Dismissed" : "Denied"}${automatic}`,
|
|
216
|
+
option
|
|
217
|
+
};
|
|
218
|
+
};
|
|
219
|
+
const receiptIcons = {
|
|
220
|
+
allowed: CheckIcon,
|
|
221
|
+
refused: XCircleIcon,
|
|
222
|
+
closed: CircleMinusIcon
|
|
223
|
+
};
|
|
224
|
+
function ToolFallbackApprovalReceipt({ approval, className, ...props }) {
|
|
225
|
+
const receipt = approvalReceipt(approval);
|
|
226
|
+
const Icon = receiptIcons[receipt.outcome];
|
|
227
|
+
const notes = [...new Set([approval.text, approval.reason].filter((value) => typeof value === "string" && value !== ""))];
|
|
228
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
229
|
+
"data-slot": "tool-fallback-approval-receipt",
|
|
230
|
+
"data-outcome": receipt.outcome,
|
|
231
|
+
className: cn("aui-tool-fallback-approval-receipt flex flex-col gap-1.5 pt-1", className),
|
|
232
|
+
...props,
|
|
233
|
+
children: [
|
|
234
|
+
approval.prompt ? /* @__PURE__ */ jsx("p", {
|
|
235
|
+
className: "aui-tool-fallback-approval-prompt text-muted-foreground whitespace-pre-line",
|
|
236
|
+
children: approval.prompt
|
|
237
|
+
}) : null,
|
|
238
|
+
/* @__PURE__ */ jsxs("p", {
|
|
239
|
+
className: "aui-tool-fallback-approval-receipt-label flex items-center gap-1.5",
|
|
240
|
+
children: [
|
|
241
|
+
/* @__PURE__ */ jsx(Icon, {
|
|
242
|
+
"aria-hidden": true,
|
|
243
|
+
className: "text-muted-foreground size-3.5 shrink-0"
|
|
244
|
+
}),
|
|
245
|
+
/* @__PURE__ */ jsx("span", {
|
|
246
|
+
className: "font-medium",
|
|
247
|
+
children: receipt.label
|
|
248
|
+
}),
|
|
249
|
+
receipt.option !== void 0 ? /* @__PURE__ */ jsxs("span", {
|
|
250
|
+
className: "text-muted-foreground",
|
|
251
|
+
children: ["· ", receipt.option]
|
|
252
|
+
}) : null
|
|
253
|
+
]
|
|
254
|
+
}),
|
|
255
|
+
notes.map((text) => /* @__PURE__ */ jsx("p", {
|
|
256
|
+
className: "aui-tool-fallback-approval-receipt-note text-muted-foreground whitespace-pre-line",
|
|
257
|
+
children: text
|
|
258
|
+
}, text))
|
|
259
|
+
]
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
const offersInterruptAction = (status, approval, interrupt) => status?.type !== "requires-action" || status.reason !== "interrupt" || approval != null || interrupt != null;
|
|
263
|
+
function ToolFallbackApproval({ className, addResult, resume, interrupt, approval, respondToApproval, status, ...props }) {
|
|
264
|
+
const [submitted, setSubmitted] = useState(false);
|
|
265
|
+
const voiceActive = useAuiState((s) => s.thread.voice !== void 0);
|
|
266
|
+
const canAnswer = useAuiState((s) => s.thread.capabilities.answerToolCall);
|
|
267
|
+
const locked = submitted || voiceActive;
|
|
268
|
+
const [confirmingId, setConfirmingId] = useState(null);
|
|
269
|
+
const [answer, setAnswer] = useState("");
|
|
270
|
+
const [error, setError] = useState(null);
|
|
271
|
+
if (approval != null && isSettled(approval)) return /* @__PURE__ */ jsx(ToolFallbackApprovalReceipt, {
|
|
272
|
+
approval,
|
|
273
|
+
className,
|
|
274
|
+
...props
|
|
275
|
+
});
|
|
276
|
+
if (!offersInterruptAction(status, approval, interrupt)) return null;
|
|
277
|
+
const promptText = approval?.prompt ? /* @__PURE__ */ jsx("p", {
|
|
278
|
+
className: "aui-tool-fallback-approval-prompt text-foreground whitespace-pre-line",
|
|
279
|
+
children: approval.prompt
|
|
280
|
+
}) : null;
|
|
281
|
+
if (!canAnswer) return promptText && /* @__PURE__ */ jsx("div", {
|
|
282
|
+
"data-slot": "tool-fallback-approval",
|
|
283
|
+
className: cn("aui-tool-fallback-approval flex flex-col gap-2 pt-1", className),
|
|
284
|
+
...props,
|
|
285
|
+
children: promptText
|
|
286
|
+
});
|
|
287
|
+
const declaredOptions = respondToApproval ? approval?.options : void 0;
|
|
288
|
+
const acceptsText = approval != null && respondToApproval != null && toolApprovalAcceptsText(approval);
|
|
289
|
+
const submit = (send) => {
|
|
290
|
+
setSubmitted(true);
|
|
291
|
+
setError(null);
|
|
292
|
+
(async () => {
|
|
293
|
+
try {
|
|
294
|
+
await send();
|
|
295
|
+
} catch (sendError) {
|
|
296
|
+
setSubmitted(false);
|
|
297
|
+
setError(sendError instanceof Error ? sendError.message : String(sendError));
|
|
298
|
+
}
|
|
299
|
+
})();
|
|
300
|
+
};
|
|
301
|
+
const respond = (approved) => {
|
|
302
|
+
if (locked) return;
|
|
303
|
+
if (approval != null && approval.approved === void 0 && respondToApproval) submit(() => respondToApproval({
|
|
304
|
+
approved,
|
|
305
|
+
...typedNote()
|
|
306
|
+
}));
|
|
307
|
+
else if (interrupt) submit(() => resume?.({ approved }));
|
|
308
|
+
else if (status?.type === "requires-action" && status.reason === "interrupt") return;
|
|
309
|
+
else submit(() => addResult?.(approved ? APPROVED_RESULT : DENIED_RESULT));
|
|
310
|
+
};
|
|
311
|
+
const respondWithOption = (option) => {
|
|
312
|
+
if (locked) return;
|
|
313
|
+
setConfirmingId(null);
|
|
314
|
+
submit(() => respondToApproval?.(isKnownKind(option.kind) ? {
|
|
315
|
+
optionId: option.id,
|
|
316
|
+
...typedNote()
|
|
317
|
+
} : {
|
|
318
|
+
optionId: option.id,
|
|
319
|
+
approved: true,
|
|
320
|
+
...typedNote()
|
|
321
|
+
}));
|
|
322
|
+
};
|
|
323
|
+
const typedNote = () => answer.trim() ? { text: answer } : {};
|
|
324
|
+
const submitAnswer = () => {
|
|
325
|
+
if (locked) return;
|
|
326
|
+
submit(() => respondToApproval?.({ text: answer }));
|
|
327
|
+
};
|
|
328
|
+
const dismiss = () => {
|
|
329
|
+
if (locked) return;
|
|
330
|
+
submit(() => respondToApproval?.({ approved: false }));
|
|
331
|
+
};
|
|
332
|
+
const handleOption = (option) => {
|
|
333
|
+
if (option.confirm) setConfirmingId(option.id);
|
|
334
|
+
else respondWithOption(option);
|
|
335
|
+
};
|
|
336
|
+
const confirming = confirmingId != null ? declaredOptions?.find((o) => o.id === confirmingId) : void 0;
|
|
337
|
+
const question = isQuestion(approval);
|
|
338
|
+
const dismissButton = question && respondToApproval != null && approval?.dismissible === true ? /* @__PURE__ */ jsx(Button, {
|
|
339
|
+
size: "sm",
|
|
340
|
+
variant: "outline",
|
|
341
|
+
className: pressable,
|
|
342
|
+
onClick: dismiss,
|
|
343
|
+
disabled: locked,
|
|
344
|
+
children: "Dismiss"
|
|
345
|
+
}) : null;
|
|
346
|
+
const errorText = error ? /* @__PURE__ */ jsx("p", {
|
|
347
|
+
role: "alert",
|
|
348
|
+
className: "aui-tool-fallback-approval-error text-destructive text-xs whitespace-pre-line",
|
|
349
|
+
children: error
|
|
350
|
+
}) : null;
|
|
351
|
+
const answerField = acceptsText ? /* @__PURE__ */ jsxs("div", {
|
|
352
|
+
className: "aui-tool-fallback-approval-answer flex flex-col items-start gap-2",
|
|
353
|
+
children: [/* @__PURE__ */ jsx(Textarea, {
|
|
354
|
+
value: answer,
|
|
355
|
+
onChange: (event) => setAnswer(event.target.value),
|
|
356
|
+
disabled: locked,
|
|
357
|
+
"aria-label": question ? approval?.prompt ?? "Answer" : "Note",
|
|
358
|
+
placeholder: question ? "Type your answer" : "Add a note to your decision"
|
|
359
|
+
}), question && /* @__PURE__ */ jsxs("div", {
|
|
360
|
+
className: "flex items-center gap-2",
|
|
361
|
+
children: [/* @__PURE__ */ jsx(Button, {
|
|
362
|
+
size: "sm",
|
|
363
|
+
className: pressable,
|
|
364
|
+
onClick: submitAnswer,
|
|
365
|
+
disabled: locked,
|
|
366
|
+
children: "Send"
|
|
367
|
+
}), dismissButton]
|
|
368
|
+
})]
|
|
369
|
+
}) : null;
|
|
370
|
+
if (confirming) {
|
|
371
|
+
const confirmMeta = typeof confirming.confirm === "object" ? confirming.confirm : void 0;
|
|
372
|
+
const confirmDescription = confirmMeta?.description ?? confirming.description;
|
|
373
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
374
|
+
"data-slot": "tool-fallback-approval-confirm",
|
|
375
|
+
className: cn("aui-tool-fallback-approval-confirm flex flex-col gap-2 pt-1", className),
|
|
376
|
+
...props,
|
|
377
|
+
children: [
|
|
378
|
+
/* @__PURE__ */ jsx("p", {
|
|
379
|
+
className: "aui-tool-fallback-approval-confirm-title font-semibold",
|
|
380
|
+
children: confirmMeta?.title ?? `${approvalOptionLabel(confirming)}?`
|
|
381
|
+
}),
|
|
382
|
+
confirmDescription && /* @__PURE__ */ jsx("p", {
|
|
383
|
+
className: "aui-tool-fallback-approval-confirm-description text-muted-foreground whitespace-pre-line",
|
|
384
|
+
children: confirmDescription
|
|
385
|
+
}),
|
|
386
|
+
confirming.grants && confirming.grants.length > 0 && /* @__PURE__ */ jsx("ul", {
|
|
387
|
+
className: "aui-tool-fallback-approval-confirm-grants flex flex-col gap-1",
|
|
388
|
+
children: confirming.grants.map((grant) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx("code", {
|
|
389
|
+
className: "aui-tool-fallback-approval-confirm-grant bg-muted rounded px-1.5 py-0.5 text-xs",
|
|
390
|
+
children: grant
|
|
391
|
+
}) }, grant))
|
|
392
|
+
}),
|
|
393
|
+
/* @__PURE__ */ jsxs("div", {
|
|
394
|
+
className: "flex items-center gap-2",
|
|
395
|
+
children: [/* @__PURE__ */ jsx(Button, {
|
|
396
|
+
size: "sm",
|
|
397
|
+
className: pressable,
|
|
398
|
+
onClick: () => respondWithOption(confirming),
|
|
399
|
+
disabled: locked,
|
|
400
|
+
children: "Confirm"
|
|
401
|
+
}), /* @__PURE__ */ jsx(Button, {
|
|
402
|
+
size: "sm",
|
|
403
|
+
variant: "outline",
|
|
404
|
+
className: pressable,
|
|
405
|
+
onClick: () => setConfirmingId(null),
|
|
406
|
+
disabled: locked,
|
|
407
|
+
children: "Back"
|
|
408
|
+
})]
|
|
409
|
+
})
|
|
410
|
+
]
|
|
411
|
+
});
|
|
412
|
+
}
|
|
413
|
+
if (declaredOptions && declaredOptions.length > 0) {
|
|
414
|
+
const allowOptions = declaredOptions.filter((o) => isAllowKind(o.kind));
|
|
415
|
+
const customOptions = declaredOptions.filter((o) => !isKnownKind(o.kind));
|
|
416
|
+
const rejectOptions = declaredOptions.filter((o) => isKnownKind(o.kind) && !isAllowKind(o.kind));
|
|
417
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
418
|
+
"data-slot": "tool-fallback-approval",
|
|
419
|
+
className: cn("aui-tool-fallback-approval flex flex-col gap-2 pt-1", className),
|
|
420
|
+
...props,
|
|
421
|
+
children: [
|
|
422
|
+
promptText,
|
|
423
|
+
/* @__PURE__ */ jsxs("div", {
|
|
424
|
+
className: "flex flex-wrap items-center gap-2",
|
|
425
|
+
children: [
|
|
426
|
+
[
|
|
427
|
+
...allowOptions,
|
|
428
|
+
...customOptions,
|
|
429
|
+
...rejectOptions
|
|
430
|
+
].map((option) => /* @__PURE__ */ jsx(Button, {
|
|
431
|
+
size: "sm",
|
|
432
|
+
variant: option === allowOptions[0] ? "default" : "outline",
|
|
433
|
+
className: pressable,
|
|
434
|
+
onClick: () => handleOption(option),
|
|
435
|
+
disabled: locked,
|
|
436
|
+
children: approvalOptionLabel(option)
|
|
437
|
+
}, option.id)),
|
|
438
|
+
rejectOptions.length === 0 && !question && /* @__PURE__ */ jsx(Button, {
|
|
439
|
+
size: "sm",
|
|
440
|
+
variant: "outline",
|
|
441
|
+
className: pressable,
|
|
442
|
+
onClick: () => respond(false),
|
|
443
|
+
disabled: locked,
|
|
444
|
+
children: "Deny"
|
|
445
|
+
}),
|
|
446
|
+
!acceptsText && dismissButton
|
|
447
|
+
]
|
|
448
|
+
}),
|
|
449
|
+
answerField,
|
|
450
|
+
errorText
|
|
451
|
+
]
|
|
452
|
+
});
|
|
453
|
+
}
|
|
454
|
+
if (question) return /* @__PURE__ */ jsxs("div", {
|
|
455
|
+
"data-slot": "tool-fallback-approval",
|
|
456
|
+
className: cn("aui-tool-fallback-approval flex flex-col gap-2 pt-1", className),
|
|
457
|
+
...props,
|
|
458
|
+
children: [
|
|
459
|
+
promptText,
|
|
460
|
+
answerField,
|
|
461
|
+
!acceptsText && dismissButton && /* @__PURE__ */ jsx("div", {
|
|
462
|
+
className: "flex items-center gap-2",
|
|
463
|
+
children: dismissButton
|
|
464
|
+
}),
|
|
465
|
+
errorText
|
|
466
|
+
]
|
|
467
|
+
});
|
|
468
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
469
|
+
"data-slot": "tool-fallback-approval",
|
|
470
|
+
className: cn("aui-tool-fallback-approval flex flex-col gap-2 pt-1", className),
|
|
471
|
+
...props,
|
|
472
|
+
children: [
|
|
473
|
+
promptText,
|
|
474
|
+
/* @__PURE__ */ jsxs("div", {
|
|
475
|
+
className: "flex items-center gap-2",
|
|
476
|
+
children: [/* @__PURE__ */ jsx(Button, {
|
|
477
|
+
size: "sm",
|
|
478
|
+
className: pressable,
|
|
479
|
+
onClick: () => respond(true),
|
|
480
|
+
disabled: locked,
|
|
481
|
+
children: "Allow"
|
|
482
|
+
}), /* @__PURE__ */ jsx(Button, {
|
|
483
|
+
size: "sm",
|
|
484
|
+
variant: "outline",
|
|
485
|
+
className: pressable,
|
|
486
|
+
onClick: () => respond(false),
|
|
487
|
+
disabled: locked,
|
|
488
|
+
children: "Deny"
|
|
489
|
+
})]
|
|
490
|
+
}),
|
|
491
|
+
answerField,
|
|
492
|
+
errorText
|
|
493
|
+
]
|
|
494
|
+
});
|
|
495
|
+
}
|
|
496
|
+
const ToolFallbackImpl = ({ toolName, argsText, result, status, addResult, resume, interrupt, approval, respondToApproval }) => {
|
|
497
|
+
const isCancelled = status?.type === "incomplete" && status.reason === "cancelled";
|
|
498
|
+
const isRequiresAction = status?.type === "requires-action";
|
|
499
|
+
const shouldRenderApproval = isRequiresAction && offersInterruptAction(status, approval, interrupt);
|
|
500
|
+
const wasDenied = approval != null && approval.approved === false;
|
|
501
|
+
const [open, setOpen] = useState(isRequiresAction);
|
|
502
|
+
const [prevRequiresAction, setPrevRequiresAction] = useState(isRequiresAction);
|
|
503
|
+
if (isRequiresAction !== prevRequiresAction) {
|
|
504
|
+
setPrevRequiresAction(isRequiresAction);
|
|
505
|
+
if (isRequiresAction) setOpen(true);
|
|
506
|
+
}
|
|
507
|
+
return /* @__PURE__ */ jsxs(ToolFallbackRoot, {
|
|
508
|
+
open,
|
|
509
|
+
onOpenChange: setOpen,
|
|
510
|
+
children: [/* @__PURE__ */ jsx(ToolFallbackTrigger, {
|
|
511
|
+
toolName,
|
|
512
|
+
status,
|
|
513
|
+
denied: wasDenied
|
|
514
|
+
}), /* @__PURE__ */ jsxs(ToolFallbackContent, { children: [
|
|
515
|
+
/* @__PURE__ */ jsx(ToolFallbackError, { status }),
|
|
516
|
+
/* @__PURE__ */ jsx(ToolFallbackArgs, {
|
|
517
|
+
argsText,
|
|
518
|
+
className: cn(isCancelled && "opacity-60")
|
|
519
|
+
}),
|
|
520
|
+
(shouldRenderApproval || isSettled(approval)) && /* @__PURE__ */ jsx(ToolFallbackApproval, {
|
|
521
|
+
addResult,
|
|
522
|
+
resume,
|
|
523
|
+
interrupt,
|
|
524
|
+
approval,
|
|
525
|
+
respondToApproval,
|
|
526
|
+
status
|
|
527
|
+
}),
|
|
528
|
+
/* @__PURE__ */ jsx(ToolFallbackResult, { result })
|
|
529
|
+
] })]
|
|
530
|
+
});
|
|
531
|
+
};
|
|
532
|
+
const ToolFallback = memo(ToolFallbackImpl);
|
|
533
|
+
ToolFallback.displayName = "ToolFallback";
|
|
534
|
+
ToolFallback.Root = ToolFallbackRoot;
|
|
535
|
+
ToolFallback.Trigger = ToolFallbackTrigger;
|
|
536
|
+
ToolFallback.Content = ToolFallbackContent;
|
|
537
|
+
ToolFallback.Args = ToolFallbackArgs;
|
|
538
|
+
ToolFallback.Result = ToolFallbackResult;
|
|
539
|
+
ToolFallback.Error = ToolFallbackError;
|
|
540
|
+
ToolFallback.Approval = ToolFallbackApproval;
|
|
541
|
+
//#endregion
|
|
542
|
+
export { ToolFallback, ToolFallbackApproval, ToolFallbackArgs, ToolFallbackContent, ToolFallbackError, ToolFallbackResult, ToolFallbackRoot, ToolFallbackTrigger, formatUnknownValue, offersInterruptAction, tool_fallback_aui_exports };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "../../ui/collapsible.js";
|
|
2
|
+
import { FC, PropsWithChildren } from "react";
|
|
3
|
+
import { VariantProps } from "class-variance-authority";
|
|
4
|
+
declare namespace tool_group_aui_d_exports {
|
|
5
|
+
export { ToolGroup, ToolGroupContent, ToolGroupRoot, ToolGroupRootProps, ToolGroupTrigger, toolGroupVariants };
|
|
6
|
+
}
|
|
7
|
+
declare const toolGroupVariants: (props?: ({
|
|
8
|
+
variant?: "ghost" | "muted" | "outline" | null | undefined;
|
|
9
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
10
|
+
export type ToolGroupRootProps = Omit<React.ComponentProps<typeof Collapsible>, "open" | "onOpenChange"> & VariantProps<typeof toolGroupVariants> & {
|
|
11
|
+
open?: boolean;
|
|
12
|
+
onOpenChange?: (open: boolean) => void;
|
|
13
|
+
defaultOpen?: boolean;
|
|
14
|
+
};
|
|
15
|
+
declare function ToolGroupRoot({ className, variant, open: controlledOpen, onOpenChange: controlledOnOpenChange, defaultOpen, children, ...props }: ToolGroupRootProps): import("react").JSX.Element;
|
|
16
|
+
declare function ToolGroupTrigger({ count, active, className, ...props }: React.ComponentProps<typeof CollapsibleTrigger> & {
|
|
17
|
+
count: number;
|
|
18
|
+
active?: boolean;
|
|
19
|
+
}): import("react").JSX.Element;
|
|
20
|
+
declare function ToolGroupContent({ className, children, ...props }: React.ComponentProps<typeof CollapsibleContent>): import("react").JSX.Element;
|
|
21
|
+
type ToolGroupComponent = FC<PropsWithChildren<{
|
|
22
|
+
startIndex: number;
|
|
23
|
+
endIndex: number;
|
|
24
|
+
}>> & {
|
|
25
|
+
Root: typeof ToolGroupRoot;
|
|
26
|
+
Trigger: typeof ToolGroupTrigger;
|
|
27
|
+
Content: typeof ToolGroupContent;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* @deprecated This wrapper targets the legacy `components.ToolGroup` prop
|
|
31
|
+
* on `<MessagePrimitive.Parts>`. Use `<MessagePrimitive.GroupedParts>` with
|
|
32
|
+
* a `groupBy` returning `"group-tool"` and compose `ToolGroupRoot` /
|
|
33
|
+
* `ToolGroupTrigger` / `ToolGroupContent` directly. See `thread.tsx`.
|
|
34
|
+
*/
|
|
35
|
+
declare const ToolGroup: ToolGroupComponent;
|
|
36
|
+
//#endregion
|
|
37
|
+
export { ToolGroup, ToolGroupContent, ToolGroupRoot, ToolGroupTrigger, toolGroupVariants, tool_group_aui_d_exports };
|