@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,626 @@
|
|
|
1
|
+
import { Alert, AlertAction, AlertDescription, AlertTitle } from "../../../components/ui/alert.js";
|
|
2
|
+
import { Spinner } from "../../../components/ui/spinner.js";
|
|
3
|
+
import { Button, buttonVariants } from "../../../components/ui/button.js";
|
|
4
|
+
import { ButtonGroup } from "../../../components/ui/button-group.js";
|
|
5
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuTrigger } from "../../../components/ui/dropdown-menu.js";
|
|
6
|
+
import { Empty, EmptyDescription, EmptyHeader, EmptyTitle } from "../../../components/ui/empty.js";
|
|
7
|
+
import { Skeleton } from "../../../components/ui/skeleton.js";
|
|
8
|
+
import { TRIAGE_TARGET_ATTRIBUTE, TriageKbd, TriageKeyHints, triageShortcuts, useTriageKeyboard } from "../../../lib/triage-keys.js";
|
|
9
|
+
import { SwipeRow } from "../../../motion/swipe-row/swipe-row.js";
|
|
10
|
+
import { ConfidenceMarker } from "../../../components/assistant-ui/elements/confidence-marker.js";
|
|
11
|
+
import * as React from "react";
|
|
12
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { cn } from "cn";
|
|
14
|
+
import { AlertCircleIcon, BellOffIcon, BotIcon, CheckIcon, ChevronDownIcon, ExternalLinkIcon, ThumbsDownIcon, XIcon } from "lucide-react";
|
|
15
|
+
import { useControllableValue, useLatest, useSize } from "ahooks";
|
|
16
|
+
//#region src/ai/compositions/attention-feed/attention-feed.tsx
|
|
17
|
+
/** The snooze presets, in menu order. */
|
|
18
|
+
const ATTENTION_SNOOZE_PRESETS = [
|
|
19
|
+
{
|
|
20
|
+
id: "1-hour",
|
|
21
|
+
label: "In 1 hour"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
id: "tonight",
|
|
25
|
+
label: "Tonight"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
id: "tomorrow",
|
|
29
|
+
label: "Tomorrow"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
id: "next-week",
|
|
33
|
+
label: "Next week"
|
|
34
|
+
}
|
|
35
|
+
];
|
|
36
|
+
const DEFAULT_KEYMAP = {
|
|
37
|
+
a: "accept",
|
|
38
|
+
d: "dismiss",
|
|
39
|
+
n: "not-useful",
|
|
40
|
+
s: "snooze",
|
|
41
|
+
o: "open"
|
|
42
|
+
};
|
|
43
|
+
const ACTION_HINTS = [
|
|
44
|
+
{
|
|
45
|
+
action: "accept",
|
|
46
|
+
label: "accept"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
action: "dismiss",
|
|
50
|
+
label: "dismiss"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
action: "not-useful",
|
|
54
|
+
label: "not useful"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
action: "snooze",
|
|
58
|
+
label: "snooze"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
action: "open",
|
|
62
|
+
label: "open source"
|
|
63
|
+
}
|
|
64
|
+
];
|
|
65
|
+
/** Narrower than this, a card stacks its actions and swipes to accept or dismiss. */
|
|
66
|
+
const NARROW_WIDTH = 512;
|
|
67
|
+
const timeFormat = new Intl.DateTimeFormat("en-GB", {
|
|
68
|
+
hour: "2-digit",
|
|
69
|
+
minute: "2-digit"
|
|
70
|
+
});
|
|
71
|
+
function defaultFormatTime(iso) {
|
|
72
|
+
const date = new Date(iso);
|
|
73
|
+
return Number.isNaN(date.getTime()) ? iso : timeFormat.format(date);
|
|
74
|
+
}
|
|
75
|
+
const itemKey = (itemId) => `item:${itemId}`;
|
|
76
|
+
/**
|
|
77
|
+
* Proactive agent suggestions as cards: each shows its source, its summary
|
|
78
|
+
* underlined by confidence (ConfidenceMarker: hover or focus a claim for its
|
|
79
|
+
* basis), and the suggested action. Accept it, dismiss it (optionally as not
|
|
80
|
+
* useful), snooze it to a preset, or open its source.
|
|
81
|
+
*
|
|
82
|
+
* Keyboard: the same model as DecisionQueue. `j`/`k` or the arrows move the
|
|
83
|
+
* cursor between cards and `keymap` keys act on the card under it, with the
|
|
84
|
+
* keys hinted above the list and on each button. Keys are ignored while focus
|
|
85
|
+
* is in a text field.
|
|
86
|
+
*
|
|
87
|
+
* Decisions are non-optimistic: a card shows pending (`isPending`) until the
|
|
88
|
+
* app removes it, and a failed action shows its error on the card until
|
|
89
|
+
* dismissed. In a feed narrower than 32rem (a phone) each card also swipes:
|
|
90
|
+
* a full swipe dismisses it, and the revealed buttons accept or dismiss.
|
|
91
|
+
*/
|
|
92
|
+
function AttentionFeed(props) {
|
|
93
|
+
const { items, onAccept, onDismiss, onSnooze, onOpenSource, keymap = DEFAULT_KEYMAP, isPending, actionError, onDismissActionError, onArrive, formatTime = defaultFormatTime, label = "Attention feed", isLoading = false, error, emptyLabel = "Nothing needs your attention", className } = props;
|
|
94
|
+
const baseId = React.useId();
|
|
95
|
+
const rootRef = React.useRef(null);
|
|
96
|
+
const size = useSize(rootRef);
|
|
97
|
+
const narrow = size !== void 0 && size.width < NARROW_WIDTH;
|
|
98
|
+
const lastIndex = React.useRef(0);
|
|
99
|
+
const [menu, setMenu] = React.useState(null);
|
|
100
|
+
const [focusedItemId, setFocusedItemId] = useControllableValue(props, {
|
|
101
|
+
valuePropName: "focusedId",
|
|
102
|
+
defaultValuePropName: "defaultFocusedId",
|
|
103
|
+
trigger: "onFocusChange",
|
|
104
|
+
defaultValue: null
|
|
105
|
+
});
|
|
106
|
+
const internalFocus = React.useRef(null);
|
|
107
|
+
const pending = React.useCallback((itemId) => isPending?.(itemId) ?? false, [isPending]);
|
|
108
|
+
const canOpen = (item) => item.sourceHref !== void 0 || onOpenSource !== void 0;
|
|
109
|
+
const offersOpen = items.some(canOpen);
|
|
110
|
+
const hasAction = (action) => action !== "open" || offersOpen;
|
|
111
|
+
const shortcuts = triageShortcuts(keymap, hasAction);
|
|
112
|
+
const shortcutFor = (action) => shortcuts.get(action)?.[0];
|
|
113
|
+
let activeIndex = focusedItemId == null ? -1 : items.findIndex((i) => i.id === focusedItemId);
|
|
114
|
+
const intendedMissing = focusedItemId != null && activeIndex === -1;
|
|
115
|
+
if (activeIndex === -1 && items.length > 0) activeIndex = intendedMissing ? Math.min(lastIndex.current, items.length - 1) : 0;
|
|
116
|
+
const active = activeIndex >= 0 ? items[activeIndex] : void 0;
|
|
117
|
+
const activeIdRef = useLatest(active?.id);
|
|
118
|
+
const failureId = `${baseId}-action-error`;
|
|
119
|
+
const failedItemGone = actionError != null && !items.some((item) => item.id === actionError.itemId);
|
|
120
|
+
const describe = (item) => {
|
|
121
|
+
return `${items.indexOf(item) + 1} of ${items.length}: ${item.action}`;
|
|
122
|
+
};
|
|
123
|
+
const activate = (item) => {
|
|
124
|
+
if (focusedItemId !== item.id) {
|
|
125
|
+
internalFocus.current = item.id;
|
|
126
|
+
setFocusedItemId(item.id);
|
|
127
|
+
}
|
|
128
|
+
};
|
|
129
|
+
const findItem = (key) => key === null ? void 0 : items.find((item) => itemKey(item.id) === key);
|
|
130
|
+
const act = (action, item) => {
|
|
131
|
+
if (pending(item.id)) return;
|
|
132
|
+
switch (action) {
|
|
133
|
+
case "accept":
|
|
134
|
+
onAccept(item.id);
|
|
135
|
+
return;
|
|
136
|
+
case "dismiss":
|
|
137
|
+
onDismiss(item.id);
|
|
138
|
+
return;
|
|
139
|
+
case "not-useful":
|
|
140
|
+
onDismiss(item.id, "not-useful");
|
|
141
|
+
return;
|
|
142
|
+
case "snooze":
|
|
143
|
+
setMenu({
|
|
144
|
+
itemId: item.id,
|
|
145
|
+
kind: "snooze"
|
|
146
|
+
});
|
|
147
|
+
return;
|
|
148
|
+
case "open": {
|
|
149
|
+
if (!canOpen(item)) return;
|
|
150
|
+
const link = item.sourceHref ? targetElement(itemKey(item.id))?.querySelector("a[data-action=\"open\"]") : null;
|
|
151
|
+
if (link) link.click();
|
|
152
|
+
else onOpenSource?.(item.id);
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
};
|
|
157
|
+
const { containerRef, registerTarget, targetElement, focusLost, cursorVisible, announcement, announce, handlers } = useTriageKeyboard({
|
|
158
|
+
keymap,
|
|
159
|
+
hasAction,
|
|
160
|
+
activeKey: active ? itemKey(active.id) : null,
|
|
161
|
+
modalOpen: menu !== null,
|
|
162
|
+
onAction: (action, key) => {
|
|
163
|
+
const item = findItem(key);
|
|
164
|
+
if (item) act(action, item);
|
|
165
|
+
},
|
|
166
|
+
onStep: (fromKey, step) => {
|
|
167
|
+
const current = findItem(fromKey);
|
|
168
|
+
const index = current ? items.indexOf(current) : -1;
|
|
169
|
+
const next = items[Math.min(Math.max(index + step, 0), items.length - 1)];
|
|
170
|
+
if (next) {
|
|
171
|
+
activate(next);
|
|
172
|
+
announce(describe(next));
|
|
173
|
+
targetElement(itemKey(next.id))?.focus();
|
|
174
|
+
}
|
|
175
|
+
},
|
|
176
|
+
onFocusTarget: (key, entered) => {
|
|
177
|
+
const item = findItem(key);
|
|
178
|
+
if (!item) return;
|
|
179
|
+
activate(item);
|
|
180
|
+
if (entered) announce(describe(item));
|
|
181
|
+
}
|
|
182
|
+
});
|
|
183
|
+
React.useEffect(() => {
|
|
184
|
+
lastIndex.current = Math.max(activeIndex, 0);
|
|
185
|
+
if (!active) return;
|
|
186
|
+
if (intendedMissing) {
|
|
187
|
+
internalFocus.current = active.id;
|
|
188
|
+
setFocusedItemId(active.id);
|
|
189
|
+
announce(describe(active));
|
|
190
|
+
}
|
|
191
|
+
const element = targetElement(itemKey(active.id));
|
|
192
|
+
if (element && focusLost()) {
|
|
193
|
+
announce(describe(active));
|
|
194
|
+
element.focus();
|
|
195
|
+
}
|
|
196
|
+
});
|
|
197
|
+
React.useEffect(() => {
|
|
198
|
+
const fromInside = internalFocus.current === focusedItemId;
|
|
199
|
+
internalFocus.current = null;
|
|
200
|
+
if (!fromInside && focusedItemId != null) targetElement(itemKey(focusedItemId))?.scrollIntoView({
|
|
201
|
+
block: "nearest",
|
|
202
|
+
inline: "nearest"
|
|
203
|
+
});
|
|
204
|
+
}, [focusedItemId, targetElement]);
|
|
205
|
+
const seen = React.useRef(null);
|
|
206
|
+
const [arrived, setArrived] = React.useState(() => /* @__PURE__ */ new Set());
|
|
207
|
+
const onArriveRef = useLatest(onArrive);
|
|
208
|
+
React.useEffect(() => {
|
|
209
|
+
if (isLoading) return;
|
|
210
|
+
if (seen.current === null) {
|
|
211
|
+
seen.current = new Set(items.map((item) => item.id));
|
|
212
|
+
return;
|
|
213
|
+
}
|
|
214
|
+
const known = seen.current;
|
|
215
|
+
const fresh = items.filter((item) => !known.has(item.id));
|
|
216
|
+
const present = new Set(items.map((item) => item.id));
|
|
217
|
+
setArrived((current) => {
|
|
218
|
+
const next = new Set(fresh.map((item) => item.id));
|
|
219
|
+
for (const id of current) if (present.has(id)) next.add(id);
|
|
220
|
+
return next.size === current.size && [...next].every((id) => current.has(id)) ? current : next;
|
|
221
|
+
});
|
|
222
|
+
if (fresh.length === 0) return;
|
|
223
|
+
for (const item of fresh) known.add(item.id);
|
|
224
|
+
onArriveRef.current?.(fresh);
|
|
225
|
+
}, [
|
|
226
|
+
items,
|
|
227
|
+
isLoading,
|
|
228
|
+
onArriveRef
|
|
229
|
+
]);
|
|
230
|
+
const dismissFailure = () => {
|
|
231
|
+
if (activeIdRef.current) targetElement(itemKey(activeIdRef.current))?.focus();
|
|
232
|
+
onDismissActionError?.();
|
|
233
|
+
};
|
|
234
|
+
const failureAlert = (failure) => /* @__PURE__ */ jsxs(Alert, {
|
|
235
|
+
variant: "destructive",
|
|
236
|
+
"data-slot": "attention-feed-action-error",
|
|
237
|
+
className: "has-data-[slot=alert-action]:pr-8",
|
|
238
|
+
children: [
|
|
239
|
+
/* @__PURE__ */ jsx(AlertCircleIcon, { "aria-hidden": "true" }),
|
|
240
|
+
/* @__PURE__ */ jsx(AlertTitle, { children: "Action failed" }),
|
|
241
|
+
/* @__PURE__ */ jsx(AlertDescription, {
|
|
242
|
+
id: failureId,
|
|
243
|
+
className: "text-pretty",
|
|
244
|
+
children: failure.message
|
|
245
|
+
}),
|
|
246
|
+
onDismissActionError ? /* @__PURE__ */ jsx(AlertAction, {
|
|
247
|
+
className: "top-1 right-1",
|
|
248
|
+
children: /* @__PURE__ */ jsx(Button, {
|
|
249
|
+
type: "button",
|
|
250
|
+
size: "icon-xs",
|
|
251
|
+
variant: "ghost",
|
|
252
|
+
"aria-label": "Dismiss error",
|
|
253
|
+
onClick: dismissFailure,
|
|
254
|
+
children: /* @__PURE__ */ jsx(XIcon, {
|
|
255
|
+
"aria-hidden": "true",
|
|
256
|
+
className: "size-3"
|
|
257
|
+
})
|
|
258
|
+
})
|
|
259
|
+
}) : null
|
|
260
|
+
]
|
|
261
|
+
});
|
|
262
|
+
const hintId = `${baseId}-hint`;
|
|
263
|
+
const renderCard = (item) => {
|
|
264
|
+
const key = itemKey(item.id);
|
|
265
|
+
const isActive = active?.id === item.id;
|
|
266
|
+
const isItemPending = pending(item.id);
|
|
267
|
+
const failure = actionError?.itemId === item.id ? actionError : null;
|
|
268
|
+
const titleId = `${baseId}-${item.id}-title`;
|
|
269
|
+
const sourceId = `${baseId}-${item.id}-source`;
|
|
270
|
+
const summaryId = `${baseId}-${item.id}-summary`;
|
|
271
|
+
const tabIndex = isActive ? 0 : -1;
|
|
272
|
+
const keyChip = (action) => {
|
|
273
|
+
const shortcut = shortcutFor(action);
|
|
274
|
+
return shortcut ? /* @__PURE__ */ jsx(TriageKbd, {
|
|
275
|
+
shortcut,
|
|
276
|
+
className: "@max-lg/attention-feed:hidden"
|
|
277
|
+
}) : null;
|
|
278
|
+
};
|
|
279
|
+
const keyShortcut = (action) => shortcutFor(action);
|
|
280
|
+
const menuOpen = (kind) => menu?.itemId === item.id && menu.kind === kind;
|
|
281
|
+
const setMenuOpen = (kind) => (open) => setMenu(open ? {
|
|
282
|
+
itemId: item.id,
|
|
283
|
+
kind
|
|
284
|
+
} : null);
|
|
285
|
+
const card = /* @__PURE__ */ jsxs("div", {
|
|
286
|
+
"data-slot": "attention-feed-card",
|
|
287
|
+
className: cn("flex flex-col gap-2.5 rounded-lg border bg-card p-3 text-card-foreground transition-colors duration-100", "group-data-cursor/suggestion:border-ring group-data-cursor/suggestion:bg-muted/70 dark:group-data-cursor/suggestion:bg-muted", failure && "group-not-data-cursor/suggestion:border-destructive/60"),
|
|
288
|
+
children: [
|
|
289
|
+
/* @__PURE__ */ jsxs("div", {
|
|
290
|
+
className: "flex min-w-0 items-center gap-1.5 text-muted-foreground",
|
|
291
|
+
children: [
|
|
292
|
+
/* @__PURE__ */ jsx("span", {
|
|
293
|
+
"aria-hidden": "true",
|
|
294
|
+
className: "flex shrink-0 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-3.5",
|
|
295
|
+
children: item.sourceIcon ?? /* @__PURE__ */ jsx(BotIcon, {})
|
|
296
|
+
}),
|
|
297
|
+
/* @__PURE__ */ jsxs("span", {
|
|
298
|
+
id: sourceId,
|
|
299
|
+
className: "flex min-w-0 items-baseline gap-1.5",
|
|
300
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
301
|
+
className: "shrink-0 font-medium text-foreground",
|
|
302
|
+
children: item.source
|
|
303
|
+
}), item.sourceDetail ? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("span", {
|
|
304
|
+
"aria-hidden": "true",
|
|
305
|
+
children: "·"
|
|
306
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
307
|
+
className: "truncate",
|
|
308
|
+
children: item.sourceDetail
|
|
309
|
+
})] }) : null]
|
|
310
|
+
}),
|
|
311
|
+
/* @__PURE__ */ jsx("span", {
|
|
312
|
+
className: "ms-auto flex shrink-0 items-center ps-2",
|
|
313
|
+
children: isItemPending ? /* @__PURE__ */ jsx(Spinner, {
|
|
314
|
+
"aria-label": "Pending",
|
|
315
|
+
className: "size-3.5"
|
|
316
|
+
}) : item.createdAt ? /* @__PURE__ */ jsx("time", {
|
|
317
|
+
dateTime: item.createdAt,
|
|
318
|
+
className: "tabular-nums",
|
|
319
|
+
children: formatTime(item.createdAt)
|
|
320
|
+
}) : null
|
|
321
|
+
})
|
|
322
|
+
]
|
|
323
|
+
}),
|
|
324
|
+
/* @__PURE__ */ jsxs("div", {
|
|
325
|
+
className: "flex flex-col gap-1",
|
|
326
|
+
children: [/* @__PURE__ */ jsx("p", {
|
|
327
|
+
id: titleId,
|
|
328
|
+
className: "font-heading text-sm leading-snug font-medium",
|
|
329
|
+
children: item.action
|
|
330
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
331
|
+
id: summaryId,
|
|
332
|
+
children: /* @__PURE__ */ jsx(SuggestionClaims, { item })
|
|
333
|
+
})]
|
|
334
|
+
}),
|
|
335
|
+
failure ? failureAlert(failure) : null,
|
|
336
|
+
/* @__PURE__ */ jsxs("div", {
|
|
337
|
+
"data-slot": "attention-feed-actions",
|
|
338
|
+
className: "flex flex-wrap items-center gap-2 @max-lg/attention-feed:[&>*]:grow",
|
|
339
|
+
children: [
|
|
340
|
+
/* @__PURE__ */ jsxs(Button, {
|
|
341
|
+
type: "button",
|
|
342
|
+
size: "sm",
|
|
343
|
+
"data-action": "accept",
|
|
344
|
+
disabled: isItemPending,
|
|
345
|
+
tabIndex,
|
|
346
|
+
"aria-keyshortcuts": keyShortcut("accept"),
|
|
347
|
+
onClick: () => act("accept", item),
|
|
348
|
+
className: "pointer-coarse:h-8 @max-lg/attention-feed:h-8",
|
|
349
|
+
children: [
|
|
350
|
+
/* @__PURE__ */ jsx(CheckIcon, { "aria-hidden": "true" }),
|
|
351
|
+
"Accept",
|
|
352
|
+
keyChip("accept")
|
|
353
|
+
]
|
|
354
|
+
}),
|
|
355
|
+
/* @__PURE__ */ jsxs(ButtonGroup, {
|
|
356
|
+
"aria-label": "Dismiss",
|
|
357
|
+
children: [/* @__PURE__ */ jsxs(Button, {
|
|
358
|
+
type: "button",
|
|
359
|
+
size: "sm",
|
|
360
|
+
variant: "outline",
|
|
361
|
+
"data-action": "dismiss",
|
|
362
|
+
disabled: isItemPending,
|
|
363
|
+
tabIndex,
|
|
364
|
+
"aria-keyshortcuts": keyShortcut("dismiss"),
|
|
365
|
+
onClick: () => act("dismiss", item),
|
|
366
|
+
className: "pointer-coarse:h-8 @max-lg/attention-feed:h-8 @max-lg/attention-feed:grow",
|
|
367
|
+
children: [
|
|
368
|
+
/* @__PURE__ */ jsx(XIcon, { "aria-hidden": "true" }),
|
|
369
|
+
"Dismiss",
|
|
370
|
+
keyChip("dismiss")
|
|
371
|
+
]
|
|
372
|
+
}), /* @__PURE__ */ jsxs(DropdownMenu, {
|
|
373
|
+
open: menuOpen("dismiss"),
|
|
374
|
+
onOpenChange: setMenuOpen("dismiss"),
|
|
375
|
+
children: [/* @__PURE__ */ jsx(DropdownMenuTrigger, {
|
|
376
|
+
disabled: isItemPending,
|
|
377
|
+
render: /* @__PURE__ */ jsx(Button, {
|
|
378
|
+
type: "button",
|
|
379
|
+
size: "icon-sm",
|
|
380
|
+
variant: "outline",
|
|
381
|
+
tabIndex,
|
|
382
|
+
"aria-label": "More ways to dismiss",
|
|
383
|
+
className: "pointer-coarse:size-8 @max-lg/attention-feed:size-8"
|
|
384
|
+
}),
|
|
385
|
+
children: /* @__PURE__ */ jsx(ChevronDownIcon, { "aria-hidden": "true" })
|
|
386
|
+
}), /* @__PURE__ */ jsx(DropdownMenuContent, {
|
|
387
|
+
align: "end",
|
|
388
|
+
className: "w-auto min-w-48",
|
|
389
|
+
children: /* @__PURE__ */ jsxs(DropdownMenuItem, {
|
|
390
|
+
"data-action": "not-useful",
|
|
391
|
+
"aria-keyshortcuts": keyShortcut("not-useful"),
|
|
392
|
+
onClick: () => act("not-useful", item),
|
|
393
|
+
children: [/* @__PURE__ */ jsx(ThumbsDownIcon, { "aria-hidden": "true" }), /* @__PURE__ */ jsxs("span", {
|
|
394
|
+
className: "flex flex-col",
|
|
395
|
+
children: [/* @__PURE__ */ jsx("span", { children: "Not useful" }), /* @__PURE__ */ jsx("span", {
|
|
396
|
+
className: "text-muted-foreground",
|
|
397
|
+
children: "Dismiss and tell the agent"
|
|
398
|
+
})]
|
|
399
|
+
})]
|
|
400
|
+
})
|
|
401
|
+
})]
|
|
402
|
+
})]
|
|
403
|
+
}),
|
|
404
|
+
/* @__PURE__ */ jsxs(DropdownMenu, {
|
|
405
|
+
open: menuOpen("snooze"),
|
|
406
|
+
onOpenChange: setMenuOpen("snooze"),
|
|
407
|
+
children: [/* @__PURE__ */ jsxs(DropdownMenuTrigger, {
|
|
408
|
+
disabled: isItemPending,
|
|
409
|
+
render: /* @__PURE__ */ jsx(Button, {
|
|
410
|
+
type: "button",
|
|
411
|
+
size: "sm",
|
|
412
|
+
variant: "outline",
|
|
413
|
+
"data-action": "snooze",
|
|
414
|
+
tabIndex,
|
|
415
|
+
"aria-keyshortcuts": keyShortcut("snooze"),
|
|
416
|
+
className: "pointer-coarse:h-8 @max-lg/attention-feed:h-8"
|
|
417
|
+
}),
|
|
418
|
+
children: [
|
|
419
|
+
/* @__PURE__ */ jsx(BellOffIcon, { "aria-hidden": "true" }),
|
|
420
|
+
"Snooze",
|
|
421
|
+
keyChip("snooze")
|
|
422
|
+
]
|
|
423
|
+
}), /* @__PURE__ */ jsx(DropdownMenuContent, {
|
|
424
|
+
align: "start",
|
|
425
|
+
className: "w-auto min-w-36",
|
|
426
|
+
children: /* @__PURE__ */ jsxs(DropdownMenuGroup, { children: [/* @__PURE__ */ jsx(DropdownMenuLabel, { children: "Snooze until" }), ATTENTION_SNOOZE_PRESETS.map((preset) => /* @__PURE__ */ jsx(DropdownMenuItem, {
|
|
427
|
+
"data-preset": preset.id,
|
|
428
|
+
onClick: () => onSnooze(item.id, preset.id),
|
|
429
|
+
children: preset.label
|
|
430
|
+
}, preset.id))] })
|
|
431
|
+
})]
|
|
432
|
+
}),
|
|
433
|
+
canOpen(item) ? item.sourceHref ? /* @__PURE__ */ jsxs("a", {
|
|
434
|
+
href: item.sourceHref,
|
|
435
|
+
"data-action": "open",
|
|
436
|
+
tabIndex,
|
|
437
|
+
"aria-keyshortcuts": keyShortcut("open"),
|
|
438
|
+
"aria-disabled": isItemPending || void 0,
|
|
439
|
+
onClick: (event) => {
|
|
440
|
+
if (isItemPending) {
|
|
441
|
+
event.preventDefault();
|
|
442
|
+
return;
|
|
443
|
+
}
|
|
444
|
+
onOpenSource?.(item.id);
|
|
445
|
+
},
|
|
446
|
+
className: cn(buttonVariants({
|
|
447
|
+
variant: "ghost",
|
|
448
|
+
size: "sm"
|
|
449
|
+
}), "ms-auto aria-disabled:pointer-events-none aria-disabled:opacity-50 pointer-coarse:h-8 @max-lg/attention-feed:ms-0 @max-lg/attention-feed:h-8"),
|
|
450
|
+
children: [
|
|
451
|
+
"Open source",
|
|
452
|
+
/* @__PURE__ */ jsx(ExternalLinkIcon, {
|
|
453
|
+
"aria-hidden": "true",
|
|
454
|
+
"data-icon": "inline-end"
|
|
455
|
+
}),
|
|
456
|
+
keyChip("open")
|
|
457
|
+
]
|
|
458
|
+
}) : /* @__PURE__ */ jsxs(Button, {
|
|
459
|
+
type: "button",
|
|
460
|
+
size: "sm",
|
|
461
|
+
variant: "ghost",
|
|
462
|
+
"data-action": "open",
|
|
463
|
+
disabled: isItemPending,
|
|
464
|
+
tabIndex,
|
|
465
|
+
"aria-keyshortcuts": keyShortcut("open"),
|
|
466
|
+
onClick: () => onOpenSource?.(item.id),
|
|
467
|
+
className: "ms-auto pointer-coarse:h-8 @max-lg/attention-feed:ms-0 @max-lg/attention-feed:h-8",
|
|
468
|
+
children: [
|
|
469
|
+
"Open source",
|
|
470
|
+
/* @__PURE__ */ jsx(ExternalLinkIcon, {
|
|
471
|
+
"aria-hidden": "true",
|
|
472
|
+
"data-icon": "inline-end"
|
|
473
|
+
}),
|
|
474
|
+
keyChip("open")
|
|
475
|
+
]
|
|
476
|
+
}) : null
|
|
477
|
+
]
|
|
478
|
+
})
|
|
479
|
+
]
|
|
480
|
+
});
|
|
481
|
+
const describedBy = [
|
|
482
|
+
sourceId,
|
|
483
|
+
summaryId,
|
|
484
|
+
failure ? failureId : null
|
|
485
|
+
].filter(Boolean);
|
|
486
|
+
return /* @__PURE__ */ jsx("li", {
|
|
487
|
+
ref: registerTarget(key),
|
|
488
|
+
[TRIAGE_TARGET_ATTRIBUTE]: key,
|
|
489
|
+
"data-slot": "attention-feed-item",
|
|
490
|
+
"data-active": isActive || void 0,
|
|
491
|
+
"data-cursor": isActive && cursorVisible || void 0,
|
|
492
|
+
"data-pending": isItemPending || void 0,
|
|
493
|
+
"data-failed": failure ? true : void 0,
|
|
494
|
+
"data-arrived": arrived.has(item.id) || void 0,
|
|
495
|
+
tabIndex,
|
|
496
|
+
"aria-labelledby": titleId,
|
|
497
|
+
"aria-describedby": describedBy.join(" "),
|
|
498
|
+
"aria-busy": isItemPending || void 0,
|
|
499
|
+
className: "group/suggestion rounded-lg outline-none data-arrived:animate-in data-arrived:fade-in data-arrived:slide-in-from-top-1 data-arrived:duration-300 motion-reduce:data-arrived:animate-none",
|
|
500
|
+
children: narrow ? /* @__PURE__ */ jsx(SwipeRow, {
|
|
501
|
+
label: item.action,
|
|
502
|
+
disabled: isItemPending,
|
|
503
|
+
actions: [{
|
|
504
|
+
id: "dismiss",
|
|
505
|
+
label: "Dismiss",
|
|
506
|
+
icon: /* @__PURE__ */ jsx(XIcon, { "aria-hidden": "true" })
|
|
507
|
+
}, {
|
|
508
|
+
id: "accept",
|
|
509
|
+
label: "Accept",
|
|
510
|
+
tone: "primary",
|
|
511
|
+
icon: /* @__PURE__ */ jsx(CheckIcon, { "aria-hidden": "true" })
|
|
512
|
+
}],
|
|
513
|
+
onAction: (id) => act(id === "accept" ? "accept" : "dismiss", item),
|
|
514
|
+
className: "rounded-lg",
|
|
515
|
+
children: card
|
|
516
|
+
}) : card
|
|
517
|
+
}, item.id);
|
|
518
|
+
};
|
|
519
|
+
return /* @__PURE__ */ jsxs("section", {
|
|
520
|
+
ref: (element) => {
|
|
521
|
+
rootRef.current = element;
|
|
522
|
+
containerRef.current = element;
|
|
523
|
+
},
|
|
524
|
+
"aria-label": label,
|
|
525
|
+
"aria-describedby": hintId,
|
|
526
|
+
"aria-busy": isLoading || void 0,
|
|
527
|
+
"data-slot": "attention-feed",
|
|
528
|
+
"data-narrow": narrow || void 0,
|
|
529
|
+
className: cn("@container/attention-feed flex w-full flex-col gap-3 text-xs/relaxed", className),
|
|
530
|
+
...handlers,
|
|
531
|
+
children: [
|
|
532
|
+
/* @__PURE__ */ jsx(TriageKeyHints, {
|
|
533
|
+
id: hintId,
|
|
534
|
+
hidden: items.length === 0,
|
|
535
|
+
"data-slot": "attention-feed-hint",
|
|
536
|
+
keymap,
|
|
537
|
+
className: "@max-lg/attention-feed:hidden",
|
|
538
|
+
hints: ACTION_HINTS.flatMap(({ action, label: hint }) => {
|
|
539
|
+
const shortcut = shortcutFor(action);
|
|
540
|
+
return shortcut ? [{
|
|
541
|
+
key: shortcut,
|
|
542
|
+
label: hint
|
|
543
|
+
}] : [];
|
|
544
|
+
})
|
|
545
|
+
}),
|
|
546
|
+
/* @__PURE__ */ jsx("div", {
|
|
547
|
+
"aria-live": "polite",
|
|
548
|
+
"aria-atomic": "true",
|
|
549
|
+
className: "sr-only",
|
|
550
|
+
children: announcement
|
|
551
|
+
}),
|
|
552
|
+
error ? /* @__PURE__ */ jsxs(Alert, {
|
|
553
|
+
variant: "destructive",
|
|
554
|
+
"data-slot": "attention-feed-error",
|
|
555
|
+
children: [/* @__PURE__ */ jsx(AlertCircleIcon, { "aria-hidden": "true" }), /* @__PURE__ */ jsx(AlertTitle, { children: error })]
|
|
556
|
+
}) : null,
|
|
557
|
+
actionError && failedItemGone ? failureAlert(actionError) : null,
|
|
558
|
+
isLoading && items.length === 0 ? /* @__PURE__ */ jsxs("div", {
|
|
559
|
+
role: "status",
|
|
560
|
+
"data-slot": "attention-feed-loading",
|
|
561
|
+
className: "flex flex-col gap-3",
|
|
562
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
563
|
+
className: "sr-only",
|
|
564
|
+
children: "Loading suggestions"
|
|
565
|
+
}), [0, 1].map((row) => /* @__PURE__ */ jsxs("div", {
|
|
566
|
+
className: "flex flex-col gap-2.5 rounded-lg border p-3",
|
|
567
|
+
children: [
|
|
568
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "h-3.5 w-40" }),
|
|
569
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-2/3" }),
|
|
570
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "h-3.5 w-full" }),
|
|
571
|
+
/* @__PURE__ */ jsxs("div", {
|
|
572
|
+
className: "flex gap-2",
|
|
573
|
+
children: [
|
|
574
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "h-6 w-20" }),
|
|
575
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "h-6 w-24" }),
|
|
576
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "h-6 w-20" })
|
|
577
|
+
]
|
|
578
|
+
})
|
|
579
|
+
]
|
|
580
|
+
}, row))]
|
|
581
|
+
}) : null,
|
|
582
|
+
!isLoading && items.length === 0 && !error ? /* @__PURE__ */ jsx(Empty, {
|
|
583
|
+
"data-slot": "attention-feed-empty",
|
|
584
|
+
className: "border",
|
|
585
|
+
children: /* @__PURE__ */ jsxs(EmptyHeader, { children: [/* @__PURE__ */ jsx(EmptyTitle, { children: emptyLabel }), /* @__PURE__ */ jsx(EmptyDescription, { children: "Suggestions appear here as your agents raise them." })] })
|
|
586
|
+
}) : null,
|
|
587
|
+
items.length > 0 ? /* @__PURE__ */ jsx("ul", {
|
|
588
|
+
"aria-label": "Suggestions",
|
|
589
|
+
className: "flex flex-col gap-2",
|
|
590
|
+
children: items.map(renderCard)
|
|
591
|
+
}) : null
|
|
592
|
+
]
|
|
593
|
+
});
|
|
594
|
+
}
|
|
595
|
+
/** One adjective per confidence, so the basis line reads "sourced · …". */
|
|
596
|
+
const CONFIDENCE_LABELS = {
|
|
597
|
+
grounded: "sourced",
|
|
598
|
+
inferred: "inferred",
|
|
599
|
+
uncertain: "unverified"
|
|
600
|
+
};
|
|
601
|
+
/**
|
|
602
|
+
* A suggestion's summary through ConfidenceMarker. The marker shows the basis
|
|
603
|
+
* of the hovered or focused claim; with none hovered it shows the first, so
|
|
604
|
+
* the card always carries its confidence. With neither a summary nor claims
|
|
605
|
+
* there is no claim to underline, so nothing renders at all.
|
|
606
|
+
*/
|
|
607
|
+
function SuggestionClaims({ item }) {
|
|
608
|
+
const [hovered, setHovered] = React.useState("");
|
|
609
|
+
const claims = item.claims ?? (item.summary ? [{
|
|
610
|
+
id: `${item.id}-summary`,
|
|
611
|
+
text: item.summary,
|
|
612
|
+
confidence: item.confidence,
|
|
613
|
+
basis: item.basis
|
|
614
|
+
}] : []);
|
|
615
|
+
if (claims.length === 0) return null;
|
|
616
|
+
const fallback = claims[0]?.id ?? "";
|
|
617
|
+
return /* @__PURE__ */ jsx(ConfidenceMarker, {
|
|
618
|
+
claims,
|
|
619
|
+
hoveredId: hovered || fallback,
|
|
620
|
+
onHover: setHovered,
|
|
621
|
+
labels: CONFIDENCE_LABELS,
|
|
622
|
+
className: "max-w-none gap-1.5 [&>div]:h-auto [&_[role=status]]:items-start [&_[role=status]]:rounded-none [&_[role=status]]:border-0 [&_[role=status]]:bg-transparent [&_[role=status]]:p-0 [&_[role=status]]:text-balance [&_[role=status]]:shadow-none [&_[role=status]]:dark:bg-transparent [&_[role=status]>span:first-child]:mt-1.5 [&_[role=status]>span:first-child]:shrink-0"
|
|
623
|
+
});
|
|
624
|
+
}
|
|
625
|
+
//#endregion
|
|
626
|
+
export { ATTENTION_SNOOZE_PRESETS, AttentionFeed };
|