@athenaintel/react 0.41.3 → 0.42.2
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 +132 -10
- package/dist/agent-runtime/src/asset-attachment.d.ts +98 -0
- package/dist/agent-runtime/src/athena-asset-drag.d.ts +32 -0
- package/dist/agent-runtime/src/auth-denial.d.ts +29 -0
- package/dist/agent-runtime/src/chat-outbox-attachments.cjs +41 -0
- package/dist/agent-runtime/src/chat-outbox-attachments.cjs.map +1 -0
- package/dist/agent-runtime/src/chat-outbox-attachments.d.ts +38 -0
- package/dist/agent-runtime/src/chat-outbox-attachments.js +41 -0
- package/dist/agent-runtime/src/chat-outbox-attachments.js.map +1 -0
- package/dist/agent-runtime/src/chat-outbox-signals.cjs +63 -0
- package/dist/agent-runtime/src/chat-outbox-signals.cjs.map +1 -0
- package/dist/agent-runtime/src/chat-outbox-signals.d.ts +12 -0
- package/dist/agent-runtime/src/chat-outbox-signals.js +63 -0
- package/dist/agent-runtime/src/chat-outbox-signals.js.map +1 -0
- package/dist/agent-runtime/src/chat-outbox-store.cjs +509 -0
- package/dist/agent-runtime/src/chat-outbox-store.cjs.map +1 -0
- package/dist/agent-runtime/src/chat-outbox-store.d.ts +203 -0
- package/dist/agent-runtime/src/chat-outbox-store.js +509 -0
- package/dist/agent-runtime/src/chat-outbox-store.js.map +1 -0
- package/dist/agent-runtime/src/chat-outbox-thread.cjs +136 -0
- package/dist/agent-runtime/src/chat-outbox-thread.cjs.map +1 -0
- package/dist/agent-runtime/src/chat-outbox-thread.d.ts +118 -0
- package/dist/agent-runtime/src/chat-outbox-thread.js +136 -0
- package/dist/agent-runtime/src/chat-outbox-thread.js.map +1 -0
- package/dist/agent-runtime/src/chat-outbox.cjs +696 -0
- package/dist/agent-runtime/src/chat-outbox.cjs.map +1 -0
- package/dist/agent-runtime/src/chat-outbox.d.ts +285 -0
- package/dist/agent-runtime/src/chat-outbox.js +696 -0
- package/dist/agent-runtime/src/chat-outbox.js.map +1 -0
- package/dist/agent-runtime/src/chat-socket-reachability.d.ts +45 -0
- package/dist/agent-runtime/src/client-tool-bridge.d.ts +152 -0
- package/dist/agent-runtime/src/client-tools.d.ts +133 -0
- package/dist/agent-runtime/src/composer-markdown.cjs +10 -0
- package/dist/agent-runtime/src/composer-markdown.cjs.map +1 -1
- package/dist/agent-runtime/src/composer-markdown.d.ts +108 -0
- package/dist/agent-runtime/src/composer-markdown.js +10 -0
- package/dist/agent-runtime/src/composer-markdown.js.map +1 -1
- package/dist/agent-runtime/src/config-mutations.d.ts +51 -0
- package/dist/agent-runtime/src/conversation-index.d.ts +110 -0
- package/dist/agent-runtime/src/conversation-list.d.ts +343 -0
- package/dist/agent-runtime/src/deep-agent-transport-recipe.cjs +3 -2
- package/dist/agent-runtime/src/deep-agent-transport-recipe.cjs.map +1 -1
- package/dist/agent-runtime/src/deep-agent-transport-recipe.d.ts +166 -0
- package/dist/agent-runtime/src/deep-agent-transport-recipe.js +3 -2
- package/dist/agent-runtime/src/deep-agent-transport-recipe.js.map +1 -1
- package/dist/agent-runtime/src/desktop-handoff.d.ts +139 -0
- package/dist/agent-runtime/src/durable-thread-snapshot-cache.d.ts +60 -0
- package/dist/agent-runtime/src/edit-command.d.ts +156 -0
- package/dist/agent-runtime/src/errors.d.ts +174 -0
- package/dist/agent-runtime/src/execute-output.d.ts +31 -0
- package/dist/agent-runtime/src/generated/runconfig-contract.cjs +16 -2
- package/dist/agent-runtime/src/generated/runconfig-contract.cjs.map +1 -1
- package/dist/agent-runtime/src/generated/runconfig-contract.d.ts +202 -0
- package/dist/agent-runtime/src/generated/runconfig-contract.js +16 -2
- package/dist/agent-runtime/src/generated/runconfig-contract.js.map +1 -1
- package/dist/agent-runtime/src/github-wake-event.d.ts +77 -0
- package/dist/agent-runtime/src/index.d.ts +74 -0
- package/dist/agent-runtime/src/interrupts.cjs +17 -0
- package/dist/agent-runtime/src/interrupts.cjs.map +1 -1
- package/dist/agent-runtime/src/interrupts.d.ts +348 -0
- package/dist/agent-runtime/src/interrupts.js +17 -0
- package/dist/agent-runtime/src/interrupts.js.map +1 -1
- package/dist/agent-runtime/src/lane-follow.d.ts +121 -0
- package/dist/agent-runtime/src/lane-history.cjs +209 -0
- package/dist/agent-runtime/src/lane-history.cjs.map +1 -0
- package/dist/agent-runtime/src/lane-history.d.ts +175 -0
- package/dist/agent-runtime/src/lane-history.js +209 -0
- package/dist/agent-runtime/src/lane-history.js.map +1 -0
- package/dist/agent-runtime/src/lane-images.d.ts +184 -0
- package/dist/agent-runtime/src/message-author.d.ts +43 -0
- package/dist/agent-runtime/src/message-text.cjs +15 -0
- package/dist/agent-runtime/src/message-text.cjs.map +1 -0
- package/dist/agent-runtime/src/message-text.d.ts +47 -0
- package/dist/agent-runtime/src/message-text.js +15 -0
- package/dist/agent-runtime/src/message-text.js.map +1 -0
- package/dist/agent-runtime/src/message-window.cjs +15 -1
- package/dist/agent-runtime/src/message-window.cjs.map +1 -1
- package/dist/agent-runtime/src/message-window.d.ts +159 -0
- package/dist/agent-runtime/src/message-window.js +16 -2
- package/dist/agent-runtime/src/message-window.js.map +1 -1
- package/dist/agent-runtime/src/messages.cjs +123 -8
- package/dist/agent-runtime/src/messages.cjs.map +1 -1
- package/dist/agent-runtime/src/messages.d.ts +621 -0
- package/dist/agent-runtime/src/messages.js +123 -8
- package/dist/agent-runtime/src/messages.js.map +1 -1
- package/dist/agent-runtime/src/model-context.d.ts +22 -0
- package/dist/agent-runtime/src/offline-status.d.ts +157 -0
- package/dist/agent-runtime/src/optimistic-content.d.ts +21 -0
- package/dist/agent-runtime/src/protocol.cjs +12 -4
- package/dist/agent-runtime/src/protocol.cjs.map +1 -1
- package/dist/agent-runtime/src/protocol.d.ts +119 -0
- package/dist/agent-runtime/src/protocol.js +13 -5
- package/dist/agent-runtime/src/protocol.js.map +1 -1
- package/dist/agent-runtime/src/ptc-subcalls.d.ts +51 -0
- package/dist/agent-runtime/src/queue.d.ts +138 -0
- package/dist/agent-runtime/src/quota-safe-local-storage-session.cjs +10 -0
- package/dist/agent-runtime/src/quota-safe-local-storage-session.cjs.map +1 -1
- package/dist/agent-runtime/src/quota-safe-local-storage-session.d.ts +161 -0
- package/dist/agent-runtime/src/quota-safe-local-storage-session.js +10 -0
- package/dist/agent-runtime/src/quota-safe-local-storage-session.js.map +1 -1
- package/dist/agent-runtime/src/running-tool-placeholder.cjs +11 -0
- package/dist/agent-runtime/src/running-tool-placeholder.cjs.map +1 -0
- package/dist/agent-runtime/src/running-tool-placeholder.d.ts +25 -0
- package/dist/agent-runtime/src/running-tool-placeholder.js +11 -0
- package/dist/agent-runtime/src/running-tool-placeholder.js.map +1 -0
- package/dist/agent-runtime/src/runtime-messages.d.ts +104 -0
- package/dist/agent-runtime/src/screen-point.d.ts +151 -0
- package/dist/agent-runtime/src/sealed-idb.cjs +112 -0
- package/dist/agent-runtime/src/sealed-idb.cjs.map +1 -0
- package/dist/agent-runtime/src/sealed-idb.d.ts +106 -0
- package/dist/agent-runtime/src/sealed-idb.js +112 -0
- package/dist/agent-runtime/src/sealed-idb.js.map +1 -0
- package/dist/agent-runtime/src/send-recovery.d.ts +40 -0
- package/dist/agent-runtime/src/session-lane-scope.cjs +25 -0
- package/dist/agent-runtime/src/session-lane-scope.cjs.map +1 -0
- package/dist/agent-runtime/src/session-lane-scope.d.ts +59 -0
- package/dist/agent-runtime/src/session-lane-scope.js +25 -0
- package/dist/agent-runtime/src/session-lane-scope.js.map +1 -0
- package/dist/agent-runtime/src/statewire-attach-observer.d.ts +194 -0
- package/dist/agent-runtime/src/statewire-diagnostics.d.ts +74 -0
- package/dist/agent-runtime/src/statewire-state.d.ts +29 -0
- package/dist/agent-runtime/src/statewire-suspended.cjs.map +1 -1
- package/dist/agent-runtime/src/statewire-suspended.d.ts +27 -0
- package/dist/agent-runtime/src/statewire-suspended.js.map +1 -1
- package/dist/agent-runtime/src/statewire-transport.d.ts +40 -0
- package/dist/agent-runtime/src/streaming-markdown.d.ts +46 -0
- package/dist/agent-runtime/src/subagent-transcripts.cjs +209 -0
- package/dist/agent-runtime/src/subagent-transcripts.cjs.map +1 -0
- package/dist/agent-runtime/src/subagent-transcripts.d.ts +71 -0
- package/dist/agent-runtime/src/subagent-transcripts.js +209 -0
- package/dist/agent-runtime/src/subagent-transcripts.js.map +1 -0
- package/dist/agent-runtime/src/subagents.cjs +253 -0
- package/dist/agent-runtime/src/subagents.cjs.map +1 -0
- package/dist/agent-runtime/src/subagents.d.ts +311 -0
- package/dist/agent-runtime/src/subagents.js +253 -0
- package/dist/agent-runtime/src/subagents.js.map +1 -0
- package/dist/agent-runtime/src/subscription-wake-event.d.ts +111 -0
- package/dist/agent-runtime/src/thread-extras.d.ts +43 -0
- package/dist/agent-runtime/src/thread-handoff.d.ts +364 -0
- package/dist/agent-runtime/src/thread-prewarm-controller.d.ts +76 -0
- package/dist/agent-runtime/src/thread-prewarm.d.ts +118 -0
- package/dist/agent-runtime/src/thread-snapshot-cache.d.ts +99 -0
- package/dist/agent-runtime/src/thread-snapshot-mirror.cjs +46 -117
- package/dist/agent-runtime/src/thread-snapshot-mirror.cjs.map +1 -1
- package/dist/agent-runtime/src/thread-snapshot-mirror.d.ts +101 -0
- package/dist/agent-runtime/src/thread-snapshot-mirror.js +17 -88
- package/dist/agent-runtime/src/thread-snapshot-mirror.js.map +1 -1
- package/dist/agent-runtime/src/thread-status.d.ts +53 -0
- package/dist/agent-runtime/src/tool-metadata.d.ts +146 -0
- package/dist/agent-runtime/src/tool-names.cjs +71 -0
- package/dist/agent-runtime/src/tool-names.cjs.map +1 -1
- package/dist/agent-runtime/src/tool-names.d.ts +67 -0
- package/dist/agent-runtime/src/tool-names.js +72 -1
- package/dist/agent-runtime/src/tool-names.js.map +1 -1
- package/dist/agent-runtime/src/tool-outputs.d.ts +35 -0
- package/dist/agent-runtime/src/tool-result.cjs +1 -0
- package/dist/agent-runtime/src/tool-result.cjs.map +1 -1
- package/dist/agent-runtime/src/tool-result.d.ts +126 -0
- package/dist/agent-runtime/src/tool-result.js +1 -0
- package/dist/agent-runtime/src/tool-result.js.map +1 -1
- package/dist/agent-runtime/src/types.d.ts +159 -0
- package/dist/agent-runtime/src/use-conversation-list.d.ts +76 -0
- package/dist/agent-runtime/src/use-deep-agent-chat-outbox.cjs +136 -0
- package/dist/agent-runtime/src/use-deep-agent-chat-outbox.cjs.map +1 -0
- package/dist/agent-runtime/src/use-deep-agent-chat-outbox.d.ts +64 -0
- package/dist/agent-runtime/src/use-deep-agent-chat-outbox.js +136 -0
- package/dist/agent-runtime/src/use-deep-agent-chat-outbox.js.map +1 -0
- package/dist/agent-runtime/src/use-deep-agent-config.d.ts +169 -0
- package/dist/agent-runtime/src/use-deep-agent-edit-submit.cjs +13 -0
- package/dist/agent-runtime/src/use-deep-agent-edit-submit.cjs.map +1 -1
- package/dist/agent-runtime/src/use-deep-agent-edit-submit.d.ts +22 -0
- package/dist/agent-runtime/src/use-deep-agent-edit-submit.js +13 -0
- package/dist/agent-runtime/src/use-deep-agent-edit-submit.js.map +1 -1
- package/dist/agent-runtime/src/use-deep-agent-runtime.cjs +37 -2
- package/dist/agent-runtime/src/use-deep-agent-runtime.cjs.map +1 -1
- package/dist/agent-runtime/src/use-deep-agent-runtime.d.ts +177 -0
- package/dist/agent-runtime/src/use-deep-agent-runtime.js +38 -3
- package/dist/agent-runtime/src/use-deep-agent-runtime.js.map +1 -1
- package/dist/agent-runtime/src/use-deep-agent-thread.cjs +39 -13
- package/dist/agent-runtime/src/use-deep-agent-thread.cjs.map +1 -1
- package/dist/agent-runtime/src/use-deep-agent-thread.d.ts +352 -0
- package/dist/agent-runtime/src/use-deep-agent-thread.js +39 -13
- package/dist/agent-runtime/src/use-deep-agent-thread.js.map +1 -1
- package/dist/agent-runtime/src/use-deep-agent-voice.cjs +1019 -0
- package/dist/agent-runtime/src/use-deep-agent-voice.cjs.map +1 -0
- package/dist/agent-runtime/src/use-deep-agent-voice.d.ts +409 -0
- package/dist/agent-runtime/src/use-deep-agent-voice.js +1019 -0
- package/dist/agent-runtime/src/use-deep-agent-voice.js.map +1 -0
- package/dist/agent-runtime/src/use-deep-agent-window-sync.d.ts +102 -0
- package/dist/agent-runtime/src/use-historical-edit-attachments.d.ts +2 -0
- package/dist/agent-runtime/src/use-thread-handoff-flow.d.ts +84 -0
- package/dist/agent-runtime/src/voice-presentation.cjs +2 -0
- package/dist/agent-runtime/src/voice-presentation.cjs.map +1 -1
- package/dist/agent-runtime/src/voice-presentation.d.ts +80 -0
- package/dist/agent-runtime/src/voice-presentation.js +2 -0
- package/dist/agent-runtime/src/voice-presentation.js.map +1 -1
- package/dist/agent-runtime/src/voice-turn-grouping.d.ts +28 -0
- package/dist/agent-runtime/src/voice-wire-types.d.ts +15 -0
- package/dist/agent-runtime/src/withdrawn-turns.d.ts +97 -0
- package/dist/catalog/runtime-catalog.js +1 -1
- package/dist/chat/AthenaChat.cjs +192 -103
- package/dist/chat/AthenaChat.cjs.map +1 -1
- package/dist/chat/AthenaChat.d.ts +9 -0
- package/dist/chat/AthenaChat.js +194 -105
- package/dist/chat/AthenaChat.js.map +1 -1
- package/dist/chat/StatewireApprovalCard.d.ts +1 -1
- package/dist/chat/StatewireClientToolBridge.d.ts +1 -1
- package/dist/chat/StatewireQueuedMessages.cjs +11 -4
- package/dist/chat/StatewireQueuedMessages.cjs.map +1 -1
- package/dist/chat/StatewireQueuedMessages.d.ts +1 -1
- package/dist/chat/StatewireQueuedMessages.js +11 -4
- package/dist/chat/StatewireQueuedMessages.js.map +1 -1
- package/dist/chat/chat-outbox-rows.cjs +223 -0
- package/dist/chat/chat-outbox-rows.cjs.map +1 -0
- package/dist/chat/chat-outbox-rows.d.ts +29 -0
- package/dist/chat/chat-outbox-rows.js +223 -0
- package/dist/chat/chat-outbox-rows.js.map +1 -0
- package/dist/chat/chat-voice-controls.cjs +128 -0
- package/dist/chat/chat-voice-controls.cjs.map +1 -0
- package/dist/chat/chat-voice-controls.d.ts +19 -0
- package/dist/chat/chat-voice-controls.js +128 -0
- package/dist/chat/chat-voice-controls.js.map +1 -0
- package/dist/chat/statewire-approval.d.ts +1 -1
- package/dist/chat/statewire-client-tools.d.ts +1 -1
- package/dist/chat/super-grouping/SuperGroupingCard.cjs +3 -1
- package/dist/chat/super-grouping/SuperGroupingCard.cjs.map +1 -1
- package/dist/chat/super-grouping/SuperGroupingCard.d.ts +7 -1
- package/dist/chat/super-grouping/SuperGroupingCard.js +3 -1
- package/dist/chat/super-grouping/SuperGroupingCard.js.map +1 -1
- package/dist/chat/super-grouping/SuperGroupingTranscript.cjs +7 -2
- package/dist/chat/super-grouping/SuperGroupingTranscript.cjs.map +1 -1
- package/dist/chat/super-grouping/SuperGroupingTranscript.d.ts +2 -2
- package/dist/chat/super-grouping/SuperGroupingTranscript.js +7 -2
- package/dist/chat/super-grouping/SuperGroupingTranscript.js.map +1 -1
- package/dist/chat/super-grouping/activity-timeline.cjs +15 -8
- package/dist/chat/super-grouping/activity-timeline.cjs.map +1 -1
- package/dist/chat/super-grouping/activity-timeline.d.ts +18 -8
- package/dist/chat/super-grouping/activity-timeline.js +15 -8
- package/dist/chat/super-grouping/activity-timeline.js.map +1 -1
- package/dist/chat/use-statewire-approval-request.cjs +36 -0
- package/dist/chat/use-statewire-approval-request.cjs.map +1 -1
- package/dist/chat/use-statewire-approval-request.d.ts +49 -1
- package/dist/chat/use-statewire-approval-request.js +39 -3
- package/dist/chat/use-statewire-approval-request.js.map +1 -1
- package/dist/chat-ui/composer/tiptap-composer.cjs +133 -14
- package/dist/chat-ui/composer/tiptap-composer.cjs.map +1 -1
- package/dist/chat-ui/composer/tiptap-composer.d.ts +33 -1
- package/dist/chat-ui/composer/tiptap-composer.js +135 -16
- package/dist/chat-ui/composer/tiptap-composer.js.map +1 -1
- package/dist/chat-ui/header/conversation-history-panel.d.ts +1 -1
- package/dist/chat-ui/index.d.ts +1 -1
- package/dist/chat-ui/mentions/suggestions/data/api-client.cjs +2 -1
- package/dist/chat-ui/mentions/suggestions/data/api-client.cjs.map +1 -1
- package/dist/chat-ui/mentions/suggestions/data/api-client.d.ts +3 -1
- package/dist/chat-ui/mentions/suggestions/data/api-client.js +2 -1
- package/dist/chat-ui/mentions/suggestions/data/api-client.js.map +1 -1
- package/dist/chat-ui/mentions/use-account-workspace-id.cjs +29 -51
- package/dist/chat-ui/mentions/use-account-workspace-id.cjs.map +1 -1
- package/dist/chat-ui/mentions/use-account-workspace-id.d.ts +2 -2
- package/dist/chat-ui/mentions/use-account-workspace-id.js +30 -52
- package/dist/chat-ui/mentions/use-account-workspace-id.js.map +1 -1
- package/dist/chat-ui/messages/message-components.cjs +15 -0
- package/dist/chat-ui/messages/message-components.cjs.map +1 -1
- package/dist/chat-ui/messages/message-components.js +15 -0
- package/dist/chat-ui/messages/message-components.js.map +1 -1
- package/dist/chat-ui/messages/runtime-message.d.ts +1 -1
- package/dist/chat-ui/messages/statewire-continue-run.d.ts +1 -1
- package/dist/chat-ui/messages/user-edit-composer.cjs +15 -2
- package/dist/chat-ui/messages/user-edit-composer.cjs.map +1 -1
- package/dist/chat-ui/messages/user-edit-composer.d.ts +4 -2
- package/dist/chat-ui/messages/user-edit-composer.js +15 -2
- package/dist/chat-ui/messages/user-edit-composer.js.map +1 -1
- package/dist/chat-ui/messages/wake-marker.d.ts +1 -1
- package/dist/chat-ui/rich-text/chat-text-schema.cjs +1 -0
- package/dist/chat-ui/rich-text/chat-text-schema.cjs.map +1 -1
- package/dist/chat-ui/rich-text/chat-text-schema.d.ts +3 -0
- package/dist/chat-ui/rich-text/chat-text-schema.js +1 -0
- package/dist/chat-ui/rich-text/chat-text-schema.js.map +1 -1
- package/dist/chat-ui/statewire.cjs +1 -0
- package/dist/chat-ui/statewire.cjs.map +1 -1
- package/dist/chat-ui/statewire.d.ts +2 -2
- package/dist/chat-ui/statewire.js +2 -1
- package/dist/chat-ui/thread/composer-send-or-stop.cjs +2 -1
- package/dist/chat-ui/thread/composer-send-or-stop.cjs.map +1 -1
- package/dist/chat-ui/thread/composer-send-or-stop.d.ts +2 -0
- package/dist/chat-ui/thread/composer-send-or-stop.js +2 -1
- package/dist/chat-ui/thread/composer-send-or-stop.js.map +1 -1
- package/dist/chat-ui/thread/statewire-history-edge.d.ts +1 -1
- package/dist/composer/AttachmentContext.cjs +8 -4
- package/dist/composer/AttachmentContext.cjs.map +1 -1
- package/dist/composer/AttachmentContext.d.ts +7 -0
- package/dist/composer/AttachmentContext.js +8 -4
- package/dist/composer/AttachmentContext.js.map +1 -1
- package/dist/composer/build-composed-message.cjs +34 -0
- package/dist/composer/build-composed-message.cjs.map +1 -1
- package/dist/composer/build-composed-message.d.ts +20 -0
- package/dist/composer/build-composed-message.js +35 -1
- package/dist/composer/build-composed-message.js.map +1 -1
- package/dist/composer/composer-handoff.cjs +39 -2
- package/dist/composer/composer-handoff.cjs.map +1 -1
- package/dist/composer/composer-handoff.d.ts +28 -3
- package/dist/composer/composer-handoff.js +39 -2
- package/dist/composer/composer-handoff.js.map +1 -1
- package/dist/composer/useAttachFiles.cjs +15 -2
- package/dist/composer/useAttachFiles.cjs.map +1 -1
- package/dist/composer/useAttachFiles.d.ts +11 -0
- package/dist/composer/useAttachFiles.js +15 -2
- package/dist/composer/useAttachFiles.js.map +1 -1
- package/dist/composer/useSendMessage.cjs.map +1 -1
- package/dist/composer/useSendMessage.d.ts +4 -3
- package/dist/composer/useSendMessage.js.map +1 -1
- package/dist/diagnostics/athena-diagnostics.cjs.map +1 -1
- package/dist/diagnostics/athena-diagnostics.d.ts +3 -1
- package/dist/diagnostics/athena-diagnostics.js.map +1 -1
- package/dist/index.cjs +13 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +14 -7
- package/dist/index.js +14 -1
- package/dist/index.js.map +1 -1
- package/dist/offline/chat-outbox.cjs +57 -0
- package/dist/offline/chat-outbox.cjs.map +1 -0
- package/dist/offline/chat-outbox.d.ts +80 -0
- package/dist/offline/chat-outbox.js +57 -0
- package/dist/offline/chat-outbox.js.map +1 -0
- package/dist/offline/offline-history.d.ts +1 -1
- package/dist/provider/AthenaProvider.cjs +162 -8
- package/dist/provider/AthenaProvider.cjs.map +1 -1
- package/dist/provider/AthenaProvider.d.ts +15 -1
- package/dist/provider/AthenaProvider.js +163 -9
- package/dist/provider/AthenaProvider.js.map +1 -1
- package/dist/provider/statewire-window-context.d.ts +1 -1
- package/dist/react/package.json.cjs +1 -1
- package/dist/react/package.json.js +1 -1
- package/dist/references/src/anchors/file-line-range.d.ts +58 -0
- package/dist/references/src/anchors/format.d.ts +21 -0
- package/dist/references/src/anchors/message-anchors.d.ts +71 -0
- package/dist/references/src/anchors/parse.d.ts +8 -0
- package/dist/references/src/anchors/registry-contract.d.ts +24 -0
- package/dist/references/src/anchors/registry.d.ts +19 -0
- package/dist/references/src/anchors/schemas.d.ts +194 -0
- package/dist/references/src/anchors/serialize.d.ts +8 -0
- package/dist/references/src/anchors/time.d.ts +78 -0
- package/dist/references/src/anchors/types.d.ts +474 -0
- package/dist/references/src/asset-bounds.d.ts +27 -0
- package/dist/references/src/asset-links.d.ts +23 -0
- package/dist/references/src/asset-reference.d.ts +16 -0
- package/dist/references/src/formats/format-catalog.d.ts +79 -0
- package/dist/references/src/formats/markdown/parse-reference-markdown.d.ts +28 -0
- package/dist/references/src/formats/markdown/reference-display-name.d.ts +6 -0
- package/dist/references/src/formats/object/asset-object.d.ts +9 -0
- package/dist/references/src/formats/object/callable-object.d.ts +6 -0
- package/dist/references/src/formats/object/decode-reference-object-payload.d.ts +3 -0
- package/dist/references/src/formats/object/external-url-object.d.ts +9 -0
- package/dist/references/src/formats/object/group-object.d.ts +9 -0
- package/dist/references/src/formats/object/navigation-object.d.ts +9 -0
- package/dist/references/src/formats/object/parse-reference-object.d.ts +11 -0
- package/dist/references/src/formats/object/person-object.d.ts +9 -0
- package/dist/references/src/formats/uri/asset-mention-uri.d.ts +9 -0
- package/dist/references/src/formats/uri/asset-spaces-url.d.ts +9 -0
- package/dist/references/src/formats/uri/callable-mention-uris.d.ts +9 -0
- package/dist/references/src/formats/uri/detect-uri-wire.d.ts +9 -0
- package/dist/references/src/formats/uri/group-mention-uri.d.ts +12 -0
- package/dist/references/src/formats/uri/navigation-spaces-url.d.ts +14 -0
- package/dist/references/src/formats/uri/parse-reference-uri.d.ts +20 -0
- package/dist/references/src/formats/uri/person-mention-uri.d.ts +9 -0
- package/dist/references/src/formats/uri/template-placeholder.d.ts +12 -0
- package/dist/references/src/index.d.ts +47 -0
- package/dist/references/src/legacy/index.d.ts +14 -0
- package/dist/references/src/legacy/pre-reference-asset-url.d.ts +57 -0
- package/dist/references/src/legacy/pre-reference-citation-bridge.d.ts +22 -0
- package/dist/references/src/legacy/pre-reference-citation.d.ts +138 -0
- package/dist/references/src/legacy/pre-reference-external-url.d.ts +31 -0
- package/dist/references/src/legacy/pre-reference-format.d.ts +8 -0
- package/dist/references/src/legacy/pre-reference-mention.d.ts +27 -0
- package/dist/references/src/legacy/pre-reference-object.d.ts +8 -0
- package/dist/references/src/legacy/pre-reference-uri.d.ts +12 -0
- package/dist/references/src/legacy.d.ts +2 -0
- package/dist/references/src/mention-href-patterns.d.ts +19 -0
- package/dist/references/src/mention-node/index.d.ts +5 -0
- package/dist/references/src/mention-node/mention-node.d.ts +31 -0
- package/dist/references/src/mention-node/resolve-node-attrs.d.ts +27 -0
- package/dist/references/src/parse-reference.d.ts +23 -0
- package/dist/references/src/schemas.d.ts +463 -0
- package/dist/references/src/serialize-reference.d.ts +50 -0
- package/dist/references/src/sheet-name.d.ts +10 -0
- package/dist/references/src/tool-option-schemas.d.ts +597 -0
- package/dist/references/src/types.d.ts +125 -0
- package/dist/references/src/version-ref.d.ts +30 -0
- package/dist/runtime/statewire-lifecycle.d.ts +1 -1
- package/dist/runtime/statewire-model-lane.d.ts +1 -1
- package/dist/runtime/statewire-server-lane-context.d.ts +1 -1
- package/dist/runtime/statewire-session-key.cjs +7 -0
- package/dist/runtime/statewire-session-key.cjs.map +1 -1
- package/dist/runtime/statewire-session-key.d.ts +19 -0
- package/dist/runtime/statewire-session-key.js +8 -1
- package/dist/runtime/statewire-session-key.js.map +1 -1
- package/dist/runtime/statewire-session-lane.cjs +48 -0
- package/dist/runtime/statewire-session-lane.cjs.map +1 -0
- package/dist/runtime/statewire-session-lane.d.ts +29 -0
- package/dist/runtime/statewire-session-lane.js +48 -0
- package/dist/runtime/statewire-session-lane.js.map +1 -0
- package/dist/runtime/statewire-thread-config-lane.d.ts +1 -1
- package/dist/runtime/useAthenaStatewireRuntime.cjs +19 -5
- package/dist/runtime/useAthenaStatewireRuntime.cjs.map +1 -1
- package/dist/runtime/useAthenaStatewireRuntime.d.ts +15 -1
- package/dist/runtime/useAthenaStatewireRuntime.js +20 -6
- package/dist/runtime/useAthenaStatewireRuntime.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/threads/api.d.ts +1 -1
- package/dist/threads/conversation-list-fetcher.d.ts +1 -1
- package/dist/threads/index-triggered-refresh.cjs +164 -0
- package/dist/threads/index-triggered-refresh.cjs.map +1 -0
- package/dist/threads/index-triggered-refresh.d.ts +70 -0
- package/dist/threads/index-triggered-refresh.js +164 -0
- package/dist/threads/index-triggered-refresh.js.map +1 -0
- package/dist/threads/offline-session-list.d.ts +1 -1
- package/dist/threads/pull-request-display.d.ts +1 -1
- package/dist/threads/session-list-model.d.ts +1 -1
- package/dist/threads/session-list-tab-share.cjs +150 -0
- package/dist/threads/session-list-tab-share.cjs.map +1 -0
- package/dist/threads/session-list-tab-share.d.ts +73 -0
- package/dist/threads/session-list-tab-share.js +150 -0
- package/dist/threads/session-list-tab-share.js.map +1 -0
- package/dist/threads/session-row-parts.d.ts +1 -1
- package/dist/threads/sessions-query.d.ts +1 -1
- package/dist/threads/statewire-thread-list.cjs +42 -16
- package/dist/threads/statewire-thread-list.cjs.map +1 -1
- package/dist/threads/statewire-thread-list.d.ts +11 -2
- package/dist/threads/statewire-thread-list.js +43 -17
- package/dist/threads/statewire-thread-list.js.map +1 -1
- package/dist/threads/thread-prefetcher.d.ts +1 -1
- package/dist/threads/use-athena-session-attention.d.ts +1 -1
- package/dist/threads/use-athena-sessions.cjs +32 -22
- package/dist/threads/use-athena-sessions.cjs.map +1 -1
- package/dist/threads/use-athena-sessions.js +33 -23
- package/dist/threads/use-athena-sessions.js.map +1 -1
- package/dist/threads/use-rest-conversation-history.d.ts +1 -1
- package/dist/threads/use-statewire-conversation-history.d.ts +5 -5
- package/dist/tiptap-markdown-table/src/markdown-table-serializer.d.ts +56 -0
- package/dist/tools/NestedPtcMessages.cjs +14 -9
- package/dist/tools/NestedPtcMessages.cjs.map +1 -1
- package/dist/tools/NestedPtcMessages.d.ts +9 -0
- package/dist/tools/NestedPtcMessages.js +6 -1
- package/dist/tools/NestedPtcMessages.js.map +1 -1
- package/dist/tools/index.d.ts +1 -1
- package/dist/tools/primitives.d.ts +1 -1
- package/dist/tools/subagent-task-tool-ui.cjs +494 -0
- package/dist/tools/subagent-task-tool-ui.cjs.map +1 -0
- package/dist/tools/subagent-task-tool-ui.d.ts +109 -0
- package/dist/tools/subagent-task-tool-ui.js +494 -0
- package/dist/tools/subagent-task-tool-ui.js.map +1 -0
- package/dist/tools/tool-fallback.d.ts +1 -1
- package/dist/tools/tool-icons.d.ts +1 -1
- package/dist/tools/tool-summary.d.ts +1 -1
- package/dist/tools/tool-uis.cjs +4 -0
- package/dist/tools/tool-uis.cjs.map +1 -1
- package/dist/tools/tool-uis.js +4 -0
- package/dist/tools/tool-uis.js.map +1 -1
- package/dist/voice/chat.cjs +6 -0
- package/dist/voice/chat.cjs.map +1 -0
- package/dist/voice/chat.d.ts +2 -0
- package/dist/voice/chat.js +6 -0
- package/dist/voice/chat.js.map +1 -0
- package/dist/voice/livekit-join.cjs +119 -0
- package/dist/voice/livekit-join.cjs.map +1 -0
- package/dist/voice/livekit-join.d.ts +8 -0
- package/dist/voice/livekit-join.js +119 -0
- package/dist/voice/livekit-join.js.map +1 -0
- package/dist/voice/livekit.cjs +32 -0
- package/dist/voice/livekit.cjs.map +1 -0
- package/dist/voice/livekit.d.ts +80 -0
- package/dist/voice/livekit.js +32 -0
- package/dist/voice/livekit.js.map +1 -0
- package/dist/voice/use-chat-voice-enabled.cjs +43 -0
- package/dist/voice/use-chat-voice-enabled.cjs.map +1 -0
- package/dist/voice/use-chat-voice-enabled.d.ts +9 -0
- package/dist/voice/use-chat-voice-enabled.js +43 -0
- package/dist/voice/use-chat-voice-enabled.js.map +1 -0
- package/package.json +22 -16
|
@@ -0,0 +1,352 @@
|
|
|
1
|
+
import { StatewireThread } from '@assistant-ui/react-statewire';
|
|
2
|
+
import { type DeepAgentHeadersResolver } from './deep-agent-transport-recipe';
|
|
3
|
+
import { type DeepAgentMessageAuthor } from './message-author';
|
|
4
|
+
import { type DeepAgentMessageWindowDeclaration, readDeepAgentMessageWindow } from './message-window';
|
|
5
|
+
import { type DeepAgentConversionMemory, type DeepAgentMessageConversionOptions } from './messages';
|
|
6
|
+
import { type DeepAgentProtocolStatus } from './protocol';
|
|
7
|
+
import type { DeepAgentAttachTimingEvent } from './statewire-attach-observer';
|
|
8
|
+
import type { StatewireDiagnosticsRecorder } from './statewire-diagnostics';
|
|
9
|
+
import { type StatewireTransportOptions } from './statewire-transport';
|
|
10
|
+
import type { DeepAgentThreadPrewarmPool } from './thread-prewarm';
|
|
11
|
+
import { type DeepAgentThreadSnapshotCache } from './thread-snapshot-cache';
|
|
12
|
+
import type { DeepAgentToolOutputStore } from './tool-outputs';
|
|
13
|
+
import type { DeepAgentWithdrawnTurns } from './withdrawn-turns';
|
|
14
|
+
import type { DeepAgentConnectionState, DeepAgentLaneProjection, DeepAgentStreamValues } from './types';
|
|
15
|
+
type ThreadOptions = StatewireThread.Options<DeepAgentStreamValues>;
|
|
16
|
+
export type { DeepAgentHeadersResolver } from './deep-agent-transport-recipe';
|
|
17
|
+
/**
|
|
18
|
+
* The identity of one attach of a thread: the thread, the host's `attachKey`
|
|
19
|
+
* and the lane epoch (`UseDeepAgentThreadOptions['laneEpoch']`). The transport
|
|
20
|
+
* mount and every per-attach decision (snapshot seed, pooled hello, conversion
|
|
21
|
+
* memory, the host's per-thread latches, send recovery) key off it, so a new
|
|
22
|
+
* lane epoch is a new attach exactly like a thread switch.
|
|
23
|
+
*/
|
|
24
|
+
export declare function deepAgentAttachId({ threadId, attachKey, laneEpoch, }: {
|
|
25
|
+
threadId: string;
|
|
26
|
+
attachKey?: string | number | undefined;
|
|
27
|
+
laneEpoch?: number;
|
|
28
|
+
}): string;
|
|
29
|
+
/**
|
|
30
|
+
* How an attach's FIRST frame is sourced, decided once per attach at mount: the
|
|
31
|
+
* hello a pooled pre-dialed attach already replicated (`prewarm`), a remembered
|
|
32
|
+
* snapshot seed (`snapshot`), or nothing (`none` — the thread loads until its
|
|
33
|
+
* hello).
|
|
34
|
+
*/
|
|
35
|
+
export type DeepAgentAttachSource = 'prewarm' | 'snapshot' | 'none';
|
|
36
|
+
export interface UseDeepAgentThreadOptions {
|
|
37
|
+
threadId: string;
|
|
38
|
+
/** Base URL of the deep-agent statewire host (the `…/v2/threads` mount). */
|
|
39
|
+
baseUrl: string;
|
|
40
|
+
/** Transport selection: SSE when true, WebSocket otherwise. */
|
|
41
|
+
sse?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Auth headers for the transport. Statewire passes `{ staleAuth: true }`
|
|
44
|
+
* when the previous credential was refused, so resolvers that can
|
|
45
|
+
* force-renew should honor it.
|
|
46
|
+
*/
|
|
47
|
+
headers: DeepAgentHeadersResolver;
|
|
48
|
+
/**
|
|
49
|
+
* Statewire session store for reconnect command-session recovery (e.g. the
|
|
50
|
+
* mobile AsyncStorage-backed store). Host-resolved; omitted, sessions are
|
|
51
|
+
* process-local.
|
|
52
|
+
*/
|
|
53
|
+
sessionStore?: StatewireTransportOptions['sessionStore'];
|
|
54
|
+
/**
|
|
55
|
+
* Mounted storage seams for the thread: `session` holds the lane identity and
|
|
56
|
+
* the commands still awaiting a durable verdict, so a reload resumes the lane
|
|
57
|
+
* instead of minting a new client (browser hosts pass `LocalStorageSession`
|
|
58
|
+
* from `@assistant-ui/react-statewire/local-storage`); `composer` persists the
|
|
59
|
+
* draft. Mutually exclusive with `sessionStore` — statewire refuses a session
|
|
60
|
+
* mounted twice.
|
|
61
|
+
*/
|
|
62
|
+
storage?: ThreadOptions['storage'];
|
|
63
|
+
/** True only for a never-started local chat; existing empty threads still load until their snapshot. */
|
|
64
|
+
isNewChat?: boolean;
|
|
65
|
+
/**
|
|
66
|
+
* Extra transport-key discriminator for the SAME thread. The session is keyed
|
|
67
|
+
* by `threadId` alone by default; hosts that must re-read the server snapshot
|
|
68
|
+
* without a thread switch (a run dispatched outside this client, e.g. a
|
|
69
|
+
* backgrounded AOP run writing the thread's first messages) bump this to
|
|
70
|
+
* remount the session against the same URL.
|
|
71
|
+
*/
|
|
72
|
+
attachKey?: string | number;
|
|
73
|
+
/**
|
|
74
|
+
* Bumped when the durable lane this mount runs on is replaced by a lane of
|
|
75
|
+
* another scope (another principal signed in, or another backend) while the
|
|
76
|
+
* thread stays mounted; `useDeepAgentRuntime` derives it from the session
|
|
77
|
+
* `key`. Each epoch remounts the whole statewire thread (its session with
|
|
78
|
+
* the client id, lane clocks and journal it loaded, the session storage, the
|
|
79
|
+
* composer and the thread state) instead of moving it to the new lane, and
|
|
80
|
+
* is an attach identity of its own. Its first attach seeds nothing this tab
|
|
81
|
+
* remembered of the thread and takes no dial pooled for it: both were
|
|
82
|
+
* captured as the previous principal. It reads `isNewChat` afresh, so a
|
|
83
|
+
* thread that persisted under the previous principal attaches at once.
|
|
84
|
+
* Default 0.
|
|
85
|
+
*/
|
|
86
|
+
laneEpoch?: number;
|
|
87
|
+
/**
|
|
88
|
+
* Host gate: park the transport instead of attaching — no socket, no retry
|
|
89
|
+
* loop. The thread element stays mounted so assistant-ui consumers keep
|
|
90
|
+
* rendering. Pass it when the host already knows every attach would be denied (e.g.
|
|
91
|
+
* the signed-in user has no workspace yet), so a locked-out tab does not
|
|
92
|
+
* hammer the attach endpoint on every backoff interval. `reason` is the
|
|
93
|
+
* connection message; a park with none (a `pending` session lane) reads
|
|
94
|
+
* like a never-started chat.
|
|
95
|
+
*/
|
|
96
|
+
suspended?: {
|
|
97
|
+
reason?: string | undefined;
|
|
98
|
+
} | false;
|
|
99
|
+
/**
|
|
100
|
+
* Adapter capabilities the host UI exposes. Defaults preserve each client's
|
|
101
|
+
* pre-extraction surface — pass what the product mounts.
|
|
102
|
+
*/
|
|
103
|
+
capabilities?: {
|
|
104
|
+
edit?: boolean;
|
|
105
|
+
continue?: boolean;
|
|
106
|
+
reload?: boolean;
|
|
107
|
+
unstable_switchBranch?: boolean;
|
|
108
|
+
};
|
|
109
|
+
/** Which run lanes project into the message tail; see {@link DeepAgentLaneProjection}. */
|
|
110
|
+
laneProjection?: DeepAgentLaneProjection;
|
|
111
|
+
/**
|
|
112
|
+
* Render quiet tools (`QUIET_TOOL_NAMES`, e.g. `submit_feedback`) like any
|
|
113
|
+
* other tool call. Off by default; pass it only for viewers allowed to see
|
|
114
|
+
* them (Olympus: Athena's internal admins on managed cloud).
|
|
115
|
+
*/
|
|
116
|
+
showQuietTools?: boolean;
|
|
117
|
+
/**
|
|
118
|
+
* The viewer, as the backend would stamp them (`metadata.custom.author`).
|
|
119
|
+
* Stamped onto this client's own optimistic bubbles — a send still in flight
|
|
120
|
+
* has no host `meta` yet — so a just-sent turn is attributed, and the
|
|
121
|
+
* multi-author avatar gate flips for a second poster, without waiting for
|
|
122
|
+
* the acknowledgment. Replicated entries carry the host's own stamp instead.
|
|
123
|
+
* Compared field-wise, so callers need not memoize the object.
|
|
124
|
+
*/
|
|
125
|
+
selfAuthor?: DeepAgentMessageAuthor | null;
|
|
126
|
+
/**
|
|
127
|
+
* Snapshot host context when each user message is submitted, before it is
|
|
128
|
+
* journaled. Includes programmatic appends, keyboard sends, queued messages,
|
|
129
|
+
* steering, and edits. The async getter starts immediately at submission;
|
|
130
|
+
* sends retain their order while it resolves. Retries, queue text edits,
|
|
131
|
+
* lane moves, reload, and continue preserve the original association.
|
|
132
|
+
* Return JSON-serializable metadata; optional capture failures can
|
|
133
|
+
* return an explicit null field rather than blocking the message.
|
|
134
|
+
*
|
|
135
|
+
* Declared structurally rather than as `ThreadOptions['getMessageMetadata']`:
|
|
136
|
+
* the option is what the monorepo patches into
|
|
137
|
+
* `@assistant-ui/react-statewire@0.31.0`, and the published sources must also
|
|
138
|
+
* compile against the unpatched upstream typings, where the library does not
|
|
139
|
+
* know the option and ignores it.
|
|
140
|
+
*/
|
|
141
|
+
getMessageMetadata?: (() => Record<string, unknown> | undefined | Promise<Record<string, unknown> | undefined>) | undefined;
|
|
142
|
+
/** Host-owned adapters: attachments (upload/mention choreography), speech, feedback. */
|
|
143
|
+
adapters?: ThreadOptions['adapters'];
|
|
144
|
+
/**
|
|
145
|
+
* Transport lifecycle recorder (attach latency, reconnect loops, command
|
|
146
|
+
* settle fates, stale-auth renewals) fed from the hook's own seams. Pass one
|
|
147
|
+
* only when the host's diagnostics channel is enabled — the recorder is
|
|
148
|
+
* observed on hot paths, and an absent recorder costs a single optional call.
|
|
149
|
+
*/
|
|
150
|
+
diagnostics?: StatewireDiagnosticsRecorder;
|
|
151
|
+
/**
|
|
152
|
+
* Per-tab LRU of the last wire state seen per thread. When set, every
|
|
153
|
+
* hydrated state the transport publishes is remembered, and a mount of a
|
|
154
|
+
* remembered thread seeds `initialState` from the cache (through
|
|
155
|
+
* {@link toThreadSnapshotSeed}) — the thread renders its last-known
|
|
156
|
+
* messages on the first frame instead of holding a loading treatment for
|
|
157
|
+
* the attach round-trip, and projects "running" when the run was live at
|
|
158
|
+
* capture (else "ready"). The attach snapshot then
|
|
159
|
+
* REPLACES the seeded state (statewire's `initialState` contract), so a
|
|
160
|
+
* thread that advanced elsewhere reconciles in one round-trip. New chats
|
|
161
|
+
* keep their preload and never read the cache.
|
|
162
|
+
*/
|
|
163
|
+
snapshotCache?: DeepAgentThreadSnapshotCache;
|
|
164
|
+
/**
|
|
165
|
+
* The head window this surface wants: declared on every attach
|
|
166
|
+
* (`x-athena-deep-agent-window`, part of the transport recipe) so the hello
|
|
167
|
+
* of a client the host does not remember carries the newest `size`
|
|
168
|
+
* messages, and stated as `athena/interest` after the hello only when the
|
|
169
|
+
* hello's head is narrower — never to shrink it (the host holds what a
|
|
170
|
+
* viewer has loaded for the life of its connection). The resolved chain is
|
|
171
|
+
* joined with the mounted message documents into the converted transcript
|
|
172
|
+
* (see `message-window.ts`); older pages load through
|
|
173
|
+
* `useDeepAgentWindowSync`. Read once per attach.
|
|
174
|
+
*/
|
|
175
|
+
messageWindow?: DeepAgentMessageWindowDeclaration;
|
|
176
|
+
/**
|
|
177
|
+
* Set only by a surface that pages a cut lane's earlier steps wherever it
|
|
178
|
+
* shows a lane's steps (`useDeepAgentLaneHistory`). Its attaches then
|
|
179
|
+
* declare the lane-cut contract version, and the host sends a finished
|
|
180
|
+
* `task` card with a deep transcript cut to its newest steps (see
|
|
181
|
+
* `DeepAgentProtocolDeclaration`). Omitted, every attach declares the
|
|
182
|
+
* default version and finished cards ride whole. Part of the transport
|
|
183
|
+
* recipe: a prewarm controller for this thread must be given the same
|
|
184
|
+
* value. Read once per attach.
|
|
185
|
+
*/
|
|
186
|
+
laneHistory?: boolean;
|
|
187
|
+
/**
|
|
188
|
+
* Joins the interest window off the mounted documents; the default is
|
|
189
|
+
* {@link readDeepAgentMessageWindow}. Olympus passes
|
|
190
|
+
* `readDeepAgentFollowedWindow`, which also reads the lanes it follows onto
|
|
191
|
+
* their `task` cards.
|
|
192
|
+
*/
|
|
193
|
+
readMessageWindow?: typeof readDeepAgentMessageWindow;
|
|
194
|
+
/**
|
|
195
|
+
* Creates each attach's conversion memory; the default is
|
|
196
|
+
* {@link createDeepAgentMessageConversionCache}. Olympus passes
|
|
197
|
+
* `createSubagentTranscriptConversionCache`, which also turns each `task`
|
|
198
|
+
* card's nested transcript into its tool-call part's `messages`.
|
|
199
|
+
*/
|
|
200
|
+
createConversionCache?: (options: DeepAgentMessageConversionOptions) => DeepAgentConversionMemory;
|
|
201
|
+
/**
|
|
202
|
+
* Full tool outputs fetched back for the wire's cut tool messages
|
|
203
|
+
* (`history/tool_output`); the thread re-converts when one lands.
|
|
204
|
+
*/
|
|
205
|
+
toolOutputs?: DeepAgentToolOutputStore;
|
|
206
|
+
/**
|
|
207
|
+
* User turns this client took back ahead of the wire (a user stop before
|
|
208
|
+
* any assistant output); the thread re-converts when one opens or closes.
|
|
209
|
+
*/
|
|
210
|
+
withdrawnTurns?: DeepAgentWithdrawnTurns;
|
|
211
|
+
/**
|
|
212
|
+
* Pre-dialed attaches (see `thread-prewarm.ts`). When the pool holds a root
|
|
213
|
+
* for this thread at mount, the thread takes the hello it replicated as its
|
|
214
|
+
* seed — the transcript is the first frame — and dials its own attach
|
|
215
|
+
* against the instance the pool warmed; the pooled root is disposed in the
|
|
216
|
+
* same step, so one socket is live per thread after mount. Never seeded for
|
|
217
|
+
* a preloaded new chat or a suspended attach; such a root is discarded.
|
|
218
|
+
*/
|
|
219
|
+
prewarmPool?: DeepAgentThreadPrewarmPool<DeepAgentStreamValues>;
|
|
220
|
+
/**
|
|
221
|
+
* Attach-path timing: socket open, hello size + handler cost, server retry
|
|
222
|
+
* hints — attributed to the attach's own thread, since a late event from the
|
|
223
|
+
* thread being left can land after the host has moved on.
|
|
224
|
+
*/
|
|
225
|
+
onAttachTiming?: (info: {
|
|
226
|
+
threadId: string;
|
|
227
|
+
event: DeepAgentAttachTimingEvent;
|
|
228
|
+
}) => void;
|
|
229
|
+
/** Where this attach's first frame comes from; once per attach, at mount. */
|
|
230
|
+
onAttachSource?: (info: {
|
|
231
|
+
threadId: string;
|
|
232
|
+
source: DeepAgentAttachSource;
|
|
233
|
+
}) => void;
|
|
234
|
+
/** Full transport error policy (paywall, toast, telemetry) — client-owned. */
|
|
235
|
+
onError?: ThreadOptions['onError'];
|
|
236
|
+
/**
|
|
237
|
+
* Raw statewire state observer (first-attach latches, telemetry). The state
|
|
238
|
+
* argument is never `undefined`/`null`: passes where the wire has no
|
|
239
|
+
* snapshot yet (pre-attach, replay boundaries) deliver the typed
|
|
240
|
+
* `DEEP_AGENT_PRE_STREAM_STATE` default — `isDeepAgentStateHydrated`
|
|
241
|
+
* distinguishes them from a real (possibly empty) snapshot.
|
|
242
|
+
*/
|
|
243
|
+
onStateChange?: ThreadOptions['onStateChange'];
|
|
244
|
+
/** Raw command-lifecycle observer (send-failure salvage, telemetry). */
|
|
245
|
+
onCommandChange?: ThreadOptions['onCommandChange'];
|
|
246
|
+
/** Raw connection observer (reconnect handles, telemetry). */
|
|
247
|
+
onRawConnectionChange?: ThreadOptions['onConnectionChange'];
|
|
248
|
+
/**
|
|
249
|
+
* Projected connection status changes, deduped per thread, with `null` on
|
|
250
|
+
* unmount so an indicator never shows a stale status.
|
|
251
|
+
*/
|
|
252
|
+
onConnectionChange?: (connection: DeepAgentConnectionState | null) => void;
|
|
253
|
+
/** Notified when a run starts/stops so the page can reflect the running thread. */
|
|
254
|
+
onRunningChange?: (isRunning: boolean) => void;
|
|
255
|
+
/**
|
|
256
|
+
* Notified once per thread with the `runConfig` carried by the statewire
|
|
257
|
+
* snapshot (the backend's persisted panel config, seeded in `_load_history`),
|
|
258
|
+
* so the host can hydrate its config store from the thread. Notified with
|
|
259
|
+
* `null` (at most once per attach) when a server snapshot arrives WITHOUT a
|
|
260
|
+
* persisted config, so a host waiting on hydration can stop waiting; a
|
|
261
|
+
* config appearing on a later snapshot of the same attach (mirrored at run
|
|
262
|
+
* start) still delivers the config notification.
|
|
263
|
+
*/
|
|
264
|
+
onServerRunConfig?: (config: Record<string, unknown> | null) => void;
|
|
265
|
+
/**
|
|
266
|
+
* Notified when the snapshot's `outOfBandRunActive` flag changes: the host set
|
|
267
|
+
* it while a run executing OUTSIDE this surface (an AOP / HTTP-route run)
|
|
268
|
+
* is actively writing the thread's bare-namespace history, which the host
|
|
269
|
+
* live-refreshes onto the wire. Lets the page show run-in-progress
|
|
270
|
+
* treatment instead of an empty conversation, and stand down its own
|
|
271
|
+
* re-attach polling. Change-notified per attach (an initial `false` before
|
|
272
|
+
* the snapshot stays silent), mirroring `onRunningChange`.
|
|
273
|
+
*/
|
|
274
|
+
onOutOfBandRunActive?: (outOfBandRunActive: boolean) => void;
|
|
275
|
+
/**
|
|
276
|
+
* Notified with the state's session-asset lifecycle flag
|
|
277
|
+
* ({@link readSessionPersisted}) PAIRED with the thread it describes: `false`
|
|
278
|
+
* while the thread's `session` asset provably does not exist yet (a
|
|
279
|
+
* never-started chat's preload, a first run before the mint), `true` once
|
|
280
|
+
* minted, `null` when the state carries no flag (a host that predates it).
|
|
281
|
+
*
|
|
282
|
+
* Fired from the converter pass, so the pair is read from the state of the
|
|
283
|
+
* thread this attach was mounted for. A component reading the flag off the
|
|
284
|
+
* client store instead lags the mounted thread id by one render on a switch
|
|
285
|
+
* and can pair the new id with the previous thread's flag — releasing a
|
|
286
|
+
* session-scoped read for a row the backend has not minted. Change-notified
|
|
287
|
+
* per attach; the first pass of every attach notifies, so a host holding a
|
|
288
|
+
* read back until it hears from the mounted thread always does.
|
|
289
|
+
*/
|
|
290
|
+
onSessionPersistedChange?: (event: {
|
|
291
|
+
threadId: string;
|
|
292
|
+
sessionPersisted: boolean | null;
|
|
293
|
+
}) => void;
|
|
294
|
+
/**
|
|
295
|
+
* Notified with the wire-contract status once the attach snapshot
|
|
296
|
+
* advertises the `protocol` lane, and again whenever it changes (a
|
|
297
|
+
* re-attach after a server roll can advertise a new `version`). Telemetry
|
|
298
|
+
* and per-version behaviour only: the host has no minimum client version,
|
|
299
|
+
* so nothing about the status gates a send. Never called for
|
|
300
|
+
* pre-declaration servers (their snapshots carry no lane) — absence of a
|
|
301
|
+
* call means "no advertisement", not "compatible".
|
|
302
|
+
*/
|
|
303
|
+
onProtocolChange?: (status: DeepAgentProtocolStatus) => void;
|
|
304
|
+
}
|
|
305
|
+
/** One thread's replicated running state, keyed so a switch between two
|
|
306
|
+
* threads with the same status still re-notifies (the host page clears its
|
|
307
|
+
* per-thread state on selection, mirroring the connection dedupe below). */
|
|
308
|
+
export interface RunningSnapshot {
|
|
309
|
+
threadId: string;
|
|
310
|
+
isRunning: boolean;
|
|
311
|
+
}
|
|
312
|
+
/** Whether the thread's `session` asset exists, read off a statewire state, or
|
|
313
|
+
* `null` when the state does not carry the flag.
|
|
314
|
+
*
|
|
315
|
+
* Absence is not absence of the asset: a snapshot from a host that predates
|
|
316
|
+
* the flag has no such key, and reading that as "the asset does not exist"
|
|
317
|
+
* would gate a read the client is entitled to make, with nothing left to
|
|
318
|
+
* un-gate it. A new thread's preload seeds `false` (see `initialState`), so
|
|
319
|
+
* the pre-attach pass of a chat that cannot have an asset yet still gates.
|
|
320
|
+
*
|
|
321
|
+
* Hosts pass this to `useStatewireState` so the flag and the thread it belongs
|
|
322
|
+
* to are read in one component — a thread switch then cannot pair one thread's
|
|
323
|
+
* id with the other's flag. */
|
|
324
|
+
export declare function readSessionPersisted(state: unknown): boolean | null;
|
|
325
|
+
/** Whether a converter pass must notify `onRunningChange`.
|
|
326
|
+
*
|
|
327
|
+
* The mount's very first status notifies only when it is `true` (a snapshot
|
|
328
|
+
* carrying a live run) — an initial `false` before the snapshot must stay
|
|
329
|
+
* silent so it cannot clear a still-valid indicator. After that, every
|
|
330
|
+
* transition notifies, and so does the first status after a thread switch
|
|
331
|
+
* (the host page clears its per-thread state on selection, so a switch
|
|
332
|
+
* between two threads with the same status must still re-notify). */
|
|
333
|
+
export declare function shouldNotifyRunningChange(previous: RunningSnapshot | null, next: RunningSnapshot): boolean;
|
|
334
|
+
/**
|
|
335
|
+
* The shared deep-agent Statewire thread.
|
|
336
|
+
*
|
|
337
|
+
* `StatewireThread` (from `@assistant-ui/react-statewire`) attaches to the
|
|
338
|
+
* agora-hosted thread at `${baseUrl}/${threadId}` (WebSocket by default,
|
|
339
|
+
* with SSE retained only as a host-selected compatibility switch): the backend
|
|
340
|
+
* hosts the thread state and this client
|
|
341
|
+
* replicates it live, so the server snapshot is the single source of history
|
|
342
|
+
* (no local import, no `/status` resume probing) and run scheduling — queueing,
|
|
343
|
+
* steering, stop, edit rewinds — rides the built-in `run/*` commands.
|
|
344
|
+
*
|
|
345
|
+
* The thread element is keyed by `threadId`, so a thread switch remounts the
|
|
346
|
+
* session against the new URL instead of importing history in place.
|
|
347
|
+
*
|
|
348
|
+
* Returns the thread element for the host's own `useAui({ thread })` — web
|
|
349
|
+
* hosts take `useAui` from `@assistant-ui/react`, React Native hosts from
|
|
350
|
+
* `@assistant-ui/react-native`; this package imports neither.
|
|
351
|
+
*/
|
|
352
|
+
export declare function useDeepAgentThread({ threadId, baseUrl, sse, headers, sessionStore, storage, isNewChat, attachKey, laneEpoch, suspended, capabilities, laneProjection, showQuietTools, selfAuthor, getMessageMetadata, adapters, diagnostics, snapshotCache, messageWindow, laneHistory, readMessageWindow, createConversionCache, toolOutputs, withdrawnTurns, prewarmPool, onAttachTiming, onAttachSource, onError, onStateChange, onCommandChange, onRawConnectionChange, onConnectionChange, onRunningChange, onServerRunConfig, onOutOfBandRunActive, onSessionPersistedChange, onProtocolChange, }: UseDeepAgentThreadOptions): import("@assistant-ui/tap").ResourceElement<import("@assistant-ui/store").ClientOutput<"thread">>;
|
|
@@ -13,6 +13,14 @@ import { pairDeepAgentStateWithThread, isDeepAgentStateHydrated, readDeepAgentSt
|
|
|
13
13
|
import { StatewireSuspended } from "./statewire-suspended.js";
|
|
14
14
|
import { DEEP_AGENT_STATEWIRE_PROTOCOL } from "./statewire-transport.js";
|
|
15
15
|
import { toThreadSnapshotSeed } from "./thread-snapshot-cache.js";
|
|
16
|
+
function deepAgentAttachId({
|
|
17
|
+
threadId,
|
|
18
|
+
attachKey,
|
|
19
|
+
laneEpoch = 0
|
|
20
|
+
}) {
|
|
21
|
+
const attach = attachKey === void 0 ? threadId : `${threadId}:${attachKey}`;
|
|
22
|
+
return laneEpoch === 0 ? attach : `${attach}#lane-epoch:${laneEpoch}`;
|
|
23
|
+
}
|
|
16
24
|
function readSessionPersisted(state) {
|
|
17
25
|
const flag = state == null ? void 0 : state.sessionPersisted;
|
|
18
26
|
return typeof flag === "boolean" ? flag : null;
|
|
@@ -33,15 +41,20 @@ function useDeepAgentThread({
|
|
|
33
41
|
storage,
|
|
34
42
|
isNewChat = false,
|
|
35
43
|
attachKey,
|
|
44
|
+
laneEpoch = 0,
|
|
36
45
|
suspended = false,
|
|
37
46
|
capabilities,
|
|
38
47
|
laneProjection = "both",
|
|
48
|
+
showQuietTools = false,
|
|
39
49
|
selfAuthor = null,
|
|
40
50
|
getMessageMetadata,
|
|
41
51
|
adapters,
|
|
42
52
|
diagnostics,
|
|
43
53
|
snapshotCache,
|
|
44
54
|
messageWindow,
|
|
55
|
+
laneHistory = false,
|
|
56
|
+
readMessageWindow = readDeepAgentMessageWindow,
|
|
57
|
+
createConversionCache = createDeepAgentMessageConversionCache,
|
|
45
58
|
toolOutputs,
|
|
46
59
|
withdrawnTurns,
|
|
47
60
|
prewarmPool,
|
|
@@ -83,6 +96,8 @@ function useDeepAgentThread({
|
|
|
83
96
|
headersRef.current = headers;
|
|
84
97
|
const messageWindowRef = useRef(messageWindow);
|
|
85
98
|
messageWindowRef.current = messageWindow;
|
|
99
|
+
const laneHistoryRef = useRef(laneHistory);
|
|
100
|
+
laneHistoryRef.current = laneHistory;
|
|
86
101
|
const interestRef = useRef({ attachId: "", stated: false });
|
|
87
102
|
const lastMessagesRef = useRef(null);
|
|
88
103
|
const [toolOutputsVersion, setToolOutputsVersion] = useState(0);
|
|
@@ -109,7 +124,7 @@ function useDeepAgentThread({
|
|
|
109
124
|
const absentStateRunConfigAttachRef = useRef(null);
|
|
110
125
|
const threadIdRef = useRef(threadId);
|
|
111
126
|
threadIdRef.current = threadId;
|
|
112
|
-
const attachId =
|
|
127
|
+
const attachId = deepAgentAttachId({ threadId, attachKey, laneEpoch });
|
|
113
128
|
const attachIdRef = useRef(attachId);
|
|
114
129
|
attachIdRef.current = attachId;
|
|
115
130
|
const [authParked, setAuthParked] = useState(null);
|
|
@@ -155,7 +170,9 @@ function useDeepAgentThread({
|
|
|
155
170
|
(_a3 = onOutOfBandRunActiveRef.current) == null ? void 0 : _a3.call(onOutOfBandRunActiveRef, stateOutOfBandRunActive);
|
|
156
171
|
});
|
|
157
172
|
}
|
|
158
|
-
const protocolStatus = projectDeepAgentProtocol(state
|
|
173
|
+
const protocolStatus = projectDeepAgentProtocol(state, {
|
|
174
|
+
laneHistory: laneHistoryRef.current
|
|
175
|
+
});
|
|
159
176
|
if (protocolStatus !== null) {
|
|
160
177
|
const previous = ((_a2 = lastProtocolRef.current) == null ? void 0 : _a2.attachId) === attachIdRef.current ? lastProtocolRef.current.status : null;
|
|
161
178
|
if (previous === null || previous.protocolVersion !== protocolStatus.protocolVersion) {
|
|
@@ -209,32 +226,38 @@ function useDeepAgentThread({
|
|
|
209
226
|
},
|
|
210
227
|
[]
|
|
211
228
|
);
|
|
212
|
-
const preloadRef = useRef({ threadId, preload: isNewChat });
|
|
213
|
-
if (preloadRef.current.threadId !== threadId)
|
|
214
|
-
preloadRef.current = { threadId, preload: isNewChat };
|
|
229
|
+
const preloadRef = useRef({ threadId, laneEpoch, preload: isNewChat });
|
|
230
|
+
if (preloadRef.current.threadId !== threadId || preloadRef.current.laneEpoch !== laneEpoch)
|
|
231
|
+
preloadRef.current = { threadId, laneEpoch, preload: isNewChat };
|
|
215
232
|
const snapshotCacheRef = useRef(snapshotCache);
|
|
216
233
|
snapshotCacheRef.current = snapshotCache;
|
|
217
234
|
const snapshotSeedRef = useRef(null);
|
|
218
235
|
if (snapshotSeedRef.current === null || snapshotSeedRef.current.attachId !== attachId) {
|
|
219
236
|
const preload = preloadRef.current.preload;
|
|
237
|
+
const laneReplaced = snapshotSeedRef.current !== null && snapshotSeedRef.current.laneEpoch !== laneEpoch;
|
|
238
|
+
if (laneReplaced) snapshotCache == null ? void 0 : snapshotCache.forget(threadId);
|
|
220
239
|
let pooledState;
|
|
221
240
|
if (prewarmPool == null ? void 0 : prewarmPool.has(threadId)) {
|
|
222
|
-
if (preload || suspended) {
|
|
241
|
+
if (preload || suspended || laneReplaced) {
|
|
223
242
|
prewarmPool.discard(threadId);
|
|
224
243
|
} else {
|
|
225
244
|
pooledState = (_a = prewarmPool.take(threadId)) == null ? void 0 : _a.state;
|
|
226
245
|
}
|
|
227
246
|
}
|
|
228
|
-
const remembered = preload || suspended ? void 0 : pooledState ?? (snapshotCache == null ? void 0 : snapshotCache.take(threadId));
|
|
247
|
+
const remembered = preload || suspended || laneReplaced ? void 0 : pooledState ?? (snapshotCache == null ? void 0 : snapshotCache.take(threadId));
|
|
229
248
|
const seed = remembered ? toThreadSnapshotSeed(remembered) : void 0;
|
|
230
|
-
snapshotSeedRef.current = { attachId, seed };
|
|
249
|
+
snapshotSeedRef.current = { attachId, laneEpoch, seed };
|
|
231
250
|
const source = pooledState !== void 0 ? "prewarm" : seed ? "snapshot" : "none";
|
|
232
251
|
const notifySource = onAttachSourceRef.current;
|
|
233
252
|
if (notifySource) queueMicrotask(() => notifySource({ threadId, source }));
|
|
234
253
|
}
|
|
235
254
|
const conversionCacheRef = useRef(null);
|
|
236
|
-
if (conversionCacheRef.current === null || conversionCacheRef.current.attachId !== attachId) {
|
|
237
|
-
conversionCacheRef.current = {
|
|
255
|
+
if (conversionCacheRef.current === null || conversionCacheRef.current.attachId !== attachId || conversionCacheRef.current.showQuietTools !== showQuietTools) {
|
|
256
|
+
conversionCacheRef.current = {
|
|
257
|
+
attachId,
|
|
258
|
+
showQuietTools,
|
|
259
|
+
cache: createConversionCache({ showQuietTools })
|
|
260
|
+
};
|
|
238
261
|
}
|
|
239
262
|
const conversionCache = conversionCacheRef.current.cache;
|
|
240
263
|
const lastStateMessagesRef = useRef(
|
|
@@ -244,7 +267,7 @@ function useDeepAgentThread({
|
|
|
244
267
|
(wireState, meta) => {
|
|
245
268
|
var _a2, _b, _c, _d, _e, _f, _g;
|
|
246
269
|
const values = readDeepAgentStreamValues(wireState);
|
|
247
|
-
const window =
|
|
270
|
+
const window = readMessageWindow(meta.mounted);
|
|
248
271
|
const held = ((_a2 = lastMessagesRef.current) == null ? void 0 : _a2.attachId) === attachId ? lastMessagesRef.current.messages : null;
|
|
249
272
|
const messages = (window == null ? void 0 : window.messages) ?? values.messages ?? held ?? [];
|
|
250
273
|
if (window !== null || messages.length > 0) lastMessagesRef.current = { attachId, messages };
|
|
@@ -335,9 +358,9 @@ function useDeepAgentThread({
|
|
|
335
358
|
}
|
|
336
359
|
return converter(state, ((_g = (_f = state.runs) == null ? void 0 : _f[0]) == null ? void 0 : _g.status) === "running", conversionCache);
|
|
337
360
|
},
|
|
338
|
-
[attachId, conversionCache, converter, materialize, threadId]
|
|
361
|
+
[attachId, conversionCache, converter, materialize, readMessageWindow, threadId]
|
|
339
362
|
);
|
|
340
|
-
|
|
363
|
+
const thread = StatewireThread({
|
|
341
364
|
// The transport stamps this protocol on every command; the thread client
|
|
342
365
|
// must declare it too or the core skips the optimistic folds and a send
|
|
343
366
|
// stays invisible until the server frame lands.
|
|
@@ -386,6 +409,7 @@ function useDeepAgentThread({
|
|
|
386
409
|
isNew: preloadRef.current.preload,
|
|
387
410
|
headers: (ctx) => headersRef.current(ctx),
|
|
388
411
|
messageWindow: messageWindowRef.current,
|
|
412
|
+
laneHistory: laneHistoryRef.current,
|
|
389
413
|
sessionStore,
|
|
390
414
|
onAuthResolve: (ctx) => {
|
|
391
415
|
var _a2;
|
|
@@ -449,8 +473,10 @@ function useDeepAgentThread({
|
|
|
449
473
|
})
|
|
450
474
|
}
|
|
451
475
|
});
|
|
476
|
+
return laneEpoch === 0 ? thread : withKey(`lane-epoch:${laneEpoch}`, thread);
|
|
452
477
|
}
|
|
453
478
|
export {
|
|
479
|
+
deepAgentAttachId,
|
|
454
480
|
readSessionPersisted,
|
|
455
481
|
shouldNotifyRunningChange,
|
|
456
482
|
useDeepAgentThread
|