@athenaintel/react 0.22.3 → 0.23.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/README.md +394 -4
- package/dist/chat/AthenaChat.cjs +389 -240
- package/dist/chat/AthenaChat.cjs.map +1 -1
- package/dist/chat/AthenaChat.d.ts +26 -8
- package/dist/chat/AthenaChat.js +394 -245
- package/dist/chat/AthenaChat.js.map +1 -1
- package/dist/chat/StatewireApprovalCard.cjs +2 -1
- package/dist/chat/StatewireApprovalCard.cjs.map +1 -1
- package/dist/chat/StatewireApprovalCard.js +2 -1
- package/dist/chat/StatewireApprovalCard.js.map +1 -1
- package/dist/chat/StatewireClientToolBridge.cjs +1 -0
- package/dist/chat/StatewireClientToolBridge.cjs.map +1 -1
- package/dist/chat/StatewireClientToolBridge.js +1 -0
- package/dist/chat/StatewireClientToolBridge.js.map +1 -1
- package/dist/chat/StatewireQueuedMessages.cjs +1 -0
- package/dist/chat/StatewireQueuedMessages.cjs.map +1 -1
- package/dist/chat/StatewireQueuedMessages.js +1 -0
- package/dist/chat/StatewireQueuedMessages.js.map +1 -1
- package/dist/chat/WaitingOnYouBanner.cjs +100 -0
- package/dist/chat/WaitingOnYouBanner.cjs.map +1 -0
- package/dist/chat/WaitingOnYouBanner.d.ts +29 -0
- package/dist/chat/WaitingOnYouBanner.js +100 -0
- package/dist/chat/WaitingOnYouBanner.js.map +1 -0
- package/dist/chat/athena-chat-welcome.cjs +148 -0
- package/dist/chat/athena-chat-welcome.cjs.map +1 -0
- package/dist/chat/athena-chat-welcome.d.ts +54 -0
- package/dist/chat/athena-chat-welcome.js +148 -0
- package/dist/chat/athena-chat-welcome.js.map +1 -0
- package/dist/chat/athena-composer-controls.cjs +76 -0
- package/dist/chat/athena-composer-controls.cjs.map +1 -0
- package/dist/chat/athena-composer-controls.d.ts +21 -0
- package/dist/chat/athena-composer-controls.js +76 -0
- package/dist/chat/athena-composer-controls.js.map +1 -0
- package/dist/chat/composer-keyboard-hint.cjs +61 -0
- package/dist/chat/composer-keyboard-hint.cjs.map +1 -0
- package/dist/chat/composer-keyboard-hint.d.ts +33 -0
- package/dist/chat/composer-keyboard-hint.js +61 -0
- package/dist/chat/composer-keyboard-hint.js.map +1 -0
- package/dist/chat/message-time.cjs +64 -0
- package/dist/chat/message-time.cjs.map +1 -0
- package/dist/chat/message-time.d.ts +45 -0
- package/dist/chat/message-time.js +64 -0
- package/dist/chat/message-time.js.map +1 -0
- package/dist/chat/run-activity.cjs +38 -7
- package/dist/chat/run-activity.cjs.map +1 -1
- package/dist/chat/run-activity.d.ts +14 -3
- package/dist/chat/run-activity.js +39 -8
- package/dist/chat/run-activity.js.map +1 -1
- package/dist/chat/statewire-client-tools.cjs +2 -1
- package/dist/chat/statewire-client-tools.cjs.map +1 -1
- package/dist/chat/statewire-client-tools.js +2 -1
- package/dist/chat/statewire-client-tools.js.map +1 -1
- package/dist/chat/super-grouping/activity-timeline.cjs +2 -1
- package/dist/chat/super-grouping/activity-timeline.cjs.map +1 -1
- package/dist/chat/super-grouping/activity-timeline.js +2 -1
- package/dist/chat/super-grouping/activity-timeline.js.map +1 -1
- package/dist/chat/thread-scroll-to-bottom.cjs +24 -0
- package/dist/chat/thread-scroll-to-bottom.cjs.map +1 -0
- package/dist/chat/thread-scroll-to-bottom.d.ts +11 -0
- package/dist/chat/thread-scroll-to-bottom.js +24 -0
- package/dist/chat/thread-scroll-to-bottom.js.map +1 -0
- package/dist/chat/tiptap-text.cjs +26 -99
- package/dist/chat/tiptap-text.cjs.map +1 -1
- package/dist/chat/tiptap-text.d.ts +13 -0
- package/dist/chat/tiptap-text.js +26 -99
- package/dist/chat/tiptap-text.js.map +1 -1
- package/dist/chat/use-athena-run-live.cjs +2 -1
- package/dist/chat/use-athena-run-live.cjs.map +1 -1
- package/dist/chat/use-athena-run-live.js +2 -1
- package/dist/chat/use-athena-run-live.js.map +1 -1
- package/dist/chat/use-statewire-approval-request.cjs +1 -0
- package/dist/chat/use-statewire-approval-request.cjs.map +1 -1
- package/dist/chat/use-statewire-approval-request.js +1 -0
- package/dist/chat/use-statewire-approval-request.js.map +1 -1
- package/dist/chat-ui/composer/tiptap-composer.cjs +39 -4
- package/dist/chat-ui/composer/tiptap-composer.cjs.map +1 -1
- package/dist/chat-ui/composer/tiptap-composer.d.ts +21 -0
- package/dist/chat-ui/composer/tiptap-composer.js +39 -4
- package/dist/chat-ui/composer/tiptap-composer.js.map +1 -1
- package/dist/chat-ui/index.cjs +15 -1
- package/dist/chat-ui/index.cjs.map +1 -1
- package/dist/chat-ui/index.d.ts +6 -3
- package/dist/chat-ui/index.js +16 -2
- package/dist/chat-ui/index.js.map +1 -1
- package/dist/chat-ui/mentions/mention-chip.cjs +31 -4
- package/dist/chat-ui/mentions/mention-chip.cjs.map +1 -1
- package/dist/chat-ui/mentions/mention-chip.js +31 -4
- package/dist/chat-ui/mentions/mention-chip.js.map +1 -1
- package/dist/chat-ui/messages/message-components.cjs +19 -1
- package/dist/chat-ui/messages/message-components.cjs.map +1 -1
- package/dist/chat-ui/messages/message-components.d.ts +13 -0
- package/dist/chat-ui/messages/message-components.js +19 -1
- package/dist/chat-ui/messages/message-components.js.map +1 -1
- package/dist/chat-ui/messages/runtime-message.cjs +2 -1
- package/dist/chat-ui/messages/runtime-message.cjs.map +1 -1
- package/dist/chat-ui/messages/runtime-message.js +2 -1
- package/dist/chat-ui/messages/runtime-message.js.map +1 -1
- package/dist/chat-ui/messages/statewire-continue-run.cjs +1 -0
- package/dist/chat-ui/messages/statewire-continue-run.cjs.map +1 -1
- package/dist/chat-ui/messages/statewire-continue-run.js +1 -0
- package/dist/chat-ui/messages/statewire-continue-run.js.map +1 -1
- package/dist/chat-ui/messages/user-edit-composer.cjs +3 -1
- package/dist/chat-ui/messages/user-edit-composer.cjs.map +1 -1
- package/dist/chat-ui/messages/user-edit-composer.js +3 -1
- package/dist/chat-ui/messages/user-edit-composer.js.map +1 -1
- package/dist/chat-ui/messages/wake-marker.cjs +84 -0
- package/dist/chat-ui/messages/wake-marker.cjs.map +1 -0
- package/dist/chat-ui/messages/wake-marker.d.ts +16 -0
- package/dist/chat-ui/messages/wake-marker.js +84 -0
- package/dist/chat-ui/messages/wake-marker.js.map +1 -0
- package/dist/chat-ui/rich-text/chat-blocks.cjs +177 -0
- package/dist/chat-ui/rich-text/chat-blocks.cjs.map +1 -0
- package/dist/chat-ui/rich-text/chat-blocks.d.ts +58 -0
- package/dist/chat-ui/rich-text/chat-blocks.js +177 -0
- package/dist/chat-ui/rich-text/chat-blocks.js.map +1 -0
- package/dist/chat-ui/rich-text/chat-link.cjs +69 -0
- package/dist/chat-ui/rich-text/chat-link.cjs.map +1 -0
- package/dist/chat-ui/rich-text/chat-link.d.ts +24 -0
- package/dist/chat-ui/rich-text/chat-link.js +69 -0
- package/dist/chat-ui/rich-text/chat-link.js.map +1 -0
- package/dist/chat-ui/rich-text/chat-message-body.cjs +144 -18
- package/dist/chat-ui/rich-text/chat-message-body.cjs.map +1 -1
- package/dist/chat-ui/rich-text/chat-message-body.d.ts +10 -1
- package/dist/chat-ui/rich-text/chat-message-body.js +149 -23
- package/dist/chat-ui/rich-text/chat-message-body.js.map +1 -1
- package/dist/chat-ui/rich-text/chat-node-views.cjs +84 -4
- package/dist/chat-ui/rich-text/chat-node-views.cjs.map +1 -1
- package/dist/chat-ui/rich-text/chat-node-views.d.ts +12 -1
- package/dist/chat-ui/rich-text/chat-node-views.js +85 -5
- package/dist/chat-ui/rich-text/chat-node-views.js.map +1 -1
- package/dist/chat-ui/rich-text/chat-text-schema.cjs +21 -3
- package/dist/chat-ui/rich-text/chat-text-schema.cjs.map +1 -1
- package/dist/chat-ui/rich-text/chat-text-schema.d.ts +17 -2
- package/dist/chat-ui/rich-text/chat-text-schema.js +21 -3
- package/dist/chat-ui/rich-text/chat-text-schema.js.map +1 -1
- package/dist/chat-ui/rich-text/citation-anchors.cjs +139 -0
- package/dist/chat-ui/rich-text/citation-anchors.cjs.map +1 -0
- package/dist/chat-ui/rich-text/citation-anchors.d.ts +74 -0
- package/dist/chat-ui/rich-text/citation-anchors.js +139 -0
- package/dist/chat-ui/rich-text/citation-anchors.js.map +1 -0
- package/dist/chat-ui/statewire.cjs +8 -1
- package/dist/chat-ui/statewire.cjs.map +1 -1
- package/dist/chat-ui/statewire.d.ts +2 -0
- package/dist/chat-ui/statewire.js +8 -1
- package/dist/chat-ui/statewire.js.map +1 -1
- package/dist/chat-ui/thread/chat-composer-dock.cjs +27 -6
- package/dist/chat-ui/thread/chat-composer-dock.cjs.map +1 -1
- package/dist/chat-ui/thread/chat-composer-dock.d.ts +21 -1
- package/dist/chat-ui/thread/chat-composer-dock.js +28 -7
- package/dist/chat-ui/thread/chat-composer-dock.js.map +1 -1
- package/dist/chat-ui/thread/statewire-history-edge.cjs +12 -13
- package/dist/chat-ui/thread/statewire-history-edge.cjs.map +1 -1
- package/dist/chat-ui/thread/statewire-history-edge.d.ts +11 -10
- package/dist/chat-ui/thread/statewire-history-edge.js +13 -14
- package/dist/chat-ui/thread/statewire-history-edge.js.map +1 -1
- package/dist/chat-ui/thread/thread-loading-overlay.cjs +31 -0
- package/dist/chat-ui/thread/thread-loading-overlay.cjs.map +1 -0
- package/dist/chat-ui/thread/thread-loading-overlay.d.ts +14 -0
- package/dist/chat-ui/thread/thread-loading-overlay.js +31 -0
- package/dist/chat-ui/thread/thread-loading-overlay.js.map +1 -0
- package/dist/composer/ComposerDropZone.cjs +8 -1
- package/dist/composer/ComposerDropZone.cjs.map +1 -1
- package/dist/composer/ComposerDropZone.d.ts +6 -0
- package/dist/composer/ComposerDropZone.js +9 -2
- package/dist/composer/ComposerDropZone.js.map +1 -1
- package/dist/diagnostics/errors.cjs +20 -0
- package/dist/diagnostics/errors.cjs.map +1 -1
- package/dist/diagnostics/errors.d.ts +20 -0
- package/dist/diagnostics/errors.js +20 -0
- package/dist/diagnostics/errors.js.map +1 -1
- package/dist/index.cjs +47 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +26 -7
- package/dist/index.js +51 -5
- package/dist/index.js.map +1 -1
- package/dist/lib/use-prefers-reduced-motion.cjs +29 -0
- package/dist/lib/use-prefers-reduced-motion.cjs.map +1 -0
- package/dist/lib/use-prefers-reduced-motion.d.ts +6 -0
- package/dist/lib/use-prefers-reduced-motion.js +29 -0
- package/dist/lib/use-prefers-reduced-motion.js.map +1 -0
- package/dist/packages/agent-runtime/src/conversation-index.cjs.map +1 -1
- package/dist/packages/agent-runtime/src/conversation-index.js.map +1 -1
- package/dist/packages/agent-runtime/src/conversation-list.cjs +59 -0
- package/dist/packages/agent-runtime/src/conversation-list.cjs.map +1 -1
- package/dist/packages/agent-runtime/src/conversation-list.js +60 -1
- package/dist/packages/agent-runtime/src/conversation-list.js.map +1 -1
- package/dist/packages/agent-runtime/src/deep-agent-transport-recipe.cjs +5 -3
- package/dist/packages/agent-runtime/src/deep-agent-transport-recipe.cjs.map +1 -1
- package/dist/packages/agent-runtime/src/deep-agent-transport-recipe.js +5 -3
- package/dist/packages/agent-runtime/src/deep-agent-transport-recipe.js.map +1 -1
- package/dist/packages/agent-runtime/src/edit-command.cjs +21 -17
- package/dist/packages/agent-runtime/src/edit-command.cjs.map +1 -1
- package/dist/packages/agent-runtime/src/edit-command.js +22 -18
- package/dist/packages/agent-runtime/src/edit-command.js.map +1 -1
- package/dist/packages/agent-runtime/src/generated/runconfig-contract.cjs +9 -11
- package/dist/packages/agent-runtime/src/generated/runconfig-contract.cjs.map +1 -1
- package/dist/packages/agent-runtime/src/generated/runconfig-contract.js +9 -11
- package/dist/packages/agent-runtime/src/generated/runconfig-contract.js.map +1 -1
- package/dist/packages/agent-runtime/src/github-wake-event.cjs +86 -0
- package/dist/packages/agent-runtime/src/github-wake-event.cjs.map +1 -0
- package/dist/packages/agent-runtime/src/github-wake-event.js +86 -0
- package/dist/packages/agent-runtime/src/github-wake-event.js.map +1 -0
- package/dist/packages/agent-runtime/src/message-window.cjs +150 -42
- package/dist/packages/agent-runtime/src/message-window.cjs.map +1 -1
- package/dist/packages/agent-runtime/src/message-window.js +151 -43
- package/dist/packages/agent-runtime/src/message-window.js.map +1 -1
- package/dist/packages/agent-runtime/src/quota-safe-local-storage-session.cjs +13 -9
- package/dist/packages/agent-runtime/src/quota-safe-local-storage-session.cjs.map +1 -1
- package/dist/packages/agent-runtime/src/quota-safe-local-storage-session.js +13 -9
- package/dist/packages/agent-runtime/src/quota-safe-local-storage-session.js.map +1 -1
- package/dist/packages/agent-runtime/src/statewire-suspended.cjs +1 -3
- package/dist/packages/agent-runtime/src/statewire-suspended.cjs.map +1 -1
- package/dist/packages/agent-runtime/src/statewire-suspended.js +1 -3
- package/dist/packages/agent-runtime/src/statewire-suspended.js.map +1 -1
- package/dist/packages/agent-runtime/src/use-deep-agent-edit-submit.cjs.map +1 -1
- package/dist/packages/agent-runtime/src/use-deep-agent-edit-submit.js.map +1 -1
- package/dist/packages/agent-runtime/src/use-deep-agent-thread.cjs +61 -30
- package/dist/packages/agent-runtime/src/use-deep-agent-thread.cjs.map +1 -1
- package/dist/packages/agent-runtime/src/use-deep-agent-thread.js +59 -28
- package/dist/packages/agent-runtime/src/use-deep-agent-thread.js.map +1 -1
- package/dist/packages/agent-runtime/src/use-deep-agent-window-sync.cjs +56 -36
- package/dist/packages/agent-runtime/src/use-deep-agent-window-sync.cjs.map +1 -1
- package/dist/packages/agent-runtime/src/use-deep-agent-window-sync.js +59 -39
- package/dist/packages/agent-runtime/src/use-deep-agent-window-sync.js.map +1 -1
- package/dist/packages/react/package.json.cjs +1 -1
- package/dist/packages/react/package.json.js +1 -1
- package/dist/provider/AthenaContext.cjs.map +1 -1
- package/dist/provider/AthenaContext.d.ts +3 -0
- package/dist/provider/AthenaContext.js.map +1 -1
- package/dist/provider/AthenaProvider.cjs +93 -45
- package/dist/provider/AthenaProvider.cjs.map +1 -1
- package/dist/provider/AthenaProvider.d.ts +6 -1
- package/dist/provider/AthenaProvider.js +97 -49
- package/dist/provider/AthenaProvider.js.map +1 -1
- package/dist/runtime/statewire-lifecycle.cjs +2 -1
- package/dist/runtime/statewire-lifecycle.cjs.map +1 -1
- package/dist/runtime/statewire-lifecycle.js +2 -1
- package/dist/runtime/statewire-lifecycle.js.map +1 -1
- package/dist/runtime/useAthenaStatewireRuntime.cjs +3 -2
- package/dist/runtime/useAthenaStatewireRuntime.cjs.map +1 -1
- package/dist/runtime/useAthenaStatewireRuntime.d.ts +8 -12
- package/dist/runtime/useAthenaStatewireRuntime.js +3 -2
- package/dist/runtime/useAthenaStatewireRuntime.js.map +1 -1
- package/dist/search/useAthenaRepoSearch.cjs +94 -0
- package/dist/search/useAthenaRepoSearch.cjs.map +1 -0
- package/dist/search/useAthenaRepoSearch.d.ts +95 -0
- package/dist/search/useAthenaRepoSearch.js +94 -0
- package/dist/search/useAthenaRepoSearch.js.map +1 -0
- package/dist/styles.css +1 -1
- package/dist/threads/SessionList.cjs +486 -0
- package/dist/threads/SessionList.cjs.map +1 -0
- package/dist/threads/SessionList.d.ts +60 -0
- package/dist/threads/SessionList.js +486 -0
- package/dist/threads/SessionList.js.map +1 -0
- package/dist/threads/api.cjs +112 -4
- package/dist/threads/api.cjs.map +1 -1
- package/dist/threads/api.d.ts +128 -1
- package/dist/threads/api.js +113 -5
- package/dist/threads/api.js.map +1 -1
- package/dist/threads/conversation-list-fetcher.cjs +27 -3
- package/dist/threads/conversation-list-fetcher.cjs.map +1 -1
- package/dist/threads/conversation-list-fetcher.d.ts +16 -3
- package/dist/threads/conversation-list-fetcher.js +27 -3
- package/dist/threads/conversation-list-fetcher.js.map +1 -1
- package/dist/threads/index.d.ts +5 -1
- package/dist/threads/session-list-model.cjs +130 -0
- package/dist/threads/session-list-model.cjs.map +1 -0
- package/dist/threads/session-list-model.d.ts +62 -0
- package/dist/threads/session-list-model.js +130 -0
- package/dist/threads/session-list-model.js.map +1 -0
- package/dist/threads/statewire-thread-list.cjs +220 -38
- package/dist/threads/statewire-thread-list.cjs.map +1 -1
- package/dist/threads/statewire-thread-list.d.ts +152 -2
- package/dist/threads/statewire-thread-list.js +222 -40
- package/dist/threads/statewire-thread-list.js.map +1 -1
- package/dist/threads/thread-prefetcher.cjs +63 -0
- package/dist/threads/thread-prefetcher.cjs.map +1 -0
- package/dist/threads/thread-prefetcher.d.ts +54 -0
- package/dist/threads/thread-prefetcher.js +63 -0
- package/dist/threads/thread-prefetcher.js.map +1 -0
- package/dist/threads/use-athena-session-attention.cjs +22 -0
- package/dist/threads/use-athena-session-attention.cjs.map +1 -0
- package/dist/threads/use-athena-session-attention.d.ts +24 -0
- package/dist/threads/use-athena-session-attention.js +22 -0
- package/dist/threads/use-athena-session-attention.js.map +1 -0
- package/dist/threads/use-rest-conversation-history.cjs +25 -2
- package/dist/threads/use-rest-conversation-history.cjs.map +1 -1
- package/dist/threads/use-rest-conversation-history.d.ts +8 -1
- package/dist/threads/use-rest-conversation-history.js +25 -2
- package/dist/threads/use-rest-conversation-history.js.map +1 -1
- package/dist/threads/use-statewire-conversation-history.cjs +40 -16
- package/dist/threads/use-statewire-conversation-history.cjs.map +1 -1
- package/dist/threads/use-statewire-conversation-history.d.ts +13 -0
- package/dist/threads/use-statewire-conversation-history.js +40 -16
- package/dist/threads/use-statewire-conversation-history.js.map +1 -1
- package/dist/threads/use-thread-archive.cjs +128 -0
- package/dist/threads/use-thread-archive.cjs.map +1 -0
- package/dist/threads/use-thread-archive.d.ts +26 -0
- package/dist/threads/use-thread-archive.js +128 -0
- package/dist/threads/use-thread-archive.js.map +1 -0
- package/dist/threads/use-thread-favorite.cjs +53 -0
- package/dist/threads/use-thread-favorite.cjs.map +1 -0
- package/dist/threads/use-thread-favorite.d.ts +49 -0
- package/dist/threads/use-thread-favorite.js +53 -0
- package/dist/threads/use-thread-favorite.js.map +1 -0
- package/dist/threads/use-thread-field-override.cjs +184 -0
- package/dist/threads/use-thread-field-override.cjs.map +1 -0
- package/dist/threads/use-thread-field-override.d.ts +55 -0
- package/dist/threads/use-thread-field-override.js +184 -0
- package/dist/threads/use-thread-field-override.js.map +1 -0
- package/dist/threads/use-thread-rename.cjs +53 -0
- package/dist/threads/use-thread-rename.cjs.map +1 -0
- package/dist/threads/use-thread-rename.d.ts +48 -0
- package/dist/threads/use-thread-rename.js +53 -0
- package/dist/threads/use-thread-rename.js.map +1 -0
- package/dist/tools/index.cjs +5 -1
- package/dist/tools/index.cjs.map +1 -1
- package/dist/tools/index.d.ts +1 -1
- package/dist/tools/index.js +7 -3
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/misc-tool-uis.cjs +2 -1
- package/dist/tools/misc-tool-uis.cjs.map +1 -1
- package/dist/tools/misc-tool-uis.js +2 -1
- package/dist/tools/misc-tool-uis.js.map +1 -1
- package/dist/tools/primitives.cjs +25 -2
- package/dist/tools/primitives.cjs.map +1 -1
- package/dist/tools/primitives.d.ts +9 -2
- package/dist/tools/primitives.js +26 -3
- package/dist/tools/primitives.js.map +1 -1
- package/dist/tools/tool-appearance.cjs +11 -0
- package/dist/tools/tool-appearance.cjs.map +1 -0
- package/dist/tools/tool-appearance.d.ts +29 -0
- package/dist/tools/tool-appearance.js +11 -0
- package/dist/tools/tool-appearance.js.map +1 -0
- package/dist/tools/tool-fallback.cjs +211 -13
- package/dist/tools/tool-fallback.cjs.map +1 -1
- package/dist/tools/tool-fallback.d.ts +31 -4
- package/dist/tools/tool-fallback.js +214 -16
- package/dist/tools/tool-fallback.js.map +1 -1
- package/dist/tools/use-elapsed-seconds.cjs +24 -0
- package/dist/tools/use-elapsed-seconds.cjs.map +1 -0
- package/dist/tools/use-elapsed-seconds.d.ts +10 -0
- package/dist/tools/use-elapsed-seconds.js +24 -0
- package/dist/tools/use-elapsed-seconds.js.map +1 -0
- package/dist/tools/voice-update-tool-ui.cjs +2 -1
- package/dist/tools/voice-update-tool-ui.cjs.map +1 -1
- package/dist/tools/voice-update-tool-ui.js +2 -1
- package/dist/tools/voice-update-tool-ui.js.map +1 -1
- package/package.json +1 -1
- package/src/chat-ui/tailwind-preset.js +14 -1
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
+
const react = require("@assistant-ui/react");
|
|
5
|
+
require("../packages/agent-runtime/src/generated/runconfig-contract.cjs");
|
|
6
|
+
const react$1 = require("react");
|
|
7
|
+
require("@assistant-ui/tap");
|
|
8
|
+
require("statewire");
|
|
9
|
+
require("../packages/agent-runtime/src/statewire-suspended.cjs");
|
|
10
|
+
require("../packages/agent-runtime/src/conversation-list.cjs");
|
|
11
|
+
require("@tanstack/react-query");
|
|
12
|
+
const interrupts = require("../packages/agent-runtime/src/interrupts.cjs");
|
|
13
|
+
require("../packages/agent-runtime/src/messages.cjs");
|
|
14
|
+
require("../packages/agent-runtime/src/statewire-state.cjs");
|
|
15
|
+
const threadExtras = require("../packages/agent-runtime/src/thread-extras.cjs");
|
|
16
|
+
require("@assistant-ui/store");
|
|
17
|
+
require("../packages/agent-runtime/src/quota-safe-local-storage-session.cjs");
|
|
18
|
+
require("../packages/agent-runtime/src/statewire-attach-observer.cjs");
|
|
19
|
+
require("../packages/agent-runtime/src/thread-status.cjs");
|
|
20
|
+
require("@assistant-ui/react-statewire");
|
|
21
|
+
require("@assistant-ui/core");
|
|
22
|
+
require("../packages/agent-runtime/src/thread-handoff.cjs");
|
|
23
|
+
const lucideReact = require("lucide-react");
|
|
24
|
+
const statewireHistoryEdge = require("../chat-ui/thread/statewire-history-edge.cjs");
|
|
25
|
+
const useAthenaSessionAttention = require("../threads/use-athena-session-attention.cjs");
|
|
26
|
+
const useStatewireApprovalRequest = require("./use-statewire-approval-request.cjs");
|
|
27
|
+
const cnfast = require("cnfast");
|
|
28
|
+
const APPROVAL_CARD_SELECTOR = ".aui-approval-card";
|
|
29
|
+
const WaitingOnYouBanner = (props) => {
|
|
30
|
+
const extras = react.useAuiState((s) => s.thread.extras);
|
|
31
|
+
const attention = useAthenaSessionAttention.useAthenaSessionAttention();
|
|
32
|
+
if (!threadExtras.hasStatewireThreadExtras(extras)) {
|
|
33
|
+
return /* @__PURE__ */ jsxRuntime.jsx(WaitingOnYouBannerView, { attention, approvalSummary: null, ...props });
|
|
34
|
+
}
|
|
35
|
+
return /* @__PURE__ */ jsxRuntime.jsx(WaitingOnYouBannerWithApproval, { attention, ...props });
|
|
36
|
+
};
|
|
37
|
+
const WaitingOnYouBannerWithApproval = ({ attention, fallbackMessage, ...props }) => {
|
|
38
|
+
var _a, _b, _c;
|
|
39
|
+
const { request, hitl, liveHitl } = useStatewireApprovalRequest.useStatewireApprovalRequest();
|
|
40
|
+
const pending = request !== void 0 || liveHitl !== null;
|
|
41
|
+
const payload = hitl ?? liveHitl;
|
|
42
|
+
const toolName = ((_a = payload == null ? void 0 : payload.context) == null ? void 0 : _a.tool_name) ?? ((_b = payload == null ? void 0 : payload.context) == null ? void 0 : _b.tool_id);
|
|
43
|
+
const pendingCount = ((_c = payload == null ? void 0 : payload.context) == null ? void 0 : _c.pending_action_count) ?? 1;
|
|
44
|
+
const approvalSummary = !pending ? null : payload && pendingCount === 1 && toolName ? `${toolName} requires approval before it runs.` : interrupts.readInterruptMessage(request ? request.payload : liveHitl, fallbackMessage);
|
|
45
|
+
return /* @__PURE__ */ jsxRuntime.jsx(WaitingOnYouBannerView, { attention, approvalSummary, ...props });
|
|
46
|
+
};
|
|
47
|
+
const WaitingOnYouBannerView = ({
|
|
48
|
+
attention,
|
|
49
|
+
approvalSummary,
|
|
50
|
+
className
|
|
51
|
+
}) => {
|
|
52
|
+
var _a;
|
|
53
|
+
const rootRef = react$1.useRef(null);
|
|
54
|
+
const scrollToApproval = react$1.useCallback(() => {
|
|
55
|
+
const root = rootRef.current;
|
|
56
|
+
if (!root) return;
|
|
57
|
+
let scope = root.parentElement;
|
|
58
|
+
while (scope && scope.querySelector(`[${statewireHistoryEdge.THREAD_VIEWPORT_ATTR}]`) === null) {
|
|
59
|
+
scope = scope.parentElement;
|
|
60
|
+
}
|
|
61
|
+
const container = scope ?? root.ownerDocument;
|
|
62
|
+
const card = container.querySelector(APPROVAL_CARD_SELECTOR);
|
|
63
|
+
if (card) {
|
|
64
|
+
card.scrollIntoView({ behavior: "smooth", block: "nearest" });
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
const viewport = container.querySelector(`[${statewireHistoryEdge.THREAD_VIEWPORT_ATTR}]`);
|
|
68
|
+
viewport == null ? void 0 : viewport.scrollTo({ top: viewport.scrollHeight, behavior: "smooth" });
|
|
69
|
+
}, []);
|
|
70
|
+
const needsYou = (attention == null ? void 0 : attention.attention) === "needs_you";
|
|
71
|
+
const pending = approvalSummary !== null;
|
|
72
|
+
if (!needsYou && !pending) return null;
|
|
73
|
+
const text = ((_a = attention == null ? void 0 : attention.nextAction) == null ? void 0 : _a.trim()) || approvalSummary || "This session is waiting on you.";
|
|
74
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { ref: rootRef, className: cnfast.cn("aui-waiting-on-you", className), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
75
|
+
"div",
|
|
76
|
+
{
|
|
77
|
+
role: "status",
|
|
78
|
+
"data-testid": "waiting-on-you-banner",
|
|
79
|
+
"data-pending-approval": pending || void 0,
|
|
80
|
+
className: "mx-auto w-full max-w-(--thread-max-width) rounded-xl border border-amber-300 bg-amber-50 text-amber-900",
|
|
81
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
82
|
+
"button",
|
|
83
|
+
{
|
|
84
|
+
type: "button",
|
|
85
|
+
onClick: scrollToApproval,
|
|
86
|
+
className: "flex w-full items-center gap-2 px-3 py-2 text-left text-xs transition-colors hover:bg-amber-100/70",
|
|
87
|
+
children: [
|
|
88
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.HandIcon, { className: "size-4 shrink-0", "aria-hidden": "true" }),
|
|
89
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0 font-semibold", children: "Waiting on you" }),
|
|
90
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 flex-1 truncate text-amber-800", children: text }),
|
|
91
|
+
pending ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0 font-medium underline-offset-2 hover:underline", children: "Review" }) : null
|
|
92
|
+
]
|
|
93
|
+
}
|
|
94
|
+
)
|
|
95
|
+
}
|
|
96
|
+
) });
|
|
97
|
+
};
|
|
98
|
+
exports.WaitingOnYouBanner = WaitingOnYouBanner;
|
|
99
|
+
exports.WaitingOnYouBannerView = WaitingOnYouBannerView;
|
|
100
|
+
//# sourceMappingURL=WaitingOnYouBanner.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WaitingOnYouBanner.cjs","sources":["../../src/chat/WaitingOnYouBanner.tsx"],"sourcesContent":["import { useAuiState } from '@assistant-ui/react';\nimport { hasStatewireThreadExtras, readInterruptMessage } from '@athenaintel/agent-runtime';\nimport { HandIcon } from 'lucide-react';\nimport { type FC, useCallback, useRef } from 'react';\nimport { THREAD_VIEWPORT_ATTR } from '../chat-ui/thread/statewire-history-edge';\nimport { cn } from '../lib/utils';\nimport {\n type AthenaSessionAttention,\n useAthenaSessionAttention,\n} from '../threads/use-athena-session-attention';\nimport { useStatewireApprovalRequest } from './use-statewire-approval-request';\n\n/** The CSS class `StatewireApprovalCard` puts on its section; the banner scrolls to it. */\nconst APPROVAL_CARD_SELECTOR = '.aui-approval-card';\n\nexport interface WaitingOnYouBannerProps {\n /** Applied to the outer wrapper (host padding); the banner itself is width-capped inside it. */\n className?: string;\n /** Copy shown when a parked interrupt carries no message. */\n fallbackMessage?: string;\n}\n\n/**\n * Persistent top-of-thread banner for a session that is waiting on the\n * viewer: shown while the active thread's attention is `needs_you` (from the\n * thread list) or while the approval hook reports a pending request. The text\n * is the server's next action, else a summary of the pending request; a\n * click scrolls to the approval card (or to the composer when there is no\n * card). It never duplicates the card's decision buttons — the card stays the\n * one place a request is answered. Renders nothing otherwise.\n */\nexport const WaitingOnYouBanner: FC<WaitingOnYouBannerProps> = (props) => {\n const extras = useAuiState((s) => s.thread.extras);\n const attention = useAthenaSessionAttention();\n // `useStatewireApprovalRequest` needs a statewire aui scope (it throws\n // outside one), so the approval leg mounts only once the thread extras are.\n if (!hasStatewireThreadExtras(extras)) {\n return <WaitingOnYouBannerView attention={attention} approvalSummary={null} {...props} />;\n }\n return <WaitingOnYouBannerWithApproval attention={attention} {...props} />;\n};\n\nconst WaitingOnYouBannerWithApproval: FC<\n WaitingOnYouBannerProps & { attention: AthenaSessionAttention | null }\n> = ({ attention, fallbackMessage, ...props }) => {\n const { request, hitl, liveHitl } = useStatewireApprovalRequest();\n const pending = request !== undefined || liveHitl !== null;\n const payload = hitl ?? liveHitl;\n const toolName = payload?.context?.tool_name ?? payload?.context?.tool_id;\n const pendingCount = payload?.context?.pending_action_count ?? 1;\n const approvalSummary = !pending\n ? null\n : payload && pendingCount === 1 && toolName\n ? `${toolName} requires approval before it runs.`\n : readInterruptMessage(request ? request.payload : liveHitl, fallbackMessage);\n return <WaitingOnYouBannerView attention={attention} approvalSummary={approvalSummary} {...props} />;\n};\n\nexport interface WaitingOnYouBannerViewProps {\n attention: Pick<AthenaSessionAttention, 'attention' | 'nextAction'> | null;\n /** Summary of the pending approval, or `null` when nothing is parked. */\n approvalSummary: string | null;\n className?: string;\n}\n\n/**\n * The banner itself, over already-resolved inputs — the pure presenter\n * `WaitingOnYouBanner` binds to the thread list and the approval hook.\n */\nexport const WaitingOnYouBannerView: FC<WaitingOnYouBannerViewProps> = ({\n attention,\n approvalSummary,\n className,\n}) => {\n const rootRef = useRef<HTMLDivElement>(null);\n const scrollToApproval = useCallback(() => {\n const root = rootRef.current;\n if (!root) return;\n // The nearest ancestor that holds the thread viewport is the chat panel;\n // the card lives in that viewport's sticky footer.\n let scope: HTMLElement | null = root.parentElement;\n while (scope && scope.querySelector(`[${THREAD_VIEWPORT_ATTR}]`) === null) {\n scope = scope.parentElement;\n }\n const container: ParentNode = scope ?? root.ownerDocument;\n const card = container.querySelector<HTMLElement>(APPROVAL_CARD_SELECTOR);\n if (card) {\n card.scrollIntoView({ behavior: 'smooth', block: 'nearest' });\n return;\n }\n const viewport = container.querySelector<HTMLElement>(`[${THREAD_VIEWPORT_ATTR}]`);\n viewport?.scrollTo({ top: viewport.scrollHeight, behavior: 'smooth' });\n }, []);\n\n const needsYou = attention?.attention === 'needs_you';\n const pending = approvalSummary !== null;\n if (!needsYou && !pending) return null;\n const text =\n attention?.nextAction?.trim() || approvalSummary || 'This session is waiting on you.';\n\n return (\n <div ref={rootRef} className={cn('aui-waiting-on-you', className)}>\n <div\n role=\"status\"\n data-testid=\"waiting-on-you-banner\"\n data-pending-approval={pending || undefined}\n className=\"mx-auto w-full max-w-(--thread-max-width) rounded-xl border border-amber-300 bg-amber-50 text-amber-900\"\n >\n <button\n type=\"button\"\n onClick={scrollToApproval}\n className=\"flex w-full items-center gap-2 px-3 py-2 text-left text-xs transition-colors hover:bg-amber-100/70\"\n >\n <HandIcon className=\"size-4 shrink-0\" aria-hidden=\"true\" />\n <span className=\"shrink-0 font-semibold\">Waiting on you</span>\n <span className=\"min-w-0 flex-1 truncate text-amber-800\">{text}</span>\n {pending ? (\n <span className=\"shrink-0 font-medium underline-offset-2 hover:underline\">\n Review\n </span>\n ) : null}\n </button>\n </div>\n </div>\n );\n};\n"],"names":["useAuiState","useAthenaSessionAttention","hasStatewireThreadExtras","jsx","useStatewireApprovalRequest","readInterruptMessage","useRef","useCallback","THREAD_VIEWPORT_ATTR","cn","jsxs","HandIcon"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAaA,MAAM,yBAAyB;AAkBxB,MAAM,qBAAkD,CAAC,UAAU;AACxE,QAAM,SAASA,MAAAA,YAAY,CAAC,MAAM,EAAE,OAAO,MAAM;AACjD,QAAM,YAAYC,0BAAAA,0BAAA;AAGlB,MAAI,CAACC,aAAAA,yBAAyB,MAAM,GAAG;AACrC,0CAAQ,wBAAA,EAAuB,WAAsB,iBAAiB,MAAO,GAAG,OAAO;AAAA,EACzF;AACA,SAAOC,2BAAAA,IAAC,gCAAA,EAA+B,WAAuB,GAAG,MAAA,CAAO;AAC1E;AAEA,MAAM,iCAEF,CAAC,EAAE,WAAW,iBAAiB,GAAG,YAAY;;AAChD,QAAM,EAAE,SAAS,MAAM,SAAA,IAAaC,4BAAAA,4BAAA;AACpC,QAAM,UAAU,YAAY,UAAa,aAAa;AACtD,QAAM,UAAU,QAAQ;AACxB,QAAM,aAAW,wCAAS,YAAT,mBAAkB,gBAAa,wCAAS,YAAT,mBAAkB;AAClE,QAAM,iBAAe,wCAAS,YAAT,mBAAkB,yBAAwB;AAC/D,QAAM,kBAAkB,CAAC,UACrB,OACA,WAAW,iBAAiB,KAAK,WAC/B,GAAG,QAAQ,uCACXC,gCAAqB,UAAU,QAAQ,UAAU,UAAU,eAAe;AAChF,SAAOF,2BAAAA,IAAC,wBAAA,EAAuB,WAAsB,iBAAmC,GAAG,OAAO;AACpG;AAaO,MAAM,yBAA0D,CAAC;AAAA,EACtE;AAAA,EACA;AAAA,EACA;AACF,MAAM;;AACJ,QAAM,UAAUG,QAAAA,OAAuB,IAAI;AAC3C,QAAM,mBAAmBC,QAAAA,YAAY,MAAM;AACzC,UAAM,OAAO,QAAQ;AACrB,QAAI,CAAC,KAAM;AAGX,QAAI,QAA4B,KAAK;AACrC,WAAO,SAAS,MAAM,cAAc,IAAIC,yCAAoB,GAAG,MAAM,MAAM;AACzE,cAAQ,MAAM;AAAA,IAChB;AACA,UAAM,YAAwB,SAAS,KAAK;AAC5C,UAAM,OAAO,UAAU,cAA2B,sBAAsB;AACxE,QAAI,MAAM;AACR,WAAK,eAAe,EAAE,UAAU,UAAU,OAAO,WAAW;AAC5D;AAAA,IACF;AACA,UAAM,WAAW,UAAU,cAA2B,IAAIA,qBAAAA,oBAAoB,GAAG;AACjF,yCAAU,SAAS,EAAE,KAAK,SAAS,cAAc,UAAU;EAC7D,GAAG,CAAA,CAAE;AAEL,QAAM,YAAW,uCAAW,eAAc;AAC1C,QAAM,UAAU,oBAAoB;AACpC,MAAI,CAAC,YAAY,CAAC,QAAS,QAAO;AAClC,QAAM,SACJ,4CAAW,eAAX,mBAAuB,WAAU,mBAAmB;AAEtD,SACEL,+BAAC,SAAI,KAAK,SAAS,WAAWM,OAAAA,GAAG,sBAAsB,SAAS,GAC9D,UAAAN,2BAAAA;AAAAA,IAAC;AAAA,IAAA;AAAA,MACC,MAAK;AAAA,MACL,eAAY;AAAA,MACZ,yBAAuB,WAAW;AAAA,MAClC,WAAU;AAAA,MAEV,UAAAO,2BAAAA;AAAAA,QAAC;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,SAAS;AAAA,UACT,WAAU;AAAA,UAEV,UAAA;AAAA,YAAAP,2BAAAA,IAACQ,YAAAA,UAAA,EAAS,WAAU,mBAAkB,eAAY,QAAO;AAAA,YACzDR,2BAAAA,IAAC,QAAA,EAAK,WAAU,0BAAyB,UAAA,kBAAc;AAAA,YACvDA,2BAAAA,IAAC,QAAA,EAAK,WAAU,0CAA0C,UAAA,MAAK;AAAA,YAC9D,UACCA,2BAAAA,IAAC,QAAA,EAAK,WAAU,2DAA0D,oBAE1E,IACE;AAAA,UAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IACN;AAAA,EAAA,GAEJ;AAEJ;;;"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type FC } from 'react';
|
|
2
|
+
import { type AthenaSessionAttention } from '../threads/use-athena-session-attention';
|
|
3
|
+
export interface WaitingOnYouBannerProps {
|
|
4
|
+
/** Applied to the outer wrapper (host padding); the banner itself is width-capped inside it. */
|
|
5
|
+
className?: string;
|
|
6
|
+
/** Copy shown when a parked interrupt carries no message. */
|
|
7
|
+
fallbackMessage?: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Persistent top-of-thread banner for a session that is waiting on the
|
|
11
|
+
* viewer: shown while the active thread's attention is `needs_you` (from the
|
|
12
|
+
* thread list) or while the approval hook reports a pending request. The text
|
|
13
|
+
* is the server's next action, else a summary of the pending request; a
|
|
14
|
+
* click scrolls to the approval card (or to the composer when there is no
|
|
15
|
+
* card). It never duplicates the card's decision buttons — the card stays the
|
|
16
|
+
* one place a request is answered. Renders nothing otherwise.
|
|
17
|
+
*/
|
|
18
|
+
export declare const WaitingOnYouBanner: FC<WaitingOnYouBannerProps>;
|
|
19
|
+
export interface WaitingOnYouBannerViewProps {
|
|
20
|
+
attention: Pick<AthenaSessionAttention, 'attention' | 'nextAction'> | null;
|
|
21
|
+
/** Summary of the pending approval, or `null` when nothing is parked. */
|
|
22
|
+
approvalSummary: string | null;
|
|
23
|
+
className?: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* The banner itself, over already-resolved inputs — the pure presenter
|
|
27
|
+
* `WaitingOnYouBanner` binds to the thread list and the approval hook.
|
|
28
|
+
*/
|
|
29
|
+
export declare const WaitingOnYouBannerView: FC<WaitingOnYouBannerViewProps>;
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useAuiState } from "@assistant-ui/react";
|
|
3
|
+
import "../packages/agent-runtime/src/generated/runconfig-contract.js";
|
|
4
|
+
import { useRef, useCallback } from "react";
|
|
5
|
+
import "@assistant-ui/tap";
|
|
6
|
+
import "statewire";
|
|
7
|
+
import "../packages/agent-runtime/src/statewire-suspended.js";
|
|
8
|
+
import "../packages/agent-runtime/src/conversation-list.js";
|
|
9
|
+
import "@tanstack/react-query";
|
|
10
|
+
import { readInterruptMessage } from "../packages/agent-runtime/src/interrupts.js";
|
|
11
|
+
import "../packages/agent-runtime/src/messages.js";
|
|
12
|
+
import "../packages/agent-runtime/src/statewire-state.js";
|
|
13
|
+
import { hasStatewireThreadExtras } from "../packages/agent-runtime/src/thread-extras.js";
|
|
14
|
+
import "@assistant-ui/store";
|
|
15
|
+
import "../packages/agent-runtime/src/quota-safe-local-storage-session.js";
|
|
16
|
+
import "../packages/agent-runtime/src/statewire-attach-observer.js";
|
|
17
|
+
import "../packages/agent-runtime/src/thread-status.js";
|
|
18
|
+
import "@assistant-ui/react-statewire";
|
|
19
|
+
import "@assistant-ui/core";
|
|
20
|
+
import "../packages/agent-runtime/src/thread-handoff.js";
|
|
21
|
+
import { HandIcon } from "lucide-react";
|
|
22
|
+
import { THREAD_VIEWPORT_ATTR } from "../chat-ui/thread/statewire-history-edge.js";
|
|
23
|
+
import { useAthenaSessionAttention } from "../threads/use-athena-session-attention.js";
|
|
24
|
+
import { useStatewireApprovalRequest } from "./use-statewire-approval-request.js";
|
|
25
|
+
import { cn } from "cnfast";
|
|
26
|
+
const APPROVAL_CARD_SELECTOR = ".aui-approval-card";
|
|
27
|
+
const WaitingOnYouBanner = (props) => {
|
|
28
|
+
const extras = useAuiState((s) => s.thread.extras);
|
|
29
|
+
const attention = useAthenaSessionAttention();
|
|
30
|
+
if (!hasStatewireThreadExtras(extras)) {
|
|
31
|
+
return /* @__PURE__ */ jsx(WaitingOnYouBannerView, { attention, approvalSummary: null, ...props });
|
|
32
|
+
}
|
|
33
|
+
return /* @__PURE__ */ jsx(WaitingOnYouBannerWithApproval, { attention, ...props });
|
|
34
|
+
};
|
|
35
|
+
const WaitingOnYouBannerWithApproval = ({ attention, fallbackMessage, ...props }) => {
|
|
36
|
+
var _a, _b, _c;
|
|
37
|
+
const { request, hitl, liveHitl } = useStatewireApprovalRequest();
|
|
38
|
+
const pending = request !== void 0 || liveHitl !== null;
|
|
39
|
+
const payload = hitl ?? liveHitl;
|
|
40
|
+
const toolName = ((_a = payload == null ? void 0 : payload.context) == null ? void 0 : _a.tool_name) ?? ((_b = payload == null ? void 0 : payload.context) == null ? void 0 : _b.tool_id);
|
|
41
|
+
const pendingCount = ((_c = payload == null ? void 0 : payload.context) == null ? void 0 : _c.pending_action_count) ?? 1;
|
|
42
|
+
const approvalSummary = !pending ? null : payload && pendingCount === 1 && toolName ? `${toolName} requires approval before it runs.` : readInterruptMessage(request ? request.payload : liveHitl, fallbackMessage);
|
|
43
|
+
return /* @__PURE__ */ jsx(WaitingOnYouBannerView, { attention, approvalSummary, ...props });
|
|
44
|
+
};
|
|
45
|
+
const WaitingOnYouBannerView = ({
|
|
46
|
+
attention,
|
|
47
|
+
approvalSummary,
|
|
48
|
+
className
|
|
49
|
+
}) => {
|
|
50
|
+
var _a;
|
|
51
|
+
const rootRef = useRef(null);
|
|
52
|
+
const scrollToApproval = useCallback(() => {
|
|
53
|
+
const root = rootRef.current;
|
|
54
|
+
if (!root) return;
|
|
55
|
+
let scope = root.parentElement;
|
|
56
|
+
while (scope && scope.querySelector(`[${THREAD_VIEWPORT_ATTR}]`) === null) {
|
|
57
|
+
scope = scope.parentElement;
|
|
58
|
+
}
|
|
59
|
+
const container = scope ?? root.ownerDocument;
|
|
60
|
+
const card = container.querySelector(APPROVAL_CARD_SELECTOR);
|
|
61
|
+
if (card) {
|
|
62
|
+
card.scrollIntoView({ behavior: "smooth", block: "nearest" });
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
const viewport = container.querySelector(`[${THREAD_VIEWPORT_ATTR}]`);
|
|
66
|
+
viewport == null ? void 0 : viewport.scrollTo({ top: viewport.scrollHeight, behavior: "smooth" });
|
|
67
|
+
}, []);
|
|
68
|
+
const needsYou = (attention == null ? void 0 : attention.attention) === "needs_you";
|
|
69
|
+
const pending = approvalSummary !== null;
|
|
70
|
+
if (!needsYou && !pending) return null;
|
|
71
|
+
const text = ((_a = attention == null ? void 0 : attention.nextAction) == null ? void 0 : _a.trim()) || approvalSummary || "This session is waiting on you.";
|
|
72
|
+
return /* @__PURE__ */ jsx("div", { ref: rootRef, className: cn("aui-waiting-on-you", className), children: /* @__PURE__ */ jsx(
|
|
73
|
+
"div",
|
|
74
|
+
{
|
|
75
|
+
role: "status",
|
|
76
|
+
"data-testid": "waiting-on-you-banner",
|
|
77
|
+
"data-pending-approval": pending || void 0,
|
|
78
|
+
className: "mx-auto w-full max-w-(--thread-max-width) rounded-xl border border-amber-300 bg-amber-50 text-amber-900",
|
|
79
|
+
children: /* @__PURE__ */ jsxs(
|
|
80
|
+
"button",
|
|
81
|
+
{
|
|
82
|
+
type: "button",
|
|
83
|
+
onClick: scrollToApproval,
|
|
84
|
+
className: "flex w-full items-center gap-2 px-3 py-2 text-left text-xs transition-colors hover:bg-amber-100/70",
|
|
85
|
+
children: [
|
|
86
|
+
/* @__PURE__ */ jsx(HandIcon, { className: "size-4 shrink-0", "aria-hidden": "true" }),
|
|
87
|
+
/* @__PURE__ */ jsx("span", { className: "shrink-0 font-semibold", children: "Waiting on you" }),
|
|
88
|
+
/* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1 truncate text-amber-800", children: text }),
|
|
89
|
+
pending ? /* @__PURE__ */ jsx("span", { className: "shrink-0 font-medium underline-offset-2 hover:underline", children: "Review" }) : null
|
|
90
|
+
]
|
|
91
|
+
}
|
|
92
|
+
)
|
|
93
|
+
}
|
|
94
|
+
) });
|
|
95
|
+
};
|
|
96
|
+
export {
|
|
97
|
+
WaitingOnYouBanner,
|
|
98
|
+
WaitingOnYouBannerView
|
|
99
|
+
};
|
|
100
|
+
//# sourceMappingURL=WaitingOnYouBanner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WaitingOnYouBanner.js","sources":["../../src/chat/WaitingOnYouBanner.tsx"],"sourcesContent":["import { useAuiState } from '@assistant-ui/react';\nimport { hasStatewireThreadExtras, readInterruptMessage } from '@athenaintel/agent-runtime';\nimport { HandIcon } from 'lucide-react';\nimport { type FC, useCallback, useRef } from 'react';\nimport { THREAD_VIEWPORT_ATTR } from '../chat-ui/thread/statewire-history-edge';\nimport { cn } from '../lib/utils';\nimport {\n type AthenaSessionAttention,\n useAthenaSessionAttention,\n} from '../threads/use-athena-session-attention';\nimport { useStatewireApprovalRequest } from './use-statewire-approval-request';\n\n/** The CSS class `StatewireApprovalCard` puts on its section; the banner scrolls to it. */\nconst APPROVAL_CARD_SELECTOR = '.aui-approval-card';\n\nexport interface WaitingOnYouBannerProps {\n /** Applied to the outer wrapper (host padding); the banner itself is width-capped inside it. */\n className?: string;\n /** Copy shown when a parked interrupt carries no message. */\n fallbackMessage?: string;\n}\n\n/**\n * Persistent top-of-thread banner for a session that is waiting on the\n * viewer: shown while the active thread's attention is `needs_you` (from the\n * thread list) or while the approval hook reports a pending request. The text\n * is the server's next action, else a summary of the pending request; a\n * click scrolls to the approval card (or to the composer when there is no\n * card). It never duplicates the card's decision buttons — the card stays the\n * one place a request is answered. Renders nothing otherwise.\n */\nexport const WaitingOnYouBanner: FC<WaitingOnYouBannerProps> = (props) => {\n const extras = useAuiState((s) => s.thread.extras);\n const attention = useAthenaSessionAttention();\n // `useStatewireApprovalRequest` needs a statewire aui scope (it throws\n // outside one), so the approval leg mounts only once the thread extras are.\n if (!hasStatewireThreadExtras(extras)) {\n return <WaitingOnYouBannerView attention={attention} approvalSummary={null} {...props} />;\n }\n return <WaitingOnYouBannerWithApproval attention={attention} {...props} />;\n};\n\nconst WaitingOnYouBannerWithApproval: FC<\n WaitingOnYouBannerProps & { attention: AthenaSessionAttention | null }\n> = ({ attention, fallbackMessage, ...props }) => {\n const { request, hitl, liveHitl } = useStatewireApprovalRequest();\n const pending = request !== undefined || liveHitl !== null;\n const payload = hitl ?? liveHitl;\n const toolName = payload?.context?.tool_name ?? payload?.context?.tool_id;\n const pendingCount = payload?.context?.pending_action_count ?? 1;\n const approvalSummary = !pending\n ? null\n : payload && pendingCount === 1 && toolName\n ? `${toolName} requires approval before it runs.`\n : readInterruptMessage(request ? request.payload : liveHitl, fallbackMessage);\n return <WaitingOnYouBannerView attention={attention} approvalSummary={approvalSummary} {...props} />;\n};\n\nexport interface WaitingOnYouBannerViewProps {\n attention: Pick<AthenaSessionAttention, 'attention' | 'nextAction'> | null;\n /** Summary of the pending approval, or `null` when nothing is parked. */\n approvalSummary: string | null;\n className?: string;\n}\n\n/**\n * The banner itself, over already-resolved inputs — the pure presenter\n * `WaitingOnYouBanner` binds to the thread list and the approval hook.\n */\nexport const WaitingOnYouBannerView: FC<WaitingOnYouBannerViewProps> = ({\n attention,\n approvalSummary,\n className,\n}) => {\n const rootRef = useRef<HTMLDivElement>(null);\n const scrollToApproval = useCallback(() => {\n const root = rootRef.current;\n if (!root) return;\n // The nearest ancestor that holds the thread viewport is the chat panel;\n // the card lives in that viewport's sticky footer.\n let scope: HTMLElement | null = root.parentElement;\n while (scope && scope.querySelector(`[${THREAD_VIEWPORT_ATTR}]`) === null) {\n scope = scope.parentElement;\n }\n const container: ParentNode = scope ?? root.ownerDocument;\n const card = container.querySelector<HTMLElement>(APPROVAL_CARD_SELECTOR);\n if (card) {\n card.scrollIntoView({ behavior: 'smooth', block: 'nearest' });\n return;\n }\n const viewport = container.querySelector<HTMLElement>(`[${THREAD_VIEWPORT_ATTR}]`);\n viewport?.scrollTo({ top: viewport.scrollHeight, behavior: 'smooth' });\n }, []);\n\n const needsYou = attention?.attention === 'needs_you';\n const pending = approvalSummary !== null;\n if (!needsYou && !pending) return null;\n const text =\n attention?.nextAction?.trim() || approvalSummary || 'This session is waiting on you.';\n\n return (\n <div ref={rootRef} className={cn('aui-waiting-on-you', className)}>\n <div\n role=\"status\"\n data-testid=\"waiting-on-you-banner\"\n data-pending-approval={pending || undefined}\n className=\"mx-auto w-full max-w-(--thread-max-width) rounded-xl border border-amber-300 bg-amber-50 text-amber-900\"\n >\n <button\n type=\"button\"\n onClick={scrollToApproval}\n className=\"flex w-full items-center gap-2 px-3 py-2 text-left text-xs transition-colors hover:bg-amber-100/70\"\n >\n <HandIcon className=\"size-4 shrink-0\" aria-hidden=\"true\" />\n <span className=\"shrink-0 font-semibold\">Waiting on you</span>\n <span className=\"min-w-0 flex-1 truncate text-amber-800\">{text}</span>\n {pending ? (\n <span className=\"shrink-0 font-medium underline-offset-2 hover:underline\">\n Review\n </span>\n ) : null}\n </button>\n </div>\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAaA,MAAM,yBAAyB;AAkBxB,MAAM,qBAAkD,CAAC,UAAU;AACxE,QAAM,SAAS,YAAY,CAAC,MAAM,EAAE,OAAO,MAAM;AACjD,QAAM,YAAY,0BAAA;AAGlB,MAAI,CAAC,yBAAyB,MAAM,GAAG;AACrC,+BAAQ,wBAAA,EAAuB,WAAsB,iBAAiB,MAAO,GAAG,OAAO;AAAA,EACzF;AACA,SAAO,oBAAC,gCAAA,EAA+B,WAAuB,GAAG,MAAA,CAAO;AAC1E;AAEA,MAAM,iCAEF,CAAC,EAAE,WAAW,iBAAiB,GAAG,YAAY;;AAChD,QAAM,EAAE,SAAS,MAAM,SAAA,IAAa,4BAAA;AACpC,QAAM,UAAU,YAAY,UAAa,aAAa;AACtD,QAAM,UAAU,QAAQ;AACxB,QAAM,aAAW,wCAAS,YAAT,mBAAkB,gBAAa,wCAAS,YAAT,mBAAkB;AAClE,QAAM,iBAAe,wCAAS,YAAT,mBAAkB,yBAAwB;AAC/D,QAAM,kBAAkB,CAAC,UACrB,OACA,WAAW,iBAAiB,KAAK,WAC/B,GAAG,QAAQ,uCACX,qBAAqB,UAAU,QAAQ,UAAU,UAAU,eAAe;AAChF,SAAO,oBAAC,wBAAA,EAAuB,WAAsB,iBAAmC,GAAG,OAAO;AACpG;AAaO,MAAM,yBAA0D,CAAC;AAAA,EACtE;AAAA,EACA;AAAA,EACA;AACF,MAAM;;AACJ,QAAM,UAAU,OAAuB,IAAI;AAC3C,QAAM,mBAAmB,YAAY,MAAM;AACzC,UAAM,OAAO,QAAQ;AACrB,QAAI,CAAC,KAAM;AAGX,QAAI,QAA4B,KAAK;AACrC,WAAO,SAAS,MAAM,cAAc,IAAI,oBAAoB,GAAG,MAAM,MAAM;AACzE,cAAQ,MAAM;AAAA,IAChB;AACA,UAAM,YAAwB,SAAS,KAAK;AAC5C,UAAM,OAAO,UAAU,cAA2B,sBAAsB;AACxE,QAAI,MAAM;AACR,WAAK,eAAe,EAAE,UAAU,UAAU,OAAO,WAAW;AAC5D;AAAA,IACF;AACA,UAAM,WAAW,UAAU,cAA2B,IAAI,oBAAoB,GAAG;AACjF,yCAAU,SAAS,EAAE,KAAK,SAAS,cAAc,UAAU;EAC7D,GAAG,CAAA,CAAE;AAEL,QAAM,YAAW,uCAAW,eAAc;AAC1C,QAAM,UAAU,oBAAoB;AACpC,MAAI,CAAC,YAAY,CAAC,QAAS,QAAO;AAClC,QAAM,SACJ,4CAAW,eAAX,mBAAuB,WAAU,mBAAmB;AAEtD,SACE,oBAAC,SAAI,KAAK,SAAS,WAAW,GAAG,sBAAsB,SAAS,GAC9D,UAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,MAAK;AAAA,MACL,eAAY;AAAA,MACZ,yBAAuB,WAAW;AAAA,MAClC,WAAU;AAAA,MAEV,UAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,SAAS;AAAA,UACT,WAAU;AAAA,UAEV,UAAA;AAAA,YAAA,oBAAC,UAAA,EAAS,WAAU,mBAAkB,eAAY,QAAO;AAAA,YACzD,oBAAC,QAAA,EAAK,WAAU,0BAAyB,UAAA,kBAAc;AAAA,YACvD,oBAAC,QAAA,EAAK,WAAU,0CAA0C,UAAA,MAAK;AAAA,YAC9D,UACC,oBAAC,QAAA,EAAK,WAAU,2DAA0D,oBAE1E,IACE;AAAA,UAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IACN;AAAA,EAAA,GAEJ;AAEJ;"}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
+
const lucideReact = require("lucide-react");
|
|
5
|
+
const react = require("react");
|
|
6
|
+
const useSendMessage = require("../composer/useSendMessage.cjs");
|
|
7
|
+
const usePrefersReducedMotion = require("../lib/use-prefers-reduced-motion.cjs");
|
|
8
|
+
const cnfast = require("cnfast");
|
|
9
|
+
const DEFAULT_WELCOME_SUGGESTIONS = [
|
|
10
|
+
{
|
|
11
|
+
icon: lucideReact.SearchIcon,
|
|
12
|
+
title: "Research a topic and draft a report",
|
|
13
|
+
prompt: "Search the web for the latest developments in enterprise AI adoption, then create a document summarizing the key trends, market data, and strategic implications."
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
icon: lucideReact.SearchIcon,
|
|
17
|
+
title: "Compare recent AI model launches",
|
|
18
|
+
prompt: "Search the web for the latest major AI model launches from OpenAI, Anthropic, and Google, then summarize the release dates, standout capabilities, and practical tradeoffs in a concise comparison table."
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
icon: lucideReact.PresentationIcon,
|
|
22
|
+
title: "Build a presentation from scratch",
|
|
23
|
+
prompt: "Create a 5-slide investor update presentation covering market opportunity, product traction, key metrics, competitive positioning, and next steps."
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
icon: lucideReact.FileTextIcon,
|
|
27
|
+
title: "Set up a structured spreadsheet",
|
|
28
|
+
prompt: "Create a project tracking spreadsheet with columns for task name, owner, priority, status, start date, due date, and completion percentage."
|
|
29
|
+
}
|
|
30
|
+
];
|
|
31
|
+
const WELCOME_GREETING_SUBTEXT_DELAY_MS = 60;
|
|
32
|
+
const WELCOME_SUGGESTION_STAGGER_BASE_MS = 120;
|
|
33
|
+
const WELCOME_SUGGESTION_STAGGER_STEP_MS = 70;
|
|
34
|
+
const WELCOME_COMPOSER_ENTER_DELAY_MS = 360;
|
|
35
|
+
function welcomeSuggestionDelayMs(index) {
|
|
36
|
+
return WELCOME_SUGGESTION_STAGGER_BASE_MS + index * WELCOME_SUGGESTION_STAGGER_STEP_MS;
|
|
37
|
+
}
|
|
38
|
+
const WELCOME_COMPOSER_AFTER_LAST_CARD_MS = 30;
|
|
39
|
+
function welcomeComposerDelayMs(suggestionCount) {
|
|
40
|
+
if (suggestionCount <= 0) return WELCOME_COMPOSER_ENTER_DELAY_MS;
|
|
41
|
+
return Math.max(
|
|
42
|
+
WELCOME_COMPOSER_ENTER_DELAY_MS,
|
|
43
|
+
welcomeSuggestionDelayMs(suggestionCount - 1) + WELCOME_COMPOSER_AFTER_LAST_CARD_MS
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
const WELCOME_ENTER_CLASS = "animate-in fade-in slide-in-from-bottom-2 fill-mode-both animation-duration-300";
|
|
47
|
+
function welcomeEntrance(delayMs, reducedMotion) {
|
|
48
|
+
if (reducedMotion) return { className: void 0, style: void 0 };
|
|
49
|
+
return { className: WELCOME_ENTER_CLASS, style: { animationDelay: `${delayMs}ms` } };
|
|
50
|
+
}
|
|
51
|
+
const SuggestionCard = ({ suggestion, index, reducedMotion }) => {
|
|
52
|
+
const Icon = suggestion.icon;
|
|
53
|
+
const sendMessage = useSendMessage.useSendMessage();
|
|
54
|
+
const entrance = welcomeEntrance(welcomeSuggestionDelayMs(index), reducedMotion);
|
|
55
|
+
const handleClick = react.useCallback(() => {
|
|
56
|
+
void sendMessage(suggestion.prompt);
|
|
57
|
+
}, [sendMessage, suggestion.prompt]);
|
|
58
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
59
|
+
"button",
|
|
60
|
+
{
|
|
61
|
+
type: "button",
|
|
62
|
+
onClick: handleClick,
|
|
63
|
+
className: cnfast.cn(
|
|
64
|
+
"aui-thread-welcome-suggestion group flex flex-col items-start gap-2.5 rounded-xl border border-border/60 bg-card p-3.5 text-left shadow-sm transition-all duration-150 hover:border-border hover:bg-muted/40 hover:shadow-md focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40",
|
|
65
|
+
entrance.className
|
|
66
|
+
),
|
|
67
|
+
style: entrance.style,
|
|
68
|
+
"data-welcome-suggestion": index,
|
|
69
|
+
children: [
|
|
70
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex w-full items-center justify-between", children: [
|
|
71
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex size-8 shrink-0 items-center justify-center rounded-lg bg-muted/60 text-muted-foreground transition-colors group-hover:bg-primary/10 group-hover:text-primary", children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { className: "size-4" }) }),
|
|
72
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ArrowRightIcon, { className: "size-3.5 shrink-0 text-muted-foreground/0 transition-all group-hover:text-muted-foreground" })
|
|
73
|
+
] }),
|
|
74
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[13px] font-medium leading-snug text-foreground", children: suggestion.title })
|
|
75
|
+
]
|
|
76
|
+
}
|
|
77
|
+
);
|
|
78
|
+
};
|
|
79
|
+
const AthenaChatWelcomeSuggestions = ({
|
|
80
|
+
suggestions,
|
|
81
|
+
className
|
|
82
|
+
}) => {
|
|
83
|
+
const reducedMotion = usePrefersReducedMotion.usePrefersReducedMotion();
|
|
84
|
+
if (suggestions.length === 0) return null;
|
|
85
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
86
|
+
"div",
|
|
87
|
+
{
|
|
88
|
+
className: cnfast.cn(
|
|
89
|
+
"aui-thread-welcome-suggestions grid w-full auto-rows-fr grid-cols-2 gap-2.5 @min-[40rem]:grid-flow-col @min-[40rem]:auto-cols-fr",
|
|
90
|
+
className
|
|
91
|
+
),
|
|
92
|
+
"data-testid": "athena-welcome-suggestions",
|
|
93
|
+
children: suggestions.map((suggestion, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
94
|
+
SuggestionCard,
|
|
95
|
+
{
|
|
96
|
+
suggestion,
|
|
97
|
+
index,
|
|
98
|
+
reducedMotion
|
|
99
|
+
},
|
|
100
|
+
suggestion.title
|
|
101
|
+
))
|
|
102
|
+
}
|
|
103
|
+
);
|
|
104
|
+
};
|
|
105
|
+
const AthenaChatWelcome = ({
|
|
106
|
+
welcomeMessage,
|
|
107
|
+
welcomeSubtext
|
|
108
|
+
}) => {
|
|
109
|
+
const reducedMotion = usePrefersReducedMotion.usePrefersReducedMotion();
|
|
110
|
+
const greeting = welcomeEntrance(0, reducedMotion);
|
|
111
|
+
const subtext = welcomeEntrance(WELCOME_GREETING_SUBTEXT_DELAY_MS, reducedMotion);
|
|
112
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "aui-thread-welcome-root mx-auto my-auto flex w-full max-w-(--thread-max-width) grow flex-col", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "aui-thread-welcome-center flex w-full grow flex-col items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "aui-thread-welcome-message flex size-full flex-col justify-center px-4", children: [
|
|
113
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
114
|
+
"h2",
|
|
115
|
+
{
|
|
116
|
+
className: cnfast.cn(
|
|
117
|
+
"aui-thread-welcome-message-inner text-2xl font-semibold text-foreground",
|
|
118
|
+
greeting.className
|
|
119
|
+
),
|
|
120
|
+
style: greeting.style,
|
|
121
|
+
children: welcomeMessage
|
|
122
|
+
}
|
|
123
|
+
),
|
|
124
|
+
welcomeSubtext && /* @__PURE__ */ jsxRuntime.jsx(
|
|
125
|
+
"p",
|
|
126
|
+
{
|
|
127
|
+
className: cnfast.cn(
|
|
128
|
+
"aui-thread-welcome-message-inner text-lg text-muted-foreground",
|
|
129
|
+
subtext.className
|
|
130
|
+
),
|
|
131
|
+
style: subtext.style,
|
|
132
|
+
children: welcomeSubtext
|
|
133
|
+
}
|
|
134
|
+
)
|
|
135
|
+
] }) }) });
|
|
136
|
+
};
|
|
137
|
+
exports.AthenaChatWelcome = AthenaChatWelcome;
|
|
138
|
+
exports.AthenaChatWelcomeSuggestions = AthenaChatWelcomeSuggestions;
|
|
139
|
+
exports.DEFAULT_WELCOME_SUGGESTIONS = DEFAULT_WELCOME_SUGGESTIONS;
|
|
140
|
+
exports.WELCOME_COMPOSER_ENTER_DELAY_MS = WELCOME_COMPOSER_ENTER_DELAY_MS;
|
|
141
|
+
exports.WELCOME_ENTER_CLASS = WELCOME_ENTER_CLASS;
|
|
142
|
+
exports.WELCOME_GREETING_SUBTEXT_DELAY_MS = WELCOME_GREETING_SUBTEXT_DELAY_MS;
|
|
143
|
+
exports.WELCOME_SUGGESTION_STAGGER_BASE_MS = WELCOME_SUGGESTION_STAGGER_BASE_MS;
|
|
144
|
+
exports.WELCOME_SUGGESTION_STAGGER_STEP_MS = WELCOME_SUGGESTION_STAGGER_STEP_MS;
|
|
145
|
+
exports.welcomeComposerDelayMs = welcomeComposerDelayMs;
|
|
146
|
+
exports.welcomeEntrance = welcomeEntrance;
|
|
147
|
+
exports.welcomeSuggestionDelayMs = welcomeSuggestionDelayMs;
|
|
148
|
+
//# sourceMappingURL=athena-chat-welcome.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"athena-chat-welcome.cjs","sources":["../../src/chat/athena-chat-welcome.tsx"],"sourcesContent":["import { ArrowRightIcon, FileTextIcon, PresentationIcon, SearchIcon } from 'lucide-react';\nimport { useCallback, type CSSProperties, type FC } from 'react';\nimport { useSendMessage } from '../composer/useSendMessage';\nimport { cn } from '../lib/utils';\nimport { usePrefersReducedMotion } from '../lib/use-prefers-reduced-motion';\n\nexport interface WelcomeSuggestion {\n icon: React.ElementType;\n title: string;\n prompt: string;\n}\n\nexport const DEFAULT_WELCOME_SUGGESTIONS: WelcomeSuggestion[] = [\n {\n icon: SearchIcon,\n title: 'Research a topic and draft a report',\n prompt:\n 'Search the web for the latest developments in enterprise AI adoption, then create a document summarizing the key trends, market data, and strategic implications.',\n },\n {\n icon: SearchIcon,\n title: 'Compare recent AI model launches',\n prompt:\n 'Search the web for the latest major AI model launches from OpenAI, Anthropic, and Google, then summarize the release dates, standout capabilities, and practical tradeoffs in a concise comparison table.',\n },\n {\n icon: PresentationIcon,\n title: 'Build a presentation from scratch',\n prompt:\n 'Create a 5-slide investor update presentation covering market opportunity, product traction, key metrics, competitive positioning, and next steps.',\n },\n {\n icon: FileTextIcon,\n title: 'Set up a structured spreadsheet',\n prompt:\n 'Create a project tracking spreadsheet with columns for task name, owner, priority, status, start date, due date, and completion percentage.',\n },\n];\n\n/**\n * The empty state's entrance schedule: the greeting first, the suggestion\n * cards staggered behind it, the composer last. Every value is an inline\n * `animation-delay`, so a host reading the DOM sees the schedule as-is.\n */\nexport const WELCOME_GREETING_SUBTEXT_DELAY_MS = 60;\nexport const WELCOME_SUGGESTION_STAGGER_BASE_MS = 120;\nexport const WELCOME_SUGGESTION_STAGGER_STEP_MS = 70;\nexport const WELCOME_COMPOSER_ENTER_DELAY_MS = 360;\n\nexport function welcomeSuggestionDelayMs(index: number): number {\n return WELCOME_SUGGESTION_STAGGER_BASE_MS + index * WELCOME_SUGGESTION_STAGGER_STEP_MS;\n}\n\n/** Gap between the last card and the composer, which always arrives last. */\nconst WELCOME_COMPOSER_AFTER_LAST_CARD_MS = 30;\n\n/**\n * When the composer enters: 360 ms behind the default four cards, and behind\n * the last card whenever a host supplies more (`welcomeSuggestions` is\n * unbounded), so the composer is always the final element to arrive.\n */\nexport function welcomeComposerDelayMs(suggestionCount: number): number {\n if (suggestionCount <= 0) return WELCOME_COMPOSER_ENTER_DELAY_MS;\n return Math.max(\n WELCOME_COMPOSER_ENTER_DELAY_MS,\n welcomeSuggestionDelayMs(suggestionCount - 1) + WELCOME_COMPOSER_AFTER_LAST_CARD_MS,\n );\n}\n\n/** Fade + short rise; `fill-mode-both` holds the hidden start through a delay. */\nexport const WELCOME_ENTER_CLASS =\n 'animate-in fade-in slide-in-from-bottom-2 fill-mode-both animation-duration-300';\n\n/**\n * Inline entrance schedule for one element, or nothing under reduced motion\n * (no classes, no delay — the element is simply there).\n */\nexport function welcomeEntrance(\n delayMs: number,\n reducedMotion: boolean,\n): { className: string | undefined; style: CSSProperties | undefined } {\n if (reducedMotion) return { className: undefined, style: undefined };\n return { className: WELCOME_ENTER_CLASS, style: { animationDelay: `${delayMs}ms` } };\n}\n\nconst SuggestionCard: FC<{\n suggestion: WelcomeSuggestion;\n index: number;\n reducedMotion: boolean;\n}> = ({ suggestion, index, reducedMotion }) => {\n const Icon = suggestion.icon;\n const sendMessage = useSendMessage();\n const entrance = welcomeEntrance(welcomeSuggestionDelayMs(index), reducedMotion);\n\n const handleClick = useCallback(() => {\n void sendMessage(suggestion.prompt);\n }, [sendMessage, suggestion.prompt]);\n\n // Icon row above the title: the card reads the same at a 2-column width\n // and in the one-row layout, where each card is about a quarter of the\n // thread and a side-by-side icon would leave the title a few words wide.\n return (\n <button\n type=\"button\"\n onClick={handleClick}\n className={cn(\n 'aui-thread-welcome-suggestion group flex flex-col items-start gap-2.5 rounded-xl border border-border/60 bg-card p-3.5 text-left shadow-sm transition-all duration-150 hover:border-border hover:bg-muted/40 hover:shadow-md focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40',\n entrance.className,\n )}\n style={entrance.style}\n data-welcome-suggestion={index}\n >\n <span className=\"flex w-full items-center justify-between\">\n <span className=\"flex size-8 shrink-0 items-center justify-center rounded-lg bg-muted/60 text-muted-foreground transition-colors group-hover:bg-primary/10 group-hover:text-primary\">\n <Icon className=\"size-4\" />\n </span>\n <ArrowRightIcon className=\"size-3.5 shrink-0 text-muted-foreground/0 transition-all group-hover:text-muted-foreground\" />\n </span>\n <span className=\"text-[13px] font-medium leading-snug text-foreground\">\n {suggestion.title}\n </span>\n </button>\n );\n};\n\nexport interface AthenaChatWelcomeSuggestionsProps {\n suggestions: readonly WelcomeSuggestion[];\n className?: string;\n}\n\n/**\n * The suggestion cards, docked directly above the composer in the empty\n * state: equal-width in one row once the thread is 40rem wide, a two-column\n * grid below that (a container query on the thread root, so a chat embedded\n * in a narrow pane of a wide window wraps too). Cards stagger in at\n * 120 ms + 70 ms × index; none of it moves under reduced motion.\n */\nexport const AthenaChatWelcomeSuggestions: FC<AthenaChatWelcomeSuggestionsProps> = ({\n suggestions,\n className,\n}) => {\n const reducedMotion = usePrefersReducedMotion();\n if (suggestions.length === 0) return null;\n return (\n <div\n className={cn(\n 'aui-thread-welcome-suggestions grid w-full auto-rows-fr grid-cols-2 gap-2.5 @min-[40rem]:grid-flow-col @min-[40rem]:auto-cols-fr',\n className,\n )}\n data-testid=\"athena-welcome-suggestions\"\n >\n {suggestions.map((suggestion, index) => (\n <SuggestionCard\n key={suggestion.title}\n suggestion={suggestion}\n index={index}\n reducedMotion={reducedMotion}\n />\n ))}\n </div>\n );\n};\n\nexport interface AthenaChatWelcomeProps {\n welcomeMessage: string;\n welcomeSubtext?: string;\n}\n\n/**\n * The greeting, centred in the viewport's free space while the thread is\n * empty. Fades and rises in; the subtext follows a beat later.\n */\nexport const AthenaChatWelcome: FC<AthenaChatWelcomeProps> = ({\n welcomeMessage,\n welcomeSubtext,\n}) => {\n const reducedMotion = usePrefersReducedMotion();\n const greeting = welcomeEntrance(0, reducedMotion);\n const subtext = welcomeEntrance(WELCOME_GREETING_SUBTEXT_DELAY_MS, reducedMotion);\n return (\n <div className=\"aui-thread-welcome-root mx-auto my-auto flex w-full max-w-(--thread-max-width) grow flex-col\">\n <div className=\"aui-thread-welcome-center flex w-full grow flex-col items-center justify-center\">\n <div className=\"aui-thread-welcome-message flex size-full flex-col justify-center px-4\">\n <h2\n className={cn(\n 'aui-thread-welcome-message-inner text-2xl font-semibold text-foreground',\n greeting.className,\n )}\n style={greeting.style}\n >\n {welcomeMessage}\n </h2>\n {welcomeSubtext && (\n <p\n className={cn(\n 'aui-thread-welcome-message-inner text-lg text-muted-foreground',\n subtext.className,\n )}\n style={subtext.style}\n >\n {welcomeSubtext}\n </p>\n )}\n </div>\n </div>\n </div>\n );\n};\n"],"names":["SearchIcon","PresentationIcon","FileTextIcon","useSendMessage","useCallback","jsxs","cn","jsx","ArrowRightIcon","usePrefersReducedMotion"],"mappings":";;;;;;;;AAYO,MAAM,8BAAmD;AAAA,EAC9D;AAAA,IACE,MAAMA,YAAAA;AAAAA,IACN,OAAO;AAAA,IACP,QACE;AAAA,EAAA;AAAA,EAEJ;AAAA,IACE,MAAMA,YAAAA;AAAAA,IACN,OAAO;AAAA,IACP,QACE;AAAA,EAAA;AAAA,EAEJ;AAAA,IACE,MAAMC,YAAAA;AAAAA,IACN,OAAO;AAAA,IACP,QACE;AAAA,EAAA;AAAA,EAEJ;AAAA,IACE,MAAMC,YAAAA;AAAAA,IACN,OAAO;AAAA,IACP,QACE;AAAA,EAAA;AAEN;AAOO,MAAM,oCAAoC;AAC1C,MAAM,qCAAqC;AAC3C,MAAM,qCAAqC;AAC3C,MAAM,kCAAkC;AAExC,SAAS,yBAAyB,OAAuB;AAC9D,SAAO,qCAAqC,QAAQ;AACtD;AAGA,MAAM,sCAAsC;AAOrC,SAAS,uBAAuB,iBAAiC;AACtE,MAAI,mBAAmB,EAAG,QAAO;AACjC,SAAO,KAAK;AAAA,IACV;AAAA,IACA,yBAAyB,kBAAkB,CAAC,IAAI;AAAA,EAAA;AAEpD;AAGO,MAAM,sBACX;AAMK,SAAS,gBACd,SACA,eACqE;AACrE,MAAI,cAAe,QAAO,EAAE,WAAW,QAAW,OAAO,OAAA;AACzD,SAAO,EAAE,WAAW,qBAAqB,OAAO,EAAE,gBAAgB,GAAG,OAAO,OAAK;AACnF;AAEA,MAAM,iBAID,CAAC,EAAE,YAAY,OAAO,oBAAoB;AAC7C,QAAM,OAAO,WAAW;AACxB,QAAM,cAAcC,eAAAA,eAAA;AACpB,QAAM,WAAW,gBAAgB,yBAAyB,KAAK,GAAG,aAAa;AAE/E,QAAM,cAAcC,MAAAA,YAAY,MAAM;AACpC,SAAK,YAAY,WAAW,MAAM;AAAA,EACpC,GAAG,CAAC,aAAa,WAAW,MAAM,CAAC;AAKnC,SACEC,2BAAAA;AAAAA,IAAC;AAAA,IAAA;AAAA,MACC,MAAK;AAAA,MACL,SAAS;AAAA,MACT,WAAWC,OAAAA;AAAAA,QACT;AAAA,QACA,SAAS;AAAA,MAAA;AAAA,MAEX,OAAO,SAAS;AAAA,MAChB,2BAAyB;AAAA,MAEzB,UAAA;AAAA,QAAAD,2BAAAA,KAAC,QAAA,EAAK,WAAU,4CACd,UAAA;AAAA,UAAAE,2BAAAA,IAAC,UAAK,WAAU,sKACd,yCAAC,MAAA,EAAK,WAAU,UAAS,EAAA,CAC3B;AAAA,UACAA,2BAAAA,IAACC,YAAAA,gBAAA,EAAe,WAAU,6FAAA,CAA6F;AAAA,QAAA,GACzH;AAAA,QACAD,2BAAAA,IAAC,QAAA,EAAK,WAAU,wDACb,qBAAW,MAAA,CACd;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN;AAcO,MAAM,+BAAsE,CAAC;AAAA,EAClF;AAAA,EACA;AACF,MAAM;AACJ,QAAM,gBAAgBE,wBAAAA,wBAAA;AACtB,MAAI,YAAY,WAAW,EAAG,QAAO;AACrC,SACEF,2BAAAA;AAAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWD,OAAAA;AAAAA,QACT;AAAA,QACA;AAAA,MAAA;AAAA,MAEF,eAAY;AAAA,MAEX,UAAA,YAAY,IAAI,CAAC,YAAY,UAC5BC,2BAAAA;AAAAA,QAAC;AAAA,QAAA;AAAA,UAEC;AAAA,UACA;AAAA,UACA;AAAA,QAAA;AAAA,QAHK,WAAW;AAAA,MAAA,CAKnB;AAAA,IAAA;AAAA,EAAA;AAGP;AAWO,MAAM,oBAAgD,CAAC;AAAA,EAC5D;AAAA,EACA;AACF,MAAM;AACJ,QAAM,gBAAgBE,wBAAAA,wBAAA;AACtB,QAAM,WAAW,gBAAgB,GAAG,aAAa;AACjD,QAAM,UAAU,gBAAgB,mCAAmC,aAAa;AAChF,SACEF,2BAAAA,IAAC,OAAA,EAAI,WAAU,gGACb,UAAAA,2BAAAA,IAAC,OAAA,EAAI,WAAU,mFACb,UAAAF,2BAAAA,KAAC,OAAA,EAAI,WAAU,0EACb,UAAA;AAAA,IAAAE,2BAAAA;AAAAA,MAAC;AAAA,MAAA;AAAA,QACC,WAAWD,OAAAA;AAAAA,UACT;AAAA,UACA,SAAS;AAAA,QAAA;AAAA,QAEX,OAAO,SAAS;AAAA,QAEf,UAAA;AAAA,MAAA;AAAA,IAAA;AAAA,IAEF,kBACCC,2BAAAA;AAAAA,MAAC;AAAA,MAAA;AAAA,QACC,WAAWD,OAAAA;AAAAA,UACT;AAAA,UACA,QAAQ;AAAA,QAAA;AAAA,QAEV,OAAO,QAAQ;AAAA,QAEd,UAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EACH,EAAA,CAEJ,GACF,GACF;AAEJ;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { type CSSProperties, type FC } from 'react';
|
|
2
|
+
export interface WelcomeSuggestion {
|
|
3
|
+
icon: React.ElementType;
|
|
4
|
+
title: string;
|
|
5
|
+
prompt: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const DEFAULT_WELCOME_SUGGESTIONS: WelcomeSuggestion[];
|
|
8
|
+
/**
|
|
9
|
+
* The empty state's entrance schedule: the greeting first, the suggestion
|
|
10
|
+
* cards staggered behind it, the composer last. Every value is an inline
|
|
11
|
+
* `animation-delay`, so a host reading the DOM sees the schedule as-is.
|
|
12
|
+
*/
|
|
13
|
+
export declare const WELCOME_GREETING_SUBTEXT_DELAY_MS = 60;
|
|
14
|
+
export declare const WELCOME_SUGGESTION_STAGGER_BASE_MS = 120;
|
|
15
|
+
export declare const WELCOME_SUGGESTION_STAGGER_STEP_MS = 70;
|
|
16
|
+
export declare const WELCOME_COMPOSER_ENTER_DELAY_MS = 360;
|
|
17
|
+
export declare function welcomeSuggestionDelayMs(index: number): number;
|
|
18
|
+
/**
|
|
19
|
+
* When the composer enters: 360 ms behind the default four cards, and behind
|
|
20
|
+
* the last card whenever a host supplies more (`welcomeSuggestions` is
|
|
21
|
+
* unbounded), so the composer is always the final element to arrive.
|
|
22
|
+
*/
|
|
23
|
+
export declare function welcomeComposerDelayMs(suggestionCount: number): number;
|
|
24
|
+
/** Fade + short rise; `fill-mode-both` holds the hidden start through a delay. */
|
|
25
|
+
export declare const WELCOME_ENTER_CLASS = "animate-in fade-in slide-in-from-bottom-2 fill-mode-both animation-duration-300";
|
|
26
|
+
/**
|
|
27
|
+
* Inline entrance schedule for one element, or nothing under reduced motion
|
|
28
|
+
* (no classes, no delay — the element is simply there).
|
|
29
|
+
*/
|
|
30
|
+
export declare function welcomeEntrance(delayMs: number, reducedMotion: boolean): {
|
|
31
|
+
className: string | undefined;
|
|
32
|
+
style: CSSProperties | undefined;
|
|
33
|
+
};
|
|
34
|
+
export interface AthenaChatWelcomeSuggestionsProps {
|
|
35
|
+
suggestions: readonly WelcomeSuggestion[];
|
|
36
|
+
className?: string;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* The suggestion cards, docked directly above the composer in the empty
|
|
40
|
+
* state: equal-width in one row once the thread is 40rem wide, a two-column
|
|
41
|
+
* grid below that (a container query on the thread root, so a chat embedded
|
|
42
|
+
* in a narrow pane of a wide window wraps too). Cards stagger in at
|
|
43
|
+
* 120 ms + 70 ms × index; none of it moves under reduced motion.
|
|
44
|
+
*/
|
|
45
|
+
export declare const AthenaChatWelcomeSuggestions: FC<AthenaChatWelcomeSuggestionsProps>;
|
|
46
|
+
export interface AthenaChatWelcomeProps {
|
|
47
|
+
welcomeMessage: string;
|
|
48
|
+
welcomeSubtext?: string;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* The greeting, centred in the viewport's free space while the thread is
|
|
52
|
+
* empty. Fades and rises in; the subtext follows a beat later.
|
|
53
|
+
*/
|
|
54
|
+
export declare const AthenaChatWelcome: FC<AthenaChatWelcomeProps>;
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { SearchIcon, PresentationIcon, FileTextIcon, ArrowRightIcon } from "lucide-react";
|
|
3
|
+
import { useCallback } from "react";
|
|
4
|
+
import { useSendMessage } from "../composer/useSendMessage.js";
|
|
5
|
+
import { usePrefersReducedMotion } from "../lib/use-prefers-reduced-motion.js";
|
|
6
|
+
import { cn } from "cnfast";
|
|
7
|
+
const DEFAULT_WELCOME_SUGGESTIONS = [
|
|
8
|
+
{
|
|
9
|
+
icon: SearchIcon,
|
|
10
|
+
title: "Research a topic and draft a report",
|
|
11
|
+
prompt: "Search the web for the latest developments in enterprise AI adoption, then create a document summarizing the key trends, market data, and strategic implications."
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
icon: SearchIcon,
|
|
15
|
+
title: "Compare recent AI model launches",
|
|
16
|
+
prompt: "Search the web for the latest major AI model launches from OpenAI, Anthropic, and Google, then summarize the release dates, standout capabilities, and practical tradeoffs in a concise comparison table."
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
icon: PresentationIcon,
|
|
20
|
+
title: "Build a presentation from scratch",
|
|
21
|
+
prompt: "Create a 5-slide investor update presentation covering market opportunity, product traction, key metrics, competitive positioning, and next steps."
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
icon: FileTextIcon,
|
|
25
|
+
title: "Set up a structured spreadsheet",
|
|
26
|
+
prompt: "Create a project tracking spreadsheet with columns for task name, owner, priority, status, start date, due date, and completion percentage."
|
|
27
|
+
}
|
|
28
|
+
];
|
|
29
|
+
const WELCOME_GREETING_SUBTEXT_DELAY_MS = 60;
|
|
30
|
+
const WELCOME_SUGGESTION_STAGGER_BASE_MS = 120;
|
|
31
|
+
const WELCOME_SUGGESTION_STAGGER_STEP_MS = 70;
|
|
32
|
+
const WELCOME_COMPOSER_ENTER_DELAY_MS = 360;
|
|
33
|
+
function welcomeSuggestionDelayMs(index) {
|
|
34
|
+
return WELCOME_SUGGESTION_STAGGER_BASE_MS + index * WELCOME_SUGGESTION_STAGGER_STEP_MS;
|
|
35
|
+
}
|
|
36
|
+
const WELCOME_COMPOSER_AFTER_LAST_CARD_MS = 30;
|
|
37
|
+
function welcomeComposerDelayMs(suggestionCount) {
|
|
38
|
+
if (suggestionCount <= 0) return WELCOME_COMPOSER_ENTER_DELAY_MS;
|
|
39
|
+
return Math.max(
|
|
40
|
+
WELCOME_COMPOSER_ENTER_DELAY_MS,
|
|
41
|
+
welcomeSuggestionDelayMs(suggestionCount - 1) + WELCOME_COMPOSER_AFTER_LAST_CARD_MS
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
const WELCOME_ENTER_CLASS = "animate-in fade-in slide-in-from-bottom-2 fill-mode-both animation-duration-300";
|
|
45
|
+
function welcomeEntrance(delayMs, reducedMotion) {
|
|
46
|
+
if (reducedMotion) return { className: void 0, style: void 0 };
|
|
47
|
+
return { className: WELCOME_ENTER_CLASS, style: { animationDelay: `${delayMs}ms` } };
|
|
48
|
+
}
|
|
49
|
+
const SuggestionCard = ({ suggestion, index, reducedMotion }) => {
|
|
50
|
+
const Icon = suggestion.icon;
|
|
51
|
+
const sendMessage = useSendMessage();
|
|
52
|
+
const entrance = welcomeEntrance(welcomeSuggestionDelayMs(index), reducedMotion);
|
|
53
|
+
const handleClick = useCallback(() => {
|
|
54
|
+
void sendMessage(suggestion.prompt);
|
|
55
|
+
}, [sendMessage, suggestion.prompt]);
|
|
56
|
+
return /* @__PURE__ */ jsxs(
|
|
57
|
+
"button",
|
|
58
|
+
{
|
|
59
|
+
type: "button",
|
|
60
|
+
onClick: handleClick,
|
|
61
|
+
className: cn(
|
|
62
|
+
"aui-thread-welcome-suggestion group flex flex-col items-start gap-2.5 rounded-xl border border-border/60 bg-card p-3.5 text-left shadow-sm transition-all duration-150 hover:border-border hover:bg-muted/40 hover:shadow-md focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40",
|
|
63
|
+
entrance.className
|
|
64
|
+
),
|
|
65
|
+
style: entrance.style,
|
|
66
|
+
"data-welcome-suggestion": index,
|
|
67
|
+
children: [
|
|
68
|
+
/* @__PURE__ */ jsxs("span", { className: "flex w-full items-center justify-between", children: [
|
|
69
|
+
/* @__PURE__ */ jsx("span", { className: "flex size-8 shrink-0 items-center justify-center rounded-lg bg-muted/60 text-muted-foreground transition-colors group-hover:bg-primary/10 group-hover:text-primary", children: /* @__PURE__ */ jsx(Icon, { className: "size-4" }) }),
|
|
70
|
+
/* @__PURE__ */ jsx(ArrowRightIcon, { className: "size-3.5 shrink-0 text-muted-foreground/0 transition-all group-hover:text-muted-foreground" })
|
|
71
|
+
] }),
|
|
72
|
+
/* @__PURE__ */ jsx("span", { className: "text-[13px] font-medium leading-snug text-foreground", children: suggestion.title })
|
|
73
|
+
]
|
|
74
|
+
}
|
|
75
|
+
);
|
|
76
|
+
};
|
|
77
|
+
const AthenaChatWelcomeSuggestions = ({
|
|
78
|
+
suggestions,
|
|
79
|
+
className
|
|
80
|
+
}) => {
|
|
81
|
+
const reducedMotion = usePrefersReducedMotion();
|
|
82
|
+
if (suggestions.length === 0) return null;
|
|
83
|
+
return /* @__PURE__ */ jsx(
|
|
84
|
+
"div",
|
|
85
|
+
{
|
|
86
|
+
className: cn(
|
|
87
|
+
"aui-thread-welcome-suggestions grid w-full auto-rows-fr grid-cols-2 gap-2.5 @min-[40rem]:grid-flow-col @min-[40rem]:auto-cols-fr",
|
|
88
|
+
className
|
|
89
|
+
),
|
|
90
|
+
"data-testid": "athena-welcome-suggestions",
|
|
91
|
+
children: suggestions.map((suggestion, index) => /* @__PURE__ */ jsx(
|
|
92
|
+
SuggestionCard,
|
|
93
|
+
{
|
|
94
|
+
suggestion,
|
|
95
|
+
index,
|
|
96
|
+
reducedMotion
|
|
97
|
+
},
|
|
98
|
+
suggestion.title
|
|
99
|
+
))
|
|
100
|
+
}
|
|
101
|
+
);
|
|
102
|
+
};
|
|
103
|
+
const AthenaChatWelcome = ({
|
|
104
|
+
welcomeMessage,
|
|
105
|
+
welcomeSubtext
|
|
106
|
+
}) => {
|
|
107
|
+
const reducedMotion = usePrefersReducedMotion();
|
|
108
|
+
const greeting = welcomeEntrance(0, reducedMotion);
|
|
109
|
+
const subtext = welcomeEntrance(WELCOME_GREETING_SUBTEXT_DELAY_MS, reducedMotion);
|
|
110
|
+
return /* @__PURE__ */ jsx("div", { className: "aui-thread-welcome-root mx-auto my-auto flex w-full max-w-(--thread-max-width) grow flex-col", children: /* @__PURE__ */ jsx("div", { className: "aui-thread-welcome-center flex w-full grow flex-col items-center justify-center", children: /* @__PURE__ */ jsxs("div", { className: "aui-thread-welcome-message flex size-full flex-col justify-center px-4", children: [
|
|
111
|
+
/* @__PURE__ */ jsx(
|
|
112
|
+
"h2",
|
|
113
|
+
{
|
|
114
|
+
className: cn(
|
|
115
|
+
"aui-thread-welcome-message-inner text-2xl font-semibold text-foreground",
|
|
116
|
+
greeting.className
|
|
117
|
+
),
|
|
118
|
+
style: greeting.style,
|
|
119
|
+
children: welcomeMessage
|
|
120
|
+
}
|
|
121
|
+
),
|
|
122
|
+
welcomeSubtext && /* @__PURE__ */ jsx(
|
|
123
|
+
"p",
|
|
124
|
+
{
|
|
125
|
+
className: cn(
|
|
126
|
+
"aui-thread-welcome-message-inner text-lg text-muted-foreground",
|
|
127
|
+
subtext.className
|
|
128
|
+
),
|
|
129
|
+
style: subtext.style,
|
|
130
|
+
children: welcomeSubtext
|
|
131
|
+
}
|
|
132
|
+
)
|
|
133
|
+
] }) }) });
|
|
134
|
+
};
|
|
135
|
+
export {
|
|
136
|
+
AthenaChatWelcome,
|
|
137
|
+
AthenaChatWelcomeSuggestions,
|
|
138
|
+
DEFAULT_WELCOME_SUGGESTIONS,
|
|
139
|
+
WELCOME_COMPOSER_ENTER_DELAY_MS,
|
|
140
|
+
WELCOME_ENTER_CLASS,
|
|
141
|
+
WELCOME_GREETING_SUBTEXT_DELAY_MS,
|
|
142
|
+
WELCOME_SUGGESTION_STAGGER_BASE_MS,
|
|
143
|
+
WELCOME_SUGGESTION_STAGGER_STEP_MS,
|
|
144
|
+
welcomeComposerDelayMs,
|
|
145
|
+
welcomeEntrance,
|
|
146
|
+
welcomeSuggestionDelayMs
|
|
147
|
+
};
|
|
148
|
+
//# sourceMappingURL=athena-chat-welcome.js.map
|