@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,703 @@
|
|
|
1
|
+
import { Alert, AlertDescription, AlertTitle } from "../../../components/ui/alert.js";
|
|
2
|
+
import { Empty, EmptyDescription, EmptyHeader, EmptyTitle } from "../../../components/ui/empty.js";
|
|
3
|
+
import { Skeleton } from "../../../components/ui/skeleton.js";
|
|
4
|
+
import { CheckItem } from "../../../motion/check-item/check-item.js";
|
|
5
|
+
import { ScrubSelect } from "../../../motion/scrub-select/scrub-select.js";
|
|
6
|
+
import { StatusGlyph } from "../../../motion/status-glyph/status-glyph.js";
|
|
7
|
+
import { Stepper } from "../../../motion/stepper/stepper.js";
|
|
8
|
+
import { mono, paper } from "../../../components/assistant-ui/elements/surfaces.js";
|
|
9
|
+
import { formatLatency } from "../usage-meter/usage-format.js";
|
|
10
|
+
import { UsageMeter } from "../usage-meter/usage-meter.js";
|
|
11
|
+
import { ReasoningContent, ReasoningRoot, ReasoningText, ReasoningTrigger } from "../../../components/assistant-ui/elements/reasoning.js";
|
|
12
|
+
import { ToolTimeline } from "../../../components/assistant-ui/elements/tool-timeline.js";
|
|
13
|
+
import { TraceWaterfall } from "../../../components/assistant-ui/elements/trace-waterfall.js";
|
|
14
|
+
import { JsonView } from "./json-view.js";
|
|
15
|
+
import { RUN_STATUS_LABEL, STEP_STATUS_LABEL, attemptMark, attemptsOf, defaultStepId, paragraphsOf, runBounds, stepStatusLabel, stepTiming, timeOf, toSpans } from "./run-model.js";
|
|
16
|
+
import * as React from "react";
|
|
17
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
18
|
+
import { cn } from "cn";
|
|
19
|
+
import { AlertCircleIcon, ChartGanttIcon, CircleCheckIcon, CircleXIcon, ListTreeIcon, RotateCcwIcon } from "lucide-react";
|
|
20
|
+
import { useBoolean, useControllableValue } from "ahooks";
|
|
21
|
+
import { useReducedMotionConfig } from "motion/react";
|
|
22
|
+
//#region src/ai/compositions/run-inspector/run-inspector.tsx
|
|
23
|
+
const timeFormat = new Intl.DateTimeFormat("en-GB", {
|
|
24
|
+
hour: "2-digit",
|
|
25
|
+
minute: "2-digit",
|
|
26
|
+
second: "2-digit"
|
|
27
|
+
});
|
|
28
|
+
function defaultFormatTime(iso) {
|
|
29
|
+
const ms = timeOf(iso);
|
|
30
|
+
return ms === void 0 ? iso : timeFormat.format(ms);
|
|
31
|
+
}
|
|
32
|
+
const RUN_GLYPH = {
|
|
33
|
+
pending: "pending",
|
|
34
|
+
running: "running",
|
|
35
|
+
waiting: "pending",
|
|
36
|
+
succeeded: "done",
|
|
37
|
+
failed: "failed",
|
|
38
|
+
cancelled: "cancelled"
|
|
39
|
+
};
|
|
40
|
+
const STEP_GLYPH = {
|
|
41
|
+
pending: "pending",
|
|
42
|
+
running: "running",
|
|
43
|
+
succeeded: "done",
|
|
44
|
+
failed: "failed",
|
|
45
|
+
skipped: "cancelled"
|
|
46
|
+
};
|
|
47
|
+
const TOOL_GLYPH = {
|
|
48
|
+
running: "running",
|
|
49
|
+
"awaiting-approval": "pending",
|
|
50
|
+
succeeded: "done",
|
|
51
|
+
failed: "failed",
|
|
52
|
+
denied: "cancelled",
|
|
53
|
+
cancelled: "cancelled"
|
|
54
|
+
};
|
|
55
|
+
const TOOL_STATUS_LABEL = {
|
|
56
|
+
running: "Running",
|
|
57
|
+
"awaiting-approval": "Awaiting approval",
|
|
58
|
+
succeeded: "Succeeded",
|
|
59
|
+
failed: "Failed",
|
|
60
|
+
denied: "Denied",
|
|
61
|
+
cancelled: "Cancelled"
|
|
62
|
+
};
|
|
63
|
+
const KIND_LABEL = {
|
|
64
|
+
message: "Message",
|
|
65
|
+
reasoning: "Reasoning",
|
|
66
|
+
"tool-call": "Tool call",
|
|
67
|
+
approval: "Approval",
|
|
68
|
+
progress: "Progress",
|
|
69
|
+
plan: "Plan",
|
|
70
|
+
error: "Error"
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* A short tag for a step in the timeline: the tool for a call, else its kind,
|
|
74
|
+
* with `#2` and up for a retry, as the waterfall marks it.
|
|
75
|
+
*/
|
|
76
|
+
function chipOf(step) {
|
|
77
|
+
return `${step.toolCall?.name ?? KIND_LABEL[step.kind].toLowerCase()}${attemptMark(step)}`;
|
|
78
|
+
}
|
|
79
|
+
function glyphIcon(status) {
|
|
80
|
+
function Glyph() {
|
|
81
|
+
return /* @__PURE__ */ jsx("span", {
|
|
82
|
+
"aria-hidden": "true",
|
|
83
|
+
className: "flex shrink-0",
|
|
84
|
+
children: /* @__PURE__ */ jsx(StatusGlyph, {
|
|
85
|
+
status,
|
|
86
|
+
size: 14
|
|
87
|
+
})
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
Glyph.displayName = `RunStepGlyph(${status})`;
|
|
91
|
+
return Glyph;
|
|
92
|
+
}
|
|
93
|
+
const GLYPH_ICON = {
|
|
94
|
+
pending: glyphIcon("pending"),
|
|
95
|
+
running: glyphIcon("running"),
|
|
96
|
+
done: glyphIcon("done"),
|
|
97
|
+
failed: glyphIcon("failed"),
|
|
98
|
+
cancelled: glyphIcon("cancelled")
|
|
99
|
+
};
|
|
100
|
+
/** A StatusGlyph with its status in words beside it; the glyph is decoration. */
|
|
101
|
+
function StatusText({ status, children, className }) {
|
|
102
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
103
|
+
className: cn("inline-flex min-w-0 items-center gap-1.5", className),
|
|
104
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
105
|
+
"aria-hidden": "true",
|
|
106
|
+
className: "flex shrink-0",
|
|
107
|
+
children: /* @__PURE__ */ jsx(StatusGlyph, {
|
|
108
|
+
status,
|
|
109
|
+
size: 14
|
|
110
|
+
})
|
|
111
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
112
|
+
className: "min-w-0",
|
|
113
|
+
children
|
|
114
|
+
})]
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* A line of facts separated by middle dots. Each fact carries its dot in
|
|
119
|
+
* front, and the row is pulled one dot-width to the start inside a clipping
|
|
120
|
+
* box: whichever fact starts a line has its dot clipped off, so a wrapped line
|
|
121
|
+
* neither starts nor ends with a dot.
|
|
122
|
+
*/
|
|
123
|
+
function FactLine({ facts, className }) {
|
|
124
|
+
const shown = facts.filter((fact) => fact !== null && fact !== void 0 && fact !== false);
|
|
125
|
+
return /* @__PURE__ */ jsx("p", {
|
|
126
|
+
className: cn("text-xs text-muted-foreground", className),
|
|
127
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
128
|
+
className: "block overflow-hidden",
|
|
129
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
130
|
+
className: "-ms-4 flex flex-wrap items-center gap-y-0.5",
|
|
131
|
+
children: shown.map((fact, index) => /* @__PURE__ */ jsxs("span", {
|
|
132
|
+
className: "flex min-w-0 items-center",
|
|
133
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
134
|
+
"aria-hidden": "true",
|
|
135
|
+
className: "w-4 shrink-0 text-center",
|
|
136
|
+
children: "·"
|
|
137
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
138
|
+
className: "min-w-0",
|
|
139
|
+
children: fact
|
|
140
|
+
})]
|
|
141
|
+
}, index))
|
|
142
|
+
})
|
|
143
|
+
})
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
function ErrorAlert({ error, title }) {
|
|
147
|
+
const details = [error.code ? /* @__PURE__ */ jsx("span", {
|
|
148
|
+
className: mono,
|
|
149
|
+
children: error.code
|
|
150
|
+
}, "code") : null, error.retryable === void 0 ? null : error.retryable ? "Retryable" : "Not retryable"].filter((item) => item !== null);
|
|
151
|
+
return /* @__PURE__ */ jsxs(Alert, {
|
|
152
|
+
variant: "destructive",
|
|
153
|
+
"data-slot": "run-inspector-error",
|
|
154
|
+
children: [
|
|
155
|
+
/* @__PURE__ */ jsx(AlertCircleIcon, { "aria-hidden": "true" }),
|
|
156
|
+
/* @__PURE__ */ jsx(AlertTitle, { children: title }),
|
|
157
|
+
/* @__PURE__ */ jsxs(AlertDescription, {
|
|
158
|
+
className: "flex flex-col gap-0.5 [&_p:not(:last-child)]:mb-0",
|
|
159
|
+
children: [/* @__PURE__ */ jsx("p", { children: error.message }), details.length > 0 ? /* @__PURE__ */ jsx("p", {
|
|
160
|
+
className: "flex flex-wrap items-center gap-x-1.5",
|
|
161
|
+
children: details.map((detail, index) => /* @__PURE__ */ jsxs(React.Fragment, { children: [index > 0 ? /* @__PURE__ */ jsx("span", {
|
|
162
|
+
"aria-hidden": "true",
|
|
163
|
+
children: "·"
|
|
164
|
+
}) : null, detail] }, index))
|
|
165
|
+
}) : null]
|
|
166
|
+
})
|
|
167
|
+
]
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
/** "Approved by Kevin at 09:02", worded from the record. */
|
|
171
|
+
function decisionLine(approval, formatTime) {
|
|
172
|
+
const by = approval.decidedBy ? ` by ${approval.decidedBy}` : "";
|
|
173
|
+
const at = ` at ${formatTime(approval.decidedAt)}`;
|
|
174
|
+
if (approval.decision === "rejected") return `Denied${by}${at}`;
|
|
175
|
+
if (approval.byStandingPermission) return `Allowed by standing permission${at}`;
|
|
176
|
+
return `Approved${approval.amendedArgs ? " with edits" : ""}${by}${at}`;
|
|
177
|
+
}
|
|
178
|
+
function Decision({ approval, formatTime }) {
|
|
179
|
+
const rejected = approval.decision === "rejected";
|
|
180
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
181
|
+
"data-slot": "run-inspector-decision",
|
|
182
|
+
className: "flex flex-col gap-1",
|
|
183
|
+
children: [/* @__PURE__ */ jsxs("p", {
|
|
184
|
+
className: "flex items-center gap-1.5 text-xs text-foreground",
|
|
185
|
+
children: [/* @__PURE__ */ jsx(rejected ? CircleXIcon : CircleCheckIcon, {
|
|
186
|
+
"aria-hidden": "true",
|
|
187
|
+
className: cn("size-3.5 shrink-0", rejected ? "text-destructive" : "text-chart-2")
|
|
188
|
+
}), decisionLine(approval, formatTime)]
|
|
189
|
+
}), approval.reason ? /* @__PURE__ */ jsx("blockquote", {
|
|
190
|
+
className: "border-border border-s-2 ps-2.5 text-xs text-muted-foreground",
|
|
191
|
+
children: approval.reason
|
|
192
|
+
}) : null]
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
/** A labeled block in the step detail. */
|
|
196
|
+
function Block({ title, children, className }) {
|
|
197
|
+
const id = React.useId();
|
|
198
|
+
return /* @__PURE__ */ jsxs("section", {
|
|
199
|
+
"aria-labelledby": id,
|
|
200
|
+
className: cn("flex min-w-0 flex-col gap-1.5", className),
|
|
201
|
+
children: [/* @__PURE__ */ jsx("h4", {
|
|
202
|
+
id,
|
|
203
|
+
className: "text-xs font-medium text-muted-foreground",
|
|
204
|
+
children: title
|
|
205
|
+
}), children]
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
function ToolCallBody({ toolCall, formatTime }) {
|
|
209
|
+
const unfinished = toolCall.status === "running" || toolCall.status === "awaiting-approval";
|
|
210
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
211
|
+
/* @__PURE__ */ jsxs("div", {
|
|
212
|
+
className: "flex flex-wrap items-center gap-x-2.5 gap-y-1.5",
|
|
213
|
+
children: [
|
|
214
|
+
/* @__PURE__ */ jsx("code", {
|
|
215
|
+
className: cn(mono, "rounded-md bg-foreground/[0.06] px-1.5 py-0.5 text-foreground/80 [overflow-wrap:anywhere]"),
|
|
216
|
+
children: toolCall.name
|
|
217
|
+
}),
|
|
218
|
+
/* @__PURE__ */ jsx(StatusText, {
|
|
219
|
+
status: TOOL_GLYPH[toolCall.status],
|
|
220
|
+
className: "text-xs text-foreground",
|
|
221
|
+
children: TOOL_STATUS_LABEL[toolCall.status]
|
|
222
|
+
}),
|
|
223
|
+
toolCall.dangerous ? /* @__PURE__ */ jsxs("span", {
|
|
224
|
+
className: "inline-flex items-center gap-1.5 text-xs text-destructive",
|
|
225
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
226
|
+
"aria-hidden": "true",
|
|
227
|
+
className: "size-1.5 shrink-0 rounded-full bg-destructive"
|
|
228
|
+
}), "Dangerous"]
|
|
229
|
+
}) : null
|
|
230
|
+
]
|
|
231
|
+
}),
|
|
232
|
+
toolCall.approval ? /* @__PURE__ */ jsx(Decision, {
|
|
233
|
+
approval: toolCall.approval,
|
|
234
|
+
formatTime
|
|
235
|
+
}) : toolCall.status === "awaiting-approval" ? /* @__PURE__ */ jsx("p", {
|
|
236
|
+
className: "text-xs text-muted-foreground",
|
|
237
|
+
children: "Waiting for the owner's decision."
|
|
238
|
+
}) : null,
|
|
239
|
+
toolCall.error ? /* @__PURE__ */ jsx(ErrorAlert, {
|
|
240
|
+
error: toolCall.error,
|
|
241
|
+
title: "The call failed"
|
|
242
|
+
}) : null,
|
|
243
|
+
/* @__PURE__ */ jsx(Block, {
|
|
244
|
+
title: "Input",
|
|
245
|
+
children: /* @__PURE__ */ jsx(JsonView, {
|
|
246
|
+
value: toolCall.args,
|
|
247
|
+
label: `${toolCall.name} input`
|
|
248
|
+
})
|
|
249
|
+
}),
|
|
250
|
+
toolCall.approval?.amendedArgs ? /* @__PURE__ */ jsx(Block, {
|
|
251
|
+
title: "Input as approved",
|
|
252
|
+
children: /* @__PURE__ */ jsx(JsonView, {
|
|
253
|
+
value: toolCall.approval.amendedArgs,
|
|
254
|
+
label: `${toolCall.name} input as approved`
|
|
255
|
+
})
|
|
256
|
+
}) : null,
|
|
257
|
+
/* @__PURE__ */ jsx(Block, {
|
|
258
|
+
title: "Result",
|
|
259
|
+
children: toolCall.result !== void 0 ? /* @__PURE__ */ jsx(JsonView, {
|
|
260
|
+
value: toolCall.result,
|
|
261
|
+
label: `${toolCall.name} result`
|
|
262
|
+
}) : /* @__PURE__ */ jsx("p", {
|
|
263
|
+
className: "text-xs text-muted-foreground",
|
|
264
|
+
children: unfinished ? "No result yet." : "No result recorded."
|
|
265
|
+
})
|
|
266
|
+
})
|
|
267
|
+
] });
|
|
268
|
+
}
|
|
269
|
+
function PlanBody({ plan }) {
|
|
270
|
+
const doneCount = plan.filter((item) => item.done).length;
|
|
271
|
+
const current = plan.findIndex((item) => !item.done);
|
|
272
|
+
const completed = current === -1;
|
|
273
|
+
const checklist = /* @__PURE__ */ jsx("ul", {
|
|
274
|
+
"aria-label": "Plan items",
|
|
275
|
+
className: "flex flex-col gap-1",
|
|
276
|
+
children: plan.map((item) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(CheckItem, {
|
|
277
|
+
label: item.label,
|
|
278
|
+
description: item.description,
|
|
279
|
+
checked: item.done,
|
|
280
|
+
"aria-readonly": "true",
|
|
281
|
+
tabIndex: -1,
|
|
282
|
+
className: "pointer-events-none"
|
|
283
|
+
}) }, item.id))
|
|
284
|
+
});
|
|
285
|
+
if (plan.length === 0) return /* @__PURE__ */ jsx("p", {
|
|
286
|
+
className: "text-xs text-muted-foreground",
|
|
287
|
+
children: "The plan has no items."
|
|
288
|
+
});
|
|
289
|
+
return /* @__PURE__ */ jsx(Block, {
|
|
290
|
+
title: `Plan, ${doneCount} of ${plan.length} done`,
|
|
291
|
+
children: /* @__PURE__ */ jsx(Stepper, {
|
|
292
|
+
label: "Plan progress",
|
|
293
|
+
navigation: false,
|
|
294
|
+
clickableSteps: false,
|
|
295
|
+
step: completed ? plan.length - 1 : current,
|
|
296
|
+
completed,
|
|
297
|
+
completionTitle: "Plan complete",
|
|
298
|
+
completion: checklist,
|
|
299
|
+
className: "gap-4 [&_[data-slot=stepper-panel]>h3]:text-sm [&_[data-slot=stepper-panel]>h3]:font-medium [&_[data-slot=stepper-panel]>p]:text-xs",
|
|
300
|
+
steps: plan.map((item, index) => ({
|
|
301
|
+
id: item.id,
|
|
302
|
+
title: item.label,
|
|
303
|
+
description: `Step ${index + 1} of ${plan.length}`,
|
|
304
|
+
content: checklist
|
|
305
|
+
}))
|
|
306
|
+
})
|
|
307
|
+
});
|
|
308
|
+
}
|
|
309
|
+
function StepBody({ step, timing, formatTime }) {
|
|
310
|
+
switch (step.kind) {
|
|
311
|
+
case "tool-call": return step.toolCall ? /* @__PURE__ */ jsx(ToolCallBody, {
|
|
312
|
+
toolCall: step.toolCall,
|
|
313
|
+
formatTime
|
|
314
|
+
}) : null;
|
|
315
|
+
case "reasoning": {
|
|
316
|
+
const seconds = timing.durationMs !== void 0 && !timing.open ? Math.max(1, Math.round(timing.durationMs / 1e3)) : void 0;
|
|
317
|
+
return step.text ? /* @__PURE__ */ jsxs(ReasoningRoot, {
|
|
318
|
+
variant: "muted",
|
|
319
|
+
defaultOpen: true,
|
|
320
|
+
streaming: step.status === "running",
|
|
321
|
+
className: "mb-0",
|
|
322
|
+
children: [/* @__PURE__ */ jsx(ReasoningTrigger, {
|
|
323
|
+
active: step.status === "running",
|
|
324
|
+
...seconds !== void 0 ? { duration: seconds } : {}
|
|
325
|
+
}), /* @__PURE__ */ jsx(ReasoningContent, { children: /* @__PURE__ */ jsx(ReasoningText, {
|
|
326
|
+
className: "text-xs/relaxed",
|
|
327
|
+
children: paragraphsOf(step.text).map((paragraph) => /* @__PURE__ */ jsx("p", { children: paragraph }, paragraph))
|
|
328
|
+
}) })]
|
|
329
|
+
}) : null;
|
|
330
|
+
}
|
|
331
|
+
case "message":
|
|
332
|
+
case "progress":
|
|
333
|
+
case "error": return step.text ? /* @__PURE__ */ jsx("div", {
|
|
334
|
+
className: cn("flex flex-col gap-2 text-xs/relaxed text-foreground wrap-break-word", step.kind === "message" && "rounded-xl bg-muted px-3 py-2.5"),
|
|
335
|
+
children: paragraphsOf(step.text).map((paragraph) => /* @__PURE__ */ jsx("p", {
|
|
336
|
+
className: "whitespace-pre-wrap",
|
|
337
|
+
children: paragraph
|
|
338
|
+
}, paragraph))
|
|
339
|
+
}) : null;
|
|
340
|
+
case "approval": return step.approval ? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Decision, {
|
|
341
|
+
approval: step.approval,
|
|
342
|
+
formatTime
|
|
343
|
+
}), step.approval.amendedArgs ? /* @__PURE__ */ jsx(Block, {
|
|
344
|
+
title: "Input as approved",
|
|
345
|
+
children: /* @__PURE__ */ jsx(JsonView, {
|
|
346
|
+
value: step.approval.amendedArgs,
|
|
347
|
+
label: "Input as approved"
|
|
348
|
+
})
|
|
349
|
+
}) : null] }) : null;
|
|
350
|
+
case "plan": return step.plan ? /* @__PURE__ */ jsx(PlanBody, { plan: step.plan }) : null;
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
function StepDetail({ step, steps, bounds, formatTime, onSelect }) {
|
|
354
|
+
const titleId = React.useId();
|
|
355
|
+
const timing = stepTiming(step, bounds);
|
|
356
|
+
const attempts = attemptsOf(step, steps);
|
|
357
|
+
const duration = timing.durationMs === void 0 ? null : timing.open ? `Running for ${formatLatency(timing.durationMs)}` : `Took ${formatLatency(timing.durationMs)}`;
|
|
358
|
+
return /* @__PURE__ */ jsxs("section", {
|
|
359
|
+
"aria-labelledby": titleId,
|
|
360
|
+
"data-slot": "run-inspector-detail",
|
|
361
|
+
"data-step-id": step.id,
|
|
362
|
+
className: cn(paper, "flex min-w-0 flex-col gap-4 rounded-2xl p-4"),
|
|
363
|
+
children: [
|
|
364
|
+
/* @__PURE__ */ jsxs("header", {
|
|
365
|
+
className: "flex min-w-0 flex-col gap-1",
|
|
366
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
367
|
+
className: "flex min-w-0 items-start gap-2",
|
|
368
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
369
|
+
"aria-hidden": "true",
|
|
370
|
+
className: "mt-px flex shrink-0",
|
|
371
|
+
children: /* @__PURE__ */ jsx(StatusGlyph, {
|
|
372
|
+
status: STEP_GLYPH[step.status],
|
|
373
|
+
size: 16
|
|
374
|
+
})
|
|
375
|
+
}), /* @__PURE__ */ jsx("h3", {
|
|
376
|
+
id: titleId,
|
|
377
|
+
className: "min-w-0 text-sm font-medium text-foreground wrap-break-word",
|
|
378
|
+
children: step.label
|
|
379
|
+
})]
|
|
380
|
+
}), /* @__PURE__ */ jsx(FactLine, {
|
|
381
|
+
className: "ps-6",
|
|
382
|
+
facts: [
|
|
383
|
+
stepStatusLabel(step),
|
|
384
|
+
KIND_LABEL[step.kind],
|
|
385
|
+
/* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
386
|
+
"Started ",
|
|
387
|
+
/* @__PURE__ */ jsx("time", {
|
|
388
|
+
dateTime: step.startedAt,
|
|
389
|
+
children: formatTime(step.startedAt)
|
|
390
|
+
}),
|
|
391
|
+
/* @__PURE__ */ jsxs("span", {
|
|
392
|
+
className: "tabular-nums",
|
|
393
|
+
children: [
|
|
394
|
+
" (+",
|
|
395
|
+
formatLatency(timing.offsetMs),
|
|
396
|
+
")"
|
|
397
|
+
]
|
|
398
|
+
})
|
|
399
|
+
] }),
|
|
400
|
+
duration,
|
|
401
|
+
(step.attempt ?? 1) > 1 ? `Attempt ${step.attempt}` : null
|
|
402
|
+
]
|
|
403
|
+
})]
|
|
404
|
+
}),
|
|
405
|
+
attempts.length > 1 ? /* @__PURE__ */ jsxs("nav", {
|
|
406
|
+
"aria-label": "Attempts",
|
|
407
|
+
className: "flex flex-wrap items-center gap-1.5",
|
|
408
|
+
children: [/* @__PURE__ */ jsx(RotateCcwIcon, {
|
|
409
|
+
"aria-hidden": "true",
|
|
410
|
+
className: "size-3.5 text-muted-foreground"
|
|
411
|
+
}), attempts.map((attempt) => {
|
|
412
|
+
const current = attempt.id === step.id;
|
|
413
|
+
return /* @__PURE__ */ jsxs("button", {
|
|
414
|
+
type: "button",
|
|
415
|
+
"aria-current": current ? "true" : void 0,
|
|
416
|
+
"aria-label": `Attempt ${attempt.attempt ?? 1}, ${STEP_STATUS_LABEL[attempt.status].toLowerCase()}`,
|
|
417
|
+
onClick: () => onSelect(attempt.id),
|
|
418
|
+
className: cn("inline-flex h-6 items-center gap-1.5 rounded-md border px-2 text-xs outline-none transition-colors focus-visible:border-ring focus-visible:bg-foreground/[0.04] focus-visible:text-foreground", current ? "border-foreground/20 bg-foreground/[0.06] text-foreground" : "border-border text-muted-foreground hover:bg-foreground/[0.04] hover:text-foreground"),
|
|
419
|
+
children: [
|
|
420
|
+
/* @__PURE__ */ jsx("span", {
|
|
421
|
+
"aria-hidden": "true",
|
|
422
|
+
className: "flex",
|
|
423
|
+
children: /* @__PURE__ */ jsx(StatusGlyph, {
|
|
424
|
+
status: STEP_GLYPH[attempt.status],
|
|
425
|
+
size: 12
|
|
426
|
+
})
|
|
427
|
+
}),
|
|
428
|
+
"Attempt ",
|
|
429
|
+
attempt.attempt ?? 1
|
|
430
|
+
]
|
|
431
|
+
}, attempt.id);
|
|
432
|
+
})]
|
|
433
|
+
}) : null,
|
|
434
|
+
step.error && !step.toolCall?.error ? /* @__PURE__ */ jsx(ErrorAlert, {
|
|
435
|
+
error: step.error,
|
|
436
|
+
title: "The step failed"
|
|
437
|
+
}) : null,
|
|
438
|
+
/* @__PURE__ */ jsx(StepBody, {
|
|
439
|
+
step,
|
|
440
|
+
timing,
|
|
441
|
+
formatTime
|
|
442
|
+
}),
|
|
443
|
+
step.status === "pending" && !step.text && !step.toolCall && !step.plan ? /* @__PURE__ */ jsx("p", {
|
|
444
|
+
className: "text-xs text-muted-foreground",
|
|
445
|
+
children: "This step has not started."
|
|
446
|
+
}) : null
|
|
447
|
+
]
|
|
448
|
+
});
|
|
449
|
+
}
|
|
450
|
+
function InspectorSkeleton() {
|
|
451
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
452
|
+
role: "status",
|
|
453
|
+
"data-slot": "run-inspector-loading",
|
|
454
|
+
className: "flex flex-col gap-4",
|
|
455
|
+
children: [
|
|
456
|
+
/* @__PURE__ */ jsx("span", {
|
|
457
|
+
className: "sr-only",
|
|
458
|
+
children: "Loading run"
|
|
459
|
+
}),
|
|
460
|
+
/* @__PURE__ */ jsxs("div", {
|
|
461
|
+
className: "flex flex-col gap-2",
|
|
462
|
+
children: [/* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-2/3" }), /* @__PURE__ */ jsx(Skeleton, { className: "h-3 w-1/2" })]
|
|
463
|
+
}),
|
|
464
|
+
/* @__PURE__ */ jsxs("div", {
|
|
465
|
+
className: "grid gap-4 @3xl/run:grid-cols-2",
|
|
466
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
467
|
+
className: "flex flex-col gap-2.5 rounded-2xl border border-border/60 p-4",
|
|
468
|
+
children: Array.from({ length: 6 }, (_, index) => /* @__PURE__ */ jsx(Skeleton, {
|
|
469
|
+
className: "h-4",
|
|
470
|
+
style: { width: `${88 - index * 7}%` }
|
|
471
|
+
}, index))
|
|
472
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
473
|
+
className: "flex flex-col gap-2.5 rounded-2xl border border-border/60 p-4",
|
|
474
|
+
children: [/* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-1/2" }), /* @__PURE__ */ jsx(Skeleton, { className: "h-24 w-full" })]
|
|
475
|
+
})]
|
|
476
|
+
})
|
|
477
|
+
]
|
|
478
|
+
});
|
|
479
|
+
}
|
|
480
|
+
const VIEW_OPTIONS = [{
|
|
481
|
+
value: "timeline",
|
|
482
|
+
label: "Timeline",
|
|
483
|
+
icon: /* @__PURE__ */ jsx(ListTreeIcon, { "aria-hidden": "true" })
|
|
484
|
+
}, {
|
|
485
|
+
value: "waterfall",
|
|
486
|
+
label: "Waterfall",
|
|
487
|
+
icon: /* @__PURE__ */ jsx(ChartGanttIcon, { "aria-hidden": "true" })
|
|
488
|
+
}];
|
|
489
|
+
/**
|
|
490
|
+
* The timeline of one agent run: its steps, reasoning, tool calls with their
|
|
491
|
+
* input and result, timings, errors and retries, and the run's usage.
|
|
492
|
+
*
|
|
493
|
+
* Two views of the steps, switched with a ScrubSelect: a timeline (the
|
|
494
|
+
* registry's ToolTimeline, one row per step with its StatusGlyph) and a
|
|
495
|
+
* waterfall (the registry's TraceWaterfall, each step a bar on the run's time
|
|
496
|
+
* axis). Either way the steps are a listbox: a click or the arrow keys (Home
|
|
497
|
+
* and End too) select a step, and its detail shows beside the steps on a wide
|
|
498
|
+
* container and below them on a narrow one. Plan steps show their progress
|
|
499
|
+
* with a Stepper and their items with CheckItems.
|
|
500
|
+
*
|
|
501
|
+
* Dumb: the run is a prop, and selection and view are UI state the app may
|
|
502
|
+
* control. It never reads a clock: pass `now` to measure a live run.
|
|
503
|
+
*
|
|
504
|
+
* Scale limit: both views mount every step - neither the timeline nor the
|
|
505
|
+
* waterfall virtualizes - so rendering cost grows with the run's step count.
|
|
506
|
+
*/
|
|
507
|
+
function RunInspector(props) {
|
|
508
|
+
const { run, title = run.objective, label = `Run: ${run.objective}`, selectedStepId: _selectedStepId, defaultSelectedStepId: _defaultSelectedStepId, onSelectedStepChange: _onSelectedStepChange, view: _view, defaultView: _defaultView, onViewChange: _onViewChange, now, formatTime = defaultFormatTime, isLoading = false, error, className, ...rest } = props;
|
|
509
|
+
const reduced = useReducedMotionConfig() ?? false;
|
|
510
|
+
const selection = {};
|
|
511
|
+
if (_selectedStepId !== void 0) selection.selectedStepId = _selectedStepId;
|
|
512
|
+
if (_defaultSelectedStepId !== void 0) selection.defaultSelectedStepId = _defaultSelectedStepId;
|
|
513
|
+
if (_onSelectedStepChange) selection.onSelectedStepChange = _onSelectedStepChange;
|
|
514
|
+
const [selectedState, setSelected] = useControllableValue(selection, {
|
|
515
|
+
valuePropName: "selectedStepId",
|
|
516
|
+
defaultValuePropName: "defaultSelectedStepId",
|
|
517
|
+
trigger: "onSelectedStepChange",
|
|
518
|
+
defaultValue: null
|
|
519
|
+
});
|
|
520
|
+
const viewProps = {};
|
|
521
|
+
if (_view !== void 0) viewProps.view = _view;
|
|
522
|
+
if (_defaultView !== void 0) viewProps.defaultView = _defaultView;
|
|
523
|
+
if (_onViewChange) viewProps.onViewChange = _onViewChange;
|
|
524
|
+
const [view, setView] = useControllableValue(viewProps, {
|
|
525
|
+
valuePropName: "view",
|
|
526
|
+
defaultValuePropName: "defaultView",
|
|
527
|
+
trigger: "onViewChange",
|
|
528
|
+
defaultValue: "timeline"
|
|
529
|
+
});
|
|
530
|
+
const [timelineOpen, timelineToggle] = useBoolean(true);
|
|
531
|
+
const steps = run.steps;
|
|
532
|
+
const bounds = React.useMemo(() => runBounds(run, now), [run, now]);
|
|
533
|
+
const spans = React.useMemo(() => toSpans(run, bounds), [run, bounds]);
|
|
534
|
+
const selectedId = selectedState && steps.some((step) => step.id === selectedState) ? selectedState : defaultStepId(steps);
|
|
535
|
+
const selected = steps.find((step) => step.id === selectedId);
|
|
536
|
+
const timelineSteps = React.useMemo(() => steps.map((step) => ({
|
|
537
|
+
id: step.id,
|
|
538
|
+
verb: step.label,
|
|
539
|
+
chip: chipOf(step),
|
|
540
|
+
icon: GLYPH_ICON[STEP_GLYPH[step.status]],
|
|
541
|
+
label: `${step.label}, ${stepStatusLabel(step).toLowerCase()}, ${chipOf(step)}`
|
|
542
|
+
})), [steps]);
|
|
543
|
+
const detailRef = React.useRef(null);
|
|
544
|
+
const stepsRef = React.useRef(null);
|
|
545
|
+
const pointerSelect = React.useRef(false);
|
|
546
|
+
const select = (id) => {
|
|
547
|
+
setSelected(id);
|
|
548
|
+
if (!pointerSelect.current) return;
|
|
549
|
+
pointerSelect.current = false;
|
|
550
|
+
const detail = detailRef.current;
|
|
551
|
+
const list = stepsRef.current;
|
|
552
|
+
if (!detail || !list) return;
|
|
553
|
+
if (detail.getBoundingClientRect().top >= list.getBoundingClientRect().bottom - 1) requestAnimationFrame(() => detail.scrollIntoView({
|
|
554
|
+
block: "nearest",
|
|
555
|
+
behavior: reduced ? "auto" : "smooth"
|
|
556
|
+
}));
|
|
557
|
+
};
|
|
558
|
+
const durationMs = bounds.end - bounds.start;
|
|
559
|
+
const running = run.status === "running" || run.status === "waiting";
|
|
560
|
+
const finished = run.status !== "pending" && !running;
|
|
561
|
+
const emptyCopy = run.status === "pending" ? "Steps show here once the agent starts." : running ? "Steps show here as the agent works." : "This run ended without recording any steps.";
|
|
562
|
+
const stepCount = `${steps.length} ${steps.length === 1 ? "step" : "steps"}`;
|
|
563
|
+
const showsDuration = steps.length > 0 || bounds.ended;
|
|
564
|
+
const usage = run.usage && showsDuration ? {
|
|
565
|
+
...run.usage,
|
|
566
|
+
latencyMs: void 0
|
|
567
|
+
} : run.usage;
|
|
568
|
+
return /* @__PURE__ */ jsxs("section", {
|
|
569
|
+
"aria-label": label,
|
|
570
|
+
"aria-busy": isLoading || void 0,
|
|
571
|
+
"data-slot": "run-inspector",
|
|
572
|
+
"data-status": run.status,
|
|
573
|
+
className: cn("@container/run flex min-w-0 flex-col gap-4 text-sm", className),
|
|
574
|
+
...rest,
|
|
575
|
+
children: [
|
|
576
|
+
/* @__PURE__ */ jsxs("header", {
|
|
577
|
+
"data-slot": "run-inspector-header",
|
|
578
|
+
className: "flex min-w-0 flex-col gap-2.5",
|
|
579
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
580
|
+
className: cn("flex min-w-0 items-start", title === null ? "gap-3" : "gap-2.5"),
|
|
581
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
582
|
+
"aria-hidden": "true",
|
|
583
|
+
className: cn("flex shrink-0", title !== null && "mt-px"),
|
|
584
|
+
children: /* @__PURE__ */ jsx(StatusGlyph, {
|
|
585
|
+
status: RUN_GLYPH[run.status],
|
|
586
|
+
size: title === null ? 16 : 18
|
|
587
|
+
})
|
|
588
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
589
|
+
className: "flex min-w-0 flex-1 flex-col gap-1",
|
|
590
|
+
children: [title === null ? null : /* @__PURE__ */ jsx("h2", {
|
|
591
|
+
className: "text-sm font-medium leading-snug text-foreground wrap-break-word",
|
|
592
|
+
children: title
|
|
593
|
+
}), /* @__PURE__ */ jsx(FactLine, { facts: [
|
|
594
|
+
/* @__PURE__ */ jsx("span", {
|
|
595
|
+
className: "font-medium text-foreground",
|
|
596
|
+
children: RUN_STATUS_LABEL[run.status]
|
|
597
|
+
}, "status"),
|
|
598
|
+
run.agent,
|
|
599
|
+
/* @__PURE__ */ jsx("span", {
|
|
600
|
+
className: cn(mono, "text-muted-foreground"),
|
|
601
|
+
children: run.kind
|
|
602
|
+
}, "kind"),
|
|
603
|
+
run.startedAt || run.createdAt ? /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
604
|
+
"Started",
|
|
605
|
+
" ",
|
|
606
|
+
/* @__PURE__ */ jsx("time", {
|
|
607
|
+
dateTime: run.startedAt ?? run.createdAt,
|
|
608
|
+
children: formatTime(run.startedAt ?? run.createdAt)
|
|
609
|
+
})
|
|
610
|
+
] }) : null,
|
|
611
|
+
showsDuration ? /* @__PURE__ */ jsxs("span", {
|
|
612
|
+
className: "tabular-nums",
|
|
613
|
+
children: [bounds.ended ? "" : "Running for ", formatLatency(durationMs)]
|
|
614
|
+
}, "duration") : null
|
|
615
|
+
] })]
|
|
616
|
+
})]
|
|
617
|
+
}), usage ? /* @__PURE__ */ jsx(UsageMeter, {
|
|
618
|
+
usage,
|
|
619
|
+
scope: "run",
|
|
620
|
+
className: "ps-7"
|
|
621
|
+
}) : null]
|
|
622
|
+
}),
|
|
623
|
+
error ? /* @__PURE__ */ jsxs(Alert, {
|
|
624
|
+
variant: "destructive",
|
|
625
|
+
"data-slot": "run-inspector-load-error",
|
|
626
|
+
children: [/* @__PURE__ */ jsx(AlertCircleIcon, { "aria-hidden": "true" }), /* @__PURE__ */ jsx(AlertTitle, { children: error })]
|
|
627
|
+
}) : null,
|
|
628
|
+
run.error ? /* @__PURE__ */ jsx(ErrorAlert, {
|
|
629
|
+
error: run.error,
|
|
630
|
+
title: run.status === "failed" ? "The run failed" : "The run reported an error"
|
|
631
|
+
}) : null,
|
|
632
|
+
isLoading && steps.length === 0 ? /* @__PURE__ */ jsx(InspectorSkeleton, {}) : steps.length === 0 ? /* @__PURE__ */ jsx(Empty, {
|
|
633
|
+
"data-slot": "run-inspector-empty",
|
|
634
|
+
className: "border",
|
|
635
|
+
children: /* @__PURE__ */ jsxs(EmptyHeader, { children: [/* @__PURE__ */ jsx(EmptyTitle, { children: finished ? "No steps recorded" : "No steps yet" }), /* @__PURE__ */ jsx(EmptyDescription, { children: emptyCopy })] })
|
|
636
|
+
}) : /* @__PURE__ */ jsxs("div", {
|
|
637
|
+
className: "grid min-w-0 gap-4 @3xl/run:grid-cols-[minmax(0,5fr)_minmax(0,6fr)]",
|
|
638
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
639
|
+
ref: stepsRef,
|
|
640
|
+
"data-slot": "run-inspector-steps",
|
|
641
|
+
className: "flex min-w-0 flex-col gap-2",
|
|
642
|
+
onPointerDownCapture: () => {
|
|
643
|
+
pointerSelect.current = true;
|
|
644
|
+
},
|
|
645
|
+
onKeyDownCapture: () => {
|
|
646
|
+
pointerSelect.current = false;
|
|
647
|
+
},
|
|
648
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
649
|
+
className: "flex items-center justify-between gap-2",
|
|
650
|
+
children: [/* @__PURE__ */ jsx("h3", {
|
|
651
|
+
className: "text-xs font-medium text-muted-foreground",
|
|
652
|
+
children: "Steps"
|
|
653
|
+
}), /* @__PURE__ */ jsx(ScrubSelect, {
|
|
654
|
+
size: "sm",
|
|
655
|
+
label: "View",
|
|
656
|
+
align: "end",
|
|
657
|
+
options: VIEW_OPTIONS,
|
|
658
|
+
value: view,
|
|
659
|
+
onValueChange: (next) => setView(next)
|
|
660
|
+
})]
|
|
661
|
+
}), view === "timeline" ? /* @__PURE__ */ jsx("div", {
|
|
662
|
+
className: cn(paper, "rounded-2xl px-3 py-2"),
|
|
663
|
+
children: /* @__PURE__ */ jsx(ToolTimeline, {
|
|
664
|
+
className: "max-w-none",
|
|
665
|
+
steps: timelineSteps,
|
|
666
|
+
visibleSteps: timelineSteps.length,
|
|
667
|
+
streaming: running,
|
|
668
|
+
open: timelineOpen,
|
|
669
|
+
onOpenChange: timelineToggle.set,
|
|
670
|
+
restingLabel: stepCount,
|
|
671
|
+
activeLabel: `Working, ${stepCount}`,
|
|
672
|
+
stats: [],
|
|
673
|
+
selectedId,
|
|
674
|
+
onSelectedIdChange: select,
|
|
675
|
+
listLabel: "Run steps"
|
|
676
|
+
})
|
|
677
|
+
}) : /* @__PURE__ */ jsx(TraceWaterfall, {
|
|
678
|
+
className: "max-w-none",
|
|
679
|
+
spans,
|
|
680
|
+
totalMs: Math.round(durationMs),
|
|
681
|
+
formatDuration: formatLatency,
|
|
682
|
+
visibleCount: spans.length,
|
|
683
|
+
selectedId,
|
|
684
|
+
onSelectedIdChange: select,
|
|
685
|
+
listLabel: "Run steps"
|
|
686
|
+
})]
|
|
687
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
688
|
+
ref: detailRef,
|
|
689
|
+
className: "flex min-w-0 scroll-mt-4 flex-col @3xl/run:sticky @3xl/run:top-4 @3xl/run:self-start",
|
|
690
|
+
children: selected ? /* @__PURE__ */ jsx(StepDetail, {
|
|
691
|
+
step: selected,
|
|
692
|
+
steps,
|
|
693
|
+
bounds,
|
|
694
|
+
formatTime,
|
|
695
|
+
onSelect: (id) => setSelected(id)
|
|
696
|
+
}) : null
|
|
697
|
+
})]
|
|
698
|
+
})
|
|
699
|
+
]
|
|
700
|
+
});
|
|
701
|
+
}
|
|
702
|
+
//#endregion
|
|
703
|
+
export { RunInspector };
|