@athenaintel/react 0.57.2 → 0.60.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +795 -12
- package/dist/agent-runtime/src/addressed-agents.cjs +16 -0
- package/dist/agent-runtime/src/addressed-agents.cjs.map +1 -0
- package/dist/agent-runtime/src/addressed-agents.d.ts +30 -0
- package/dist/agent-runtime/src/addressed-agents.js +16 -0
- package/dist/agent-runtime/src/addressed-agents.js.map +1 -0
- package/dist/agent-runtime/src/answer-label.cjs +4 -3
- package/dist/agent-runtime/src/answer-label.cjs.map +1 -1
- package/dist/agent-runtime/src/answer-label.d.ts +13 -6
- package/dist/agent-runtime/src/answer-label.js +4 -3
- package/dist/agent-runtime/src/answer-label.js.map +1 -1
- package/dist/agent-runtime/src/chat-outbox-attachments.cjs.map +1 -1
- package/dist/agent-runtime/src/chat-outbox-attachments.d.ts +1 -1
- package/dist/agent-runtime/src/chat-outbox-attachments.js.map +1 -1
- package/dist/agent-runtime/src/chat-outbox-entry.cjs +101 -0
- package/dist/agent-runtime/src/chat-outbox-entry.cjs.map +1 -0
- package/dist/agent-runtime/src/chat-outbox-entry.d.ts +99 -0
- package/dist/agent-runtime/src/chat-outbox-entry.js +101 -0
- package/dist/agent-runtime/src/chat-outbox-entry.js.map +1 -0
- package/dist/agent-runtime/src/chat-outbox-legacy.cjs +252 -0
- package/dist/agent-runtime/src/chat-outbox-legacy.cjs.map +1 -0
- package/dist/agent-runtime/src/chat-outbox-legacy.d.ts +96 -0
- package/dist/agent-runtime/src/chat-outbox-legacy.js +252 -0
- package/dist/agent-runtime/src/chat-outbox-legacy.js.map +1 -0
- package/dist/agent-runtime/src/chat-outbox-policy.cjs +30 -0
- package/dist/agent-runtime/src/chat-outbox-policy.cjs.map +1 -0
- package/dist/agent-runtime/src/chat-outbox-policy.d.ts +42 -0
- package/dist/agent-runtime/src/chat-outbox-policy.js +30 -0
- package/dist/agent-runtime/src/chat-outbox-policy.js.map +1 -0
- package/dist/agent-runtime/src/chat-outbox-storage.cjs +306 -0
- package/dist/agent-runtime/src/chat-outbox-storage.cjs.map +1 -0
- package/dist/agent-runtime/src/chat-outbox-storage.d.ts +194 -0
- package/dist/agent-runtime/src/chat-outbox-storage.js +306 -0
- package/dist/agent-runtime/src/chat-outbox-storage.js.map +1 -0
- package/dist/agent-runtime/src/chat-outbox-thread.cjs +21 -94
- package/dist/agent-runtime/src/chat-outbox-thread.cjs.map +1 -1
- package/dist/agent-runtime/src/chat-outbox-thread.d.ts +22 -18
- package/dist/agent-runtime/src/chat-outbox-thread.js +21 -94
- package/dist/agent-runtime/src/chat-outbox-thread.js.map +1 -1
- package/dist/agent-runtime/src/chat-outbox.cjs +492 -547
- package/dist/agent-runtime/src/chat-outbox.cjs.map +1 -1
- package/dist/agent-runtime/src/chat-outbox.d.ts +110 -142
- package/dist/agent-runtime/src/chat-outbox.js +492 -547
- package/dist/agent-runtime/src/chat-outbox.js.map +1 -1
- package/dist/agent-runtime/src/composer-markdown.cjs +0 -16
- package/dist/agent-runtime/src/composer-markdown.cjs.map +1 -1
- package/dist/agent-runtime/src/composer-markdown.d.ts +1 -1
- package/dist/agent-runtime/src/composer-markdown.js +1 -17
- package/dist/agent-runtime/src/composer-markdown.js.map +1 -1
- package/dist/agent-runtime/src/deep-agent-transport-recipe.cjs +3 -1
- package/dist/agent-runtime/src/deep-agent-transport-recipe.cjs.map +1 -1
- package/dist/agent-runtime/src/deep-agent-transport-recipe.d.ts +8 -1
- package/dist/agent-runtime/src/deep-agent-transport-recipe.js +3 -1
- package/dist/agent-runtime/src/deep-agent-transport-recipe.js.map +1 -1
- package/dist/agent-runtime/src/dictation-preferences.d.ts +356 -0
- package/dist/agent-runtime/src/dictation-record.d.ts +279 -0
- package/dist/agent-runtime/src/dictation-session.d.ts +106 -7
- package/dist/agent-runtime/src/dictation-snippets.d.ts +9 -0
- package/dist/agent-runtime/src/dictation-transfer.d.ts +142 -0
- package/dist/agent-runtime/src/edit-command.cjs.map +1 -1
- package/dist/agent-runtime/src/edit-command.d.ts +1 -1
- package/dist/agent-runtime/src/edit-command.js.map +1 -1
- package/dist/agent-runtime/src/errors.cjs +1 -0
- package/dist/agent-runtime/src/errors.cjs.map +1 -1
- package/dist/agent-runtime/src/errors.js +1 -0
- package/dist/agent-runtime/src/errors.js.map +1 -1
- package/dist/agent-runtime/src/generated/runconfig-contract.cjs +24 -0
- package/dist/agent-runtime/src/generated/runconfig-contract.cjs.map +1 -1
- package/dist/agent-runtime/src/generated/runconfig-contract.d.ts +3 -3
- package/dist/agent-runtime/src/generated/runconfig-contract.js +24 -0
- package/dist/agent-runtime/src/generated/runconfig-contract.js.map +1 -1
- package/dist/agent-runtime/src/index.d.ts +14 -8
- package/dist/agent-runtime/src/lane-follow.cjs +289 -0
- package/dist/agent-runtime/src/lane-follow.cjs.map +1 -0
- package/dist/agent-runtime/src/lane-follow.js +289 -0
- package/dist/agent-runtime/src/lane-follow.js.map +1 -0
- package/dist/agent-runtime/src/lane-images.cjs +387 -0
- package/dist/agent-runtime/src/lane-images.cjs.map +1 -0
- package/dist/agent-runtime/src/lane-images.js +387 -0
- package/dist/agent-runtime/src/lane-images.js.map +1 -0
- package/dist/agent-runtime/src/message-window.js +1 -1
- package/dist/agent-runtime/src/messages.cjs +19 -1
- package/dist/agent-runtime/src/messages.cjs.map +1 -1
- package/dist/agent-runtime/src/messages.d.ts +8 -0
- package/dist/agent-runtime/src/messages.js +21 -3
- package/dist/agent-runtime/src/messages.js.map +1 -1
- package/dist/agent-runtime/src/named-agents.cjs +301 -0
- package/dist/agent-runtime/src/named-agents.cjs.map +1 -0
- package/dist/agent-runtime/src/named-agents.d.ts +246 -0
- package/dist/agent-runtime/src/named-agents.js +301 -0
- package/dist/agent-runtime/src/named-agents.js.map +1 -0
- package/dist/agent-runtime/src/offline-status.cjs.map +1 -1
- package/dist/agent-runtime/src/offline-status.d.ts +93 -2
- package/dist/agent-runtime/src/offline-status.js.map +1 -1
- package/dist/agent-runtime/src/ptc-subcalls.cjs +41 -0
- package/dist/agent-runtime/src/ptc-subcalls.cjs.map +1 -0
- package/dist/agent-runtime/src/ptc-subcalls.js +41 -0
- package/dist/agent-runtime/src/ptc-subcalls.js.map +1 -0
- package/dist/agent-runtime/src/queue.cjs +2 -2
- package/dist/agent-runtime/src/queue.cjs.map +1 -1
- package/dist/agent-runtime/src/queue.d.ts +20 -25
- package/dist/agent-runtime/src/queue.js +2 -2
- package/dist/agent-runtime/src/queue.js.map +1 -1
- package/dist/agent-runtime/src/quota-safe-local-storage-session.cjs +314 -84
- 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 +137 -40
- package/dist/agent-runtime/src/quota-safe-local-storage-session.js +318 -88
- package/dist/agent-runtime/src/quota-safe-local-storage-session.js.map +1 -1
- package/dist/agent-runtime/src/run-send.cjs +54 -0
- package/dist/agent-runtime/src/run-send.cjs.map +1 -0
- package/dist/agent-runtime/src/run-send.d.ts +51 -0
- package/dist/agent-runtime/src/run-send.js +54 -0
- package/dist/agent-runtime/src/run-send.js.map +1 -0
- package/dist/agent-runtime/src/running-tool-placeholder.cjs +6 -0
- package/dist/agent-runtime/src/running-tool-placeholder.cjs.map +1 -1
- package/dist/agent-runtime/src/running-tool-placeholder.js +6 -0
- package/dist/agent-runtime/src/running-tool-placeholder.js.map +1 -1
- package/dist/agent-runtime/src/runtime.d.ts +9 -5
- package/dist/agent-runtime/src/sealed-idb.cjs +64 -0
- package/dist/agent-runtime/src/sealed-idb.cjs.map +1 -1
- package/dist/agent-runtime/src/sealed-idb.d.ts +16 -0
- package/dist/agent-runtime/src/sealed-idb.js +64 -0
- package/dist/agent-runtime/src/sealed-idb.js.map +1 -1
- package/dist/agent-runtime/src/send-recovery.cjs +90 -118
- package/dist/agent-runtime/src/send-recovery.cjs.map +1 -1
- package/dist/agent-runtime/src/send-recovery.d.ts +25 -29
- package/dist/agent-runtime/src/send-recovery.js +90 -118
- package/dist/agent-runtime/src/send-recovery.js.map +1 -1
- package/dist/agent-runtime/src/statewire-diagnostics.d.ts +4 -1
- package/dist/agent-runtime/src/statewire-held-sends.cjs +191 -0
- package/dist/agent-runtime/src/statewire-held-sends.cjs.map +1 -0
- package/dist/agent-runtime/src/statewire-held-sends.d.ts +119 -0
- package/dist/agent-runtime/src/statewire-held-sends.js +191 -0
- package/dist/agent-runtime/src/statewire-held-sends.js.map +1 -0
- package/dist/agent-runtime/src/statewire-state.cjs +4 -0
- package/dist/agent-runtime/src/statewire-state.cjs.map +1 -1
- package/dist/agent-runtime/src/statewire-state.js +4 -0
- package/dist/agent-runtime/src/statewire-state.js.map +1 -1
- package/dist/agent-runtime/src/statewire-transport.cjs +8 -2
- package/dist/agent-runtime/src/statewire-transport.cjs.map +1 -1
- package/dist/agent-runtime/src/statewire-transport.d.ts +14 -5
- package/dist/agent-runtime/src/statewire-transport.js +8 -2
- package/dist/agent-runtime/src/statewire-transport.js.map +1 -1
- package/dist/agent-runtime/src/subagent-transcripts.cjs +1 -23
- package/dist/agent-runtime/src/subagent-transcripts.cjs.map +1 -1
- package/dist/agent-runtime/src/subagent-transcripts.js +3 -25
- package/dist/agent-runtime/src/subagent-transcripts.js.map +1 -1
- package/dist/agent-runtime/src/subagents.cjs +22 -29
- package/dist/agent-runtime/src/subagents.cjs.map +1 -1
- package/dist/agent-runtime/src/subagents.js +23 -30
- package/dist/agent-runtime/src/subagents.js.map +1 -1
- package/dist/agent-runtime/src/thread-extras.cjs +27 -19
- package/dist/agent-runtime/src/thread-extras.cjs.map +1 -1
- package/dist/agent-runtime/src/thread-extras.d.ts +19 -6
- package/dist/agent-runtime/src/thread-extras.js +27 -19
- package/dist/agent-runtime/src/thread-extras.js.map +1 -1
- package/dist/agent-runtime/src/thread-handoff-flow-machine.d.ts +8 -8
- package/dist/agent-runtime/src/tool-metadata.cjs +19 -0
- package/dist/agent-runtime/src/tool-metadata.cjs.map +1 -1
- package/dist/agent-runtime/src/tool-metadata.js +19 -0
- package/dist/agent-runtime/src/tool-metadata.js.map +1 -1
- package/dist/agent-runtime/src/tool-names.cjs +21 -0
- package/dist/agent-runtime/src/tool-names.cjs.map +1 -1
- package/dist/agent-runtime/src/tool-names.d.ts +8 -0
- package/dist/agent-runtime/src/tool-names.js +21 -0
- package/dist/agent-runtime/src/tool-names.js.map +1 -1
- package/dist/agent-runtime/src/typed-interrupt-kinds.cjs +247 -0
- package/dist/agent-runtime/src/typed-interrupt-kinds.cjs.map +1 -0
- package/dist/agent-runtime/src/typed-interrupt-kinds.d.ts +173 -0
- package/dist/agent-runtime/src/typed-interrupt-kinds.js +247 -0
- package/dist/agent-runtime/src/typed-interrupt-kinds.js.map +1 -0
- package/dist/agent-runtime/src/typed-interrupts.cjs +48 -0
- package/dist/agent-runtime/src/typed-interrupts.cjs.map +1 -0
- package/dist/agent-runtime/src/typed-interrupts.d.ts +75 -0
- package/dist/agent-runtime/src/typed-interrupts.js +48 -0
- package/dist/agent-runtime/src/typed-interrupts.js.map +1 -0
- package/dist/agent-runtime/src/types.d.ts +1 -1
- package/dist/agent-runtime/src/use-conversation-list.cjs +1 -0
- package/dist/agent-runtime/src/use-conversation-list.cjs.map +1 -1
- package/dist/agent-runtime/src/use-conversation-list.d.ts +7 -0
- package/dist/agent-runtime/src/use-conversation-list.js +1 -0
- package/dist/agent-runtime/src/use-conversation-list.js.map +1 -1
- package/dist/agent-runtime/src/use-deep-agent-chat-outbox.cjs +46 -29
- package/dist/agent-runtime/src/use-deep-agent-chat-outbox.cjs.map +1 -1
- package/dist/agent-runtime/src/use-deep-agent-chat-outbox.d.ts +14 -22
- package/dist/agent-runtime/src/use-deep-agent-chat-outbox.js +46 -29
- package/dist/agent-runtime/src/use-deep-agent-chat-outbox.js.map +1 -1
- package/dist/agent-runtime/src/use-deep-agent-runtime.cjs +78 -14
- package/dist/agent-runtime/src/use-deep-agent-runtime.cjs.map +1 -1
- package/dist/agent-runtime/src/use-deep-agent-runtime.d.ts +34 -7
- package/dist/agent-runtime/src/use-deep-agent-runtime.js +79 -15
- package/dist/agent-runtime/src/use-deep-agent-runtime.js.map +1 -1
- package/dist/agent-runtime/src/use-deep-agent-thread.cjs +16 -1
- package/dist/agent-runtime/src/use-deep-agent-thread.cjs.map +1 -1
- package/dist/agent-runtime/src/use-deep-agent-thread.d.ts +7 -2
- package/dist/agent-runtime/src/use-deep-agent-thread.js +16 -1
- package/dist/agent-runtime/src/use-deep-agent-thread.js.map +1 -1
- package/dist/agent-runtime/src/use-deep-agent-voice.cjs +30 -4
- package/dist/agent-runtime/src/use-deep-agent-voice.cjs.map +1 -1
- package/dist/agent-runtime/src/use-deep-agent-voice.d.ts +22 -4
- package/dist/agent-runtime/src/use-deep-agent-voice.js +30 -4
- package/dist/agent-runtime/src/use-deep-agent-voice.js.map +1 -1
- package/dist/agent-runtime/src/withdrawn-turns.d.ts +5 -4
- package/dist/agent-runtime/src/word-device-fit.d.ts +174 -0
- package/dist/agent-runtime/src/work-in.d.ts +127 -0
- package/dist/assets/AthenaAssetEmbed.cjs.map +1 -1
- package/dist/assets/AthenaAssetEmbed.d.ts +6 -1
- package/dist/assets/AthenaAssetEmbed.js.map +1 -1
- package/dist/assets/asset-panel-store.cjs +13 -5
- package/dist/assets/asset-panel-store.cjs.map +1 -1
- package/dist/assets/asset-panel-store.d.ts +33 -2
- package/dist/assets/asset-panel-store.js +13 -5
- package/dist/assets/asset-panel-store.js.map +1 -1
- package/dist/auth/AthenaCredentialSourceContext.cjs +11 -0
- package/dist/auth/AthenaCredentialSourceContext.cjs.map +1 -1
- package/dist/auth/AthenaCredentialSourceContext.d.ts +6 -0
- package/dist/auth/AthenaCredentialSourceContext.js +11 -0
- package/dist/auth/AthenaCredentialSourceContext.js.map +1 -1
- package/dist/auth/account-identity.cjs +13 -2
- package/dist/auth/account-identity.cjs.map +1 -1
- package/dist/auth/account-identity.d.ts +9 -0
- package/dist/auth/account-identity.js +13 -2
- package/dist/auth/account-identity.js.map +1 -1
- package/dist/auth/credential-source.cjs +20 -4
- package/dist/auth/credential-source.cjs.map +1 -1
- package/dist/auth/credential-source.d.ts +9 -0
- package/dist/auth/credential-source.js +20 -4
- package/dist/auth/credential-source.js.map +1 -1
- package/dist/catalog/chat-pickers.cjs +31 -0
- package/dist/catalog/chat-pickers.cjs.map +1 -1
- package/dist/catalog/chat-pickers.d.ts +17 -0
- package/dist/catalog/chat-pickers.js +33 -2
- package/dist/catalog/chat-pickers.js.map +1 -1
- package/dist/catalog/runtime-catalog.cjs +63 -3
- package/dist/catalog/runtime-catalog.cjs.map +1 -1
- package/dist/catalog/runtime-catalog.d.ts +63 -3
- package/dist/catalog/runtime-catalog.js +64 -4
- package/dist/catalog/runtime-catalog.js.map +1 -1
- package/dist/chat/AthenaChat.cjs +301 -98
- package/dist/chat/AthenaChat.cjs.map +1 -1
- package/dist/chat/AthenaChat.d.ts +80 -4
- package/dist/chat/AthenaChat.js +302 -99
- package/dist/chat/AthenaChat.js.map +1 -1
- package/dist/chat/StatewireApprovalCard.cjs +35 -5
- package/dist/chat/StatewireApprovalCard.cjs.map +1 -1
- package/dist/chat/StatewireApprovalCard.d.ts +55 -2
- package/dist/chat/StatewireApprovalCard.js +37 -7
- package/dist/chat/StatewireApprovalCard.js.map +1 -1
- package/dist/chat/StatewireQueuedMessages.cjs +17 -2
- package/dist/chat/StatewireQueuedMessages.cjs.map +1 -1
- package/dist/chat/StatewireQueuedMessages.d.ts +8 -45
- package/dist/chat/StatewireQueuedMessages.js +18 -3
- package/dist/chat/StatewireQueuedMessages.js.map +1 -1
- package/dist/chat/chat-agent-mentions.cjs +70 -0
- package/dist/chat/chat-agent-mentions.cjs.map +1 -0
- package/dist/chat/chat-agent-mentions.d.ts +13 -0
- package/dist/chat/chat-agent-mentions.js +70 -0
- package/dist/chat/chat-agent-mentions.js.map +1 -0
- package/dist/chat/composer-actions.cjs +12 -0
- package/dist/chat/composer-actions.cjs.map +1 -0
- package/dist/chat/composer-actions.d.ts +22 -0
- package/dist/chat/composer-actions.js +12 -0
- package/dist/chat/composer-actions.js.map +1 -0
- package/dist/chat/follow-up-suggestions.cjs +185 -0
- package/dist/chat/follow-up-suggestions.cjs.map +1 -0
- package/dist/chat/follow-up-suggestions.d.ts +64 -0
- package/dist/chat/follow-up-suggestions.js +185 -0
- package/dist/chat/follow-up-suggestions.js.map +1 -0
- package/dist/chat/super-grouping/ToolTimeline.cjs +4 -3
- package/dist/chat/super-grouping/ToolTimeline.cjs.map +1 -1
- package/dist/chat/super-grouping/ToolTimeline.d.ts +7 -3
- package/dist/chat/super-grouping/ToolTimeline.js +4 -3
- package/dist/chat/super-grouping/ToolTimeline.js.map +1 -1
- package/dist/chat/turn-changes.cjs +284 -0
- package/dist/chat/turn-changes.cjs.map +1 -0
- package/dist/chat/turn-changes.d.ts +130 -0
- package/dist/chat/turn-changes.js +284 -0
- package/dist/chat/turn-changes.js.map +1 -0
- package/dist/chat/typed-interrupts/StatewireTypedInterruptCard.cjs +31 -0
- package/dist/chat/typed-interrupts/StatewireTypedInterruptCard.cjs.map +1 -0
- package/dist/chat/typed-interrupts/StatewireTypedInterruptCard.d.ts +31 -0
- package/dist/chat/typed-interrupts/StatewireTypedInterruptCard.js +31 -0
- package/dist/chat/typed-interrupts/StatewireTypedInterruptCard.js.map +1 -0
- package/dist/chat/typed-interrupts/approval-cards.cjs +250 -0
- package/dist/chat/typed-interrupts/approval-cards.cjs.map +1 -0
- package/dist/chat/typed-interrupts/approval-cards.d.ts +22 -0
- package/dist/chat/typed-interrupts/approval-cards.js +250 -0
- package/dist/chat/typed-interrupts/approval-cards.js.map +1 -0
- package/dist/chat/typed-interrupts/form-cards.cjs +289 -0
- package/dist/chat/typed-interrupts/form-cards.cjs.map +1 -0
- package/dist/chat/typed-interrupts/form-cards.d.ts +6 -0
- package/dist/chat/typed-interrupts/form-cards.js +289 -0
- package/dist/chat/typed-interrupts/form-cards.js.map +1 -0
- package/dist/chat/typed-interrupts/interrupt-card-shell.cjs +182 -0
- package/dist/chat/typed-interrupts/interrupt-card-shell.cjs.map +1 -0
- package/dist/chat/typed-interrupts/interrupt-card-shell.d.ts +47 -0
- package/dist/chat/typed-interrupts/interrupt-card-shell.js +182 -0
- package/dist/chat/typed-interrupts/interrupt-card-shell.js.map +1 -0
- package/dist/chat/typed-interrupts/json-schema-form.cjs +388 -0
- package/dist/chat/typed-interrupts/json-schema-form.cjs.map +1 -0
- package/dist/chat/typed-interrupts/json-schema-form.d.ts +33 -0
- package/dist/chat/typed-interrupts/json-schema-form.js +388 -0
- package/dist/chat/typed-interrupts/json-schema-form.js.map +1 -0
- package/dist/chat/typed-interrupts/questionnaire-card.cjs +449 -0
- package/dist/chat/typed-interrupts/questionnaire-card.cjs.map +1 -0
- package/dist/chat/typed-interrupts/questionnaire-card.d.ts +20 -0
- package/dist/chat/typed-interrupts/questionnaire-card.js +449 -0
- package/dist/chat/typed-interrupts/questionnaire-card.js.map +1 -0
- package/dist/chat/typed-interrupts/request-file-card.cjs +159 -0
- package/dist/chat/typed-interrupts/request-file-card.cjs.map +1 -0
- package/dist/chat/typed-interrupts/request-file-card.d.ts +2 -0
- package/dist/chat/typed-interrupts/request-file-card.js +159 -0
- package/dist/chat/typed-interrupts/request-file-card.js.map +1 -0
- package/dist/chat/typed-interrupts/toolkit-selection-card.cjs +189 -0
- package/dist/chat/typed-interrupts/toolkit-selection-card.cjs.map +1 -0
- package/dist/chat/typed-interrupts/toolkit-selection-card.d.ts +23 -0
- package/dist/chat/typed-interrupts/toolkit-selection-card.js +189 -0
- package/dist/chat/typed-interrupts/toolkit-selection-card.js.map +1 -0
- package/dist/chat/typed-interrupts/typed-interrupt-body.cjs +26 -0
- package/dist/chat/typed-interrupts/typed-interrupt-body.cjs.map +1 -0
- package/dist/chat/typed-interrupts/typed-interrupt-body.d.ts +3 -0
- package/dist/chat/typed-interrupts/typed-interrupt-body.js +26 -0
- package/dist/chat/typed-interrupts/typed-interrupt-body.js.map +1 -0
- package/dist/chat/typed-interrupts/typed-interrupt-graphql.cjs +105 -0
- package/dist/chat/typed-interrupts/typed-interrupt-graphql.cjs.map +1 -0
- package/dist/chat/typed-interrupts/typed-interrupt-graphql.d.ts +29 -0
- package/dist/chat/typed-interrupts/typed-interrupt-graphql.js +105 -0
- package/dist/chat/typed-interrupts/typed-interrupt-graphql.js.map +1 -0
- package/dist/chat/typed-interrupts/typed-interrupt-notice.cjs +70 -0
- package/dist/chat/typed-interrupts/typed-interrupt-notice.cjs.map +1 -0
- package/dist/chat/typed-interrupts/typed-interrupt-notice.d.ts +45 -0
- package/dist/chat/typed-interrupts/typed-interrupt-notice.js +70 -0
- package/dist/chat/typed-interrupts/typed-interrupt-notice.js.map +1 -0
- package/dist/chat/typed-interrupts/typed-interrupt-panel.cjs +76 -0
- package/dist/chat/typed-interrupts/typed-interrupt-panel.cjs.map +1 -0
- package/dist/chat/typed-interrupts/typed-interrupt-panel.d.ts +11 -0
- package/dist/chat/typed-interrupts/typed-interrupt-panel.js +76 -0
- package/dist/chat/typed-interrupts/typed-interrupt-panel.js.map +1 -0
- package/dist/chat/typed-interrupts/typed-interrupt-types.d.ts +46 -0
- package/dist/chat/typed-interrupts/use-interrupt-draft.cjs +106 -0
- package/dist/chat/typed-interrupts/use-interrupt-draft.cjs.map +1 -0
- package/dist/chat/typed-interrupts/use-interrupt-draft.d.ts +29 -0
- package/dist/chat/typed-interrupts/use-interrupt-draft.js +106 -0
- package/dist/chat/typed-interrupts/use-interrupt-draft.js.map +1 -0
- package/dist/chat/typed-interrupts/use-statewire-typed-interrupt.cjs +231 -0
- package/dist/chat/typed-interrupts/use-statewire-typed-interrupt.cjs.map +1 -0
- package/dist/chat/typed-interrupts/use-statewire-typed-interrupt.d.ts +66 -0
- package/dist/chat/typed-interrupts/use-statewire-typed-interrupt.js +231 -0
- package/dist/chat/typed-interrupts/use-statewire-typed-interrupt.js.map +1 -0
- package/dist/chat-ui/composer/composer-named-agents.cjs +13 -0
- package/dist/chat-ui/composer/composer-named-agents.cjs.map +1 -0
- package/dist/chat-ui/composer/composer-named-agents.d.ts +20 -0
- package/dist/chat-ui/composer/composer-named-agents.js +13 -0
- package/dist/chat-ui/composer/composer-named-agents.js.map +1 -0
- package/dist/chat-ui/composer/slash-command-menu.cjs +143 -0
- package/dist/chat-ui/composer/slash-command-menu.cjs.map +1 -0
- package/dist/chat-ui/composer/slash-command-menu.d.ts +19 -0
- package/dist/chat-ui/composer/slash-command-menu.js +143 -0
- package/dist/chat-ui/composer/slash-command-menu.js.map +1 -0
- package/dist/chat-ui/composer/slash-commands-extension.cjs +51 -0
- package/dist/chat-ui/composer/slash-commands-extension.cjs.map +1 -0
- package/dist/chat-ui/composer/slash-commands-extension.d.ts +39 -0
- package/dist/chat-ui/composer/slash-commands-extension.js +51 -0
- package/dist/chat-ui/composer/slash-commands-extension.js.map +1 -0
- package/dist/chat-ui/composer/slash-commands.cjs +74 -0
- package/dist/chat-ui/composer/slash-commands.cjs.map +1 -0
- package/dist/chat-ui/composer/slash-commands.d.ts +82 -0
- package/dist/chat-ui/composer/slash-commands.js +74 -0
- package/dist/chat-ui/composer/slash-commands.js.map +1 -0
- package/dist/chat-ui/composer/tiptap-composer.cjs +135 -9
- package/dist/chat-ui/composer/tiptap-composer.cjs.map +1 -1
- package/dist/chat-ui/composer/tiptap-composer.d.ts +61 -2
- package/dist/chat-ui/composer/tiptap-composer.js +135 -9
- package/dist/chat-ui/composer/tiptap-composer.js.map +1 -1
- package/dist/chat-ui/index.cjs +5 -0
- package/dist/chat-ui/index.cjs.map +1 -1
- package/dist/chat-ui/index.d.ts +4 -2
- package/dist/chat-ui/index.js +5 -0
- package/dist/chat-ui/index.js.map +1 -1
- package/dist/chat-ui/mentions/mention-chip.cjs +10 -4
- package/dist/chat-ui/mentions/mention-chip.cjs.map +1 -1
- package/dist/chat-ui/mentions/mention-chip.js +11 -5
- package/dist/chat-ui/mentions/mention-chip.js.map +1 -1
- package/dist/chat-ui/mentions/mention-extension.cjs +8 -1
- package/dist/chat-ui/mentions/mention-extension.cjs.map +1 -1
- package/dist/chat-ui/mentions/mention-extension.js +8 -1
- package/dist/chat-ui/mentions/mention-extension.js.map +1 -1
- package/dist/chat-ui/mentions/suggestions/components/get-scope-name.cjs +1 -0
- package/dist/chat-ui/mentions/suggestions/components/get-scope-name.cjs.map +1 -1
- package/dist/chat-ui/mentions/suggestions/components/get-scope-name.js +1 -0
- package/dist/chat-ui/mentions/suggestions/components/get-scope-name.js.map +1 -1
- package/dist/chat-ui/mentions/suggestions/components/mention-icon.cjs +20 -2
- package/dist/chat-ui/mentions/suggestions/components/mention-icon.cjs.map +1 -1
- package/dist/chat-ui/mentions/suggestions/components/mention-icon.d.ts +10 -1
- package/dist/chat-ui/mentions/suggestions/components/mention-icon.js +22 -4
- package/dist/chat-ui/mentions/suggestions/components/mention-icon.js.map +1 -1
- package/dist/chat-ui/mentions/suggestions/components/menu-item.cjs +1 -1
- package/dist/chat-ui/mentions/suggestions/components/menu-item.cjs.map +1 -1
- package/dist/chat-ui/mentions/suggestions/components/menu-item.js +1 -1
- package/dist/chat-ui/mentions/suggestions/components/menu-item.js.map +1 -1
- package/dist/chat-ui/mentions/suggestions/data/api-client.cjs +45 -0
- package/dist/chat-ui/mentions/suggestions/data/api-client.cjs.map +1 -1
- package/dist/chat-ui/mentions/suggestions/data/api-client.d.ts +48 -0
- package/dist/chat-ui/mentions/suggestions/data/api-client.js +45 -0
- package/dist/chat-ui/mentions/suggestions/data/api-client.js.map +1 -1
- package/dist/chat-ui/mentions/suggestions/data/sources/asset-type-icon-names.generated.cjs +89 -0
- package/dist/chat-ui/mentions/suggestions/data/sources/asset-type-icon-names.generated.cjs.map +1 -0
- package/dist/chat-ui/mentions/suggestions/data/sources/asset-type-icon-names.generated.d.ts +8 -0
- package/dist/chat-ui/mentions/suggestions/data/sources/asset-type-icon-names.generated.js +89 -0
- package/dist/chat-ui/mentions/suggestions/data/sources/asset-type-icon-names.generated.js.map +1 -0
- package/dist/chat-ui/mentions/suggestions/data/sources/asset-type-icons.cjs +140 -116
- package/dist/chat-ui/mentions/suggestions/data/sources/asset-type-icons.cjs.map +1 -1
- package/dist/chat-ui/mentions/suggestions/data/sources/asset-type-icons.d.ts +46 -12
- package/dist/chat-ui/mentions/suggestions/data/sources/asset-type-icons.js +141 -117
- package/dist/chat-ui/mentions/suggestions/data/sources/asset-type-icons.js.map +1 -1
- package/dist/chat-ui/mentions/suggestions/data/sources/index.cjs +272 -25
- package/dist/chat-ui/mentions/suggestions/data/sources/index.cjs.map +1 -1
- package/dist/chat-ui/mentions/suggestions/data/sources/index.d.ts +88 -10
- package/dist/chat-ui/mentions/suggestions/data/sources/index.js +274 -27
- package/dist/chat-ui/mentions/suggestions/data/sources/index.js.map +1 -1
- package/dist/chat-ui/mentions/suggestions/data/types.cjs.map +1 -1
- package/dist/chat-ui/mentions/suggestions/data/types.d.ts +27 -1
- package/dist/chat-ui/mentions/suggestions/data/types.js.map +1 -1
- package/dist/chat-ui/mentions/suggestions/data/use-mention-suggestions.cjs +56 -5
- package/dist/chat-ui/mentions/suggestions/data/use-mention-suggestions.cjs.map +1 -1
- package/dist/chat-ui/mentions/suggestions/data/use-mention-suggestions.d.ts +26 -6
- package/dist/chat-ui/mentions/suggestions/data/use-mention-suggestions.js +57 -6
- package/dist/chat-ui/mentions/suggestions/data/use-mention-suggestions.js.map +1 -1
- package/dist/chat-ui/mentions/suggestions/mention-suggestions.extension.cjs +34 -17
- package/dist/chat-ui/mentions/suggestions/mention-suggestions.extension.cjs.map +1 -1
- package/dist/chat-ui/mentions/suggestions/mention-suggestions.extension.d.ts +19 -1
- package/dist/chat-ui/mentions/suggestions/mention-suggestions.extension.js +35 -18
- package/dist/chat-ui/mentions/suggestions/mention-suggestions.extension.js.map +1 -1
- package/dist/chat-ui/mentions/use-asset-icon-app-url.cjs +12 -0
- package/dist/chat-ui/mentions/use-asset-icon-app-url.cjs.map +1 -0
- package/dist/chat-ui/mentions/use-asset-icon-app-url.d.ts +8 -0
- package/dist/chat-ui/mentions/use-asset-icon-app-url.js +12 -0
- package/dist/chat-ui/mentions/use-asset-icon-app-url.js.map +1 -0
- package/dist/chat-ui/statewire.d.ts +1 -1
- package/dist/chat-ui/thread/statewire-history-edge.cjs +15 -0
- package/dist/chat-ui/thread/statewire-history-edge.cjs.map +1 -1
- package/dist/chat-ui/thread/statewire-history-edge.d.ts +4 -1
- package/dist/chat-ui/thread/statewire-history-edge.js +15 -0
- package/dist/chat-ui/thread/statewire-history-edge.js.map +1 -1
- package/dist/collab/client.cjs +41 -6
- package/dist/collab/client.cjs.map +1 -1
- package/dist/collab/client.d.ts +38 -7
- package/dist/collab/client.js +41 -6
- package/dist/collab/client.js.map +1 -1
- package/dist/composer/ComposerAttachedReferences.cjs +119 -0
- package/dist/composer/ComposerAttachedReferences.cjs.map +1 -0
- package/dist/composer/ComposerAttachedReferences.d.ts +26 -0
- package/dist/composer/ComposerAttachedReferences.js +119 -0
- package/dist/composer/ComposerAttachedReferences.js.map +1 -0
- package/dist/composer/ComposerNamedAgents.cjs +63 -0
- package/dist/composer/ComposerNamedAgents.cjs.map +1 -0
- package/dist/composer/ComposerNamedAgents.d.ts +16 -0
- package/dist/composer/ComposerNamedAgents.js +63 -0
- package/dist/composer/ComposerNamedAgents.js.map +1 -0
- package/dist/composer/attached-references.cjs +159 -0
- package/dist/composer/attached-references.cjs.map +1 -0
- package/dist/composer/attached-references.d.ts +86 -0
- package/dist/composer/attached-references.js +159 -0
- package/dist/composer/attached-references.js.map +1 -0
- package/dist/composer/build-composed-message.cjs +14 -7
- package/dist/composer/build-composed-message.cjs.map +1 -1
- package/dist/composer/build-composed-message.d.ts +6 -1
- package/dist/composer/build-composed-message.js +14 -7
- package/dist/composer/build-composed-message.js.map +1 -1
- package/dist/composer/composer-handoff.cjs +6 -2
- package/dist/composer/composer-handoff.cjs.map +1 -1
- package/dist/composer/composer-handoff.d.ts +7 -1
- package/dist/composer/composer-handoff.js +6 -2
- package/dist/composer/composer-handoff.js.map +1 -1
- package/dist/composer/folder-upload.cjs +149 -0
- package/dist/composer/folder-upload.cjs.map +1 -0
- package/dist/composer/folder-upload.d.ts +79 -0
- package/dist/composer/folder-upload.js +149 -0
- package/dist/composer/folder-upload.js.map +1 -0
- package/dist/composer/index.d.ts +1 -1
- package/dist/composer/staged-message-metadata.cjs +12 -0
- package/dist/composer/staged-message-metadata.cjs.map +1 -0
- package/dist/composer/staged-message-metadata.d.ts +15 -0
- package/dist/composer/staged-message-metadata.js +12 -0
- package/dist/composer/staged-message-metadata.js.map +1 -0
- package/dist/composer/useAttachToChat.cjs +35 -0
- package/dist/composer/useAttachToChat.cjs.map +1 -0
- package/dist/composer/useAttachToChat.d.ts +54 -0
- package/dist/composer/useAttachToChat.js +35 -0
- package/dist/composer/useAttachToChat.js.map +1 -0
- package/dist/composer/useAttachedReferencesComposerProps.cjs +19 -0
- package/dist/composer/useAttachedReferencesComposerProps.cjs.map +1 -0
- package/dist/composer/useAttachedReferencesComposerProps.d.ts +12 -0
- package/dist/composer/useAttachedReferencesComposerProps.js +19 -0
- package/dist/composer/useAttachedReferencesComposerProps.js.map +1 -0
- package/dist/composer/useFileUpload.cjs +95 -7
- package/dist/composer/useFileUpload.cjs.map +1 -1
- package/dist/composer/useFileUpload.d.ts +21 -2
- package/dist/composer/useFileUpload.js +95 -7
- package/dist/composer/useFileUpload.js.map +1 -1
- package/dist/data/athena-api-error.cjs +125 -0
- package/dist/data/athena-api-error.cjs.map +1 -0
- package/dist/data/athena-api-error.d.ts +96 -0
- package/dist/data/athena-api-error.js +125 -0
- package/dist/data/athena-api-error.js.map +1 -0
- package/dist/data/athena-data-client.cjs +106 -0
- package/dist/data/athena-data-client.cjs.map +1 -0
- package/dist/data/athena-data-client.d.ts +74 -0
- package/dist/data/athena-data-client.js +106 -0
- package/dist/data/athena-data-client.js.map +1 -0
- package/dist/data/athena-member.cjs +93 -0
- package/dist/data/athena-member.cjs.map +1 -0
- package/dist/data/athena-member.d.ts +125 -0
- package/dist/data/athena-member.js +93 -0
- package/dist/data/athena-member.js.map +1 -0
- package/dist/data/athena-request.cjs +460 -0
- package/dist/data/athena-request.cjs.map +1 -0
- package/dist/data/athena-request.d.ts +120 -0
- package/dist/data/athena-request.js +460 -0
- package/dist/data/athena-request.js.map +1 -0
- package/dist/data/use-athena-fetch.cjs +14 -0
- package/dist/data/use-athena-fetch.cjs.map +1 -0
- package/dist/data/use-athena-fetch.d.ts +19 -0
- package/dist/data/use-athena-fetch.js +14 -0
- package/dist/data/use-athena-fetch.js.map +1 -0
- package/dist/data/use-athena-graphql.cjs +66 -0
- package/dist/data/use-athena-graphql.cjs.map +1 -0
- package/dist/data/use-athena-graphql.d.ts +56 -0
- package/dist/data/use-athena-graphql.js +66 -0
- package/dist/data/use-athena-graphql.js.map +1 -0
- package/dist/data/use-athena-rest.cjs +33 -0
- package/dist/data/use-athena-rest.cjs.map +1 -0
- package/dist/data/use-athena-rest.d.ts +21 -0
- package/dist/data/use-athena-rest.js +33 -0
- package/dist/data/use-athena-rest.js.map +1 -0
- package/dist/data/use-semantic-query.cjs +44 -0
- package/dist/data/use-semantic-query.cjs.map +1 -0
- package/dist/data/use-semantic-query.d.ts +92 -0
- package/dist/data/use-semantic-query.js +44 -0
- package/dist/data/use-semantic-query.js.map +1 -0
- package/dist/diagnostics/athena-diagnostics.cjs.map +1 -1
- package/dist/diagnostics/athena-diagnostics.d.ts +5 -1
- package/dist/diagnostics/athena-diagnostics.js.map +1 -1
- package/dist/diagnostics/errors.cjs +7 -0
- package/dist/diagnostics/errors.cjs.map +1 -1
- package/dist/diagnostics/errors.d.ts +7 -0
- package/dist/diagnostics/errors.js +7 -0
- package/dist/diagnostics/errors.js.map +1 -1
- package/dist/index.cjs +155 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +72 -13
- package/dist/index.js +148 -4
- package/dist/index.js.map +1 -1
- package/dist/keryx-http/src/initial-sync.cjs +64 -16
- package/dist/keryx-http/src/initial-sync.cjs.map +1 -1
- package/dist/keryx-http/src/initial-sync.d.ts +31 -1
- package/dist/keryx-http/src/initial-sync.js +64 -16
- package/dist/keryx-http/src/initial-sync.js.map +1 -1
- package/dist/keryx-http/src/own-awareness.cjs +20 -0
- package/dist/keryx-http/src/own-awareness.cjs.map +1 -0
- package/dist/keryx-http/src/own-awareness.d.ts +50 -0
- package/dist/keryx-http/src/own-awareness.js +20 -0
- package/dist/keryx-http/src/own-awareness.js.map +1 -0
- package/dist/keryx-http/src/update-attributions.cjs +26 -1
- package/dist/keryx-http/src/update-attributions.cjs.map +1 -1
- package/dist/keryx-http/src/update-attributions.d.ts +10 -1
- package/dist/keryx-http/src/update-attributions.js +26 -1
- package/dist/keryx-http/src/update-attributions.js.map +1 -1
- package/dist/offline/chat-outbox.cjs +262 -26
- package/dist/offline/chat-outbox.cjs.map +1 -1
- package/dist/offline/chat-outbox.d.ts +90 -12
- package/dist/offline/chat-outbox.js +263 -27
- package/dist/offline/chat-outbox.js.map +1 -1
- package/dist/provider/AthenaProvider.cjs +60 -22
- package/dist/provider/AthenaProvider.cjs.map +1 -1
- package/dist/provider/AthenaProvider.d.ts +24 -8
- package/dist/provider/AthenaProvider.js +61 -23
- package/dist/provider/AthenaProvider.js.map +1 -1
- package/dist/react/package.json.cjs +1 -1
- package/dist/react/package.json.js +1 -1
- package/dist/references/src/anchors/parse.cjs +11 -1
- package/dist/references/src/anchors/parse.cjs.map +1 -1
- package/dist/references/src/anchors/parse.js +11 -1
- package/dist/references/src/anchors/parse.js.map +1 -1
- package/dist/references/src/anchors/schemas.d.ts +1 -0
- package/dist/references/src/anchors/serialize.cjs +1 -0
- package/dist/references/src/anchors/serialize.cjs.map +1 -1
- package/dist/references/src/anchors/serialize.js +1 -0
- package/dist/references/src/anchors/serialize.js.map +1 -1
- package/dist/references/src/anchors/types.cjs +5 -0
- package/dist/references/src/anchors/types.cjs.map +1 -1
- package/dist/references/src/anchors/types.d.ts +9 -0
- package/dist/references/src/anchors/types.js +5 -0
- package/dist/references/src/anchors/types.js.map +1 -1
- package/dist/references/src/attachable.cjs +149 -0
- package/dist/references/src/attachable.cjs.map +1 -0
- package/dist/references/src/attachable.d.ts +87 -0
- package/dist/references/src/attachable.js +149 -0
- package/dist/references/src/attachable.js.map +1 -0
- package/dist/references/src/schemas.d.ts +2 -0
- package/dist/runtime/StatewirePlanModeLaneSync.cjs +93 -0
- package/dist/runtime/StatewirePlanModeLaneSync.cjs.map +1 -0
- package/dist/runtime/StatewirePlanModeLaneSync.d.ts +34 -0
- package/dist/runtime/StatewirePlanModeLaneSync.js +93 -0
- package/dist/runtime/StatewirePlanModeLaneSync.js.map +1 -0
- package/dist/runtime/StatewireThreadConfigLaneSync.cjs +2 -0
- package/dist/runtime/StatewireThreadConfigLaneSync.cjs.map +1 -1
- package/dist/runtime/StatewireThreadConfigLaneSync.d.ts +4 -0
- package/dist/runtime/StatewireThreadConfigLaneSync.js +2 -0
- package/dist/runtime/StatewireThreadConfigLaneSync.js.map +1 -1
- package/dist/runtime/statewire-plan-mode.cjs +71 -0
- package/dist/runtime/statewire-plan-mode.cjs.map +1 -0
- package/dist/runtime/statewire-plan-mode.d.ts +88 -0
- package/dist/runtime/statewire-plan-mode.js +71 -0
- package/dist/runtime/statewire-plan-mode.js.map +1 -0
- package/dist/runtime/statewire-run-config.cjs +3 -1
- package/dist/runtime/statewire-run-config.cjs.map +1 -1
- package/dist/runtime/statewire-run-config.d.ts +7 -0
- package/dist/runtime/statewire-run-config.js +3 -1
- package/dist/runtime/statewire-run-config.js.map +1 -1
- package/dist/runtime/statewire-session-key.cjs +11 -5
- package/dist/runtime/statewire-session-key.cjs.map +1 -1
- package/dist/runtime/statewire-session-key.d.ts +22 -10
- package/dist/runtime/statewire-session-key.js +11 -5
- package/dist/runtime/statewire-session-key.js.map +1 -1
- package/dist/runtime/useAthenaStatewireRuntime.cjs +64 -9
- package/dist/runtime/useAthenaStatewireRuntime.cjs.map +1 -1
- package/dist/runtime/useAthenaStatewireRuntime.d.ts +26 -10
- package/dist/runtime/useAthenaStatewireRuntime.js +66 -11
- package/dist/runtime/useAthenaStatewireRuntime.js.map +1 -1
- package/dist/search/useAthenaAssets.cjs +394 -0
- package/dist/search/useAthenaAssets.cjs.map +1 -0
- package/dist/search/useAthenaAssets.d.ts +186 -0
- package/dist/search/useAthenaAssets.js +394 -0
- package/dist/search/useAthenaAssets.js.map +1 -0
- package/dist/sheet-range/index.cjs +4 -0
- package/dist/sheet-range/index.cjs.map +1 -1
- package/dist/sheet-range/index.d.ts +4 -2
- package/dist/sheet-range/index.js +4 -0
- package/dist/sheet-range/index.js.map +1 -1
- package/dist/sheet-range/query-range.cjs +102 -0
- package/dist/sheet-range/query-range.cjs.map +1 -0
- package/dist/sheet-range/query-range.d.ts +46 -0
- package/dist/sheet-range/query-range.js +102 -0
- package/dist/sheet-range/query-range.js.map +1 -0
- package/dist/styles.css +1 -1
- package/dist/subagents/index.cjs +49 -0
- package/dist/subagents/index.cjs.map +1 -0
- package/dist/subagents/index.d.ts +16 -0
- package/dist/subagents/index.js +49 -0
- package/dist/subagents/index.js.map +1 -0
- package/dist/subagents/lane-follow.cjs +19 -0
- package/dist/subagents/lane-follow.cjs.map +1 -0
- package/dist/subagents/lane-follow.d.ts +9 -0
- package/dist/subagents/lane-follow.js +19 -0
- package/dist/subagents/lane-follow.js.map +1 -0
- package/dist/subagents/lane-model.cjs +178 -0
- package/dist/subagents/lane-model.cjs.map +1 -0
- package/dist/subagents/lane-model.d.ts +140 -0
- package/dist/subagents/lane-model.js +178 -0
- package/dist/subagents/lane-model.js.map +1 -0
- package/dist/subagents/lane-parts.cjs +517 -0
- package/dist/subagents/lane-parts.cjs.map +1 -0
- package/dist/subagents/lane-parts.d.ts +130 -0
- package/dist/subagents/lane-parts.js +517 -0
- package/dist/subagents/lane-parts.js.map +1 -0
- package/dist/subagents/subagent-lane-group.cjs +215 -0
- package/dist/subagents/subagent-lane-group.cjs.map +1 -0
- package/dist/subagents/subagent-lane-group.d.ts +67 -0
- package/dist/subagents/subagent-lane-group.js +215 -0
- package/dist/subagents/subagent-lane-group.js.map +1 -0
- package/dist/subagents/subagent-transcript-drawer.cjs +431 -0
- package/dist/subagents/subagent-transcript-drawer.cjs.map +1 -0
- package/dist/subagents/subagent-transcript-drawer.d.ts +78 -0
- package/dist/subagents/subagent-transcript-drawer.js +431 -0
- package/dist/subagents/subagent-transcript-drawer.js.map +1 -0
- package/dist/subagents/task-subagent-group.cjs +115 -0
- package/dist/subagents/task-subagent-group.cjs.map +1 -0
- package/dist/subagents/task-subagent-group.d.ts +36 -0
- package/dist/subagents/task-subagent-group.js +115 -0
- package/dist/subagents/task-subagent-group.js.map +1 -0
- package/dist/subagents/use-omitted-images-in-view.cjs +68 -0
- package/dist/subagents/use-omitted-images-in-view.cjs.map +1 -0
- package/dist/subagents/use-omitted-images-in-view.d.ts +21 -0
- package/dist/subagents/use-omitted-images-in-view.js +68 -0
- package/dist/subagents/use-omitted-images-in-view.js.map +1 -0
- package/dist/threads/Inbox.cjs +2 -2
- package/dist/threads/Inbox.cjs.map +1 -1
- package/dist/threads/SessionList.cjs +6 -6
- package/dist/threads/SessionList.cjs.map +1 -1
- package/dist/threads/SessionsPage.cjs +13 -7
- package/dist/threads/SessionsPage.cjs.map +1 -1
- package/dist/threads/SessionsPage.d.ts +10 -1
- package/dist/threads/SessionsPage.js +9 -3
- package/dist/threads/SessionsPage.js.map +1 -1
- package/dist/threads/session-list-model.cjs.map +1 -1
- package/dist/threads/session-list-model.d.ts +2 -1
- package/dist/threads/session-list-model.js.map +1 -1
- package/dist/threads/session-row-parts.cjs +3 -3
- package/dist/threads/session-row-parts.cjs.map +1 -1
- package/dist/threads/sessions-page-model.cjs +13 -5
- package/dist/threads/sessions-page-model.cjs.map +1 -1
- package/dist/threads/sessions-page-model.d.ts +7 -0
- package/dist/threads/sessions-page-model.js +11 -3
- package/dist/threads/sessions-page-model.js.map +1 -1
- package/dist/threads/sessions-page-storage.cjs +8 -8
- package/dist/threads/sessions-page-storage.cjs.map +1 -1
- package/dist/threads/sessions-page-storage.d.ts +5 -1
- package/dist/threads/sessions-page-storage.js +8 -8
- package/dist/threads/sessions-page-storage.js.map +1 -1
- package/dist/threads/statewire-thread-list.cjs +14 -2
- 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 +14 -2
- package/dist/threads/statewire-thread-list.js.map +1 -1
- package/dist/threads/use-athena-sessions.cjs +1 -0
- package/dist/threads/use-athena-sessions.cjs.map +1 -1
- package/dist/threads/use-athena-sessions.d.ts +7 -0
- package/dist/threads/use-athena-sessions.js +1 -0
- package/dist/threads/use-athena-sessions.js.map +1 -1
- package/dist/threads/use-athena-thread-agent.cjs +31 -0
- package/dist/threads/use-athena-thread-agent.cjs.map +1 -0
- package/dist/threads/use-athena-thread-agent.d.ts +38 -0
- package/dist/threads/use-athena-thread-agent.js +31 -0
- package/dist/threads/use-athena-thread-agent.js.map +1 -0
- package/dist/threads/use-athena-thread-plan-mode.cjs +18 -0
- package/dist/threads/use-athena-thread-plan-mode.cjs.map +1 -0
- package/dist/threads/use-athena-thread-plan-mode.d.ts +18 -0
- package/dist/threads/use-athena-thread-plan-mode.js +18 -0
- package/dist/threads/use-athena-thread-plan-mode.js.map +1 -0
- package/dist/threads/use-rest-conversation-history.d.ts +1 -0
- package/dist/tools/agent-creations.cjs +97 -0
- package/dist/tools/agent-creations.cjs.map +1 -0
- package/dist/tools/agent-creations.d.ts +38 -0
- package/dist/tools/agent-creations.js +97 -0
- package/dist/tools/agent-creations.js.map +1 -0
- package/dist/tools/agent-highlights.cjs +100 -0
- package/dist/tools/agent-highlights.cjs.map +1 -0
- package/dist/tools/agent-highlights.d.ts +57 -0
- package/dist/tools/agent-highlights.js +100 -0
- package/dist/tools/agent-highlights.js.map +1 -0
- package/dist/tools/append-document-tool-ui.cjs +1 -0
- package/dist/tools/append-document-tool-ui.cjs.map +1 -1
- package/dist/tools/append-document-tool-ui.d.ts +7 -0
- package/dist/tools/append-document-tool-ui.js +2 -1
- package/dist/tools/append-document-tool-ui.js.map +1 -1
- package/dist/tools/auto-open-tools.cjs +144 -71
- package/dist/tools/auto-open-tools.cjs.map +1 -1
- package/dist/tools/auto-open-tools.d.ts +131 -1
- package/dist/tools/auto-open-tools.js +145 -72
- package/dist/tools/auto-open-tools.js.map +1 -1
- package/dist/tools/browser-tool-uis.cjs +594 -0
- package/dist/tools/browser-tool-uis.cjs.map +1 -0
- package/dist/tools/browser-tool-uis.d.ts +8 -0
- package/dist/tools/browser-tool-uis.js +594 -0
- package/dist/tools/browser-tool-uis.js.map +1 -0
- package/dist/tools/computer-asset-tool-uis.cjs +313 -0
- package/dist/tools/computer-asset-tool-uis.cjs.map +1 -0
- package/dist/tools/computer-asset-tool-uis.d.ts +5 -0
- package/dist/tools/computer-asset-tool-uis.js +313 -0
- package/dist/tools/computer-asset-tool-uis.js.map +1 -0
- package/dist/tools/document-edit-tool-uis.cjs +218 -0
- package/dist/tools/document-edit-tool-uis.cjs.map +1 -0
- package/dist/tools/document-edit-tool-uis.d.ts +40 -0
- package/dist/tools/document-edit-tool-uis.js +218 -0
- package/dist/tools/document-edit-tool-uis.js.map +1 -0
- package/dist/tools/drive-tool-uis.cjs +429 -0
- package/dist/tools/drive-tool-uis.cjs.map +1 -0
- package/dist/tools/drive-tool-uis.d.ts +121 -0
- package/dist/tools/drive-tool-uis.js +429 -0
- package/dist/tools/drive-tool-uis.js.map +1 -0
- package/dist/tools/email-calendar-tool-uis.cjs +789 -0
- package/dist/tools/email-calendar-tool-uis.cjs.map +1 -0
- package/dist/tools/email-calendar-tool-uis.d.ts +129 -0
- package/dist/tools/email-calendar-tool-uis.js +789 -0
- package/dist/tools/email-calendar-tool-uis.js.map +1 -0
- package/dist/tools/ontology-tool-uis.cjs +83 -0
- package/dist/tools/ontology-tool-uis.cjs.map +1 -0
- package/dist/tools/ontology-tool-uis.d.ts +9 -0
- package/dist/tools/ontology-tool-uis.js +83 -0
- package/dist/tools/ontology-tool-uis.js.map +1 -0
- package/dist/tools/orchestration-tool-uis.cjs +586 -0
- package/dist/tools/orchestration-tool-uis.cjs.map +1 -0
- package/dist/tools/orchestration-tool-uis.d.ts +141 -0
- package/dist/tools/orchestration-tool-uis.js +586 -0
- package/dist/tools/orchestration-tool-uis.js.map +1 -0
- package/dist/tools/presentation-edit-tool-uis.cjs +516 -0
- package/dist/tools/presentation-edit-tool-uis.cjs.map +1 -0
- package/dist/tools/presentation-edit-tool-uis.d.ts +73 -0
- package/dist/tools/presentation-edit-tool-uis.js +516 -0
- package/dist/tools/presentation-edit-tool-uis.js.map +1 -0
- package/dist/tools/project-tool-uis.cjs +213 -0
- package/dist/tools/project-tool-uis.cjs.map +1 -0
- package/dist/tools/project-tool-uis.d.ts +14 -0
- package/dist/tools/project-tool-uis.js +213 -0
- package/dist/tools/project-tool-uis.js.map +1 -0
- package/dist/tools/sandbox-tool-uis.cjs +491 -0
- package/dist/tools/sandbox-tool-uis.cjs.map +1 -0
- package/dist/tools/sandbox-tool-uis.d.ts +116 -0
- package/dist/tools/sandbox-tool-uis.js +491 -0
- package/dist/tools/sandbox-tool-uis.js.map +1 -0
- package/dist/tools/sheet-query-tool-ui.cjs +138 -0
- package/dist/tools/sheet-query-tool-ui.cjs.map +1 -0
- package/dist/tools/sheet-query-tool-ui.d.ts +15 -0
- package/dist/tools/sheet-query-tool-ui.js +138 -0
- package/dist/tools/sheet-query-tool-ui.js.map +1 -0
- package/dist/tools/studio-screenshot-tool-uis.cjs +262 -0
- package/dist/tools/studio-screenshot-tool-uis.cjs.map +1 -0
- package/dist/tools/studio-screenshot-tool-uis.d.ts +52 -0
- package/dist/tools/studio-screenshot-tool-uis.js +262 -0
- package/dist/tools/studio-screenshot-tool-uis.js.map +1 -0
- package/dist/tools/subagent-task-tool-ui.cjs +24 -475
- package/dist/tools/subagent-task-tool-ui.cjs.map +1 -1
- package/dist/tools/subagent-task-tool-ui.d.ts +19 -103
- package/dist/tools/subagent-task-tool-ui.js +28 -479
- package/dist/tools/subagent-task-tool-ui.js.map +1 -1
- package/dist/tools/tool-summary.cjs +36 -0
- package/dist/tools/tool-summary.cjs.map +1 -1
- package/dist/tools/tool-summary.js +36 -0
- package/dist/tools/tool-summary.js.map +1 -1
- package/dist/tools/tool-uis.cjs +181 -53
- package/dist/tools/tool-uis.cjs.map +1 -1
- package/dist/tools/tool-uis.d.ts +40 -0
- package/dist/tools/tool-uis.js +183 -55
- package/dist/tools/tool-uis.js.map +1 -1
- package/dist/typed-interrupts/index.cjs +15 -0
- package/dist/typed-interrupts/index.cjs.map +1 -0
- package/dist/typed-interrupts/index.d.ts +20 -0
- package/dist/typed-interrupts/index.js +15 -0
- package/dist/typed-interrupts/index.js.map +1 -0
- package/dist/version.cjs +4 -0
- package/dist/version.cjs.map +1 -1
- package/dist/version.d.ts +9 -0
- package/dist/version.js +4 -0
- package/dist/version.js.map +1 -1
- package/dist/workbench/live-desktop-api.cjs +2 -1
- package/dist/workbench/live-desktop-api.cjs.map +1 -1
- package/dist/workbench/live-desktop-api.js +2 -1
- package/dist/workbench/live-desktop-api.js.map +1 -1
- package/dist/workbench/session-workbench-panes.cjs +6 -6
- package/dist/workbench/session-workbench-panes.cjs.map +1 -1
- package/dist/workbench/session-workspace-api.cjs +7 -2
- package/dist/workbench/session-workspace-api.cjs.map +1 -1
- package/dist/workbench/session-workspace-api.d.ts +10 -0
- package/dist/workbench/session-workspace-api.js +7 -2
- package/dist/workbench/session-workspace-api.js.map +1 -1
- package/package.json +28 -6
- package/dist/agent-runtime/src/chat-outbox-store.cjs +0 -510
- package/dist/agent-runtime/src/chat-outbox-store.cjs.map +0 -1
- package/dist/agent-runtime/src/chat-outbox-store.d.ts +0 -210
- package/dist/agent-runtime/src/chat-outbox-store.js +0 -510
- package/dist/agent-runtime/src/chat-outbox-store.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lane-follow.js","sources":["../../../../agent-runtime/src/lane-follow.ts"],"sourcesContent":["/**\n * Followed subagent lanes — the client half of agora's `follow` interest\n * (`message_window.follow_windows`).\n *\n * A running `task` card carries only its lane's newest steps (eight, with\n * `athena_lane_truncated` counting the rest). A request that adds\n * `follow: {before}` also covers the newest `before` steps of every lane a card\n * in its window names: the resolution gains `follows`\n * (`{ns: {chain, more, toolCallId}}`) and each step is its own `athena`\n * document, keyed `[threadId, ns, stepId]`.\n *\n * A lane is followed through a request anchored at its card alone\n * ({@link laneFollowRequest}), so following one lane pulls in no other and has\n * the attach's whole step allowance. {@link readDeepAgentFollowedWindow} reads\n * the followed steps back onto the card, so the card's tool-call part carries\n * the whole live lane as its nested thread; {@link useDeepAgentLaneFollowSync}\n * keeps the attach's follow requests to the running lanes a surface shows\n * ({@link createDeepAgentLaneFollowRegistry}). It follows only on a host whose\n * `protocol` lane advertises `DEEP_AGENT_LANE_FOLLOW_PROTOCOL_VERSION`; a host\n * that refuses `follow` anyway (`invalid-interest`, one predating it) keeps the\n * attach's windows, and the cards keep the steps their own documents carry.\n *\n * Surfaces opt in. A surface that follows nothing ships none of this and sees\n * the wire it saw before.\n */\nimport type { LangChainMessage } from '@assistant-ui/react-langgraph';\nimport type { StatewireThread } from '@assistant-ui/react-statewire';\nimport { useAuiState } from '@assistant-ui/store';\nimport { useEffect, useMemo, useRef, useState, useSyncExternalStore } from 'react';\nimport {\n DEEP_AGENT_FOLLOW_TOOL_CALL_ID_KEY,\n DEEP_AGENT_INTEREST_PROTOCOL,\n DEEP_AGENT_LANE_FOLLOW_PROTOCOL_VERSION,\n DEEP_AGENT_MAIN_NS,\n DEEP_AGENT_MAX_FOLLOWED_STEPS,\n DEEP_AGENT_MAX_INTERESTS,\n DEEP_AGENT_RUNNING_LANE_WIRE_MESSAGES,\n DEEP_AGENT_TRUNCATED_LANE_KEY,\n} from './generated/runconfig-contract';\nimport {\n type DeepAgentInterestRequest,\n type DeepAgentMessageWindow,\n readDeepAgentMessageWindow,\n} from './message-window';\nimport { readDeepAgentProtocol } from './protocol';\nimport { isRunningToolPlaceholder } from './running-tool-placeholder';\nimport { DEEP_AGENT_STATEWIRE_PROTOCOL } from './statewire-transport';\nimport { hasStatewireThreadExtras } from './thread-extras';\n\ntype MountedDocuments = Parameters<typeof readDeepAgentMessageWindow>[0];\n\nconst isRecord = (value: unknown): value is Record<string, unknown> =>\n typeof value === 'object' && value !== null && !Array.isArray(value);\n\nconst isCount = (value: unknown): value is number =>\n typeof value === 'number' && Number.isInteger(value) && value >= 0;\n\nconst stepId = (step: unknown): string | undefined => {\n const id = isRecord(step) ? step.id : undefined;\n return typeof id === 'string' ? id : undefined;\n};\n\n/** A request following the lane one `task` card holds. */\nexport interface DeepAgentLaneFollowRequest extends DeepAgentInterestRequest {\n readonly at: string;\n readonly follow: { readonly before: number };\n}\n\n/**\n * The request following the lane of the running `task` card `cardId`: the card\n * alone (`before: 1`), so its window names no other card's lane, with as many\n * of its lane's newest steps as one attach follows.\n */\nexport function laneFollowRequest(cardId: string): DeepAgentLaneFollowRequest {\n return {\n ns: DEEP_AGENT_MAIN_NS,\n before: 1,\n at: cardId,\n follow: { before: DEEP_AGENT_MAX_FOLLOWED_STEPS },\n };\n}\n\nexport function isLaneFollowRequest(\n request: DeepAgentInterestRequest\n): request is DeepAgentLaneFollowRequest {\n return request.follow !== undefined && request.at !== undefined;\n}\n\n/** What an attach follows, read off its mounted documents. */\nexport interface DeepAgentLaneFollows {\n /** The follow requests the attach holds whose card is still in the transcript. */\n readonly requests: readonly DeepAgentLaneFollowRequest[];\n /** Each followed lane's mounted steps, oldest first, by the `task` call whose card holds it. */\n readonly lanes: ReadonlyMap<string, readonly LangChainMessage[]>;\n}\n\nconst NO_FOLLOWS: DeepAgentLaneFollows = { requests: [], lanes: new Map() };\n\n/**\n * A follow request as the host echoes it, or `null` for any other window. A\n * card that left the transcript (its result replaced the running placeholder)\n * leaves its window empty in place: there is nothing left to follow.\n */\nfunction followRequestOf(window: Record<string, unknown>): DeepAgentLaneFollowRequest | null {\n const { ns, before, at, follow, chain } = window;\n if (ns !== DEEP_AGENT_MAIN_NS || typeof at !== 'string' || !isRecord(follow)) return null;\n if (!Array.isArray(chain) || chain.length === 0) return null;\n if (!isCount(before) || !isCount(follow.before)) return null;\n return { ns: DEEP_AGENT_MAIN_NS, before, at, follow: { before: follow.before } };\n}\n\n/**\n * The attach's follow requests and followed lanes. A step whose document is\n * not mounted is left out; a lane two windows follow is read from the deeper\n * one. A malformed window or step reads as absent.\n */\nexport function readDeepAgentLaneFollows(mounted: MountedDocuments): DeepAgentLaneFollows {\n if (mounted === undefined) return NO_FOLLOWS;\n let windows: readonly unknown[] | undefined;\n const steps = new Map<string, Map<string, LangChainMessage>>();\n for (const document of mounted.values()) {\n const key = document.key;\n if (document.protocol === DEEP_AGENT_INTEREST_PROTOCOL && document.main === true) {\n const value = document.value;\n if (isRecord(value) && Array.isArray(value.windows)) windows = value.windows;\n continue;\n }\n if (document.protocol !== DEEP_AGENT_STATEWIRE_PROTOCOL || key === null || key.length !== 3) {\n continue;\n }\n const [, ns, id] = key;\n if (typeof ns !== 'string' || ns === DEEP_AGENT_MAIN_NS || typeof id !== 'string') continue;\n let lane = steps.get(ns);\n if (lane === undefined) {\n lane = new Map();\n steps.set(ns, lane);\n }\n lane.set(id, document.value as LangChainMessage);\n }\n if (windows === undefined) return NO_FOLLOWS;\n const requests: DeepAgentLaneFollowRequest[] = [];\n const lanes = new Map<string, readonly LangChainMessage[]>();\n for (const window of windows) {\n if (!isRecord(window)) continue;\n const request = followRequestOf(window);\n if (request !== null) requests.push(request);\n if (!isRecord(window.follows)) continue;\n for (const [ns, follow] of Object.entries(window.follows)) {\n if (!isRecord(follow) || !Array.isArray(follow.chain)) continue;\n const toolCallId = follow[DEEP_AGENT_FOLLOW_TOOL_CALL_ID_KEY];\n if (typeof toolCallId !== 'string') continue;\n const lane = steps.get(ns);\n const ordered: LangChainMessage[] = [];\n for (const entry of follow.chain) {\n const id = stepId(entry);\n const step = id === undefined ? undefined : lane?.get(id);\n if (step !== undefined) ordered.push(step);\n }\n if (ordered.length > (lanes.get(toolCallId)?.length ?? 0)) lanes.set(toolCallId, ordered);\n }\n }\n return requests.length === 0 && lanes.size === 0 ? NO_FOLLOWS : { requests, lanes };\n}\n\n/**\n * A running card's transcript with its followed lane read in. A cut card\n * carries its lane's newest steps whole, led by its first `cutTurns` entries:\n * the older assistant turns that requested results among them, cut to those\n * calls. The merge is the followed steps older than the card's newest, then\n * the card's newest steps, then any followed step newer than all of them. The\n * card's newest copies are the fuller ones (a lane step's document leaves every\n * inline image a placeholder), and only the card carries a step without an id,\n * which no follow addresses; the follow holds the cut turns whole, with the\n * steps between them and the newest, and a cut turn it does not hold leads.\n */\nexport function mergeFollowedLane(\n carried: readonly unknown[],\n followed: readonly LangChainMessage[],\n cutTurns = 0\n): readonly unknown[] {\n const position = new Map<string, number>();\n for (const [index, step] of followed.entries()) {\n const id = stepId(step);\n if (id !== undefined) position.set(id, index);\n }\n const newest = carried.slice(cutTurns);\n const turns = carried.slice(0, cutTurns).filter((turn) => {\n const id = stepId(turn);\n return id === undefined || !position.has(id);\n });\n let first = followed.length;\n let last = -1;\n for (const step of newest) {\n const id = stepId(step);\n const at = id === undefined ? undefined : position.get(id);\n if (at === undefined) continue;\n first = Math.min(first, at);\n last = Math.max(last, at);\n }\n if (last < 0) {\n return carried.length === 0 ? followed : [...turns, ...followed, ...newest];\n }\n return [...turns, ...followed.slice(0, first), ...newest, ...followed.slice(last + 1)];\n}\n\n/** How many of a running card's carried entries are cut assistant turns ahead of its newest steps. */\nfunction cutTurnsOf(message: LangChainMessage, carried: readonly unknown[]): number {\n const marker = (message as Record<string, unknown>)[DEEP_AGENT_TRUNCATED_LANE_KEY];\n return isRecord(marker) ? Math.max(0, carried.length - DEEP_AGENT_RUNNING_LANE_WIRE_MESSAGES) : 0;\n}\n\nconst sameItems = (a: readonly unknown[], b: readonly unknown[]): boolean =>\n a.length === b.length && a.every((item, index) => item === b[index]);\n\n/** Each card read with its followed lane, by the card object, while its steps stand. */\nconst followedCards = new WeakMap<\n object,\n { readonly steps: readonly LangChainMessage[]; readonly card: LangChainMessage }\n>();\n\nfunction withFollowedLane(\n message: LangChainMessage,\n lanes: ReadonlyMap<string, readonly LangChainMessage[]>\n): LangChainMessage {\n if (message.type !== 'tool' || !isRunningToolPlaceholder(message)) return message;\n const steps = lanes.get(message.tool_call_id);\n if (steps === undefined || steps.length === 0) return message;\n const kept = followedCards.get(message);\n if (kept !== undefined && sameItems(kept.steps, steps)) return kept.card;\n const artifact: Record<string, unknown> = isRecord(message.artifact) ? message.artifact : {};\n const state = isRecord(artifact.subgraph_state) ? artifact.subgraph_state : {};\n const carried: readonly unknown[] = Array.isArray(state.messages) ? state.messages : [];\n const card: LangChainMessage = {\n ...message,\n artifact: {\n ...artifact,\n subgraph_state: {\n ...state,\n messages: mergeFollowedLane(carried, steps, cutTurnsOf(message, carried)),\n },\n },\n };\n followedCards.set(message, { steps, card });\n return card;\n}\n\n/**\n * {@link readDeepAgentMessageWindow} with the attach's followed lanes read in.\n * The follow requests ride at the end of `requests`, so a restatement built\n * from this window (the thread's head widening, a page of older history) keeps\n * them: the joined view never counts them as pages. Each running card a follow\n * covers carries its lane's followed steps as its transcript, kept as the same\n * object while its steps stand. Without follows, the window is\n * {@link readDeepAgentMessageWindow}'s own.\n */\nexport function readDeepAgentFollowedWindow(\n mounted: MountedDocuments\n): DeepAgentMessageWindow | null {\n const window = readDeepAgentMessageWindow(mounted);\n if (window === null) return null;\n const follows = readDeepAgentLaneFollows(mounted);\n if (follows === NO_FOLLOWS) return window;\n return {\n ...window,\n requests: [...window.requests, ...follows.requests],\n messages:\n follows.lanes.size === 0\n ? window.messages\n : window.messages.map((message) => withFollowedLane(message, follows.lanes)),\n };\n}\n\n/**\n * The lanes a surface shows (an open transcript drawer's), by the `task` call\n * whose card holds each: what {@link useDeepAgentLaneFollowSync} follows.\n */\nexport interface DeepAgentLaneFollowRegistry {\n /** Follow the lane of the `task` call `toolCallId` until the returned release is called. */\n follow(toolCallId: string): () => void;\n subscribe(listener: () => void): () => void;\n /** The `task` calls whose lanes are followed; a new set on every change. */\n getSnapshot(): ReadonlySet<string>;\n}\n\nexport function createDeepAgentLaneFollowRegistry(): DeepAgentLaneFollowRegistry {\n const holds = new Map<string, number>();\n const listeners = new Set<() => void>();\n let snapshot: ReadonlySet<string> = new Set();\n const publish = () => {\n snapshot = new Set(holds.keys());\n for (const listener of listeners) listener();\n };\n return {\n follow(toolCallId) {\n const held = holds.get(toolCallId) ?? 0;\n holds.set(toolCallId, held + 1);\n if (held === 0) publish();\n let released = false;\n return () => {\n if (released) return;\n released = true;\n const left = (holds.get(toolCallId) ?? 1) - 1;\n if (left > 0) {\n holds.set(toolCallId, left);\n return;\n }\n holds.delete(toolCallId);\n publish();\n };\n },\n subscribe(listener) {\n listeners.add(listener);\n return () => {\n listeners.delete(listener);\n };\n },\n getSnapshot: () => snapshot,\n };\n}\n\n/** Follows the lane of `toolCallId` while `active` (a drawer open on a running lane). */\nexport function useDeepAgentLaneFollow(\n registry: DeepAgentLaneFollowRegistry | null,\n toolCallId: string,\n active: boolean\n): void {\n useEffect(() => {\n if (registry === null || !active) return undefined;\n return registry.follow(toolCallId);\n }, [registry, toolCallId, active]);\n}\n\n/** The follow requests for the running cards of the followed lanes, in transcript order. */\nfunction laneFollowRequestsFor(\n window: DeepAgentMessageWindow,\n followed: ReadonlySet<string>\n): DeepAgentLaneFollowRequest[] {\n if (followed.size === 0) return [];\n const requests: DeepAgentLaneFollowRequest[] = [];\n for (const message of window.messages) {\n if (message.type !== 'tool' || !followed.has(message.tool_call_id)) continue;\n if (typeof message.id !== 'string' || !isRunningToolPlaceholder(message)) continue;\n requests.push(laneFollowRequest(message.id));\n }\n return requests;\n}\n\nconst followKey = (request: DeepAgentInterestRequest): string =>\n `${request.at}:${request.follow?.before}`;\n\nconst sameLaneFollows = (\n held: readonly DeepAgentInterestRequest[],\n wanted: readonly DeepAgentInterestRequest[]\n): boolean =>\n held.length === wanted.length &&\n wanted.every((request) => held.some((have) => followKey(have) === followKey(request)));\n\n/** The code a host refused a statement with (`StatewireSendError.failure`), if any. */\nconst rejectionCode = (error: unknown): string | undefined => {\n const failure = isRecord(error) ? error.failure : undefined;\n return isRecord(failure) && failure.fate === 'rejected' && typeof failure.code === 'string'\n ? failure.code\n : undefined;\n};\n\nconst noopSubscribe = () => () => {};\n\nexport interface UseDeepAgentLaneFollowSyncOptions {\n /** The lanes the surface shows. */\n registry: DeepAgentLaneFollowRegistry;\n /**\n * Another statement on the interest lane is in flight (a page of older\n * history): wait for it, so neither statement drops what the other adds.\n */\n paused?: boolean;\n /**\n * A follow statement failed. A host that does not serve `follow` is not a\n * failure: the cards keep the lanes their own documents carry.\n */\n onError?: ((error: unknown) => void) | undefined;\n}\n\n/**\n * Keeps the attach's follow requests to the running lanes the registry holds,\n * once per change, on a host whose `protocol` lane advertises at least\n * `DEEP_AGENT_LANE_FOLLOW_PROTOCOL_VERSION`. A statement restates the\n * attach's other requests as the window holds them, with the follows after\n * them, inside the host's interest cap; a statement elsewhere that left a\n * follow out (a page of older history) is answered by stating it again.\n *\n * Never a retry loop: a statement is not sent again unchanged on the same\n * connection. A host that refuses `follow` (`invalid-interest`, one that\n * predates it) keeps the attach's windows, and nothing is followed on that\n * connection again; a card that left the transcript first (`unknown-message`)\n * is not followed until the transcript moves.\n */\nexport function useDeepAgentLaneFollowSync({\n registry,\n paused = false,\n onError,\n}: UseDeepAgentLaneFollowSyncOptions): void {\n const { invoke, connection, documents } = useAuiState((s) => {\n if (!hasStatewireThreadExtras(s.thread.extras)) {\n throw new Error('useDeepAgentLaneFollowSync requires a statewire thread');\n }\n return s.thread.extras as StatewireThread.Extras;\n });\n const hostVersion = useAuiState((s) => {\n const extras = s.thread.extras as Partial<StatewireThread.Extras> | undefined;\n return readDeepAgentProtocol(extras?.state)?.version ?? 0;\n });\n const mounted = useSyncExternalStore(\n documents?.subscribe ?? noopSubscribe,\n () => documents?.list(),\n () => documents?.list()\n );\n const window = useMemo(() => readDeepAgentFollowedWindow(mounted), [mounted]);\n const followed = useSyncExternalStore(\n registry.subscribe,\n registry.getSnapshot,\n registry.getSnapshot\n );\n const [settled, setSettled] = useState(0);\n const inflightRef = useRef(false);\n const aliveRef = useRef(true);\n // The connection whose host refused `follow`, and the last statement sent on a connection.\n const unservedRef = useRef<unknown>(null);\n const lastStatedRef = useRef<{ connection: unknown; key: string } | null>(null);\n const onErrorRef = useRef(onError);\n onErrorRef.current = onError;\n\n useEffect(() => {\n aliveRef.current = true;\n return () => {\n aliveRef.current = false;\n };\n }, []);\n\n // biome-ignore lint/correctness/useExhaustiveDependencies: `settled` re-runs the check once a statement settles.\n useEffect(() => {\n if (window === null || paused || inflightRef.current) return;\n if (connection.status !== 'connected') return;\n const served =\n hostVersion >= DEEP_AGENT_LANE_FOLLOW_PROTOCOL_VERSION && unservedRef.current !== connection;\n const others = window.requests.filter((request) => !isLaneFollowRequest(request));\n const held = window.requests.filter(isLaneFollowRequest);\n const wanted = served\n ? laneFollowRequestsFor(window, followed).slice(\n 0,\n Math.max(0, DEEP_AGENT_MAX_INTERESTS - others.length)\n )\n : [];\n if (sameLaneFollows(held, wanted)) return;\n const requests = [...others, ...wanted];\n const key = JSON.stringify(requests);\n const last = lastStatedRef.current;\n if (last !== null && last.connection === connection && last.key === key) return;\n lastStatedRef.current = { connection, key };\n inflightRef.current = true;\n invoke(DEEP_AGENT_INTEREST_PROTOCOL, 'set', [requests])\n .catch((error: unknown) => {\n const code = rejectionCode(error);\n if (code === 'invalid-interest' && wanted.length > 0) {\n unservedRef.current = connection;\n return;\n }\n if (code !== 'unknown-message') onErrorRef.current?.(error);\n })\n .finally(() => {\n inflightRef.current = false;\n if (aliveRef.current) setSettled((count) => count + 1);\n });\n }, [window, followed, hostVersion, connection, invoke, paused, settled]);\n}\n"],"names":[],"mappings":";;;;;;;;AAmDA,MAAM,WAAW,CAAC,UAChB,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,KAAK;AAErE,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
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const store = require("@assistant-ui/store");
|
|
4
|
+
const reactQuery = require("@tanstack/react-query");
|
|
5
|
+
const require$$0 = require("react");
|
|
6
|
+
const runconfigContract = require("./generated/runconfig-contract.cjs");
|
|
7
|
+
const threadExtras = require("./thread-extras.cjs");
|
|
8
|
+
const isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
9
|
+
const isCount = (value) => typeof value === "number" && Number.isInteger(value) && value >= 0;
|
|
10
|
+
function buildHistoryLaneImageCommand({
|
|
11
|
+
target,
|
|
12
|
+
step,
|
|
13
|
+
index,
|
|
14
|
+
offset = 0
|
|
15
|
+
}) {
|
|
16
|
+
return {
|
|
17
|
+
type: runconfigContract.DEEP_AGENT_HISTORY_LANE_IMAGE_COMMAND,
|
|
18
|
+
...target.lane !== void 0 ? { lane: target.lane } : { messageId: target.messageId },
|
|
19
|
+
step,
|
|
20
|
+
index,
|
|
21
|
+
...offset > 0 && { offset }
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
function readInlineImageChunk(payload) {
|
|
25
|
+
if (!isRecord(payload)) return null;
|
|
26
|
+
const { index, mediaType, offset, total, chunk, next } = payload;
|
|
27
|
+
if (!isCount(index) || !isCount(offset) || !isCount(total) || typeof chunk !== "string") {
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
if (next !== null && !isCount(next)) return null;
|
|
31
|
+
if (mediaType !== void 0 && mediaType !== null && typeof mediaType !== "string") return null;
|
|
32
|
+
return { index, mediaType: mediaType ?? null, offset, total, chunk, next };
|
|
33
|
+
}
|
|
34
|
+
const nonEmpty = (value) => typeof value === "string" && value ? value : null;
|
|
35
|
+
function readHistoryLaneImageChunk(payload) {
|
|
36
|
+
const chunk = readInlineImageChunk(payload);
|
|
37
|
+
if (chunk === null || !isRecord(payload)) return null;
|
|
38
|
+
const messageId = nonEmpty(payload.messageId);
|
|
39
|
+
const lane = nonEmpty(payload.lane);
|
|
40
|
+
const step = nonEmpty(payload.step);
|
|
41
|
+
if (messageId === null === (lane === null) || step === null) return null;
|
|
42
|
+
return { ...chunk, messageId, lane, step };
|
|
43
|
+
}
|
|
44
|
+
const MAX_IMAGE_CHUNKS = 128;
|
|
45
|
+
const abortReason = (signal) => signal.reason ?? new DOMException("The image read was cancelled.", "AbortError");
|
|
46
|
+
function unlessCancelled(promise, signal) {
|
|
47
|
+
if (signal === void 0) return promise;
|
|
48
|
+
if (signal.aborted) return Promise.reject(abortReason(signal));
|
|
49
|
+
return new Promise((resolve, reject) => {
|
|
50
|
+
const onAbort = () => reject(abortReason(signal));
|
|
51
|
+
signal.addEventListener("abort", onAbort, { once: true });
|
|
52
|
+
promise.then(
|
|
53
|
+
(value) => {
|
|
54
|
+
signal.removeEventListener("abort", onAbort);
|
|
55
|
+
resolve(value);
|
|
56
|
+
},
|
|
57
|
+
(error) => {
|
|
58
|
+
signal.removeEventListener("abort", onAbort);
|
|
59
|
+
reject(error);
|
|
60
|
+
}
|
|
61
|
+
);
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
async function readChunkedInlineImage({
|
|
65
|
+
read,
|
|
66
|
+
signal
|
|
67
|
+
}) {
|
|
68
|
+
const chunks = [];
|
|
69
|
+
let offset = 0;
|
|
70
|
+
let total = null;
|
|
71
|
+
let mediaType = null;
|
|
72
|
+
for (let count = 0; count < MAX_IMAGE_CHUNKS; count += 1) {
|
|
73
|
+
if (signal == null ? void 0 : signal.aborted) throw abortReason(signal);
|
|
74
|
+
const answer = await unlessCancelled(read(offset), signal);
|
|
75
|
+
if (answer.offset !== offset || total !== null && answer.total !== total) {
|
|
76
|
+
throw new Error("the image chunk does not continue the image");
|
|
77
|
+
}
|
|
78
|
+
total = answer.total;
|
|
79
|
+
mediaType = answer.mediaType ?? mediaType;
|
|
80
|
+
const end = offset + answer.chunk.length;
|
|
81
|
+
if (answer.chunk.length === 0 || end > total) {
|
|
82
|
+
throw new Error("the image chunk does not fit the image");
|
|
83
|
+
}
|
|
84
|
+
chunks.push(answer.chunk);
|
|
85
|
+
if (answer.next === null) {
|
|
86
|
+
if (end !== total) throw new Error("the image ended before its total");
|
|
87
|
+
const url = chunks.join("");
|
|
88
|
+
if (!url.startsWith("data:")) throw new Error("the image is not a data: URL");
|
|
89
|
+
return { url, mediaType };
|
|
90
|
+
}
|
|
91
|
+
if (answer.next !== end) throw new Error("the next image chunk is not where this one ends");
|
|
92
|
+
offset = end;
|
|
93
|
+
}
|
|
94
|
+
throw new Error(`the image takes more than ${MAX_IMAGE_CHUNKS} chunks`);
|
|
95
|
+
}
|
|
96
|
+
const NO_OMITTED_IMAGES = [];
|
|
97
|
+
function omittedIndex(block) {
|
|
98
|
+
if (!isRecord(block)) return void 0;
|
|
99
|
+
const marker = block[runconfigContract.DEEP_AGENT_OMITTED_IMAGE_KEY];
|
|
100
|
+
return isRecord(marker) && isCount(marker.index) ? marker.index : void 0;
|
|
101
|
+
}
|
|
102
|
+
const omittedByStep = /* @__PURE__ */ new WeakMap();
|
|
103
|
+
function omittedImagesOfStep(step) {
|
|
104
|
+
const cached = omittedByStep.get(step);
|
|
105
|
+
if (cached !== void 0) return cached;
|
|
106
|
+
const id = step.id;
|
|
107
|
+
const content = step.content;
|
|
108
|
+
let images = null;
|
|
109
|
+
if (typeof id === "string" && id && Array.isArray(content)) {
|
|
110
|
+
for (const block of content) {
|
|
111
|
+
const index = omittedIndex(block);
|
|
112
|
+
if (index === void 0) continue;
|
|
113
|
+
images ?? (images = []);
|
|
114
|
+
images.push({ step: id, index });
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
const found = images ?? NO_OMITTED_IMAGES;
|
|
118
|
+
omittedByStep.set(step, found);
|
|
119
|
+
return found;
|
|
120
|
+
}
|
|
121
|
+
function omittedLaneImages(steps) {
|
|
122
|
+
let images = null;
|
|
123
|
+
for (const step of steps) {
|
|
124
|
+
const own = omittedImagesOfStep(step);
|
|
125
|
+
if (own.length === 0) continue;
|
|
126
|
+
images ?? (images = []);
|
|
127
|
+
images.push(...own);
|
|
128
|
+
}
|
|
129
|
+
return images ?? NO_OMITTED_IMAGES;
|
|
130
|
+
}
|
|
131
|
+
const laneImageKey = ({ step, index }) => `${index}:${step}`;
|
|
132
|
+
const TILE_FRAGMENT = "#athena-lane-image=";
|
|
133
|
+
function readLaneImageTile(src) {
|
|
134
|
+
if (typeof src !== "string" || !src.startsWith("data:")) return null;
|
|
135
|
+
const at = src.lastIndexOf(TILE_FRAGMENT);
|
|
136
|
+
if (at < 0) return null;
|
|
137
|
+
let key;
|
|
138
|
+
try {
|
|
139
|
+
key = decodeURIComponent(src.slice(at + TILE_FRAGMENT.length));
|
|
140
|
+
} catch {
|
|
141
|
+
return null;
|
|
142
|
+
}
|
|
143
|
+
const colon = key.indexOf(":");
|
|
144
|
+
const index = Number(key.slice(0, colon));
|
|
145
|
+
const step = key.slice(colon + 1);
|
|
146
|
+
return colon > 0 && isCount(index) && step ? { step, index } : null;
|
|
147
|
+
}
|
|
148
|
+
function blockWithTile(block, image) {
|
|
149
|
+
const tag = `${TILE_FRAGMENT}${encodeURIComponent(laneImageKey(image))}`;
|
|
150
|
+
const tagged = (value) => typeof value === "string" && !value.includes(TILE_FRAGMENT) ? `${value}${tag}` : null;
|
|
151
|
+
if (block.type === "image_url") {
|
|
152
|
+
const slot = block.image_url;
|
|
153
|
+
const url2 = tagged(isRecord(slot) ? slot.url : slot);
|
|
154
|
+
if (url2 === null) return block;
|
|
155
|
+
return { ...block, image_url: isRecord(slot) ? { ...slot, url: url2 } : url2 };
|
|
156
|
+
}
|
|
157
|
+
if (block.type !== "image") return block;
|
|
158
|
+
const source = block.source;
|
|
159
|
+
if (isRecord(source) && source.type === "base64") {
|
|
160
|
+
const data = tagged(source.data);
|
|
161
|
+
return data === null ? block : { ...block, source: { ...source, data } };
|
|
162
|
+
}
|
|
163
|
+
if (typeof block.base64 === "string") {
|
|
164
|
+
const base64 = tagged(block.base64);
|
|
165
|
+
return base64 === null ? block : { ...block, base64 };
|
|
166
|
+
}
|
|
167
|
+
if (block.source_type === "base64" && typeof block.data === "string") {
|
|
168
|
+
const data = tagged(block.data);
|
|
169
|
+
return data === null ? block : { ...block, data };
|
|
170
|
+
}
|
|
171
|
+
const url = tagged(block.url);
|
|
172
|
+
return url === null ? block : { ...block, url };
|
|
173
|
+
}
|
|
174
|
+
function blockWithImage(block, url) {
|
|
175
|
+
const { [runconfigContract.DEEP_AGENT_OMITTED_IMAGE_KEY]: _omitted, ...rest } = block;
|
|
176
|
+
if (block.type === "image_url") {
|
|
177
|
+
const slot = block.image_url;
|
|
178
|
+
if (typeof slot === "string") return { ...rest, image_url: url };
|
|
179
|
+
return isRecord(slot) ? { ...rest, image_url: { ...slot, url } } : null;
|
|
180
|
+
}
|
|
181
|
+
if (block.type !== "image") return null;
|
|
182
|
+
const comma = url.indexOf(",");
|
|
183
|
+
const header = comma < 0 ? "" : url.slice(5, comma);
|
|
184
|
+
const base64 = header.endsWith(";base64");
|
|
185
|
+
const mediaType = header.split(";")[0] || null;
|
|
186
|
+
const payload = url.slice(comma + 1);
|
|
187
|
+
const source = block.source;
|
|
188
|
+
if (isRecord(source) && source.type === "base64") {
|
|
189
|
+
if (!base64) return null;
|
|
190
|
+
return {
|
|
191
|
+
...rest,
|
|
192
|
+
source: { ...source, media_type: mediaType ?? source.media_type, data: payload }
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
if (typeof block.base64 === "string") {
|
|
196
|
+
if (!base64) return null;
|
|
197
|
+
return { ...rest, base64: payload, ...mediaType !== null && { mime_type: mediaType } };
|
|
198
|
+
}
|
|
199
|
+
if (block.source_type === "base64" && typeof block.data === "string") {
|
|
200
|
+
if (!base64) return null;
|
|
201
|
+
return { ...rest, data: payload, ...mediaType !== null && { mime_type: mediaType } };
|
|
202
|
+
}
|
|
203
|
+
return typeof block.url === "string" ? { ...rest, url } : null;
|
|
204
|
+
}
|
|
205
|
+
const shownSteps = /* @__PURE__ */ new WeakMap();
|
|
206
|
+
function stepShown(step, images) {
|
|
207
|
+
const omitted = omittedImagesOfStep(step);
|
|
208
|
+
const stored = step.content;
|
|
209
|
+
const id = step.id;
|
|
210
|
+
if (omitted.length === 0 || !Array.isArray(stored) || typeof id !== "string") return step;
|
|
211
|
+
const read = omitted.map((image) => images.get(laneImageKey(image)));
|
|
212
|
+
const cached = shownSteps.get(step);
|
|
213
|
+
if (cached !== void 0 && cached.images.length === read.length && cached.images.every((image, position) => image === read[position])) {
|
|
214
|
+
return cached.step;
|
|
215
|
+
}
|
|
216
|
+
const content = stored.map((block) => {
|
|
217
|
+
const index = omittedIndex(block);
|
|
218
|
+
if (index === void 0 || !isRecord(block)) return block;
|
|
219
|
+
const image = images.get(laneImageKey({ step: id, index }));
|
|
220
|
+
if (image !== void 0) {
|
|
221
|
+
const restored = blockWithImage(block, image.url);
|
|
222
|
+
if (restored !== null) return restored;
|
|
223
|
+
}
|
|
224
|
+
return blockWithTile(block, { step: id, index });
|
|
225
|
+
});
|
|
226
|
+
const shown = { ...step, content };
|
|
227
|
+
shownSteps.set(step, { images: read, step: shown });
|
|
228
|
+
return shown;
|
|
229
|
+
}
|
|
230
|
+
function showLaneImages({
|
|
231
|
+
steps,
|
|
232
|
+
images
|
|
233
|
+
}) {
|
|
234
|
+
let changed = false;
|
|
235
|
+
const shown = steps.map((step) => {
|
|
236
|
+
const next = stepShown(step, images);
|
|
237
|
+
if (next !== step) changed = true;
|
|
238
|
+
return next;
|
|
239
|
+
});
|
|
240
|
+
return changed ? shown : steps;
|
|
241
|
+
}
|
|
242
|
+
const MAX_CONCURRENT_IMAGE_READS = 2;
|
|
243
|
+
let imageReads = 0;
|
|
244
|
+
const waitingImageReads = [];
|
|
245
|
+
function waitForImageRead(signal) {
|
|
246
|
+
return new Promise((resolve, reject) => {
|
|
247
|
+
const onAbort = () => {
|
|
248
|
+
const position = waitingImageReads.indexOf(wake);
|
|
249
|
+
if (position >= 0) waitingImageReads.splice(position, 1);
|
|
250
|
+
reject(signal === void 0 ? void 0 : abortReason(signal));
|
|
251
|
+
};
|
|
252
|
+
const wake = () => {
|
|
253
|
+
signal == null ? void 0 : signal.removeEventListener("abort", onAbort);
|
|
254
|
+
resolve();
|
|
255
|
+
};
|
|
256
|
+
if (signal == null ? void 0 : signal.aborted) {
|
|
257
|
+
reject(abortReason(signal));
|
|
258
|
+
return;
|
|
259
|
+
}
|
|
260
|
+
waitingImageReads.push(wake);
|
|
261
|
+
signal == null ? void 0 : signal.addEventListener("abort", onAbort, { once: true });
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
async function withImageRead(signal, read) {
|
|
265
|
+
var _a;
|
|
266
|
+
while (imageReads >= MAX_CONCURRENT_IMAGE_READS) await waitForImageRead(signal);
|
|
267
|
+
imageReads += 1;
|
|
268
|
+
try {
|
|
269
|
+
return await read();
|
|
270
|
+
} finally {
|
|
271
|
+
imageReads -= 1;
|
|
272
|
+
(_a = waitingImageReads.shift()) == null ? void 0 : _a();
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
const answersImage = (answer, { target, step, index }) => answer.step === step && answer.index === index && (target.lane !== void 0 ? answer.lane === target.lane : answer.messageId === target.messageId);
|
|
276
|
+
function readLaneImage({
|
|
277
|
+
sendCommand,
|
|
278
|
+
target,
|
|
279
|
+
step,
|
|
280
|
+
index,
|
|
281
|
+
signal
|
|
282
|
+
}) {
|
|
283
|
+
return readChunkedInlineImage({
|
|
284
|
+
signal,
|
|
285
|
+
read: async (offset) => {
|
|
286
|
+
const answer = readHistoryLaneImageChunk(
|
|
287
|
+
await sendCommand(buildHistoryLaneImageCommand({ target, step, index, offset }))
|
|
288
|
+
);
|
|
289
|
+
if (answer === null || !answersImage(answer, { target, step, index })) {
|
|
290
|
+
throw new Error("history/lane_image answered another image");
|
|
291
|
+
}
|
|
292
|
+
return answer;
|
|
293
|
+
}
|
|
294
|
+
});
|
|
295
|
+
}
|
|
296
|
+
const laneTargetKey = (target) => target.lane !== void 0 ? `lane:${target.lane}` : `card:${target.messageId}`;
|
|
297
|
+
const deepAgentLaneImageQueryKey = ({
|
|
298
|
+
target,
|
|
299
|
+
step,
|
|
300
|
+
index
|
|
301
|
+
}) => ["athena-deep-agent", "history-lane-image", target, step, index];
|
|
302
|
+
const NO_IMAGES_ASKED = /* @__PURE__ */ new Set();
|
|
303
|
+
function useDeepAgentLaneImages({
|
|
304
|
+
messageId,
|
|
305
|
+
lane,
|
|
306
|
+
steps
|
|
307
|
+
}) {
|
|
308
|
+
const sendCommand = store.useAuiState(
|
|
309
|
+
(s) => threadExtras.hasStatewireThreadExtras(s.thread.extras) ? s.thread.extras.sendCommand : void 0
|
|
310
|
+
);
|
|
311
|
+
const sendRef = require$$0.useRef(sendCommand);
|
|
312
|
+
sendRef.current = sendCommand;
|
|
313
|
+
const target = require$$0.useMemo(
|
|
314
|
+
() => lane !== void 0 ? { lane } : messageId !== void 0 ? { messageId } : void 0,
|
|
315
|
+
[lane, messageId]
|
|
316
|
+
);
|
|
317
|
+
const omitted = require$$0.useMemo(() => omittedLaneImages(steps), [steps]);
|
|
318
|
+
const [asked, setAsked] = require$$0.useState(NO_IMAGES_ASKED);
|
|
319
|
+
const kept = require$$0.useRef(/* @__PURE__ */ new Map());
|
|
320
|
+
const readable = target !== void 0 && sendCommand !== void 0;
|
|
321
|
+
const reads = require$$0.useMemo(
|
|
322
|
+
() => readable ? omitted.filter((image) => asked.has(laneImageKey(image))) : NO_OMITTED_IMAGES,
|
|
323
|
+
[readable, omitted, asked]
|
|
324
|
+
);
|
|
325
|
+
const results = reactQuery.useQueries({
|
|
326
|
+
queries: reads.map((image) => ({
|
|
327
|
+
queryKey: deepAgentLaneImageQueryKey({
|
|
328
|
+
target: target === void 0 ? "" : laneTargetKey(target),
|
|
329
|
+
step: image.step,
|
|
330
|
+
index: image.index
|
|
331
|
+
}),
|
|
332
|
+
queryFn: ({ signal }) => {
|
|
333
|
+
const send = sendRef.current;
|
|
334
|
+
if (target === void 0 || send === void 0) {
|
|
335
|
+
return Promise.reject(new Error("no statewire thread to read the image from"));
|
|
336
|
+
}
|
|
337
|
+
return withImageRead(
|
|
338
|
+
signal,
|
|
339
|
+
() => readLaneImage({ sendCommand: send, target, step: image.step, index: image.index, signal })
|
|
340
|
+
);
|
|
341
|
+
},
|
|
342
|
+
initialData: () => kept.current.get(laneImageKey(image)),
|
|
343
|
+
retry: false,
|
|
344
|
+
retryOnMount: false,
|
|
345
|
+
staleTime: Number.POSITIVE_INFINITY,
|
|
346
|
+
refetchOnMount: false,
|
|
347
|
+
refetchOnWindowFocus: false,
|
|
348
|
+
refetchOnReconnect: false
|
|
349
|
+
})),
|
|
350
|
+
// Shared structurally: the same images read give back the same list.
|
|
351
|
+
combine: (answers) => answers.flatMap((answer, position) => {
|
|
352
|
+
const image = reads[position];
|
|
353
|
+
return image !== void 0 && answer.data !== void 0 ? [{ key: laneImageKey(image), image: answer.data }] : [];
|
|
354
|
+
})
|
|
355
|
+
});
|
|
356
|
+
const images = require$$0.useMemo(
|
|
357
|
+
() => new Map(results.map(({ key, image }) => [key, image])),
|
|
358
|
+
[results]
|
|
359
|
+
);
|
|
360
|
+
require$$0.useEffect(() => {
|
|
361
|
+
for (const [key, image] of images) kept.current.set(key, image);
|
|
362
|
+
}, [images]);
|
|
363
|
+
const shown = require$$0.useMemo(() => showLaneImages({ steps, images }), [steps, images]);
|
|
364
|
+
const pending = readable && omitted.some((image) => !asked.has(laneImageKey(image)));
|
|
365
|
+
const request = require$$0.useCallback((image) => {
|
|
366
|
+
const key = laneImageKey(image);
|
|
367
|
+
setAsked((previous) => {
|
|
368
|
+
if (previous.has(key)) return previous;
|
|
369
|
+
const next = new Set(previous);
|
|
370
|
+
next.add(key);
|
|
371
|
+
return next;
|
|
372
|
+
});
|
|
373
|
+
}, []);
|
|
374
|
+
return { steps: shown, pending, request };
|
|
375
|
+
}
|
|
376
|
+
exports.buildHistoryLaneImageCommand = buildHistoryLaneImageCommand;
|
|
377
|
+
exports.deepAgentLaneImageQueryKey = deepAgentLaneImageQueryKey;
|
|
378
|
+
exports.laneImageKey = laneImageKey;
|
|
379
|
+
exports.omittedLaneImages = omittedLaneImages;
|
|
380
|
+
exports.readChunkedInlineImage = readChunkedInlineImage;
|
|
381
|
+
exports.readHistoryLaneImageChunk = readHistoryLaneImageChunk;
|
|
382
|
+
exports.readInlineImageChunk = readInlineImageChunk;
|
|
383
|
+
exports.readLaneImage = readLaneImage;
|
|
384
|
+
exports.readLaneImageTile = readLaneImageTile;
|
|
385
|
+
exports.showLaneImages = showLaneImages;
|
|
386
|
+
exports.useDeepAgentLaneImages = useDeepAgentLaneImages;
|
|
387
|
+
//# sourceMappingURL=lane-images.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lane-images.cjs","sources":["../../../../agent-runtime/src/lane-images.ts"],"sourcesContent":["/**\n * A lane step's inline images on demand — the client half of agora's\n * `history/lane_image` read command.\n *\n * A subagent lane's steps ride (on a cut card, on an in-eval lane's registry\n * entry, and in every `history/lane` page) with each inline image left off: the\n * block keeps its own shape with a neutral PNG tile in its payload slot\n * (`DEEP_AGENT_OMITTED_IMAGE_PLACEHOLDER_URL`) and\n * `athena_image_omitted: {index, chars, mediaType}` beside it, `index` being\n * the block's position in the stored step's content. `history/lane_image`\n * `{messageId | lane, step, index, offset?}` answers that image's `data:` URL\n * in chunks, exactly as `history/image` answers a top-level message's:\n * `{messageId, lane, step, index, mediaType, offset, total, chunk, next}`, the\n * chunks joined in order being the URL and `next` the offset to ask for next\n * (`null` after the last). {@link readChunkedInlineImage} is that loop, for\n * either command.\n *\n * {@link useDeepAgentLaneImages} reads a lane's images for a surface that\n * shows its steps, lazily, one image at a time as its tile comes into view.\n * The steps it hands back carry each image read so far in its block, and each\n * placeholder still waiting tagged with the image it stands for: its payload\n * slot keeps the tile, with a `#athena-lane-image=` fragment naming the step\n * and index ({@link readLaneImageTile}). A `data:` URL's fragment is no part of\n * its data, so the tile still draws, and whatever card draws it, the `<img>`\n * names its own image. Nothing is read until the surface reports a tile\n * (`request`); each image is one TanStack query cached per (card | lane, step,\n * index), and at most two are read at a time. Any refusal (an older pod's\n * unknown command, an unknown card or lane, a step the lane does not hold, no\n * inline image at that index, an offset past its end) leaves that image's\n * tile: no error, and no second ask while the refusal is cached.\n *\n * Surfaces opt in. A surface that reads no lane image ships none of this.\n */\nimport type { LangChainMessage } from '@assistant-ui/react-langgraph';\nimport type { StatewireThread } from '@assistant-ui/react-statewire';\nimport { useAuiState } from '@assistant-ui/store';\nimport { useQueries } from '@tanstack/react-query';\nimport { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport {\n DEEP_AGENT_HISTORY_LANE_IMAGE_COMMAND,\n DEEP_AGENT_OMITTED_IMAGE_KEY,\n} from './generated/runconfig-contract';\nimport type { DeepAgentLaneTarget } from './lane-history';\nimport { hasStatewireThreadExtras } from './thread-extras';\n\nconst isRecord = (value: unknown): value is Record<string, unknown> =>\n typeof value === 'object' && value !== null && !Array.isArray(value);\n\nconst isCount = (value: unknown): value is number =>\n typeof value === 'number' && Number.isInteger(value) && value >= 0;\n\n/**\n * The `history/lane_image` read command on the statewire command union, so\n * `sendCommand({ type: 'history/lane_image', … })` typechecks wherever the\n * deep-agent host is driven (an attach-ACL read, like `history/image`).\n */\ndeclare module '@assistant-ui/core' {\n namespace Assistant {\n interface Commands {\n /** One chunk of an inline image a lane step carries as a placeholder. */\n historyLaneImage: HistoryLaneImageCommand;\n }\n }\n}\n\n/** The `history/lane_image` command: one chunk of one lane step's inline image. */\nexport type HistoryLaneImageCommand = {\n readonly type: typeof DEEP_AGENT_HISTORY_LANE_IMAGE_COMMAND;\n /** The step's id. */\n readonly step: string;\n /** The block's position in the stored step's content: the placeholder's `athena_image_omitted.index`. */\n readonly index: number;\n /** Where the chunk starts in the image's `data:` URL; the start when absent. */\n readonly offset?: number;\n} & ({ readonly messageId: string } | { readonly lane: string });\n\nexport function buildHistoryLaneImageCommand({\n target,\n step,\n index,\n offset = 0,\n}: {\n target: DeepAgentLaneTarget;\n step: string;\n index: number;\n offset?: number;\n}): HistoryLaneImageCommand {\n return {\n type: DEEP_AGENT_HISTORY_LANE_IMAGE_COMMAND,\n ...(target.lane !== undefined ? { lane: target.lane } : { messageId: target.messageId }),\n step,\n index,\n ...(offset > 0 && { offset }),\n };\n}\n\n/** One chunk of an inline image's `data:` URL, as `history/image` and `history/lane_image` answer it. */\nexport interface InlineImageChunk {\n readonly index: number;\n /** The image's declared media type; `null` when the store declares none. */\n readonly mediaType: string | null;\n readonly offset: number;\n /** The whole URL's length. */\n readonly total: number;\n readonly chunk: string;\n /** Where the next chunk starts; `null` after the last. */\n readonly next: number | null;\n}\n\n/** The keys `history/image` and `history/lane_image` answer alike; `null` for anything else. */\nexport function readInlineImageChunk(payload: unknown): InlineImageChunk | null {\n if (!isRecord(payload)) return null;\n const { index, mediaType, offset, total, chunk, next } = payload;\n if (!isCount(index) || !isCount(offset) || !isCount(total) || typeof chunk !== 'string') {\n return null;\n }\n if (next !== null && !isCount(next)) return null;\n if (mediaType !== undefined && mediaType !== null && typeof mediaType !== 'string') return null;\n return { index, mediaType: mediaType ?? null, offset, total, chunk, next };\n}\n\n/** One `history/lane_image` answer: an image chunk, and the card or lane and step it belongs to. */\nexport interface HistoryLaneImageChunk extends InlineImageChunk {\n /** The card it reads; `null` for a lane. */\n readonly messageId: string | null;\n /** The in-eval lane it reads; `null` for a card. */\n readonly lane: string | null;\n readonly step: string;\n}\n\nconst nonEmpty = (value: unknown): string | null =>\n typeof value === 'string' && value ? value : null;\n\nexport function readHistoryLaneImageChunk(payload: unknown): HistoryLaneImageChunk | null {\n const chunk = readInlineImageChunk(payload);\n if (chunk === null || !isRecord(payload)) return null;\n const messageId = nonEmpty(payload.messageId);\n const lane = nonEmpty(payload.lane);\n const step = nonEmpty(payload.step);\n if ((messageId === null) === (lane === null) || step === null) return null;\n return { ...chunk, messageId, lane, step };\n}\n\n/** An inline image read whole. */\nexport interface InlineImage {\n /** The image's `data:` URL. */\n readonly url: string;\n readonly mediaType: string | null;\n}\n\n/**\n * The most chunks one image is read in: 128 MiB of `data:` URL at the host's\n * 1 MiB a chunk. Every answer must move the offset forward, so the loop ends\n * anyway; the cap bounds what a host that sends tiny chunks can cost.\n */\nconst MAX_IMAGE_CHUNKS = 128;\n\nconst abortReason = (signal: AbortSignal): unknown =>\n signal.reason ?? new DOMException('The image read was cancelled.', 'AbortError');\n\n/**\n * `promise`, or its rejection as soon as `signal` is cancelled: a request the\n * host has not answered yet never holds up a read nobody wants any more (its\n * answer, if one comes, is dropped).\n */\nfunction unlessCancelled<T>(promise: Promise<T>, signal: AbortSignal | undefined): Promise<T> {\n if (signal === undefined) return promise;\n if (signal.aborted) return Promise.reject(abortReason(signal));\n return new Promise<T>((resolve, reject) => {\n const onAbort = () => reject(abortReason(signal));\n signal.addEventListener('abort', onAbort, { once: true });\n promise.then(\n (value) => {\n signal.removeEventListener('abort', onAbort);\n resolve(value);\n },\n (error: unknown) => {\n signal.removeEventListener('abort', onAbort);\n reject(error);\n }\n );\n });\n}\n\n/**\n * Reads one inline image whole, chunk by chunk: the start, then each `next`\n * the host names, until it names none. Each answer must start where it was\n * asked, keep the first answer's `total`, carry the chunk up to `next`, and end\n * the URL exactly at `total`; anything else throws. A cancelled `signal`\n * rejects at once, without waiting for an answer still out. `read` sends one\n * request and returns its answer, checked against the request.\n */\nexport async function readChunkedInlineImage({\n read,\n signal,\n}: {\n read: (offset: number) => Promise<InlineImageChunk>;\n signal?: AbortSignal | undefined;\n}): Promise<InlineImage> {\n const chunks: string[] = [];\n let offset = 0;\n let total: number | null = null;\n let mediaType: string | null = null;\n for (let count = 0; count < MAX_IMAGE_CHUNKS; count += 1) {\n if (signal?.aborted) throw abortReason(signal);\n const answer = await unlessCancelled(read(offset), signal);\n if (answer.offset !== offset || (total !== null && answer.total !== total)) {\n throw new Error('the image chunk does not continue the image');\n }\n total = answer.total;\n mediaType = answer.mediaType ?? mediaType;\n const end = offset + answer.chunk.length;\n if (answer.chunk.length === 0 || end > total) {\n throw new Error('the image chunk does not fit the image');\n }\n chunks.push(answer.chunk);\n if (answer.next === null) {\n if (end !== total) throw new Error('the image ended before its total');\n const url = chunks.join('');\n if (!url.startsWith('data:')) throw new Error('the image is not a data: URL');\n return { url, mediaType };\n }\n if (answer.next !== end) throw new Error('the next image chunk is not where this one ends');\n offset = end;\n }\n throw new Error(`the image takes more than ${MAX_IMAGE_CHUNKS} chunks`);\n}\n\n/** One lane step's image: the step's id and the block's stored index (`athena_image_omitted.index`). */\nexport interface LaneImageRef {\n readonly step: string;\n readonly index: number;\n}\n\nconst NO_OMITTED_IMAGES: readonly LaneImageRef[] = [];\n\n/** The `athena_image_omitted.index` of a placeholder block; `undefined` for any other block. */\nfunction omittedIndex(block: unknown): number | undefined {\n if (!isRecord(block)) return undefined;\n const marker = block[DEEP_AGENT_OMITTED_IMAGE_KEY];\n return isRecord(marker) && isCount(marker.index) ? marker.index : undefined;\n}\n\nconst omittedByStep = new WeakMap<object, readonly LaneImageRef[]>();\n\n/** The placeholders one step carries, in content order. Memoized per step object. */\nfunction omittedImagesOfStep(step: LangChainMessage): readonly LaneImageRef[] {\n const cached = omittedByStep.get(step);\n if (cached !== undefined) return cached;\n const id = step.id;\n const content: unknown = step.content;\n let images: LaneImageRef[] | null = null;\n if (typeof id === 'string' && id && Array.isArray(content)) {\n for (const block of content) {\n const index = omittedIndex(block);\n if (index === undefined) continue;\n images ??= [];\n images.push({ step: id, index });\n }\n }\n const found = images ?? NO_OMITTED_IMAGES;\n omittedByStep.set(step, found);\n return found;\n}\n\n/** Every image a lane's steps carry as a placeholder, in step and content order. */\nexport function omittedLaneImages(steps: readonly LangChainMessage[]): readonly LaneImageRef[] {\n let images: LaneImageRef[] | null = null;\n for (const step of steps) {\n const own = omittedImagesOfStep(step);\n if (own.length === 0) continue;\n images ??= [];\n images.push(...own);\n }\n return images ?? NO_OMITTED_IMAGES;\n}\n\n/** The key one lane image is held under in a surface's image map. */\nexport const laneImageKey = ({ step, index }: LaneImageRef): string => `${index}:${step}`;\n\n/** The URL fragment a waiting tile carries, ahead of the image's key. */\nconst TILE_FRAGMENT = '#athena-lane-image=';\n\n/**\n * The image a tile stands for, read off the `src` its `<img>` draws: a waiting\n * placeholder's payload carries `#athena-lane-image=<index>:<step>`. `null` for\n * any other picture (a read image, the host's untagged tile, any URL at all).\n */\nexport function readLaneImageTile(src: string | null | undefined): LaneImageRef | null {\n if (typeof src !== 'string' || !src.startsWith('data:')) return null;\n const at = src.lastIndexOf(TILE_FRAGMENT);\n if (at < 0) return null;\n let key: string;\n try {\n key = decodeURIComponent(src.slice(at + TILE_FRAGMENT.length));\n } catch {\n return null;\n }\n const colon = key.indexOf(':');\n const index = Number(key.slice(0, colon));\n const step = key.slice(colon + 1);\n return colon > 0 && isCount(index) && step ? { step, index } : null;\n}\n\n/**\n * A waiting placeholder with the image it stands for named in its payload\n * slot: the slot keeps the tile and gains `#athena-lane-image=<index>:<step>`,\n * which a renderer that builds `data:<type>;base64,<payload>` (or takes the\n * URL whole) carries into the `<img>` it draws, and a `data:` URL's decoder\n * ignores. The block for a slot it cannot tag, as it is.\n */\nfunction blockWithTile(\n block: Record<string, unknown>,\n image: LaneImageRef\n): Record<string, unknown> {\n const tag = `${TILE_FRAGMENT}${encodeURIComponent(laneImageKey(image))}`;\n const tagged = (value: unknown): string | null =>\n typeof value === 'string' && !value.includes(TILE_FRAGMENT) ? `${value}${tag}` : null;\n if (block.type === 'image_url') {\n const slot = block.image_url;\n const url = tagged(isRecord(slot) ? slot.url : slot);\n if (url === null) return block;\n return { ...block, image_url: isRecord(slot) ? { ...slot, url } : url };\n }\n if (block.type !== 'image') return block;\n const source = block.source;\n if (isRecord(source) && source.type === 'base64') {\n const data = tagged(source.data);\n return data === null ? block : { ...block, source: { ...source, data } };\n }\n if (typeof block.base64 === 'string') {\n const base64 = tagged(block.base64);\n return base64 === null ? block : { ...block, base64 };\n }\n if (block.source_type === 'base64' && typeof block.data === 'string') {\n const data = tagged(block.data);\n return data === null ? block : { ...block, data };\n }\n const url = tagged(block.url);\n return url === null ? block : { ...block, url };\n}\n\n/**\n * A placeholder block with its image back, in the block's own shape (the\n * slots agora's `_omitted_image` writes the tile into): a URL slot takes the\n * `data:` URL whole, a base64 slot its payload and media type. The marker\n * goes. `null` for a shape it cannot hold the image in.\n */\nfunction blockWithImage(\n block: Record<string, unknown>,\n url: string\n): Record<string, unknown> | null {\n const { [DEEP_AGENT_OMITTED_IMAGE_KEY]: _omitted, ...rest } = block;\n if (block.type === 'image_url') {\n const slot = block.image_url;\n if (typeof slot === 'string') return { ...rest, image_url: url };\n return isRecord(slot) ? { ...rest, image_url: { ...slot, url } } : null;\n }\n if (block.type !== 'image') return null;\n const comma = url.indexOf(',');\n const header = comma < 0 ? '' : url.slice(5, comma);\n const base64 = header.endsWith(';base64');\n const mediaType = header.split(';')[0] || null;\n const payload = url.slice(comma + 1);\n const source = block.source;\n if (isRecord(source) && source.type === 'base64') {\n if (!base64) return null;\n return {\n ...rest,\n source: { ...source, media_type: mediaType ?? source.media_type, data: payload },\n };\n }\n if (typeof block.base64 === 'string') {\n if (!base64) return null;\n return { ...rest, base64: payload, ...(mediaType !== null && { mime_type: mediaType }) };\n }\n if (block.source_type === 'base64' && typeof block.data === 'string') {\n if (!base64) return null;\n return { ...rest, data: payload, ...(mediaType !== null && { mime_type: mediaType }) };\n }\n return typeof block.url === 'string' ? { ...rest, url } : null;\n}\n\nconst shownSteps = new WeakMap<\n object,\n { readonly images: readonly (InlineImage | undefined)[]; readonly step: LangChainMessage }\n>();\n\n/** One step as a surface shows it: each image read in its block, each other placeholder tagged. */\nfunction stepShown(\n step: LangChainMessage,\n images: ReadonlyMap<string, InlineImage>\n): LangChainMessage {\n const omitted = omittedImagesOfStep(step);\n const stored: unknown = step.content;\n const id = step.id;\n if (omitted.length === 0 || !Array.isArray(stored) || typeof id !== 'string') return step;\n const read = omitted.map((image) => images.get(laneImageKey(image)));\n const cached = shownSteps.get(step);\n if (\n cached !== undefined &&\n cached.images.length === read.length &&\n cached.images.every((image, position) => image === read[position])\n ) {\n return cached.step;\n }\n const content = stored.map((block: unknown) => {\n const index = omittedIndex(block);\n if (index === undefined || !isRecord(block)) return block;\n const image = images.get(laneImageKey({ step: id, index }));\n if (image !== undefined) {\n const restored = blockWithImage(block, image.url);\n if (restored !== null) return restored;\n }\n return blockWithTile(block, { step: id, index });\n });\n // The step's own blocks, each restored or tagged one in its own shape.\n const shown = { ...step, content } as LangChainMessage;\n shownSteps.set(step, { images: read, step: shown });\n return shown;\n}\n\n/**\n * A lane's steps as a surface shows them: each image `images` holds back in\n * its placeholder's block, and each other placeholder's tile tagged with the\n * image it stands for (see {@link readLaneImageTile}). A step without\n * placeholders is the step itself, and the same steps and images give back the\n * same step objects, so a conversion memory sees an unchanged step as\n * unchanged. Without any placeholder, `steps` itself.\n */\nexport function showLaneImages({\n steps,\n images,\n}: {\n steps: readonly LangChainMessage[];\n images: ReadonlyMap<string, InlineImage>;\n}): readonly LangChainMessage[] {\n let changed = false;\n const shown = steps.map((step) => {\n const next = stepShown(step, images);\n if (next !== step) changed = true;\n return next;\n });\n return changed ? shown : steps;\n}\n\n/**\n * At most this many images are read at once across the tab: each is a chain of\n * 1 MiB answers on the thread's command lane, which the run's own commands\n * share.\n */\nconst MAX_CONCURRENT_IMAGE_READS = 2;\nlet imageReads = 0;\nconst waitingImageReads: Array<() => void> = [];\n\n/** Waits for a free read; rejects (and gives up its place) once `signal` is cancelled. */\nfunction waitForImageRead(signal: AbortSignal | undefined): Promise<void> {\n return new Promise((resolve, reject) => {\n const onAbort = () => {\n const position = waitingImageReads.indexOf(wake);\n if (position >= 0) waitingImageReads.splice(position, 1);\n reject(signal === undefined ? undefined : abortReason(signal));\n };\n const wake = () => {\n signal?.removeEventListener('abort', onAbort);\n resolve();\n };\n if (signal?.aborted) {\n reject(abortReason(signal));\n return;\n }\n waitingImageReads.push(wake);\n signal?.addEventListener('abort', onAbort, { once: true });\n });\n}\n\nasync function withImageRead<T>(\n signal: AbortSignal | undefined,\n read: () => Promise<T>\n): Promise<T> {\n while (imageReads >= MAX_CONCURRENT_IMAGE_READS) await waitForImageRead(signal);\n imageReads += 1;\n try {\n return await read();\n } finally {\n imageReads -= 1;\n waitingImageReads.shift()?.();\n }\n}\n\ntype SendCommand = StatewireThread.Extras['sendCommand'];\n\n/** Whether an answer is the chunk of the image a request asked for. */\nconst answersImage = (\n answer: HistoryLaneImageChunk,\n { target, step, index }: { target: DeepAgentLaneTarget; step: string; index: number }\n): boolean =>\n answer.step === step &&\n answer.index === index &&\n (target.lane !== undefined ? answer.lane === target.lane : answer.messageId === target.messageId);\n\n/** One lane image, read whole through `history/lane_image`. */\nexport function readLaneImage({\n sendCommand,\n target,\n step,\n index,\n signal,\n}: {\n sendCommand: SendCommand;\n target: DeepAgentLaneTarget;\n step: string;\n index: number;\n signal?: AbortSignal | undefined;\n}): Promise<InlineImage> {\n return readChunkedInlineImage({\n signal,\n read: async (offset) => {\n const answer = readHistoryLaneImageChunk(\n await sendCommand(buildHistoryLaneImageCommand({ target, step, index, offset }))\n );\n if (answer === null || !answersImage(answer, { target, step, index })) {\n throw new Error('history/lane_image answered another image');\n }\n return answer;\n },\n });\n}\n\n/** One key per card or lane, as the lane pager keys its pages. */\nconst laneTargetKey = (target: DeepAgentLaneTarget): string =>\n target.lane !== undefined ? `lane:${target.lane}` : `card:${target.messageId}`;\n\n/** The query key one lane image is cached under: per card or lane, step and index. */\nexport const deepAgentLaneImageQueryKey = ({\n target,\n step,\n index,\n}: {\n target: string;\n step: string;\n index: number;\n}) => ['athena-deep-agent', 'history-lane-image', target, step, index];\n\n/** What a surface shows of a lane's steps, with the images read so far. */\nexport interface DeepAgentLaneImagesState {\n /** The steps, each image read so far back in its block and each other placeholder's tile tagged. */\n readonly steps: readonly LangChainMessage[];\n /** Tiles remain whose image nobody asked for yet, on a host the images can be read from. */\n readonly pending: boolean;\n /**\n * Read the image a tile the surface shows stands for ({@link readLaneImageTile}).\n * An image the steps do not carry is never read; asking again costs nothing.\n */\n readonly request: (image: LaneImageRef) => void;\n}\n\nconst NO_IMAGES_ASKED: ReadonlySet<string> = new Set();\n\n/**\n * Reads a lane's images as a surface shows them, through `history/lane_image`,\n * each a TanStack query: nothing until `request` names the image a tile stands\n * for, then that image alone, at most two at a time across the tab. A read\n * image is cached per card or lane, step and index, so another surface showing\n * it reads nothing. The card a running `task` lane rides changes id when its\n * result lands: an image this hook already read is kept for the new card,\n * never read again. A refusal is the query's error, never retried or\n * refetched: the image stays its tile.\n */\nexport function useDeepAgentLaneImages({\n messageId,\n lane,\n steps,\n}: {\n /** The card's message id, for a `task` lane. */\n messageId?: string | undefined;\n /** The dispatch id, for an in-eval lane; wins over `messageId`. Neither: nothing is read. */\n lane?: string | undefined;\n /** The steps the surface shows. */\n steps: readonly LangChainMessage[];\n}): DeepAgentLaneImagesState {\n const sendCommand = useAuiState((s) =>\n hasStatewireThreadExtras(s.thread.extras)\n ? (s.thread.extras as StatewireThread.Extras).sendCommand\n : undefined\n );\n const sendRef = useRef(sendCommand);\n sendRef.current = sendCommand;\n const target = useMemo<DeepAgentLaneTarget | undefined>(\n () => (lane !== undefined ? { lane } : messageId !== undefined ? { messageId } : undefined),\n [lane, messageId]\n );\n const omitted = useMemo(() => omittedLaneImages(steps), [steps]);\n const [asked, setAsked] = useState<ReadonlySet<string>>(NO_IMAGES_ASKED);\n // The images this mount read, by step and index: a card whose id changed\n // under it (a running lane's result landed) starts with them.\n const kept = useRef(new Map<string, InlineImage>());\n\n const readable = target !== undefined && sendCommand !== undefined;\n // Only an image the steps carry is read, whatever a tile claims.\n const reads = useMemo(\n () =>\n readable ? omitted.filter((image) => asked.has(laneImageKey(image))) : NO_OMITTED_IMAGES,\n [readable, omitted, asked]\n );\n const results = useQueries({\n queries: reads.map((image) => ({\n queryKey: deepAgentLaneImageQueryKey({\n target: target === undefined ? '' : laneTargetKey(target),\n step: image.step,\n index: image.index,\n }),\n queryFn: ({ signal }) => {\n const send = sendRef.current;\n if (target === undefined || send === undefined) {\n return Promise.reject(new Error('no statewire thread to read the image from'));\n }\n return withImageRead(signal, () =>\n readLaneImage({ sendCommand: send, target, step: image.step, index: image.index, signal })\n );\n },\n initialData: () => kept.current.get(laneImageKey(image)),\n retry: false,\n retryOnMount: false,\n staleTime: Number.POSITIVE_INFINITY,\n refetchOnMount: false,\n refetchOnWindowFocus: false,\n refetchOnReconnect: false,\n })),\n // Shared structurally: the same images read give back the same list.\n combine: (answers) =>\n answers.flatMap((answer, position) => {\n const image = reads[position];\n return image !== undefined && answer.data !== undefined\n ? [{ key: laneImageKey(image), image: answer.data }]\n : [];\n }),\n });\n const images = useMemo(\n () => new Map<string, InlineImage>(results.map(({ key, image }) => [key, image] as const)),\n [results]\n );\n useEffect(() => {\n for (const [key, image] of images) kept.current.set(key, image);\n }, [images]);\n\n const shown = useMemo(() => showLaneImages({ steps, images }), [steps, images]);\n const pending = readable && omitted.some((image) => !asked.has(laneImageKey(image)));\n const request = useCallback((image: LaneImageRef) => {\n const key = laneImageKey(image);\n setAsked((previous) => {\n if (previous.has(key)) return previous;\n const next = new Set(previous);\n next.add(key);\n return next;\n });\n }, []);\n\n return { steps: shown, pending, request };\n}\n"],"names":["DEEP_AGENT_HISTORY_LANE_IMAGE_COMMAND","DEEP_AGENT_OMITTED_IMAGE_KEY","url","useAuiState","hasStatewireThreadExtras","useRef","useMemo","useState","useQueries","useEffect","useCallback"],"mappings":";;;;;;;AA6CA,MAAM,WAAW,CAAC,UAChB,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,KAAK;AAErE,MAAM,UAAU,CAAC,UACf,OAAO,UAAU,YAAY,OAAO,UAAU,KAAK,KAAK,SAAS;AA2B5D,SAAS,6BAA6B;AAAA,EAC3C;AAAA,EACA;AAAA,EACA;AAAA,EACA,SAAS;AACX,GAK4B;AAC1B,SAAO;AAAA,IACL,MAAMA,kBAAAA;AAA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