@athenaintel/react 0.22.4 → 0.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +390 -4
- package/dist/chat/AthenaChat.cjs +346 -244
- package/dist/chat/AthenaChat.cjs.map +1 -1
- package/dist/chat/AthenaChat.d.ts +19 -8
- package/dist/chat/AthenaChat.js +350 -248
- package/dist/chat/AthenaChat.js.map +1 -1
- package/dist/chat/StatewireApprovalCard.cjs +2 -1
- package/dist/chat/StatewireApprovalCard.cjs.map +1 -1
- package/dist/chat/StatewireApprovalCard.js +2 -1
- package/dist/chat/StatewireApprovalCard.js.map +1 -1
- package/dist/chat/StatewireClientToolBridge.cjs +1 -0
- package/dist/chat/StatewireClientToolBridge.cjs.map +1 -1
- package/dist/chat/StatewireClientToolBridge.js +1 -0
- package/dist/chat/StatewireClientToolBridge.js.map +1 -1
- package/dist/chat/StatewireQueuedMessages.cjs +1 -0
- package/dist/chat/StatewireQueuedMessages.cjs.map +1 -1
- package/dist/chat/StatewireQueuedMessages.js +1 -0
- package/dist/chat/StatewireQueuedMessages.js.map +1 -1
- package/dist/chat/WaitingOnYouBanner.cjs +100 -0
- package/dist/chat/WaitingOnYouBanner.cjs.map +1 -0
- package/dist/chat/WaitingOnYouBanner.d.ts +29 -0
- package/dist/chat/WaitingOnYouBanner.js +100 -0
- package/dist/chat/WaitingOnYouBanner.js.map +1 -0
- package/dist/chat/athena-chat-welcome.cjs +148 -0
- package/dist/chat/athena-chat-welcome.cjs.map +1 -0
- package/dist/chat/athena-chat-welcome.d.ts +54 -0
- package/dist/chat/athena-chat-welcome.js +148 -0
- package/dist/chat/athena-chat-welcome.js.map +1 -0
- package/dist/chat/athena-composer-controls.cjs +76 -0
- package/dist/chat/athena-composer-controls.cjs.map +1 -0
- package/dist/chat/athena-composer-controls.d.ts +21 -0
- package/dist/chat/athena-composer-controls.js +76 -0
- package/dist/chat/athena-composer-controls.js.map +1 -0
- package/dist/chat/composer-keyboard-hint.cjs +61 -0
- package/dist/chat/composer-keyboard-hint.cjs.map +1 -0
- package/dist/chat/composer-keyboard-hint.d.ts +33 -0
- package/dist/chat/composer-keyboard-hint.js +61 -0
- package/dist/chat/composer-keyboard-hint.js.map +1 -0
- package/dist/chat/message-time.cjs +64 -0
- package/dist/chat/message-time.cjs.map +1 -0
- package/dist/chat/message-time.d.ts +45 -0
- package/dist/chat/message-time.js +64 -0
- package/dist/chat/message-time.js.map +1 -0
- package/dist/chat/run-activity.cjs +38 -7
- package/dist/chat/run-activity.cjs.map +1 -1
- package/dist/chat/run-activity.d.ts +14 -3
- package/dist/chat/run-activity.js +39 -8
- package/dist/chat/run-activity.js.map +1 -1
- package/dist/chat/statewire-client-tools.cjs +2 -1
- package/dist/chat/statewire-client-tools.cjs.map +1 -1
- package/dist/chat/statewire-client-tools.js +2 -1
- package/dist/chat/statewire-client-tools.js.map +1 -1
- package/dist/chat/super-grouping/activity-timeline.cjs +2 -1
- package/dist/chat/super-grouping/activity-timeline.cjs.map +1 -1
- package/dist/chat/super-grouping/activity-timeline.js +2 -1
- package/dist/chat/super-grouping/activity-timeline.js.map +1 -1
- package/dist/chat/thread-scroll-to-bottom.cjs +24 -0
- package/dist/chat/thread-scroll-to-bottom.cjs.map +1 -0
- package/dist/chat/thread-scroll-to-bottom.d.ts +11 -0
- package/dist/chat/thread-scroll-to-bottom.js +24 -0
- package/dist/chat/thread-scroll-to-bottom.js.map +1 -0
- package/dist/chat/tiptap-text.cjs +26 -95
- package/dist/chat/tiptap-text.cjs.map +1 -1
- package/dist/chat/tiptap-text.d.ts +13 -0
- package/dist/chat/tiptap-text.js +26 -95
- package/dist/chat/tiptap-text.js.map +1 -1
- package/dist/chat/use-athena-run-live.cjs +2 -1
- package/dist/chat/use-athena-run-live.cjs.map +1 -1
- package/dist/chat/use-athena-run-live.js +2 -1
- package/dist/chat/use-athena-run-live.js.map +1 -1
- package/dist/chat/use-statewire-approval-request.cjs +1 -0
- package/dist/chat/use-statewire-approval-request.cjs.map +1 -1
- package/dist/chat/use-statewire-approval-request.js +1 -0
- package/dist/chat/use-statewire-approval-request.js.map +1 -1
- package/dist/chat-ui/composer/tiptap-composer.cjs +39 -4
- package/dist/chat-ui/composer/tiptap-composer.cjs.map +1 -1
- package/dist/chat-ui/composer/tiptap-composer.d.ts +21 -0
- package/dist/chat-ui/composer/tiptap-composer.js +39 -4
- package/dist/chat-ui/composer/tiptap-composer.js.map +1 -1
- package/dist/chat-ui/index.cjs +15 -1
- package/dist/chat-ui/index.cjs.map +1 -1
- package/dist/chat-ui/index.d.ts +6 -3
- package/dist/chat-ui/index.js +16 -2
- package/dist/chat-ui/index.js.map +1 -1
- package/dist/chat-ui/mentions/mention-chip.cjs +31 -4
- package/dist/chat-ui/mentions/mention-chip.cjs.map +1 -1
- package/dist/chat-ui/mentions/mention-chip.js +31 -4
- package/dist/chat-ui/mentions/mention-chip.js.map +1 -1
- package/dist/chat-ui/messages/message-components.cjs +19 -1
- package/dist/chat-ui/messages/message-components.cjs.map +1 -1
- package/dist/chat-ui/messages/message-components.d.ts +13 -0
- package/dist/chat-ui/messages/message-components.js +19 -1
- package/dist/chat-ui/messages/message-components.js.map +1 -1
- package/dist/chat-ui/messages/runtime-message.cjs +2 -1
- package/dist/chat-ui/messages/runtime-message.cjs.map +1 -1
- package/dist/chat-ui/messages/runtime-message.js +2 -1
- package/dist/chat-ui/messages/runtime-message.js.map +1 -1
- package/dist/chat-ui/messages/statewire-continue-run.cjs +1 -0
- package/dist/chat-ui/messages/statewire-continue-run.cjs.map +1 -1
- package/dist/chat-ui/messages/statewire-continue-run.js +1 -0
- package/dist/chat-ui/messages/statewire-continue-run.js.map +1 -1
- package/dist/chat-ui/messages/user-edit-composer.cjs +3 -1
- package/dist/chat-ui/messages/user-edit-composer.cjs.map +1 -1
- package/dist/chat-ui/messages/user-edit-composer.js +3 -1
- package/dist/chat-ui/messages/user-edit-composer.js.map +1 -1
- package/dist/chat-ui/messages/wake-marker.cjs +84 -0
- package/dist/chat-ui/messages/wake-marker.cjs.map +1 -0
- package/dist/chat-ui/messages/wake-marker.d.ts +16 -0
- package/dist/chat-ui/messages/wake-marker.js +84 -0
- package/dist/chat-ui/messages/wake-marker.js.map +1 -0
- package/dist/chat-ui/rich-text/chat-blocks.cjs +177 -0
- package/dist/chat-ui/rich-text/chat-blocks.cjs.map +1 -0
- package/dist/chat-ui/rich-text/chat-blocks.d.ts +58 -0
- package/dist/chat-ui/rich-text/chat-blocks.js +177 -0
- package/dist/chat-ui/rich-text/chat-blocks.js.map +1 -0
- package/dist/chat-ui/rich-text/chat-link.cjs +69 -0
- package/dist/chat-ui/rich-text/chat-link.cjs.map +1 -0
- package/dist/chat-ui/rich-text/chat-link.d.ts +24 -0
- package/dist/chat-ui/rich-text/chat-link.js +69 -0
- package/dist/chat-ui/rich-text/chat-link.js.map +1 -0
- package/dist/chat-ui/rich-text/chat-message-body.cjs +144 -18
- package/dist/chat-ui/rich-text/chat-message-body.cjs.map +1 -1
- package/dist/chat-ui/rich-text/chat-message-body.d.ts +10 -1
- package/dist/chat-ui/rich-text/chat-message-body.js +149 -23
- package/dist/chat-ui/rich-text/chat-message-body.js.map +1 -1
- package/dist/chat-ui/rich-text/chat-node-views.cjs +38 -5
- package/dist/chat-ui/rich-text/chat-node-views.cjs.map +1 -1
- package/dist/chat-ui/rich-text/chat-node-views.d.ts +11 -0
- package/dist/chat-ui/rich-text/chat-node-views.js +39 -6
- package/dist/chat-ui/rich-text/chat-node-views.js.map +1 -1
- package/dist/chat-ui/rich-text/chat-text-schema.cjs +20 -3
- package/dist/chat-ui/rich-text/chat-text-schema.cjs.map +1 -1
- package/dist/chat-ui/rich-text/chat-text-schema.d.ts +15 -2
- package/dist/chat-ui/rich-text/chat-text-schema.js +20 -3
- package/dist/chat-ui/rich-text/chat-text-schema.js.map +1 -1
- package/dist/chat-ui/rich-text/citation-anchors.cjs +139 -0
- package/dist/chat-ui/rich-text/citation-anchors.cjs.map +1 -0
- package/dist/chat-ui/rich-text/citation-anchors.d.ts +74 -0
- package/dist/chat-ui/rich-text/citation-anchors.js +139 -0
- package/dist/chat-ui/rich-text/citation-anchors.js.map +1 -0
- package/dist/chat-ui/statewire.cjs +8 -1
- package/dist/chat-ui/statewire.cjs.map +1 -1
- package/dist/chat-ui/statewire.d.ts +2 -0
- package/dist/chat-ui/statewire.js +8 -1
- package/dist/chat-ui/statewire.js.map +1 -1
- package/dist/chat-ui/thread/chat-composer-dock.cjs +27 -6
- package/dist/chat-ui/thread/chat-composer-dock.cjs.map +1 -1
- package/dist/chat-ui/thread/chat-composer-dock.d.ts +21 -1
- package/dist/chat-ui/thread/chat-composer-dock.js +28 -7
- package/dist/chat-ui/thread/chat-composer-dock.js.map +1 -1
- package/dist/chat-ui/thread/statewire-history-edge.cjs +12 -13
- package/dist/chat-ui/thread/statewire-history-edge.cjs.map +1 -1
- package/dist/chat-ui/thread/statewire-history-edge.d.ts +11 -10
- package/dist/chat-ui/thread/statewire-history-edge.js +13 -14
- package/dist/chat-ui/thread/statewire-history-edge.js.map +1 -1
- package/dist/chat-ui/thread/thread-loading-overlay.cjs +31 -0
- package/dist/chat-ui/thread/thread-loading-overlay.cjs.map +1 -0
- package/dist/chat-ui/thread/thread-loading-overlay.d.ts +14 -0
- package/dist/chat-ui/thread/thread-loading-overlay.js +31 -0
- package/dist/chat-ui/thread/thread-loading-overlay.js.map +1 -0
- package/dist/composer/ComposerDropZone.cjs +8 -1
- package/dist/composer/ComposerDropZone.cjs.map +1 -1
- package/dist/composer/ComposerDropZone.d.ts +6 -0
- package/dist/composer/ComposerDropZone.js +9 -2
- package/dist/composer/ComposerDropZone.js.map +1 -1
- package/dist/diagnostics/errors.cjs +20 -0
- package/dist/diagnostics/errors.cjs.map +1 -1
- package/dist/diagnostics/errors.d.ts +20 -0
- package/dist/diagnostics/errors.js +20 -0
- package/dist/diagnostics/errors.js.map +1 -1
- package/dist/index.cjs +47 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +26 -7
- package/dist/index.js +51 -5
- package/dist/index.js.map +1 -1
- package/dist/lib/use-prefers-reduced-motion.cjs +29 -0
- package/dist/lib/use-prefers-reduced-motion.cjs.map +1 -0
- package/dist/lib/use-prefers-reduced-motion.d.ts +6 -0
- package/dist/lib/use-prefers-reduced-motion.js +29 -0
- package/dist/lib/use-prefers-reduced-motion.js.map +1 -0
- package/dist/packages/agent-runtime/src/conversation-index.cjs.map +1 -1
- package/dist/packages/agent-runtime/src/conversation-index.js.map +1 -1
- package/dist/packages/agent-runtime/src/conversation-list.cjs +59 -0
- package/dist/packages/agent-runtime/src/conversation-list.cjs.map +1 -1
- package/dist/packages/agent-runtime/src/conversation-list.js +60 -1
- package/dist/packages/agent-runtime/src/conversation-list.js.map +1 -1
- package/dist/packages/agent-runtime/src/deep-agent-transport-recipe.cjs +5 -3
- package/dist/packages/agent-runtime/src/deep-agent-transport-recipe.cjs.map +1 -1
- package/dist/packages/agent-runtime/src/deep-agent-transport-recipe.js +5 -3
- package/dist/packages/agent-runtime/src/deep-agent-transport-recipe.js.map +1 -1
- package/dist/packages/agent-runtime/src/edit-command.cjs +21 -17
- package/dist/packages/agent-runtime/src/edit-command.cjs.map +1 -1
- package/dist/packages/agent-runtime/src/edit-command.js +22 -18
- package/dist/packages/agent-runtime/src/edit-command.js.map +1 -1
- package/dist/packages/agent-runtime/src/generated/runconfig-contract.cjs +9 -11
- package/dist/packages/agent-runtime/src/generated/runconfig-contract.cjs.map +1 -1
- package/dist/packages/agent-runtime/src/generated/runconfig-contract.js +9 -11
- package/dist/packages/agent-runtime/src/generated/runconfig-contract.js.map +1 -1
- package/dist/packages/agent-runtime/src/github-wake-event.cjs +86 -0
- package/dist/packages/agent-runtime/src/github-wake-event.cjs.map +1 -0
- package/dist/packages/agent-runtime/src/github-wake-event.js +86 -0
- package/dist/packages/agent-runtime/src/github-wake-event.js.map +1 -0
- package/dist/packages/agent-runtime/src/message-window.cjs +150 -42
- package/dist/packages/agent-runtime/src/message-window.cjs.map +1 -1
- package/dist/packages/agent-runtime/src/message-window.js +151 -43
- package/dist/packages/agent-runtime/src/message-window.js.map +1 -1
- package/dist/packages/agent-runtime/src/quota-safe-local-storage-session.cjs +13 -9
- package/dist/packages/agent-runtime/src/quota-safe-local-storage-session.cjs.map +1 -1
- package/dist/packages/agent-runtime/src/quota-safe-local-storage-session.js +13 -9
- package/dist/packages/agent-runtime/src/quota-safe-local-storage-session.js.map +1 -1
- package/dist/packages/agent-runtime/src/statewire-suspended.cjs +1 -3
- package/dist/packages/agent-runtime/src/statewire-suspended.cjs.map +1 -1
- package/dist/packages/agent-runtime/src/statewire-suspended.js +1 -3
- package/dist/packages/agent-runtime/src/statewire-suspended.js.map +1 -1
- package/dist/packages/agent-runtime/src/use-deep-agent-edit-submit.cjs.map +1 -1
- package/dist/packages/agent-runtime/src/use-deep-agent-edit-submit.js.map +1 -1
- package/dist/packages/agent-runtime/src/use-deep-agent-thread.cjs +61 -30
- package/dist/packages/agent-runtime/src/use-deep-agent-thread.cjs.map +1 -1
- package/dist/packages/agent-runtime/src/use-deep-agent-thread.js +59 -28
- package/dist/packages/agent-runtime/src/use-deep-agent-thread.js.map +1 -1
- package/dist/packages/agent-runtime/src/use-deep-agent-window-sync.cjs +56 -36
- package/dist/packages/agent-runtime/src/use-deep-agent-window-sync.cjs.map +1 -1
- package/dist/packages/agent-runtime/src/use-deep-agent-window-sync.js +59 -39
- package/dist/packages/agent-runtime/src/use-deep-agent-window-sync.js.map +1 -1
- package/dist/packages/react/package.json.cjs +1 -1
- package/dist/packages/react/package.json.js +1 -1
- package/dist/provider/AthenaContext.cjs.map +1 -1
- package/dist/provider/AthenaContext.d.ts +3 -0
- package/dist/provider/AthenaContext.js.map +1 -1
- package/dist/provider/AthenaProvider.cjs +93 -45
- package/dist/provider/AthenaProvider.cjs.map +1 -1
- package/dist/provider/AthenaProvider.d.ts +6 -1
- package/dist/provider/AthenaProvider.js +97 -49
- package/dist/provider/AthenaProvider.js.map +1 -1
- package/dist/runtime/statewire-lifecycle.cjs +2 -1
- package/dist/runtime/statewire-lifecycle.cjs.map +1 -1
- package/dist/runtime/statewire-lifecycle.js +2 -1
- package/dist/runtime/statewire-lifecycle.js.map +1 -1
- package/dist/runtime/useAthenaStatewireRuntime.cjs +3 -2
- package/dist/runtime/useAthenaStatewireRuntime.cjs.map +1 -1
- package/dist/runtime/useAthenaStatewireRuntime.d.ts +8 -12
- package/dist/runtime/useAthenaStatewireRuntime.js +3 -2
- package/dist/runtime/useAthenaStatewireRuntime.js.map +1 -1
- package/dist/search/useAthenaRepoSearch.cjs +94 -0
- package/dist/search/useAthenaRepoSearch.cjs.map +1 -0
- package/dist/search/useAthenaRepoSearch.d.ts +95 -0
- package/dist/search/useAthenaRepoSearch.js +94 -0
- package/dist/search/useAthenaRepoSearch.js.map +1 -0
- package/dist/styles.css +1 -1
- package/dist/threads/SessionList.cjs +486 -0
- package/dist/threads/SessionList.cjs.map +1 -0
- package/dist/threads/SessionList.d.ts +60 -0
- package/dist/threads/SessionList.js +486 -0
- package/dist/threads/SessionList.js.map +1 -0
- package/dist/threads/api.cjs +112 -4
- package/dist/threads/api.cjs.map +1 -1
- package/dist/threads/api.d.ts +128 -1
- package/dist/threads/api.js +113 -5
- package/dist/threads/api.js.map +1 -1
- package/dist/threads/conversation-list-fetcher.cjs +27 -3
- package/dist/threads/conversation-list-fetcher.cjs.map +1 -1
- package/dist/threads/conversation-list-fetcher.d.ts +16 -3
- package/dist/threads/conversation-list-fetcher.js +27 -3
- package/dist/threads/conversation-list-fetcher.js.map +1 -1
- package/dist/threads/index.d.ts +5 -1
- package/dist/threads/session-list-model.cjs +130 -0
- package/dist/threads/session-list-model.cjs.map +1 -0
- package/dist/threads/session-list-model.d.ts +62 -0
- package/dist/threads/session-list-model.js +130 -0
- package/dist/threads/session-list-model.js.map +1 -0
- package/dist/threads/statewire-thread-list.cjs +220 -38
- package/dist/threads/statewire-thread-list.cjs.map +1 -1
- package/dist/threads/statewire-thread-list.d.ts +152 -2
- package/dist/threads/statewire-thread-list.js +222 -40
- package/dist/threads/statewire-thread-list.js.map +1 -1
- package/dist/threads/thread-prefetcher.cjs +63 -0
- package/dist/threads/thread-prefetcher.cjs.map +1 -0
- package/dist/threads/thread-prefetcher.d.ts +54 -0
- package/dist/threads/thread-prefetcher.js +63 -0
- package/dist/threads/thread-prefetcher.js.map +1 -0
- package/dist/threads/use-athena-session-attention.cjs +22 -0
- package/dist/threads/use-athena-session-attention.cjs.map +1 -0
- package/dist/threads/use-athena-session-attention.d.ts +24 -0
- package/dist/threads/use-athena-session-attention.js +22 -0
- package/dist/threads/use-athena-session-attention.js.map +1 -0
- package/dist/threads/use-rest-conversation-history.cjs +25 -2
- package/dist/threads/use-rest-conversation-history.cjs.map +1 -1
- package/dist/threads/use-rest-conversation-history.d.ts +8 -1
- package/dist/threads/use-rest-conversation-history.js +25 -2
- package/dist/threads/use-rest-conversation-history.js.map +1 -1
- package/dist/threads/use-statewire-conversation-history.cjs +40 -16
- package/dist/threads/use-statewire-conversation-history.cjs.map +1 -1
- package/dist/threads/use-statewire-conversation-history.d.ts +13 -0
- package/dist/threads/use-statewire-conversation-history.js +40 -16
- package/dist/threads/use-statewire-conversation-history.js.map +1 -1
- package/dist/threads/use-thread-archive.cjs +128 -0
- package/dist/threads/use-thread-archive.cjs.map +1 -0
- package/dist/threads/use-thread-archive.d.ts +26 -0
- package/dist/threads/use-thread-archive.js +128 -0
- package/dist/threads/use-thread-archive.js.map +1 -0
- package/dist/threads/use-thread-favorite.cjs +53 -0
- package/dist/threads/use-thread-favorite.cjs.map +1 -0
- package/dist/threads/use-thread-favorite.d.ts +49 -0
- package/dist/threads/use-thread-favorite.js +53 -0
- package/dist/threads/use-thread-favorite.js.map +1 -0
- package/dist/threads/use-thread-field-override.cjs +184 -0
- package/dist/threads/use-thread-field-override.cjs.map +1 -0
- package/dist/threads/use-thread-field-override.d.ts +55 -0
- package/dist/threads/use-thread-field-override.js +184 -0
- package/dist/threads/use-thread-field-override.js.map +1 -0
- package/dist/threads/use-thread-rename.cjs +53 -0
- package/dist/threads/use-thread-rename.cjs.map +1 -0
- package/dist/threads/use-thread-rename.d.ts +48 -0
- package/dist/threads/use-thread-rename.js +53 -0
- package/dist/threads/use-thread-rename.js.map +1 -0
- package/dist/tools/index.cjs +5 -1
- package/dist/tools/index.cjs.map +1 -1
- package/dist/tools/index.d.ts +1 -1
- package/dist/tools/index.js +7 -3
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/misc-tool-uis.cjs +2 -1
- package/dist/tools/misc-tool-uis.cjs.map +1 -1
- package/dist/tools/misc-tool-uis.js +2 -1
- package/dist/tools/misc-tool-uis.js.map +1 -1
- package/dist/tools/primitives.cjs +25 -2
- package/dist/tools/primitives.cjs.map +1 -1
- package/dist/tools/primitives.d.ts +9 -2
- package/dist/tools/primitives.js +26 -3
- package/dist/tools/primitives.js.map +1 -1
- package/dist/tools/tool-appearance.cjs +11 -0
- package/dist/tools/tool-appearance.cjs.map +1 -0
- package/dist/tools/tool-appearance.d.ts +29 -0
- package/dist/tools/tool-appearance.js +11 -0
- package/dist/tools/tool-appearance.js.map +1 -0
- package/dist/tools/tool-fallback.cjs +211 -13
- package/dist/tools/tool-fallback.cjs.map +1 -1
- package/dist/tools/tool-fallback.d.ts +31 -4
- package/dist/tools/tool-fallback.js +214 -16
- package/dist/tools/tool-fallback.js.map +1 -1
- package/dist/tools/use-elapsed-seconds.cjs +24 -0
- package/dist/tools/use-elapsed-seconds.cjs.map +1 -0
- package/dist/tools/use-elapsed-seconds.d.ts +10 -0
- package/dist/tools/use-elapsed-seconds.js +24 -0
- package/dist/tools/use-elapsed-seconds.js.map +1 -0
- package/dist/tools/voice-update-tool-ui.cjs +2 -1
- package/dist/tools/voice-update-tool-ui.cjs.map +1 -1
- package/dist/tools/voice-update-tool-ui.js +2 -1
- package/dist/tools/voice-update-tool-ui.js.map +1 -1
- package/package.json +1 -1
- package/src/chat-ui/tailwind-preset.js +14 -1
|
@@ -5,21 +5,24 @@ import { HistoryEdgeRow, StatewireHistoryEdge } from "./thread/statewire-history
|
|
|
5
5
|
import { StatewireToolOutputsContext, useStatewireToolOutputs } from "../provider/statewire-window-context.js";
|
|
6
6
|
import { ContinuePill } from "./messages/continue-pill.js";
|
|
7
7
|
import { RuntimeMessageCard } from "./messages/runtime-message.js";
|
|
8
|
+
import { WakeMarkerCard, WakeMarkerMessage } from "./messages/wake-marker.js";
|
|
9
|
+
import { WaitingOnYouBanner, WaitingOnYouBannerView } from "../chat/WaitingOnYouBanner.js";
|
|
8
10
|
import { StatewireContinueRunAffordance, StatewireContinueRunButton, StatewireRunEndedFooter } from "./messages/statewire-continue-run.js";
|
|
9
11
|
import "../packages/agent-runtime/src/generated/runconfig-contract.js";
|
|
10
12
|
import "react";
|
|
11
13
|
import "@assistant-ui/tap";
|
|
12
14
|
import "statewire";
|
|
13
15
|
import "../packages/agent-runtime/src/statewire-suspended.js";
|
|
16
|
+
import "../packages/agent-runtime/src/conversation-list.js";
|
|
14
17
|
import "@tanstack/react-query";
|
|
15
18
|
import { HITL_PENDING_RESUME_GRACE_MS } from "../packages/agent-runtime/src/interrupts.js";
|
|
16
19
|
import "../packages/agent-runtime/src/messages.js";
|
|
17
20
|
import "../packages/agent-runtime/src/statewire-state.js";
|
|
18
|
-
import "@assistant-ui/react-statewire";
|
|
19
21
|
import "@assistant-ui/store";
|
|
20
22
|
import "../packages/agent-runtime/src/quota-safe-local-storage-session.js";
|
|
21
23
|
import "../packages/agent-runtime/src/statewire-attach-observer.js";
|
|
22
24
|
import "../packages/agent-runtime/src/thread-status.js";
|
|
25
|
+
import "@assistant-ui/react-statewire";
|
|
23
26
|
import "@assistant-ui/core";
|
|
24
27
|
import "../packages/agent-runtime/src/thread-handoff.js";
|
|
25
28
|
export {
|
|
@@ -34,6 +37,10 @@ export {
|
|
|
34
37
|
StatewireQueuedMessages,
|
|
35
38
|
StatewireRunEndedFooter,
|
|
36
39
|
StatewireToolOutputsContext,
|
|
40
|
+
WaitingOnYouBanner,
|
|
41
|
+
WaitingOnYouBannerView,
|
|
42
|
+
WakeMarkerCard,
|
|
43
|
+
WakeMarkerMessage,
|
|
37
44
|
useStatewireApprovalRequest,
|
|
38
45
|
useStatewireToolOutputs
|
|
39
46
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"statewire.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"statewire.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -3,34 +3,55 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
4
|
const react = require("@assistant-ui/react");
|
|
5
5
|
const messageComponents = require("../messages/message-components.cjs");
|
|
6
|
+
const CHROME = {
|
|
7
|
+
default: {
|
|
8
|
+
dock: messageComponents.COMPOSER_DOCK_CLASS,
|
|
9
|
+
surface: messageComponents.COMPOSER_SURFACE_CLASS,
|
|
10
|
+
editorRow: messageComponents.COMPOSER_EDITOR_ROW_CLASS,
|
|
11
|
+
toolbar: messageComponents.COMPOSER_TOOLBAR_CLASS
|
|
12
|
+
},
|
|
13
|
+
paper: {
|
|
14
|
+
dock: messageComponents.COMPOSER_PAPER_DOCK_CLASS,
|
|
15
|
+
surface: messageComponents.COMPOSER_PAPER_SURFACE_CLASS,
|
|
16
|
+
editorRow: messageComponents.COMPOSER_PAPER_EDITOR_ROW_CLASS,
|
|
17
|
+
toolbar: messageComponents.COMPOSER_PAPER_TOOLBAR_CLASS
|
|
18
|
+
}
|
|
19
|
+
};
|
|
6
20
|
function ChatComposerDock({
|
|
21
|
+
appearance = "default",
|
|
7
22
|
className,
|
|
8
23
|
surfaceClassName,
|
|
9
24
|
editorRowClassName,
|
|
10
25
|
toolbarClassName,
|
|
26
|
+
dragActive = false,
|
|
11
27
|
aboveSurface,
|
|
12
28
|
beforeEditor,
|
|
13
29
|
editor,
|
|
14
30
|
toolbarStart,
|
|
15
|
-
toolbarEnd
|
|
31
|
+
toolbarEnd,
|
|
32
|
+
belowSurface
|
|
16
33
|
}) {
|
|
17
|
-
|
|
34
|
+
const chrome = CHROME[appearance];
|
|
35
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: className ?? chrome.dock, children: [
|
|
18
36
|
aboveSurface,
|
|
19
37
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
20
38
|
react.ComposerPrimitive.Root,
|
|
21
39
|
{
|
|
22
|
-
className: surfaceClassName ??
|
|
40
|
+
className: surfaceClassName ?? chrome.surface,
|
|
41
|
+
"data-appearance": appearance === "paper" ? "paper" : void 0,
|
|
42
|
+
"data-drag-active": dragActive ? "true" : void 0,
|
|
23
43
|
children: [
|
|
24
44
|
beforeEditor,
|
|
25
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: editorRowClassName ??
|
|
26
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: toolbarClassName ??
|
|
45
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: editorRowClassName ?? chrome.editorRow, children: editor }),
|
|
46
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: toolbarClassName ?? chrome.toolbar, children: [
|
|
27
47
|
toolbarStart,
|
|
28
48
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1" }),
|
|
29
49
|
toolbarEnd
|
|
30
50
|
] })
|
|
31
51
|
]
|
|
32
52
|
}
|
|
33
|
-
)
|
|
53
|
+
),
|
|
54
|
+
belowSurface
|
|
34
55
|
] });
|
|
35
56
|
}
|
|
36
57
|
exports.ChatComposerDock = ChatComposerDock;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-composer-dock.cjs","sources":["../../../src/chat-ui/thread/chat-composer-dock.tsx"],"sourcesContent":["import { ComposerPrimitive } from \"@assistant-ui/react\";\nimport type { ReactNode } from \"react\";\nimport {\n COMPOSER_DOCK_CLASS,\n COMPOSER_EDITOR_ROW_CLASS,\n COMPOSER_SURFACE_CLASS,\n COMPOSER_TOOLBAR_CLASS,\n} from \"../messages/message-components\";\n\nexport interface ChatComposerDockProps {\n /**\n * Replaces the dock chrome (padding + background around the surface).\n * Hosts with their own composer chrome system (AthenaChat's `aui-*`\n * classes) pass their chrome here; the scaffolding structure stays shared.\n */\n className?: string;\n /** Replaces the bordered composer-surface chrome. */\n surfaceClassName?: string;\n /** Replaces the editor-row chrome. */\n editorRowClassName?: string;\n /** Replaces the toolbar-row chrome. */\n toolbarClassName?: string;\n /** Rendered inside the dock, above the composer surface (error banners). */\n aboveSurface?: ReactNode;\n /**\n * Rendered inside the surface above the editor row: context chips,\n * restore notices, attachment strips.\n */\n beforeEditor?: ReactNode;\n /** The editor element (a TiptapComposer, typically ref-held by the host). */\n editor: ReactNode;\n /** Toolbar contents before the spacer (attach buttons, pickers). */\n toolbarStart?: ReactNode;\n /** Toolbar contents after the spacer (voice and send/stop controls). */\n toolbarEnd: ReactNode;\n}\n\n/**\n * The shared composer scaffolding: dock padding, the bordered surface, the\n * editor row, and the toolbar with its start/end slots around a flexible\n * spacer. Hosts supply the editor element and toolbar controls.\n */\nexport function ChatComposerDock({\n className,\n surfaceClassName,\n editorRowClassName,\n toolbarClassName,\n aboveSurface,\n beforeEditor,\n editor,\n toolbarStart,\n toolbarEnd,\n}: ChatComposerDockProps) {\n return (\n <div className={className ??
|
|
1
|
+
{"version":3,"file":"chat-composer-dock.cjs","sources":["../../../src/chat-ui/thread/chat-composer-dock.tsx"],"sourcesContent":["import { ComposerPrimitive } from \"@assistant-ui/react\";\nimport type { ReactNode } from \"react\";\nimport {\n COMPOSER_DOCK_CLASS,\n COMPOSER_EDITOR_ROW_CLASS,\n COMPOSER_PAPER_DOCK_CLASS,\n COMPOSER_PAPER_EDITOR_ROW_CLASS,\n COMPOSER_PAPER_SURFACE_CLASS,\n COMPOSER_PAPER_TOOLBAR_CLASS,\n COMPOSER_SURFACE_CLASS,\n COMPOSER_TOOLBAR_CLASS,\n} from \"../messages/message-components\";\n\n/**\n * Which chrome the dock renders when a host supplies no class names of its\n * own. `default` is the side-panel / task-pane card (Chrome extension, Office\n * add-in); `paper` is the SDK thread's card-toned surface with the larger\n * radius, focus ring and drag-over tint.\n */\nexport type ChatComposerAppearance = \"default\" | \"paper\";\n\ninterface ComposerChrome {\n dock: string;\n surface: string;\n editorRow: string;\n toolbar: string;\n}\n\nconst CHROME: Record<ChatComposerAppearance, ComposerChrome> = {\n default: {\n dock: COMPOSER_DOCK_CLASS,\n surface: COMPOSER_SURFACE_CLASS,\n editorRow: COMPOSER_EDITOR_ROW_CLASS,\n toolbar: COMPOSER_TOOLBAR_CLASS,\n },\n paper: {\n dock: COMPOSER_PAPER_DOCK_CLASS,\n surface: COMPOSER_PAPER_SURFACE_CLASS,\n editorRow: COMPOSER_PAPER_EDITOR_ROW_CLASS,\n toolbar: COMPOSER_PAPER_TOOLBAR_CLASS,\n },\n};\n\nexport interface ChatComposerDockProps {\n /**\n * The chrome set used for every class a host leaves unset. Defaults to\n * `default`, so existing hosts render exactly what they rendered before.\n */\n appearance?: ChatComposerAppearance;\n /**\n * Replaces the dock chrome (padding + background around the surface).\n * Hosts with their own composer chrome system (AthenaChat's `aui-*`\n * classes) pass their chrome here; the scaffolding structure stays shared.\n */\n className?: string;\n /** Replaces the bordered composer-surface chrome. */\n surfaceClassName?: string;\n /** Replaces the editor-row chrome. */\n editorRowClassName?: string;\n /** Replaces the toolbar-row chrome. */\n toolbarClassName?: string;\n /**\n * Files are being dragged over the composer: sets `data-drag-active=\"true\"`\n * on the surface, which the paper chrome tints. The host's drop zone owns\n * the drag state (`ComposerDropZone onDragActiveChange`).\n */\n dragActive?: boolean;\n /** Rendered inside the dock, above the composer surface (error banners). */\n aboveSurface?: ReactNode;\n /**\n * Rendered inside the surface above the editor row: context chips,\n * restore notices, attachment strips.\n */\n beforeEditor?: ReactNode;\n /** The editor element (a TiptapComposer, typically ref-held by the host). */\n editor: ReactNode;\n /** Toolbar contents before the spacer (attach buttons, pickers). */\n toolbarStart?: ReactNode;\n /** Toolbar contents after the spacer (voice and send/stop controls). */\n toolbarEnd: ReactNode;\n /** Rendered inside the dock, under the composer surface (keyboard hints). */\n belowSurface?: ReactNode;\n}\n\n/**\n * The shared composer scaffolding: dock padding, the bordered surface, the\n * editor row, and the toolbar with its start/end slots around a flexible\n * spacer. Hosts supply the editor element and toolbar controls.\n */\nexport function ChatComposerDock({\n appearance = \"default\",\n className,\n surfaceClassName,\n editorRowClassName,\n toolbarClassName,\n dragActive = false,\n aboveSurface,\n beforeEditor,\n editor,\n toolbarStart,\n toolbarEnd,\n belowSurface,\n}: ChatComposerDockProps) {\n const chrome = CHROME[appearance];\n return (\n <div className={className ?? chrome.dock}>\n {aboveSurface}\n <ComposerPrimitive.Root\n className={surfaceClassName ?? chrome.surface}\n // Only the paper chrome is keyed off these attributes; the default\n // chrome's DOM stays byte-for-byte what its hosts snapshot.\n data-appearance={appearance === \"paper\" ? \"paper\" : undefined}\n data-drag-active={dragActive ? \"true\" : undefined}\n >\n {beforeEditor}\n <div className={editorRowClassName ?? chrome.editorRow}>\n {editor}\n </div>\n <div className={toolbarClassName ?? chrome.toolbar}>\n {toolbarStart}\n <div className=\"flex-1\" />\n {toolbarEnd}\n </div>\n </ComposerPrimitive.Root>\n {belowSurface}\n </div>\n );\n}\n"],"names":["COMPOSER_DOCK_CLASS","COMPOSER_SURFACE_CLASS","COMPOSER_EDITOR_ROW_CLASS","COMPOSER_TOOLBAR_CLASS","COMPOSER_PAPER_DOCK_CLASS","COMPOSER_PAPER_SURFACE_CLASS","COMPOSER_PAPER_EDITOR_ROW_CLASS","COMPOSER_PAPER_TOOLBAR_CLASS","jsxs","ComposerPrimitive","jsx"],"mappings":";;;;;AA4BA,MAAM,SAAyD;AAAA,EAC7D,SAAS;AAAA,IACP,MAAMA,kBAAAA;AAAAA,IACN,SAASC,kBAAAA;AAAAA,IACT,WAAWC,kBAAAA;AAAAA,IACX,SAASC,kBAAAA;AAAAA,EAAA;AAAA,EAEX,OAAO;AAAA,IACL,MAAMC,kBAAAA;AAAAA,IACN,SAASC,kBAAAA;AAAAA,IACT,WAAWC,kBAAAA;AAAAA,IACX,SAASC,kBAAAA;AAAAA,EAAA;AAEb;AAgDO,SAAS,iBAAiB;AAAA,EAC/B,aAAa;AAAA,EACb;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,aAAa;AAAA,EACb;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAA0B;AACxB,QAAM,SAAS,OAAO,UAAU;AAChC,SACEC,2BAAAA,KAAC,OAAA,EAAI,WAAW,aAAa,OAAO,MACjC,UAAA;AAAA,IAAA;AAAA,IACDA,2BAAAA;AAAAA,MAACC,MAAAA,kBAAkB;AAAA,MAAlB;AAAA,QACC,WAAW,oBAAoB,OAAO;AAAA,QAGtC,mBAAiB,eAAe,UAAU,UAAU;AAAA,QACpD,oBAAkB,aAAa,SAAS;AAAA,QAEvC,UAAA;AAAA,UAAA;AAAA,yCACA,OAAA,EAAI,WAAW,sBAAsB,OAAO,WAC1C,UAAA,QACH;AAAA,UACAD,2BAAAA,KAAC,OAAA,EAAI,WAAW,oBAAoB,OAAO,SACxC,UAAA;AAAA,YAAA;AAAA,YACDE,2BAAAA,IAAC,OAAA,EAAI,WAAU,SAAA,CAAS;AAAA,YACvB;AAAA,UAAA,EAAA,CACH;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,IAED;AAAA,EAAA,GACH;AAEJ;;"}
|
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Which chrome the dock renders when a host supplies no class names of its
|
|
4
|
+
* own. `default` is the side-panel / task-pane card (Chrome extension, Office
|
|
5
|
+
* add-in); `paper` is the SDK thread's card-toned surface with the larger
|
|
6
|
+
* radius, focus ring and drag-over tint.
|
|
7
|
+
*/
|
|
8
|
+
export type ChatComposerAppearance = "default" | "paper";
|
|
2
9
|
export interface ChatComposerDockProps {
|
|
10
|
+
/**
|
|
11
|
+
* The chrome set used for every class a host leaves unset. Defaults to
|
|
12
|
+
* `default`, so existing hosts render exactly what they rendered before.
|
|
13
|
+
*/
|
|
14
|
+
appearance?: ChatComposerAppearance;
|
|
3
15
|
/**
|
|
4
16
|
* Replaces the dock chrome (padding + background around the surface).
|
|
5
17
|
* Hosts with their own composer chrome system (AthenaChat's `aui-*`
|
|
@@ -12,6 +24,12 @@ export interface ChatComposerDockProps {
|
|
|
12
24
|
editorRowClassName?: string;
|
|
13
25
|
/** Replaces the toolbar-row chrome. */
|
|
14
26
|
toolbarClassName?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Files are being dragged over the composer: sets `data-drag-active="true"`
|
|
29
|
+
* on the surface, which the paper chrome tints. The host's drop zone owns
|
|
30
|
+
* the drag state (`ComposerDropZone onDragActiveChange`).
|
|
31
|
+
*/
|
|
32
|
+
dragActive?: boolean;
|
|
15
33
|
/** Rendered inside the dock, above the composer surface (error banners). */
|
|
16
34
|
aboveSurface?: ReactNode;
|
|
17
35
|
/**
|
|
@@ -25,10 +43,12 @@ export interface ChatComposerDockProps {
|
|
|
25
43
|
toolbarStart?: ReactNode;
|
|
26
44
|
/** Toolbar contents after the spacer (voice and send/stop controls). */
|
|
27
45
|
toolbarEnd: ReactNode;
|
|
46
|
+
/** Rendered inside the dock, under the composer surface (keyboard hints). */
|
|
47
|
+
belowSurface?: ReactNode;
|
|
28
48
|
}
|
|
29
49
|
/**
|
|
30
50
|
* The shared composer scaffolding: dock padding, the bordered surface, the
|
|
31
51
|
* editor row, and the toolbar with its start/end slots around a flexible
|
|
32
52
|
* spacer. Hosts supply the editor element and toolbar controls.
|
|
33
53
|
*/
|
|
34
|
-
export declare function ChatComposerDock({ className, surfaceClassName, editorRowClassName, toolbarClassName, aboveSurface, beforeEditor, editor, toolbarStart, toolbarEnd, }: ChatComposerDockProps): import("react/jsx-runtime").JSX.Element;
|
|
54
|
+
export declare function ChatComposerDock({ appearance, className, surfaceClassName, editorRowClassName, toolbarClassName, dragActive, aboveSurface, beforeEditor, editor, toolbarStart, toolbarEnd, belowSurface, }: ChatComposerDockProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,34 +1,55 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { ComposerPrimitive } from "@assistant-ui/react";
|
|
3
|
-
import {
|
|
3
|
+
import { COMPOSER_PAPER_TOOLBAR_CLASS, COMPOSER_PAPER_EDITOR_ROW_CLASS, COMPOSER_PAPER_SURFACE_CLASS, COMPOSER_PAPER_DOCK_CLASS, COMPOSER_TOOLBAR_CLASS, COMPOSER_EDITOR_ROW_CLASS, COMPOSER_SURFACE_CLASS, COMPOSER_DOCK_CLASS } from "../messages/message-components.js";
|
|
4
|
+
const CHROME = {
|
|
5
|
+
default: {
|
|
6
|
+
dock: COMPOSER_DOCK_CLASS,
|
|
7
|
+
surface: COMPOSER_SURFACE_CLASS,
|
|
8
|
+
editorRow: COMPOSER_EDITOR_ROW_CLASS,
|
|
9
|
+
toolbar: COMPOSER_TOOLBAR_CLASS
|
|
10
|
+
},
|
|
11
|
+
paper: {
|
|
12
|
+
dock: COMPOSER_PAPER_DOCK_CLASS,
|
|
13
|
+
surface: COMPOSER_PAPER_SURFACE_CLASS,
|
|
14
|
+
editorRow: COMPOSER_PAPER_EDITOR_ROW_CLASS,
|
|
15
|
+
toolbar: COMPOSER_PAPER_TOOLBAR_CLASS
|
|
16
|
+
}
|
|
17
|
+
};
|
|
4
18
|
function ChatComposerDock({
|
|
19
|
+
appearance = "default",
|
|
5
20
|
className,
|
|
6
21
|
surfaceClassName,
|
|
7
22
|
editorRowClassName,
|
|
8
23
|
toolbarClassName,
|
|
24
|
+
dragActive = false,
|
|
9
25
|
aboveSurface,
|
|
10
26
|
beforeEditor,
|
|
11
27
|
editor,
|
|
12
28
|
toolbarStart,
|
|
13
|
-
toolbarEnd
|
|
29
|
+
toolbarEnd,
|
|
30
|
+
belowSurface
|
|
14
31
|
}) {
|
|
15
|
-
|
|
32
|
+
const chrome = CHROME[appearance];
|
|
33
|
+
return /* @__PURE__ */ jsxs("div", { className: className ?? chrome.dock, children: [
|
|
16
34
|
aboveSurface,
|
|
17
35
|
/* @__PURE__ */ jsxs(
|
|
18
36
|
ComposerPrimitive.Root,
|
|
19
37
|
{
|
|
20
|
-
className: surfaceClassName ??
|
|
38
|
+
className: surfaceClassName ?? chrome.surface,
|
|
39
|
+
"data-appearance": appearance === "paper" ? "paper" : void 0,
|
|
40
|
+
"data-drag-active": dragActive ? "true" : void 0,
|
|
21
41
|
children: [
|
|
22
42
|
beforeEditor,
|
|
23
|
-
/* @__PURE__ */ jsx("div", { className: editorRowClassName ??
|
|
24
|
-
/* @__PURE__ */ jsxs("div", { className: toolbarClassName ??
|
|
43
|
+
/* @__PURE__ */ jsx("div", { className: editorRowClassName ?? chrome.editorRow, children: editor }),
|
|
44
|
+
/* @__PURE__ */ jsxs("div", { className: toolbarClassName ?? chrome.toolbar, children: [
|
|
25
45
|
toolbarStart,
|
|
26
46
|
/* @__PURE__ */ jsx("div", { className: "flex-1" }),
|
|
27
47
|
toolbarEnd
|
|
28
48
|
] })
|
|
29
49
|
]
|
|
30
50
|
}
|
|
31
|
-
)
|
|
51
|
+
),
|
|
52
|
+
belowSurface
|
|
32
53
|
] });
|
|
33
54
|
}
|
|
34
55
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-composer-dock.js","sources":["../../../src/chat-ui/thread/chat-composer-dock.tsx"],"sourcesContent":["import { ComposerPrimitive } from \"@assistant-ui/react\";\nimport type { ReactNode } from \"react\";\nimport {\n COMPOSER_DOCK_CLASS,\n COMPOSER_EDITOR_ROW_CLASS,\n COMPOSER_SURFACE_CLASS,\n COMPOSER_TOOLBAR_CLASS,\n} from \"../messages/message-components\";\n\nexport interface ChatComposerDockProps {\n /**\n * Replaces the dock chrome (padding + background around the surface).\n * Hosts with their own composer chrome system (AthenaChat's `aui-*`\n * classes) pass their chrome here; the scaffolding structure stays shared.\n */\n className?: string;\n /** Replaces the bordered composer-surface chrome. */\n surfaceClassName?: string;\n /** Replaces the editor-row chrome. */\n editorRowClassName?: string;\n /** Replaces the toolbar-row chrome. */\n toolbarClassName?: string;\n /** Rendered inside the dock, above the composer surface (error banners). */\n aboveSurface?: ReactNode;\n /**\n * Rendered inside the surface above the editor row: context chips,\n * restore notices, attachment strips.\n */\n beforeEditor?: ReactNode;\n /** The editor element (a TiptapComposer, typically ref-held by the host). */\n editor: ReactNode;\n /** Toolbar contents before the spacer (attach buttons, pickers). */\n toolbarStart?: ReactNode;\n /** Toolbar contents after the spacer (voice and send/stop controls). */\n toolbarEnd: ReactNode;\n}\n\n/**\n * The shared composer scaffolding: dock padding, the bordered surface, the\n * editor row, and the toolbar with its start/end slots around a flexible\n * spacer. Hosts supply the editor element and toolbar controls.\n */\nexport function ChatComposerDock({\n className,\n surfaceClassName,\n editorRowClassName,\n toolbarClassName,\n aboveSurface,\n beforeEditor,\n editor,\n toolbarStart,\n toolbarEnd,\n}: ChatComposerDockProps) {\n return (\n <div className={className ??
|
|
1
|
+
{"version":3,"file":"chat-composer-dock.js","sources":["../../../src/chat-ui/thread/chat-composer-dock.tsx"],"sourcesContent":["import { ComposerPrimitive } from \"@assistant-ui/react\";\nimport type { ReactNode } from \"react\";\nimport {\n COMPOSER_DOCK_CLASS,\n COMPOSER_EDITOR_ROW_CLASS,\n COMPOSER_PAPER_DOCK_CLASS,\n COMPOSER_PAPER_EDITOR_ROW_CLASS,\n COMPOSER_PAPER_SURFACE_CLASS,\n COMPOSER_PAPER_TOOLBAR_CLASS,\n COMPOSER_SURFACE_CLASS,\n COMPOSER_TOOLBAR_CLASS,\n} from \"../messages/message-components\";\n\n/**\n * Which chrome the dock renders when a host supplies no class names of its\n * own. `default` is the side-panel / task-pane card (Chrome extension, Office\n * add-in); `paper` is the SDK thread's card-toned surface with the larger\n * radius, focus ring and drag-over tint.\n */\nexport type ChatComposerAppearance = \"default\" | \"paper\";\n\ninterface ComposerChrome {\n dock: string;\n surface: string;\n editorRow: string;\n toolbar: string;\n}\n\nconst CHROME: Record<ChatComposerAppearance, ComposerChrome> = {\n default: {\n dock: COMPOSER_DOCK_CLASS,\n surface: COMPOSER_SURFACE_CLASS,\n editorRow: COMPOSER_EDITOR_ROW_CLASS,\n toolbar: COMPOSER_TOOLBAR_CLASS,\n },\n paper: {\n dock: COMPOSER_PAPER_DOCK_CLASS,\n surface: COMPOSER_PAPER_SURFACE_CLASS,\n editorRow: COMPOSER_PAPER_EDITOR_ROW_CLASS,\n toolbar: COMPOSER_PAPER_TOOLBAR_CLASS,\n },\n};\n\nexport interface ChatComposerDockProps {\n /**\n * The chrome set used for every class a host leaves unset. Defaults to\n * `default`, so existing hosts render exactly what they rendered before.\n */\n appearance?: ChatComposerAppearance;\n /**\n * Replaces the dock chrome (padding + background around the surface).\n * Hosts with their own composer chrome system (AthenaChat's `aui-*`\n * classes) pass their chrome here; the scaffolding structure stays shared.\n */\n className?: string;\n /** Replaces the bordered composer-surface chrome. */\n surfaceClassName?: string;\n /** Replaces the editor-row chrome. */\n editorRowClassName?: string;\n /** Replaces the toolbar-row chrome. */\n toolbarClassName?: string;\n /**\n * Files are being dragged over the composer: sets `data-drag-active=\"true\"`\n * on the surface, which the paper chrome tints. The host's drop zone owns\n * the drag state (`ComposerDropZone onDragActiveChange`).\n */\n dragActive?: boolean;\n /** Rendered inside the dock, above the composer surface (error banners). */\n aboveSurface?: ReactNode;\n /**\n * Rendered inside the surface above the editor row: context chips,\n * restore notices, attachment strips.\n */\n beforeEditor?: ReactNode;\n /** The editor element (a TiptapComposer, typically ref-held by the host). */\n editor: ReactNode;\n /** Toolbar contents before the spacer (attach buttons, pickers). */\n toolbarStart?: ReactNode;\n /** Toolbar contents after the spacer (voice and send/stop controls). */\n toolbarEnd: ReactNode;\n /** Rendered inside the dock, under the composer surface (keyboard hints). */\n belowSurface?: ReactNode;\n}\n\n/**\n * The shared composer scaffolding: dock padding, the bordered surface, the\n * editor row, and the toolbar with its start/end slots around a flexible\n * spacer. Hosts supply the editor element and toolbar controls.\n */\nexport function ChatComposerDock({\n appearance = \"default\",\n className,\n surfaceClassName,\n editorRowClassName,\n toolbarClassName,\n dragActive = false,\n aboveSurface,\n beforeEditor,\n editor,\n toolbarStart,\n toolbarEnd,\n belowSurface,\n}: ChatComposerDockProps) {\n const chrome = CHROME[appearance];\n return (\n <div className={className ?? chrome.dock}>\n {aboveSurface}\n <ComposerPrimitive.Root\n className={surfaceClassName ?? chrome.surface}\n // Only the paper chrome is keyed off these attributes; the default\n // chrome's DOM stays byte-for-byte what its hosts snapshot.\n data-appearance={appearance === \"paper\" ? \"paper\" : undefined}\n data-drag-active={dragActive ? \"true\" : undefined}\n >\n {beforeEditor}\n <div className={editorRowClassName ?? chrome.editorRow}>\n {editor}\n </div>\n <div className={toolbarClassName ?? chrome.toolbar}>\n {toolbarStart}\n <div className=\"flex-1\" />\n {toolbarEnd}\n </div>\n </ComposerPrimitive.Root>\n {belowSurface}\n </div>\n );\n}\n"],"names":[],"mappings":";;;AA4BA,MAAM,SAAyD;AAAA,EAC7D,SAAS;AAAA,IACP,MAAM;AAAA,IACN,SAAS;AAAA,IACT,WAAW;AAAA,IACX,SAAS;AAAA,EAAA;AAAA,EAEX,OAAO;AAAA,IACL,MAAM;AAAA,IACN,SAAS;AAAA,IACT,WAAW;AAAA,IACX,SAAS;AAAA,EAAA;AAEb;AAgDO,SAAS,iBAAiB;AAAA,EAC/B,aAAa;AAAA,EACb;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,aAAa;AAAA,EACb;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAA0B;AACxB,QAAM,SAAS,OAAO,UAAU;AAChC,SACE,qBAAC,OAAA,EAAI,WAAW,aAAa,OAAO,MACjC,UAAA;AAAA,IAAA;AAAA,IACD;AAAA,MAAC,kBAAkB;AAAA,MAAlB;AAAA,QACC,WAAW,oBAAoB,OAAO;AAAA,QAGtC,mBAAiB,eAAe,UAAU,UAAU;AAAA,QACpD,oBAAkB,aAAa,SAAS;AAAA,QAEvC,UAAA;AAAA,UAAA;AAAA,8BACA,OAAA,EAAI,WAAW,sBAAsB,OAAO,WAC1C,UAAA,QACH;AAAA,UACA,qBAAC,OAAA,EAAI,WAAW,oBAAoB,OAAO,SACxC,UAAA;AAAA,YAAA;AAAA,YACD,oBAAC,OAAA,EAAI,WAAU,SAAA,CAAS;AAAA,YACvB;AAAA,UAAA,EAAA,CACH;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,IAED;AAAA,EAAA,GACH;AAEJ;"}
|
|
@@ -8,6 +8,7 @@ require("@assistant-ui/tap");
|
|
|
8
8
|
require("statewire");
|
|
9
9
|
const errors = require("../../packages/agent-runtime/src/errors.cjs");
|
|
10
10
|
require("../../packages/agent-runtime/src/statewire-suspended.cjs");
|
|
11
|
+
require("../../packages/agent-runtime/src/conversation-list.cjs");
|
|
11
12
|
require("@tanstack/react-query");
|
|
12
13
|
require("../../packages/agent-runtime/src/statewire-state.cjs");
|
|
13
14
|
require("../../packages/agent-runtime/src/messages.cjs");
|
|
@@ -24,13 +25,14 @@ const cnfast = require("cnfast");
|
|
|
24
25
|
const THREAD_VIEWPORT_ATTR = "data-aui-thread-viewport";
|
|
25
26
|
const HISTORY_EDGE_NEAR_MARGIN_PX = 1500;
|
|
26
27
|
const HistoryEdgeRow = ({
|
|
27
|
-
|
|
28
|
+
hasOlder,
|
|
29
|
+
canLoadOlder = hasOlder,
|
|
28
30
|
loading,
|
|
29
31
|
onLoadOlder,
|
|
30
32
|
className,
|
|
31
33
|
rowRef
|
|
32
34
|
}) => {
|
|
33
|
-
if (
|
|
35
|
+
if (!hasOlder) return null;
|
|
34
36
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
35
37
|
"div",
|
|
36
38
|
{
|
|
@@ -40,20 +42,16 @@ const HistoryEdgeRow = ({
|
|
|
40
42
|
"flex w-full max-w-(--thread-max-width) items-center justify-center py-1 text-xs text-muted-foreground",
|
|
41
43
|
className
|
|
42
44
|
),
|
|
43
|
-
children: loading ? /* @__PURE__ */ jsxRuntime.jsx("span", { "data-testid": "thread-history-edge-loading", children: "Loading earlier messages…" }) : /* @__PURE__ */ jsxRuntime.
|
|
45
|
+
children: loading ? /* @__PURE__ */ jsxRuntime.jsx("span", { "data-testid": "thread-history-edge-loading", children: "Loading earlier messages…" }) : canLoadOlder ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
44
46
|
"button",
|
|
45
47
|
{
|
|
46
48
|
type: "button",
|
|
47
49
|
"data-testid": "thread-history-edge-load",
|
|
48
50
|
onClick: onLoadOlder,
|
|
49
51
|
className: "rounded-lg px-2.5 py-1 text-xs font-medium text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",
|
|
50
|
-
children:
|
|
51
|
-
olderCount.toLocaleString(),
|
|
52
|
-
" earlier ",
|
|
53
|
-
olderCount === 1 ? "message" : "messages"
|
|
54
|
-
]
|
|
52
|
+
children: "Load earlier messages"
|
|
55
53
|
}
|
|
56
|
-
)
|
|
54
|
+
) : /* @__PURE__ */ jsxRuntime.jsx("span", { "data-testid": "thread-history-edge-limit", children: "Earlier messages can't be loaded here" })
|
|
57
55
|
}
|
|
58
56
|
);
|
|
59
57
|
};
|
|
@@ -70,7 +68,7 @@ const StatewireHistoryEdge = ({
|
|
|
70
68
|
const [nearTopEpoch, setNearTopEpoch] = react$1.useState(0);
|
|
71
69
|
const nearTopRef = react$1.useRef(false);
|
|
72
70
|
const [rowEl, setRowEl] = react$1.useState(null);
|
|
73
|
-
const {
|
|
71
|
+
const { hasOlder, canLoadOlder, loading, loadOlder } = useDeepAgentWindowSync.useDeepAgentWindowSync({
|
|
74
72
|
messages,
|
|
75
73
|
toolOutputs,
|
|
76
74
|
nearTop,
|
|
@@ -82,7 +80,7 @@ const StatewireHistoryEdge = ({
|
|
|
82
80
|
}
|
|
83
81
|
});
|
|
84
82
|
react$1.useEffect(() => {
|
|
85
|
-
if (!rowEl ||
|
|
83
|
+
if (!rowEl || !hasOlder || typeof IntersectionObserver === "undefined") return;
|
|
86
84
|
const observer = new IntersectionObserver(
|
|
87
85
|
(entries) => {
|
|
88
86
|
for (const entry of entries) {
|
|
@@ -104,7 +102,7 @@ const StatewireHistoryEdge = ({
|
|
|
104
102
|
nearTopRef.current = false;
|
|
105
103
|
setNearTop(false);
|
|
106
104
|
};
|
|
107
|
-
}, [rowEl,
|
|
105
|
+
}, [rowEl, hasOlder]);
|
|
108
106
|
const shapeRef = react$1.useRef(
|
|
109
107
|
null
|
|
110
108
|
);
|
|
@@ -121,7 +119,8 @@ const StatewireHistoryEdge = ({
|
|
|
121
119
|
HistoryEdgeRow,
|
|
122
120
|
{
|
|
123
121
|
rowRef: setRowEl,
|
|
124
|
-
|
|
122
|
+
hasOlder,
|
|
123
|
+
canLoadOlder,
|
|
125
124
|
loading,
|
|
126
125
|
onLoadOlder: loadOlder,
|
|
127
126
|
className
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"statewire-history-edge.cjs","sources":["../../../src/chat-ui/thread/statewire-history-edge.tsx"],"sourcesContent":["import { useAuiState } from \"@assistant-ui/react\";\nimport {\n type DeepAgentHistoryLoadEvent,\n type DeepAgentToolOutputStore,\n isStatewireChannelTeardown,\n useDeepAgentWindowSync,\n} from \"@athenaintel/agent-runtime\";\nimport type { FC } from \"react\";\nimport { useEffect, useLayoutEffect, useRef, useState } from \"react\";\nimport { cn } from \"../../lib/utils\";\nimport { useStatewireToolOutputs } from \"../../provider/statewire-window-context\";\n\n/** The attribute `ChatThreadShell` stamps on the scroll viewport. */\nexport const THREAD_VIEWPORT_ATTR = \"data-aui-thread-viewport\";\n\n/**\n * How far above the viewport the edge row counts as near: the row sits above\n * the first loaded message, so reaching it means the user has scrolled past\n * everything loaded and the next page should already be on its way.\n */\nexport const HISTORY_EDGE_NEAR_MARGIN_PX = 1500;\n\nexport interface HistoryEdgeRowProps {\n /**
|
|
1
|
+
{"version":3,"file":"statewire-history-edge.cjs","sources":["../../../src/chat-ui/thread/statewire-history-edge.tsx"],"sourcesContent":["import { useAuiState } from \"@assistant-ui/react\";\nimport {\n type DeepAgentHistoryLoadEvent,\n type DeepAgentToolOutputStore,\n isStatewireChannelTeardown,\n useDeepAgentWindowSync,\n} from \"@athenaintel/agent-runtime\";\nimport type { FC } from \"react\";\nimport { useEffect, useLayoutEffect, useRef, useState } from \"react\";\nimport { cn } from \"../../lib/utils\";\nimport { useStatewireToolOutputs } from \"../../provider/statewire-window-context\";\n\n/** The attribute `ChatThreadShell` stamps on the scroll viewport. */\nexport const THREAD_VIEWPORT_ATTR = \"data-aui-thread-viewport\";\n\n/**\n * How far above the viewport the edge row counts as near: the row sits above\n * the first loaded message, so reaching it means the user has scrolled past\n * everything loaded and the next page should already be on its way.\n */\nexport const HISTORY_EDGE_NEAR_MARGIN_PX = 1500;\n\nexport interface HistoryEdgeRowProps {\n /** Whether the server holds messages older than the loaded window. */\n hasOlder: boolean;\n /** Whether the next page can be asked for; `false` with `hasOlder` is the connection's loading depth spent. Defaults to `hasOlder`. */\n canLoadOlder?: boolean;\n /** A page of older history is in flight. */\n loading: boolean;\n onLoadOlder: () => void;\n className?: string;\n /** The row element, for the viewport observer. */\n rowRef?: (element: HTMLElement | null) => void;\n}\n\n/**\n * The top edge of the LOADED history: a manual way to load the next page of\n * older messages, and the in-flight state. Renders nothing when the whole\n * transcript is loaded (or the head interest has not resolved).\n */\nexport const HistoryEdgeRow: FC<HistoryEdgeRowProps> = ({\n hasOlder,\n canLoadOlder = hasOlder,\n loading,\n onLoadOlder,\n className,\n rowRef,\n}) => {\n if (!hasOlder) return null;\n return (\n <div\n ref={rowRef}\n data-testid=\"thread-history-edge\"\n className={cn(\n \"flex w-full max-w-(--thread-max-width) items-center justify-center py-1 text-xs text-muted-foreground\",\n className,\n )}\n >\n {loading ? (\n <span data-testid=\"thread-history-edge-loading\">Loading earlier messages…</span>\n ) : canLoadOlder ? (\n <button\n type=\"button\"\n data-testid=\"thread-history-edge-load\"\n onClick={onLoadOlder}\n className=\"rounded-lg px-2.5 py-1 text-xs font-medium text-muted-foreground transition-colors hover:bg-accent hover:text-foreground\"\n >\n Load earlier messages\n </button>\n ) : (\n <span data-testid=\"thread-history-edge-limit\">Earlier messages can't be loaded here</span>\n )}\n </div>\n );\n};\n\nexport interface StatewireHistoryEdgeProps {\n /**\n * The thread's tool-output store (the one its converter substitutes from).\n * Defaults to `AthenaProvider`'s; hosts mounting the runtime themselves pass\n * the store they gave `useDeepAgentRuntime({ toolOutputs })`.\n */\n toolOutputs?: DeepAgentToolOutputStore;\n className?: string;\n /** A page interest resolved (telemetry). */\n onHistoryLoad?: (event: DeepAgentHistoryLoadEvent) => void;\n}\n\n/**\n * The client half of the interest window for a DOM thread — mounted once per\n * thread, inside the scroll viewport above the messages (`ChatThreadShell`'s\n * `beforeMessages` slot):\n *\n * - renders the \"Load earlier messages\" edge row and loads the next page when\n * the row comes near the viewport (scrolling up) or on its button, keeping\n * the reading position when the page lands above the view;\n * - fetches cut tool outputs whole for the rendered cards, so they re-render\n * complete through the converter (`toolOutputs`).\n *\n * Inert until the head interest resolves: no row, no reads.\n */\nexport const StatewireHistoryEdge: FC<StatewireHistoryEdgeProps> = ({\n toolOutputs: toolOutputsProp,\n className,\n onHistoryLoad,\n}) => {\n const providerToolOutputs = useStatewireToolOutputs();\n const toolOutputs = toolOutputsProp ?? providerToolOutputs ?? undefined;\n const messages = useAuiState((s) => s.thread.messages);\n const [nearTop, setNearTop] = useState(false);\n const [nearTopEpoch, setNearTopEpoch] = useState(0);\n const nearTopRef = useRef(false);\n const [rowEl, setRowEl] = useState<HTMLElement | null>(null);\n const { hasOlder, canLoadOlder, loading, loadOlder } = useDeepAgentWindowSync({\n messages,\n toolOutputs,\n nearTop,\n nearTopEpoch,\n onHistoryLoad,\n onError: (error, command) => {\n // Leaving the thread settles an in-flight read as lost: lifecycle, not a failure.\n if (error instanceof Error && isStatewireChannelTeardown(error)) return;\n console.warn(`[StatewireHistoryEdge] ${command} failed:`, error);\n },\n });\n\n // The row's own visibility is the near-top level: a level, not an edge, so\n // pages chain while the user stays at the top and stop once the prepended\n // content has pushed the row away again.\n useEffect(() => {\n if (!rowEl || !hasOlder || typeof IntersectionObserver === \"undefined\") return;\n const observer = new IntersectionObserver(\n (entries) => {\n for (const entry of entries) {\n const near = entry.isIntersecting;\n if (nearTopRef.current === near) continue;\n nearTopRef.current = near;\n setNearTop(near);\n if (near) setNearTopEpoch((epoch) => epoch + 1);\n }\n },\n {\n root: rowEl.closest<HTMLElement>(`[${THREAD_VIEWPORT_ATTR}]`),\n rootMargin: `${HISTORY_EDGE_NEAR_MARGIN_PX}px 0px`,\n },\n );\n observer.observe(rowEl);\n return () => {\n observer.disconnect();\n nearTopRef.current = false;\n setNearTop(false);\n };\n }, [rowEl, hasOlder]);\n\n // A prepend (older history landing) keeps the reading position: the\n // viewport scrolls by the height the page added above the view, so the\n // message the user was on stays put. The pre-prepend height is measured\n // only while a page is in flight (a layout read per render would force a\n // reflow on every streamed token otherwise).\n const shapeRef = useRef<{ firstId: string | undefined; length: number; scrollHeight: number } | null>(\n null,\n );\n const firstId = messages[0]?.id;\n const length = messages.length;\n useLayoutEffect(() => {\n const viewport = rowEl?.closest<HTMLElement>(`[${THREAD_VIEWPORT_ATTR}]`) ?? null;\n const prev = shapeRef.current;\n const prepended =\n viewport !== null &&\n prev !== null &&\n prev.firstId !== undefined &&\n firstId !== prev.firstId &&\n length > prev.length;\n if (prepended) viewport.scrollTop += viewport.scrollHeight - prev.scrollHeight;\n shapeRef.current =\n loading || prepended || prev === null\n ? { firstId, length, scrollHeight: viewport?.scrollHeight ?? 0 }\n : { firstId, length, scrollHeight: prev.scrollHeight };\n });\n\n return (\n <HistoryEdgeRow\n rowRef={setRowEl}\n hasOlder={hasOlder}\n canLoadOlder={canLoadOlder}\n loading={loading}\n onLoadOlder={loadOlder}\n className={className}\n />\n );\n};\n"],"names":["jsx","cn","useStatewireToolOutputs","useAuiState","useState","useRef","useDeepAgentWindowSync","isStatewireChannelTeardown","useEffect","useLayoutEffect"],"mappings":"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"}
|
|
@@ -9,8 +9,10 @@ export declare const THREAD_VIEWPORT_ATTR = "data-aui-thread-viewport";
|
|
|
9
9
|
*/
|
|
10
10
|
export declare const HISTORY_EDGE_NEAR_MARGIN_PX = 1500;
|
|
11
11
|
export interface HistoryEdgeRowProps {
|
|
12
|
-
/**
|
|
13
|
-
|
|
12
|
+
/** Whether the server holds messages older than the loaded window. */
|
|
13
|
+
hasOlder: boolean;
|
|
14
|
+
/** Whether the next page can be asked for; `false` with `hasOlder` is the connection's loading depth spent. Defaults to `hasOlder`. */
|
|
15
|
+
canLoadOlder?: boolean;
|
|
14
16
|
/** A page of older history is in flight. */
|
|
15
17
|
loading: boolean;
|
|
16
18
|
onLoadOlder: () => void;
|
|
@@ -19,10 +21,9 @@ export interface HistoryEdgeRowProps {
|
|
|
19
21
|
rowRef?: (element: HTMLElement | null) => void;
|
|
20
22
|
}
|
|
21
23
|
/**
|
|
22
|
-
* The top edge of the LOADED history
|
|
23
|
-
* messages the
|
|
24
|
-
*
|
|
25
|
-
* (or the wire is not windowed).
|
|
24
|
+
* The top edge of the LOADED history: a manual way to load the next page of
|
|
25
|
+
* older messages, and the in-flight state. Renders nothing when the whole
|
|
26
|
+
* transcript is loaded (or the head interest has not resolved).
|
|
26
27
|
*/
|
|
27
28
|
export declare const HistoryEdgeRow: FC<HistoryEdgeRowProps>;
|
|
28
29
|
export interface StatewireHistoryEdgeProps {
|
|
@@ -33,20 +34,20 @@ export interface StatewireHistoryEdgeProps {
|
|
|
33
34
|
*/
|
|
34
35
|
toolOutputs?: DeepAgentToolOutputStore;
|
|
35
36
|
className?: string;
|
|
36
|
-
/** A
|
|
37
|
+
/** A page interest resolved (telemetry). */
|
|
37
38
|
onHistoryLoad?: (event: DeepAgentHistoryLoadEvent) => void;
|
|
38
39
|
}
|
|
39
40
|
/**
|
|
40
|
-
* The client half of the
|
|
41
|
+
* The client half of the interest window for a DOM thread — mounted once per
|
|
41
42
|
* thread, inside the scroll viewport above the messages (`ChatThreadShell`'s
|
|
42
43
|
* `beforeMessages` slot):
|
|
43
44
|
*
|
|
44
|
-
* - renders the "
|
|
45
|
+
* - renders the "Load earlier messages" edge row and loads the next page when
|
|
45
46
|
* the row comes near the viewport (scrolling up) or on its button, keeping
|
|
46
47
|
* the reading position when the page lands above the view;
|
|
47
48
|
* - fetches cut tool outputs whole for the rendered cards, so they re-render
|
|
48
49
|
* complete through the converter (`toolOutputs`).
|
|
49
50
|
*
|
|
50
|
-
* Inert
|
|
51
|
+
* Inert until the head interest resolves: no row, no reads.
|
|
51
52
|
*/
|
|
52
53
|
export declare const StatewireHistoryEdge: FC<StatewireHistoryEdgeProps>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useAuiState } from "@assistant-ui/react";
|
|
3
3
|
import "../../packages/agent-runtime/src/generated/runconfig-contract.js";
|
|
4
4
|
import { useState, useRef, useEffect, useLayoutEffect } from "react";
|
|
@@ -6,6 +6,7 @@ import "@assistant-ui/tap";
|
|
|
6
6
|
import "statewire";
|
|
7
7
|
import { isStatewireChannelTeardown } from "../../packages/agent-runtime/src/errors.js";
|
|
8
8
|
import "../../packages/agent-runtime/src/statewire-suspended.js";
|
|
9
|
+
import "../../packages/agent-runtime/src/conversation-list.js";
|
|
9
10
|
import "@tanstack/react-query";
|
|
10
11
|
import "../../packages/agent-runtime/src/statewire-state.js";
|
|
11
12
|
import "../../packages/agent-runtime/src/messages.js";
|
|
@@ -22,13 +23,14 @@ import { cn } from "cnfast";
|
|
|
22
23
|
const THREAD_VIEWPORT_ATTR = "data-aui-thread-viewport";
|
|
23
24
|
const HISTORY_EDGE_NEAR_MARGIN_PX = 1500;
|
|
24
25
|
const HistoryEdgeRow = ({
|
|
25
|
-
|
|
26
|
+
hasOlder,
|
|
27
|
+
canLoadOlder = hasOlder,
|
|
26
28
|
loading,
|
|
27
29
|
onLoadOlder,
|
|
28
30
|
className,
|
|
29
31
|
rowRef
|
|
30
32
|
}) => {
|
|
31
|
-
if (
|
|
33
|
+
if (!hasOlder) return null;
|
|
32
34
|
return /* @__PURE__ */ jsx(
|
|
33
35
|
"div",
|
|
34
36
|
{
|
|
@@ -38,20 +40,16 @@ const HistoryEdgeRow = ({
|
|
|
38
40
|
"flex w-full max-w-(--thread-max-width) items-center justify-center py-1 text-xs text-muted-foreground",
|
|
39
41
|
className
|
|
40
42
|
),
|
|
41
|
-
children: loading ? /* @__PURE__ */ jsx("span", { "data-testid": "thread-history-edge-loading", children: "Loading earlier messages…" }) : /* @__PURE__ */
|
|
43
|
+
children: loading ? /* @__PURE__ */ jsx("span", { "data-testid": "thread-history-edge-loading", children: "Loading earlier messages…" }) : canLoadOlder ? /* @__PURE__ */ jsx(
|
|
42
44
|
"button",
|
|
43
45
|
{
|
|
44
46
|
type: "button",
|
|
45
47
|
"data-testid": "thread-history-edge-load",
|
|
46
48
|
onClick: onLoadOlder,
|
|
47
49
|
className: "rounded-lg px-2.5 py-1 text-xs font-medium text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",
|
|
48
|
-
children:
|
|
49
|
-
olderCount.toLocaleString(),
|
|
50
|
-
" earlier ",
|
|
51
|
-
olderCount === 1 ? "message" : "messages"
|
|
52
|
-
]
|
|
50
|
+
children: "Load earlier messages"
|
|
53
51
|
}
|
|
54
|
-
)
|
|
52
|
+
) : /* @__PURE__ */ jsx("span", { "data-testid": "thread-history-edge-limit", children: "Earlier messages can't be loaded here" })
|
|
55
53
|
}
|
|
56
54
|
);
|
|
57
55
|
};
|
|
@@ -68,7 +66,7 @@ const StatewireHistoryEdge = ({
|
|
|
68
66
|
const [nearTopEpoch, setNearTopEpoch] = useState(0);
|
|
69
67
|
const nearTopRef = useRef(false);
|
|
70
68
|
const [rowEl, setRowEl] = useState(null);
|
|
71
|
-
const {
|
|
69
|
+
const { hasOlder, canLoadOlder, loading, loadOlder } = useDeepAgentWindowSync({
|
|
72
70
|
messages,
|
|
73
71
|
toolOutputs,
|
|
74
72
|
nearTop,
|
|
@@ -80,7 +78,7 @@ const StatewireHistoryEdge = ({
|
|
|
80
78
|
}
|
|
81
79
|
});
|
|
82
80
|
useEffect(() => {
|
|
83
|
-
if (!rowEl ||
|
|
81
|
+
if (!rowEl || !hasOlder || typeof IntersectionObserver === "undefined") return;
|
|
84
82
|
const observer = new IntersectionObserver(
|
|
85
83
|
(entries) => {
|
|
86
84
|
for (const entry of entries) {
|
|
@@ -102,7 +100,7 @@ const StatewireHistoryEdge = ({
|
|
|
102
100
|
nearTopRef.current = false;
|
|
103
101
|
setNearTop(false);
|
|
104
102
|
};
|
|
105
|
-
}, [rowEl,
|
|
103
|
+
}, [rowEl, hasOlder]);
|
|
106
104
|
const shapeRef = useRef(
|
|
107
105
|
null
|
|
108
106
|
);
|
|
@@ -119,7 +117,8 @@ const StatewireHistoryEdge = ({
|
|
|
119
117
|
HistoryEdgeRow,
|
|
120
118
|
{
|
|
121
119
|
rowRef: setRowEl,
|
|
122
|
-
|
|
120
|
+
hasOlder,
|
|
121
|
+
canLoadOlder,
|
|
123
122
|
loading,
|
|
124
123
|
onLoadOlder: loadOlder,
|
|
125
124
|
className
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"statewire-history-edge.js","sources":["../../../src/chat-ui/thread/statewire-history-edge.tsx"],"sourcesContent":["import { useAuiState } from \"@assistant-ui/react\";\nimport {\n type DeepAgentHistoryLoadEvent,\n type DeepAgentToolOutputStore,\n isStatewireChannelTeardown,\n useDeepAgentWindowSync,\n} from \"@athenaintel/agent-runtime\";\nimport type { FC } from \"react\";\nimport { useEffect, useLayoutEffect, useRef, useState } from \"react\";\nimport { cn } from \"../../lib/utils\";\nimport { useStatewireToolOutputs } from \"../../provider/statewire-window-context\";\n\n/** The attribute `ChatThreadShell` stamps on the scroll viewport. */\nexport const THREAD_VIEWPORT_ATTR = \"data-aui-thread-viewport\";\n\n/**\n * How far above the viewport the edge row counts as near: the row sits above\n * the first loaded message, so reaching it means the user has scrolled past\n * everything loaded and the next page should already be on its way.\n */\nexport const HISTORY_EDGE_NEAR_MARGIN_PX = 1500;\n\nexport interface HistoryEdgeRowProps {\n /**
|
|
1
|
+
{"version":3,"file":"statewire-history-edge.js","sources":["../../../src/chat-ui/thread/statewire-history-edge.tsx"],"sourcesContent":["import { useAuiState } from \"@assistant-ui/react\";\nimport {\n type DeepAgentHistoryLoadEvent,\n type DeepAgentToolOutputStore,\n isStatewireChannelTeardown,\n useDeepAgentWindowSync,\n} from \"@athenaintel/agent-runtime\";\nimport type { FC } from \"react\";\nimport { useEffect, useLayoutEffect, useRef, useState } from \"react\";\nimport { cn } from \"../../lib/utils\";\nimport { useStatewireToolOutputs } from \"../../provider/statewire-window-context\";\n\n/** The attribute `ChatThreadShell` stamps on the scroll viewport. */\nexport const THREAD_VIEWPORT_ATTR = \"data-aui-thread-viewport\";\n\n/**\n * How far above the viewport the edge row counts as near: the row sits above\n * the first loaded message, so reaching it means the user has scrolled past\n * everything loaded and the next page should already be on its way.\n */\nexport const HISTORY_EDGE_NEAR_MARGIN_PX = 1500;\n\nexport interface HistoryEdgeRowProps {\n /** Whether the server holds messages older than the loaded window. */\n hasOlder: boolean;\n /** Whether the next page can be asked for; `false` with `hasOlder` is the connection's loading depth spent. Defaults to `hasOlder`. */\n canLoadOlder?: boolean;\n /** A page of older history is in flight. */\n loading: boolean;\n onLoadOlder: () => void;\n className?: string;\n /** The row element, for the viewport observer. */\n rowRef?: (element: HTMLElement | null) => void;\n}\n\n/**\n * The top edge of the LOADED history: a manual way to load the next page of\n * older messages, and the in-flight state. Renders nothing when the whole\n * transcript is loaded (or the head interest has not resolved).\n */\nexport const HistoryEdgeRow: FC<HistoryEdgeRowProps> = ({\n hasOlder,\n canLoadOlder = hasOlder,\n loading,\n onLoadOlder,\n className,\n rowRef,\n}) => {\n if (!hasOlder) return null;\n return (\n <div\n ref={rowRef}\n data-testid=\"thread-history-edge\"\n className={cn(\n \"flex w-full max-w-(--thread-max-width) items-center justify-center py-1 text-xs text-muted-foreground\",\n className,\n )}\n >\n {loading ? (\n <span data-testid=\"thread-history-edge-loading\">Loading earlier messages…</span>\n ) : canLoadOlder ? (\n <button\n type=\"button\"\n data-testid=\"thread-history-edge-load\"\n onClick={onLoadOlder}\n className=\"rounded-lg px-2.5 py-1 text-xs font-medium text-muted-foreground transition-colors hover:bg-accent hover:text-foreground\"\n >\n Load earlier messages\n </button>\n ) : (\n <span data-testid=\"thread-history-edge-limit\">Earlier messages can't be loaded here</span>\n )}\n </div>\n );\n};\n\nexport interface StatewireHistoryEdgeProps {\n /**\n * The thread's tool-output store (the one its converter substitutes from).\n * Defaults to `AthenaProvider`'s; hosts mounting the runtime themselves pass\n * the store they gave `useDeepAgentRuntime({ toolOutputs })`.\n */\n toolOutputs?: DeepAgentToolOutputStore;\n className?: string;\n /** A page interest resolved (telemetry). */\n onHistoryLoad?: (event: DeepAgentHistoryLoadEvent) => void;\n}\n\n/**\n * The client half of the interest window for a DOM thread — mounted once per\n * thread, inside the scroll viewport above the messages (`ChatThreadShell`'s\n * `beforeMessages` slot):\n *\n * - renders the \"Load earlier messages\" edge row and loads the next page when\n * the row comes near the viewport (scrolling up) or on its button, keeping\n * the reading position when the page lands above the view;\n * - fetches cut tool outputs whole for the rendered cards, so they re-render\n * complete through the converter (`toolOutputs`).\n *\n * Inert until the head interest resolves: no row, no reads.\n */\nexport const StatewireHistoryEdge: FC<StatewireHistoryEdgeProps> = ({\n toolOutputs: toolOutputsProp,\n className,\n onHistoryLoad,\n}) => {\n const providerToolOutputs = useStatewireToolOutputs();\n const toolOutputs = toolOutputsProp ?? providerToolOutputs ?? undefined;\n const messages = useAuiState((s) => s.thread.messages);\n const [nearTop, setNearTop] = useState(false);\n const [nearTopEpoch, setNearTopEpoch] = useState(0);\n const nearTopRef = useRef(false);\n const [rowEl, setRowEl] = useState<HTMLElement | null>(null);\n const { hasOlder, canLoadOlder, loading, loadOlder } = useDeepAgentWindowSync({\n messages,\n toolOutputs,\n nearTop,\n nearTopEpoch,\n onHistoryLoad,\n onError: (error, command) => {\n // Leaving the thread settles an in-flight read as lost: lifecycle, not a failure.\n if (error instanceof Error && isStatewireChannelTeardown(error)) return;\n console.warn(`[StatewireHistoryEdge] ${command} failed:`, error);\n },\n });\n\n // The row's own visibility is the near-top level: a level, not an edge, so\n // pages chain while the user stays at the top and stop once the prepended\n // content has pushed the row away again.\n useEffect(() => {\n if (!rowEl || !hasOlder || typeof IntersectionObserver === \"undefined\") return;\n const observer = new IntersectionObserver(\n (entries) => {\n for (const entry of entries) {\n const near = entry.isIntersecting;\n if (nearTopRef.current === near) continue;\n nearTopRef.current = near;\n setNearTop(near);\n if (near) setNearTopEpoch((epoch) => epoch + 1);\n }\n },\n {\n root: rowEl.closest<HTMLElement>(`[${THREAD_VIEWPORT_ATTR}]`),\n rootMargin: `${HISTORY_EDGE_NEAR_MARGIN_PX}px 0px`,\n },\n );\n observer.observe(rowEl);\n return () => {\n observer.disconnect();\n nearTopRef.current = false;\n setNearTop(false);\n };\n }, [rowEl, hasOlder]);\n\n // A prepend (older history landing) keeps the reading position: the\n // viewport scrolls by the height the page added above the view, so the\n // message the user was on stays put. The pre-prepend height is measured\n // only while a page is in flight (a layout read per render would force a\n // reflow on every streamed token otherwise).\n const shapeRef = useRef<{ firstId: string | undefined; length: number; scrollHeight: number } | null>(\n null,\n );\n const firstId = messages[0]?.id;\n const length = messages.length;\n useLayoutEffect(() => {\n const viewport = rowEl?.closest<HTMLElement>(`[${THREAD_VIEWPORT_ATTR}]`) ?? null;\n const prev = shapeRef.current;\n const prepended =\n viewport !== null &&\n prev !== null &&\n prev.firstId !== undefined &&\n firstId !== prev.firstId &&\n length > prev.length;\n if (prepended) viewport.scrollTop += viewport.scrollHeight - prev.scrollHeight;\n shapeRef.current =\n loading || prepended || prev === null\n ? { firstId, length, scrollHeight: viewport?.scrollHeight ?? 0 }\n : { firstId, length, scrollHeight: prev.scrollHeight };\n });\n\n return (\n <HistoryEdgeRow\n rowRef={setRowEl}\n hasOlder={hasOlder}\n canLoadOlder={canLoadOlder}\n loading={loading}\n onLoadOlder={loadOlder}\n className={className}\n />\n );\n};\n"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
+
const react$1 = require("@assistant-ui/react");
|
|
5
|
+
const react = require("react");
|
|
6
|
+
const threadIdContext = require("../../threads/thread-id-context.cjs");
|
|
7
|
+
const THREAD_LOADING_OVERLAY_TIMEOUT_MS = 15e3;
|
|
8
|
+
const ThreadLoadingOverlay = () => {
|
|
9
|
+
const remoteId = threadIdContext.useAthenaThreadId();
|
|
10
|
+
const [timedOut, setTimedOut] = react.useState(false);
|
|
11
|
+
react.useEffect(() => {
|
|
12
|
+
if (!remoteId) return;
|
|
13
|
+
setTimedOut(false);
|
|
14
|
+
const timer = setTimeout(() => setTimedOut(true), THREAD_LOADING_OVERLAY_TIMEOUT_MS);
|
|
15
|
+
return () => clearTimeout(timer);
|
|
16
|
+
}, [remoteId]);
|
|
17
|
+
if (!remoteId || timedOut) return null;
|
|
18
|
+
return /* @__PURE__ */ jsxRuntime.jsx(react$1.AuiIf, { condition: (s) => s.thread.isEmpty, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
19
|
+
"div",
|
|
20
|
+
{
|
|
21
|
+
"data-testid": "thread-loading-overlay",
|
|
22
|
+
role: "status",
|
|
23
|
+
"aria-label": "Loading conversation",
|
|
24
|
+
className: "absolute inset-0 z-10 flex items-center justify-center bg-background/80",
|
|
25
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "size-5 animate-spin rounded-full border-2 border-muted-foreground border-t-transparent" })
|
|
26
|
+
}
|
|
27
|
+
) });
|
|
28
|
+
};
|
|
29
|
+
exports.THREAD_LOADING_OVERLAY_TIMEOUT_MS = THREAD_LOADING_OVERLAY_TIMEOUT_MS;
|
|
30
|
+
exports.ThreadLoadingOverlay = ThreadLoadingOverlay;
|
|
31
|
+
//# sourceMappingURL=thread-loading-overlay.cjs.map
|