@athenaintel/react 0.22.3 → 0.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +394 -4
- package/dist/chat/AthenaChat.cjs +389 -240
- package/dist/chat/AthenaChat.cjs.map +1 -1
- package/dist/chat/AthenaChat.d.ts +26 -8
- package/dist/chat/AthenaChat.js +394 -245
- package/dist/chat/AthenaChat.js.map +1 -1
- package/dist/chat/StatewireApprovalCard.cjs +2 -1
- package/dist/chat/StatewireApprovalCard.cjs.map +1 -1
- package/dist/chat/StatewireApprovalCard.js +2 -1
- package/dist/chat/StatewireApprovalCard.js.map +1 -1
- package/dist/chat/StatewireClientToolBridge.cjs +1 -0
- package/dist/chat/StatewireClientToolBridge.cjs.map +1 -1
- package/dist/chat/StatewireClientToolBridge.js +1 -0
- package/dist/chat/StatewireClientToolBridge.js.map +1 -1
- package/dist/chat/StatewireQueuedMessages.cjs +1 -0
- package/dist/chat/StatewireQueuedMessages.cjs.map +1 -1
- package/dist/chat/StatewireQueuedMessages.js +1 -0
- package/dist/chat/StatewireQueuedMessages.js.map +1 -1
- package/dist/chat/WaitingOnYouBanner.cjs +100 -0
- package/dist/chat/WaitingOnYouBanner.cjs.map +1 -0
- package/dist/chat/WaitingOnYouBanner.d.ts +29 -0
- package/dist/chat/WaitingOnYouBanner.js +100 -0
- package/dist/chat/WaitingOnYouBanner.js.map +1 -0
- package/dist/chat/athena-chat-welcome.cjs +148 -0
- package/dist/chat/athena-chat-welcome.cjs.map +1 -0
- package/dist/chat/athena-chat-welcome.d.ts +54 -0
- package/dist/chat/athena-chat-welcome.js +148 -0
- package/dist/chat/athena-chat-welcome.js.map +1 -0
- package/dist/chat/athena-composer-controls.cjs +76 -0
- package/dist/chat/athena-composer-controls.cjs.map +1 -0
- package/dist/chat/athena-composer-controls.d.ts +21 -0
- package/dist/chat/athena-composer-controls.js +76 -0
- package/dist/chat/athena-composer-controls.js.map +1 -0
- package/dist/chat/composer-keyboard-hint.cjs +61 -0
- package/dist/chat/composer-keyboard-hint.cjs.map +1 -0
- package/dist/chat/composer-keyboard-hint.d.ts +33 -0
- package/dist/chat/composer-keyboard-hint.js +61 -0
- package/dist/chat/composer-keyboard-hint.js.map +1 -0
- package/dist/chat/message-time.cjs +64 -0
- package/dist/chat/message-time.cjs.map +1 -0
- package/dist/chat/message-time.d.ts +45 -0
- package/dist/chat/message-time.js +64 -0
- package/dist/chat/message-time.js.map +1 -0
- package/dist/chat/run-activity.cjs +38 -7
- package/dist/chat/run-activity.cjs.map +1 -1
- package/dist/chat/run-activity.d.ts +14 -3
- package/dist/chat/run-activity.js +39 -8
- package/dist/chat/run-activity.js.map +1 -1
- package/dist/chat/statewire-client-tools.cjs +2 -1
- package/dist/chat/statewire-client-tools.cjs.map +1 -1
- package/dist/chat/statewire-client-tools.js +2 -1
- package/dist/chat/statewire-client-tools.js.map +1 -1
- package/dist/chat/super-grouping/activity-timeline.cjs +2 -1
- package/dist/chat/super-grouping/activity-timeline.cjs.map +1 -1
- package/dist/chat/super-grouping/activity-timeline.js +2 -1
- package/dist/chat/super-grouping/activity-timeline.js.map +1 -1
- package/dist/chat/thread-scroll-to-bottom.cjs +24 -0
- package/dist/chat/thread-scroll-to-bottom.cjs.map +1 -0
- package/dist/chat/thread-scroll-to-bottom.d.ts +11 -0
- package/dist/chat/thread-scroll-to-bottom.js +24 -0
- package/dist/chat/thread-scroll-to-bottom.js.map +1 -0
- package/dist/chat/tiptap-text.cjs +26 -99
- package/dist/chat/tiptap-text.cjs.map +1 -1
- package/dist/chat/tiptap-text.d.ts +13 -0
- package/dist/chat/tiptap-text.js +26 -99
- package/dist/chat/tiptap-text.js.map +1 -1
- package/dist/chat/use-athena-run-live.cjs +2 -1
- package/dist/chat/use-athena-run-live.cjs.map +1 -1
- package/dist/chat/use-athena-run-live.js +2 -1
- package/dist/chat/use-athena-run-live.js.map +1 -1
- package/dist/chat/use-statewire-approval-request.cjs +1 -0
- package/dist/chat/use-statewire-approval-request.cjs.map +1 -1
- package/dist/chat/use-statewire-approval-request.js +1 -0
- package/dist/chat/use-statewire-approval-request.js.map +1 -1
- package/dist/chat-ui/composer/tiptap-composer.cjs +39 -4
- package/dist/chat-ui/composer/tiptap-composer.cjs.map +1 -1
- package/dist/chat-ui/composer/tiptap-composer.d.ts +21 -0
- package/dist/chat-ui/composer/tiptap-composer.js +39 -4
- package/dist/chat-ui/composer/tiptap-composer.js.map +1 -1
- package/dist/chat-ui/index.cjs +15 -1
- package/dist/chat-ui/index.cjs.map +1 -1
- package/dist/chat-ui/index.d.ts +6 -3
- package/dist/chat-ui/index.js +16 -2
- package/dist/chat-ui/index.js.map +1 -1
- package/dist/chat-ui/mentions/mention-chip.cjs +31 -4
- package/dist/chat-ui/mentions/mention-chip.cjs.map +1 -1
- package/dist/chat-ui/mentions/mention-chip.js +31 -4
- package/dist/chat-ui/mentions/mention-chip.js.map +1 -1
- package/dist/chat-ui/messages/message-components.cjs +19 -1
- package/dist/chat-ui/messages/message-components.cjs.map +1 -1
- package/dist/chat-ui/messages/message-components.d.ts +13 -0
- package/dist/chat-ui/messages/message-components.js +19 -1
- package/dist/chat-ui/messages/message-components.js.map +1 -1
- package/dist/chat-ui/messages/runtime-message.cjs +2 -1
- package/dist/chat-ui/messages/runtime-message.cjs.map +1 -1
- package/dist/chat-ui/messages/runtime-message.js +2 -1
- package/dist/chat-ui/messages/runtime-message.js.map +1 -1
- package/dist/chat-ui/messages/statewire-continue-run.cjs +1 -0
- package/dist/chat-ui/messages/statewire-continue-run.cjs.map +1 -1
- package/dist/chat-ui/messages/statewire-continue-run.js +1 -0
- package/dist/chat-ui/messages/statewire-continue-run.js.map +1 -1
- package/dist/chat-ui/messages/user-edit-composer.cjs +3 -1
- package/dist/chat-ui/messages/user-edit-composer.cjs.map +1 -1
- package/dist/chat-ui/messages/user-edit-composer.js +3 -1
- package/dist/chat-ui/messages/user-edit-composer.js.map +1 -1
- package/dist/chat-ui/messages/wake-marker.cjs +84 -0
- package/dist/chat-ui/messages/wake-marker.cjs.map +1 -0
- package/dist/chat-ui/messages/wake-marker.d.ts +16 -0
- package/dist/chat-ui/messages/wake-marker.js +84 -0
- package/dist/chat-ui/messages/wake-marker.js.map +1 -0
- package/dist/chat-ui/rich-text/chat-blocks.cjs +177 -0
- package/dist/chat-ui/rich-text/chat-blocks.cjs.map +1 -0
- package/dist/chat-ui/rich-text/chat-blocks.d.ts +58 -0
- package/dist/chat-ui/rich-text/chat-blocks.js +177 -0
- package/dist/chat-ui/rich-text/chat-blocks.js.map +1 -0
- package/dist/chat-ui/rich-text/chat-link.cjs +69 -0
- package/dist/chat-ui/rich-text/chat-link.cjs.map +1 -0
- package/dist/chat-ui/rich-text/chat-link.d.ts +24 -0
- package/dist/chat-ui/rich-text/chat-link.js +69 -0
- package/dist/chat-ui/rich-text/chat-link.js.map +1 -0
- package/dist/chat-ui/rich-text/chat-message-body.cjs +144 -18
- package/dist/chat-ui/rich-text/chat-message-body.cjs.map +1 -1
- package/dist/chat-ui/rich-text/chat-message-body.d.ts +10 -1
- package/dist/chat-ui/rich-text/chat-message-body.js +149 -23
- package/dist/chat-ui/rich-text/chat-message-body.js.map +1 -1
- package/dist/chat-ui/rich-text/chat-node-views.cjs +84 -4
- package/dist/chat-ui/rich-text/chat-node-views.cjs.map +1 -1
- package/dist/chat-ui/rich-text/chat-node-views.d.ts +12 -1
- package/dist/chat-ui/rich-text/chat-node-views.js +85 -5
- package/dist/chat-ui/rich-text/chat-node-views.js.map +1 -1
- package/dist/chat-ui/rich-text/chat-text-schema.cjs +21 -3
- package/dist/chat-ui/rich-text/chat-text-schema.cjs.map +1 -1
- package/dist/chat-ui/rich-text/chat-text-schema.d.ts +17 -2
- package/dist/chat-ui/rich-text/chat-text-schema.js +21 -3
- package/dist/chat-ui/rich-text/chat-text-schema.js.map +1 -1
- package/dist/chat-ui/rich-text/citation-anchors.cjs +139 -0
- package/dist/chat-ui/rich-text/citation-anchors.cjs.map +1 -0
- package/dist/chat-ui/rich-text/citation-anchors.d.ts +74 -0
- package/dist/chat-ui/rich-text/citation-anchors.js +139 -0
- package/dist/chat-ui/rich-text/citation-anchors.js.map +1 -0
- package/dist/chat-ui/statewire.cjs +8 -1
- package/dist/chat-ui/statewire.cjs.map +1 -1
- package/dist/chat-ui/statewire.d.ts +2 -0
- package/dist/chat-ui/statewire.js +8 -1
- package/dist/chat-ui/statewire.js.map +1 -1
- package/dist/chat-ui/thread/chat-composer-dock.cjs +27 -6
- package/dist/chat-ui/thread/chat-composer-dock.cjs.map +1 -1
- package/dist/chat-ui/thread/chat-composer-dock.d.ts +21 -1
- package/dist/chat-ui/thread/chat-composer-dock.js +28 -7
- package/dist/chat-ui/thread/chat-composer-dock.js.map +1 -1
- package/dist/chat-ui/thread/statewire-history-edge.cjs +12 -13
- package/dist/chat-ui/thread/statewire-history-edge.cjs.map +1 -1
- package/dist/chat-ui/thread/statewire-history-edge.d.ts +11 -10
- package/dist/chat-ui/thread/statewire-history-edge.js +13 -14
- package/dist/chat-ui/thread/statewire-history-edge.js.map +1 -1
- package/dist/chat-ui/thread/thread-loading-overlay.cjs +31 -0
- package/dist/chat-ui/thread/thread-loading-overlay.cjs.map +1 -0
- package/dist/chat-ui/thread/thread-loading-overlay.d.ts +14 -0
- package/dist/chat-ui/thread/thread-loading-overlay.js +31 -0
- package/dist/chat-ui/thread/thread-loading-overlay.js.map +1 -0
- package/dist/composer/ComposerDropZone.cjs +8 -1
- package/dist/composer/ComposerDropZone.cjs.map +1 -1
- package/dist/composer/ComposerDropZone.d.ts +6 -0
- package/dist/composer/ComposerDropZone.js +9 -2
- package/dist/composer/ComposerDropZone.js.map +1 -1
- package/dist/diagnostics/errors.cjs +20 -0
- package/dist/diagnostics/errors.cjs.map +1 -1
- package/dist/diagnostics/errors.d.ts +20 -0
- package/dist/diagnostics/errors.js +20 -0
- package/dist/diagnostics/errors.js.map +1 -1
- package/dist/index.cjs +47 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +26 -7
- package/dist/index.js +51 -5
- package/dist/index.js.map +1 -1
- package/dist/lib/use-prefers-reduced-motion.cjs +29 -0
- package/dist/lib/use-prefers-reduced-motion.cjs.map +1 -0
- package/dist/lib/use-prefers-reduced-motion.d.ts +6 -0
- package/dist/lib/use-prefers-reduced-motion.js +29 -0
- package/dist/lib/use-prefers-reduced-motion.js.map +1 -0
- package/dist/packages/agent-runtime/src/conversation-index.cjs.map +1 -1
- package/dist/packages/agent-runtime/src/conversation-index.js.map +1 -1
- package/dist/packages/agent-runtime/src/conversation-list.cjs +59 -0
- package/dist/packages/agent-runtime/src/conversation-list.cjs.map +1 -1
- package/dist/packages/agent-runtime/src/conversation-list.js +60 -1
- package/dist/packages/agent-runtime/src/conversation-list.js.map +1 -1
- package/dist/packages/agent-runtime/src/deep-agent-transport-recipe.cjs +5 -3
- package/dist/packages/agent-runtime/src/deep-agent-transport-recipe.cjs.map +1 -1
- package/dist/packages/agent-runtime/src/deep-agent-transport-recipe.js +5 -3
- package/dist/packages/agent-runtime/src/deep-agent-transport-recipe.js.map +1 -1
- package/dist/packages/agent-runtime/src/edit-command.cjs +21 -17
- package/dist/packages/agent-runtime/src/edit-command.cjs.map +1 -1
- package/dist/packages/agent-runtime/src/edit-command.js +22 -18
- package/dist/packages/agent-runtime/src/edit-command.js.map +1 -1
- package/dist/packages/agent-runtime/src/generated/runconfig-contract.cjs +9 -11
- package/dist/packages/agent-runtime/src/generated/runconfig-contract.cjs.map +1 -1
- package/dist/packages/agent-runtime/src/generated/runconfig-contract.js +9 -11
- package/dist/packages/agent-runtime/src/generated/runconfig-contract.js.map +1 -1
- package/dist/packages/agent-runtime/src/github-wake-event.cjs +86 -0
- package/dist/packages/agent-runtime/src/github-wake-event.cjs.map +1 -0
- package/dist/packages/agent-runtime/src/github-wake-event.js +86 -0
- package/dist/packages/agent-runtime/src/github-wake-event.js.map +1 -0
- package/dist/packages/agent-runtime/src/message-window.cjs +150 -42
- package/dist/packages/agent-runtime/src/message-window.cjs.map +1 -1
- package/dist/packages/agent-runtime/src/message-window.js +151 -43
- package/dist/packages/agent-runtime/src/message-window.js.map +1 -1
- package/dist/packages/agent-runtime/src/quota-safe-local-storage-session.cjs +13 -9
- package/dist/packages/agent-runtime/src/quota-safe-local-storage-session.cjs.map +1 -1
- package/dist/packages/agent-runtime/src/quota-safe-local-storage-session.js +13 -9
- package/dist/packages/agent-runtime/src/quota-safe-local-storage-session.js.map +1 -1
- package/dist/packages/agent-runtime/src/statewire-suspended.cjs +1 -3
- package/dist/packages/agent-runtime/src/statewire-suspended.cjs.map +1 -1
- package/dist/packages/agent-runtime/src/statewire-suspended.js +1 -3
- package/dist/packages/agent-runtime/src/statewire-suspended.js.map +1 -1
- package/dist/packages/agent-runtime/src/use-deep-agent-edit-submit.cjs.map +1 -1
- package/dist/packages/agent-runtime/src/use-deep-agent-edit-submit.js.map +1 -1
- package/dist/packages/agent-runtime/src/use-deep-agent-thread.cjs +61 -30
- package/dist/packages/agent-runtime/src/use-deep-agent-thread.cjs.map +1 -1
- package/dist/packages/agent-runtime/src/use-deep-agent-thread.js +59 -28
- package/dist/packages/agent-runtime/src/use-deep-agent-thread.js.map +1 -1
- package/dist/packages/agent-runtime/src/use-deep-agent-window-sync.cjs +56 -36
- package/dist/packages/agent-runtime/src/use-deep-agent-window-sync.cjs.map +1 -1
- package/dist/packages/agent-runtime/src/use-deep-agent-window-sync.js +59 -39
- package/dist/packages/agent-runtime/src/use-deep-agent-window-sync.js.map +1 -1
- package/dist/packages/react/package.json.cjs +1 -1
- package/dist/packages/react/package.json.js +1 -1
- package/dist/provider/AthenaContext.cjs.map +1 -1
- package/dist/provider/AthenaContext.d.ts +3 -0
- package/dist/provider/AthenaContext.js.map +1 -1
- package/dist/provider/AthenaProvider.cjs +93 -45
- package/dist/provider/AthenaProvider.cjs.map +1 -1
- package/dist/provider/AthenaProvider.d.ts +6 -1
- package/dist/provider/AthenaProvider.js +97 -49
- package/dist/provider/AthenaProvider.js.map +1 -1
- package/dist/runtime/statewire-lifecycle.cjs +2 -1
- package/dist/runtime/statewire-lifecycle.cjs.map +1 -1
- package/dist/runtime/statewire-lifecycle.js +2 -1
- package/dist/runtime/statewire-lifecycle.js.map +1 -1
- package/dist/runtime/useAthenaStatewireRuntime.cjs +3 -2
- package/dist/runtime/useAthenaStatewireRuntime.cjs.map +1 -1
- package/dist/runtime/useAthenaStatewireRuntime.d.ts +8 -12
- package/dist/runtime/useAthenaStatewireRuntime.js +3 -2
- package/dist/runtime/useAthenaStatewireRuntime.js.map +1 -1
- package/dist/search/useAthenaRepoSearch.cjs +94 -0
- package/dist/search/useAthenaRepoSearch.cjs.map +1 -0
- package/dist/search/useAthenaRepoSearch.d.ts +95 -0
- package/dist/search/useAthenaRepoSearch.js +94 -0
- package/dist/search/useAthenaRepoSearch.js.map +1 -0
- package/dist/styles.css +1 -1
- package/dist/threads/SessionList.cjs +486 -0
- package/dist/threads/SessionList.cjs.map +1 -0
- package/dist/threads/SessionList.d.ts +60 -0
- package/dist/threads/SessionList.js +486 -0
- package/dist/threads/SessionList.js.map +1 -0
- package/dist/threads/api.cjs +112 -4
- package/dist/threads/api.cjs.map +1 -1
- package/dist/threads/api.d.ts +128 -1
- package/dist/threads/api.js +113 -5
- package/dist/threads/api.js.map +1 -1
- package/dist/threads/conversation-list-fetcher.cjs +27 -3
- package/dist/threads/conversation-list-fetcher.cjs.map +1 -1
- package/dist/threads/conversation-list-fetcher.d.ts +16 -3
- package/dist/threads/conversation-list-fetcher.js +27 -3
- package/dist/threads/conversation-list-fetcher.js.map +1 -1
- package/dist/threads/index.d.ts +5 -1
- package/dist/threads/session-list-model.cjs +130 -0
- package/dist/threads/session-list-model.cjs.map +1 -0
- package/dist/threads/session-list-model.d.ts +62 -0
- package/dist/threads/session-list-model.js +130 -0
- package/dist/threads/session-list-model.js.map +1 -0
- package/dist/threads/statewire-thread-list.cjs +220 -38
- package/dist/threads/statewire-thread-list.cjs.map +1 -1
- package/dist/threads/statewire-thread-list.d.ts +152 -2
- package/dist/threads/statewire-thread-list.js +222 -40
- package/dist/threads/statewire-thread-list.js.map +1 -1
- package/dist/threads/thread-prefetcher.cjs +63 -0
- package/dist/threads/thread-prefetcher.cjs.map +1 -0
- package/dist/threads/thread-prefetcher.d.ts +54 -0
- package/dist/threads/thread-prefetcher.js +63 -0
- package/dist/threads/thread-prefetcher.js.map +1 -0
- package/dist/threads/use-athena-session-attention.cjs +22 -0
- package/dist/threads/use-athena-session-attention.cjs.map +1 -0
- package/dist/threads/use-athena-session-attention.d.ts +24 -0
- package/dist/threads/use-athena-session-attention.js +22 -0
- package/dist/threads/use-athena-session-attention.js.map +1 -0
- package/dist/threads/use-rest-conversation-history.cjs +25 -2
- package/dist/threads/use-rest-conversation-history.cjs.map +1 -1
- package/dist/threads/use-rest-conversation-history.d.ts +8 -1
- package/dist/threads/use-rest-conversation-history.js +25 -2
- package/dist/threads/use-rest-conversation-history.js.map +1 -1
- package/dist/threads/use-statewire-conversation-history.cjs +40 -16
- package/dist/threads/use-statewire-conversation-history.cjs.map +1 -1
- package/dist/threads/use-statewire-conversation-history.d.ts +13 -0
- package/dist/threads/use-statewire-conversation-history.js +40 -16
- package/dist/threads/use-statewire-conversation-history.js.map +1 -1
- package/dist/threads/use-thread-archive.cjs +128 -0
- package/dist/threads/use-thread-archive.cjs.map +1 -0
- package/dist/threads/use-thread-archive.d.ts +26 -0
- package/dist/threads/use-thread-archive.js +128 -0
- package/dist/threads/use-thread-archive.js.map +1 -0
- package/dist/threads/use-thread-favorite.cjs +53 -0
- package/dist/threads/use-thread-favorite.cjs.map +1 -0
- package/dist/threads/use-thread-favorite.d.ts +49 -0
- package/dist/threads/use-thread-favorite.js +53 -0
- package/dist/threads/use-thread-favorite.js.map +1 -0
- package/dist/threads/use-thread-field-override.cjs +184 -0
- package/dist/threads/use-thread-field-override.cjs.map +1 -0
- package/dist/threads/use-thread-field-override.d.ts +55 -0
- package/dist/threads/use-thread-field-override.js +184 -0
- package/dist/threads/use-thread-field-override.js.map +1 -0
- package/dist/threads/use-thread-rename.cjs +53 -0
- package/dist/threads/use-thread-rename.cjs.map +1 -0
- package/dist/threads/use-thread-rename.d.ts +48 -0
- package/dist/threads/use-thread-rename.js +53 -0
- package/dist/threads/use-thread-rename.js.map +1 -0
- package/dist/tools/index.cjs +5 -1
- package/dist/tools/index.cjs.map +1 -1
- package/dist/tools/index.d.ts +1 -1
- package/dist/tools/index.js +7 -3
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/misc-tool-uis.cjs +2 -1
- package/dist/tools/misc-tool-uis.cjs.map +1 -1
- package/dist/tools/misc-tool-uis.js +2 -1
- package/dist/tools/misc-tool-uis.js.map +1 -1
- package/dist/tools/primitives.cjs +25 -2
- package/dist/tools/primitives.cjs.map +1 -1
- package/dist/tools/primitives.d.ts +9 -2
- package/dist/tools/primitives.js +26 -3
- package/dist/tools/primitives.js.map +1 -1
- package/dist/tools/tool-appearance.cjs +11 -0
- package/dist/tools/tool-appearance.cjs.map +1 -0
- package/dist/tools/tool-appearance.d.ts +29 -0
- package/dist/tools/tool-appearance.js +11 -0
- package/dist/tools/tool-appearance.js.map +1 -0
- package/dist/tools/tool-fallback.cjs +211 -13
- package/dist/tools/tool-fallback.cjs.map +1 -1
- package/dist/tools/tool-fallback.d.ts +31 -4
- package/dist/tools/tool-fallback.js +214 -16
- package/dist/tools/tool-fallback.js.map +1 -1
- package/dist/tools/use-elapsed-seconds.cjs +24 -0
- package/dist/tools/use-elapsed-seconds.cjs.map +1 -0
- package/dist/tools/use-elapsed-seconds.d.ts +10 -0
- package/dist/tools/use-elapsed-seconds.js +24 -0
- package/dist/tools/use-elapsed-seconds.js.map +1 -0
- package/dist/tools/voice-update-tool-ui.cjs +2 -1
- package/dist/tools/voice-update-tool-ui.cjs.map +1 -1
- package/dist/tools/voice-update-tool-ui.js +2 -1
- package/dist/tools/voice-update-tool-ui.js.map +1 -1
- package/package.json +1 -1
- package/src/chat-ui/tailwind-preset.js +14 -1
package/dist/index.d.ts
CHANGED
|
@@ -6,6 +6,8 @@ export { useAthenaDiagnostics } from './diagnostics/useAthenaDiagnostics';
|
|
|
6
6
|
export { ATHENA_SDK_ERROR_CODES, AthenaSdkError, isAthenaSdkError, readRejectionDetail, toAthenaSdkError, } from './diagnostics/errors';
|
|
7
7
|
export type { AthenaSdkErrorCode, AthenaSdkErrorOptions } from './diagnostics/errors';
|
|
8
8
|
export { COLLAB_AGENT_REF_PREFIX, COLLAB_AGENT_REF_SHAPE, parseCollabAgentRef, resolveAgentProp, } from './runtime/statewire-run-config';
|
|
9
|
+
export { ATHENA_REPO_SEARCH_PATH, fetchRepoSearch, repoSearchRequestBody, useAthenaRepoSearch, } from './search/useAthenaRepoSearch';
|
|
10
|
+
export type { AthenaRepoSearchHit, AthenaRepoSearchMode, AthenaRepoSearchParams, AthenaRepoSearchRequestBody, AthenaRepoSearchResponse, UseAthenaRepoSearchOptions, } from './search/useAthenaRepoSearch';
|
|
9
11
|
export { AthenaProvider } from './provider/AthenaProvider';
|
|
10
12
|
export type { AthenaProviderProps } from './provider/AthenaProvider';
|
|
11
13
|
export type { AthenaProviderConfig } from './provider/config';
|
|
@@ -15,7 +17,8 @@ export { getPostHogInstance } from './provider/PostHogProvider';
|
|
|
15
17
|
export { capturePosthogEvent, capturePosthogException, getPosthogCaptureGate, wrapPosthogClient, } from './lib/posthog/wrap-posthog-client';
|
|
16
18
|
export { buildCoalescedCaptureProperties, isCriticalPosthogEvent, withCaptureGateBypass, type CaptureGateSnapshot, type CoalescedCapturePayload, } from './lib/posthog/capture-gate';
|
|
17
19
|
export { AthenaAssistantActionBar, AthenaAssistantMessage, AthenaChat, AthenaReasoningPart, AthenaUserMessage, } from './chat/AthenaChat';
|
|
18
|
-
export type { AthenaAssistantActionBarProps, AthenaAssistantMessageProps, AthenaChatComponents, AthenaChatMessagePartComponents, AthenaChatProps, AthenaReasoningPartProps, AthenaUserMessageProps,
|
|
20
|
+
export type { AthenaAssistantActionBarProps, AthenaAssistantMessageProps, AthenaChatComponents, AthenaChatMessagePartComponents, AthenaChatProps, AthenaReasoningPartProps, AthenaUserMessageProps, } from './chat/AthenaChat';
|
|
21
|
+
export type { WelcomeSuggestion } from './chat/athena-chat-welcome';
|
|
19
22
|
export { AthenaChatErrorBoundary } from './chat/AthenaChatErrorBoundary';
|
|
20
23
|
export { type ActivityItem, type ActivityPhase, type ActivityTimelineOptions, type ActivityToolState, buildActivityTimeline, CollapsibleGroup, type CollapsibleGroupProps, countActivityTools, createToolBasedGroupingFunction, DEFAULT_TOOLKIT_THEME, defaultGetToolGroupKey, excludeFinalTextFromGroups, type FinalTextPart, getActivityItemLabel, getActivitySummary, getActivityToolState, getFinalText, type GetToolGroupKey, type GroupablePart, type GroupingFunction, type MessagePartGroup, resetRememberedExpansionsForTests, resolveActivityPhase, SuperGroupingCard, type SuperGroupingCardProps, SuperGroupingFinalText, SuperGroupingProvider, TOOLKIT_THEMES, type ToolGroupKeyOptions, type ToolkitTheme, useActivityExpansion, } from './chat/super-grouping';
|
|
21
24
|
export { StatewireApprovalCard } from './chat/StatewireApprovalCard';
|
|
@@ -25,6 +28,7 @@ export type { StatewireApprovalRequest, StatewireInterruptPredicate, UseStatewir
|
|
|
25
28
|
export { useAthenaRunLive } from './chat/use-athena-run-live';
|
|
26
29
|
export { StatewireHistoryEdge } from './chat-ui/thread/statewire-history-edge';
|
|
27
30
|
export type { StatewireHistoryEdgeProps } from './chat-ui/thread/statewire-history-edge';
|
|
31
|
+
export { ThreadLoadingOverlay } from './chat-ui/thread/thread-loading-overlay';
|
|
28
32
|
export { useStatewireToolOutputs } from './provider/statewire-window-context';
|
|
29
33
|
export { ATHENA_SDK_MESSAGE_WINDOW } from './runtime/useAthenaStatewireRuntime';
|
|
30
34
|
export { StatewireQueuedMessages } from './chat/StatewireQueuedMessages';
|
|
@@ -36,8 +40,12 @@ export type { StatewireClientTool } from './chat/statewire-client-tools';
|
|
|
36
40
|
export { useAthenaStatewireLifecycle } from './provider/statewire-lifecycle-context';
|
|
37
41
|
export { athenaStatewireErrorNotice } from './runtime/statewire-lifecycle';
|
|
38
42
|
export type { AthenaStatewireErrorNotice, AthenaStatewireLifecycleState, } from './runtime/statewire-lifecycle';
|
|
39
|
-
export { useAthenaStatewireThreadList } from './threads/statewire-thread-list';
|
|
43
|
+
export { threadSummaryFromConversation, useAthenaStatewireThreadList, } from './threads/statewire-thread-list';
|
|
40
44
|
export type { AthenaStatewireThreadListState, AthenaStatewireThreadSummary, } from './threads/statewire-thread-list';
|
|
45
|
+
export { WaitingOnYouBanner, WaitingOnYouBannerView } from './chat/WaitingOnYouBanner';
|
|
46
|
+
export type { WaitingOnYouBannerProps, WaitingOnYouBannerViewProps, } from './chat/WaitingOnYouBanner';
|
|
47
|
+
export { WakeMarkerCard, WakeMarkerMessage } from './chat-ui/messages/wake-marker';
|
|
48
|
+
export type { WakeMarkerCardProps } from './chat-ui/messages/wake-marker';
|
|
41
49
|
export { asHitlApproval, hasStatewireThreadExtras, HITL_PENDING_RESUME_GRACE_MS, isPendingInterrupt, readInterruptMessage, } from './chat/statewire-approval';
|
|
42
50
|
export type { HitlApprovalPayload } from './chat/statewire-approval';
|
|
43
51
|
export { TiptapText } from './chat/tiptap-text';
|
|
@@ -58,8 +66,8 @@ export { useLatestTodoPlan } from './tools/todo-plan-store';
|
|
|
58
66
|
export type { LatestTodoPlan } from './tools/todo-plan-store';
|
|
59
67
|
export { EditFileToolUI, friendlyWorkspacePath, ListFilesToolUI, ReadFileToolUI, SearchFilesToolUI, WriteFileToolUI, } from './tools/file-tool-uis';
|
|
60
68
|
export type { PlanStep, PlanStepStatus, TodoPlan, } from './tools/write-todos-tool-ui';
|
|
61
|
-
export { ToolFallback, ToolFallbackRoot, ToolFallbackTrigger, ToolFallbackContent, ToolFallbackArgs, ToolFallbackResult, ToolFallbackError, ToolFallbackNotice, } from './tools/tool-fallback';
|
|
62
|
-
export type { ToolFallbackContext, ToolFallbackOptions, ToolFallbackProps, ToolFallbackRootProps, ToolFallbackTriggerProps, } from './tools/tool-fallback';
|
|
69
|
+
export { ToolFallback, ToolFallbackAppearanceProvider, ToolFallbackRoot, ToolFallbackTrigger, ToolFallbackContent, ToolFallbackArgs, ToolFallbackResult, ToolFallbackError, ToolFallbackNotice, useToolAppearance, } from './tools/tool-fallback';
|
|
70
|
+
export type { ToolAppearance, ToolFallbackContext, ToolFallbackOptions, ToolFallbackProps, ToolFallbackRootProps, ToolFallbackTriggerProps, } from './tools/tool-fallback';
|
|
63
71
|
export { VoiceUpdateCard, VoiceUpdateToolUI } from './tools/voice-update-tool-ui';
|
|
64
72
|
export type { VoiceUpdateCardProps } from './tools/voice-update-tool-ui';
|
|
65
73
|
export { VoiceDelegationCard, VoiceDelegationMessage, } from './chat-ui/messages/voice-delegation-card';
|
|
@@ -87,10 +95,21 @@ export type { AthenaCitationLinkMetadata, AthenaCitationLinkClickContext, Athena
|
|
|
87
95
|
export { clearAutoOpenedAssets } from './tools/tool-fallback';
|
|
88
96
|
export { ThreadList } from './threads/ThreadList';
|
|
89
97
|
export type { ThreadListProps } from './threads/ThreadList';
|
|
90
|
-
export
|
|
98
|
+
export { SessionList } from './threads/SessionList';
|
|
99
|
+
export type { SessionListProps } from './threads/SessionList';
|
|
100
|
+
export { useAthenaSessionAttention } from './threads/use-athena-session-attention';
|
|
101
|
+
export type { AthenaSessionAttention } from './threads/use-athena-session-attention';
|
|
102
|
+
export { groupSessions, pullRequestChip, pullRequestChipState, sessionIndicator, sessionListGroupOf, sessionOriginLabel, sessionSecondaryLine, } from './threads/session-list-model';
|
|
103
|
+
export type { PullRequestChip, PullRequestChipState, SessionIndicator, SessionLineTone, SessionListGroup, SessionListSection, SessionSecondaryLine, } from './threads/session-list-model';
|
|
104
|
+
export { deriveConversationAttention, githubWakeEventLabel, githubWakeMarkerText, isGithubWakeMessage, readGithubWakeEvent, } from '@athenaintel/agent-runtime';
|
|
105
|
+
export type { ConversationAttention, ConversationAttentionSource, ConversationPullRequest, ConversationSummary, ConversationWake, GithubWakeEvent, } from '@athenaintel/agent-runtime';
|
|
106
|
+
export type { ThreadFavoriteResponse, ThreadPullRequest, ThreadRenameResponse, ThreadSummary, ThreadWake, } from './threads/api';
|
|
91
107
|
export { useRefreshThreadList } from './threads/statewire-thread-list';
|
|
92
|
-
export { useAthenaThreadId, AthenaThreadIdContext } from './threads/thread-id-context';
|
|
93
|
-
export { listThreads, archiveThread, getThreadState, createThread, setThreadReadState } from './threads/api';
|
|
108
|
+
export { useAthenaThreadId, AthenaThreadIdContext, useAthenaStatewireThreadId, } from './threads/thread-id-context';
|
|
109
|
+
export { listThreads, archiveThread, getThreadState, createThread, renameThread, setThreadReadState, setThreadFavorite, isThreadArchiveUnavailableError, isThreadFavoriteUnavailableError, isThreadRenameUnavailableError, THREAD_TITLE_MAX_LENGTH, } from './threads/api';
|
|
110
|
+
export type { ThreadFavoriteTarget } from './threads/use-thread-favorite';
|
|
111
|
+
export type { ThreadRenameTarget } from './threads/use-thread-rename';
|
|
112
|
+
export { THREAD_PREFETCH_HOVER_DELAY_MS, THREAD_PREFETCH_MAX_CONCURRENT, } from './threads/thread-prefetcher';
|
|
94
113
|
export { conversationDisplayTitle, useRestConversationHistory, type RestConversationAuth, type UseRestConversationHistoryOptions, } from './threads/use-rest-conversation-history';
|
|
95
114
|
export { conversationSummaryFromIndexEntry, useStatewireConversationHistory, type UseStatewireConversationHistoryOptions, } from './threads/use-statewire-conversation-history';
|
|
96
115
|
export { useAthenaThreadManager } from './threads/useAthenaThreadManager';
|
package/dist/index.js
CHANGED
|
@@ -3,6 +3,7 @@ import { athenaDiagnostics, installAthenaDiagnosticsGlobal } from "./diagnostics
|
|
|
3
3
|
import { useAthenaDiagnostics } from "./diagnostics/useAthenaDiagnostics.js";
|
|
4
4
|
import { ATHENA_SDK_ERROR_CODES, AthenaSdkError, isAthenaSdkError, readRejectionDetail, toAthenaSdkError } from "./diagnostics/errors.js";
|
|
5
5
|
import { COLLAB_AGENT_REF_PREFIX, COLLAB_AGENT_REF_SHAPE, DEFAULT_STATEWIRE_MODEL, buildStatewireRunConfig, parseCollabAgentRef, resolveAgentProp } from "./runtime/statewire-run-config.js";
|
|
6
|
+
import { ATHENA_REPO_SEARCH_PATH, fetchRepoSearch, repoSearchRequestBody, useAthenaRepoSearch } from "./search/useAthenaRepoSearch.js";
|
|
6
7
|
import { AthenaProvider } from "./provider/AthenaProvider.js";
|
|
7
8
|
import { getPostHogInstance } from "./provider/PostHogProvider.js";
|
|
8
9
|
import { capturePosthogEvent, capturePosthogException, getPosthogCaptureGate, wrapPosthogClient } from "./lib/posthog/wrap-posthog-client.js";
|
|
@@ -18,6 +19,7 @@ import { StatewireApprovalCard } from "./chat/StatewireApprovalCard.js";
|
|
|
18
19
|
import { useStatewireApprovalRequest } from "./chat/use-statewire-approval-request.js";
|
|
19
20
|
import { useAthenaRunLive } from "./chat/use-athena-run-live.js";
|
|
20
21
|
import { StatewireHistoryEdge } from "./chat-ui/thread/statewire-history-edge.js";
|
|
22
|
+
import { ThreadLoadingOverlay } from "./chat-ui/thread/thread-loading-overlay.js";
|
|
21
23
|
import { useStatewireToolOutputs } from "./provider/statewire-window-context.js";
|
|
22
24
|
import { ATHENA_SDK_MESSAGE_WINDOW, useAthenaStatewireRuntime } from "./runtime/useAthenaStatewireRuntime.js";
|
|
23
25
|
import { StatewireQueuedMessages } from "./chat/StatewireQueuedMessages.js";
|
|
@@ -26,7 +28,9 @@ import { StatewireClientToolBridge } from "./chat/StatewireClientToolBridge.js";
|
|
|
26
28
|
import { collectStatewireClientTools, statewireClientToolWireEntries } from "./chat/statewire-client-tools.js";
|
|
27
29
|
import { useAthenaStatewireLifecycle } from "./provider/statewire-lifecycle-context.js";
|
|
28
30
|
import { athenaStatewireErrorNotice } from "./runtime/statewire-lifecycle.js";
|
|
29
|
-
import { useAthenaStatewireThreadList, useRefreshThreadList } from "./threads/statewire-thread-list.js";
|
|
31
|
+
import { threadSummaryFromConversation, useAthenaStatewireThreadList, useRefreshThreadList } from "./threads/statewire-thread-list.js";
|
|
32
|
+
import { WaitingOnYouBanner, WaitingOnYouBannerView } from "./chat/WaitingOnYouBanner.js";
|
|
33
|
+
import { WakeMarkerCard, WakeMarkerMessage } from "./chat-ui/messages/wake-marker.js";
|
|
30
34
|
import { TiptapText } from "./chat/tiptap-text.js";
|
|
31
35
|
import { isAthenaCitationUrl, parseAthenaCitationLink, useAthenaCitationLinkHandler, useAthenaLinkClickHandler } from "./chat/athena-citation-links.js";
|
|
32
36
|
import { TooltipIconButton } from "./chat/tooltip-icon-button.js";
|
|
@@ -39,6 +43,7 @@ import "react";
|
|
|
39
43
|
import "@assistant-ui/tap";
|
|
40
44
|
import "statewire";
|
|
41
45
|
import "./packages/agent-runtime/src/statewire-suspended.js";
|
|
46
|
+
import { deriveConversationAttention } from "./packages/agent-runtime/src/conversation-list.js";
|
|
42
47
|
import { describeToolArgs, formatToolName, getToolDisplayMeta, toolActiveLabel, toolCompletedLabel } from "./packages/agent-runtime/src/tool-metadata.js";
|
|
43
48
|
import { classifyToolResult, isToolResultSuccess, resultMessage } from "./packages/agent-runtime/src/tool-result.js";
|
|
44
49
|
import "@tanstack/react-query";
|
|
@@ -46,17 +51,18 @@ import { HITL_PENDING_RESUME_GRACE_MS, asHitlApproval, isPendingInterrupt, readI
|
|
|
46
51
|
import "./packages/agent-runtime/src/messages.js";
|
|
47
52
|
import "./packages/agent-runtime/src/statewire-state.js";
|
|
48
53
|
import { hasStatewireThreadExtras } from "./packages/agent-runtime/src/thread-extras.js";
|
|
49
|
-
import "@assistant-ui/react-statewire";
|
|
50
54
|
import "@assistant-ui/store";
|
|
51
55
|
import "./packages/agent-runtime/src/quota-safe-local-storage-session.js";
|
|
52
56
|
import "./packages/agent-runtime/src/statewire-attach-observer.js";
|
|
53
57
|
import "./packages/agent-runtime/src/thread-status.js";
|
|
58
|
+
import "@assistant-ui/react-statewire";
|
|
59
|
+
import { githubWakeEventLabel, githubWakeMarkerText, isGithubWakeMessage, readGithubWakeEvent } from "./packages/agent-runtime/src/github-wake-event.js";
|
|
54
60
|
import "@assistant-ui/core";
|
|
55
61
|
import "./packages/agent-runtime/src/thread-handoff.js";
|
|
56
62
|
import { HiddenWriteTodosToolUI, WriteTodosToolUI, parseTodoPlan } from "./tools/write-todos-tool-ui.js";
|
|
57
63
|
import { useLatestTodoPlan } from "./tools/todo-plan-store.js";
|
|
58
64
|
import { EditFileToolUI, ListFilesToolUI, ReadFileToolUI, SearchFilesToolUI, WriteFileToolUI, friendlyWorkspacePath } from "./tools/file-tool-uis.js";
|
|
59
|
-
import { ToolFallback, ToolFallbackArgs, ToolFallbackContent, ToolFallbackError, ToolFallbackNotice, ToolFallbackResult, ToolFallbackRoot, ToolFallbackTrigger, clearAutoOpenedAssets } from "./tools/tool-fallback.js";
|
|
65
|
+
import { ToolFallback, ToolFallbackAppearanceProvider, ToolFallbackArgs, ToolFallbackContent, ToolFallbackError, ToolFallbackNotice, ToolFallbackResult, ToolFallbackRoot, ToolFallbackTrigger, clearAutoOpenedAssets } from "./tools/tool-fallback.js";
|
|
60
66
|
import { VoiceUpdateCard, VoiceUpdateToolUI } from "./tools/voice-update-tool-ui.js";
|
|
61
67
|
import { VoiceDelegationCard, VoiceDelegationMessage } from "./chat-ui/messages/voice-delegation-card.js";
|
|
62
68
|
import { NestedPtcComponentsProvider, NestedPtcMessages, useNestedPtcComponents } from "./tools/NestedPtcMessages.js";
|
|
@@ -71,8 +77,12 @@ import { useAssetPanelStore } from "./assets/asset-panel-store.js";
|
|
|
71
77
|
import { useAssetEmbed } from "./assets/use-asset-embed.js";
|
|
72
78
|
import { useAthenaConfig } from "./provider/AthenaContext.js";
|
|
73
79
|
import { ThreadList } from "./threads/ThreadList.js";
|
|
74
|
-
import {
|
|
75
|
-
import {
|
|
80
|
+
import { SessionList } from "./threads/SessionList.js";
|
|
81
|
+
import { useAthenaSessionAttention } from "./threads/use-athena-session-attention.js";
|
|
82
|
+
import { groupSessions, pullRequestChip, pullRequestChipState, sessionIndicator, sessionListGroupOf, sessionOriginLabel, sessionSecondaryLine } from "./threads/session-list-model.js";
|
|
83
|
+
import { AthenaThreadIdContext, useAthenaStatewireThreadId, useAthenaThreadId } from "./threads/thread-id-context.js";
|
|
84
|
+
import { THREAD_TITLE_MAX_LENGTH, archiveThread, createThread, getThreadState, isThreadArchiveUnavailableError, isThreadFavoriteUnavailableError, isThreadRenameUnavailableError, listThreads, renameThread, setThreadFavorite, setThreadReadState } from "./threads/api.js";
|
|
85
|
+
import { THREAD_PREFETCH_HOVER_DELAY_MS, THREAD_PREFETCH_MAX_CONCURRENT } from "./threads/thread-prefetcher.js";
|
|
76
86
|
import { conversationDisplayTitle, useRestConversationHistory } from "./threads/use-rest-conversation-history.js";
|
|
77
87
|
import { conversationSummaryFromIndexEntry, useStatewireConversationHistory } from "./threads/use-statewire-conversation-history.js";
|
|
78
88
|
import { useAthenaThreadManager } from "./threads/useAthenaThreadManager.js";
|
|
@@ -92,8 +102,10 @@ import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "./ui/collap
|
|
|
92
102
|
import { Toolkits } from "./toolkits/index.js";
|
|
93
103
|
import { themeToStyleVars, themes } from "./theme/index.js";
|
|
94
104
|
import { cn } from "cnfast";
|
|
105
|
+
import { useToolAppearance } from "./tools/tool-appearance.js";
|
|
95
106
|
export {
|
|
96
107
|
ATHENA_REACT_SDK_VERSION,
|
|
108
|
+
ATHENA_REPO_SEARCH_PATH,
|
|
97
109
|
ATHENA_SDK_ERROR_CODES,
|
|
98
110
|
ATHENA_SDK_MESSAGE_WINDOW,
|
|
99
111
|
AppendDocumentToolUI,
|
|
@@ -150,6 +162,7 @@ export {
|
|
|
150
162
|
RunPythonCodeToolUI,
|
|
151
163
|
RunSqlToolUI,
|
|
152
164
|
SearchFilesToolUI,
|
|
165
|
+
SessionList,
|
|
153
166
|
StatewireApprovalCard,
|
|
154
167
|
StatewireClientToolBridge,
|
|
155
168
|
StatewireConnectionBanner,
|
|
@@ -159,13 +172,18 @@ export {
|
|
|
159
172
|
SuperGroupingCard,
|
|
160
173
|
SuperGroupingFinalText,
|
|
161
174
|
SuperGroupingProvider,
|
|
175
|
+
THREAD_PREFETCH_HOVER_DELAY_MS,
|
|
176
|
+
THREAD_PREFETCH_MAX_CONCURRENT,
|
|
177
|
+
THREAD_TITLE_MAX_LENGTH,
|
|
162
178
|
TOOLKIT_THEMES,
|
|
163
179
|
TOOL_ICONS,
|
|
164
180
|
TOOL_UI_REGISTRY,
|
|
165
181
|
ThreadList,
|
|
182
|
+
ThreadLoadingOverlay,
|
|
166
183
|
TiptapText,
|
|
167
184
|
ToolCard,
|
|
168
185
|
ToolFallback,
|
|
186
|
+
ToolFallbackAppearanceProvider,
|
|
169
187
|
ToolFallbackArgs,
|
|
170
188
|
ToolFallbackContent,
|
|
171
189
|
ToolFallbackError,
|
|
@@ -184,6 +202,10 @@ export {
|
|
|
184
202
|
VoiceDelegationMessage,
|
|
185
203
|
VoiceUpdateCard,
|
|
186
204
|
VoiceUpdateToolUI,
|
|
205
|
+
WaitingOnYouBanner,
|
|
206
|
+
WaitingOnYouBannerView,
|
|
207
|
+
WakeMarkerCard,
|
|
208
|
+
WakeMarkerMessage,
|
|
187
209
|
WebSearchToolUI,
|
|
188
210
|
WriteFileToolUI,
|
|
189
211
|
WriteTodosToolUI,
|
|
@@ -211,9 +233,11 @@ export {
|
|
|
211
233
|
defaultGetToolGroupKey,
|
|
212
234
|
deriveAthenaApiUrl,
|
|
213
235
|
deriveAthenaAppUrl,
|
|
236
|
+
deriveConversationAttention,
|
|
214
237
|
deriveStatewireSyncUrl,
|
|
215
238
|
describeToolArgs,
|
|
216
239
|
excludeFinalTextFromGroups,
|
|
240
|
+
fetchRepoSearch,
|
|
217
241
|
formatToolName,
|
|
218
242
|
friendlyWorkspacePath,
|
|
219
243
|
getActivityItemLabel,
|
|
@@ -225,30 +249,48 @@ export {
|
|
|
225
249
|
getPosthogCaptureGate,
|
|
226
250
|
getThreadState,
|
|
227
251
|
getToolDisplayMeta,
|
|
252
|
+
githubWakeEventLabel,
|
|
253
|
+
githubWakeMarkerText,
|
|
254
|
+
groupSessions,
|
|
228
255
|
hasStatewireThreadExtras,
|
|
229
256
|
installAthenaDiagnosticsGlobal,
|
|
230
257
|
isAthenaCitationUrl,
|
|
231
258
|
isAthenaSdkError,
|
|
232
259
|
isCriticalPosthogEvent,
|
|
260
|
+
isGithubWakeMessage,
|
|
233
261
|
isPendingInterrupt,
|
|
262
|
+
isThreadArchiveUnavailableError,
|
|
263
|
+
isThreadFavoriteUnavailableError,
|
|
264
|
+
isThreadRenameUnavailableError,
|
|
234
265
|
isToolResultSuccess,
|
|
235
266
|
listThreads,
|
|
236
267
|
normalizeResult,
|
|
237
268
|
parseAthenaCitationLink,
|
|
238
269
|
parseCollabAgentRef,
|
|
239
270
|
parseTodoPlan,
|
|
271
|
+
pullRequestChip,
|
|
272
|
+
pullRequestChipState,
|
|
273
|
+
readGithubWakeEvent,
|
|
240
274
|
readInterruptMessage,
|
|
241
275
|
readRejectionDetail,
|
|
276
|
+
renameThread,
|
|
277
|
+
repoSearchRequestBody,
|
|
242
278
|
resetAssetAutoOpen,
|
|
243
279
|
resetRememberedExpansionsForTests,
|
|
244
280
|
resolveActivityPhase,
|
|
245
281
|
resolveAgentProp,
|
|
246
282
|
resolveStatewireSyncUrl,
|
|
247
283
|
resultMessage,
|
|
284
|
+
sessionIndicator,
|
|
285
|
+
sessionListGroupOf,
|
|
286
|
+
sessionOriginLabel,
|
|
287
|
+
sessionSecondaryLine,
|
|
288
|
+
setThreadFavorite,
|
|
248
289
|
setThreadReadState,
|
|
249
290
|
statewireClientToolWireEntries,
|
|
250
291
|
themeToStyleVars,
|
|
251
292
|
themes,
|
|
293
|
+
threadSummaryFromConversation,
|
|
252
294
|
toAthenaSdkError,
|
|
253
295
|
toolActiveLabel,
|
|
254
296
|
toolCompletedLabel,
|
|
@@ -263,9 +305,12 @@ export {
|
|
|
263
305
|
useAthenaConfig,
|
|
264
306
|
useAthenaDiagnostics,
|
|
265
307
|
useAthenaLinkClickHandler,
|
|
308
|
+
useAthenaRepoSearch,
|
|
266
309
|
useAthenaRunLive,
|
|
310
|
+
useAthenaSessionAttention,
|
|
267
311
|
useAthenaStatewireLifecycle,
|
|
268
312
|
useAthenaStatewireRuntime,
|
|
313
|
+
useAthenaStatewireThreadId,
|
|
269
314
|
useAthenaStatewireThreadList,
|
|
270
315
|
useAthenaThreadId,
|
|
271
316
|
useAthenaThreadManager,
|
|
@@ -282,6 +327,7 @@ export {
|
|
|
282
327
|
useStatewireApprovalRequest,
|
|
283
328
|
useStatewireConversationHistory,
|
|
284
329
|
useStatewireToolOutputs,
|
|
330
|
+
useToolAppearance,
|
|
285
331
|
withCaptureGateBypass,
|
|
286
332
|
wrapPosthogClient
|
|
287
333
|
};
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const react = require("react");
|
|
4
|
+
const REDUCED_MOTION_QUERY = "(prefers-reduced-motion: reduce)";
|
|
5
|
+
function mediaQuery() {
|
|
6
|
+
if (typeof window === "undefined" || typeof window.matchMedia !== "function") {
|
|
7
|
+
return null;
|
|
8
|
+
}
|
|
9
|
+
return window.matchMedia(REDUCED_MOTION_QUERY);
|
|
10
|
+
}
|
|
11
|
+
function subscribe(onChange) {
|
|
12
|
+
const media = mediaQuery();
|
|
13
|
+
if (!media) return () => {
|
|
14
|
+
};
|
|
15
|
+
media.addEventListener("change", onChange);
|
|
16
|
+
return () => media.removeEventListener("change", onChange);
|
|
17
|
+
}
|
|
18
|
+
function getSnapshot() {
|
|
19
|
+
var _a;
|
|
20
|
+
return ((_a = mediaQuery()) == null ? void 0 : _a.matches) ?? false;
|
|
21
|
+
}
|
|
22
|
+
function getServerSnapshot() {
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
function usePrefersReducedMotion() {
|
|
26
|
+
return react.useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
|
|
27
|
+
}
|
|
28
|
+
exports.usePrefersReducedMotion = usePrefersReducedMotion;
|
|
29
|
+
//# sourceMappingURL=use-prefers-reduced-motion.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-prefers-reduced-motion.cjs","sources":["../../src/lib/use-prefers-reduced-motion.ts"],"sourcesContent":["import { useSyncExternalStore } from \"react\";\n\nconst REDUCED_MOTION_QUERY = \"(prefers-reduced-motion: reduce)\";\n\nfunction mediaQuery(): MediaQueryList | null {\n if (typeof window === \"undefined\" || typeof window.matchMedia !== \"function\") {\n return null;\n }\n return window.matchMedia(REDUCED_MOTION_QUERY);\n}\n\nfunction subscribe(onChange: () => void): () => void {\n const media = mediaQuery();\n if (!media) return () => {};\n media.addEventListener(\"change\", onChange);\n return () => media.removeEventListener(\"change\", onChange);\n}\n\nfunction getSnapshot(): boolean {\n return mediaQuery()?.matches ?? false;\n}\n\nfunction getServerSnapshot(): boolean {\n return false;\n}\n\n/**\n * Whether the viewer asked the OS for reduced motion. Read synchronously on\n * the client's first render (no animate-then-cancel flash); `false` on the\n * server and in environments without `matchMedia`.\n */\nexport function usePrefersReducedMotion(): boolean {\n return useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);\n}\n"],"names":["useSyncExternalStore"],"mappings":";;;AAEA,MAAM,uBAAuB;AAE7B,SAAS,aAAoC;AAC3C,MAAI,OAAO,WAAW,eAAe,OAAO,OAAO,eAAe,YAAY;AAC5E,WAAO;AAAA,EACT;AACA,SAAO,OAAO,WAAW,oBAAoB;AAC/C;AAEA,SAAS,UAAU,UAAkC;AACnD,QAAM,QAAQ,WAAA;AACd,MAAI,CAAC,MAAO,QAAO,MAAM;AAAA,EAAC;AAC1B,QAAM,iBAAiB,UAAU,QAAQ;AACzC,SAAO,MAAM,MAAM,oBAAoB,UAAU,QAAQ;AAC3D;AAEA,SAAS,cAAuB;;AAC9B,WAAO,gBAAA,MAAA,mBAAc,YAAW;AAClC;AAEA,SAAS,oBAA6B;AACpC,SAAO;AACT;AAOO,SAAS,0BAAmC;AACjD,SAAOA,2BAAqB,WAAW,aAAa,iBAAiB;AACvE;;"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether the viewer asked the OS for reduced motion. Read synchronously on
|
|
3
|
+
* the client's first render (no animate-then-cancel flash); `false` on the
|
|
4
|
+
* server and in environments without `matchMedia`.
|
|
5
|
+
*/
|
|
6
|
+
export declare function usePrefersReducedMotion(): boolean;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { useSyncExternalStore } from "react";
|
|
2
|
+
const REDUCED_MOTION_QUERY = "(prefers-reduced-motion: reduce)";
|
|
3
|
+
function mediaQuery() {
|
|
4
|
+
if (typeof window === "undefined" || typeof window.matchMedia !== "function") {
|
|
5
|
+
return null;
|
|
6
|
+
}
|
|
7
|
+
return window.matchMedia(REDUCED_MOTION_QUERY);
|
|
8
|
+
}
|
|
9
|
+
function subscribe(onChange) {
|
|
10
|
+
const media = mediaQuery();
|
|
11
|
+
if (!media) return () => {
|
|
12
|
+
};
|
|
13
|
+
media.addEventListener("change", onChange);
|
|
14
|
+
return () => media.removeEventListener("change", onChange);
|
|
15
|
+
}
|
|
16
|
+
function getSnapshot() {
|
|
17
|
+
var _a;
|
|
18
|
+
return ((_a = mediaQuery()) == null ? void 0 : _a.matches) ?? false;
|
|
19
|
+
}
|
|
20
|
+
function getServerSnapshot() {
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
function usePrefersReducedMotion() {
|
|
24
|
+
return useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
|
|
25
|
+
}
|
|
26
|
+
export {
|
|
27
|
+
usePrefersReducedMotion
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=use-prefers-reduced-motion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-prefers-reduced-motion.js","sources":["../../src/lib/use-prefers-reduced-motion.ts"],"sourcesContent":["import { useSyncExternalStore } from \"react\";\n\nconst REDUCED_MOTION_QUERY = \"(prefers-reduced-motion: reduce)\";\n\nfunction mediaQuery(): MediaQueryList | null {\n if (typeof window === \"undefined\" || typeof window.matchMedia !== \"function\") {\n return null;\n }\n return window.matchMedia(REDUCED_MOTION_QUERY);\n}\n\nfunction subscribe(onChange: () => void): () => void {\n const media = mediaQuery();\n if (!media) return () => {};\n media.addEventListener(\"change\", onChange);\n return () => media.removeEventListener(\"change\", onChange);\n}\n\nfunction getSnapshot(): boolean {\n return mediaQuery()?.matches ?? false;\n}\n\nfunction getServerSnapshot(): boolean {\n return false;\n}\n\n/**\n * Whether the viewer asked the OS for reduced motion. Read synchronously on\n * the client's first render (no animate-then-cancel flash); `false` on the\n * server and in environments without `matchMedia`.\n */\nexport function usePrefersReducedMotion(): boolean {\n return useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);\n}\n"],"names":[],"mappings":";AAEA,MAAM,uBAAuB;AAE7B,SAAS,aAAoC;AAC3C,MAAI,OAAO,WAAW,eAAe,OAAO,OAAO,eAAe,YAAY;AAC5E,WAAO;AAAA,EACT;AACA,SAAO,OAAO,WAAW,oBAAoB;AAC/C;AAEA,SAAS,UAAU,UAAkC;AACnD,QAAM,QAAQ,WAAA;AACd,MAAI,CAAC,MAAO,QAAO,MAAM;AAAA,EAAC;AAC1B,QAAM,iBAAiB,UAAU,QAAQ;AACzC,SAAO,MAAM,MAAM,oBAAoB,UAAU,QAAQ;AAC3D;AAEA,SAAS,cAAuB;;AAC9B,WAAO,gBAAA,MAAA,mBAAc,YAAW;AAClC;AAEA,SAAS,oBAA6B;AACpC,SAAO;AACT;AAOO,SAAS,0BAAmC;AACjD,SAAO,qBAAqB,WAAW,aAAa,iBAAiB;AACvE;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation-index.cjs","sources":["../../../../../agent-runtime/src/conversation-index.ts"],"sourcesContent":["import { withKey } from '@assistant-ui/tap';\nimport { useCallback, useEffect, useRef, useState } from 'react';\nimport { useStatewire, type StatewireClient } from 'statewire';\nimport { initialAuthDenialTrackerState, observeAuthDenial } from './auth-denial';\nimport { projectDeepAgentConnection } from './errors';\nimport { StatewireSuspended } from './statewire-suspended';\nimport { statewireTransport } from './statewire-transport';\nimport type { DeepAgentHeadersResolver } from './use-deep-agent-thread';\n\n/**\n * Client side of the conversation-index statewire (issue #29088): agora\n * replicates the newest page of one viewer's conversation list as one state\n * object, so thread creation / lifecycle / title changes arrive as ops\n * instead of newest-page polling. The replicated rows are renderable and the\n * typed commands extend or refresh the inclusive window; reconnects are free\n * because the protocol's snapshot-first attach IS the newest-page reconcile.\n *\n * A viewer is a `(workspaceId, userId)` pair and every pair is its own\n * instance (`/conversation-index/<workspaceId>-<userId>`): workspaces are\n * tenants, so a tab in one workspace never shares a window with a tab in\n * another, and switching workspaces attaches to a different instance instead\n * of retagging the one other tabs are still reading.\n */\nexport interface ConversationIndexEntry {\n thread_id: string;\n title: string;\n updated_at: string;\n state: string | null;\n runtime: string | null;\n start_channel: string | null;\n asset_type: string;\n asset_id: string | null;\n app_id: string | null;\n trigger_type: string | null;\n last_message_preview: string | null;\n message_count: number | null;\n is_unread: boolean | null;\n /**\n * Canonical status_v2 planes, present once the publishing agora reports them\n * (absent from snapshots replicated by an older pod during a rollout).\n */\n session_status?: string | null;\n run_status?: string | null;\n}\n\ninterface ConversationIndexState {\n conversations?: ConversationIndexEntry[];\n has_more?: boolean;\n total_count?: number;\n}\n\ninterface ConversationIndexCommands {\n [key: string]: (...args: never[]) => unknown;\n refresh(): void;\n load_more(): void;\n}\n\nexport interface UseConversationIndexOptions {\n /** Base URL of the conversation-index host (the `…/v2/conversation-index` mount). */\n baseUrl: string;\n /** The workspace being viewed — half of the instance id. Callers gate mounting on it. */\n workspaceId: string;\n /** The signed-in user's id — the other half. Callers gate mounting on it. */\n userId: string;\n /** Transport selection: SSE when true, WebSocket otherwise. */\n sse?: boolean;\n headers: DeepAgentHeadersResolver;\n /** Park the transport until the caller has a resolved principal. */\n enabled?: boolean;\n}\n\nexport interface UseConversationIndexResult {\n /** Newest-page entries, or `null` until the attach snapshot applies. */\n entries: ConversationIndexEntry[] | null;\n hasNextPage: boolean;\n totalCount: number | null;\n connection: StatewireClient.Connection;\n refresh: () => Promise<void>;\n loadMore: () => Promise<void>;\n}\n\n/** The conversation-index host is mounted beside the threads host. */\nexport function conversationIndexUrlFromStatewireUrl(statewireUrl: string): string {\n return statewireUrl.replace(/\\/threads\\/?$/, '/conversation-index');\n}\n\n/** Instance id of one viewer's index; mirrors agora's `conversation_index_id`. */\nexport function conversationIndexId({\n workspaceId,\n userId,\n}: {\n workspaceId: string;\n userId: string;\n}): string {\n return `${workspaceId}-${userId}`;\n}\n\n/**\n * Attach to the live conversation index of one `(workspace, user)` viewer.\n */\nexport function useConversationIndex({\n baseUrl,\n workspaceId,\n userId,\n sse = false,\n headers,\n enabled = true,\n}: UseConversationIndexOptions): UseConversationIndexResult {\n const headersRef = useRef(headers);\n headersRef.current = headers;\n const indexId = conversationIndexId({ workspaceId, userId });\n // Auth-denial park (same policy as the thread transport): the index is a\n // pure push signal, so after a streak of `unauthorized` denials the retry\n // loop stops instead of hammering the attach endpoint every 30s for as long\n // as the tab lives. A remount or the parked connection's `reconnect()`\n // re-arms it.\n const [parked, setParked] = useState<{ indexId: string; message: string | undefined } | null>(\n null\n );\n const denialRef = useRef({ indexId, state: initialAuthDenialTrackerState() });\n if (denialRef.current.indexId !== indexId) {\n denialRef.current = { indexId, state: initialAuthDenialTrackerState() };\n }\n const isParked = parked !== null && parked.indexId === indexId;\n const client = useStatewire<ConversationIndexState | undefined, ConversationIndexCommands>({\n transport: withKey(\n indexId,\n !enabled || isParked\n ? StatewireSuspended<ConversationIndexCommands>({\n message:\n parked?.message ??\n (enabled\n ? 'Conversation index authorization was refused.'\n : 'Conversation index is waiting for a signed-in user and workspace.'),\n ...(enabled\n ? {\n onReconnectRequested: () => {\n denialRef.current = { indexId, state: initialAuthDenialTrackerState() };\n setParked(null);\n },\n }\n : {}),\n })\n : statewireTransport<ConversationIndexState, ConversationIndexCommands>(\n {\n url: `${baseUrl.replace(/\\/+$/, '')}/${encodeURIComponent(indexId)}`,\n headers: (ctx: { staleAuth: boolean }) => headersRef.current(ctx),\n },\n { sse }\n )\n ),\n initialState: undefined,\n });\n // Observing during render is idempotent (the tracker dedupes by attempt\n // number), so a re-render of the same connection state cannot double-count.\n // The tracker consumes the projected vocabulary, never the raw connection.\n const denial = observeAuthDenial(\n denialRef.current.state,\n projectDeepAgentConnection(client.connection)\n );\n denialRef.current.state = denial.state;\n const shouldPark = denial.park;\n const parkMessage = denial.state.message;\n useEffect(() => {\n if (!enabled || !shouldPark) return;\n setParked((prev) =>\n prev?.indexId === indexId ? prev : { indexId, message: parkMessage }\n );\n }, [enabled, shouldPark, parkMessage, indexId]);\n const commandsRef = useRef(client.commands);\n commandsRef.current = client.commands;\n const refresh = useCallback(() => commandsRef.current.refresh(), []);\n const loadMore = useCallback(() => commandsRef.current.load_more(), []);\n return {\n entries: client.state?.conversations ?? null,\n hasNextPage: client.state?.has_more ?? false,\n totalCount: client.state?.total_count ?? null,\n connection: client.connection,\n refresh,\n loadMore,\n };\n}\n\n/**\n * Stable change fingerprint over the entries a list surface reacts to. An\n * empty string means \"no snapshot yet\" — effects keyed on the fingerprint\n * should treat it as a no-op rather than an empty list. An applied-but-empty\n * snapshot serializes to `'[]'`, so deleting the last conversation still\n * changes the fingerprint. JSON-encoding keeps arbitrary titles from\n * colliding across field or entry boundaries.\n */\nexport function conversationIndexFingerprint(\n entries: ConversationIndexEntry[] | null\n): string {\n if (entries === null) return '';\n return JSON.stringify(\n entries.map((entry) => [\n entry.thread_id,\n entry.updated_at,\n entry.state,\n entry.title,\n entry.run_status ?? null,\n entry.is_unread ?? null,\n ])\n );\n}\n"],"names":["useRef","useState","initialAuthDenialTrackerState","useStatewire","withKey","StatewireSuspended","statewireTransport","observeAuthDenial","projectDeepAgentConnection","useEffect","useCallback"],"mappings":";;;;;;;;;AAkFO,SAAS,qCAAqC,cAA8B;AACjF,SAAO,aAAa,QAAQ,iBAAiB,qBAAqB;AACpE;AAGO,SAAS,oBAAoB;AAAA,EAClC;AAAA,EACA;AACF,GAGW;AACT,SAAO,GAAG,WAAW,IAAI,MAAM;AACjC;AAKO,SAAS,qBAAqB;AAAA,EACnC;AAAA,EACA;AAAA,EACA;AAAA,EACA,MAAM;AAAA,EACN;AAAA,EACA,UAAU;AACZ,GAA4D;;AAC1D,QAAM,aAAaA,MAAAA,OAAO,OAAO;AACjC,aAAW,UAAU;AACrB,QAAM,UAAU,oBAAoB,EAAE,aAAa,QAAQ;AAM3D,QAAM,CAAC,QAAQ,SAAS,IAAIC,MAAAA;AAAAA,IAC1B;AAAA,EAAA;AAEF,QAAM,YAAYD,MAAAA,OAAO,EAAE,SAAS,OAAOE,WAAAA,8BAAA,GAAiC;AAC5E,MAAI,UAAU,QAAQ,YAAY,SAAS;AACzC,cAAU,UAAU,EAAE,SAAS,OAAOA,WAAAA,gCAA8B;AAAA,EACtE;AACA,QAAM,WAAW,WAAW,QAAQ,OAAO,YAAY;AACvD,QAAM,SAASC,UAAAA,aAA4E;AAAA,IACzF,WAAWC,IAAAA;AAAAA,MACT;AAAA,MACA,CAAC,WAAW,WACRC,sCAA8C;AAAA,QAC5C,UACE,iCAAQ,aACP,UACG,kDACA;AAAA,QACN,GAAI,UACA;AAAA,UACE,sBAAsB,MAAM;AAC1B,sBAAU,UAAU,EAAE,SAAS,OAAOH,WAAAA,gCAA8B;AACpE,sBAAU,IAAI;AAAA,UAChB;AAAA,QAAA,IAEF,CAAA;AAAA,MAAC,CACN,IACDI,mBAAAA;AAAAA,QACE;AAAA,UACE,KAAK,GAAG,QAAQ,QAAQ,QAAQ,EAAE,CAAC,IAAI,mBAAmB,OAAO,CAAC;AAAA,UAClE,SAAS,CAAC,QAAgC,WAAW,QAAQ,GAAG;AAAA,QAAA;AAAA,QAElE,EAAE,IAAA;AAAA,MAAI;AAAA,IACR;AAAA,IAEN,cAAc;AAAA,EAAA,CACf;AAID,QAAM,SAASC,WAAAA;AAAAA,IACb,UAAU,QAAQ;AAAA,IAClBC,OAAAA,2BAA2B,OAAO,UAAU;AAAA,EAAA;AAE9C,YAAU,QAAQ,QAAQ,OAAO;AACjC,QAAM,aAAa,OAAO;AAC1B,QAAM,cAAc,OAAO,MAAM;AACjCC,QAAAA,UAAU,MAAM;AACd,QAAI,CAAC,WAAW,CAAC,WAAY;AAC7B;AAAA,MAAU,CAAC,UACT,6BAAM,aAAY,UAAU,OAAO,EAAE,SAAS,SAAS,YAAA;AAAA,IAAY;AAAA,EAEvE,GAAG,CAAC,SAAS,YAAY,aAAa,OAAO,CAAC;AAC9C,QAAM,cAAcT,MAAAA,OAAO,OAAO,QAAQ;AAC1C,cAAY,UAAU,OAAO;AAC7B,QAAM,UAAUU,MAAAA,YAAY,MAAM,YAAY,QAAQ,QAAA,GAAW,EAAE;AACnE,QAAM,WAAWA,MAAAA,YAAY,MAAM,YAAY,QAAQ,UAAA,GAAa,EAAE;AACtE,SAAO;AAAA,IACL,WAAS,YAAO,UAAP,mBAAc,kBAAiB;AAAA,IACxC,eAAa,YAAO,UAAP,mBAAc,aAAY;AAAA,IACvC,cAAY,YAAO,UAAP,mBAAc,gBAAe;AAAA,IACzC,YAAY,OAAO;AAAA,IACnB;AAAA,IACA;AAAA,EAAA;AAEJ;;;;"}
|
|
1
|
+
{"version":3,"file":"conversation-index.cjs","sources":["../../../../../agent-runtime/src/conversation-index.ts"],"sourcesContent":["import { withKey } from '@assistant-ui/tap';\nimport { useCallback, useEffect, useRef, useState } from 'react';\nimport { useStatewire, type StatewireClient } from 'statewire';\nimport { initialAuthDenialTrackerState, observeAuthDenial } from './auth-denial';\nimport type { ConversationAttention, ConversationAttentionSource } from './conversation-list';\nimport { projectDeepAgentConnection } from './errors';\nimport { StatewireSuspended } from './statewire-suspended';\nimport { statewireTransport } from './statewire-transport';\nimport type { DeepAgentHeadersResolver } from './use-deep-agent-thread';\n\n/**\n * Client side of the conversation-index statewire (issue #29088): agora\n * replicates the newest page of one viewer's conversation list as one state\n * object, so thread creation / lifecycle / title changes arrive as ops\n * instead of newest-page polling. The replicated rows are renderable and the\n * typed commands extend or refresh the inclusive window; reconnects are free\n * because the protocol's snapshot-first attach IS the newest-page reconcile.\n *\n * A viewer is a `(workspaceId, userId)` pair and every pair is its own\n * instance (`/conversation-index/<workspaceId>-<userId>`): workspaces are\n * tenants, so a tab in one workspace never shares a window with a tab in\n * another, and switching workspaces attaches to a different instance instead\n * of retagging the one other tabs are still reading.\n */\nexport interface ConversationIndexEntry {\n thread_id: string;\n title: string;\n updated_at: string;\n state: string | null;\n runtime: string | null;\n start_channel: string | null;\n asset_type: string;\n asset_id: string | null;\n app_id: string | null;\n trigger_type: string | null;\n last_message_preview: string | null;\n message_count: number | null;\n is_unread: boolean | null;\n /**\n * Canonical status_v2 planes, present once the publishing agora reports them\n * (absent from snapshots replicated by an older pod during a rollout).\n */\n session_status?: string | null;\n run_status?: string | null;\n /**\n * The viewer's attention state and its one-line next action, present once\n * the publishing agora derives them (absent from snapshots replicated by\n * an older pod). Pull-request state is never pushed — it rides the list\n * fetch only (`include_pull_requests`).\n */\n attention?: ConversationAttention | null;\n next_action?: string | null;\n attention_source?: ConversationAttentionSource | null;\n is_favorited?: boolean | null;\n}\n\ninterface ConversationIndexState {\n conversations?: ConversationIndexEntry[];\n has_more?: boolean;\n total_count?: number;\n}\n\ninterface ConversationIndexCommands {\n [key: string]: (...args: never[]) => unknown;\n refresh(): void;\n load_more(): void;\n}\n\nexport interface UseConversationIndexOptions {\n /** Base URL of the conversation-index host (the `…/v2/conversation-index` mount). */\n baseUrl: string;\n /** The workspace being viewed — half of the instance id. Callers gate mounting on it. */\n workspaceId: string;\n /** The signed-in user's id — the other half. Callers gate mounting on it. */\n userId: string;\n /** Transport selection: SSE when true, WebSocket otherwise. */\n sse?: boolean;\n headers: DeepAgentHeadersResolver;\n /** Park the transport until the caller has a resolved principal. */\n enabled?: boolean;\n}\n\nexport interface UseConversationIndexResult {\n /** Newest-page entries, or `null` until the attach snapshot applies. */\n entries: ConversationIndexEntry[] | null;\n hasNextPage: boolean;\n totalCount: number | null;\n connection: StatewireClient.Connection;\n refresh: () => Promise<void>;\n loadMore: () => Promise<void>;\n}\n\n/** The conversation-index host is mounted beside the threads host. */\nexport function conversationIndexUrlFromStatewireUrl(statewireUrl: string): string {\n return statewireUrl.replace(/\\/threads\\/?$/, '/conversation-index');\n}\n\n/** Instance id of one viewer's index; mirrors agora's `conversation_index_id`. */\nexport function conversationIndexId({\n workspaceId,\n userId,\n}: {\n workspaceId: string;\n userId: string;\n}): string {\n return `${workspaceId}-${userId}`;\n}\n\n/**\n * Attach to the live conversation index of one `(workspace, user)` viewer.\n */\nexport function useConversationIndex({\n baseUrl,\n workspaceId,\n userId,\n sse = false,\n headers,\n enabled = true,\n}: UseConversationIndexOptions): UseConversationIndexResult {\n const headersRef = useRef(headers);\n headersRef.current = headers;\n const indexId = conversationIndexId({ workspaceId, userId });\n // Auth-denial park (same policy as the thread transport): the index is a\n // pure push signal, so after a streak of `unauthorized` denials the retry\n // loop stops instead of hammering the attach endpoint every 30s for as long\n // as the tab lives. A remount or the parked connection's `reconnect()`\n // re-arms it.\n const [parked, setParked] = useState<{ indexId: string; message: string | undefined } | null>(\n null\n );\n const denialRef = useRef({ indexId, state: initialAuthDenialTrackerState() });\n if (denialRef.current.indexId !== indexId) {\n denialRef.current = { indexId, state: initialAuthDenialTrackerState() };\n }\n const isParked = parked !== null && parked.indexId === indexId;\n const client = useStatewire<ConversationIndexState | undefined, ConversationIndexCommands>({\n transport: withKey(\n indexId,\n !enabled || isParked\n ? StatewireSuspended<ConversationIndexCommands>({\n message:\n parked?.message ??\n (enabled\n ? 'Conversation index authorization was refused.'\n : 'Conversation index is waiting for a signed-in user and workspace.'),\n ...(enabled\n ? {\n onReconnectRequested: () => {\n denialRef.current = { indexId, state: initialAuthDenialTrackerState() };\n setParked(null);\n },\n }\n : {}),\n })\n : statewireTransport<ConversationIndexState, ConversationIndexCommands>(\n {\n url: `${baseUrl.replace(/\\/+$/, '')}/${encodeURIComponent(indexId)}`,\n headers: (ctx: { staleAuth: boolean }) => headersRef.current(ctx),\n },\n { sse }\n )\n ),\n initialState: undefined,\n });\n // Observing during render is idempotent (the tracker dedupes by attempt\n // number), so a re-render of the same connection state cannot double-count.\n // The tracker consumes the projected vocabulary, never the raw connection.\n const denial = observeAuthDenial(\n denialRef.current.state,\n projectDeepAgentConnection(client.connection)\n );\n denialRef.current.state = denial.state;\n const shouldPark = denial.park;\n const parkMessage = denial.state.message;\n useEffect(() => {\n if (!enabled || !shouldPark) return;\n setParked((prev) =>\n prev?.indexId === indexId ? prev : { indexId, message: parkMessage }\n );\n }, [enabled, shouldPark, parkMessage, indexId]);\n const commandsRef = useRef(client.commands);\n commandsRef.current = client.commands;\n const refresh = useCallback(() => commandsRef.current.refresh(), []);\n const loadMore = useCallback(() => commandsRef.current.load_more(), []);\n return {\n entries: client.state?.conversations ?? null,\n hasNextPage: client.state?.has_more ?? false,\n totalCount: client.state?.total_count ?? null,\n connection: client.connection,\n refresh,\n loadMore,\n };\n}\n\n/**\n * Stable change fingerprint over the entries a list surface reacts to. An\n * empty string means \"no snapshot yet\" — effects keyed on the fingerprint\n * should treat it as a no-op rather than an empty list. An applied-but-empty\n * snapshot serializes to `'[]'`, so deleting the last conversation still\n * changes the fingerprint. JSON-encoding keeps arbitrary titles from\n * colliding across field or entry boundaries.\n */\nexport function conversationIndexFingerprint(\n entries: ConversationIndexEntry[] | null\n): string {\n if (entries === null) return '';\n return JSON.stringify(\n entries.map((entry) => [\n entry.thread_id,\n entry.updated_at,\n entry.state,\n entry.title,\n entry.run_status ?? null,\n entry.is_unread ?? null,\n entry.attention ?? null,\n entry.next_action ?? null,\n entry.attention_source ?? null,\n entry.is_favorited ?? null,\n ])\n );\n}\n"],"names":["useRef","useState","initialAuthDenialTrackerState","useStatewire","withKey","StatewireSuspended","statewireTransport","observeAuthDenial","projectDeepAgentConnection","useEffect","useCallback"],"mappings":";;;;;;;;;AA6FO,SAAS,qCAAqC,cAA8B;AACjF,SAAO,aAAa,QAAQ,iBAAiB,qBAAqB;AACpE;AAGO,SAAS,oBAAoB;AAAA,EAClC;AAAA,EACA;AACF,GAGW;AACT,SAAO,GAAG,WAAW,IAAI,MAAM;AACjC;AAKO,SAAS,qBAAqB;AAAA,EACnC;AAAA,EACA;AAAA,EACA;AAAA,EACA,MAAM;AAAA,EACN;AAAA,EACA,UAAU;AACZ,GAA4D;;AAC1D,QAAM,aAAaA,MAAAA,OAAO,OAAO;AACjC,aAAW,UAAU;AACrB,QAAM,UAAU,oBAAoB,EAAE,aAAa,QAAQ;AAM3D,QAAM,CAAC,QAAQ,SAAS,IAAIC,MAAAA;AAAAA,IAC1B;AAAA,EAAA;AAEF,QAAM,YAAYD,MAAAA,OAAO,EAAE,SAAS,OAAOE,WAAAA,8BAAA,GAAiC;AAC5E,MAAI,UAAU,QAAQ,YAAY,SAAS;AACzC,cAAU,UAAU,EAAE,SAAS,OAAOA,WAAAA,gCAA8B;AAAA,EACtE;AACA,QAAM,WAAW,WAAW,QAAQ,OAAO,YAAY;AACvD,QAAM,SAASC,UAAAA,aAA4E;AAAA,IACzF,WAAWC,IAAAA;AAAAA,MACT;AAAA,MACA,CAAC,WAAW,WACRC,sCAA8C;AAAA,QAC5C,UACE,iCAAQ,aACP,UACG,kDACA;AAAA,QACN,GAAI,UACA;AAAA,UACE,sBAAsB,MAAM;AAC1B,sBAAU,UAAU,EAAE,SAAS,OAAOH,WAAAA,gCAA8B;AACpE,sBAAU,IAAI;AAAA,UAChB;AAAA,QAAA,IAEF,CAAA;AAAA,MAAC,CACN,IACDI,mBAAAA;AAAAA,QACE;AAAA,UACE,KAAK,GAAG,QAAQ,QAAQ,QAAQ,EAAE,CAAC,IAAI,mBAAmB,OAAO,CAAC;AAAA,UAClE,SAAS,CAAC,QAAgC,WAAW,QAAQ,GAAG;AAAA,QAAA;AAAA,QAElE,EAAE,IAAA;AAAA,MAAI;AAAA,IACR;AAAA,IAEN,cAAc;AAAA,EAAA,CACf;AAID,QAAM,SAASC,WAAAA;AAAAA,IACb,UAAU,QAAQ;AAAA,IAClBC,OAAAA,2BAA2B,OAAO,UAAU;AAAA,EAAA;AAE9C,YAAU,QAAQ,QAAQ,OAAO;AACjC,QAAM,aAAa,OAAO;AAC1B,QAAM,cAAc,OAAO,MAAM;AACjCC,QAAAA,UAAU,MAAM;AACd,QAAI,CAAC,WAAW,CAAC,WAAY;AAC7B;AAAA,MAAU,CAAC,UACT,6BAAM,aAAY,UAAU,OAAO,EAAE,SAAS,SAAS,YAAA;AAAA,IAAY;AAAA,EAEvE,GAAG,CAAC,SAAS,YAAY,aAAa,OAAO,CAAC;AAC9C,QAAM,cAAcT,MAAAA,OAAO,OAAO,QAAQ;AAC1C,cAAY,UAAU,OAAO;AAC7B,QAAM,UAAUU,MAAAA,YAAY,MAAM,YAAY,QAAQ,QAAA,GAAW,EAAE;AACnE,QAAM,WAAWA,MAAAA,YAAY,MAAM,YAAY,QAAQ,UAAA,GAAa,EAAE;AACtE,SAAO;AAAA,IACL,WAAS,YAAO,UAAP,mBAAc,kBAAiB;AAAA,IACxC,eAAa,YAAO,UAAP,mBAAc,aAAY;AAAA,IACvC,cAAY,YAAO,UAAP,mBAAc,gBAAe;AAAA,IACzC,YAAY,OAAO;AAAA,IACnB;AAAA,IACA;AAAA,EAAA;AAEJ;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation-index.js","sources":["../../../../../agent-runtime/src/conversation-index.ts"],"sourcesContent":["import { withKey } from '@assistant-ui/tap';\nimport { useCallback, useEffect, useRef, useState } from 'react';\nimport { useStatewire, type StatewireClient } from 'statewire';\nimport { initialAuthDenialTrackerState, observeAuthDenial } from './auth-denial';\nimport { projectDeepAgentConnection } from './errors';\nimport { StatewireSuspended } from './statewire-suspended';\nimport { statewireTransport } from './statewire-transport';\nimport type { DeepAgentHeadersResolver } from './use-deep-agent-thread';\n\n/**\n * Client side of the conversation-index statewire (issue #29088): agora\n * replicates the newest page of one viewer's conversation list as one state\n * object, so thread creation / lifecycle / title changes arrive as ops\n * instead of newest-page polling. The replicated rows are renderable and the\n * typed commands extend or refresh the inclusive window; reconnects are free\n * because the protocol's snapshot-first attach IS the newest-page reconcile.\n *\n * A viewer is a `(workspaceId, userId)` pair and every pair is its own\n * instance (`/conversation-index/<workspaceId>-<userId>`): workspaces are\n * tenants, so a tab in one workspace never shares a window with a tab in\n * another, and switching workspaces attaches to a different instance instead\n * of retagging the one other tabs are still reading.\n */\nexport interface ConversationIndexEntry {\n thread_id: string;\n title: string;\n updated_at: string;\n state: string | null;\n runtime: string | null;\n start_channel: string | null;\n asset_type: string;\n asset_id: string | null;\n app_id: string | null;\n trigger_type: string | null;\n last_message_preview: string | null;\n message_count: number | null;\n is_unread: boolean | null;\n /**\n * Canonical status_v2 planes, present once the publishing agora reports them\n * (absent from snapshots replicated by an older pod during a rollout).\n */\n session_status?: string | null;\n run_status?: string | null;\n}\n\ninterface ConversationIndexState {\n conversations?: ConversationIndexEntry[];\n has_more?: boolean;\n total_count?: number;\n}\n\ninterface ConversationIndexCommands {\n [key: string]: (...args: never[]) => unknown;\n refresh(): void;\n load_more(): void;\n}\n\nexport interface UseConversationIndexOptions {\n /** Base URL of the conversation-index host (the `…/v2/conversation-index` mount). */\n baseUrl: string;\n /** The workspace being viewed — half of the instance id. Callers gate mounting on it. */\n workspaceId: string;\n /** The signed-in user's id — the other half. Callers gate mounting on it. */\n userId: string;\n /** Transport selection: SSE when true, WebSocket otherwise. */\n sse?: boolean;\n headers: DeepAgentHeadersResolver;\n /** Park the transport until the caller has a resolved principal. */\n enabled?: boolean;\n}\n\nexport interface UseConversationIndexResult {\n /** Newest-page entries, or `null` until the attach snapshot applies. */\n entries: ConversationIndexEntry[] | null;\n hasNextPage: boolean;\n totalCount: number | null;\n connection: StatewireClient.Connection;\n refresh: () => Promise<void>;\n loadMore: () => Promise<void>;\n}\n\n/** The conversation-index host is mounted beside the threads host. */\nexport function conversationIndexUrlFromStatewireUrl(statewireUrl: string): string {\n return statewireUrl.replace(/\\/threads\\/?$/, '/conversation-index');\n}\n\n/** Instance id of one viewer's index; mirrors agora's `conversation_index_id`. */\nexport function conversationIndexId({\n workspaceId,\n userId,\n}: {\n workspaceId: string;\n userId: string;\n}): string {\n return `${workspaceId}-${userId}`;\n}\n\n/**\n * Attach to the live conversation index of one `(workspace, user)` viewer.\n */\nexport function useConversationIndex({\n baseUrl,\n workspaceId,\n userId,\n sse = false,\n headers,\n enabled = true,\n}: UseConversationIndexOptions): UseConversationIndexResult {\n const headersRef = useRef(headers);\n headersRef.current = headers;\n const indexId = conversationIndexId({ workspaceId, userId });\n // Auth-denial park (same policy as the thread transport): the index is a\n // pure push signal, so after a streak of `unauthorized` denials the retry\n // loop stops instead of hammering the attach endpoint every 30s for as long\n // as the tab lives. A remount or the parked connection's `reconnect()`\n // re-arms it.\n const [parked, setParked] = useState<{ indexId: string; message: string | undefined } | null>(\n null\n );\n const denialRef = useRef({ indexId, state: initialAuthDenialTrackerState() });\n if (denialRef.current.indexId !== indexId) {\n denialRef.current = { indexId, state: initialAuthDenialTrackerState() };\n }\n const isParked = parked !== null && parked.indexId === indexId;\n const client = useStatewire<ConversationIndexState | undefined, ConversationIndexCommands>({\n transport: withKey(\n indexId,\n !enabled || isParked\n ? StatewireSuspended<ConversationIndexCommands>({\n message:\n parked?.message ??\n (enabled\n ? 'Conversation index authorization was refused.'\n : 'Conversation index is waiting for a signed-in user and workspace.'),\n ...(enabled\n ? {\n onReconnectRequested: () => {\n denialRef.current = { indexId, state: initialAuthDenialTrackerState() };\n setParked(null);\n },\n }\n : {}),\n })\n : statewireTransport<ConversationIndexState, ConversationIndexCommands>(\n {\n url: `${baseUrl.replace(/\\/+$/, '')}/${encodeURIComponent(indexId)}`,\n headers: (ctx: { staleAuth: boolean }) => headersRef.current(ctx),\n },\n { sse }\n )\n ),\n initialState: undefined,\n });\n // Observing during render is idempotent (the tracker dedupes by attempt\n // number), so a re-render of the same connection state cannot double-count.\n // The tracker consumes the projected vocabulary, never the raw connection.\n const denial = observeAuthDenial(\n denialRef.current.state,\n projectDeepAgentConnection(client.connection)\n );\n denialRef.current.state = denial.state;\n const shouldPark = denial.park;\n const parkMessage = denial.state.message;\n useEffect(() => {\n if (!enabled || !shouldPark) return;\n setParked((prev) =>\n prev?.indexId === indexId ? prev : { indexId, message: parkMessage }\n );\n }, [enabled, shouldPark, parkMessage, indexId]);\n const commandsRef = useRef(client.commands);\n commandsRef.current = client.commands;\n const refresh = useCallback(() => commandsRef.current.refresh(), []);\n const loadMore = useCallback(() => commandsRef.current.load_more(), []);\n return {\n entries: client.state?.conversations ?? null,\n hasNextPage: client.state?.has_more ?? false,\n totalCount: client.state?.total_count ?? null,\n connection: client.connection,\n refresh,\n loadMore,\n };\n}\n\n/**\n * Stable change fingerprint over the entries a list surface reacts to. An\n * empty string means \"no snapshot yet\" — effects keyed on the fingerprint\n * should treat it as a no-op rather than an empty list. An applied-but-empty\n * snapshot serializes to `'[]'`, so deleting the last conversation still\n * changes the fingerprint. JSON-encoding keeps arbitrary titles from\n * colliding across field or entry boundaries.\n */\nexport function conversationIndexFingerprint(\n entries: ConversationIndexEntry[] | null\n): string {\n if (entries === null) return '';\n return JSON.stringify(\n entries.map((entry) => [\n entry.thread_id,\n entry.updated_at,\n entry.state,\n entry.title,\n entry.run_status ?? null,\n entry.is_unread ?? null,\n ])\n );\n}\n"],"names":[],"mappings":";;;;;;;AAkFO,SAAS,qCAAqC,cAA8B;AACjF,SAAO,aAAa,QAAQ,iBAAiB,qBAAqB;AACpE;AAGO,SAAS,oBAAoB;AAAA,EAClC;AAAA,EACA;AACF,GAGW;AACT,SAAO,GAAG,WAAW,IAAI,MAAM;AACjC;AAKO,SAAS,qBAAqB;AAAA,EACnC;AAAA,EACA;AAAA,EACA;AAAA,EACA,MAAM;AAAA,EACN;AAAA,EACA,UAAU;AACZ,GAA4D;;AAC1D,QAAM,aAAa,OAAO,OAAO;AACjC,aAAW,UAAU;AACrB,QAAM,UAAU,oBAAoB,EAAE,aAAa,QAAQ;AAM3D,QAAM,CAAC,QAAQ,SAAS,IAAI;AAAA,IAC1B;AAAA,EAAA;AAEF,QAAM,YAAY,OAAO,EAAE,SAAS,OAAO,8BAAA,GAAiC;AAC5E,MAAI,UAAU,QAAQ,YAAY,SAAS;AACzC,cAAU,UAAU,EAAE,SAAS,OAAO,gCAA8B;AAAA,EACtE;AACA,QAAM,WAAW,WAAW,QAAQ,OAAO,YAAY;AACvD,QAAM,SAAS,aAA4E;AAAA,IACzF,WAAW;AAAA,MACT;AAAA,MACA,CAAC,WAAW,WACR,mBAA8C;AAAA,QAC5C,UACE,iCAAQ,aACP,UACG,kDACA;AAAA,QACN,GAAI,UACA;AAAA,UACE,sBAAsB,MAAM;AAC1B,sBAAU,UAAU,EAAE,SAAS,OAAO,gCAA8B;AACpE,sBAAU,IAAI;AAAA,UAChB;AAAA,QAAA,IAEF,CAAA;AAAA,MAAC,CACN,IACD;AAAA,QACE;AAAA,UACE,KAAK,GAAG,QAAQ,QAAQ,QAAQ,EAAE,CAAC,IAAI,mBAAmB,OAAO,CAAC;AAAA,UAClE,SAAS,CAAC,QAAgC,WAAW,QAAQ,GAAG;AAAA,QAAA;AAAA,QAElE,EAAE,IAAA;AAAA,MAAI;AAAA,IACR;AAAA,IAEN,cAAc;AAAA,EAAA,CACf;AAID,QAAM,SAAS;AAAA,IACb,UAAU,QAAQ;AAAA,IAClB,2BAA2B,OAAO,UAAU;AAAA,EAAA;AAE9C,YAAU,QAAQ,QAAQ,OAAO;AACjC,QAAM,aAAa,OAAO;AAC1B,QAAM,cAAc,OAAO,MAAM;AACjC,YAAU,MAAM;AACd,QAAI,CAAC,WAAW,CAAC,WAAY;AAC7B;AAAA,MAAU,CAAC,UACT,6BAAM,aAAY,UAAU,OAAO,EAAE,SAAS,SAAS,YAAA;AAAA,IAAY;AAAA,EAEvE,GAAG,CAAC,SAAS,YAAY,aAAa,OAAO,CAAC;AAC9C,QAAM,cAAc,OAAO,OAAO,QAAQ;AAC1C,cAAY,UAAU,OAAO;AAC7B,QAAM,UAAU,YAAY,MAAM,YAAY,QAAQ,QAAA,GAAW,EAAE;AACnE,QAAM,WAAW,YAAY,MAAM,YAAY,QAAQ,UAAA,GAAa,EAAE;AACtE,SAAO;AAAA,IACL,WAAS,YAAO,UAAP,mBAAc,kBAAiB;AAAA,IACxC,eAAa,YAAO,UAAP,mBAAc,aAAY;AAAA,IACvC,cAAY,YAAO,UAAP,mBAAc,gBAAe;AAAA,IACzC,YAAY,OAAO;AAAA,IACnB;AAAA,IACA;AAAA,EAAA;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"conversation-index.js","sources":["../../../../../agent-runtime/src/conversation-index.ts"],"sourcesContent":["import { withKey } from '@assistant-ui/tap';\nimport { useCallback, useEffect, useRef, useState } from 'react';\nimport { useStatewire, type StatewireClient } from 'statewire';\nimport { initialAuthDenialTrackerState, observeAuthDenial } from './auth-denial';\nimport type { ConversationAttention, ConversationAttentionSource } from './conversation-list';\nimport { projectDeepAgentConnection } from './errors';\nimport { StatewireSuspended } from './statewire-suspended';\nimport { statewireTransport } from './statewire-transport';\nimport type { DeepAgentHeadersResolver } from './use-deep-agent-thread';\n\n/**\n * Client side of the conversation-index statewire (issue #29088): agora\n * replicates the newest page of one viewer's conversation list as one state\n * object, so thread creation / lifecycle / title changes arrive as ops\n * instead of newest-page polling. The replicated rows are renderable and the\n * typed commands extend or refresh the inclusive window; reconnects are free\n * because the protocol's snapshot-first attach IS the newest-page reconcile.\n *\n * A viewer is a `(workspaceId, userId)` pair and every pair is its own\n * instance (`/conversation-index/<workspaceId>-<userId>`): workspaces are\n * tenants, so a tab in one workspace never shares a window with a tab in\n * another, and switching workspaces attaches to a different instance instead\n * of retagging the one other tabs are still reading.\n */\nexport interface ConversationIndexEntry {\n thread_id: string;\n title: string;\n updated_at: string;\n state: string | null;\n runtime: string | null;\n start_channel: string | null;\n asset_type: string;\n asset_id: string | null;\n app_id: string | null;\n trigger_type: string | null;\n last_message_preview: string | null;\n message_count: number | null;\n is_unread: boolean | null;\n /**\n * Canonical status_v2 planes, present once the publishing agora reports them\n * (absent from snapshots replicated by an older pod during a rollout).\n */\n session_status?: string | null;\n run_status?: string | null;\n /**\n * The viewer's attention state and its one-line next action, present once\n * the publishing agora derives them (absent from snapshots replicated by\n * an older pod). Pull-request state is never pushed — it rides the list\n * fetch only (`include_pull_requests`).\n */\n attention?: ConversationAttention | null;\n next_action?: string | null;\n attention_source?: ConversationAttentionSource | null;\n is_favorited?: boolean | null;\n}\n\ninterface ConversationIndexState {\n conversations?: ConversationIndexEntry[];\n has_more?: boolean;\n total_count?: number;\n}\n\ninterface ConversationIndexCommands {\n [key: string]: (...args: never[]) => unknown;\n refresh(): void;\n load_more(): void;\n}\n\nexport interface UseConversationIndexOptions {\n /** Base URL of the conversation-index host (the `…/v2/conversation-index` mount). */\n baseUrl: string;\n /** The workspace being viewed — half of the instance id. Callers gate mounting on it. */\n workspaceId: string;\n /** The signed-in user's id — the other half. Callers gate mounting on it. */\n userId: string;\n /** Transport selection: SSE when true, WebSocket otherwise. */\n sse?: boolean;\n headers: DeepAgentHeadersResolver;\n /** Park the transport until the caller has a resolved principal. */\n enabled?: boolean;\n}\n\nexport interface UseConversationIndexResult {\n /** Newest-page entries, or `null` until the attach snapshot applies. */\n entries: ConversationIndexEntry[] | null;\n hasNextPage: boolean;\n totalCount: number | null;\n connection: StatewireClient.Connection;\n refresh: () => Promise<void>;\n loadMore: () => Promise<void>;\n}\n\n/** The conversation-index host is mounted beside the threads host. */\nexport function conversationIndexUrlFromStatewireUrl(statewireUrl: string): string {\n return statewireUrl.replace(/\\/threads\\/?$/, '/conversation-index');\n}\n\n/** Instance id of one viewer's index; mirrors agora's `conversation_index_id`. */\nexport function conversationIndexId({\n workspaceId,\n userId,\n}: {\n workspaceId: string;\n userId: string;\n}): string {\n return `${workspaceId}-${userId}`;\n}\n\n/**\n * Attach to the live conversation index of one `(workspace, user)` viewer.\n */\nexport function useConversationIndex({\n baseUrl,\n workspaceId,\n userId,\n sse = false,\n headers,\n enabled = true,\n}: UseConversationIndexOptions): UseConversationIndexResult {\n const headersRef = useRef(headers);\n headersRef.current = headers;\n const indexId = conversationIndexId({ workspaceId, userId });\n // Auth-denial park (same policy as the thread transport): the index is a\n // pure push signal, so after a streak of `unauthorized` denials the retry\n // loop stops instead of hammering the attach endpoint every 30s for as long\n // as the tab lives. A remount or the parked connection's `reconnect()`\n // re-arms it.\n const [parked, setParked] = useState<{ indexId: string; message: string | undefined } | null>(\n null\n );\n const denialRef = useRef({ indexId, state: initialAuthDenialTrackerState() });\n if (denialRef.current.indexId !== indexId) {\n denialRef.current = { indexId, state: initialAuthDenialTrackerState() };\n }\n const isParked = parked !== null && parked.indexId === indexId;\n const client = useStatewire<ConversationIndexState | undefined, ConversationIndexCommands>({\n transport: withKey(\n indexId,\n !enabled || isParked\n ? StatewireSuspended<ConversationIndexCommands>({\n message:\n parked?.message ??\n (enabled\n ? 'Conversation index authorization was refused.'\n : 'Conversation index is waiting for a signed-in user and workspace.'),\n ...(enabled\n ? {\n onReconnectRequested: () => {\n denialRef.current = { indexId, state: initialAuthDenialTrackerState() };\n setParked(null);\n },\n }\n : {}),\n })\n : statewireTransport<ConversationIndexState, ConversationIndexCommands>(\n {\n url: `${baseUrl.replace(/\\/+$/, '')}/${encodeURIComponent(indexId)}`,\n headers: (ctx: { staleAuth: boolean }) => headersRef.current(ctx),\n },\n { sse }\n )\n ),\n initialState: undefined,\n });\n // Observing during render is idempotent (the tracker dedupes by attempt\n // number), so a re-render of the same connection state cannot double-count.\n // The tracker consumes the projected vocabulary, never the raw connection.\n const denial = observeAuthDenial(\n denialRef.current.state,\n projectDeepAgentConnection(client.connection)\n );\n denialRef.current.state = denial.state;\n const shouldPark = denial.park;\n const parkMessage = denial.state.message;\n useEffect(() => {\n if (!enabled || !shouldPark) return;\n setParked((prev) =>\n prev?.indexId === indexId ? prev : { indexId, message: parkMessage }\n );\n }, [enabled, shouldPark, parkMessage, indexId]);\n const commandsRef = useRef(client.commands);\n commandsRef.current = client.commands;\n const refresh = useCallback(() => commandsRef.current.refresh(), []);\n const loadMore = useCallback(() => commandsRef.current.load_more(), []);\n return {\n entries: client.state?.conversations ?? null,\n hasNextPage: client.state?.has_more ?? false,\n totalCount: client.state?.total_count ?? null,\n connection: client.connection,\n refresh,\n loadMore,\n };\n}\n\n/**\n * Stable change fingerprint over the entries a list surface reacts to. An\n * empty string means \"no snapshot yet\" — effects keyed on the fingerprint\n * should treat it as a no-op rather than an empty list. An applied-but-empty\n * snapshot serializes to `'[]'`, so deleting the last conversation still\n * changes the fingerprint. JSON-encoding keeps arbitrary titles from\n * colliding across field or entry boundaries.\n */\nexport function conversationIndexFingerprint(\n entries: ConversationIndexEntry[] | null\n): string {\n if (entries === null) return '';\n return JSON.stringify(\n entries.map((entry) => [\n entry.thread_id,\n entry.updated_at,\n entry.state,\n entry.title,\n entry.run_status ?? null,\n entry.is_unread ?? null,\n entry.attention ?? null,\n entry.next_action ?? null,\n entry.attention_source ?? null,\n entry.is_favorited ?? null,\n ])\n );\n}\n"],"names":[],"mappings":";;;;;;;AA6FO,SAAS,qCAAqC,cAA8B;AACjF,SAAO,aAAa,QAAQ,iBAAiB,qBAAqB;AACpE;AAGO,SAAS,oBAAoB;AAAA,EAClC;AAAA,EACA;AACF,GAGW;AACT,SAAO,GAAG,WAAW,IAAI,MAAM;AACjC;AAKO,SAAS,qBAAqB;AAAA,EACnC;AAAA,EACA;AAAA,EACA;AAAA,EACA,MAAM;AAAA,EACN;AAAA,EACA,UAAU;AACZ,GAA4D;;AAC1D,QAAM,aAAa,OAAO,OAAO;AACjC,aAAW,UAAU;AACrB,QAAM,UAAU,oBAAoB,EAAE,aAAa,QAAQ;AAM3D,QAAM,CAAC,QAAQ,SAAS,IAAI;AAAA,IAC1B;AAAA,EAAA;AAEF,QAAM,YAAY,OAAO,EAAE,SAAS,OAAO,8BAAA,GAAiC;AAC5E,MAAI,UAAU,QAAQ,YAAY,SAAS;AACzC,cAAU,UAAU,EAAE,SAAS,OAAO,gCAA8B;AAAA,EACtE;AACA,QAAM,WAAW,WAAW,QAAQ,OAAO,YAAY;AACvD,QAAM,SAAS,aAA4E;AAAA,IACzF,WAAW;AAAA,MACT;AAAA,MACA,CAAC,WAAW,WACR,mBAA8C;AAAA,QAC5C,UACE,iCAAQ,aACP,UACG,kDACA;AAAA,QACN,GAAI,UACA;AAAA,UACE,sBAAsB,MAAM;AAC1B,sBAAU,UAAU,EAAE,SAAS,OAAO,gCAA8B;AACpE,sBAAU,IAAI;AAAA,UAChB;AAAA,QAAA,IAEF,CAAA;AAAA,MAAC,CACN,IACD;AAAA,QACE;AAAA,UACE,KAAK,GAAG,QAAQ,QAAQ,QAAQ,EAAE,CAAC,IAAI,mBAAmB,OAAO,CAAC;AAAA,UAClE,SAAS,CAAC,QAAgC,WAAW,QAAQ,GAAG;AAAA,QAAA;AAAA,QAElE,EAAE,IAAA;AAAA,MAAI;AAAA,IACR;AAAA,IAEN,cAAc;AAAA,EAAA,CACf;AAID,QAAM,SAAS;AAAA,IACb,UAAU,QAAQ;AAAA,IAClB,2BAA2B,OAAO,UAAU;AAAA,EAAA;AAE9C,YAAU,QAAQ,QAAQ,OAAO;AACjC,QAAM,aAAa,OAAO;AAC1B,QAAM,cAAc,OAAO,MAAM;AACjC,YAAU,MAAM;AACd,QAAI,CAAC,WAAW,CAAC,WAAY;AAC7B;AAAA,MAAU,CAAC,UACT,6BAAM,aAAY,UAAU,OAAO,EAAE,SAAS,SAAS,YAAA;AAAA,IAAY;AAAA,EAEvE,GAAG,CAAC,SAAS,YAAY,aAAa,OAAO,CAAC;AAC9C,QAAM,cAAc,OAAO,OAAO,QAAQ;AAC1C,cAAY,UAAU,OAAO;AAC7B,QAAM,UAAU,YAAY,MAAM,YAAY,QAAQ,QAAA,GAAW,EAAE;AACnE,QAAM,WAAW,YAAY,MAAM,YAAY,QAAQ,UAAA,GAAa,EAAE;AACtE,SAAO;AAAA,IACL,WAAS,YAAO,UAAP,mBAAc,kBAAiB;AAAA,IACxC,eAAa,YAAO,UAAP,mBAAc,aAAY;AAAA,IACvC,cAAY,YAAO,UAAP,mBAAc,gBAAe;AAAA,IACzC,YAAY,OAAO;AAAA,IACnB;AAAA,IACA;AAAA,EAAA;AAEJ;"}
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const CONVERSATION_ATTENTIONS = [
|
|
4
|
+
"needs_you",
|
|
5
|
+
"working",
|
|
6
|
+
"ready",
|
|
7
|
+
"watching",
|
|
8
|
+
"done",
|
|
9
|
+
"error"
|
|
10
|
+
];
|
|
3
11
|
const CONVERSATION_LIST_QUERY_KEY_ROOT = "athena-conversation-list";
|
|
4
12
|
const CONVERSATION_LIST_DEFAULT_SCOPE_KEY = "default";
|
|
5
13
|
function normalizeConversationListFilter(filter) {
|
|
@@ -26,6 +34,25 @@ function normalizeConversationListFilter(filter) {
|
|
|
26
34
|
if (filter.includeSubSessions) normalized.includeSubSessions = true;
|
|
27
35
|
return normalized;
|
|
28
36
|
}
|
|
37
|
+
const RUNNING_RUN_STATUSES = /* @__PURE__ */ new Set(["queued", "running"]);
|
|
38
|
+
function isConversationRunning(summary) {
|
|
39
|
+
if (summary.runStatus !== null && summary.runStatus !== void 0) {
|
|
40
|
+
return RUNNING_RUN_STATUSES.has(summary.runStatus);
|
|
41
|
+
}
|
|
42
|
+
return summary.state === "running";
|
|
43
|
+
}
|
|
44
|
+
const KNOWN_ATTENTIONS = new Set(CONVERSATION_ATTENTIONS);
|
|
45
|
+
function deriveConversationAttention(summary) {
|
|
46
|
+
if (typeof summary.attention === "string" && KNOWN_ATTENTIONS.has(summary.attention)) {
|
|
47
|
+
return summary.attention;
|
|
48
|
+
}
|
|
49
|
+
if (summary.runStatus === "needs_input" || summary.sessionStatus === "needs_input") {
|
|
50
|
+
return "needs_you";
|
|
51
|
+
}
|
|
52
|
+
if (isConversationRunning(summary)) return "working";
|
|
53
|
+
if (summary.runStatus === "failed" || summary.sessionStatus === "error") return "error";
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
29
56
|
function conversationListFilterKey(filter) {
|
|
30
57
|
const normalized = normalizeConversationListFilter(filter);
|
|
31
58
|
return JSON.stringify(
|
|
@@ -77,14 +104,46 @@ function scopedKey(options) {
|
|
|
77
104
|
function invalidateConversationListCaches(queryClient, options) {
|
|
78
105
|
return queryClient.invalidateQueries({ queryKey: scopedKey(options) });
|
|
79
106
|
}
|
|
107
|
+
function summaryFromConversationIndexEntry(entry, previous) {
|
|
108
|
+
const carriesStatus = entry.run_status !== void 0 || entry.session_status !== void 0;
|
|
109
|
+
return {
|
|
110
|
+
threadId: entry.thread_id,
|
|
111
|
+
title: entry.title,
|
|
112
|
+
updatedAt: entry.updated_at,
|
|
113
|
+
createdAt: (previous == null ? void 0 : previous.createdAt) ?? null,
|
|
114
|
+
state: entry.state,
|
|
115
|
+
runtime: entry.runtime,
|
|
116
|
+
sourceChannel: entry.start_channel,
|
|
117
|
+
assetType: entry.asset_type,
|
|
118
|
+
assetId: entry.asset_id ?? (previous == null ? void 0 : previous.assetId) ?? null,
|
|
119
|
+
computerAssetId: (previous == null ? void 0 : previous.computerAssetId) ?? null,
|
|
120
|
+
appId: entry.app_id,
|
|
121
|
+
triggerType: entry.trigger_type,
|
|
122
|
+
preview: entry.last_message_preview,
|
|
123
|
+
messageCount: entry.message_count,
|
|
124
|
+
isUnread: entry.is_unread ?? (previous == null ? void 0 : previous.isUnread) ?? false,
|
|
125
|
+
sessionStatus: carriesStatus ? entry.session_status ?? null : null,
|
|
126
|
+
runStatus: carriesStatus ? entry.run_status ?? null : null,
|
|
127
|
+
attention: entry.attention !== void 0 ? entry.attention : previous == null ? void 0 : previous.attention,
|
|
128
|
+
nextAction: entry.next_action !== void 0 ? entry.next_action : previous == null ? void 0 : previous.nextAction,
|
|
129
|
+
attentionSource: entry.attention_source !== void 0 ? entry.attention_source : previous == null ? void 0 : previous.attentionSource,
|
|
130
|
+
isFavorited: entry.is_favorited ?? (previous == null ? void 0 : previous.isFavorited),
|
|
131
|
+
lastWake: previous == null ? void 0 : previous.lastWake,
|
|
132
|
+
pullRequests: previous == null ? void 0 : previous.pullRequests
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
exports.CONVERSATION_ATTENTIONS = CONVERSATION_ATTENTIONS;
|
|
80
136
|
exports.CONVERSATION_LIST_DEFAULT_SCOPE_KEY = CONVERSATION_LIST_DEFAULT_SCOPE_KEY;
|
|
81
137
|
exports.CONVERSATION_LIST_QUERY_KEY_ROOT = CONVERSATION_LIST_QUERY_KEY_ROOT;
|
|
82
138
|
exports.conversationListFilterKey = conversationListFilterKey;
|
|
83
139
|
exports.conversationListQueryKeys = conversationListQueryKeys;
|
|
140
|
+
exports.deriveConversationAttention = deriveConversationAttention;
|
|
84
141
|
exports.invalidateConversationListCaches = invalidateConversationListCaches;
|
|
142
|
+
exports.isConversationRunning = isConversationRunning;
|
|
85
143
|
exports.mergeConversationPages = mergeConversationPages;
|
|
86
144
|
exports.normalizeConversationListFilter = normalizeConversationListFilter;
|
|
87
145
|
exports.patchConversationsInPage = patchConversationsInPage;
|
|
88
146
|
exports.prependConversationToPage = prependConversationToPage;
|
|
89
147
|
exports.removeConversationFromPage = removeConversationFromPage;
|
|
148
|
+
exports.summaryFromConversationIndexEntry = summaryFromConversationIndexEntry;
|
|
90
149
|
//# sourceMappingURL=conversation-list.cjs.map
|