@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.cjs","sources":["../../../../../src/chat-ui/mentions/suggestions/data/types.ts"],"sourcesContent":["/**\n * Core types for mention suggestions data layer\n */\n\n/**\n * MenuScope - A navigable container in the mention menu hierarchy\n *\n * Conceptual model:\n * - SCOPE = Container/Group you navigate INTO (e.g., \"athena_assets\", \"folder_123\")\n * - ITEM = Individual mentionable thing you SELECT (e.g., specific asset, tool)\n *\n * Scopes form a navigation hierarchy:\n * root → athena_assets → folder_123 → subfolder_456\n *\n * Items can be visible in multiple scopes simultaneously:\n * Asset \"Report.pdf\" is in both \"folder_123\" AND \"asset_search\" results\n */\nexport type MenuScope = string;\n\nexport const MentionMenuSection = {\n CURRENT_WEBPAGE: \"current-webpage\",\n OTHER_WEBPAGES: \"other-webpages\",\n LIBRARY: \"library\",\n} as const;\n\nexport type MentionMenuSection =\n (typeof MentionMenuSection)[keyof typeof MentionMenuSection];\n\nexport interface WebpageMention {\n tabId: number;\n title: string;\n url: string;\n isCurrent: boolean;\n}\n\nexport interface WebpageMentionScope {\n primaryTabId: number;\n tabGroupId: number | null;\n allowedTabIds: readonly number[];\n}\n\n/**\n * Selector result - provides current state + loading indicators\n * Used by the UI to get immediate access to data and loading state\n */\nexport interface MenuItemsSelector {\n items: MenuItem[];\n isFetching: boolean;\n hasMore: boolean;\n}\n\n/**\n * MenuItem - individual mentionable item\n * Icon fields match MentionIcon component props exactly - no transforms needed at render time!\n *\n * Multi-scope system: Items can belong to multiple scopes simultaneously\n * Example: An asset can be visible in 'athena_assets', 'folder_123', and 'my_spaces'\n */\nexport interface MenuItem {\n id: string;\n name: string;\n type:\n | 'menu'\n | 'asset'\n | 'folder'\n | 'tool'\n | 'toolkit'\n | 'drive'\n | 'user'\n | 'task'\n | 'tab'\n | 'workspace_item'\n | 'drive_catalog'\n | 'placeholder';\n\n // Icon fields (match MentionIcon component props)\n thumbnailUrl?: string; // For assets: URL/path to thumbnail (e.g., from AthenaTypeToThumb)\n fallbackIcon: string; // For menus/tools: Lucide icon name (e.g., 'Folder', 'Wrench') or emoji\n\n // Multi-scope membership: Which menu scopes this item is visible in\n // Items can belong to multiple scopes simultaneously\n visibleInScopes: Set<MenuScope>; // e.g., Set(['athena_assets', 'folder_123', 'my_spaces'])\n\n // Navigation capability: If present, this item can be navigated into\n // When user selects this item, navigate to this scope\n navigatesToScope?: MenuScope;\n\n // Navigation-only flag: If true, item CANNOT be inserted as mention (only navigate)\n // Use for root categories that are pure navigation containers\n isNavigationOnly?: boolean; // Default: false (most items are mentionable)\n\n // Type-specific metadata\n extra?: Record<string, any>;\n description?: string;\n url?: string;\n menuSection?: MentionMenuSection;\n updatedAt?: string;\n email?: string; // For user type\n version?: string; // For versioned assets\n\n // Legacy compatibility\n parentMenuId?: string;\n}\n\n/**\n * FetchState - fetch status and pagination state for a specific query\n * Managed by orchestrator, not returned by sources\n */\nexport interface FetchState {\n isFetching: boolean;\n hasNextPage: boolean;\n fetchNext: (() => void) | null;\n error: Error | null; // Track errors to prevent infinite retry loops\n\n // Source-specific pagination metadata (offset, cursor, page token, etc.)\n // Each source stores what IT needs between calls\n // Orchestrator doesn't care what's in here!\n meta: unknown;\n}\n\n/**\n * FetchMetadata - Common metadata fields used by orchestrator\n * Sources can extend this with their own fields (e.g., pageToken, cursor)\n */\nexport interface FetchMetadata {\n // Orchestrator fields\n validatedCount?: number; // Number of items fetched and validated so far\n fetchAttempts?: number; // Number of fetch attempts (for safety limits)\n // Source-specific fields can be added via extension or intersection\n [key: string]: unknown;\n}\n\n/**\n * New source to register dynamically\n * Returned by sources when they discover navigable items (folders, catalogs, etc.)\n */\nexport interface SourceToRegister {\n scope: MenuScope; // The scope ID to register\n sourceFn: SourceFn; // The source function to use for this scope\n sourceConfig?: any; // Configuration for the source\n isFlat?: boolean; // Whether this scope should be flat (no navigation arrows)\n}\n\n/**\n * Scope binding to register dynamically\n * Binds a browse scope to a search scope (hot scope swap on query)\n */\nexport interface ScopeBindingToRegister {\n browseScope: MenuScope; // The scope shown when browsing (no query)\n searchScope: MenuScope; // The scope shown when searching (has query)\n}\n\n/**\n * Source result - returned by all source functions\n *\n * Sources come in two flavors:\n * 1. TRANSFORMERS - Transform existing data (no API calls)\n * Examples: tools, toolkits, workspace members, opened spaces\n * Pattern: Read from store/ref → transform → return items\n *\n * 2. FETCHERS - Fetch from API (async operations)\n * Examples: internal assets, folders, SharePoint items\n * Pattern: Call GraphQL/REST → transform response → return items\n *\n * 3. HYBRID - Behavior depends on query\n * Example: Root menu (transformer when no query, fetcher with query)\n *\n * Original design: Sources can return new sources to register!\n * This allows discovered items (folders, catalogs) to be dynamically registered\n * without circular dependencies (orchestrator handles registration centrally)\n */\nexport interface SourceResult {\n // Items to add/update (source sets navigatesToScope on navigable items)\n // Orchestrator will tag these items with the current scope\n items: MenuItem[];\n\n // Pagination metadata (what we learned from this fetch)\n // All sources return this - orchestrator uses it\n pagination?: {\n hasMore: boolean;\n totalCount?: number;\n // Rows the source consumed from the server for this page. Defaults to\n // `items.length`; sources that drop rows after fetching must report the\n // pre-filter count so the next offset does not re-read the same rows.\n consumedCount?: number;\n };\n\n // Source-specific metadata (e.g., pageToken for SharePoint, cursor for pagination)\n // Orchestrator merges this into fetchState.meta for the next fetch\n meta?: Record<string, unknown>;\n\n // New sources to register (for discovered navigable items)\n // Orchestrator will register these in the registry\n sources?: SourceToRegister[];\n\n // New bindings to register (for hot scope swap on query)\n // Example: catalogId → catalogId_search\n bindings?: ScopeBindingToRegister[];\n}\n\n/**\n * Source function context\n *\n * Sources are pure functions - just fetch/transform and return items!\n * Orchestrator handles sync/deduplication via Cache.addItems() with scope tagging\n */\nexport interface SourceContext<TConfig = any> {\n scope: MenuScope; // Current scope we're fetching for\n query: string; // User's search query\n fetchState: FetchState; // Pagination state for this query (includes source-specific meta)\n sourceConfig: TConfig; // Source configuration (can include getters for reactive data!)\n}\n\n/**\n * Source function type\n *\n * Pure function that provides items for a scope + query combination.\n * Can be a transformer (reads from store) or fetcher (calls API).\n * State (pagination, sourceConfig) is stored externally in registry entry.\n */\nexport type SourceFn<TConfig = any> = (context: SourceContext<TConfig>) => Promise<SourceResult>;\n\n/**\n * A host-provided candidate for the Tools / Toolkits categories. A host that\n * hands the composer a list of these replaces the server tool catalog for\n * those categories with its own (AthenaChat offers the toolkits its provider\n * enabled, or whatever the host passes through `mentionTools`).\n */\nexport interface MentionTool {\n id: string;\n name: string;\n description?: string;\n /** Lucide icon name (`Package`, `Wrench`, …) or an emoji. */\n icon?: string;\n type: 'tool' | 'toolkit';\n}\n"],"names":[],"mappings":";;AAmBO,MAAM,qBAAqB;AAAA,EAChC,iBAAiB;AAAA,EACjB,gBAAgB;AAAA,EAChB,SAAS;AACX;;"}
|
|
1
|
+
{"version":3,"file":"types.cjs","sources":["../../../../../src/chat-ui/mentions/suggestions/data/types.ts"],"sourcesContent":["/**\n * Core types for mention suggestions data layer\n */\n\n/**\n * MenuScope - A navigable container in the mention menu hierarchy\n *\n * Conceptual model:\n * - SCOPE = Container/Group you navigate INTO (e.g., \"athena_assets\", \"folder_123\")\n * - ITEM = Individual mentionable thing you SELECT (e.g., specific asset, tool)\n *\n * Scopes form a navigation hierarchy:\n * root → athena_assets → folder_123 → subfolder_456\n *\n * Items can be visible in multiple scopes simultaneously:\n * Asset \"Report.pdf\" is in both \"folder_123\" AND \"asset_search\" results\n */\nexport type MenuScope = string;\n\nexport const MentionMenuSection = {\n CURRENT_WEBPAGE: \"current-webpage\",\n OTHER_WEBPAGES: \"other-webpages\",\n LIBRARY: \"library\",\n} as const;\n\nexport type MentionMenuSection =\n (typeof MentionMenuSection)[keyof typeof MentionMenuSection];\n\nexport interface WebpageMention {\n tabId: number;\n title: string;\n url: string;\n isCurrent: boolean;\n}\n\nexport interface WebpageMentionScope {\n primaryTabId: number;\n tabGroupId: number | null;\n allowedTabIds: readonly number[];\n}\n\n/**\n * Selector result - provides current state + loading indicators\n * Used by the UI to get immediate access to data and loading state\n */\nexport interface MenuItemsSelector {\n items: MenuItem[];\n isFetching: boolean;\n hasMore: boolean;\n}\n\n/**\n * MenuItem - individual mentionable item\n * Icon fields match MentionIcon component props exactly - no transforms needed at render time!\n *\n * Multi-scope system: Items can belong to multiple scopes simultaneously\n * Example: An asset can be visible in 'athena_assets', 'folder_123', and 'my_spaces'\n */\nexport interface MenuItem {\n id: string;\n name: string;\n type:\n | 'menu'\n | 'asset'\n | 'folder'\n | 'tool'\n | 'toolkit'\n | 'drive'\n | 'user'\n | 'group'\n | 'agent'\n | 'task'\n | 'tab'\n | 'workspace_item'\n | 'drive_catalog'\n | 'placeholder';\n\n // Icon fields (match MentionIcon component props)\n thumbnailUrl?: string; // For assets: URL/path to thumbnail (e.g., from AthenaTypeToThumb)\n fallbackIcon: string; // For menus/tools: Lucide icon name (e.g., 'Folder', 'Wrench') or emoji\n\n // Multi-scope membership: Which menu scopes this item is visible in\n // Items can belong to multiple scopes simultaneously\n visibleInScopes: Set<MenuScope>; // e.g., Set(['athena_assets', 'folder_123', 'my_spaces'])\n\n // Navigation capability: If present, this item can be navigated into\n // When user selects this item, navigate to this scope\n navigatesToScope?: MenuScope;\n\n // Navigation-only flag: If true, item CANNOT be inserted as mention (only navigate)\n // Use for root categories that are pure navigation containers\n isNavigationOnly?: boolean; // Default: false (most items are mentionable)\n\n // Type-specific metadata\n extra?: Record<string, any>;\n description?: string;\n url?: string;\n menuSection?: MentionMenuSection;\n updatedAt?: string;\n email?: string; // For user type\n version?: string; // For versioned assets\n\n // Legacy compatibility\n parentMenuId?: string;\n}\n\n/**\n * FetchState - fetch status and pagination state for a specific query\n * Managed by orchestrator, not returned by sources\n */\nexport interface FetchState {\n isFetching: boolean;\n hasNextPage: boolean;\n fetchNext: (() => void) | null;\n error: Error | null; // Track errors to prevent infinite retry loops\n\n // Source-specific pagination metadata (offset, cursor, page token, etc.)\n // Each source stores what IT needs between calls\n // Orchestrator doesn't care what's in here!\n meta: unknown;\n}\n\n/**\n * FetchMetadata - Common metadata fields used by orchestrator\n * Sources can extend this with their own fields (e.g., pageToken, cursor)\n */\nexport interface FetchMetadata {\n // Orchestrator fields\n validatedCount?: number; // Number of items fetched and validated so far\n fetchAttempts?: number; // Number of fetch attempts (for safety limits)\n // Source-specific fields can be added via extension or intersection\n [key: string]: unknown;\n}\n\n/**\n * New source to register dynamically\n * Returned by sources when they discover navigable items (folders, catalogs, etc.)\n */\nexport interface SourceToRegister {\n scope: MenuScope; // The scope ID to register\n sourceFn: SourceFn; // The source function to use for this scope\n sourceConfig?: any; // Configuration for the source\n isFlat?: boolean; // Whether this scope should be flat (no navigation arrows)\n}\n\n/**\n * Scope binding to register dynamically\n * Binds a browse scope to a search scope (hot scope swap on query)\n */\nexport interface ScopeBindingToRegister {\n browseScope: MenuScope; // The scope shown when browsing (no query)\n searchScope: MenuScope; // The scope shown when searching (has query)\n}\n\n/**\n * Source result - returned by all source functions\n *\n * Sources come in two flavors:\n * 1. TRANSFORMERS - Transform existing data (no API calls)\n * Examples: tools, toolkits, workspace members, opened spaces\n * Pattern: Read from store/ref → transform → return items\n *\n * 2. FETCHERS - Fetch from API (async operations)\n * Examples: internal assets, folders, SharePoint items\n * Pattern: Call GraphQL/REST → transform response → return items\n *\n * 3. HYBRID - Behavior depends on query\n * Example: Root menu (transformer when no query, fetcher with query)\n *\n * Original design: Sources can return new sources to register!\n * This allows discovered items (folders, catalogs) to be dynamically registered\n * without circular dependencies (orchestrator handles registration centrally)\n */\nexport interface SourceResult {\n // Items to add/update (source sets navigatesToScope on navigable items)\n // Orchestrator will tag these items with the current scope\n items: MenuItem[];\n\n // Pagination metadata (what we learned from this fetch)\n // All sources return this - orchestrator uses it\n pagination?: {\n hasMore: boolean;\n totalCount?: number;\n // Rows the source consumed from the server for this page. Defaults to\n // `items.length`; sources that drop rows after fetching must report the\n // pre-filter count so the next offset does not re-read the same rows.\n consumedCount?: number;\n };\n\n // Source-specific metadata (e.g., pageToken for SharePoint, cursor for pagination)\n // Orchestrator merges this into fetchState.meta for the next fetch\n meta?: Record<string, unknown>;\n\n // New sources to register (for discovered navigable items)\n // Orchestrator will register these in the registry\n sources?: SourceToRegister[];\n\n // New bindings to register (for hot scope swap on query)\n // Example: catalogId → catalogId_search\n bindings?: ScopeBindingToRegister[];\n}\n\n/**\n * Source function context\n *\n * Sources are pure functions - just fetch/transform and return items!\n * Orchestrator handles sync/deduplication via Cache.addItems() with scope tagging\n */\nexport interface SourceContext<TConfig = any> {\n scope: MenuScope; // Current scope we're fetching for\n query: string; // User's search query\n fetchState: FetchState; // Pagination state for this query (includes source-specific meta)\n sourceConfig: TConfig; // Source configuration (can include getters for reactive data!)\n}\n\n/**\n * Source function type\n *\n * Pure function that provides items for a scope + query combination.\n * Can be a transformer (reads from store) or fetcher (calls API).\n * State (pagination, sourceConfig) is stored externally in registry entry.\n */\nexport type SourceFn<TConfig = any> = (context: SourceContext<TConfig>) => Promise<SourceResult>;\n\n/**\n * An agent a chat message can name (identity v7 D13), as the `@` menu's Agents section offers it:\n * choosing one names it for the message (a chip on the composer's To line) and never writes a\n * mention into the text. `ref` is what the send names (`collab_agent:<asset id>`, or `assistant`\n * for the person's own assistant).\n */\nexport interface MentionChatAgent {\n ref: string;\n name: string;\n /** The collab agent asset behind `ref`; `null` for the person's own assistant. */\n assetId: string | null;\n /** A Lucide icon name for the menu row. */\n icon: string;\n}\n\n/**\n * What a composer that names agents hands its `@` menu (`TiptapComposer`'s `chatAgents`): the\n * agents offered now, naming what is chosen, and a way to hear the offer change.\n */\nexport interface MentionChatAgents {\n /** The agents the Agents section offers now (none once eight are named). */\n getAgents: () => readonly MentionChatAgent[];\n /** Name `agents` for the message, in the order chosen. */\n nameAgents: (agents: readonly MentionChatAgent[]) => void;\n /** Called whenever {@link MentionChatAgents.getAgents} would answer differently. */\n subscribe: (listener: () => void) => () => void;\n}\n\n/**\n * A host-provided candidate for the Tools / Toolkits categories. A host that\n * hands the composer a list of these replaces the server tool catalog for\n * those categories with its own (AthenaChat offers the toolkits its provider\n * enabled, or whatever the host passes through `mentionTools`).\n */\nexport interface MentionTool {\n id: string;\n name: string;\n description?: string;\n /** Lucide icon name (`Package`, `Wrench`, …) or an emoji. */\n icon?: string;\n type: 'tool' | 'toolkit';\n}\n"],"names":[],"mappings":";;AAmBO,MAAM,qBAAqB;AAAA,EAChC,iBAAiB;AAAA,EACjB,gBAAgB;AAAA,EAChB,SAAS;AACX;;"}
|
|
@@ -51,7 +51,7 @@ export interface MenuItemsSelector {
|
|
|
51
51
|
export interface MenuItem {
|
|
52
52
|
id: string;
|
|
53
53
|
name: string;
|
|
54
|
-
type: 'menu' | 'asset' | 'folder' | 'tool' | 'toolkit' | 'drive' | 'user' | 'task' | 'tab' | 'workspace_item' | 'drive_catalog' | 'placeholder';
|
|
54
|
+
type: 'menu' | 'asset' | 'folder' | 'tool' | 'toolkit' | 'drive' | 'user' | 'group' | 'agent' | 'task' | 'tab' | 'workspace_item' | 'drive_catalog' | 'placeholder';
|
|
55
55
|
thumbnailUrl?: string;
|
|
56
56
|
fallbackIcon: string;
|
|
57
57
|
visibleInScopes: Set<MenuScope>;
|
|
@@ -154,6 +154,32 @@ export interface SourceContext<TConfig = any> {
|
|
|
154
154
|
* State (pagination, sourceConfig) is stored externally in registry entry.
|
|
155
155
|
*/
|
|
156
156
|
export type SourceFn<TConfig = any> = (context: SourceContext<TConfig>) => Promise<SourceResult>;
|
|
157
|
+
/**
|
|
158
|
+
* An agent a chat message can name (identity v7 D13), as the `@` menu's Agents section offers it:
|
|
159
|
+
* choosing one names it for the message (a chip on the composer's To line) and never writes a
|
|
160
|
+
* mention into the text. `ref` is what the send names (`collab_agent:<asset id>`, or `assistant`
|
|
161
|
+
* for the person's own assistant).
|
|
162
|
+
*/
|
|
163
|
+
export interface MentionChatAgent {
|
|
164
|
+
ref: string;
|
|
165
|
+
name: string;
|
|
166
|
+
/** The collab agent asset behind `ref`; `null` for the person's own assistant. */
|
|
167
|
+
assetId: string | null;
|
|
168
|
+
/** A Lucide icon name for the menu row. */
|
|
169
|
+
icon: string;
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* What a composer that names agents hands its `@` menu (`TiptapComposer`'s `chatAgents`): the
|
|
173
|
+
* agents offered now, naming what is chosen, and a way to hear the offer change.
|
|
174
|
+
*/
|
|
175
|
+
export interface MentionChatAgents {
|
|
176
|
+
/** The agents the Agents section offers now (none once eight are named). */
|
|
177
|
+
getAgents: () => readonly MentionChatAgent[];
|
|
178
|
+
/** Name `agents` for the message, in the order chosen. */
|
|
179
|
+
nameAgents: (agents: readonly MentionChatAgent[]) => void;
|
|
180
|
+
/** Called whenever {@link MentionChatAgents.getAgents} would answer differently. */
|
|
181
|
+
subscribe: (listener: () => void) => () => void;
|
|
182
|
+
}
|
|
157
183
|
/**
|
|
158
184
|
* A host-provided candidate for the Tools / Toolkits categories. A host that
|
|
159
185
|
* hands the composer a list of these replaces the server tool catalog for
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sources":["../../../../../src/chat-ui/mentions/suggestions/data/types.ts"],"sourcesContent":["/**\n * Core types for mention suggestions data layer\n */\n\n/**\n * MenuScope - A navigable container in the mention menu hierarchy\n *\n * Conceptual model:\n * - SCOPE = Container/Group you navigate INTO (e.g., \"athena_assets\", \"folder_123\")\n * - ITEM = Individual mentionable thing you SELECT (e.g., specific asset, tool)\n *\n * Scopes form a navigation hierarchy:\n * root → athena_assets → folder_123 → subfolder_456\n *\n * Items can be visible in multiple scopes simultaneously:\n * Asset \"Report.pdf\" is in both \"folder_123\" AND \"asset_search\" results\n */\nexport type MenuScope = string;\n\nexport const MentionMenuSection = {\n CURRENT_WEBPAGE: \"current-webpage\",\n OTHER_WEBPAGES: \"other-webpages\",\n LIBRARY: \"library\",\n} as const;\n\nexport type MentionMenuSection =\n (typeof MentionMenuSection)[keyof typeof MentionMenuSection];\n\nexport interface WebpageMention {\n tabId: number;\n title: string;\n url: string;\n isCurrent: boolean;\n}\n\nexport interface WebpageMentionScope {\n primaryTabId: number;\n tabGroupId: number | null;\n allowedTabIds: readonly number[];\n}\n\n/**\n * Selector result - provides current state + loading indicators\n * Used by the UI to get immediate access to data and loading state\n */\nexport interface MenuItemsSelector {\n items: MenuItem[];\n isFetching: boolean;\n hasMore: boolean;\n}\n\n/**\n * MenuItem - individual mentionable item\n * Icon fields match MentionIcon component props exactly - no transforms needed at render time!\n *\n * Multi-scope system: Items can belong to multiple scopes simultaneously\n * Example: An asset can be visible in 'athena_assets', 'folder_123', and 'my_spaces'\n */\nexport interface MenuItem {\n id: string;\n name: string;\n type:\n | 'menu'\n | 'asset'\n | 'folder'\n | 'tool'\n | 'toolkit'\n | 'drive'\n | 'user'\n | 'task'\n | 'tab'\n | 'workspace_item'\n | 'drive_catalog'\n | 'placeholder';\n\n // Icon fields (match MentionIcon component props)\n thumbnailUrl?: string; // For assets: URL/path to thumbnail (e.g., from AthenaTypeToThumb)\n fallbackIcon: string; // For menus/tools: Lucide icon name (e.g., 'Folder', 'Wrench') or emoji\n\n // Multi-scope membership: Which menu scopes this item is visible in\n // Items can belong to multiple scopes simultaneously\n visibleInScopes: Set<MenuScope>; // e.g., Set(['athena_assets', 'folder_123', 'my_spaces'])\n\n // Navigation capability: If present, this item can be navigated into\n // When user selects this item, navigate to this scope\n navigatesToScope?: MenuScope;\n\n // Navigation-only flag: If true, item CANNOT be inserted as mention (only navigate)\n // Use for root categories that are pure navigation containers\n isNavigationOnly?: boolean; // Default: false (most items are mentionable)\n\n // Type-specific metadata\n extra?: Record<string, any>;\n description?: string;\n url?: string;\n menuSection?: MentionMenuSection;\n updatedAt?: string;\n email?: string; // For user type\n version?: string; // For versioned assets\n\n // Legacy compatibility\n parentMenuId?: string;\n}\n\n/**\n * FetchState - fetch status and pagination state for a specific query\n * Managed by orchestrator, not returned by sources\n */\nexport interface FetchState {\n isFetching: boolean;\n hasNextPage: boolean;\n fetchNext: (() => void) | null;\n error: Error | null; // Track errors to prevent infinite retry loops\n\n // Source-specific pagination metadata (offset, cursor, page token, etc.)\n // Each source stores what IT needs between calls\n // Orchestrator doesn't care what's in here!\n meta: unknown;\n}\n\n/**\n * FetchMetadata - Common metadata fields used by orchestrator\n * Sources can extend this with their own fields (e.g., pageToken, cursor)\n */\nexport interface FetchMetadata {\n // Orchestrator fields\n validatedCount?: number; // Number of items fetched and validated so far\n fetchAttempts?: number; // Number of fetch attempts (for safety limits)\n // Source-specific fields can be added via extension or intersection\n [key: string]: unknown;\n}\n\n/**\n * New source to register dynamically\n * Returned by sources when they discover navigable items (folders, catalogs, etc.)\n */\nexport interface SourceToRegister {\n scope: MenuScope; // The scope ID to register\n sourceFn: SourceFn; // The source function to use for this scope\n sourceConfig?: any; // Configuration for the source\n isFlat?: boolean; // Whether this scope should be flat (no navigation arrows)\n}\n\n/**\n * Scope binding to register dynamically\n * Binds a browse scope to a search scope (hot scope swap on query)\n */\nexport interface ScopeBindingToRegister {\n browseScope: MenuScope; // The scope shown when browsing (no query)\n searchScope: MenuScope; // The scope shown when searching (has query)\n}\n\n/**\n * Source result - returned by all source functions\n *\n * Sources come in two flavors:\n * 1. TRANSFORMERS - Transform existing data (no API calls)\n * Examples: tools, toolkits, workspace members, opened spaces\n * Pattern: Read from store/ref → transform → return items\n *\n * 2. FETCHERS - Fetch from API (async operations)\n * Examples: internal assets, folders, SharePoint items\n * Pattern: Call GraphQL/REST → transform response → return items\n *\n * 3. HYBRID - Behavior depends on query\n * Example: Root menu (transformer when no query, fetcher with query)\n *\n * Original design: Sources can return new sources to register!\n * This allows discovered items (folders, catalogs) to be dynamically registered\n * without circular dependencies (orchestrator handles registration centrally)\n */\nexport interface SourceResult {\n // Items to add/update (source sets navigatesToScope on navigable items)\n // Orchestrator will tag these items with the current scope\n items: MenuItem[];\n\n // Pagination metadata (what we learned from this fetch)\n // All sources return this - orchestrator uses it\n pagination?: {\n hasMore: boolean;\n totalCount?: number;\n // Rows the source consumed from the server for this page. Defaults to\n // `items.length`; sources that drop rows after fetching must report the\n // pre-filter count so the next offset does not re-read the same rows.\n consumedCount?: number;\n };\n\n // Source-specific metadata (e.g., pageToken for SharePoint, cursor for pagination)\n // Orchestrator merges this into fetchState.meta for the next fetch\n meta?: Record<string, unknown>;\n\n // New sources to register (for discovered navigable items)\n // Orchestrator will register these in the registry\n sources?: SourceToRegister[];\n\n // New bindings to register (for hot scope swap on query)\n // Example: catalogId → catalogId_search\n bindings?: ScopeBindingToRegister[];\n}\n\n/**\n * Source function context\n *\n * Sources are pure functions - just fetch/transform and return items!\n * Orchestrator handles sync/deduplication via Cache.addItems() with scope tagging\n */\nexport interface SourceContext<TConfig = any> {\n scope: MenuScope; // Current scope we're fetching for\n query: string; // User's search query\n fetchState: FetchState; // Pagination state for this query (includes source-specific meta)\n sourceConfig: TConfig; // Source configuration (can include getters for reactive data!)\n}\n\n/**\n * Source function type\n *\n * Pure function that provides items for a scope + query combination.\n * Can be a transformer (reads from store) or fetcher (calls API).\n * State (pagination, sourceConfig) is stored externally in registry entry.\n */\nexport type SourceFn<TConfig = any> = (context: SourceContext<TConfig>) => Promise<SourceResult>;\n\n/**\n * A host-provided candidate for the Tools / Toolkits categories. A host that\n * hands the composer a list of these replaces the server tool catalog for\n * those categories with its own (AthenaChat offers the toolkits its provider\n * enabled, or whatever the host passes through `mentionTools`).\n */\nexport interface MentionTool {\n id: string;\n name: string;\n description?: string;\n /** Lucide icon name (`Package`, `Wrench`, …) or an emoji. */\n icon?: string;\n type: 'tool' | 'toolkit';\n}\n"],"names":[],"mappings":"AAmBO,MAAM,qBAAqB;AAAA,EAChC,iBAAiB;AAAA,EACjB,gBAAgB;AAAA,EAChB,SAAS;AACX;"}
|
|
1
|
+
{"version":3,"file":"types.js","sources":["../../../../../src/chat-ui/mentions/suggestions/data/types.ts"],"sourcesContent":["/**\n * Core types for mention suggestions data layer\n */\n\n/**\n * MenuScope - A navigable container in the mention menu hierarchy\n *\n * Conceptual model:\n * - SCOPE = Container/Group you navigate INTO (e.g., \"athena_assets\", \"folder_123\")\n * - ITEM = Individual mentionable thing you SELECT (e.g., specific asset, tool)\n *\n * Scopes form a navigation hierarchy:\n * root → athena_assets → folder_123 → subfolder_456\n *\n * Items can be visible in multiple scopes simultaneously:\n * Asset \"Report.pdf\" is in both \"folder_123\" AND \"asset_search\" results\n */\nexport type MenuScope = string;\n\nexport const MentionMenuSection = {\n CURRENT_WEBPAGE: \"current-webpage\",\n OTHER_WEBPAGES: \"other-webpages\",\n LIBRARY: \"library\",\n} as const;\n\nexport type MentionMenuSection =\n (typeof MentionMenuSection)[keyof typeof MentionMenuSection];\n\nexport interface WebpageMention {\n tabId: number;\n title: string;\n url: string;\n isCurrent: boolean;\n}\n\nexport interface WebpageMentionScope {\n primaryTabId: number;\n tabGroupId: number | null;\n allowedTabIds: readonly number[];\n}\n\n/**\n * Selector result - provides current state + loading indicators\n * Used by the UI to get immediate access to data and loading state\n */\nexport interface MenuItemsSelector {\n items: MenuItem[];\n isFetching: boolean;\n hasMore: boolean;\n}\n\n/**\n * MenuItem - individual mentionable item\n * Icon fields match MentionIcon component props exactly - no transforms needed at render time!\n *\n * Multi-scope system: Items can belong to multiple scopes simultaneously\n * Example: An asset can be visible in 'athena_assets', 'folder_123', and 'my_spaces'\n */\nexport interface MenuItem {\n id: string;\n name: string;\n type:\n | 'menu'\n | 'asset'\n | 'folder'\n | 'tool'\n | 'toolkit'\n | 'drive'\n | 'user'\n | 'group'\n | 'agent'\n | 'task'\n | 'tab'\n | 'workspace_item'\n | 'drive_catalog'\n | 'placeholder';\n\n // Icon fields (match MentionIcon component props)\n thumbnailUrl?: string; // For assets: URL/path to thumbnail (e.g., from AthenaTypeToThumb)\n fallbackIcon: string; // For menus/tools: Lucide icon name (e.g., 'Folder', 'Wrench') or emoji\n\n // Multi-scope membership: Which menu scopes this item is visible in\n // Items can belong to multiple scopes simultaneously\n visibleInScopes: Set<MenuScope>; // e.g., Set(['athena_assets', 'folder_123', 'my_spaces'])\n\n // Navigation capability: If present, this item can be navigated into\n // When user selects this item, navigate to this scope\n navigatesToScope?: MenuScope;\n\n // Navigation-only flag: If true, item CANNOT be inserted as mention (only navigate)\n // Use for root categories that are pure navigation containers\n isNavigationOnly?: boolean; // Default: false (most items are mentionable)\n\n // Type-specific metadata\n extra?: Record<string, any>;\n description?: string;\n url?: string;\n menuSection?: MentionMenuSection;\n updatedAt?: string;\n email?: string; // For user type\n version?: string; // For versioned assets\n\n // Legacy compatibility\n parentMenuId?: string;\n}\n\n/**\n * FetchState - fetch status and pagination state for a specific query\n * Managed by orchestrator, not returned by sources\n */\nexport interface FetchState {\n isFetching: boolean;\n hasNextPage: boolean;\n fetchNext: (() => void) | null;\n error: Error | null; // Track errors to prevent infinite retry loops\n\n // Source-specific pagination metadata (offset, cursor, page token, etc.)\n // Each source stores what IT needs between calls\n // Orchestrator doesn't care what's in here!\n meta: unknown;\n}\n\n/**\n * FetchMetadata - Common metadata fields used by orchestrator\n * Sources can extend this with their own fields (e.g., pageToken, cursor)\n */\nexport interface FetchMetadata {\n // Orchestrator fields\n validatedCount?: number; // Number of items fetched and validated so far\n fetchAttempts?: number; // Number of fetch attempts (for safety limits)\n // Source-specific fields can be added via extension or intersection\n [key: string]: unknown;\n}\n\n/**\n * New source to register dynamically\n * Returned by sources when they discover navigable items (folders, catalogs, etc.)\n */\nexport interface SourceToRegister {\n scope: MenuScope; // The scope ID to register\n sourceFn: SourceFn; // The source function to use for this scope\n sourceConfig?: any; // Configuration for the source\n isFlat?: boolean; // Whether this scope should be flat (no navigation arrows)\n}\n\n/**\n * Scope binding to register dynamically\n * Binds a browse scope to a search scope (hot scope swap on query)\n */\nexport interface ScopeBindingToRegister {\n browseScope: MenuScope; // The scope shown when browsing (no query)\n searchScope: MenuScope; // The scope shown when searching (has query)\n}\n\n/**\n * Source result - returned by all source functions\n *\n * Sources come in two flavors:\n * 1. TRANSFORMERS - Transform existing data (no API calls)\n * Examples: tools, toolkits, workspace members, opened spaces\n * Pattern: Read from store/ref → transform → return items\n *\n * 2. FETCHERS - Fetch from API (async operations)\n * Examples: internal assets, folders, SharePoint items\n * Pattern: Call GraphQL/REST → transform response → return items\n *\n * 3. HYBRID - Behavior depends on query\n * Example: Root menu (transformer when no query, fetcher with query)\n *\n * Original design: Sources can return new sources to register!\n * This allows discovered items (folders, catalogs) to be dynamically registered\n * without circular dependencies (orchestrator handles registration centrally)\n */\nexport interface SourceResult {\n // Items to add/update (source sets navigatesToScope on navigable items)\n // Orchestrator will tag these items with the current scope\n items: MenuItem[];\n\n // Pagination metadata (what we learned from this fetch)\n // All sources return this - orchestrator uses it\n pagination?: {\n hasMore: boolean;\n totalCount?: number;\n // Rows the source consumed from the server for this page. Defaults to\n // `items.length`; sources that drop rows after fetching must report the\n // pre-filter count so the next offset does not re-read the same rows.\n consumedCount?: number;\n };\n\n // Source-specific metadata (e.g., pageToken for SharePoint, cursor for pagination)\n // Orchestrator merges this into fetchState.meta for the next fetch\n meta?: Record<string, unknown>;\n\n // New sources to register (for discovered navigable items)\n // Orchestrator will register these in the registry\n sources?: SourceToRegister[];\n\n // New bindings to register (for hot scope swap on query)\n // Example: catalogId → catalogId_search\n bindings?: ScopeBindingToRegister[];\n}\n\n/**\n * Source function context\n *\n * Sources are pure functions - just fetch/transform and return items!\n * Orchestrator handles sync/deduplication via Cache.addItems() with scope tagging\n */\nexport interface SourceContext<TConfig = any> {\n scope: MenuScope; // Current scope we're fetching for\n query: string; // User's search query\n fetchState: FetchState; // Pagination state for this query (includes source-specific meta)\n sourceConfig: TConfig; // Source configuration (can include getters for reactive data!)\n}\n\n/**\n * Source function type\n *\n * Pure function that provides items for a scope + query combination.\n * Can be a transformer (reads from store) or fetcher (calls API).\n * State (pagination, sourceConfig) is stored externally in registry entry.\n */\nexport type SourceFn<TConfig = any> = (context: SourceContext<TConfig>) => Promise<SourceResult>;\n\n/**\n * An agent a chat message can name (identity v7 D13), as the `@` menu's Agents section offers it:\n * choosing one names it for the message (a chip on the composer's To line) and never writes a\n * mention into the text. `ref` is what the send names (`collab_agent:<asset id>`, or `assistant`\n * for the person's own assistant).\n */\nexport interface MentionChatAgent {\n ref: string;\n name: string;\n /** The collab agent asset behind `ref`; `null` for the person's own assistant. */\n assetId: string | null;\n /** A Lucide icon name for the menu row. */\n icon: string;\n}\n\n/**\n * What a composer that names agents hands its `@` menu (`TiptapComposer`'s `chatAgents`): the\n * agents offered now, naming what is chosen, and a way to hear the offer change.\n */\nexport interface MentionChatAgents {\n /** The agents the Agents section offers now (none once eight are named). */\n getAgents: () => readonly MentionChatAgent[];\n /** Name `agents` for the message, in the order chosen. */\n nameAgents: (agents: readonly MentionChatAgent[]) => void;\n /** Called whenever {@link MentionChatAgents.getAgents} would answer differently. */\n subscribe: (listener: () => void) => () => void;\n}\n\n/**\n * A host-provided candidate for the Tools / Toolkits categories. A host that\n * hands the composer a list of these replaces the server tool catalog for\n * those categories with its own (AthenaChat offers the toolkits its provider\n * enabled, or whatever the host passes through `mentionTools`).\n */\nexport interface MentionTool {\n id: string;\n name: string;\n description?: string;\n /** Lucide icon name (`Package`, `Wrench`, …) or an emoji. */\n icon?: string;\n type: 'tool' | 'toolkit';\n}\n"],"names":[],"mappings":"AAmBO,MAAM,qBAAqB;AAAA,EAChC,iBAAiB;AAAA,EACjB,gBAAgB;AAAA,EAChB,SAAS;AACX;"}
|
|
@@ -26,6 +26,7 @@ const ROOT_MENTION_CATEGORIES = [
|
|
|
26
26
|
"tools",
|
|
27
27
|
"toolkits",
|
|
28
28
|
"team",
|
|
29
|
+
"agents",
|
|
29
30
|
"drives"
|
|
30
31
|
];
|
|
31
32
|
function providedToolsFingerprint(tools) {
|
|
@@ -43,21 +44,30 @@ function buildStore({
|
|
|
43
44
|
auth,
|
|
44
45
|
getWebpages,
|
|
45
46
|
getTools,
|
|
47
|
+
getChatAgents,
|
|
48
|
+
getIsAdmin,
|
|
46
49
|
rootCategories,
|
|
47
50
|
athenaUnavailable
|
|
48
51
|
}) {
|
|
49
52
|
const registry = scopeRegistry.createScopeRegistry();
|
|
50
53
|
const cache = itemCache.createItemCache();
|
|
54
|
+
const offersAgents = rootCategories.includes("agents");
|
|
55
|
+
const offeredChatAgents = () => {
|
|
56
|
+
var _a;
|
|
57
|
+
return offersAgents ? ((_a = getChatAgents()) == null ? void 0 : _a.getAgents()) ?? [] : [];
|
|
58
|
+
};
|
|
51
59
|
scopeRegistry.registerSource(registry, "root", index.transformRootCategories, {
|
|
52
60
|
categories: [...rootCategories],
|
|
53
|
-
getWebpages
|
|
61
|
+
getWebpages,
|
|
62
|
+
getChatAgents: offeredChatAgents
|
|
54
63
|
});
|
|
55
|
-
const loadTeam = index.createTeamLoader(auth);
|
|
64
|
+
const loadTeam = index.createTeamLoader(auth, { getIsAdmin });
|
|
56
65
|
const withHostTools = getTools ? index.withProvidedTools(index.fetchGlobalSearch, getTools) : index.fetchGlobalSearch;
|
|
66
|
+
const withPeople = rootCategories.includes("team") ? index.withTeam(withHostTools, loadTeam) : withHostTools;
|
|
57
67
|
scopeRegistry.registerSource(
|
|
58
68
|
registry,
|
|
59
69
|
"global_search",
|
|
60
|
-
|
|
70
|
+
offersAgents ? index.withChatAgents(withPeople, offeredChatAgents) : withPeople,
|
|
61
71
|
{ auth }
|
|
62
72
|
);
|
|
63
73
|
scopeRegistry.bindScopes(registry, "root", "global_search");
|
|
@@ -98,12 +108,25 @@ function buildStore({
|
|
|
98
108
|
scopeRegistry.registerSource(registry, "toolkits", index.fetchToolkits, { auth });
|
|
99
109
|
}
|
|
100
110
|
scopeRegistry.registerSource(registry, "team", index.fetchTeam, { auth, loadTeam });
|
|
111
|
+
if (offersAgents) {
|
|
112
|
+
scopeRegistry.registerSource(registry, index.CHAT_AGENTS_SCOPE, index.transformChatAgents, {
|
|
113
|
+
getAgents: offeredChatAgents
|
|
114
|
+
});
|
|
115
|
+
}
|
|
101
116
|
scopeRegistry.registerSource(registry, "drive_catalogs", index.fetchDrives, { auth });
|
|
102
|
-
|
|
117
|
+
const store$1 = new store.Store({
|
|
103
118
|
registry,
|
|
104
119
|
cache,
|
|
105
120
|
athenaUnavailable
|
|
106
121
|
});
|
|
122
|
+
store$1.nameAgents = (items) => {
|
|
123
|
+
const host = offersAgents ? getChatAgents() : void 0;
|
|
124
|
+
const agents = items.flatMap((item) => index.chatAgentFromMenuItem(item) ?? []);
|
|
125
|
+
if (!host || agents.length === 0) return false;
|
|
126
|
+
host.nameAgents(agents);
|
|
127
|
+
return true;
|
|
128
|
+
};
|
|
129
|
+
return store$1;
|
|
107
130
|
}
|
|
108
131
|
function sameReason(a, b) {
|
|
109
132
|
if (a === null || b === null) return a === b;
|
|
@@ -113,7 +136,9 @@ function useMentionSuggestions({
|
|
|
113
136
|
webpages,
|
|
114
137
|
tools,
|
|
115
138
|
rootCategories = ROOT_MENTION_CATEGORIES,
|
|
116
|
-
athenaUnavailable = null
|
|
139
|
+
athenaUnavailable = null,
|
|
140
|
+
chatAgents,
|
|
141
|
+
viewerIsAdmin = false
|
|
117
142
|
}) {
|
|
118
143
|
const auth = apiClient.useMentionAuth();
|
|
119
144
|
const webpagesRef = require$$0.useRef(webpages);
|
|
@@ -121,6 +146,10 @@ function useMentionSuggestions({
|
|
|
121
146
|
const toolsRef = require$$0.useRef(tools);
|
|
122
147
|
toolsRef.current = tools;
|
|
123
148
|
const hasProvidedTools = tools !== void 0;
|
|
149
|
+
const chatAgentsRef = require$$0.useRef(chatAgents);
|
|
150
|
+
chatAgentsRef.current = chatAgents;
|
|
151
|
+
const viewerIsAdminRef = require$$0.useRef(viewerIsAdmin);
|
|
152
|
+
viewerIsAdminRef.current = viewerIsAdmin;
|
|
124
153
|
const athenaUnavailableRef = require$$0.useRef(athenaUnavailable);
|
|
125
154
|
athenaUnavailableRef.current = athenaUnavailable;
|
|
126
155
|
const store2 = require$$0.useMemo(
|
|
@@ -128,6 +157,8 @@ function useMentionSuggestions({
|
|
|
128
157
|
auth,
|
|
129
158
|
getWebpages: () => webpagesRef.current,
|
|
130
159
|
getTools: hasProvidedTools ? () => toolsRef.current ?? [] : void 0,
|
|
160
|
+
getChatAgents: () => chatAgentsRef.current,
|
|
161
|
+
getIsAdmin: () => viewerIsAdminRef.current,
|
|
131
162
|
rootCategories,
|
|
132
163
|
athenaUnavailable: athenaUnavailableRef.current
|
|
133
164
|
}),
|
|
@@ -188,6 +219,26 @@ function useMentionSuggestions({
|
|
|
188
219
|
invalidate("toolkits");
|
|
189
220
|
invalidate("global_search");
|
|
190
221
|
}, [invalidate, toolsFingerprint]);
|
|
222
|
+
const offersAgents = rootCategories.includes("agents");
|
|
223
|
+
require$$0.useEffect(() => {
|
|
224
|
+
if (!offersAgents || !chatAgents) return;
|
|
225
|
+
const refresh = () => {
|
|
226
|
+
invalidate(index.CHAT_AGENTS_SCOPE);
|
|
227
|
+
invalidate("root");
|
|
228
|
+
invalidate("global_search");
|
|
229
|
+
};
|
|
230
|
+
refresh();
|
|
231
|
+
return chatAgents.subscribe(refresh);
|
|
232
|
+
}, [chatAgents, invalidate, offersAgents]);
|
|
233
|
+
const offersTeam = rootCategories.includes("team");
|
|
234
|
+
const previousViewerIsAdminRef = require$$0.useRef(viewerIsAdmin);
|
|
235
|
+
require$$0.useEffect(() => {
|
|
236
|
+
if (previousViewerIsAdminRef.current === viewerIsAdmin) return;
|
|
237
|
+
previousViewerIsAdminRef.current = viewerIsAdmin;
|
|
238
|
+
if (!offersTeam) return;
|
|
239
|
+
invalidate("team");
|
|
240
|
+
invalidate("global_search");
|
|
241
|
+
}, [invalidate, offersTeam, viewerIsAdmin]);
|
|
191
242
|
return { store: store2, invalidate };
|
|
192
243
|
}
|
|
193
244
|
exports.ROOT_MENTION_CATEGORIES = ROOT_MENTION_CATEGORIES;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-mention-suggestions.cjs","sources":["../../../../../src/chat-ui/mentions/suggestions/data/use-mention-suggestions.ts"],"sourcesContent":["/**\n * Mention Suggestions Store — shared by every Athena chat host (the Chrome\n * side panel, the Office task pane, the SDK's AthenaChat).\n *\n * Full Olympus-style mention store with all categories:\n * Favorites, Assets, Projects, Browse Profiles, Folders,\n * current/group webpages, Team, Workspace, Drives + Global Search (assets,\n * plus workspace members when Team is offered).\n *\n * Uses registry + cache architecture from Olympus with\n * async data fetching via GraphQL. A host may hand the Tools / Toolkits\n * categories its own list instead of the server catalog (`tools`).\n */\n\nimport type { LabelCopy } from \"@athenaintel/agent-runtime/offline-status\";\nimport { Store } from \"@tanstack/store\";\nimport { useEffect, useLayoutEffect, useMemo, useRef } from \"react\";\nimport type { MentionAuthContext } from \"./api-client\";\nimport { useMentionAuth } from \"./api-client\";\nimport { createItemCache, type ItemCache } from \"./item-cache\";\nimport { retryFailedFetches } from \"./orchestrator\";\nimport {\n createScopeRegistry,\n registerSource,\n bindScopes,\n type ScopeRegistry,\n} from \"./scope-registry\";\nimport {\n transformRootCategories,\n fetchAssets,\n fetchFavorites,\n fetchFolders,\n fetchFolderContents,\n fetchTypedAssets,\n fetchTeam,\n fetchTools,\n fetchToolkits,\n fetchDrives,\n fetchGlobalSearch,\n transformProvidedTools,\n withProvidedTools,\n createTeamLoader,\n withTeam,\n} from \"./sources\";\nimport type { MentionTool, WebpageMention } from \"./types\";\n\nexport function webpageMentionFingerprint(\n webpages: readonly WebpageMention[],\n): string {\n return JSON.stringify(\n webpages.map(({ tabId, title, url, isCurrent }) => [\n tabId,\n title,\n url,\n isCurrent,\n ]),\n );\n}\n\n// ── Store types ──\n\nexport interface MentionSuggestionsStoreState {\n registry: ScopeRegistry;\n cache: ItemCache;\n /**\n * Why nothing is asked of Athena right now, or `null` while it answers: the\n * scopes whose source asks Athena fetch nothing and say this instead, while\n * the host's own items (its tabs, its tool list) and what was already loaded\n * still show.\n */\n athenaUnavailable: LabelCopy | null;\n}\n\nexport type MentionSuggestionsStore = Store<MentionSuggestionsStoreState>;\n\n// ── Categories ──\n\n/**\n * All mention menu categories, in display order.\n */\nexport const ROOT_MENTION_CATEGORIES = [\n \"favorites\",\n \"assets\",\n \"projects\",\n \"browse_profiles\",\n \"folders\",\n \"tools\",\n \"toolkits\",\n \"team\",\n \"drives\",\n] as const;\n\nexport type MentionRootCategory = (typeof ROOT_MENTION_CATEGORIES)[number];\n\n// ── Store builder ──\n\n/** Stable fingerprint of a host's tool list, for cache invalidation. */\nexport function providedToolsFingerprint(tools: readonly MentionTool[]): string {\n return JSON.stringify(\n tools.map(({ id, name, type, description, icon }) => [\n id,\n name,\n type,\n description ?? null,\n icon ?? null,\n ]),\n );\n}\n\nfunction buildStore({\n auth,\n getWebpages,\n getTools,\n rootCategories,\n athenaUnavailable,\n}: {\n auth: MentionAuthContext;\n getWebpages: () => readonly WebpageMention[];\n /** Present when the host supplies the Tools / Toolkits list itself. */\n getTools?: () => readonly MentionTool[];\n rootCategories: readonly MentionRootCategory[];\n athenaUnavailable: LabelCopy | null;\n}): MentionSuggestionsStore {\n const registry = createScopeRegistry();\n const cache = createItemCache();\n\n // ── Root categories ──\n registerSource(registry, \"root\", transformRootCategories, {\n categories: [...rootCategories],\n getWebpages,\n });\n\n const loadTeam = createTeamLoader(auth);\n\n // ── Global search (aggregated) ──\n // A host's own tools ride along so a root query finds them beside assets,\n // and so do workspace members when the host offers Team.\n const withHostTools = getTools\n ? withProvidedTools(fetchGlobalSearch, getTools)\n : fetchGlobalSearch;\n registerSource(\n registry,\n \"global_search\",\n rootCategories.includes(\"team\") ? withTeam(withHostTools, loadTeam) : withHostTools,\n { auth },\n );\n bindScopes(registry, \"root\", \"global_search\");\n\n // ── Assets ──\n registerSource(registry, \"athena_assets\", fetchAssets, { auth, limit: 50 });\n\n // ── Favorites ──\n registerSource(registry, \"favorites\", fetchFavorites, { auth, limit: 50 });\n\n // ── Folders (flat list) ──\n registerSource(\n registry,\n \"athena_folders\",\n fetchFolders,\n { auth, limit: 50 },\n true /* isFlat */,\n );\n\n // ── Internal drive (folder navigation root) ──\n registerSource(registry, \"internal_drive\", fetchFolderContents, {\n auth,\n limit: 50,\n });\n\n // ── Projects ──\n registerSource(registry, \"athena_projects\", fetchTypedAssets, {\n auth,\n includeOnlyTypes: [\"project\"],\n limit: 50,\n });\n\n // ── Browse Profiles ──\n registerSource(registry, \"athena_browse_profiles\", fetchTypedAssets, {\n auth,\n includeOnlyTypes: [\"browse_profile\"],\n limit: 50,\n });\n\n // ── Tools & Toolkits ── the server catalog, or the host's own list\n if (getTools) {\n registerSource(registry, \"tools\", transformProvidedTools, {\n getTools,\n type: \"tool\",\n });\n registerSource(registry, \"toolkits\", transformProvidedTools, {\n getTools,\n type: \"toolkit\",\n });\n } else {\n registerSource(registry, \"tools\", fetchTools, { auth });\n registerSource(registry, \"toolkits\", fetchToolkits, { auth });\n }\n\n // ── Team ──\n registerSource(registry, \"team\", fetchTeam, { auth, loadTeam });\n\n // ── Drives (catalogs) ──\n registerSource(registry, \"drive_catalogs\", fetchDrives, { auth });\n\n return new Store<MentionSuggestionsStoreState>({\n registry,\n cache,\n athenaUnavailable,\n });\n}\n\n/** Two reasons say the same thing (a host may hand a new object with the same words). */\nfunction sameReason(a: LabelCopy | null, b: LabelCopy | null): boolean {\n if (a === null || b === null) return a === b;\n return a.label === b.label && a.detail === b.detail;\n}\n\n// ── Hook ──\n\n/**\n * Creates a stable MentionSuggestionsStore.\n * Uses MentionAuthCtx for API credentials.\n */\nexport function useMentionSuggestions({\n webpages,\n tools,\n rootCategories = ROOT_MENTION_CATEGORIES,\n athenaUnavailable = null,\n}: {\n webpages: readonly WebpageMention[];\n /**\n * Host-provided Tools / Toolkits candidates. When set (even empty) they\n * replace the server tool catalog for those categories and join root\n * search results; omitted, the categories fetch the catalog.\n */\n tools?: readonly MentionTool[];\n /** Categories shown at the top level; hosts can narrow the default set. */\n rootCategories?: readonly MentionRootCategory[];\n /**\n * Why nothing may be asked of Athena right now (`NEEDS_CONNECTION` while\n * Athena can't be reached), or `null`. Once it clears, the lookups that\n * failed meanwhile run again.\n */\n athenaUnavailable?: LabelCopy | null;\n}): {\n store: MentionSuggestionsStore;\n invalidate: (scope: string) => void;\n} {\n const auth = useMentionAuth();\n const webpagesRef = useRef(webpages);\n webpagesRef.current = webpages;\n const toolsRef = useRef(tools);\n toolsRef.current = tools;\n const hasProvidedTools = tools !== undefined;\n // Read once per store build: a store rebuilt meanwhile starts where the host stands.\n const athenaUnavailableRef = useRef(athenaUnavailable);\n athenaUnavailableRef.current = athenaUnavailable;\n\n // Depend on primitive values to avoid rebuilding store on object identity changes\n const store = useMemo(\n () =>\n buildStore({\n auth,\n getWebpages: () => webpagesRef.current,\n getTools: hasProvidedTools ? () => toolsRef.current ?? [] : undefined,\n rootCategories,\n athenaUnavailable: athenaUnavailableRef.current,\n }),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [\n auth.backendUrl,\n auth.accessToken,\n auth.apiKey,\n auth.workspaceId,\n auth.userId,\n hasProvidedTools,\n rootCategories.join(\",\"),\n ],\n );\n\n const invalidate = useMemo(\n () => (scope: string) => {\n const state = store.state;\n const { registry, cache } = state;\n\n // Clear scope from cache\n if (cache.items) {\n for (const item of Object.values(cache.items)) {\n item.visibleInScopes.delete(scope);\n }\n // Remove orphaned items\n for (const [id, item] of Object.entries(cache.items)) {\n if (item.visibleInScopes.size === 0) {\n delete cache.items[id];\n }\n }\n }\n\n // Reset fetch states\n if (registry.entries[scope]) {\n registry.entries[scope].fetchStates = {};\n }\n\n store.setState((prev) => ({ ...prev }));\n },\n [store],\n );\n\n // Before the menu's own effects run, so no lookup leaves under a stale answer;\n // a value that changed nothing keeps the store's state (and its readers) as is.\n useLayoutEffect(() => {\n const unavailableBefore = store.state.athenaUnavailable;\n if (sameReason(unavailableBefore, athenaUnavailable)) return;\n store.setState((prev) => ({ ...prev, athenaUnavailable }));\n if (unavailableBefore !== null && athenaUnavailable === null) {\n retryFailedFetches(store);\n }\n }, [athenaUnavailable, store]);\n\n const webpageFingerprint = webpageMentionFingerprint(webpages);\n const previousWebpageFingerprintRef = useRef<string | null>(null);\n\n useEffect(() => {\n if (previousWebpageFingerprintRef.current === webpageFingerprint) return;\n previousWebpageFingerprintRef.current = webpageFingerprint;\n invalidate(\"root\");\n }, [invalidate, webpageFingerprint]);\n\n // A changed tool list drops the cached Tools / Toolkits entries (and the\n // root search results they were folded into) so the next open re-reads it.\n const toolsFingerprint = tools ? providedToolsFingerprint(tools) : null;\n const previousToolsFingerprintRef = useRef<string | null>(null);\n\n useEffect(() => {\n if (previousToolsFingerprintRef.current === toolsFingerprint) return;\n previousToolsFingerprintRef.current = toolsFingerprint;\n if (toolsFingerprint === null) return;\n invalidate(\"tools\");\n invalidate(\"toolkits\");\n invalidate(\"global_search\");\n }, [invalidate, toolsFingerprint]);\n\n return { store, invalidate };\n}\n"],"names":["createScopeRegistry","createItemCache","registerSource","transformRootCategories","createTeamLoader","withProvidedTools","fetchGlobalSearch","withTeam","bindScopes","fetchAssets","fetchFavorites","fetchFolders","fetchFolderContents","fetchTypedAssets","transformProvidedTools","fetchTools","fetchToolkits","fetchTeam","fetchDrives","Store","useMentionAuth","useRef","store","useMemo","useLayoutEffect","retryFailedFetches","useEffect"],"mappings":";;;;;;;;;AA8CO,SAAS,0BACd,UACQ;AACR,SAAO,KAAK;AAAA,IACV,SAAS,IAAI,CAAC,EAAE,OAAO,OAAO,KAAK,gBAAgB;AAAA,MACjD;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IAAA,CACD;AAAA,EAAA;AAEL;AAuBO,MAAM,0BAA0B;AAAA,EACrC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAOO,SAAS,yBAAyB,OAAuC;AAC9E,SAAO,KAAK;AAAA,IACV,MAAM,IAAI,CAAC,EAAE,IAAI,MAAM,MAAM,aAAa,WAAW;AAAA,MACnD;AAAA,MACA;AAAA,MACA;AAAA,MACA,eAAe;AAAA,MACf,QAAQ;AAAA,IAAA,CACT;AAAA,EAAA;AAEL;AAEA,SAAS,WAAW;AAAA,EAClB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAO4B;AAC1B,QAAM,WAAWA,cAAAA,oBAAA;AACjB,QAAM,QAAQC,UAAAA,gBAAA;AAGdC,+BAAe,UAAU,QAAQC,+BAAyB;AAAA,IACxD,YAAY,CAAC,GAAG,cAAc;AAAA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AAW,eAAe;AAAA,EAC5B,GAAG,CAAC,YAAY,gBAAgB,CAAC;AAEjC,SAAO,EAAE,OAAAJ,QAAO,WAAA;AAClB;;;;;"}
|
|
1
|
+
{"version":3,"file":"use-mention-suggestions.cjs","sources":["../../../../../src/chat-ui/mentions/suggestions/data/use-mention-suggestions.ts"],"sourcesContent":["/**\n * Mention Suggestions Store — shared by every Athena chat host (the Chrome\n * side panel, the Office task pane, the SDK's AthenaChat).\n *\n * Full Olympus-style mention store with all categories:\n * Favorites, Assets, Projects, Browse Profiles, Folders,\n * current/group webpages, Team (members, the viewer's people, groups), Agents\n * (the agents a message can name, where the host names agents), Drives +\n * Global Search (assets, plus Team and Agents when offered).\n *\n * Uses registry + cache architecture from Olympus with\n * async data fetching via GraphQL. A host may hand the Tools / Toolkits\n * categories its own list instead of the server catalog (`tools`).\n */\n\nimport type { LabelCopy } from \"@athenaintel/agent-runtime/offline-status\";\nimport { Store } from \"@tanstack/store\";\nimport { useEffect, useLayoutEffect, useMemo, useRef } from \"react\";\nimport type { MentionAuthContext } from \"./api-client\";\nimport { useMentionAuth } from \"./api-client\";\nimport { createItemCache, type ItemCache } from \"./item-cache\";\nimport { retryFailedFetches } from \"./orchestrator\";\nimport {\n createScopeRegistry,\n registerSource,\n bindScopes,\n type ScopeRegistry,\n} from \"./scope-registry\";\nimport {\n CHAT_AGENTS_SCOPE,\n chatAgentFromMenuItem,\n transformChatAgents,\n withChatAgents,\n transformRootCategories,\n fetchAssets,\n fetchFavorites,\n fetchFolders,\n fetchFolderContents,\n fetchTypedAssets,\n fetchTeam,\n fetchTools,\n fetchToolkits,\n fetchDrives,\n fetchGlobalSearch,\n transformProvidedTools,\n withProvidedTools,\n createTeamLoader,\n withTeam,\n} from \"./sources\";\nimport type {\n MentionChatAgent,\n MentionChatAgents,\n MentionTool,\n MenuItem,\n WebpageMention,\n} from \"./types\";\n\nexport function webpageMentionFingerprint(\n webpages: readonly WebpageMention[],\n): string {\n return JSON.stringify(\n webpages.map(({ tabId, title, url, isCurrent }) => [\n tabId,\n title,\n url,\n isCurrent,\n ]),\n );\n}\n\n// ── Store types ──\n\nexport interface MentionSuggestionsStoreState {\n registry: ScopeRegistry;\n cache: ItemCache;\n /**\n * Why nothing is asked of Athena right now, or `null` while it answers: the\n * scopes whose source asks Athena fetch nothing and say this instead, while\n * the host's own items (its tabs, its tool list) and what was already loaded\n * still show.\n */\n athenaUnavailable: LabelCopy | null;\n}\n\nexport type MentionSuggestionsStore = Store<MentionSuggestionsStoreState> & {\n /**\n * Names the agents the `agent` items among `items` stand for (the Agents\n * section), in order; `false` when there is none or the composer names no\n * agents (no `chatAgents`), and the text is then left as it was.\n */\n nameAgents?: (items: readonly MenuItem[]) => boolean;\n};\n\n// ── Categories ──\n\n/**\n * All mention menu categories, in display order.\n */\nexport const ROOT_MENTION_CATEGORIES = [\n \"favorites\",\n \"assets\",\n \"projects\",\n \"browse_profiles\",\n \"folders\",\n \"tools\",\n \"toolkits\",\n \"team\",\n \"agents\",\n \"drives\",\n] as const;\n\nexport type MentionRootCategory = (typeof ROOT_MENTION_CATEGORIES)[number];\n\n// ── Store builder ──\n\n/** Stable fingerprint of a host's tool list, for cache invalidation. */\nexport function providedToolsFingerprint(tools: readonly MentionTool[]): string {\n return JSON.stringify(\n tools.map(({ id, name, type, description, icon }) => [\n id,\n name,\n type,\n description ?? null,\n icon ?? null,\n ]),\n );\n}\n\nfunction buildStore({\n auth,\n getWebpages,\n getTools,\n getChatAgents,\n getIsAdmin,\n rootCategories,\n athenaUnavailable,\n}: {\n auth: MentionAuthContext;\n getWebpages: () => readonly WebpageMention[];\n /** Present when the host supplies the Tools / Toolkits list itself. */\n getTools?: () => readonly MentionTool[];\n /** The host's agents to name (`chatAgents`), read when the menu queries and when one is chosen. */\n getChatAgents: () => MentionChatAgents | undefined;\n /** Whether the viewer is an Athena admin (the ranked people are an admin's). */\n getIsAdmin: () => boolean;\n rootCategories: readonly MentionRootCategory[];\n athenaUnavailable: LabelCopy | null;\n}): MentionSuggestionsStore {\n const registry = createScopeRegistry();\n const cache = createItemCache();\n const offersAgents = rootCategories.includes(\"agents\");\n const offeredChatAgents = (): readonly MentionChatAgent[] =>\n offersAgents ? (getChatAgents()?.getAgents() ?? []) : [];\n\n // ── Root categories ──\n registerSource(registry, \"root\", transformRootCategories, {\n categories: [...rootCategories],\n getWebpages,\n getChatAgents: offeredChatAgents,\n });\n\n const loadTeam = createTeamLoader(auth, { getIsAdmin });\n\n // ── Global search (aggregated) ──\n // A host's own tools ride along so a root query finds them beside assets,\n // and so do the Team list when the host offers Team and the agents it\n // offers to name when it offers Agents.\n const withHostTools = getTools\n ? withProvidedTools(fetchGlobalSearch, getTools)\n : fetchGlobalSearch;\n const withPeople = rootCategories.includes(\"team\")\n ? withTeam(withHostTools, loadTeam)\n : withHostTools;\n registerSource(\n registry,\n \"global_search\",\n offersAgents ? withChatAgents(withPeople, offeredChatAgents) : withPeople,\n { auth },\n );\n bindScopes(registry, \"root\", \"global_search\");\n\n // ── Assets ──\n registerSource(registry, \"athena_assets\", fetchAssets, { auth, limit: 50 });\n\n // ── Favorites ──\n registerSource(registry, \"favorites\", fetchFavorites, { auth, limit: 50 });\n\n // ── Folders (flat list) ──\n registerSource(\n registry,\n \"athena_folders\",\n fetchFolders,\n { auth, limit: 50 },\n true /* isFlat */,\n );\n\n // ── Internal drive (folder navigation root) ──\n registerSource(registry, \"internal_drive\", fetchFolderContents, {\n auth,\n limit: 50,\n });\n\n // ── Projects ──\n registerSource(registry, \"athena_projects\", fetchTypedAssets, {\n auth,\n includeOnlyTypes: [\"project\"],\n limit: 50,\n });\n\n // ── Browse Profiles ──\n registerSource(registry, \"athena_browse_profiles\", fetchTypedAssets, {\n auth,\n includeOnlyTypes: [\"browse_profile\"],\n limit: 50,\n });\n\n // ── Tools & Toolkits ── the server catalog, or the host's own list\n if (getTools) {\n registerSource(registry, \"tools\", transformProvidedTools, {\n getTools,\n type: \"tool\",\n });\n registerSource(registry, \"toolkits\", transformProvidedTools, {\n getTools,\n type: \"toolkit\",\n });\n } else {\n registerSource(registry, \"tools\", fetchTools, { auth });\n registerSource(registry, \"toolkits\", fetchToolkits, { auth });\n }\n\n // ── Team ──\n registerSource(registry, \"team\", fetchTeam, { auth, loadTeam });\n\n // ── Agents ── the agents a message can name, where the host names agents\n if (offersAgents) {\n registerSource(registry, CHAT_AGENTS_SCOPE, transformChatAgents, {\n getAgents: offeredChatAgents,\n });\n }\n\n // ── Drives (catalogs) ──\n registerSource(registry, \"drive_catalogs\", fetchDrives, { auth });\n\n const store: MentionSuggestionsStore = new Store<MentionSuggestionsStoreState>({\n registry,\n cache,\n athenaUnavailable,\n });\n store.nameAgents = (items) => {\n const host = offersAgents ? getChatAgents() : undefined;\n const agents = items.flatMap((item) => chatAgentFromMenuItem(item) ?? []);\n if (!host || agents.length === 0) return false;\n host.nameAgents(agents);\n return true;\n };\n return store;\n}\n\n/** Two reasons say the same thing (a host may hand a new object with the same words). */\nfunction sameReason(a: LabelCopy | null, b: LabelCopy | null): boolean {\n if (a === null || b === null) return a === b;\n return a.label === b.label && a.detail === b.detail;\n}\n\n// ── Hook ──\n\n/**\n * Creates a stable MentionSuggestionsStore.\n * Uses MentionAuthCtx for API credentials.\n */\nexport function useMentionSuggestions({\n webpages,\n tools,\n rootCategories = ROOT_MENTION_CATEGORIES,\n athenaUnavailable = null,\n chatAgents,\n viewerIsAdmin = false,\n}: {\n webpages: readonly WebpageMention[];\n /**\n * Host-provided Tools / Toolkits candidates. When set (even empty) they\n * replace the server tool catalog for those categories and join root\n * search results; omitted, the categories fetch the catalog.\n */\n tools?: readonly MentionTool[];\n /** Categories shown at the top level; hosts can narrow the default set. */\n rootCategories?: readonly MentionRootCategory[];\n /**\n * Why nothing may be asked of Athena right now (`NEEDS_CONNECTION` while\n * Athena can't be reached), or `null`. Once it clears, the lookups that\n * failed meanwhile run again.\n */\n athenaUnavailable?: LabelCopy | null;\n /**\n * The agents this composer's messages can name (identity v7 D13), for the\n * Agents category: what it offers, naming what is chosen. Without it the\n * category shows nothing.\n */\n chatAgents?: MentionChatAgents;\n /**\n * Whether the viewer is an Athena admin: Team ranks an admin's people (the\n * people they talked to most recently first, with the people they saved),\n * as Olympus does while Person is in preview.\n */\n viewerIsAdmin?: boolean;\n}): {\n store: MentionSuggestionsStore;\n invalidate: (scope: string) => void;\n} {\n const auth = useMentionAuth();\n const webpagesRef = useRef(webpages);\n webpagesRef.current = webpages;\n const toolsRef = useRef(tools);\n toolsRef.current = tools;\n const hasProvidedTools = tools !== undefined;\n // Read at query and selection time: the store is built once per credential.\n const chatAgentsRef = useRef(chatAgents);\n chatAgentsRef.current = chatAgents;\n const viewerIsAdminRef = useRef(viewerIsAdmin);\n viewerIsAdminRef.current = viewerIsAdmin;\n // Read once per store build: a store rebuilt meanwhile starts where the host stands.\n const athenaUnavailableRef = useRef(athenaUnavailable);\n athenaUnavailableRef.current = athenaUnavailable;\n\n // Depend on primitive values to avoid rebuilding store on object identity changes\n const store = useMemo(\n () =>\n buildStore({\n auth,\n getWebpages: () => webpagesRef.current,\n getTools: hasProvidedTools ? () => toolsRef.current ?? [] : undefined,\n getChatAgents: () => chatAgentsRef.current,\n getIsAdmin: () => viewerIsAdminRef.current,\n rootCategories,\n athenaUnavailable: athenaUnavailableRef.current,\n }),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [\n auth.backendUrl,\n auth.accessToken,\n auth.apiKey,\n auth.workspaceId,\n auth.userId,\n hasProvidedTools,\n rootCategories.join(\",\"),\n ],\n );\n\n const invalidate = useMemo(\n () => (scope: string) => {\n const state = store.state;\n const { registry, cache } = state;\n\n // Clear scope from cache\n if (cache.items) {\n for (const item of Object.values(cache.items)) {\n item.visibleInScopes.delete(scope);\n }\n // Remove orphaned items\n for (const [id, item] of Object.entries(cache.items)) {\n if (item.visibleInScopes.size === 0) {\n delete cache.items[id];\n }\n }\n }\n\n // Reset fetch states\n if (registry.entries[scope]) {\n registry.entries[scope].fetchStates = {};\n }\n\n store.setState((prev) => ({ ...prev }));\n },\n [store],\n );\n\n // Before the menu's own effects run, so no lookup leaves under a stale answer;\n // a value that changed nothing keeps the store's state (and its readers) as is.\n useLayoutEffect(() => {\n const unavailableBefore = store.state.athenaUnavailable;\n if (sameReason(unavailableBefore, athenaUnavailable)) return;\n store.setState((prev) => ({ ...prev, athenaUnavailable }));\n if (unavailableBefore !== null && athenaUnavailable === null) {\n retryFailedFetches(store);\n }\n }, [athenaUnavailable, store]);\n\n const webpageFingerprint = webpageMentionFingerprint(webpages);\n const previousWebpageFingerprintRef = useRef<string | null>(null);\n\n useEffect(() => {\n if (previousWebpageFingerprintRef.current === webpageFingerprint) return;\n previousWebpageFingerprintRef.current = webpageFingerprint;\n invalidate(\"root\");\n }, [invalidate, webpageFingerprint]);\n\n // A changed tool list drops the cached Tools / Toolkits entries (and the\n // root search results they were folded into) so the next open re-reads it.\n const toolsFingerprint = tools ? providedToolsFingerprint(tools) : null;\n const previousToolsFingerprintRef = useRef<string | null>(null);\n\n useEffect(() => {\n if (previousToolsFingerprintRef.current === toolsFingerprint) return;\n previousToolsFingerprintRef.current = toolsFingerprint;\n if (toolsFingerprint === null) return;\n invalidate(\"tools\");\n invalidate(\"toolkits\");\n invalidate(\"global_search\");\n }, [invalidate, toolsFingerprint]);\n\n // What the Agents section offers moves with the host (an agent named or\n // removed, the agent list loading): refresh the section, the root (it hides\n // once nothing is left to name) and the cached search, which embeds it.\n const offersAgents = rootCategories.includes(\"agents\");\n useEffect(() => {\n if (!offersAgents || !chatAgents) return;\n const refresh = (): void => {\n invalidate(CHAT_AGENTS_SCOPE);\n invalidate(\"root\");\n invalidate(\"global_search\");\n };\n refresh();\n return chatAgents.subscribe(refresh);\n }, [chatAgents, invalidate, offersAgents]);\n\n // An admin answer that arrived (or changed) re-reads Team: an admin's is ranked by their people.\n const offersTeam = rootCategories.includes(\"team\");\n const previousViewerIsAdminRef = useRef(viewerIsAdmin);\n useEffect(() => {\n if (previousViewerIsAdminRef.current === viewerIsAdmin) return;\n previousViewerIsAdminRef.current = viewerIsAdmin;\n if (!offersTeam) return;\n invalidate(\"team\");\n invalidate(\"global_search\");\n }, [invalidate, offersTeam, viewerIsAdmin]);\n\n return { store, invalidate };\n}\n"],"names":["createScopeRegistry","createItemCache","registerSource","transformRootCategories","createTeamLoader","withProvidedTools","fetchGlobalSearch","withTeam","withChatAgents","bindScopes","fetchAssets","fetchFavorites","fetchFolders","fetchFolderContents","fetchTypedAssets","transformProvidedTools","fetchTools","fetchToolkits","fetchTeam","CHAT_AGENTS_SCOPE","transformChatAgents","fetchDrives","store","Store","chatAgentFromMenuItem","useMentionAuth","useRef","useMemo","useLayoutEffect","retryFailedFetches","useEffect"],"mappings":";;;;;;;;;AAyDO,SAAS,0BACd,UACQ;AACR,SAAO,KAAK;AAAA,IACV,SAAS,IAAI,CAAC,EAAE,OAAO,OAAO,KAAK,gBAAgB;AAAA,MACjD;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IAAA,CACD;AAAA,EAAA;AAEL;AA8BO,MAAM,0BAA0B;AAAA,EACrC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAOO,SAAS,yBAAyB,OAAuC;AAC9E,SAAO,KAAK;AAAA,IACV,MAAM,IAAI,CAAC,EAAE,IAAI,MAAM,MAAM,aAAa,WAAW;AAAA,MACnD;AAAA,MACA;AAAA,MACA;AAAA,MACA,eAAe;AAAA,MACf,QAAQ;AAAA,IAAA,CACT;AAAA,EAAA;AAEL;AAEA,SAAS,WAAW;AAAA,EAClB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAW4B;AAC1B,QAAM,WAAWA,cAAAA,oBAAA;AACjB,QAAM,QAAQC,UAAAA,gBAAA;AACd,QAAM,eAAe,eAAe,SAAS,QAAQ;AACrD,QAAM,oBAAoB,MAAA;;AACxB,4BAAgB,mB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AACrDI,aAAAA,UAAU,MAAM;AACd,QAAI,yBAAyB,YAAY,cAAe;AACxD,6BAAyB,UAAU;AACnC,QAAI,CAAC,WAAY;AACjB,eAAW,MAAM;AACjB,eAAW,eAAe;AAAA,EAC5B,GAAG,CAAC,YAAY,YAAY,aAAa,CAAC;AAE1C,SAAO,EAAE,OAAAR,QAAO,WAAA;AAClB;;;;;"}
|
|
@@ -4,8 +4,9 @@
|
|
|
4
4
|
*
|
|
5
5
|
* Full Olympus-style mention store with all categories:
|
|
6
6
|
* Favorites, Assets, Projects, Browse Profiles, Folders,
|
|
7
|
-
* current/group webpages, Team
|
|
8
|
-
*
|
|
7
|
+
* current/group webpages, Team (members, the viewer's people, groups), Agents
|
|
8
|
+
* (the agents a message can name, where the host names agents), Drives +
|
|
9
|
+
* Global Search (assets, plus Team and Agents when offered).
|
|
9
10
|
*
|
|
10
11
|
* Uses registry + cache architecture from Olympus with
|
|
11
12
|
* async data fetching via GraphQL. A host may hand the Tools / Toolkits
|
|
@@ -15,7 +16,7 @@ import type { LabelCopy } from "../../../../agent-runtime/src/offline-status";
|
|
|
15
16
|
import { Store } from "@tanstack/store";
|
|
16
17
|
import { type ItemCache } from "./item-cache";
|
|
17
18
|
import { type ScopeRegistry } from "./scope-registry";
|
|
18
|
-
import type { MentionTool, WebpageMention } from "./types";
|
|
19
|
+
import type { MentionChatAgents, MentionTool, MenuItem, WebpageMention } from "./types";
|
|
19
20
|
export declare function webpageMentionFingerprint(webpages: readonly WebpageMention[]): string;
|
|
20
21
|
export interface MentionSuggestionsStoreState {
|
|
21
22
|
registry: ScopeRegistry;
|
|
@@ -28,11 +29,18 @@ export interface MentionSuggestionsStoreState {
|
|
|
28
29
|
*/
|
|
29
30
|
athenaUnavailable: LabelCopy | null;
|
|
30
31
|
}
|
|
31
|
-
export type MentionSuggestionsStore = Store<MentionSuggestionsStoreState
|
|
32
|
+
export type MentionSuggestionsStore = Store<MentionSuggestionsStoreState> & {
|
|
33
|
+
/**
|
|
34
|
+
* Names the agents the `agent` items among `items` stand for (the Agents
|
|
35
|
+
* section), in order; `false` when there is none or the composer names no
|
|
36
|
+
* agents (no `chatAgents`), and the text is then left as it was.
|
|
37
|
+
*/
|
|
38
|
+
nameAgents?: (items: readonly MenuItem[]) => boolean;
|
|
39
|
+
};
|
|
32
40
|
/**
|
|
33
41
|
* All mention menu categories, in display order.
|
|
34
42
|
*/
|
|
35
|
-
export declare const ROOT_MENTION_CATEGORIES: readonly ["favorites", "assets", "projects", "browse_profiles", "folders", "tools", "toolkits", "team", "drives"];
|
|
43
|
+
export declare const ROOT_MENTION_CATEGORIES: readonly ["favorites", "assets", "projects", "browse_profiles", "folders", "tools", "toolkits", "team", "agents", "drives"];
|
|
36
44
|
export type MentionRootCategory = (typeof ROOT_MENTION_CATEGORIES)[number];
|
|
37
45
|
/** Stable fingerprint of a host's tool list, for cache invalidation. */
|
|
38
46
|
export declare function providedToolsFingerprint(tools: readonly MentionTool[]): string;
|
|
@@ -40,7 +48,7 @@ export declare function providedToolsFingerprint(tools: readonly MentionTool[]):
|
|
|
40
48
|
* Creates a stable MentionSuggestionsStore.
|
|
41
49
|
* Uses MentionAuthCtx for API credentials.
|
|
42
50
|
*/
|
|
43
|
-
export declare function useMentionSuggestions({ webpages, tools, rootCategories, athenaUnavailable, }: {
|
|
51
|
+
export declare function useMentionSuggestions({ webpages, tools, rootCategories, athenaUnavailable, chatAgents, viewerIsAdmin, }: {
|
|
44
52
|
webpages: readonly WebpageMention[];
|
|
45
53
|
/**
|
|
46
54
|
* Host-provided Tools / Toolkits candidates. When set (even empty) they
|
|
@@ -56,6 +64,18 @@ export declare function useMentionSuggestions({ webpages, tools, rootCategories,
|
|
|
56
64
|
* failed meanwhile run again.
|
|
57
65
|
*/
|
|
58
66
|
athenaUnavailable?: LabelCopy | null;
|
|
67
|
+
/**
|
|
68
|
+
* The agents this composer's messages can name (identity v7 D13), for the
|
|
69
|
+
* Agents category: what it offers, naming what is chosen. Without it the
|
|
70
|
+
* category shows nothing.
|
|
71
|
+
*/
|
|
72
|
+
chatAgents?: MentionChatAgents;
|
|
73
|
+
/**
|
|
74
|
+
* Whether the viewer is an Athena admin: Team ranks an admin's people (the
|
|
75
|
+
* people they talked to most recently first, with the people they saved),
|
|
76
|
+
* as Olympus does while Person is in preview.
|
|
77
|
+
*/
|
|
78
|
+
viewerIsAdmin?: boolean;
|
|
59
79
|
}): {
|
|
60
80
|
store: MentionSuggestionsStore;
|
|
61
81
|
invalidate: (scope: string) => void;
|
|
@@ -4,7 +4,7 @@ import { useMentionAuth } from "./api-client.js";
|
|
|
4
4
|
import { createItemCache } from "./item-cache.js";
|
|
5
5
|
import { retryFailedFetches } from "./orchestrator.js";
|
|
6
6
|
import { registerSource, bindScopes, createScopeRegistry } from "./scope-registry.js";
|
|
7
|
-
import { transformRootCategories, withProvidedTools, fetchGlobalSearch, withTeam, fetchAssets, fetchFavorites, fetchFolders, fetchFolderContents, fetchTypedAssets, transformProvidedTools, fetchTools, fetchToolkits, fetchTeam, fetchDrives, createTeamLoader } from "./sources/index.js";
|
|
7
|
+
import { transformRootCategories, withProvidedTools, fetchGlobalSearch, withTeam, withChatAgents, chatAgentFromMenuItem, CHAT_AGENTS_SCOPE, fetchAssets, fetchFavorites, fetchFolders, fetchFolderContents, fetchTypedAssets, transformProvidedTools, fetchTools, fetchToolkits, fetchTeam, transformChatAgents, fetchDrives, createTeamLoader } from "./sources/index.js";
|
|
8
8
|
function webpageMentionFingerprint(webpages) {
|
|
9
9
|
return JSON.stringify(
|
|
10
10
|
webpages.map(({ tabId, title, url, isCurrent }) => [
|
|
@@ -24,6 +24,7 @@ const ROOT_MENTION_CATEGORIES = [
|
|
|
24
24
|
"tools",
|
|
25
25
|
"toolkits",
|
|
26
26
|
"team",
|
|
27
|
+
"agents",
|
|
27
28
|
"drives"
|
|
28
29
|
];
|
|
29
30
|
function providedToolsFingerprint(tools) {
|
|
@@ -41,21 +42,30 @@ function buildStore({
|
|
|
41
42
|
auth,
|
|
42
43
|
getWebpages,
|
|
43
44
|
getTools,
|
|
45
|
+
getChatAgents,
|
|
46
|
+
getIsAdmin,
|
|
44
47
|
rootCategories,
|
|
45
48
|
athenaUnavailable
|
|
46
49
|
}) {
|
|
47
50
|
const registry = createScopeRegistry();
|
|
48
51
|
const cache = createItemCache();
|
|
52
|
+
const offersAgents = rootCategories.includes("agents");
|
|
53
|
+
const offeredChatAgents = () => {
|
|
54
|
+
var _a;
|
|
55
|
+
return offersAgents ? ((_a = getChatAgents()) == null ? void 0 : _a.getAgents()) ?? [] : [];
|
|
56
|
+
};
|
|
49
57
|
registerSource(registry, "root", transformRootCategories, {
|
|
50
58
|
categories: [...rootCategories],
|
|
51
|
-
getWebpages
|
|
59
|
+
getWebpages,
|
|
60
|
+
getChatAgents: offeredChatAgents
|
|
52
61
|
});
|
|
53
|
-
const loadTeam = createTeamLoader(auth);
|
|
62
|
+
const loadTeam = createTeamLoader(auth, { getIsAdmin });
|
|
54
63
|
const withHostTools = getTools ? withProvidedTools(fetchGlobalSearch, getTools) : fetchGlobalSearch;
|
|
64
|
+
const withPeople = rootCategories.includes("team") ? withTeam(withHostTools, loadTeam) : withHostTools;
|
|
55
65
|
registerSource(
|
|
56
66
|
registry,
|
|
57
67
|
"global_search",
|
|
58
|
-
|
|
68
|
+
offersAgents ? withChatAgents(withPeople, offeredChatAgents) : withPeople,
|
|
59
69
|
{ auth }
|
|
60
70
|
);
|
|
61
71
|
bindScopes(registry, "root", "global_search");
|
|
@@ -96,12 +106,25 @@ function buildStore({
|
|
|
96
106
|
registerSource(registry, "toolkits", fetchToolkits, { auth });
|
|
97
107
|
}
|
|
98
108
|
registerSource(registry, "team", fetchTeam, { auth, loadTeam });
|
|
109
|
+
if (offersAgents) {
|
|
110
|
+
registerSource(registry, CHAT_AGENTS_SCOPE, transformChatAgents, {
|
|
111
|
+
getAgents: offeredChatAgents
|
|
112
|
+
});
|
|
113
|
+
}
|
|
99
114
|
registerSource(registry, "drive_catalogs", fetchDrives, { auth });
|
|
100
|
-
|
|
115
|
+
const store = new Store({
|
|
101
116
|
registry,
|
|
102
117
|
cache,
|
|
103
118
|
athenaUnavailable
|
|
104
119
|
});
|
|
120
|
+
store.nameAgents = (items) => {
|
|
121
|
+
const host = offersAgents ? getChatAgents() : void 0;
|
|
122
|
+
const agents = items.flatMap((item) => chatAgentFromMenuItem(item) ?? []);
|
|
123
|
+
if (!host || agents.length === 0) return false;
|
|
124
|
+
host.nameAgents(agents);
|
|
125
|
+
return true;
|
|
126
|
+
};
|
|
127
|
+
return store;
|
|
105
128
|
}
|
|
106
129
|
function sameReason(a, b) {
|
|
107
130
|
if (a === null || b === null) return a === b;
|
|
@@ -111,7 +134,9 @@ function useMentionSuggestions({
|
|
|
111
134
|
webpages,
|
|
112
135
|
tools,
|
|
113
136
|
rootCategories = ROOT_MENTION_CATEGORIES,
|
|
114
|
-
athenaUnavailable = null
|
|
137
|
+
athenaUnavailable = null,
|
|
138
|
+
chatAgents,
|
|
139
|
+
viewerIsAdmin = false
|
|
115
140
|
}) {
|
|
116
141
|
const auth = useMentionAuth();
|
|
117
142
|
const webpagesRef = useRef(webpages);
|
|
@@ -119,6 +144,10 @@ function useMentionSuggestions({
|
|
|
119
144
|
const toolsRef = useRef(tools);
|
|
120
145
|
toolsRef.current = tools;
|
|
121
146
|
const hasProvidedTools = tools !== void 0;
|
|
147
|
+
const chatAgentsRef = useRef(chatAgents);
|
|
148
|
+
chatAgentsRef.current = chatAgents;
|
|
149
|
+
const viewerIsAdminRef = useRef(viewerIsAdmin);
|
|
150
|
+
viewerIsAdminRef.current = viewerIsAdmin;
|
|
122
151
|
const athenaUnavailableRef = useRef(athenaUnavailable);
|
|
123
152
|
athenaUnavailableRef.current = athenaUnavailable;
|
|
124
153
|
const store = useMemo(
|
|
@@ -126,6 +155,8 @@ function useMentionSuggestions({
|
|
|
126
155
|
auth,
|
|
127
156
|
getWebpages: () => webpagesRef.current,
|
|
128
157
|
getTools: hasProvidedTools ? () => toolsRef.current ?? [] : void 0,
|
|
158
|
+
getChatAgents: () => chatAgentsRef.current,
|
|
159
|
+
getIsAdmin: () => viewerIsAdminRef.current,
|
|
129
160
|
rootCategories,
|
|
130
161
|
athenaUnavailable: athenaUnavailableRef.current
|
|
131
162
|
}),
|
|
@@ -186,6 +217,26 @@ function useMentionSuggestions({
|
|
|
186
217
|
invalidate("toolkits");
|
|
187
218
|
invalidate("global_search");
|
|
188
219
|
}, [invalidate, toolsFingerprint]);
|
|
220
|
+
const offersAgents = rootCategories.includes("agents");
|
|
221
|
+
useEffect(() => {
|
|
222
|
+
if (!offersAgents || !chatAgents) return;
|
|
223
|
+
const refresh = () => {
|
|
224
|
+
invalidate(CHAT_AGENTS_SCOPE);
|
|
225
|
+
invalidate("root");
|
|
226
|
+
invalidate("global_search");
|
|
227
|
+
};
|
|
228
|
+
refresh();
|
|
229
|
+
return chatAgents.subscribe(refresh);
|
|
230
|
+
}, [chatAgents, invalidate, offersAgents]);
|
|
231
|
+
const offersTeam = rootCategories.includes("team");
|
|
232
|
+
const previousViewerIsAdminRef = useRef(viewerIsAdmin);
|
|
233
|
+
useEffect(() => {
|
|
234
|
+
if (previousViewerIsAdminRef.current === viewerIsAdmin) return;
|
|
235
|
+
previousViewerIsAdminRef.current = viewerIsAdmin;
|
|
236
|
+
if (!offersTeam) return;
|
|
237
|
+
invalidate("team");
|
|
238
|
+
invalidate("global_search");
|
|
239
|
+
}, [invalidate, offersTeam, viewerIsAdmin]);
|
|
189
240
|
return { store, invalidate };
|
|
190
241
|
}
|
|
191
242
|
export {
|