@athenaintel/react 0.57.2 → 0.60.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +795 -12
- package/dist/agent-runtime/src/addressed-agents.cjs +16 -0
- package/dist/agent-runtime/src/addressed-agents.cjs.map +1 -0
- package/dist/agent-runtime/src/addressed-agents.d.ts +30 -0
- package/dist/agent-runtime/src/addressed-agents.js +16 -0
- package/dist/agent-runtime/src/addressed-agents.js.map +1 -0
- package/dist/agent-runtime/src/answer-label.cjs +4 -3
- package/dist/agent-runtime/src/answer-label.cjs.map +1 -1
- package/dist/agent-runtime/src/answer-label.d.ts +13 -6
- package/dist/agent-runtime/src/answer-label.js +4 -3
- package/dist/agent-runtime/src/answer-label.js.map +1 -1
- package/dist/agent-runtime/src/chat-outbox-attachments.cjs.map +1 -1
- package/dist/agent-runtime/src/chat-outbox-attachments.d.ts +1 -1
- package/dist/agent-runtime/src/chat-outbox-attachments.js.map +1 -1
- package/dist/agent-runtime/src/chat-outbox-entry.cjs +101 -0
- package/dist/agent-runtime/src/chat-outbox-entry.cjs.map +1 -0
- package/dist/agent-runtime/src/chat-outbox-entry.d.ts +99 -0
- package/dist/agent-runtime/src/chat-outbox-entry.js +101 -0
- package/dist/agent-runtime/src/chat-outbox-entry.js.map +1 -0
- package/dist/agent-runtime/src/chat-outbox-legacy.cjs +252 -0
- package/dist/agent-runtime/src/chat-outbox-legacy.cjs.map +1 -0
- package/dist/agent-runtime/src/chat-outbox-legacy.d.ts +96 -0
- package/dist/agent-runtime/src/chat-outbox-legacy.js +252 -0
- package/dist/agent-runtime/src/chat-outbox-legacy.js.map +1 -0
- package/dist/agent-runtime/src/chat-outbox-policy.cjs +30 -0
- package/dist/agent-runtime/src/chat-outbox-policy.cjs.map +1 -0
- package/dist/agent-runtime/src/chat-outbox-policy.d.ts +42 -0
- package/dist/agent-runtime/src/chat-outbox-policy.js +30 -0
- package/dist/agent-runtime/src/chat-outbox-policy.js.map +1 -0
- package/dist/agent-runtime/src/chat-outbox-storage.cjs +306 -0
- package/dist/agent-runtime/src/chat-outbox-storage.cjs.map +1 -0
- package/dist/agent-runtime/src/chat-outbox-storage.d.ts +194 -0
- package/dist/agent-runtime/src/chat-outbox-storage.js +306 -0
- package/dist/agent-runtime/src/chat-outbox-storage.js.map +1 -0
- package/dist/agent-runtime/src/chat-outbox-thread.cjs +21 -94
- package/dist/agent-runtime/src/chat-outbox-thread.cjs.map +1 -1
- package/dist/agent-runtime/src/chat-outbox-thread.d.ts +22 -18
- package/dist/agent-runtime/src/chat-outbox-thread.js +21 -94
- package/dist/agent-runtime/src/chat-outbox-thread.js.map +1 -1
- package/dist/agent-runtime/src/chat-outbox.cjs +492 -547
- package/dist/agent-runtime/src/chat-outbox.cjs.map +1 -1
- package/dist/agent-runtime/src/chat-outbox.d.ts +110 -142
- package/dist/agent-runtime/src/chat-outbox.js +492 -547
- package/dist/agent-runtime/src/chat-outbox.js.map +1 -1
- package/dist/agent-runtime/src/composer-markdown.cjs +0 -16
- package/dist/agent-runtime/src/composer-markdown.cjs.map +1 -1
- package/dist/agent-runtime/src/composer-markdown.d.ts +1 -1
- package/dist/agent-runtime/src/composer-markdown.js +1 -17
- package/dist/agent-runtime/src/composer-markdown.js.map +1 -1
- package/dist/agent-runtime/src/deep-agent-transport-recipe.cjs +3 -1
- package/dist/agent-runtime/src/deep-agent-transport-recipe.cjs.map +1 -1
- package/dist/agent-runtime/src/deep-agent-transport-recipe.d.ts +8 -1
- package/dist/agent-runtime/src/deep-agent-transport-recipe.js +3 -1
- package/dist/agent-runtime/src/deep-agent-transport-recipe.js.map +1 -1
- package/dist/agent-runtime/src/dictation-preferences.d.ts +356 -0
- package/dist/agent-runtime/src/dictation-record.d.ts +279 -0
- package/dist/agent-runtime/src/dictation-session.d.ts +106 -7
- package/dist/agent-runtime/src/dictation-snippets.d.ts +9 -0
- package/dist/agent-runtime/src/dictation-transfer.d.ts +142 -0
- package/dist/agent-runtime/src/edit-command.cjs.map +1 -1
- package/dist/agent-runtime/src/edit-command.d.ts +1 -1
- package/dist/agent-runtime/src/edit-command.js.map +1 -1
- package/dist/agent-runtime/src/errors.cjs +1 -0
- package/dist/agent-runtime/src/errors.cjs.map +1 -1
- package/dist/agent-runtime/src/errors.js +1 -0
- package/dist/agent-runtime/src/errors.js.map +1 -1
- package/dist/agent-runtime/src/generated/runconfig-contract.cjs +24 -0
- package/dist/agent-runtime/src/generated/runconfig-contract.cjs.map +1 -1
- package/dist/agent-runtime/src/generated/runconfig-contract.d.ts +3 -3
- package/dist/agent-runtime/src/generated/runconfig-contract.js +24 -0
- package/dist/agent-runtime/src/generated/runconfig-contract.js.map +1 -1
- package/dist/agent-runtime/src/index.d.ts +14 -8
- package/dist/agent-runtime/src/lane-follow.cjs +289 -0
- package/dist/agent-runtime/src/lane-follow.cjs.map +1 -0
- package/dist/agent-runtime/src/lane-follow.js +289 -0
- package/dist/agent-runtime/src/lane-follow.js.map +1 -0
- package/dist/agent-runtime/src/lane-images.cjs +387 -0
- package/dist/agent-runtime/src/lane-images.cjs.map +1 -0
- package/dist/agent-runtime/src/lane-images.js +387 -0
- package/dist/agent-runtime/src/lane-images.js.map +1 -0
- package/dist/agent-runtime/src/message-window.js +1 -1
- package/dist/agent-runtime/src/messages.cjs +19 -1
- package/dist/agent-runtime/src/messages.cjs.map +1 -1
- package/dist/agent-runtime/src/messages.d.ts +8 -0
- package/dist/agent-runtime/src/messages.js +21 -3
- package/dist/agent-runtime/src/messages.js.map +1 -1
- package/dist/agent-runtime/src/named-agents.cjs +301 -0
- package/dist/agent-runtime/src/named-agents.cjs.map +1 -0
- package/dist/agent-runtime/src/named-agents.d.ts +246 -0
- package/dist/agent-runtime/src/named-agents.js +301 -0
- package/dist/agent-runtime/src/named-agents.js.map +1 -0
- package/dist/agent-runtime/src/offline-status.cjs.map +1 -1
- package/dist/agent-runtime/src/offline-status.d.ts +93 -2
- package/dist/agent-runtime/src/offline-status.js.map +1 -1
- package/dist/agent-runtime/src/ptc-subcalls.cjs +41 -0
- package/dist/agent-runtime/src/ptc-subcalls.cjs.map +1 -0
- package/dist/agent-runtime/src/ptc-subcalls.js +41 -0
- package/dist/agent-runtime/src/ptc-subcalls.js.map +1 -0
- package/dist/agent-runtime/src/queue.cjs +2 -2
- package/dist/agent-runtime/src/queue.cjs.map +1 -1
- package/dist/agent-runtime/src/queue.d.ts +20 -25
- package/dist/agent-runtime/src/queue.js +2 -2
- package/dist/agent-runtime/src/queue.js.map +1 -1
- package/dist/agent-runtime/src/quota-safe-local-storage-session.cjs +314 -84
- package/dist/agent-runtime/src/quota-safe-local-storage-session.cjs.map +1 -1
- package/dist/agent-runtime/src/quota-safe-local-storage-session.d.ts +137 -40
- package/dist/agent-runtime/src/quota-safe-local-storage-session.js +318 -88
- package/dist/agent-runtime/src/quota-safe-local-storage-session.js.map +1 -1
- package/dist/agent-runtime/src/run-send.cjs +54 -0
- package/dist/agent-runtime/src/run-send.cjs.map +1 -0
- package/dist/agent-runtime/src/run-send.d.ts +51 -0
- package/dist/agent-runtime/src/run-send.js +54 -0
- package/dist/agent-runtime/src/run-send.js.map +1 -0
- package/dist/agent-runtime/src/running-tool-placeholder.cjs +6 -0
- package/dist/agent-runtime/src/running-tool-placeholder.cjs.map +1 -1
- package/dist/agent-runtime/src/running-tool-placeholder.js +6 -0
- package/dist/agent-runtime/src/running-tool-placeholder.js.map +1 -1
- package/dist/agent-runtime/src/runtime.d.ts +9 -5
- package/dist/agent-runtime/src/sealed-idb.cjs +64 -0
- package/dist/agent-runtime/src/sealed-idb.cjs.map +1 -1
- package/dist/agent-runtime/src/sealed-idb.d.ts +16 -0
- package/dist/agent-runtime/src/sealed-idb.js +64 -0
- package/dist/agent-runtime/src/sealed-idb.js.map +1 -1
- package/dist/agent-runtime/src/send-recovery.cjs +90 -118
- package/dist/agent-runtime/src/send-recovery.cjs.map +1 -1
- package/dist/agent-runtime/src/send-recovery.d.ts +25 -29
- package/dist/agent-runtime/src/send-recovery.js +90 -118
- package/dist/agent-runtime/src/send-recovery.js.map +1 -1
- package/dist/agent-runtime/src/statewire-diagnostics.d.ts +4 -1
- package/dist/agent-runtime/src/statewire-held-sends.cjs +191 -0
- package/dist/agent-runtime/src/statewire-held-sends.cjs.map +1 -0
- package/dist/agent-runtime/src/statewire-held-sends.d.ts +119 -0
- package/dist/agent-runtime/src/statewire-held-sends.js +191 -0
- package/dist/agent-runtime/src/statewire-held-sends.js.map +1 -0
- package/dist/agent-runtime/src/statewire-state.cjs +4 -0
- package/dist/agent-runtime/src/statewire-state.cjs.map +1 -1
- package/dist/agent-runtime/src/statewire-state.js +4 -0
- package/dist/agent-runtime/src/statewire-state.js.map +1 -1
- package/dist/agent-runtime/src/statewire-transport.cjs +8 -2
- package/dist/agent-runtime/src/statewire-transport.cjs.map +1 -1
- package/dist/agent-runtime/src/statewire-transport.d.ts +14 -5
- package/dist/agent-runtime/src/statewire-transport.js +8 -2
- package/dist/agent-runtime/src/statewire-transport.js.map +1 -1
- package/dist/agent-runtime/src/subagent-transcripts.cjs +1 -23
- package/dist/agent-runtime/src/subagent-transcripts.cjs.map +1 -1
- package/dist/agent-runtime/src/subagent-transcripts.js +3 -25
- package/dist/agent-runtime/src/subagent-transcripts.js.map +1 -1
- package/dist/agent-runtime/src/subagents.cjs +22 -29
- package/dist/agent-runtime/src/subagents.cjs.map +1 -1
- package/dist/agent-runtime/src/subagents.js +23 -30
- package/dist/agent-runtime/src/subagents.js.map +1 -1
- package/dist/agent-runtime/src/thread-extras.cjs +27 -19
- package/dist/agent-runtime/src/thread-extras.cjs.map +1 -1
- package/dist/agent-runtime/src/thread-extras.d.ts +19 -6
- package/dist/agent-runtime/src/thread-extras.js +27 -19
- package/dist/agent-runtime/src/thread-extras.js.map +1 -1
- package/dist/agent-runtime/src/thread-handoff-flow-machine.d.ts +8 -8
- package/dist/agent-runtime/src/tool-metadata.cjs +19 -0
- package/dist/agent-runtime/src/tool-metadata.cjs.map +1 -1
- package/dist/agent-runtime/src/tool-metadata.js +19 -0
- package/dist/agent-runtime/src/tool-metadata.js.map +1 -1
- package/dist/agent-runtime/src/tool-names.cjs +21 -0
- package/dist/agent-runtime/src/tool-names.cjs.map +1 -1
- package/dist/agent-runtime/src/tool-names.d.ts +8 -0
- package/dist/agent-runtime/src/tool-names.js +21 -0
- package/dist/agent-runtime/src/tool-names.js.map +1 -1
- package/dist/agent-runtime/src/typed-interrupt-kinds.cjs +247 -0
- package/dist/agent-runtime/src/typed-interrupt-kinds.cjs.map +1 -0
- package/dist/agent-runtime/src/typed-interrupt-kinds.d.ts +173 -0
- package/dist/agent-runtime/src/typed-interrupt-kinds.js +247 -0
- package/dist/agent-runtime/src/typed-interrupt-kinds.js.map +1 -0
- package/dist/agent-runtime/src/typed-interrupts.cjs +48 -0
- package/dist/agent-runtime/src/typed-interrupts.cjs.map +1 -0
- package/dist/agent-runtime/src/typed-interrupts.d.ts +75 -0
- package/dist/agent-runtime/src/typed-interrupts.js +48 -0
- package/dist/agent-runtime/src/typed-interrupts.js.map +1 -0
- package/dist/agent-runtime/src/types.d.ts +1 -1
- package/dist/agent-runtime/src/use-conversation-list.cjs +1 -0
- package/dist/agent-runtime/src/use-conversation-list.cjs.map +1 -1
- package/dist/agent-runtime/src/use-conversation-list.d.ts +7 -0
- package/dist/agent-runtime/src/use-conversation-list.js +1 -0
- package/dist/agent-runtime/src/use-conversation-list.js.map +1 -1
- package/dist/agent-runtime/src/use-deep-agent-chat-outbox.cjs +46 -29
- package/dist/agent-runtime/src/use-deep-agent-chat-outbox.cjs.map +1 -1
- package/dist/agent-runtime/src/use-deep-agent-chat-outbox.d.ts +14 -22
- package/dist/agent-runtime/src/use-deep-agent-chat-outbox.js +46 -29
- package/dist/agent-runtime/src/use-deep-agent-chat-outbox.js.map +1 -1
- package/dist/agent-runtime/src/use-deep-agent-runtime.cjs +78 -14
- package/dist/agent-runtime/src/use-deep-agent-runtime.cjs.map +1 -1
- package/dist/agent-runtime/src/use-deep-agent-runtime.d.ts +34 -7
- package/dist/agent-runtime/src/use-deep-agent-runtime.js +79 -15
- package/dist/agent-runtime/src/use-deep-agent-runtime.js.map +1 -1
- package/dist/agent-runtime/src/use-deep-agent-thread.cjs +16 -1
- package/dist/agent-runtime/src/use-deep-agent-thread.cjs.map +1 -1
- package/dist/agent-runtime/src/use-deep-agent-thread.d.ts +7 -2
- package/dist/agent-runtime/src/use-deep-agent-thread.js +16 -1
- package/dist/agent-runtime/src/use-deep-agent-thread.js.map +1 -1
- package/dist/agent-runtime/src/use-deep-agent-voice.cjs +30 -4
- package/dist/agent-runtime/src/use-deep-agent-voice.cjs.map +1 -1
- package/dist/agent-runtime/src/use-deep-agent-voice.d.ts +22 -4
- package/dist/agent-runtime/src/use-deep-agent-voice.js +30 -4
- package/dist/agent-runtime/src/use-deep-agent-voice.js.map +1 -1
- package/dist/agent-runtime/src/withdrawn-turns.d.ts +5 -4
- package/dist/agent-runtime/src/word-device-fit.d.ts +174 -0
- package/dist/agent-runtime/src/work-in.d.ts +127 -0
- package/dist/assets/AthenaAssetEmbed.cjs.map +1 -1
- package/dist/assets/AthenaAssetEmbed.d.ts +6 -1
- package/dist/assets/AthenaAssetEmbed.js.map +1 -1
- package/dist/assets/asset-panel-store.cjs +13 -5
- package/dist/assets/asset-panel-store.cjs.map +1 -1
- package/dist/assets/asset-panel-store.d.ts +33 -2
- package/dist/assets/asset-panel-store.js +13 -5
- package/dist/assets/asset-panel-store.js.map +1 -1
- package/dist/auth/AthenaCredentialSourceContext.cjs +11 -0
- package/dist/auth/AthenaCredentialSourceContext.cjs.map +1 -1
- package/dist/auth/AthenaCredentialSourceContext.d.ts +6 -0
- package/dist/auth/AthenaCredentialSourceContext.js +11 -0
- package/dist/auth/AthenaCredentialSourceContext.js.map +1 -1
- package/dist/auth/account-identity.cjs +13 -2
- package/dist/auth/account-identity.cjs.map +1 -1
- package/dist/auth/account-identity.d.ts +9 -0
- package/dist/auth/account-identity.js +13 -2
- package/dist/auth/account-identity.js.map +1 -1
- package/dist/auth/credential-source.cjs +20 -4
- package/dist/auth/credential-source.cjs.map +1 -1
- package/dist/auth/credential-source.d.ts +9 -0
- package/dist/auth/credential-source.js +20 -4
- package/dist/auth/credential-source.js.map +1 -1
- package/dist/catalog/chat-pickers.cjs +31 -0
- package/dist/catalog/chat-pickers.cjs.map +1 -1
- package/dist/catalog/chat-pickers.d.ts +17 -0
- package/dist/catalog/chat-pickers.js +33 -2
- package/dist/catalog/chat-pickers.js.map +1 -1
- package/dist/catalog/runtime-catalog.cjs +63 -3
- package/dist/catalog/runtime-catalog.cjs.map +1 -1
- package/dist/catalog/runtime-catalog.d.ts +63 -3
- package/dist/catalog/runtime-catalog.js +64 -4
- package/dist/catalog/runtime-catalog.js.map +1 -1
- package/dist/chat/AthenaChat.cjs +301 -98
- package/dist/chat/AthenaChat.cjs.map +1 -1
- package/dist/chat/AthenaChat.d.ts +80 -4
- package/dist/chat/AthenaChat.js +302 -99
- package/dist/chat/AthenaChat.js.map +1 -1
- package/dist/chat/StatewireApprovalCard.cjs +35 -5
- package/dist/chat/StatewireApprovalCard.cjs.map +1 -1
- package/dist/chat/StatewireApprovalCard.d.ts +55 -2
- package/dist/chat/StatewireApprovalCard.js +37 -7
- package/dist/chat/StatewireApprovalCard.js.map +1 -1
- package/dist/chat/StatewireQueuedMessages.cjs +17 -2
- package/dist/chat/StatewireQueuedMessages.cjs.map +1 -1
- package/dist/chat/StatewireQueuedMessages.d.ts +8 -45
- package/dist/chat/StatewireQueuedMessages.js +18 -3
- package/dist/chat/StatewireQueuedMessages.js.map +1 -1
- package/dist/chat/chat-agent-mentions.cjs +70 -0
- package/dist/chat/chat-agent-mentions.cjs.map +1 -0
- package/dist/chat/chat-agent-mentions.d.ts +13 -0
- package/dist/chat/chat-agent-mentions.js +70 -0
- package/dist/chat/chat-agent-mentions.js.map +1 -0
- package/dist/chat/composer-actions.cjs +12 -0
- package/dist/chat/composer-actions.cjs.map +1 -0
- package/dist/chat/composer-actions.d.ts +22 -0
- package/dist/chat/composer-actions.js +12 -0
- package/dist/chat/composer-actions.js.map +1 -0
- package/dist/chat/follow-up-suggestions.cjs +185 -0
- package/dist/chat/follow-up-suggestions.cjs.map +1 -0
- package/dist/chat/follow-up-suggestions.d.ts +64 -0
- package/dist/chat/follow-up-suggestions.js +185 -0
- package/dist/chat/follow-up-suggestions.js.map +1 -0
- package/dist/chat/super-grouping/ToolTimeline.cjs +4 -3
- package/dist/chat/super-grouping/ToolTimeline.cjs.map +1 -1
- package/dist/chat/super-grouping/ToolTimeline.d.ts +7 -3
- package/dist/chat/super-grouping/ToolTimeline.js +4 -3
- package/dist/chat/super-grouping/ToolTimeline.js.map +1 -1
- package/dist/chat/turn-changes.cjs +284 -0
- package/dist/chat/turn-changes.cjs.map +1 -0
- package/dist/chat/turn-changes.d.ts +130 -0
- package/dist/chat/turn-changes.js +284 -0
- package/dist/chat/turn-changes.js.map +1 -0
- package/dist/chat/typed-interrupts/StatewireTypedInterruptCard.cjs +31 -0
- package/dist/chat/typed-interrupts/StatewireTypedInterruptCard.cjs.map +1 -0
- package/dist/chat/typed-interrupts/StatewireTypedInterruptCard.d.ts +31 -0
- package/dist/chat/typed-interrupts/StatewireTypedInterruptCard.js +31 -0
- package/dist/chat/typed-interrupts/StatewireTypedInterruptCard.js.map +1 -0
- package/dist/chat/typed-interrupts/approval-cards.cjs +250 -0
- package/dist/chat/typed-interrupts/approval-cards.cjs.map +1 -0
- package/dist/chat/typed-interrupts/approval-cards.d.ts +22 -0
- package/dist/chat/typed-interrupts/approval-cards.js +250 -0
- package/dist/chat/typed-interrupts/approval-cards.js.map +1 -0
- package/dist/chat/typed-interrupts/form-cards.cjs +289 -0
- package/dist/chat/typed-interrupts/form-cards.cjs.map +1 -0
- package/dist/chat/typed-interrupts/form-cards.d.ts +6 -0
- package/dist/chat/typed-interrupts/form-cards.js +289 -0
- package/dist/chat/typed-interrupts/form-cards.js.map +1 -0
- package/dist/chat/typed-interrupts/interrupt-card-shell.cjs +182 -0
- package/dist/chat/typed-interrupts/interrupt-card-shell.cjs.map +1 -0
- package/dist/chat/typed-interrupts/interrupt-card-shell.d.ts +47 -0
- package/dist/chat/typed-interrupts/interrupt-card-shell.js +182 -0
- package/dist/chat/typed-interrupts/interrupt-card-shell.js.map +1 -0
- package/dist/chat/typed-interrupts/json-schema-form.cjs +388 -0
- package/dist/chat/typed-interrupts/json-schema-form.cjs.map +1 -0
- package/dist/chat/typed-interrupts/json-schema-form.d.ts +33 -0
- package/dist/chat/typed-interrupts/json-schema-form.js +388 -0
- package/dist/chat/typed-interrupts/json-schema-form.js.map +1 -0
- package/dist/chat/typed-interrupts/questionnaire-card.cjs +449 -0
- package/dist/chat/typed-interrupts/questionnaire-card.cjs.map +1 -0
- package/dist/chat/typed-interrupts/questionnaire-card.d.ts +20 -0
- package/dist/chat/typed-interrupts/questionnaire-card.js +449 -0
- package/dist/chat/typed-interrupts/questionnaire-card.js.map +1 -0
- package/dist/chat/typed-interrupts/request-file-card.cjs +159 -0
- package/dist/chat/typed-interrupts/request-file-card.cjs.map +1 -0
- package/dist/chat/typed-interrupts/request-file-card.d.ts +2 -0
- package/dist/chat/typed-interrupts/request-file-card.js +159 -0
- package/dist/chat/typed-interrupts/request-file-card.js.map +1 -0
- package/dist/chat/typed-interrupts/toolkit-selection-card.cjs +189 -0
- package/dist/chat/typed-interrupts/toolkit-selection-card.cjs.map +1 -0
- package/dist/chat/typed-interrupts/toolkit-selection-card.d.ts +23 -0
- package/dist/chat/typed-interrupts/toolkit-selection-card.js +189 -0
- package/dist/chat/typed-interrupts/toolkit-selection-card.js.map +1 -0
- package/dist/chat/typed-interrupts/typed-interrupt-body.cjs +26 -0
- package/dist/chat/typed-interrupts/typed-interrupt-body.cjs.map +1 -0
- package/dist/chat/typed-interrupts/typed-interrupt-body.d.ts +3 -0
- package/dist/chat/typed-interrupts/typed-interrupt-body.js +26 -0
- package/dist/chat/typed-interrupts/typed-interrupt-body.js.map +1 -0
- package/dist/chat/typed-interrupts/typed-interrupt-graphql.cjs +105 -0
- package/dist/chat/typed-interrupts/typed-interrupt-graphql.cjs.map +1 -0
- package/dist/chat/typed-interrupts/typed-interrupt-graphql.d.ts +29 -0
- package/dist/chat/typed-interrupts/typed-interrupt-graphql.js +105 -0
- package/dist/chat/typed-interrupts/typed-interrupt-graphql.js.map +1 -0
- package/dist/chat/typed-interrupts/typed-interrupt-notice.cjs +70 -0
- package/dist/chat/typed-interrupts/typed-interrupt-notice.cjs.map +1 -0
- package/dist/chat/typed-interrupts/typed-interrupt-notice.d.ts +45 -0
- package/dist/chat/typed-interrupts/typed-interrupt-notice.js +70 -0
- package/dist/chat/typed-interrupts/typed-interrupt-notice.js.map +1 -0
- package/dist/chat/typed-interrupts/typed-interrupt-panel.cjs +76 -0
- package/dist/chat/typed-interrupts/typed-interrupt-panel.cjs.map +1 -0
- package/dist/chat/typed-interrupts/typed-interrupt-panel.d.ts +11 -0
- package/dist/chat/typed-interrupts/typed-interrupt-panel.js +76 -0
- package/dist/chat/typed-interrupts/typed-interrupt-panel.js.map +1 -0
- package/dist/chat/typed-interrupts/typed-interrupt-types.d.ts +46 -0
- package/dist/chat/typed-interrupts/use-interrupt-draft.cjs +106 -0
- package/dist/chat/typed-interrupts/use-interrupt-draft.cjs.map +1 -0
- package/dist/chat/typed-interrupts/use-interrupt-draft.d.ts +29 -0
- package/dist/chat/typed-interrupts/use-interrupt-draft.js +106 -0
- package/dist/chat/typed-interrupts/use-interrupt-draft.js.map +1 -0
- package/dist/chat/typed-interrupts/use-statewire-typed-interrupt.cjs +231 -0
- package/dist/chat/typed-interrupts/use-statewire-typed-interrupt.cjs.map +1 -0
- package/dist/chat/typed-interrupts/use-statewire-typed-interrupt.d.ts +66 -0
- package/dist/chat/typed-interrupts/use-statewire-typed-interrupt.js +231 -0
- package/dist/chat/typed-interrupts/use-statewire-typed-interrupt.js.map +1 -0
- package/dist/chat-ui/composer/composer-named-agents.cjs +13 -0
- package/dist/chat-ui/composer/composer-named-agents.cjs.map +1 -0
- package/dist/chat-ui/composer/composer-named-agents.d.ts +20 -0
- package/dist/chat-ui/composer/composer-named-agents.js +13 -0
- package/dist/chat-ui/composer/composer-named-agents.js.map +1 -0
- package/dist/chat-ui/composer/slash-command-menu.cjs +143 -0
- package/dist/chat-ui/composer/slash-command-menu.cjs.map +1 -0
- package/dist/chat-ui/composer/slash-command-menu.d.ts +19 -0
- package/dist/chat-ui/composer/slash-command-menu.js +143 -0
- package/dist/chat-ui/composer/slash-command-menu.js.map +1 -0
- package/dist/chat-ui/composer/slash-commands-extension.cjs +51 -0
- package/dist/chat-ui/composer/slash-commands-extension.cjs.map +1 -0
- package/dist/chat-ui/composer/slash-commands-extension.d.ts +39 -0
- package/dist/chat-ui/composer/slash-commands-extension.js +51 -0
- package/dist/chat-ui/composer/slash-commands-extension.js.map +1 -0
- package/dist/chat-ui/composer/slash-commands.cjs +74 -0
- package/dist/chat-ui/composer/slash-commands.cjs.map +1 -0
- package/dist/chat-ui/composer/slash-commands.d.ts +82 -0
- package/dist/chat-ui/composer/slash-commands.js +74 -0
- package/dist/chat-ui/composer/slash-commands.js.map +1 -0
- package/dist/chat-ui/composer/tiptap-composer.cjs +135 -9
- package/dist/chat-ui/composer/tiptap-composer.cjs.map +1 -1
- package/dist/chat-ui/composer/tiptap-composer.d.ts +61 -2
- package/dist/chat-ui/composer/tiptap-composer.js +135 -9
- package/dist/chat-ui/composer/tiptap-composer.js.map +1 -1
- package/dist/chat-ui/index.cjs +5 -0
- package/dist/chat-ui/index.cjs.map +1 -1
- package/dist/chat-ui/index.d.ts +4 -2
- package/dist/chat-ui/index.js +5 -0
- package/dist/chat-ui/index.js.map +1 -1
- package/dist/chat-ui/mentions/mention-chip.cjs +10 -4
- package/dist/chat-ui/mentions/mention-chip.cjs.map +1 -1
- package/dist/chat-ui/mentions/mention-chip.js +11 -5
- package/dist/chat-ui/mentions/mention-chip.js.map +1 -1
- package/dist/chat-ui/mentions/mention-extension.cjs +8 -1
- package/dist/chat-ui/mentions/mention-extension.cjs.map +1 -1
- package/dist/chat-ui/mentions/mention-extension.js +8 -1
- package/dist/chat-ui/mentions/mention-extension.js.map +1 -1
- package/dist/chat-ui/mentions/suggestions/components/get-scope-name.cjs +1 -0
- package/dist/chat-ui/mentions/suggestions/components/get-scope-name.cjs.map +1 -1
- package/dist/chat-ui/mentions/suggestions/components/get-scope-name.js +1 -0
- package/dist/chat-ui/mentions/suggestions/components/get-scope-name.js.map +1 -1
- package/dist/chat-ui/mentions/suggestions/components/mention-icon.cjs +20 -2
- package/dist/chat-ui/mentions/suggestions/components/mention-icon.cjs.map +1 -1
- package/dist/chat-ui/mentions/suggestions/components/mention-icon.d.ts +10 -1
- package/dist/chat-ui/mentions/suggestions/components/mention-icon.js +22 -4
- package/dist/chat-ui/mentions/suggestions/components/mention-icon.js.map +1 -1
- package/dist/chat-ui/mentions/suggestions/components/menu-item.cjs +1 -1
- package/dist/chat-ui/mentions/suggestions/components/menu-item.cjs.map +1 -1
- package/dist/chat-ui/mentions/suggestions/components/menu-item.js +1 -1
- package/dist/chat-ui/mentions/suggestions/components/menu-item.js.map +1 -1
- package/dist/chat-ui/mentions/suggestions/data/api-client.cjs +45 -0
- package/dist/chat-ui/mentions/suggestions/data/api-client.cjs.map +1 -1
- package/dist/chat-ui/mentions/suggestions/data/api-client.d.ts +48 -0
- package/dist/chat-ui/mentions/suggestions/data/api-client.js +45 -0
- package/dist/chat-ui/mentions/suggestions/data/api-client.js.map +1 -1
- package/dist/chat-ui/mentions/suggestions/data/sources/asset-type-icon-names.generated.cjs +89 -0
- package/dist/chat-ui/mentions/suggestions/data/sources/asset-type-icon-names.generated.cjs.map +1 -0
- package/dist/chat-ui/mentions/suggestions/data/sources/asset-type-icon-names.generated.d.ts +8 -0
- package/dist/chat-ui/mentions/suggestions/data/sources/asset-type-icon-names.generated.js +89 -0
- package/dist/chat-ui/mentions/suggestions/data/sources/asset-type-icon-names.generated.js.map +1 -0
- package/dist/chat-ui/mentions/suggestions/data/sources/asset-type-icons.cjs +140 -116
- package/dist/chat-ui/mentions/suggestions/data/sources/asset-type-icons.cjs.map +1 -1
- package/dist/chat-ui/mentions/suggestions/data/sources/asset-type-icons.d.ts +46 -12
- package/dist/chat-ui/mentions/suggestions/data/sources/asset-type-icons.js +141 -117
- package/dist/chat-ui/mentions/suggestions/data/sources/asset-type-icons.js.map +1 -1
- package/dist/chat-ui/mentions/suggestions/data/sources/index.cjs +272 -25
- package/dist/chat-ui/mentions/suggestions/data/sources/index.cjs.map +1 -1
- package/dist/chat-ui/mentions/suggestions/data/sources/index.d.ts +88 -10
- package/dist/chat-ui/mentions/suggestions/data/sources/index.js +274 -27
- package/dist/chat-ui/mentions/suggestions/data/sources/index.js.map +1 -1
- package/dist/chat-ui/mentions/suggestions/data/types.cjs.map +1 -1
- package/dist/chat-ui/mentions/suggestions/data/types.d.ts +27 -1
- package/dist/chat-ui/mentions/suggestions/data/types.js.map +1 -1
- package/dist/chat-ui/mentions/suggestions/data/use-mention-suggestions.cjs +56 -5
- package/dist/chat-ui/mentions/suggestions/data/use-mention-suggestions.cjs.map +1 -1
- package/dist/chat-ui/mentions/suggestions/data/use-mention-suggestions.d.ts +26 -6
- package/dist/chat-ui/mentions/suggestions/data/use-mention-suggestions.js +57 -6
- package/dist/chat-ui/mentions/suggestions/data/use-mention-suggestions.js.map +1 -1
- package/dist/chat-ui/mentions/suggestions/mention-suggestions.extension.cjs +34 -17
- package/dist/chat-ui/mentions/suggestions/mention-suggestions.extension.cjs.map +1 -1
- package/dist/chat-ui/mentions/suggestions/mention-suggestions.extension.d.ts +19 -1
- package/dist/chat-ui/mentions/suggestions/mention-suggestions.extension.js +35 -18
- package/dist/chat-ui/mentions/suggestions/mention-suggestions.extension.js.map +1 -1
- package/dist/chat-ui/mentions/use-asset-icon-app-url.cjs +12 -0
- package/dist/chat-ui/mentions/use-asset-icon-app-url.cjs.map +1 -0
- package/dist/chat-ui/mentions/use-asset-icon-app-url.d.ts +8 -0
- package/dist/chat-ui/mentions/use-asset-icon-app-url.js +12 -0
- package/dist/chat-ui/mentions/use-asset-icon-app-url.js.map +1 -0
- package/dist/chat-ui/statewire.d.ts +1 -1
- package/dist/chat-ui/thread/statewire-history-edge.cjs +15 -0
- package/dist/chat-ui/thread/statewire-history-edge.cjs.map +1 -1
- package/dist/chat-ui/thread/statewire-history-edge.d.ts +4 -1
- package/dist/chat-ui/thread/statewire-history-edge.js +15 -0
- package/dist/chat-ui/thread/statewire-history-edge.js.map +1 -1
- package/dist/collab/client.cjs +41 -6
- package/dist/collab/client.cjs.map +1 -1
- package/dist/collab/client.d.ts +38 -7
- package/dist/collab/client.js +41 -6
- package/dist/collab/client.js.map +1 -1
- package/dist/composer/ComposerAttachedReferences.cjs +119 -0
- package/dist/composer/ComposerAttachedReferences.cjs.map +1 -0
- package/dist/composer/ComposerAttachedReferences.d.ts +26 -0
- package/dist/composer/ComposerAttachedReferences.js +119 -0
- package/dist/composer/ComposerAttachedReferences.js.map +1 -0
- package/dist/composer/ComposerNamedAgents.cjs +63 -0
- package/dist/composer/ComposerNamedAgents.cjs.map +1 -0
- package/dist/composer/ComposerNamedAgents.d.ts +16 -0
- package/dist/composer/ComposerNamedAgents.js +63 -0
- package/dist/composer/ComposerNamedAgents.js.map +1 -0
- package/dist/composer/attached-references.cjs +159 -0
- package/dist/composer/attached-references.cjs.map +1 -0
- package/dist/composer/attached-references.d.ts +86 -0
- package/dist/composer/attached-references.js +159 -0
- package/dist/composer/attached-references.js.map +1 -0
- package/dist/composer/build-composed-message.cjs +14 -7
- package/dist/composer/build-composed-message.cjs.map +1 -1
- package/dist/composer/build-composed-message.d.ts +6 -1
- package/dist/composer/build-composed-message.js +14 -7
- package/dist/composer/build-composed-message.js.map +1 -1
- package/dist/composer/composer-handoff.cjs +6 -2
- package/dist/composer/composer-handoff.cjs.map +1 -1
- package/dist/composer/composer-handoff.d.ts +7 -1
- package/dist/composer/composer-handoff.js +6 -2
- package/dist/composer/composer-handoff.js.map +1 -1
- package/dist/composer/folder-upload.cjs +149 -0
- package/dist/composer/folder-upload.cjs.map +1 -0
- package/dist/composer/folder-upload.d.ts +79 -0
- package/dist/composer/folder-upload.js +149 -0
- package/dist/composer/folder-upload.js.map +1 -0
- package/dist/composer/index.d.ts +1 -1
- package/dist/composer/staged-message-metadata.cjs +12 -0
- package/dist/composer/staged-message-metadata.cjs.map +1 -0
- package/dist/composer/staged-message-metadata.d.ts +15 -0
- package/dist/composer/staged-message-metadata.js +12 -0
- package/dist/composer/staged-message-metadata.js.map +1 -0
- package/dist/composer/useAttachToChat.cjs +35 -0
- package/dist/composer/useAttachToChat.cjs.map +1 -0
- package/dist/composer/useAttachToChat.d.ts +54 -0
- package/dist/composer/useAttachToChat.js +35 -0
- package/dist/composer/useAttachToChat.js.map +1 -0
- package/dist/composer/useAttachedReferencesComposerProps.cjs +19 -0
- package/dist/composer/useAttachedReferencesComposerProps.cjs.map +1 -0
- package/dist/composer/useAttachedReferencesComposerProps.d.ts +12 -0
- package/dist/composer/useAttachedReferencesComposerProps.js +19 -0
- package/dist/composer/useAttachedReferencesComposerProps.js.map +1 -0
- package/dist/composer/useFileUpload.cjs +95 -7
- package/dist/composer/useFileUpload.cjs.map +1 -1
- package/dist/composer/useFileUpload.d.ts +21 -2
- package/dist/composer/useFileUpload.js +95 -7
- package/dist/composer/useFileUpload.js.map +1 -1
- package/dist/data/athena-api-error.cjs +125 -0
- package/dist/data/athena-api-error.cjs.map +1 -0
- package/dist/data/athena-api-error.d.ts +96 -0
- package/dist/data/athena-api-error.js +125 -0
- package/dist/data/athena-api-error.js.map +1 -0
- package/dist/data/athena-data-client.cjs +106 -0
- package/dist/data/athena-data-client.cjs.map +1 -0
- package/dist/data/athena-data-client.d.ts +74 -0
- package/dist/data/athena-data-client.js +106 -0
- package/dist/data/athena-data-client.js.map +1 -0
- package/dist/data/athena-member.cjs +93 -0
- package/dist/data/athena-member.cjs.map +1 -0
- package/dist/data/athena-member.d.ts +125 -0
- package/dist/data/athena-member.js +93 -0
- package/dist/data/athena-member.js.map +1 -0
- package/dist/data/athena-request.cjs +460 -0
- package/dist/data/athena-request.cjs.map +1 -0
- package/dist/data/athena-request.d.ts +120 -0
- package/dist/data/athena-request.js +460 -0
- package/dist/data/athena-request.js.map +1 -0
- package/dist/data/use-athena-fetch.cjs +14 -0
- package/dist/data/use-athena-fetch.cjs.map +1 -0
- package/dist/data/use-athena-fetch.d.ts +19 -0
- package/dist/data/use-athena-fetch.js +14 -0
- package/dist/data/use-athena-fetch.js.map +1 -0
- package/dist/data/use-athena-graphql.cjs +66 -0
- package/dist/data/use-athena-graphql.cjs.map +1 -0
- package/dist/data/use-athena-graphql.d.ts +56 -0
- package/dist/data/use-athena-graphql.js +66 -0
- package/dist/data/use-athena-graphql.js.map +1 -0
- package/dist/data/use-athena-rest.cjs +33 -0
- package/dist/data/use-athena-rest.cjs.map +1 -0
- package/dist/data/use-athena-rest.d.ts +21 -0
- package/dist/data/use-athena-rest.js +33 -0
- package/dist/data/use-athena-rest.js.map +1 -0
- package/dist/data/use-semantic-query.cjs +44 -0
- package/dist/data/use-semantic-query.cjs.map +1 -0
- package/dist/data/use-semantic-query.d.ts +92 -0
- package/dist/data/use-semantic-query.js +44 -0
- package/dist/data/use-semantic-query.js.map +1 -0
- package/dist/diagnostics/athena-diagnostics.cjs.map +1 -1
- package/dist/diagnostics/athena-diagnostics.d.ts +5 -1
- package/dist/diagnostics/athena-diagnostics.js.map +1 -1
- package/dist/diagnostics/errors.cjs +7 -0
- package/dist/diagnostics/errors.cjs.map +1 -1
- package/dist/diagnostics/errors.d.ts +7 -0
- package/dist/diagnostics/errors.js +7 -0
- package/dist/diagnostics/errors.js.map +1 -1
- package/dist/index.cjs +155 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +72 -13
- package/dist/index.js +148 -4
- package/dist/index.js.map +1 -1
- package/dist/keryx-http/src/initial-sync.cjs +64 -16
- package/dist/keryx-http/src/initial-sync.cjs.map +1 -1
- package/dist/keryx-http/src/initial-sync.d.ts +31 -1
- package/dist/keryx-http/src/initial-sync.js +64 -16
- package/dist/keryx-http/src/initial-sync.js.map +1 -1
- package/dist/keryx-http/src/own-awareness.cjs +20 -0
- package/dist/keryx-http/src/own-awareness.cjs.map +1 -0
- package/dist/keryx-http/src/own-awareness.d.ts +50 -0
- package/dist/keryx-http/src/own-awareness.js +20 -0
- package/dist/keryx-http/src/own-awareness.js.map +1 -0
- package/dist/keryx-http/src/update-attributions.cjs +26 -1
- package/dist/keryx-http/src/update-attributions.cjs.map +1 -1
- package/dist/keryx-http/src/update-attributions.d.ts +10 -1
- package/dist/keryx-http/src/update-attributions.js +26 -1
- package/dist/keryx-http/src/update-attributions.js.map +1 -1
- package/dist/offline/chat-outbox.cjs +262 -26
- package/dist/offline/chat-outbox.cjs.map +1 -1
- package/dist/offline/chat-outbox.d.ts +90 -12
- package/dist/offline/chat-outbox.js +263 -27
- package/dist/offline/chat-outbox.js.map +1 -1
- package/dist/provider/AthenaProvider.cjs +60 -22
- package/dist/provider/AthenaProvider.cjs.map +1 -1
- package/dist/provider/AthenaProvider.d.ts +24 -8
- package/dist/provider/AthenaProvider.js +61 -23
- package/dist/provider/AthenaProvider.js.map +1 -1
- package/dist/react/package.json.cjs +1 -1
- package/dist/react/package.json.js +1 -1
- package/dist/references/src/anchors/parse.cjs +11 -1
- package/dist/references/src/anchors/parse.cjs.map +1 -1
- package/dist/references/src/anchors/parse.js +11 -1
- package/dist/references/src/anchors/parse.js.map +1 -1
- package/dist/references/src/anchors/schemas.d.ts +1 -0
- package/dist/references/src/anchors/serialize.cjs +1 -0
- package/dist/references/src/anchors/serialize.cjs.map +1 -1
- package/dist/references/src/anchors/serialize.js +1 -0
- package/dist/references/src/anchors/serialize.js.map +1 -1
- package/dist/references/src/anchors/types.cjs +5 -0
- package/dist/references/src/anchors/types.cjs.map +1 -1
- package/dist/references/src/anchors/types.d.ts +9 -0
- package/dist/references/src/anchors/types.js +5 -0
- package/dist/references/src/anchors/types.js.map +1 -1
- package/dist/references/src/attachable.cjs +149 -0
- package/dist/references/src/attachable.cjs.map +1 -0
- package/dist/references/src/attachable.d.ts +87 -0
- package/dist/references/src/attachable.js +149 -0
- package/dist/references/src/attachable.js.map +1 -0
- package/dist/references/src/schemas.d.ts +2 -0
- package/dist/runtime/StatewirePlanModeLaneSync.cjs +93 -0
- package/dist/runtime/StatewirePlanModeLaneSync.cjs.map +1 -0
- package/dist/runtime/StatewirePlanModeLaneSync.d.ts +34 -0
- package/dist/runtime/StatewirePlanModeLaneSync.js +93 -0
- package/dist/runtime/StatewirePlanModeLaneSync.js.map +1 -0
- package/dist/runtime/StatewireThreadConfigLaneSync.cjs +2 -0
- package/dist/runtime/StatewireThreadConfigLaneSync.cjs.map +1 -1
- package/dist/runtime/StatewireThreadConfigLaneSync.d.ts +4 -0
- package/dist/runtime/StatewireThreadConfigLaneSync.js +2 -0
- package/dist/runtime/StatewireThreadConfigLaneSync.js.map +1 -1
- package/dist/runtime/statewire-plan-mode.cjs +71 -0
- package/dist/runtime/statewire-plan-mode.cjs.map +1 -0
- package/dist/runtime/statewire-plan-mode.d.ts +88 -0
- package/dist/runtime/statewire-plan-mode.js +71 -0
- package/dist/runtime/statewire-plan-mode.js.map +1 -0
- package/dist/runtime/statewire-run-config.cjs +3 -1
- package/dist/runtime/statewire-run-config.cjs.map +1 -1
- package/dist/runtime/statewire-run-config.d.ts +7 -0
- package/dist/runtime/statewire-run-config.js +3 -1
- package/dist/runtime/statewire-run-config.js.map +1 -1
- package/dist/runtime/statewire-session-key.cjs +11 -5
- package/dist/runtime/statewire-session-key.cjs.map +1 -1
- package/dist/runtime/statewire-session-key.d.ts +22 -10
- package/dist/runtime/statewire-session-key.js +11 -5
- package/dist/runtime/statewire-session-key.js.map +1 -1
- package/dist/runtime/useAthenaStatewireRuntime.cjs +64 -9
- package/dist/runtime/useAthenaStatewireRuntime.cjs.map +1 -1
- package/dist/runtime/useAthenaStatewireRuntime.d.ts +26 -10
- package/dist/runtime/useAthenaStatewireRuntime.js +66 -11
- package/dist/runtime/useAthenaStatewireRuntime.js.map +1 -1
- package/dist/search/useAthenaAssets.cjs +394 -0
- package/dist/search/useAthenaAssets.cjs.map +1 -0
- package/dist/search/useAthenaAssets.d.ts +186 -0
- package/dist/search/useAthenaAssets.js +394 -0
- package/dist/search/useAthenaAssets.js.map +1 -0
- package/dist/sheet-range/index.cjs +4 -0
- package/dist/sheet-range/index.cjs.map +1 -1
- package/dist/sheet-range/index.d.ts +4 -2
- package/dist/sheet-range/index.js +4 -0
- package/dist/sheet-range/index.js.map +1 -1
- package/dist/sheet-range/query-range.cjs +102 -0
- package/dist/sheet-range/query-range.cjs.map +1 -0
- package/dist/sheet-range/query-range.d.ts +46 -0
- package/dist/sheet-range/query-range.js +102 -0
- package/dist/sheet-range/query-range.js.map +1 -0
- package/dist/styles.css +1 -1
- package/dist/subagents/index.cjs +49 -0
- package/dist/subagents/index.cjs.map +1 -0
- package/dist/subagents/index.d.ts +16 -0
- package/dist/subagents/index.js +49 -0
- package/dist/subagents/index.js.map +1 -0
- package/dist/subagents/lane-follow.cjs +19 -0
- package/dist/subagents/lane-follow.cjs.map +1 -0
- package/dist/subagents/lane-follow.d.ts +9 -0
- package/dist/subagents/lane-follow.js +19 -0
- package/dist/subagents/lane-follow.js.map +1 -0
- package/dist/subagents/lane-model.cjs +178 -0
- package/dist/subagents/lane-model.cjs.map +1 -0
- package/dist/subagents/lane-model.d.ts +140 -0
- package/dist/subagents/lane-model.js +178 -0
- package/dist/subagents/lane-model.js.map +1 -0
- package/dist/subagents/lane-parts.cjs +517 -0
- package/dist/subagents/lane-parts.cjs.map +1 -0
- package/dist/subagents/lane-parts.d.ts +130 -0
- package/dist/subagents/lane-parts.js +517 -0
- package/dist/subagents/lane-parts.js.map +1 -0
- package/dist/subagents/subagent-lane-group.cjs +215 -0
- package/dist/subagents/subagent-lane-group.cjs.map +1 -0
- package/dist/subagents/subagent-lane-group.d.ts +67 -0
- package/dist/subagents/subagent-lane-group.js +215 -0
- package/dist/subagents/subagent-lane-group.js.map +1 -0
- package/dist/subagents/subagent-transcript-drawer.cjs +431 -0
- package/dist/subagents/subagent-transcript-drawer.cjs.map +1 -0
- package/dist/subagents/subagent-transcript-drawer.d.ts +78 -0
- package/dist/subagents/subagent-transcript-drawer.js +431 -0
- package/dist/subagents/subagent-transcript-drawer.js.map +1 -0
- package/dist/subagents/task-subagent-group.cjs +115 -0
- package/dist/subagents/task-subagent-group.cjs.map +1 -0
- package/dist/subagents/task-subagent-group.d.ts +36 -0
- package/dist/subagents/task-subagent-group.js +115 -0
- package/dist/subagents/task-subagent-group.js.map +1 -0
- package/dist/subagents/use-omitted-images-in-view.cjs +68 -0
- package/dist/subagents/use-omitted-images-in-view.cjs.map +1 -0
- package/dist/subagents/use-omitted-images-in-view.d.ts +21 -0
- package/dist/subagents/use-omitted-images-in-view.js +68 -0
- package/dist/subagents/use-omitted-images-in-view.js.map +1 -0
- package/dist/threads/Inbox.cjs +2 -2
- package/dist/threads/Inbox.cjs.map +1 -1
- package/dist/threads/SessionList.cjs +6 -6
- package/dist/threads/SessionList.cjs.map +1 -1
- package/dist/threads/SessionsPage.cjs +13 -7
- package/dist/threads/SessionsPage.cjs.map +1 -1
- package/dist/threads/SessionsPage.d.ts +10 -1
- package/dist/threads/SessionsPage.js +9 -3
- package/dist/threads/SessionsPage.js.map +1 -1
- package/dist/threads/session-list-model.cjs.map +1 -1
- package/dist/threads/session-list-model.d.ts +2 -1
- package/dist/threads/session-list-model.js.map +1 -1
- package/dist/threads/session-row-parts.cjs +3 -3
- package/dist/threads/session-row-parts.cjs.map +1 -1
- package/dist/threads/sessions-page-model.cjs +13 -5
- package/dist/threads/sessions-page-model.cjs.map +1 -1
- package/dist/threads/sessions-page-model.d.ts +7 -0
- package/dist/threads/sessions-page-model.js +11 -3
- package/dist/threads/sessions-page-model.js.map +1 -1
- package/dist/threads/sessions-page-storage.cjs +8 -8
- package/dist/threads/sessions-page-storage.cjs.map +1 -1
- package/dist/threads/sessions-page-storage.d.ts +5 -1
- package/dist/threads/sessions-page-storage.js +8 -8
- package/dist/threads/sessions-page-storage.js.map +1 -1
- package/dist/threads/statewire-thread-list.cjs +14 -2
- package/dist/threads/statewire-thread-list.cjs.map +1 -1
- package/dist/threads/statewire-thread-list.d.ts +11 -2
- package/dist/threads/statewire-thread-list.js +14 -2
- package/dist/threads/statewire-thread-list.js.map +1 -1
- package/dist/threads/use-athena-sessions.cjs +1 -0
- package/dist/threads/use-athena-sessions.cjs.map +1 -1
- package/dist/threads/use-athena-sessions.d.ts +7 -0
- package/dist/threads/use-athena-sessions.js +1 -0
- package/dist/threads/use-athena-sessions.js.map +1 -1
- package/dist/threads/use-athena-thread-agent.cjs +31 -0
- package/dist/threads/use-athena-thread-agent.cjs.map +1 -0
- package/dist/threads/use-athena-thread-agent.d.ts +38 -0
- package/dist/threads/use-athena-thread-agent.js +31 -0
- package/dist/threads/use-athena-thread-agent.js.map +1 -0
- package/dist/threads/use-athena-thread-plan-mode.cjs +18 -0
- package/dist/threads/use-athena-thread-plan-mode.cjs.map +1 -0
- package/dist/threads/use-athena-thread-plan-mode.d.ts +18 -0
- package/dist/threads/use-athena-thread-plan-mode.js +18 -0
- package/dist/threads/use-athena-thread-plan-mode.js.map +1 -0
- package/dist/threads/use-rest-conversation-history.d.ts +1 -0
- package/dist/tools/agent-creations.cjs +97 -0
- package/dist/tools/agent-creations.cjs.map +1 -0
- package/dist/tools/agent-creations.d.ts +38 -0
- package/dist/tools/agent-creations.js +97 -0
- package/dist/tools/agent-creations.js.map +1 -0
- package/dist/tools/agent-highlights.cjs +100 -0
- package/dist/tools/agent-highlights.cjs.map +1 -0
- package/dist/tools/agent-highlights.d.ts +57 -0
- package/dist/tools/agent-highlights.js +100 -0
- package/dist/tools/agent-highlights.js.map +1 -0
- package/dist/tools/append-document-tool-ui.cjs +1 -0
- package/dist/tools/append-document-tool-ui.cjs.map +1 -1
- package/dist/tools/append-document-tool-ui.d.ts +7 -0
- package/dist/tools/append-document-tool-ui.js +2 -1
- package/dist/tools/append-document-tool-ui.js.map +1 -1
- package/dist/tools/auto-open-tools.cjs +144 -71
- package/dist/tools/auto-open-tools.cjs.map +1 -1
- package/dist/tools/auto-open-tools.d.ts +131 -1
- package/dist/tools/auto-open-tools.js +145 -72
- package/dist/tools/auto-open-tools.js.map +1 -1
- package/dist/tools/browser-tool-uis.cjs +594 -0
- package/dist/tools/browser-tool-uis.cjs.map +1 -0
- package/dist/tools/browser-tool-uis.d.ts +8 -0
- package/dist/tools/browser-tool-uis.js +594 -0
- package/dist/tools/browser-tool-uis.js.map +1 -0
- package/dist/tools/computer-asset-tool-uis.cjs +313 -0
- package/dist/tools/computer-asset-tool-uis.cjs.map +1 -0
- package/dist/tools/computer-asset-tool-uis.d.ts +5 -0
- package/dist/tools/computer-asset-tool-uis.js +313 -0
- package/dist/tools/computer-asset-tool-uis.js.map +1 -0
- package/dist/tools/document-edit-tool-uis.cjs +218 -0
- package/dist/tools/document-edit-tool-uis.cjs.map +1 -0
- package/dist/tools/document-edit-tool-uis.d.ts +40 -0
- package/dist/tools/document-edit-tool-uis.js +218 -0
- package/dist/tools/document-edit-tool-uis.js.map +1 -0
- package/dist/tools/drive-tool-uis.cjs +429 -0
- package/dist/tools/drive-tool-uis.cjs.map +1 -0
- package/dist/tools/drive-tool-uis.d.ts +121 -0
- package/dist/tools/drive-tool-uis.js +429 -0
- package/dist/tools/drive-tool-uis.js.map +1 -0
- package/dist/tools/email-calendar-tool-uis.cjs +789 -0
- package/dist/tools/email-calendar-tool-uis.cjs.map +1 -0
- package/dist/tools/email-calendar-tool-uis.d.ts +129 -0
- package/dist/tools/email-calendar-tool-uis.js +789 -0
- package/dist/tools/email-calendar-tool-uis.js.map +1 -0
- package/dist/tools/ontology-tool-uis.cjs +83 -0
- package/dist/tools/ontology-tool-uis.cjs.map +1 -0
- package/dist/tools/ontology-tool-uis.d.ts +9 -0
- package/dist/tools/ontology-tool-uis.js +83 -0
- package/dist/tools/ontology-tool-uis.js.map +1 -0
- package/dist/tools/orchestration-tool-uis.cjs +586 -0
- package/dist/tools/orchestration-tool-uis.cjs.map +1 -0
- package/dist/tools/orchestration-tool-uis.d.ts +141 -0
- package/dist/tools/orchestration-tool-uis.js +586 -0
- package/dist/tools/orchestration-tool-uis.js.map +1 -0
- package/dist/tools/presentation-edit-tool-uis.cjs +516 -0
- package/dist/tools/presentation-edit-tool-uis.cjs.map +1 -0
- package/dist/tools/presentation-edit-tool-uis.d.ts +73 -0
- package/dist/tools/presentation-edit-tool-uis.js +516 -0
- package/dist/tools/presentation-edit-tool-uis.js.map +1 -0
- package/dist/tools/project-tool-uis.cjs +213 -0
- package/dist/tools/project-tool-uis.cjs.map +1 -0
- package/dist/tools/project-tool-uis.d.ts +14 -0
- package/dist/tools/project-tool-uis.js +213 -0
- package/dist/tools/project-tool-uis.js.map +1 -0
- package/dist/tools/sandbox-tool-uis.cjs +491 -0
- package/dist/tools/sandbox-tool-uis.cjs.map +1 -0
- package/dist/tools/sandbox-tool-uis.d.ts +116 -0
- package/dist/tools/sandbox-tool-uis.js +491 -0
- package/dist/tools/sandbox-tool-uis.js.map +1 -0
- package/dist/tools/sheet-query-tool-ui.cjs +138 -0
- package/dist/tools/sheet-query-tool-ui.cjs.map +1 -0
- package/dist/tools/sheet-query-tool-ui.d.ts +15 -0
- package/dist/tools/sheet-query-tool-ui.js +138 -0
- package/dist/tools/sheet-query-tool-ui.js.map +1 -0
- package/dist/tools/studio-screenshot-tool-uis.cjs +262 -0
- package/dist/tools/studio-screenshot-tool-uis.cjs.map +1 -0
- package/dist/tools/studio-screenshot-tool-uis.d.ts +52 -0
- package/dist/tools/studio-screenshot-tool-uis.js +262 -0
- package/dist/tools/studio-screenshot-tool-uis.js.map +1 -0
- package/dist/tools/subagent-task-tool-ui.cjs +24 -475
- package/dist/tools/subagent-task-tool-ui.cjs.map +1 -1
- package/dist/tools/subagent-task-tool-ui.d.ts +19 -103
- package/dist/tools/subagent-task-tool-ui.js +28 -479
- package/dist/tools/subagent-task-tool-ui.js.map +1 -1
- package/dist/tools/tool-summary.cjs +36 -0
- package/dist/tools/tool-summary.cjs.map +1 -1
- package/dist/tools/tool-summary.js +36 -0
- package/dist/tools/tool-summary.js.map +1 -1
- package/dist/tools/tool-uis.cjs +181 -53
- package/dist/tools/tool-uis.cjs.map +1 -1
- package/dist/tools/tool-uis.d.ts +40 -0
- package/dist/tools/tool-uis.js +183 -55
- package/dist/tools/tool-uis.js.map +1 -1
- package/dist/typed-interrupts/index.cjs +15 -0
- package/dist/typed-interrupts/index.cjs.map +1 -0
- package/dist/typed-interrupts/index.d.ts +20 -0
- package/dist/typed-interrupts/index.js +15 -0
- package/dist/typed-interrupts/index.js.map +1 -0
- package/dist/version.cjs +4 -0
- package/dist/version.cjs.map +1 -1
- package/dist/version.d.ts +9 -0
- package/dist/version.js +4 -0
- package/dist/version.js.map +1 -1
- package/dist/workbench/live-desktop-api.cjs +2 -1
- package/dist/workbench/live-desktop-api.cjs.map +1 -1
- package/dist/workbench/live-desktop-api.js +2 -1
- package/dist/workbench/live-desktop-api.js.map +1 -1
- package/dist/workbench/session-workbench-panes.cjs +6 -6
- package/dist/workbench/session-workbench-panes.cjs.map +1 -1
- package/dist/workbench/session-workspace-api.cjs +7 -2
- package/dist/workbench/session-workspace-api.cjs.map +1 -1
- package/dist/workbench/session-workspace-api.d.ts +10 -0
- package/dist/workbench/session-workspace-api.js +7 -2
- package/dist/workbench/session-workspace-api.js.map +1 -1
- package/package.json +28 -6
- package/dist/agent-runtime/src/chat-outbox-store.cjs +0 -510
- package/dist/agent-runtime/src/chat-outbox-store.cjs.map +0 -1
- package/dist/agent-runtime/src/chat-outbox-store.d.ts +0 -210
- package/dist/agent-runtime/src/chat-outbox-store.js +0 -510
- package/dist/agent-runtime/src/chat-outbox-store.js.map +0 -1
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
+
const react = require("@assistant-ui/react");
|
|
5
|
+
const format = require("../references/src/anchors/format.cjs");
|
|
6
|
+
const attachable = require("../references/src/attachable.cjs");
|
|
7
|
+
const lucideReact = require("lucide-react");
|
|
8
|
+
const require$$0 = require("react");
|
|
9
|
+
const threadIdContext = require("../threads/thread-id-context.cjs");
|
|
10
|
+
const attachedReferences = require("./attached-references.cjs");
|
|
11
|
+
const cnfast = require("cnfast");
|
|
12
|
+
const KIND_NAME = {
|
|
13
|
+
asset: "Asset",
|
|
14
|
+
ontology_object: "Object",
|
|
15
|
+
external_url: "Web page"
|
|
16
|
+
};
|
|
17
|
+
function KindIcon({ reference }) {
|
|
18
|
+
const Icon = reference.referenced === "asset" ? lucideReact.FileTextIcon : reference.referenced === "ontology_object" ? lucideReact.BoxIcon : lucideReact.GlobeIcon;
|
|
19
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Icon, { "aria-hidden": "true", className: "size-3 shrink-0 text-muted-foreground" });
|
|
20
|
+
}
|
|
21
|
+
function attachedReferenceChipText(reference) {
|
|
22
|
+
const label = attachable.attachableReferenceLabel(reference);
|
|
23
|
+
if (reference.referenced !== "asset" || !reference.anchor) return label;
|
|
24
|
+
const place = format.formatReferenceAnchor(reference.anchor, "short", reference.meta);
|
|
25
|
+
return place ? `${label} · ${place}` : label;
|
|
26
|
+
}
|
|
27
|
+
function ReferenceChip({
|
|
28
|
+
reference,
|
|
29
|
+
onRemove
|
|
30
|
+
}) {
|
|
31
|
+
const text = attachedReferenceChipText(reference);
|
|
32
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "inline-flex max-w-full items-center gap-1 rounded-md border border-border bg-muted/60 py-0 pr-0.5 pl-1.5 font-medium text-foreground text-xs", children: [
|
|
33
|
+
/* @__PURE__ */ jsxRuntime.jsx(KindIcon, { reference }),
|
|
34
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: cnfast.cn("max-w-48 truncate", !onRemove && "pr-1"), children: [
|
|
35
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "sr-only", children: [
|
|
36
|
+
KIND_NAME[reference.referenced],
|
|
37
|
+
": "
|
|
38
|
+
] }),
|
|
39
|
+
text
|
|
40
|
+
] }),
|
|
41
|
+
onRemove ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
42
|
+
"button",
|
|
43
|
+
{
|
|
44
|
+
type: "button",
|
|
45
|
+
className: "inline-flex size-5 shrink-0 items-center justify-center rounded-sm text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
46
|
+
"aria-label": `Remove ${text}`,
|
|
47
|
+
"data-attached-reference-remove": "",
|
|
48
|
+
onClick: onRemove,
|
|
49
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.XIcon, { "aria-hidden": "true", className: "size-3" })
|
|
50
|
+
}
|
|
51
|
+
) : null
|
|
52
|
+
] });
|
|
53
|
+
}
|
|
54
|
+
const ComposerAttachedReferences = ({
|
|
55
|
+
threadId: threadIdProp,
|
|
56
|
+
onEmptied,
|
|
57
|
+
className
|
|
58
|
+
}) => {
|
|
59
|
+
const providerThreadId = require$$0.useContext(threadIdContext.AthenaStatewireThreadIdContext);
|
|
60
|
+
const threadId = threadIdProp ?? providerThreadId;
|
|
61
|
+
const references = attachedReferences.usePendingAttachedReferences(threadId);
|
|
62
|
+
const listRef = require$$0.useRef(null);
|
|
63
|
+
if (references.length === 0) return null;
|
|
64
|
+
const remove = (reference, index) => {
|
|
65
|
+
attachedReferences.detachReferenceFromThread({ threadId, reference });
|
|
66
|
+
requestAnimationFrame(() => {
|
|
67
|
+
var _a;
|
|
68
|
+
const buttons = (_a = listRef.current) == null ? void 0 : _a.querySelectorAll(
|
|
69
|
+
"button[data-attached-reference-remove]"
|
|
70
|
+
);
|
|
71
|
+
const next = (buttons == null ? void 0 : buttons.length) ? buttons[Math.min(index, buttons.length - 1)] : void 0;
|
|
72
|
+
if (next) next.focus();
|
|
73
|
+
else onEmptied == null ? void 0 : onEmptied();
|
|
74
|
+
});
|
|
75
|
+
};
|
|
76
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
77
|
+
"div",
|
|
78
|
+
{
|
|
79
|
+
className: cnfast.cn("aui-composer-attached-references mx-3 mt-2 flex items-start", className),
|
|
80
|
+
"data-testid": "athena-attached-references",
|
|
81
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
82
|
+
"ul",
|
|
83
|
+
{
|
|
84
|
+
ref: listRef,
|
|
85
|
+
"aria-label": "Attached to this message",
|
|
86
|
+
className: "flex min-w-0 flex-1 flex-wrap gap-1.5",
|
|
87
|
+
children: references.map((reference, index) => {
|
|
88
|
+
const key = attachable.attachableReferenceKey(reference);
|
|
89
|
+
return /* @__PURE__ */ jsxRuntime.jsx("li", { className: "min-w-0", "data-attached-reference": key, children: /* @__PURE__ */ jsxRuntime.jsx(ReferenceChip, { reference, onRemove: () => remove(reference, index) }) }, key);
|
|
90
|
+
})
|
|
91
|
+
}
|
|
92
|
+
)
|
|
93
|
+
}
|
|
94
|
+
);
|
|
95
|
+
};
|
|
96
|
+
const MessageAttachedReferences = ({ className }) => {
|
|
97
|
+
const custom = react.useAuiState((s) => {
|
|
98
|
+
var _a;
|
|
99
|
+
return (_a = s.message.metadata) == null ? void 0 : _a.custom;
|
|
100
|
+
});
|
|
101
|
+
const references = require$$0.useMemo(() => attachable.readAttachedReferences(custom), [custom]);
|
|
102
|
+
if (references.length === 0) return null;
|
|
103
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
104
|
+
"ul",
|
|
105
|
+
{
|
|
106
|
+
"aria-label": "Attached to this message",
|
|
107
|
+
className: cnfast.cn("aui-message-attached-references flex flex-wrap justify-end gap-1.5", className),
|
|
108
|
+
"data-testid": "athena-message-attached-references",
|
|
109
|
+
children: references.map((reference) => {
|
|
110
|
+
const key = attachable.attachableReferenceKey(reference);
|
|
111
|
+
return /* @__PURE__ */ jsxRuntime.jsx("li", { className: "min-w-0", "data-attached-reference": key, children: /* @__PURE__ */ jsxRuntime.jsx(ReferenceChip, { reference }) }, key);
|
|
112
|
+
})
|
|
113
|
+
}
|
|
114
|
+
);
|
|
115
|
+
};
|
|
116
|
+
exports.ComposerAttachedReferences = ComposerAttachedReferences;
|
|
117
|
+
exports.MessageAttachedReferences = MessageAttachedReferences;
|
|
118
|
+
exports.attachedReferenceChipText = attachedReferenceChipText;
|
|
119
|
+
//# sourceMappingURL=ComposerAttachedReferences.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ComposerAttachedReferences.cjs","sources":["../../src/composer/ComposerAttachedReferences.tsx"],"sourcesContent":["import { useAuiState } from '@assistant-ui/react';\nimport { formatReferenceAnchor } from '@athenaintel/references/asset-links';\nimport {\n type AttachableReference,\n attachableReferenceKey,\n attachableReferenceLabel,\n readAttachedReferences as readMessageAttachedReferences,\n} from '@athenaintel/references/attachable';\nimport { BoxIcon, FileTextIcon, GlobeIcon, XIcon } from 'lucide-react';\nimport { type FC, useContext, useMemo, useRef } from 'react';\nimport { cn } from '../lib/utils';\nimport { AthenaStatewireThreadIdContext } from '../threads/thread-id-context';\nimport { detachReferenceFromThread, usePendingAttachedReferences } from './attached-references';\n\nconst KIND_NAME: Record<AttachableReference['referenced'], string> = {\n asset: 'Asset',\n ontology_object: 'Object',\n external_url: 'Web page',\n};\n\nfunction KindIcon({ reference }: { reference: AttachableReference }) {\n const Icon =\n reference.referenced === 'asset'\n ? FileTextIcon\n : reference.referenced === 'ontology_object'\n ? BoxIcon\n : GlobeIcon;\n return <Icon aria-hidden=\"true\" className=\"size-3 shrink-0 text-muted-foreground\" />;\n}\n\n/** What a chip reads: the label, and for an anchored asset the place (`p.5`, `B3:C7`, …). */\nexport function attachedReferenceChipText(reference: AttachableReference): string {\n const label = attachableReferenceLabel(reference);\n if (reference.referenced !== 'asset' || !reference.anchor) return label;\n const place = formatReferenceAnchor(reference.anchor, 'short', reference.meta);\n return place ? `${label} · ${place}` : label;\n}\n\nfunction ReferenceChip({\n reference,\n onRemove,\n}: {\n reference: AttachableReference;\n onRemove?: () => void;\n}) {\n const text = attachedReferenceChipText(reference);\n return (\n <span className=\"inline-flex max-w-full items-center gap-1 rounded-md border border-border bg-muted/60 py-0 pr-0.5 pl-1.5 font-medium text-foreground text-xs\">\n <KindIcon reference={reference} />\n <span className={cn('max-w-48 truncate', !onRemove && 'pr-1')}>\n <span className=\"sr-only\">{KIND_NAME[reference.referenced]}: </span>\n {text}\n </span>\n {onRemove ? (\n <button\n type=\"button\"\n className=\"inline-flex size-5 shrink-0 items-center justify-center rounded-sm text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\"\n aria-label={`Remove ${text}`}\n data-attached-reference-remove=\"\"\n onClick={onRemove}\n >\n <XIcon aria-hidden=\"true\" className=\"size-3\" />\n </button>\n ) : null}\n </span>\n );\n}\n\nexport interface ComposerAttachedReferencesProps {\n /** The conversation whose next message carries the references; defaults to the provider's. */\n threadId?: string;\n /** The last reference was removed: where focus goes next (the editor). */\n onEmptied?: () => void;\n className?: string;\n}\n\n/**\n * The references the next message carries (`useAttachToChat`), as removable chips above the\n * editor: each with its kind's icon, its label (and an anchored asset's place) and a labelled\n * remove button. Renders nothing while none are attached. Removing one hands focus to the chip\n * that took its place, else the one before it, else back to the editor (`onEmptied`).\n */\nexport const ComposerAttachedReferences: FC<ComposerAttachedReferencesProps> = ({\n threadId: threadIdProp,\n onEmptied,\n className,\n}) => {\n const providerThreadId = useContext(AthenaStatewireThreadIdContext);\n const threadId = threadIdProp ?? providerThreadId;\n const references = usePendingAttachedReferences(threadId);\n const listRef = useRef<HTMLUListElement>(null);\n if (references.length === 0) return null;\n\n const remove = (reference: AttachableReference, index: number): void => {\n detachReferenceFromThread({ threadId, reference });\n // After React has painted the row without the chip (or unmounted it).\n requestAnimationFrame(() => {\n const buttons = listRef.current?.querySelectorAll<HTMLButtonElement>(\n 'button[data-attached-reference-remove]',\n );\n const next = buttons?.length ? buttons[Math.min(index, buttons.length - 1)] : undefined;\n if (next) next.focus();\n else onEmptied?.();\n });\n };\n\n return (\n <div\n className={cn('aui-composer-attached-references mx-3 mt-2 flex items-start', className)}\n data-testid=\"athena-attached-references\"\n >\n <ul\n ref={listRef}\n aria-label=\"Attached to this message\"\n className=\"flex min-w-0 flex-1 flex-wrap gap-1.5\"\n >\n {references.map((reference, index) => {\n const key = attachableReferenceKey(reference);\n return (\n <li key={key} className=\"min-w-0\" data-attached-reference={key}>\n <ReferenceChip reference={reference} onRemove={() => remove(reference, index)} />\n </li>\n );\n })}\n </ul>\n </div>\n );\n};\n\n/**\n * The references a sent user message carried (`message.metadata.custom.attachedReferences`, as\n * agora kept them), as read-only chips above its bubble. Renders nothing for a message that\n * attached nothing. Use it inside a message (`MessagePrimitive.Root`).\n */\nexport const MessageAttachedReferences: FC<{ className?: string }> = ({ className }) => {\n const custom = useAuiState((s) => s.message.metadata?.custom);\n const references = useMemo(() => readMessageAttachedReferences(custom), [custom]);\n if (references.length === 0) return null;\n return (\n <ul\n aria-label=\"Attached to this message\"\n className={cn('aui-message-attached-references flex flex-wrap justify-end gap-1.5', className)}\n data-testid=\"athena-message-attached-references\"\n >\n {references.map((reference) => {\n const key = attachableReferenceKey(reference);\n return (\n <li key={key} className=\"min-w-0\" data-attached-reference={key}>\n <ReferenceChip reference={reference} />\n </li>\n );\n })}\n </ul>\n );\n};\n"],"names":["FileTextIcon","BoxIcon","GlobeIcon","jsx","attachableReferenceLabel","formatReferenceAnchor","jsxs","cn","XIcon","useContext","AthenaStatewireThreadIdContext","usePendingAttachedReferences","useRef","detachReferenceFromThread","attachableReferenceKey","useAuiState","useMemo","readMessageAttachedReferences"],"mappings":"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"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type AttachableReference } from '../references/src/attachable';
|
|
2
|
+
import { type FC } from 'react';
|
|
3
|
+
/** What a chip reads: the label, and for an anchored asset the place (`p.5`, `B3:C7`, …). */
|
|
4
|
+
export declare function attachedReferenceChipText(reference: AttachableReference): string;
|
|
5
|
+
export interface ComposerAttachedReferencesProps {
|
|
6
|
+
/** The conversation whose next message carries the references; defaults to the provider's. */
|
|
7
|
+
threadId?: string;
|
|
8
|
+
/** The last reference was removed: where focus goes next (the editor). */
|
|
9
|
+
onEmptied?: () => void;
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* The references the next message carries (`useAttachToChat`), as removable chips above the
|
|
14
|
+
* editor: each with its kind's icon, its label (and an anchored asset's place) and a labelled
|
|
15
|
+
* remove button. Renders nothing while none are attached. Removing one hands focus to the chip
|
|
16
|
+
* that took its place, else the one before it, else back to the editor (`onEmptied`).
|
|
17
|
+
*/
|
|
18
|
+
export declare const ComposerAttachedReferences: FC<ComposerAttachedReferencesProps>;
|
|
19
|
+
/**
|
|
20
|
+
* The references a sent user message carried (`message.metadata.custom.attachedReferences`, as
|
|
21
|
+
* agora kept them), as read-only chips above its bubble. Renders nothing for a message that
|
|
22
|
+
* attached nothing. Use it inside a message (`MessagePrimitive.Root`).
|
|
23
|
+
*/
|
|
24
|
+
export declare const MessageAttachedReferences: FC<{
|
|
25
|
+
className?: string;
|
|
26
|
+
}>;
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useAuiState } from "@assistant-ui/react";
|
|
3
|
+
import { formatReferenceAnchor } from "../references/src/anchors/format.js";
|
|
4
|
+
import { attachableReferenceKey, readAttachedReferences, attachableReferenceLabel } from "../references/src/attachable.js";
|
|
5
|
+
import { XIcon, FileTextIcon, BoxIcon, GlobeIcon } from "lucide-react";
|
|
6
|
+
import { useContext, useRef, useMemo } from "react";
|
|
7
|
+
import { AthenaStatewireThreadIdContext } from "../threads/thread-id-context.js";
|
|
8
|
+
import { usePendingAttachedReferences, detachReferenceFromThread } from "./attached-references.js";
|
|
9
|
+
import { cn } from "cnfast";
|
|
10
|
+
const KIND_NAME = {
|
|
11
|
+
asset: "Asset",
|
|
12
|
+
ontology_object: "Object",
|
|
13
|
+
external_url: "Web page"
|
|
14
|
+
};
|
|
15
|
+
function KindIcon({ reference }) {
|
|
16
|
+
const Icon = reference.referenced === "asset" ? FileTextIcon : reference.referenced === "ontology_object" ? BoxIcon : GlobeIcon;
|
|
17
|
+
return /* @__PURE__ */ jsx(Icon, { "aria-hidden": "true", className: "size-3 shrink-0 text-muted-foreground" });
|
|
18
|
+
}
|
|
19
|
+
function attachedReferenceChipText(reference) {
|
|
20
|
+
const label = attachableReferenceLabel(reference);
|
|
21
|
+
if (reference.referenced !== "asset" || !reference.anchor) return label;
|
|
22
|
+
const place = formatReferenceAnchor(reference.anchor, "short", reference.meta);
|
|
23
|
+
return place ? `${label} · ${place}` : label;
|
|
24
|
+
}
|
|
25
|
+
function ReferenceChip({
|
|
26
|
+
reference,
|
|
27
|
+
onRemove
|
|
28
|
+
}) {
|
|
29
|
+
const text = attachedReferenceChipText(reference);
|
|
30
|
+
return /* @__PURE__ */ jsxs("span", { className: "inline-flex max-w-full items-center gap-1 rounded-md border border-border bg-muted/60 py-0 pr-0.5 pl-1.5 font-medium text-foreground text-xs", children: [
|
|
31
|
+
/* @__PURE__ */ jsx(KindIcon, { reference }),
|
|
32
|
+
/* @__PURE__ */ jsxs("span", { className: cn("max-w-48 truncate", !onRemove && "pr-1"), children: [
|
|
33
|
+
/* @__PURE__ */ jsxs("span", { className: "sr-only", children: [
|
|
34
|
+
KIND_NAME[reference.referenced],
|
|
35
|
+
": "
|
|
36
|
+
] }),
|
|
37
|
+
text
|
|
38
|
+
] }),
|
|
39
|
+
onRemove ? /* @__PURE__ */ jsx(
|
|
40
|
+
"button",
|
|
41
|
+
{
|
|
42
|
+
type: "button",
|
|
43
|
+
className: "inline-flex size-5 shrink-0 items-center justify-center rounded-sm text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
44
|
+
"aria-label": `Remove ${text}`,
|
|
45
|
+
"data-attached-reference-remove": "",
|
|
46
|
+
onClick: onRemove,
|
|
47
|
+
children: /* @__PURE__ */ jsx(XIcon, { "aria-hidden": "true", className: "size-3" })
|
|
48
|
+
}
|
|
49
|
+
) : null
|
|
50
|
+
] });
|
|
51
|
+
}
|
|
52
|
+
const ComposerAttachedReferences = ({
|
|
53
|
+
threadId: threadIdProp,
|
|
54
|
+
onEmptied,
|
|
55
|
+
className
|
|
56
|
+
}) => {
|
|
57
|
+
const providerThreadId = useContext(AthenaStatewireThreadIdContext);
|
|
58
|
+
const threadId = threadIdProp ?? providerThreadId;
|
|
59
|
+
const references = usePendingAttachedReferences(threadId);
|
|
60
|
+
const listRef = useRef(null);
|
|
61
|
+
if (references.length === 0) return null;
|
|
62
|
+
const remove = (reference, index) => {
|
|
63
|
+
detachReferenceFromThread({ threadId, reference });
|
|
64
|
+
requestAnimationFrame(() => {
|
|
65
|
+
var _a;
|
|
66
|
+
const buttons = (_a = listRef.current) == null ? void 0 : _a.querySelectorAll(
|
|
67
|
+
"button[data-attached-reference-remove]"
|
|
68
|
+
);
|
|
69
|
+
const next = (buttons == null ? void 0 : buttons.length) ? buttons[Math.min(index, buttons.length - 1)] : void 0;
|
|
70
|
+
if (next) next.focus();
|
|
71
|
+
else onEmptied == null ? void 0 : onEmptied();
|
|
72
|
+
});
|
|
73
|
+
};
|
|
74
|
+
return /* @__PURE__ */ jsx(
|
|
75
|
+
"div",
|
|
76
|
+
{
|
|
77
|
+
className: cn("aui-composer-attached-references mx-3 mt-2 flex items-start", className),
|
|
78
|
+
"data-testid": "athena-attached-references",
|
|
79
|
+
children: /* @__PURE__ */ jsx(
|
|
80
|
+
"ul",
|
|
81
|
+
{
|
|
82
|
+
ref: listRef,
|
|
83
|
+
"aria-label": "Attached to this message",
|
|
84
|
+
className: "flex min-w-0 flex-1 flex-wrap gap-1.5",
|
|
85
|
+
children: references.map((reference, index) => {
|
|
86
|
+
const key = attachableReferenceKey(reference);
|
|
87
|
+
return /* @__PURE__ */ jsx("li", { className: "min-w-0", "data-attached-reference": key, children: /* @__PURE__ */ jsx(ReferenceChip, { reference, onRemove: () => remove(reference, index) }) }, key);
|
|
88
|
+
})
|
|
89
|
+
}
|
|
90
|
+
)
|
|
91
|
+
}
|
|
92
|
+
);
|
|
93
|
+
};
|
|
94
|
+
const MessageAttachedReferences = ({ className }) => {
|
|
95
|
+
const custom = useAuiState((s) => {
|
|
96
|
+
var _a;
|
|
97
|
+
return (_a = s.message.metadata) == null ? void 0 : _a.custom;
|
|
98
|
+
});
|
|
99
|
+
const references = useMemo(() => readAttachedReferences(custom), [custom]);
|
|
100
|
+
if (references.length === 0) return null;
|
|
101
|
+
return /* @__PURE__ */ jsx(
|
|
102
|
+
"ul",
|
|
103
|
+
{
|
|
104
|
+
"aria-label": "Attached to this message",
|
|
105
|
+
className: cn("aui-message-attached-references flex flex-wrap justify-end gap-1.5", className),
|
|
106
|
+
"data-testid": "athena-message-attached-references",
|
|
107
|
+
children: references.map((reference) => {
|
|
108
|
+
const key = attachableReferenceKey(reference);
|
|
109
|
+
return /* @__PURE__ */ jsx("li", { className: "min-w-0", "data-attached-reference": key, children: /* @__PURE__ */ jsx(ReferenceChip, { reference }) }, key);
|
|
110
|
+
})
|
|
111
|
+
}
|
|
112
|
+
);
|
|
113
|
+
};
|
|
114
|
+
export {
|
|
115
|
+
ComposerAttachedReferences,
|
|
116
|
+
MessageAttachedReferences,
|
|
117
|
+
attachedReferenceChipText
|
|
118
|
+
};
|
|
119
|
+
//# sourceMappingURL=ComposerAttachedReferences.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ComposerAttachedReferences.js","sources":["../../src/composer/ComposerAttachedReferences.tsx"],"sourcesContent":["import { useAuiState } from '@assistant-ui/react';\nimport { formatReferenceAnchor } from '@athenaintel/references/asset-links';\nimport {\n type AttachableReference,\n attachableReferenceKey,\n attachableReferenceLabel,\n readAttachedReferences as readMessageAttachedReferences,\n} from '@athenaintel/references/attachable';\nimport { BoxIcon, FileTextIcon, GlobeIcon, XIcon } from 'lucide-react';\nimport { type FC, useContext, useMemo, useRef } from 'react';\nimport { cn } from '../lib/utils';\nimport { AthenaStatewireThreadIdContext } from '../threads/thread-id-context';\nimport { detachReferenceFromThread, usePendingAttachedReferences } from './attached-references';\n\nconst KIND_NAME: Record<AttachableReference['referenced'], string> = {\n asset: 'Asset',\n ontology_object: 'Object',\n external_url: 'Web page',\n};\n\nfunction KindIcon({ reference }: { reference: AttachableReference }) {\n const Icon =\n reference.referenced === 'asset'\n ? FileTextIcon\n : reference.referenced === 'ontology_object'\n ? BoxIcon\n : GlobeIcon;\n return <Icon aria-hidden=\"true\" className=\"size-3 shrink-0 text-muted-foreground\" />;\n}\n\n/** What a chip reads: the label, and for an anchored asset the place (`p.5`, `B3:C7`, …). */\nexport function attachedReferenceChipText(reference: AttachableReference): string {\n const label = attachableReferenceLabel(reference);\n if (reference.referenced !== 'asset' || !reference.anchor) return label;\n const place = formatReferenceAnchor(reference.anchor, 'short', reference.meta);\n return place ? `${label} · ${place}` : label;\n}\n\nfunction ReferenceChip({\n reference,\n onRemove,\n}: {\n reference: AttachableReference;\n onRemove?: () => void;\n}) {\n const text = attachedReferenceChipText(reference);\n return (\n <span className=\"inline-flex max-w-full items-center gap-1 rounded-md border border-border bg-muted/60 py-0 pr-0.5 pl-1.5 font-medium text-foreground text-xs\">\n <KindIcon reference={reference} />\n <span className={cn('max-w-48 truncate', !onRemove && 'pr-1')}>\n <span className=\"sr-only\">{KIND_NAME[reference.referenced]}: </span>\n {text}\n </span>\n {onRemove ? (\n <button\n type=\"button\"\n className=\"inline-flex size-5 shrink-0 items-center justify-center rounded-sm text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\"\n aria-label={`Remove ${text}`}\n data-attached-reference-remove=\"\"\n onClick={onRemove}\n >\n <XIcon aria-hidden=\"true\" className=\"size-3\" />\n </button>\n ) : null}\n </span>\n );\n}\n\nexport interface ComposerAttachedReferencesProps {\n /** The conversation whose next message carries the references; defaults to the provider's. */\n threadId?: string;\n /** The last reference was removed: where focus goes next (the editor). */\n onEmptied?: () => void;\n className?: string;\n}\n\n/**\n * The references the next message carries (`useAttachToChat`), as removable chips above the\n * editor: each with its kind's icon, its label (and an anchored asset's place) and a labelled\n * remove button. Renders nothing while none are attached. Removing one hands focus to the chip\n * that took its place, else the one before it, else back to the editor (`onEmptied`).\n */\nexport const ComposerAttachedReferences: FC<ComposerAttachedReferencesProps> = ({\n threadId: threadIdProp,\n onEmptied,\n className,\n}) => {\n const providerThreadId = useContext(AthenaStatewireThreadIdContext);\n const threadId = threadIdProp ?? providerThreadId;\n const references = usePendingAttachedReferences(threadId);\n const listRef = useRef<HTMLUListElement>(null);\n if (references.length === 0) return null;\n\n const remove = (reference: AttachableReference, index: number): void => {\n detachReferenceFromThread({ threadId, reference });\n // After React has painted the row without the chip (or unmounted it).\n requestAnimationFrame(() => {\n const buttons = listRef.current?.querySelectorAll<HTMLButtonElement>(\n 'button[data-attached-reference-remove]',\n );\n const next = buttons?.length ? buttons[Math.min(index, buttons.length - 1)] : undefined;\n if (next) next.focus();\n else onEmptied?.();\n });\n };\n\n return (\n <div\n className={cn('aui-composer-attached-references mx-3 mt-2 flex items-start', className)}\n data-testid=\"athena-attached-references\"\n >\n <ul\n ref={listRef}\n aria-label=\"Attached to this message\"\n className=\"flex min-w-0 flex-1 flex-wrap gap-1.5\"\n >\n {references.map((reference, index) => {\n const key = attachableReferenceKey(reference);\n return (\n <li key={key} className=\"min-w-0\" data-attached-reference={key}>\n <ReferenceChip reference={reference} onRemove={() => remove(reference, index)} />\n </li>\n );\n })}\n </ul>\n </div>\n );\n};\n\n/**\n * The references a sent user message carried (`message.metadata.custom.attachedReferences`, as\n * agora kept them), as read-only chips above its bubble. Renders nothing for a message that\n * attached nothing. Use it inside a message (`MessagePrimitive.Root`).\n */\nexport const MessageAttachedReferences: FC<{ className?: string }> = ({ className }) => {\n const custom = useAuiState((s) => s.message.metadata?.custom);\n const references = useMemo(() => readMessageAttachedReferences(custom), [custom]);\n if (references.length === 0) return null;\n return (\n <ul\n aria-label=\"Attached to this message\"\n className={cn('aui-message-attached-references flex flex-wrap justify-end gap-1.5', className)}\n data-testid=\"athena-message-attached-references\"\n >\n {references.map((reference) => {\n const key = attachableReferenceKey(reference);\n return (\n <li key={key} className=\"min-w-0\" data-attached-reference={key}>\n <ReferenceChip reference={reference} />\n </li>\n );\n })}\n </ul>\n );\n};\n"],"names":["readMessageAttachedReferences"],"mappings":"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"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
+
const namedAgents = require("../agent-runtime/src/named-agents.cjs");
|
|
5
|
+
const lucideReact = require("lucide-react");
|
|
6
|
+
const require$$0 = require("react");
|
|
7
|
+
const cnfast = require("cnfast");
|
|
8
|
+
const ComposerNamedAgents = ({
|
|
9
|
+
threadId,
|
|
10
|
+
onEmptied,
|
|
11
|
+
className
|
|
12
|
+
}) => {
|
|
13
|
+
const agents = namedAgents.useDeepAgentNamedAgents(threadId);
|
|
14
|
+
const listRef = require$$0.useRef(null);
|
|
15
|
+
if (agents.length === 0) return null;
|
|
16
|
+
const remove = (agent, index) => {
|
|
17
|
+
namedAgents.removeDeepAgentNamedAgent({ threadId, ref: agent.ref });
|
|
18
|
+
requestAnimationFrame(() => {
|
|
19
|
+
var _a;
|
|
20
|
+
const buttons = (_a = listRef.current) == null ? void 0 : _a.querySelectorAll(
|
|
21
|
+
"button[data-named-agent-remove]"
|
|
22
|
+
);
|
|
23
|
+
const next = (buttons == null ? void 0 : buttons.length) ? buttons[Math.min(index, buttons.length - 1)] : void 0;
|
|
24
|
+
if (next) next.focus();
|
|
25
|
+
else onEmptied == null ? void 0 : onEmptied();
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
29
|
+
"div",
|
|
30
|
+
{
|
|
31
|
+
className: cnfast.cn("aui-composer-named-agents mx-3 mt-2 flex items-start gap-2", className),
|
|
32
|
+
"data-testid": "athena-named-agents",
|
|
33
|
+
children: [
|
|
34
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": "true", className: "py-0.5 text-muted-foreground text-xs", children: "To" }),
|
|
35
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
36
|
+
"ul",
|
|
37
|
+
{
|
|
38
|
+
ref: listRef,
|
|
39
|
+
"aria-label": "Agents this message goes to",
|
|
40
|
+
className: "flex min-w-0 flex-1 flex-wrap gap-1.5",
|
|
41
|
+
children: agents.map((agent, index) => /* @__PURE__ */ jsxRuntime.jsx("li", { className: "min-w-0", "data-named-agent": agent.ref, children: /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "inline-flex max-w-full items-center gap-1 rounded-md border border-border bg-muted/60 py-0 pr-0.5 pl-1.5 font-medium text-foreground text-xs", children: [
|
|
42
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.BotIcon, { "aria-hidden": "true", className: "size-3 shrink-0 text-muted-foreground" }),
|
|
43
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "max-w-48 truncate", children: agent.name }),
|
|
44
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
45
|
+
"button",
|
|
46
|
+
{
|
|
47
|
+
type: "button",
|
|
48
|
+
className: "inline-flex size-5 shrink-0 items-center justify-center rounded-sm text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
49
|
+
"aria-label": `Remove ${agent.name}`,
|
|
50
|
+
"data-named-agent-remove": "",
|
|
51
|
+
onClick: () => remove(agent, index),
|
|
52
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.XIcon, { "aria-hidden": "true", className: "size-3" })
|
|
53
|
+
}
|
|
54
|
+
)
|
|
55
|
+
] }) }, agent.ref))
|
|
56
|
+
}
|
|
57
|
+
)
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
);
|
|
61
|
+
};
|
|
62
|
+
exports.ComposerNamedAgents = ComposerNamedAgents;
|
|
63
|
+
//# sourceMappingURL=ComposerNamedAgents.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ComposerNamedAgents.cjs","sources":["../../src/composer/ComposerNamedAgents.tsx"],"sourcesContent":["import {\n type DeepAgentNamedAgent,\n removeDeepAgentNamedAgent,\n useDeepAgentNamedAgents,\n} from '@athenaintel/agent-runtime/named-agents';\nimport { BotIcon, XIcon } from 'lucide-react';\nimport { type FC, useRef } from 'react';\nimport { cn } from '../lib/utils';\n\nexport interface ComposerNamedAgentsProps {\n /** The conversation whose next message the chips name agents for. */\n threadId: string;\n /** The last named agent was removed: where focus goes next (the editor). */\n onEmptied?: () => void;\n className?: string;\n}\n\n/**\n * The composer's To line (identity v7 D13), as Olympus's composer shows it: the agents the person\n * named from the `@` menu's Agents section, in the order named, each answering the message in its\n * own turn and each with a labelled remove button. They stay for every message until the person\n * changes them. Renders nothing while none are named. Removing an agent hands focus to the chip that\n * took its place, else the one before it, else back to the editor (`onEmptied`).\n */\nexport const ComposerNamedAgents: FC<ComposerNamedAgentsProps> = ({\n threadId,\n onEmptied,\n className,\n}) => {\n const agents = useDeepAgentNamedAgents(threadId);\n const listRef = useRef<HTMLUListElement>(null);\n if (agents.length === 0) return null;\n\n const remove = (agent: DeepAgentNamedAgent, index: number): void => {\n removeDeepAgentNamedAgent({ threadId, ref: agent.ref });\n // After React has painted the row without the chip (or unmounted it).\n requestAnimationFrame(() => {\n const buttons = listRef.current?.querySelectorAll<HTMLButtonElement>(\n 'button[data-named-agent-remove]',\n );\n const next = buttons?.length ? buttons[Math.min(index, buttons.length - 1)] : undefined;\n if (next) next.focus();\n else onEmptied?.();\n });\n };\n\n return (\n <div\n className={cn('aui-composer-named-agents mx-3 mt-2 flex items-start gap-2', className)}\n data-testid=\"athena-named-agents\"\n >\n <span aria-hidden=\"true\" className=\"py-0.5 text-muted-foreground text-xs\">\n To\n </span>\n <ul\n ref={listRef}\n aria-label=\"Agents this message goes to\"\n className=\"flex min-w-0 flex-1 flex-wrap gap-1.5\"\n >\n {agents.map((agent, index) => (\n <li key={agent.ref} className=\"min-w-0\" data-named-agent={agent.ref}>\n <span className=\"inline-flex max-w-full items-center gap-1 rounded-md border border-border bg-muted/60 py-0 pr-0.5 pl-1.5 font-medium text-foreground text-xs\">\n <BotIcon aria-hidden=\"true\" className=\"size-3 shrink-0 text-muted-foreground\" />\n <span className=\"max-w-48 truncate\">{agent.name}</span>\n <button\n type=\"button\"\n className=\"inline-flex size-5 shrink-0 items-center justify-center rounded-sm text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\"\n aria-label={`Remove ${agent.name}`}\n data-named-agent-remove=\"\"\n onClick={() => remove(agent, index)}\n >\n <XIcon aria-hidden=\"true\" className=\"size-3\" />\n </button>\n </span>\n </li>\n ))}\n </ul>\n </div>\n );\n};\n"],"names":["useDeepAgentNamedAgents","useRef","removeDeepAgentNamedAgent","jsxs","cn","jsx","BotIcon","XIcon"],"mappings":";;;;;;;AAwBO,MAAM,sBAAoD,CAAC;AAAA,EAChE;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,QAAM,SAASA,YAAAA,wBAAwB,QAAQ;AAC/C,QAAM,UAAUC,WAAAA,OAAyB,IAAI;AAC7C,MAAI,OAAO,WAAW,EAAG,QAAO;AAEhC,QAAM,SAAS,CAAC,OAA4B,UAAwB;AAClEC,gBAAAA,0BAA0B,EAAE,UAAU,KAAK,MAAM,KAAK;AAEtD,0BAAsB,MAAM;;AAC1B,YAAM,WAAU,aAAQ,YAAR,mBAAiB;AAAA,QAC/B;AAAA;AAEF,YAAM,QAAO,mCAAS,UAAS,QAAQ,KAAK,IAAI,OAAO,QAAQ,SAAS,CAAC,CAAC,IAAI;AAC9E,UAAI,WAAW,MAAA;AAAA,UACV;AAAA,IACP,CAAC;AAAA,EACH;AAEA,SACEC,2BAAAA;AAAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC,OAAAA,GAAG,8DAA8D,SAAS;AAAA,MACrF,eAAY;AAAA,MAEZ,UAAA;AAAA,QAAAC,+BAAC,QAAA,EAAK,eAAY,QAAO,WAAU,wCAAuC,UAAA,MAE1E;AAAA,QACAA,2BAAAA;AAAAA,UAAC;AAAA,UAAA;AAAA,YACC,KAAK;AAAA,YACL,cAAW;AAAA,YACX,WAAU;AAAA,YAET,UAAA,OAAO,IAAI,CAAC,OAAO,UAClBA,2BAAAA,IAAC,MAAA,EAAmB,WAAU,WAAU,oBAAkB,MAAM,KAC9D,UAAAF,2BAAAA,KAAC,QAAA,EAAK,WAAU,gJACd,UAAA;AAAA,cAAAE,2BAAAA,IAACC,YAAAA,SAAA,EAAQ,eAAY,QAAO,WAAU,yCAAwC;AAAA,cAC9ED,2BAAAA,IAAC,QAAA,EAAK,WAAU,qBAAqB,gBAAM,MAAK;AAAA,cAChDA,2BAAAA;AAAAA,gBAAC;AAAA,gBAAA;AAAA,kBACC,MAAK;AAAA,kBACL,WAAU;AAAA,kBACV,cAAY,UAAU,MAAM,IAAI;AAAA,kBAChC,2BAAwB;AAAA,kBACxB,SAAS,MAAM,OAAO,OAAO,KAAK;AAAA,kBAElC,UAAAA,2BAAAA,IAACE,mBAAA,EAAM,eAAY,QAAO,WAAU,SAAA,CAAS;AAAA,gBAAA;AAAA,cAAA;AAAA,YAC/C,GACF,EAAA,GAbO,MAAM,GAcf,CACD;AAAA,UAAA;AAAA,QAAA;AAAA,MACH;AAAA,IAAA;AAAA,EAAA;AAGN;;"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type FC } from 'react';
|
|
2
|
+
export interface ComposerNamedAgentsProps {
|
|
3
|
+
/** The conversation whose next message the chips name agents for. */
|
|
4
|
+
threadId: string;
|
|
5
|
+
/** The last named agent was removed: where focus goes next (the editor). */
|
|
6
|
+
onEmptied?: () => void;
|
|
7
|
+
className?: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* The composer's To line (identity v7 D13), as Olympus's composer shows it: the agents the person
|
|
11
|
+
* named from the `@` menu's Agents section, in the order named, each answering the message in its
|
|
12
|
+
* own turn and each with a labelled remove button. They stay for every message until the person
|
|
13
|
+
* changes them. Renders nothing while none are named. Removing an agent hands focus to the chip that
|
|
14
|
+
* took its place, else the one before it, else back to the editor (`onEmptied`).
|
|
15
|
+
*/
|
|
16
|
+
export declare const ComposerNamedAgents: FC<ComposerNamedAgentsProps>;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useDeepAgentNamedAgents, removeDeepAgentNamedAgent } from "../agent-runtime/src/named-agents.js";
|
|
3
|
+
import { BotIcon, XIcon } from "lucide-react";
|
|
4
|
+
import { useRef } from "react";
|
|
5
|
+
import { cn } from "cnfast";
|
|
6
|
+
const ComposerNamedAgents = ({
|
|
7
|
+
threadId,
|
|
8
|
+
onEmptied,
|
|
9
|
+
className
|
|
10
|
+
}) => {
|
|
11
|
+
const agents = useDeepAgentNamedAgents(threadId);
|
|
12
|
+
const listRef = useRef(null);
|
|
13
|
+
if (agents.length === 0) return null;
|
|
14
|
+
const remove = (agent, index) => {
|
|
15
|
+
removeDeepAgentNamedAgent({ threadId, ref: agent.ref });
|
|
16
|
+
requestAnimationFrame(() => {
|
|
17
|
+
var _a;
|
|
18
|
+
const buttons = (_a = listRef.current) == null ? void 0 : _a.querySelectorAll(
|
|
19
|
+
"button[data-named-agent-remove]"
|
|
20
|
+
);
|
|
21
|
+
const next = (buttons == null ? void 0 : buttons.length) ? buttons[Math.min(index, buttons.length - 1)] : void 0;
|
|
22
|
+
if (next) next.focus();
|
|
23
|
+
else onEmptied == null ? void 0 : onEmptied();
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
return /* @__PURE__ */ jsxs(
|
|
27
|
+
"div",
|
|
28
|
+
{
|
|
29
|
+
className: cn("aui-composer-named-agents mx-3 mt-2 flex items-start gap-2", className),
|
|
30
|
+
"data-testid": "athena-named-agents",
|
|
31
|
+
children: [
|
|
32
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: "py-0.5 text-muted-foreground text-xs", children: "To" }),
|
|
33
|
+
/* @__PURE__ */ jsx(
|
|
34
|
+
"ul",
|
|
35
|
+
{
|
|
36
|
+
ref: listRef,
|
|
37
|
+
"aria-label": "Agents this message goes to",
|
|
38
|
+
className: "flex min-w-0 flex-1 flex-wrap gap-1.5",
|
|
39
|
+
children: agents.map((agent, index) => /* @__PURE__ */ jsx("li", { className: "min-w-0", "data-named-agent": agent.ref, children: /* @__PURE__ */ jsxs("span", { className: "inline-flex max-w-full items-center gap-1 rounded-md border border-border bg-muted/60 py-0 pr-0.5 pl-1.5 font-medium text-foreground text-xs", children: [
|
|
40
|
+
/* @__PURE__ */ jsx(BotIcon, { "aria-hidden": "true", className: "size-3 shrink-0 text-muted-foreground" }),
|
|
41
|
+
/* @__PURE__ */ jsx("span", { className: "max-w-48 truncate", children: agent.name }),
|
|
42
|
+
/* @__PURE__ */ jsx(
|
|
43
|
+
"button",
|
|
44
|
+
{
|
|
45
|
+
type: "button",
|
|
46
|
+
className: "inline-flex size-5 shrink-0 items-center justify-center rounded-sm text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
47
|
+
"aria-label": `Remove ${agent.name}`,
|
|
48
|
+
"data-named-agent-remove": "",
|
|
49
|
+
onClick: () => remove(agent, index),
|
|
50
|
+
children: /* @__PURE__ */ jsx(XIcon, { "aria-hidden": "true", className: "size-3" })
|
|
51
|
+
}
|
|
52
|
+
)
|
|
53
|
+
] }) }, agent.ref))
|
|
54
|
+
}
|
|
55
|
+
)
|
|
56
|
+
]
|
|
57
|
+
}
|
|
58
|
+
);
|
|
59
|
+
};
|
|
60
|
+
export {
|
|
61
|
+
ComposerNamedAgents
|
|
62
|
+
};
|
|
63
|
+
//# sourceMappingURL=ComposerNamedAgents.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ComposerNamedAgents.js","sources":["../../src/composer/ComposerNamedAgents.tsx"],"sourcesContent":["import {\n type DeepAgentNamedAgent,\n removeDeepAgentNamedAgent,\n useDeepAgentNamedAgents,\n} from '@athenaintel/agent-runtime/named-agents';\nimport { BotIcon, XIcon } from 'lucide-react';\nimport { type FC, useRef } from 'react';\nimport { cn } from '../lib/utils';\n\nexport interface ComposerNamedAgentsProps {\n /** The conversation whose next message the chips name agents for. */\n threadId: string;\n /** The last named agent was removed: where focus goes next (the editor). */\n onEmptied?: () => void;\n className?: string;\n}\n\n/**\n * The composer's To line (identity v7 D13), as Olympus's composer shows it: the agents the person\n * named from the `@` menu's Agents section, in the order named, each answering the message in its\n * own turn and each with a labelled remove button. They stay for every message until the person\n * changes them. Renders nothing while none are named. Removing an agent hands focus to the chip that\n * took its place, else the one before it, else back to the editor (`onEmptied`).\n */\nexport const ComposerNamedAgents: FC<ComposerNamedAgentsProps> = ({\n threadId,\n onEmptied,\n className,\n}) => {\n const agents = useDeepAgentNamedAgents(threadId);\n const listRef = useRef<HTMLUListElement>(null);\n if (agents.length === 0) return null;\n\n const remove = (agent: DeepAgentNamedAgent, index: number): void => {\n removeDeepAgentNamedAgent({ threadId, ref: agent.ref });\n // After React has painted the row without the chip (or unmounted it).\n requestAnimationFrame(() => {\n const buttons = listRef.current?.querySelectorAll<HTMLButtonElement>(\n 'button[data-named-agent-remove]',\n );\n const next = buttons?.length ? buttons[Math.min(index, buttons.length - 1)] : undefined;\n if (next) next.focus();\n else onEmptied?.();\n });\n };\n\n return (\n <div\n className={cn('aui-composer-named-agents mx-3 mt-2 flex items-start gap-2', className)}\n data-testid=\"athena-named-agents\"\n >\n <span aria-hidden=\"true\" className=\"py-0.5 text-muted-foreground text-xs\">\n To\n </span>\n <ul\n ref={listRef}\n aria-label=\"Agents this message goes to\"\n className=\"flex min-w-0 flex-1 flex-wrap gap-1.5\"\n >\n {agents.map((agent, index) => (\n <li key={agent.ref} className=\"min-w-0\" data-named-agent={agent.ref}>\n <span className=\"inline-flex max-w-full items-center gap-1 rounded-md border border-border bg-muted/60 py-0 pr-0.5 pl-1.5 font-medium text-foreground text-xs\">\n <BotIcon aria-hidden=\"true\" className=\"size-3 shrink-0 text-muted-foreground\" />\n <span className=\"max-w-48 truncate\">{agent.name}</span>\n <button\n type=\"button\"\n className=\"inline-flex size-5 shrink-0 items-center justify-center rounded-sm text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\"\n aria-label={`Remove ${agent.name}`}\n data-named-agent-remove=\"\"\n onClick={() => remove(agent, index)}\n >\n <XIcon aria-hidden=\"true\" className=\"size-3\" />\n </button>\n </span>\n </li>\n ))}\n </ul>\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;AAwBO,MAAM,sBAAoD,CAAC;AAAA,EAChE;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,QAAM,SAAS,wBAAwB,QAAQ;AAC/C,QAAM,UAAU,OAAyB,IAAI;AAC7C,MAAI,OAAO,WAAW,EAAG,QAAO;AAEhC,QAAM,SAAS,CAAC,OAA4B,UAAwB;AAClE,8BAA0B,EAAE,UAAU,KAAK,MAAM,KAAK;AAEtD,0BAAsB,MAAM;;AAC1B,YAAM,WAAU,aAAQ,YAAR,mBAAiB;AAAA,QAC/B;AAAA;AAEF,YAAM,QAAO,mCAAS,UAAS,QAAQ,KAAK,IAAI,OAAO,QAAQ,SAAS,CAAC,CAAC,IAAI;AAC9E,UAAI,WAAW,MAAA;AAAA,UACV;AAAA,IACP,CAAC;AAAA,EACH;AAEA,SACE;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAW,GAAG,8DAA8D,SAAS;AAAA,MACrF,eAAY;AAAA,MAEZ,UAAA;AAAA,QAAA,oBAAC,QAAA,EAAK,eAAY,QAAO,WAAU,wCAAuC,UAAA,MAE1E;AAAA,QACA;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,KAAK;AAAA,YACL,cAAW;AAAA,YACX,WAAU;AAAA,YAET,UAAA,OAAO,IAAI,CAAC,OAAO,UAClB,oBAAC,MAAA,EAAmB,WAAU,WAAU,oBAAkB,MAAM,KAC9D,UAAA,qBAAC,QAAA,EAAK,WAAU,gJACd,UAAA;AAAA,cAAA,oBAAC,SAAA,EAAQ,eAAY,QAAO,WAAU,yCAAwC;AAAA,cAC9E,oBAAC,QAAA,EAAK,WAAU,qBAAqB,gBAAM,MAAK;AAAA,cAChD;AAAA,gBAAC;AAAA,gBAAA;AAAA,kBACC,MAAK;AAAA,kBACL,WAAU;AAAA,kBACV,cAAY,UAAU,MAAM,IAAI;AAAA,kBAChC,2BAAwB;AAAA,kBACxB,SAAS,MAAM,OAAO,OAAO,KAAK;AAAA,kBAElC,UAAA,oBAAC,OAAA,EAAM,eAAY,QAAO,WAAU,SAAA,CAAS;AAAA,gBAAA;AAAA,cAAA;AAAA,YAC/C,GACF,EAAA,GAbO,MAAM,GAcf,CACD;AAAA,UAAA;AAAA,QAAA;AAAA,MACH;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const attachable = require("../references/src/attachable.cjs");
|
|
4
|
+
const require$$0 = require("react");
|
|
5
|
+
const EMPTY = Object.freeze([]);
|
|
6
|
+
const pending = /* @__PURE__ */ new Map();
|
|
7
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
8
|
+
let attachedForIdentity = null;
|
|
9
|
+
function notify() {
|
|
10
|
+
for (const listener of [...listeners]) listener();
|
|
11
|
+
}
|
|
12
|
+
function subscribe(listener) {
|
|
13
|
+
listeners.add(listener);
|
|
14
|
+
return () => {
|
|
15
|
+
listeners.delete(listener);
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
function setPending(threadId, references) {
|
|
19
|
+
if (references.length === 0) pending.delete(threadId);
|
|
20
|
+
else pending.set(threadId, Object.freeze([...references]));
|
|
21
|
+
notify();
|
|
22
|
+
}
|
|
23
|
+
function attachReferenceToThread({
|
|
24
|
+
threadId,
|
|
25
|
+
reference
|
|
26
|
+
}) {
|
|
27
|
+
if (!threadId) return { attached: false, reason: "no_thread" };
|
|
28
|
+
const normalized = attachable.normalizeAttachableReference(reference);
|
|
29
|
+
if (normalized === null) return { attached: false, reason: "invalid_reference" };
|
|
30
|
+
const key = attachable.attachableReferenceKey(normalized);
|
|
31
|
+
const current = pending.get(threadId) ?? EMPTY;
|
|
32
|
+
const index = current.findIndex((entry) => attachable.attachableReferenceKey(entry) === key);
|
|
33
|
+
if (index >= 0) {
|
|
34
|
+
setPending(
|
|
35
|
+
threadId,
|
|
36
|
+
current.map((entry, position) => position === index ? normalized : entry)
|
|
37
|
+
);
|
|
38
|
+
return { attached: true, reference: normalized, duplicate: true };
|
|
39
|
+
}
|
|
40
|
+
if (current.length >= attachable.MAX_ATTACHED_REFERENCES) return { attached: false, reason: "too_many" };
|
|
41
|
+
setPending(threadId, [...current, normalized]);
|
|
42
|
+
return { attached: true, reference: normalized, duplicate: false };
|
|
43
|
+
}
|
|
44
|
+
function detachReferenceFromThread({
|
|
45
|
+
threadId,
|
|
46
|
+
reference
|
|
47
|
+
}) {
|
|
48
|
+
if (!threadId) return;
|
|
49
|
+
const current = pending.get(threadId);
|
|
50
|
+
if (!current) return;
|
|
51
|
+
const key = attachable.attachableReferenceKey(reference);
|
|
52
|
+
const kept = current.filter((entry) => attachable.attachableReferenceKey(entry) !== key);
|
|
53
|
+
if (kept.length !== current.length) setPending(threadId, kept);
|
|
54
|
+
}
|
|
55
|
+
function clearAttachedReferences(threadId) {
|
|
56
|
+
if (!threadId || !pending.has(threadId)) return;
|
|
57
|
+
setPending(threadId, EMPTY);
|
|
58
|
+
}
|
|
59
|
+
function readPendingAttachedReferences(threadId) {
|
|
60
|
+
return (threadId ? pending.get(threadId) : void 0) ?? EMPTY;
|
|
61
|
+
}
|
|
62
|
+
function usePendingAttachedReferences(threadId) {
|
|
63
|
+
const read = require$$0.useCallback(() => readPendingAttachedReferences(threadId), [threadId]);
|
|
64
|
+
return require$$0.useSyncExternalStore(subscribe, read, read);
|
|
65
|
+
}
|
|
66
|
+
function forgetAllAttachedReferences() {
|
|
67
|
+
pending.clear();
|
|
68
|
+
stagedForSend.clear();
|
|
69
|
+
sentWithText.clear();
|
|
70
|
+
notify();
|
|
71
|
+
}
|
|
72
|
+
function keepAttachedReferencesForIdentity(identity) {
|
|
73
|
+
if (attachedForIdentity !== null && attachedForIdentity !== identity) {
|
|
74
|
+
forgetAllAttachedReferences();
|
|
75
|
+
}
|
|
76
|
+
attachedForIdentity = identity;
|
|
77
|
+
}
|
|
78
|
+
const ATTACHED_REFERENCES_STAGED_TTL_MS = 1e4;
|
|
79
|
+
const stagedForSend = /* @__PURE__ */ new Map();
|
|
80
|
+
function stageAttachedReferencesForSend({
|
|
81
|
+
threadId,
|
|
82
|
+
references
|
|
83
|
+
}) {
|
|
84
|
+
if (!threadId) return;
|
|
85
|
+
if (references.length === 0) {
|
|
86
|
+
stagedForSend.delete(threadId);
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
stagedForSend.set(threadId, { references, stagedAt: Date.now() });
|
|
90
|
+
}
|
|
91
|
+
function takeStagedAttachedReferences(threadId) {
|
|
92
|
+
const staged = stagedForSend.get(threadId);
|
|
93
|
+
stagedForSend.delete(threadId);
|
|
94
|
+
if (!staged || Date.now() - staged.stagedAt > ATTACHED_REFERENCES_STAGED_TTL_MS) return EMPTY;
|
|
95
|
+
return staged.references;
|
|
96
|
+
}
|
|
97
|
+
function withStagedAttachedReferences(threadId, metadata) {
|
|
98
|
+
const references = takeStagedAttachedReferences(threadId);
|
|
99
|
+
return references.length === 0 ? metadata : attachable.withAttachedReferences(metadata, references);
|
|
100
|
+
}
|
|
101
|
+
const SENT_TEXTS_KEPT_PER_THREAD = 20;
|
|
102
|
+
const THREADS_WITH_SENT_TEXTS_KEPT = 50;
|
|
103
|
+
const sentWithText = /* @__PURE__ */ new Map();
|
|
104
|
+
function setBounded(map, key, value, limit) {
|
|
105
|
+
map.delete(key);
|
|
106
|
+
map.set(key, value);
|
|
107
|
+
while (map.size > limit) {
|
|
108
|
+
const oldest = map.keys().next();
|
|
109
|
+
if (oldest.done) break;
|
|
110
|
+
map.delete(oldest.value);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
function stageThreadAttachedReferencesForSend({
|
|
114
|
+
threadId,
|
|
115
|
+
text
|
|
116
|
+
}) {
|
|
117
|
+
const references = readPendingAttachedReferences(threadId);
|
|
118
|
+
stageAttachedReferencesForSend({ threadId, references });
|
|
119
|
+
if (!threadId) return references;
|
|
120
|
+
const texts = sentWithText.get(threadId);
|
|
121
|
+
if (references.length === 0) {
|
|
122
|
+
texts == null ? void 0 : texts.delete(text);
|
|
123
|
+
return references;
|
|
124
|
+
}
|
|
125
|
+
const kept = texts ?? /* @__PURE__ */ new Map();
|
|
126
|
+
setBounded(kept, text, references, SENT_TEXTS_KEPT_PER_THREAD);
|
|
127
|
+
setBounded(sentWithText, threadId, kept, THREADS_WITH_SENT_TEXTS_KEPT);
|
|
128
|
+
clearAttachedReferences(threadId);
|
|
129
|
+
return references;
|
|
130
|
+
}
|
|
131
|
+
function reattach(threadId, references) {
|
|
132
|
+
for (const reference of references) attachReferenceToThread({ threadId, reference });
|
|
133
|
+
}
|
|
134
|
+
function restoreSentAttachedReferences({
|
|
135
|
+
threadId,
|
|
136
|
+
text
|
|
137
|
+
}) {
|
|
138
|
+
var _a;
|
|
139
|
+
const references = (_a = sentWithText.get(threadId)) == null ? void 0 : _a.get(text);
|
|
140
|
+
if (references) reattach(threadId, references);
|
|
141
|
+
}
|
|
142
|
+
function giveBackHeldAttachedReferences(entry) {
|
|
143
|
+
reattach(entry.threadId, attachable.readAttachedReferences(entry.metadata));
|
|
144
|
+
}
|
|
145
|
+
exports.ATTACHED_REFERENCES_STAGED_TTL_MS = ATTACHED_REFERENCES_STAGED_TTL_MS;
|
|
146
|
+
exports.attachReferenceToThread = attachReferenceToThread;
|
|
147
|
+
exports.clearAttachedReferences = clearAttachedReferences;
|
|
148
|
+
exports.detachReferenceFromThread = detachReferenceFromThread;
|
|
149
|
+
exports.forgetAllAttachedReferences = forgetAllAttachedReferences;
|
|
150
|
+
exports.giveBackHeldAttachedReferences = giveBackHeldAttachedReferences;
|
|
151
|
+
exports.keepAttachedReferencesForIdentity = keepAttachedReferencesForIdentity;
|
|
152
|
+
exports.readPendingAttachedReferences = readPendingAttachedReferences;
|
|
153
|
+
exports.restoreSentAttachedReferences = restoreSentAttachedReferences;
|
|
154
|
+
exports.stageAttachedReferencesForSend = stageAttachedReferencesForSend;
|
|
155
|
+
exports.stageThreadAttachedReferencesForSend = stageThreadAttachedReferencesForSend;
|
|
156
|
+
exports.takeStagedAttachedReferences = takeStagedAttachedReferences;
|
|
157
|
+
exports.usePendingAttachedReferences = usePendingAttachedReferences;
|
|
158
|
+
exports.withStagedAttachedReferences = withStagedAttachedReferences;
|
|
159
|
+
//# sourceMappingURL=attached-references.cjs.map
|