@athenaintel/react 0.57.2 → 0.60.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +795 -12
- package/dist/agent-runtime/src/addressed-agents.cjs +16 -0
- package/dist/agent-runtime/src/addressed-agents.cjs.map +1 -0
- package/dist/agent-runtime/src/addressed-agents.d.ts +30 -0
- package/dist/agent-runtime/src/addressed-agents.js +16 -0
- package/dist/agent-runtime/src/addressed-agents.js.map +1 -0
- package/dist/agent-runtime/src/answer-label.cjs +4 -3
- package/dist/agent-runtime/src/answer-label.cjs.map +1 -1
- package/dist/agent-runtime/src/answer-label.d.ts +13 -6
- package/dist/agent-runtime/src/answer-label.js +4 -3
- package/dist/agent-runtime/src/answer-label.js.map +1 -1
- package/dist/agent-runtime/src/chat-outbox-attachments.cjs.map +1 -1
- package/dist/agent-runtime/src/chat-outbox-attachments.d.ts +1 -1
- package/dist/agent-runtime/src/chat-outbox-attachments.js.map +1 -1
- package/dist/agent-runtime/src/chat-outbox-entry.cjs +101 -0
- package/dist/agent-runtime/src/chat-outbox-entry.cjs.map +1 -0
- package/dist/agent-runtime/src/chat-outbox-entry.d.ts +99 -0
- package/dist/agent-runtime/src/chat-outbox-entry.js +101 -0
- package/dist/agent-runtime/src/chat-outbox-entry.js.map +1 -0
- package/dist/agent-runtime/src/chat-outbox-legacy.cjs +252 -0
- package/dist/agent-runtime/src/chat-outbox-legacy.cjs.map +1 -0
- package/dist/agent-runtime/src/chat-outbox-legacy.d.ts +96 -0
- package/dist/agent-runtime/src/chat-outbox-legacy.js +252 -0
- package/dist/agent-runtime/src/chat-outbox-legacy.js.map +1 -0
- package/dist/agent-runtime/src/chat-outbox-policy.cjs +30 -0
- package/dist/agent-runtime/src/chat-outbox-policy.cjs.map +1 -0
- package/dist/agent-runtime/src/chat-outbox-policy.d.ts +42 -0
- package/dist/agent-runtime/src/chat-outbox-policy.js +30 -0
- package/dist/agent-runtime/src/chat-outbox-policy.js.map +1 -0
- package/dist/agent-runtime/src/chat-outbox-storage.cjs +306 -0
- package/dist/agent-runtime/src/chat-outbox-storage.cjs.map +1 -0
- package/dist/agent-runtime/src/chat-outbox-storage.d.ts +194 -0
- package/dist/agent-runtime/src/chat-outbox-storage.js +306 -0
- package/dist/agent-runtime/src/chat-outbox-storage.js.map +1 -0
- package/dist/agent-runtime/src/chat-outbox-thread.cjs +21 -94
- package/dist/agent-runtime/src/chat-outbox-thread.cjs.map +1 -1
- package/dist/agent-runtime/src/chat-outbox-thread.d.ts +22 -18
- package/dist/agent-runtime/src/chat-outbox-thread.js +21 -94
- package/dist/agent-runtime/src/chat-outbox-thread.js.map +1 -1
- package/dist/agent-runtime/src/chat-outbox.cjs +492 -547
- package/dist/agent-runtime/src/chat-outbox.cjs.map +1 -1
- package/dist/agent-runtime/src/chat-outbox.d.ts +110 -142
- package/dist/agent-runtime/src/chat-outbox.js +492 -547
- package/dist/agent-runtime/src/chat-outbox.js.map +1 -1
- package/dist/agent-runtime/src/composer-markdown.cjs +0 -16
- package/dist/agent-runtime/src/composer-markdown.cjs.map +1 -1
- package/dist/agent-runtime/src/composer-markdown.d.ts +1 -1
- package/dist/agent-runtime/src/composer-markdown.js +1 -17
- package/dist/agent-runtime/src/composer-markdown.js.map +1 -1
- package/dist/agent-runtime/src/deep-agent-transport-recipe.cjs +3 -1
- package/dist/agent-runtime/src/deep-agent-transport-recipe.cjs.map +1 -1
- package/dist/agent-runtime/src/deep-agent-transport-recipe.d.ts +8 -1
- package/dist/agent-runtime/src/deep-agent-transport-recipe.js +3 -1
- package/dist/agent-runtime/src/deep-agent-transport-recipe.js.map +1 -1
- package/dist/agent-runtime/src/dictation-preferences.d.ts +356 -0
- package/dist/agent-runtime/src/dictation-record.d.ts +279 -0
- package/dist/agent-runtime/src/dictation-session.d.ts +106 -7
- package/dist/agent-runtime/src/dictation-snippets.d.ts +9 -0
- package/dist/agent-runtime/src/dictation-transfer.d.ts +142 -0
- package/dist/agent-runtime/src/edit-command.cjs.map +1 -1
- package/dist/agent-runtime/src/edit-command.d.ts +1 -1
- package/dist/agent-runtime/src/edit-command.js.map +1 -1
- package/dist/agent-runtime/src/errors.cjs +1 -0
- package/dist/agent-runtime/src/errors.cjs.map +1 -1
- package/dist/agent-runtime/src/errors.js +1 -0
- package/dist/agent-runtime/src/errors.js.map +1 -1
- package/dist/agent-runtime/src/generated/runconfig-contract.cjs +24 -0
- package/dist/agent-runtime/src/generated/runconfig-contract.cjs.map +1 -1
- package/dist/agent-runtime/src/generated/runconfig-contract.d.ts +3 -3
- package/dist/agent-runtime/src/generated/runconfig-contract.js +24 -0
- package/dist/agent-runtime/src/generated/runconfig-contract.js.map +1 -1
- package/dist/agent-runtime/src/index.d.ts +14 -8
- package/dist/agent-runtime/src/lane-follow.cjs +289 -0
- package/dist/agent-runtime/src/lane-follow.cjs.map +1 -0
- package/dist/agent-runtime/src/lane-follow.js +289 -0
- package/dist/agent-runtime/src/lane-follow.js.map +1 -0
- package/dist/agent-runtime/src/lane-images.cjs +387 -0
- package/dist/agent-runtime/src/lane-images.cjs.map +1 -0
- package/dist/agent-runtime/src/lane-images.js +387 -0
- package/dist/agent-runtime/src/lane-images.js.map +1 -0
- package/dist/agent-runtime/src/message-window.js +1 -1
- package/dist/agent-runtime/src/messages.cjs +19 -1
- package/dist/agent-runtime/src/messages.cjs.map +1 -1
- package/dist/agent-runtime/src/messages.d.ts +8 -0
- package/dist/agent-runtime/src/messages.js +21 -3
- package/dist/agent-runtime/src/messages.js.map +1 -1
- package/dist/agent-runtime/src/named-agents.cjs +301 -0
- package/dist/agent-runtime/src/named-agents.cjs.map +1 -0
- package/dist/agent-runtime/src/named-agents.d.ts +246 -0
- package/dist/agent-runtime/src/named-agents.js +301 -0
- package/dist/agent-runtime/src/named-agents.js.map +1 -0
- package/dist/agent-runtime/src/offline-status.cjs.map +1 -1
- package/dist/agent-runtime/src/offline-status.d.ts +93 -2
- package/dist/agent-runtime/src/offline-status.js.map +1 -1
- package/dist/agent-runtime/src/ptc-subcalls.cjs +41 -0
- package/dist/agent-runtime/src/ptc-subcalls.cjs.map +1 -0
- package/dist/agent-runtime/src/ptc-subcalls.js +41 -0
- package/dist/agent-runtime/src/ptc-subcalls.js.map +1 -0
- package/dist/agent-runtime/src/queue.cjs +2 -2
- package/dist/agent-runtime/src/queue.cjs.map +1 -1
- package/dist/agent-runtime/src/queue.d.ts +20 -25
- package/dist/agent-runtime/src/queue.js +2 -2
- package/dist/agent-runtime/src/queue.js.map +1 -1
- package/dist/agent-runtime/src/quota-safe-local-storage-session.cjs +314 -84
- package/dist/agent-runtime/src/quota-safe-local-storage-session.cjs.map +1 -1
- package/dist/agent-runtime/src/quota-safe-local-storage-session.d.ts +137 -40
- package/dist/agent-runtime/src/quota-safe-local-storage-session.js +318 -88
- package/dist/agent-runtime/src/quota-safe-local-storage-session.js.map +1 -1
- package/dist/agent-runtime/src/run-send.cjs +54 -0
- package/dist/agent-runtime/src/run-send.cjs.map +1 -0
- package/dist/agent-runtime/src/run-send.d.ts +51 -0
- package/dist/agent-runtime/src/run-send.js +54 -0
- package/dist/agent-runtime/src/run-send.js.map +1 -0
- package/dist/agent-runtime/src/running-tool-placeholder.cjs +6 -0
- package/dist/agent-runtime/src/running-tool-placeholder.cjs.map +1 -1
- package/dist/agent-runtime/src/running-tool-placeholder.js +6 -0
- package/dist/agent-runtime/src/running-tool-placeholder.js.map +1 -1
- package/dist/agent-runtime/src/runtime.d.ts +9 -5
- package/dist/agent-runtime/src/sealed-idb.cjs +64 -0
- package/dist/agent-runtime/src/sealed-idb.cjs.map +1 -1
- package/dist/agent-runtime/src/sealed-idb.d.ts +16 -0
- package/dist/agent-runtime/src/sealed-idb.js +64 -0
- package/dist/agent-runtime/src/sealed-idb.js.map +1 -1
- package/dist/agent-runtime/src/send-recovery.cjs +90 -118
- package/dist/agent-runtime/src/send-recovery.cjs.map +1 -1
- package/dist/agent-runtime/src/send-recovery.d.ts +25 -29
- package/dist/agent-runtime/src/send-recovery.js +90 -118
- package/dist/agent-runtime/src/send-recovery.js.map +1 -1
- package/dist/agent-runtime/src/statewire-diagnostics.d.ts +4 -1
- package/dist/agent-runtime/src/statewire-held-sends.cjs +191 -0
- package/dist/agent-runtime/src/statewire-held-sends.cjs.map +1 -0
- package/dist/agent-runtime/src/statewire-held-sends.d.ts +119 -0
- package/dist/agent-runtime/src/statewire-held-sends.js +191 -0
- package/dist/agent-runtime/src/statewire-held-sends.js.map +1 -0
- package/dist/agent-runtime/src/statewire-state.cjs +4 -0
- package/dist/agent-runtime/src/statewire-state.cjs.map +1 -1
- package/dist/agent-runtime/src/statewire-state.js +4 -0
- package/dist/agent-runtime/src/statewire-state.js.map +1 -1
- package/dist/agent-runtime/src/statewire-transport.cjs +8 -2
- package/dist/agent-runtime/src/statewire-transport.cjs.map +1 -1
- package/dist/agent-runtime/src/statewire-transport.d.ts +14 -5
- package/dist/agent-runtime/src/statewire-transport.js +8 -2
- package/dist/agent-runtime/src/statewire-transport.js.map +1 -1
- package/dist/agent-runtime/src/subagent-transcripts.cjs +1 -23
- package/dist/agent-runtime/src/subagent-transcripts.cjs.map +1 -1
- package/dist/agent-runtime/src/subagent-transcripts.js +3 -25
- package/dist/agent-runtime/src/subagent-transcripts.js.map +1 -1
- package/dist/agent-runtime/src/subagents.cjs +22 -29
- package/dist/agent-runtime/src/subagents.cjs.map +1 -1
- package/dist/agent-runtime/src/subagents.js +23 -30
- package/dist/agent-runtime/src/subagents.js.map +1 -1
- package/dist/agent-runtime/src/thread-extras.cjs +27 -19
- package/dist/agent-runtime/src/thread-extras.cjs.map +1 -1
- package/dist/agent-runtime/src/thread-extras.d.ts +19 -6
- package/dist/agent-runtime/src/thread-extras.js +27 -19
- package/dist/agent-runtime/src/thread-extras.js.map +1 -1
- package/dist/agent-runtime/src/thread-handoff-flow-machine.d.ts +8 -8
- package/dist/agent-runtime/src/tool-metadata.cjs +19 -0
- package/dist/agent-runtime/src/tool-metadata.cjs.map +1 -1
- package/dist/agent-runtime/src/tool-metadata.js +19 -0
- package/dist/agent-runtime/src/tool-metadata.js.map +1 -1
- package/dist/agent-runtime/src/tool-names.cjs +21 -0
- package/dist/agent-runtime/src/tool-names.cjs.map +1 -1
- package/dist/agent-runtime/src/tool-names.d.ts +8 -0
- package/dist/agent-runtime/src/tool-names.js +21 -0
- package/dist/agent-runtime/src/tool-names.js.map +1 -1
- package/dist/agent-runtime/src/typed-interrupt-kinds.cjs +247 -0
- package/dist/agent-runtime/src/typed-interrupt-kinds.cjs.map +1 -0
- package/dist/agent-runtime/src/typed-interrupt-kinds.d.ts +173 -0
- package/dist/agent-runtime/src/typed-interrupt-kinds.js +247 -0
- package/dist/agent-runtime/src/typed-interrupt-kinds.js.map +1 -0
- package/dist/agent-runtime/src/typed-interrupts.cjs +48 -0
- package/dist/agent-runtime/src/typed-interrupts.cjs.map +1 -0
- package/dist/agent-runtime/src/typed-interrupts.d.ts +75 -0
- package/dist/agent-runtime/src/typed-interrupts.js +48 -0
- package/dist/agent-runtime/src/typed-interrupts.js.map +1 -0
- package/dist/agent-runtime/src/types.d.ts +1 -1
- package/dist/agent-runtime/src/use-conversation-list.cjs +1 -0
- package/dist/agent-runtime/src/use-conversation-list.cjs.map +1 -1
- package/dist/agent-runtime/src/use-conversation-list.d.ts +7 -0
- package/dist/agent-runtime/src/use-conversation-list.js +1 -0
- package/dist/agent-runtime/src/use-conversation-list.js.map +1 -1
- package/dist/agent-runtime/src/use-deep-agent-chat-outbox.cjs +46 -29
- package/dist/agent-runtime/src/use-deep-agent-chat-outbox.cjs.map +1 -1
- package/dist/agent-runtime/src/use-deep-agent-chat-outbox.d.ts +14 -22
- package/dist/agent-runtime/src/use-deep-agent-chat-outbox.js +46 -29
- package/dist/agent-runtime/src/use-deep-agent-chat-outbox.js.map +1 -1
- package/dist/agent-runtime/src/use-deep-agent-runtime.cjs +78 -14
- package/dist/agent-runtime/src/use-deep-agent-runtime.cjs.map +1 -1
- package/dist/agent-runtime/src/use-deep-agent-runtime.d.ts +34 -7
- package/dist/agent-runtime/src/use-deep-agent-runtime.js +79 -15
- package/dist/agent-runtime/src/use-deep-agent-runtime.js.map +1 -1
- package/dist/agent-runtime/src/use-deep-agent-thread.cjs +16 -1
- package/dist/agent-runtime/src/use-deep-agent-thread.cjs.map +1 -1
- package/dist/agent-runtime/src/use-deep-agent-thread.d.ts +7 -2
- package/dist/agent-runtime/src/use-deep-agent-thread.js +16 -1
- package/dist/agent-runtime/src/use-deep-agent-thread.js.map +1 -1
- package/dist/agent-runtime/src/use-deep-agent-voice.cjs +30 -4
- package/dist/agent-runtime/src/use-deep-agent-voice.cjs.map +1 -1
- package/dist/agent-runtime/src/use-deep-agent-voice.d.ts +22 -4
- package/dist/agent-runtime/src/use-deep-agent-voice.js +30 -4
- package/dist/agent-runtime/src/use-deep-agent-voice.js.map +1 -1
- package/dist/agent-runtime/src/withdrawn-turns.d.ts +5 -4
- package/dist/agent-runtime/src/word-device-fit.d.ts +174 -0
- package/dist/agent-runtime/src/work-in.d.ts +127 -0
- package/dist/assets/AthenaAssetEmbed.cjs.map +1 -1
- package/dist/assets/AthenaAssetEmbed.d.ts +6 -1
- package/dist/assets/AthenaAssetEmbed.js.map +1 -1
- package/dist/assets/asset-panel-store.cjs +13 -5
- package/dist/assets/asset-panel-store.cjs.map +1 -1
- package/dist/assets/asset-panel-store.d.ts +33 -2
- package/dist/assets/asset-panel-store.js +13 -5
- package/dist/assets/asset-panel-store.js.map +1 -1
- package/dist/auth/AthenaCredentialSourceContext.cjs +11 -0
- package/dist/auth/AthenaCredentialSourceContext.cjs.map +1 -1
- package/dist/auth/AthenaCredentialSourceContext.d.ts +6 -0
- package/dist/auth/AthenaCredentialSourceContext.js +11 -0
- package/dist/auth/AthenaCredentialSourceContext.js.map +1 -1
- package/dist/auth/account-identity.cjs +13 -2
- package/dist/auth/account-identity.cjs.map +1 -1
- package/dist/auth/account-identity.d.ts +9 -0
- package/dist/auth/account-identity.js +13 -2
- package/dist/auth/account-identity.js.map +1 -1
- package/dist/auth/credential-source.cjs +20 -4
- package/dist/auth/credential-source.cjs.map +1 -1
- package/dist/auth/credential-source.d.ts +9 -0
- package/dist/auth/credential-source.js +20 -4
- package/dist/auth/credential-source.js.map +1 -1
- package/dist/catalog/chat-pickers.cjs +31 -0
- package/dist/catalog/chat-pickers.cjs.map +1 -1
- package/dist/catalog/chat-pickers.d.ts +17 -0
- package/dist/catalog/chat-pickers.js +33 -2
- package/dist/catalog/chat-pickers.js.map +1 -1
- package/dist/catalog/runtime-catalog.cjs +63 -3
- package/dist/catalog/runtime-catalog.cjs.map +1 -1
- package/dist/catalog/runtime-catalog.d.ts +63 -3
- package/dist/catalog/runtime-catalog.js +64 -4
- package/dist/catalog/runtime-catalog.js.map +1 -1
- package/dist/chat/AthenaChat.cjs +301 -98
- package/dist/chat/AthenaChat.cjs.map +1 -1
- package/dist/chat/AthenaChat.d.ts +80 -4
- package/dist/chat/AthenaChat.js +302 -99
- package/dist/chat/AthenaChat.js.map +1 -1
- package/dist/chat/StatewireApprovalCard.cjs +35 -5
- package/dist/chat/StatewireApprovalCard.cjs.map +1 -1
- package/dist/chat/StatewireApprovalCard.d.ts +55 -2
- package/dist/chat/StatewireApprovalCard.js +37 -7
- package/dist/chat/StatewireApprovalCard.js.map +1 -1
- package/dist/chat/StatewireQueuedMessages.cjs +17 -2
- package/dist/chat/StatewireQueuedMessages.cjs.map +1 -1
- package/dist/chat/StatewireQueuedMessages.d.ts +8 -45
- package/dist/chat/StatewireQueuedMessages.js +18 -3
- package/dist/chat/StatewireQueuedMessages.js.map +1 -1
- package/dist/chat/chat-agent-mentions.cjs +70 -0
- package/dist/chat/chat-agent-mentions.cjs.map +1 -0
- package/dist/chat/chat-agent-mentions.d.ts +13 -0
- package/dist/chat/chat-agent-mentions.js +70 -0
- package/dist/chat/chat-agent-mentions.js.map +1 -0
- package/dist/chat/composer-actions.cjs +12 -0
- package/dist/chat/composer-actions.cjs.map +1 -0
- package/dist/chat/composer-actions.d.ts +22 -0
- package/dist/chat/composer-actions.js +12 -0
- package/dist/chat/composer-actions.js.map +1 -0
- package/dist/chat/follow-up-suggestions.cjs +185 -0
- package/dist/chat/follow-up-suggestions.cjs.map +1 -0
- package/dist/chat/follow-up-suggestions.d.ts +64 -0
- package/dist/chat/follow-up-suggestions.js +185 -0
- package/dist/chat/follow-up-suggestions.js.map +1 -0
- package/dist/chat/super-grouping/ToolTimeline.cjs +4 -3
- package/dist/chat/super-grouping/ToolTimeline.cjs.map +1 -1
- package/dist/chat/super-grouping/ToolTimeline.d.ts +7 -3
- package/dist/chat/super-grouping/ToolTimeline.js +4 -3
- package/dist/chat/super-grouping/ToolTimeline.js.map +1 -1
- package/dist/chat/turn-changes.cjs +284 -0
- package/dist/chat/turn-changes.cjs.map +1 -0
- package/dist/chat/turn-changes.d.ts +130 -0
- package/dist/chat/turn-changes.js +284 -0
- package/dist/chat/turn-changes.js.map +1 -0
- package/dist/chat/typed-interrupts/StatewireTypedInterruptCard.cjs +31 -0
- package/dist/chat/typed-interrupts/StatewireTypedInterruptCard.cjs.map +1 -0
- package/dist/chat/typed-interrupts/StatewireTypedInterruptCard.d.ts +31 -0
- package/dist/chat/typed-interrupts/StatewireTypedInterruptCard.js +31 -0
- package/dist/chat/typed-interrupts/StatewireTypedInterruptCard.js.map +1 -0
- package/dist/chat/typed-interrupts/approval-cards.cjs +250 -0
- package/dist/chat/typed-interrupts/approval-cards.cjs.map +1 -0
- package/dist/chat/typed-interrupts/approval-cards.d.ts +22 -0
- package/dist/chat/typed-interrupts/approval-cards.js +250 -0
- package/dist/chat/typed-interrupts/approval-cards.js.map +1 -0
- package/dist/chat/typed-interrupts/form-cards.cjs +289 -0
- package/dist/chat/typed-interrupts/form-cards.cjs.map +1 -0
- package/dist/chat/typed-interrupts/form-cards.d.ts +6 -0
- package/dist/chat/typed-interrupts/form-cards.js +289 -0
- package/dist/chat/typed-interrupts/form-cards.js.map +1 -0
- package/dist/chat/typed-interrupts/interrupt-card-shell.cjs +182 -0
- package/dist/chat/typed-interrupts/interrupt-card-shell.cjs.map +1 -0
- package/dist/chat/typed-interrupts/interrupt-card-shell.d.ts +47 -0
- package/dist/chat/typed-interrupts/interrupt-card-shell.js +182 -0
- package/dist/chat/typed-interrupts/interrupt-card-shell.js.map +1 -0
- package/dist/chat/typed-interrupts/json-schema-form.cjs +388 -0
- package/dist/chat/typed-interrupts/json-schema-form.cjs.map +1 -0
- package/dist/chat/typed-interrupts/json-schema-form.d.ts +33 -0
- package/dist/chat/typed-interrupts/json-schema-form.js +388 -0
- package/dist/chat/typed-interrupts/json-schema-form.js.map +1 -0
- package/dist/chat/typed-interrupts/questionnaire-card.cjs +449 -0
- package/dist/chat/typed-interrupts/questionnaire-card.cjs.map +1 -0
- package/dist/chat/typed-interrupts/questionnaire-card.d.ts +20 -0
- package/dist/chat/typed-interrupts/questionnaire-card.js +449 -0
- package/dist/chat/typed-interrupts/questionnaire-card.js.map +1 -0
- package/dist/chat/typed-interrupts/request-file-card.cjs +159 -0
- package/dist/chat/typed-interrupts/request-file-card.cjs.map +1 -0
- package/dist/chat/typed-interrupts/request-file-card.d.ts +2 -0
- package/dist/chat/typed-interrupts/request-file-card.js +159 -0
- package/dist/chat/typed-interrupts/request-file-card.js.map +1 -0
- package/dist/chat/typed-interrupts/toolkit-selection-card.cjs +189 -0
- package/dist/chat/typed-interrupts/toolkit-selection-card.cjs.map +1 -0
- package/dist/chat/typed-interrupts/toolkit-selection-card.d.ts +23 -0
- package/dist/chat/typed-interrupts/toolkit-selection-card.js +189 -0
- package/dist/chat/typed-interrupts/toolkit-selection-card.js.map +1 -0
- package/dist/chat/typed-interrupts/typed-interrupt-body.cjs +26 -0
- package/dist/chat/typed-interrupts/typed-interrupt-body.cjs.map +1 -0
- package/dist/chat/typed-interrupts/typed-interrupt-body.d.ts +3 -0
- package/dist/chat/typed-interrupts/typed-interrupt-body.js +26 -0
- package/dist/chat/typed-interrupts/typed-interrupt-body.js.map +1 -0
- package/dist/chat/typed-interrupts/typed-interrupt-graphql.cjs +105 -0
- package/dist/chat/typed-interrupts/typed-interrupt-graphql.cjs.map +1 -0
- package/dist/chat/typed-interrupts/typed-interrupt-graphql.d.ts +29 -0
- package/dist/chat/typed-interrupts/typed-interrupt-graphql.js +105 -0
- package/dist/chat/typed-interrupts/typed-interrupt-graphql.js.map +1 -0
- package/dist/chat/typed-interrupts/typed-interrupt-notice.cjs +70 -0
- package/dist/chat/typed-interrupts/typed-interrupt-notice.cjs.map +1 -0
- package/dist/chat/typed-interrupts/typed-interrupt-notice.d.ts +45 -0
- package/dist/chat/typed-interrupts/typed-interrupt-notice.js +70 -0
- package/dist/chat/typed-interrupts/typed-interrupt-notice.js.map +1 -0
- package/dist/chat/typed-interrupts/typed-interrupt-panel.cjs +76 -0
- package/dist/chat/typed-interrupts/typed-interrupt-panel.cjs.map +1 -0
- package/dist/chat/typed-interrupts/typed-interrupt-panel.d.ts +11 -0
- package/dist/chat/typed-interrupts/typed-interrupt-panel.js +76 -0
- package/dist/chat/typed-interrupts/typed-interrupt-panel.js.map +1 -0
- package/dist/chat/typed-interrupts/typed-interrupt-types.d.ts +46 -0
- package/dist/chat/typed-interrupts/use-interrupt-draft.cjs +106 -0
- package/dist/chat/typed-interrupts/use-interrupt-draft.cjs.map +1 -0
- package/dist/chat/typed-interrupts/use-interrupt-draft.d.ts +29 -0
- package/dist/chat/typed-interrupts/use-interrupt-draft.js +106 -0
- package/dist/chat/typed-interrupts/use-interrupt-draft.js.map +1 -0
- package/dist/chat/typed-interrupts/use-statewire-typed-interrupt.cjs +231 -0
- package/dist/chat/typed-interrupts/use-statewire-typed-interrupt.cjs.map +1 -0
- package/dist/chat/typed-interrupts/use-statewire-typed-interrupt.d.ts +66 -0
- package/dist/chat/typed-interrupts/use-statewire-typed-interrupt.js +231 -0
- package/dist/chat/typed-interrupts/use-statewire-typed-interrupt.js.map +1 -0
- package/dist/chat-ui/composer/composer-named-agents.cjs +13 -0
- package/dist/chat-ui/composer/composer-named-agents.cjs.map +1 -0
- package/dist/chat-ui/composer/composer-named-agents.d.ts +20 -0
- package/dist/chat-ui/composer/composer-named-agents.js +13 -0
- package/dist/chat-ui/composer/composer-named-agents.js.map +1 -0
- package/dist/chat-ui/composer/slash-command-menu.cjs +143 -0
- package/dist/chat-ui/composer/slash-command-menu.cjs.map +1 -0
- package/dist/chat-ui/composer/slash-command-menu.d.ts +19 -0
- package/dist/chat-ui/composer/slash-command-menu.js +143 -0
- package/dist/chat-ui/composer/slash-command-menu.js.map +1 -0
- package/dist/chat-ui/composer/slash-commands-extension.cjs +51 -0
- package/dist/chat-ui/composer/slash-commands-extension.cjs.map +1 -0
- package/dist/chat-ui/composer/slash-commands-extension.d.ts +39 -0
- package/dist/chat-ui/composer/slash-commands-extension.js +51 -0
- package/dist/chat-ui/composer/slash-commands-extension.js.map +1 -0
- package/dist/chat-ui/composer/slash-commands.cjs +74 -0
- package/dist/chat-ui/composer/slash-commands.cjs.map +1 -0
- package/dist/chat-ui/composer/slash-commands.d.ts +82 -0
- package/dist/chat-ui/composer/slash-commands.js +74 -0
- package/dist/chat-ui/composer/slash-commands.js.map +1 -0
- package/dist/chat-ui/composer/tiptap-composer.cjs +135 -9
- package/dist/chat-ui/composer/tiptap-composer.cjs.map +1 -1
- package/dist/chat-ui/composer/tiptap-composer.d.ts +61 -2
- package/dist/chat-ui/composer/tiptap-composer.js +135 -9
- package/dist/chat-ui/composer/tiptap-composer.js.map +1 -1
- package/dist/chat-ui/index.cjs +5 -0
- package/dist/chat-ui/index.cjs.map +1 -1
- package/dist/chat-ui/index.d.ts +4 -2
- package/dist/chat-ui/index.js +5 -0
- package/dist/chat-ui/index.js.map +1 -1
- package/dist/chat-ui/mentions/mention-chip.cjs +10 -4
- package/dist/chat-ui/mentions/mention-chip.cjs.map +1 -1
- package/dist/chat-ui/mentions/mention-chip.js +11 -5
- package/dist/chat-ui/mentions/mention-chip.js.map +1 -1
- package/dist/chat-ui/mentions/mention-extension.cjs +8 -1
- package/dist/chat-ui/mentions/mention-extension.cjs.map +1 -1
- package/dist/chat-ui/mentions/mention-extension.js +8 -1
- package/dist/chat-ui/mentions/mention-extension.js.map +1 -1
- package/dist/chat-ui/mentions/suggestions/components/get-scope-name.cjs +1 -0
- package/dist/chat-ui/mentions/suggestions/components/get-scope-name.cjs.map +1 -1
- package/dist/chat-ui/mentions/suggestions/components/get-scope-name.js +1 -0
- package/dist/chat-ui/mentions/suggestions/components/get-scope-name.js.map +1 -1
- package/dist/chat-ui/mentions/suggestions/components/mention-icon.cjs +20 -2
- package/dist/chat-ui/mentions/suggestions/components/mention-icon.cjs.map +1 -1
- package/dist/chat-ui/mentions/suggestions/components/mention-icon.d.ts +10 -1
- package/dist/chat-ui/mentions/suggestions/components/mention-icon.js +22 -4
- package/dist/chat-ui/mentions/suggestions/components/mention-icon.js.map +1 -1
- package/dist/chat-ui/mentions/suggestions/components/menu-item.cjs +1 -1
- package/dist/chat-ui/mentions/suggestions/components/menu-item.cjs.map +1 -1
- package/dist/chat-ui/mentions/suggestions/components/menu-item.js +1 -1
- package/dist/chat-ui/mentions/suggestions/components/menu-item.js.map +1 -1
- package/dist/chat-ui/mentions/suggestions/data/api-client.cjs +45 -0
- package/dist/chat-ui/mentions/suggestions/data/api-client.cjs.map +1 -1
- package/dist/chat-ui/mentions/suggestions/data/api-client.d.ts +48 -0
- package/dist/chat-ui/mentions/suggestions/data/api-client.js +45 -0
- package/dist/chat-ui/mentions/suggestions/data/api-client.js.map +1 -1
- package/dist/chat-ui/mentions/suggestions/data/sources/asset-type-icon-names.generated.cjs +89 -0
- package/dist/chat-ui/mentions/suggestions/data/sources/asset-type-icon-names.generated.cjs.map +1 -0
- package/dist/chat-ui/mentions/suggestions/data/sources/asset-type-icon-names.generated.d.ts +8 -0
- package/dist/chat-ui/mentions/suggestions/data/sources/asset-type-icon-names.generated.js +89 -0
- package/dist/chat-ui/mentions/suggestions/data/sources/asset-type-icon-names.generated.js.map +1 -0
- package/dist/chat-ui/mentions/suggestions/data/sources/asset-type-icons.cjs +140 -116
- package/dist/chat-ui/mentions/suggestions/data/sources/asset-type-icons.cjs.map +1 -1
- package/dist/chat-ui/mentions/suggestions/data/sources/asset-type-icons.d.ts +46 -12
- package/dist/chat-ui/mentions/suggestions/data/sources/asset-type-icons.js +141 -117
- package/dist/chat-ui/mentions/suggestions/data/sources/asset-type-icons.js.map +1 -1
- package/dist/chat-ui/mentions/suggestions/data/sources/index.cjs +272 -25
- package/dist/chat-ui/mentions/suggestions/data/sources/index.cjs.map +1 -1
- package/dist/chat-ui/mentions/suggestions/data/sources/index.d.ts +88 -10
- package/dist/chat-ui/mentions/suggestions/data/sources/index.js +274 -27
- package/dist/chat-ui/mentions/suggestions/data/sources/index.js.map +1 -1
- package/dist/chat-ui/mentions/suggestions/data/types.cjs.map +1 -1
- package/dist/chat-ui/mentions/suggestions/data/types.d.ts +27 -1
- package/dist/chat-ui/mentions/suggestions/data/types.js.map +1 -1
- package/dist/chat-ui/mentions/suggestions/data/use-mention-suggestions.cjs +56 -5
- package/dist/chat-ui/mentions/suggestions/data/use-mention-suggestions.cjs.map +1 -1
- package/dist/chat-ui/mentions/suggestions/data/use-mention-suggestions.d.ts +26 -6
- package/dist/chat-ui/mentions/suggestions/data/use-mention-suggestions.js +57 -6
- package/dist/chat-ui/mentions/suggestions/data/use-mention-suggestions.js.map +1 -1
- package/dist/chat-ui/mentions/suggestions/mention-suggestions.extension.cjs +34 -17
- package/dist/chat-ui/mentions/suggestions/mention-suggestions.extension.cjs.map +1 -1
- package/dist/chat-ui/mentions/suggestions/mention-suggestions.extension.d.ts +19 -1
- package/dist/chat-ui/mentions/suggestions/mention-suggestions.extension.js +35 -18
- package/dist/chat-ui/mentions/suggestions/mention-suggestions.extension.js.map +1 -1
- package/dist/chat-ui/mentions/use-asset-icon-app-url.cjs +12 -0
- package/dist/chat-ui/mentions/use-asset-icon-app-url.cjs.map +1 -0
- package/dist/chat-ui/mentions/use-asset-icon-app-url.d.ts +8 -0
- package/dist/chat-ui/mentions/use-asset-icon-app-url.js +12 -0
- package/dist/chat-ui/mentions/use-asset-icon-app-url.js.map +1 -0
- package/dist/chat-ui/statewire.d.ts +1 -1
- package/dist/chat-ui/thread/statewire-history-edge.cjs +15 -0
- package/dist/chat-ui/thread/statewire-history-edge.cjs.map +1 -1
- package/dist/chat-ui/thread/statewire-history-edge.d.ts +4 -1
- package/dist/chat-ui/thread/statewire-history-edge.js +15 -0
- package/dist/chat-ui/thread/statewire-history-edge.js.map +1 -1
- package/dist/collab/client.cjs +41 -6
- package/dist/collab/client.cjs.map +1 -1
- package/dist/collab/client.d.ts +38 -7
- package/dist/collab/client.js +41 -6
- package/dist/collab/client.js.map +1 -1
- package/dist/composer/ComposerAttachedReferences.cjs +119 -0
- package/dist/composer/ComposerAttachedReferences.cjs.map +1 -0
- package/dist/composer/ComposerAttachedReferences.d.ts +26 -0
- package/dist/composer/ComposerAttachedReferences.js +119 -0
- package/dist/composer/ComposerAttachedReferences.js.map +1 -0
- package/dist/composer/ComposerNamedAgents.cjs +63 -0
- package/dist/composer/ComposerNamedAgents.cjs.map +1 -0
- package/dist/composer/ComposerNamedAgents.d.ts +16 -0
- package/dist/composer/ComposerNamedAgents.js +63 -0
- package/dist/composer/ComposerNamedAgents.js.map +1 -0
- package/dist/composer/attached-references.cjs +159 -0
- package/dist/composer/attached-references.cjs.map +1 -0
- package/dist/composer/attached-references.d.ts +86 -0
- package/dist/composer/attached-references.js +159 -0
- package/dist/composer/attached-references.js.map +1 -0
- package/dist/composer/build-composed-message.cjs +14 -7
- package/dist/composer/build-composed-message.cjs.map +1 -1
- package/dist/composer/build-composed-message.d.ts +6 -1
- package/dist/composer/build-composed-message.js +14 -7
- package/dist/composer/build-composed-message.js.map +1 -1
- package/dist/composer/composer-handoff.cjs +6 -2
- package/dist/composer/composer-handoff.cjs.map +1 -1
- package/dist/composer/composer-handoff.d.ts +7 -1
- package/dist/composer/composer-handoff.js +6 -2
- package/dist/composer/composer-handoff.js.map +1 -1
- package/dist/composer/folder-upload.cjs +149 -0
- package/dist/composer/folder-upload.cjs.map +1 -0
- package/dist/composer/folder-upload.d.ts +79 -0
- package/dist/composer/folder-upload.js +149 -0
- package/dist/composer/folder-upload.js.map +1 -0
- package/dist/composer/index.d.ts +1 -1
- package/dist/composer/staged-message-metadata.cjs +12 -0
- package/dist/composer/staged-message-metadata.cjs.map +1 -0
- package/dist/composer/staged-message-metadata.d.ts +15 -0
- package/dist/composer/staged-message-metadata.js +12 -0
- package/dist/composer/staged-message-metadata.js.map +1 -0
- package/dist/composer/useAttachToChat.cjs +35 -0
- package/dist/composer/useAttachToChat.cjs.map +1 -0
- package/dist/composer/useAttachToChat.d.ts +54 -0
- package/dist/composer/useAttachToChat.js +35 -0
- package/dist/composer/useAttachToChat.js.map +1 -0
- package/dist/composer/useAttachedReferencesComposerProps.cjs +19 -0
- package/dist/composer/useAttachedReferencesComposerProps.cjs.map +1 -0
- package/dist/composer/useAttachedReferencesComposerProps.d.ts +12 -0
- package/dist/composer/useAttachedReferencesComposerProps.js +19 -0
- package/dist/composer/useAttachedReferencesComposerProps.js.map +1 -0
- package/dist/composer/useFileUpload.cjs +95 -7
- package/dist/composer/useFileUpload.cjs.map +1 -1
- package/dist/composer/useFileUpload.d.ts +21 -2
- package/dist/composer/useFileUpload.js +95 -7
- package/dist/composer/useFileUpload.js.map +1 -1
- package/dist/data/athena-api-error.cjs +125 -0
- package/dist/data/athena-api-error.cjs.map +1 -0
- package/dist/data/athena-api-error.d.ts +96 -0
- package/dist/data/athena-api-error.js +125 -0
- package/dist/data/athena-api-error.js.map +1 -0
- package/dist/data/athena-data-client.cjs +106 -0
- package/dist/data/athena-data-client.cjs.map +1 -0
- package/dist/data/athena-data-client.d.ts +74 -0
- package/dist/data/athena-data-client.js +106 -0
- package/dist/data/athena-data-client.js.map +1 -0
- package/dist/data/athena-member.cjs +93 -0
- package/dist/data/athena-member.cjs.map +1 -0
- package/dist/data/athena-member.d.ts +125 -0
- package/dist/data/athena-member.js +93 -0
- package/dist/data/athena-member.js.map +1 -0
- package/dist/data/athena-request.cjs +460 -0
- package/dist/data/athena-request.cjs.map +1 -0
- package/dist/data/athena-request.d.ts +120 -0
- package/dist/data/athena-request.js +460 -0
- package/dist/data/athena-request.js.map +1 -0
- package/dist/data/use-athena-fetch.cjs +14 -0
- package/dist/data/use-athena-fetch.cjs.map +1 -0
- package/dist/data/use-athena-fetch.d.ts +19 -0
- package/dist/data/use-athena-fetch.js +14 -0
- package/dist/data/use-athena-fetch.js.map +1 -0
- package/dist/data/use-athena-graphql.cjs +66 -0
- package/dist/data/use-athena-graphql.cjs.map +1 -0
- package/dist/data/use-athena-graphql.d.ts +56 -0
- package/dist/data/use-athena-graphql.js +66 -0
- package/dist/data/use-athena-graphql.js.map +1 -0
- package/dist/data/use-athena-rest.cjs +33 -0
- package/dist/data/use-athena-rest.cjs.map +1 -0
- package/dist/data/use-athena-rest.d.ts +21 -0
- package/dist/data/use-athena-rest.js +33 -0
- package/dist/data/use-athena-rest.js.map +1 -0
- package/dist/data/use-semantic-query.cjs +44 -0
- package/dist/data/use-semantic-query.cjs.map +1 -0
- package/dist/data/use-semantic-query.d.ts +92 -0
- package/dist/data/use-semantic-query.js +44 -0
- package/dist/data/use-semantic-query.js.map +1 -0
- package/dist/diagnostics/athena-diagnostics.cjs.map +1 -1
- package/dist/diagnostics/athena-diagnostics.d.ts +5 -1
- package/dist/diagnostics/athena-diagnostics.js.map +1 -1
- package/dist/diagnostics/errors.cjs +7 -0
- package/dist/diagnostics/errors.cjs.map +1 -1
- package/dist/diagnostics/errors.d.ts +7 -0
- package/dist/diagnostics/errors.js +7 -0
- package/dist/diagnostics/errors.js.map +1 -1
- package/dist/index.cjs +155 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +72 -13
- package/dist/index.js +148 -4
- package/dist/index.js.map +1 -1
- package/dist/keryx-http/src/initial-sync.cjs +64 -16
- package/dist/keryx-http/src/initial-sync.cjs.map +1 -1
- package/dist/keryx-http/src/initial-sync.d.ts +31 -1
- package/dist/keryx-http/src/initial-sync.js +64 -16
- package/dist/keryx-http/src/initial-sync.js.map +1 -1
- package/dist/keryx-http/src/own-awareness.cjs +20 -0
- package/dist/keryx-http/src/own-awareness.cjs.map +1 -0
- package/dist/keryx-http/src/own-awareness.d.ts +50 -0
- package/dist/keryx-http/src/own-awareness.js +20 -0
- package/dist/keryx-http/src/own-awareness.js.map +1 -0
- package/dist/keryx-http/src/update-attributions.cjs +26 -1
- package/dist/keryx-http/src/update-attributions.cjs.map +1 -1
- package/dist/keryx-http/src/update-attributions.d.ts +10 -1
- package/dist/keryx-http/src/update-attributions.js +26 -1
- package/dist/keryx-http/src/update-attributions.js.map +1 -1
- package/dist/offline/chat-outbox.cjs +262 -26
- package/dist/offline/chat-outbox.cjs.map +1 -1
- package/dist/offline/chat-outbox.d.ts +90 -12
- package/dist/offline/chat-outbox.js +263 -27
- package/dist/offline/chat-outbox.js.map +1 -1
- package/dist/provider/AthenaProvider.cjs +60 -22
- package/dist/provider/AthenaProvider.cjs.map +1 -1
- package/dist/provider/AthenaProvider.d.ts +24 -8
- package/dist/provider/AthenaProvider.js +61 -23
- package/dist/provider/AthenaProvider.js.map +1 -1
- package/dist/react/package.json.cjs +1 -1
- package/dist/react/package.json.js +1 -1
- package/dist/references/src/anchors/parse.cjs +11 -1
- package/dist/references/src/anchors/parse.cjs.map +1 -1
- package/dist/references/src/anchors/parse.js +11 -1
- package/dist/references/src/anchors/parse.js.map +1 -1
- package/dist/references/src/anchors/schemas.d.ts +1 -0
- package/dist/references/src/anchors/serialize.cjs +1 -0
- package/dist/references/src/anchors/serialize.cjs.map +1 -1
- package/dist/references/src/anchors/serialize.js +1 -0
- package/dist/references/src/anchors/serialize.js.map +1 -1
- package/dist/references/src/anchors/types.cjs +5 -0
- package/dist/references/src/anchors/types.cjs.map +1 -1
- package/dist/references/src/anchors/types.d.ts +9 -0
- package/dist/references/src/anchors/types.js +5 -0
- package/dist/references/src/anchors/types.js.map +1 -1
- package/dist/references/src/attachable.cjs +149 -0
- package/dist/references/src/attachable.cjs.map +1 -0
- package/dist/references/src/attachable.d.ts +87 -0
- package/dist/references/src/attachable.js +149 -0
- package/dist/references/src/attachable.js.map +1 -0
- package/dist/references/src/schemas.d.ts +2 -0
- package/dist/runtime/StatewirePlanModeLaneSync.cjs +93 -0
- package/dist/runtime/StatewirePlanModeLaneSync.cjs.map +1 -0
- package/dist/runtime/StatewirePlanModeLaneSync.d.ts +34 -0
- package/dist/runtime/StatewirePlanModeLaneSync.js +93 -0
- package/dist/runtime/StatewirePlanModeLaneSync.js.map +1 -0
- package/dist/runtime/StatewireThreadConfigLaneSync.cjs +2 -0
- package/dist/runtime/StatewireThreadConfigLaneSync.cjs.map +1 -1
- package/dist/runtime/StatewireThreadConfigLaneSync.d.ts +4 -0
- package/dist/runtime/StatewireThreadConfigLaneSync.js +2 -0
- package/dist/runtime/StatewireThreadConfigLaneSync.js.map +1 -1
- package/dist/runtime/statewire-plan-mode.cjs +71 -0
- package/dist/runtime/statewire-plan-mode.cjs.map +1 -0
- package/dist/runtime/statewire-plan-mode.d.ts +88 -0
- package/dist/runtime/statewire-plan-mode.js +71 -0
- package/dist/runtime/statewire-plan-mode.js.map +1 -0
- package/dist/runtime/statewire-run-config.cjs +3 -1
- package/dist/runtime/statewire-run-config.cjs.map +1 -1
- package/dist/runtime/statewire-run-config.d.ts +7 -0
- package/dist/runtime/statewire-run-config.js +3 -1
- package/dist/runtime/statewire-run-config.js.map +1 -1
- package/dist/runtime/statewire-session-key.cjs +11 -5
- package/dist/runtime/statewire-session-key.cjs.map +1 -1
- package/dist/runtime/statewire-session-key.d.ts +22 -10
- package/dist/runtime/statewire-session-key.js +11 -5
- package/dist/runtime/statewire-session-key.js.map +1 -1
- package/dist/runtime/useAthenaStatewireRuntime.cjs +64 -9
- package/dist/runtime/useAthenaStatewireRuntime.cjs.map +1 -1
- package/dist/runtime/useAthenaStatewireRuntime.d.ts +26 -10
- package/dist/runtime/useAthenaStatewireRuntime.js +66 -11
- package/dist/runtime/useAthenaStatewireRuntime.js.map +1 -1
- package/dist/search/useAthenaAssets.cjs +394 -0
- package/dist/search/useAthenaAssets.cjs.map +1 -0
- package/dist/search/useAthenaAssets.d.ts +186 -0
- package/dist/search/useAthenaAssets.js +394 -0
- package/dist/search/useAthenaAssets.js.map +1 -0
- package/dist/sheet-range/index.cjs +4 -0
- package/dist/sheet-range/index.cjs.map +1 -1
- package/dist/sheet-range/index.d.ts +4 -2
- package/dist/sheet-range/index.js +4 -0
- package/dist/sheet-range/index.js.map +1 -1
- package/dist/sheet-range/query-range.cjs +102 -0
- package/dist/sheet-range/query-range.cjs.map +1 -0
- package/dist/sheet-range/query-range.d.ts +46 -0
- package/dist/sheet-range/query-range.js +102 -0
- package/dist/sheet-range/query-range.js.map +1 -0
- package/dist/styles.css +1 -1
- package/dist/subagents/index.cjs +49 -0
- package/dist/subagents/index.cjs.map +1 -0
- package/dist/subagents/index.d.ts +16 -0
- package/dist/subagents/index.js +49 -0
- package/dist/subagents/index.js.map +1 -0
- package/dist/subagents/lane-follow.cjs +19 -0
- package/dist/subagents/lane-follow.cjs.map +1 -0
- package/dist/subagents/lane-follow.d.ts +9 -0
- package/dist/subagents/lane-follow.js +19 -0
- package/dist/subagents/lane-follow.js.map +1 -0
- package/dist/subagents/lane-model.cjs +178 -0
- package/dist/subagents/lane-model.cjs.map +1 -0
- package/dist/subagents/lane-model.d.ts +140 -0
- package/dist/subagents/lane-model.js +178 -0
- package/dist/subagents/lane-model.js.map +1 -0
- package/dist/subagents/lane-parts.cjs +517 -0
- package/dist/subagents/lane-parts.cjs.map +1 -0
- package/dist/subagents/lane-parts.d.ts +130 -0
- package/dist/subagents/lane-parts.js +517 -0
- package/dist/subagents/lane-parts.js.map +1 -0
- package/dist/subagents/subagent-lane-group.cjs +215 -0
- package/dist/subagents/subagent-lane-group.cjs.map +1 -0
- package/dist/subagents/subagent-lane-group.d.ts +67 -0
- package/dist/subagents/subagent-lane-group.js +215 -0
- package/dist/subagents/subagent-lane-group.js.map +1 -0
- package/dist/subagents/subagent-transcript-drawer.cjs +431 -0
- package/dist/subagents/subagent-transcript-drawer.cjs.map +1 -0
- package/dist/subagents/subagent-transcript-drawer.d.ts +78 -0
- package/dist/subagents/subagent-transcript-drawer.js +431 -0
- package/dist/subagents/subagent-transcript-drawer.js.map +1 -0
- package/dist/subagents/task-subagent-group.cjs +115 -0
- package/dist/subagents/task-subagent-group.cjs.map +1 -0
- package/dist/subagents/task-subagent-group.d.ts +36 -0
- package/dist/subagents/task-subagent-group.js +115 -0
- package/dist/subagents/task-subagent-group.js.map +1 -0
- package/dist/subagents/use-omitted-images-in-view.cjs +68 -0
- package/dist/subagents/use-omitted-images-in-view.cjs.map +1 -0
- package/dist/subagents/use-omitted-images-in-view.d.ts +21 -0
- package/dist/subagents/use-omitted-images-in-view.js +68 -0
- package/dist/subagents/use-omitted-images-in-view.js.map +1 -0
- package/dist/threads/Inbox.cjs +2 -2
- package/dist/threads/Inbox.cjs.map +1 -1
- package/dist/threads/SessionList.cjs +6 -6
- package/dist/threads/SessionList.cjs.map +1 -1
- package/dist/threads/SessionsPage.cjs +13 -7
- package/dist/threads/SessionsPage.cjs.map +1 -1
- package/dist/threads/SessionsPage.d.ts +10 -1
- package/dist/threads/SessionsPage.js +9 -3
- package/dist/threads/SessionsPage.js.map +1 -1
- package/dist/threads/session-list-model.cjs.map +1 -1
- package/dist/threads/session-list-model.d.ts +2 -1
- package/dist/threads/session-list-model.js.map +1 -1
- package/dist/threads/session-row-parts.cjs +3 -3
- package/dist/threads/session-row-parts.cjs.map +1 -1
- package/dist/threads/sessions-page-model.cjs +13 -5
- package/dist/threads/sessions-page-model.cjs.map +1 -1
- package/dist/threads/sessions-page-model.d.ts +7 -0
- package/dist/threads/sessions-page-model.js +11 -3
- package/dist/threads/sessions-page-model.js.map +1 -1
- package/dist/threads/sessions-page-storage.cjs +8 -8
- package/dist/threads/sessions-page-storage.cjs.map +1 -1
- package/dist/threads/sessions-page-storage.d.ts +5 -1
- package/dist/threads/sessions-page-storage.js +8 -8
- package/dist/threads/sessions-page-storage.js.map +1 -1
- package/dist/threads/statewire-thread-list.cjs +14 -2
- package/dist/threads/statewire-thread-list.cjs.map +1 -1
- package/dist/threads/statewire-thread-list.d.ts +11 -2
- package/dist/threads/statewire-thread-list.js +14 -2
- package/dist/threads/statewire-thread-list.js.map +1 -1
- package/dist/threads/use-athena-sessions.cjs +1 -0
- package/dist/threads/use-athena-sessions.cjs.map +1 -1
- package/dist/threads/use-athena-sessions.d.ts +7 -0
- package/dist/threads/use-athena-sessions.js +1 -0
- package/dist/threads/use-athena-sessions.js.map +1 -1
- package/dist/threads/use-athena-thread-agent.cjs +31 -0
- package/dist/threads/use-athena-thread-agent.cjs.map +1 -0
- package/dist/threads/use-athena-thread-agent.d.ts +38 -0
- package/dist/threads/use-athena-thread-agent.js +31 -0
- package/dist/threads/use-athena-thread-agent.js.map +1 -0
- package/dist/threads/use-athena-thread-plan-mode.cjs +18 -0
- package/dist/threads/use-athena-thread-plan-mode.cjs.map +1 -0
- package/dist/threads/use-athena-thread-plan-mode.d.ts +18 -0
- package/dist/threads/use-athena-thread-plan-mode.js +18 -0
- package/dist/threads/use-athena-thread-plan-mode.js.map +1 -0
- package/dist/threads/use-rest-conversation-history.d.ts +1 -0
- package/dist/tools/agent-creations.cjs +97 -0
- package/dist/tools/agent-creations.cjs.map +1 -0
- package/dist/tools/agent-creations.d.ts +38 -0
- package/dist/tools/agent-creations.js +97 -0
- package/dist/tools/agent-creations.js.map +1 -0
- package/dist/tools/agent-highlights.cjs +100 -0
- package/dist/tools/agent-highlights.cjs.map +1 -0
- package/dist/tools/agent-highlights.d.ts +57 -0
- package/dist/tools/agent-highlights.js +100 -0
- package/dist/tools/agent-highlights.js.map +1 -0
- package/dist/tools/append-document-tool-ui.cjs +1 -0
- package/dist/tools/append-document-tool-ui.cjs.map +1 -1
- package/dist/tools/append-document-tool-ui.d.ts +7 -0
- package/dist/tools/append-document-tool-ui.js +2 -1
- package/dist/tools/append-document-tool-ui.js.map +1 -1
- package/dist/tools/auto-open-tools.cjs +144 -71
- package/dist/tools/auto-open-tools.cjs.map +1 -1
- package/dist/tools/auto-open-tools.d.ts +131 -1
- package/dist/tools/auto-open-tools.js +145 -72
- package/dist/tools/auto-open-tools.js.map +1 -1
- package/dist/tools/browser-tool-uis.cjs +594 -0
- package/dist/tools/browser-tool-uis.cjs.map +1 -0
- package/dist/tools/browser-tool-uis.d.ts +8 -0
- package/dist/tools/browser-tool-uis.js +594 -0
- package/dist/tools/browser-tool-uis.js.map +1 -0
- package/dist/tools/computer-asset-tool-uis.cjs +313 -0
- package/dist/tools/computer-asset-tool-uis.cjs.map +1 -0
- package/dist/tools/computer-asset-tool-uis.d.ts +5 -0
- package/dist/tools/computer-asset-tool-uis.js +313 -0
- package/dist/tools/computer-asset-tool-uis.js.map +1 -0
- package/dist/tools/document-edit-tool-uis.cjs +218 -0
- package/dist/tools/document-edit-tool-uis.cjs.map +1 -0
- package/dist/tools/document-edit-tool-uis.d.ts +40 -0
- package/dist/tools/document-edit-tool-uis.js +218 -0
- package/dist/tools/document-edit-tool-uis.js.map +1 -0
- package/dist/tools/drive-tool-uis.cjs +429 -0
- package/dist/tools/drive-tool-uis.cjs.map +1 -0
- package/dist/tools/drive-tool-uis.d.ts +121 -0
- package/dist/tools/drive-tool-uis.js +429 -0
- package/dist/tools/drive-tool-uis.js.map +1 -0
- package/dist/tools/email-calendar-tool-uis.cjs +789 -0
- package/dist/tools/email-calendar-tool-uis.cjs.map +1 -0
- package/dist/tools/email-calendar-tool-uis.d.ts +129 -0
- package/dist/tools/email-calendar-tool-uis.js +789 -0
- package/dist/tools/email-calendar-tool-uis.js.map +1 -0
- package/dist/tools/ontology-tool-uis.cjs +83 -0
- package/dist/tools/ontology-tool-uis.cjs.map +1 -0
- package/dist/tools/ontology-tool-uis.d.ts +9 -0
- package/dist/tools/ontology-tool-uis.js +83 -0
- package/dist/tools/ontology-tool-uis.js.map +1 -0
- package/dist/tools/orchestration-tool-uis.cjs +586 -0
- package/dist/tools/orchestration-tool-uis.cjs.map +1 -0
- package/dist/tools/orchestration-tool-uis.d.ts +141 -0
- package/dist/tools/orchestration-tool-uis.js +586 -0
- package/dist/tools/orchestration-tool-uis.js.map +1 -0
- package/dist/tools/presentation-edit-tool-uis.cjs +516 -0
- package/dist/tools/presentation-edit-tool-uis.cjs.map +1 -0
- package/dist/tools/presentation-edit-tool-uis.d.ts +73 -0
- package/dist/tools/presentation-edit-tool-uis.js +516 -0
- package/dist/tools/presentation-edit-tool-uis.js.map +1 -0
- package/dist/tools/project-tool-uis.cjs +213 -0
- package/dist/tools/project-tool-uis.cjs.map +1 -0
- package/dist/tools/project-tool-uis.d.ts +14 -0
- package/dist/tools/project-tool-uis.js +213 -0
- package/dist/tools/project-tool-uis.js.map +1 -0
- package/dist/tools/sandbox-tool-uis.cjs +491 -0
- package/dist/tools/sandbox-tool-uis.cjs.map +1 -0
- package/dist/tools/sandbox-tool-uis.d.ts +116 -0
- package/dist/tools/sandbox-tool-uis.js +491 -0
- package/dist/tools/sandbox-tool-uis.js.map +1 -0
- package/dist/tools/sheet-query-tool-ui.cjs +138 -0
- package/dist/tools/sheet-query-tool-ui.cjs.map +1 -0
- package/dist/tools/sheet-query-tool-ui.d.ts +15 -0
- package/dist/tools/sheet-query-tool-ui.js +138 -0
- package/dist/tools/sheet-query-tool-ui.js.map +1 -0
- package/dist/tools/studio-screenshot-tool-uis.cjs +262 -0
- package/dist/tools/studio-screenshot-tool-uis.cjs.map +1 -0
- package/dist/tools/studio-screenshot-tool-uis.d.ts +52 -0
- package/dist/tools/studio-screenshot-tool-uis.js +262 -0
- package/dist/tools/studio-screenshot-tool-uis.js.map +1 -0
- package/dist/tools/subagent-task-tool-ui.cjs +24 -475
- package/dist/tools/subagent-task-tool-ui.cjs.map +1 -1
- package/dist/tools/subagent-task-tool-ui.d.ts +19 -103
- package/dist/tools/subagent-task-tool-ui.js +28 -479
- package/dist/tools/subagent-task-tool-ui.js.map +1 -1
- package/dist/tools/tool-summary.cjs +36 -0
- package/dist/tools/tool-summary.cjs.map +1 -1
- package/dist/tools/tool-summary.js +36 -0
- package/dist/tools/tool-summary.js.map +1 -1
- package/dist/tools/tool-uis.cjs +181 -53
- package/dist/tools/tool-uis.cjs.map +1 -1
- package/dist/tools/tool-uis.d.ts +40 -0
- package/dist/tools/tool-uis.js +183 -55
- package/dist/tools/tool-uis.js.map +1 -1
- package/dist/typed-interrupts/index.cjs +15 -0
- package/dist/typed-interrupts/index.cjs.map +1 -0
- package/dist/typed-interrupts/index.d.ts +20 -0
- package/dist/typed-interrupts/index.js +15 -0
- package/dist/typed-interrupts/index.js.map +1 -0
- package/dist/version.cjs +4 -0
- package/dist/version.cjs.map +1 -1
- package/dist/version.d.ts +9 -0
- package/dist/version.js +4 -0
- package/dist/version.js.map +1 -1
- package/dist/workbench/live-desktop-api.cjs +2 -1
- package/dist/workbench/live-desktop-api.cjs.map +1 -1
- package/dist/workbench/live-desktop-api.js +2 -1
- package/dist/workbench/live-desktop-api.js.map +1 -1
- package/dist/workbench/session-workbench-panes.cjs +6 -6
- package/dist/workbench/session-workbench-panes.cjs.map +1 -1
- package/dist/workbench/session-workspace-api.cjs +7 -2
- package/dist/workbench/session-workspace-api.cjs.map +1 -1
- package/dist/workbench/session-workspace-api.d.ts +10 -0
- package/dist/workbench/session-workspace-api.js +7 -2
- package/dist/workbench/session-workspace-api.js.map +1 -1
- package/package.json +28 -6
- package/dist/agent-runtime/src/chat-outbox-store.cjs +0 -510
- package/dist/agent-runtime/src/chat-outbox-store.cjs.map +0 -1
- package/dist/agent-runtime/src/chat-outbox-store.d.ts +0 -210
- package/dist/agent-runtime/src/chat-outbox-store.js +0 -510
- package/dist/agent-runtime/src/chat-outbox-store.js.map +0 -1
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const react = require("@assistant-ui/react");
|
|
4
|
+
const require$$0 = require("react");
|
|
5
|
+
const laneModel = require("./lane-model.cjs");
|
|
6
|
+
const subagents = require("../agent-runtime/src/subagents.cjs");
|
|
7
|
+
const toolNames = require("../agent-runtime/src/tool-names.cjs");
|
|
8
|
+
const NO_LANES = [];
|
|
9
|
+
const NO_LANE_IDS = /* @__PURE__ */ new Set();
|
|
10
|
+
function record(value) {
|
|
11
|
+
return value && typeof value === "object" && !Array.isArray(value) ? value : void 0;
|
|
12
|
+
}
|
|
13
|
+
function laneFromArgs(id, args) {
|
|
14
|
+
const fields = record(args) ?? {};
|
|
15
|
+
const name = fields.subagent_type ?? fields.subagentType;
|
|
16
|
+
return {
|
|
17
|
+
id,
|
|
18
|
+
name: typeof name === "string" && name !== "" ? name : "subagent",
|
|
19
|
+
description: typeof fields.description === "string" ? fields.description : "",
|
|
20
|
+
status: "queued",
|
|
21
|
+
toolCallCount: 0,
|
|
22
|
+
messages: [],
|
|
23
|
+
messageCount: 0,
|
|
24
|
+
currentText: ""
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
function rawCallArgs(sources, ids) {
|
|
28
|
+
const wanted = new Set(ids);
|
|
29
|
+
const byId = /* @__PURE__ */ new Map();
|
|
30
|
+
for (const source of sources) {
|
|
31
|
+
if (source.type !== "ai" || !source.tool_calls) continue;
|
|
32
|
+
for (const call of source.tool_calls) {
|
|
33
|
+
if (call.id && wanted.has(call.id)) byId.set(call.id, call.args);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return byId;
|
|
37
|
+
}
|
|
38
|
+
const timedLanes = /* @__PURE__ */ new WeakMap();
|
|
39
|
+
function withServerDuration(lane, artifact) {
|
|
40
|
+
if (lane.durationMs != null || !subagents.isTerminalSubagentStatus(lane.status)) return lane;
|
|
41
|
+
const cached = timedLanes.get(lane);
|
|
42
|
+
if (cached !== void 0) return cached;
|
|
43
|
+
const durationMs = laneModel.finishedLaneDurationMs(artifact);
|
|
44
|
+
const timed = durationMs === null ? lane : { ...lane, durationMs };
|
|
45
|
+
timedLanes.set(lane, timed);
|
|
46
|
+
return timed;
|
|
47
|
+
}
|
|
48
|
+
function runErrorText(status) {
|
|
49
|
+
if ((status == null ? void 0 : status.type) !== "incomplete" || status.reason !== "error") return "";
|
|
50
|
+
const { error } = status;
|
|
51
|
+
if (error === void 0 || error === null) return "";
|
|
52
|
+
return (typeof error === "string" ? error : JSON.stringify(error)).trim();
|
|
53
|
+
}
|
|
54
|
+
const failedLanes = /* @__PURE__ */ new WeakMap();
|
|
55
|
+
function failedWithRun(lane, reason) {
|
|
56
|
+
const cached = failedLanes.get(lane);
|
|
57
|
+
if (cached !== void 0) return cached;
|
|
58
|
+
const failed = { ...lane, status: "error", output: reason || subagents.ORPHANED_SUBAGENT_OUTPUT };
|
|
59
|
+
failedLanes.set(lane, failed);
|
|
60
|
+
return failed;
|
|
61
|
+
}
|
|
62
|
+
function groupLanes({
|
|
63
|
+
message,
|
|
64
|
+
group,
|
|
65
|
+
args,
|
|
66
|
+
toolCallId,
|
|
67
|
+
turnEnded
|
|
68
|
+
}) {
|
|
69
|
+
const byCall = subagents.taskSubagentsOfTurn(message);
|
|
70
|
+
const artifacts = /* @__PURE__ */ new Map();
|
|
71
|
+
if (message.role === "assistant") {
|
|
72
|
+
for (const part of message.content) {
|
|
73
|
+
if (part.type === "tool-call" && part.toolName === toolNames.TASK_TOOL_NAME) artifacts.set(part.toolCallId, part.artifact);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
const missing = group.ids.filter((id) => !byCall.has(id));
|
|
77
|
+
const raw = missing.length > 0 ? rawCallArgs(react.getExternalStoreMessages(message), missing) : null;
|
|
78
|
+
let stopped = null;
|
|
79
|
+
const lanes = group.ids.map((id) => {
|
|
80
|
+
const known = byCall.get(id);
|
|
81
|
+
const lane = known !== void 0 ? withServerDuration(known, artifacts.get(id)) : laneFromArgs(id, (raw == null ? void 0 : raw.get(id)) ?? (id === toolCallId ? args : void 0));
|
|
82
|
+
if (!turnEnded || subagents.isTerminalSubagentStatus(lane.status)) return lane;
|
|
83
|
+
const reason = runErrorText(message.status);
|
|
84
|
+
if (reason !== "") return failedWithRun(lane, reason);
|
|
85
|
+
stopped ?? (stopped = /* @__PURE__ */ new Set());
|
|
86
|
+
stopped.add(id);
|
|
87
|
+
return lane;
|
|
88
|
+
});
|
|
89
|
+
return { lanes, stoppedLaneIds: stopped ?? NO_LANE_IDS };
|
|
90
|
+
}
|
|
91
|
+
function useTaskSubagentGroup({
|
|
92
|
+
toolCallId,
|
|
93
|
+
args
|
|
94
|
+
}) {
|
|
95
|
+
var _a;
|
|
96
|
+
const message = react.useAuiState((s) => s.message);
|
|
97
|
+
const group = require$$0.useMemo(
|
|
98
|
+
() => subagents.taskSiblingGroup(react.getExternalStoreMessages(message), toolCallId),
|
|
99
|
+
[message, toolCallId]
|
|
100
|
+
);
|
|
101
|
+
const isAnchor = group.anchorId === toolCallId;
|
|
102
|
+
const turnToolCallIds = require$$0.useMemo(() => isAnchor ? subagents.openTurnToolCallIds(message) : void 0, [isAnchor, message]);
|
|
103
|
+
const turnEnded = !message.isLast || ((_a = message.status) == null ? void 0 : _a.type) === "incomplete";
|
|
104
|
+
const { lanes, stoppedLaneIds } = require$$0.useMemo(
|
|
105
|
+
() => isAnchor ? groupLanes({ message, group, args, toolCallId, turnEnded }) : { lanes: NO_LANES, stoppedLaneIds: NO_LANE_IDS },
|
|
106
|
+
[isAnchor, message, group, args, toolCallId, turnEnded]
|
|
107
|
+
);
|
|
108
|
+
const delegatedAtMs = require$$0.useMemo(
|
|
109
|
+
() => isAnchor ? laneModel.laneDelegatedAtMs({ sources: react.getExternalStoreMessages(message), toolCallId }) : null,
|
|
110
|
+
[isAnchor, message, toolCallId]
|
|
111
|
+
);
|
|
112
|
+
return { group, isAnchor, lanes, turnToolCallIds, stoppedLaneIds, delegatedAtMs };
|
|
113
|
+
}
|
|
114
|
+
exports.useTaskSubagentGroup = useTaskSubagentGroup;
|
|
115
|
+
//# sourceMappingURL=task-subagent-group.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task-subagent-group.cjs","sources":["../../src/subagents/task-subagent-group.ts"],"sourcesContent":["'use client';\n\nimport { getExternalStoreMessages, type ThreadMessage, useAuiState } from '@assistant-ui/react';\nimport type { LangChainMessage } from '@assistant-ui/react-langgraph';\nimport {\n isTerminalSubagentStatus,\n ORPHANED_SUBAGENT_OUTPUT,\n openTurnToolCallIds,\n type SubagentDiscoverySnapshot,\n TASK_TOOL_NAME,\n type TaskSiblingGroup,\n taskSiblingGroup,\n taskSubagentsOfTurn,\n} from '@athenaintel/agent-runtime';\nimport { useMemo } from 'react';\nimport { finishedLaneDurationMs, laneDelegatedAtMs } from './lane-model';\n\n/** The lanes of the `task` calls a turn delegated together, as the call `toolCallId` reads them. */\nexport interface TaskSubagentGroupState {\n /** The sibling `task` calls of one parent message, in the order the agent made them. */\n group: TaskSiblingGroup;\n /**\n * This call draws the group (it is the first sibling); every other sibling\n * draws nothing, so a parallel fan-out becomes one row of lanes.\n */\n isAnchor: boolean;\n /** The group's lanes, in `group.ids` order; empty for a call that is not the anchor. */\n lanes: readonly SubagentDiscoverySnapshot[];\n /** Every call of the turn while it is still open (`openTurnToolCallIds`); see `SubagentLaneGroup`. */\n turnToolCallIds: ReadonlySet<string> | undefined;\n /**\n * Lanes whose run ended before they settled: the conversation moved past\n * their turn, or the turn itself ended unfinished (stopped), and the lane\n * never got its result. A lane its run's failure ended reads Failed instead.\n */\n stoppedLaneIds: ReadonlySet<string>;\n /** When the agent delegated the group: the delegating message's server stamp (ms), else `null`. */\n delegatedAtMs: number | null;\n}\n\nconst NO_LANES: readonly SubagentDiscoverySnapshot[] = [];\nconst NO_LANE_IDS: ReadonlySet<string> = new Set();\n\nfunction record(value: unknown): Record<string, unknown> | undefined {\n return value && typeof value === 'object' && !Array.isArray(value)\n ? (value as Record<string, unknown>)\n : undefined;\n}\n\n/** A queued lane for a sibling the turn holds no tool-call part for yet: what its arguments say. */\nfunction laneFromArgs(id: string, args: unknown): SubagentDiscoverySnapshot {\n const fields = record(args) ?? {};\n const name = fields.subagent_type ?? fields.subagentType;\n return {\n id,\n name: typeof name === 'string' && name !== '' ? name : 'subagent',\n description: typeof fields.description === 'string' ? fields.description : '',\n status: 'queued',\n toolCallCount: 0,\n messages: [],\n messageCount: 0,\n currentText: '',\n };\n}\n\n/** The arguments of each of `ids` as the raw delegating message carries them. */\nfunction rawCallArgs(sources: readonly LangChainMessage[], ids: readonly string[]): Map<string, unknown> {\n const wanted = new Set(ids);\n const byId = new Map<string, unknown>();\n for (const source of sources) {\n if (source.type !== 'ai' || !source.tool_calls) continue;\n for (const call of source.tool_calls) {\n if (call.id && wanted.has(call.id)) byId.set(call.id, call.args);\n }\n }\n return byId;\n}\n\n/**\n * A settled `task` lane with its runtime as the server measured it (the\n * result's own stamps, `finishedLaneDurationMs`), so its card shows how long\n * it ran after a reload too. Kept per lane, so a lane that did not change\n * keeps its identity.\n */\nconst timedLanes = new WeakMap<SubagentDiscoverySnapshot, SubagentDiscoverySnapshot>();\n\nfunction withServerDuration(lane: SubagentDiscoverySnapshot, artifact: unknown): SubagentDiscoverySnapshot {\n if (lane.durationMs != null || !isTerminalSubagentStatus(lane.status)) return lane;\n const cached = timedLanes.get(lane);\n if (cached !== undefined) return cached;\n const durationMs = finishedLaneDurationMs(artifact);\n const timed = durationMs === null ? lane : { ...lane, durationMs };\n timedLanes.set(lane, timed);\n return timed;\n}\n\n/**\n * Why the run's own failure ended the turn, as its status says it (a call the\n * run never answered takes its message's status); `''` without a reason.\n */\nfunction runErrorText(status: ThreadMessage['status']): string {\n if (status?.type !== 'incomplete' || status.reason !== 'error') return '';\n const { error } = status;\n if (error === undefined || error === null) return '';\n return (typeof error === 'string' ? error : JSON.stringify(error)).trim();\n}\n\n/** A lane whose run failed before it settled, failed with the run's reason. Kept per lane. */\nconst failedLanes = new WeakMap<SubagentDiscoverySnapshot, SubagentDiscoverySnapshot>();\n\nfunction failedWithRun(lane: SubagentDiscoverySnapshot, reason: string): SubagentDiscoverySnapshot {\n const cached = failedLanes.get(lane);\n if (cached !== undefined) return cached;\n const failed: SubagentDiscoverySnapshot = { ...lane, status: 'error', output: reason || ORPHANED_SUBAGENT_OUTPUT };\n failedLanes.set(lane, failed);\n return failed;\n}\n\ninterface GroupLanes {\n lanes: readonly SubagentDiscoverySnapshot[];\n stoppedLaneIds: ReadonlySet<string>;\n}\n\nfunction groupLanes({\n message,\n group,\n args,\n toolCallId,\n turnEnded,\n}: {\n message: ThreadMessage;\n group: TaskSiblingGroup;\n args: unknown;\n toolCallId: string;\n /**\n * Nothing will settle the turn's lanes now: a later message follows it, or\n * it ended unfinished. (Its status alone is no sign the run is on it: a turn\n * whose lanes hold their running placeholders reads complete while the run\n * waits on a person.)\n */\n turnEnded: boolean;\n}): GroupLanes {\n const byCall = taskSubagentsOfTurn(message);\n const artifacts = new Map<string, unknown>();\n if (message.role === 'assistant') {\n for (const part of message.content) {\n if (part.type === 'tool-call' && part.toolName === TASK_TOOL_NAME) artifacts.set(part.toolCallId, part.artifact);\n }\n }\n const missing = group.ids.filter((id) => !byCall.has(id));\n const raw = missing.length > 0 ? rawCallArgs(getExternalStoreMessages<LangChainMessage>(message), missing) : null;\n let stopped: Set<string> | null = null;\n const lanes = group.ids.map((id) => {\n const known = byCall.get(id);\n const lane =\n known !== undefined\n ? withServerDuration(known, artifacts.get(id))\n : laneFromArgs(id, raw?.get(id) ?? (id === toolCallId ? args : undefined));\n if (!turnEnded || isTerminalSubagentStatus(lane.status)) return lane;\n // The run left this turn before the lane settled: nothing will settle it now.\n const reason = runErrorText(message.status);\n if (reason !== '') return failedWithRun(lane, reason);\n stopped ??= new Set();\n stopped.add(id);\n return lane;\n });\n return { lanes, stoppedLaneIds: stopped ?? NO_LANE_IDS };\n}\n\n/**\n * The lanes of the `task` calls issued together with `toolCallId` (its parallel\n * siblings), read off the turn's tool-call parts: each part's result and\n * `isPreliminary` say where its lane is, and its native `messages` are the\n * lane's transcript. The group is the calls of one parent AI message, found in\n * the sources bound to the turn. Only the first sibling reads the lanes; every\n * other sibling learns it is not the anchor and draws nothing.\n */\nexport function useTaskSubagentGroup({\n toolCallId,\n args,\n}: {\n toolCallId: string;\n /** The call's own arguments, for its lane before the turn holds its part. */\n args?: unknown;\n}): TaskSubagentGroupState {\n const message = useAuiState((s) => s.message);\n const group = useMemo(\n () => taskSiblingGroup(getExternalStoreMessages<LangChainMessage>(message), toolCallId),\n [message, toolCallId],\n );\n const isAnchor = group.anchorId === toolCallId;\n const turnToolCallIds = useMemo(() => (isAnchor ? openTurnToolCallIds(message) : undefined), [isAnchor, message]);\n const turnEnded = !message.isLast || message.status?.type === 'incomplete';\n const { lanes, stoppedLaneIds } = useMemo<GroupLanes>(\n () =>\n isAnchor\n ? groupLanes({ message, group, args, toolCallId, turnEnded })\n : { lanes: NO_LANES, stoppedLaneIds: NO_LANE_IDS },\n [isAnchor, message, group, args, toolCallId, turnEnded],\n );\n const delegatedAtMs = useMemo(\n () =>\n isAnchor ? laneDelegatedAtMs({ sources: getExternalStoreMessages<unknown>(message), toolCallId }) : null,\n [isAnchor, message, toolCallId],\n );\n return { group, isAnchor, lanes, turnToolCallIds, stoppedLaneIds, delegatedAtMs };\n}\n"],"names":["isTerminalSubagentStatus","finishedLaneDurationMs","ORPHANED_SUBAGENT_OUTPUT","taskSubagentsOfTurn","TASK_TOOL_NAME","getExternalStoreMessages","useAuiState","useMemo","taskSiblingGroup","openTurnToolCallIds","laneDelegatedAtMs"],"mappings":"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"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { type SubagentDiscoverySnapshot, type TaskSiblingGroup } from '../agent-runtime/src/index';
|
|
2
|
+
/** The lanes of the `task` calls a turn delegated together, as the call `toolCallId` reads them. */
|
|
3
|
+
export interface TaskSubagentGroupState {
|
|
4
|
+
/** The sibling `task` calls of one parent message, in the order the agent made them. */
|
|
5
|
+
group: TaskSiblingGroup;
|
|
6
|
+
/**
|
|
7
|
+
* This call draws the group (it is the first sibling); every other sibling
|
|
8
|
+
* draws nothing, so a parallel fan-out becomes one row of lanes.
|
|
9
|
+
*/
|
|
10
|
+
isAnchor: boolean;
|
|
11
|
+
/** The group's lanes, in `group.ids` order; empty for a call that is not the anchor. */
|
|
12
|
+
lanes: readonly SubagentDiscoverySnapshot[];
|
|
13
|
+
/** Every call of the turn while it is still open (`openTurnToolCallIds`); see `SubagentLaneGroup`. */
|
|
14
|
+
turnToolCallIds: ReadonlySet<string> | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* Lanes whose run ended before they settled: the conversation moved past
|
|
17
|
+
* their turn, or the turn itself ended unfinished (stopped), and the lane
|
|
18
|
+
* never got its result. A lane its run's failure ended reads Failed instead.
|
|
19
|
+
*/
|
|
20
|
+
stoppedLaneIds: ReadonlySet<string>;
|
|
21
|
+
/** When the agent delegated the group: the delegating message's server stamp (ms), else `null`. */
|
|
22
|
+
delegatedAtMs: number | null;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* The lanes of the `task` calls issued together with `toolCallId` (its parallel
|
|
26
|
+
* siblings), read off the turn's tool-call parts: each part's result and
|
|
27
|
+
* `isPreliminary` say where its lane is, and its native `messages` are the
|
|
28
|
+
* lane's transcript. The group is the calls of one parent AI message, found in
|
|
29
|
+
* the sources bound to the turn. Only the first sibling reads the lanes; every
|
|
30
|
+
* other sibling learns it is not the anchor and draws nothing.
|
|
31
|
+
*/
|
|
32
|
+
export declare function useTaskSubagentGroup({ toolCallId, args, }: {
|
|
33
|
+
toolCallId: string;
|
|
34
|
+
/** The call's own arguments, for its lane before the turn holds its part. */
|
|
35
|
+
args?: unknown;
|
|
36
|
+
}): TaskSubagentGroupState;
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { useAuiState, getExternalStoreMessages } from "@assistant-ui/react";
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
import { laneDelegatedAtMs, finishedLaneDurationMs } from "./lane-model.js";
|
|
4
|
+
import { taskSiblingGroup, openTurnToolCallIds, taskSubagentsOfTurn, isTerminalSubagentStatus, ORPHANED_SUBAGENT_OUTPUT } from "../agent-runtime/src/subagents.js";
|
|
5
|
+
import { TASK_TOOL_NAME } from "../agent-runtime/src/tool-names.js";
|
|
6
|
+
const NO_LANES = [];
|
|
7
|
+
const NO_LANE_IDS = /* @__PURE__ */ new Set();
|
|
8
|
+
function record(value) {
|
|
9
|
+
return value && typeof value === "object" && !Array.isArray(value) ? value : void 0;
|
|
10
|
+
}
|
|
11
|
+
function laneFromArgs(id, args) {
|
|
12
|
+
const fields = record(args) ?? {};
|
|
13
|
+
const name = fields.subagent_type ?? fields.subagentType;
|
|
14
|
+
return {
|
|
15
|
+
id,
|
|
16
|
+
name: typeof name === "string" && name !== "" ? name : "subagent",
|
|
17
|
+
description: typeof fields.description === "string" ? fields.description : "",
|
|
18
|
+
status: "queued",
|
|
19
|
+
toolCallCount: 0,
|
|
20
|
+
messages: [],
|
|
21
|
+
messageCount: 0,
|
|
22
|
+
currentText: ""
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
function rawCallArgs(sources, ids) {
|
|
26
|
+
const wanted = new Set(ids);
|
|
27
|
+
const byId = /* @__PURE__ */ new Map();
|
|
28
|
+
for (const source of sources) {
|
|
29
|
+
if (source.type !== "ai" || !source.tool_calls) continue;
|
|
30
|
+
for (const call of source.tool_calls) {
|
|
31
|
+
if (call.id && wanted.has(call.id)) byId.set(call.id, call.args);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return byId;
|
|
35
|
+
}
|
|
36
|
+
const timedLanes = /* @__PURE__ */ new WeakMap();
|
|
37
|
+
function withServerDuration(lane, artifact) {
|
|
38
|
+
if (lane.durationMs != null || !isTerminalSubagentStatus(lane.status)) return lane;
|
|
39
|
+
const cached = timedLanes.get(lane);
|
|
40
|
+
if (cached !== void 0) return cached;
|
|
41
|
+
const durationMs = finishedLaneDurationMs(artifact);
|
|
42
|
+
const timed = durationMs === null ? lane : { ...lane, durationMs };
|
|
43
|
+
timedLanes.set(lane, timed);
|
|
44
|
+
return timed;
|
|
45
|
+
}
|
|
46
|
+
function runErrorText(status) {
|
|
47
|
+
if ((status == null ? void 0 : status.type) !== "incomplete" || status.reason !== "error") return "";
|
|
48
|
+
const { error } = status;
|
|
49
|
+
if (error === void 0 || error === null) return "";
|
|
50
|
+
return (typeof error === "string" ? error : JSON.stringify(error)).trim();
|
|
51
|
+
}
|
|
52
|
+
const failedLanes = /* @__PURE__ */ new WeakMap();
|
|
53
|
+
function failedWithRun(lane, reason) {
|
|
54
|
+
const cached = failedLanes.get(lane);
|
|
55
|
+
if (cached !== void 0) return cached;
|
|
56
|
+
const failed = { ...lane, status: "error", output: reason || ORPHANED_SUBAGENT_OUTPUT };
|
|
57
|
+
failedLanes.set(lane, failed);
|
|
58
|
+
return failed;
|
|
59
|
+
}
|
|
60
|
+
function groupLanes({
|
|
61
|
+
message,
|
|
62
|
+
group,
|
|
63
|
+
args,
|
|
64
|
+
toolCallId,
|
|
65
|
+
turnEnded
|
|
66
|
+
}) {
|
|
67
|
+
const byCall = taskSubagentsOfTurn(message);
|
|
68
|
+
const artifacts = /* @__PURE__ */ new Map();
|
|
69
|
+
if (message.role === "assistant") {
|
|
70
|
+
for (const part of message.content) {
|
|
71
|
+
if (part.type === "tool-call" && part.toolName === TASK_TOOL_NAME) artifacts.set(part.toolCallId, part.artifact);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
const missing = group.ids.filter((id) => !byCall.has(id));
|
|
75
|
+
const raw = missing.length > 0 ? rawCallArgs(getExternalStoreMessages(message), missing) : null;
|
|
76
|
+
let stopped = null;
|
|
77
|
+
const lanes = group.ids.map((id) => {
|
|
78
|
+
const known = byCall.get(id);
|
|
79
|
+
const lane = known !== void 0 ? withServerDuration(known, artifacts.get(id)) : laneFromArgs(id, (raw == null ? void 0 : raw.get(id)) ?? (id === toolCallId ? args : void 0));
|
|
80
|
+
if (!turnEnded || isTerminalSubagentStatus(lane.status)) return lane;
|
|
81
|
+
const reason = runErrorText(message.status);
|
|
82
|
+
if (reason !== "") return failedWithRun(lane, reason);
|
|
83
|
+
stopped ?? (stopped = /* @__PURE__ */ new Set());
|
|
84
|
+
stopped.add(id);
|
|
85
|
+
return lane;
|
|
86
|
+
});
|
|
87
|
+
return { lanes, stoppedLaneIds: stopped ?? NO_LANE_IDS };
|
|
88
|
+
}
|
|
89
|
+
function useTaskSubagentGroup({
|
|
90
|
+
toolCallId,
|
|
91
|
+
args
|
|
92
|
+
}) {
|
|
93
|
+
var _a;
|
|
94
|
+
const message = useAuiState((s) => s.message);
|
|
95
|
+
const group = useMemo(
|
|
96
|
+
() => taskSiblingGroup(getExternalStoreMessages(message), toolCallId),
|
|
97
|
+
[message, toolCallId]
|
|
98
|
+
);
|
|
99
|
+
const isAnchor = group.anchorId === toolCallId;
|
|
100
|
+
const turnToolCallIds = useMemo(() => isAnchor ? openTurnToolCallIds(message) : void 0, [isAnchor, message]);
|
|
101
|
+
const turnEnded = !message.isLast || ((_a = message.status) == null ? void 0 : _a.type) === "incomplete";
|
|
102
|
+
const { lanes, stoppedLaneIds } = useMemo(
|
|
103
|
+
() => isAnchor ? groupLanes({ message, group, args, toolCallId, turnEnded }) : { lanes: NO_LANES, stoppedLaneIds: NO_LANE_IDS },
|
|
104
|
+
[isAnchor, message, group, args, toolCallId, turnEnded]
|
|
105
|
+
);
|
|
106
|
+
const delegatedAtMs = useMemo(
|
|
107
|
+
() => isAnchor ? laneDelegatedAtMs({ sources: getExternalStoreMessages(message), toolCallId }) : null,
|
|
108
|
+
[isAnchor, message, toolCallId]
|
|
109
|
+
);
|
|
110
|
+
return { group, isAnchor, lanes, turnToolCallIds, stoppedLaneIds, delegatedAtMs };
|
|
111
|
+
}
|
|
112
|
+
export {
|
|
113
|
+
useTaskSubagentGroup
|
|
114
|
+
};
|
|
115
|
+
//# sourceMappingURL=task-subagent-group.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task-subagent-group.js","sources":["../../src/subagents/task-subagent-group.ts"],"sourcesContent":["'use client';\n\nimport { getExternalStoreMessages, type ThreadMessage, useAuiState } from '@assistant-ui/react';\nimport type { LangChainMessage } from '@assistant-ui/react-langgraph';\nimport {\n isTerminalSubagentStatus,\n ORPHANED_SUBAGENT_OUTPUT,\n openTurnToolCallIds,\n type SubagentDiscoverySnapshot,\n TASK_TOOL_NAME,\n type TaskSiblingGroup,\n taskSiblingGroup,\n taskSubagentsOfTurn,\n} from '@athenaintel/agent-runtime';\nimport { useMemo } from 'react';\nimport { finishedLaneDurationMs, laneDelegatedAtMs } from './lane-model';\n\n/** The lanes of the `task` calls a turn delegated together, as the call `toolCallId` reads them. */\nexport interface TaskSubagentGroupState {\n /** The sibling `task` calls of one parent message, in the order the agent made them. */\n group: TaskSiblingGroup;\n /**\n * This call draws the group (it is the first sibling); every other sibling\n * draws nothing, so a parallel fan-out becomes one row of lanes.\n */\n isAnchor: boolean;\n /** The group's lanes, in `group.ids` order; empty for a call that is not the anchor. */\n lanes: readonly SubagentDiscoverySnapshot[];\n /** Every call of the turn while it is still open (`openTurnToolCallIds`); see `SubagentLaneGroup`. */\n turnToolCallIds: ReadonlySet<string> | undefined;\n /**\n * Lanes whose run ended before they settled: the conversation moved past\n * their turn, or the turn itself ended unfinished (stopped), and the lane\n * never got its result. A lane its run's failure ended reads Failed instead.\n */\n stoppedLaneIds: ReadonlySet<string>;\n /** When the agent delegated the group: the delegating message's server stamp (ms), else `null`. */\n delegatedAtMs: number | null;\n}\n\nconst NO_LANES: readonly SubagentDiscoverySnapshot[] = [];\nconst NO_LANE_IDS: ReadonlySet<string> = new Set();\n\nfunction record(value: unknown): Record<string, unknown> | undefined {\n return value && typeof value === 'object' && !Array.isArray(value)\n ? (value as Record<string, unknown>)\n : undefined;\n}\n\n/** A queued lane for a sibling the turn holds no tool-call part for yet: what its arguments say. */\nfunction laneFromArgs(id: string, args: unknown): SubagentDiscoverySnapshot {\n const fields = record(args) ?? {};\n const name = fields.subagent_type ?? fields.subagentType;\n return {\n id,\n name: typeof name === 'string' && name !== '' ? name : 'subagent',\n description: typeof fields.description === 'string' ? fields.description : '',\n status: 'queued',\n toolCallCount: 0,\n messages: [],\n messageCount: 0,\n currentText: '',\n };\n}\n\n/** The arguments of each of `ids` as the raw delegating message carries them. */\nfunction rawCallArgs(sources: readonly LangChainMessage[], ids: readonly string[]): Map<string, unknown> {\n const wanted = new Set(ids);\n const byId = new Map<string, unknown>();\n for (const source of sources) {\n if (source.type !== 'ai' || !source.tool_calls) continue;\n for (const call of source.tool_calls) {\n if (call.id && wanted.has(call.id)) byId.set(call.id, call.args);\n }\n }\n return byId;\n}\n\n/**\n * A settled `task` lane with its runtime as the server measured it (the\n * result's own stamps, `finishedLaneDurationMs`), so its card shows how long\n * it ran after a reload too. Kept per lane, so a lane that did not change\n * keeps its identity.\n */\nconst timedLanes = new WeakMap<SubagentDiscoverySnapshot, SubagentDiscoverySnapshot>();\n\nfunction withServerDuration(lane: SubagentDiscoverySnapshot, artifact: unknown): SubagentDiscoverySnapshot {\n if (lane.durationMs != null || !isTerminalSubagentStatus(lane.status)) return lane;\n const cached = timedLanes.get(lane);\n if (cached !== undefined) return cached;\n const durationMs = finishedLaneDurationMs(artifact);\n const timed = durationMs === null ? lane : { ...lane, durationMs };\n timedLanes.set(lane, timed);\n return timed;\n}\n\n/**\n * Why the run's own failure ended the turn, as its status says it (a call the\n * run never answered takes its message's status); `''` without a reason.\n */\nfunction runErrorText(status: ThreadMessage['status']): string {\n if (status?.type !== 'incomplete' || status.reason !== 'error') return '';\n const { error } = status;\n if (error === undefined || error === null) return '';\n return (typeof error === 'string' ? error : JSON.stringify(error)).trim();\n}\n\n/** A lane whose run failed before it settled, failed with the run's reason. Kept per lane. */\nconst failedLanes = new WeakMap<SubagentDiscoverySnapshot, SubagentDiscoverySnapshot>();\n\nfunction failedWithRun(lane: SubagentDiscoverySnapshot, reason: string): SubagentDiscoverySnapshot {\n const cached = failedLanes.get(lane);\n if (cached !== undefined) return cached;\n const failed: SubagentDiscoverySnapshot = { ...lane, status: 'error', output: reason || ORPHANED_SUBAGENT_OUTPUT };\n failedLanes.set(lane, failed);\n return failed;\n}\n\ninterface GroupLanes {\n lanes: readonly SubagentDiscoverySnapshot[];\n stoppedLaneIds: ReadonlySet<string>;\n}\n\nfunction groupLanes({\n message,\n group,\n args,\n toolCallId,\n turnEnded,\n}: {\n message: ThreadMessage;\n group: TaskSiblingGroup;\n args: unknown;\n toolCallId: string;\n /**\n * Nothing will settle the turn's lanes now: a later message follows it, or\n * it ended unfinished. (Its status alone is no sign the run is on it: a turn\n * whose lanes hold their running placeholders reads complete while the run\n * waits on a person.)\n */\n turnEnded: boolean;\n}): GroupLanes {\n const byCall = taskSubagentsOfTurn(message);\n const artifacts = new Map<string, unknown>();\n if (message.role === 'assistant') {\n for (const part of message.content) {\n if (part.type === 'tool-call' && part.toolName === TASK_TOOL_NAME) artifacts.set(part.toolCallId, part.artifact);\n }\n }\n const missing = group.ids.filter((id) => !byCall.has(id));\n const raw = missing.length > 0 ? rawCallArgs(getExternalStoreMessages<LangChainMessage>(message), missing) : null;\n let stopped: Set<string> | null = null;\n const lanes = group.ids.map((id) => {\n const known = byCall.get(id);\n const lane =\n known !== undefined\n ? withServerDuration(known, artifacts.get(id))\n : laneFromArgs(id, raw?.get(id) ?? (id === toolCallId ? args : undefined));\n if (!turnEnded || isTerminalSubagentStatus(lane.status)) return lane;\n // The run left this turn before the lane settled: nothing will settle it now.\n const reason = runErrorText(message.status);\n if (reason !== '') return failedWithRun(lane, reason);\n stopped ??= new Set();\n stopped.add(id);\n return lane;\n });\n return { lanes, stoppedLaneIds: stopped ?? NO_LANE_IDS };\n}\n\n/**\n * The lanes of the `task` calls issued together with `toolCallId` (its parallel\n * siblings), read off the turn's tool-call parts: each part's result and\n * `isPreliminary` say where its lane is, and its native `messages` are the\n * lane's transcript. The group is the calls of one parent AI message, found in\n * the sources bound to the turn. Only the first sibling reads the lanes; every\n * other sibling learns it is not the anchor and draws nothing.\n */\nexport function useTaskSubagentGroup({\n toolCallId,\n args,\n}: {\n toolCallId: string;\n /** The call's own arguments, for its lane before the turn holds its part. */\n args?: unknown;\n}): TaskSubagentGroupState {\n const message = useAuiState((s) => s.message);\n const group = useMemo(\n () => taskSiblingGroup(getExternalStoreMessages<LangChainMessage>(message), toolCallId),\n [message, toolCallId],\n );\n const isAnchor = group.anchorId === toolCallId;\n const turnToolCallIds = useMemo(() => (isAnchor ? openTurnToolCallIds(message) : undefined), [isAnchor, message]);\n const turnEnded = !message.isLast || message.status?.type === 'incomplete';\n const { lanes, stoppedLaneIds } = useMemo<GroupLanes>(\n () =>\n isAnchor\n ? groupLanes({ message, group, args, toolCallId, turnEnded })\n : { lanes: NO_LANES, stoppedLaneIds: NO_LANE_IDS },\n [isAnchor, message, group, args, toolCallId, turnEnded],\n );\n const delegatedAtMs = useMemo(\n () =>\n isAnchor ? laneDelegatedAtMs({ sources: getExternalStoreMessages<unknown>(message), toolCallId }) : null,\n [isAnchor, message, toolCallId],\n );\n return { group, isAnchor, lanes, turnToolCallIds, stoppedLaneIds, delegatedAtMs };\n}\n"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const require$$0 = require("react");
|
|
4
|
+
const laneImages = require("../agent-runtime/src/lane-images.cjs");
|
|
5
|
+
const IN_VIEW_MARGIN = "320px 0px";
|
|
6
|
+
const tileImage = (image) => laneImages.readLaneImageTile(image.getAttribute("src"));
|
|
7
|
+
function useOmittedImagesInView({
|
|
8
|
+
rootRef,
|
|
9
|
+
enabled,
|
|
10
|
+
onSeen
|
|
11
|
+
}) {
|
|
12
|
+
const onSeenRef = require$$0.useRef(onSeen);
|
|
13
|
+
onSeenRef.current = onSeen;
|
|
14
|
+
require$$0.useEffect(() => {
|
|
15
|
+
const root = rootRef.current;
|
|
16
|
+
if (!enabled || root === null) return void 0;
|
|
17
|
+
const watched = /* @__PURE__ */ new WeakSet();
|
|
18
|
+
const report = (image) => {
|
|
19
|
+
const seen = tileImage(image);
|
|
20
|
+
if (seen !== null) onSeenRef.current(seen);
|
|
21
|
+
};
|
|
22
|
+
const observed = /* @__PURE__ */ new Set();
|
|
23
|
+
const intersections = typeof IntersectionObserver === "function" ? new IntersectionObserver(
|
|
24
|
+
(entries) => {
|
|
25
|
+
for (const entry of entries) {
|
|
26
|
+
if (!entry.isIntersecting) continue;
|
|
27
|
+
intersections == null ? void 0 : intersections.unobserve(entry.target);
|
|
28
|
+
observed.delete(entry.target);
|
|
29
|
+
report(entry.target);
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
{ rootMargin: IN_VIEW_MARGIN }
|
|
33
|
+
) : null;
|
|
34
|
+
const scan = () => {
|
|
35
|
+
for (const image of observed) {
|
|
36
|
+
if (image.isConnected && tileImage(image) !== null) continue;
|
|
37
|
+
intersections == null ? void 0 : intersections.unobserve(image);
|
|
38
|
+
observed.delete(image);
|
|
39
|
+
}
|
|
40
|
+
for (const image of root.getElementsByTagName("img")) {
|
|
41
|
+
if (watched.has(image) || tileImage(image) === null) continue;
|
|
42
|
+
watched.add(image);
|
|
43
|
+
if (intersections === null) {
|
|
44
|
+
report(image);
|
|
45
|
+
continue;
|
|
46
|
+
}
|
|
47
|
+
observed.add(image);
|
|
48
|
+
intersections.observe(image);
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
const mutations = new MutationObserver((records) => {
|
|
52
|
+
for (const record of records) {
|
|
53
|
+
if (record.type === "attributes" && record.target instanceof Element) {
|
|
54
|
+
watched.delete(record.target);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
scan();
|
|
58
|
+
});
|
|
59
|
+
mutations.observe(root, { subtree: true, childList: true, attributes: true, attributeFilter: ["src"] });
|
|
60
|
+
scan();
|
|
61
|
+
return () => {
|
|
62
|
+
mutations.disconnect();
|
|
63
|
+
intersections == null ? void 0 : intersections.disconnect();
|
|
64
|
+
};
|
|
65
|
+
}, [rootRef, enabled]);
|
|
66
|
+
}
|
|
67
|
+
exports.useOmittedImagesInView = useOmittedImagesInView;
|
|
68
|
+
//# sourceMappingURL=use-omitted-images-in-view.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-omitted-images-in-view.cjs","sources":["../../src/subagents/use-omitted-images-in-view.ts"],"sourcesContent":["'use client';\n\nimport { type LaneImageRef, readLaneImageTile } from '@athenaintel/agent-runtime';\nimport { type RefObject, useEffect, useRef } from 'react';\n\n/** How far outside the visible area a tile starts its image's read. */\nconst IN_VIEW_MARGIN = '320px 0px';\n\nconst tileImage = (image: Element): LaneImageRef | null => readLaneImageTile(image.getAttribute('src'));\n\n/**\n * Reports each waiting tile a lane's transcript draws once it scrolls near the\n * viewport, with the image it stands for. Whatever card draws an omitted\n * image, its `<img>` shows the tile its block carries, which\n * `useDeepAgentLaneImages` tagged with that image's step and index\n * (`readLaneImageTile`). A tile in a collapsed card is not rendered, so it is\n * reported once the card opens.\n *\n * Read-only observation of `root`'s subtree: a MutationObserver finds tiles as\n * cards render, open, and swap an image back for its tile, and an\n * IntersectionObserver reports each one once it is near the viewport (every\n * tile at once where IntersectionObserver is missing). Nothing runs while\n * `enabled` is false (no image is left to ask for).\n */\nexport function useOmittedImagesInView({\n rootRef,\n enabled,\n onSeen,\n}: {\n rootRef: RefObject<HTMLElement | null>;\n enabled: boolean;\n onSeen: (image: LaneImageRef) => void;\n}): void {\n const onSeenRef = useRef(onSeen);\n onSeenRef.current = onSeen;\n useEffect(() => {\n const root = rootRef.current;\n if (!enabled || root === null) return undefined;\n // Tiles already handed to the observer (or reported); a tile whose `src`\n // changes is a new one.\n const watched = new WeakSet<Element>();\n const report = (image: Element) => {\n const seen = tileImage(image);\n if (seen !== null) onSeenRef.current(seen);\n };\n // Tiles the IntersectionObserver holds, let go once reported or removed.\n const observed = new Set<Element>();\n const intersections =\n typeof IntersectionObserver === 'function'\n ? new IntersectionObserver(\n (entries) => {\n for (const entry of entries) {\n if (!entry.isIntersecting) continue;\n intersections?.unobserve(entry.target);\n observed.delete(entry.target);\n report(entry.target);\n }\n },\n { rootMargin: IN_VIEW_MARGIN },\n )\n : null;\n const scan = () => {\n // A tile removed (its card closed) or showing its image is let go.\n for (const image of observed) {\n if (image.isConnected && tileImage(image) !== null) continue;\n intersections?.unobserve(image);\n observed.delete(image);\n }\n for (const image of root.getElementsByTagName('img')) {\n if (watched.has(image) || tileImage(image) === null) continue;\n watched.add(image);\n if (intersections === null) {\n report(image);\n continue;\n }\n observed.add(image);\n intersections.observe(image);\n }\n };\n const mutations = new MutationObserver((records) => {\n for (const record of records) {\n if (record.type === 'attributes' && record.target instanceof Element) {\n watched.delete(record.target);\n }\n }\n scan();\n });\n mutations.observe(root, { subtree: true, childList: true, attributes: true, attributeFilter: ['src'] });\n scan();\n return () => {\n mutations.disconnect();\n intersections?.disconnect();\n };\n }, [rootRef, enabled]);\n}\n"],"names":["readLaneImageTile","useRef","useEffect"],"mappings":";;;;AAMA,MAAM,iBAAiB;AAEvB,MAAM,YAAY,CAAC,UAAwCA,WAAAA,kBAAkB,MAAM,aAAa,KAAK,CAAC;AAgB/F,SAAS,uBAAuB;AAAA,EACrC;AAAA,EACA;AAAA,EACA;AACF,GAIS;AACP,QAAM,YAAYC,WAAAA,OAAO,MAAM;AAC/B,YAAU,UAAU;AACpBC,aAAAA,UAAU,MAAM;AACd,UAAM,OAAO,QAAQ;AACrB,QAAI,CAAC,WAAW,SAAS,KAAM,QAAO;AAGtC,UAAM,8BAAc,QAAA;AACpB,UAAM,SAAS,CAAC,UAAmB;AACjC,YAAM,OAAO,UAAU,KAAK;AAC5B,UAAI,SAAS,KAAM,WAAU,QAAQ,IAAI;AAAA,IAC3C;AAEA,UAAM,+BAAe,IAAA;AACrB,UAAM,gBACJ,OAAO,yBAAyB,aAC5B,IAAI;AAAA,MACF,CAAC,YAAY;AACX,mBAAW,SAAS,SAAS;AAC3B,cAAI,CAAC,MAAM,eAAgB;AAC3B,yDAAe,UAAU,MAAM;AAC/B,mBAAS,OAAO,MAAM,MAAM;AAC5B,iBAAO,MAAM,MAAM;AAAA,QACrB;AAAA,MACF;AAAA,MACA,EAAE,YAAY,eAAA;AAAA,IAAe,IAE/B;AACN,UAAM,OAAO,MAAM;AAEjB,iBAAW,SAAS,UAAU;AAC5B,YAAI,MAAM,eAAe,UAAU,KAAK,MAAM,KAAM;AACpD,uDAAe,UAAU;AACzB,iBAAS,OAAO,KAAK;AAAA,MACvB;AACA,iBAAW,SAAS,KAAK,qBAAqB,KAAK,GAAG;AACpD,YAAI,QAAQ,IAAI,KAAK,KAAK,UAAU,KAAK,MAAM,KAAM;AACrD,gBAAQ,IAAI,KAAK;AACjB,YAAI,kBAAkB,MAAM;AAC1B,iBAAO,KAAK;AACZ;AAAA,QACF;AACA,iBAAS,IAAI,KAAK;AAClB,sBAAc,QAAQ,KAAK;AAAA,MAC7B;AAAA,IACF;AACA,UAAM,YAAY,IAAI,iBAAiB,CAAC,YAAY;AAClD,iBAAW,UAAU,SAAS;AAC5B,YAAI,OAAO,SAAS,gBAAgB,OAAO,kBAAkB,SAAS;AACpE,kBAAQ,OAAO,OAAO,MAAM;AAAA,QAC9B;AAAA,MACF;AACA,WAAA;AAAA,IACF,CAAC;AACD,cAAU,QAAQ,MAAM,EAAE,SAAS,MAAM,WAAW,MAAM,YAAY,MAAM,iBAAiB,CAAC,KAAK,GAAG;AACtG,SAAA;AACA,WAAO,MAAM;AACX,gBAAU,WAAA;AACV,qDAAe;AAAA,IACjB;AAAA,EACF,GAAG,CAAC,SAAS,OAAO,CAAC;AACvB;;"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type LaneImageRef } from '../agent-runtime/src/index';
|
|
2
|
+
import { type RefObject } from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* Reports each waiting tile a lane's transcript draws once it scrolls near the
|
|
5
|
+
* viewport, with the image it stands for. Whatever card draws an omitted
|
|
6
|
+
* image, its `<img>` shows the tile its block carries, which
|
|
7
|
+
* `useDeepAgentLaneImages` tagged with that image's step and index
|
|
8
|
+
* (`readLaneImageTile`). A tile in a collapsed card is not rendered, so it is
|
|
9
|
+
* reported once the card opens.
|
|
10
|
+
*
|
|
11
|
+
* Read-only observation of `root`'s subtree: a MutationObserver finds tiles as
|
|
12
|
+
* cards render, open, and swap an image back for its tile, and an
|
|
13
|
+
* IntersectionObserver reports each one once it is near the viewport (every
|
|
14
|
+
* tile at once where IntersectionObserver is missing). Nothing runs while
|
|
15
|
+
* `enabled` is false (no image is left to ask for).
|
|
16
|
+
*/
|
|
17
|
+
export declare function useOmittedImagesInView({ rootRef, enabled, onSeen, }: {
|
|
18
|
+
rootRef: RefObject<HTMLElement | null>;
|
|
19
|
+
enabled: boolean;
|
|
20
|
+
onSeen: (image: LaneImageRef) => void;
|
|
21
|
+
}): void;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { useRef, useEffect } from "react";
|
|
2
|
+
import { readLaneImageTile } from "../agent-runtime/src/lane-images.js";
|
|
3
|
+
const IN_VIEW_MARGIN = "320px 0px";
|
|
4
|
+
const tileImage = (image) => readLaneImageTile(image.getAttribute("src"));
|
|
5
|
+
function useOmittedImagesInView({
|
|
6
|
+
rootRef,
|
|
7
|
+
enabled,
|
|
8
|
+
onSeen
|
|
9
|
+
}) {
|
|
10
|
+
const onSeenRef = useRef(onSeen);
|
|
11
|
+
onSeenRef.current = onSeen;
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
const root = rootRef.current;
|
|
14
|
+
if (!enabled || root === null) return void 0;
|
|
15
|
+
const watched = /* @__PURE__ */ new WeakSet();
|
|
16
|
+
const report = (image) => {
|
|
17
|
+
const seen = tileImage(image);
|
|
18
|
+
if (seen !== null) onSeenRef.current(seen);
|
|
19
|
+
};
|
|
20
|
+
const observed = /* @__PURE__ */ new Set();
|
|
21
|
+
const intersections = typeof IntersectionObserver === "function" ? new IntersectionObserver(
|
|
22
|
+
(entries) => {
|
|
23
|
+
for (const entry of entries) {
|
|
24
|
+
if (!entry.isIntersecting) continue;
|
|
25
|
+
intersections == null ? void 0 : intersections.unobserve(entry.target);
|
|
26
|
+
observed.delete(entry.target);
|
|
27
|
+
report(entry.target);
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
{ rootMargin: IN_VIEW_MARGIN }
|
|
31
|
+
) : null;
|
|
32
|
+
const scan = () => {
|
|
33
|
+
for (const image of observed) {
|
|
34
|
+
if (image.isConnected && tileImage(image) !== null) continue;
|
|
35
|
+
intersections == null ? void 0 : intersections.unobserve(image);
|
|
36
|
+
observed.delete(image);
|
|
37
|
+
}
|
|
38
|
+
for (const image of root.getElementsByTagName("img")) {
|
|
39
|
+
if (watched.has(image) || tileImage(image) === null) continue;
|
|
40
|
+
watched.add(image);
|
|
41
|
+
if (intersections === null) {
|
|
42
|
+
report(image);
|
|
43
|
+
continue;
|
|
44
|
+
}
|
|
45
|
+
observed.add(image);
|
|
46
|
+
intersections.observe(image);
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
const mutations = new MutationObserver((records) => {
|
|
50
|
+
for (const record of records) {
|
|
51
|
+
if (record.type === "attributes" && record.target instanceof Element) {
|
|
52
|
+
watched.delete(record.target);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
scan();
|
|
56
|
+
});
|
|
57
|
+
mutations.observe(root, { subtree: true, childList: true, attributes: true, attributeFilter: ["src"] });
|
|
58
|
+
scan();
|
|
59
|
+
return () => {
|
|
60
|
+
mutations.disconnect();
|
|
61
|
+
intersections == null ? void 0 : intersections.disconnect();
|
|
62
|
+
};
|
|
63
|
+
}, [rootRef, enabled]);
|
|
64
|
+
}
|
|
65
|
+
export {
|
|
66
|
+
useOmittedImagesInView
|
|
67
|
+
};
|
|
68
|
+
//# sourceMappingURL=use-omitted-images-in-view.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-omitted-images-in-view.js","sources":["../../src/subagents/use-omitted-images-in-view.ts"],"sourcesContent":["'use client';\n\nimport { type LaneImageRef, readLaneImageTile } from '@athenaintel/agent-runtime';\nimport { type RefObject, useEffect, useRef } from 'react';\n\n/** How far outside the visible area a tile starts its image's read. */\nconst IN_VIEW_MARGIN = '320px 0px';\n\nconst tileImage = (image: Element): LaneImageRef | null => readLaneImageTile(image.getAttribute('src'));\n\n/**\n * Reports each waiting tile a lane's transcript draws once it scrolls near the\n * viewport, with the image it stands for. Whatever card draws an omitted\n * image, its `<img>` shows the tile its block carries, which\n * `useDeepAgentLaneImages` tagged with that image's step and index\n * (`readLaneImageTile`). A tile in a collapsed card is not rendered, so it is\n * reported once the card opens.\n *\n * Read-only observation of `root`'s subtree: a MutationObserver finds tiles as\n * cards render, open, and swap an image back for its tile, and an\n * IntersectionObserver reports each one once it is near the viewport (every\n * tile at once where IntersectionObserver is missing). Nothing runs while\n * `enabled` is false (no image is left to ask for).\n */\nexport function useOmittedImagesInView({\n rootRef,\n enabled,\n onSeen,\n}: {\n rootRef: RefObject<HTMLElement | null>;\n enabled: boolean;\n onSeen: (image: LaneImageRef) => void;\n}): void {\n const onSeenRef = useRef(onSeen);\n onSeenRef.current = onSeen;\n useEffect(() => {\n const root = rootRef.current;\n if (!enabled || root === null) return undefined;\n // Tiles already handed to the observer (or reported); a tile whose `src`\n // changes is a new one.\n const watched = new WeakSet<Element>();\n const report = (image: Element) => {\n const seen = tileImage(image);\n if (seen !== null) onSeenRef.current(seen);\n };\n // Tiles the IntersectionObserver holds, let go once reported or removed.\n const observed = new Set<Element>();\n const intersections =\n typeof IntersectionObserver === 'function'\n ? new IntersectionObserver(\n (entries) => {\n for (const entry of entries) {\n if (!entry.isIntersecting) continue;\n intersections?.unobserve(entry.target);\n observed.delete(entry.target);\n report(entry.target);\n }\n },\n { rootMargin: IN_VIEW_MARGIN },\n )\n : null;\n const scan = () => {\n // A tile removed (its card closed) or showing its image is let go.\n for (const image of observed) {\n if (image.isConnected && tileImage(image) !== null) continue;\n intersections?.unobserve(image);\n observed.delete(image);\n }\n for (const image of root.getElementsByTagName('img')) {\n if (watched.has(image) || tileImage(image) === null) continue;\n watched.add(image);\n if (intersections === null) {\n report(image);\n continue;\n }\n observed.add(image);\n intersections.observe(image);\n }\n };\n const mutations = new MutationObserver((records) => {\n for (const record of records) {\n if (record.type === 'attributes' && record.target instanceof Element) {\n watched.delete(record.target);\n }\n }\n scan();\n });\n mutations.observe(root, { subtree: true, childList: true, attributes: true, attributeFilter: ['src'] });\n scan();\n return () => {\n mutations.disconnect();\n intersections?.disconnect();\n };\n }, [rootRef, enabled]);\n}\n"],"names":[],"mappings":";;AAMA,MAAM,iBAAiB;AAEvB,MAAM,YAAY,CAAC,UAAwC,kBAAkB,MAAM,aAAa,KAAK,CAAC;AAgB/F,SAAS,uBAAuB;AAAA,EACrC;AAAA,EACA;AAAA,EACA;AACF,GAIS;AACP,QAAM,YAAY,OAAO,MAAM;AAC/B,YAAU,UAAU;AACpB,YAAU,MAAM;AACd,UAAM,OAAO,QAAQ;AACrB,QAAI,CAAC,WAAW,SAAS,KAAM,QAAO;AAGtC,UAAM,8BAAc,QAAA;AACpB,UAAM,SAAS,CAAC,UAAmB;AACjC,YAAM,OAAO,UAAU,KAAK;AAC5B,UAAI,SAAS,KAAM,WAAU,QAAQ,IAAI;AAAA,IAC3C;AAEA,UAAM,+BAAe,IAAA;AACrB,UAAM,gBACJ,OAAO,yBAAyB,aAC5B,IAAI;AAAA,MACF,CAAC,YAAY;AACX,mBAAW,SAAS,SAAS;AAC3B,cAAI,CAAC,MAAM,eAAgB;AAC3B,yDAAe,UAAU,MAAM;AAC/B,mBAAS,OAAO,MAAM,MAAM;AAC5B,iBAAO,MAAM,MAAM;AAAA,QACrB;AAAA,MACF;AAAA,MACA,EAAE,YAAY,eAAA;AAAA,IAAe,IAE/B;AACN,UAAM,OAAO,MAAM;AAEjB,iBAAW,SAAS,UAAU;AAC5B,YAAI,MAAM,eAAe,UAAU,KAAK,MAAM,KAAM;AACpD,uDAAe,UAAU;AACzB,iBAAS,OAAO,KAAK;AAAA,MACvB;AACA,iBAAW,SAAS,KAAK,qBAAqB,KAAK,GAAG;AACpD,YAAI,QAAQ,IAAI,KAAK,KAAK,UAAU,KAAK,MAAM,KAAM;AACrD,gBAAQ,IAAI,KAAK;AACjB,YAAI,kBAAkB,MAAM;AAC1B,iBAAO,KAAK;AACZ;AAAA,QACF;AACA,iBAAS,IAAI,KAAK;AAClB,sBAAc,QAAQ,KAAK;AAAA,MAC7B;AAAA,IACF;AACA,UAAM,YAAY,IAAI,iBAAiB,CAAC,YAAY;AAClD,iBAAW,UAAU,SAAS;AAC5B,YAAI,OAAO,SAAS,gBAAgB,OAAO,kBAAkB,SAAS;AACpE,kBAAQ,OAAO,OAAO,MAAM;AAAA,QAC9B;AAAA,MACF;AACA,WAAA;AAAA,IACF,CAAC;AACD,cAAU,QAAQ,MAAM,EAAE,SAAS,MAAM,WAAW,MAAM,YAAY,MAAM,iBAAiB,CAAC,KAAK,GAAG;AACtG,SAAA;AACA,WAAO,MAAM;AACX,gBAAU,WAAA;AACV,qDAAe;AAAA,IACjB;AAAA,EACF,GAAG,CAAC,SAAS,OAAO,CAAC;AACvB;"}
|
package/dist/threads/Inbox.cjs
CHANGED
|
@@ -9,7 +9,7 @@ const credentialRenewal = require("../runtime/credential-renewal.cjs");
|
|
|
9
9
|
const popover = require("../ui/popover.cjs");
|
|
10
10
|
const api = require("./api.cjs");
|
|
11
11
|
const SessionList = require("./SessionList.cjs");
|
|
12
|
-
const
|
|
12
|
+
const threads_sessionListModel = require("./session-list-model.cjs");
|
|
13
13
|
const sessionRowParts = require("./session-row-parts.cjs");
|
|
14
14
|
const sessionsPageModel = require("./sessions-page-model.cjs");
|
|
15
15
|
const statewireThreadList = require("./statewire-thread-list.cjs");
|
|
@@ -103,7 +103,7 @@ const InboxRow = ({ row, isActive, list, onOpen, onDismiss }) => {
|
|
|
103
103
|
children: row.title ?? "Untitled"
|
|
104
104
|
}
|
|
105
105
|
),
|
|
106
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0 text-[11px] text-muted-foreground", children:
|
|
106
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0 text-[11px] text-muted-foreground", children: threads_sessionListModel.relativeTime(row.updatedAt) })
|
|
107
107
|
] }),
|
|
108
108
|
excerpt ? /* @__PURE__ */ jsxRuntime.jsx("span", { "data-excerpt": true, className: "mt-0.5 line-clamp-2 break-words text-muted-foreground text-xs", children: excerpt }) : null,
|
|
109
109
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "mt-1 flex", children: /* @__PURE__ */ jsxRuntime.jsx(sessionRowParts.StatusChip, { label: chip.label, tone: chip.tone, detail: row.nextAction }) })
|