@athenaintel/react 0.22.4 → 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 +390 -4
- package/dist/chat/AthenaChat.cjs +346 -244
- package/dist/chat/AthenaChat.cjs.map +1 -1
- package/dist/chat/AthenaChat.d.ts +19 -8
- package/dist/chat/AthenaChat.js +350 -248
- 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 -95
- 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 -95
- 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 +38 -5
- package/dist/chat-ui/rich-text/chat-node-views.cjs.map +1 -1
- package/dist/chat-ui/rich-text/chat-node-views.d.ts +11 -0
- package/dist/chat-ui/rich-text/chat-node-views.js +39 -6
- package/dist/chat-ui/rich-text/chat-node-views.js.map +1 -1
- package/dist/chat-ui/rich-text/chat-text-schema.cjs +20 -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 +15 -2
- package/dist/chat-ui/rich-text/chat-text-schema.js +20 -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,16 +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
42
|
import { ACTION_BAR_REVEAL_CLASS, BranchPicker } from "../chat-ui/messages/message-components.js";
|
|
23
43
|
import { useMessageActionsReadOnly } from "../chat-ui/messages/message-actions-config.js";
|
|
24
44
|
import { useAthenaRunLive } from "./use-athena-run-live.js";
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
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";
|
|
29
52
|
import { FileUploadButton } from "../composer/FileUploadButton.js";
|
|
30
53
|
import { ComposerQuotePreview } from "../composer/ComposerQuotePreview.js";
|
|
31
54
|
import { ComposerAttachmentPreview } from "../composer/ComposerAttachmentPreview.js";
|
|
@@ -37,36 +60,15 @@ import { useAttachFiles } from "../composer/useAttachFiles.js";
|
|
|
37
60
|
import { useAthenaConfig } from "../provider/AthenaContext.js";
|
|
38
61
|
import { createAthenaSpacesUrl } from "../lib/athena-urls.js";
|
|
39
62
|
import { isRecord } from "../lib/utils.js";
|
|
40
|
-
import { useSendMessage } from "../composer/useSendMessage.js";
|
|
41
63
|
import { getToolkitDisplayInfo } from "../toolkits/index.js";
|
|
42
|
-
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";
|
|
43
67
|
import { cn } from "cnfast";
|
|
44
68
|
function QuotePostMessageBridge() {
|
|
45
69
|
useQuoteFromPostMessage();
|
|
46
70
|
return null;
|
|
47
71
|
}
|
|
48
|
-
const DEFAULT_SUGGESTIONS = [
|
|
49
|
-
{
|
|
50
|
-
icon: SearchIcon,
|
|
51
|
-
title: "Research a topic and draft a report",
|
|
52
|
-
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."
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
icon: SearchIcon,
|
|
56
|
-
title: "Compare recent AI model launches",
|
|
57
|
-
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."
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
icon: PresentationIcon,
|
|
61
|
-
title: "Build a presentation from scratch",
|
|
62
|
-
prompt: "Create a 5-slide investor update presentation covering market opportunity, product traction, key metrics, competitive positioning, and next steps."
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
icon: FileTextIcon,
|
|
66
|
-
title: "Set up a structured spreadsheet",
|
|
67
|
-
prompt: "Create a project tracking spreadsheet with columns for task name, owner, priority, status, start date, due date, and completion percentage."
|
|
68
|
-
}
|
|
69
|
-
];
|
|
70
72
|
const AthenaChatDefaultComponentsContext = createContext(null);
|
|
71
73
|
const AthenaReasoningTextComponentContext = createContext(null);
|
|
72
74
|
const useAthenaChatDefaultComponents = () => {
|
|
@@ -77,11 +79,20 @@ const useAthenaChatDefaultComponents = () => {
|
|
|
77
79
|
return value;
|
|
78
80
|
};
|
|
79
81
|
const AthenaDefaultAssistantMessage = () => {
|
|
80
|
-
const {
|
|
82
|
+
const {
|
|
83
|
+
toolUIs,
|
|
84
|
+
TextComponent,
|
|
85
|
+
ReasoningComponent,
|
|
86
|
+
EmptyComponent,
|
|
87
|
+
ActionBarComponent,
|
|
88
|
+
AvatarComponent,
|
|
89
|
+
groupToolCalls
|
|
90
|
+
} = useAthenaChatDefaultComponents();
|
|
81
91
|
return /* @__PURE__ */ jsx(
|
|
82
92
|
AthenaAssistantMessage,
|
|
83
93
|
{
|
|
84
94
|
toolUIs,
|
|
95
|
+
AvatarComponent,
|
|
85
96
|
TextComponent,
|
|
86
97
|
ReasoningComponent,
|
|
87
98
|
EmptyComponent,
|
|
@@ -120,50 +131,22 @@ const withNestedPtcMessages = (ToolUI) => {
|
|
|
120
131
|
};
|
|
121
132
|
return ToolUIWithNestedPtcMessages;
|
|
122
133
|
};
|
|
123
|
-
const SuggestionCard = ({
|
|
124
|
-
suggestion,
|
|
125
|
-
index
|
|
126
|
-
}) => {
|
|
127
|
-
const Icon = suggestion.icon;
|
|
128
|
-
const sendMessage = useSendMessage();
|
|
129
|
-
const handleClick = useCallback(() => {
|
|
130
|
-
void sendMessage(suggestion.prompt);
|
|
131
|
-
}, [sendMessage, suggestion.prompt]);
|
|
132
|
-
return /* @__PURE__ */ jsxs(
|
|
133
|
-
"button",
|
|
134
|
-
{
|
|
135
|
-
type: "button",
|
|
136
|
-
onClick: handleClick,
|
|
137
|
-
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`,
|
|
138
|
-
style: { animationDelay: `${100 + index * 75}ms` },
|
|
139
|
-
children: [
|
|
140
|
-
/* @__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" }) }),
|
|
141
|
-
/* @__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 }) }),
|
|
142
|
-
/* @__PURE__ */ jsx(ArrowRightIcon, { className: "mt-0.5 size-3.5 shrink-0 text-muted-foreground/0 transition-all group-hover:text-muted-foreground" })
|
|
143
|
-
]
|
|
144
|
-
}
|
|
145
|
-
);
|
|
146
|
-
};
|
|
147
|
-
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: [
|
|
148
|
-
/* @__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 }),
|
|
149
|
-
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 }),
|
|
150
|
-
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)) })
|
|
151
|
-
] }) }) });
|
|
152
134
|
const AthenaChat = ({
|
|
153
135
|
className,
|
|
154
136
|
welcomeMessage = "Hello there!",
|
|
155
137
|
welcomeSubtext = "What can I help you with?",
|
|
156
|
-
maxWidth = "
|
|
138
|
+
maxWidth = "46rem",
|
|
157
139
|
turnAnchor = "bottom",
|
|
158
140
|
readOnly = false,
|
|
159
141
|
toolUIs,
|
|
160
142
|
mentionTools,
|
|
161
|
-
welcomeSuggestions =
|
|
143
|
+
welcomeSuggestions = DEFAULT_WELCOME_SUGGESTIONS,
|
|
162
144
|
components,
|
|
163
|
-
groupToolCalls =
|
|
145
|
+
groupToolCalls = true
|
|
164
146
|
}) => {
|
|
165
147
|
var _a, _b, _c;
|
|
166
148
|
const athenaConfig = useAthenaConfig();
|
|
149
|
+
const statewireThreadId = useContext(AthenaStatewireThreadIdContext);
|
|
167
150
|
const mentionAuth = useMemo(
|
|
168
151
|
() => ({
|
|
169
152
|
backendUrl: athenaConfig.backendUrl,
|
|
@@ -204,6 +187,7 @@ const AthenaChat = ({
|
|
|
204
187
|
const reasoningComponent = (_b = components == null ? void 0 : components.messageParts) == null ? void 0 : _b.Reasoning;
|
|
205
188
|
const emptyComponent = ((_c = components == null ? void 0 : components.messageParts) == null ? void 0 : _c.Empty) ?? AthenaAssistantMessageEmpty;
|
|
206
189
|
const actionBarComponent = (components == null ? void 0 : components.AssistantActionBar) ?? AthenaAssistantActionBar;
|
|
190
|
+
const avatarComponent = components == null ? void 0 : components.AssistantAvatar;
|
|
207
191
|
const defaultComponentsContextValue = useMemo(
|
|
208
192
|
() => ({
|
|
209
193
|
toolUIs: mergedToolUIs,
|
|
@@ -211,9 +195,18 @@ const AthenaChat = ({
|
|
|
211
195
|
ReasoningComponent: reasoningComponent,
|
|
212
196
|
EmptyComponent: emptyComponent,
|
|
213
197
|
ActionBarComponent: actionBarComponent,
|
|
198
|
+
AvatarComponent: avatarComponent,
|
|
214
199
|
groupToolCalls
|
|
215
200
|
}),
|
|
216
|
-
[
|
|
201
|
+
[
|
|
202
|
+
actionBarComponent,
|
|
203
|
+
avatarComponent,
|
|
204
|
+
emptyComponent,
|
|
205
|
+
groupToolCalls,
|
|
206
|
+
mergedToolUIs,
|
|
207
|
+
reasoningComponent,
|
|
208
|
+
textComponent
|
|
209
|
+
]
|
|
217
210
|
);
|
|
218
211
|
const AssistantMessageComponent = (components == null ? void 0 : components.AssistantMessage) ?? AthenaDefaultAssistantMessage;
|
|
219
212
|
const UserMessageComponent = (components == null ? void 0 : components.UserMessage) ?? AthenaDefaultUserMessage;
|
|
@@ -224,7 +217,7 @@ const AthenaChat = ({
|
|
|
224
217
|
}),
|
|
225
218
|
[AssistantMessageComponent, UserMessageComponent]
|
|
226
219
|
);
|
|
227
|
-
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(
|
|
228
221
|
ChatThreadShell,
|
|
229
222
|
{
|
|
230
223
|
overlay: /* @__PURE__ */ jsx(ThreadLoadingOverlay, {}),
|
|
@@ -235,46 +228,35 @@ const AthenaChat = ({
|
|
|
235
228
|
maxWidth,
|
|
236
229
|
turnAnchor,
|
|
237
230
|
readOnly,
|
|
231
|
+
banners: /* @__PURE__ */ jsx(WaitingOnYouBanner, { className: "px-4 pt-3" }),
|
|
238
232
|
viewportClassName: "aui-thread-viewport relative flex flex-1 flex-col overflow-x-auto overflow-y-scroll scroll-smooth px-4 pt-4",
|
|
239
233
|
contentClassName: "flex w-full flex-1 flex-col",
|
|
240
234
|
viewportOverlay: /* @__PURE__ */ jsx(ThreadScrollToTop, {}),
|
|
241
|
-
welcome: /* @__PURE__ */ jsx(
|
|
242
|
-
AthenaChatWelcome,
|
|
243
|
-
{
|
|
244
|
-
welcomeMessage,
|
|
245
|
-
welcomeSubtext,
|
|
246
|
-
welcomeSuggestions
|
|
247
|
-
}
|
|
248
|
-
),
|
|
235
|
+
welcome: /* @__PURE__ */ jsx(AthenaChatWelcome, { welcomeMessage, welcomeSubtext }),
|
|
249
236
|
beforeMessages: /* @__PURE__ */ jsx(StatewireHistoryEdge, { className: "aui-thread-history-edge" }),
|
|
250
237
|
components: messageComponents,
|
|
251
238
|
runningIndicator: null,
|
|
252
|
-
scrollToBottom:
|
|
253
|
-
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",
|
|
254
241
|
viewportFooter: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
242
|
+
welcomeSuggestions.length > 0 && /* @__PURE__ */ jsx(ThreadPrimitive.Empty, { children: /* @__PURE__ */ jsx(AthenaChatWelcomeSuggestions, { suggestions: welcomeSuggestions }) }),
|
|
255
243
|
/* @__PURE__ */ jsx(StatewireConnectionBanner, {}),
|
|
256
244
|
/* @__PURE__ */ jsx(StatewireErrorBanner, {}),
|
|
257
245
|
/* @__PURE__ */ jsx(StatewireApprovalCard, {}),
|
|
258
246
|
/* @__PURE__ */ jsx(StatewireQueuedMessages, {}),
|
|
259
247
|
/* @__PURE__ */ jsx(AttachmentProvider, { children: /* @__PURE__ */ jsxs(QuoteProvider, { children: [
|
|
260
248
|
/* @__PURE__ */ jsx(QuotePostMessageBridge, {}),
|
|
261
|
-
/* @__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
|
+
) })
|
|
262
256
|
] }) })
|
|
263
257
|
] })
|
|
264
258
|
}
|
|
265
|
-
) }) });
|
|
266
|
-
};
|
|
267
|
-
const ThreadLoadingOverlay = () => {
|
|
268
|
-
const remoteId = useAthenaThreadId();
|
|
269
|
-
const [timedOut, setTimedOut] = useState(false);
|
|
270
|
-
useEffect(() => {
|
|
271
|
-
if (!remoteId) return;
|
|
272
|
-
setTimedOut(false);
|
|
273
|
-
const timer = setTimeout(() => setTimedOut(true), 15e3);
|
|
274
|
-
return () => clearTimeout(timer);
|
|
275
|
-
}, [remoteId]);
|
|
276
|
-
if (!remoteId || timedOut) return null;
|
|
277
|
-
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) });
|
|
278
260
|
};
|
|
279
261
|
const THREAD_VIEWPORT_ATTR = "data-aui-thread-viewport";
|
|
280
262
|
const useScrollToTop = () => {
|
|
@@ -320,63 +302,13 @@ const ThreadScrollToTop = () => {
|
|
|
320
302
|
}
|
|
321
303
|
) });
|
|
322
304
|
};
|
|
323
|
-
const ThreadScrollToBottom = () => /* @__PURE__ */ jsx(ThreadPrimitive.ScrollToBottom, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
324
|
-
TooltipIconButton,
|
|
325
|
-
{
|
|
326
|
-
tooltip: "Scroll to bottom",
|
|
327
|
-
variant: "outline",
|
|
328
|
-
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",
|
|
329
|
-
children: /* @__PURE__ */ jsx(ArrowDownIcon, {})
|
|
330
|
-
}
|
|
331
|
-
) });
|
|
332
|
-
const AthenaComposerSendButton = ({
|
|
333
|
-
action,
|
|
334
|
-
onSend,
|
|
335
|
-
disabled,
|
|
336
|
-
title
|
|
337
|
-
}) => {
|
|
338
|
-
const label = action === "queue" ? "Queue message" : "Send message";
|
|
339
|
-
return /* @__PURE__ */ jsx(
|
|
340
|
-
TooltipIconButton,
|
|
341
|
-
{
|
|
342
|
-
tooltip: title ?? label,
|
|
343
|
-
side: "bottom",
|
|
344
|
-
type: "button",
|
|
345
|
-
variant: "default",
|
|
346
|
-
size: "icon",
|
|
347
|
-
className: "aui-composer-send size-8 rounded-full",
|
|
348
|
-
"aria-label": label,
|
|
349
|
-
onClick: onSend,
|
|
350
|
-
disabled,
|
|
351
|
-
children: action === "queue" ? /* @__PURE__ */ jsx(ListPlusIcon, { className: "aui-composer-send-icon size-4" }) : /* @__PURE__ */ jsx(ArrowUpIcon, { className: "aui-composer-send-icon size-4" })
|
|
352
|
-
}
|
|
353
|
-
);
|
|
354
|
-
};
|
|
355
|
-
const AthenaComposerStopButton = ({ onStop, disabled, title }) => /* @__PURE__ */ jsx(
|
|
356
|
-
Button,
|
|
357
|
-
{
|
|
358
|
-
type: "button",
|
|
359
|
-
variant: "default",
|
|
360
|
-
size: "icon",
|
|
361
|
-
className: "aui-composer-cancel size-8 rounded-full",
|
|
362
|
-
"aria-label": "Stop generating",
|
|
363
|
-
title,
|
|
364
|
-
onClick: onStop,
|
|
365
|
-
disabled,
|
|
366
|
-
children: /* @__PURE__ */ jsx(SquareIcon, { className: "aui-composer-cancel-icon size-3 fill-current" })
|
|
367
|
-
}
|
|
368
|
-
);
|
|
369
|
-
const ATHENA_COMPOSER_COMPONENTS = {
|
|
370
|
-
SendButton: AthenaComposerSendButton,
|
|
371
|
-
StopButton: AthenaComposerStopButton
|
|
372
|
-
};
|
|
373
305
|
const ATHENA_CHAT_MENTION_CATEGORIES = [
|
|
374
306
|
"favorites",
|
|
375
307
|
"assets",
|
|
376
308
|
"projects",
|
|
377
309
|
"folders"
|
|
378
310
|
];
|
|
379
|
-
const AthenaChatComposer = ({ tools }) => {
|
|
311
|
+
const AthenaChatComposer = ({ tools, welcomeSuggestionCount }) => {
|
|
380
312
|
const aui = useAui();
|
|
381
313
|
const threadId = useAthenaStatewireThreadId();
|
|
382
314
|
const { appUrl } = useAthenaConfig();
|
|
@@ -385,6 +317,15 @@ const AthenaChatComposer = ({ tools }) => {
|
|
|
385
317
|
const { attachFiles } = useAttachFiles();
|
|
386
318
|
const composerRef = useRef(null);
|
|
387
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
|
+
);
|
|
388
329
|
const rootCategories = useMemo(() => {
|
|
389
330
|
const categories = [...ATHENA_CHAT_MENTION_CATEGORIES];
|
|
390
331
|
if (tools.some((tool) => tool.type === "toolkit")) categories.push("toolkits");
|
|
@@ -440,41 +381,62 @@ const AthenaChatComposer = ({ tools }) => {
|
|
|
440
381
|
}),
|
|
441
382
|
[attachFiles]
|
|
442
383
|
);
|
|
443
|
-
return /* @__PURE__ */ jsx(ComposerDropZone, { children: /* @__PURE__ */ jsx(
|
|
444
|
-
|
|
384
|
+
return /* @__PURE__ */ jsx(ComposerDropZone, { onDragActiveChange: setDragActive, children: /* @__PURE__ */ jsx(
|
|
385
|
+
"div",
|
|
445
386
|
{
|
|
446
|
-
className: "",
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
/* @__PURE__ */ jsx(ComposerQuotePreview, {}),
|
|
452
|
-
/* @__PURE__ */ jsx(ComposerAttachmentPreview, {})
|
|
453
|
-
] }),
|
|
454
|
-
editor: /* @__PURE__ */ jsx(
|
|
455
|
-
TiptapComposer,
|
|
387
|
+
className: cn("aui-composer-entrance", entrance.className),
|
|
388
|
+
style: entrance.style,
|
|
389
|
+
onFocus: keyboardHint.onFocus,
|
|
390
|
+
children: /* @__PURE__ */ jsx(
|
|
391
|
+
ChatComposerDock,
|
|
456
392
|
{
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
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 })
|
|
476
438
|
}
|
|
477
|
-
)
|
|
439
|
+
)
|
|
478
440
|
}
|
|
479
441
|
) });
|
|
480
442
|
};
|
|
@@ -491,9 +453,54 @@ const MessageError = () => /* @__PURE__ */ jsx(MessagePrimitive.Error, { childre
|
|
|
491
453
|
}
|
|
492
454
|
) })
|
|
493
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
|
+
};
|
|
494
501
|
const AthenaAssistantMessageEmpty = ({ status }) => {
|
|
495
502
|
if ((status == null ? void 0 : status.type) !== "running") return null;
|
|
496
|
-
return /* @__PURE__ */ jsx(
|
|
503
|
+
return /* @__PURE__ */ jsx(RunStatusLine, { verb: "Thinking", resetKey: "empty", className: "mt-0" });
|
|
497
504
|
};
|
|
498
505
|
const AthenaMessageEmptyIndicator = ({
|
|
499
506
|
EmptyComponent
|
|
@@ -512,27 +519,77 @@ const AthenaMessageActivityIndicator = () => {
|
|
|
512
519
|
return ((_a = s.message.status) == null ? void 0 : _a.type) === "running";
|
|
513
520
|
});
|
|
514
521
|
const activityKey = useAuiState((s) => runActivityKey(s.message.parts));
|
|
515
|
-
const
|
|
516
|
-
useEffect(() => {
|
|
517
|
-
setSeconds(0);
|
|
518
|
-
if (!isRunning || activityKey === null) return;
|
|
519
|
-
const startedAt = Date.now();
|
|
520
|
-
const timer = setInterval(() => {
|
|
521
|
-
setSeconds(Math.floor((Date.now() - startedAt) / 1e3));
|
|
522
|
-
}, 1e3);
|
|
523
|
-
return () => clearInterval(timer);
|
|
524
|
-
}, [isRunning, activityKey]);
|
|
522
|
+
const verb = useAuiState((s) => runActivityVerb(s.message.parts));
|
|
525
523
|
if (!isRunning || activityKey === null) return null;
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
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
|
+
);
|
|
536
593
|
};
|
|
537
594
|
const AthenaReasoningPart = ({
|
|
538
595
|
text,
|
|
@@ -612,11 +669,12 @@ const AthenaReasoningPart = ({
|
|
|
612
669
|
const noToolGrouping = () => null;
|
|
613
670
|
const AthenaAssistantMessage = ({
|
|
614
671
|
toolUIs,
|
|
672
|
+
AvatarComponent,
|
|
615
673
|
TextComponent = TiptapText,
|
|
616
674
|
ReasoningComponent,
|
|
617
675
|
EmptyComponent = AthenaAssistantMessageEmpty,
|
|
618
676
|
ActionBarComponent = AthenaAssistantActionBar,
|
|
619
|
-
groupToolCalls =
|
|
677
|
+
groupToolCalls = true
|
|
620
678
|
}) => {
|
|
621
679
|
const effectiveReasoningComponent = ReasoningComponent ?? AthenaReasoningPart;
|
|
622
680
|
const toolUIsWithNestedMessages = useMemo(() => {
|
|
@@ -644,50 +702,71 @@ const AthenaAssistantMessage = ({
|
|
|
644
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",
|
|
645
703
|
"data-role": "assistant",
|
|
646
704
|
children: [
|
|
647
|
-
/* @__PURE__ */ jsx(
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
/* @__PURE__ */ jsx(AthenaMessageEmptyIndicator, { EmptyComponent }),
|
|
661
|
-
/* @__PURE__ */ jsx(MessagePrimitive.GroupedParts, { groupBy: noToolGrouping, children: ({ part }) => {
|
|
662
|
-
var _a;
|
|
663
|
-
switch (part.type) {
|
|
664
|
-
case "tool-call": {
|
|
665
|
-
const ToolUI = toolUIsWithNestedMessages[part.toolName];
|
|
666
|
-
const toolProps = part;
|
|
667
|
-
return ToolUI ? /* @__PURE__ */ jsx(ToolUI, { ...toolProps }) : /* @__PURE__ */ jsx(ToolFallback, { ...toolProps });
|
|
668
|
-
}
|
|
669
|
-
case "reasoning": {
|
|
670
|
-
const ReasoningRenderer = effectiveReasoningComponent;
|
|
671
|
-
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"
|
|
672
718
|
}
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
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
|
|
677
732
|
}
|
|
678
|
-
|
|
679
|
-
}
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
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
|
+
] })
|
|
691
770
|
] })
|
|
692
771
|
]
|
|
693
772
|
}
|
|
@@ -786,20 +865,43 @@ const AthenaAssistantActionBar = ({ className }) => {
|
|
|
786
865
|
};
|
|
787
866
|
const AthenaUserMessage = ({
|
|
788
867
|
TextComponent = TiptapText
|
|
789
|
-
}) =>
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
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
|
+
);
|
|
801
885
|
}
|
|
802
|
-
|
|
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
|
+
};
|
|
803
905
|
export {
|
|
804
906
|
AthenaAssistantActionBar,
|
|
805
907
|
AthenaAssistantMessage,
|