@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"statewire-history-edge.js","sources":["../../../src/chat-ui/thread/statewire-history-edge.tsx"],"sourcesContent":["import { useAuiState } from \"@assistant-ui/react\";\nimport {\n type DeepAgentHistoryLoadEvent,\n type DeepAgentToolOutputStore,\n isStatewireChannelTeardown,\n useDeepAgentWindowSync,\n} from \"@athenaintel/agent-runtime\";\nimport type { FC } from \"react\";\nimport { useEffect, useLayoutEffect, useRef, useState } from \"react\";\nimport { cn } from \"../../lib/utils\";\nimport { useStatewireToolOutputs } from \"../../provider/statewire-window-context\";\n\n/** The attribute `ChatThreadShell` stamps on the scroll viewport. */\nexport const THREAD_VIEWPORT_ATTR = \"data-aui-thread-viewport\";\n\n/**\n * How far above the viewport the edge row counts as near: the row sits above\n * the first loaded message, so reaching it means the user has scrolled past\n * everything loaded and the next page should already be on its way.\n */\nexport const HISTORY_EDGE_NEAR_MARGIN_PX = 1500;\n\nexport interface HistoryEdgeRowProps {\n /**
|
|
1
|
+
{"version":3,"file":"statewire-history-edge.js","sources":["../../../src/chat-ui/thread/statewire-history-edge.tsx"],"sourcesContent":["import { useAuiState } from \"@assistant-ui/react\";\nimport {\n type DeepAgentHistoryLoadEvent,\n type DeepAgentToolOutputStore,\n isStatewireChannelTeardown,\n useDeepAgentWindowSync,\n} from \"@athenaintel/agent-runtime\";\nimport type { FC } from \"react\";\nimport { useEffect, useLayoutEffect, useRef, useState } from \"react\";\nimport { cn } from \"../../lib/utils\";\nimport { useStatewireToolOutputs } from \"../../provider/statewire-window-context\";\n\n/** The attribute `ChatThreadShell` stamps on the scroll viewport. */\nexport const THREAD_VIEWPORT_ATTR = \"data-aui-thread-viewport\";\n\n/**\n * How far above the viewport the edge row counts as near: the row sits above\n * the first loaded message, so reaching it means the user has scrolled past\n * everything loaded and the next page should already be on its way.\n */\nexport const HISTORY_EDGE_NEAR_MARGIN_PX = 1500;\n\nexport interface HistoryEdgeRowProps {\n /** Whether the server holds messages older than the loaded window. */\n hasOlder: boolean;\n /** Whether the next page can be asked for; `false` with `hasOlder` is the connection's loading depth spent. Defaults to `hasOlder`. */\n canLoadOlder?: boolean;\n /** A page of older history is in flight. */\n loading: boolean;\n onLoadOlder: () => void;\n className?: string;\n /** The row element, for the viewport observer. */\n rowRef?: (element: HTMLElement | null) => void;\n}\n\n/**\n * The top edge of the LOADED history: a manual way to load the next page of\n * older messages, and the in-flight state. Renders nothing when the whole\n * transcript is loaded (or the head interest has not resolved).\n */\nexport const HistoryEdgeRow: FC<HistoryEdgeRowProps> = ({\n hasOlder,\n canLoadOlder = hasOlder,\n loading,\n onLoadOlder,\n className,\n rowRef,\n}) => {\n if (!hasOlder) return null;\n return (\n <div\n ref={rowRef}\n data-testid=\"thread-history-edge\"\n className={cn(\n \"flex w-full max-w-(--thread-max-width) items-center justify-center py-1 text-xs text-muted-foreground\",\n className,\n )}\n >\n {loading ? (\n <span data-testid=\"thread-history-edge-loading\">Loading earlier messages…</span>\n ) : canLoadOlder ? (\n <button\n type=\"button\"\n data-testid=\"thread-history-edge-load\"\n onClick={onLoadOlder}\n className=\"rounded-lg px-2.5 py-1 text-xs font-medium text-muted-foreground transition-colors hover:bg-accent hover:text-foreground\"\n >\n Load earlier messages\n </button>\n ) : (\n <span data-testid=\"thread-history-edge-limit\">Earlier messages can't be loaded here</span>\n )}\n </div>\n );\n};\n\nexport interface StatewireHistoryEdgeProps {\n /**\n * The thread's tool-output store (the one its converter substitutes from).\n * Defaults to `AthenaProvider`'s; hosts mounting the runtime themselves pass\n * the store they gave `useDeepAgentRuntime({ toolOutputs })`.\n */\n toolOutputs?: DeepAgentToolOutputStore;\n className?: string;\n /** A page interest resolved (telemetry). */\n onHistoryLoad?: (event: DeepAgentHistoryLoadEvent) => void;\n}\n\n/**\n * The client half of the interest window for a DOM thread — mounted once per\n * thread, inside the scroll viewport above the messages (`ChatThreadShell`'s\n * `beforeMessages` slot):\n *\n * - renders the \"Load earlier messages\" edge row and loads the next page when\n * the row comes near the viewport (scrolling up) or on its button, keeping\n * the reading position when the page lands above the view;\n * - fetches cut tool outputs whole for the rendered cards, so they re-render\n * complete through the converter (`toolOutputs`).\n *\n * Inert until the head interest resolves: no row, no reads.\n */\nexport const StatewireHistoryEdge: FC<StatewireHistoryEdgeProps> = ({\n toolOutputs: toolOutputsProp,\n className,\n onHistoryLoad,\n}) => {\n const providerToolOutputs = useStatewireToolOutputs();\n const toolOutputs = toolOutputsProp ?? providerToolOutputs ?? undefined;\n const messages = useAuiState((s) => s.thread.messages);\n const [nearTop, setNearTop] = useState(false);\n const [nearTopEpoch, setNearTopEpoch] = useState(0);\n const nearTopRef = useRef(false);\n const [rowEl, setRowEl] = useState<HTMLElement | null>(null);\n const { hasOlder, canLoadOlder, loading, loadOlder } = useDeepAgentWindowSync({\n messages,\n toolOutputs,\n nearTop,\n nearTopEpoch,\n onHistoryLoad,\n onError: (error, command) => {\n // Leaving the thread settles an in-flight read as lost: lifecycle, not a failure.\n if (error instanceof Error && isStatewireChannelTeardown(error)) return;\n console.warn(`[StatewireHistoryEdge] ${command} failed:`, error);\n },\n });\n\n // The row's own visibility is the near-top level: a level, not an edge, so\n // pages chain while the user stays at the top and stop once the prepended\n // content has pushed the row away again.\n useEffect(() => {\n if (!rowEl || !hasOlder || typeof IntersectionObserver === \"undefined\") return;\n const observer = new IntersectionObserver(\n (entries) => {\n for (const entry of entries) {\n const near = entry.isIntersecting;\n if (nearTopRef.current === near) continue;\n nearTopRef.current = near;\n setNearTop(near);\n if (near) setNearTopEpoch((epoch) => epoch + 1);\n }\n },\n {\n root: rowEl.closest<HTMLElement>(`[${THREAD_VIEWPORT_ATTR}]`),\n rootMargin: `${HISTORY_EDGE_NEAR_MARGIN_PX}px 0px`,\n },\n );\n observer.observe(rowEl);\n return () => {\n observer.disconnect();\n nearTopRef.current = false;\n setNearTop(false);\n };\n }, [rowEl, hasOlder]);\n\n // A prepend (older history landing) keeps the reading position: the\n // viewport scrolls by the height the page added above the view, so the\n // message the user was on stays put. The pre-prepend height is measured\n // only while a page is in flight (a layout read per render would force a\n // reflow on every streamed token otherwise).\n const shapeRef = useRef<{ firstId: string | undefined; length: number; scrollHeight: number } | null>(\n null,\n );\n const firstId = messages[0]?.id;\n const length = messages.length;\n useLayoutEffect(() => {\n const viewport = rowEl?.closest<HTMLElement>(`[${THREAD_VIEWPORT_ATTR}]`) ?? null;\n const prev = shapeRef.current;\n const prepended =\n viewport !== null &&\n prev !== null &&\n prev.firstId !== undefined &&\n firstId !== prev.firstId &&\n length > prev.length;\n if (prepended) viewport.scrollTop += viewport.scrollHeight - prev.scrollHeight;\n shapeRef.current =\n loading || prepended || prev === null\n ? { firstId, length, scrollHeight: viewport?.scrollHeight ?? 0 }\n : { firstId, length, scrollHeight: prev.scrollHeight };\n });\n\n return (\n <HistoryEdgeRow\n rowRef={setRowEl}\n hasOlder={hasOlder}\n canLoadOlder={canLoadOlder}\n loading={loading}\n onLoadOlder={loadOlder}\n className={className}\n />\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAaO,MAAM,uBAAuB;AAO7B,MAAM,8BAA8B;AAoBpC,MAAM,iBAA0C,CAAC;AAAA,EACtD;AAAA,EACA,eAAe;AAAA,EACf;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,MAAI,CAAC,SAAU,QAAO;AACtB,SACE;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAK;AAAA,MACL,eAAY;AAAA,MACZ,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MAAA;AAAA,MAGD,oBACC,oBAAC,QAAA,EAAK,eAAY,+BAA8B,UAAA,6BAAyB,IACvE,eACF;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,eAAY;AAAA,UACZ,SAAS;AAAA,UACT,WAAU;AAAA,UACX,UAAA;AAAA,QAAA;AAAA,MAAA,IAID,oBAAC,QAAA,EAAK,eAAY,6BAA4B,UAAA,wCAAA,CAAqC;AAAA,IAAA;AAAA,EAAA;AAI3F;AA2BO,MAAM,uBAAsD,CAAC;AAAA,EAClE,aAAa;AAAA,EACb;AAAA,EACA;AACF,MAAM;;AACJ,QAAM,sBAAsB,wBAAA;AAC5B,QAAM,cAAc,mBAAmB,uBAAuB;AAC9D,QAAM,WAAW,YAAY,CAAC,MAAM,EAAE,OAAO,QAAQ;AACrD,QAAM,CAAC,SAAS,UAAU,IAAI,SAAS,KAAK;AAC5C,QAAM,CAAC,cAAc,eAAe,IAAI,SAAS,CAAC;AAClD,QAAM,aAAa,OAAO,KAAK;AAC/B,QAAM,CAAC,OAAO,QAAQ,IAAI,SAA6B,IAAI;AAC3D,QAAM,EAAE,UAAU,cAAc,SAAS,UAAA,IAAc,uBAAuB;AAAA,IAC5E;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,SAAS,CAAC,OAAO,YAAY;AAE3B,UAAI,iBAAiB,SAAS,2BAA2B,KAAK,EAAG;AACjE,cAAQ,KAAK,0BAA0B,OAAO,YAAY,KAAK;AAAA,IACjE;AAAA,EAAA,CACD;AAKD,YAAU,MAAM;AACd,QAAI,CAAC,SAAS,CAAC,YAAY,OAAO,yBAAyB,YAAa;AACxE,UAAM,WAAW,IAAI;AAAA,MACnB,CAAC,YAAY;AACX,mBAAW,SAAS,SAAS;AAC3B,gBAAM,OAAO,MAAM;AACnB,cAAI,WAAW,YAAY,KAAM;AACjC,qBAAW,UAAU;AACrB,qBAAW,IAAI;AACf,cAAI,KAAM,iBAAgB,CAAC,UAAU,QAAQ,CAAC;AAAA,QAChD;AAAA,MACF;AAAA,MACA;AAAA,QACE,MAAM,MAAM,QAAqB,IAAI,oBAAoB,GAAG;AAAA,QAC5D,YAAY,GAAG,2BAA2B;AAAA,MAAA;AAAA,IAC5C;AAEF,aAAS,QAAQ,KAAK;AACtB,WAAO,MAAM;AACX,eAAS,WAAA;AACT,iBAAW,UAAU;AACrB,iBAAW,KAAK;AAAA,IAClB;AAAA,EACF,GAAG,CAAC,OAAO,QAAQ,CAAC;AAOpB,QAAM,WAAW;AAAA,IACf;AAAA,EAAA;AAEF,QAAM,WAAU,cAAS,CAAC,MAAV,mBAAa;AAC7B,QAAM,SAAS,SAAS;AACxB,kBAAgB,MAAM;AACpB,UAAM,YAAW,+BAAO,QAAqB,IAAI,oBAAoB,SAAQ;AAC7E,UAAM,OAAO,SAAS;AACtB,UAAM,YACJ,aAAa,QACb,SAAS,QACT,KAAK,YAAY,UACjB,YAAY,KAAK,WACjB,SAAS,KAAK;AAChB,QAAI,UAAW,UAAS,aAAa,SAAS,eAAe,KAAK;AAClE,aAAS,UACP,WAAW,aAAa,SAAS,OAC7B,EAAE,SAAS,QAAQ,eAAc,qCAAU,iBAAgB,MAC3D,EAAE,SAAS,QAAQ,cAAc,KAAK,aAAA;AAAA,EAC9C,CAAC;AAED,SACE;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,QAAQ;AAAA,MACR;AAAA,MACA;AAAA,MACA;AAAA,MACA,aAAa;AAAA,MACb;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
+
const react$1 = require("@assistant-ui/react");
|
|
5
|
+
const react = require("react");
|
|
6
|
+
const threadIdContext = require("../../threads/thread-id-context.cjs");
|
|
7
|
+
const THREAD_LOADING_OVERLAY_TIMEOUT_MS = 15e3;
|
|
8
|
+
const ThreadLoadingOverlay = () => {
|
|
9
|
+
const remoteId = threadIdContext.useAthenaThreadId();
|
|
10
|
+
const [timedOut, setTimedOut] = react.useState(false);
|
|
11
|
+
react.useEffect(() => {
|
|
12
|
+
if (!remoteId) return;
|
|
13
|
+
setTimedOut(false);
|
|
14
|
+
const timer = setTimeout(() => setTimedOut(true), THREAD_LOADING_OVERLAY_TIMEOUT_MS);
|
|
15
|
+
return () => clearTimeout(timer);
|
|
16
|
+
}, [remoteId]);
|
|
17
|
+
if (!remoteId || timedOut) return null;
|
|
18
|
+
return /* @__PURE__ */ jsxRuntime.jsx(react$1.AuiIf, { condition: (s) => s.thread.isEmpty, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
19
|
+
"div",
|
|
20
|
+
{
|
|
21
|
+
"data-testid": "thread-loading-overlay",
|
|
22
|
+
role: "status",
|
|
23
|
+
"aria-label": "Loading conversation",
|
|
24
|
+
className: "absolute inset-0 z-10 flex items-center justify-center bg-background/80",
|
|
25
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "size-5 animate-spin rounded-full border-2 border-muted-foreground border-t-transparent" })
|
|
26
|
+
}
|
|
27
|
+
) });
|
|
28
|
+
};
|
|
29
|
+
exports.THREAD_LOADING_OVERLAY_TIMEOUT_MS = THREAD_LOADING_OVERLAY_TIMEOUT_MS;
|
|
30
|
+
exports.ThreadLoadingOverlay = ThreadLoadingOverlay;
|
|
31
|
+
//# sourceMappingURL=thread-loading-overlay.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"thread-loading-overlay.cjs","sources":["../../../src/chat-ui/thread/thread-loading-overlay.tsx"],"sourcesContent":["import { AuiIf } from '@assistant-ui/react';\nimport type { FC } from 'react';\nimport { useEffect, useState } from 'react';\nimport { useAthenaThreadId } from '../../threads/thread-id-context';\n\n/** How long the overlay covers an empty thread with server history before giving up. */\nexport const THREAD_LOADING_OVERLAY_TIMEOUT_MS = 15_000;\n\n/**\n * The scrim `AthenaChat` mounts over the thread panel while a thread that\n * has server history (`useAthenaThreadId()` defined) is still empty — the\n * attach has not delivered its snapshot yet. A never-started chat is empty\n * on purpose and gets no scrim; a switch to a thread the snapshot cache\n * holds (a recently visited or hover-prefetched session) mounts with its\n * messages and never shows it either. Gives up after\n * {@link THREAD_LOADING_OVERLAY_TIMEOUT_MS} so a thread that is genuinely\n * empty on the server does not stay covered.\n */\nexport const ThreadLoadingOverlay: FC = () => {\n const remoteId = useAthenaThreadId();\n const [timedOut, setTimedOut] = useState(false);\n\n useEffect(() => {\n if (!remoteId) return;\n setTimedOut(false);\n const timer = setTimeout(() => setTimedOut(true), THREAD_LOADING_OVERLAY_TIMEOUT_MS);\n return () => clearTimeout(timer);\n }, [remoteId]);\n\n if (!remoteId || timedOut) return null;\n\n return (\n <AuiIf condition={(s) => s.thread.isEmpty}>\n <div\n data-testid=\"thread-loading-overlay\"\n role=\"status\"\n aria-label=\"Loading conversation\"\n className=\"absolute inset-0 z-10 flex items-center justify-center bg-background/80\"\n >\n <div className=\"size-5 animate-spin rounded-full border-2 border-muted-foreground border-t-transparent\" />\n </div>\n </AuiIf>\n );\n};\n"],"names":["useAthenaThreadId","useState","useEffect","AuiIf","jsx"],"mappings":";;;;;;AAMO,MAAM,oCAAoC;AAY1C,MAAM,uBAA2B,MAAM;AAC5C,QAAM,WAAWA,gBAAAA,kBAAA;AACjB,QAAM,CAAC,UAAU,WAAW,IAAIC,MAAAA,SAAS,KAAK;AAE9CC,QAAAA,UAAU,MAAM;AACd,QAAI,CAAC,SAAU;AACf,gBAAY,KAAK;AACjB,UAAM,QAAQ,WAAW,MAAM,YAAY,IAAI,GAAG,iCAAiC;AACnF,WAAO,MAAM,aAAa,KAAK;AAAA,EACjC,GAAG,CAAC,QAAQ,CAAC;AAEb,MAAI,CAAC,YAAY,SAAU,QAAO;AAElC,wCACGC,eAAA,EAAM,WAAW,CAAC,MAAM,EAAE,OAAO,SAChC,UAAAC,2BAAAA;AAAAA,IAAC;AAAA,IAAA;AAAA,MACC,eAAY;AAAA,MACZ,MAAK;AAAA,MACL,cAAW;AAAA,MACX,WAAU;AAAA,MAEV,UAAAA,2BAAAA,IAAC,OAAA,EAAI,WAAU,yFAAA,CAAyF;AAAA,IAAA;AAAA,EAAA,GAE5G;AAEJ;;;"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { FC } from 'react';
|
|
2
|
+
/** How long the overlay covers an empty thread with server history before giving up. */
|
|
3
|
+
export declare const THREAD_LOADING_OVERLAY_TIMEOUT_MS = 15000;
|
|
4
|
+
/**
|
|
5
|
+
* The scrim `AthenaChat` mounts over the thread panel while a thread that
|
|
6
|
+
* has server history (`useAthenaThreadId()` defined) is still empty — the
|
|
7
|
+
* attach has not delivered its snapshot yet. A never-started chat is empty
|
|
8
|
+
* on purpose and gets no scrim; a switch to a thread the snapshot cache
|
|
9
|
+
* holds (a recently visited or hover-prefetched session) mounts with its
|
|
10
|
+
* messages and never shows it either. Gives up after
|
|
11
|
+
* {@link THREAD_LOADING_OVERLAY_TIMEOUT_MS} so a thread that is genuinely
|
|
12
|
+
* empty on the server does not stay covered.
|
|
13
|
+
*/
|
|
14
|
+
export declare const ThreadLoadingOverlay: FC;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { AuiIf } from "@assistant-ui/react";
|
|
3
|
+
import { useState, useEffect } from "react";
|
|
4
|
+
import { useAthenaThreadId } from "../../threads/thread-id-context.js";
|
|
5
|
+
const THREAD_LOADING_OVERLAY_TIMEOUT_MS = 15e3;
|
|
6
|
+
const ThreadLoadingOverlay = () => {
|
|
7
|
+
const remoteId = useAthenaThreadId();
|
|
8
|
+
const [timedOut, setTimedOut] = useState(false);
|
|
9
|
+
useEffect(() => {
|
|
10
|
+
if (!remoteId) return;
|
|
11
|
+
setTimedOut(false);
|
|
12
|
+
const timer = setTimeout(() => setTimedOut(true), THREAD_LOADING_OVERLAY_TIMEOUT_MS);
|
|
13
|
+
return () => clearTimeout(timer);
|
|
14
|
+
}, [remoteId]);
|
|
15
|
+
if (!remoteId || timedOut) return null;
|
|
16
|
+
return /* @__PURE__ */ jsx(AuiIf, { condition: (s) => s.thread.isEmpty, children: /* @__PURE__ */ jsx(
|
|
17
|
+
"div",
|
|
18
|
+
{
|
|
19
|
+
"data-testid": "thread-loading-overlay",
|
|
20
|
+
role: "status",
|
|
21
|
+
"aria-label": "Loading conversation",
|
|
22
|
+
className: "absolute inset-0 z-10 flex items-center justify-center bg-background/80",
|
|
23
|
+
children: /* @__PURE__ */ jsx("div", { className: "size-5 animate-spin rounded-full border-2 border-muted-foreground border-t-transparent" })
|
|
24
|
+
}
|
|
25
|
+
) });
|
|
26
|
+
};
|
|
27
|
+
export {
|
|
28
|
+
THREAD_LOADING_OVERLAY_TIMEOUT_MS,
|
|
29
|
+
ThreadLoadingOverlay
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=thread-loading-overlay.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"thread-loading-overlay.js","sources":["../../../src/chat-ui/thread/thread-loading-overlay.tsx"],"sourcesContent":["import { AuiIf } from '@assistant-ui/react';\nimport type { FC } from 'react';\nimport { useEffect, useState } from 'react';\nimport { useAthenaThreadId } from '../../threads/thread-id-context';\n\n/** How long the overlay covers an empty thread with server history before giving up. */\nexport const THREAD_LOADING_OVERLAY_TIMEOUT_MS = 15_000;\n\n/**\n * The scrim `AthenaChat` mounts over the thread panel while a thread that\n * has server history (`useAthenaThreadId()` defined) is still empty — the\n * attach has not delivered its snapshot yet. A never-started chat is empty\n * on purpose and gets no scrim; a switch to a thread the snapshot cache\n * holds (a recently visited or hover-prefetched session) mounts with its\n * messages and never shows it either. Gives up after\n * {@link THREAD_LOADING_OVERLAY_TIMEOUT_MS} so a thread that is genuinely\n * empty on the server does not stay covered.\n */\nexport const ThreadLoadingOverlay: FC = () => {\n const remoteId = useAthenaThreadId();\n const [timedOut, setTimedOut] = useState(false);\n\n useEffect(() => {\n if (!remoteId) return;\n setTimedOut(false);\n const timer = setTimeout(() => setTimedOut(true), THREAD_LOADING_OVERLAY_TIMEOUT_MS);\n return () => clearTimeout(timer);\n }, [remoteId]);\n\n if (!remoteId || timedOut) return null;\n\n return (\n <AuiIf condition={(s) => s.thread.isEmpty}>\n <div\n data-testid=\"thread-loading-overlay\"\n role=\"status\"\n aria-label=\"Loading conversation\"\n className=\"absolute inset-0 z-10 flex items-center justify-center bg-background/80\"\n >\n <div className=\"size-5 animate-spin rounded-full border-2 border-muted-foreground border-t-transparent\" />\n </div>\n </AuiIf>\n );\n};\n"],"names":[],"mappings":";;;;AAMO,MAAM,oCAAoC;AAY1C,MAAM,uBAA2B,MAAM;AAC5C,QAAM,WAAW,kBAAA;AACjB,QAAM,CAAC,UAAU,WAAW,IAAI,SAAS,KAAK;AAE9C,YAAU,MAAM;AACd,QAAI,CAAC,SAAU;AACf,gBAAY,KAAK;AACjB,UAAM,QAAQ,WAAW,MAAM,YAAY,IAAI,GAAG,iCAAiC;AACnF,WAAO,MAAM,aAAa,KAAK;AAAA,EACjC,GAAG,CAAC,QAAQ,CAAC;AAEb,MAAI,CAAC,YAAY,SAAU,QAAO;AAElC,6BACG,OAAA,EAAM,WAAW,CAAC,MAAM,EAAE,OAAO,SAChC,UAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,eAAY;AAAA,MACZ,MAAK;AAAA,MACL,cAAW;AAAA,MACX,WAAU;AAAA,MAEV,UAAA,oBAAC,OAAA,EAAI,WAAU,yFAAA,CAAyF;AAAA,IAAA;AAAA,EAAA,GAE5G;AAEJ;"}
|
|
@@ -8,11 +8,18 @@ const cnfast = require("cnfast");
|
|
|
8
8
|
const ComposerDropZone = ({
|
|
9
9
|
children,
|
|
10
10
|
className,
|
|
11
|
-
onUpload
|
|
11
|
+
onUpload,
|
|
12
|
+
onDragActiveChange
|
|
12
13
|
}) => {
|
|
13
14
|
const [isDragOver, setIsDragOver] = react.useState(false);
|
|
14
15
|
const { attachFiles } = useAttachFiles.useAttachFiles();
|
|
15
16
|
const { isUploading } = AttachmentContext.useAttachments();
|
|
17
|
+
const onDragActiveChangeRef = react.useRef(onDragActiveChange);
|
|
18
|
+
onDragActiveChangeRef.current = onDragActiveChange;
|
|
19
|
+
react.useEffect(() => {
|
|
20
|
+
var _a;
|
|
21
|
+
(_a = onDragActiveChangeRef.current) == null ? void 0 : _a.call(onDragActiveChangeRef, isDragOver);
|
|
22
|
+
}, [isDragOver]);
|
|
16
23
|
const handleDragOver = react.useCallback((e) => {
|
|
17
24
|
e.preventDefault();
|
|
18
25
|
e.stopPropagation();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ComposerDropZone.cjs","sources":["../../src/composer/ComposerDropZone.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"ComposerDropZone.cjs","sources":["../../src/composer/ComposerDropZone.tsx"],"sourcesContent":["import {\n useCallback,\n useEffect,\n useRef,\n useState,\n type DragEvent,\n type FC,\n type ReactNode,\n} from 'react';\nimport { useAttachments } from './AttachmentContext';\nimport { useAttachFiles } from './useAttachFiles';\nimport type { UploadedAsset } from './useFileUpload';\nimport { cn } from '../lib/utils';\n\nexport interface ComposerDropZoneProps {\n children: ReactNode;\n className?: string;\n /** Called after files are uploaded via drag-and-drop. */\n onUpload?: (assets: UploadedAsset[]) => void;\n /**\n * Reports whether files are being dragged over the zone, so the composer\n * surface inside can tint itself (`ChatComposerDock dragActive`). Called\n * with `false` on mount and again on every change.\n */\n onDragActiveChange?: (active: boolean) => void;\n}\n\n/**\n * Wraps the composer area with drag-and-drop file upload support.\n * Shows a visual drop indicator when files are dragged over.\n */\nexport const ComposerDropZone: FC<ComposerDropZoneProps> = ({\n children,\n className,\n onUpload,\n onDragActiveChange,\n}) => {\n const [isDragOver, setIsDragOver] = useState(false);\n const { attachFiles } = useAttachFiles();\n const { isUploading } = useAttachments();\n\n const onDragActiveChangeRef = useRef(onDragActiveChange);\n onDragActiveChangeRef.current = onDragActiveChange;\n useEffect(() => {\n onDragActiveChangeRef.current?.(isDragOver);\n }, [isDragOver]);\n\n const handleDragOver = useCallback((e: DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n if (e.dataTransfer.types.includes('Files')) {\n setIsDragOver(true);\n }\n }, []);\n\n const handleDragLeave = useCallback((e: DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n const rect = (e.currentTarget as HTMLElement).getBoundingClientRect();\n const { clientX, clientY } = e;\n if (\n clientX < rect.left ||\n clientX > rect.right ||\n clientY < rect.top ||\n clientY > rect.bottom\n ) {\n setIsDragOver(false);\n }\n }, []);\n\n const handleDrop = useCallback(\n async (e: DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n setIsDragOver(false);\n\n const files = Array.from(e.dataTransfer.files);\n if (files.length === 0) return;\n\n const assets = await attachFiles(files, 'drop');\n if (assets.length > 0) {\n onUpload?.(assets);\n }\n },\n [attachFiles, onUpload],\n );\n\n return (\n <div\n className={cn('relative', className)}\n onDragOver={handleDragOver}\n onDragLeave={handleDragLeave}\n onDrop={handleDrop}\n >\n {children}\n {isDragOver && !isUploading && (\n <div className=\"aui-drop-overlay pointer-events-none absolute inset-0 z-20 flex items-center justify-center rounded-2xl border-2 border-dashed border-primary/50 bg-primary/5\">\n <span className=\"text-sm font-medium text-primary\">Drop files to upload</span>\n </div>\n )}\n </div>\n );\n};\n"],"names":["useState","useAttachFiles","useAttachments","useRef","useEffect","useCallback","jsxs","cn","jsx"],"mappings":";;;;;;;AA+BO,MAAM,mBAA8C,CAAC;AAAA,EAC1D;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,QAAM,CAAC,YAAY,aAAa,IAAIA,MAAAA,SAAS,KAAK;AAClD,QAAM,EAAE,YAAA,IAAgBC,8BAAA;AACxB,QAAM,EAAE,YAAA,IAAgBC,iCAAA;AAExB,QAAM,wBAAwBC,MAAAA,OAAO,kBAAkB;AACvD,wBAAsB,UAAU;AAChCC,QAAAA,UAAU,MAAM;;AACd,gCAAsB,YAAtB,+CAAgC;AAAA,EAClC,GAAG,CAAC,UAAU,CAAC;AAEf,QAAM,iBAAiBC,kBAAY,CAAC,MAAiB;AACnD,MAAE,eAAA;AACF,MAAE,gBAAA;AACF,QAAI,EAAE,aAAa,MAAM,SAAS,OAAO,GAAG;AAC1C,oBAAc,IAAI;AAAA,IACpB;AAAA,EACF,GAAG,CAAA,CAAE;AAEL,QAAM,kBAAkBA,kBAAY,CAAC,MAAiB;AACpD,MAAE,eAAA;AACF,MAAE,gBAAA;AACF,UAAM,OAAQ,EAAE,cAA8B,sBAAA;AAC9C,UAAM,EAAE,SAAS,QAAA,IAAY;AAC7B,QACE,UAAU,KAAK,QACf,UAAU,KAAK,SACf,UAAU,KAAK,OACf,UAAU,KAAK,QACf;AACA,oBAAc,KAAK;AAAA,IACrB;AAAA,EACF,GAAG,CAAA,CAAE;AAEL,QAAM,aAAaA,MAAAA;AAAAA,IACjB,OAAO,MAAiB;AACtB,QAAE,eAAA;AACF,QAAE,gBAAA;AACF,oBAAc,KAAK;AAEnB,YAAM,QAAQ,MAAM,KAAK,EAAE,aAAa,KAAK;AAC7C,UAAI,MAAM,WAAW,EAAG;AAExB,YAAM,SAAS,MAAM,YAAY,OAAO,MAAM;AAC9C,UAAI,OAAO,SAAS,GAAG;AACrB,6CAAW;AAAA,MACb;AAAA,IACF;AAAA,IACA,CAAC,aAAa,QAAQ;AAAA,EAAA;AAGxB,SACEC,2BAAAA;AAAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC,OAAAA,GAAG,YAAY,SAAS;AAAA,MACnC,YAAY;AAAA,MACZ,aAAa;AAAA,MACb,QAAQ;AAAA,MAEP,UAAA;AAAA,QAAA;AAAA,QACA,cAAc,CAAC,eACdC,2BAAAA,IAAC,OAAA,EAAI,WAAU,iKACb,UAAAA,2BAAAA,IAAC,QAAA,EAAK,WAAU,oCAAmC,UAAA,uBAAA,CAAoB,EAAA,CACzE;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAIR;;"}
|
|
@@ -5,6 +5,12 @@ export interface ComposerDropZoneProps {
|
|
|
5
5
|
className?: string;
|
|
6
6
|
/** Called after files are uploaded via drag-and-drop. */
|
|
7
7
|
onUpload?: (assets: UploadedAsset[]) => void;
|
|
8
|
+
/**
|
|
9
|
+
* Reports whether files are being dragged over the zone, so the composer
|
|
10
|
+
* surface inside can tint itself (`ChatComposerDock dragActive`). Called
|
|
11
|
+
* with `false` on mount and again on every change.
|
|
12
|
+
*/
|
|
13
|
+
onDragActiveChange?: (active: boolean) => void;
|
|
8
14
|
}
|
|
9
15
|
/**
|
|
10
16
|
* Wraps the composer area with drag-and-drop file upload support.
|
|
@@ -1,16 +1,23 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useState, useCallback } from "react";
|
|
2
|
+
import { useState, useRef, useEffect, useCallback } from "react";
|
|
3
3
|
import { useAttachments } from "./AttachmentContext.js";
|
|
4
4
|
import { useAttachFiles } from "./useAttachFiles.js";
|
|
5
5
|
import { cn } from "cnfast";
|
|
6
6
|
const ComposerDropZone = ({
|
|
7
7
|
children,
|
|
8
8
|
className,
|
|
9
|
-
onUpload
|
|
9
|
+
onUpload,
|
|
10
|
+
onDragActiveChange
|
|
10
11
|
}) => {
|
|
11
12
|
const [isDragOver, setIsDragOver] = useState(false);
|
|
12
13
|
const { attachFiles } = useAttachFiles();
|
|
13
14
|
const { isUploading } = useAttachments();
|
|
15
|
+
const onDragActiveChangeRef = useRef(onDragActiveChange);
|
|
16
|
+
onDragActiveChangeRef.current = onDragActiveChange;
|
|
17
|
+
useEffect(() => {
|
|
18
|
+
var _a;
|
|
19
|
+
(_a = onDragActiveChangeRef.current) == null ? void 0 : _a.call(onDragActiveChangeRef, isDragOver);
|
|
20
|
+
}, [isDragOver]);
|
|
14
21
|
const handleDragOver = useCallback((e) => {
|
|
15
22
|
e.preventDefault();
|
|
16
23
|
e.stopPropagation();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ComposerDropZone.js","sources":["../../src/composer/ComposerDropZone.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"ComposerDropZone.js","sources":["../../src/composer/ComposerDropZone.tsx"],"sourcesContent":["import {\n useCallback,\n useEffect,\n useRef,\n useState,\n type DragEvent,\n type FC,\n type ReactNode,\n} from 'react';\nimport { useAttachments } from './AttachmentContext';\nimport { useAttachFiles } from './useAttachFiles';\nimport type { UploadedAsset } from './useFileUpload';\nimport { cn } from '../lib/utils';\n\nexport interface ComposerDropZoneProps {\n children: ReactNode;\n className?: string;\n /** Called after files are uploaded via drag-and-drop. */\n onUpload?: (assets: UploadedAsset[]) => void;\n /**\n * Reports whether files are being dragged over the zone, so the composer\n * surface inside can tint itself (`ChatComposerDock dragActive`). Called\n * with `false` on mount and again on every change.\n */\n onDragActiveChange?: (active: boolean) => void;\n}\n\n/**\n * Wraps the composer area with drag-and-drop file upload support.\n * Shows a visual drop indicator when files are dragged over.\n */\nexport const ComposerDropZone: FC<ComposerDropZoneProps> = ({\n children,\n className,\n onUpload,\n onDragActiveChange,\n}) => {\n const [isDragOver, setIsDragOver] = useState(false);\n const { attachFiles } = useAttachFiles();\n const { isUploading } = useAttachments();\n\n const onDragActiveChangeRef = useRef(onDragActiveChange);\n onDragActiveChangeRef.current = onDragActiveChange;\n useEffect(() => {\n onDragActiveChangeRef.current?.(isDragOver);\n }, [isDragOver]);\n\n const handleDragOver = useCallback((e: DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n if (e.dataTransfer.types.includes('Files')) {\n setIsDragOver(true);\n }\n }, []);\n\n const handleDragLeave = useCallback((e: DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n const rect = (e.currentTarget as HTMLElement).getBoundingClientRect();\n const { clientX, clientY } = e;\n if (\n clientX < rect.left ||\n clientX > rect.right ||\n clientY < rect.top ||\n clientY > rect.bottom\n ) {\n setIsDragOver(false);\n }\n }, []);\n\n const handleDrop = useCallback(\n async (e: DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n setIsDragOver(false);\n\n const files = Array.from(e.dataTransfer.files);\n if (files.length === 0) return;\n\n const assets = await attachFiles(files, 'drop');\n if (assets.length > 0) {\n onUpload?.(assets);\n }\n },\n [attachFiles, onUpload],\n );\n\n return (\n <div\n className={cn('relative', className)}\n onDragOver={handleDragOver}\n onDragLeave={handleDragLeave}\n onDrop={handleDrop}\n >\n {children}\n {isDragOver && !isUploading && (\n <div className=\"aui-drop-overlay pointer-events-none absolute inset-0 z-20 flex items-center justify-center rounded-2xl border-2 border-dashed border-primary/50 bg-primary/5\">\n <span className=\"text-sm font-medium text-primary\">Drop files to upload</span>\n </div>\n )}\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;AA+BO,MAAM,mBAA8C,CAAC;AAAA,EAC1D;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,QAAM,CAAC,YAAY,aAAa,IAAI,SAAS,KAAK;AAClD,QAAM,EAAE,YAAA,IAAgB,eAAA;AACxB,QAAM,EAAE,YAAA,IAAgB,eAAA;AAExB,QAAM,wBAAwB,OAAO,kBAAkB;AACvD,wBAAsB,UAAU;AAChC,YAAU,MAAM;;AACd,gCAAsB,YAAtB,+CAAgC;AAAA,EAClC,GAAG,CAAC,UAAU,CAAC;AAEf,QAAM,iBAAiB,YAAY,CAAC,MAAiB;AACnD,MAAE,eAAA;AACF,MAAE,gBAAA;AACF,QAAI,EAAE,aAAa,MAAM,SAAS,OAAO,GAAG;AAC1C,oBAAc,IAAI;AAAA,IACpB;AAAA,EACF,GAAG,CAAA,CAAE;AAEL,QAAM,kBAAkB,YAAY,CAAC,MAAiB;AACpD,MAAE,eAAA;AACF,MAAE,gBAAA;AACF,UAAM,OAAQ,EAAE,cAA8B,sBAAA;AAC9C,UAAM,EAAE,SAAS,QAAA,IAAY;AAC7B,QACE,UAAU,KAAK,QACf,UAAU,KAAK,SACf,UAAU,KAAK,OACf,UAAU,KAAK,QACf;AACA,oBAAc,KAAK;AAAA,IACrB;AAAA,EACF,GAAG,CAAA,CAAE;AAEL,QAAM,aAAa;AAAA,IACjB,OAAO,MAAiB;AACtB,QAAE,eAAA;AACF,QAAE,gBAAA;AACF,oBAAc,KAAK;AAEnB,YAAM,QAAQ,MAAM,KAAK,EAAE,aAAa,KAAK;AAC7C,UAAI,MAAM,WAAW,EAAG;AAExB,YAAM,SAAS,MAAM,YAAY,OAAO,MAAM;AAC9C,UAAI,OAAO,SAAS,GAAG;AACrB,6CAAW;AAAA,MACb;AAAA,IACF;AAAA,IACA,CAAC,aAAa,QAAQ;AAAA,EAAA;AAGxB,SACE;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAW,GAAG,YAAY,SAAS;AAAA,MACnC,YAAY;AAAA,MACZ,aAAa;AAAA,MACb,QAAQ;AAAA,MAEP,UAAA;AAAA,QAAA;AAAA,QACA,cAAc,CAAC,eACd,oBAAC,OAAA,EAAI,WAAU,iKACb,UAAA,oBAAC,QAAA,EAAK,WAAU,oCAAmC,UAAA,uBAAA,CAAoB,EAAA,CACzE;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAIR;"}
|
|
@@ -18,6 +18,24 @@ const ATHENA_SDK_ERROR_CODES = {
|
|
|
18
18
|
threads_list_failed: "threads_list_failed",
|
|
19
19
|
/** Loading a thread's history failed. */
|
|
20
20
|
thread_load_failed: "thread_load_failed",
|
|
21
|
+
/**
|
|
22
|
+
* Pinning / unpinning a thread failed. `status` 404 / 405 means the backend
|
|
23
|
+
* predates `POST /api/conversations/threads/favorite` (see
|
|
24
|
+
* `isThreadFavoriteUnavailableError`); the pin then stays read-only.
|
|
25
|
+
*/
|
|
26
|
+
thread_favorite_failed: "thread_favorite_failed",
|
|
27
|
+
/**
|
|
28
|
+
* Renaming a thread failed. `status` 404 / 405 means the backend predates
|
|
29
|
+
* `POST /api/conversations/threads/rename` (see
|
|
30
|
+
* `isThreadRenameUnavailableError`); the list then offers no rename.
|
|
31
|
+
*/
|
|
32
|
+
thread_rename_failed: "thread_rename_failed",
|
|
33
|
+
/**
|
|
34
|
+
* Archiving a thread failed. `status` 404 / 405 means the backend has no
|
|
35
|
+
* archive route (see `isThreadArchiveUnavailableError`); the list then
|
|
36
|
+
* offers no archive action.
|
|
37
|
+
*/
|
|
38
|
+
thread_archive_failed: "thread_archive_failed",
|
|
21
39
|
/** The statewire host rejected a command (structured `{status, detail}`). */
|
|
22
40
|
statewire_rejected: "statewire_rejected",
|
|
23
41
|
/** The statewire connection is gone and will not reconnect on its own. */
|
|
@@ -30,6 +48,8 @@ const ATHENA_SDK_ERROR_CODES = {
|
|
|
30
48
|
attachment_failed: "attachment_failed",
|
|
31
49
|
/** Mention suggestions for a scope failed after every retry. */
|
|
32
50
|
mentions_fetch_failed: "mentions_fetch_failed",
|
|
51
|
+
/** The repository code search request (`/api/search/repositories`) failed. */
|
|
52
|
+
repo_search_failed: "repo_search_failed",
|
|
33
53
|
/** Anything else. */
|
|
34
54
|
unknown: "unknown"
|
|
35
55
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.cjs","sources":["../../src/diagnostics/errors.ts"],"sourcesContent":["/**\n * Typed SDK errors. Every failure the SDK surfaces to a consumer carries a\n * stable `code` (matchable in code), a human `message`, and a `hint` — the\n * one-line \"what to do about it\" that turns a silent failure into a debuggable\n * one. Backend rejections keep their structured `{ status, detail }` payload.\n */\n\nexport const ATHENA_SDK_ERROR_CODES = {\n /** No token and no API key resolved before a request had to be sent. */\n auth_missing: 'auth_missing',\n /** The server refused the credential (401 / statewire `unauthorized` fin). */\n auth_rejected: 'auth_rejected',\n /** `/_athena/auth` or the iframe bridge did not answer within the timeout. */\n auth_bridge_timeout: 'auth_bridge_timeout',\n /** `/_athena/auth` answered with a non-404 error. */\n auth_bridge_failed: 'auth_bridge_failed',\n /** The statewire sync URL could not be derived from the configuration. */\n config_invalid: 'config_invalid',\n /** The thread list request failed. */\n threads_list_failed: 'threads_list_failed',\n /** Loading a thread's history failed. */\n thread_load_failed: 'thread_load_failed',\n /** The statewire host rejected a command (structured `{status, detail}`). */\n statewire_rejected: 'statewire_rejected',\n /** The statewire connection is gone and will not reconnect on its own. */\n statewire_gone: 'statewire_gone',\n /** The selected collab agent / channel was refused by the backend. */\n collab_agent_rejected: 'collab_agent_rejected',\n /** A React render error crashed the chat surface (caught by the SDK's error boundary). */\n chat_render_crash: 'chat_render_crash',\n /** A pasted or dropped file could not be uploaded as a composer attachment. */\n attachment_failed: 'attachment_failed',\n /** Mention suggestions for a scope failed after every retry. */\n mentions_fetch_failed: 'mentions_fetch_failed',\n /** Anything else. */\n unknown: 'unknown',\n} as const;\n\nexport type AthenaSdkErrorCode =\n (typeof ATHENA_SDK_ERROR_CODES)[keyof typeof ATHENA_SDK_ERROR_CODES];\n\nexport interface AthenaSdkErrorOptions {\n code: AthenaSdkErrorCode;\n message: string;\n /** One line telling the integrator what to check or change. */\n hint?: string;\n /** HTTP-ish status when the failure came from a server. */\n status?: number;\n /** Structured server detail (e.g. `{ code, message }` from agora). */\n detail?: unknown;\n cause?: unknown;\n /** Extra structured context safe to log (never credentials). */\n context?: Record<string, unknown>;\n}\n\nexport class AthenaSdkError extends Error {\n readonly code: AthenaSdkErrorCode;\n readonly hint: string | undefined;\n readonly status: number | undefined;\n readonly detail: unknown;\n readonly context: Record<string, unknown>;\n\n constructor(options: AthenaSdkErrorOptions) {\n super(options.message, options.cause === undefined ? undefined : { cause: options.cause });\n this.name = 'AthenaSdkError';\n this.code = options.code;\n this.hint = options.hint;\n this.status = options.status;\n this.detail = options.detail;\n this.context = options.context ?? {};\n }\n\n /** A log/console-friendly one-liner: `[code] message — hint`. */\n describe(): string {\n return `[${this.code}] ${this.message}${this.hint ? ` — ${this.hint}` : ''}`;\n }\n\n toJSON(): Record<string, unknown> {\n return {\n name: this.name,\n code: this.code,\n message: this.message,\n hint: this.hint,\n status: this.status,\n detail: this.detail,\n context: this.context,\n };\n }\n}\n\nexport function isAthenaSdkError(value: unknown): value is AthenaSdkError {\n return value instanceof AthenaSdkError;\n}\n\n/** Wrap any thrown value as an `AthenaSdkError` (idempotent for SDK errors). */\nexport function toAthenaSdkError(\n value: unknown,\n fallback: Omit<AthenaSdkErrorOptions, 'cause'>,\n): AthenaSdkError {\n if (isAthenaSdkError(value)) return value;\n const message =\n value instanceof Error && value.message ? value.message : fallback.message;\n return new AthenaSdkError({ ...fallback, message, cause: value });\n}\n\n/** Structured `{ code, message }` detail from an agora rejection, if present. */\nexport function readRejectionDetail(\n detail: unknown,\n): { code: string | null; message: string | null } {\n if (typeof detail === 'string') return { code: null, message: detail || null };\n if (!detail || typeof detail !== 'object') return { code: null, message: null };\n const record = detail as { code?: unknown; message?: unknown };\n return {\n code: typeof record.code === 'string' ? record.code : null,\n message: typeof record.message === 'string' ? record.message : null,\n };\n}\n"],"names":[],"mappings":";;;;;AAOO,MAAM,yBAAyB;AAAA;AAAA,EAEpC,cAAc;AAAA;AAAA,EAEd,eAAe;AAAA;AAAA,EAEf,qBAAqB;AAAA;AAAA,EAErB,oBAAoB;AAAA;AAAA,EAEpB,gBAAgB;AAAA;AAAA,EAEhB,qBAAqB;AAAA;AAAA,EAErB,oBAAoB;AAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"errors.cjs","sources":["../../src/diagnostics/errors.ts"],"sourcesContent":["/**\n * Typed SDK errors. Every failure the SDK surfaces to a consumer carries a\n * stable `code` (matchable in code), a human `message`, and a `hint` — the\n * one-line \"what to do about it\" that turns a silent failure into a debuggable\n * one. Backend rejections keep their structured `{ status, detail }` payload.\n */\n\nexport const ATHENA_SDK_ERROR_CODES = {\n /** No token and no API key resolved before a request had to be sent. */\n auth_missing: 'auth_missing',\n /** The server refused the credential (401 / statewire `unauthorized` fin). */\n auth_rejected: 'auth_rejected',\n /** `/_athena/auth` or the iframe bridge did not answer within the timeout. */\n auth_bridge_timeout: 'auth_bridge_timeout',\n /** `/_athena/auth` answered with a non-404 error. */\n auth_bridge_failed: 'auth_bridge_failed',\n /** The statewire sync URL could not be derived from the configuration. */\n config_invalid: 'config_invalid',\n /** The thread list request failed. */\n threads_list_failed: 'threads_list_failed',\n /** Loading a thread's history failed. */\n thread_load_failed: 'thread_load_failed',\n /**\n * Pinning / unpinning a thread failed. `status` 404 / 405 means the backend\n * predates `POST /api/conversations/threads/favorite` (see\n * `isThreadFavoriteUnavailableError`); the pin then stays read-only.\n */\n thread_favorite_failed: 'thread_favorite_failed',\n /**\n * Renaming a thread failed. `status` 404 / 405 means the backend predates\n * `POST /api/conversations/threads/rename` (see\n * `isThreadRenameUnavailableError`); the list then offers no rename.\n */\n thread_rename_failed: 'thread_rename_failed',\n /**\n * Archiving a thread failed. `status` 404 / 405 means the backend has no\n * archive route (see `isThreadArchiveUnavailableError`); the list then\n * offers no archive action.\n */\n thread_archive_failed: 'thread_archive_failed',\n /** The statewire host rejected a command (structured `{status, detail}`). */\n statewire_rejected: 'statewire_rejected',\n /** The statewire connection is gone and will not reconnect on its own. */\n statewire_gone: 'statewire_gone',\n /** The selected collab agent / channel was refused by the backend. */\n collab_agent_rejected: 'collab_agent_rejected',\n /** A React render error crashed the chat surface (caught by the SDK's error boundary). */\n chat_render_crash: 'chat_render_crash',\n /** A pasted or dropped file could not be uploaded as a composer attachment. */\n attachment_failed: 'attachment_failed',\n /** Mention suggestions for a scope failed after every retry. */\n mentions_fetch_failed: 'mentions_fetch_failed',\n /** The repository code search request (`/api/search/repositories`) failed. */\n repo_search_failed: 'repo_search_failed',\n /** Anything else. */\n unknown: 'unknown',\n} as const;\n\nexport type AthenaSdkErrorCode =\n (typeof ATHENA_SDK_ERROR_CODES)[keyof typeof ATHENA_SDK_ERROR_CODES];\n\nexport interface AthenaSdkErrorOptions {\n code: AthenaSdkErrorCode;\n message: string;\n /** One line telling the integrator what to check or change. */\n hint?: string;\n /** HTTP-ish status when the failure came from a server. */\n status?: number;\n /** Structured server detail (e.g. `{ code, message }` from agora). */\n detail?: unknown;\n cause?: unknown;\n /** Extra structured context safe to log (never credentials). */\n context?: Record<string, unknown>;\n}\n\nexport class AthenaSdkError extends Error {\n readonly code: AthenaSdkErrorCode;\n readonly hint: string | undefined;\n readonly status: number | undefined;\n readonly detail: unknown;\n readonly context: Record<string, unknown>;\n\n constructor(options: AthenaSdkErrorOptions) {\n super(options.message, options.cause === undefined ? undefined : { cause: options.cause });\n this.name = 'AthenaSdkError';\n this.code = options.code;\n this.hint = options.hint;\n this.status = options.status;\n this.detail = options.detail;\n this.context = options.context ?? {};\n }\n\n /** A log/console-friendly one-liner: `[code] message — hint`. */\n describe(): string {\n return `[${this.code}] ${this.message}${this.hint ? ` — ${this.hint}` : ''}`;\n }\n\n toJSON(): Record<string, unknown> {\n return {\n name: this.name,\n code: this.code,\n message: this.message,\n hint: this.hint,\n status: this.status,\n detail: this.detail,\n context: this.context,\n };\n }\n}\n\nexport function isAthenaSdkError(value: unknown): value is AthenaSdkError {\n return value instanceof AthenaSdkError;\n}\n\n/** Wrap any thrown value as an `AthenaSdkError` (idempotent for SDK errors). */\nexport function toAthenaSdkError(\n value: unknown,\n fallback: Omit<AthenaSdkErrorOptions, 'cause'>,\n): AthenaSdkError {\n if (isAthenaSdkError(value)) return value;\n const message =\n value instanceof Error && value.message ? value.message : fallback.message;\n return new AthenaSdkError({ ...fallback, message, cause: value });\n}\n\n/** Structured `{ code, message }` detail from an agora rejection, if present. */\nexport function readRejectionDetail(\n detail: unknown,\n): { code: string | null; message: string | null } {\n if (typeof detail === 'string') return { code: null, message: detail || null };\n if (!detail || typeof detail !== 'object') return { code: null, message: null };\n const record = detail as { code?: unknown; message?: unknown };\n return {\n code: typeof record.code === 'string' ? record.code : null,\n message: typeof record.message === 'string' ? record.message : null,\n };\n}\n"],"names":[],"mappings":";;;;;AAOO,MAAM,yBAAyB;AAAA;AAAA,EAEpC,cAAc;AAAA;AAAA,EAEd,eAAe;AAAA;AAAA,EAEf,qBAAqB;AAAA;AAAA,EAErB,oBAAoB;AAAA;AAAA,EAEpB,gBAAgB;AAAA;AAAA,EAEhB,qBAAqB;AAAA;AAAA,EAErB,oBAAoB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMpB,wBAAwB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMxB,sBAAsB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMtB,uBAAuB;AAAA;AAAA,EAEvB,oBAAoB;AAAA;AAAA,EAEpB,gBAAgB;AAAA;AAAA,EAEhB,uBAAuB;AAAA;AAAA,EAEvB,mBAAmB;AAAA;AAAA,EAEnB,mBAAmB;AAAA;AAAA,EAEnB,uBAAuB;AAAA;AAAA,EAEvB,oBAAoB;AAAA;AAAA,EAEpB,SAAS;AACX;AAmBO,MAAM,uBAAuB,MAAM;AAAA,EAOxC,YAAY,SAAgC;AAC1C,UAAM,QAAQ,SAAS,QAAQ,UAAU,SAAY,SAAY,EAAE,OAAO,QAAQ,MAAA,CAAO;AAPlF;AACA;AACA;AACA;AACA;AAIP,SAAK,OAAO;AACZ,SAAK,OAAO,QAAQ;AACpB,SAAK,OAAO,QAAQ;AACpB,SAAK,SAAS,QAAQ;AACtB,SAAK,SAAS,QAAQ;AACtB,SAAK,UAAU,QAAQ,WAAW,CAAA;AAAA,EACpC;AAAA;AAAA,EAGA,WAAmB;AACjB,WAAO,IAAI,KAAK,IAAI,KAAK,KAAK,OAAO,GAAG,KAAK,OAAO,MAAM,KAAK,IAAI,KAAK,EAAE;AAAA,EAC5E;AAAA,EAEA,SAAkC;AAChC,WAAO;AAAA,MACL,MAAM,KAAK;AAAA,MACX,MAAM,KAAK;AAAA,MACX,SAAS,KAAK;AAAA,MACd,MAAM,KAAK;AAAA,MACX,QAAQ,KAAK;AAAA,MACb,QAAQ,KAAK;AAAA,MACb,SAAS,KAAK;AAAA,IAAA;AAAA,EAElB;AACF;AAEO,SAAS,iBAAiB,OAAyC;AACxE,SAAO,iBAAiB;AAC1B;AAGO,SAAS,iBACd,OACA,UACgB;AAChB,MAAI,iBAAiB,KAAK,EAAG,QAAO;AACpC,QAAM,UACJ,iBAAiB,SAAS,MAAM,UAAU,MAAM,UAAU,SAAS;AACrE,SAAO,IAAI,eAAe,EAAE,GAAG,UAAU,SAAS,OAAO,OAAO;AAClE;AAGO,SAAS,oBACd,QACiD;AACjD,MAAI,OAAO,WAAW,SAAU,QAAO,EAAE,MAAM,MAAM,SAAS,UAAU,KAAA;AACxE,MAAI,CAAC,UAAU,OAAO,WAAW,iBAAiB,EAAE,MAAM,MAAM,SAAS,KAAA;AACzE,QAAM,SAAS;AACf,SAAO;AAAA,IACL,MAAM,OAAO,OAAO,SAAS,WAAW,OAAO,OAAO;AAAA,IACtD,SAAS,OAAO,OAAO,YAAY,WAAW,OAAO,UAAU;AAAA,EAAA;AAEnE;;;;;;"}
|
|
@@ -19,6 +19,24 @@ export declare const ATHENA_SDK_ERROR_CODES: {
|
|
|
19
19
|
readonly threads_list_failed: 'threads_list_failed';
|
|
20
20
|
/** Loading a thread's history failed. */
|
|
21
21
|
readonly thread_load_failed: 'thread_load_failed';
|
|
22
|
+
/**
|
|
23
|
+
* Pinning / unpinning a thread failed. `status` 404 / 405 means the backend
|
|
24
|
+
* predates `POST /api/conversations/threads/favorite` (see
|
|
25
|
+
* `isThreadFavoriteUnavailableError`); the pin then stays read-only.
|
|
26
|
+
*/
|
|
27
|
+
readonly thread_favorite_failed: 'thread_favorite_failed';
|
|
28
|
+
/**
|
|
29
|
+
* Renaming a thread failed. `status` 404 / 405 means the backend predates
|
|
30
|
+
* `POST /api/conversations/threads/rename` (see
|
|
31
|
+
* `isThreadRenameUnavailableError`); the list then offers no rename.
|
|
32
|
+
*/
|
|
33
|
+
readonly thread_rename_failed: 'thread_rename_failed';
|
|
34
|
+
/**
|
|
35
|
+
* Archiving a thread failed. `status` 404 / 405 means the backend has no
|
|
36
|
+
* archive route (see `isThreadArchiveUnavailableError`); the list then
|
|
37
|
+
* offers no archive action.
|
|
38
|
+
*/
|
|
39
|
+
readonly thread_archive_failed: 'thread_archive_failed';
|
|
22
40
|
/** The statewire host rejected a command (structured `{status, detail}`). */
|
|
23
41
|
readonly statewire_rejected: 'statewire_rejected';
|
|
24
42
|
/** The statewire connection is gone and will not reconnect on its own. */
|
|
@@ -31,6 +49,8 @@ export declare const ATHENA_SDK_ERROR_CODES: {
|
|
|
31
49
|
readonly attachment_failed: 'attachment_failed';
|
|
32
50
|
/** Mention suggestions for a scope failed after every retry. */
|
|
33
51
|
readonly mentions_fetch_failed: 'mentions_fetch_failed';
|
|
52
|
+
/** The repository code search request (`/api/search/repositories`) failed. */
|
|
53
|
+
readonly repo_search_failed: 'repo_search_failed';
|
|
34
54
|
/** Anything else. */
|
|
35
55
|
readonly unknown: 'unknown';
|
|
36
56
|
};
|
|
@@ -16,6 +16,24 @@ const ATHENA_SDK_ERROR_CODES = {
|
|
|
16
16
|
threads_list_failed: "threads_list_failed",
|
|
17
17
|
/** Loading a thread's history failed. */
|
|
18
18
|
thread_load_failed: "thread_load_failed",
|
|
19
|
+
/**
|
|
20
|
+
* Pinning / unpinning a thread failed. `status` 404 / 405 means the backend
|
|
21
|
+
* predates `POST /api/conversations/threads/favorite` (see
|
|
22
|
+
* `isThreadFavoriteUnavailableError`); the pin then stays read-only.
|
|
23
|
+
*/
|
|
24
|
+
thread_favorite_failed: "thread_favorite_failed",
|
|
25
|
+
/**
|
|
26
|
+
* Renaming a thread failed. `status` 404 / 405 means the backend predates
|
|
27
|
+
* `POST /api/conversations/threads/rename` (see
|
|
28
|
+
* `isThreadRenameUnavailableError`); the list then offers no rename.
|
|
29
|
+
*/
|
|
30
|
+
thread_rename_failed: "thread_rename_failed",
|
|
31
|
+
/**
|
|
32
|
+
* Archiving a thread failed. `status` 404 / 405 means the backend has no
|
|
33
|
+
* archive route (see `isThreadArchiveUnavailableError`); the list then
|
|
34
|
+
* offers no archive action.
|
|
35
|
+
*/
|
|
36
|
+
thread_archive_failed: "thread_archive_failed",
|
|
19
37
|
/** The statewire host rejected a command (structured `{status, detail}`). */
|
|
20
38
|
statewire_rejected: "statewire_rejected",
|
|
21
39
|
/** The statewire connection is gone and will not reconnect on its own. */
|
|
@@ -28,6 +46,8 @@ const ATHENA_SDK_ERROR_CODES = {
|
|
|
28
46
|
attachment_failed: "attachment_failed",
|
|
29
47
|
/** Mention suggestions for a scope failed after every retry. */
|
|
30
48
|
mentions_fetch_failed: "mentions_fetch_failed",
|
|
49
|
+
/** The repository code search request (`/api/search/repositories`) failed. */
|
|
50
|
+
repo_search_failed: "repo_search_failed",
|
|
31
51
|
/** Anything else. */
|
|
32
52
|
unknown: "unknown"
|
|
33
53
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sources":["../../src/diagnostics/errors.ts"],"sourcesContent":["/**\n * Typed SDK errors. Every failure the SDK surfaces to a consumer carries a\n * stable `code` (matchable in code), a human `message`, and a `hint` — the\n * one-line \"what to do about it\" that turns a silent failure into a debuggable\n * one. Backend rejections keep their structured `{ status, detail }` payload.\n */\n\nexport const ATHENA_SDK_ERROR_CODES = {\n /** No token and no API key resolved before a request had to be sent. */\n auth_missing: 'auth_missing',\n /** The server refused the credential (401 / statewire `unauthorized` fin). */\n auth_rejected: 'auth_rejected',\n /** `/_athena/auth` or the iframe bridge did not answer within the timeout. */\n auth_bridge_timeout: 'auth_bridge_timeout',\n /** `/_athena/auth` answered with a non-404 error. */\n auth_bridge_failed: 'auth_bridge_failed',\n /** The statewire sync URL could not be derived from the configuration. */\n config_invalid: 'config_invalid',\n /** The thread list request failed. */\n threads_list_failed: 'threads_list_failed',\n /** Loading a thread's history failed. */\n thread_load_failed: 'thread_load_failed',\n /** The statewire host rejected a command (structured `{status, detail}`). */\n statewire_rejected: 'statewire_rejected',\n /** The statewire connection is gone and will not reconnect on its own. */\n statewire_gone: 'statewire_gone',\n /** The selected collab agent / channel was refused by the backend. */\n collab_agent_rejected: 'collab_agent_rejected',\n /** A React render error crashed the chat surface (caught by the SDK's error boundary). */\n chat_render_crash: 'chat_render_crash',\n /** A pasted or dropped file could not be uploaded as a composer attachment. */\n attachment_failed: 'attachment_failed',\n /** Mention suggestions for a scope failed after every retry. */\n mentions_fetch_failed: 'mentions_fetch_failed',\n /** Anything else. */\n unknown: 'unknown',\n} as const;\n\nexport type AthenaSdkErrorCode =\n (typeof ATHENA_SDK_ERROR_CODES)[keyof typeof ATHENA_SDK_ERROR_CODES];\n\nexport interface AthenaSdkErrorOptions {\n code: AthenaSdkErrorCode;\n message: string;\n /** One line telling the integrator what to check or change. */\n hint?: string;\n /** HTTP-ish status when the failure came from a server. */\n status?: number;\n /** Structured server detail (e.g. `{ code, message }` from agora). */\n detail?: unknown;\n cause?: unknown;\n /** Extra structured context safe to log (never credentials). */\n context?: Record<string, unknown>;\n}\n\nexport class AthenaSdkError extends Error {\n readonly code: AthenaSdkErrorCode;\n readonly hint: string | undefined;\n readonly status: number | undefined;\n readonly detail: unknown;\n readonly context: Record<string, unknown>;\n\n constructor(options: AthenaSdkErrorOptions) {\n super(options.message, options.cause === undefined ? undefined : { cause: options.cause });\n this.name = 'AthenaSdkError';\n this.code = options.code;\n this.hint = options.hint;\n this.status = options.status;\n this.detail = options.detail;\n this.context = options.context ?? {};\n }\n\n /** A log/console-friendly one-liner: `[code] message — hint`. */\n describe(): string {\n return `[${this.code}] ${this.message}${this.hint ? ` — ${this.hint}` : ''}`;\n }\n\n toJSON(): Record<string, unknown> {\n return {\n name: this.name,\n code: this.code,\n message: this.message,\n hint: this.hint,\n status: this.status,\n detail: this.detail,\n context: this.context,\n };\n }\n}\n\nexport function isAthenaSdkError(value: unknown): value is AthenaSdkError {\n return value instanceof AthenaSdkError;\n}\n\n/** Wrap any thrown value as an `AthenaSdkError` (idempotent for SDK errors). */\nexport function toAthenaSdkError(\n value: unknown,\n fallback: Omit<AthenaSdkErrorOptions, 'cause'>,\n): AthenaSdkError {\n if (isAthenaSdkError(value)) return value;\n const message =\n value instanceof Error && value.message ? value.message : fallback.message;\n return new AthenaSdkError({ ...fallback, message, cause: value });\n}\n\n/** Structured `{ code, message }` detail from an agora rejection, if present. */\nexport function readRejectionDetail(\n detail: unknown,\n): { code: string | null; message: string | null } {\n if (typeof detail === 'string') return { code: null, message: detail || null };\n if (!detail || typeof detail !== 'object') return { code: null, message: null };\n const record = detail as { code?: unknown; message?: unknown };\n return {\n code: typeof record.code === 'string' ? record.code : null,\n message: typeof record.message === 'string' ? record.message : null,\n };\n}\n"],"names":[],"mappings":";;;AAOO,MAAM,yBAAyB;AAAA;AAAA,EAEpC,cAAc;AAAA;AAAA,EAEd,eAAe;AAAA;AAAA,EAEf,qBAAqB;AAAA;AAAA,EAErB,oBAAoB;AAAA;AAAA,EAEpB,gBAAgB;AAAA;AAAA,EAEhB,qBAAqB;AAAA;AAAA,EAErB,oBAAoB;AAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"errors.js","sources":["../../src/diagnostics/errors.ts"],"sourcesContent":["/**\n * Typed SDK errors. Every failure the SDK surfaces to a consumer carries a\n * stable `code` (matchable in code), a human `message`, and a `hint` — the\n * one-line \"what to do about it\" that turns a silent failure into a debuggable\n * one. Backend rejections keep their structured `{ status, detail }` payload.\n */\n\nexport const ATHENA_SDK_ERROR_CODES = {\n /** No token and no API key resolved before a request had to be sent. */\n auth_missing: 'auth_missing',\n /** The server refused the credential (401 / statewire `unauthorized` fin). */\n auth_rejected: 'auth_rejected',\n /** `/_athena/auth` or the iframe bridge did not answer within the timeout. */\n auth_bridge_timeout: 'auth_bridge_timeout',\n /** `/_athena/auth` answered with a non-404 error. */\n auth_bridge_failed: 'auth_bridge_failed',\n /** The statewire sync URL could not be derived from the configuration. */\n config_invalid: 'config_invalid',\n /** The thread list request failed. */\n threads_list_failed: 'threads_list_failed',\n /** Loading a thread's history failed. */\n thread_load_failed: 'thread_load_failed',\n /**\n * Pinning / unpinning a thread failed. `status` 404 / 405 means the backend\n * predates `POST /api/conversations/threads/favorite` (see\n * `isThreadFavoriteUnavailableError`); the pin then stays read-only.\n */\n thread_favorite_failed: 'thread_favorite_failed',\n /**\n * Renaming a thread failed. `status` 404 / 405 means the backend predates\n * `POST /api/conversations/threads/rename` (see\n * `isThreadRenameUnavailableError`); the list then offers no rename.\n */\n thread_rename_failed: 'thread_rename_failed',\n /**\n * Archiving a thread failed. `status` 404 / 405 means the backend has no\n * archive route (see `isThreadArchiveUnavailableError`); the list then\n * offers no archive action.\n */\n thread_archive_failed: 'thread_archive_failed',\n /** The statewire host rejected a command (structured `{status, detail}`). */\n statewire_rejected: 'statewire_rejected',\n /** The statewire connection is gone and will not reconnect on its own. */\n statewire_gone: 'statewire_gone',\n /** The selected collab agent / channel was refused by the backend. */\n collab_agent_rejected: 'collab_agent_rejected',\n /** A React render error crashed the chat surface (caught by the SDK's error boundary). */\n chat_render_crash: 'chat_render_crash',\n /** A pasted or dropped file could not be uploaded as a composer attachment. */\n attachment_failed: 'attachment_failed',\n /** Mention suggestions for a scope failed after every retry. */\n mentions_fetch_failed: 'mentions_fetch_failed',\n /** The repository code search request (`/api/search/repositories`) failed. */\n repo_search_failed: 'repo_search_failed',\n /** Anything else. */\n unknown: 'unknown',\n} as const;\n\nexport type AthenaSdkErrorCode =\n (typeof ATHENA_SDK_ERROR_CODES)[keyof typeof ATHENA_SDK_ERROR_CODES];\n\nexport interface AthenaSdkErrorOptions {\n code: AthenaSdkErrorCode;\n message: string;\n /** One line telling the integrator what to check or change. */\n hint?: string;\n /** HTTP-ish status when the failure came from a server. */\n status?: number;\n /** Structured server detail (e.g. `{ code, message }` from agora). */\n detail?: unknown;\n cause?: unknown;\n /** Extra structured context safe to log (never credentials). */\n context?: Record<string, unknown>;\n}\n\nexport class AthenaSdkError extends Error {\n readonly code: AthenaSdkErrorCode;\n readonly hint: string | undefined;\n readonly status: number | undefined;\n readonly detail: unknown;\n readonly context: Record<string, unknown>;\n\n constructor(options: AthenaSdkErrorOptions) {\n super(options.message, options.cause === undefined ? undefined : { cause: options.cause });\n this.name = 'AthenaSdkError';\n this.code = options.code;\n this.hint = options.hint;\n this.status = options.status;\n this.detail = options.detail;\n this.context = options.context ?? {};\n }\n\n /** A log/console-friendly one-liner: `[code] message — hint`. */\n describe(): string {\n return `[${this.code}] ${this.message}${this.hint ? ` — ${this.hint}` : ''}`;\n }\n\n toJSON(): Record<string, unknown> {\n return {\n name: this.name,\n code: this.code,\n message: this.message,\n hint: this.hint,\n status: this.status,\n detail: this.detail,\n context: this.context,\n };\n }\n}\n\nexport function isAthenaSdkError(value: unknown): value is AthenaSdkError {\n return value instanceof AthenaSdkError;\n}\n\n/** Wrap any thrown value as an `AthenaSdkError` (idempotent for SDK errors). */\nexport function toAthenaSdkError(\n value: unknown,\n fallback: Omit<AthenaSdkErrorOptions, 'cause'>,\n): AthenaSdkError {\n if (isAthenaSdkError(value)) return value;\n const message =\n value instanceof Error && value.message ? value.message : fallback.message;\n return new AthenaSdkError({ ...fallback, message, cause: value });\n}\n\n/** Structured `{ code, message }` detail from an agora rejection, if present. */\nexport function readRejectionDetail(\n detail: unknown,\n): { code: string | null; message: string | null } {\n if (typeof detail === 'string') return { code: null, message: detail || null };\n if (!detail || typeof detail !== 'object') return { code: null, message: null };\n const record = detail as { code?: unknown; message?: unknown };\n return {\n code: typeof record.code === 'string' ? record.code : null,\n message: typeof record.message === 'string' ? record.message : null,\n };\n}\n"],"names":[],"mappings":";;;AAOO,MAAM,yBAAyB;AAAA;AAAA,EAEpC,cAAc;AAAA;AAAA,EAEd,eAAe;AAAA;AAAA,EAEf,qBAAqB;AAAA;AAAA,EAErB,oBAAoB;AAAA;AAAA,EAEpB,gBAAgB;AAAA;AAAA,EAEhB,qBAAqB;AAAA;AAAA,EAErB,oBAAoB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMpB,wBAAwB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMxB,sBAAsB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMtB,uBAAuB;AAAA;AAAA,EAEvB,oBAAoB;AAAA;AAAA,EAEpB,gBAAgB;AAAA;AAAA,EAEhB,uBAAuB;AAAA;AAAA,EAEvB,mBAAmB;AAAA;AAAA,EAEnB,mBAAmB;AAAA;AAAA,EAEnB,uBAAuB;AAAA;AAAA,EAEvB,oBAAoB;AAAA;AAAA,EAEpB,SAAS;AACX;AAmBO,MAAM,uBAAuB,MAAM;AAAA,EAOxC,YAAY,SAAgC;AAC1C,UAAM,QAAQ,SAAS,QAAQ,UAAU,SAAY,SAAY,EAAE,OAAO,QAAQ,MAAA,CAAO;AAPlF;AACA;AACA;AACA;AACA;AAIP,SAAK,OAAO;AACZ,SAAK,OAAO,QAAQ;AACpB,SAAK,OAAO,QAAQ;AACpB,SAAK,SAAS,QAAQ;AACtB,SAAK,SAAS,QAAQ;AACtB,SAAK,UAAU,QAAQ,WAAW,CAAA;AAAA,EACpC;AAAA;AAAA,EAGA,WAAmB;AACjB,WAAO,IAAI,KAAK,IAAI,KAAK,KAAK,OAAO,GAAG,KAAK,OAAO,MAAM,KAAK,IAAI,KAAK,EAAE;AAAA,EAC5E;AAAA,EAEA,SAAkC;AAChC,WAAO;AAAA,MACL,MAAM,KAAK;AAAA,MACX,MAAM,KAAK;AAAA,MACX,SAAS,KAAK;AAAA,MACd,MAAM,KAAK;AAAA,MACX,QAAQ,KAAK;AAAA,MACb,QAAQ,KAAK;AAAA,MACb,SAAS,KAAK;AAAA,IAAA;AAAA,EAElB;AACF;AAEO,SAAS,iBAAiB,OAAyC;AACxE,SAAO,iBAAiB;AAC1B;AAGO,SAAS,iBACd,OACA,UACgB;AAChB,MAAI,iBAAiB,KAAK,EAAG,QAAO;AACpC,QAAM,UACJ,iBAAiB,SAAS,MAAM,UAAU,MAAM,UAAU,SAAS;AACrE,SAAO,IAAI,eAAe,EAAE,GAAG,UAAU,SAAS,OAAO,OAAO;AAClE;AAGO,SAAS,oBACd,QACiD;AACjD,MAAI,OAAO,WAAW,SAAU,QAAO,EAAE,MAAM,MAAM,SAAS,UAAU,KAAA;AACxE,MAAI,CAAC,UAAU,OAAO,WAAW,iBAAiB,EAAE,MAAM,MAAM,SAAS,KAAA;AACzE,QAAM,SAAS;AACf,SAAO;AAAA,IACL,MAAM,OAAO,OAAO,SAAS,WAAW,OAAO,OAAO;AAAA,IACtD,SAAS,OAAO,OAAO,YAAY,WAAW,OAAO,UAAU;AAAA,EAAA;AAEnE;"}
|
package/dist/index.cjs
CHANGED
|
@@ -5,6 +5,7 @@ const athenaDiagnostics = require("./diagnostics/athena-diagnostics.cjs");
|
|
|
5
5
|
const useAthenaDiagnostics = require("./diagnostics/useAthenaDiagnostics.cjs");
|
|
6
6
|
const errors = require("./diagnostics/errors.cjs");
|
|
7
7
|
const statewireRunConfig = require("./runtime/statewire-run-config.cjs");
|
|
8
|
+
const useAthenaRepoSearch = require("./search/useAthenaRepoSearch.cjs");
|
|
8
9
|
const AthenaProvider = require("./provider/AthenaProvider.cjs");
|
|
9
10
|
const PostHogProvider = require("./provider/PostHogProvider.cjs");
|
|
10
11
|
const wrapPosthogClient = require("./lib/posthog/wrap-posthog-client.cjs");
|
|
@@ -20,6 +21,7 @@ const StatewireApprovalCard = require("./chat/StatewireApprovalCard.cjs");
|
|
|
20
21
|
const useStatewireApprovalRequest = require("./chat/use-statewire-approval-request.cjs");
|
|
21
22
|
const useAthenaRunLive = require("./chat/use-athena-run-live.cjs");
|
|
22
23
|
const statewireHistoryEdge = require("./chat-ui/thread/statewire-history-edge.cjs");
|
|
24
|
+
const threadLoadingOverlay = require("./chat-ui/thread/thread-loading-overlay.cjs");
|
|
23
25
|
const statewireWindowContext = require("./provider/statewire-window-context.cjs");
|
|
24
26
|
const useAthenaStatewireRuntime = require("./runtime/useAthenaStatewireRuntime.cjs");
|
|
25
27
|
const StatewireQueuedMessages = require("./chat/StatewireQueuedMessages.cjs");
|
|
@@ -29,6 +31,8 @@ const statewireClientTools = require("./chat/statewire-client-tools.cjs");
|
|
|
29
31
|
const statewireLifecycleContext = require("./provider/statewire-lifecycle-context.cjs");
|
|
30
32
|
const statewireLifecycle = require("./runtime/statewire-lifecycle.cjs");
|
|
31
33
|
const statewireThreadList = require("./threads/statewire-thread-list.cjs");
|
|
34
|
+
const WaitingOnYouBanner = require("./chat/WaitingOnYouBanner.cjs");
|
|
35
|
+
const wakeMarker = require("./chat-ui/messages/wake-marker.cjs");
|
|
32
36
|
const tiptapText = require("./chat/tiptap-text.cjs");
|
|
33
37
|
const athenaCitationLinks = require("./chat/athena-citation-links.cjs");
|
|
34
38
|
const tooltipIconButton = require("./chat/tooltip-icon-button.cjs");
|
|
@@ -41,6 +45,7 @@ require("react");
|
|
|
41
45
|
require("@assistant-ui/tap");
|
|
42
46
|
require("statewire");
|
|
43
47
|
require("./packages/agent-runtime/src/statewire-suspended.cjs");
|
|
48
|
+
const conversationList = require("./packages/agent-runtime/src/conversation-list.cjs");
|
|
44
49
|
const toolMetadata = require("./packages/agent-runtime/src/tool-metadata.cjs");
|
|
45
50
|
const toolResult = require("./packages/agent-runtime/src/tool-result.cjs");
|
|
46
51
|
require("@tanstack/react-query");
|
|
@@ -48,11 +53,12 @@ const interrupts = require("./packages/agent-runtime/src/interrupts.cjs");
|
|
|
48
53
|
require("./packages/agent-runtime/src/messages.cjs");
|
|
49
54
|
require("./packages/agent-runtime/src/statewire-state.cjs");
|
|
50
55
|
const threadExtras = require("./packages/agent-runtime/src/thread-extras.cjs");
|
|
51
|
-
require("@assistant-ui/react-statewire");
|
|
52
56
|
require("@assistant-ui/store");
|
|
53
57
|
require("./packages/agent-runtime/src/quota-safe-local-storage-session.cjs");
|
|
54
58
|
require("./packages/agent-runtime/src/statewire-attach-observer.cjs");
|
|
55
59
|
require("./packages/agent-runtime/src/thread-status.cjs");
|
|
60
|
+
require("@assistant-ui/react-statewire");
|
|
61
|
+
const githubWakeEvent = require("./packages/agent-runtime/src/github-wake-event.cjs");
|
|
56
62
|
require("@assistant-ui/core");
|
|
57
63
|
require("./packages/agent-runtime/src/thread-handoff.cjs");
|
|
58
64
|
const writeTodosToolUi = require("./tools/write-todos-tool-ui.cjs");
|
|
@@ -73,8 +79,12 @@ const assetPanelStore = require("./assets/asset-panel-store.cjs");
|
|
|
73
79
|
const useAssetEmbed = require("./assets/use-asset-embed.cjs");
|
|
74
80
|
const AthenaContext = require("./provider/AthenaContext.cjs");
|
|
75
81
|
const ThreadList = require("./threads/ThreadList.cjs");
|
|
82
|
+
const SessionList = require("./threads/SessionList.cjs");
|
|
83
|
+
const useAthenaSessionAttention = require("./threads/use-athena-session-attention.cjs");
|
|
84
|
+
const sessionListModel = require("./threads/session-list-model.cjs");
|
|
76
85
|
const threadIdContext = require("./threads/thread-id-context.cjs");
|
|
77
86
|
const api = require("./threads/api.cjs");
|
|
87
|
+
const threadPrefetcher = require("./threads/thread-prefetcher.cjs");
|
|
78
88
|
const useRestConversationHistory = require("./threads/use-rest-conversation-history.cjs");
|
|
79
89
|
const useStatewireConversationHistory = require("./threads/use-statewire-conversation-history.cjs");
|
|
80
90
|
const useAthenaThreadManager = require("./threads/useAthenaThreadManager.cjs");
|
|
@@ -94,6 +104,7 @@ const collapsible = require("./ui/collapsible.cjs");
|
|
|
94
104
|
const index = require("./toolkits/index.cjs");
|
|
95
105
|
const index$1 = require("./theme/index.cjs");
|
|
96
106
|
const cnfast = require("cnfast");
|
|
107
|
+
const toolAppearance = require("./tools/tool-appearance.cjs");
|
|
97
108
|
exports.ATHENA_REACT_SDK_VERSION = version.ATHENA_REACT_SDK_VERSION;
|
|
98
109
|
exports.athenaDiagnostics = athenaDiagnostics.athenaDiagnostics;
|
|
99
110
|
exports.installAthenaDiagnosticsGlobal = athenaDiagnostics.installAthenaDiagnosticsGlobal;
|
|
@@ -109,6 +120,10 @@ exports.DEFAULT_STATEWIRE_MODEL = statewireRunConfig.DEFAULT_STATEWIRE_MODEL;
|
|
|
109
120
|
exports.buildStatewireRunConfig = statewireRunConfig.buildStatewireRunConfig;
|
|
110
121
|
exports.parseCollabAgentRef = statewireRunConfig.parseCollabAgentRef;
|
|
111
122
|
exports.resolveAgentProp = statewireRunConfig.resolveAgentProp;
|
|
123
|
+
exports.ATHENA_REPO_SEARCH_PATH = useAthenaRepoSearch.ATHENA_REPO_SEARCH_PATH;
|
|
124
|
+
exports.fetchRepoSearch = useAthenaRepoSearch.fetchRepoSearch;
|
|
125
|
+
exports.repoSearchRequestBody = useAthenaRepoSearch.repoSearchRequestBody;
|
|
126
|
+
exports.useAthenaRepoSearch = useAthenaRepoSearch.useAthenaRepoSearch;
|
|
112
127
|
exports.AthenaProvider = AthenaProvider.AthenaProvider;
|
|
113
128
|
exports.getPostHogInstance = PostHogProvider.getPostHogInstance;
|
|
114
129
|
exports.capturePosthogEvent = wrapPosthogClient.capturePosthogEvent;
|
|
@@ -146,6 +161,7 @@ exports.StatewireApprovalCard = StatewireApprovalCard.StatewireApprovalCard;
|
|
|
146
161
|
exports.useStatewireApprovalRequest = useStatewireApprovalRequest.useStatewireApprovalRequest;
|
|
147
162
|
exports.useAthenaRunLive = useAthenaRunLive.useAthenaRunLive;
|
|
148
163
|
exports.StatewireHistoryEdge = statewireHistoryEdge.StatewireHistoryEdge;
|
|
164
|
+
exports.ThreadLoadingOverlay = threadLoadingOverlay.ThreadLoadingOverlay;
|
|
149
165
|
exports.useStatewireToolOutputs = statewireWindowContext.useStatewireToolOutputs;
|
|
150
166
|
exports.ATHENA_SDK_MESSAGE_WINDOW = useAthenaStatewireRuntime.ATHENA_SDK_MESSAGE_WINDOW;
|
|
151
167
|
exports.useAthenaStatewireRuntime = useAthenaStatewireRuntime.useAthenaStatewireRuntime;
|
|
@@ -157,8 +173,13 @@ exports.collectStatewireClientTools = statewireClientTools.collectStatewireClien
|
|
|
157
173
|
exports.statewireClientToolWireEntries = statewireClientTools.statewireClientToolWireEntries;
|
|
158
174
|
exports.useAthenaStatewireLifecycle = statewireLifecycleContext.useAthenaStatewireLifecycle;
|
|
159
175
|
exports.athenaStatewireErrorNotice = statewireLifecycle.athenaStatewireErrorNotice;
|
|
176
|
+
exports.threadSummaryFromConversation = statewireThreadList.threadSummaryFromConversation;
|
|
160
177
|
exports.useAthenaStatewireThreadList = statewireThreadList.useAthenaStatewireThreadList;
|
|
161
178
|
exports.useRefreshThreadList = statewireThreadList.useRefreshThreadList;
|
|
179
|
+
exports.WaitingOnYouBanner = WaitingOnYouBanner.WaitingOnYouBanner;
|
|
180
|
+
exports.WaitingOnYouBannerView = WaitingOnYouBanner.WaitingOnYouBannerView;
|
|
181
|
+
exports.WakeMarkerCard = wakeMarker.WakeMarkerCard;
|
|
182
|
+
exports.WakeMarkerMessage = wakeMarker.WakeMarkerMessage;
|
|
162
183
|
exports.TiptapText = tiptapText.TiptapText;
|
|
163
184
|
exports.isAthenaCitationUrl = athenaCitationLinks.isAthenaCitationUrl;
|
|
164
185
|
exports.parseAthenaCitationLink = athenaCitationLinks.parseAthenaCitationLink;
|
|
@@ -192,6 +213,7 @@ exports.truncate = primitives.truncate;
|
|
|
192
213
|
exports.InstallPackageToolUI = miscToolUis.InstallPackageToolUI;
|
|
193
214
|
exports.TOOL_ICONS = toolIcons.TOOL_ICONS;
|
|
194
215
|
exports.toolIcon = toolIcons.toolIcon;
|
|
216
|
+
exports.deriveConversationAttention = conversationList.deriveConversationAttention;
|
|
195
217
|
exports.describeToolArgs = toolMetadata.describeToolArgs;
|
|
196
218
|
exports.formatToolName = toolMetadata.formatToolName;
|
|
197
219
|
exports.getToolDisplayMeta = toolMetadata.getToolDisplayMeta;
|
|
@@ -205,6 +227,10 @@ exports.asHitlApproval = interrupts.asHitlApproval;
|
|
|
205
227
|
exports.isPendingInterrupt = interrupts.isPendingInterrupt;
|
|
206
228
|
exports.readInterruptMessage = interrupts.readInterruptMessage;
|
|
207
229
|
exports.hasStatewireThreadExtras = threadExtras.hasStatewireThreadExtras;
|
|
230
|
+
exports.githubWakeEventLabel = githubWakeEvent.githubWakeEventLabel;
|
|
231
|
+
exports.githubWakeMarkerText = githubWakeEvent.githubWakeMarkerText;
|
|
232
|
+
exports.isGithubWakeMessage = githubWakeEvent.isGithubWakeMessage;
|
|
233
|
+
exports.readGithubWakeEvent = githubWakeEvent.readGithubWakeEvent;
|
|
208
234
|
exports.HiddenWriteTodosToolUI = writeTodosToolUi.HiddenWriteTodosToolUI;
|
|
209
235
|
exports.WriteTodosToolUI = writeTodosToolUi.WriteTodosToolUI;
|
|
210
236
|
exports.parseTodoPlan = writeTodosToolUi.parseTodoPlan;
|
|
@@ -216,6 +242,7 @@ exports.SearchFilesToolUI = fileToolUis.SearchFilesToolUI;
|
|
|
216
242
|
exports.WriteFileToolUI = fileToolUis.WriteFileToolUI;
|
|
217
243
|
exports.friendlyWorkspacePath = fileToolUis.friendlyWorkspacePath;
|
|
218
244
|
exports.ToolFallback = toolFallback.ToolFallback;
|
|
245
|
+
exports.ToolFallbackAppearanceProvider = toolFallback.ToolFallbackAppearanceProvider;
|
|
219
246
|
exports.ToolFallbackArgs = toolFallback.ToolFallbackArgs;
|
|
220
247
|
exports.ToolFallbackContent = toolFallback.ToolFallbackContent;
|
|
221
248
|
exports.ToolFallbackError = toolFallback.ToolFallbackError;
|
|
@@ -243,13 +270,31 @@ exports.useAssetPanelStore = assetPanelStore.useAssetPanelStore;
|
|
|
243
270
|
exports.useAssetEmbed = useAssetEmbed.useAssetEmbed;
|
|
244
271
|
exports.useAthenaConfig = AthenaContext.useAthenaConfig;
|
|
245
272
|
exports.ThreadList = ThreadList.ThreadList;
|
|
273
|
+
exports.SessionList = SessionList.SessionList;
|
|
274
|
+
exports.useAthenaSessionAttention = useAthenaSessionAttention.useAthenaSessionAttention;
|
|
275
|
+
exports.groupSessions = sessionListModel.groupSessions;
|
|
276
|
+
exports.pullRequestChip = sessionListModel.pullRequestChip;
|
|
277
|
+
exports.pullRequestChipState = sessionListModel.pullRequestChipState;
|
|
278
|
+
exports.sessionIndicator = sessionListModel.sessionIndicator;
|
|
279
|
+
exports.sessionListGroupOf = sessionListModel.sessionListGroupOf;
|
|
280
|
+
exports.sessionOriginLabel = sessionListModel.sessionOriginLabel;
|
|
281
|
+
exports.sessionSecondaryLine = sessionListModel.sessionSecondaryLine;
|
|
246
282
|
exports.AthenaThreadIdContext = threadIdContext.AthenaThreadIdContext;
|
|
283
|
+
exports.useAthenaStatewireThreadId = threadIdContext.useAthenaStatewireThreadId;
|
|
247
284
|
exports.useAthenaThreadId = threadIdContext.useAthenaThreadId;
|
|
285
|
+
exports.THREAD_TITLE_MAX_LENGTH = api.THREAD_TITLE_MAX_LENGTH;
|
|
248
286
|
exports.archiveThread = api.archiveThread;
|
|
249
287
|
exports.createThread = api.createThread;
|
|
250
288
|
exports.getThreadState = api.getThreadState;
|
|
289
|
+
exports.isThreadArchiveUnavailableError = api.isThreadArchiveUnavailableError;
|
|
290
|
+
exports.isThreadFavoriteUnavailableError = api.isThreadFavoriteUnavailableError;
|
|
291
|
+
exports.isThreadRenameUnavailableError = api.isThreadRenameUnavailableError;
|
|
251
292
|
exports.listThreads = api.listThreads;
|
|
293
|
+
exports.renameThread = api.renameThread;
|
|
294
|
+
exports.setThreadFavorite = api.setThreadFavorite;
|
|
252
295
|
exports.setThreadReadState = api.setThreadReadState;
|
|
296
|
+
exports.THREAD_PREFETCH_HOVER_DELAY_MS = threadPrefetcher.THREAD_PREFETCH_HOVER_DELAY_MS;
|
|
297
|
+
exports.THREAD_PREFETCH_MAX_CONCURRENT = threadPrefetcher.THREAD_PREFETCH_MAX_CONCURRENT;
|
|
253
298
|
exports.conversationDisplayTitle = useRestConversationHistory.conversationDisplayTitle;
|
|
254
299
|
exports.useRestConversationHistory = useRestConversationHistory.useRestConversationHistory;
|
|
255
300
|
exports.conversationSummaryFromIndexEntry = useStatewireConversationHistory.conversationSummaryFromIndexEntry;
|
|
@@ -288,4 +333,5 @@ Object.defineProperty(exports, "cn", {
|
|
|
288
333
|
enumerable: true,
|
|
289
334
|
get: () => cnfast.cn
|
|
290
335
|
});
|
|
336
|
+
exports.useToolAppearance = toolAppearance.useToolAppearance;
|
|
291
337
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|