@athenaintel/react 0.22.3 → 0.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +394 -4
- package/dist/chat/AthenaChat.cjs +389 -240
- package/dist/chat/AthenaChat.cjs.map +1 -1
- package/dist/chat/AthenaChat.d.ts +26 -8
- package/dist/chat/AthenaChat.js +394 -245
- package/dist/chat/AthenaChat.js.map +1 -1
- package/dist/chat/StatewireApprovalCard.cjs +2 -1
- package/dist/chat/StatewireApprovalCard.cjs.map +1 -1
- package/dist/chat/StatewireApprovalCard.js +2 -1
- package/dist/chat/StatewireApprovalCard.js.map +1 -1
- package/dist/chat/StatewireClientToolBridge.cjs +1 -0
- package/dist/chat/StatewireClientToolBridge.cjs.map +1 -1
- package/dist/chat/StatewireClientToolBridge.js +1 -0
- package/dist/chat/StatewireClientToolBridge.js.map +1 -1
- package/dist/chat/StatewireQueuedMessages.cjs +1 -0
- package/dist/chat/StatewireQueuedMessages.cjs.map +1 -1
- package/dist/chat/StatewireQueuedMessages.js +1 -0
- package/dist/chat/StatewireQueuedMessages.js.map +1 -1
- package/dist/chat/WaitingOnYouBanner.cjs +100 -0
- package/dist/chat/WaitingOnYouBanner.cjs.map +1 -0
- package/dist/chat/WaitingOnYouBanner.d.ts +29 -0
- package/dist/chat/WaitingOnYouBanner.js +100 -0
- package/dist/chat/WaitingOnYouBanner.js.map +1 -0
- package/dist/chat/athena-chat-welcome.cjs +148 -0
- package/dist/chat/athena-chat-welcome.cjs.map +1 -0
- package/dist/chat/athena-chat-welcome.d.ts +54 -0
- package/dist/chat/athena-chat-welcome.js +148 -0
- package/dist/chat/athena-chat-welcome.js.map +1 -0
- package/dist/chat/athena-composer-controls.cjs +76 -0
- package/dist/chat/athena-composer-controls.cjs.map +1 -0
- package/dist/chat/athena-composer-controls.d.ts +21 -0
- package/dist/chat/athena-composer-controls.js +76 -0
- package/dist/chat/athena-composer-controls.js.map +1 -0
- package/dist/chat/composer-keyboard-hint.cjs +61 -0
- package/dist/chat/composer-keyboard-hint.cjs.map +1 -0
- package/dist/chat/composer-keyboard-hint.d.ts +33 -0
- package/dist/chat/composer-keyboard-hint.js +61 -0
- package/dist/chat/composer-keyboard-hint.js.map +1 -0
- package/dist/chat/message-time.cjs +64 -0
- package/dist/chat/message-time.cjs.map +1 -0
- package/dist/chat/message-time.d.ts +45 -0
- package/dist/chat/message-time.js +64 -0
- package/dist/chat/message-time.js.map +1 -0
- package/dist/chat/run-activity.cjs +38 -7
- package/dist/chat/run-activity.cjs.map +1 -1
- package/dist/chat/run-activity.d.ts +14 -3
- package/dist/chat/run-activity.js +39 -8
- package/dist/chat/run-activity.js.map +1 -1
- package/dist/chat/statewire-client-tools.cjs +2 -1
- package/dist/chat/statewire-client-tools.cjs.map +1 -1
- package/dist/chat/statewire-client-tools.js +2 -1
- package/dist/chat/statewire-client-tools.js.map +1 -1
- package/dist/chat/super-grouping/activity-timeline.cjs +2 -1
- package/dist/chat/super-grouping/activity-timeline.cjs.map +1 -1
- package/dist/chat/super-grouping/activity-timeline.js +2 -1
- package/dist/chat/super-grouping/activity-timeline.js.map +1 -1
- package/dist/chat/thread-scroll-to-bottom.cjs +24 -0
- package/dist/chat/thread-scroll-to-bottom.cjs.map +1 -0
- package/dist/chat/thread-scroll-to-bottom.d.ts +11 -0
- package/dist/chat/thread-scroll-to-bottom.js +24 -0
- package/dist/chat/thread-scroll-to-bottom.js.map +1 -0
- package/dist/chat/tiptap-text.cjs +26 -99
- package/dist/chat/tiptap-text.cjs.map +1 -1
- package/dist/chat/tiptap-text.d.ts +13 -0
- package/dist/chat/tiptap-text.js +26 -99
- package/dist/chat/tiptap-text.js.map +1 -1
- package/dist/chat/use-athena-run-live.cjs +2 -1
- package/dist/chat/use-athena-run-live.cjs.map +1 -1
- package/dist/chat/use-athena-run-live.js +2 -1
- package/dist/chat/use-athena-run-live.js.map +1 -1
- package/dist/chat/use-statewire-approval-request.cjs +1 -0
- package/dist/chat/use-statewire-approval-request.cjs.map +1 -1
- package/dist/chat/use-statewire-approval-request.js +1 -0
- package/dist/chat/use-statewire-approval-request.js.map +1 -1
- package/dist/chat-ui/composer/tiptap-composer.cjs +39 -4
- package/dist/chat-ui/composer/tiptap-composer.cjs.map +1 -1
- package/dist/chat-ui/composer/tiptap-composer.d.ts +21 -0
- package/dist/chat-ui/composer/tiptap-composer.js +39 -4
- package/dist/chat-ui/composer/tiptap-composer.js.map +1 -1
- package/dist/chat-ui/index.cjs +15 -1
- package/dist/chat-ui/index.cjs.map +1 -1
- package/dist/chat-ui/index.d.ts +6 -3
- package/dist/chat-ui/index.js +16 -2
- package/dist/chat-ui/index.js.map +1 -1
- package/dist/chat-ui/mentions/mention-chip.cjs +31 -4
- package/dist/chat-ui/mentions/mention-chip.cjs.map +1 -1
- package/dist/chat-ui/mentions/mention-chip.js +31 -4
- package/dist/chat-ui/mentions/mention-chip.js.map +1 -1
- package/dist/chat-ui/messages/message-components.cjs +19 -1
- package/dist/chat-ui/messages/message-components.cjs.map +1 -1
- package/dist/chat-ui/messages/message-components.d.ts +13 -0
- package/dist/chat-ui/messages/message-components.js +19 -1
- package/dist/chat-ui/messages/message-components.js.map +1 -1
- package/dist/chat-ui/messages/runtime-message.cjs +2 -1
- package/dist/chat-ui/messages/runtime-message.cjs.map +1 -1
- package/dist/chat-ui/messages/runtime-message.js +2 -1
- package/dist/chat-ui/messages/runtime-message.js.map +1 -1
- package/dist/chat-ui/messages/statewire-continue-run.cjs +1 -0
- package/dist/chat-ui/messages/statewire-continue-run.cjs.map +1 -1
- package/dist/chat-ui/messages/statewire-continue-run.js +1 -0
- package/dist/chat-ui/messages/statewire-continue-run.js.map +1 -1
- package/dist/chat-ui/messages/user-edit-composer.cjs +3 -1
- package/dist/chat-ui/messages/user-edit-composer.cjs.map +1 -1
- package/dist/chat-ui/messages/user-edit-composer.js +3 -1
- package/dist/chat-ui/messages/user-edit-composer.js.map +1 -1
- package/dist/chat-ui/messages/wake-marker.cjs +84 -0
- package/dist/chat-ui/messages/wake-marker.cjs.map +1 -0
- package/dist/chat-ui/messages/wake-marker.d.ts +16 -0
- package/dist/chat-ui/messages/wake-marker.js +84 -0
- package/dist/chat-ui/messages/wake-marker.js.map +1 -0
- package/dist/chat-ui/rich-text/chat-blocks.cjs +177 -0
- package/dist/chat-ui/rich-text/chat-blocks.cjs.map +1 -0
- package/dist/chat-ui/rich-text/chat-blocks.d.ts +58 -0
- package/dist/chat-ui/rich-text/chat-blocks.js +177 -0
- package/dist/chat-ui/rich-text/chat-blocks.js.map +1 -0
- package/dist/chat-ui/rich-text/chat-link.cjs +69 -0
- package/dist/chat-ui/rich-text/chat-link.cjs.map +1 -0
- package/dist/chat-ui/rich-text/chat-link.d.ts +24 -0
- package/dist/chat-ui/rich-text/chat-link.js +69 -0
- package/dist/chat-ui/rich-text/chat-link.js.map +1 -0
- package/dist/chat-ui/rich-text/chat-message-body.cjs +144 -18
- package/dist/chat-ui/rich-text/chat-message-body.cjs.map +1 -1
- package/dist/chat-ui/rich-text/chat-message-body.d.ts +10 -1
- package/dist/chat-ui/rich-text/chat-message-body.js +149 -23
- package/dist/chat-ui/rich-text/chat-message-body.js.map +1 -1
- package/dist/chat-ui/rich-text/chat-node-views.cjs +84 -4
- package/dist/chat-ui/rich-text/chat-node-views.cjs.map +1 -1
- package/dist/chat-ui/rich-text/chat-node-views.d.ts +12 -1
- package/dist/chat-ui/rich-text/chat-node-views.js +85 -5
- package/dist/chat-ui/rich-text/chat-node-views.js.map +1 -1
- package/dist/chat-ui/rich-text/chat-text-schema.cjs +21 -3
- package/dist/chat-ui/rich-text/chat-text-schema.cjs.map +1 -1
- package/dist/chat-ui/rich-text/chat-text-schema.d.ts +17 -2
- package/dist/chat-ui/rich-text/chat-text-schema.js +21 -3
- package/dist/chat-ui/rich-text/chat-text-schema.js.map +1 -1
- package/dist/chat-ui/rich-text/citation-anchors.cjs +139 -0
- package/dist/chat-ui/rich-text/citation-anchors.cjs.map +1 -0
- package/dist/chat-ui/rich-text/citation-anchors.d.ts +74 -0
- package/dist/chat-ui/rich-text/citation-anchors.js +139 -0
- package/dist/chat-ui/rich-text/citation-anchors.js.map +1 -0
- package/dist/chat-ui/statewire.cjs +8 -1
- package/dist/chat-ui/statewire.cjs.map +1 -1
- package/dist/chat-ui/statewire.d.ts +2 -0
- package/dist/chat-ui/statewire.js +8 -1
- package/dist/chat-ui/statewire.js.map +1 -1
- package/dist/chat-ui/thread/chat-composer-dock.cjs +27 -6
- package/dist/chat-ui/thread/chat-composer-dock.cjs.map +1 -1
- package/dist/chat-ui/thread/chat-composer-dock.d.ts +21 -1
- package/dist/chat-ui/thread/chat-composer-dock.js +28 -7
- package/dist/chat-ui/thread/chat-composer-dock.js.map +1 -1
- package/dist/chat-ui/thread/statewire-history-edge.cjs +12 -13
- package/dist/chat-ui/thread/statewire-history-edge.cjs.map +1 -1
- package/dist/chat-ui/thread/statewire-history-edge.d.ts +11 -10
- package/dist/chat-ui/thread/statewire-history-edge.js +13 -14
- package/dist/chat-ui/thread/statewire-history-edge.js.map +1 -1
- package/dist/chat-ui/thread/thread-loading-overlay.cjs +31 -0
- package/dist/chat-ui/thread/thread-loading-overlay.cjs.map +1 -0
- package/dist/chat-ui/thread/thread-loading-overlay.d.ts +14 -0
- package/dist/chat-ui/thread/thread-loading-overlay.js +31 -0
- package/dist/chat-ui/thread/thread-loading-overlay.js.map +1 -0
- package/dist/composer/ComposerDropZone.cjs +8 -1
- package/dist/composer/ComposerDropZone.cjs.map +1 -1
- package/dist/composer/ComposerDropZone.d.ts +6 -0
- package/dist/composer/ComposerDropZone.js +9 -2
- package/dist/composer/ComposerDropZone.js.map +1 -1
- package/dist/diagnostics/errors.cjs +20 -0
- package/dist/diagnostics/errors.cjs.map +1 -1
- package/dist/diagnostics/errors.d.ts +20 -0
- package/dist/diagnostics/errors.js +20 -0
- package/dist/diagnostics/errors.js.map +1 -1
- package/dist/index.cjs +47 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +26 -7
- package/dist/index.js +51 -5
- package/dist/index.js.map +1 -1
- package/dist/lib/use-prefers-reduced-motion.cjs +29 -0
- package/dist/lib/use-prefers-reduced-motion.cjs.map +1 -0
- package/dist/lib/use-prefers-reduced-motion.d.ts +6 -0
- package/dist/lib/use-prefers-reduced-motion.js +29 -0
- package/dist/lib/use-prefers-reduced-motion.js.map +1 -0
- package/dist/packages/agent-runtime/src/conversation-index.cjs.map +1 -1
- package/dist/packages/agent-runtime/src/conversation-index.js.map +1 -1
- package/dist/packages/agent-runtime/src/conversation-list.cjs +59 -0
- package/dist/packages/agent-runtime/src/conversation-list.cjs.map +1 -1
- package/dist/packages/agent-runtime/src/conversation-list.js +60 -1
- package/dist/packages/agent-runtime/src/conversation-list.js.map +1 -1
- package/dist/packages/agent-runtime/src/deep-agent-transport-recipe.cjs +5 -3
- package/dist/packages/agent-runtime/src/deep-agent-transport-recipe.cjs.map +1 -1
- package/dist/packages/agent-runtime/src/deep-agent-transport-recipe.js +5 -3
- package/dist/packages/agent-runtime/src/deep-agent-transport-recipe.js.map +1 -1
- package/dist/packages/agent-runtime/src/edit-command.cjs +21 -17
- package/dist/packages/agent-runtime/src/edit-command.cjs.map +1 -1
- package/dist/packages/agent-runtime/src/edit-command.js +22 -18
- package/dist/packages/agent-runtime/src/edit-command.js.map +1 -1
- package/dist/packages/agent-runtime/src/generated/runconfig-contract.cjs +9 -11
- package/dist/packages/agent-runtime/src/generated/runconfig-contract.cjs.map +1 -1
- package/dist/packages/agent-runtime/src/generated/runconfig-contract.js +9 -11
- package/dist/packages/agent-runtime/src/generated/runconfig-contract.js.map +1 -1
- package/dist/packages/agent-runtime/src/github-wake-event.cjs +86 -0
- package/dist/packages/agent-runtime/src/github-wake-event.cjs.map +1 -0
- package/dist/packages/agent-runtime/src/github-wake-event.js +86 -0
- package/dist/packages/agent-runtime/src/github-wake-event.js.map +1 -0
- package/dist/packages/agent-runtime/src/message-window.cjs +150 -42
- package/dist/packages/agent-runtime/src/message-window.cjs.map +1 -1
- package/dist/packages/agent-runtime/src/message-window.js +151 -43
- package/dist/packages/agent-runtime/src/message-window.js.map +1 -1
- package/dist/packages/agent-runtime/src/quota-safe-local-storage-session.cjs +13 -9
- package/dist/packages/agent-runtime/src/quota-safe-local-storage-session.cjs.map +1 -1
- package/dist/packages/agent-runtime/src/quota-safe-local-storage-session.js +13 -9
- package/dist/packages/agent-runtime/src/quota-safe-local-storage-session.js.map +1 -1
- package/dist/packages/agent-runtime/src/statewire-suspended.cjs +1 -3
- package/dist/packages/agent-runtime/src/statewire-suspended.cjs.map +1 -1
- package/dist/packages/agent-runtime/src/statewire-suspended.js +1 -3
- package/dist/packages/agent-runtime/src/statewire-suspended.js.map +1 -1
- package/dist/packages/agent-runtime/src/use-deep-agent-edit-submit.cjs.map +1 -1
- package/dist/packages/agent-runtime/src/use-deep-agent-edit-submit.js.map +1 -1
- package/dist/packages/agent-runtime/src/use-deep-agent-thread.cjs +61 -30
- package/dist/packages/agent-runtime/src/use-deep-agent-thread.cjs.map +1 -1
- package/dist/packages/agent-runtime/src/use-deep-agent-thread.js +59 -28
- package/dist/packages/agent-runtime/src/use-deep-agent-thread.js.map +1 -1
- package/dist/packages/agent-runtime/src/use-deep-agent-window-sync.cjs +56 -36
- package/dist/packages/agent-runtime/src/use-deep-agent-window-sync.cjs.map +1 -1
- package/dist/packages/agent-runtime/src/use-deep-agent-window-sync.js +59 -39
- package/dist/packages/agent-runtime/src/use-deep-agent-window-sync.js.map +1 -1
- package/dist/packages/react/package.json.cjs +1 -1
- package/dist/packages/react/package.json.js +1 -1
- package/dist/provider/AthenaContext.cjs.map +1 -1
- package/dist/provider/AthenaContext.d.ts +3 -0
- package/dist/provider/AthenaContext.js.map +1 -1
- package/dist/provider/AthenaProvider.cjs +93 -45
- package/dist/provider/AthenaProvider.cjs.map +1 -1
- package/dist/provider/AthenaProvider.d.ts +6 -1
- package/dist/provider/AthenaProvider.js +97 -49
- package/dist/provider/AthenaProvider.js.map +1 -1
- package/dist/runtime/statewire-lifecycle.cjs +2 -1
- package/dist/runtime/statewire-lifecycle.cjs.map +1 -1
- package/dist/runtime/statewire-lifecycle.js +2 -1
- package/dist/runtime/statewire-lifecycle.js.map +1 -1
- package/dist/runtime/useAthenaStatewireRuntime.cjs +3 -2
- package/dist/runtime/useAthenaStatewireRuntime.cjs.map +1 -1
- package/dist/runtime/useAthenaStatewireRuntime.d.ts +8 -12
- package/dist/runtime/useAthenaStatewireRuntime.js +3 -2
- package/dist/runtime/useAthenaStatewireRuntime.js.map +1 -1
- package/dist/search/useAthenaRepoSearch.cjs +94 -0
- package/dist/search/useAthenaRepoSearch.cjs.map +1 -0
- package/dist/search/useAthenaRepoSearch.d.ts +95 -0
- package/dist/search/useAthenaRepoSearch.js +94 -0
- package/dist/search/useAthenaRepoSearch.js.map +1 -0
- package/dist/styles.css +1 -1
- package/dist/threads/SessionList.cjs +486 -0
- package/dist/threads/SessionList.cjs.map +1 -0
- package/dist/threads/SessionList.d.ts +60 -0
- package/dist/threads/SessionList.js +486 -0
- package/dist/threads/SessionList.js.map +1 -0
- package/dist/threads/api.cjs +112 -4
- package/dist/threads/api.cjs.map +1 -1
- package/dist/threads/api.d.ts +128 -1
- package/dist/threads/api.js +113 -5
- package/dist/threads/api.js.map +1 -1
- package/dist/threads/conversation-list-fetcher.cjs +27 -3
- package/dist/threads/conversation-list-fetcher.cjs.map +1 -1
- package/dist/threads/conversation-list-fetcher.d.ts +16 -3
- package/dist/threads/conversation-list-fetcher.js +27 -3
- package/dist/threads/conversation-list-fetcher.js.map +1 -1
- package/dist/threads/index.d.ts +5 -1
- package/dist/threads/session-list-model.cjs +130 -0
- package/dist/threads/session-list-model.cjs.map +1 -0
- package/dist/threads/session-list-model.d.ts +62 -0
- package/dist/threads/session-list-model.js +130 -0
- package/dist/threads/session-list-model.js.map +1 -0
- package/dist/threads/statewire-thread-list.cjs +220 -38
- package/dist/threads/statewire-thread-list.cjs.map +1 -1
- package/dist/threads/statewire-thread-list.d.ts +152 -2
- package/dist/threads/statewire-thread-list.js +222 -40
- package/dist/threads/statewire-thread-list.js.map +1 -1
- package/dist/threads/thread-prefetcher.cjs +63 -0
- package/dist/threads/thread-prefetcher.cjs.map +1 -0
- package/dist/threads/thread-prefetcher.d.ts +54 -0
- package/dist/threads/thread-prefetcher.js +63 -0
- package/dist/threads/thread-prefetcher.js.map +1 -0
- package/dist/threads/use-athena-session-attention.cjs +22 -0
- package/dist/threads/use-athena-session-attention.cjs.map +1 -0
- package/dist/threads/use-athena-session-attention.d.ts +24 -0
- package/dist/threads/use-athena-session-attention.js +22 -0
- package/dist/threads/use-athena-session-attention.js.map +1 -0
- package/dist/threads/use-rest-conversation-history.cjs +25 -2
- package/dist/threads/use-rest-conversation-history.cjs.map +1 -1
- package/dist/threads/use-rest-conversation-history.d.ts +8 -1
- package/dist/threads/use-rest-conversation-history.js +25 -2
- package/dist/threads/use-rest-conversation-history.js.map +1 -1
- package/dist/threads/use-statewire-conversation-history.cjs +40 -16
- package/dist/threads/use-statewire-conversation-history.cjs.map +1 -1
- package/dist/threads/use-statewire-conversation-history.d.ts +13 -0
- package/dist/threads/use-statewire-conversation-history.js +40 -16
- package/dist/threads/use-statewire-conversation-history.js.map +1 -1
- package/dist/threads/use-thread-archive.cjs +128 -0
- package/dist/threads/use-thread-archive.cjs.map +1 -0
- package/dist/threads/use-thread-archive.d.ts +26 -0
- package/dist/threads/use-thread-archive.js +128 -0
- package/dist/threads/use-thread-archive.js.map +1 -0
- package/dist/threads/use-thread-favorite.cjs +53 -0
- package/dist/threads/use-thread-favorite.cjs.map +1 -0
- package/dist/threads/use-thread-favorite.d.ts +49 -0
- package/dist/threads/use-thread-favorite.js +53 -0
- package/dist/threads/use-thread-favorite.js.map +1 -0
- package/dist/threads/use-thread-field-override.cjs +184 -0
- package/dist/threads/use-thread-field-override.cjs.map +1 -0
- package/dist/threads/use-thread-field-override.d.ts +55 -0
- package/dist/threads/use-thread-field-override.js +184 -0
- package/dist/threads/use-thread-field-override.js.map +1 -0
- package/dist/threads/use-thread-rename.cjs +53 -0
- package/dist/threads/use-thread-rename.cjs.map +1 -0
- package/dist/threads/use-thread-rename.d.ts +48 -0
- package/dist/threads/use-thread-rename.js +53 -0
- package/dist/threads/use-thread-rename.js.map +1 -0
- package/dist/tools/index.cjs +5 -1
- package/dist/tools/index.cjs.map +1 -1
- package/dist/tools/index.d.ts +1 -1
- package/dist/tools/index.js +7 -3
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/misc-tool-uis.cjs +2 -1
- package/dist/tools/misc-tool-uis.cjs.map +1 -1
- package/dist/tools/misc-tool-uis.js +2 -1
- package/dist/tools/misc-tool-uis.js.map +1 -1
- package/dist/tools/primitives.cjs +25 -2
- package/dist/tools/primitives.cjs.map +1 -1
- package/dist/tools/primitives.d.ts +9 -2
- package/dist/tools/primitives.js +26 -3
- package/dist/tools/primitives.js.map +1 -1
- package/dist/tools/tool-appearance.cjs +11 -0
- package/dist/tools/tool-appearance.cjs.map +1 -0
- package/dist/tools/tool-appearance.d.ts +29 -0
- package/dist/tools/tool-appearance.js +11 -0
- package/dist/tools/tool-appearance.js.map +1 -0
- package/dist/tools/tool-fallback.cjs +211 -13
- package/dist/tools/tool-fallback.cjs.map +1 -1
- package/dist/tools/tool-fallback.d.ts +31 -4
- package/dist/tools/tool-fallback.js +214 -16
- package/dist/tools/tool-fallback.js.map +1 -1
- package/dist/tools/use-elapsed-seconds.cjs +24 -0
- package/dist/tools/use-elapsed-seconds.cjs.map +1 -0
- package/dist/tools/use-elapsed-seconds.d.ts +10 -0
- package/dist/tools/use-elapsed-seconds.js +24 -0
- package/dist/tools/use-elapsed-seconds.js.map +1 -0
- package/dist/tools/voice-update-tool-ui.cjs +2 -1
- package/dist/tools/voice-update-tool-ui.cjs.map +1 -1
- package/dist/tools/voice-update-tool-ui.js +2 -1
- package/dist/tools/voice-update-tool-ui.js.map +1 -1
- package/package.json +1 -1
- package/src/chat-ui/tailwind-preset.js +14 -1
package/dist/chat/AthenaChat.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,13 +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");
|
|
45
|
+
const messageActionsConfig = require("../chat-ui/messages/message-actions-config.cjs");
|
|
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");
|
|
25
51
|
const react = require("@assistant-ui/react");
|
|
26
52
|
const lucideReact = require("lucide-react");
|
|
27
|
-
const react$1 = require("react");
|
|
28
53
|
const threadIdContext = require("../threads/thread-id-context.cjs");
|
|
29
54
|
const FileUploadButton = require("../composer/FileUploadButton.cjs");
|
|
30
55
|
const ComposerQuotePreview = require("../composer/ComposerQuotePreview.cjs");
|
|
@@ -37,36 +62,15 @@ const useAttachFiles = require("../composer/useAttachFiles.cjs");
|
|
|
37
62
|
const AthenaContext = require("../provider/AthenaContext.cjs");
|
|
38
63
|
const athenaUrls = require("../lib/athena-urls.cjs");
|
|
39
64
|
const utils = require("../lib/utils.cjs");
|
|
40
|
-
const useSendMessage = require("../composer/useSendMessage.cjs");
|
|
41
65
|
const index = require("../toolkits/index.cjs");
|
|
42
66
|
const runActivity = require("./run-activity.cjs");
|
|
67
|
+
const messageTime = require("./message-time.cjs");
|
|
68
|
+
const threadScrollToBottom = require("./thread-scroll-to-bottom.cjs");
|
|
43
69
|
const cnfast = require("cnfast");
|
|
44
70
|
function QuotePostMessageBridge() {
|
|
45
71
|
QuoteContext.useQuoteFromPostMessage();
|
|
46
72
|
return null;
|
|
47
73
|
}
|
|
48
|
-
const DEFAULT_SUGGESTIONS = [
|
|
49
|
-
{
|
|
50
|
-
icon: lucideReact.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: lucideReact.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: lucideReact.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: lucideReact.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
74
|
const AthenaChatDefaultComponentsContext = react$1.createContext(null);
|
|
71
75
|
const AthenaReasoningTextComponentContext = react$1.createContext(null);
|
|
72
76
|
const useAthenaChatDefaultComponents = () => {
|
|
@@ -77,11 +81,20 @@ const useAthenaChatDefaultComponents = () => {
|
|
|
77
81
|
return value;
|
|
78
82
|
};
|
|
79
83
|
const AthenaDefaultAssistantMessage = () => {
|
|
80
|
-
const {
|
|
84
|
+
const {
|
|
85
|
+
toolUIs,
|
|
86
|
+
TextComponent,
|
|
87
|
+
ReasoningComponent,
|
|
88
|
+
EmptyComponent,
|
|
89
|
+
ActionBarComponent,
|
|
90
|
+
AvatarComponent,
|
|
91
|
+
groupToolCalls
|
|
92
|
+
} = useAthenaChatDefaultComponents();
|
|
81
93
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
82
94
|
AthenaAssistantMessage,
|
|
83
95
|
{
|
|
84
96
|
toolUIs,
|
|
97
|
+
AvatarComponent,
|
|
85
98
|
TextComponent,
|
|
86
99
|
ReasoningComponent,
|
|
87
100
|
EmptyComponent,
|
|
@@ -120,49 +133,22 @@ const withNestedPtcMessages = (ToolUI) => {
|
|
|
120
133
|
};
|
|
121
134
|
return ToolUIWithNestedPtcMessages;
|
|
122
135
|
};
|
|
123
|
-
const SuggestionCard = ({
|
|
124
|
-
suggestion,
|
|
125
|
-
index: index2
|
|
126
|
-
}) => {
|
|
127
|
-
const Icon = suggestion.icon;
|
|
128
|
-
const sendMessage = useSendMessage.useSendMessage();
|
|
129
|
-
const handleClick = react$1.useCallback(() => {
|
|
130
|
-
void sendMessage(suggestion.prompt);
|
|
131
|
-
}, [sendMessage, suggestion.prompt]);
|
|
132
|
-
return /* @__PURE__ */ jsxRuntime.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 + index2 * 75}ms` },
|
|
139
|
-
children: [
|
|
140
|
-
/* @__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" }) }),
|
|
141
|
-
/* @__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 }) }),
|
|
142
|
-
/* @__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" })
|
|
143
|
-
]
|
|
144
|
-
}
|
|
145
|
-
);
|
|
146
|
-
};
|
|
147
|
-
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: [
|
|
148
|
-
/* @__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 }),
|
|
149
|
-
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 }),
|
|
150
|
-
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)) })
|
|
151
|
-
] }) }) });
|
|
152
136
|
const AthenaChat = ({
|
|
153
137
|
className,
|
|
154
138
|
welcomeMessage = "Hello there!",
|
|
155
139
|
welcomeSubtext = "What can I help you with?",
|
|
156
|
-
maxWidth = "
|
|
140
|
+
maxWidth = "46rem",
|
|
157
141
|
turnAnchor = "bottom",
|
|
142
|
+
readOnly = false,
|
|
158
143
|
toolUIs,
|
|
159
144
|
mentionTools,
|
|
160
|
-
welcomeSuggestions =
|
|
145
|
+
welcomeSuggestions = athenaChatWelcome.DEFAULT_WELCOME_SUGGESTIONS,
|
|
161
146
|
components,
|
|
162
|
-
groupToolCalls =
|
|
147
|
+
groupToolCalls = true
|
|
163
148
|
}) => {
|
|
164
149
|
var _a, _b, _c;
|
|
165
150
|
const athenaConfig = AthenaContext.useAthenaConfig();
|
|
151
|
+
const statewireThreadId = react$1.useContext(threadIdContext.AthenaStatewireThreadIdContext);
|
|
166
152
|
const mentionAuth = react$1.useMemo(
|
|
167
153
|
() => ({
|
|
168
154
|
backendUrl: athenaConfig.backendUrl,
|
|
@@ -203,6 +189,7 @@ const AthenaChat = ({
|
|
|
203
189
|
const reasoningComponent = (_b = components == null ? void 0 : components.messageParts) == null ? void 0 : _b.Reasoning;
|
|
204
190
|
const emptyComponent = ((_c = components == null ? void 0 : components.messageParts) == null ? void 0 : _c.Empty) ?? AthenaAssistantMessageEmpty;
|
|
205
191
|
const actionBarComponent = (components == null ? void 0 : components.AssistantActionBar) ?? AthenaAssistantActionBar;
|
|
192
|
+
const avatarComponent = components == null ? void 0 : components.AssistantAvatar;
|
|
206
193
|
const defaultComponentsContextValue = react$1.useMemo(
|
|
207
194
|
() => ({
|
|
208
195
|
toolUIs: mergedToolUIs,
|
|
@@ -210,9 +197,18 @@ const AthenaChat = ({
|
|
|
210
197
|
ReasoningComponent: reasoningComponent,
|
|
211
198
|
EmptyComponent: emptyComponent,
|
|
212
199
|
ActionBarComponent: actionBarComponent,
|
|
200
|
+
AvatarComponent: avatarComponent,
|
|
213
201
|
groupToolCalls
|
|
214
202
|
}),
|
|
215
|
-
[
|
|
203
|
+
[
|
|
204
|
+
actionBarComponent,
|
|
205
|
+
avatarComponent,
|
|
206
|
+
emptyComponent,
|
|
207
|
+
groupToolCalls,
|
|
208
|
+
mergedToolUIs,
|
|
209
|
+
reasoningComponent,
|
|
210
|
+
textComponent
|
|
211
|
+
]
|
|
216
212
|
);
|
|
217
213
|
const AssistantMessageComponent = (components == null ? void 0 : components.AssistantMessage) ?? AthenaDefaultAssistantMessage;
|
|
218
214
|
const UserMessageComponent = (components == null ? void 0 : components.UserMessage) ?? AthenaDefaultUserMessage;
|
|
@@ -223,56 +219,46 @@ const AthenaChat = ({
|
|
|
223
219
|
}),
|
|
224
220
|
[AssistantMessageComponent, UserMessageComponent]
|
|
225
221
|
);
|
|
226
|
-
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(
|
|
227
223
|
chatThreadShell.ChatThreadShell,
|
|
228
224
|
{
|
|
229
|
-
overlay: /* @__PURE__ */ jsxRuntime.jsx(ThreadLoadingOverlay, {}),
|
|
225
|
+
overlay: /* @__PURE__ */ jsxRuntime.jsx(threadLoadingOverlay.ThreadLoadingOverlay, {}),
|
|
230
226
|
panelClassName: cnfast.cn(
|
|
231
227
|
"aui-root aui-thread-root @container relative flex h-full flex-col bg-background",
|
|
232
228
|
className
|
|
233
229
|
),
|
|
234
230
|
maxWidth,
|
|
235
231
|
turnAnchor,
|
|
232
|
+
readOnly,
|
|
233
|
+
banners: /* @__PURE__ */ jsxRuntime.jsx(WaitingOnYouBanner.WaitingOnYouBanner, { className: "px-4 pt-3" }),
|
|
236
234
|
viewportClassName: "aui-thread-viewport relative flex flex-1 flex-col overflow-x-auto overflow-y-scroll scroll-smooth px-4 pt-4",
|
|
237
235
|
contentClassName: "flex w-full flex-1 flex-col",
|
|
238
236
|
viewportOverlay: /* @__PURE__ */ jsxRuntime.jsx(ThreadScrollToTop, {}),
|
|
239
|
-
welcome: /* @__PURE__ */ jsxRuntime.jsx(
|
|
240
|
-
AthenaChatWelcome,
|
|
241
|
-
{
|
|
242
|
-
welcomeMessage,
|
|
243
|
-
welcomeSubtext,
|
|
244
|
-
welcomeSuggestions
|
|
245
|
-
}
|
|
246
|
-
),
|
|
237
|
+
welcome: /* @__PURE__ */ jsxRuntime.jsx(athenaChatWelcome.AthenaChatWelcome, { welcomeMessage, welcomeSubtext }),
|
|
247
238
|
beforeMessages: /* @__PURE__ */ jsxRuntime.jsx(statewireHistoryEdge.StatewireHistoryEdge, { className: "aui-thread-history-edge" }),
|
|
248
239
|
components: messageComponents2,
|
|
249
240
|
runningIndicator: null,
|
|
250
|
-
scrollToBottom:
|
|
251
|
-
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",
|
|
252
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 }) }),
|
|
253
245
|
/* @__PURE__ */ jsxRuntime.jsx(statewireBanners.StatewireConnectionBanner, {}),
|
|
254
246
|
/* @__PURE__ */ jsxRuntime.jsx(statewireBanners.StatewireErrorBanner, {}),
|
|
255
247
|
/* @__PURE__ */ jsxRuntime.jsx(StatewireApprovalCard.StatewireApprovalCard, {}),
|
|
256
248
|
/* @__PURE__ */ jsxRuntime.jsx(StatewireQueuedMessages.StatewireQueuedMessages, {}),
|
|
257
249
|
/* @__PURE__ */ jsxRuntime.jsx(AttachmentContext.AttachmentProvider, { children: /* @__PURE__ */ jsxRuntime.jsxs(QuoteContext.QuoteProvider, { children: [
|
|
258
250
|
/* @__PURE__ */ jsxRuntime.jsx(QuotePostMessageBridge, {}),
|
|
259
|
-
/* @__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
|
+
) })
|
|
260
258
|
] }) })
|
|
261
259
|
] })
|
|
262
260
|
}
|
|
263
|
-
) }) });
|
|
264
|
-
};
|
|
265
|
-
const ThreadLoadingOverlay = () => {
|
|
266
|
-
const remoteId = threadIdContext.useAthenaThreadId();
|
|
267
|
-
const [timedOut, setTimedOut] = react$1.useState(false);
|
|
268
|
-
react$1.useEffect(() => {
|
|
269
|
-
if (!remoteId) return;
|
|
270
|
-
setTimedOut(false);
|
|
271
|
-
const timer = setTimeout(() => setTimedOut(true), 15e3);
|
|
272
|
-
return () => clearTimeout(timer);
|
|
273
|
-
}, [remoteId]);
|
|
274
|
-
if (!remoteId || timedOut) return null;
|
|
275
|
-
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) });
|
|
276
262
|
};
|
|
277
263
|
const THREAD_VIEWPORT_ATTR = "data-aui-thread-viewport";
|
|
278
264
|
const useScrollToTop = () => {
|
|
@@ -318,63 +304,13 @@ const ThreadScrollToTop = () => {
|
|
|
318
304
|
}
|
|
319
305
|
) });
|
|
320
306
|
};
|
|
321
|
-
const ThreadScrollToBottom = () => /* @__PURE__ */ jsxRuntime.jsx(react.ThreadPrimitive.ScrollToBottom, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
322
|
-
tooltipIconButton.TooltipIconButton,
|
|
323
|
-
{
|
|
324
|
-
tooltip: "Scroll to bottom",
|
|
325
|
-
variant: "outline",
|
|
326
|
-
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",
|
|
327
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ArrowDownIcon, {})
|
|
328
|
-
}
|
|
329
|
-
) });
|
|
330
|
-
const AthenaComposerSendButton = ({
|
|
331
|
-
action,
|
|
332
|
-
onSend,
|
|
333
|
-
disabled,
|
|
334
|
-
title
|
|
335
|
-
}) => {
|
|
336
|
-
const label = action === "queue" ? "Queue message" : "Send message";
|
|
337
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
338
|
-
tooltipIconButton.TooltipIconButton,
|
|
339
|
-
{
|
|
340
|
-
tooltip: title ?? label,
|
|
341
|
-
side: "bottom",
|
|
342
|
-
type: "button",
|
|
343
|
-
variant: "default",
|
|
344
|
-
size: "icon",
|
|
345
|
-
className: "aui-composer-send size-8 rounded-full",
|
|
346
|
-
"aria-label": label,
|
|
347
|
-
onClick: onSend,
|
|
348
|
-
disabled,
|
|
349
|
-
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" })
|
|
350
|
-
}
|
|
351
|
-
);
|
|
352
|
-
};
|
|
353
|
-
const AthenaComposerStopButton = ({ onStop, disabled, title }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
354
|
-
button.Button,
|
|
355
|
-
{
|
|
356
|
-
type: "button",
|
|
357
|
-
variant: "default",
|
|
358
|
-
size: "icon",
|
|
359
|
-
className: "aui-composer-cancel size-8 rounded-full",
|
|
360
|
-
"aria-label": "Stop generating",
|
|
361
|
-
title,
|
|
362
|
-
onClick: onStop,
|
|
363
|
-
disabled,
|
|
364
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.SquareIcon, { className: "aui-composer-cancel-icon size-3 fill-current" })
|
|
365
|
-
}
|
|
366
|
-
);
|
|
367
|
-
const ATHENA_COMPOSER_COMPONENTS = {
|
|
368
|
-
SendButton: AthenaComposerSendButton,
|
|
369
|
-
StopButton: AthenaComposerStopButton
|
|
370
|
-
};
|
|
371
307
|
const ATHENA_CHAT_MENTION_CATEGORIES = [
|
|
372
308
|
"favorites",
|
|
373
309
|
"assets",
|
|
374
310
|
"projects",
|
|
375
311
|
"folders"
|
|
376
312
|
];
|
|
377
|
-
const AthenaChatComposer = ({ tools }) => {
|
|
313
|
+
const AthenaChatComposer = ({ tools, welcomeSuggestionCount }) => {
|
|
378
314
|
const aui = react.useAui();
|
|
379
315
|
const threadId = threadIdContext.useAthenaStatewireThreadId();
|
|
380
316
|
const { appUrl } = AthenaContext.useAthenaConfig();
|
|
@@ -383,6 +319,15 @@ const AthenaChatComposer = ({ tools }) => {
|
|
|
383
319
|
const { attachFiles } = useAttachFiles.useAttachFiles();
|
|
384
320
|
const composerRef = react$1.useRef(null);
|
|
385
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
|
+
);
|
|
386
331
|
const rootCategories = react$1.useMemo(() => {
|
|
387
332
|
const categories = [...ATHENA_CHAT_MENTION_CATEGORIES];
|
|
388
333
|
if (tools.some((tool) => tool.type === "toolkit")) categories.push("toolkits");
|
|
@@ -438,41 +383,62 @@ const AthenaChatComposer = ({ tools }) => {
|
|
|
438
383
|
}),
|
|
439
384
|
[attachFiles]
|
|
440
385
|
);
|
|
441
|
-
return /* @__PURE__ */ jsxRuntime.jsx(ComposerDropZone.ComposerDropZone, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
442
|
-
|
|
386
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ComposerDropZone.ComposerDropZone, { onDragActiveChange: setDragActive, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
387
|
+
"div",
|
|
443
388
|
{
|
|
444
|
-
className: "",
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
/* @__PURE__ */ jsxRuntime.jsx(ComposerQuotePreview.ComposerQuotePreview, {}),
|
|
450
|
-
/* @__PURE__ */ jsxRuntime.jsx(ComposerAttachmentPreview.ComposerAttachmentPreview, {})
|
|
451
|
-
] }),
|
|
452
|
-
editor: /* @__PURE__ */ jsxRuntime.jsx(
|
|
453
|
-
tiptapComposer.TiptapComposer,
|
|
454
|
-
{
|
|
455
|
-
ref: composerRef,
|
|
456
|
-
threadId,
|
|
457
|
-
placeholder: "Send a message...",
|
|
458
|
-
tools,
|
|
459
|
-
rootCategories,
|
|
460
|
-
onDraftStateChange: setHasText,
|
|
461
|
-
waitForHostUploads,
|
|
462
|
-
interceptSubmit,
|
|
463
|
-
fileIntake
|
|
464
|
-
}
|
|
465
|
-
),
|
|
466
|
-
toolbarStart: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-1", children: /* @__PURE__ */ jsxRuntime.jsx(FileUploadButton.FileUploadButton, {}) }),
|
|
467
|
-
toolbarEnd: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-1", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
468
|
-
composerSendOrStop.ComposerSendOrStop,
|
|
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,
|
|
469
394
|
{
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
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 })
|
|
474
440
|
}
|
|
475
|
-
)
|
|
441
|
+
)
|
|
476
442
|
}
|
|
477
443
|
) });
|
|
478
444
|
};
|
|
@@ -489,9 +455,54 @@ const MessageError = () => /* @__PURE__ */ jsxRuntime.jsx(react.MessagePrimitive
|
|
|
489
455
|
}
|
|
490
456
|
) })
|
|
491
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
|
+
};
|
|
492
503
|
const AthenaAssistantMessageEmpty = ({ status }) => {
|
|
493
504
|
if ((status == null ? void 0 : status.type) !== "running") return null;
|
|
494
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
505
|
+
return /* @__PURE__ */ jsxRuntime.jsx(RunStatusLine, { verb: "Thinking", resetKey: "empty", className: "mt-0" });
|
|
495
506
|
};
|
|
496
507
|
const AthenaMessageEmptyIndicator = ({
|
|
497
508
|
EmptyComponent
|
|
@@ -510,27 +521,77 @@ const AthenaMessageActivityIndicator = () => {
|
|
|
510
521
|
return ((_a = s.message.status) == null ? void 0 : _a.type) === "running";
|
|
511
522
|
});
|
|
512
523
|
const activityKey = react.useAuiState((s) => runActivity.runActivityKey(s.message.parts));
|
|
513
|
-
const
|
|
514
|
-
react$1.useEffect(() => {
|
|
515
|
-
setSeconds(0);
|
|
516
|
-
if (!isRunning || activityKey === null) return;
|
|
517
|
-
const startedAt = Date.now();
|
|
518
|
-
const timer = setInterval(() => {
|
|
519
|
-
setSeconds(Math.floor((Date.now() - startedAt) / 1e3));
|
|
520
|
-
}, 1e3);
|
|
521
|
-
return () => clearInterval(timer);
|
|
522
|
-
}, [isRunning, activityKey]);
|
|
524
|
+
const verb = react.useAuiState((s) => runActivity.runActivityVerb(s.message.parts));
|
|
523
525
|
if (!isRunning || activityKey === null) return null;
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
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
|
+
);
|
|
534
595
|
};
|
|
535
596
|
const AthenaReasoningPart = ({
|
|
536
597
|
text,
|
|
@@ -610,11 +671,12 @@ const AthenaReasoningPart = ({
|
|
|
610
671
|
const noToolGrouping = () => null;
|
|
611
672
|
const AthenaAssistantMessage = ({
|
|
612
673
|
toolUIs,
|
|
674
|
+
AvatarComponent,
|
|
613
675
|
TextComponent = tiptapText.TiptapText,
|
|
614
676
|
ReasoningComponent,
|
|
615
677
|
EmptyComponent = AthenaAssistantMessageEmpty,
|
|
616
678
|
ActionBarComponent = AthenaAssistantActionBar,
|
|
617
|
-
groupToolCalls =
|
|
679
|
+
groupToolCalls = true
|
|
618
680
|
}) => {
|
|
619
681
|
const effectiveReasoningComponent = ReasoningComponent ?? AthenaReasoningPart;
|
|
620
682
|
const toolUIsWithNestedMessages = react$1.useMemo(() => {
|
|
@@ -642,48 +704,108 @@ const AthenaAssistantMessage = ({
|
|
|
642
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",
|
|
643
705
|
"data-role": "assistant",
|
|
644
706
|
children: [
|
|
645
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
/* @__PURE__ */ jsxRuntime.jsx(AthenaMessageEmptyIndicator, { EmptyComponent }),
|
|
659
|
-
/* @__PURE__ */ jsxRuntime.jsx(react.MessagePrimitive.GroupedParts, { groupBy: noToolGrouping, children: ({ part }) => {
|
|
660
|
-
var _a;
|
|
661
|
-
switch (part.type) {
|
|
662
|
-
case "tool-call": {
|
|
663
|
-
const ToolUI = toolUIsWithNestedMessages[part.toolName];
|
|
664
|
-
const toolProps = part;
|
|
665
|
-
return ToolUI ? /* @__PURE__ */ jsxRuntime.jsx(ToolUI, { ...toolProps }) : /* @__PURE__ */ jsxRuntime.jsx(toolFallback.ToolFallback, { ...toolProps });
|
|
666
|
-
}
|
|
667
|
-
case "reasoning": {
|
|
668
|
-
const ReasoningRenderer = effectiveReasoningComponent;
|
|
669
|
-
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"
|
|
670
720
|
}
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
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
|
|
675
734
|
}
|
|
676
|
-
|
|
677
|
-
}
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
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
|
+
] })
|
|
772
|
+
] })
|
|
773
|
+
]
|
|
774
|
+
}
|
|
775
|
+
);
|
|
776
|
+
};
|
|
777
|
+
const CopyMessageButton = () => /* @__PURE__ */ jsxRuntime.jsx(react.ActionBarPrimitive.Copy, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(tooltipIconButton.TooltipIconButton, { tooltip: "Copy", children: [
|
|
778
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.AuiIf, { condition: (s) => s.message.isCopied, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CheckIcon, {}) }),
|
|
779
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.AuiIf, { condition: (s) => !s.message.isCopied, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CopyIcon, {}) })
|
|
780
|
+
] }) });
|
|
781
|
+
const RegenerateMessageButton = () => {
|
|
782
|
+
const readOnly = messageActionsConfig.useMessageActionsReadOnly();
|
|
783
|
+
if (readOnly) return null;
|
|
784
|
+
return /* @__PURE__ */ jsxRuntime.jsx(react.ActionBarPrimitive.Reload, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(tooltipIconButton.TooltipIconButton, { tooltip: "Regenerate", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.RefreshCwIcon, {}) }) });
|
|
785
|
+
};
|
|
786
|
+
const EditMessageButton = () => {
|
|
787
|
+
const allowEdit = react.useAuiState((s) => s.thread.capabilities.edit);
|
|
788
|
+
const isRunning = useAthenaRunLive.useAthenaRunLive();
|
|
789
|
+
const readOnly = messageActionsConfig.useMessageActionsReadOnly();
|
|
790
|
+
if (!allowEdit || isRunning || readOnly) return null;
|
|
791
|
+
return /* @__PURE__ */ jsxRuntime.jsx(react.ActionBarPrimitive.Edit, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(tooltipIconButton.TooltipIconButton, { tooltip: "Edit", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.PencilIcon, {}) }) });
|
|
792
|
+
};
|
|
793
|
+
const AthenaUserActionBar = () => {
|
|
794
|
+
const isThreadRunning = react.useAuiState((s) => s.thread.isRunning);
|
|
795
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
796
|
+
react.ActionBarPrimitive.Root,
|
|
797
|
+
{
|
|
798
|
+
autohide: "never",
|
|
799
|
+
className: cnfast.cn(
|
|
800
|
+
"aui-user-action-bar-root flex min-h-6 gap-1 text-muted-foreground",
|
|
801
|
+
isThreadRunning ? "invisible" : [
|
|
802
|
+
messageComponents.ACTION_BAR_REVEAL_CLASS,
|
|
803
|
+
"group-hover/aui-user-message:pointer-events-auto group-hover/aui-user-message:opacity-100"
|
|
804
|
+
]
|
|
805
|
+
),
|
|
806
|
+
children: [
|
|
807
|
+
/* @__PURE__ */ jsxRuntime.jsx(CopyMessageButton, {}),
|
|
808
|
+
/* @__PURE__ */ jsxRuntime.jsx(EditMessageButton, {})
|
|
687
809
|
]
|
|
688
810
|
}
|
|
689
811
|
);
|
|
@@ -707,10 +829,8 @@ const AthenaAssistantActionBar = ({ className }) => {
|
|
|
707
829
|
className
|
|
708
830
|
),
|
|
709
831
|
children: [
|
|
710
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
711
|
-
|
|
712
|
-
/* @__PURE__ */ jsxRuntime.jsx(react.AuiIf, { condition: (s) => !s.message.isCopied, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CopyIcon, {}) })
|
|
713
|
-
] }) }),
|
|
832
|
+
/* @__PURE__ */ jsxRuntime.jsx(CopyMessageButton, {}),
|
|
833
|
+
/* @__PURE__ */ jsxRuntime.jsx(RegenerateMessageButton, {}),
|
|
714
834
|
/* @__PURE__ */ jsxRuntime.jsxs(react.ActionBarMorePrimitive.Root, { children: [
|
|
715
835
|
/* @__PURE__ */ jsxRuntime.jsx(react.ActionBarMorePrimitive.Trigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(tooltipIconButton.TooltipIconButton, { tooltip: "More", className: "data-[state=open]:bg-accent", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MoreHorizontalIcon, {}) }) }),
|
|
716
836
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -747,14 +867,43 @@ const AthenaAssistantActionBar = ({ className }) => {
|
|
|
747
867
|
};
|
|
748
868
|
const AthenaUserMessage = ({
|
|
749
869
|
TextComponent = tiptapText.TiptapText
|
|
750
|
-
}) =>
|
|
751
|
-
react.
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
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
|
+
);
|
|
756
887
|
}
|
|
757
|
-
|
|
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
|
+
};
|
|
758
907
|
exports.AthenaAssistantActionBar = AthenaAssistantActionBar;
|
|
759
908
|
exports.AthenaAssistantMessage = AthenaAssistantMessage;
|
|
760
909
|
exports.AthenaChat = AthenaChat;
|