@athenaintel/react 0.57.1 → 0.59.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +778 -9
- package/dist/agent-runtime/src/addressed-agents.cjs +16 -0
- package/dist/agent-runtime/src/addressed-agents.cjs.map +1 -0
- package/dist/agent-runtime/src/addressed-agents.d.ts +30 -0
- package/dist/agent-runtime/src/addressed-agents.js +16 -0
- package/dist/agent-runtime/src/addressed-agents.js.map +1 -0
- package/dist/agent-runtime/src/answer-label.cjs +4 -3
- package/dist/agent-runtime/src/answer-label.cjs.map +1 -1
- package/dist/agent-runtime/src/answer-label.d.ts +13 -6
- package/dist/agent-runtime/src/answer-label.js +4 -3
- package/dist/agent-runtime/src/answer-label.js.map +1 -1
- package/dist/agent-runtime/src/chat-outbox-attachments.cjs.map +1 -1
- package/dist/agent-runtime/src/chat-outbox-attachments.d.ts +1 -1
- package/dist/agent-runtime/src/chat-outbox-attachments.js.map +1 -1
- package/dist/agent-runtime/src/chat-outbox-entry.cjs +101 -0
- package/dist/agent-runtime/src/chat-outbox-entry.cjs.map +1 -0
- package/dist/agent-runtime/src/chat-outbox-entry.d.ts +99 -0
- package/dist/agent-runtime/src/chat-outbox-entry.js +101 -0
- package/dist/agent-runtime/src/chat-outbox-entry.js.map +1 -0
- package/dist/agent-runtime/src/chat-outbox-legacy.cjs +252 -0
- package/dist/agent-runtime/src/chat-outbox-legacy.cjs.map +1 -0
- package/dist/agent-runtime/src/chat-outbox-legacy.d.ts +96 -0
- package/dist/agent-runtime/src/chat-outbox-legacy.js +252 -0
- package/dist/agent-runtime/src/chat-outbox-legacy.js.map +1 -0
- package/dist/agent-runtime/src/chat-outbox-policy.cjs +30 -0
- package/dist/agent-runtime/src/chat-outbox-policy.cjs.map +1 -0
- package/dist/agent-runtime/src/chat-outbox-policy.d.ts +42 -0
- package/dist/agent-runtime/src/chat-outbox-policy.js +30 -0
- package/dist/agent-runtime/src/chat-outbox-policy.js.map +1 -0
- package/dist/agent-runtime/src/chat-outbox-storage.cjs +306 -0
- package/dist/agent-runtime/src/chat-outbox-storage.cjs.map +1 -0
- package/dist/agent-runtime/src/chat-outbox-storage.d.ts +194 -0
- package/dist/agent-runtime/src/chat-outbox-storage.js +306 -0
- package/dist/agent-runtime/src/chat-outbox-storage.js.map +1 -0
- package/dist/agent-runtime/src/chat-outbox-thread.cjs +21 -94
- package/dist/agent-runtime/src/chat-outbox-thread.cjs.map +1 -1
- package/dist/agent-runtime/src/chat-outbox-thread.d.ts +22 -18
- package/dist/agent-runtime/src/chat-outbox-thread.js +21 -94
- package/dist/agent-runtime/src/chat-outbox-thread.js.map +1 -1
- package/dist/agent-runtime/src/chat-outbox.cjs +492 -547
- package/dist/agent-runtime/src/chat-outbox.cjs.map +1 -1
- package/dist/agent-runtime/src/chat-outbox.d.ts +110 -142
- package/dist/agent-runtime/src/chat-outbox.js +492 -547
- package/dist/agent-runtime/src/chat-outbox.js.map +1 -1
- package/dist/agent-runtime/src/composer-markdown.cjs.map +1 -1
- package/dist/agent-runtime/src/composer-markdown.d.ts +1 -1
- package/dist/agent-runtime/src/composer-markdown.js.map +1 -1
- package/dist/agent-runtime/src/deep-agent-transport-recipe.cjs +3 -1
- package/dist/agent-runtime/src/deep-agent-transport-recipe.cjs.map +1 -1
- package/dist/agent-runtime/src/deep-agent-transport-recipe.d.ts +8 -1
- package/dist/agent-runtime/src/deep-agent-transport-recipe.js +3 -1
- package/dist/agent-runtime/src/deep-agent-transport-recipe.js.map +1 -1
- package/dist/agent-runtime/src/dictation-preferences.d.ts +356 -0
- package/dist/agent-runtime/src/dictation-record.d.ts +279 -0
- package/dist/agent-runtime/src/dictation-session.d.ts +106 -7
- package/dist/agent-runtime/src/dictation-snippets.d.ts +9 -0
- package/dist/agent-runtime/src/dictation-transfer.d.ts +142 -0
- package/dist/agent-runtime/src/edit-command.cjs.map +1 -1
- package/dist/agent-runtime/src/edit-command.d.ts +1 -1
- package/dist/agent-runtime/src/edit-command.js.map +1 -1
- package/dist/agent-runtime/src/errors.cjs +1 -0
- package/dist/agent-runtime/src/errors.cjs.map +1 -1
- package/dist/agent-runtime/src/errors.js +1 -0
- package/dist/agent-runtime/src/errors.js.map +1 -1
- package/dist/agent-runtime/src/generated/runconfig-contract.cjs +24 -0
- package/dist/agent-runtime/src/generated/runconfig-contract.cjs.map +1 -1
- package/dist/agent-runtime/src/generated/runconfig-contract.d.ts +3 -3
- package/dist/agent-runtime/src/generated/runconfig-contract.js +24 -0
- package/dist/agent-runtime/src/generated/runconfig-contract.js.map +1 -1
- package/dist/agent-runtime/src/index.d.ts +14 -8
- package/dist/agent-runtime/src/lane-follow.cjs +289 -0
- package/dist/agent-runtime/src/lane-follow.cjs.map +1 -0
- package/dist/agent-runtime/src/lane-follow.js +289 -0
- package/dist/agent-runtime/src/lane-follow.js.map +1 -0
- package/dist/agent-runtime/src/lane-images.cjs +387 -0
- package/dist/agent-runtime/src/lane-images.cjs.map +1 -0
- package/dist/agent-runtime/src/lane-images.js +387 -0
- package/dist/agent-runtime/src/lane-images.js.map +1 -0
- package/dist/agent-runtime/src/message-window.js +1 -1
- package/dist/agent-runtime/src/messages.cjs +19 -1
- package/dist/agent-runtime/src/messages.cjs.map +1 -1
- package/dist/agent-runtime/src/messages.d.ts +8 -0
- package/dist/agent-runtime/src/messages.js +21 -3
- package/dist/agent-runtime/src/messages.js.map +1 -1
- package/dist/agent-runtime/src/named-agents.cjs +301 -0
- package/dist/agent-runtime/src/named-agents.cjs.map +1 -0
- package/dist/agent-runtime/src/named-agents.d.ts +246 -0
- package/dist/agent-runtime/src/named-agents.js +301 -0
- package/dist/agent-runtime/src/named-agents.js.map +1 -0
- package/dist/agent-runtime/src/offline-status.cjs.map +1 -1
- package/dist/agent-runtime/src/offline-status.d.ts +66 -2
- package/dist/agent-runtime/src/offline-status.js.map +1 -1
- package/dist/agent-runtime/src/ptc-subcalls.cjs +41 -0
- package/dist/agent-runtime/src/ptc-subcalls.cjs.map +1 -0
- package/dist/agent-runtime/src/ptc-subcalls.js +41 -0
- package/dist/agent-runtime/src/ptc-subcalls.js.map +1 -0
- package/dist/agent-runtime/src/queue.cjs +2 -2
- package/dist/agent-runtime/src/queue.cjs.map +1 -1
- package/dist/agent-runtime/src/queue.d.ts +20 -25
- package/dist/agent-runtime/src/queue.js +2 -2
- package/dist/agent-runtime/src/queue.js.map +1 -1
- package/dist/agent-runtime/src/quota-safe-local-storage-session.cjs +314 -84
- package/dist/agent-runtime/src/quota-safe-local-storage-session.cjs.map +1 -1
- package/dist/agent-runtime/src/quota-safe-local-storage-session.d.ts +137 -40
- package/dist/agent-runtime/src/quota-safe-local-storage-session.js +318 -88
- package/dist/agent-runtime/src/quota-safe-local-storage-session.js.map +1 -1
- package/dist/agent-runtime/src/run-send.cjs +54 -0
- package/dist/agent-runtime/src/run-send.cjs.map +1 -0
- package/dist/agent-runtime/src/run-send.d.ts +51 -0
- package/dist/agent-runtime/src/run-send.js +54 -0
- package/dist/agent-runtime/src/run-send.js.map +1 -0
- package/dist/agent-runtime/src/running-tool-placeholder.cjs +6 -0
- package/dist/agent-runtime/src/running-tool-placeholder.cjs.map +1 -1
- package/dist/agent-runtime/src/running-tool-placeholder.js +6 -0
- package/dist/agent-runtime/src/running-tool-placeholder.js.map +1 -1
- package/dist/agent-runtime/src/runtime.d.ts +9 -5
- package/dist/agent-runtime/src/sealed-idb.cjs +64 -0
- package/dist/agent-runtime/src/sealed-idb.cjs.map +1 -1
- package/dist/agent-runtime/src/sealed-idb.d.ts +16 -0
- package/dist/agent-runtime/src/sealed-idb.js +64 -0
- package/dist/agent-runtime/src/sealed-idb.js.map +1 -1
- package/dist/agent-runtime/src/send-recovery.cjs +90 -118
- package/dist/agent-runtime/src/send-recovery.cjs.map +1 -1
- package/dist/agent-runtime/src/send-recovery.d.ts +25 -29
- package/dist/agent-runtime/src/send-recovery.js +90 -118
- package/dist/agent-runtime/src/send-recovery.js.map +1 -1
- package/dist/agent-runtime/src/statewire-diagnostics.d.ts +4 -1
- package/dist/agent-runtime/src/statewire-held-sends.cjs +191 -0
- package/dist/agent-runtime/src/statewire-held-sends.cjs.map +1 -0
- package/dist/agent-runtime/src/statewire-held-sends.d.ts +119 -0
- package/dist/agent-runtime/src/statewire-held-sends.js +191 -0
- package/dist/agent-runtime/src/statewire-held-sends.js.map +1 -0
- package/dist/agent-runtime/src/statewire-state.cjs +4 -0
- package/dist/agent-runtime/src/statewire-state.cjs.map +1 -1
- package/dist/agent-runtime/src/statewire-state.js +4 -0
- package/dist/agent-runtime/src/statewire-state.js.map +1 -1
- package/dist/agent-runtime/src/statewire-transport.cjs +8 -2
- package/dist/agent-runtime/src/statewire-transport.cjs.map +1 -1
- package/dist/agent-runtime/src/statewire-transport.d.ts +14 -5
- package/dist/agent-runtime/src/statewire-transport.js +8 -2
- package/dist/agent-runtime/src/statewire-transport.js.map +1 -1
- package/dist/agent-runtime/src/subagent-transcripts.cjs +1 -23
- package/dist/agent-runtime/src/subagent-transcripts.cjs.map +1 -1
- package/dist/agent-runtime/src/subagent-transcripts.js +3 -25
- package/dist/agent-runtime/src/subagent-transcripts.js.map +1 -1
- package/dist/agent-runtime/src/subagents.cjs +22 -29
- package/dist/agent-runtime/src/subagents.cjs.map +1 -1
- package/dist/agent-runtime/src/subagents.js +23 -30
- package/dist/agent-runtime/src/subagents.js.map +1 -1
- package/dist/agent-runtime/src/thread-extras.cjs +27 -19
- package/dist/agent-runtime/src/thread-extras.cjs.map +1 -1
- package/dist/agent-runtime/src/thread-extras.d.ts +19 -6
- package/dist/agent-runtime/src/thread-extras.js +27 -19
- package/dist/agent-runtime/src/thread-extras.js.map +1 -1
- package/dist/agent-runtime/src/thread-handoff-flow-machine.d.ts +8 -8
- package/dist/agent-runtime/src/tool-metadata.cjs +12 -0
- package/dist/agent-runtime/src/tool-metadata.cjs.map +1 -1
- package/dist/agent-runtime/src/tool-metadata.js +12 -0
- package/dist/agent-runtime/src/tool-metadata.js.map +1 -1
- package/dist/agent-runtime/src/tool-names.cjs +21 -0
- package/dist/agent-runtime/src/tool-names.cjs.map +1 -1
- package/dist/agent-runtime/src/tool-names.d.ts +8 -0
- package/dist/agent-runtime/src/tool-names.js +21 -0
- package/dist/agent-runtime/src/tool-names.js.map +1 -1
- package/dist/agent-runtime/src/typed-interrupt-kinds.cjs +247 -0
- package/dist/agent-runtime/src/typed-interrupt-kinds.cjs.map +1 -0
- package/dist/agent-runtime/src/typed-interrupt-kinds.d.ts +173 -0
- package/dist/agent-runtime/src/typed-interrupt-kinds.js +247 -0
- package/dist/agent-runtime/src/typed-interrupt-kinds.js.map +1 -0
- package/dist/agent-runtime/src/typed-interrupts.cjs +48 -0
- package/dist/agent-runtime/src/typed-interrupts.cjs.map +1 -0
- package/dist/agent-runtime/src/typed-interrupts.d.ts +75 -0
- package/dist/agent-runtime/src/typed-interrupts.js +48 -0
- package/dist/agent-runtime/src/typed-interrupts.js.map +1 -0
- package/dist/agent-runtime/src/types.d.ts +1 -1
- package/dist/agent-runtime/src/use-conversation-list.cjs +1 -0
- package/dist/agent-runtime/src/use-conversation-list.cjs.map +1 -1
- package/dist/agent-runtime/src/use-conversation-list.d.ts +7 -0
- package/dist/agent-runtime/src/use-conversation-list.js +1 -0
- package/dist/agent-runtime/src/use-conversation-list.js.map +1 -1
- package/dist/agent-runtime/src/use-deep-agent-chat-outbox.cjs +46 -29
- package/dist/agent-runtime/src/use-deep-agent-chat-outbox.cjs.map +1 -1
- package/dist/agent-runtime/src/use-deep-agent-chat-outbox.d.ts +14 -22
- package/dist/agent-runtime/src/use-deep-agent-chat-outbox.js +46 -29
- package/dist/agent-runtime/src/use-deep-agent-chat-outbox.js.map +1 -1
- package/dist/agent-runtime/src/use-deep-agent-runtime.cjs +78 -14
- package/dist/agent-runtime/src/use-deep-agent-runtime.cjs.map +1 -1
- package/dist/agent-runtime/src/use-deep-agent-runtime.d.ts +34 -7
- package/dist/agent-runtime/src/use-deep-agent-runtime.js +79 -15
- package/dist/agent-runtime/src/use-deep-agent-runtime.js.map +1 -1
- package/dist/agent-runtime/src/use-deep-agent-thread.cjs +16 -1
- package/dist/agent-runtime/src/use-deep-agent-thread.cjs.map +1 -1
- package/dist/agent-runtime/src/use-deep-agent-thread.d.ts +7 -2
- package/dist/agent-runtime/src/use-deep-agent-thread.js +16 -1
- package/dist/agent-runtime/src/use-deep-agent-thread.js.map +1 -1
- package/dist/agent-runtime/src/use-deep-agent-voice.cjs +30 -4
- package/dist/agent-runtime/src/use-deep-agent-voice.cjs.map +1 -1
- package/dist/agent-runtime/src/use-deep-agent-voice.d.ts +22 -4
- package/dist/agent-runtime/src/use-deep-agent-voice.js +30 -4
- package/dist/agent-runtime/src/use-deep-agent-voice.js.map +1 -1
- package/dist/agent-runtime/src/withdrawn-turns.d.ts +5 -4
- package/dist/agent-runtime/src/word-device-fit.d.ts +174 -0
- package/dist/agent-runtime/src/work-in.d.ts +127 -0
- package/dist/assets/AthenaAssetEmbed.cjs.map +1 -1
- package/dist/assets/AthenaAssetEmbed.d.ts +6 -1
- package/dist/assets/AthenaAssetEmbed.js.map +1 -1
- package/dist/assets/asset-panel-store.cjs +13 -5
- package/dist/assets/asset-panel-store.cjs.map +1 -1
- package/dist/assets/asset-panel-store.d.ts +33 -2
- package/dist/assets/asset-panel-store.js +13 -5
- package/dist/assets/asset-panel-store.js.map +1 -1
- package/dist/auth/AthenaCredentialSourceContext.cjs +11 -0
- package/dist/auth/AthenaCredentialSourceContext.cjs.map +1 -1
- package/dist/auth/AthenaCredentialSourceContext.d.ts +6 -0
- package/dist/auth/AthenaCredentialSourceContext.js +11 -0
- package/dist/auth/AthenaCredentialSourceContext.js.map +1 -1
- package/dist/auth/account-identity.cjs +13 -2
- package/dist/auth/account-identity.cjs.map +1 -1
- package/dist/auth/account-identity.d.ts +9 -0
- package/dist/auth/account-identity.js +13 -2
- package/dist/auth/account-identity.js.map +1 -1
- package/dist/auth/credential-source.cjs +20 -4
- package/dist/auth/credential-source.cjs.map +1 -1
- package/dist/auth/credential-source.d.ts +9 -0
- package/dist/auth/credential-source.js +20 -4
- package/dist/auth/credential-source.js.map +1 -1
- package/dist/catalog/chat-pickers.cjs +31 -0
- package/dist/catalog/chat-pickers.cjs.map +1 -1
- package/dist/catalog/chat-pickers.d.ts +17 -0
- package/dist/catalog/chat-pickers.js +33 -2
- package/dist/catalog/chat-pickers.js.map +1 -1
- package/dist/catalog/runtime-catalog.cjs +63 -3
- package/dist/catalog/runtime-catalog.cjs.map +1 -1
- package/dist/catalog/runtime-catalog.d.ts +63 -3
- package/dist/catalog/runtime-catalog.js +64 -4
- package/dist/catalog/runtime-catalog.js.map +1 -1
- package/dist/chat/AthenaChat.cjs +337 -99
- package/dist/chat/AthenaChat.cjs.map +1 -1
- package/dist/chat/AthenaChat.d.ts +80 -4
- package/dist/chat/AthenaChat.js +337 -99
- package/dist/chat/AthenaChat.js.map +1 -1
- package/dist/chat/StatewireApprovalCard.cjs +35 -5
- package/dist/chat/StatewireApprovalCard.cjs.map +1 -1
- package/dist/chat/StatewireApprovalCard.d.ts +55 -2
- package/dist/chat/StatewireApprovalCard.js +37 -7
- package/dist/chat/StatewireApprovalCard.js.map +1 -1
- package/dist/chat/StatewireQueuedMessages.cjs +17 -2
- package/dist/chat/StatewireQueuedMessages.cjs.map +1 -1
- package/dist/chat/StatewireQueuedMessages.d.ts +8 -45
- package/dist/chat/StatewireQueuedMessages.js +18 -3
- package/dist/chat/StatewireQueuedMessages.js.map +1 -1
- package/dist/chat/chat-agent-mentions.cjs +70 -0
- package/dist/chat/chat-agent-mentions.cjs.map +1 -0
- package/dist/chat/chat-agent-mentions.d.ts +13 -0
- package/dist/chat/chat-agent-mentions.js +70 -0
- package/dist/chat/chat-agent-mentions.js.map +1 -0
- package/dist/chat/composer-actions.cjs +12 -0
- package/dist/chat/composer-actions.cjs.map +1 -0
- package/dist/chat/composer-actions.d.ts +22 -0
- package/dist/chat/composer-actions.js +12 -0
- package/dist/chat/composer-actions.js.map +1 -0
- package/dist/chat/follow-up-suggestions.cjs +185 -0
- package/dist/chat/follow-up-suggestions.cjs.map +1 -0
- package/dist/chat/follow-up-suggestions.d.ts +64 -0
- package/dist/chat/follow-up-suggestions.js +185 -0
- package/dist/chat/follow-up-suggestions.js.map +1 -0
- package/dist/chat/super-grouping/ToolTimeline.cjs +4 -3
- package/dist/chat/super-grouping/ToolTimeline.cjs.map +1 -1
- package/dist/chat/super-grouping/ToolTimeline.d.ts +7 -3
- package/dist/chat/super-grouping/ToolTimeline.js +4 -3
- package/dist/chat/super-grouping/ToolTimeline.js.map +1 -1
- package/dist/chat/turn-changes.cjs +284 -0
- package/dist/chat/turn-changes.cjs.map +1 -0
- package/dist/chat/turn-changes.d.ts +130 -0
- package/dist/chat/turn-changes.js +284 -0
- package/dist/chat/turn-changes.js.map +1 -0
- package/dist/chat/typed-interrupts/StatewireTypedInterruptCard.cjs +31 -0
- package/dist/chat/typed-interrupts/StatewireTypedInterruptCard.cjs.map +1 -0
- package/dist/chat/typed-interrupts/StatewireTypedInterruptCard.d.ts +31 -0
- package/dist/chat/typed-interrupts/StatewireTypedInterruptCard.js +31 -0
- package/dist/chat/typed-interrupts/StatewireTypedInterruptCard.js.map +1 -0
- package/dist/chat/typed-interrupts/approval-cards.cjs +250 -0
- package/dist/chat/typed-interrupts/approval-cards.cjs.map +1 -0
- package/dist/chat/typed-interrupts/approval-cards.d.ts +22 -0
- package/dist/chat/typed-interrupts/approval-cards.js +250 -0
- package/dist/chat/typed-interrupts/approval-cards.js.map +1 -0
- package/dist/chat/typed-interrupts/form-cards.cjs +289 -0
- package/dist/chat/typed-interrupts/form-cards.cjs.map +1 -0
- package/dist/chat/typed-interrupts/form-cards.d.ts +6 -0
- package/dist/chat/typed-interrupts/form-cards.js +289 -0
- package/dist/chat/typed-interrupts/form-cards.js.map +1 -0
- package/dist/chat/typed-interrupts/interrupt-card-shell.cjs +182 -0
- package/dist/chat/typed-interrupts/interrupt-card-shell.cjs.map +1 -0
- package/dist/chat/typed-interrupts/interrupt-card-shell.d.ts +47 -0
- package/dist/chat/typed-interrupts/interrupt-card-shell.js +182 -0
- package/dist/chat/typed-interrupts/interrupt-card-shell.js.map +1 -0
- package/dist/chat/typed-interrupts/json-schema-form.cjs +388 -0
- package/dist/chat/typed-interrupts/json-schema-form.cjs.map +1 -0
- package/dist/chat/typed-interrupts/json-schema-form.d.ts +33 -0
- package/dist/chat/typed-interrupts/json-schema-form.js +388 -0
- package/dist/chat/typed-interrupts/json-schema-form.js.map +1 -0
- package/dist/chat/typed-interrupts/questionnaire-card.cjs +449 -0
- package/dist/chat/typed-interrupts/questionnaire-card.cjs.map +1 -0
- package/dist/chat/typed-interrupts/questionnaire-card.d.ts +20 -0
- package/dist/chat/typed-interrupts/questionnaire-card.js +449 -0
- package/dist/chat/typed-interrupts/questionnaire-card.js.map +1 -0
- package/dist/chat/typed-interrupts/request-file-card.cjs +159 -0
- package/dist/chat/typed-interrupts/request-file-card.cjs.map +1 -0
- package/dist/chat/typed-interrupts/request-file-card.d.ts +2 -0
- package/dist/chat/typed-interrupts/request-file-card.js +159 -0
- package/dist/chat/typed-interrupts/request-file-card.js.map +1 -0
- package/dist/chat/typed-interrupts/toolkit-selection-card.cjs +189 -0
- package/dist/chat/typed-interrupts/toolkit-selection-card.cjs.map +1 -0
- package/dist/chat/typed-interrupts/toolkit-selection-card.d.ts +23 -0
- package/dist/chat/typed-interrupts/toolkit-selection-card.js +189 -0
- package/dist/chat/typed-interrupts/toolkit-selection-card.js.map +1 -0
- package/dist/chat/typed-interrupts/typed-interrupt-body.cjs +26 -0
- package/dist/chat/typed-interrupts/typed-interrupt-body.cjs.map +1 -0
- package/dist/chat/typed-interrupts/typed-interrupt-body.d.ts +3 -0
- package/dist/chat/typed-interrupts/typed-interrupt-body.js +26 -0
- package/dist/chat/typed-interrupts/typed-interrupt-body.js.map +1 -0
- package/dist/chat/typed-interrupts/typed-interrupt-graphql.cjs +105 -0
- package/dist/chat/typed-interrupts/typed-interrupt-graphql.cjs.map +1 -0
- package/dist/chat/typed-interrupts/typed-interrupt-graphql.d.ts +29 -0
- package/dist/chat/typed-interrupts/typed-interrupt-graphql.js +105 -0
- package/dist/chat/typed-interrupts/typed-interrupt-graphql.js.map +1 -0
- package/dist/chat/typed-interrupts/typed-interrupt-notice.cjs +70 -0
- package/dist/chat/typed-interrupts/typed-interrupt-notice.cjs.map +1 -0
- package/dist/chat/typed-interrupts/typed-interrupt-notice.d.ts +45 -0
- package/dist/chat/typed-interrupts/typed-interrupt-notice.js +70 -0
- package/dist/chat/typed-interrupts/typed-interrupt-notice.js.map +1 -0
- package/dist/chat/typed-interrupts/typed-interrupt-panel.cjs +76 -0
- package/dist/chat/typed-interrupts/typed-interrupt-panel.cjs.map +1 -0
- package/dist/chat/typed-interrupts/typed-interrupt-panel.d.ts +11 -0
- package/dist/chat/typed-interrupts/typed-interrupt-panel.js +76 -0
- package/dist/chat/typed-interrupts/typed-interrupt-panel.js.map +1 -0
- package/dist/chat/typed-interrupts/typed-interrupt-types.d.ts +46 -0
- package/dist/chat/typed-interrupts/use-interrupt-draft.cjs +106 -0
- package/dist/chat/typed-interrupts/use-interrupt-draft.cjs.map +1 -0
- package/dist/chat/typed-interrupts/use-interrupt-draft.d.ts +29 -0
- package/dist/chat/typed-interrupts/use-interrupt-draft.js +106 -0
- package/dist/chat/typed-interrupts/use-interrupt-draft.js.map +1 -0
- package/dist/chat/typed-interrupts/use-statewire-typed-interrupt.cjs +231 -0
- package/dist/chat/typed-interrupts/use-statewire-typed-interrupt.cjs.map +1 -0
- package/dist/chat/typed-interrupts/use-statewire-typed-interrupt.d.ts +66 -0
- package/dist/chat/typed-interrupts/use-statewire-typed-interrupt.js +231 -0
- package/dist/chat/typed-interrupts/use-statewire-typed-interrupt.js.map +1 -0
- package/dist/chat-ui/composer/composer-named-agents.cjs +13 -0
- package/dist/chat-ui/composer/composer-named-agents.cjs.map +1 -0
- package/dist/chat-ui/composer/composer-named-agents.d.ts +20 -0
- package/dist/chat-ui/composer/composer-named-agents.js +13 -0
- package/dist/chat-ui/composer/composer-named-agents.js.map +1 -0
- package/dist/chat-ui/composer/slash-command-menu.cjs +143 -0
- package/dist/chat-ui/composer/slash-command-menu.cjs.map +1 -0
- package/dist/chat-ui/composer/slash-command-menu.d.ts +19 -0
- package/dist/chat-ui/composer/slash-command-menu.js +143 -0
- package/dist/chat-ui/composer/slash-command-menu.js.map +1 -0
- package/dist/chat-ui/composer/slash-commands-extension.cjs +51 -0
- package/dist/chat-ui/composer/slash-commands-extension.cjs.map +1 -0
- package/dist/chat-ui/composer/slash-commands-extension.d.ts +39 -0
- package/dist/chat-ui/composer/slash-commands-extension.js +51 -0
- package/dist/chat-ui/composer/slash-commands-extension.js.map +1 -0
- package/dist/chat-ui/composer/slash-commands.cjs +74 -0
- package/dist/chat-ui/composer/slash-commands.cjs.map +1 -0
- package/dist/chat-ui/composer/slash-commands.d.ts +82 -0
- package/dist/chat-ui/composer/slash-commands.js +74 -0
- package/dist/chat-ui/composer/slash-commands.js.map +1 -0
- package/dist/chat-ui/composer/tiptap-composer.cjs +135 -9
- package/dist/chat-ui/composer/tiptap-composer.cjs.map +1 -1
- package/dist/chat-ui/composer/tiptap-composer.d.ts +61 -2
- package/dist/chat-ui/composer/tiptap-composer.js +135 -9
- package/dist/chat-ui/composer/tiptap-composer.js.map +1 -1
- package/dist/chat-ui/index.cjs +3 -0
- package/dist/chat-ui/index.cjs.map +1 -1
- package/dist/chat-ui/index.d.ts +3 -2
- package/dist/chat-ui/index.js +3 -0
- package/dist/chat-ui/index.js.map +1 -1
- package/dist/chat-ui/mentions/mention-chip.cjs +1 -1
- package/dist/chat-ui/mentions/mention-chip.cjs.map +1 -1
- package/dist/chat-ui/mentions/mention-chip.js +2 -2
- package/dist/chat-ui/mentions/mention-chip.js.map +1 -1
- package/dist/chat-ui/mentions/mention-extension.cjs +8 -1
- package/dist/chat-ui/mentions/mention-extension.cjs.map +1 -1
- package/dist/chat-ui/mentions/mention-extension.js +8 -1
- package/dist/chat-ui/mentions/mention-extension.js.map +1 -1
- package/dist/chat-ui/mentions/suggestions/components/get-scope-name.cjs +1 -0
- package/dist/chat-ui/mentions/suggestions/components/get-scope-name.cjs.map +1 -1
- package/dist/chat-ui/mentions/suggestions/components/get-scope-name.js +1 -0
- package/dist/chat-ui/mentions/suggestions/components/get-scope-name.js.map +1 -1
- package/dist/chat-ui/mentions/suggestions/components/mention-icon.cjs +2 -0
- package/dist/chat-ui/mentions/suggestions/components/mention-icon.cjs.map +1 -1
- package/dist/chat-ui/mentions/suggestions/components/mention-icon.js +3 -1
- package/dist/chat-ui/mentions/suggestions/components/mention-icon.js.map +1 -1
- package/dist/chat-ui/mentions/suggestions/components/menu-item.cjs +1 -1
- package/dist/chat-ui/mentions/suggestions/components/menu-item.cjs.map +1 -1
- package/dist/chat-ui/mentions/suggestions/components/menu-item.js +1 -1
- package/dist/chat-ui/mentions/suggestions/components/menu-item.js.map +1 -1
- package/dist/chat-ui/mentions/suggestions/data/api-client.cjs +36 -0
- package/dist/chat-ui/mentions/suggestions/data/api-client.cjs.map +1 -1
- package/dist/chat-ui/mentions/suggestions/data/api-client.d.ts +42 -0
- package/dist/chat-ui/mentions/suggestions/data/api-client.js +36 -0
- package/dist/chat-ui/mentions/suggestions/data/api-client.js.map +1 -1
- package/dist/chat-ui/mentions/suggestions/data/sources/index.cjs +235 -19
- package/dist/chat-ui/mentions/suggestions/data/sources/index.cjs.map +1 -1
- package/dist/chat-ui/mentions/suggestions/data/sources/index.d.ts +88 -10
- package/dist/chat-ui/mentions/suggestions/data/sources/index.js +236 -20
- package/dist/chat-ui/mentions/suggestions/data/sources/index.js.map +1 -1
- package/dist/chat-ui/mentions/suggestions/data/types.cjs.map +1 -1
- package/dist/chat-ui/mentions/suggestions/data/types.d.ts +27 -1
- package/dist/chat-ui/mentions/suggestions/data/types.js.map +1 -1
- package/dist/chat-ui/mentions/suggestions/data/use-mention-suggestions.cjs +56 -5
- package/dist/chat-ui/mentions/suggestions/data/use-mention-suggestions.cjs.map +1 -1
- package/dist/chat-ui/mentions/suggestions/data/use-mention-suggestions.d.ts +26 -6
- package/dist/chat-ui/mentions/suggestions/data/use-mention-suggestions.js +57 -6
- package/dist/chat-ui/mentions/suggestions/data/use-mention-suggestions.js.map +1 -1
- package/dist/chat-ui/mentions/suggestions/mention-suggestions.extension.cjs +34 -17
- package/dist/chat-ui/mentions/suggestions/mention-suggestions.extension.cjs.map +1 -1
- package/dist/chat-ui/mentions/suggestions/mention-suggestions.extension.d.ts +19 -1
- package/dist/chat-ui/mentions/suggestions/mention-suggestions.extension.js +35 -18
- package/dist/chat-ui/mentions/suggestions/mention-suggestions.extension.js.map +1 -1
- package/dist/chat-ui/statewire.d.ts +1 -1
- package/dist/chat-ui/thread/statewire-history-edge.cjs +15 -0
- package/dist/chat-ui/thread/statewire-history-edge.cjs.map +1 -1
- package/dist/chat-ui/thread/statewire-history-edge.d.ts +4 -1
- package/dist/chat-ui/thread/statewire-history-edge.js +15 -0
- package/dist/chat-ui/thread/statewire-history-edge.js.map +1 -1
- package/dist/collab/client.cjs +17 -5
- package/dist/collab/client.cjs.map +1 -1
- package/dist/collab/client.d.ts +22 -7
- package/dist/collab/client.js +17 -5
- package/dist/collab/client.js.map +1 -1
- package/dist/composer/ComposerAttachedReferences.cjs +119 -0
- package/dist/composer/ComposerAttachedReferences.cjs.map +1 -0
- package/dist/composer/ComposerAttachedReferences.d.ts +26 -0
- package/dist/composer/ComposerAttachedReferences.js +119 -0
- package/dist/composer/ComposerAttachedReferences.js.map +1 -0
- package/dist/composer/ComposerNamedAgents.cjs +63 -0
- package/dist/composer/ComposerNamedAgents.cjs.map +1 -0
- package/dist/composer/ComposerNamedAgents.d.ts +16 -0
- package/dist/composer/ComposerNamedAgents.js +63 -0
- package/dist/composer/ComposerNamedAgents.js.map +1 -0
- package/dist/composer/attached-references.cjs +159 -0
- package/dist/composer/attached-references.cjs.map +1 -0
- package/dist/composer/attached-references.d.ts +86 -0
- package/dist/composer/attached-references.js +159 -0
- package/dist/composer/attached-references.js.map +1 -0
- package/dist/composer/build-composed-message.cjs +14 -7
- package/dist/composer/build-composed-message.cjs.map +1 -1
- package/dist/composer/build-composed-message.d.ts +6 -1
- package/dist/composer/build-composed-message.js +14 -7
- package/dist/composer/build-composed-message.js.map +1 -1
- package/dist/composer/composer-handoff.cjs +6 -2
- package/dist/composer/composer-handoff.cjs.map +1 -1
- package/dist/composer/composer-handoff.d.ts +7 -1
- package/dist/composer/composer-handoff.js +6 -2
- package/dist/composer/composer-handoff.js.map +1 -1
- package/dist/composer/folder-upload.cjs +149 -0
- package/dist/composer/folder-upload.cjs.map +1 -0
- package/dist/composer/folder-upload.d.ts +79 -0
- package/dist/composer/folder-upload.js +149 -0
- package/dist/composer/folder-upload.js.map +1 -0
- package/dist/composer/index.d.ts +1 -1
- package/dist/composer/useAttachToChat.cjs +35 -0
- package/dist/composer/useAttachToChat.cjs.map +1 -0
- package/dist/composer/useAttachToChat.d.ts +54 -0
- package/dist/composer/useAttachToChat.js +35 -0
- package/dist/composer/useAttachToChat.js.map +1 -0
- package/dist/composer/useAttachedReferencesComposerProps.cjs +19 -0
- package/dist/composer/useAttachedReferencesComposerProps.cjs.map +1 -0
- package/dist/composer/useAttachedReferencesComposerProps.d.ts +12 -0
- package/dist/composer/useAttachedReferencesComposerProps.js +19 -0
- package/dist/composer/useAttachedReferencesComposerProps.js.map +1 -0
- package/dist/composer/useFileUpload.cjs +95 -7
- package/dist/composer/useFileUpload.cjs.map +1 -1
- package/dist/composer/useFileUpload.d.ts +21 -2
- package/dist/composer/useFileUpload.js +95 -7
- package/dist/composer/useFileUpload.js.map +1 -1
- package/dist/data/athena-api-error.cjs +125 -0
- package/dist/data/athena-api-error.cjs.map +1 -0
- package/dist/data/athena-api-error.d.ts +96 -0
- package/dist/data/athena-api-error.js +125 -0
- package/dist/data/athena-api-error.js.map +1 -0
- package/dist/data/athena-data-client.cjs +106 -0
- package/dist/data/athena-data-client.cjs.map +1 -0
- package/dist/data/athena-data-client.d.ts +74 -0
- package/dist/data/athena-data-client.js +106 -0
- package/dist/data/athena-data-client.js.map +1 -0
- package/dist/data/athena-member.cjs +93 -0
- package/dist/data/athena-member.cjs.map +1 -0
- package/dist/data/athena-member.d.ts +125 -0
- package/dist/data/athena-member.js +93 -0
- package/dist/data/athena-member.js.map +1 -0
- package/dist/data/athena-request.cjs +458 -0
- package/dist/data/athena-request.cjs.map +1 -0
- package/dist/data/athena-request.d.ts +120 -0
- package/dist/data/athena-request.js +458 -0
- package/dist/data/athena-request.js.map +1 -0
- package/dist/data/use-athena-fetch.cjs +14 -0
- package/dist/data/use-athena-fetch.cjs.map +1 -0
- package/dist/data/use-athena-fetch.d.ts +19 -0
- package/dist/data/use-athena-fetch.js +14 -0
- package/dist/data/use-athena-fetch.js.map +1 -0
- package/dist/data/use-athena-graphql.cjs +66 -0
- package/dist/data/use-athena-graphql.cjs.map +1 -0
- package/dist/data/use-athena-graphql.d.ts +56 -0
- package/dist/data/use-athena-graphql.js +66 -0
- package/dist/data/use-athena-graphql.js.map +1 -0
- package/dist/data/use-athena-rest.cjs +33 -0
- package/dist/data/use-athena-rest.cjs.map +1 -0
- package/dist/data/use-athena-rest.d.ts +21 -0
- package/dist/data/use-athena-rest.js +33 -0
- package/dist/data/use-athena-rest.js.map +1 -0
- package/dist/data/use-semantic-query.cjs +44 -0
- package/dist/data/use-semantic-query.cjs.map +1 -0
- package/dist/data/use-semantic-query.d.ts +92 -0
- package/dist/data/use-semantic-query.js +44 -0
- package/dist/data/use-semantic-query.js.map +1 -0
- package/dist/diagnostics/athena-diagnostics.cjs.map +1 -1
- package/dist/diagnostics/athena-diagnostics.d.ts +5 -1
- package/dist/diagnostics/athena-diagnostics.js.map +1 -1
- package/dist/diagnostics/errors.cjs +7 -0
- package/dist/diagnostics/errors.cjs.map +1 -1
- package/dist/diagnostics/errors.d.ts +7 -0
- package/dist/diagnostics/errors.js +7 -0
- package/dist/diagnostics/errors.js.map +1 -1
- package/dist/index.cjs +155 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +72 -13
- package/dist/index.js +148 -4
- package/dist/index.js.map +1 -1
- package/dist/keryx-http/src/initial-sync.cjs +64 -16
- package/dist/keryx-http/src/initial-sync.cjs.map +1 -1
- package/dist/keryx-http/src/initial-sync.d.ts +31 -1
- package/dist/keryx-http/src/initial-sync.js +64 -16
- package/dist/keryx-http/src/initial-sync.js.map +1 -1
- package/dist/keryx-http/src/own-awareness.cjs +20 -0
- package/dist/keryx-http/src/own-awareness.cjs.map +1 -0
- package/dist/keryx-http/src/own-awareness.d.ts +50 -0
- package/dist/keryx-http/src/own-awareness.js +20 -0
- package/dist/keryx-http/src/own-awareness.js.map +1 -0
- package/dist/keryx-http/src/update-attributions.cjs +26 -1
- package/dist/keryx-http/src/update-attributions.cjs.map +1 -1
- package/dist/keryx-http/src/update-attributions.d.ts +10 -1
- package/dist/keryx-http/src/update-attributions.js +26 -1
- package/dist/keryx-http/src/update-attributions.js.map +1 -1
- package/dist/offline/chat-outbox.cjs +262 -26
- package/dist/offline/chat-outbox.cjs.map +1 -1
- package/dist/offline/chat-outbox.d.ts +90 -12
- package/dist/offline/chat-outbox.js +263 -27
- package/dist/offline/chat-outbox.js.map +1 -1
- package/dist/provider/AthenaProvider.cjs +63 -19
- package/dist/provider/AthenaProvider.cjs.map +1 -1
- package/dist/provider/AthenaProvider.d.ts +24 -8
- package/dist/provider/AthenaProvider.js +66 -22
- package/dist/provider/AthenaProvider.js.map +1 -1
- package/dist/react/package.json.cjs +1 -1
- package/dist/react/package.json.js +1 -1
- package/dist/references/src/anchors/types.cjs +5 -0
- package/dist/references/src/anchors/types.cjs.map +1 -1
- package/dist/references/src/anchors/types.js +5 -0
- package/dist/references/src/anchors/types.js.map +1 -1
- package/dist/references/src/attachable.cjs +149 -0
- package/dist/references/src/attachable.cjs.map +1 -0
- package/dist/references/src/attachable.d.ts +87 -0
- package/dist/references/src/attachable.js +149 -0
- package/dist/references/src/attachable.js.map +1 -0
- package/dist/runtime/StatewirePlanModeLaneSync.cjs +93 -0
- package/dist/runtime/StatewirePlanModeLaneSync.cjs.map +1 -0
- package/dist/runtime/StatewirePlanModeLaneSync.d.ts +34 -0
- package/dist/runtime/StatewirePlanModeLaneSync.js +93 -0
- package/dist/runtime/StatewirePlanModeLaneSync.js.map +1 -0
- package/dist/runtime/StatewireThreadConfigLaneSync.cjs +2 -0
- package/dist/runtime/StatewireThreadConfigLaneSync.cjs.map +1 -1
- package/dist/runtime/StatewireThreadConfigLaneSync.d.ts +4 -0
- package/dist/runtime/StatewireThreadConfigLaneSync.js +2 -0
- package/dist/runtime/StatewireThreadConfigLaneSync.js.map +1 -1
- package/dist/runtime/statewire-plan-mode.cjs +71 -0
- package/dist/runtime/statewire-plan-mode.cjs.map +1 -0
- package/dist/runtime/statewire-plan-mode.d.ts +88 -0
- package/dist/runtime/statewire-plan-mode.js +71 -0
- package/dist/runtime/statewire-plan-mode.js.map +1 -0
- package/dist/runtime/statewire-run-config.cjs +18 -1
- package/dist/runtime/statewire-run-config.cjs.map +1 -1
- package/dist/runtime/statewire-run-config.d.ts +20 -0
- package/dist/runtime/statewire-run-config.js +18 -1
- package/dist/runtime/statewire-run-config.js.map +1 -1
- package/dist/runtime/statewire-session-key.cjs +11 -5
- package/dist/runtime/statewire-session-key.cjs.map +1 -1
- package/dist/runtime/statewire-session-key.d.ts +22 -10
- package/dist/runtime/statewire-session-key.js +11 -5
- package/dist/runtime/statewire-session-key.js.map +1 -1
- package/dist/runtime/useAthenaStatewireRuntime.cjs +65 -8
- package/dist/runtime/useAthenaStatewireRuntime.cjs.map +1 -1
- package/dist/runtime/useAthenaStatewireRuntime.d.ts +26 -10
- package/dist/runtime/useAthenaStatewireRuntime.js +67 -10
- package/dist/runtime/useAthenaStatewireRuntime.js.map +1 -1
- package/dist/search/useAthenaAssets.cjs +394 -0
- package/dist/search/useAthenaAssets.cjs.map +1 -0
- package/dist/search/useAthenaAssets.d.ts +186 -0
- package/dist/search/useAthenaAssets.js +394 -0
- package/dist/search/useAthenaAssets.js.map +1 -0
- package/dist/sheet-range/index.cjs +4 -0
- package/dist/sheet-range/index.cjs.map +1 -1
- package/dist/sheet-range/index.d.ts +4 -2
- package/dist/sheet-range/index.js +4 -0
- package/dist/sheet-range/index.js.map +1 -1
- package/dist/sheet-range/query-range.cjs +102 -0
- package/dist/sheet-range/query-range.cjs.map +1 -0
- package/dist/sheet-range/query-range.d.ts +46 -0
- package/dist/sheet-range/query-range.js +102 -0
- package/dist/sheet-range/query-range.js.map +1 -0
- package/dist/styles.css +1 -1
- package/dist/subagents/index.cjs +49 -0
- package/dist/subagents/index.cjs.map +1 -0
- package/dist/subagents/index.d.ts +16 -0
- package/dist/subagents/index.js +49 -0
- package/dist/subagents/index.js.map +1 -0
- package/dist/subagents/lane-follow.cjs +19 -0
- package/dist/subagents/lane-follow.cjs.map +1 -0
- package/dist/subagents/lane-follow.d.ts +9 -0
- package/dist/subagents/lane-follow.js +19 -0
- package/dist/subagents/lane-follow.js.map +1 -0
- package/dist/subagents/lane-model.cjs +178 -0
- package/dist/subagents/lane-model.cjs.map +1 -0
- package/dist/subagents/lane-model.d.ts +140 -0
- package/dist/subagents/lane-model.js +178 -0
- package/dist/subagents/lane-model.js.map +1 -0
- package/dist/subagents/lane-parts.cjs +517 -0
- package/dist/subagents/lane-parts.cjs.map +1 -0
- package/dist/subagents/lane-parts.d.ts +130 -0
- package/dist/subagents/lane-parts.js +517 -0
- package/dist/subagents/lane-parts.js.map +1 -0
- package/dist/subagents/subagent-lane-group.cjs +215 -0
- package/dist/subagents/subagent-lane-group.cjs.map +1 -0
- package/dist/subagents/subagent-lane-group.d.ts +67 -0
- package/dist/subagents/subagent-lane-group.js +215 -0
- package/dist/subagents/subagent-lane-group.js.map +1 -0
- package/dist/subagents/subagent-transcript-drawer.cjs +431 -0
- package/dist/subagents/subagent-transcript-drawer.cjs.map +1 -0
- package/dist/subagents/subagent-transcript-drawer.d.ts +78 -0
- package/dist/subagents/subagent-transcript-drawer.js +431 -0
- package/dist/subagents/subagent-transcript-drawer.js.map +1 -0
- package/dist/subagents/task-subagent-group.cjs +115 -0
- package/dist/subagents/task-subagent-group.cjs.map +1 -0
- package/dist/subagents/task-subagent-group.d.ts +36 -0
- package/dist/subagents/task-subagent-group.js +115 -0
- package/dist/subagents/task-subagent-group.js.map +1 -0
- package/dist/subagents/use-omitted-images-in-view.cjs +68 -0
- package/dist/subagents/use-omitted-images-in-view.cjs.map +1 -0
- package/dist/subagents/use-omitted-images-in-view.d.ts +21 -0
- package/dist/subagents/use-omitted-images-in-view.js +68 -0
- package/dist/subagents/use-omitted-images-in-view.js.map +1 -0
- package/dist/threads/Inbox.cjs +2 -2
- package/dist/threads/Inbox.cjs.map +1 -1
- package/dist/threads/SessionList.cjs +27 -24
- package/dist/threads/SessionList.cjs.map +1 -1
- package/dist/threads/SessionList.js +22 -19
- package/dist/threads/SessionList.js.map +1 -1
- package/dist/threads/SessionsPage.cjs +13 -7
- package/dist/threads/SessionsPage.cjs.map +1 -1
- package/dist/threads/SessionsPage.d.ts +10 -1
- package/dist/threads/SessionsPage.js +9 -3
- package/dist/threads/SessionsPage.js.map +1 -1
- package/dist/threads/live-session-rows.cjs +207 -0
- package/dist/threads/live-session-rows.cjs.map +1 -0
- package/dist/threads/live-session-rows.d.ts +175 -0
- package/dist/threads/live-session-rows.js +207 -0
- package/dist/threads/live-session-rows.js.map +1 -0
- package/dist/threads/session-list-model.cjs.map +1 -1
- package/dist/threads/session-list-model.d.ts +2 -1
- package/dist/threads/session-list-model.js.map +1 -1
- package/dist/threads/session-row-parts.cjs +3 -3
- package/dist/threads/session-row-parts.cjs.map +1 -1
- package/dist/threads/sessions-page-model.cjs +13 -5
- package/dist/threads/sessions-page-model.cjs.map +1 -1
- package/dist/threads/sessions-page-model.d.ts +7 -0
- package/dist/threads/sessions-page-model.js +11 -3
- package/dist/threads/sessions-page-model.js.map +1 -1
- package/dist/threads/sessions-page-storage.cjs +8 -8
- package/dist/threads/sessions-page-storage.cjs.map +1 -1
- package/dist/threads/sessions-page-storage.d.ts +5 -1
- package/dist/threads/sessions-page-storage.js +8 -8
- package/dist/threads/sessions-page-storage.js.map +1 -1
- package/dist/threads/statewire-thread-list.cjs +173 -20
- package/dist/threads/statewire-thread-list.cjs.map +1 -1
- package/dist/threads/statewire-thread-list.d.ts +44 -1
- package/dist/threads/statewire-thread-list.js +174 -21
- package/dist/threads/statewire-thread-list.js.map +1 -1
- package/dist/threads/use-athena-sessions.cjs +1 -0
- package/dist/threads/use-athena-sessions.cjs.map +1 -1
- package/dist/threads/use-athena-sessions.d.ts +7 -0
- package/dist/threads/use-athena-sessions.js +1 -0
- package/dist/threads/use-athena-sessions.js.map +1 -1
- package/dist/threads/use-athena-thread-agent.cjs +31 -0
- package/dist/threads/use-athena-thread-agent.cjs.map +1 -0
- package/dist/threads/use-athena-thread-agent.d.ts +38 -0
- package/dist/threads/use-athena-thread-agent.js +31 -0
- package/dist/threads/use-athena-thread-agent.js.map +1 -0
- package/dist/threads/use-athena-thread-plan-mode.cjs +18 -0
- package/dist/threads/use-athena-thread-plan-mode.cjs.map +1 -0
- package/dist/threads/use-athena-thread-plan-mode.d.ts +18 -0
- package/dist/threads/use-athena-thread-plan-mode.js +18 -0
- package/dist/threads/use-athena-thread-plan-mode.js.map +1 -0
- package/dist/threads/use-rest-conversation-history.d.ts +1 -0
- package/dist/tools/agent-creations.cjs +97 -0
- package/dist/tools/agent-creations.cjs.map +1 -0
- package/dist/tools/agent-creations.d.ts +38 -0
- package/dist/tools/agent-creations.js +97 -0
- package/dist/tools/agent-creations.js.map +1 -0
- package/dist/tools/agent-highlights.cjs +100 -0
- package/dist/tools/agent-highlights.cjs.map +1 -0
- package/dist/tools/agent-highlights.d.ts +57 -0
- package/dist/tools/agent-highlights.js +100 -0
- package/dist/tools/agent-highlights.js.map +1 -0
- package/dist/tools/append-document-tool-ui.cjs +1 -0
- package/dist/tools/append-document-tool-ui.cjs.map +1 -1
- package/dist/tools/append-document-tool-ui.d.ts +7 -0
- package/dist/tools/append-document-tool-ui.js +2 -1
- package/dist/tools/append-document-tool-ui.js.map +1 -1
- package/dist/tools/auto-open-tools.cjs +144 -71
- package/dist/tools/auto-open-tools.cjs.map +1 -1
- package/dist/tools/auto-open-tools.d.ts +131 -1
- package/dist/tools/auto-open-tools.js +145 -72
- package/dist/tools/auto-open-tools.js.map +1 -1
- package/dist/tools/browser-tool-uis.cjs +594 -0
- package/dist/tools/browser-tool-uis.cjs.map +1 -0
- package/dist/tools/browser-tool-uis.d.ts +8 -0
- package/dist/tools/browser-tool-uis.js +594 -0
- package/dist/tools/browser-tool-uis.js.map +1 -0
- package/dist/tools/computer-asset-tool-uis.cjs +313 -0
- package/dist/tools/computer-asset-tool-uis.cjs.map +1 -0
- package/dist/tools/computer-asset-tool-uis.d.ts +5 -0
- package/dist/tools/computer-asset-tool-uis.js +313 -0
- package/dist/tools/computer-asset-tool-uis.js.map +1 -0
- package/dist/tools/document-edit-tool-uis.cjs +218 -0
- package/dist/tools/document-edit-tool-uis.cjs.map +1 -0
- package/dist/tools/document-edit-tool-uis.d.ts +40 -0
- package/dist/tools/document-edit-tool-uis.js +218 -0
- package/dist/tools/document-edit-tool-uis.js.map +1 -0
- package/dist/tools/drive-tool-uis.cjs +425 -0
- package/dist/tools/drive-tool-uis.cjs.map +1 -0
- package/dist/tools/drive-tool-uis.d.ts +120 -0
- package/dist/tools/drive-tool-uis.js +425 -0
- package/dist/tools/drive-tool-uis.js.map +1 -0
- package/dist/tools/email-calendar-tool-uis.cjs +789 -0
- package/dist/tools/email-calendar-tool-uis.cjs.map +1 -0
- package/dist/tools/email-calendar-tool-uis.d.ts +129 -0
- package/dist/tools/email-calendar-tool-uis.js +789 -0
- package/dist/tools/email-calendar-tool-uis.js.map +1 -0
- package/dist/tools/ontology-tool-uis.cjs +83 -0
- package/dist/tools/ontology-tool-uis.cjs.map +1 -0
- package/dist/tools/ontology-tool-uis.d.ts +9 -0
- package/dist/tools/ontology-tool-uis.js +83 -0
- package/dist/tools/ontology-tool-uis.js.map +1 -0
- package/dist/tools/orchestration-tool-uis.cjs +586 -0
- package/dist/tools/orchestration-tool-uis.cjs.map +1 -0
- package/dist/tools/orchestration-tool-uis.d.ts +141 -0
- package/dist/tools/orchestration-tool-uis.js +586 -0
- package/dist/tools/orchestration-tool-uis.js.map +1 -0
- package/dist/tools/presentation-edit-tool-uis.cjs +516 -0
- package/dist/tools/presentation-edit-tool-uis.cjs.map +1 -0
- package/dist/tools/presentation-edit-tool-uis.d.ts +73 -0
- package/dist/tools/presentation-edit-tool-uis.js +516 -0
- package/dist/tools/presentation-edit-tool-uis.js.map +1 -0
- package/dist/tools/project-tool-uis.cjs +213 -0
- package/dist/tools/project-tool-uis.cjs.map +1 -0
- package/dist/tools/project-tool-uis.d.ts +14 -0
- package/dist/tools/project-tool-uis.js +213 -0
- package/dist/tools/project-tool-uis.js.map +1 -0
- package/dist/tools/sandbox-tool-uis.cjs +491 -0
- package/dist/tools/sandbox-tool-uis.cjs.map +1 -0
- package/dist/tools/sandbox-tool-uis.d.ts +116 -0
- package/dist/tools/sandbox-tool-uis.js +491 -0
- package/dist/tools/sandbox-tool-uis.js.map +1 -0
- package/dist/tools/sheet-query-tool-ui.cjs +138 -0
- package/dist/tools/sheet-query-tool-ui.cjs.map +1 -0
- package/dist/tools/sheet-query-tool-ui.d.ts +15 -0
- package/dist/tools/sheet-query-tool-ui.js +138 -0
- package/dist/tools/sheet-query-tool-ui.js.map +1 -0
- package/dist/tools/studio-screenshot-tool-uis.cjs +262 -0
- package/dist/tools/studio-screenshot-tool-uis.cjs.map +1 -0
- package/dist/tools/studio-screenshot-tool-uis.d.ts +52 -0
- package/dist/tools/studio-screenshot-tool-uis.js +262 -0
- package/dist/tools/studio-screenshot-tool-uis.js.map +1 -0
- package/dist/tools/subagent-task-tool-ui.cjs +24 -475
- package/dist/tools/subagent-task-tool-ui.cjs.map +1 -1
- package/dist/tools/subagent-task-tool-ui.d.ts +19 -103
- package/dist/tools/subagent-task-tool-ui.js +28 -479
- package/dist/tools/subagent-task-tool-ui.js.map +1 -1
- package/dist/tools/tool-summary.cjs +36 -0
- package/dist/tools/tool-summary.cjs.map +1 -1
- package/dist/tools/tool-summary.js +36 -0
- package/dist/tools/tool-summary.js.map +1 -1
- package/dist/tools/tool-uis.cjs +181 -53
- package/dist/tools/tool-uis.cjs.map +1 -1
- package/dist/tools/tool-uis.d.ts +40 -0
- package/dist/tools/tool-uis.js +183 -55
- package/dist/tools/tool-uis.js.map +1 -1
- package/dist/typed-interrupts/index.cjs +15 -0
- package/dist/typed-interrupts/index.cjs.map +1 -0
- package/dist/typed-interrupts/index.d.ts +20 -0
- package/dist/typed-interrupts/index.js +15 -0
- package/dist/typed-interrupts/index.js.map +1 -0
- package/dist/workbench/session-workbench-panes.cjs +6 -6
- package/dist/workbench/session-workbench-panes.cjs.map +1 -1
- package/package.json +28 -6
- package/dist/agent-runtime/src/chat-outbox-store.cjs +0 -510
- package/dist/agent-runtime/src/chat-outbox-store.cjs.map +0 -1
- package/dist/agent-runtime/src/chat-outbox-store.d.ts +0 -210
- package/dist/agent-runtime/src/chat-outbox-store.js +0 -510
- package/dist/agent-runtime/src/chat-outbox-store.js.map +0 -1
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const require$$0 = require("react");
|
|
4
|
+
const agentModelOptions = require("../catalog/agent-model-options.cjs");
|
|
5
|
+
const statewireServerLaneContext = require("../runtime/statewire-server-lane-context.cjs");
|
|
6
|
+
function threadAgentFromLane({
|
|
7
|
+
lane,
|
|
8
|
+
ready
|
|
9
|
+
}) {
|
|
10
|
+
if (!ready || lane === null) return { agentId: null, configured: false, ready };
|
|
11
|
+
const value = lane.custom.collab_agent_id;
|
|
12
|
+
return {
|
|
13
|
+
agentId: typeof value === "string" ? agentModelOptions.agentAssetIdOf(value) : null,
|
|
14
|
+
configured: true,
|
|
15
|
+
ready
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
function useAthenaThreadAgent() {
|
|
19
|
+
const lane = require$$0.useContext(statewireServerLaneContext.AthenaStatewireServerLaneContext);
|
|
20
|
+
const agent = require$$0.useMemo(
|
|
21
|
+
() => lane === null ? null : threadAgentFromLane({ lane: lane.config, ready: lane.landed }),
|
|
22
|
+
[lane]
|
|
23
|
+
);
|
|
24
|
+
if (agent === null) {
|
|
25
|
+
throw new Error("[AthenaSDK] useAthenaThreadAgent must be used within <AthenaProvider>");
|
|
26
|
+
}
|
|
27
|
+
return agent;
|
|
28
|
+
}
|
|
29
|
+
exports.threadAgentFromLane = threadAgentFromLane;
|
|
30
|
+
exports.useAthenaThreadAgent = useAthenaThreadAgent;
|
|
31
|
+
//# sourceMappingURL=use-athena-thread-agent.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-athena-thread-agent.cjs","sources":["../../src/threads/use-athena-thread-agent.ts"],"sourcesContent":["import type { DeepAgentServerConfig } from '@athenaintel/agent-runtime';\nimport { useContext, useMemo } from 'react';\nimport { agentAssetIdOf } from '../catalog/agent-model-options';\nimport { AthenaStatewireServerLaneContext } from '../runtime/statewire-server-lane-context';\n\n/**\n * The collab agent a thread runs as, read from its server config lane\n * (`state.config.custom.collab_agent_id`), plus whether there is a lane at all.\n */\nexport interface AthenaThreadAgent {\n /**\n * The collab agent's asset id, or `null` when the lane names none: the thread is the person's\n * own Athena assistant's.\n */\n agentId: string | null;\n /** `true` once the thread has a server config lane (version > 0). */\n configured: boolean;\n /**\n * `true` once the statewire host's snapshot of this thread has arrived. Before that `agentId` is\n * `null` and `configured` is `false` whatever the thread holds, so wait for `ready` before\n * treating \"no agent\" as an answer.\n */\n ready: boolean;\n}\n\n/** {@link AthenaThreadAgent} from the lane and the landed flag. Pure. */\nexport function threadAgentFromLane({\n lane,\n ready,\n}: {\n lane: DeepAgentServerConfig | null;\n ready: boolean;\n}): AthenaThreadAgent {\n if (!ready || lane === null) return { agentId: null, configured: false, ready };\n const value = lane.custom.collab_agent_id;\n return {\n agentId: typeof value === 'string' ? agentAssetIdOf(value) : null,\n configured: true,\n ready,\n };\n}\n\n/**\n * The collab agent the active thread runs as, from the thread's config lane as the statewire host\n * sent it.\n *\n * `collab_agent_id` is a key the lane owns: once a thread has run, every turn runs as the agent\n * the lane names, whatever the provider's `agent` prop says (the prop seeds a new thread's lane on\n * its first send and is dropped from later sends). Read this hook to show an open thread's real\n * agent: `{ agentId: null, configured: true }` is a thread of the person's own assistant. Wait for\n * `ready`; a never-started chat stays not ready until its first send attaches it.\n *\n * Must be used within `<AthenaProvider>`.\n */\nexport function useAthenaThreadAgent(): AthenaThreadAgent {\n const lane = useContext(AthenaStatewireServerLaneContext);\n const agent = useMemo(\n () => (lane === null ? null : threadAgentFromLane({ lane: lane.config, ready: lane.landed })),\n [lane],\n );\n if (agent === null) {\n throw new Error('[AthenaSDK] useAthenaThreadAgent must be used within <AthenaProvider>');\n }\n return agent;\n}\n"],"names":["agentAssetIdOf","useContext","AthenaStatewireServerLaneContext","useMemo"],"mappings":";;;;;AA0BO,SAAS,oBAAoB;AAAA,EAClC;AAAA,EACA;AACF,GAGsB;AACpB,MAAI,CAAC,SAAS,SAAS,KAAM,QAAO,EAAE,SAAS,MAAM,YAAY,OAAO,MAAA;AACxE,QAAM,QAAQ,KAAK,OAAO;AAC1B,SAAO;AAAA,IACL,SAAS,OAAO,UAAU,WAAWA,kBAAAA,eAAe,KAAK,IAAI;AAAA,IAC7D,YAAY;AAAA,IACZ;AAAA,EAAA;AAEJ;AAcO,SAAS,uBAA0C;AACxD,QAAM,OAAOC,WAAAA,WAAWC,2DAAgC;AACxD,QAAM,QAAQC,WAAAA;AAAAA,IACZ,MAAO,SAAS,OAAO,OAAO,oBAAoB,EAAE,MAAM,KAAK,QAAQ,OAAO,KAAK,OAAA,CAAQ;AAAA,IAC3F,CAAC,IAAI;AAAA,EAAA;AAEP,MAAI,UAAU,MAAM;AAClB,UAAM,IAAI,MAAM,uEAAuE;AAAA,EACzF;AACA,SAAO;AACT;;;"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { DeepAgentServerConfig } from '../agent-runtime/src/index';
|
|
2
|
+
/**
|
|
3
|
+
* The collab agent a thread runs as, read from its server config lane
|
|
4
|
+
* (`state.config.custom.collab_agent_id`), plus whether there is a lane at all.
|
|
5
|
+
*/
|
|
6
|
+
export interface AthenaThreadAgent {
|
|
7
|
+
/**
|
|
8
|
+
* The collab agent's asset id, or `null` when the lane names none: the thread is the person's
|
|
9
|
+
* own Athena assistant's.
|
|
10
|
+
*/
|
|
11
|
+
agentId: string | null;
|
|
12
|
+
/** `true` once the thread has a server config lane (version > 0). */
|
|
13
|
+
configured: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* `true` once the statewire host's snapshot of this thread has arrived. Before that `agentId` is
|
|
16
|
+
* `null` and `configured` is `false` whatever the thread holds, so wait for `ready` before
|
|
17
|
+
* treating "no agent" as an answer.
|
|
18
|
+
*/
|
|
19
|
+
ready: boolean;
|
|
20
|
+
}
|
|
21
|
+
/** {@link AthenaThreadAgent} from the lane and the landed flag. Pure. */
|
|
22
|
+
export declare function threadAgentFromLane({ lane, ready, }: {
|
|
23
|
+
lane: DeepAgentServerConfig | null;
|
|
24
|
+
ready: boolean;
|
|
25
|
+
}): AthenaThreadAgent;
|
|
26
|
+
/**
|
|
27
|
+
* The collab agent the active thread runs as, from the thread's config lane as the statewire host
|
|
28
|
+
* sent it.
|
|
29
|
+
*
|
|
30
|
+
* `collab_agent_id` is a key the lane owns: once a thread has run, every turn runs as the agent
|
|
31
|
+
* the lane names, whatever the provider's `agent` prop says (the prop seeds a new thread's lane on
|
|
32
|
+
* its first send and is dropped from later sends). Read this hook to show an open thread's real
|
|
33
|
+
* agent: `{ agentId: null, configured: true }` is a thread of the person's own assistant. Wait for
|
|
34
|
+
* `ready`; a never-started chat stays not ready until its first send attaches it.
|
|
35
|
+
*
|
|
36
|
+
* Must be used within `<AthenaProvider>`.
|
|
37
|
+
*/
|
|
38
|
+
export declare function useAthenaThreadAgent(): AthenaThreadAgent;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { useContext, useMemo } from "react";
|
|
2
|
+
import { agentAssetIdOf } from "../catalog/agent-model-options.js";
|
|
3
|
+
import { AthenaStatewireServerLaneContext } from "../runtime/statewire-server-lane-context.js";
|
|
4
|
+
function threadAgentFromLane({
|
|
5
|
+
lane,
|
|
6
|
+
ready
|
|
7
|
+
}) {
|
|
8
|
+
if (!ready || lane === null) return { agentId: null, configured: false, ready };
|
|
9
|
+
const value = lane.custom.collab_agent_id;
|
|
10
|
+
return {
|
|
11
|
+
agentId: typeof value === "string" ? agentAssetIdOf(value) : null,
|
|
12
|
+
configured: true,
|
|
13
|
+
ready
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
function useAthenaThreadAgent() {
|
|
17
|
+
const lane = useContext(AthenaStatewireServerLaneContext);
|
|
18
|
+
const agent = useMemo(
|
|
19
|
+
() => lane === null ? null : threadAgentFromLane({ lane: lane.config, ready: lane.landed }),
|
|
20
|
+
[lane]
|
|
21
|
+
);
|
|
22
|
+
if (agent === null) {
|
|
23
|
+
throw new Error("[AthenaSDK] useAthenaThreadAgent must be used within <AthenaProvider>");
|
|
24
|
+
}
|
|
25
|
+
return agent;
|
|
26
|
+
}
|
|
27
|
+
export {
|
|
28
|
+
threadAgentFromLane,
|
|
29
|
+
useAthenaThreadAgent
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=use-athena-thread-agent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-athena-thread-agent.js","sources":["../../src/threads/use-athena-thread-agent.ts"],"sourcesContent":["import type { DeepAgentServerConfig } from '@athenaintel/agent-runtime';\nimport { useContext, useMemo } from 'react';\nimport { agentAssetIdOf } from '../catalog/agent-model-options';\nimport { AthenaStatewireServerLaneContext } from '../runtime/statewire-server-lane-context';\n\n/**\n * The collab agent a thread runs as, read from its server config lane\n * (`state.config.custom.collab_agent_id`), plus whether there is a lane at all.\n */\nexport interface AthenaThreadAgent {\n /**\n * The collab agent's asset id, or `null` when the lane names none: the thread is the person's\n * own Athena assistant's.\n */\n agentId: string | null;\n /** `true` once the thread has a server config lane (version > 0). */\n configured: boolean;\n /**\n * `true` once the statewire host's snapshot of this thread has arrived. Before that `agentId` is\n * `null` and `configured` is `false` whatever the thread holds, so wait for `ready` before\n * treating \"no agent\" as an answer.\n */\n ready: boolean;\n}\n\n/** {@link AthenaThreadAgent} from the lane and the landed flag. Pure. */\nexport function threadAgentFromLane({\n lane,\n ready,\n}: {\n lane: DeepAgentServerConfig | null;\n ready: boolean;\n}): AthenaThreadAgent {\n if (!ready || lane === null) return { agentId: null, configured: false, ready };\n const value = lane.custom.collab_agent_id;\n return {\n agentId: typeof value === 'string' ? agentAssetIdOf(value) : null,\n configured: true,\n ready,\n };\n}\n\n/**\n * The collab agent the active thread runs as, from the thread's config lane as the statewire host\n * sent it.\n *\n * `collab_agent_id` is a key the lane owns: once a thread has run, every turn runs as the agent\n * the lane names, whatever the provider's `agent` prop says (the prop seeds a new thread's lane on\n * its first send and is dropped from later sends). Read this hook to show an open thread's real\n * agent: `{ agentId: null, configured: true }` is a thread of the person's own assistant. Wait for\n * `ready`; a never-started chat stays not ready until its first send attaches it.\n *\n * Must be used within `<AthenaProvider>`.\n */\nexport function useAthenaThreadAgent(): AthenaThreadAgent {\n const lane = useContext(AthenaStatewireServerLaneContext);\n const agent = useMemo(\n () => (lane === null ? null : threadAgentFromLane({ lane: lane.config, ready: lane.landed })),\n [lane],\n );\n if (agent === null) {\n throw new Error('[AthenaSDK] useAthenaThreadAgent must be used within <AthenaProvider>');\n }\n return agent;\n}\n"],"names":[],"mappings":";;;AA0BO,SAAS,oBAAoB;AAAA,EAClC;AAAA,EACA;AACF,GAGsB;AACpB,MAAI,CAAC,SAAS,SAAS,KAAM,QAAO,EAAE,SAAS,MAAM,YAAY,OAAO,MAAA;AACxE,QAAM,QAAQ,KAAK,OAAO;AAC1B,SAAO;AAAA,IACL,SAAS,OAAO,UAAU,WAAW,eAAe,KAAK,IAAI;AAAA,IAC7D,YAAY;AAAA,IACZ;AAAA,EAAA;AAEJ;AAcO,SAAS,uBAA0C;AACxD,QAAM,OAAO,WAAW,gCAAgC;AACxD,QAAM,QAAQ;AAAA,IACZ,MAAO,SAAS,OAAO,OAAO,oBAAoB,EAAE,MAAM,KAAK,QAAQ,OAAO,KAAK,OAAA,CAAQ;AAAA,IAC3F,CAAC,IAAI;AAAA,EAAA;AAEP,MAAI,UAAU,MAAM;AAClB,UAAM,IAAI,MAAM,uEAAuE;AAAA,EACzF;AACA,SAAO;AACT;"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const require$$0 = require("react");
|
|
4
|
+
const statewirePlanMode = require("../runtime/statewire-plan-mode.cjs");
|
|
5
|
+
const statewireServerLaneContext = require("../runtime/statewire-server-lane-context.cjs");
|
|
6
|
+
function useAthenaThreadPlanMode() {
|
|
7
|
+
const lane = require$$0.useContext(statewireServerLaneContext.AthenaStatewireServerLaneContext);
|
|
8
|
+
const planMode = require$$0.useMemo(
|
|
9
|
+
() => lane === null ? null : statewirePlanMode.threadPlanModeFromLane({ lane: lane.config, ready: lane.landed }),
|
|
10
|
+
[lane]
|
|
11
|
+
);
|
|
12
|
+
if (planMode === null) {
|
|
13
|
+
throw new Error("[AthenaSDK] useAthenaThreadPlanMode must be used within <AthenaProvider>");
|
|
14
|
+
}
|
|
15
|
+
return planMode;
|
|
16
|
+
}
|
|
17
|
+
exports.useAthenaThreadPlanMode = useAthenaThreadPlanMode;
|
|
18
|
+
//# sourceMappingURL=use-athena-thread-plan-mode.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-athena-thread-plan-mode.cjs","sources":["../../src/threads/use-athena-thread-plan-mode.ts"],"sourcesContent":["import { useContext, useMemo } from 'react';\nimport { type AthenaThreadPlanMode, threadPlanModeFromLane } from '../runtime/statewire-plan-mode';\nimport { AthenaStatewireServerLaneContext } from '../runtime/statewire-server-lane-context';\n\nexport type { AthenaThreadPlanMode };\n\n/**\n * Whether the active thread's server config plans: the agent's to-do plan\n * (`write_todos`) is on unless the thread's config lane excludes it, as the\n * statewire host sent the lane.\n *\n * Once a thread has run with server config, its lane (not the provider's\n * `planMode` prop) decides, and another client (Athena on the web, a second\n * app) can change it at any time. Read this hook when a thread opens to show\n * the thread's own plan mode in a switch: `{ planMode: null, configured: false }`\n * is a thread without server config, whose turns run with what the provider\n * sends. Wait for `ready`: until the host's snapshot of the thread has arrived\n * every thread reads as unconfigured.\n *\n * Must be used within `<AthenaProvider>`.\n */\nexport function useAthenaThreadPlanMode(): AthenaThreadPlanMode {\n const lane = useContext(AthenaStatewireServerLaneContext);\n const planMode = useMemo(\n () => (lane === null ? null : threadPlanModeFromLane({ lane: lane.config, ready: lane.landed })),\n [lane],\n );\n if (planMode === null) {\n throw new Error('[AthenaSDK] useAthenaThreadPlanMode must be used within <AthenaProvider>');\n }\n return planMode;\n}\n"],"names":["useContext","AthenaStatewireServerLaneContext","useMemo","threadPlanModeFromLane"],"mappings":";;;;;AAqBO,SAAS,0BAAgD;AAC9D,QAAM,OAAOA,WAAAA,WAAWC,2DAAgC;AACxD,QAAM,WAAWC,WAAAA;AAAAA,IACf,MAAO,SAAS,OAAO,OAAOC,kBAAAA,uBAAuB,EAAE,MAAM,KAAK,QAAQ,OAAO,KAAK,OAAA,CAAQ;AAAA,IAC9F,CAAC,IAAI;AAAA,EAAA;AAEP,MAAI,aAAa,MAAM;AACrB,UAAM,IAAI,MAAM,0EAA0E;AAAA,EAC5F;AACA,SAAO;AACT;;"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type AthenaThreadPlanMode } from '../runtime/statewire-plan-mode';
|
|
2
|
+
export type { AthenaThreadPlanMode };
|
|
3
|
+
/**
|
|
4
|
+
* Whether the active thread's server config plans: the agent's to-do plan
|
|
5
|
+
* (`write_todos`) is on unless the thread's config lane excludes it, as the
|
|
6
|
+
* statewire host sent the lane.
|
|
7
|
+
*
|
|
8
|
+
* Once a thread has run with server config, its lane (not the provider's
|
|
9
|
+
* `planMode` prop) decides, and another client (Athena on the web, a second
|
|
10
|
+
* app) can change it at any time. Read this hook when a thread opens to show
|
|
11
|
+
* the thread's own plan mode in a switch: `{ planMode: null, configured: false }`
|
|
12
|
+
* is a thread without server config, whose turns run with what the provider
|
|
13
|
+
* sends. Wait for `ready`: until the host's snapshot of the thread has arrived
|
|
14
|
+
* every thread reads as unconfigured.
|
|
15
|
+
*
|
|
16
|
+
* Must be used within `<AthenaProvider>`.
|
|
17
|
+
*/
|
|
18
|
+
export declare function useAthenaThreadPlanMode(): AthenaThreadPlanMode;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { useContext, useMemo } from "react";
|
|
2
|
+
import { threadPlanModeFromLane } from "../runtime/statewire-plan-mode.js";
|
|
3
|
+
import { AthenaStatewireServerLaneContext } from "../runtime/statewire-server-lane-context.js";
|
|
4
|
+
function useAthenaThreadPlanMode() {
|
|
5
|
+
const lane = useContext(AthenaStatewireServerLaneContext);
|
|
6
|
+
const planMode = useMemo(
|
|
7
|
+
() => lane === null ? null : threadPlanModeFromLane({ lane: lane.config, ready: lane.landed }),
|
|
8
|
+
[lane]
|
|
9
|
+
);
|
|
10
|
+
if (planMode === null) {
|
|
11
|
+
throw new Error("[AthenaSDK] useAthenaThreadPlanMode must be used within <AthenaProvider>");
|
|
12
|
+
}
|
|
13
|
+
return planMode;
|
|
14
|
+
}
|
|
15
|
+
export {
|
|
16
|
+
useAthenaThreadPlanMode
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=use-athena-thread-plan-mode.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-athena-thread-plan-mode.js","sources":["../../src/threads/use-athena-thread-plan-mode.ts"],"sourcesContent":["import { useContext, useMemo } from 'react';\nimport { type AthenaThreadPlanMode, threadPlanModeFromLane } from '../runtime/statewire-plan-mode';\nimport { AthenaStatewireServerLaneContext } from '../runtime/statewire-server-lane-context';\n\nexport type { AthenaThreadPlanMode };\n\n/**\n * Whether the active thread's server config plans: the agent's to-do plan\n * (`write_todos`) is on unless the thread's config lane excludes it, as the\n * statewire host sent the lane.\n *\n * Once a thread has run with server config, its lane (not the provider's\n * `planMode` prop) decides, and another client (Athena on the web, a second\n * app) can change it at any time. Read this hook when a thread opens to show\n * the thread's own plan mode in a switch: `{ planMode: null, configured: false }`\n * is a thread without server config, whose turns run with what the provider\n * sends. Wait for `ready`: until the host's snapshot of the thread has arrived\n * every thread reads as unconfigured.\n *\n * Must be used within `<AthenaProvider>`.\n */\nexport function useAthenaThreadPlanMode(): AthenaThreadPlanMode {\n const lane = useContext(AthenaStatewireServerLaneContext);\n const planMode = useMemo(\n () => (lane === null ? null : threadPlanModeFromLane({ lane: lane.config, ready: lane.landed })),\n [lane],\n );\n if (planMode === null) {\n throw new Error('[AthenaSDK] useAthenaThreadPlanMode must be used within <AthenaProvider>');\n }\n return planMode;\n}\n"],"names":[],"mappings":";;;AAqBO,SAAS,0BAAgD;AAC9D,QAAM,OAAO,WAAW,gCAAgC;AACxD,QAAM,WAAW;AAAA,IACf,MAAO,SAAS,OAAO,OAAO,uBAAuB,EAAE,MAAM,KAAK,QAAQ,OAAO,KAAK,OAAA,CAAQ;AAAA,IAC9F,CAAC,IAAI;AAAA,EAAA;AAEP,MAAI,aAAa,MAAM;AACrB,UAAM,IAAI,MAAM,0EAA0E;AAAA,EAC5F;AACA,SAAO;AACT;"}
|
|
@@ -25,6 +25,7 @@ export declare function useRestConversationHistory({ backendUrl, principalId, ge
|
|
|
25
25
|
isLoading: boolean;
|
|
26
26
|
isFetching: boolean;
|
|
27
27
|
hasResolvedFirstPage: boolean;
|
|
28
|
+
firstPageUpdatedAt: number;
|
|
28
29
|
hasNextPage: boolean;
|
|
29
30
|
isFetchingNextPage: boolean;
|
|
30
31
|
isFetchNextPageError: boolean;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const reactStatewire = require("@assistant-ui/react-statewire");
|
|
4
|
+
const require$$0 = require("react");
|
|
5
|
+
const autoOpenTools = require("./auto-open-tools.cjs");
|
|
6
|
+
const statewireState = require("../agent-runtime/src/statewire-state.cjs");
|
|
7
|
+
const toolNames = require("../agent-runtime/src/tool-names.cjs");
|
|
8
|
+
const subagents = require("../agent-runtime/src/subagents.cjs");
|
|
9
|
+
const runningToolPlaceholder = require("../agent-runtime/src/running-tool-placeholder.cjs");
|
|
10
|
+
const messageText = require("../agent-runtime/src/message-text.cjs");
|
|
11
|
+
const creationsByMessage = /* @__PURE__ */ new WeakMap();
|
|
12
|
+
function argsByCallId(messages) {
|
|
13
|
+
const args = /* @__PURE__ */ new Map();
|
|
14
|
+
for (const message of messages) {
|
|
15
|
+
if (message.type !== "ai" || !message.tool_calls) continue;
|
|
16
|
+
for (const call of message.tool_calls) if (call.id) args.set(call.id, call.args);
|
|
17
|
+
}
|
|
18
|
+
return args;
|
|
19
|
+
}
|
|
20
|
+
function agentCreationsIn(messages) {
|
|
21
|
+
const args = argsByCallId(messages);
|
|
22
|
+
const made = [];
|
|
23
|
+
for (const message of messages) {
|
|
24
|
+
if (message.type !== "tool" || !message.tool_call_id || !message.name) continue;
|
|
25
|
+
if (message.name === toolNames.TASK_TOOL_NAME) {
|
|
26
|
+
made.push(...agentCreationsIn(subagents.nestedMessagesFromArtifact(message.artifact)));
|
|
27
|
+
continue;
|
|
28
|
+
}
|
|
29
|
+
if (runningToolPlaceholder.isRunningToolPlaceholder(message)) continue;
|
|
30
|
+
let creations = creationsByMessage.get(message);
|
|
31
|
+
if (creations === void 0) {
|
|
32
|
+
creations = autoOpenTools.creationsOfCall({
|
|
33
|
+
toolCallId: message.tool_call_id,
|
|
34
|
+
tool: message.name,
|
|
35
|
+
result: typeof message.content === "string" ? message.content : messageText.getMessageText(message),
|
|
36
|
+
isError: message.status === "error",
|
|
37
|
+
artifact: message.artifact,
|
|
38
|
+
args: args.get(message.tool_call_id)
|
|
39
|
+
});
|
|
40
|
+
creationsByMessage.set(message, creations);
|
|
41
|
+
}
|
|
42
|
+
made.push(...creations);
|
|
43
|
+
}
|
|
44
|
+
return made;
|
|
45
|
+
}
|
|
46
|
+
function latestTurn(messages) {
|
|
47
|
+
var _a;
|
|
48
|
+
for (let index = messages.length - 1; index >= 0; index -= 1) {
|
|
49
|
+
if (((_a = messages[index]) == null ? void 0 : _a.type) === "human") return messages.slice(index + 1);
|
|
50
|
+
}
|
|
51
|
+
return messages;
|
|
52
|
+
}
|
|
53
|
+
function createAgentCreationsReporter() {
|
|
54
|
+
let seen = null;
|
|
55
|
+
return {
|
|
56
|
+
see: ({ thread, messages }) => {
|
|
57
|
+
if (seen === null || seen.thread !== thread) {
|
|
58
|
+
seen = { thread, reported: new Set(agentCreationsIn(messages).map(({ key }) => key)) };
|
|
59
|
+
return [];
|
|
60
|
+
}
|
|
61
|
+
const reported = seen.reported;
|
|
62
|
+
const fresh = agentCreationsIn(latestTurn(messages)).filter(({ key }) => !reported.has(key));
|
|
63
|
+
for (const { key } of fresh) reported.add(key);
|
|
64
|
+
return fresh;
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
const selectState = (state) => state;
|
|
69
|
+
function useAthenaAgentCreations({
|
|
70
|
+
onCreation,
|
|
71
|
+
enabled = true
|
|
72
|
+
}) {
|
|
73
|
+
const state = reactStatewire.useStatewireState(selectState);
|
|
74
|
+
const reporter = require$$0.useRef(null);
|
|
75
|
+
const latest = require$$0.useRef(onCreation);
|
|
76
|
+
require$$0.useEffect(() => {
|
|
77
|
+
latest.current = onCreation;
|
|
78
|
+
}, [onCreation]);
|
|
79
|
+
require$$0.useEffect(() => {
|
|
80
|
+
if (!enabled) {
|
|
81
|
+
reporter.current = null;
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
if (!statewireState.isDeepAgentStateHydrated(state)) return;
|
|
85
|
+
reporter.current ?? (reporter.current = createAgentCreationsReporter());
|
|
86
|
+
const made = reporter.current.see({
|
|
87
|
+
thread: statewireState.readDeepAgentStateThreadId(state),
|
|
88
|
+
messages: statewireState.readDeepAgentStreamValues(state).messages ?? []
|
|
89
|
+
});
|
|
90
|
+
for (const creation of made) latest.current(creation);
|
|
91
|
+
}, [state, enabled]);
|
|
92
|
+
}
|
|
93
|
+
exports.agentCreationsIn = agentCreationsIn;
|
|
94
|
+
exports.createAgentCreationsReporter = createAgentCreationsReporter;
|
|
95
|
+
exports.latestTurn = latestTurn;
|
|
96
|
+
exports.useAthenaAgentCreations = useAthenaAgentCreations;
|
|
97
|
+
//# sourceMappingURL=agent-creations.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-creations.cjs","sources":["../../src/tools/agent-creations.ts"],"sourcesContent":["'use client';\n\nimport type { LangChainMessage } from '@assistant-ui/react-langgraph';\nimport { useStatewireState } from '@assistant-ui/react-statewire';\nimport {\n getMessageText,\n isDeepAgentStateHydrated,\n isRunningToolPlaceholder,\n nestedMessagesFromArtifact,\n readDeepAgentStateThreadId,\n readDeepAgentStreamValues,\n TASK_TOOL_NAME,\n} from '@athenaintel/agent-runtime';\nimport { useEffect, useRef } from 'react';\nimport { type AgentCreation, creationsOfCall } from './auto-open-tools';\n\n/*\n * What the agent makes, as it makes it, read off the conversation's own state: the deep agent's\n * runtime (statewire) runs no tool's `streamCall`, so the SDK's auto-open toolkit\n * (`DEFAULT_AUTO_OPEN_TOOLS`) never hears its calls answer. A host that follows the agent's work\n * (Athena's desktop app opens what it makes in a tab behind the person's) reads it here instead, as\n * Athena on the web's studio follow reads the transcript (`DeepAgentPtcStudioFollowObserver`).\n */\n\nexport type { AgentCreation } from './auto-open-tools';\n\n/** Each finished tool message's creations, kept with the message (a message never changes). */\nconst creationsByMessage = new WeakMap<object, AgentCreation[]>();\n\n/** The arguments of every tool call the AI messages in `messages` asked for, by call id. */\nfunction argsByCallId(messages: readonly LangChainMessage[]): Map<string, unknown> {\n const args = new Map<string, unknown>();\n for (const message of messages) {\n if (message.type !== 'ai' || !message.tool_calls) continue;\n for (const call of message.tool_calls) if (call.id) args.set(call.id, call.args);\n }\n return args;\n}\n\n/**\n * What the finished tool calls in `messages` made or showed the person (`creationsOfCall`), a\n * `task` subagent's own calls included (its transcript rides its card, running or done). A call\n * still running (its card is the backend's running placeholder) has made nothing yet.\n */\nexport function agentCreationsIn(messages: readonly LangChainMessage[]): AgentCreation[] {\n const args = argsByCallId(messages);\n const made: AgentCreation[] = [];\n for (const message of messages) {\n if (message.type !== 'tool' || !message.tool_call_id || !message.name) continue;\n if (message.name === TASK_TOOL_NAME) {\n made.push(...agentCreationsIn(nestedMessagesFromArtifact(message.artifact)));\n continue;\n }\n if (isRunningToolPlaceholder(message)) continue;\n let creations = creationsByMessage.get(message);\n if (creations === undefined) {\n creations = creationsOfCall({\n toolCallId: message.tool_call_id,\n tool: message.name,\n result: typeof message.content === 'string' ? message.content : getMessageText(message),\n isError: message.status === 'error',\n artifact: message.artifact,\n args: args.get(message.tool_call_id),\n });\n creationsByMessage.set(message, creations);\n }\n made.push(...creations);\n }\n return made;\n}\n\n/**\n * The messages of the conversation's latest turn: everything after the person's last message. What\n * the agent makes now is there; older history a page loads in never is.\n */\nexport function latestTurn(messages: readonly LangChainMessage[]): readonly LangChainMessage[] {\n for (let index = messages.length - 1; index >= 0; index -= 1) {\n if (messages[index]?.type === 'human') return messages.slice(index + 1);\n }\n return messages;\n}\n\n/** Tells a host what the agent makes, once each, from the states its conversation goes through. */\nexport interface AgentCreationsReporter {\n /**\n * A state of the conversation: what its latest turn made since the last one, never reported\n * before. Everything a thread's first state holds (its history, a run already under way when it\n * was opened) is history: nothing of it is reported. A state of another thread starts again.\n */\n see(params: { thread: string | null; messages: readonly LangChainMessage[] }): AgentCreation[];\n}\n\nexport function createAgentCreationsReporter(): AgentCreationsReporter {\n let seen: { thread: string | null; reported: Set<string> } | null = null;\n return {\n see: ({ thread, messages }) => {\n if (seen === null || seen.thread !== thread) {\n seen = { thread, reported: new Set(agentCreationsIn(messages).map(({ key }) => key)) };\n return [];\n }\n const reported = seen.reported;\n const fresh = agentCreationsIn(latestTurn(messages)).filter(({ key }) => !reported.has(key));\n for (const { key } of fresh) reported.add(key);\n return fresh;\n },\n };\n}\n\nconst selectState = (state: unknown): unknown => state;\n\n/**\n * Calls `onCreation` once for each asset the agent makes in this conversation (a create tool, a\n * studio script's `Create*`) or opens for the person to see (`open_asset_in_workspace`), as its\n * call finishes: never for history, a call that failed or was refused, or a call that only read or\n * changed an asset. Render it inside `AthenaChat` (a `composer` slot, a `components` override),\n * where the conversation's state is read. Nothing is read while `enabled` is false.\n */\nexport function useAthenaAgentCreations({\n onCreation,\n enabled = true,\n}: {\n onCreation: (creation: AgentCreation) => void;\n enabled?: boolean;\n}): void {\n const state = useStatewireState(selectState);\n const reporter = useRef<AgentCreationsReporter | null>(null);\n const latest = useRef(onCreation);\n useEffect(() => {\n latest.current = onCreation;\n }, [onCreation]);\n useEffect(() => {\n if (!enabled) {\n reporter.current = null;\n return;\n }\n if (!isDeepAgentStateHydrated(state)) return;\n reporter.current ??= createAgentCreationsReporter();\n const made = reporter.current.see({\n thread: readDeepAgentStateThreadId(state),\n messages: readDeepAgentStreamValues(state).messages ?? [],\n });\n for (const creation of made) latest.current(creation);\n }, [state, enabled]);\n}\n"],"names":["TASK_TOOL_NAME","nestedMessagesFromArtifact","isRunningToolPlaceholder","creationsOfCall","getMessageText","useStatewireState","useRef","useEffect","isDeepAgentStateHydrated","readDeepAgentStateThreadId","readDeepAgentStreamValues"],"mappings":";;;;;;;;;;AA2BA,MAAM,yCAAyB,QAAA;AAG/B,SAAS,aAAa,UAA6D;AACjF,QAAM,2BAAW,IAAA;AACjB,aAAW,WAAW,UAAU;AAC9B,QAAI,QAAQ,SAAS,QAAQ,CAAC,QAAQ,WAAY;AAClD,eAAW,QAAQ,QAAQ,WAAY,KAAI,KAAK,GAAI,MAAK,IAAI,KAAK,IAAI,KAAK,IAAI;AAAA,EACjF;AACA,SAAO;AACT;AAOO,SAAS,iBAAiB,UAAwD;AACvF,QAAM,OAAO,aAAa,QAAQ;AAClC,QAAM,OAAwB,CAAA;AAC9B,aAAW,WAAW,UAAU;AAC9B,QAAI,QAAQ,SAAS,UAAU,CAAC,QAAQ,gBAAgB,CAAC,QAAQ,KAAM;AACvE,QAAI,QAAQ,SAASA,0BAAgB;AACnC,WAAK,KAAK,GAAG,iBAAiBC,UAAAA,2BAA2B,QAAQ,QAAQ,CAAC,CAAC;AAC3E;AAAA,IACF;AACA,QAAIC,uBAAAA,yBAAyB,OAAO,EAAG;AACvC,QAAI,YAAY,mBAAmB,IAAI,OAAO;AAC9C,QAAI,cAAc,QAAW;AAC3B,kBAAYC,cAAAA,gBAAgB;AAAA,QAC1B,YAAY,QAAQ;AAAA,QACpB,MAAM,QAAQ;AAAA,QACd,QAAQ,OAAO,QAAQ,YAAY,WAAW,QAAQ,UAAUC,YAAAA,eAAe,OAAO;AAAA,QACtF,SAAS,QAAQ,WAAW;AAAA,QAC5B,UAAU,QAAQ;AAAA,QAClB,MAAM,KAAK,IAAI,QAAQ,YAAY;AAAA,MAAA,CACpC;AACD,yBAAmB,IAAI,SAAS,SAAS;AAAA,IAC3C;AACA,SAAK,KAAK,GAAG,SAAS;AAAA,EACxB;AACA,SAAO;AACT;AAMO,SAAS,WAAW,UAAoE;;AAC7F,WAAS,QAAQ,SAAS,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG;AAC5D,UAAI,cAAS,KAAK,MAAd,mBAAiB,UAAS,QAAS,QAAO,SAAS,MAAM,QAAQ,CAAC;AAAA,EACxE;AACA,SAAO;AACT;AAYO,SAAS,+BAAuD;AACrE,MAAI,OAAgE;AACpE,SAAO;AAAA,IACL,KAAK,CAAC,EAAE,QAAQ,eAAe;AAC7B,UAAI,SAAS,QAAQ,KAAK,WAAW,QAAQ;AAC3C,eAAO,EAAE,QAAQ,UAAU,IAAI,IAAI,iBAAiB,QAAQ,EAAE,IAAI,CAAC,EAAE,IAAA,MAAU,GAAG,CAAC,EAAA;AACnF,eAAO,CAAA;AAAA,MACT;AACA,YAAM,WAAW,KAAK;AACtB,YAAM,QAAQ,iBAAiB,WAAW,QAAQ,CAAC,EAAE,OAAO,CAAC,EAAE,UAAU,CAAC,SAAS,IAAI,GAAG,CAAC;AAC3F,iBAAW,EAAE,IAAA,KAAS,MAAO,UAAS,IAAI,GAAG;AAC7C,aAAO;AAAA,IACT;AAAA,EAAA;AAEJ;AAEA,MAAM,cAAc,CAAC,UAA4B;AAS1C,SAAS,wBAAwB;AAAA,EACtC;AAAA,EACA,UAAU;AACZ,GAGS;AACP,QAAM,QAAQC,eAAAA,kBAAkB,WAAW;AAC3C,QAAM,WAAWC,WAAAA,OAAsC,IAAI;AAC3D,QAAM,SAASA,WAAAA,OAAO,UAAU;AAChCC,aAAAA,UAAU,MAAM;AACd,WAAO,UAAU;AAAA,EACnB,GAAG,CAAC,UAAU,CAAC;AACfA,aAAAA,UAAU,MAAM;AACd,QAAI,CAAC,SAAS;AACZ,eAAS,UAAU;AACnB;AAAA,IACF;AACA,QAAI,CAACC,eAAAA,yBAAyB,KAAK,EAAG;AACtC,aAAS,YAAT,SAAS,UAAY,6BAAA;AACrB,UAAM,OAAO,SAAS,QAAQ,IAAI;AAAA,MAChC,QAAQC,eAAAA,2BAA2B,KAAK;AAAA,MACxC,UAAUC,eAAAA,0BAA0B,KAAK,EAAE,YAAY,CAAA;AAAA,IAAC,CACzD;AACD,eAAW,YAAY,KAAM,QAAO,QAAQ,QAAQ;AAAA,EACtD,GAAG,CAAC,OAAO,OAAO,CAAC;AACrB;;;;;"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { LangChainMessage } from '@assistant-ui/react-langgraph';
|
|
2
|
+
import { type AgentCreation } from './auto-open-tools';
|
|
3
|
+
export type { AgentCreation } from './auto-open-tools';
|
|
4
|
+
/**
|
|
5
|
+
* What the finished tool calls in `messages` made or showed the person (`creationsOfCall`), a
|
|
6
|
+
* `task` subagent's own calls included (its transcript rides its card, running or done). A call
|
|
7
|
+
* still running (its card is the backend's running placeholder) has made nothing yet.
|
|
8
|
+
*/
|
|
9
|
+
export declare function agentCreationsIn(messages: readonly LangChainMessage[]): AgentCreation[];
|
|
10
|
+
/**
|
|
11
|
+
* The messages of the conversation's latest turn: everything after the person's last message. What
|
|
12
|
+
* the agent makes now is there; older history a page loads in never is.
|
|
13
|
+
*/
|
|
14
|
+
export declare function latestTurn(messages: readonly LangChainMessage[]): readonly LangChainMessage[];
|
|
15
|
+
/** Tells a host what the agent makes, once each, from the states its conversation goes through. */
|
|
16
|
+
export interface AgentCreationsReporter {
|
|
17
|
+
/**
|
|
18
|
+
* A state of the conversation: what its latest turn made since the last one, never reported
|
|
19
|
+
* before. Everything a thread's first state holds (its history, a run already under way when it
|
|
20
|
+
* was opened) is history: nothing of it is reported. A state of another thread starts again.
|
|
21
|
+
*/
|
|
22
|
+
see(params: {
|
|
23
|
+
thread: string | null;
|
|
24
|
+
messages: readonly LangChainMessage[];
|
|
25
|
+
}): AgentCreation[];
|
|
26
|
+
}
|
|
27
|
+
export declare function createAgentCreationsReporter(): AgentCreationsReporter;
|
|
28
|
+
/**
|
|
29
|
+
* Calls `onCreation` once for each asset the agent makes in this conversation (a create tool, a
|
|
30
|
+
* studio script's `Create*`) or opens for the person to see (`open_asset_in_workspace`), as its
|
|
31
|
+
* call finishes: never for history, a call that failed or was refused, or a call that only read or
|
|
32
|
+
* changed an asset. Render it inside `AthenaChat` (a `composer` slot, a `components` override),
|
|
33
|
+
* where the conversation's state is read. Nothing is read while `enabled` is false.
|
|
34
|
+
*/
|
|
35
|
+
export declare function useAthenaAgentCreations({ onCreation, enabled, }: {
|
|
36
|
+
onCreation: (creation: AgentCreation) => void;
|
|
37
|
+
enabled?: boolean;
|
|
38
|
+
}): void;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { useStatewireState } from "@assistant-ui/react-statewire";
|
|
2
|
+
import { useRef, useEffect } from "react";
|
|
3
|
+
import { creationsOfCall } from "./auto-open-tools.js";
|
|
4
|
+
import { isDeepAgentStateHydrated, readDeepAgentStreamValues, readDeepAgentStateThreadId } from "../agent-runtime/src/statewire-state.js";
|
|
5
|
+
import { TASK_TOOL_NAME } from "../agent-runtime/src/tool-names.js";
|
|
6
|
+
import { nestedMessagesFromArtifact } from "../agent-runtime/src/subagents.js";
|
|
7
|
+
import { isRunningToolPlaceholder } from "../agent-runtime/src/running-tool-placeholder.js";
|
|
8
|
+
import { getMessageText } from "../agent-runtime/src/message-text.js";
|
|
9
|
+
const creationsByMessage = /* @__PURE__ */ new WeakMap();
|
|
10
|
+
function argsByCallId(messages) {
|
|
11
|
+
const args = /* @__PURE__ */ new Map();
|
|
12
|
+
for (const message of messages) {
|
|
13
|
+
if (message.type !== "ai" || !message.tool_calls) continue;
|
|
14
|
+
for (const call of message.tool_calls) if (call.id) args.set(call.id, call.args);
|
|
15
|
+
}
|
|
16
|
+
return args;
|
|
17
|
+
}
|
|
18
|
+
function agentCreationsIn(messages) {
|
|
19
|
+
const args = argsByCallId(messages);
|
|
20
|
+
const made = [];
|
|
21
|
+
for (const message of messages) {
|
|
22
|
+
if (message.type !== "tool" || !message.tool_call_id || !message.name) continue;
|
|
23
|
+
if (message.name === TASK_TOOL_NAME) {
|
|
24
|
+
made.push(...agentCreationsIn(nestedMessagesFromArtifact(message.artifact)));
|
|
25
|
+
continue;
|
|
26
|
+
}
|
|
27
|
+
if (isRunningToolPlaceholder(message)) continue;
|
|
28
|
+
let creations = creationsByMessage.get(message);
|
|
29
|
+
if (creations === void 0) {
|
|
30
|
+
creations = creationsOfCall({
|
|
31
|
+
toolCallId: message.tool_call_id,
|
|
32
|
+
tool: message.name,
|
|
33
|
+
result: typeof message.content === "string" ? message.content : getMessageText(message),
|
|
34
|
+
isError: message.status === "error",
|
|
35
|
+
artifact: message.artifact,
|
|
36
|
+
args: args.get(message.tool_call_id)
|
|
37
|
+
});
|
|
38
|
+
creationsByMessage.set(message, creations);
|
|
39
|
+
}
|
|
40
|
+
made.push(...creations);
|
|
41
|
+
}
|
|
42
|
+
return made;
|
|
43
|
+
}
|
|
44
|
+
function latestTurn(messages) {
|
|
45
|
+
var _a;
|
|
46
|
+
for (let index = messages.length - 1; index >= 0; index -= 1) {
|
|
47
|
+
if (((_a = messages[index]) == null ? void 0 : _a.type) === "human") return messages.slice(index + 1);
|
|
48
|
+
}
|
|
49
|
+
return messages;
|
|
50
|
+
}
|
|
51
|
+
function createAgentCreationsReporter() {
|
|
52
|
+
let seen = null;
|
|
53
|
+
return {
|
|
54
|
+
see: ({ thread, messages }) => {
|
|
55
|
+
if (seen === null || seen.thread !== thread) {
|
|
56
|
+
seen = { thread, reported: new Set(agentCreationsIn(messages).map(({ key }) => key)) };
|
|
57
|
+
return [];
|
|
58
|
+
}
|
|
59
|
+
const reported = seen.reported;
|
|
60
|
+
const fresh = agentCreationsIn(latestTurn(messages)).filter(({ key }) => !reported.has(key));
|
|
61
|
+
for (const { key } of fresh) reported.add(key);
|
|
62
|
+
return fresh;
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
const selectState = (state) => state;
|
|
67
|
+
function useAthenaAgentCreations({
|
|
68
|
+
onCreation,
|
|
69
|
+
enabled = true
|
|
70
|
+
}) {
|
|
71
|
+
const state = useStatewireState(selectState);
|
|
72
|
+
const reporter = useRef(null);
|
|
73
|
+
const latest = useRef(onCreation);
|
|
74
|
+
useEffect(() => {
|
|
75
|
+
latest.current = onCreation;
|
|
76
|
+
}, [onCreation]);
|
|
77
|
+
useEffect(() => {
|
|
78
|
+
if (!enabled) {
|
|
79
|
+
reporter.current = null;
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
if (!isDeepAgentStateHydrated(state)) return;
|
|
83
|
+
reporter.current ?? (reporter.current = createAgentCreationsReporter());
|
|
84
|
+
const made = reporter.current.see({
|
|
85
|
+
thread: readDeepAgentStateThreadId(state),
|
|
86
|
+
messages: readDeepAgentStreamValues(state).messages ?? []
|
|
87
|
+
});
|
|
88
|
+
for (const creation of made) latest.current(creation);
|
|
89
|
+
}, [state, enabled]);
|
|
90
|
+
}
|
|
91
|
+
export {
|
|
92
|
+
agentCreationsIn,
|
|
93
|
+
createAgentCreationsReporter,
|
|
94
|
+
latestTurn,
|
|
95
|
+
useAthenaAgentCreations
|
|
96
|
+
};
|
|
97
|
+
//# sourceMappingURL=agent-creations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-creations.js","sources":["../../src/tools/agent-creations.ts"],"sourcesContent":["'use client';\n\nimport type { LangChainMessage } from '@assistant-ui/react-langgraph';\nimport { useStatewireState } from '@assistant-ui/react-statewire';\nimport {\n getMessageText,\n isDeepAgentStateHydrated,\n isRunningToolPlaceholder,\n nestedMessagesFromArtifact,\n readDeepAgentStateThreadId,\n readDeepAgentStreamValues,\n TASK_TOOL_NAME,\n} from '@athenaintel/agent-runtime';\nimport { useEffect, useRef } from 'react';\nimport { type AgentCreation, creationsOfCall } from './auto-open-tools';\n\n/*\n * What the agent makes, as it makes it, read off the conversation's own state: the deep agent's\n * runtime (statewire) runs no tool's `streamCall`, so the SDK's auto-open toolkit\n * (`DEFAULT_AUTO_OPEN_TOOLS`) never hears its calls answer. A host that follows the agent's work\n * (Athena's desktop app opens what it makes in a tab behind the person's) reads it here instead, as\n * Athena on the web's studio follow reads the transcript (`DeepAgentPtcStudioFollowObserver`).\n */\n\nexport type { AgentCreation } from './auto-open-tools';\n\n/** Each finished tool message's creations, kept with the message (a message never changes). */\nconst creationsByMessage = new WeakMap<object, AgentCreation[]>();\n\n/** The arguments of every tool call the AI messages in `messages` asked for, by call id. */\nfunction argsByCallId(messages: readonly LangChainMessage[]): Map<string, unknown> {\n const args = new Map<string, unknown>();\n for (const message of messages) {\n if (message.type !== 'ai' || !message.tool_calls) continue;\n for (const call of message.tool_calls) if (call.id) args.set(call.id, call.args);\n }\n return args;\n}\n\n/**\n * What the finished tool calls in `messages` made or showed the person (`creationsOfCall`), a\n * `task` subagent's own calls included (its transcript rides its card, running or done). A call\n * still running (its card is the backend's running placeholder) has made nothing yet.\n */\nexport function agentCreationsIn(messages: readonly LangChainMessage[]): AgentCreation[] {\n const args = argsByCallId(messages);\n const made: AgentCreation[] = [];\n for (const message of messages) {\n if (message.type !== 'tool' || !message.tool_call_id || !message.name) continue;\n if (message.name === TASK_TOOL_NAME) {\n made.push(...agentCreationsIn(nestedMessagesFromArtifact(message.artifact)));\n continue;\n }\n if (isRunningToolPlaceholder(message)) continue;\n let creations = creationsByMessage.get(message);\n if (creations === undefined) {\n creations = creationsOfCall({\n toolCallId: message.tool_call_id,\n tool: message.name,\n result: typeof message.content === 'string' ? message.content : getMessageText(message),\n isError: message.status === 'error',\n artifact: message.artifact,\n args: args.get(message.tool_call_id),\n });\n creationsByMessage.set(message, creations);\n }\n made.push(...creations);\n }\n return made;\n}\n\n/**\n * The messages of the conversation's latest turn: everything after the person's last message. What\n * the agent makes now is there; older history a page loads in never is.\n */\nexport function latestTurn(messages: readonly LangChainMessage[]): readonly LangChainMessage[] {\n for (let index = messages.length - 1; index >= 0; index -= 1) {\n if (messages[index]?.type === 'human') return messages.slice(index + 1);\n }\n return messages;\n}\n\n/** Tells a host what the agent makes, once each, from the states its conversation goes through. */\nexport interface AgentCreationsReporter {\n /**\n * A state of the conversation: what its latest turn made since the last one, never reported\n * before. Everything a thread's first state holds (its history, a run already under way when it\n * was opened) is history: nothing of it is reported. A state of another thread starts again.\n */\n see(params: { thread: string | null; messages: readonly LangChainMessage[] }): AgentCreation[];\n}\n\nexport function createAgentCreationsReporter(): AgentCreationsReporter {\n let seen: { thread: string | null; reported: Set<string> } | null = null;\n return {\n see: ({ thread, messages }) => {\n if (seen === null || seen.thread !== thread) {\n seen = { thread, reported: new Set(agentCreationsIn(messages).map(({ key }) => key)) };\n return [];\n }\n const reported = seen.reported;\n const fresh = agentCreationsIn(latestTurn(messages)).filter(({ key }) => !reported.has(key));\n for (const { key } of fresh) reported.add(key);\n return fresh;\n },\n };\n}\n\nconst selectState = (state: unknown): unknown => state;\n\n/**\n * Calls `onCreation` once for each asset the agent makes in this conversation (a create tool, a\n * studio script's `Create*`) or opens for the person to see (`open_asset_in_workspace`), as its\n * call finishes: never for history, a call that failed or was refused, or a call that only read or\n * changed an asset. Render it inside `AthenaChat` (a `composer` slot, a `components` override),\n * where the conversation's state is read. Nothing is read while `enabled` is false.\n */\nexport function useAthenaAgentCreations({\n onCreation,\n enabled = true,\n}: {\n onCreation: (creation: AgentCreation) => void;\n enabled?: boolean;\n}): void {\n const state = useStatewireState(selectState);\n const reporter = useRef<AgentCreationsReporter | null>(null);\n const latest = useRef(onCreation);\n useEffect(() => {\n latest.current = onCreation;\n }, [onCreation]);\n useEffect(() => {\n if (!enabled) {\n reporter.current = null;\n return;\n }\n if (!isDeepAgentStateHydrated(state)) return;\n reporter.current ??= createAgentCreationsReporter();\n const made = reporter.current.see({\n thread: readDeepAgentStateThreadId(state),\n messages: readDeepAgentStreamValues(state).messages ?? [],\n });\n for (const creation of made) latest.current(creation);\n }, [state, enabled]);\n}\n"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const reactStatewire = require("@assistant-ui/react-statewire");
|
|
4
|
+
const require$$0 = require("react");
|
|
5
|
+
const agentCreations = require("./agent-creations.cjs");
|
|
6
|
+
const assetUtils = require("./asset-utils.cjs");
|
|
7
|
+
const statewireState = require("../agent-runtime/src/statewire-state.cjs");
|
|
8
|
+
const toolNames = require("../agent-runtime/src/tool-names.cjs");
|
|
9
|
+
const subagents = require("../agent-runtime/src/subagents.cjs");
|
|
10
|
+
const runningToolPlaceholder = require("../agent-runtime/src/running-tool-placeholder.cjs");
|
|
11
|
+
const messageText = require("../agent-runtime/src/message-text.cjs");
|
|
12
|
+
const HIGHLIGHT_IN_ASSET_TOOL = "highlight_in_asset";
|
|
13
|
+
const AGENT_HIGHLIGHT_MAX_MS = 3e4;
|
|
14
|
+
const AGENT_HIGHLIGHT_DEFAULT_MS = 5e3;
|
|
15
|
+
const isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
16
|
+
function highlightOfCall({
|
|
17
|
+
toolCallId,
|
|
18
|
+
result,
|
|
19
|
+
isError
|
|
20
|
+
}) {
|
|
21
|
+
if (isError) return null;
|
|
22
|
+
const data = typeof result === "string" ? assetUtils.tryParseJson(result) : result;
|
|
23
|
+
if (!isRecord(data) || data.status !== "success") return null;
|
|
24
|
+
const assetRef = typeof data.assetRef === "string" ? data.assetRef.trim() : "";
|
|
25
|
+
const assetId = assetRef.split("?")[0] ?? "";
|
|
26
|
+
if (!assetId.startsWith("asset_")) return null;
|
|
27
|
+
const content = typeof data.content === "string" && data.content.trim() ? data.content.trim() : null;
|
|
28
|
+
const asked = typeof data.durationMs === "number" && Number.isFinite(data.durationMs) ? data.durationMs : null;
|
|
29
|
+
const durationMs = Math.max(
|
|
30
|
+
0,
|
|
31
|
+
Math.min(asked ?? AGENT_HIGHLIGHT_DEFAULT_MS, AGENT_HIGHLIGHT_MAX_MS)
|
|
32
|
+
);
|
|
33
|
+
return { key: toolCallId, assetId, assetRef, content, durationMs };
|
|
34
|
+
}
|
|
35
|
+
function agentHighlightsIn(messages) {
|
|
36
|
+
const shown = [];
|
|
37
|
+
for (const message of messages) {
|
|
38
|
+
if (message.type !== "tool" || !message.tool_call_id || !message.name) continue;
|
|
39
|
+
if (message.name === toolNames.TASK_TOOL_NAME) {
|
|
40
|
+
shown.push(...agentHighlightsIn(subagents.nestedMessagesFromArtifact(message.artifact)));
|
|
41
|
+
continue;
|
|
42
|
+
}
|
|
43
|
+
if (message.name !== HIGHLIGHT_IN_ASSET_TOOL || runningToolPlaceholder.isRunningToolPlaceholder(message)) continue;
|
|
44
|
+
const highlight = highlightOfCall({
|
|
45
|
+
toolCallId: message.tool_call_id,
|
|
46
|
+
result: typeof message.content === "string" ? message.content : messageText.getMessageText(message),
|
|
47
|
+
isError: message.status === "error"
|
|
48
|
+
});
|
|
49
|
+
if (highlight) shown.push(highlight);
|
|
50
|
+
}
|
|
51
|
+
return shown;
|
|
52
|
+
}
|
|
53
|
+
function createAgentHighlightsReporter() {
|
|
54
|
+
let seen = null;
|
|
55
|
+
return {
|
|
56
|
+
see: ({ thread, messages }) => {
|
|
57
|
+
if (seen === null || seen.thread !== thread) {
|
|
58
|
+
seen = { thread, reported: new Set(agentHighlightsIn(messages).map(({ key }) => key)) };
|
|
59
|
+
return [];
|
|
60
|
+
}
|
|
61
|
+
const reported = seen.reported;
|
|
62
|
+
const fresh = agentHighlightsIn(agentCreations.latestTurn(messages)).filter(({ key }) => !reported.has(key));
|
|
63
|
+
for (const { key } of fresh) reported.add(key);
|
|
64
|
+
return fresh;
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
const selectState = (state) => state;
|
|
69
|
+
function useAthenaAgentHighlights({
|
|
70
|
+
onHighlight,
|
|
71
|
+
enabled = true
|
|
72
|
+
}) {
|
|
73
|
+
const state = reactStatewire.useStatewireState(selectState);
|
|
74
|
+
const reporter = require$$0.useRef(null);
|
|
75
|
+
const latest = require$$0.useRef(onHighlight);
|
|
76
|
+
require$$0.useEffect(() => {
|
|
77
|
+
latest.current = onHighlight;
|
|
78
|
+
}, [onHighlight]);
|
|
79
|
+
require$$0.useEffect(() => {
|
|
80
|
+
if (!enabled) {
|
|
81
|
+
reporter.current = null;
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
if (!statewireState.isDeepAgentStateHydrated(state)) return;
|
|
85
|
+
reporter.current ?? (reporter.current = createAgentHighlightsReporter());
|
|
86
|
+
const shown = reporter.current.see({
|
|
87
|
+
thread: statewireState.readDeepAgentStateThreadId(state),
|
|
88
|
+
messages: statewireState.readDeepAgentStreamValues(state).messages ?? []
|
|
89
|
+
});
|
|
90
|
+
for (const highlight of shown) latest.current(highlight);
|
|
91
|
+
}, [state, enabled]);
|
|
92
|
+
}
|
|
93
|
+
exports.AGENT_HIGHLIGHT_DEFAULT_MS = AGENT_HIGHLIGHT_DEFAULT_MS;
|
|
94
|
+
exports.AGENT_HIGHLIGHT_MAX_MS = AGENT_HIGHLIGHT_MAX_MS;
|
|
95
|
+
exports.HIGHLIGHT_IN_ASSET_TOOL = HIGHLIGHT_IN_ASSET_TOOL;
|
|
96
|
+
exports.agentHighlightsIn = agentHighlightsIn;
|
|
97
|
+
exports.createAgentHighlightsReporter = createAgentHighlightsReporter;
|
|
98
|
+
exports.highlightOfCall = highlightOfCall;
|
|
99
|
+
exports.useAthenaAgentHighlights = useAthenaAgentHighlights;
|
|
100
|
+
//# sourceMappingURL=agent-highlights.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-highlights.cjs","sources":["../../src/tools/agent-highlights.ts"],"sourcesContent":["'use client';\n\nimport type { LangChainMessage } from '@assistant-ui/react-langgraph';\nimport { useStatewireState } from '@assistant-ui/react-statewire';\nimport {\n getMessageText,\n isDeepAgentStateHydrated,\n isRunningToolPlaceholder,\n nestedMessagesFromArtifact,\n readDeepAgentStateThreadId,\n readDeepAgentStreamValues,\n TASK_TOOL_NAME,\n} from '@athenaintel/agent-runtime';\nimport { useEffect, useRef } from 'react';\nimport { latestTurn } from './agent-creations';\nimport { tryParseJson } from './asset-utils';\n\n/*\n * The places the agent shows the person (`highlight_in_asset`: \"flash and scroll the user to a\n * location inside an asset\", with a tooltip), read off the conversation's own state as the agent's\n * creations are (`agent-creations.ts`): the deep agent's runtime runs no tool's `streamCall`, so a\n * host that shows them (Athena's desktop app) reads them here. agora answers a highlight only for an\n * asset the person may view (its read gate); a refusal carries no `assetRef`, and shows nothing.\n */\n\n/** The `highlight_in_asset` tool's name. */\nexport const HIGHLIGHT_IN_ASSET_TOOL = 'highlight_in_asset';\n\n/** The longest a highlight stays, as agora clamps it. */\nexport const AGENT_HIGHLIGHT_MAX_MS = 30_000;\n/** How long a highlight stays when the answer names no duration, as agora's default. */\nexport const AGENT_HIGHLIGHT_DEFAULT_MS = 5_000;\n\n/** A place the agent showed the person in an asset, once its call answered. */\nexport interface AgentHighlight {\n /** The call's id: a highlight is reported once. */\n key: string;\n /** The asset, by its bare id. */\n assetId: string;\n /**\n * Where in it, as the agent named it: the id and the references grammar's anchor query\n * (`asset_x?anchor=pm_node&node_id=…`), or the bare id for the asset itself.\n */\n assetRef: string;\n /** The tooltip to show over the place, if any. */\n content: string | null;\n /** How long the mark and the tooltip stay, clamped to `AGENT_HIGHLIGHT_MAX_MS`. */\n durationMs: number;\n}\n\ntype AnyRecord = Record<string, unknown>;\n\nconst isRecord = (value: unknown): value is AnyRecord =>\n typeof value === 'object' && value !== null && !Array.isArray(value);\n\n/** The highlight one finished `highlight_in_asset` call showed, or null for a refusal or a failure. */\nexport function highlightOfCall({\n toolCallId,\n result,\n isError,\n}: {\n toolCallId: string;\n result: unknown;\n isError?: boolean;\n}): AgentHighlight | null {\n if (isError) return null;\n const data = typeof result === 'string' ? tryParseJson(result) : result;\n if (!isRecord(data) || data.status !== 'success') return null;\n const assetRef = typeof data.assetRef === 'string' ? data.assetRef.trim() : '';\n const assetId = assetRef.split('?')[0] ?? '';\n if (!assetId.startsWith('asset_')) return null;\n const content =\n typeof data.content === 'string' && data.content.trim() ? data.content.trim() : null;\n const asked =\n typeof data.durationMs === 'number' && Number.isFinite(data.durationMs) ? data.durationMs : null;\n const durationMs = Math.max(\n 0,\n Math.min(asked ?? AGENT_HIGHLIGHT_DEFAULT_MS, AGENT_HIGHLIGHT_MAX_MS),\n );\n return { key: toolCallId, assetId, assetRef, content, durationMs };\n}\n\n/**\n * What the finished `highlight_in_asset` calls in `messages` showed the person, a `task` subagent's\n * own calls included. A call still running has shown nothing yet.\n */\nexport function agentHighlightsIn(messages: readonly LangChainMessage[]): AgentHighlight[] {\n const shown: AgentHighlight[] = [];\n for (const message of messages) {\n if (message.type !== 'tool' || !message.tool_call_id || !message.name) continue;\n if (message.name === TASK_TOOL_NAME) {\n shown.push(...agentHighlightsIn(nestedMessagesFromArtifact(message.artifact)));\n continue;\n }\n if (message.name !== HIGHLIGHT_IN_ASSET_TOOL || isRunningToolPlaceholder(message)) continue;\n const highlight = highlightOfCall({\n toolCallId: message.tool_call_id,\n result: typeof message.content === 'string' ? message.content : getMessageText(message),\n isError: message.status === 'error',\n });\n if (highlight) shown.push(highlight);\n }\n return shown;\n}\n\n/** Tells a host the places the agent shows, once each, from the states its conversation goes through. */\nexport interface AgentHighlightsReporter {\n /**\n * A state of the conversation: the highlights its latest turn showed since the last one. A\n * thread's first state is history (nothing of it is shown again); a state of another thread\n * starts again.\n */\n see(params: { thread: string | null; messages: readonly LangChainMessage[] }): AgentHighlight[];\n}\n\nexport function createAgentHighlightsReporter(): AgentHighlightsReporter {\n let seen: { thread: string | null; reported: Set<string> } | null = null;\n return {\n see: ({ thread, messages }) => {\n if (seen === null || seen.thread !== thread) {\n seen = { thread, reported: new Set(agentHighlightsIn(messages).map(({ key }) => key)) };\n return [];\n }\n const reported = seen.reported;\n const fresh = agentHighlightsIn(latestTurn(messages)).filter(({ key }) => !reported.has(key));\n for (const { key } of fresh) reported.add(key);\n return fresh;\n },\n };\n}\n\nconst selectState = (state: unknown): unknown => state;\n\n/**\n * Calls `onHighlight` once for each place the agent shows the person in this conversation\n * (`highlight_in_asset`), as its call answers: never for history, or a call that failed or was\n * refused. Render it inside `AthenaChat`, where the conversation's state is read. Nothing is read\n * while `enabled` is false.\n */\nexport function useAthenaAgentHighlights({\n onHighlight,\n enabled = true,\n}: {\n onHighlight: (highlight: AgentHighlight) => void;\n enabled?: boolean;\n}): void {\n const state = useStatewireState(selectState);\n const reporter = useRef<AgentHighlightsReporter | null>(null);\n const latest = useRef(onHighlight);\n useEffect(() => {\n latest.current = onHighlight;\n }, [onHighlight]);\n useEffect(() => {\n if (!enabled) {\n reporter.current = null;\n return;\n }\n if (!isDeepAgentStateHydrated(state)) return;\n reporter.current ??= createAgentHighlightsReporter();\n const shown = reporter.current.see({\n thread: readDeepAgentStateThreadId(state),\n messages: readDeepAgentStreamValues(state).messages ?? [],\n });\n for (const highlight of shown) latest.current(highlight);\n }, [state, enabled]);\n}\n"],"names":["tryParseJson","TASK_TOOL_NAME","nestedMessagesFromArtifact","isRunningToolPlaceholder","getMessageText","latestTurn","useStatewireState","useRef","useEffect","isDeepAgentStateHydrated","readDeepAgentStateThreadId","readDeepAgentStreamValues"],"mappings":";;;;;;;;;;;AA0BO,MAAM,0BAA0B;AAGhC,MAAM,yBAAyB;AAE/B,MAAM,6BAA6B;AAqB1C,MAAM,WAAW,CAAC,UAChB,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,KAAK;AAG9D,SAAS,gBAAgB;AAAA,EAC9B;AAAA,EACA;AAAA,EACA;AACF,GAI0B;AACxB,MAAI,QAAS,QAAO;AACpB,QAAM,OAAO,OAAO,WAAW,WAAWA,WAAAA,aAAa,MAAM,IAAI;AACjE,MAAI,CAAC,SAAS,IAAI,KAAK,KAAK,WAAW,UAAW,QAAO;AACzD,QAAM,WAAW,OAAO,KAAK,aAAa,WAAW,KAAK,SAAS,SAAS;AAC5E,QAAM,UAAU,SAAS,MAAM,GAAG,EAAE,CAAC,KAAK;AAC1C,MAAI,CAAC,QAAQ,WAAW,QAAQ,EAAG,QAAO;AAC1C,QAAM,UACJ,OAAO,KAAK,YAAY,YAAY,KAAK,QAAQ,KAAA,IAAS,KAAK,QAAQ,KAAA,IAAS;AAClF,QAAM,QACJ,OAAO,KAAK,eAAe,YAAY,OAAO,SAAS,KAAK,UAAU,IAAI,KAAK,aAAa;AAC9F,QAAM,aAAa,KAAK;AAAA,IACtB;AAAA,IACA,KAAK,IAAI,SAAS,4BAA4B,sBAAsB;AAAA,EAAA;AAEtE,SAAO,EAAE,KAAK,YAAY,SAAS,UAAU,SAAS,WAAA;AACxD;AAMO,SAAS,kBAAkB,UAAyD;AACzF,QAAM,QAA0B,CAAA;AAChC,aAAW,WAAW,UAAU;AAC9B,QAAI,QAAQ,SAAS,UAAU,CAAC,QAAQ,gBAAgB,CAAC,QAAQ,KAAM;AACvE,QAAI,QAAQ,SAASC,0BAAgB;AACnC,YAAM,KAAK,GAAG,kBAAkBC,UAAAA,2BAA2B,QAAQ,QAAQ,CAAC,CAAC;AAC7E;AAAA,IACF;AACA,QAAI,QAAQ,SAAS,2BAA2BC,uBAAAA,yBAAyB,OAAO,EAAG;AACnF,UAAM,YAAY,gBAAgB;AAAA,MAChC,YAAY,QAAQ;AAAA,MACpB,QAAQ,OAAO,QAAQ,YAAY,WAAW,QAAQ,UAAUC,YAAAA,eAAe,OAAO;AAAA,MACtF,SAAS,QAAQ,WAAW;AAAA,IAAA,CAC7B;AACD,QAAI,UAAW,OAAM,KAAK,SAAS;AAAA,EACrC;AACA,SAAO;AACT;AAYO,SAAS,gCAAyD;AACvE,MAAI,OAAgE;AACpE,SAAO;AAAA,IACL,KAAK,CAAC,EAAE,QAAQ,eAAe;AAC7B,UAAI,SAAS,QAAQ,KAAK,WAAW,QAAQ;AAC3C,eAAO,EAAE,QAAQ,UAAU,IAAI,IAAI,kBAAkB,QAAQ,EAAE,IAAI,CAAC,EAAE,IAAA,MAAU,GAAG,CAAC,EAAA;AACpF,eAAO,CAAA;AAAA,MACT;AACA,YAAM,WAAW,KAAK;AACtB,YAAM,QAAQ,kBAAkBC,0BAAW,QAAQ,CAAC,EAAE,OAAO,CAAC,EAAE,UAAU,CAAC,SAAS,IAAI,GAAG,CAAC;AAC5F,iBAAW,EAAE,IAAA,KAAS,MAAO,UAAS,IAAI,GAAG;AAC7C,aAAO;AAAA,IACT;AAAA,EAAA;AAEJ;AAEA,MAAM,cAAc,CAAC,UAA4B;AAQ1C,SAAS,yBAAyB;AAAA,EACvC;AAAA,EACA,UAAU;AACZ,GAGS;AACP,QAAM,QAAQC,eAAAA,kBAAkB,WAAW;AAC3C,QAAM,WAAWC,WAAAA,OAAuC,IAAI;AAC5D,QAAM,SAASA,WAAAA,OAAO,WAAW;AACjCC,aAAAA,UAAU,MAAM;AACd,WAAO,UAAU;AAAA,EACnB,GAAG,CAAC,WAAW,CAAC;AAChBA,aAAAA,UAAU,MAAM;AACd,QAAI,CAAC,SAAS;AACZ,eAAS,UAAU;AACnB;AAAA,IACF;AACA,QAAI,CAACC,eAAAA,yBAAyB,KAAK,EAAG;AACtC,aAAS,YAAT,SAAS,UAAY,8BAAA;AACrB,UAAM,QAAQ,SAAS,QAAQ,IAAI;AAAA,MACjC,QAAQC,eAAAA,2BAA2B,KAAK;AAAA,MACxC,UAAUC,eAAAA,0BAA0B,KAAK,EAAE,YAAY,CAAA;AAAA,IAAC,CACzD;AACD,eAAW,aAAa,MAAO,QAAO,QAAQ,SAAS;AAAA,EACzD,GAAG,CAAC,OAAO,OAAO,CAAC;AACrB;;;;;;;;"}
|