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