@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
package/dist/chat/AthenaChat.js
CHANGED
|
@@ -1,10 +1,29 @@
|
|
|
1
1
|
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
2
|
+
import "../packages/agent-runtime/src/generated/runconfig-contract.js";
|
|
3
|
+
import { useMemo, useContext, useState, useRef, useEffect, createContext, useCallback } from "react";
|
|
4
|
+
import "@assistant-ui/tap";
|
|
5
|
+
import "statewire";
|
|
6
|
+
import "../packages/agent-runtime/src/statewire-suspended.js";
|
|
7
|
+
import "../packages/agent-runtime/src/conversation-list.js";
|
|
8
|
+
import "@tanstack/react-query";
|
|
9
|
+
import "../packages/agent-runtime/src/statewire-state.js";
|
|
10
|
+
import "../packages/agent-runtime/src/messages.js";
|
|
11
|
+
import "@assistant-ui/store";
|
|
12
|
+
import "../packages/agent-runtime/src/quota-safe-local-storage-session.js";
|
|
13
|
+
import "../packages/agent-runtime/src/statewire-attach-observer.js";
|
|
14
|
+
import "../packages/agent-runtime/src/thread-status.js";
|
|
15
|
+
import "@assistant-ui/react-statewire";
|
|
16
|
+
import { isGithubWakeMessage } from "../packages/agent-runtime/src/github-wake-event.js";
|
|
17
|
+
import "@assistant-ui/core";
|
|
18
|
+
import "../packages/agent-runtime/src/thread-handoff.js";
|
|
2
19
|
import { TiptapText } from "./tiptap-text.js";
|
|
3
20
|
import { AthenaChatErrorBoundary } from "./AthenaChatErrorBoundary.js";
|
|
4
21
|
import { StatewireApprovalCard } from "./StatewireApprovalCard.js";
|
|
5
22
|
import { StatewireQueuedMessages } from "./StatewireQueuedMessages.js";
|
|
6
23
|
import { StatewireConnectionBanner, StatewireErrorBanner } from "./statewire-banners.js";
|
|
7
|
-
import {
|
|
24
|
+
import { WaitingOnYouBanner } from "./WaitingOnYouBanner.js";
|
|
25
|
+
import { WakeMarkerMessage } from "../chat-ui/messages/wake-marker.js";
|
|
26
|
+
import { ToolFallback, ToolFallbackAppearanceProvider } from "../tools/tool-fallback.js";
|
|
8
27
|
import { AppendDocumentToolUI } from "../tools/append-document-tool-ui.js";
|
|
9
28
|
import { ReadAssetToolUI } from "../tools/read-asset-tool-ui.js";
|
|
10
29
|
import { TOOL_UI_REGISTRY } from "../tools/tool-uis.js";
|
|
@@ -16,14 +35,20 @@ import { Collapsible, CollapsibleTrigger, CollapsibleContent } from "../ui/colla
|
|
|
16
35
|
import { ChatComposerDock } from "../chat-ui/thread/chat-composer-dock.js";
|
|
17
36
|
import { ChatThreadShell } from "../chat-ui/thread/chat-thread-shell.js";
|
|
18
37
|
import { StatewireHistoryEdge } from "../chat-ui/thread/statewire-history-edge.js";
|
|
38
|
+
import { ThreadLoadingOverlay } from "../chat-ui/thread/thread-loading-overlay.js";
|
|
19
39
|
import { ComposerSendOrStop } from "../chat-ui/thread/composer-send-or-stop.js";
|
|
20
40
|
import { TiptapComposer } from "../chat-ui/composer/tiptap-composer.js";
|
|
21
41
|
import { MentionAuthCtx } from "../chat-ui/mentions/suggestions/data/api-client.js";
|
|
22
|
-
import { ACTION_BAR_REVEAL_CLASS } from "../chat-ui/messages/message-components.js";
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
42
|
+
import { ACTION_BAR_REVEAL_CLASS, BranchPicker } from "../chat-ui/messages/message-components.js";
|
|
43
|
+
import { useMessageActionsReadOnly } from "../chat-ui/messages/message-actions-config.js";
|
|
44
|
+
import { useAthenaRunLive } from "./use-athena-run-live.js";
|
|
45
|
+
import { DEFAULT_WELCOME_SUGGESTIONS, AthenaChatWelcomeSuggestions, AthenaChatWelcome, welcomeEntrance, welcomeComposerDelayMs } from "./athena-chat-welcome.js";
|
|
46
|
+
import { ATHENA_COMPOSER_COMPONENTS, AthenaComposerMentionButton } from "./athena-composer-controls.js";
|
|
47
|
+
import { useComposerKeyboardHint, ComposerKeyboardHint } from "./composer-keyboard-hint.js";
|
|
48
|
+
import { usePrefersReducedMotion } from "../lib/use-prefers-reduced-motion.js";
|
|
49
|
+
import { useAuiState, ActionBarPrimitive, ActionBarMorePrimitive, MessagePrimitive, ThreadPrimitive, AuiIf, ErrorPrimitive, useAui } from "@assistant-ui/react";
|
|
50
|
+
import { MoreHorizontalIcon, DownloadIcon, ExternalLinkIcon, BrainIcon, ChevronRightIcon, CheckIcon, CopyIcon, RefreshCwIcon, AlertCircleIcon, ArrowUpIcon, PencilIcon } from "lucide-react";
|
|
51
|
+
import { useAthenaThreadId, AthenaStatewireThreadIdContext, useAthenaStatewireThreadId } from "../threads/thread-id-context.js";
|
|
27
52
|
import { FileUploadButton } from "../composer/FileUploadButton.js";
|
|
28
53
|
import { ComposerQuotePreview } from "../composer/ComposerQuotePreview.js";
|
|
29
54
|
import { ComposerAttachmentPreview } from "../composer/ComposerAttachmentPreview.js";
|
|
@@ -35,36 +60,15 @@ import { useAttachFiles } from "../composer/useAttachFiles.js";
|
|
|
35
60
|
import { useAthenaConfig } from "../provider/AthenaContext.js";
|
|
36
61
|
import { createAthenaSpacesUrl } from "../lib/athena-urls.js";
|
|
37
62
|
import { isRecord } from "../lib/utils.js";
|
|
38
|
-
import { useSendMessage } from "../composer/useSendMessage.js";
|
|
39
63
|
import { getToolkitDisplayInfo } from "../toolkits/index.js";
|
|
40
|
-
import { runActivityKey, runActivityLabel, RUN_ACTIVITY_STALL_SECONDS } from "./run-activity.js";
|
|
64
|
+
import { runActivityKey, runActivityVerb, RUN_ACTIVITY_COUNTER_SECONDS, runActivityLabel, RUN_ACTIVITY_STALL_SECONDS } from "./run-activity.js";
|
|
65
|
+
import { readMessageCreatedAt, parseMessageTime, isSameCalendarDay, formatDayLabel, formatMessageTime, formatMessageDateTime } from "./message-time.js";
|
|
66
|
+
import { ThreadScrollToBottom } from "./thread-scroll-to-bottom.js";
|
|
41
67
|
import { cn } from "cnfast";
|
|
42
68
|
function QuotePostMessageBridge() {
|
|
43
69
|
useQuoteFromPostMessage();
|
|
44
70
|
return null;
|
|
45
71
|
}
|
|
46
|
-
const DEFAULT_SUGGESTIONS = [
|
|
47
|
-
{
|
|
48
|
-
icon: SearchIcon,
|
|
49
|
-
title: "Research a topic and draft a report",
|
|
50
|
-
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."
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
icon: SearchIcon,
|
|
54
|
-
title: "Compare recent AI model launches",
|
|
55
|
-
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."
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
icon: PresentationIcon,
|
|
59
|
-
title: "Build a presentation from scratch",
|
|
60
|
-
prompt: "Create a 5-slide investor update presentation covering market opportunity, product traction, key metrics, competitive positioning, and next steps."
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
icon: FileTextIcon,
|
|
64
|
-
title: "Set up a structured spreadsheet",
|
|
65
|
-
prompt: "Create a project tracking spreadsheet with columns for task name, owner, priority, status, start date, due date, and completion percentage."
|
|
66
|
-
}
|
|
67
|
-
];
|
|
68
72
|
const AthenaChatDefaultComponentsContext = createContext(null);
|
|
69
73
|
const AthenaReasoningTextComponentContext = createContext(null);
|
|
70
74
|
const useAthenaChatDefaultComponents = () => {
|
|
@@ -75,11 +79,20 @@ const useAthenaChatDefaultComponents = () => {
|
|
|
75
79
|
return value;
|
|
76
80
|
};
|
|
77
81
|
const AthenaDefaultAssistantMessage = () => {
|
|
78
|
-
const {
|
|
82
|
+
const {
|
|
83
|
+
toolUIs,
|
|
84
|
+
TextComponent,
|
|
85
|
+
ReasoningComponent,
|
|
86
|
+
EmptyComponent,
|
|
87
|
+
ActionBarComponent,
|
|
88
|
+
AvatarComponent,
|
|
89
|
+
groupToolCalls
|
|
90
|
+
} = useAthenaChatDefaultComponents();
|
|
79
91
|
return /* @__PURE__ */ jsx(
|
|
80
92
|
AthenaAssistantMessage,
|
|
81
93
|
{
|
|
82
94
|
toolUIs,
|
|
95
|
+
AvatarComponent,
|
|
83
96
|
TextComponent,
|
|
84
97
|
ReasoningComponent,
|
|
85
98
|
EmptyComponent,
|
|
@@ -118,49 +131,22 @@ const withNestedPtcMessages = (ToolUI) => {
|
|
|
118
131
|
};
|
|
119
132
|
return ToolUIWithNestedPtcMessages;
|
|
120
133
|
};
|
|
121
|
-
const SuggestionCard = ({
|
|
122
|
-
suggestion,
|
|
123
|
-
index
|
|
124
|
-
}) => {
|
|
125
|
-
const Icon = suggestion.icon;
|
|
126
|
-
const sendMessage = useSendMessage();
|
|
127
|
-
const handleClick = useCallback(() => {
|
|
128
|
-
void sendMessage(suggestion.prompt);
|
|
129
|
-
}, [sendMessage, suggestion.prompt]);
|
|
130
|
-
return /* @__PURE__ */ jsxs(
|
|
131
|
-
"button",
|
|
132
|
-
{
|
|
133
|
-
type: "button",
|
|
134
|
-
onClick: handleClick,
|
|
135
|
-
className: `fade-in slide-in-from-bottom-2 animate-in fill-mode-both group flex items-start gap-3 rounded-xl border border-border/60 bg-background p-3.5 text-left shadow-sm transition-all duration-150 hover:border-border hover:bg-muted/40 hover:shadow-md`,
|
|
136
|
-
style: { animationDelay: `${100 + index * 75}ms` },
|
|
137
|
-
children: [
|
|
138
|
-
/* @__PURE__ */ jsx("div", { 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" }) }),
|
|
139
|
-
/* @__PURE__ */ jsx("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ jsx("span", { className: "text-[13px] font-medium leading-snug text-foreground", children: suggestion.title }) }),
|
|
140
|
-
/* @__PURE__ */ jsx(ArrowRightIcon, { className: "mt-0.5 size-3.5 shrink-0 text-muted-foreground/0 transition-all group-hover:text-muted-foreground" })
|
|
141
|
-
]
|
|
142
|
-
}
|
|
143
|
-
);
|
|
144
|
-
};
|
|
145
|
-
const AthenaChatWelcome = ({ welcomeMessage, welcomeSubtext, welcomeSuggestions }) => /* @__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: [
|
|
146
|
-
/* @__PURE__ */ jsx("h1", { className: "aui-thread-welcome-message-inner fade-in slide-in-from-bottom-1 animate-in fill-mode-both font-semibold text-2xl duration-200", children: welcomeMessage }),
|
|
147
|
-
welcomeSubtext && /* @__PURE__ */ jsx("p", { className: "aui-thread-welcome-message-inner fade-in slide-in-from-bottom-1 animate-in fill-mode-both text-muted-foreground text-lg delay-75 duration-200", children: welcomeSubtext }),
|
|
148
|
-
welcomeSuggestions.length > 0 && /* @__PURE__ */ jsx("div", { className: "mt-6 grid grid-cols-1 gap-2.5 sm:grid-cols-2", children: welcomeSuggestions.map((s, i) => /* @__PURE__ */ jsx(SuggestionCard, { suggestion: s, index: i }, s.title)) })
|
|
149
|
-
] }) }) });
|
|
150
134
|
const AthenaChat = ({
|
|
151
135
|
className,
|
|
152
136
|
welcomeMessage = "Hello there!",
|
|
153
137
|
welcomeSubtext = "What can I help you with?",
|
|
154
|
-
maxWidth = "
|
|
138
|
+
maxWidth = "46rem",
|
|
155
139
|
turnAnchor = "bottom",
|
|
140
|
+
readOnly = false,
|
|
156
141
|
toolUIs,
|
|
157
142
|
mentionTools,
|
|
158
|
-
welcomeSuggestions =
|
|
143
|
+
welcomeSuggestions = DEFAULT_WELCOME_SUGGESTIONS,
|
|
159
144
|
components,
|
|
160
|
-
groupToolCalls =
|
|
145
|
+
groupToolCalls = true
|
|
161
146
|
}) => {
|
|
162
147
|
var _a, _b, _c;
|
|
163
148
|
const athenaConfig = useAthenaConfig();
|
|
149
|
+
const statewireThreadId = useContext(AthenaStatewireThreadIdContext);
|
|
164
150
|
const mentionAuth = useMemo(
|
|
165
151
|
() => ({
|
|
166
152
|
backendUrl: athenaConfig.backendUrl,
|
|
@@ -201,6 +187,7 @@ const AthenaChat = ({
|
|
|
201
187
|
const reasoningComponent = (_b = components == null ? void 0 : components.messageParts) == null ? void 0 : _b.Reasoning;
|
|
202
188
|
const emptyComponent = ((_c = components == null ? void 0 : components.messageParts) == null ? void 0 : _c.Empty) ?? AthenaAssistantMessageEmpty;
|
|
203
189
|
const actionBarComponent = (components == null ? void 0 : components.AssistantActionBar) ?? AthenaAssistantActionBar;
|
|
190
|
+
const avatarComponent = components == null ? void 0 : components.AssistantAvatar;
|
|
204
191
|
const defaultComponentsContextValue = useMemo(
|
|
205
192
|
() => ({
|
|
206
193
|
toolUIs: mergedToolUIs,
|
|
@@ -208,9 +195,18 @@ const AthenaChat = ({
|
|
|
208
195
|
ReasoningComponent: reasoningComponent,
|
|
209
196
|
EmptyComponent: emptyComponent,
|
|
210
197
|
ActionBarComponent: actionBarComponent,
|
|
198
|
+
AvatarComponent: avatarComponent,
|
|
211
199
|
groupToolCalls
|
|
212
200
|
}),
|
|
213
|
-
[
|
|
201
|
+
[
|
|
202
|
+
actionBarComponent,
|
|
203
|
+
avatarComponent,
|
|
204
|
+
emptyComponent,
|
|
205
|
+
groupToolCalls,
|
|
206
|
+
mergedToolUIs,
|
|
207
|
+
reasoningComponent,
|
|
208
|
+
textComponent
|
|
209
|
+
]
|
|
214
210
|
);
|
|
215
211
|
const AssistantMessageComponent = (components == null ? void 0 : components.AssistantMessage) ?? AthenaDefaultAssistantMessage;
|
|
216
212
|
const UserMessageComponent = (components == null ? void 0 : components.UserMessage) ?? AthenaDefaultUserMessage;
|
|
@@ -221,7 +217,7 @@ const AthenaChat = ({
|
|
|
221
217
|
}),
|
|
222
218
|
[AssistantMessageComponent, UserMessageComponent]
|
|
223
219
|
);
|
|
224
|
-
return /* @__PURE__ */ jsx(AthenaChatDefaultComponentsContext.Provider, { value: defaultComponentsContextValue, children: /* @__PURE__ */ jsx(AthenaChatErrorBoundary, { children: /* @__PURE__ */ jsx(
|
|
220
|
+
return /* @__PURE__ */ jsx(AthenaChatDefaultComponentsContext.Provider, { value: defaultComponentsContextValue, children: /* @__PURE__ */ jsx(AthenaChatErrorBoundary, { children: /* @__PURE__ */ jsx(ToolFallbackAppearanceProvider, { appearance: "thread", children: /* @__PURE__ */ jsx(
|
|
225
221
|
ChatThreadShell,
|
|
226
222
|
{
|
|
227
223
|
overlay: /* @__PURE__ */ jsx(ThreadLoadingOverlay, {}),
|
|
@@ -231,46 +227,36 @@ const AthenaChat = ({
|
|
|
231
227
|
),
|
|
232
228
|
maxWidth,
|
|
233
229
|
turnAnchor,
|
|
230
|
+
readOnly,
|
|
231
|
+
banners: /* @__PURE__ */ jsx(WaitingOnYouBanner, { className: "px-4 pt-3" }),
|
|
234
232
|
viewportClassName: "aui-thread-viewport relative flex flex-1 flex-col overflow-x-auto overflow-y-scroll scroll-smooth px-4 pt-4",
|
|
235
233
|
contentClassName: "flex w-full flex-1 flex-col",
|
|
236
234
|
viewportOverlay: /* @__PURE__ */ jsx(ThreadScrollToTop, {}),
|
|
237
|
-
welcome: /* @__PURE__ */ jsx(
|
|
238
|
-
AthenaChatWelcome,
|
|
239
|
-
{
|
|
240
|
-
welcomeMessage,
|
|
241
|
-
welcomeSubtext,
|
|
242
|
-
welcomeSuggestions
|
|
243
|
-
}
|
|
244
|
-
),
|
|
235
|
+
welcome: /* @__PURE__ */ jsx(AthenaChatWelcome, { welcomeMessage, welcomeSubtext }),
|
|
245
236
|
beforeMessages: /* @__PURE__ */ jsx(StatewireHistoryEdge, { className: "aui-thread-history-edge" }),
|
|
246
237
|
components: messageComponents,
|
|
247
238
|
runningIndicator: null,
|
|
248
|
-
scrollToBottom:
|
|
249
|
-
viewportFooterClassName: "aui-thread-viewport-footer sticky bottom-0 mx-auto mt-auto flex w-full max-w-(--thread-max-width) flex-col gap-4 overflow-visible rounded-t-3xl bg-background pb-4 md:pb-6",
|
|
239
|
+
scrollToBottom: null,
|
|
240
|
+
viewportFooterClassName: "aui-thread-viewport-footer sticky bottom-0 mx-auto mt-auto flex w-full max-w-(--thread-max-width) flex-col gap-4 overflow-visible rounded-t-3xl bg-background pt-4 pb-4 md:pb-6",
|
|
250
241
|
viewportFooter: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
242
|
+
welcomeSuggestions.length > 0 && /* @__PURE__ */ jsx(ThreadPrimitive.Empty, { children: /* @__PURE__ */ jsx(AthenaChatWelcomeSuggestions, { suggestions: welcomeSuggestions }) }),
|
|
251
243
|
/* @__PURE__ */ jsx(StatewireConnectionBanner, {}),
|
|
252
244
|
/* @__PURE__ */ jsx(StatewireErrorBanner, {}),
|
|
253
245
|
/* @__PURE__ */ jsx(StatewireApprovalCard, {}),
|
|
254
246
|
/* @__PURE__ */ jsx(StatewireQueuedMessages, {}),
|
|
255
247
|
/* @__PURE__ */ jsx(AttachmentProvider, { children: /* @__PURE__ */ jsxs(QuoteProvider, { children: [
|
|
256
248
|
/* @__PURE__ */ jsx(QuotePostMessageBridge, {}),
|
|
257
|
-
/* @__PURE__ */ jsx(MentionAuthCtx.Provider, { value: mentionAuth, children: /* @__PURE__ */ jsx(
|
|
249
|
+
/* @__PURE__ */ jsx(MentionAuthCtx.Provider, { value: mentionAuth, children: /* @__PURE__ */ jsx(
|
|
250
|
+
AthenaChatComposer,
|
|
251
|
+
{
|
|
252
|
+
tools,
|
|
253
|
+
welcomeSuggestionCount: welcomeSuggestions.length
|
|
254
|
+
}
|
|
255
|
+
) })
|
|
258
256
|
] }) })
|
|
259
257
|
] })
|
|
260
258
|
}
|
|
261
|
-
) }) });
|
|
262
|
-
};
|
|
263
|
-
const ThreadLoadingOverlay = () => {
|
|
264
|
-
const remoteId = useAthenaThreadId();
|
|
265
|
-
const [timedOut, setTimedOut] = useState(false);
|
|
266
|
-
useEffect(() => {
|
|
267
|
-
if (!remoteId) return;
|
|
268
|
-
setTimedOut(false);
|
|
269
|
-
const timer = setTimeout(() => setTimedOut(true), 15e3);
|
|
270
|
-
return () => clearTimeout(timer);
|
|
271
|
-
}, [remoteId]);
|
|
272
|
-
if (!remoteId || timedOut) return null;
|
|
273
|
-
return /* @__PURE__ */ jsx(AuiIf, { condition: (s) => s.thread.isEmpty, children: /* @__PURE__ */ jsx("div", { className: "absolute inset-0 z-10 flex items-center justify-center bg-background/80", children: /* @__PURE__ */ jsx("div", { className: "size-5 animate-spin rounded-full border-2 border-muted-foreground border-t-transparent" }) }) });
|
|
259
|
+
) }) }, statewireThreadId ?? void 0) });
|
|
274
260
|
};
|
|
275
261
|
const THREAD_VIEWPORT_ATTR = "data-aui-thread-viewport";
|
|
276
262
|
const useScrollToTop = () => {
|
|
@@ -316,63 +302,13 @@ const ThreadScrollToTop = () => {
|
|
|
316
302
|
}
|
|
317
303
|
) });
|
|
318
304
|
};
|
|
319
|
-
const ThreadScrollToBottom = () => /* @__PURE__ */ jsx(ThreadPrimitive.ScrollToBottom, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
320
|
-
TooltipIconButton,
|
|
321
|
-
{
|
|
322
|
-
tooltip: "Scroll to bottom",
|
|
323
|
-
variant: "outline",
|
|
324
|
-
className: "aui-thread-scroll-to-bottom absolute -top-12 z-10 self-center rounded-full p-4 disabled:invisible dark:bg-background dark:hover:bg-accent",
|
|
325
|
-
children: /* @__PURE__ */ jsx(ArrowDownIcon, {})
|
|
326
|
-
}
|
|
327
|
-
) });
|
|
328
|
-
const AthenaComposerSendButton = ({
|
|
329
|
-
action,
|
|
330
|
-
onSend,
|
|
331
|
-
disabled,
|
|
332
|
-
title
|
|
333
|
-
}) => {
|
|
334
|
-
const label = action === "queue" ? "Queue message" : "Send message";
|
|
335
|
-
return /* @__PURE__ */ jsx(
|
|
336
|
-
TooltipIconButton,
|
|
337
|
-
{
|
|
338
|
-
tooltip: title ?? label,
|
|
339
|
-
side: "bottom",
|
|
340
|
-
type: "button",
|
|
341
|
-
variant: "default",
|
|
342
|
-
size: "icon",
|
|
343
|
-
className: "aui-composer-send size-8 rounded-full",
|
|
344
|
-
"aria-label": label,
|
|
345
|
-
onClick: onSend,
|
|
346
|
-
disabled,
|
|
347
|
-
children: action === "queue" ? /* @__PURE__ */ jsx(ListPlusIcon, { className: "aui-composer-send-icon size-4" }) : /* @__PURE__ */ jsx(ArrowUpIcon, { className: "aui-composer-send-icon size-4" })
|
|
348
|
-
}
|
|
349
|
-
);
|
|
350
|
-
};
|
|
351
|
-
const AthenaComposerStopButton = ({ onStop, disabled, title }) => /* @__PURE__ */ jsx(
|
|
352
|
-
Button,
|
|
353
|
-
{
|
|
354
|
-
type: "button",
|
|
355
|
-
variant: "default",
|
|
356
|
-
size: "icon",
|
|
357
|
-
className: "aui-composer-cancel size-8 rounded-full",
|
|
358
|
-
"aria-label": "Stop generating",
|
|
359
|
-
title,
|
|
360
|
-
onClick: onStop,
|
|
361
|
-
disabled,
|
|
362
|
-
children: /* @__PURE__ */ jsx(SquareIcon, { className: "aui-composer-cancel-icon size-3 fill-current" })
|
|
363
|
-
}
|
|
364
|
-
);
|
|
365
|
-
const ATHENA_COMPOSER_COMPONENTS = {
|
|
366
|
-
SendButton: AthenaComposerSendButton,
|
|
367
|
-
StopButton: AthenaComposerStopButton
|
|
368
|
-
};
|
|
369
305
|
const ATHENA_CHAT_MENTION_CATEGORIES = [
|
|
370
306
|
"favorites",
|
|
371
307
|
"assets",
|
|
372
308
|
"projects",
|
|
373
309
|
"folders"
|
|
374
310
|
];
|
|
375
|
-
const AthenaChatComposer = ({ tools }) => {
|
|
311
|
+
const AthenaChatComposer = ({ tools, welcomeSuggestionCount }) => {
|
|
376
312
|
const aui = useAui();
|
|
377
313
|
const threadId = useAthenaStatewireThreadId();
|
|
378
314
|
const { appUrl } = useAthenaConfig();
|
|
@@ -381,6 +317,15 @@ const AthenaChatComposer = ({ tools }) => {
|
|
|
381
317
|
const { attachFiles } = useAttachFiles();
|
|
382
318
|
const composerRef = useRef(null);
|
|
383
319
|
const [hasText, setHasText] = useState(false);
|
|
320
|
+
const [dragActive, setDragActive] = useState(false);
|
|
321
|
+
const keyboardHint = useComposerKeyboardHint();
|
|
322
|
+
const reducedMotion = usePrefersReducedMotion();
|
|
323
|
+
const isEmpty = useAuiState((state) => state.thread.isEmpty);
|
|
324
|
+
const [mountedEmpty] = useState(() => isEmpty);
|
|
325
|
+
const entrance = welcomeEntrance(
|
|
326
|
+
welcomeComposerDelayMs(welcomeSuggestionCount),
|
|
327
|
+
reducedMotion || !mountedEmpty
|
|
328
|
+
);
|
|
384
329
|
const rootCategories = useMemo(() => {
|
|
385
330
|
const categories = [...ATHENA_CHAT_MENTION_CATEGORIES];
|
|
386
331
|
if (tools.some((tool) => tool.type === "toolkit")) categories.push("toolkits");
|
|
@@ -436,41 +381,62 @@ const AthenaChatComposer = ({ tools }) => {
|
|
|
436
381
|
}),
|
|
437
382
|
[attachFiles]
|
|
438
383
|
);
|
|
439
|
-
return /* @__PURE__ */ jsx(ComposerDropZone, { children: /* @__PURE__ */ jsx(
|
|
440
|
-
|
|
384
|
+
return /* @__PURE__ */ jsx(ComposerDropZone, { onDragActiveChange: setDragActive, children: /* @__PURE__ */ jsx(
|
|
385
|
+
"div",
|
|
441
386
|
{
|
|
442
|
-
className: "",
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
/* @__PURE__ */ jsx(ComposerQuotePreview, {}),
|
|
448
|
-
/* @__PURE__ */ jsx(ComposerAttachmentPreview, {})
|
|
449
|
-
] }),
|
|
450
|
-
editor: /* @__PURE__ */ jsx(
|
|
451
|
-
TiptapComposer,
|
|
452
|
-
{
|
|
453
|
-
ref: composerRef,
|
|
454
|
-
threadId,
|
|
455
|
-
placeholder: "Send a message...",
|
|
456
|
-
tools,
|
|
457
|
-
rootCategories,
|
|
458
|
-
onDraftStateChange: setHasText,
|
|
459
|
-
waitForHostUploads,
|
|
460
|
-
interceptSubmit,
|
|
461
|
-
fileIntake
|
|
462
|
-
}
|
|
463
|
-
),
|
|
464
|
-
toolbarStart: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-1", children: /* @__PURE__ */ jsx(FileUploadButton, {}) }),
|
|
465
|
-
toolbarEnd: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-1", children: /* @__PURE__ */ jsx(
|
|
466
|
-
ComposerSendOrStop,
|
|
387
|
+
className: cn("aui-composer-entrance", entrance.className),
|
|
388
|
+
style: entrance.style,
|
|
389
|
+
onFocus: keyboardHint.onFocus,
|
|
390
|
+
children: /* @__PURE__ */ jsx(
|
|
391
|
+
ChatComposerDock,
|
|
467
392
|
{
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
393
|
+
appearance: "paper",
|
|
394
|
+
dragActive,
|
|
395
|
+
aboveSurface: /* @__PURE__ */ jsx(ThreadScrollToBottom, {}),
|
|
396
|
+
beforeEditor: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
397
|
+
/* @__PURE__ */ jsx(ComposerQuotePreview, {}),
|
|
398
|
+
/* @__PURE__ */ jsx(ComposerAttachmentPreview, {})
|
|
399
|
+
] }),
|
|
400
|
+
editor: /* @__PURE__ */ jsx(
|
|
401
|
+
TiptapComposer,
|
|
402
|
+
{
|
|
403
|
+
ref: composerRef,
|
|
404
|
+
threadId,
|
|
405
|
+
appearance: "paper",
|
|
406
|
+
placeholder: "Type @ to tag an asset",
|
|
407
|
+
tools,
|
|
408
|
+
rootCategories,
|
|
409
|
+
onDraftStateChange: setHasText,
|
|
410
|
+
waitForHostUploads,
|
|
411
|
+
interceptSubmit,
|
|
412
|
+
fileIntake,
|
|
413
|
+
onSubmitted: keyboardHint.onSubmitted
|
|
414
|
+
}
|
|
415
|
+
),
|
|
416
|
+
toolbarStart: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
|
|
417
|
+
/* @__PURE__ */ jsx(FileUploadButton, { className: "aui-composer-attach size-8 rounded-full p-0 disabled:opacity-30" }),
|
|
418
|
+
/* @__PURE__ */ jsx(
|
|
419
|
+
AthenaComposerMentionButton,
|
|
420
|
+
{
|
|
421
|
+
onClick: () => {
|
|
422
|
+
var _a, _b;
|
|
423
|
+
return (_b = (_a = composerRef.current) == null ? void 0 : _a.openMentionMenu) == null ? void 0 : _b.call(_a);
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
)
|
|
427
|
+
] }),
|
|
428
|
+
toolbarEnd: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-1", children: /* @__PURE__ */ jsx(
|
|
429
|
+
ComposerSendOrStop,
|
|
430
|
+
{
|
|
431
|
+
composerRef,
|
|
432
|
+
hasDraft: hasText || hasExtras,
|
|
433
|
+
sendBlockedReason: isUploading ? "Upload in progress..." : null,
|
|
434
|
+
components: ATHENA_COMPOSER_COMPONENTS
|
|
435
|
+
}
|
|
436
|
+
) }),
|
|
437
|
+
belowSurface: /* @__PURE__ */ jsx(ComposerKeyboardHint, { visible: keyboardHint.visible })
|
|
472
438
|
}
|
|
473
|
-
)
|
|
439
|
+
)
|
|
474
440
|
}
|
|
475
441
|
) });
|
|
476
442
|
};
|
|
@@ -487,9 +453,54 @@ const MessageError = () => /* @__PURE__ */ jsx(MessagePrimitive.Error, { childre
|
|
|
487
453
|
}
|
|
488
454
|
) })
|
|
489
455
|
] }) });
|
|
456
|
+
const RunStatusLine = ({ verb, resetKey, counterOnly = false, className }) => {
|
|
457
|
+
const [seconds, setSeconds] = useState(0);
|
|
458
|
+
useEffect(() => {
|
|
459
|
+
setSeconds(0);
|
|
460
|
+
const startedAt = Date.now();
|
|
461
|
+
const timer = setInterval(() => {
|
|
462
|
+
setSeconds(Math.floor((Date.now() - startedAt) / 1e3));
|
|
463
|
+
}, 1e3);
|
|
464
|
+
return () => clearInterval(timer);
|
|
465
|
+
}, [resetKey]);
|
|
466
|
+
const stalled = seconds >= RUN_ACTIVITY_STALL_SECONDS;
|
|
467
|
+
if (counterOnly && seconds < RUN_ACTIVITY_COUNTER_SECONDS) return null;
|
|
468
|
+
return /* @__PURE__ */ jsxs(
|
|
469
|
+
"div",
|
|
470
|
+
{
|
|
471
|
+
"data-slot": "run-status-line",
|
|
472
|
+
"data-stalled": stalled ? "true" : void 0,
|
|
473
|
+
className: cn(
|
|
474
|
+
"aui-run-activity mt-2 flex items-center gap-2 px-1 text-[12px] text-muted-foreground",
|
|
475
|
+
className
|
|
476
|
+
),
|
|
477
|
+
children: [
|
|
478
|
+
/* @__PURE__ */ jsx(
|
|
479
|
+
"span",
|
|
480
|
+
{
|
|
481
|
+
"aria-hidden": "true",
|
|
482
|
+
className: cn(
|
|
483
|
+
"size-1.5 shrink-0 rounded-full bg-current opacity-60",
|
|
484
|
+
!stalled && "animate-pulse motion-reduce:animate-none"
|
|
485
|
+
)
|
|
486
|
+
}
|
|
487
|
+
),
|
|
488
|
+
/* @__PURE__ */ jsx(
|
|
489
|
+
"span",
|
|
490
|
+
{
|
|
491
|
+
"aria-hidden": "true",
|
|
492
|
+
className: cn("tabular-nums", stalled && "text-amber-600 dark:text-amber-400"),
|
|
493
|
+
children: runActivityLabel(seconds, verb)
|
|
494
|
+
}
|
|
495
|
+
),
|
|
496
|
+
/* @__PURE__ */ jsx("span", { "aria-live": "polite", className: "sr-only", children: stalled ? "Assistant is still working; nothing new for over thirty seconds." : `${verb}…` })
|
|
497
|
+
]
|
|
498
|
+
}
|
|
499
|
+
);
|
|
500
|
+
};
|
|
490
501
|
const AthenaAssistantMessageEmpty = ({ status }) => {
|
|
491
502
|
if ((status == null ? void 0 : status.type) !== "running") return null;
|
|
492
|
-
return /* @__PURE__ */ jsx(
|
|
503
|
+
return /* @__PURE__ */ jsx(RunStatusLine, { verb: "Thinking", resetKey: "empty", className: "mt-0" });
|
|
493
504
|
};
|
|
494
505
|
const AthenaMessageEmptyIndicator = ({
|
|
495
506
|
EmptyComponent
|
|
@@ -508,27 +519,77 @@ const AthenaMessageActivityIndicator = () => {
|
|
|
508
519
|
return ((_a = s.message.status) == null ? void 0 : _a.type) === "running";
|
|
509
520
|
});
|
|
510
521
|
const activityKey = useAuiState((s) => runActivityKey(s.message.parts));
|
|
511
|
-
const
|
|
512
|
-
useEffect(() => {
|
|
513
|
-
setSeconds(0);
|
|
514
|
-
if (!isRunning || activityKey === null) return;
|
|
515
|
-
const startedAt = Date.now();
|
|
516
|
-
const timer = setInterval(() => {
|
|
517
|
-
setSeconds(Math.floor((Date.now() - startedAt) / 1e3));
|
|
518
|
-
}, 1e3);
|
|
519
|
-
return () => clearInterval(timer);
|
|
520
|
-
}, [isRunning, activityKey]);
|
|
522
|
+
const verb = useAuiState((s) => runActivityVerb(s.message.parts));
|
|
521
523
|
if (!isRunning || activityKey === null) return null;
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
524
|
+
return /* @__PURE__ */ jsx(RunStatusLine, { verb: verb ?? "Working", resetKey: activityKey });
|
|
525
|
+
};
|
|
526
|
+
const AthenaGroupedRunMeta = () => {
|
|
527
|
+
const activityKey = useAuiState((s) => runActivityKey(s.message.parts));
|
|
528
|
+
return /* @__PURE__ */ jsx(
|
|
529
|
+
RunStatusLine,
|
|
530
|
+
{
|
|
531
|
+
verb: "Working",
|
|
532
|
+
resetKey: activityKey ?? "thinking",
|
|
533
|
+
counterOnly: true,
|
|
534
|
+
className: "mt-1 px-0"
|
|
535
|
+
}
|
|
536
|
+
);
|
|
537
|
+
};
|
|
538
|
+
const renderGroupedRunningMeta = () => /* @__PURE__ */ jsx(AthenaGroupedRunMeta, {});
|
|
539
|
+
const MessageDaySeparator = () => {
|
|
540
|
+
const stamp = useAuiState((s) => {
|
|
541
|
+
var _a;
|
|
542
|
+
return readMessageCreatedAt((_a = s.message.metadata) == null ? void 0 : _a.custom);
|
|
543
|
+
});
|
|
544
|
+
const previousStamp = useAuiState((s) => {
|
|
545
|
+
var _a;
|
|
546
|
+
const index = s.message.index;
|
|
547
|
+
const previous = index > 0 ? s.thread.messages[index - 1] : void 0;
|
|
548
|
+
return readMessageCreatedAt((_a = previous == null ? void 0 : previous.metadata) == null ? void 0 : _a.custom);
|
|
549
|
+
});
|
|
550
|
+
const label = useMemo(() => {
|
|
551
|
+
const date = stamp ? parseMessageTime(stamp) : null;
|
|
552
|
+
const previous = previousStamp ? parseMessageTime(previousStamp) : null;
|
|
553
|
+
if (!date || !previous || isSameCalendarDay(date, previous)) return null;
|
|
554
|
+
return formatDayLabel(date);
|
|
555
|
+
}, [stamp, previousStamp]);
|
|
556
|
+
if (!label) return null;
|
|
557
|
+
return /* @__PURE__ */ jsxs(
|
|
558
|
+
"div",
|
|
559
|
+
{
|
|
560
|
+
role: "separator",
|
|
561
|
+
"aria-label": label,
|
|
562
|
+
"data-slot": "day-separator",
|
|
563
|
+
className: "aui-day-separator mb-3 flex w-full items-center gap-3 text-[11px] font-medium text-muted-foreground",
|
|
564
|
+
children: [
|
|
565
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: "h-px flex-1 bg-border" }),
|
|
566
|
+
/* @__PURE__ */ jsx("span", { children: label }),
|
|
567
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: "h-px flex-1 bg-border" })
|
|
568
|
+
]
|
|
569
|
+
}
|
|
570
|
+
);
|
|
571
|
+
};
|
|
572
|
+
const MessageTimestamp = ({ className }) => {
|
|
573
|
+
const stamp = useAuiState((s) => {
|
|
574
|
+
var _a;
|
|
575
|
+
return readMessageCreatedAt((_a = s.message.metadata) == null ? void 0 : _a.custom);
|
|
576
|
+
});
|
|
577
|
+
const date = useMemo(() => stamp ? parseMessageTime(stamp) : null, [stamp]);
|
|
578
|
+
if (!date) return null;
|
|
579
|
+
return /* @__PURE__ */ jsx(
|
|
580
|
+
"time",
|
|
581
|
+
{
|
|
582
|
+
dateTime: date.toISOString(),
|
|
583
|
+
title: formatMessageDateTime(date),
|
|
584
|
+
"data-slot": "message-timestamp",
|
|
585
|
+
className: cn(
|
|
586
|
+
"aui-message-timestamp shrink-0 text-[11px] tabular-nums text-muted-foreground",
|
|
587
|
+
ACTION_BAR_REVEAL_CLASS,
|
|
588
|
+
className
|
|
589
|
+
),
|
|
590
|
+
children: formatMessageTime(date)
|
|
591
|
+
}
|
|
592
|
+
);
|
|
532
593
|
};
|
|
533
594
|
const AthenaReasoningPart = ({
|
|
534
595
|
text,
|
|
@@ -608,11 +669,12 @@ const AthenaReasoningPart = ({
|
|
|
608
669
|
const noToolGrouping = () => null;
|
|
609
670
|
const AthenaAssistantMessage = ({
|
|
610
671
|
toolUIs,
|
|
672
|
+
AvatarComponent,
|
|
611
673
|
TextComponent = TiptapText,
|
|
612
674
|
ReasoningComponent,
|
|
613
675
|
EmptyComponent = AthenaAssistantMessageEmpty,
|
|
614
676
|
ActionBarComponent = AthenaAssistantActionBar,
|
|
615
|
-
groupToolCalls =
|
|
677
|
+
groupToolCalls = true
|
|
616
678
|
}) => {
|
|
617
679
|
const effectiveReasoningComponent = ReasoningComponent ?? AthenaReasoningPart;
|
|
618
680
|
const toolUIsWithNestedMessages = useMemo(() => {
|
|
@@ -640,48 +702,108 @@ const AthenaAssistantMessage = ({
|
|
|
640
702
|
className: "aui-assistant-message-root group/aui-assistant-message fade-in slide-in-from-bottom-1 relative mx-auto w-full max-w-(--thread-max-width) animate-in py-3 duration-150",
|
|
641
703
|
"data-role": "assistant",
|
|
642
704
|
children: [
|
|
643
|
-
/* @__PURE__ */ jsx(
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
/* @__PURE__ */ jsx(AthenaMessageEmptyIndicator, { EmptyComponent }),
|
|
657
|
-
/* @__PURE__ */ jsx(MessagePrimitive.GroupedParts, { groupBy: noToolGrouping, children: ({ part }) => {
|
|
658
|
-
var _a;
|
|
659
|
-
switch (part.type) {
|
|
660
|
-
case "tool-call": {
|
|
661
|
-
const ToolUI = toolUIsWithNestedMessages[part.toolName];
|
|
662
|
-
const toolProps = part;
|
|
663
|
-
return ToolUI ? /* @__PURE__ */ jsx(ToolUI, { ...toolProps }) : /* @__PURE__ */ jsx(ToolFallback, { ...toolProps });
|
|
664
|
-
}
|
|
665
|
-
case "reasoning": {
|
|
666
|
-
const ReasoningRenderer = effectiveReasoningComponent;
|
|
667
|
-
return /* @__PURE__ */ jsx(ReasoningRenderer, { ...part });
|
|
705
|
+
/* @__PURE__ */ jsx(MessageDaySeparator, {}),
|
|
706
|
+
/* @__PURE__ */ jsxs("div", { className: "flex gap-3", children: [
|
|
707
|
+
/* @__PURE__ */ jsx(
|
|
708
|
+
"div",
|
|
709
|
+
{
|
|
710
|
+
"data-slot": "assistant-lead",
|
|
711
|
+
className: "aui-assistant-message-lead flex shrink-0 justify-center",
|
|
712
|
+
children: AvatarComponent ? /* @__PURE__ */ jsx(AvatarComponent, {}) : /* @__PURE__ */ jsx(
|
|
713
|
+
"span",
|
|
714
|
+
{
|
|
715
|
+
"aria-hidden": "true",
|
|
716
|
+
"data-slot": "assistant-rule",
|
|
717
|
+
className: "aui-assistant-message-rule w-0.5 self-stretch rounded-full bg-border"
|
|
668
718
|
}
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
719
|
+
)
|
|
720
|
+
}
|
|
721
|
+
),
|
|
722
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
723
|
+
/* @__PURE__ */ jsx(AthenaReasoningTextComponentContext.Provider, { value: TextComponent, children: /* @__PURE__ */ jsxs("div", { className: "aui-assistant-message-content wrap-break-word px-2 text-foreground leading-relaxed", children: [
|
|
724
|
+
/* @__PURE__ */ jsx(NestedPtcComponentsProvider, { components: nestedPtcComponents, children: groupToolCalls ? /* @__PURE__ */ jsxs("div", { className: "flex flex-col space-y-2", children: [
|
|
725
|
+
/* @__PURE__ */ jsx(
|
|
726
|
+
SuperGroupingCard,
|
|
727
|
+
{
|
|
728
|
+
toolUIs: toolUIsWithNestedMessages,
|
|
729
|
+
TextComponent,
|
|
730
|
+
ReasoningComponent: effectiveReasoningComponent,
|
|
731
|
+
renderRunningMeta: renderGroupedRunningMeta
|
|
673
732
|
}
|
|
674
|
-
|
|
675
|
-
}
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
733
|
+
),
|
|
734
|
+
/* @__PURE__ */ jsx(SuperGroupingFinalText, { TextComponent })
|
|
735
|
+
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
736
|
+
/* @__PURE__ */ jsx(AthenaMessageEmptyIndicator, { EmptyComponent }),
|
|
737
|
+
/* @__PURE__ */ jsx(MessagePrimitive.GroupedParts, { groupBy: noToolGrouping, children: ({ part }) => {
|
|
738
|
+
var _a;
|
|
739
|
+
switch (part.type) {
|
|
740
|
+
case "tool-call": {
|
|
741
|
+
const ToolUI = toolUIsWithNestedMessages[part.toolName];
|
|
742
|
+
const toolProps = part;
|
|
743
|
+
return ToolUI ? /* @__PURE__ */ jsx(ToolUI, { ...toolProps }) : /* @__PURE__ */ jsx(ToolFallback, { ...toolProps });
|
|
744
|
+
}
|
|
745
|
+
case "reasoning": {
|
|
746
|
+
const ReasoningRenderer = effectiveReasoningComponent;
|
|
747
|
+
return /* @__PURE__ */ jsx(ReasoningRenderer, { ...part });
|
|
748
|
+
}
|
|
749
|
+
case "text": {
|
|
750
|
+
const textPart = part;
|
|
751
|
+
if (textPart.text === "" && ((_a = textPart.status) == null ? void 0 : _a.type) === "running") {
|
|
752
|
+
return /* @__PURE__ */ jsx(EmptyComponent, { status: textPart.status });
|
|
753
|
+
}
|
|
754
|
+
return /* @__PURE__ */ jsx(TextComponent, { ...textPart });
|
|
755
|
+
}
|
|
756
|
+
default:
|
|
757
|
+
return null;
|
|
758
|
+
}
|
|
759
|
+
} }),
|
|
760
|
+
/* @__PURE__ */ jsx(AthenaMessageActivityIndicator, {})
|
|
761
|
+
] }) }),
|
|
762
|
+
/* @__PURE__ */ jsx(MessageError, {})
|
|
763
|
+
] }) }),
|
|
764
|
+
/* @__PURE__ */ jsxs("div", { className: "aui-assistant-message-footer mt-1 ml-2 flex items-center gap-1", children: [
|
|
765
|
+
/* @__PURE__ */ jsx(BranchPicker, {}),
|
|
766
|
+
/* @__PURE__ */ jsx(ActionBarComponent, {}),
|
|
767
|
+
/* @__PURE__ */ jsx(MessageTimestamp, { className: "ml-auto group-hover/aui-assistant-message:opacity-100" })
|
|
768
|
+
] })
|
|
769
|
+
] })
|
|
770
|
+
] })
|
|
771
|
+
]
|
|
772
|
+
}
|
|
773
|
+
);
|
|
774
|
+
};
|
|
775
|
+
const CopyMessageButton = () => /* @__PURE__ */ jsx(ActionBarPrimitive.Copy, { asChild: true, children: /* @__PURE__ */ jsxs(TooltipIconButton, { tooltip: "Copy", children: [
|
|
776
|
+
/* @__PURE__ */ jsx(AuiIf, { condition: (s) => s.message.isCopied, children: /* @__PURE__ */ jsx(CheckIcon, {}) }),
|
|
777
|
+
/* @__PURE__ */ jsx(AuiIf, { condition: (s) => !s.message.isCopied, children: /* @__PURE__ */ jsx(CopyIcon, {}) })
|
|
778
|
+
] }) });
|
|
779
|
+
const RegenerateMessageButton = () => {
|
|
780
|
+
const readOnly = useMessageActionsReadOnly();
|
|
781
|
+
if (readOnly) return null;
|
|
782
|
+
return /* @__PURE__ */ jsx(ActionBarPrimitive.Reload, { asChild: true, children: /* @__PURE__ */ jsx(TooltipIconButton, { tooltip: "Regenerate", children: /* @__PURE__ */ jsx(RefreshCwIcon, {}) }) });
|
|
783
|
+
};
|
|
784
|
+
const EditMessageButton = () => {
|
|
785
|
+
const allowEdit = useAuiState((s) => s.thread.capabilities.edit);
|
|
786
|
+
const isRunning = useAthenaRunLive();
|
|
787
|
+
const readOnly = useMessageActionsReadOnly();
|
|
788
|
+
if (!allowEdit || isRunning || readOnly) return null;
|
|
789
|
+
return /* @__PURE__ */ jsx(ActionBarPrimitive.Edit, { asChild: true, children: /* @__PURE__ */ jsx(TooltipIconButton, { tooltip: "Edit", children: /* @__PURE__ */ jsx(PencilIcon, {}) }) });
|
|
790
|
+
};
|
|
791
|
+
const AthenaUserActionBar = () => {
|
|
792
|
+
const isThreadRunning = useAuiState((s) => s.thread.isRunning);
|
|
793
|
+
return /* @__PURE__ */ jsxs(
|
|
794
|
+
ActionBarPrimitive.Root,
|
|
795
|
+
{
|
|
796
|
+
autohide: "never",
|
|
797
|
+
className: cn(
|
|
798
|
+
"aui-user-action-bar-root flex min-h-6 gap-1 text-muted-foreground",
|
|
799
|
+
isThreadRunning ? "invisible" : [
|
|
800
|
+
ACTION_BAR_REVEAL_CLASS,
|
|
801
|
+
"group-hover/aui-user-message:pointer-events-auto group-hover/aui-user-message:opacity-100"
|
|
802
|
+
]
|
|
803
|
+
),
|
|
804
|
+
children: [
|
|
805
|
+
/* @__PURE__ */ jsx(CopyMessageButton, {}),
|
|
806
|
+
/* @__PURE__ */ jsx(EditMessageButton, {})
|
|
685
807
|
]
|
|
686
808
|
}
|
|
687
809
|
);
|
|
@@ -705,10 +827,8 @@ const AthenaAssistantActionBar = ({ className }) => {
|
|
|
705
827
|
className
|
|
706
828
|
),
|
|
707
829
|
children: [
|
|
708
|
-
/* @__PURE__ */ jsx(
|
|
709
|
-
|
|
710
|
-
/* @__PURE__ */ jsx(AuiIf, { condition: (s) => !s.message.isCopied, children: /* @__PURE__ */ jsx(CopyIcon, {}) })
|
|
711
|
-
] }) }),
|
|
830
|
+
/* @__PURE__ */ jsx(CopyMessageButton, {}),
|
|
831
|
+
/* @__PURE__ */ jsx(RegenerateMessageButton, {}),
|
|
712
832
|
/* @__PURE__ */ jsxs(ActionBarMorePrimitive.Root, { children: [
|
|
713
833
|
/* @__PURE__ */ jsx(ActionBarMorePrimitive.Trigger, { asChild: true, children: /* @__PURE__ */ jsx(TooltipIconButton, { tooltip: "More", className: "data-[state=open]:bg-accent", children: /* @__PURE__ */ jsx(MoreHorizontalIcon, {}) }) }),
|
|
714
834
|
/* @__PURE__ */ jsxs(
|
|
@@ -745,14 +865,43 @@ const AthenaAssistantActionBar = ({ className }) => {
|
|
|
745
865
|
};
|
|
746
866
|
const AthenaUserMessage = ({
|
|
747
867
|
TextComponent = TiptapText
|
|
748
|
-
}) =>
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
868
|
+
}) => {
|
|
869
|
+
const isWake = useAuiState((s) => {
|
|
870
|
+
var _a;
|
|
871
|
+
return isGithubWakeMessage((_a = s.message.metadata) == null ? void 0 : _a.custom);
|
|
872
|
+
});
|
|
873
|
+
if (isWake) {
|
|
874
|
+
return /* @__PURE__ */ jsxs(
|
|
875
|
+
MessagePrimitive.Root,
|
|
876
|
+
{
|
|
877
|
+
className: "aui-user-message-root aui-wake-marker-root mx-auto w-full max-w-(--thread-max-width) px-2 py-1",
|
|
878
|
+
"data-role": "user",
|
|
879
|
+
children: [
|
|
880
|
+
/* @__PURE__ */ jsx(MessageDaySeparator, {}),
|
|
881
|
+
/* @__PURE__ */ jsx(WakeMarkerMessage, {})
|
|
882
|
+
]
|
|
883
|
+
}
|
|
884
|
+
);
|
|
754
885
|
}
|
|
755
|
-
|
|
886
|
+
return /* @__PURE__ */ jsxs(
|
|
887
|
+
MessagePrimitive.Root,
|
|
888
|
+
{
|
|
889
|
+
className: "aui-user-message-root group/aui-user-message fade-in slide-in-from-bottom-1 mx-auto flex w-full max-w-(--thread-max-width) animate-in flex-col items-end px-2 py-3 duration-150",
|
|
890
|
+
"data-role": "user",
|
|
891
|
+
children: [
|
|
892
|
+
/* @__PURE__ */ jsx(MessageDaySeparator, {}),
|
|
893
|
+
/* @__PURE__ */ jsxs("div", { className: "flex min-w-0 max-w-[75%] flex-col items-end gap-1", children: [
|
|
894
|
+
/* @__PURE__ */ jsx("div", { className: "aui-user-message-content wrap-break-word rounded-2xl bg-muted/70 px-4 py-2.5 text-foreground", children: /* @__PURE__ */ jsx(MessagePrimitive.Parts, { components: { Text: TextComponent } }) }),
|
|
895
|
+
/* @__PURE__ */ jsxs("div", { className: "aui-user-message-footer -mr-1 flex items-center gap-1", children: [
|
|
896
|
+
/* @__PURE__ */ jsx(MessageTimestamp, { className: "mr-1 group-hover/aui-user-message:opacity-100" }),
|
|
897
|
+
/* @__PURE__ */ jsx(BranchPicker, {}),
|
|
898
|
+
/* @__PURE__ */ jsx(AthenaUserActionBar, {})
|
|
899
|
+
] })
|
|
900
|
+
] })
|
|
901
|
+
]
|
|
902
|
+
}
|
|
903
|
+
);
|
|
904
|
+
};
|
|
756
905
|
export {
|
|
757
906
|
AthenaAssistantActionBar,
|
|
758
907
|
AthenaAssistantMessage,
|