@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,21 @@
|
|
|
1
|
+
import type { LangChainMessage } from '@assistant-ui/react-langgraph';
|
|
2
|
+
/** Parts of a pending user message the optimistic bubble can render. */
|
|
3
|
+
export type OptimisticContentPart = {
|
|
4
|
+
type: 'text';
|
|
5
|
+
text: string;
|
|
6
|
+
} | {
|
|
7
|
+
type: 'image';
|
|
8
|
+
image: string;
|
|
9
|
+
};
|
|
10
|
+
type HumanMessageContent = Extract<LangChainMessage, {
|
|
11
|
+
type: 'human';
|
|
12
|
+
}>['content'];
|
|
13
|
+
/**
|
|
14
|
+
* Content for the optimistic human bubble built from a pending send. Image
|
|
15
|
+
* attachment parts become LangChain `image_url` blocks so the just-sent
|
|
16
|
+
* message renders its images immediately instead of waiting for the backend
|
|
17
|
+
* echo (which only carries images after server-side mention extraction).
|
|
18
|
+
* Text-only sends keep the plain joined string.
|
|
19
|
+
*/
|
|
20
|
+
export declare const buildOptimisticHumanContent: (parts: readonly OptimisticContentPart[]) => HumanMessageContent;
|
|
21
|
+
export {};
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const runconfigContract = require("./generated/runconfig-contract.cjs");
|
|
4
|
+
const DEEP_AGENT_DEFAULT_CLIENT_PROTOCOL_VERSION = runconfigContract.DEEP_AGENT_LANE_CUT_PROTOCOL_VERSION - 1;
|
|
5
|
+
function declaredDeepAgentProtocolVersion({
|
|
6
|
+
laneHistory = false
|
|
7
|
+
} = {}) {
|
|
8
|
+
return laneHistory ? runconfigContract.DEEP_AGENT_LANE_CUT_PROTOCOL_VERSION : DEEP_AGENT_DEFAULT_CLIENT_PROTOCOL_VERSION;
|
|
9
|
+
}
|
|
4
10
|
const isContractVersion = (value) => typeof value === "number" && Number.isInteger(value) && value >= 1;
|
|
5
11
|
function readDeepAgentProtocol(state) {
|
|
6
12
|
if (typeof state !== "object" || state === null) return null;
|
|
@@ -10,12 +16,12 @@ function readDeepAgentProtocol(state) {
|
|
|
10
16
|
if (!isContractVersion(version)) return null;
|
|
11
17
|
return { version };
|
|
12
18
|
}
|
|
13
|
-
function projectDeepAgentProtocol(state) {
|
|
19
|
+
function projectDeepAgentProtocol(state, declaration = {}) {
|
|
14
20
|
const lane = readDeepAgentProtocol(state);
|
|
15
21
|
if (lane === null) return null;
|
|
16
22
|
return {
|
|
17
23
|
protocolVersion: lane.version,
|
|
18
|
-
clientVersion:
|
|
24
|
+
clientVersion: declaredDeepAgentProtocolVersion(declaration)
|
|
19
25
|
};
|
|
20
26
|
}
|
|
21
27
|
const seedProtocolLanes = /* @__PURE__ */ new WeakSet();
|
|
@@ -31,13 +37,15 @@ function isDeepAgentHostState(state) {
|
|
|
31
37
|
const lane = state[runconfigContract.DEEP_AGENT_PROTOCOL_STATE_KEY];
|
|
32
38
|
return typeof lane === "object" && lane !== null && readDeepAgentProtocol(state) !== null && !seedProtocolLanes.has(lane);
|
|
33
39
|
}
|
|
34
|
-
function withDeclaredProtocolVersion(headers) {
|
|
40
|
+
function withDeclaredProtocolVersion(headers, declaration = {}) {
|
|
35
41
|
if (runconfigContract.DEEP_AGENT_PROTOCOL_VERSION_HEADER in headers) return headers;
|
|
36
42
|
return {
|
|
37
43
|
...headers,
|
|
38
|
-
[runconfigContract.DEEP_AGENT_PROTOCOL_VERSION_HEADER]: String(
|
|
44
|
+
[runconfigContract.DEEP_AGENT_PROTOCOL_VERSION_HEADER]: String(declaredDeepAgentProtocolVersion(declaration))
|
|
39
45
|
};
|
|
40
46
|
}
|
|
47
|
+
exports.DEEP_AGENT_DEFAULT_CLIENT_PROTOCOL_VERSION = DEEP_AGENT_DEFAULT_CLIENT_PROTOCOL_VERSION;
|
|
48
|
+
exports.declaredDeepAgentProtocolVersion = declaredDeepAgentProtocolVersion;
|
|
41
49
|
exports.isDeepAgentHostState = isDeepAgentHostState;
|
|
42
50
|
exports.projectDeepAgentProtocol = projectDeepAgentProtocol;
|
|
43
51
|
exports.readDeepAgentProtocol = readDeepAgentProtocol;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protocol.cjs","sources":["../../../../agent-runtime/src/protocol.ts"],"sourcesContent":["import {\n
|
|
1
|
+
{"version":3,"file":"protocol.cjs","sources":["../../../../agent-runtime/src/protocol.ts"],"sourcesContent":["import {\n DEEP_AGENT_LANE_CUT_PROTOCOL_VERSION,\n DEEP_AGENT_PROTOCOL_STATE_KEY,\n DEEP_AGENT_PROTOCOL_VERSION_HEADER,\n} from './generated/runconfig-contract';\nimport type { DeepAgentStreamValues } from './types';\n\n/**\n * Wire-contract version declaration between the deep-agent statewire host and\n * a client surface (the client half of agora's\n * `agora/graphs/athena_deep_agent/protocol_version.py`; upstream ask\n * assistant-ui/statewire #31506 would make this a library concern).\n *\n * - Declaration: {@link withDeclaredProtocolVersion} stamps the version the\n * surface declares ({@link declaredDeepAgentProtocolVersion}) onto the\n * attach headers — they ride the first WS frame's mandatory `headers` field /\n * the SSE request headers, so no statewire change is needed. The host\n * records it for attach telemetry and selects per-version behaviour by it.\n * - Advertisement: the host publishes its own `version` under the `protocol`\n * state key in every attach snapshot; {@link readDeepAgentProtocol} /\n * {@link projectDeepAgentProtocol} read it.\n *\n * A declared version is a promise the host acts on, not the newest version\n * this build knows (`DEEP_AGENT_PROTOCOL_VERSION`): a host serves a client\n * declaring `DEEP_AGENT_LANE_CUT_PROTOCOL_VERSION` finished subagent lanes cut\n * to their newest steps, trusting it to page the rest. So a surface declares\n * what it implements ({@link DeepAgentProtocolDeclaration}), and a contract\n * bump never changes what a surface promises.\n *\n * There is no minimum client version: the host refuses no command for the\n * version its client declared (or for declaring none), so nothing here\n * compares versions or gates a send. Hosts still publish a `minClientVersion`\n * key (the constant 1) for installed clients whose lane reader required it;\n * this reader ignores it.\n *\n * Skew-tolerant on both sides: an old server advertises nothing (project\n * `null`, gate nothing), and a malformed lane reads as absent — the\n * declaration must never brick a client that could otherwise talk.\n */\nexport interface DeepAgentWireProtocol {\n /** The wire-contract version the server speaks. */\n version: number;\n}\n\n/**\n * What a surface implements of the contract, and so may declare on its\n * attaches ({@link declaredDeepAgentProtocolVersion}). Every field is off\n * until the surface ships the capability.\n */\nexport interface DeepAgentProtocolDeclaration {\n /**\n * The surface pages a cut lane's earlier steps (`useDeepAgentLaneHistory`\n * over `history/lane`) wherever it shows a lane's steps. Its attaches then\n * declare `DEEP_AGENT_LANE_CUT_PROTOCOL_VERSION`, and the host sends a\n * finished `task` card with a deep nested transcript cut to its newest\n * steps, as it sends a running one, under the key\n * `[threadId, \"main\", messageId, \"cut\"]`. Off, finished cards ride whole.\n */\n laneHistory?: boolean;\n}\n\n/**\n * The version a surface declares until it pages lanes: the one below the lane\n * cut, the newest contract under which the host sends every finished card\n * whole (the host's version gates are cumulative, `>=`).\n */\nexport const DEEP_AGENT_DEFAULT_CLIENT_PROTOCOL_VERSION: number =\n DEEP_AGENT_LANE_CUT_PROTOCOL_VERSION - 1;\n\n/**\n * The contract version a surface's attaches declare: the lane-cut version\n * when it pages lanes, else {@link DEEP_AGENT_DEFAULT_CLIENT_PROTOCOL_VERSION}.\n * Every attach of one surface — its thread, its pooled prewarm dials, its\n * wakes — declares the same, so a pooled hello is the hello the thread's own\n * attach would get.\n */\nexport function declaredDeepAgentProtocolVersion({\n laneHistory = false,\n}: DeepAgentProtocolDeclaration = {}): number {\n return laneHistory\n ? DEEP_AGENT_LANE_CUT_PROTOCOL_VERSION\n : DEEP_AGENT_DEFAULT_CLIENT_PROTOCOL_VERSION;\n}\n\n/** The advertised-lane projection a host surface reads. */\nexport interface DeepAgentProtocolStatus {\n /** Server-advertised current contract version. */\n protocolVersion: number;\n /** The contract version this surface's attach declares ({@link declaredDeepAgentProtocolVersion}). */\n clientVersion: number;\n}\n\nconst isContractVersion = (value: unknown): value is number =>\n typeof value === 'number' && Number.isInteger(value) && value >= 1;\n\n/**\n * The server-advertised version lane off a raw statewire state, or `null`\n * while it is unreadable — pre-attach, a pre-negotiation server's snapshot\n * (no lane), or a malformed lane (tolerated as absent, never thrown on).\n */\nexport function readDeepAgentProtocol(state: unknown): DeepAgentWireProtocol | null {\n if (typeof state !== 'object' || state === null) return null;\n const lane = (state as Record<string, unknown>)[DEEP_AGENT_PROTOCOL_STATE_KEY];\n if (typeof lane !== 'object' || lane === null) return null;\n const { version } = lane as Record<string, unknown>;\n if (!isContractVersion(version)) return null;\n return { version };\n}\n\n/**\n * Project the advertised version for a host surface, paired with what the\n * surface declares, or `null` while the server has not advertised (see\n * {@link readDeepAgentProtocol}). Pure and selector-safe, mirroring\n * `readSessionPersisted`.\n */\nexport function projectDeepAgentProtocol(\n state: unknown,\n declaration: DeepAgentProtocolDeclaration = {}\n): DeepAgentProtocolStatus | null {\n const lane = readDeepAgentProtocol(state);\n if (lane === null) return null;\n return {\n protocolVersion: lane.version,\n clientVersion: declaredDeepAgentProtocolVersion(declaration),\n };\n}\n\n/**\n * The protocol lanes seeds carry ({@link withSeedProtocolLane}), by identity.\n * Statewire's optimistic folds are copy-on-write, so every state folded over a\n * seed keeps its lane object, while a state the host sent never holds one\n * (each is parsed off the wire).\n */\nconst seedProtocolLanes = new WeakSet<object>();\n\n/**\n * `state` with a protocol lane of its own, remembered as a seed's — for the\n * remembered states a mount is seeded with (`toThreadSnapshotSeed`), whose\n * lanes are what the host sent an earlier attach. The lane is copied rather\n * than remembered in place, so a live attach still holding the original object\n * is never read as a seed.\n */\nexport function withSeedProtocolLane(state: DeepAgentStreamValues): DeepAgentStreamValues {\n const lane = state.protocol;\n if (typeof lane !== 'object' || lane === null) return state;\n const seeded = { ...lane };\n seedProtocolLanes.add(seeded);\n return { ...state, protocol: seeded };\n}\n\n/**\n * Whether `state` is one the host sent on this attach. The host advertises the\n * protocol lane in every attach snapshot and keeps it on every later frame;\n * the states a thread renders before its snapshot carry none (the placeholder\n * an existing thread loads with, and any optimistic fold over it) or a seed's\n * ({@link withSeedProtocolLane}).\n *\n * Decide anything about what the host holds — its config lane above all —\n * from these states only, never from the connection status: on a thread\n * mid-run the channel reports `connected` before the attach snapshot applies,\n * and a placeholder read as the host's says the thread has no config.\n *\n * A host predating the lane (2026-08-28) never answers true; the config lane\n * writes clients make (`config/patch`, 2026-09-05) came after it.\n */\nexport function isDeepAgentHostState(state: unknown): boolean {\n if (typeof state !== 'object' || state === null) return false;\n const lane = (state as Record<string, unknown>)[DEEP_AGENT_PROTOCOL_STATE_KEY];\n return (\n typeof lane === 'object' &&\n lane !== null &&\n readDeepAgentProtocol(state) !== null &&\n !seedProtocolLanes.has(lane)\n );\n}\n\n/**\n * Attach headers with the surface's contract version declared\n * ({@link declaredDeepAgentProtocolVersion}). Applied by the attach recipe\n * (`createDeepAgentAttachTransport`, `wakeDeepAgentThread`) to every resolved\n * header set, so every surface declares without per-host wiring; an explicit\n * entry (tests, forced overrides) wins.\n */\nexport function withDeclaredProtocolVersion(\n headers: Record<string, string>,\n declaration: DeepAgentProtocolDeclaration = {}\n): Record<string, string> {\n if (DEEP_AGENT_PROTOCOL_VERSION_HEADER in headers) return headers;\n return {\n ...headers,\n [DEEP_AGENT_PROTOCOL_VERSION_HEADER]: String(declaredDeepAgentProtocolVersion(declaration)),\n };\n}\n"],"names":["DEEP_AGENT_LANE_CUT_PROTOCOL_VERSION","DEEP_AGENT_PROTOCOL_STATE_KEY","DEEP_AGENT_PROTOCOL_VERSION_HEADER"],"mappings":";;;AAkEO,MAAM,6CACXA,kBAAAA,uCAAuC;AASlC,SAAS,iCAAiC;AAAA,EAC/C,cAAc;AAChB,IAAkC,IAAY;AAC5C,SAAO,cACHA,kBAAAA,uCACA;AACN;AAUA,MAAM,oBAAoB,CAAC,UACzB,OAAO,UAAU,YAAY,OAAO,UAAU,KAAK,KAAK,SAAS;AAO5D,SAAS,sBAAsB,OAA8C;AAClF,MAAI,OAAO,UAAU,YAAY,UAAU,KAAM,QAAO;AACxD,QAAM,OAAQ,MAAkCC,+CAA6B;AAC7E,MAAI,OAAO,SAAS,YAAY,SAAS,KAAM,QAAO;AACtD,QAAM,EAAE,YAAY;AACpB,MAAI,CAAC,kBAAkB,OAAO,EAAG,QAAO;AACxC,SAAO,EAAE,QAAA;AACX;AAQO,SAAS,yBACd,OACA,cAA4C,IACZ;AAChC,QAAM,OAAO,sBAAsB,KAAK;AACxC,MAAI,SAAS,KAAM,QAAO;AAC1B,SAAO;AAAA,IACL,iBAAiB,KAAK;AAAA,IACtB,eAAe,iCAAiC,WAAW;AAAA,EAAA;AAE/D;AAQA,MAAM,wCAAwB,QAAA;AASvB,SAAS,qBAAqB,OAAqD;AACxF,QAAM,OAAO,MAAM;AACnB,MAAI,OAAO,SAAS,YAAY,SAAS,KAAM,QAAO;AACtD,QAAM,SAAS,EAAE,GAAG,KAAA;AACpB,oBAAkB,IAAI,MAAM;AAC5B,SAAO,EAAE,GAAG,OAAO,UAAU,OAAA;AAC/B;AAiBO,SAAS,qBAAqB,OAAyB;AAC5D,MAAI,OAAO,UAAU,YAAY,UAAU,KAAM,QAAO;AACxD,QAAM,OAAQ,MAAkCA,+CAA6B;AAC7E,SACE,OAAO,SAAS,YAChB,SAAS,QACT,sBAAsB,KAAK,MAAM,QACjC,CAAC,kBAAkB,IAAI,IAAI;AAE/B;AASO,SAAS,4BACd,SACA,cAA4C,IACpB;AACxB,MAAIC,kBAAAA,sCAAsC,QAAS,QAAO;AAC1D,SAAO;AAAA,IACL,GAAG;AAAA,IACH,CAACA,oDAAkC,GAAG,OAAO,iCAAiC,WAAW,CAAC;AAAA,EAAA;AAE9F;;;;;;;;"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import type { DeepAgentStreamValues } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Wire-contract version declaration between the deep-agent statewire host and
|
|
4
|
+
* a client surface (the client half of agora's
|
|
5
|
+
* `agora/graphs/athena_deep_agent/protocol_version.py`; upstream ask
|
|
6
|
+
* assistant-ui/statewire #31506 would make this a library concern).
|
|
7
|
+
*
|
|
8
|
+
* - Declaration: {@link withDeclaredProtocolVersion} stamps the version the
|
|
9
|
+
* surface declares ({@link declaredDeepAgentProtocolVersion}) onto the
|
|
10
|
+
* attach headers — they ride the first WS frame's mandatory `headers` field /
|
|
11
|
+
* the SSE request headers, so no statewire change is needed. The host
|
|
12
|
+
* records it for attach telemetry and selects per-version behaviour by it.
|
|
13
|
+
* - Advertisement: the host publishes its own `version` under the `protocol`
|
|
14
|
+
* state key in every attach snapshot; {@link readDeepAgentProtocol} /
|
|
15
|
+
* {@link projectDeepAgentProtocol} read it.
|
|
16
|
+
*
|
|
17
|
+
* A declared version is a promise the host acts on, not the newest version
|
|
18
|
+
* this build knows (`DEEP_AGENT_PROTOCOL_VERSION`): a host serves a client
|
|
19
|
+
* declaring `DEEP_AGENT_LANE_CUT_PROTOCOL_VERSION` finished subagent lanes cut
|
|
20
|
+
* to their newest steps, trusting it to page the rest. So a surface declares
|
|
21
|
+
* what it implements ({@link DeepAgentProtocolDeclaration}), and a contract
|
|
22
|
+
* bump never changes what a surface promises.
|
|
23
|
+
*
|
|
24
|
+
* There is no minimum client version: the host refuses no command for the
|
|
25
|
+
* version its client declared (or for declaring none), so nothing here
|
|
26
|
+
* compares versions or gates a send. Hosts still publish a `minClientVersion`
|
|
27
|
+
* key (the constant 1) for installed clients whose lane reader required it;
|
|
28
|
+
* this reader ignores it.
|
|
29
|
+
*
|
|
30
|
+
* Skew-tolerant on both sides: an old server advertises nothing (project
|
|
31
|
+
* `null`, gate nothing), and a malformed lane reads as absent — the
|
|
32
|
+
* declaration must never brick a client that could otherwise talk.
|
|
33
|
+
*/
|
|
34
|
+
export interface DeepAgentWireProtocol {
|
|
35
|
+
/** The wire-contract version the server speaks. */
|
|
36
|
+
version: number;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* What a surface implements of the contract, and so may declare on its
|
|
40
|
+
* attaches ({@link declaredDeepAgentProtocolVersion}). Every field is off
|
|
41
|
+
* until the surface ships the capability.
|
|
42
|
+
*/
|
|
43
|
+
export interface DeepAgentProtocolDeclaration {
|
|
44
|
+
/**
|
|
45
|
+
* The surface pages a cut lane's earlier steps (`useDeepAgentLaneHistory`
|
|
46
|
+
* over `history/lane`) wherever it shows a lane's steps. Its attaches then
|
|
47
|
+
* declare `DEEP_AGENT_LANE_CUT_PROTOCOL_VERSION`, and the host sends a
|
|
48
|
+
* finished `task` card with a deep nested transcript cut to its newest
|
|
49
|
+
* steps, as it sends a running one, under the key
|
|
50
|
+
* `[threadId, "main", messageId, "cut"]`. Off, finished cards ride whole.
|
|
51
|
+
*/
|
|
52
|
+
laneHistory?: boolean;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* The version a surface declares until it pages lanes: the one below the lane
|
|
56
|
+
* cut, the newest contract under which the host sends every finished card
|
|
57
|
+
* whole (the host's version gates are cumulative, `>=`).
|
|
58
|
+
*/
|
|
59
|
+
export declare const DEEP_AGENT_DEFAULT_CLIENT_PROTOCOL_VERSION: number;
|
|
60
|
+
/**
|
|
61
|
+
* The contract version a surface's attaches declare: the lane-cut version
|
|
62
|
+
* when it pages lanes, else {@link DEEP_AGENT_DEFAULT_CLIENT_PROTOCOL_VERSION}.
|
|
63
|
+
* Every attach of one surface — its thread, its pooled prewarm dials, its
|
|
64
|
+
* wakes — declares the same, so a pooled hello is the hello the thread's own
|
|
65
|
+
* attach would get.
|
|
66
|
+
*/
|
|
67
|
+
export declare function declaredDeepAgentProtocolVersion({ laneHistory, }?: DeepAgentProtocolDeclaration): number;
|
|
68
|
+
/** The advertised-lane projection a host surface reads. */
|
|
69
|
+
export interface DeepAgentProtocolStatus {
|
|
70
|
+
/** Server-advertised current contract version. */
|
|
71
|
+
protocolVersion: number;
|
|
72
|
+
/** The contract version this surface's attach declares ({@link declaredDeepAgentProtocolVersion}). */
|
|
73
|
+
clientVersion: number;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* The server-advertised version lane off a raw statewire state, or `null`
|
|
77
|
+
* while it is unreadable — pre-attach, a pre-negotiation server's snapshot
|
|
78
|
+
* (no lane), or a malformed lane (tolerated as absent, never thrown on).
|
|
79
|
+
*/
|
|
80
|
+
export declare function readDeepAgentProtocol(state: unknown): DeepAgentWireProtocol | null;
|
|
81
|
+
/**
|
|
82
|
+
* Project the advertised version for a host surface, paired with what the
|
|
83
|
+
* surface declares, or `null` while the server has not advertised (see
|
|
84
|
+
* {@link readDeepAgentProtocol}). Pure and selector-safe, mirroring
|
|
85
|
+
* `readSessionPersisted`.
|
|
86
|
+
*/
|
|
87
|
+
export declare function projectDeepAgentProtocol(state: unknown, declaration?: DeepAgentProtocolDeclaration): DeepAgentProtocolStatus | null;
|
|
88
|
+
/**
|
|
89
|
+
* `state` with a protocol lane of its own, remembered as a seed's — for the
|
|
90
|
+
* remembered states a mount is seeded with (`toThreadSnapshotSeed`), whose
|
|
91
|
+
* lanes are what the host sent an earlier attach. The lane is copied rather
|
|
92
|
+
* than remembered in place, so a live attach still holding the original object
|
|
93
|
+
* is never read as a seed.
|
|
94
|
+
*/
|
|
95
|
+
export declare function withSeedProtocolLane(state: DeepAgentStreamValues): DeepAgentStreamValues;
|
|
96
|
+
/**
|
|
97
|
+
* Whether `state` is one the host sent on this attach. The host advertises the
|
|
98
|
+
* protocol lane in every attach snapshot and keeps it on every later frame;
|
|
99
|
+
* the states a thread renders before its snapshot carry none (the placeholder
|
|
100
|
+
* an existing thread loads with, and any optimistic fold over it) or a seed's
|
|
101
|
+
* ({@link withSeedProtocolLane}).
|
|
102
|
+
*
|
|
103
|
+
* Decide anything about what the host holds — its config lane above all —
|
|
104
|
+
* from these states only, never from the connection status: on a thread
|
|
105
|
+
* mid-run the channel reports `connected` before the attach snapshot applies,
|
|
106
|
+
* and a placeholder read as the host's says the thread has no config.
|
|
107
|
+
*
|
|
108
|
+
* A host predating the lane (2026-08-28) never answers true; the config lane
|
|
109
|
+
* writes clients make (`config/patch`, 2026-09-05) came after it.
|
|
110
|
+
*/
|
|
111
|
+
export declare function isDeepAgentHostState(state: unknown): boolean;
|
|
112
|
+
/**
|
|
113
|
+
* Attach headers with the surface's contract version declared
|
|
114
|
+
* ({@link declaredDeepAgentProtocolVersion}). Applied by the attach recipe
|
|
115
|
+
* (`createDeepAgentAttachTransport`, `wakeDeepAgentThread`) to every resolved
|
|
116
|
+
* header set, so every surface declares without per-host wiring; an explicit
|
|
117
|
+
* entry (tests, forced overrides) wins.
|
|
118
|
+
*/
|
|
119
|
+
export declare function withDeclaredProtocolVersion(headers: Record<string, string>, declaration?: DeepAgentProtocolDeclaration): Record<string, string>;
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DEEP_AGENT_PROTOCOL_STATE_KEY, DEEP_AGENT_LANE_CUT_PROTOCOL_VERSION, DEEP_AGENT_PROTOCOL_VERSION_HEADER } from "./generated/runconfig-contract.js";
|
|
2
|
+
const DEEP_AGENT_DEFAULT_CLIENT_PROTOCOL_VERSION = DEEP_AGENT_LANE_CUT_PROTOCOL_VERSION - 1;
|
|
3
|
+
function declaredDeepAgentProtocolVersion({
|
|
4
|
+
laneHistory = false
|
|
5
|
+
} = {}) {
|
|
6
|
+
return laneHistory ? DEEP_AGENT_LANE_CUT_PROTOCOL_VERSION : DEEP_AGENT_DEFAULT_CLIENT_PROTOCOL_VERSION;
|
|
7
|
+
}
|
|
2
8
|
const isContractVersion = (value) => typeof value === "number" && Number.isInteger(value) && value >= 1;
|
|
3
9
|
function readDeepAgentProtocol(state) {
|
|
4
10
|
if (typeof state !== "object" || state === null) return null;
|
|
@@ -8,12 +14,12 @@ function readDeepAgentProtocol(state) {
|
|
|
8
14
|
if (!isContractVersion(version)) return null;
|
|
9
15
|
return { version };
|
|
10
16
|
}
|
|
11
|
-
function projectDeepAgentProtocol(state) {
|
|
17
|
+
function projectDeepAgentProtocol(state, declaration = {}) {
|
|
12
18
|
const lane = readDeepAgentProtocol(state);
|
|
13
19
|
if (lane === null) return null;
|
|
14
20
|
return {
|
|
15
21
|
protocolVersion: lane.version,
|
|
16
|
-
clientVersion:
|
|
22
|
+
clientVersion: declaredDeepAgentProtocolVersion(declaration)
|
|
17
23
|
};
|
|
18
24
|
}
|
|
19
25
|
const seedProtocolLanes = /* @__PURE__ */ new WeakSet();
|
|
@@ -29,14 +35,16 @@ function isDeepAgentHostState(state) {
|
|
|
29
35
|
const lane = state[DEEP_AGENT_PROTOCOL_STATE_KEY];
|
|
30
36
|
return typeof lane === "object" && lane !== null && readDeepAgentProtocol(state) !== null && !seedProtocolLanes.has(lane);
|
|
31
37
|
}
|
|
32
|
-
function withDeclaredProtocolVersion(headers) {
|
|
38
|
+
function withDeclaredProtocolVersion(headers, declaration = {}) {
|
|
33
39
|
if (DEEP_AGENT_PROTOCOL_VERSION_HEADER in headers) return headers;
|
|
34
40
|
return {
|
|
35
41
|
...headers,
|
|
36
|
-
[DEEP_AGENT_PROTOCOL_VERSION_HEADER]: String(
|
|
42
|
+
[DEEP_AGENT_PROTOCOL_VERSION_HEADER]: String(declaredDeepAgentProtocolVersion(declaration))
|
|
37
43
|
};
|
|
38
44
|
}
|
|
39
45
|
export {
|
|
46
|
+
DEEP_AGENT_DEFAULT_CLIENT_PROTOCOL_VERSION,
|
|
47
|
+
declaredDeepAgentProtocolVersion,
|
|
40
48
|
isDeepAgentHostState,
|
|
41
49
|
projectDeepAgentProtocol,
|
|
42
50
|
readDeepAgentProtocol,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protocol.js","sources":["../../../../agent-runtime/src/protocol.ts"],"sourcesContent":["import {\n
|
|
1
|
+
{"version":3,"file":"protocol.js","sources":["../../../../agent-runtime/src/protocol.ts"],"sourcesContent":["import {\n DEEP_AGENT_LANE_CUT_PROTOCOL_VERSION,\n DEEP_AGENT_PROTOCOL_STATE_KEY,\n DEEP_AGENT_PROTOCOL_VERSION_HEADER,\n} from './generated/runconfig-contract';\nimport type { DeepAgentStreamValues } from './types';\n\n/**\n * Wire-contract version declaration between the deep-agent statewire host and\n * a client surface (the client half of agora's\n * `agora/graphs/athena_deep_agent/protocol_version.py`; upstream ask\n * assistant-ui/statewire #31506 would make this a library concern).\n *\n * - Declaration: {@link withDeclaredProtocolVersion} stamps the version the\n * surface declares ({@link declaredDeepAgentProtocolVersion}) onto the\n * attach headers — they ride the first WS frame's mandatory `headers` field /\n * the SSE request headers, so no statewire change is needed. The host\n * records it for attach telemetry and selects per-version behaviour by it.\n * - Advertisement: the host publishes its own `version` under the `protocol`\n * state key in every attach snapshot; {@link readDeepAgentProtocol} /\n * {@link projectDeepAgentProtocol} read it.\n *\n * A declared version is a promise the host acts on, not the newest version\n * this build knows (`DEEP_AGENT_PROTOCOL_VERSION`): a host serves a client\n * declaring `DEEP_AGENT_LANE_CUT_PROTOCOL_VERSION` finished subagent lanes cut\n * to their newest steps, trusting it to page the rest. So a surface declares\n * what it implements ({@link DeepAgentProtocolDeclaration}), and a contract\n * bump never changes what a surface promises.\n *\n * There is no minimum client version: the host refuses no command for the\n * version its client declared (or for declaring none), so nothing here\n * compares versions or gates a send. Hosts still publish a `minClientVersion`\n * key (the constant 1) for installed clients whose lane reader required it;\n * this reader ignores it.\n *\n * Skew-tolerant on both sides: an old server advertises nothing (project\n * `null`, gate nothing), and a malformed lane reads as absent — the\n * declaration must never brick a client that could otherwise talk.\n */\nexport interface DeepAgentWireProtocol {\n /** The wire-contract version the server speaks. */\n version: number;\n}\n\n/**\n * What a surface implements of the contract, and so may declare on its\n * attaches ({@link declaredDeepAgentProtocolVersion}). Every field is off\n * until the surface ships the capability.\n */\nexport interface DeepAgentProtocolDeclaration {\n /**\n * The surface pages a cut lane's earlier steps (`useDeepAgentLaneHistory`\n * over `history/lane`) wherever it shows a lane's steps. Its attaches then\n * declare `DEEP_AGENT_LANE_CUT_PROTOCOL_VERSION`, and the host sends a\n * finished `task` card with a deep nested transcript cut to its newest\n * steps, as it sends a running one, under the key\n * `[threadId, \"main\", messageId, \"cut\"]`. Off, finished cards ride whole.\n */\n laneHistory?: boolean;\n}\n\n/**\n * The version a surface declares until it pages lanes: the one below the lane\n * cut, the newest contract under which the host sends every finished card\n * whole (the host's version gates are cumulative, `>=`).\n */\nexport const DEEP_AGENT_DEFAULT_CLIENT_PROTOCOL_VERSION: number =\n DEEP_AGENT_LANE_CUT_PROTOCOL_VERSION - 1;\n\n/**\n * The contract version a surface's attaches declare: the lane-cut version\n * when it pages lanes, else {@link DEEP_AGENT_DEFAULT_CLIENT_PROTOCOL_VERSION}.\n * Every attach of one surface — its thread, its pooled prewarm dials, its\n * wakes — declares the same, so a pooled hello is the hello the thread's own\n * attach would get.\n */\nexport function declaredDeepAgentProtocolVersion({\n laneHistory = false,\n}: DeepAgentProtocolDeclaration = {}): number {\n return laneHistory\n ? DEEP_AGENT_LANE_CUT_PROTOCOL_VERSION\n : DEEP_AGENT_DEFAULT_CLIENT_PROTOCOL_VERSION;\n}\n\n/** The advertised-lane projection a host surface reads. */\nexport interface DeepAgentProtocolStatus {\n /** Server-advertised current contract version. */\n protocolVersion: number;\n /** The contract version this surface's attach declares ({@link declaredDeepAgentProtocolVersion}). */\n clientVersion: number;\n}\n\nconst isContractVersion = (value: unknown): value is number =>\n typeof value === 'number' && Number.isInteger(value) && value >= 1;\n\n/**\n * The server-advertised version lane off a raw statewire state, or `null`\n * while it is unreadable — pre-attach, a pre-negotiation server's snapshot\n * (no lane), or a malformed lane (tolerated as absent, never thrown on).\n */\nexport function readDeepAgentProtocol(state: unknown): DeepAgentWireProtocol | null {\n if (typeof state !== 'object' || state === null) return null;\n const lane = (state as Record<string, unknown>)[DEEP_AGENT_PROTOCOL_STATE_KEY];\n if (typeof lane !== 'object' || lane === null) return null;\n const { version } = lane as Record<string, unknown>;\n if (!isContractVersion(version)) return null;\n return { version };\n}\n\n/**\n * Project the advertised version for a host surface, paired with what the\n * surface declares, or `null` while the server has not advertised (see\n * {@link readDeepAgentProtocol}). Pure and selector-safe, mirroring\n * `readSessionPersisted`.\n */\nexport function projectDeepAgentProtocol(\n state: unknown,\n declaration: DeepAgentProtocolDeclaration = {}\n): DeepAgentProtocolStatus | null {\n const lane = readDeepAgentProtocol(state);\n if (lane === null) return null;\n return {\n protocolVersion: lane.version,\n clientVersion: declaredDeepAgentProtocolVersion(declaration),\n };\n}\n\n/**\n * The protocol lanes seeds carry ({@link withSeedProtocolLane}), by identity.\n * Statewire's optimistic folds are copy-on-write, so every state folded over a\n * seed keeps its lane object, while a state the host sent never holds one\n * (each is parsed off the wire).\n */\nconst seedProtocolLanes = new WeakSet<object>();\n\n/**\n * `state` with a protocol lane of its own, remembered as a seed's — for the\n * remembered states a mount is seeded with (`toThreadSnapshotSeed`), whose\n * lanes are what the host sent an earlier attach. The lane is copied rather\n * than remembered in place, so a live attach still holding the original object\n * is never read as a seed.\n */\nexport function withSeedProtocolLane(state: DeepAgentStreamValues): DeepAgentStreamValues {\n const lane = state.protocol;\n if (typeof lane !== 'object' || lane === null) return state;\n const seeded = { ...lane };\n seedProtocolLanes.add(seeded);\n return { ...state, protocol: seeded };\n}\n\n/**\n * Whether `state` is one the host sent on this attach. The host advertises the\n * protocol lane in every attach snapshot and keeps it on every later frame;\n * the states a thread renders before its snapshot carry none (the placeholder\n * an existing thread loads with, and any optimistic fold over it) or a seed's\n * ({@link withSeedProtocolLane}).\n *\n * Decide anything about what the host holds — its config lane above all —\n * from these states only, never from the connection status: on a thread\n * mid-run the channel reports `connected` before the attach snapshot applies,\n * and a placeholder read as the host's says the thread has no config.\n *\n * A host predating the lane (2026-08-28) never answers true; the config lane\n * writes clients make (`config/patch`, 2026-09-05) came after it.\n */\nexport function isDeepAgentHostState(state: unknown): boolean {\n if (typeof state !== 'object' || state === null) return false;\n const lane = (state as Record<string, unknown>)[DEEP_AGENT_PROTOCOL_STATE_KEY];\n return (\n typeof lane === 'object' &&\n lane !== null &&\n readDeepAgentProtocol(state) !== null &&\n !seedProtocolLanes.has(lane)\n );\n}\n\n/**\n * Attach headers with the surface's contract version declared\n * ({@link declaredDeepAgentProtocolVersion}). Applied by the attach recipe\n * (`createDeepAgentAttachTransport`, `wakeDeepAgentThread`) to every resolved\n * header set, so every surface declares without per-host wiring; an explicit\n * entry (tests, forced overrides) wins.\n */\nexport function withDeclaredProtocolVersion(\n headers: Record<string, string>,\n declaration: DeepAgentProtocolDeclaration = {}\n): Record<string, string> {\n if (DEEP_AGENT_PROTOCOL_VERSION_HEADER in headers) return headers;\n return {\n ...headers,\n [DEEP_AGENT_PROTOCOL_VERSION_HEADER]: String(declaredDeepAgentProtocolVersion(declaration)),\n };\n}\n"],"names":[],"mappings":";AAkEO,MAAM,6CACX,uCAAuC;AASlC,SAAS,iCAAiC;AAAA,EAC/C,cAAc;AAChB,IAAkC,IAAY;AAC5C,SAAO,cACH,uCACA;AACN;AAUA,MAAM,oBAAoB,CAAC,UACzB,OAAO,UAAU,YAAY,OAAO,UAAU,KAAK,KAAK,SAAS;AAO5D,SAAS,sBAAsB,OAA8C;AAClF,MAAI,OAAO,UAAU,YAAY,UAAU,KAAM,QAAO;AACxD,QAAM,OAAQ,MAAkC,6BAA6B;AAC7E,MAAI,OAAO,SAAS,YAAY,SAAS,KAAM,QAAO;AACtD,QAAM,EAAE,YAAY;AACpB,MAAI,CAAC,kBAAkB,OAAO,EAAG,QAAO;AACxC,SAAO,EAAE,QAAA;AACX;AAQO,SAAS,yBACd,OACA,cAA4C,IACZ;AAChC,QAAM,OAAO,sBAAsB,KAAK;AACxC,MAAI,SAAS,KAAM,QAAO;AAC1B,SAAO;AAAA,IACL,iBAAiB,KAAK;AAAA,IACtB,eAAe,iCAAiC,WAAW;AAAA,EAAA;AAE/D;AAQA,MAAM,wCAAwB,QAAA;AASvB,SAAS,qBAAqB,OAAqD;AACxF,QAAM,OAAO,MAAM;AACnB,MAAI,OAAO,SAAS,YAAY,SAAS,KAAM,QAAO;AACtD,QAAM,SAAS,EAAE,GAAG,KAAA;AACpB,oBAAkB,IAAI,MAAM;AAC5B,SAAO,EAAE,GAAG,OAAO,UAAU,OAAA;AAC/B;AAiBO,SAAS,qBAAqB,OAAyB;AAC5D,MAAI,OAAO,UAAU,YAAY,UAAU,KAAM,QAAO;AACxD,QAAM,OAAQ,MAAkC,6BAA6B;AAC7E,SACE,OAAO,SAAS,YAChB,SAAS,QACT,sBAAsB,KAAK,MAAM,QACjC,CAAC,kBAAkB,IAAI,IAAI;AAE/B;AASO,SAAS,4BACd,SACA,cAA4C,IACpB;AACxB,MAAI,sCAAsC,QAAS,QAAO;AAC1D,SAAO;AAAA,IACL,GAAG;AAAA,IACH,CAAC,kCAAkC,GAAG,OAAO,iCAAiC,WAAW,CAAC;AAAA,EAAA;AAE9F;"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Programmatic-tool-calling (PTC) sub-call parsing — the SDK method calls a
|
|
3
|
+
* sandbox `execute` / interpreter `eval` recorded, promoted by the backend onto
|
|
4
|
+
* the parent ToolMessage's artifact (`promote_artifact_with_ptc_subcalls`
|
|
5
|
+
* shape: one AIMessage carrying every call, then one ToolMessage per settled
|
|
6
|
+
* call). Pure parsing shared by the nested tool cards and the studio
|
|
7
|
+
* follow-along; React selectors over these live with each runtime host.
|
|
8
|
+
*/
|
|
9
|
+
import type { LangChainMessage } from '@assistant-ui/react-langgraph';
|
|
10
|
+
/**
|
|
11
|
+
* One SDK sub-call recorded under a sandbox `execute` (or interpreter `eval`)
|
|
12
|
+
* tool call — an Athena SDK method call (e.g. `Presentation.create`) the
|
|
13
|
+
* backend's PTC display channel captured and promoted onto the parent
|
|
14
|
+
* ToolMessage's `artifact.subgraph_state.messages`.
|
|
15
|
+
*/
|
|
16
|
+
export interface PtcSubcall {
|
|
17
|
+
id: string;
|
|
18
|
+
name: string;
|
|
19
|
+
args: Record<string, unknown>;
|
|
20
|
+
status: 'in_flight' | 'completed' | 'error';
|
|
21
|
+
/** The settled call's parsed result payload (`undefined` while in flight). */
|
|
22
|
+
result: unknown;
|
|
23
|
+
/** The settled call's result text ('' while in flight). */
|
|
24
|
+
resultText: string;
|
|
25
|
+
}
|
|
26
|
+
/** Parse the PTC sub-call list from a parent ToolMessage's promoted artifact. */
|
|
27
|
+
export declare function ptcSubcallsFromArtifact(artifact: unknown): PtcSubcall[];
|
|
28
|
+
/** One completed PTC parent (`execute`, `eval`, or a studio executor) carrying recorded sub-calls. */
|
|
29
|
+
export interface CompletedPtcParent {
|
|
30
|
+
toolCallId: string;
|
|
31
|
+
/** The parent tool's name, one of `PTC_PARENT_TOOL_NAMES`. */
|
|
32
|
+
toolName: string;
|
|
33
|
+
/**
|
|
34
|
+
* The executor source the call ran (`eval`'s `code` arg), read off the AI
|
|
35
|
+
* message that requested it. The studio SDKs emit no cell-level sub-calls,
|
|
36
|
+
* so the code string is the only carrier of the written spreadsheet cell.
|
|
37
|
+
*/
|
|
38
|
+
code: string | undefined;
|
|
39
|
+
/** Shape `computeStudioFollowTarget` expects: `{ artifact, result }`. */
|
|
40
|
+
rawResult: {
|
|
41
|
+
artifact: unknown;
|
|
42
|
+
result: unknown;
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Every completed `execute`/`eval` ToolMessage carrying recorded PTC
|
|
47
|
+
* sub-calls, from the raw transport messages — including the ones a subagent
|
|
48
|
+
* ran inside a `task` call's nested transcript. Drives the deep-agent's studio
|
|
49
|
+
* follow-along (`DeepAgentPtcStudioFollowObserver`).
|
|
50
|
+
*/
|
|
51
|
+
export declare function extractCompletedPtcParents(messages: readonly LangChainMessage[]): CompletedPtcParent[];
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Derivations for the server-owned statewire queue and steer lanes, shared by
|
|
3
|
+
* every queued-messages tray (Olympus, the React SDK, the Chrome extension).
|
|
4
|
+
*
|
|
5
|
+
* The queue is SERVER-owned: statewire surfaces it on the runs projection.
|
|
6
|
+
* "Send now" moves an item into the steer lane (`run/steer` — the host stops
|
|
7
|
+
* the run and dispatches it once the run settles; on a stopped/errored thread
|
|
8
|
+
* the same move dispatches immediately as a stop-/error-continue run) and
|
|
9
|
+
* remove issues `run/dequeue`. While the thread rests stopped/errored,
|
|
10
|
+
* stranded steer-lane entries list ahead of the queue — they dispatch first,
|
|
11
|
+
* as one batch, so they carry Remove but no per-row Send now.
|
|
12
|
+
*
|
|
13
|
+
* Pure helpers only: the host component reads `useStatewireRuns()` and
|
|
14
|
+
* `useDeepAgentThreadStatus()` itself (both mockable per surface) and passes
|
|
15
|
+
* the values in.
|
|
16
|
+
*/
|
|
17
|
+
import type { StatewireThread } from '@assistant-ui/react-statewire';
|
|
18
|
+
import type { DeepAgentThreadStatus } from './thread-status';
|
|
19
|
+
/** The text content of a queued entry (non-text parts render as fallbacks). */
|
|
20
|
+
export declare function queueEntryText(parts: readonly {
|
|
21
|
+
type: string;
|
|
22
|
+
text?: string;
|
|
23
|
+
}[]): string;
|
|
24
|
+
/**
|
|
25
|
+
* Whether a lane entry is still awaiting its send's settle: the host stamps
|
|
26
|
+
* `meta` on every entry it admits (`_op_meta` — submitter and contextSync
|
|
27
|
+
* snapshot), so a meta-less entry is this client's own optimistic fold. The
|
|
28
|
+
* send is still in flight and can still be refused (billing gate, auth,
|
|
29
|
+
* reconnect), which the tray must not render as an accepted queue position.
|
|
30
|
+
*/
|
|
31
|
+
export declare function isQueueEntryUnsettled(entry: StatewireThread.RunsQueueEntry): boolean;
|
|
32
|
+
/**
|
|
33
|
+
* The ids of queued entries the user prioritized (⚡ — `run/prioritize`), as
|
|
34
|
+
* the host records them in its durable `prioritizedQueueIds` state. A
|
|
35
|
+
* prioritized entry heads the queue lane and the live run ends at its next
|
|
36
|
+
* model-call boundary to deliver it, so trays render these rows lit and offer
|
|
37
|
+
* "Remove priority" instead of "Prioritize". Tolerates the key being absent
|
|
38
|
+
* (a thread that never prioritized, a pre-feature host) and ignores anything
|
|
39
|
+
* that is not a string id.
|
|
40
|
+
*/
|
|
41
|
+
export declare function readPrioritizedQueueIds(raw: unknown): readonly string[];
|
|
42
|
+
export interface QueueLaneFlags {
|
|
43
|
+
isRunning: boolean;
|
|
44
|
+
/** A stopped/errored thread can continue with its queued work. */
|
|
45
|
+
isContinuable: boolean;
|
|
46
|
+
}
|
|
47
|
+
/** The thread-status split every queue tray keys its affordances on. */
|
|
48
|
+
export declare function queueLaneFlags(status: DeepAgentThreadStatus): QueueLaneFlags;
|
|
49
|
+
export interface StatewireQueueRow {
|
|
50
|
+
item: StatewireThread.RunsQueueEntry;
|
|
51
|
+
lane: 'queue' | 'steer';
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* The rows a queue tray renders, in dispatch order: stranded steer-lane
|
|
55
|
+
* entries first (only while the thread rests continuable — during a run they
|
|
56
|
+
* already render in the message list), then the queue lane.
|
|
57
|
+
*/
|
|
58
|
+
export declare function buildStatewireQueueRows(options: {
|
|
59
|
+
queue: readonly StatewireThread.RunsQueueEntry[];
|
|
60
|
+
steerQueue: readonly StatewireThread.RunsQueueEntry[];
|
|
61
|
+
isContinuable: boolean;
|
|
62
|
+
}): StatewireQueueRow[];
|
|
63
|
+
/**
|
|
64
|
+
* Whether a row offers "Send now": queue-lane rows only (steer entries already
|
|
65
|
+
* dispatch first), every row while the thread rests continuable, and only the
|
|
66
|
+
* head row while a run is live (later rows would jump the queue order).
|
|
67
|
+
*/
|
|
68
|
+
export declare function showQueueRowSendNow(options: {
|
|
69
|
+
lane: 'queue' | 'steer';
|
|
70
|
+
index: number;
|
|
71
|
+
isRunning: boolean;
|
|
72
|
+
isContinuable: boolean;
|
|
73
|
+
}): boolean;
|
|
74
|
+
/**
|
|
75
|
+
* Whether a row offers "Steer" (`run/steer-live`): queue-lane rows while a run
|
|
76
|
+
* is live. Steer folds the entry into the RUNNING turn at its next model call
|
|
77
|
+
* — after the in-flight tool chain, never mid-tool — and the run goes on with
|
|
78
|
+
* it in context (ChatGPT's and Codex's Steer, versus Queue). Nothing is
|
|
79
|
+
* cancelled and no second run starts, so every queued row qualifies, not just
|
|
80
|
+
* the head. At rest there is no turn to steer: Send now already dispatches.
|
|
81
|
+
*/
|
|
82
|
+
export declare function showQueueRowSteer(options: {
|
|
83
|
+
lane: 'queue' | 'steer';
|
|
84
|
+
isRunning: boolean;
|
|
85
|
+
}): boolean;
|
|
86
|
+
export type QueueEditCommand = {
|
|
87
|
+
type: 'run/steer';
|
|
88
|
+
runId: string;
|
|
89
|
+
message: StatewireThread.UserMessage;
|
|
90
|
+
} | {
|
|
91
|
+
type: 'run/enqueue';
|
|
92
|
+
runId: string;
|
|
93
|
+
message: StatewireThread.UserMessage;
|
|
94
|
+
};
|
|
95
|
+
/**
|
|
96
|
+
* Re-send a queued entry under its own id on its own lane with edited text:
|
|
97
|
+
* the host replaces the queued message's content in place, leaving its queue
|
|
98
|
+
* position and lane untouched (a same-id send never dispatches). The built-in
|
|
99
|
+
* queue client has no update command, so this goes straight to the runs
|
|
100
|
+
* protocol. Returns `null` when there is nothing to send — blank or unchanged
|
|
101
|
+
* text, or no live run entry to address.
|
|
102
|
+
*/
|
|
103
|
+
export declare function buildQueueEditCommand(options: {
|
|
104
|
+
item: StatewireThread.RunsQueueEntry;
|
|
105
|
+
lane: 'queue' | 'steer';
|
|
106
|
+
runId: string | null;
|
|
107
|
+
text: string;
|
|
108
|
+
/**
|
|
109
|
+
* The edited message's metadata, replacing the entry's (the host replaces
|
|
110
|
+
* the queued message whole). Omitted, the entry's metadata is kept, minus a
|
|
111
|
+
* composer markdown that described the old text.
|
|
112
|
+
*/
|
|
113
|
+
metadata?: Readonly<Record<string, unknown>> | undefined;
|
|
114
|
+
}): QueueEditCommand | null;
|
|
115
|
+
/**
|
|
116
|
+
* Grace between observing a stranded settle and auto-promoting the queue
|
|
117
|
+
* head — long enough for the host's own settle bookkeeping (or a status flap
|
|
118
|
+
* during reconnect) to resolve first, short enough to read as "it just
|
|
119
|
+
* continued" rather than "it hung".
|
|
120
|
+
*/
|
|
121
|
+
export declare const QUEUE_AUTO_CONTINUE_DELAY_MS = 2000;
|
|
122
|
+
/** Whether the last cancellation marker records a user or client stop. */
|
|
123
|
+
export declare function userStopBlocksQueueAutoContinue(options: {
|
|
124
|
+
marker: string | undefined;
|
|
125
|
+
source: string | undefined;
|
|
126
|
+
}): boolean;
|
|
127
|
+
/** `fate (cause)[: message]` — the detail a failed-send row carries. */
|
|
128
|
+
export declare function describeQueueSendFailure(failure: StatewireThread.RunsFailedEntry['sendFailure']): string;
|
|
129
|
+
/**
|
|
130
|
+
* Whether a `retryFailed` / `discardFailed` throw is the covered drop race:
|
|
131
|
+
* statewire drops a failed entry on its own as soon as a canonical update
|
|
132
|
+
* shows the message landed, and acting on a just-dropped entry throws. Both
|
|
133
|
+
* the session record ("unknown failed command") and the adapter's projection
|
|
134
|
+
* ("unknown failed entry") use this prefix. Nothing is lost in that race — the
|
|
135
|
+
* message already made it and the row is about to disappear — so a tray
|
|
136
|
+
* swallows it (keeping telemetry) instead of crashing the click handler.
|
|
137
|
+
*/
|
|
138
|
+
export declare function isFailedSendEntryRace(error: unknown): boolean;
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
3
3
|
const tap = require("@assistant-ui/tap");
|
|
4
4
|
const storage = require("statewire/storage");
|
|
5
5
|
const react = require("react");
|
|
6
|
+
const sessionLaneScope = require("./session-lane-scope.cjs");
|
|
6
7
|
const statewireTransport = require("./statewire-transport.cjs");
|
|
7
8
|
const SESSION_PREFIX = "aui:statewire-session:";
|
|
8
9
|
const SESSION_LOCK_PREFIX = "aui:statewire-session-lock:";
|
|
@@ -320,6 +321,15 @@ const useQuotaSafeLocalStorageSession = ({
|
|
|
320
321
|
const sessionKey = key(threadId);
|
|
321
322
|
const storageKey = SESSION_PREFIX + sessionKey;
|
|
322
323
|
const lockName = SESSION_LOCK_PREFIX + sessionKey;
|
|
324
|
+
const mountedScope = react.useRef({
|
|
325
|
+
threadId,
|
|
326
|
+
laneKey: sessionKey
|
|
327
|
+
});
|
|
328
|
+
if (!sessionLaneScope.isSameSessionLaneScope({ scope: mountedScope.current, key })) {
|
|
329
|
+
throw new Error(
|
|
330
|
+
"statewire: principal changed; remount the account's thread/session"
|
|
331
|
+
);
|
|
332
|
+
}
|
|
323
333
|
const latestOnDegraded = react.useRef(onStorageDegraded);
|
|
324
334
|
latestOnDegraded.current = onStorageDegraded;
|
|
325
335
|
const reportDegradation = react.useMemo(() => {
|