@athenaintel/react 0.57.1 → 0.59.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 +778 -9
- 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.map +1 -1
- package/dist/agent-runtime/src/composer-markdown.d.ts +1 -1
- 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 +66 -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 +12 -0
- package/dist/agent-runtime/src/tool-metadata.cjs.map +1 -1
- package/dist/agent-runtime/src/tool-metadata.js +12 -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 +337 -99
- package/dist/chat/AthenaChat.cjs.map +1 -1
- package/dist/chat/AthenaChat.d.ts +80 -4
- package/dist/chat/AthenaChat.js +337 -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 +3 -0
- package/dist/chat-ui/index.cjs.map +1 -1
- package/dist/chat-ui/index.d.ts +3 -2
- package/dist/chat-ui/index.js +3 -0
- package/dist/chat-ui/index.js.map +1 -1
- package/dist/chat-ui/mentions/mention-chip.cjs +1 -1
- package/dist/chat-ui/mentions/mention-chip.cjs.map +1 -1
- package/dist/chat-ui/mentions/mention-chip.js +2 -2
- 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 +2 -0
- package/dist/chat-ui/mentions/suggestions/components/mention-icon.cjs.map +1 -1
- package/dist/chat-ui/mentions/suggestions/components/mention-icon.js +3 -1
- 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 +36 -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 +42 -0
- package/dist/chat-ui/mentions/suggestions/data/api-client.js +36 -0
- package/dist/chat-ui/mentions/suggestions/data/api-client.js.map +1 -1
- package/dist/chat-ui/mentions/suggestions/data/sources/index.cjs +235 -19
- 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 +236 -20
- 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/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 +17 -5
- package/dist/collab/client.cjs.map +1 -1
- package/dist/collab/client.d.ts +22 -7
- package/dist/collab/client.js +17 -5
- 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/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 +458 -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 +458 -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 +63 -19
- package/dist/provider/AthenaProvider.cjs.map +1 -1
- package/dist/provider/AthenaProvider.d.ts +24 -8
- package/dist/provider/AthenaProvider.js +66 -22
- 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/types.cjs +5 -0
- package/dist/references/src/anchors/types.cjs.map +1 -1
- 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/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 +18 -1
- package/dist/runtime/statewire-run-config.cjs.map +1 -1
- package/dist/runtime/statewire-run-config.d.ts +20 -0
- package/dist/runtime/statewire-run-config.js +18 -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 +65 -8
- package/dist/runtime/useAthenaStatewireRuntime.cjs.map +1 -1
- package/dist/runtime/useAthenaStatewireRuntime.d.ts +26 -10
- package/dist/runtime/useAthenaStatewireRuntime.js +67 -10
- 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 +27 -24
- package/dist/threads/SessionList.cjs.map +1 -1
- package/dist/threads/SessionList.js +22 -19
- package/dist/threads/SessionList.js.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/live-session-rows.cjs +207 -0
- package/dist/threads/live-session-rows.cjs.map +1 -0
- package/dist/threads/live-session-rows.d.ts +175 -0
- package/dist/threads/live-session-rows.js +207 -0
- package/dist/threads/live-session-rows.js.map +1 -0
- 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 +173 -20
- package/dist/threads/statewire-thread-list.cjs.map +1 -1
- package/dist/threads/statewire-thread-list.d.ts +44 -1
- package/dist/threads/statewire-thread-list.js +174 -21
- 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 +425 -0
- package/dist/tools/drive-tool-uis.cjs.map +1 -0
- package/dist/tools/drive-tool-uis.d.ts +120 -0
- package/dist/tools/drive-tool-uis.js +425 -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/workbench/session-workbench-panes.cjs +6 -6
- package/dist/workbench/session-workbench-panes.cjs.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,173 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a typed card needs beyond the selector (`typed-interrupts.ts`): which
|
|
3
|
+
* answers decide something only a person may decide (`isTypedApprovalInterrupt`),
|
|
4
|
+
* the stamps the raiser's stale-resume check reads, the timer, and each kind's
|
|
5
|
+
* context reader and resume, each mirroring its raiser
|
|
6
|
+
* (`agora/services/interrupts/definitions.py`) and Olympus's
|
|
7
|
+
* `config/interruptDefinitions.ts`.
|
|
8
|
+
*/
|
|
9
|
+
import { type TypedInterruptPayload } from './typed-interrupts';
|
|
10
|
+
export declare function isTypedApprovalInterrupt(payload: TypedInterruptPayload): boolean;
|
|
11
|
+
/** Whether a typed answer lets anything run, as its raiser reads it (fails closed). */
|
|
12
|
+
export declare function typedAnswerLetsSomethingRun(value: unknown): boolean;
|
|
13
|
+
/** The keys the raiser's stale-resume check reads on an answer. */
|
|
14
|
+
export declare const TYPED_INTERRUPT_ID_KEY = "__interrupt_id__";
|
|
15
|
+
export declare const TYPED_INTERRUPT_INSTANCE_KEY = "__interrupt_instance_id__";
|
|
16
|
+
/**
|
|
17
|
+
* The answer as it leaves: the kind's resume value stamped with the park it
|
|
18
|
+
* answers (`__interrupt_id__`, `__interrupt_instance_id__`) and serialized as
|
|
19
|
+
* plain JSON, so an optional field a card left unset never reaches statewire
|
|
20
|
+
* as `undefined` (an invalid document there).
|
|
21
|
+
*/
|
|
22
|
+
export declare function stampTypedInterruptAnswer({ payload, value, }: {
|
|
23
|
+
payload: TypedInterruptPayload;
|
|
24
|
+
value: Readonly<Record<string, unknown>>;
|
|
25
|
+
}): Record<string, unknown>;
|
|
26
|
+
/** `{ action: 'cancel' }`: every typed raiser ends the interrupted operation (`FormCancelledError`). */
|
|
27
|
+
export declare function typedInterruptCancel(): Record<string, string>;
|
|
28
|
+
/** Whether the backend's timer answers this park for the person at a deadline. */
|
|
29
|
+
export declare function hasInterruptTimeout(payload: TypedInterruptPayload): boolean;
|
|
30
|
+
/** Seconds until the backend's timer answers (never negative), or `null` without one. */
|
|
31
|
+
export declare function interruptTimeoutRemaining(payload: TypedInterruptPayload, now?: number): number | null;
|
|
32
|
+
/**
|
|
33
|
+
* The park's message without the raiser's `(timeout in 180s)` suffix, for
|
|
34
|
+
* once the person stopped the timer and the card says "take your time".
|
|
35
|
+
*/
|
|
36
|
+
export declare function stripInterruptTimeoutText(message: string | null | undefined): string;
|
|
37
|
+
/**
|
|
38
|
+
* The key a timed interrupt's draft is saved under: the one the backend's
|
|
39
|
+
* timer worker checks before it fires (`_draft_interrupt_id_for_timeout`: the
|
|
40
|
+
* park's `timeout_at`, else its source). A draft under any other key does not
|
|
41
|
+
* hold the timer.
|
|
42
|
+
*/
|
|
43
|
+
export declare function interruptDraftId(payload: TypedInterruptPayload): string;
|
|
44
|
+
/** The kinds of question the `ask` tool asks. */
|
|
45
|
+
export declare const QuestionType: {
|
|
46
|
+
readonly TEXT: 'text';
|
|
47
|
+
readonly YES_NO: 'yes_no';
|
|
48
|
+
readonly SINGLE_CHOICE: 'single_choice';
|
|
49
|
+
readonly MULTI_CHOICE: 'multi_choice';
|
|
50
|
+
};
|
|
51
|
+
export type QuestionType = (typeof QuestionType)[keyof typeof QuestionType];
|
|
52
|
+
export interface TypedQuestion {
|
|
53
|
+
readonly text: string;
|
|
54
|
+
readonly type: QuestionType;
|
|
55
|
+
readonly options: readonly string[];
|
|
56
|
+
/** The answer the agent recommends (an option, or `yes` / `no`); also the timeout's answer. */
|
|
57
|
+
readonly recommended: string | null;
|
|
58
|
+
}
|
|
59
|
+
export interface QuestionnaireContext {
|
|
60
|
+
/** The questionnaire's own title, when the agent gave one. */
|
|
61
|
+
readonly title: string | null;
|
|
62
|
+
readonly questions: readonly TypedQuestion[];
|
|
63
|
+
}
|
|
64
|
+
export declare function isQuestionnaireInterrupt(payload: TypedInterruptPayload): boolean;
|
|
65
|
+
/** The questions the `ask` tool parked on (`misc_tools.py`), in order. */
|
|
66
|
+
export declare function readQuestionnaireContext(payload: TypedInterruptPayload): QuestionnaireContext;
|
|
67
|
+
/** One answer of a questionnaire's resume (`QuestionnaireAnswer`). */
|
|
68
|
+
export interface QuestionnaireAnswer {
|
|
69
|
+
readonly value: string;
|
|
70
|
+
readonly comment: string | null;
|
|
71
|
+
}
|
|
72
|
+
/** The questionnaire's resume (`QuestionnaireResume`); an empty list is the card's cancel. */
|
|
73
|
+
export declare function questionnaireResume(answers: readonly QuestionnaireAnswer[]): Record<string, unknown>;
|
|
74
|
+
/** One toolkit `toggle_toolkit` proposes (`agent_config_tools.py`). */
|
|
75
|
+
export interface ToolkitSelectionItem {
|
|
76
|
+
readonly toolkit_id: string;
|
|
77
|
+
readonly display_name: string;
|
|
78
|
+
readonly description: string | null;
|
|
79
|
+
/** The agent's reason it needs this toolkit, shown to the person. */
|
|
80
|
+
readonly rationale: string | null;
|
|
81
|
+
/** Tools this toolkit adds beyond those already on (the tool cap's headroom). */
|
|
82
|
+
readonly added_tool_count?: number;
|
|
83
|
+
}
|
|
84
|
+
export interface ToolkitSelectionContext {
|
|
85
|
+
readonly action: 'enable' | 'disable';
|
|
86
|
+
readonly toolkits: readonly ToolkitSelectionItem[];
|
|
87
|
+
/** Tools already on and the run's cap (enable only), so the card warns before a breach. */
|
|
88
|
+
readonly current_tool_count?: number;
|
|
89
|
+
readonly max_tools?: number;
|
|
90
|
+
}
|
|
91
|
+
export declare function isToolkitSelectionInterrupt(payload: TypedInterruptPayload): boolean;
|
|
92
|
+
/**
|
|
93
|
+
* The toolkits `toggle_toolkit` asks to turn on or off. Read whole or not at
|
|
94
|
+
* all, as Olympus's schema reads it: a malformed context is an empty enable.
|
|
95
|
+
*/
|
|
96
|
+
export declare function readToolkitSelectionContext(payload: TypedInterruptPayload): ToolkitSelectionContext;
|
|
97
|
+
/** The toolkit selection's resume (`ToolkitSelectionResume`). */
|
|
98
|
+
export declare function toolkitSelectionResume({ action, approvedToolkitIds, reason, }: {
|
|
99
|
+
action: 'approve' | 'reject';
|
|
100
|
+
approvedToolkitIds: readonly string[];
|
|
101
|
+
reason?: string;
|
|
102
|
+
}): Record<string, unknown>;
|
|
103
|
+
/** One saved login the browse-profile gate asks to use (`browse_profile_gate_node.py`). */
|
|
104
|
+
export interface BrowseProfileApprovalProfile {
|
|
105
|
+
readonly profile_asset_id: string;
|
|
106
|
+
/** What the ordinary approve grants: `session` (this browser session) or `attempt` (this one action). */
|
|
107
|
+
readonly approval_scope: string | null;
|
|
108
|
+
}
|
|
109
|
+
export interface BrowseProfileApprovalContext {
|
|
110
|
+
readonly profiles: readonly BrowseProfileApprovalProfile[];
|
|
111
|
+
/** Stamped when every shown profile may be approved for the rest of the thread. */
|
|
112
|
+
readonly sessionApprovalAllowed: boolean;
|
|
113
|
+
}
|
|
114
|
+
export declare function isBrowseProfileApprovalInterrupt(payload: TypedInterruptPayload): boolean;
|
|
115
|
+
export declare function readBrowseProfileApprovalContext(payload: TypedInterruptPayload): BrowseProfileApprovalContext;
|
|
116
|
+
/** The browse-profile gate's resume (`BrowseProfileApprovalResume`). */
|
|
117
|
+
export declare function browseProfileApprovalResume({ action, forSession, }: {
|
|
118
|
+
action: 'approve' | 'reject';
|
|
119
|
+
/** On an approve: stop asking about these profiles for the rest of the thread. */
|
|
120
|
+
forSession?: boolean;
|
|
121
|
+
}): Record<string, unknown>;
|
|
122
|
+
export declare function isPmScheduleApprovalInterrupt(payload: TypedInterruptPayload): boolean;
|
|
123
|
+
/** The project manager schedule a person approves (`pm_tools.py`). */
|
|
124
|
+
export interface PmScheduleApprovalContext {
|
|
125
|
+
/** `delete` for a deletion; anything else is a creation. */
|
|
126
|
+
readonly action: string | null;
|
|
127
|
+
/** The schedule's facts, in the card's order, by their context key. */
|
|
128
|
+
readonly fields: readonly (readonly [key: string, value: string])[];
|
|
129
|
+
}
|
|
130
|
+
export declare function readPmScheduleApprovalContext(payload: TypedInterruptPayload): PmScheduleApprovalContext;
|
|
131
|
+
/** An approval's resume (`HITLResume`, `PMScheduleApprovalResume`): approve, or reject with a reason. */
|
|
132
|
+
export declare function typedApprovalResume({ action, reason, }: {
|
|
133
|
+
action: 'approve' | 'reject';
|
|
134
|
+
reason?: string;
|
|
135
|
+
}): Record<string, unknown>;
|
|
136
|
+
export declare function isWaitForMinutesInterrupt(payload: TypedInterruptPayload): boolean;
|
|
137
|
+
/** The wait `wait_for_minutes` announced (`misc_tools.py`). */
|
|
138
|
+
export interface WaitForMinutesContext {
|
|
139
|
+
readonly minutes: number;
|
|
140
|
+
readonly reason: string | null;
|
|
141
|
+
/** The whole wait in seconds, when the raiser stamped it on the context. */
|
|
142
|
+
readonly timeoutSeconds: number | null;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Each field on its own: the raiser sends `reason: null` for a wait without
|
|
146
|
+
* one, which must not lose the minutes.
|
|
147
|
+
*/
|
|
148
|
+
export declare function readWaitForMinutesContext(payload: TypedInterruptPayload): WaitForMinutesContext;
|
|
149
|
+
export declare function isRequestFileInterrupt(payload: TypedInterruptPayload): boolean;
|
|
150
|
+
/** What `request_file_from_user` asks for (`misc_tools.py`). */
|
|
151
|
+
export interface RequestFileContext {
|
|
152
|
+
readonly prompt: string;
|
|
153
|
+
readonly allowMultiple: boolean;
|
|
154
|
+
}
|
|
155
|
+
export declare function readRequestFileContext(payload: TypedInterruptPayload): RequestFileContext;
|
|
156
|
+
/** One uploaded file of `request_file_from_user`'s resume (`RequestedFile`). */
|
|
157
|
+
export interface RequestedFile {
|
|
158
|
+
readonly asset_id: string;
|
|
159
|
+
readonly filename: string;
|
|
160
|
+
/** The `[@title](link)` mention the agent can quote. */
|
|
161
|
+
readonly mention: string | null;
|
|
162
|
+
}
|
|
163
|
+
/** The file request's resume (`RequestFileResume`). */
|
|
164
|
+
export declare function requestFileResume(files: readonly RequestedFile[]): Record<string, unknown>;
|
|
165
|
+
/** The gated call of a tool-raised HITL approval (`raise_hitl_interrupt`). */
|
|
166
|
+
export interface TypedHitlContext {
|
|
167
|
+
readonly toolId: string | null;
|
|
168
|
+
readonly toolCallId: string | null;
|
|
169
|
+
readonly toolArgs: Readonly<Record<string, unknown>>;
|
|
170
|
+
/** What the backend resolved about the call before asking (`approval_context`). */
|
|
171
|
+
readonly approvalContext: unknown;
|
|
172
|
+
}
|
|
173
|
+
export declare function readTypedHitlContext(payload: TypedInterruptPayload): TypedHitlContext;
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
import { TypedInterruptSource, TypedInterruptType } from "./typed-interrupts.js";
|
|
2
|
+
function isRecord(value) {
|
|
3
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
4
|
+
}
|
|
5
|
+
function isOptional(value, check) {
|
|
6
|
+
return value === void 0 || check(value);
|
|
7
|
+
}
|
|
8
|
+
const isString = (value) => typeof value === "string";
|
|
9
|
+
const isFiniteNumber = (value) => typeof value === "number" && Number.isFinite(value);
|
|
10
|
+
const TYPED_APPROVAL_SOURCES = /* @__PURE__ */ new Set([
|
|
11
|
+
TypedInterruptSource.PM_SCHEDULE_APPROVAL,
|
|
12
|
+
TypedInterruptSource.BROWSE_PROFILE_APPROVAL,
|
|
13
|
+
TypedInterruptSource.TOOLKIT_SELECTION
|
|
14
|
+
]);
|
|
15
|
+
function isTypedApprovalInterrupt(payload) {
|
|
16
|
+
return payload.type === TypedInterruptType.HITL || TYPED_APPROVAL_SOURCES.has(payload.source);
|
|
17
|
+
}
|
|
18
|
+
const TYPED_NON_RUNNING_ACTIONS = /* @__PURE__ */ new Set(["reject", "cancel"]);
|
|
19
|
+
function typedAnswerLetsSomethingRun(value) {
|
|
20
|
+
if (!isRecord(value)) return true;
|
|
21
|
+
return !(typeof value.action === "string" && TYPED_NON_RUNNING_ACTIONS.has(value.action));
|
|
22
|
+
}
|
|
23
|
+
const TYPED_INTERRUPT_ID_KEY = "__interrupt_id__";
|
|
24
|
+
const TYPED_INTERRUPT_INSTANCE_KEY = "__interrupt_instance_id__";
|
|
25
|
+
function stampTypedInterruptAnswer({
|
|
26
|
+
payload,
|
|
27
|
+
value
|
|
28
|
+
}) {
|
|
29
|
+
const stamped = {
|
|
30
|
+
...value,
|
|
31
|
+
[TYPED_INTERRUPT_ID_KEY]: payload.source,
|
|
32
|
+
[TYPED_INTERRUPT_INSTANCE_KEY]: payload.interrupt_instance_id
|
|
33
|
+
};
|
|
34
|
+
const parsed = JSON.parse(JSON.stringify(stamped));
|
|
35
|
+
return isRecord(parsed) ? parsed : {};
|
|
36
|
+
}
|
|
37
|
+
function typedInterruptCancel() {
|
|
38
|
+
return { action: "cancel" };
|
|
39
|
+
}
|
|
40
|
+
function hasInterruptTimeout(payload) {
|
|
41
|
+
return payload.timeout_seconds !== void 0 && payload.timeout_at !== void 0;
|
|
42
|
+
}
|
|
43
|
+
function interruptTimeoutRemaining(payload, now = Date.now()) {
|
|
44
|
+
if (!payload.timeout_at) return null;
|
|
45
|
+
const deadline = new Date(payload.timeout_at).getTime();
|
|
46
|
+
if (Number.isNaN(deadline)) return null;
|
|
47
|
+
return Math.max(0, (deadline - now) / 1e3);
|
|
48
|
+
}
|
|
49
|
+
function stripInterruptTimeoutText(message) {
|
|
50
|
+
if (!message) return "";
|
|
51
|
+
return message.replace(/\s*\(timeout in \d+s\)/, "");
|
|
52
|
+
}
|
|
53
|
+
function interruptDraftId(payload) {
|
|
54
|
+
return payload.timeout_at ?? payload.source;
|
|
55
|
+
}
|
|
56
|
+
function isCustomWithSource(payload, source) {
|
|
57
|
+
return payload.type === TypedInterruptType.CUSTOM && payload.source === source;
|
|
58
|
+
}
|
|
59
|
+
const isStringArray = (value) => Array.isArray(value) && value.every(isString);
|
|
60
|
+
function optionalText(value) {
|
|
61
|
+
return isString(value) ? value : null;
|
|
62
|
+
}
|
|
63
|
+
const QuestionType = {
|
|
64
|
+
TEXT: "text",
|
|
65
|
+
YES_NO: "yes_no",
|
|
66
|
+
SINGLE_CHOICE: "single_choice",
|
|
67
|
+
MULTI_CHOICE: "multi_choice"
|
|
68
|
+
};
|
|
69
|
+
const QUESTION_TYPES = new Set(Object.values(QuestionType));
|
|
70
|
+
function isQuestionnaireInterrupt(payload) {
|
|
71
|
+
return isCustomWithSource(payload, TypedInterruptSource.ASK_QUESTIONNAIRE);
|
|
72
|
+
}
|
|
73
|
+
function readQuestionnaireContext(payload) {
|
|
74
|
+
const { context } = payload;
|
|
75
|
+
const questions = Array.isArray(context.questions) ? context.questions.filter(isRecord).map(
|
|
76
|
+
(question) => ({
|
|
77
|
+
text: isString(question.text) ? question.text : "",
|
|
78
|
+
type: isString(question.type) && QUESTION_TYPES.has(question.type) ? question.type : QuestionType.TEXT,
|
|
79
|
+
options: isStringArray(question.options) ? question.options : [],
|
|
80
|
+
recommended: optionalText(question.recommended)
|
|
81
|
+
})
|
|
82
|
+
) : [];
|
|
83
|
+
return { title: optionalText(context.title), questions };
|
|
84
|
+
}
|
|
85
|
+
function questionnaireResume(answers) {
|
|
86
|
+
return { answers: answers.map(({ value, comment }) => ({ value, comment })) };
|
|
87
|
+
}
|
|
88
|
+
function isToolkitSelectionInterrupt(payload) {
|
|
89
|
+
return isCustomWithSource(payload, TypedInterruptSource.TOOLKIT_SELECTION);
|
|
90
|
+
}
|
|
91
|
+
const NO_TOOLKIT_SELECTION = { action: "enable", toolkits: [] };
|
|
92
|
+
function readToolkitItem(value) {
|
|
93
|
+
if (!isRecord(value) || !isString(value.toolkit_id) || !isString(value.display_name)) return null;
|
|
94
|
+
const { description, rationale, added_tool_count: added } = value;
|
|
95
|
+
if (description != null && !isString(description) || rationale != null && !isString(rationale) || !isOptional(added, isFiniteNumber)) {
|
|
96
|
+
return null;
|
|
97
|
+
}
|
|
98
|
+
return {
|
|
99
|
+
toolkit_id: value.toolkit_id,
|
|
100
|
+
display_name: value.display_name,
|
|
101
|
+
description: optionalText(description),
|
|
102
|
+
rationale: optionalText(rationale),
|
|
103
|
+
...isFiniteNumber(added) ? { added_tool_count: added } : {}
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
function readToolkitSelectionContext(payload) {
|
|
107
|
+
const { context } = payload;
|
|
108
|
+
const { action, toolkits, total, current_tool_count: current, max_tools: max } = context;
|
|
109
|
+
if (action !== "enable" && action !== "disable") return NO_TOOLKIT_SELECTION;
|
|
110
|
+
if (!Array.isArray(toolkits)) return NO_TOOLKIT_SELECTION;
|
|
111
|
+
if (!isOptional(total, isFiniteNumber) || !isOptional(current, isFiniteNumber) || !isOptional(max, isFiniteNumber)) {
|
|
112
|
+
return NO_TOOLKIT_SELECTION;
|
|
113
|
+
}
|
|
114
|
+
const items = toolkits.map(readToolkitItem);
|
|
115
|
+
if (items.some((item) => item === null)) return NO_TOOLKIT_SELECTION;
|
|
116
|
+
return {
|
|
117
|
+
action,
|
|
118
|
+
toolkits: items,
|
|
119
|
+
...isFiniteNumber(current) ? { current_tool_count: current } : {},
|
|
120
|
+
...isFiniteNumber(max) ? { max_tools: max } : {}
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
function toolkitSelectionResume({
|
|
124
|
+
action,
|
|
125
|
+
approvedToolkitIds,
|
|
126
|
+
reason
|
|
127
|
+
}) {
|
|
128
|
+
return {
|
|
129
|
+
action,
|
|
130
|
+
approved_toolkit_ids: action === "approve" ? [...approvedToolkitIds] : [],
|
|
131
|
+
...reason ? { reason } : {}
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
function isBrowseProfileApprovalInterrupt(payload) {
|
|
135
|
+
return isCustomWithSource(payload, TypedInterruptSource.BROWSE_PROFILE_APPROVAL);
|
|
136
|
+
}
|
|
137
|
+
function readBrowseProfileApprovalContext(payload) {
|
|
138
|
+
const approval = payload.context.browse_profile_approval;
|
|
139
|
+
if (!isRecord(approval)) return { profiles: [], sessionApprovalAllowed: false };
|
|
140
|
+
const profiles = Array.isArray(approval.profiles) ? approval.profiles.flatMap(
|
|
141
|
+
(profile) => isRecord(profile) && isString(profile.profile_asset_id) ? [
|
|
142
|
+
{
|
|
143
|
+
profile_asset_id: profile.profile_asset_id,
|
|
144
|
+
approval_scope: optionalText(profile.approval_scope)
|
|
145
|
+
}
|
|
146
|
+
] : []
|
|
147
|
+
) : [];
|
|
148
|
+
return { profiles, sessionApprovalAllowed: approval.session_approval_allowed === true };
|
|
149
|
+
}
|
|
150
|
+
function browseProfileApprovalResume({
|
|
151
|
+
action,
|
|
152
|
+
forSession = false
|
|
153
|
+
}) {
|
|
154
|
+
return action === "approve" && forSession ? { action, scope: "session" } : { action };
|
|
155
|
+
}
|
|
156
|
+
function isPmScheduleApprovalInterrupt(payload) {
|
|
157
|
+
return isCustomWithSource(payload, TypedInterruptSource.PM_SCHEDULE_APPROVAL);
|
|
158
|
+
}
|
|
159
|
+
const PM_SCHEDULE_FIELDS = [
|
|
160
|
+
"project_asset_id",
|
|
161
|
+
"cron",
|
|
162
|
+
"timezone",
|
|
163
|
+
"summary",
|
|
164
|
+
"scheduled_for",
|
|
165
|
+
"schedule_id"
|
|
166
|
+
];
|
|
167
|
+
function readPmScheduleApprovalContext(payload) {
|
|
168
|
+
const { context } = payload;
|
|
169
|
+
const fields = PM_SCHEDULE_FIELDS.flatMap((key) => {
|
|
170
|
+
const value = context[key];
|
|
171
|
+
return value ? [[key, String(value)]] : [];
|
|
172
|
+
});
|
|
173
|
+
return { action: optionalText(context.action), fields };
|
|
174
|
+
}
|
|
175
|
+
function typedApprovalResume({
|
|
176
|
+
action,
|
|
177
|
+
reason
|
|
178
|
+
}) {
|
|
179
|
+
return reason ? { action, reason } : { action };
|
|
180
|
+
}
|
|
181
|
+
function isWaitForMinutesInterrupt(payload) {
|
|
182
|
+
return isCustomWithSource(payload, TypedInterruptSource.WAIT_FOR_MINUTES);
|
|
183
|
+
}
|
|
184
|
+
function readWaitForMinutesContext(payload) {
|
|
185
|
+
const { minutes, reason, timeout_seconds: timeoutSeconds } = payload.context;
|
|
186
|
+
return {
|
|
187
|
+
minutes: isFiniteNumber(minutes) ? minutes : 0,
|
|
188
|
+
reason: isString(reason) && reason ? reason : null,
|
|
189
|
+
timeoutSeconds: isFiniteNumber(timeoutSeconds) ? timeoutSeconds : null
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
function isRequestFileInterrupt(payload) {
|
|
193
|
+
return isCustomWithSource(payload, TypedInterruptSource.REQUEST_FILE);
|
|
194
|
+
}
|
|
195
|
+
function readRequestFileContext(payload) {
|
|
196
|
+
const { prompt, allow_multiple: allowMultiple } = payload.context;
|
|
197
|
+
return {
|
|
198
|
+
prompt: isString(prompt) && prompt || payload.message || "Upload a file to continue.",
|
|
199
|
+
allowMultiple: allowMultiple === true
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
function requestFileResume(files) {
|
|
203
|
+
return {
|
|
204
|
+
files: files.map(({ asset_id, filename, mention }) => ({ asset_id, filename, mention }))
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
function readTypedHitlContext(payload) {
|
|
208
|
+
const { context } = payload;
|
|
209
|
+
return {
|
|
210
|
+
toolId: optionalText(context.tool_id),
|
|
211
|
+
toolCallId: optionalText(context.tool_call_id),
|
|
212
|
+
toolArgs: isRecord(context.tool_args) ? context.tool_args : {},
|
|
213
|
+
approvalContext: context.approval_context
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
export {
|
|
217
|
+
QuestionType,
|
|
218
|
+
TYPED_INTERRUPT_ID_KEY,
|
|
219
|
+
TYPED_INTERRUPT_INSTANCE_KEY,
|
|
220
|
+
browseProfileApprovalResume,
|
|
221
|
+
hasInterruptTimeout,
|
|
222
|
+
interruptDraftId,
|
|
223
|
+
interruptTimeoutRemaining,
|
|
224
|
+
isBrowseProfileApprovalInterrupt,
|
|
225
|
+
isPmScheduleApprovalInterrupt,
|
|
226
|
+
isQuestionnaireInterrupt,
|
|
227
|
+
isRequestFileInterrupt,
|
|
228
|
+
isToolkitSelectionInterrupt,
|
|
229
|
+
isTypedApprovalInterrupt,
|
|
230
|
+
isWaitForMinutesInterrupt,
|
|
231
|
+
questionnaireResume,
|
|
232
|
+
readBrowseProfileApprovalContext,
|
|
233
|
+
readPmScheduleApprovalContext,
|
|
234
|
+
readQuestionnaireContext,
|
|
235
|
+
readRequestFileContext,
|
|
236
|
+
readToolkitSelectionContext,
|
|
237
|
+
readTypedHitlContext,
|
|
238
|
+
readWaitForMinutesContext,
|
|
239
|
+
requestFileResume,
|
|
240
|
+
stampTypedInterruptAnswer,
|
|
241
|
+
stripInterruptTimeoutText,
|
|
242
|
+
toolkitSelectionResume,
|
|
243
|
+
typedAnswerLetsSomethingRun,
|
|
244
|
+
typedApprovalResume,
|
|
245
|
+
typedInterruptCancel
|
|
246
|
+
};
|
|
247
|
+
//# sourceMappingURL=typed-interrupt-kinds.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typed-interrupt-kinds.js","sources":["../../../../agent-runtime/src/typed-interrupt-kinds.ts"],"sourcesContent":["/**\n * What a typed card needs beyond the selector (`typed-interrupts.ts`): which\n * answers decide something only a person may decide (`isTypedApprovalInterrupt`),\n * the stamps the raiser's stale-resume check reads, the timer, and each kind's\n * context reader and resume, each mirroring its raiser\n * (`agora/services/interrupts/definitions.py`) and Olympus's\n * `config/interruptDefinitions.ts`.\n */\n\nimport {\n type TypedInterruptPayload,\n TypedInterruptSource,\n TypedInterruptType,\n} from './typed-interrupts';\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nfunction isOptional<T>(value: unknown, check: (candidate: unknown) => candidate is T): boolean {\n return value === undefined || check(value);\n}\n\nconst isString = (value: unknown): value is string => typeof value === 'string';\nconst isFiniteNumber = (value: unknown): value is number =>\n typeof value === 'number' && Number.isFinite(value);\n\n/**\n * The parks a person answers by approving: a tool-raised HITL approval (type\n * `hitl`), a project manager's schedule (standing work), a saved login the\n * agent asks to use, and toolkits it asks to turn on. A question the agent\n * asked (a form, a questionnaire, a file) is not: answering it decides\n * nothing. Mirrors agora's `answer_checks.is_typed_approval_interrupt`, which\n * holds an approving answer to a signed-in person (or, while checks are\n * enforced, a device key with a passkey check).\n */\nconst TYPED_APPROVAL_SOURCES: ReadonlySet<string> = new Set([\n TypedInterruptSource.PM_SCHEDULE_APPROVAL,\n TypedInterruptSource.BROWSE_PROFILE_APPROVAL,\n TypedInterruptSource.TOOLKIT_SELECTION,\n]);\n\nexport function isTypedApprovalInterrupt(payload: TypedInterruptPayload): boolean {\n return payload.type === TypedInterruptType.HITL || TYPED_APPROVAL_SOURCES.has(payload.source);\n}\n\n/**\n * What every typed raiser reads as running nothing: a reject, and the card's\n * cancel, which ends the interrupted operation (agora's\n * `TYPED_NON_RUNNING_ACTIONS`). Anything else, unreadable included, runs.\n */\nconst TYPED_NON_RUNNING_ACTIONS: ReadonlySet<string> = new Set(['reject', 'cancel']);\n\n/** Whether a typed answer lets anything run, as its raiser reads it (fails closed). */\nexport function typedAnswerLetsSomethingRun(value: unknown): boolean {\n if (!isRecord(value)) return true;\n return !(typeof value.action === 'string' && TYPED_NON_RUNNING_ACTIONS.has(value.action));\n}\n\n/** The keys the raiser's stale-resume check reads on an answer. */\nexport const TYPED_INTERRUPT_ID_KEY = '__interrupt_id__';\nexport const TYPED_INTERRUPT_INSTANCE_KEY = '__interrupt_instance_id__';\n\n/**\n * The answer as it leaves: the kind's resume value stamped with the park it\n * answers (`__interrupt_id__`, `__interrupt_instance_id__`) and serialized as\n * plain JSON, so an optional field a card left unset never reaches statewire\n * as `undefined` (an invalid document there).\n */\nexport function stampTypedInterruptAnswer({\n payload,\n value,\n}: {\n payload: TypedInterruptPayload;\n value: Readonly<Record<string, unknown>>;\n}): Record<string, unknown> {\n const stamped = {\n ...value,\n [TYPED_INTERRUPT_ID_KEY]: payload.source,\n [TYPED_INTERRUPT_INSTANCE_KEY]: payload.interrupt_instance_id,\n };\n const parsed: unknown = JSON.parse(JSON.stringify(stamped));\n return isRecord(parsed) ? parsed : {};\n}\n\n/** `{ action: 'cancel' }`: every typed raiser ends the interrupted operation (`FormCancelledError`). */\nexport function typedInterruptCancel(): Record<string, string> {\n return { action: 'cancel' };\n}\n\n// ── Timeouts ─────────────────────────────────────────────────────────────\n\n/** Whether the backend's timer answers this park for the person at a deadline. */\nexport function hasInterruptTimeout(payload: TypedInterruptPayload): boolean {\n return payload.timeout_seconds !== undefined && payload.timeout_at !== undefined;\n}\n\n/** Seconds until the backend's timer answers (never negative), or `null` without one. */\nexport function interruptTimeoutRemaining(\n payload: TypedInterruptPayload,\n now: number = Date.now(),\n): number | null {\n if (!payload.timeout_at) return null;\n const deadline = new Date(payload.timeout_at).getTime();\n if (Number.isNaN(deadline)) return null;\n return Math.max(0, (deadline - now) / 1000);\n}\n\n/**\n * The park's message without the raiser's `(timeout in 180s)` suffix, for\n * once the person stopped the timer and the card says \"take your time\".\n */\nexport function stripInterruptTimeoutText(message: string | null | undefined): string {\n if (!message) return '';\n return message.replace(/\\s*\\(timeout in \\d+s\\)/, '');\n}\n\n/**\n * The key a timed interrupt's draft is saved under: the one the backend's\n * timer worker checks before it fires (`_draft_interrupt_id_for_timeout`: the\n * park's `timeout_at`, else its source). A draft under any other key does not\n * hold the timer.\n */\nexport function interruptDraftId(payload: TypedInterruptPayload): string {\n return payload.timeout_at ?? payload.source;\n}\n\n// ── Kinds ────────────────────────────────────────────────────────────────\n\nfunction isCustomWithSource(payload: TypedInterruptPayload, source: string): boolean {\n return payload.type === TypedInterruptType.CUSTOM && payload.source === source;\n}\n\nconst isStringArray = (value: unknown): value is string[] =>\n Array.isArray(value) && value.every(isString);\n\nfunction optionalText(value: unknown): string | null {\n return isString(value) ? value : null;\n}\n\n/** The kinds of question the `ask` tool asks. */\nexport const QuestionType = {\n TEXT: 'text',\n YES_NO: 'yes_no',\n SINGLE_CHOICE: 'single_choice',\n MULTI_CHOICE: 'multi_choice',\n} as const;\n\nexport type QuestionType = (typeof QuestionType)[keyof typeof QuestionType];\n\nconst QUESTION_TYPES: ReadonlySet<string> = new Set(Object.values(QuestionType));\n\nexport interface TypedQuestion {\n readonly text: string;\n readonly type: QuestionType;\n readonly options: readonly string[];\n /** The answer the agent recommends (an option, or `yes` / `no`); also the timeout's answer. */\n readonly recommended: string | null;\n}\n\nexport interface QuestionnaireContext {\n /** The questionnaire's own title, when the agent gave one. */\n readonly title: string | null;\n readonly questions: readonly TypedQuestion[];\n}\n\nexport function isQuestionnaireInterrupt(payload: TypedInterruptPayload): boolean {\n return isCustomWithSource(payload, TypedInterruptSource.ASK_QUESTIONNAIRE);\n}\n\n/** The questions the `ask` tool parked on (`misc_tools.py`), in order. */\nexport function readQuestionnaireContext(payload: TypedInterruptPayload): QuestionnaireContext {\n const { context } = payload;\n const questions = Array.isArray(context.questions)\n ? context.questions.filter(isRecord).map(\n (question): TypedQuestion => ({\n text: isString(question.text) ? question.text : '',\n type:\n isString(question.type) && QUESTION_TYPES.has(question.type)\n ? (question.type as QuestionType)\n : QuestionType.TEXT,\n options: isStringArray(question.options) ? question.options : [],\n recommended: optionalText(question.recommended),\n }),\n )\n : [];\n return { title: optionalText(context.title), questions };\n}\n\n/** One answer of a questionnaire's resume (`QuestionnaireAnswer`). */\nexport interface QuestionnaireAnswer {\n readonly value: string;\n readonly comment: string | null;\n}\n\n/** The questionnaire's resume (`QuestionnaireResume`); an empty list is the card's cancel. */\nexport function questionnaireResume(answers: readonly QuestionnaireAnswer[]): Record<string, unknown> {\n return { answers: answers.map(({ value, comment }) => ({ value, comment })) };\n}\n\n/** One toolkit `toggle_toolkit` proposes (`agent_config_tools.py`). */\nexport interface ToolkitSelectionItem {\n readonly toolkit_id: string;\n readonly display_name: string;\n readonly description: string | null;\n /** The agent's reason it needs this toolkit, shown to the person. */\n readonly rationale: string | null;\n /** Tools this toolkit adds beyond those already on (the tool cap's headroom). */\n readonly added_tool_count?: number;\n}\n\nexport interface ToolkitSelectionContext {\n readonly action: 'enable' | 'disable';\n readonly toolkits: readonly ToolkitSelectionItem[];\n /** Tools already on and the run's cap (enable only), so the card warns before a breach. */\n readonly current_tool_count?: number;\n readonly max_tools?: number;\n}\n\nexport function isToolkitSelectionInterrupt(payload: TypedInterruptPayload): boolean {\n return isCustomWithSource(payload, TypedInterruptSource.TOOLKIT_SELECTION);\n}\n\nconst NO_TOOLKIT_SELECTION: ToolkitSelectionContext = { action: 'enable', toolkits: [] };\n\nfunction readToolkitItem(value: unknown): ToolkitSelectionItem | null {\n if (!isRecord(value) || !isString(value.toolkit_id) || !isString(value.display_name)) return null;\n const { description, rationale, added_tool_count: added } = value;\n if (\n (description != null && !isString(description)) ||\n (rationale != null && !isString(rationale)) ||\n !isOptional(added, isFiniteNumber)\n ) {\n return null;\n }\n return {\n toolkit_id: value.toolkit_id,\n display_name: value.display_name,\n description: optionalText(description),\n rationale: optionalText(rationale),\n ...(isFiniteNumber(added) ? { added_tool_count: added } : {}),\n };\n}\n\n/**\n * The toolkits `toggle_toolkit` asks to turn on or off. Read whole or not at\n * all, as Olympus's schema reads it: a malformed context is an empty enable.\n */\nexport function readToolkitSelectionContext(payload: TypedInterruptPayload): ToolkitSelectionContext {\n const { context } = payload;\n const { action, toolkits, total, current_tool_count: current, max_tools: max } = context;\n if (action !== 'enable' && action !== 'disable') return NO_TOOLKIT_SELECTION;\n if (!Array.isArray(toolkits)) return NO_TOOLKIT_SELECTION;\n if (\n !isOptional(total, isFiniteNumber) ||\n !isOptional(current, isFiniteNumber) ||\n !isOptional(max, isFiniteNumber)\n ) {\n return NO_TOOLKIT_SELECTION;\n }\n const items = toolkits.map(readToolkitItem);\n if (items.some((item) => item === null)) return NO_TOOLKIT_SELECTION;\n return {\n action,\n toolkits: items as ToolkitSelectionItem[],\n ...(isFiniteNumber(current) ? { current_tool_count: current } : {}),\n ...(isFiniteNumber(max) ? { max_tools: max } : {}),\n };\n}\n\n/** The toolkit selection's resume (`ToolkitSelectionResume`). */\nexport function toolkitSelectionResume({\n action,\n approvedToolkitIds,\n reason,\n}: {\n action: 'approve' | 'reject';\n approvedToolkitIds: readonly string[];\n reason?: string;\n}): Record<string, unknown> {\n return {\n action,\n approved_toolkit_ids: action === 'approve' ? [...approvedToolkitIds] : [],\n ...(reason ? { reason } : {}),\n };\n}\n\n/** One saved login the browse-profile gate asks to use (`browse_profile_gate_node.py`). */\nexport interface BrowseProfileApprovalProfile {\n readonly profile_asset_id: string;\n /** What the ordinary approve grants: `session` (this browser session) or `attempt` (this one action). */\n readonly approval_scope: string | null;\n}\n\nexport interface BrowseProfileApprovalContext {\n readonly profiles: readonly BrowseProfileApprovalProfile[];\n /** Stamped when every shown profile may be approved for the rest of the thread. */\n readonly sessionApprovalAllowed: boolean;\n}\n\nexport function isBrowseProfileApprovalInterrupt(payload: TypedInterruptPayload): boolean {\n return isCustomWithSource(payload, TypedInterruptSource.BROWSE_PROFILE_APPROVAL);\n}\n\nexport function readBrowseProfileApprovalContext(\n payload: TypedInterruptPayload,\n): BrowseProfileApprovalContext {\n const approval = payload.context.browse_profile_approval;\n if (!isRecord(approval)) return { profiles: [], sessionApprovalAllowed: false };\n const profiles = Array.isArray(approval.profiles)\n ? approval.profiles.flatMap((profile): BrowseProfileApprovalProfile[] =>\n isRecord(profile) && isString(profile.profile_asset_id)\n ? [\n {\n profile_asset_id: profile.profile_asset_id,\n approval_scope: optionalText(profile.approval_scope),\n },\n ]\n : [],\n )\n : [];\n return { profiles, sessionApprovalAllowed: approval.session_approval_allowed === true };\n}\n\n/** The browse-profile gate's resume (`BrowseProfileApprovalResume`). */\nexport function browseProfileApprovalResume({\n action,\n forSession = false,\n}: {\n action: 'approve' | 'reject';\n /** On an approve: stop asking about these profiles for the rest of the thread. */\n forSession?: boolean;\n}): Record<string, unknown> {\n return action === 'approve' && forSession ? { action, scope: 'session' } : { action };\n}\n\nexport function isPmScheduleApprovalInterrupt(payload: TypedInterruptPayload): boolean {\n return isCustomWithSource(payload, TypedInterruptSource.PM_SCHEDULE_APPROVAL);\n}\n\n/** The project manager schedule a person approves (`pm_tools.py`). */\nexport interface PmScheduleApprovalContext {\n /** `delete` for a deletion; anything else is a creation. */\n readonly action: string | null;\n /** The schedule's facts, in the card's order, by their context key. */\n readonly fields: readonly (readonly [key: string, value: string])[];\n}\n\nconst PM_SCHEDULE_FIELDS = [\n 'project_asset_id',\n 'cron',\n 'timezone',\n 'summary',\n 'scheduled_for',\n 'schedule_id',\n] as const;\n\nexport function readPmScheduleApprovalContext(payload: TypedInterruptPayload): PmScheduleApprovalContext {\n const { context } = payload;\n // Only the facts the schedule has, as Olympus's card lists them.\n const fields = PM_SCHEDULE_FIELDS.flatMap((key): (readonly [string, string])[] => {\n const value = context[key];\n return value ? [[key, String(value)]] : [];\n });\n return { action: optionalText(context.action), fields };\n}\n\n/** An approval's resume (`HITLResume`, `PMScheduleApprovalResume`): approve, or reject with a reason. */\nexport function typedApprovalResume({\n action,\n reason,\n}: {\n action: 'approve' | 'reject';\n reason?: string;\n}): Record<string, unknown> {\n return reason ? { action, reason } : { action };\n}\n\nexport function isWaitForMinutesInterrupt(payload: TypedInterruptPayload): boolean {\n return isCustomWithSource(payload, TypedInterruptSource.WAIT_FOR_MINUTES);\n}\n\n/** The wait `wait_for_minutes` announced (`misc_tools.py`). */\nexport interface WaitForMinutesContext {\n readonly minutes: number;\n readonly reason: string | null;\n /** The whole wait in seconds, when the raiser stamped it on the context. */\n readonly timeoutSeconds: number | null;\n}\n\n/**\n * Each field on its own: the raiser sends `reason: null` for a wait without\n * one, which must not lose the minutes.\n */\nexport function readWaitForMinutesContext(payload: TypedInterruptPayload): WaitForMinutesContext {\n const { minutes, reason, timeout_seconds: timeoutSeconds } = payload.context;\n return {\n minutes: isFiniteNumber(minutes) ? minutes : 0,\n reason: isString(reason) && reason ? reason : null,\n timeoutSeconds: isFiniteNumber(timeoutSeconds) ? timeoutSeconds : null,\n };\n}\n\nexport function isRequestFileInterrupt(payload: TypedInterruptPayload): boolean {\n return isCustomWithSource(payload, TypedInterruptSource.REQUEST_FILE);\n}\n\n/** What `request_file_from_user` asks for (`misc_tools.py`). */\nexport interface RequestFileContext {\n readonly prompt: string;\n readonly allowMultiple: boolean;\n}\n\nexport function readRequestFileContext(payload: TypedInterruptPayload): RequestFileContext {\n const { prompt, allow_multiple: allowMultiple } = payload.context;\n return {\n prompt: (isString(prompt) && prompt) || payload.message || 'Upload a file to continue.',\n allowMultiple: allowMultiple === true,\n };\n}\n\n/** One uploaded file of `request_file_from_user`'s resume (`RequestedFile`). */\nexport interface RequestedFile {\n readonly asset_id: string;\n readonly filename: string;\n /** The `[@title](link)` mention the agent can quote. */\n readonly mention: string | null;\n}\n\n/** The file request's resume (`RequestFileResume`). */\nexport function requestFileResume(files: readonly RequestedFile[]): Record<string, unknown> {\n return {\n files: files.map(({ asset_id, filename, mention }) => ({ asset_id, filename, mention })),\n };\n}\n\n/** The gated call of a tool-raised HITL approval (`raise_hitl_interrupt`). */\nexport interface TypedHitlContext {\n readonly toolId: string | null;\n readonly toolCallId: string | null;\n readonly toolArgs: Readonly<Record<string, unknown>>;\n /** What the backend resolved about the call before asking (`approval_context`). */\n readonly approvalContext: unknown;\n}\n\nexport function readTypedHitlContext(payload: TypedInterruptPayload): TypedHitlContext {\n const { context } = payload;\n return {\n toolId: optionalText(context.tool_id),\n toolCallId: optionalText(context.tool_call_id),\n toolArgs: isRecord(context.tool_args) ? context.tool_args : {},\n approvalContext: context.approval_context,\n };\n}\n"],"names":[],"mappings":";AAeA,SAAS,SAAS,OAAkD;AAClE,SAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,KAAK;AAC5E;AAEA,SAAS,WAAc,OAAgB,OAAwD;AAC7F,SAAO,UAAU,UAAa,MAAM,KAAK;AAC3C;AAEA,MAAM,WAAW,CAAC,UAAoC,OAAO,UAAU;AACvE,MAAM,iBAAiB,CAAC,UACtB,OAAO,UAAU,YAAY,OAAO,SAAS,KAAK;AAWpD,MAAM,6CAAkD,IAAI;AAAA,EAC1D,qBAAqB;AAAA,EACrB,qBAAqB;AAAA,EACrB,qBAAqB;AACvB,CAAC;AAEM,SAAS,yBAAyB,SAAyC;AAChF,SAAO,QAAQ,SAAS,mBAAmB,QAAQ,uBAAuB,IAAI,QAAQ,MAAM;AAC9F;AAOA,MAAM,4BAAiD,oBAAI,IAAI,CAAC,UAAU,QAAQ,CAAC;AAG5E,SAAS,4BAA4B,OAAyB;AACnE,MAAI,CAAC,SAAS,KAAK,EAAG,QAAO;AAC7B,SAAO,EAAE,OAAO,MAAM,WAAW,YAAY,0BAA0B,IAAI,MAAM,MAAM;AACzF;AAGO,MAAM,yBAAyB;AAC/B,MAAM,+BAA+B;AAQrC,SAAS,0BAA0B;AAAA,EACxC;AAAA,EACA;AACF,GAG4B;AAC1B,QAAM,UAAU;AAAA,IACd,GAAG;AAAA,IACH,CAAC,sBAAsB,GAAG,QAAQ;AAAA,IAClC,CAAC,4BAA4B,GAAG,QAAQ;AAAA,EAAA;AAE1C,QAAM,SAAkB,KAAK,MAAM,KAAK,UAAU,OAAO,CAAC;AAC1D,SAAO,SAAS,MAAM,IAAI,SAAS,CAAA;AACrC;AAGO,SAAS,uBAA+C;AAC7D,SAAO,EAAE,QAAQ,SAAA;AACnB;AAKO,SAAS,oBAAoB,SAAyC;AAC3E,SAAO,QAAQ,oBAAoB,UAAa,QAAQ,eAAe;AACzE;AAGO,SAAS,0BACd,SACA,MAAc,KAAK,OACJ;AACf,MAAI,CAAC,QAAQ,WAAY,QAAO;AAChC,QAAM,WAAW,IAAI,KAAK,QAAQ,UAAU,EAAE,QAAA;AAC9C,MAAI,OAAO,MAAM,QAAQ,EAAG,QAAO;AACnC,SAAO,KAAK,IAAI,IAAI,WAAW,OAAO,GAAI;AAC5C;AAMO,SAAS,0BAA0B,SAA4C;AACpF,MAAI,CAAC,QAAS,QAAO;AACrB,SAAO,QAAQ,QAAQ,0BAA0B,EAAE;AACrD;AAQO,SAAS,iBAAiB,SAAwC;AACvE,SAAO,QAAQ,cAAc,QAAQ;AACvC;AAIA,SAAS,mBAAmB,SAAgC,QAAyB;AACnF,SAAO,QAAQ,SAAS,mBAAmB,UAAU,QAAQ,WAAW;AAC1E;AAEA,MAAM,gBAAgB,CAAC,UACrB,MAAM,QAAQ,KAAK,KAAK,MAAM,MAAM,QAAQ;AAE9C,SAAS,aAAa,OAA+B;AACnD,SAAO,SAAS,KAAK,IAAI,QAAQ;AACnC;AAGO,MAAM,eAAe;AAAA,EAC1B,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,eAAe;AAAA,EACf,cAAc;AAChB;AAIA,MAAM,iBAAsC,IAAI,IAAI,OAAO,OAAO,YAAY,CAAC;AAgBxE,SAAS,yBAAyB,SAAyC;AAChF,SAAO,mBAAmB,SAAS,qBAAqB,iBAAiB;AAC3E;AAGO,SAAS,yBAAyB,SAAsD;AAC7F,QAAM,EAAE,YAAY;AACpB,QAAM,YAAY,MAAM,QAAQ,QAAQ,SAAS,IAC7C,QAAQ,UAAU,OAAO,QAAQ,EAAE;AAAA,IACjC,CAAC,cAA6B;AAAA,MAC5B,MAAM,SAAS,SAAS,IAAI,IAAI,SAAS,OAAO;AAAA,MAChD,MACE,SAAS,SAAS,IAAI,KAAK,eAAe,IAAI,SAAS,IAAI,IACtD,SAAS,OACV,aAAa;AAAA,MACnB,SAAS,cAAc,SAAS,OAAO,IAAI,SAAS,UAAU,CAAA;AAAA,MAC9D,aAAa,aAAa,SAAS,WAAW;AAAA,IAAA;AAAA,EAChD,IAEF,CAAA;AACJ,SAAO,EAAE,OAAO,aAAa,QAAQ,KAAK,GAAG,UAAA;AAC/C;AASO,SAAS,oBAAoB,SAAkE;AACpG,SAAO,EAAE,SAAS,QAAQ,IAAI,CAAC,EAAE,OAAO,QAAA,OAAe,EAAE,OAAO,QAAA,EAAU,EAAA;AAC5E;AAqBO,SAAS,4BAA4B,SAAyC;AACnF,SAAO,mBAAmB,SAAS,qBAAqB,iBAAiB;AAC3E;AAEA,MAAM,uBAAgD,EAAE,QAAQ,UAAU,UAAU,CAAA,EAAC;AAErF,SAAS,gBAAgB,OAA6C;AACpE,MAAI,CAAC,SAAS,KAAK,KAAK,CAAC,SAAS,MAAM,UAAU,KAAK,CAAC,SAAS,MAAM,YAAY,EAAG,QAAO;AAC7F,QAAM,EAAE,aAAa,WAAW,kBAAkB,UAAU;AAC5D,MACG,eAAe,QAAQ,CAAC,SAAS,WAAW,KAC5C,aAAa,QAAQ,CAAC,SAAS,SAAS,KACzC,CAAC,WAAW,OAAO,cAAc,GACjC;AACA,WAAO;AAAA,EACT;AACA,SAAO;AAAA,IACL,YAAY,MAAM;AAAA,IAClB,cAAc,MAAM;AAAA,IACpB,aAAa,aAAa,WAAW;AAAA,IACrC,WAAW,aAAa,SAAS;AAAA,IACjC,GAAI,eAAe,KAAK,IAAI,EAAE,kBAAkB,MAAA,IAAU,CAAA;AAAA,EAAC;AAE/D;AAMO,SAAS,4BAA4B,SAAyD;AACnG,QAAM,EAAE,YAAY;AACpB,QAAM,EAAE,QAAQ,UAAU,OAAO,oBAAoB,SAAS,WAAW,QAAQ;AACjF,MAAI,WAAW,YAAY,WAAW,UAAW,QAAO;AACxD,MAAI,CAAC,MAAM,QAAQ,QAAQ,EAAG,QAAO;AACrC,MACE,CAAC,WAAW,OAAO,cAAc,KACjC,CAAC,WAAW,SAAS,cAAc,KACnC,CAAC,WAAW,KAAK,cAAc,GAC/B;AACA,WAAO;AAAA,EACT;AACA,QAAM,QAAQ,SAAS,IAAI,eAAe;AAC1C,MAAI,MAAM,KAAK,CAAC,SAAS,SAAS,IAAI,EAAG,QAAO;AAChD,SAAO;AAAA,IACL;AAAA,IACA,UAAU;AAAA,IACV,GAAI,eAAe,OAAO,IAAI,EAAE,oBAAoB,QAAA,IAAY,CAAA;AAAA,IAChE,GAAI,eAAe,GAAG,IAAI,EAAE,WAAW,IAAA,IAAQ,CAAA;AAAA,EAAC;AAEpD;AAGO,SAAS,uBAAuB;AAAA,EACrC;AAAA,EACA;AAAA,EACA;AACF,GAI4B;AAC1B,SAAO;AAAA,IACL;AAAA,IACA,sBAAsB,WAAW,YAAY,CAAC,GAAG,kBAAkB,IAAI,CAAA;AAAA,IACvE,GAAI,SAAS,EAAE,WAAW,CAAA;AAAA,EAAC;AAE/B;AAeO,SAAS,iCAAiC,SAAyC;AACxF,SAAO,mBAAmB,SAAS,qBAAqB,uBAAuB;AACjF;AAEO,SAAS,iCACd,SAC8B;AAC9B,QAAM,WAAW,QAAQ,QAAQ;AACjC,MAAI,CAAC,SAAS,QAAQ,EAAG,QAAO,EAAE,UAAU,CAAA,GAAI,wBAAwB,MAAA;AACxE,QAAM,WAAW,MAAM,QAAQ,SAAS,QAAQ,IAC5C,SAAS,SAAS;AAAA,IAAQ,CAAC,YACzB,SAAS,OAAO,KAAK,SAAS,QAAQ,gBAAgB,IAClD;AAAA,MACE;AAAA,QACE,kBAAkB,QAAQ;AAAA,QAC1B,gBAAgB,aAAa,QAAQ,cAAc;AAAA,MAAA;AAAA,IACrD,IAEF,CAAA;AAAA,EAAC,IAEP,CAAA;AACJ,SAAO,EAAE,UAAU,wBAAwB,SAAS,6BAA6B,KAAA;AACnF;AAGO,SAAS,4BAA4B;AAAA,EAC1C;AAAA,EACA,aAAa;AACf,GAI4B;AAC1B,SAAO,WAAW,aAAa,aAAa,EAAE,QAAQ,OAAO,cAAc,EAAE,OAAA;AAC/E;AAEO,SAAS,8BAA8B,SAAyC;AACrF,SAAO,mBAAmB,SAAS,qBAAqB,oBAAoB;AAC9E;AAUA,MAAM,qBAAqB;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEO,SAAS,8BAA8B,SAA2D;AACvG,QAAM,EAAE,YAAY;AAEpB,QAAM,SAAS,mBAAmB,QAAQ,CAAC,QAAuC;AAChF,UAAM,QAAQ,QAAQ,GAAG;AACzB,WAAO,QAAQ,CAAC,CAAC,KAAK,OAAO,KAAK,CAAC,CAAC,IAAI,CAAA;AAAA,EAC1C,CAAC;AACD,SAAO,EAAE,QAAQ,aAAa,QAAQ,MAAM,GAAG,OAAA;AACjD;AAGO,SAAS,oBAAoB;AAAA,EAClC;AAAA,EACA;AACF,GAG4B;AAC1B,SAAO,SAAS,EAAE,QAAQ,OAAA,IAAW,EAAE,OAAA;AACzC;AAEO,SAAS,0BAA0B,SAAyC;AACjF,SAAO,mBAAmB,SAAS,qBAAqB,gBAAgB;AAC1E;AAcO,SAAS,0BAA0B,SAAuD;AAC/F,QAAM,EAAE,SAAS,QAAQ,iBAAiB,eAAA,IAAmB,QAAQ;AACrE,SAAO;AAAA,IACL,SAAS,eAAe,OAAO,IAAI,UAAU;AAAA,IAC7C,QAAQ,SAAS,MAAM,KAAK,SAAS,SAAS;AAAA,IAC9C,gBAAgB,eAAe,cAAc,IAAI,iBAAiB;AAAA,EAAA;AAEtE;AAEO,SAAS,uBAAuB,SAAyC;AAC9E,SAAO,mBAAmB,SAAS,qBAAqB,YAAY;AACtE;AAQO,SAAS,uBAAuB,SAAoD;AACzF,QAAM,EAAE,QAAQ,gBAAgB,cAAA,IAAkB,QAAQ;AAC1D,SAAO;AAAA,IACL,QAAS,SAAS,MAAM,KAAK,UAAW,QAAQ,WAAW;AAAA,IAC3D,eAAe,kBAAkB;AAAA,EAAA;AAErC;AAWO,SAAS,kBAAkB,OAA0D;AAC1F,SAAO;AAAA,IACL,OAAO,MAAM,IAAI,CAAC,EAAE,UAAU,UAAU,QAAA,OAAe,EAAE,UAAU,UAAU,UAAU;AAAA,EAAA;AAE3F;AAWO,SAAS,qBAAqB,SAAkD;AACrF,QAAM,EAAE,YAAY;AACpB,SAAO;AAAA,IACL,QAAQ,aAAa,QAAQ,OAAO;AAAA,IACpC,YAAY,aAAa,QAAQ,YAAY;AAAA,IAC7C,UAAU,SAAS,QAAQ,SAAS,IAAI,QAAQ,YAAY,CAAA;AAAA,IAC5D,iBAAiB,QAAQ;AAAA,EAAA;AAE7B;"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const interrupts = require("./interrupts.cjs");
|
|
4
|
+
const TypedInterruptType = {
|
|
5
|
+
HITL: "hitl",
|
|
6
|
+
FORM_INPUT: "form_input",
|
|
7
|
+
CUSTOM: "custom"
|
|
8
|
+
};
|
|
9
|
+
const TYPED_INTERRUPT_TYPES = new Set(Object.values(TypedInterruptType));
|
|
10
|
+
const TypedInterruptSource = {
|
|
11
|
+
ASK_QUESTIONNAIRE: "ask_questionnaire",
|
|
12
|
+
DEEP_RESEARCH_PENDING: "deep_research_pending",
|
|
13
|
+
PM_SCHEDULE_APPROVAL: "pm_schedule_approval",
|
|
14
|
+
WAIT_FOR_MINUTES: "wait_for_minutes",
|
|
15
|
+
BROWSE_PROFILE_APPROVAL: "browse_profile_approval",
|
|
16
|
+
TOOLKIT_SELECTION: "toolkit_selection",
|
|
17
|
+
REQUEST_FILE: "request_file"
|
|
18
|
+
};
|
|
19
|
+
function isRecord(value) {
|
|
20
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
21
|
+
}
|
|
22
|
+
function isOptional(value, check) {
|
|
23
|
+
return value === void 0 || check(value);
|
|
24
|
+
}
|
|
25
|
+
const isString = (value) => typeof value === "string";
|
|
26
|
+
const isBoolean = (value) => typeof value === "boolean";
|
|
27
|
+
const isFiniteNumber = (value) => typeof value === "number" && Number.isFinite(value);
|
|
28
|
+
function parseTypedInterruptPayload(value) {
|
|
29
|
+
if (!isRecord(value)) return null;
|
|
30
|
+
const { source, type, origin, message, timestamp, context } = value;
|
|
31
|
+
if (!isString(source) || !isString(type) || !TYPED_INTERRUPT_TYPES.has(type)) return null;
|
|
32
|
+
if (!isString(origin) || !isString(message) || !isFiniteNumber(timestamp)) return null;
|
|
33
|
+
if (!isOptional(value.requires_user_action, isBoolean) || !isOptional(value.timeout_seconds, isFiniteNumber) || !isOptional(value.timeout_at, isString) || !isOptional(value.timeout_default_value, isRecord) || !isOptional(value.interrupt_instance_id, isString)) {
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
36
|
+
return { ...value, context: isRecord(context) ? context : {} };
|
|
37
|
+
}
|
|
38
|
+
function isTypedInterruptRequest(request) {
|
|
39
|
+
if (!interrupts.isApprovalCardInterrupt(request)) return false;
|
|
40
|
+
const payload = request.payload;
|
|
41
|
+
if (interrupts.asHitlApproval(payload) !== null) return false;
|
|
42
|
+
return parseTypedInterruptPayload(payload) !== null;
|
|
43
|
+
}
|
|
44
|
+
exports.TypedInterruptSource = TypedInterruptSource;
|
|
45
|
+
exports.TypedInterruptType = TypedInterruptType;
|
|
46
|
+
exports.isTypedInterruptRequest = isTypedInterruptRequest;
|
|
47
|
+
exports.parseTypedInterruptPayload = parseTypedInterruptPayload;
|
|
48
|
+
//# sourceMappingURL=typed-interrupts.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typed-interrupts.cjs","sources":["../../../../agent-runtime/src/typed-interrupts.ts"],"sourcesContent":["/**\n * The typed Athena interrupts: what a tool parks a run on through agora's\n * `raise_hitl_interrupt`, `raise_form_interrupt` and `raise_custom_interrupt`\n * (`agora/services/interrupts/utils.py`), each answered with the resume shape\n * its raiser validates (`agora/services/interrupts/definitions.py`). The\n * deepagents `hitl_approval` park is not one of them: the approval card\n * answers that (`asHitlApproval`).\n *\n * This module is the payload contract's selector, which every chat carries:\n * which parks are typed (`isTypedInterruptRequest`, the one selector) and the\n * payload they carry. What a card needs beyond it (each kind's reader and\n * resume, which answers approve, the stale-resume stamps, the timer) is\n * `typed-interrupt-kinds.ts`, kept apart so a host's startup bundle carries only\n * the selector while the cards load later. Both mirror Olympus's\n * `config/interruptDefinitions.ts` field for field (a payload either side calls\n * typed, the other does too) without zod, which the React SDK's published\n * bundle may not carry. Rendering stays with each surface.\n */\n\nimport type { StatewireThread } from '@assistant-ui/react-statewire';\nimport { asHitlApproval, isApprovalCardInterrupt } from './interrupts';\n\n/** The three types the server raises (`InterruptType` in `definitions.py`). */\nexport const TypedInterruptType = {\n HITL: 'hitl',\n FORM_INPUT: 'form_input',\n CUSTOM: 'custom',\n} as const;\n\nexport type TypedInterruptType = (typeof TypedInterruptType)[keyof typeof TypedInterruptType];\n\nconst TYPED_INTERRUPT_TYPES: ReadonlySet<string> = new Set(Object.values(TypedInterruptType));\n\n/** The `custom` sources a surface has a card of its own for (`interrupt_id` at the raise site). */\nexport const TypedInterruptSource = {\n ASK_QUESTIONNAIRE: 'ask_questionnaire',\n DEEP_RESEARCH_PENDING: 'deep_research_pending',\n PM_SCHEDULE_APPROVAL: 'pm_schedule_approval',\n WAIT_FOR_MINUTES: 'wait_for_minutes',\n BROWSE_PROFILE_APPROVAL: 'browse_profile_approval',\n TOOLKIT_SELECTION: 'toolkit_selection',\n REQUEST_FILE: 'request_file',\n} as const;\n\nexport type TypedInterruptSource = (typeof TypedInterruptSource)[keyof typeof TypedInterruptSource];\n\n/** A parked typed interrupt, as the raiser published it. */\nexport interface TypedInterruptPayload {\n /** The interrupt id: `ask_questionnaire`, `toolkit_selection`, `hitl_<tool>`, a form id… */\n readonly source: string;\n readonly type: TypedInterruptType;\n /** Who raised it (`tool:ask`, `tool:toggle_toolkit`…). */\n readonly origin: string;\n readonly message: string;\n /** The kind's own fields (questions, toolkits, the gated call…); `{}` when the raiser sent none. */\n readonly context: Readonly<Record<string, unknown>>;\n readonly timestamp: number;\n /** The resume model's JSON Schema (a form's fields). */\n readonly schema?: unknown;\n /** `false` on a system pause nobody answers (a background research wait). */\n readonly requires_user_action?: boolean;\n readonly timeout_seconds?: number;\n /** When the backend's timer answers for the person (ISO 8601 UTC). */\n readonly timeout_at?: string;\n readonly timeout_default_value?: Readonly<Record<string, unknown>>;\n /** The instance the raiser's stale-resume check compares (HITL parks carry it). */\n readonly interrupt_instance_id?: string;\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nfunction isOptional<T>(value: unknown, check: (candidate: unknown) => candidate is T): boolean {\n return value === undefined || check(value);\n}\n\nconst isString = (value: unknown): value is string => typeof value === 'string';\nconst isBoolean = (value: unknown): value is boolean => typeof value === 'boolean';\nconst isFiniteNumber = (value: unknown): value is number =>\n typeof value === 'number' && Number.isFinite(value);\n\n/**\n * The payload as a typed interrupt, or `null` when it is not one. Reads what\n * Olympus's `InterruptPayloadSchema` reads, with the same required fields\n * (`source`, `type`, `origin`, `message`, `timestamp`) and the same optional\n * ones, so a park is typed on every surface or on none. A missing or malformed\n * `context` reads as `{}`, as the schema's `.catch({})` does.\n */\nexport function parseTypedInterruptPayload(value: unknown): TypedInterruptPayload | null {\n if (!isRecord(value)) return null;\n const { source, type, origin, message, timestamp, context } = value;\n if (!isString(source) || !isString(type) || !TYPED_INTERRUPT_TYPES.has(type)) return null;\n if (!isString(origin) || !isString(message) || !isFiniteNumber(timestamp)) return null;\n if (\n !isOptional(value.requires_user_action, isBoolean) ||\n !isOptional(value.timeout_seconds, isFiniteNumber) ||\n !isOptional(value.timeout_at, isString) ||\n !isOptional(value.timeout_default_value, isRecord) ||\n !isOptional(value.interrupt_instance_id, isString)\n ) {\n return null;\n }\n return { ...value, context: isRecord(context) ? context : {} } as unknown as TypedInterruptPayload;\n}\n\n/**\n * The one selector for \"a pending park a typed card answers\": an approval-card\n * interrupt (neither a client tool's park nor a system pause), not the\n * deepagents HITL approval the approval card answers, and parsing as a typed\n * interrupt. The card renders for the request this selects and its answer is\n * sent under that same request.\n */\nexport function isTypedInterruptRequest(\n request: StatewireThread.InputRequestState,\n): request is StatewireThread.CustomInputRequest {\n if (!isApprovalCardInterrupt(request)) return false;\n const payload: unknown = (request as { payload?: unknown }).payload;\n if (asHitlApproval(payload) !== null) return false;\n return parseTypedInterruptPayload(payload) !== null;\n}\n"],"names":["isApprovalCardInterrupt","asHitlApproval"],"mappings":";;;AAuBO,MAAM,qBAAqB;AAAA,EAChC,MAAM;AAAA,EACN,YAAY;AAAA,EACZ,QAAQ;AACV;AAIA,MAAM,wBAA6C,IAAI,IAAI,OAAO,OAAO,kBAAkB,CAAC;AAGrF,MAAM,uBAAuB;AAAA,EAClC,mBAAmB;AAAA,EACnB,uBAAuB;AAAA,EACvB,sBAAsB;AAAA,EACtB,kBAAkB;AAAA,EAClB,yBAAyB;AAAA,EACzB,mBAAmB;AAAA,EACnB,cAAc;AAChB;AA2BA,SAAS,SAAS,OAAkD;AAClE,SAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,KAAK;AAC5E;AAEA,SAAS,WAAc,OAAgB,OAAwD;AAC7F,SAAO,UAAU,UAAa,MAAM,KAAK;AAC3C;AAEA,MAAM,WAAW,CAAC,UAAoC,OAAO,UAAU;AACvE,MAAM,YAAY,CAAC,UAAqC,OAAO,UAAU;AACzE,MAAM,iBAAiB,CAAC,UACtB,OAAO,UAAU,YAAY,OAAO,SAAS,KAAK;AAS7C,SAAS,2BAA2B,OAA8C;AACvF,MAAI,CAAC,SAAS,KAAK,EAAG,QAAO;AAC7B,QAAM,EAAE,QAAQ,MAAM,QAAQ,SAAS,WAAW,YAAY;AAC9D,MAAI,CAAC,SAAS,MAAM,KAAK,CAAC,SAAS,IAAI,KAAK,CAAC,sBAAsB,IAAI,IAAI,EAAG,QAAO;AACrF,MAAI,CAAC,SAAS,MAAM,KAAK,CAAC,SAAS,OAAO,KAAK,CAAC,eAAe,SAAS,EAAG,QAAO;AAClF,MACE,CAAC,WAAW,MAAM,sBAAsB,SAAS,KACjD,CAAC,WAAW,MAAM,iBAAiB,cAAc,KACjD,CAAC,WAAW,MAAM,YAAY,QAAQ,KACtC,CAAC,WAAW,MAAM,uBAAuB,QAAQ,KACjD,CAAC,WAAW,MAAM,uBAAuB,QAAQ,GACjD;AACA,WAAO;AAAA,EACT;AACA,SAAO,EAAE,GAAG,OAAO,SAAS,SAAS,OAAO,IAAI,UAAU,GAAC;AAC7D;AASO,SAAS,wBACd,SAC+C;AAC/C,MAAI,CAACA,WAAAA,wBAAwB,OAAO,EAAG,QAAO;AAC9C,QAAM,UAAoB,QAAkC;AAC5D,MAAIC,0BAAe,OAAO,MAAM,KAAM,QAAO;AAC7C,SAAO,2BAA2B,OAAO,MAAM;AACjD;;;;;"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The typed Athena interrupts: what a tool parks a run on through agora's
|
|
3
|
+
* `raise_hitl_interrupt`, `raise_form_interrupt` and `raise_custom_interrupt`
|
|
4
|
+
* (`agora/services/interrupts/utils.py`), each answered with the resume shape
|
|
5
|
+
* its raiser validates (`agora/services/interrupts/definitions.py`). The
|
|
6
|
+
* deepagents `hitl_approval` park is not one of them: the approval card
|
|
7
|
+
* answers that (`asHitlApproval`).
|
|
8
|
+
*
|
|
9
|
+
* This module is the payload contract's selector, which every chat carries:
|
|
10
|
+
* which parks are typed (`isTypedInterruptRequest`, the one selector) and the
|
|
11
|
+
* payload they carry. What a card needs beyond it (each kind's reader and
|
|
12
|
+
* resume, which answers approve, the stale-resume stamps, the timer) is
|
|
13
|
+
* `typed-interrupt-kinds.ts`, kept apart so a host's startup bundle carries only
|
|
14
|
+
* the selector while the cards load later. Both mirror Olympus's
|
|
15
|
+
* `config/interruptDefinitions.ts` field for field (a payload either side calls
|
|
16
|
+
* typed, the other does too) without zod, which the React SDK's published
|
|
17
|
+
* bundle may not carry. Rendering stays with each surface.
|
|
18
|
+
*/
|
|
19
|
+
import type { StatewireThread } from '@assistant-ui/react-statewire';
|
|
20
|
+
/** The three types the server raises (`InterruptType` in `definitions.py`). */
|
|
21
|
+
export declare const TypedInterruptType: {
|
|
22
|
+
readonly HITL: 'hitl';
|
|
23
|
+
readonly FORM_INPUT: 'form_input';
|
|
24
|
+
readonly CUSTOM: 'custom';
|
|
25
|
+
};
|
|
26
|
+
export type TypedInterruptType = (typeof TypedInterruptType)[keyof typeof TypedInterruptType];
|
|
27
|
+
/** The `custom` sources a surface has a card of its own for (`interrupt_id` at the raise site). */
|
|
28
|
+
export declare const TypedInterruptSource: {
|
|
29
|
+
readonly ASK_QUESTIONNAIRE: 'ask_questionnaire';
|
|
30
|
+
readonly DEEP_RESEARCH_PENDING: 'deep_research_pending';
|
|
31
|
+
readonly PM_SCHEDULE_APPROVAL: 'pm_schedule_approval';
|
|
32
|
+
readonly WAIT_FOR_MINUTES: 'wait_for_minutes';
|
|
33
|
+
readonly BROWSE_PROFILE_APPROVAL: 'browse_profile_approval';
|
|
34
|
+
readonly TOOLKIT_SELECTION: 'toolkit_selection';
|
|
35
|
+
readonly REQUEST_FILE: 'request_file';
|
|
36
|
+
};
|
|
37
|
+
export type TypedInterruptSource = (typeof TypedInterruptSource)[keyof typeof TypedInterruptSource];
|
|
38
|
+
/** A parked typed interrupt, as the raiser published it. */
|
|
39
|
+
export interface TypedInterruptPayload {
|
|
40
|
+
/** The interrupt id: `ask_questionnaire`, `toolkit_selection`, `hitl_<tool>`, a form id… */
|
|
41
|
+
readonly source: string;
|
|
42
|
+
readonly type: TypedInterruptType;
|
|
43
|
+
/** Who raised it (`tool:ask`, `tool:toggle_toolkit`…). */
|
|
44
|
+
readonly origin: string;
|
|
45
|
+
readonly message: string;
|
|
46
|
+
/** The kind's own fields (questions, toolkits, the gated call…); `{}` when the raiser sent none. */
|
|
47
|
+
readonly context: Readonly<Record<string, unknown>>;
|
|
48
|
+
readonly timestamp: number;
|
|
49
|
+
/** The resume model's JSON Schema (a form's fields). */
|
|
50
|
+
readonly schema?: unknown;
|
|
51
|
+
/** `false` on a system pause nobody answers (a background research wait). */
|
|
52
|
+
readonly requires_user_action?: boolean;
|
|
53
|
+
readonly timeout_seconds?: number;
|
|
54
|
+
/** When the backend's timer answers for the person (ISO 8601 UTC). */
|
|
55
|
+
readonly timeout_at?: string;
|
|
56
|
+
readonly timeout_default_value?: Readonly<Record<string, unknown>>;
|
|
57
|
+
/** The instance the raiser's stale-resume check compares (HITL parks carry it). */
|
|
58
|
+
readonly interrupt_instance_id?: string;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* The payload as a typed interrupt, or `null` when it is not one. Reads what
|
|
62
|
+
* Olympus's `InterruptPayloadSchema` reads, with the same required fields
|
|
63
|
+
* (`source`, `type`, `origin`, `message`, `timestamp`) and the same optional
|
|
64
|
+
* ones, so a park is typed on every surface or on none. A missing or malformed
|
|
65
|
+
* `context` reads as `{}`, as the schema's `.catch({})` does.
|
|
66
|
+
*/
|
|
67
|
+
export declare function parseTypedInterruptPayload(value: unknown): TypedInterruptPayload | null;
|
|
68
|
+
/**
|
|
69
|
+
* The one selector for "a pending park a typed card answers": an approval-card
|
|
70
|
+
* interrupt (neither a client tool's park nor a system pause), not the
|
|
71
|
+
* deepagents HITL approval the approval card answers, and parsing as a typed
|
|
72
|
+
* interrupt. The card renders for the request this selects and its answer is
|
|
73
|
+
* sent under that same request.
|
|
74
|
+
*/
|
|
75
|
+
export declare function isTypedInterruptRequest(request: StatewireThread.InputRequestState): request is StatewireThread.CustomInputRequest;
|