@athenaintel/react 0.57.1 → 0.59.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +778 -9
- package/dist/agent-runtime/src/addressed-agents.cjs +16 -0
- package/dist/agent-runtime/src/addressed-agents.cjs.map +1 -0
- package/dist/agent-runtime/src/addressed-agents.d.ts +30 -0
- package/dist/agent-runtime/src/addressed-agents.js +16 -0
- package/dist/agent-runtime/src/addressed-agents.js.map +1 -0
- package/dist/agent-runtime/src/answer-label.cjs +4 -3
- package/dist/agent-runtime/src/answer-label.cjs.map +1 -1
- package/dist/agent-runtime/src/answer-label.d.ts +13 -6
- package/dist/agent-runtime/src/answer-label.js +4 -3
- package/dist/agent-runtime/src/answer-label.js.map +1 -1
- package/dist/agent-runtime/src/chat-outbox-attachments.cjs.map +1 -1
- package/dist/agent-runtime/src/chat-outbox-attachments.d.ts +1 -1
- package/dist/agent-runtime/src/chat-outbox-attachments.js.map +1 -1
- package/dist/agent-runtime/src/chat-outbox-entry.cjs +101 -0
- package/dist/agent-runtime/src/chat-outbox-entry.cjs.map +1 -0
- package/dist/agent-runtime/src/chat-outbox-entry.d.ts +99 -0
- package/dist/agent-runtime/src/chat-outbox-entry.js +101 -0
- package/dist/agent-runtime/src/chat-outbox-entry.js.map +1 -0
- package/dist/agent-runtime/src/chat-outbox-legacy.cjs +252 -0
- package/dist/agent-runtime/src/chat-outbox-legacy.cjs.map +1 -0
- package/dist/agent-runtime/src/chat-outbox-legacy.d.ts +96 -0
- package/dist/agent-runtime/src/chat-outbox-legacy.js +252 -0
- package/dist/agent-runtime/src/chat-outbox-legacy.js.map +1 -0
- package/dist/agent-runtime/src/chat-outbox-policy.cjs +30 -0
- package/dist/agent-runtime/src/chat-outbox-policy.cjs.map +1 -0
- package/dist/agent-runtime/src/chat-outbox-policy.d.ts +42 -0
- package/dist/agent-runtime/src/chat-outbox-policy.js +30 -0
- package/dist/agent-runtime/src/chat-outbox-policy.js.map +1 -0
- package/dist/agent-runtime/src/chat-outbox-storage.cjs +306 -0
- package/dist/agent-runtime/src/chat-outbox-storage.cjs.map +1 -0
- package/dist/agent-runtime/src/chat-outbox-storage.d.ts +194 -0
- package/dist/agent-runtime/src/chat-outbox-storage.js +306 -0
- package/dist/agent-runtime/src/chat-outbox-storage.js.map +1 -0
- package/dist/agent-runtime/src/chat-outbox-thread.cjs +21 -94
- package/dist/agent-runtime/src/chat-outbox-thread.cjs.map +1 -1
- package/dist/agent-runtime/src/chat-outbox-thread.d.ts +22 -18
- package/dist/agent-runtime/src/chat-outbox-thread.js +21 -94
- package/dist/agent-runtime/src/chat-outbox-thread.js.map +1 -1
- package/dist/agent-runtime/src/chat-outbox.cjs +492 -547
- package/dist/agent-runtime/src/chat-outbox.cjs.map +1 -1
- package/dist/agent-runtime/src/chat-outbox.d.ts +110 -142
- package/dist/agent-runtime/src/chat-outbox.js +492 -547
- package/dist/agent-runtime/src/chat-outbox.js.map +1 -1
- package/dist/agent-runtime/src/composer-markdown.cjs.map +1 -1
- package/dist/agent-runtime/src/composer-markdown.d.ts +1 -1
- package/dist/agent-runtime/src/composer-markdown.js.map +1 -1
- package/dist/agent-runtime/src/deep-agent-transport-recipe.cjs +3 -1
- package/dist/agent-runtime/src/deep-agent-transport-recipe.cjs.map +1 -1
- package/dist/agent-runtime/src/deep-agent-transport-recipe.d.ts +8 -1
- package/dist/agent-runtime/src/deep-agent-transport-recipe.js +3 -1
- package/dist/agent-runtime/src/deep-agent-transport-recipe.js.map +1 -1
- package/dist/agent-runtime/src/dictation-preferences.d.ts +356 -0
- package/dist/agent-runtime/src/dictation-record.d.ts +279 -0
- package/dist/agent-runtime/src/dictation-session.d.ts +106 -7
- package/dist/agent-runtime/src/dictation-snippets.d.ts +9 -0
- package/dist/agent-runtime/src/dictation-transfer.d.ts +142 -0
- package/dist/agent-runtime/src/edit-command.cjs.map +1 -1
- package/dist/agent-runtime/src/edit-command.d.ts +1 -1
- package/dist/agent-runtime/src/edit-command.js.map +1 -1
- package/dist/agent-runtime/src/errors.cjs +1 -0
- package/dist/agent-runtime/src/errors.cjs.map +1 -1
- package/dist/agent-runtime/src/errors.js +1 -0
- package/dist/agent-runtime/src/errors.js.map +1 -1
- package/dist/agent-runtime/src/generated/runconfig-contract.cjs +24 -0
- package/dist/agent-runtime/src/generated/runconfig-contract.cjs.map +1 -1
- package/dist/agent-runtime/src/generated/runconfig-contract.d.ts +3 -3
- package/dist/agent-runtime/src/generated/runconfig-contract.js +24 -0
- package/dist/agent-runtime/src/generated/runconfig-contract.js.map +1 -1
- package/dist/agent-runtime/src/index.d.ts +14 -8
- package/dist/agent-runtime/src/lane-follow.cjs +289 -0
- package/dist/agent-runtime/src/lane-follow.cjs.map +1 -0
- package/dist/agent-runtime/src/lane-follow.js +289 -0
- package/dist/agent-runtime/src/lane-follow.js.map +1 -0
- package/dist/agent-runtime/src/lane-images.cjs +387 -0
- package/dist/agent-runtime/src/lane-images.cjs.map +1 -0
- package/dist/agent-runtime/src/lane-images.js +387 -0
- package/dist/agent-runtime/src/lane-images.js.map +1 -0
- package/dist/agent-runtime/src/message-window.js +1 -1
- package/dist/agent-runtime/src/messages.cjs +19 -1
- package/dist/agent-runtime/src/messages.cjs.map +1 -1
- package/dist/agent-runtime/src/messages.d.ts +8 -0
- package/dist/agent-runtime/src/messages.js +21 -3
- package/dist/agent-runtime/src/messages.js.map +1 -1
- package/dist/agent-runtime/src/named-agents.cjs +301 -0
- package/dist/agent-runtime/src/named-agents.cjs.map +1 -0
- package/dist/agent-runtime/src/named-agents.d.ts +246 -0
- package/dist/agent-runtime/src/named-agents.js +301 -0
- package/dist/agent-runtime/src/named-agents.js.map +1 -0
- package/dist/agent-runtime/src/offline-status.cjs.map +1 -1
- package/dist/agent-runtime/src/offline-status.d.ts +66 -2
- package/dist/agent-runtime/src/offline-status.js.map +1 -1
- package/dist/agent-runtime/src/ptc-subcalls.cjs +41 -0
- package/dist/agent-runtime/src/ptc-subcalls.cjs.map +1 -0
- package/dist/agent-runtime/src/ptc-subcalls.js +41 -0
- package/dist/agent-runtime/src/ptc-subcalls.js.map +1 -0
- package/dist/agent-runtime/src/queue.cjs +2 -2
- package/dist/agent-runtime/src/queue.cjs.map +1 -1
- package/dist/agent-runtime/src/queue.d.ts +20 -25
- package/dist/agent-runtime/src/queue.js +2 -2
- package/dist/agent-runtime/src/queue.js.map +1 -1
- package/dist/agent-runtime/src/quota-safe-local-storage-session.cjs +314 -84
- package/dist/agent-runtime/src/quota-safe-local-storage-session.cjs.map +1 -1
- package/dist/agent-runtime/src/quota-safe-local-storage-session.d.ts +137 -40
- package/dist/agent-runtime/src/quota-safe-local-storage-session.js +318 -88
- package/dist/agent-runtime/src/quota-safe-local-storage-session.js.map +1 -1
- package/dist/agent-runtime/src/run-send.cjs +54 -0
- package/dist/agent-runtime/src/run-send.cjs.map +1 -0
- package/dist/agent-runtime/src/run-send.d.ts +51 -0
- package/dist/agent-runtime/src/run-send.js +54 -0
- package/dist/agent-runtime/src/run-send.js.map +1 -0
- package/dist/agent-runtime/src/running-tool-placeholder.cjs +6 -0
- package/dist/agent-runtime/src/running-tool-placeholder.cjs.map +1 -1
- package/dist/agent-runtime/src/running-tool-placeholder.js +6 -0
- package/dist/agent-runtime/src/running-tool-placeholder.js.map +1 -1
- package/dist/agent-runtime/src/runtime.d.ts +9 -5
- package/dist/agent-runtime/src/sealed-idb.cjs +64 -0
- package/dist/agent-runtime/src/sealed-idb.cjs.map +1 -1
- package/dist/agent-runtime/src/sealed-idb.d.ts +16 -0
- package/dist/agent-runtime/src/sealed-idb.js +64 -0
- package/dist/agent-runtime/src/sealed-idb.js.map +1 -1
- package/dist/agent-runtime/src/send-recovery.cjs +90 -118
- package/dist/agent-runtime/src/send-recovery.cjs.map +1 -1
- package/dist/agent-runtime/src/send-recovery.d.ts +25 -29
- package/dist/agent-runtime/src/send-recovery.js +90 -118
- package/dist/agent-runtime/src/send-recovery.js.map +1 -1
- package/dist/agent-runtime/src/statewire-diagnostics.d.ts +4 -1
- package/dist/agent-runtime/src/statewire-held-sends.cjs +191 -0
- package/dist/agent-runtime/src/statewire-held-sends.cjs.map +1 -0
- package/dist/agent-runtime/src/statewire-held-sends.d.ts +119 -0
- package/dist/agent-runtime/src/statewire-held-sends.js +191 -0
- package/dist/agent-runtime/src/statewire-held-sends.js.map +1 -0
- package/dist/agent-runtime/src/statewire-state.cjs +4 -0
- package/dist/agent-runtime/src/statewire-state.cjs.map +1 -1
- package/dist/agent-runtime/src/statewire-state.js +4 -0
- package/dist/agent-runtime/src/statewire-state.js.map +1 -1
- package/dist/agent-runtime/src/statewire-transport.cjs +8 -2
- package/dist/agent-runtime/src/statewire-transport.cjs.map +1 -1
- package/dist/agent-runtime/src/statewire-transport.d.ts +14 -5
- package/dist/agent-runtime/src/statewire-transport.js +8 -2
- package/dist/agent-runtime/src/statewire-transport.js.map +1 -1
- package/dist/agent-runtime/src/subagent-transcripts.cjs +1 -23
- package/dist/agent-runtime/src/subagent-transcripts.cjs.map +1 -1
- package/dist/agent-runtime/src/subagent-transcripts.js +3 -25
- package/dist/agent-runtime/src/subagent-transcripts.js.map +1 -1
- package/dist/agent-runtime/src/subagents.cjs +22 -29
- package/dist/agent-runtime/src/subagents.cjs.map +1 -1
- package/dist/agent-runtime/src/subagents.js +23 -30
- package/dist/agent-runtime/src/subagents.js.map +1 -1
- package/dist/agent-runtime/src/thread-extras.cjs +27 -19
- package/dist/agent-runtime/src/thread-extras.cjs.map +1 -1
- package/dist/agent-runtime/src/thread-extras.d.ts +19 -6
- package/dist/agent-runtime/src/thread-extras.js +27 -19
- package/dist/agent-runtime/src/thread-extras.js.map +1 -1
- package/dist/agent-runtime/src/thread-handoff-flow-machine.d.ts +8 -8
- package/dist/agent-runtime/src/tool-metadata.cjs +12 -0
- package/dist/agent-runtime/src/tool-metadata.cjs.map +1 -1
- package/dist/agent-runtime/src/tool-metadata.js +12 -0
- package/dist/agent-runtime/src/tool-metadata.js.map +1 -1
- package/dist/agent-runtime/src/tool-names.cjs +21 -0
- package/dist/agent-runtime/src/tool-names.cjs.map +1 -1
- package/dist/agent-runtime/src/tool-names.d.ts +8 -0
- package/dist/agent-runtime/src/tool-names.js +21 -0
- package/dist/agent-runtime/src/tool-names.js.map +1 -1
- package/dist/agent-runtime/src/typed-interrupt-kinds.cjs +247 -0
- package/dist/agent-runtime/src/typed-interrupt-kinds.cjs.map +1 -0
- package/dist/agent-runtime/src/typed-interrupt-kinds.d.ts +173 -0
- package/dist/agent-runtime/src/typed-interrupt-kinds.js +247 -0
- package/dist/agent-runtime/src/typed-interrupt-kinds.js.map +1 -0
- package/dist/agent-runtime/src/typed-interrupts.cjs +48 -0
- package/dist/agent-runtime/src/typed-interrupts.cjs.map +1 -0
- package/dist/agent-runtime/src/typed-interrupts.d.ts +75 -0
- package/dist/agent-runtime/src/typed-interrupts.js +48 -0
- package/dist/agent-runtime/src/typed-interrupts.js.map +1 -0
- package/dist/agent-runtime/src/types.d.ts +1 -1
- package/dist/agent-runtime/src/use-conversation-list.cjs +1 -0
- package/dist/agent-runtime/src/use-conversation-list.cjs.map +1 -1
- package/dist/agent-runtime/src/use-conversation-list.d.ts +7 -0
- package/dist/agent-runtime/src/use-conversation-list.js +1 -0
- package/dist/agent-runtime/src/use-conversation-list.js.map +1 -1
- package/dist/agent-runtime/src/use-deep-agent-chat-outbox.cjs +46 -29
- package/dist/agent-runtime/src/use-deep-agent-chat-outbox.cjs.map +1 -1
- package/dist/agent-runtime/src/use-deep-agent-chat-outbox.d.ts +14 -22
- package/dist/agent-runtime/src/use-deep-agent-chat-outbox.js +46 -29
- package/dist/agent-runtime/src/use-deep-agent-chat-outbox.js.map +1 -1
- package/dist/agent-runtime/src/use-deep-agent-runtime.cjs +78 -14
- package/dist/agent-runtime/src/use-deep-agent-runtime.cjs.map +1 -1
- package/dist/agent-runtime/src/use-deep-agent-runtime.d.ts +34 -7
- package/dist/agent-runtime/src/use-deep-agent-runtime.js +79 -15
- package/dist/agent-runtime/src/use-deep-agent-runtime.js.map +1 -1
- package/dist/agent-runtime/src/use-deep-agent-thread.cjs +16 -1
- package/dist/agent-runtime/src/use-deep-agent-thread.cjs.map +1 -1
- package/dist/agent-runtime/src/use-deep-agent-thread.d.ts +7 -2
- package/dist/agent-runtime/src/use-deep-agent-thread.js +16 -1
- package/dist/agent-runtime/src/use-deep-agent-thread.js.map +1 -1
- package/dist/agent-runtime/src/use-deep-agent-voice.cjs +30 -4
- package/dist/agent-runtime/src/use-deep-agent-voice.cjs.map +1 -1
- package/dist/agent-runtime/src/use-deep-agent-voice.d.ts +22 -4
- package/dist/agent-runtime/src/use-deep-agent-voice.js +30 -4
- package/dist/agent-runtime/src/use-deep-agent-voice.js.map +1 -1
- package/dist/agent-runtime/src/withdrawn-turns.d.ts +5 -4
- package/dist/agent-runtime/src/word-device-fit.d.ts +174 -0
- package/dist/agent-runtime/src/work-in.d.ts +127 -0
- package/dist/assets/AthenaAssetEmbed.cjs.map +1 -1
- package/dist/assets/AthenaAssetEmbed.d.ts +6 -1
- package/dist/assets/AthenaAssetEmbed.js.map +1 -1
- package/dist/assets/asset-panel-store.cjs +13 -5
- package/dist/assets/asset-panel-store.cjs.map +1 -1
- package/dist/assets/asset-panel-store.d.ts +33 -2
- package/dist/assets/asset-panel-store.js +13 -5
- package/dist/assets/asset-panel-store.js.map +1 -1
- package/dist/auth/AthenaCredentialSourceContext.cjs +11 -0
- package/dist/auth/AthenaCredentialSourceContext.cjs.map +1 -1
- package/dist/auth/AthenaCredentialSourceContext.d.ts +6 -0
- package/dist/auth/AthenaCredentialSourceContext.js +11 -0
- package/dist/auth/AthenaCredentialSourceContext.js.map +1 -1
- package/dist/auth/account-identity.cjs +13 -2
- package/dist/auth/account-identity.cjs.map +1 -1
- package/dist/auth/account-identity.d.ts +9 -0
- package/dist/auth/account-identity.js +13 -2
- package/dist/auth/account-identity.js.map +1 -1
- package/dist/auth/credential-source.cjs +20 -4
- package/dist/auth/credential-source.cjs.map +1 -1
- package/dist/auth/credential-source.d.ts +9 -0
- package/dist/auth/credential-source.js +20 -4
- package/dist/auth/credential-source.js.map +1 -1
- package/dist/catalog/chat-pickers.cjs +31 -0
- package/dist/catalog/chat-pickers.cjs.map +1 -1
- package/dist/catalog/chat-pickers.d.ts +17 -0
- package/dist/catalog/chat-pickers.js +33 -2
- package/dist/catalog/chat-pickers.js.map +1 -1
- package/dist/catalog/runtime-catalog.cjs +63 -3
- package/dist/catalog/runtime-catalog.cjs.map +1 -1
- package/dist/catalog/runtime-catalog.d.ts +63 -3
- package/dist/catalog/runtime-catalog.js +64 -4
- package/dist/catalog/runtime-catalog.js.map +1 -1
- package/dist/chat/AthenaChat.cjs +337 -99
- package/dist/chat/AthenaChat.cjs.map +1 -1
- package/dist/chat/AthenaChat.d.ts +80 -4
- package/dist/chat/AthenaChat.js +337 -99
- package/dist/chat/AthenaChat.js.map +1 -1
- package/dist/chat/StatewireApprovalCard.cjs +35 -5
- package/dist/chat/StatewireApprovalCard.cjs.map +1 -1
- package/dist/chat/StatewireApprovalCard.d.ts +55 -2
- package/dist/chat/StatewireApprovalCard.js +37 -7
- package/dist/chat/StatewireApprovalCard.js.map +1 -1
- package/dist/chat/StatewireQueuedMessages.cjs +17 -2
- package/dist/chat/StatewireQueuedMessages.cjs.map +1 -1
- package/dist/chat/StatewireQueuedMessages.d.ts +8 -45
- package/dist/chat/StatewireQueuedMessages.js +18 -3
- package/dist/chat/StatewireQueuedMessages.js.map +1 -1
- package/dist/chat/chat-agent-mentions.cjs +70 -0
- package/dist/chat/chat-agent-mentions.cjs.map +1 -0
- package/dist/chat/chat-agent-mentions.d.ts +13 -0
- package/dist/chat/chat-agent-mentions.js +70 -0
- package/dist/chat/chat-agent-mentions.js.map +1 -0
- package/dist/chat/composer-actions.cjs +12 -0
- package/dist/chat/composer-actions.cjs.map +1 -0
- package/dist/chat/composer-actions.d.ts +22 -0
- package/dist/chat/composer-actions.js +12 -0
- package/dist/chat/composer-actions.js.map +1 -0
- package/dist/chat/follow-up-suggestions.cjs +185 -0
- package/dist/chat/follow-up-suggestions.cjs.map +1 -0
- package/dist/chat/follow-up-suggestions.d.ts +64 -0
- package/dist/chat/follow-up-suggestions.js +185 -0
- package/dist/chat/follow-up-suggestions.js.map +1 -0
- package/dist/chat/super-grouping/ToolTimeline.cjs +4 -3
- package/dist/chat/super-grouping/ToolTimeline.cjs.map +1 -1
- package/dist/chat/super-grouping/ToolTimeline.d.ts +7 -3
- package/dist/chat/super-grouping/ToolTimeline.js +4 -3
- package/dist/chat/super-grouping/ToolTimeline.js.map +1 -1
- package/dist/chat/turn-changes.cjs +284 -0
- package/dist/chat/turn-changes.cjs.map +1 -0
- package/dist/chat/turn-changes.d.ts +130 -0
- package/dist/chat/turn-changes.js +284 -0
- package/dist/chat/turn-changes.js.map +1 -0
- package/dist/chat/typed-interrupts/StatewireTypedInterruptCard.cjs +31 -0
- package/dist/chat/typed-interrupts/StatewireTypedInterruptCard.cjs.map +1 -0
- package/dist/chat/typed-interrupts/StatewireTypedInterruptCard.d.ts +31 -0
- package/dist/chat/typed-interrupts/StatewireTypedInterruptCard.js +31 -0
- package/dist/chat/typed-interrupts/StatewireTypedInterruptCard.js.map +1 -0
- package/dist/chat/typed-interrupts/approval-cards.cjs +250 -0
- package/dist/chat/typed-interrupts/approval-cards.cjs.map +1 -0
- package/dist/chat/typed-interrupts/approval-cards.d.ts +22 -0
- package/dist/chat/typed-interrupts/approval-cards.js +250 -0
- package/dist/chat/typed-interrupts/approval-cards.js.map +1 -0
- package/dist/chat/typed-interrupts/form-cards.cjs +289 -0
- package/dist/chat/typed-interrupts/form-cards.cjs.map +1 -0
- package/dist/chat/typed-interrupts/form-cards.d.ts +6 -0
- package/dist/chat/typed-interrupts/form-cards.js +289 -0
- package/dist/chat/typed-interrupts/form-cards.js.map +1 -0
- package/dist/chat/typed-interrupts/interrupt-card-shell.cjs +182 -0
- package/dist/chat/typed-interrupts/interrupt-card-shell.cjs.map +1 -0
- package/dist/chat/typed-interrupts/interrupt-card-shell.d.ts +47 -0
- package/dist/chat/typed-interrupts/interrupt-card-shell.js +182 -0
- package/dist/chat/typed-interrupts/interrupt-card-shell.js.map +1 -0
- package/dist/chat/typed-interrupts/json-schema-form.cjs +388 -0
- package/dist/chat/typed-interrupts/json-schema-form.cjs.map +1 -0
- package/dist/chat/typed-interrupts/json-schema-form.d.ts +33 -0
- package/dist/chat/typed-interrupts/json-schema-form.js +388 -0
- package/dist/chat/typed-interrupts/json-schema-form.js.map +1 -0
- package/dist/chat/typed-interrupts/questionnaire-card.cjs +449 -0
- package/dist/chat/typed-interrupts/questionnaire-card.cjs.map +1 -0
- package/dist/chat/typed-interrupts/questionnaire-card.d.ts +20 -0
- package/dist/chat/typed-interrupts/questionnaire-card.js +449 -0
- package/dist/chat/typed-interrupts/questionnaire-card.js.map +1 -0
- package/dist/chat/typed-interrupts/request-file-card.cjs +159 -0
- package/dist/chat/typed-interrupts/request-file-card.cjs.map +1 -0
- package/dist/chat/typed-interrupts/request-file-card.d.ts +2 -0
- package/dist/chat/typed-interrupts/request-file-card.js +159 -0
- package/dist/chat/typed-interrupts/request-file-card.js.map +1 -0
- package/dist/chat/typed-interrupts/toolkit-selection-card.cjs +189 -0
- package/dist/chat/typed-interrupts/toolkit-selection-card.cjs.map +1 -0
- package/dist/chat/typed-interrupts/toolkit-selection-card.d.ts +23 -0
- package/dist/chat/typed-interrupts/toolkit-selection-card.js +189 -0
- package/dist/chat/typed-interrupts/toolkit-selection-card.js.map +1 -0
- package/dist/chat/typed-interrupts/typed-interrupt-body.cjs +26 -0
- package/dist/chat/typed-interrupts/typed-interrupt-body.cjs.map +1 -0
- package/dist/chat/typed-interrupts/typed-interrupt-body.d.ts +3 -0
- package/dist/chat/typed-interrupts/typed-interrupt-body.js +26 -0
- package/dist/chat/typed-interrupts/typed-interrupt-body.js.map +1 -0
- package/dist/chat/typed-interrupts/typed-interrupt-graphql.cjs +105 -0
- package/dist/chat/typed-interrupts/typed-interrupt-graphql.cjs.map +1 -0
- package/dist/chat/typed-interrupts/typed-interrupt-graphql.d.ts +29 -0
- package/dist/chat/typed-interrupts/typed-interrupt-graphql.js +105 -0
- package/dist/chat/typed-interrupts/typed-interrupt-graphql.js.map +1 -0
- package/dist/chat/typed-interrupts/typed-interrupt-notice.cjs +70 -0
- package/dist/chat/typed-interrupts/typed-interrupt-notice.cjs.map +1 -0
- package/dist/chat/typed-interrupts/typed-interrupt-notice.d.ts +45 -0
- package/dist/chat/typed-interrupts/typed-interrupt-notice.js +70 -0
- package/dist/chat/typed-interrupts/typed-interrupt-notice.js.map +1 -0
- package/dist/chat/typed-interrupts/typed-interrupt-panel.cjs +76 -0
- package/dist/chat/typed-interrupts/typed-interrupt-panel.cjs.map +1 -0
- package/dist/chat/typed-interrupts/typed-interrupt-panel.d.ts +11 -0
- package/dist/chat/typed-interrupts/typed-interrupt-panel.js +76 -0
- package/dist/chat/typed-interrupts/typed-interrupt-panel.js.map +1 -0
- package/dist/chat/typed-interrupts/typed-interrupt-types.d.ts +46 -0
- package/dist/chat/typed-interrupts/use-interrupt-draft.cjs +106 -0
- package/dist/chat/typed-interrupts/use-interrupt-draft.cjs.map +1 -0
- package/dist/chat/typed-interrupts/use-interrupt-draft.d.ts +29 -0
- package/dist/chat/typed-interrupts/use-interrupt-draft.js +106 -0
- package/dist/chat/typed-interrupts/use-interrupt-draft.js.map +1 -0
- package/dist/chat/typed-interrupts/use-statewire-typed-interrupt.cjs +231 -0
- package/dist/chat/typed-interrupts/use-statewire-typed-interrupt.cjs.map +1 -0
- package/dist/chat/typed-interrupts/use-statewire-typed-interrupt.d.ts +66 -0
- package/dist/chat/typed-interrupts/use-statewire-typed-interrupt.js +231 -0
- package/dist/chat/typed-interrupts/use-statewire-typed-interrupt.js.map +1 -0
- package/dist/chat-ui/composer/composer-named-agents.cjs +13 -0
- package/dist/chat-ui/composer/composer-named-agents.cjs.map +1 -0
- package/dist/chat-ui/composer/composer-named-agents.d.ts +20 -0
- package/dist/chat-ui/composer/composer-named-agents.js +13 -0
- package/dist/chat-ui/composer/composer-named-agents.js.map +1 -0
- package/dist/chat-ui/composer/slash-command-menu.cjs +143 -0
- package/dist/chat-ui/composer/slash-command-menu.cjs.map +1 -0
- package/dist/chat-ui/composer/slash-command-menu.d.ts +19 -0
- package/dist/chat-ui/composer/slash-command-menu.js +143 -0
- package/dist/chat-ui/composer/slash-command-menu.js.map +1 -0
- package/dist/chat-ui/composer/slash-commands-extension.cjs +51 -0
- package/dist/chat-ui/composer/slash-commands-extension.cjs.map +1 -0
- package/dist/chat-ui/composer/slash-commands-extension.d.ts +39 -0
- package/dist/chat-ui/composer/slash-commands-extension.js +51 -0
- package/dist/chat-ui/composer/slash-commands-extension.js.map +1 -0
- package/dist/chat-ui/composer/slash-commands.cjs +74 -0
- package/dist/chat-ui/composer/slash-commands.cjs.map +1 -0
- package/dist/chat-ui/composer/slash-commands.d.ts +82 -0
- package/dist/chat-ui/composer/slash-commands.js +74 -0
- package/dist/chat-ui/composer/slash-commands.js.map +1 -0
- package/dist/chat-ui/composer/tiptap-composer.cjs +135 -9
- package/dist/chat-ui/composer/tiptap-composer.cjs.map +1 -1
- package/dist/chat-ui/composer/tiptap-composer.d.ts +61 -2
- package/dist/chat-ui/composer/tiptap-composer.js +135 -9
- package/dist/chat-ui/composer/tiptap-composer.js.map +1 -1
- package/dist/chat-ui/index.cjs +3 -0
- package/dist/chat-ui/index.cjs.map +1 -1
- package/dist/chat-ui/index.d.ts +3 -2
- package/dist/chat-ui/index.js +3 -0
- package/dist/chat-ui/index.js.map +1 -1
- package/dist/chat-ui/mentions/mention-chip.cjs +1 -1
- package/dist/chat-ui/mentions/mention-chip.cjs.map +1 -1
- package/dist/chat-ui/mentions/mention-chip.js +2 -2
- package/dist/chat-ui/mentions/mention-chip.js.map +1 -1
- package/dist/chat-ui/mentions/mention-extension.cjs +8 -1
- package/dist/chat-ui/mentions/mention-extension.cjs.map +1 -1
- package/dist/chat-ui/mentions/mention-extension.js +8 -1
- package/dist/chat-ui/mentions/mention-extension.js.map +1 -1
- package/dist/chat-ui/mentions/suggestions/components/get-scope-name.cjs +1 -0
- package/dist/chat-ui/mentions/suggestions/components/get-scope-name.cjs.map +1 -1
- package/dist/chat-ui/mentions/suggestions/components/get-scope-name.js +1 -0
- package/dist/chat-ui/mentions/suggestions/components/get-scope-name.js.map +1 -1
- package/dist/chat-ui/mentions/suggestions/components/mention-icon.cjs +2 -0
- package/dist/chat-ui/mentions/suggestions/components/mention-icon.cjs.map +1 -1
- package/dist/chat-ui/mentions/suggestions/components/mention-icon.js +3 -1
- package/dist/chat-ui/mentions/suggestions/components/mention-icon.js.map +1 -1
- package/dist/chat-ui/mentions/suggestions/components/menu-item.cjs +1 -1
- package/dist/chat-ui/mentions/suggestions/components/menu-item.cjs.map +1 -1
- package/dist/chat-ui/mentions/suggestions/components/menu-item.js +1 -1
- package/dist/chat-ui/mentions/suggestions/components/menu-item.js.map +1 -1
- package/dist/chat-ui/mentions/suggestions/data/api-client.cjs +36 -0
- package/dist/chat-ui/mentions/suggestions/data/api-client.cjs.map +1 -1
- package/dist/chat-ui/mentions/suggestions/data/api-client.d.ts +42 -0
- package/dist/chat-ui/mentions/suggestions/data/api-client.js +36 -0
- package/dist/chat-ui/mentions/suggestions/data/api-client.js.map +1 -1
- package/dist/chat-ui/mentions/suggestions/data/sources/index.cjs +235 -19
- package/dist/chat-ui/mentions/suggestions/data/sources/index.cjs.map +1 -1
- package/dist/chat-ui/mentions/suggestions/data/sources/index.d.ts +88 -10
- package/dist/chat-ui/mentions/suggestions/data/sources/index.js +236 -20
- package/dist/chat-ui/mentions/suggestions/data/sources/index.js.map +1 -1
- package/dist/chat-ui/mentions/suggestions/data/types.cjs.map +1 -1
- package/dist/chat-ui/mentions/suggestions/data/types.d.ts +27 -1
- package/dist/chat-ui/mentions/suggestions/data/types.js.map +1 -1
- package/dist/chat-ui/mentions/suggestions/data/use-mention-suggestions.cjs +56 -5
- package/dist/chat-ui/mentions/suggestions/data/use-mention-suggestions.cjs.map +1 -1
- package/dist/chat-ui/mentions/suggestions/data/use-mention-suggestions.d.ts +26 -6
- package/dist/chat-ui/mentions/suggestions/data/use-mention-suggestions.js +57 -6
- package/dist/chat-ui/mentions/suggestions/data/use-mention-suggestions.js.map +1 -1
- package/dist/chat-ui/mentions/suggestions/mention-suggestions.extension.cjs +34 -17
- package/dist/chat-ui/mentions/suggestions/mention-suggestions.extension.cjs.map +1 -1
- package/dist/chat-ui/mentions/suggestions/mention-suggestions.extension.d.ts +19 -1
- package/dist/chat-ui/mentions/suggestions/mention-suggestions.extension.js +35 -18
- package/dist/chat-ui/mentions/suggestions/mention-suggestions.extension.js.map +1 -1
- package/dist/chat-ui/statewire.d.ts +1 -1
- package/dist/chat-ui/thread/statewire-history-edge.cjs +15 -0
- package/dist/chat-ui/thread/statewire-history-edge.cjs.map +1 -1
- package/dist/chat-ui/thread/statewire-history-edge.d.ts +4 -1
- package/dist/chat-ui/thread/statewire-history-edge.js +15 -0
- package/dist/chat-ui/thread/statewire-history-edge.js.map +1 -1
- package/dist/collab/client.cjs +17 -5
- package/dist/collab/client.cjs.map +1 -1
- package/dist/collab/client.d.ts +22 -7
- package/dist/collab/client.js +17 -5
- package/dist/collab/client.js.map +1 -1
- package/dist/composer/ComposerAttachedReferences.cjs +119 -0
- package/dist/composer/ComposerAttachedReferences.cjs.map +1 -0
- package/dist/composer/ComposerAttachedReferences.d.ts +26 -0
- package/dist/composer/ComposerAttachedReferences.js +119 -0
- package/dist/composer/ComposerAttachedReferences.js.map +1 -0
- package/dist/composer/ComposerNamedAgents.cjs +63 -0
- package/dist/composer/ComposerNamedAgents.cjs.map +1 -0
- package/dist/composer/ComposerNamedAgents.d.ts +16 -0
- package/dist/composer/ComposerNamedAgents.js +63 -0
- package/dist/composer/ComposerNamedAgents.js.map +1 -0
- package/dist/composer/attached-references.cjs +159 -0
- package/dist/composer/attached-references.cjs.map +1 -0
- package/dist/composer/attached-references.d.ts +86 -0
- package/dist/composer/attached-references.js +159 -0
- package/dist/composer/attached-references.js.map +1 -0
- package/dist/composer/build-composed-message.cjs +14 -7
- package/dist/composer/build-composed-message.cjs.map +1 -1
- package/dist/composer/build-composed-message.d.ts +6 -1
- package/dist/composer/build-composed-message.js +14 -7
- package/dist/composer/build-composed-message.js.map +1 -1
- package/dist/composer/composer-handoff.cjs +6 -2
- package/dist/composer/composer-handoff.cjs.map +1 -1
- package/dist/composer/composer-handoff.d.ts +7 -1
- package/dist/composer/composer-handoff.js +6 -2
- package/dist/composer/composer-handoff.js.map +1 -1
- package/dist/composer/folder-upload.cjs +149 -0
- package/dist/composer/folder-upload.cjs.map +1 -0
- package/dist/composer/folder-upload.d.ts +79 -0
- package/dist/composer/folder-upload.js +149 -0
- package/dist/composer/folder-upload.js.map +1 -0
- package/dist/composer/index.d.ts +1 -1
- package/dist/composer/useAttachToChat.cjs +35 -0
- package/dist/composer/useAttachToChat.cjs.map +1 -0
- package/dist/composer/useAttachToChat.d.ts +54 -0
- package/dist/composer/useAttachToChat.js +35 -0
- package/dist/composer/useAttachToChat.js.map +1 -0
- package/dist/composer/useAttachedReferencesComposerProps.cjs +19 -0
- package/dist/composer/useAttachedReferencesComposerProps.cjs.map +1 -0
- package/dist/composer/useAttachedReferencesComposerProps.d.ts +12 -0
- package/dist/composer/useAttachedReferencesComposerProps.js +19 -0
- package/dist/composer/useAttachedReferencesComposerProps.js.map +1 -0
- package/dist/composer/useFileUpload.cjs +95 -7
- package/dist/composer/useFileUpload.cjs.map +1 -1
- package/dist/composer/useFileUpload.d.ts +21 -2
- package/dist/composer/useFileUpload.js +95 -7
- package/dist/composer/useFileUpload.js.map +1 -1
- package/dist/data/athena-api-error.cjs +125 -0
- package/dist/data/athena-api-error.cjs.map +1 -0
- package/dist/data/athena-api-error.d.ts +96 -0
- package/dist/data/athena-api-error.js +125 -0
- package/dist/data/athena-api-error.js.map +1 -0
- package/dist/data/athena-data-client.cjs +106 -0
- package/dist/data/athena-data-client.cjs.map +1 -0
- package/dist/data/athena-data-client.d.ts +74 -0
- package/dist/data/athena-data-client.js +106 -0
- package/dist/data/athena-data-client.js.map +1 -0
- package/dist/data/athena-member.cjs +93 -0
- package/dist/data/athena-member.cjs.map +1 -0
- package/dist/data/athena-member.d.ts +125 -0
- package/dist/data/athena-member.js +93 -0
- package/dist/data/athena-member.js.map +1 -0
- package/dist/data/athena-request.cjs +458 -0
- package/dist/data/athena-request.cjs.map +1 -0
- package/dist/data/athena-request.d.ts +120 -0
- package/dist/data/athena-request.js +458 -0
- package/dist/data/athena-request.js.map +1 -0
- package/dist/data/use-athena-fetch.cjs +14 -0
- package/dist/data/use-athena-fetch.cjs.map +1 -0
- package/dist/data/use-athena-fetch.d.ts +19 -0
- package/dist/data/use-athena-fetch.js +14 -0
- package/dist/data/use-athena-fetch.js.map +1 -0
- package/dist/data/use-athena-graphql.cjs +66 -0
- package/dist/data/use-athena-graphql.cjs.map +1 -0
- package/dist/data/use-athena-graphql.d.ts +56 -0
- package/dist/data/use-athena-graphql.js +66 -0
- package/dist/data/use-athena-graphql.js.map +1 -0
- package/dist/data/use-athena-rest.cjs +33 -0
- package/dist/data/use-athena-rest.cjs.map +1 -0
- package/dist/data/use-athena-rest.d.ts +21 -0
- package/dist/data/use-athena-rest.js +33 -0
- package/dist/data/use-athena-rest.js.map +1 -0
- package/dist/data/use-semantic-query.cjs +44 -0
- package/dist/data/use-semantic-query.cjs.map +1 -0
- package/dist/data/use-semantic-query.d.ts +92 -0
- package/dist/data/use-semantic-query.js +44 -0
- package/dist/data/use-semantic-query.js.map +1 -0
- package/dist/diagnostics/athena-diagnostics.cjs.map +1 -1
- package/dist/diagnostics/athena-diagnostics.d.ts +5 -1
- package/dist/diagnostics/athena-diagnostics.js.map +1 -1
- package/dist/diagnostics/errors.cjs +7 -0
- package/dist/diagnostics/errors.cjs.map +1 -1
- package/dist/diagnostics/errors.d.ts +7 -0
- package/dist/diagnostics/errors.js +7 -0
- package/dist/diagnostics/errors.js.map +1 -1
- package/dist/index.cjs +155 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +72 -13
- package/dist/index.js +148 -4
- package/dist/index.js.map +1 -1
- package/dist/keryx-http/src/initial-sync.cjs +64 -16
- package/dist/keryx-http/src/initial-sync.cjs.map +1 -1
- package/dist/keryx-http/src/initial-sync.d.ts +31 -1
- package/dist/keryx-http/src/initial-sync.js +64 -16
- package/dist/keryx-http/src/initial-sync.js.map +1 -1
- package/dist/keryx-http/src/own-awareness.cjs +20 -0
- package/dist/keryx-http/src/own-awareness.cjs.map +1 -0
- package/dist/keryx-http/src/own-awareness.d.ts +50 -0
- package/dist/keryx-http/src/own-awareness.js +20 -0
- package/dist/keryx-http/src/own-awareness.js.map +1 -0
- package/dist/keryx-http/src/update-attributions.cjs +26 -1
- package/dist/keryx-http/src/update-attributions.cjs.map +1 -1
- package/dist/keryx-http/src/update-attributions.d.ts +10 -1
- package/dist/keryx-http/src/update-attributions.js +26 -1
- package/dist/keryx-http/src/update-attributions.js.map +1 -1
- package/dist/offline/chat-outbox.cjs +262 -26
- package/dist/offline/chat-outbox.cjs.map +1 -1
- package/dist/offline/chat-outbox.d.ts +90 -12
- package/dist/offline/chat-outbox.js +263 -27
- package/dist/offline/chat-outbox.js.map +1 -1
- package/dist/provider/AthenaProvider.cjs +63 -19
- package/dist/provider/AthenaProvider.cjs.map +1 -1
- package/dist/provider/AthenaProvider.d.ts +24 -8
- package/dist/provider/AthenaProvider.js +66 -22
- package/dist/provider/AthenaProvider.js.map +1 -1
- package/dist/react/package.json.cjs +1 -1
- package/dist/react/package.json.js +1 -1
- package/dist/references/src/anchors/types.cjs +5 -0
- package/dist/references/src/anchors/types.cjs.map +1 -1
- package/dist/references/src/anchors/types.js +5 -0
- package/dist/references/src/anchors/types.js.map +1 -1
- package/dist/references/src/attachable.cjs +149 -0
- package/dist/references/src/attachable.cjs.map +1 -0
- package/dist/references/src/attachable.d.ts +87 -0
- package/dist/references/src/attachable.js +149 -0
- package/dist/references/src/attachable.js.map +1 -0
- package/dist/runtime/StatewirePlanModeLaneSync.cjs +93 -0
- package/dist/runtime/StatewirePlanModeLaneSync.cjs.map +1 -0
- package/dist/runtime/StatewirePlanModeLaneSync.d.ts +34 -0
- package/dist/runtime/StatewirePlanModeLaneSync.js +93 -0
- package/dist/runtime/StatewirePlanModeLaneSync.js.map +1 -0
- package/dist/runtime/StatewireThreadConfigLaneSync.cjs +2 -0
- package/dist/runtime/StatewireThreadConfigLaneSync.cjs.map +1 -1
- package/dist/runtime/StatewireThreadConfigLaneSync.d.ts +4 -0
- package/dist/runtime/StatewireThreadConfigLaneSync.js +2 -0
- package/dist/runtime/StatewireThreadConfigLaneSync.js.map +1 -1
- package/dist/runtime/statewire-plan-mode.cjs +71 -0
- package/dist/runtime/statewire-plan-mode.cjs.map +1 -0
- package/dist/runtime/statewire-plan-mode.d.ts +88 -0
- package/dist/runtime/statewire-plan-mode.js +71 -0
- package/dist/runtime/statewire-plan-mode.js.map +1 -0
- package/dist/runtime/statewire-run-config.cjs +18 -1
- package/dist/runtime/statewire-run-config.cjs.map +1 -1
- package/dist/runtime/statewire-run-config.d.ts +20 -0
- package/dist/runtime/statewire-run-config.js +18 -1
- package/dist/runtime/statewire-run-config.js.map +1 -1
- package/dist/runtime/statewire-session-key.cjs +11 -5
- package/dist/runtime/statewire-session-key.cjs.map +1 -1
- package/dist/runtime/statewire-session-key.d.ts +22 -10
- package/dist/runtime/statewire-session-key.js +11 -5
- package/dist/runtime/statewire-session-key.js.map +1 -1
- package/dist/runtime/useAthenaStatewireRuntime.cjs +65 -8
- package/dist/runtime/useAthenaStatewireRuntime.cjs.map +1 -1
- package/dist/runtime/useAthenaStatewireRuntime.d.ts +26 -10
- package/dist/runtime/useAthenaStatewireRuntime.js +67 -10
- package/dist/runtime/useAthenaStatewireRuntime.js.map +1 -1
- package/dist/search/useAthenaAssets.cjs +394 -0
- package/dist/search/useAthenaAssets.cjs.map +1 -0
- package/dist/search/useAthenaAssets.d.ts +186 -0
- package/dist/search/useAthenaAssets.js +394 -0
- package/dist/search/useAthenaAssets.js.map +1 -0
- package/dist/sheet-range/index.cjs +4 -0
- package/dist/sheet-range/index.cjs.map +1 -1
- package/dist/sheet-range/index.d.ts +4 -2
- package/dist/sheet-range/index.js +4 -0
- package/dist/sheet-range/index.js.map +1 -1
- package/dist/sheet-range/query-range.cjs +102 -0
- package/dist/sheet-range/query-range.cjs.map +1 -0
- package/dist/sheet-range/query-range.d.ts +46 -0
- package/dist/sheet-range/query-range.js +102 -0
- package/dist/sheet-range/query-range.js.map +1 -0
- package/dist/styles.css +1 -1
- package/dist/subagents/index.cjs +49 -0
- package/dist/subagents/index.cjs.map +1 -0
- package/dist/subagents/index.d.ts +16 -0
- package/dist/subagents/index.js +49 -0
- package/dist/subagents/index.js.map +1 -0
- package/dist/subagents/lane-follow.cjs +19 -0
- package/dist/subagents/lane-follow.cjs.map +1 -0
- package/dist/subagents/lane-follow.d.ts +9 -0
- package/dist/subagents/lane-follow.js +19 -0
- package/dist/subagents/lane-follow.js.map +1 -0
- package/dist/subagents/lane-model.cjs +178 -0
- package/dist/subagents/lane-model.cjs.map +1 -0
- package/dist/subagents/lane-model.d.ts +140 -0
- package/dist/subagents/lane-model.js +178 -0
- package/dist/subagents/lane-model.js.map +1 -0
- package/dist/subagents/lane-parts.cjs +517 -0
- package/dist/subagents/lane-parts.cjs.map +1 -0
- package/dist/subagents/lane-parts.d.ts +130 -0
- package/dist/subagents/lane-parts.js +517 -0
- package/dist/subagents/lane-parts.js.map +1 -0
- package/dist/subagents/subagent-lane-group.cjs +215 -0
- package/dist/subagents/subagent-lane-group.cjs.map +1 -0
- package/dist/subagents/subagent-lane-group.d.ts +67 -0
- package/dist/subagents/subagent-lane-group.js +215 -0
- package/dist/subagents/subagent-lane-group.js.map +1 -0
- package/dist/subagents/subagent-transcript-drawer.cjs +431 -0
- package/dist/subagents/subagent-transcript-drawer.cjs.map +1 -0
- package/dist/subagents/subagent-transcript-drawer.d.ts +78 -0
- package/dist/subagents/subagent-transcript-drawer.js +431 -0
- package/dist/subagents/subagent-transcript-drawer.js.map +1 -0
- package/dist/subagents/task-subagent-group.cjs +115 -0
- package/dist/subagents/task-subagent-group.cjs.map +1 -0
- package/dist/subagents/task-subagent-group.d.ts +36 -0
- package/dist/subagents/task-subagent-group.js +115 -0
- package/dist/subagents/task-subagent-group.js.map +1 -0
- package/dist/subagents/use-omitted-images-in-view.cjs +68 -0
- package/dist/subagents/use-omitted-images-in-view.cjs.map +1 -0
- package/dist/subagents/use-omitted-images-in-view.d.ts +21 -0
- package/dist/subagents/use-omitted-images-in-view.js +68 -0
- package/dist/subagents/use-omitted-images-in-view.js.map +1 -0
- package/dist/threads/Inbox.cjs +2 -2
- package/dist/threads/Inbox.cjs.map +1 -1
- package/dist/threads/SessionList.cjs +27 -24
- package/dist/threads/SessionList.cjs.map +1 -1
- package/dist/threads/SessionList.js +22 -19
- package/dist/threads/SessionList.js.map +1 -1
- package/dist/threads/SessionsPage.cjs +13 -7
- package/dist/threads/SessionsPage.cjs.map +1 -1
- package/dist/threads/SessionsPage.d.ts +10 -1
- package/dist/threads/SessionsPage.js +9 -3
- package/dist/threads/SessionsPage.js.map +1 -1
- package/dist/threads/live-session-rows.cjs +207 -0
- package/dist/threads/live-session-rows.cjs.map +1 -0
- package/dist/threads/live-session-rows.d.ts +175 -0
- package/dist/threads/live-session-rows.js +207 -0
- package/dist/threads/live-session-rows.js.map +1 -0
- package/dist/threads/session-list-model.cjs.map +1 -1
- package/dist/threads/session-list-model.d.ts +2 -1
- package/dist/threads/session-list-model.js.map +1 -1
- package/dist/threads/session-row-parts.cjs +3 -3
- package/dist/threads/session-row-parts.cjs.map +1 -1
- package/dist/threads/sessions-page-model.cjs +13 -5
- package/dist/threads/sessions-page-model.cjs.map +1 -1
- package/dist/threads/sessions-page-model.d.ts +7 -0
- package/dist/threads/sessions-page-model.js +11 -3
- package/dist/threads/sessions-page-model.js.map +1 -1
- package/dist/threads/sessions-page-storage.cjs +8 -8
- package/dist/threads/sessions-page-storage.cjs.map +1 -1
- package/dist/threads/sessions-page-storage.d.ts +5 -1
- package/dist/threads/sessions-page-storage.js +8 -8
- package/dist/threads/sessions-page-storage.js.map +1 -1
- package/dist/threads/statewire-thread-list.cjs +173 -20
- package/dist/threads/statewire-thread-list.cjs.map +1 -1
- package/dist/threads/statewire-thread-list.d.ts +44 -1
- package/dist/threads/statewire-thread-list.js +174 -21
- package/dist/threads/statewire-thread-list.js.map +1 -1
- package/dist/threads/use-athena-sessions.cjs +1 -0
- package/dist/threads/use-athena-sessions.cjs.map +1 -1
- package/dist/threads/use-athena-sessions.d.ts +7 -0
- package/dist/threads/use-athena-sessions.js +1 -0
- package/dist/threads/use-athena-sessions.js.map +1 -1
- package/dist/threads/use-athena-thread-agent.cjs +31 -0
- package/dist/threads/use-athena-thread-agent.cjs.map +1 -0
- package/dist/threads/use-athena-thread-agent.d.ts +38 -0
- package/dist/threads/use-athena-thread-agent.js +31 -0
- package/dist/threads/use-athena-thread-agent.js.map +1 -0
- package/dist/threads/use-athena-thread-plan-mode.cjs +18 -0
- package/dist/threads/use-athena-thread-plan-mode.cjs.map +1 -0
- package/dist/threads/use-athena-thread-plan-mode.d.ts +18 -0
- package/dist/threads/use-athena-thread-plan-mode.js +18 -0
- package/dist/threads/use-athena-thread-plan-mode.js.map +1 -0
- package/dist/threads/use-rest-conversation-history.d.ts +1 -0
- package/dist/tools/agent-creations.cjs +97 -0
- package/dist/tools/agent-creations.cjs.map +1 -0
- package/dist/tools/agent-creations.d.ts +38 -0
- package/dist/tools/agent-creations.js +97 -0
- package/dist/tools/agent-creations.js.map +1 -0
- package/dist/tools/agent-highlights.cjs +100 -0
- package/dist/tools/agent-highlights.cjs.map +1 -0
- package/dist/tools/agent-highlights.d.ts +57 -0
- package/dist/tools/agent-highlights.js +100 -0
- package/dist/tools/agent-highlights.js.map +1 -0
- package/dist/tools/append-document-tool-ui.cjs +1 -0
- package/dist/tools/append-document-tool-ui.cjs.map +1 -1
- package/dist/tools/append-document-tool-ui.d.ts +7 -0
- package/dist/tools/append-document-tool-ui.js +2 -1
- package/dist/tools/append-document-tool-ui.js.map +1 -1
- package/dist/tools/auto-open-tools.cjs +144 -71
- package/dist/tools/auto-open-tools.cjs.map +1 -1
- package/dist/tools/auto-open-tools.d.ts +131 -1
- package/dist/tools/auto-open-tools.js +145 -72
- package/dist/tools/auto-open-tools.js.map +1 -1
- package/dist/tools/browser-tool-uis.cjs +594 -0
- package/dist/tools/browser-tool-uis.cjs.map +1 -0
- package/dist/tools/browser-tool-uis.d.ts +8 -0
- package/dist/tools/browser-tool-uis.js +594 -0
- package/dist/tools/browser-tool-uis.js.map +1 -0
- package/dist/tools/computer-asset-tool-uis.cjs +313 -0
- package/dist/tools/computer-asset-tool-uis.cjs.map +1 -0
- package/dist/tools/computer-asset-tool-uis.d.ts +5 -0
- package/dist/tools/computer-asset-tool-uis.js +313 -0
- package/dist/tools/computer-asset-tool-uis.js.map +1 -0
- package/dist/tools/document-edit-tool-uis.cjs +218 -0
- package/dist/tools/document-edit-tool-uis.cjs.map +1 -0
- package/dist/tools/document-edit-tool-uis.d.ts +40 -0
- package/dist/tools/document-edit-tool-uis.js +218 -0
- package/dist/tools/document-edit-tool-uis.js.map +1 -0
- package/dist/tools/drive-tool-uis.cjs +425 -0
- package/dist/tools/drive-tool-uis.cjs.map +1 -0
- package/dist/tools/drive-tool-uis.d.ts +120 -0
- package/dist/tools/drive-tool-uis.js +425 -0
- package/dist/tools/drive-tool-uis.js.map +1 -0
- package/dist/tools/email-calendar-tool-uis.cjs +789 -0
- package/dist/tools/email-calendar-tool-uis.cjs.map +1 -0
- package/dist/tools/email-calendar-tool-uis.d.ts +129 -0
- package/dist/tools/email-calendar-tool-uis.js +789 -0
- package/dist/tools/email-calendar-tool-uis.js.map +1 -0
- package/dist/tools/ontology-tool-uis.cjs +83 -0
- package/dist/tools/ontology-tool-uis.cjs.map +1 -0
- package/dist/tools/ontology-tool-uis.d.ts +9 -0
- package/dist/tools/ontology-tool-uis.js +83 -0
- package/dist/tools/ontology-tool-uis.js.map +1 -0
- package/dist/tools/orchestration-tool-uis.cjs +586 -0
- package/dist/tools/orchestration-tool-uis.cjs.map +1 -0
- package/dist/tools/orchestration-tool-uis.d.ts +141 -0
- package/dist/tools/orchestration-tool-uis.js +586 -0
- package/dist/tools/orchestration-tool-uis.js.map +1 -0
- package/dist/tools/presentation-edit-tool-uis.cjs +516 -0
- package/dist/tools/presentation-edit-tool-uis.cjs.map +1 -0
- package/dist/tools/presentation-edit-tool-uis.d.ts +73 -0
- package/dist/tools/presentation-edit-tool-uis.js +516 -0
- package/dist/tools/presentation-edit-tool-uis.js.map +1 -0
- package/dist/tools/project-tool-uis.cjs +213 -0
- package/dist/tools/project-tool-uis.cjs.map +1 -0
- package/dist/tools/project-tool-uis.d.ts +14 -0
- package/dist/tools/project-tool-uis.js +213 -0
- package/dist/tools/project-tool-uis.js.map +1 -0
- package/dist/tools/sandbox-tool-uis.cjs +491 -0
- package/dist/tools/sandbox-tool-uis.cjs.map +1 -0
- package/dist/tools/sandbox-tool-uis.d.ts +116 -0
- package/dist/tools/sandbox-tool-uis.js +491 -0
- package/dist/tools/sandbox-tool-uis.js.map +1 -0
- package/dist/tools/sheet-query-tool-ui.cjs +138 -0
- package/dist/tools/sheet-query-tool-ui.cjs.map +1 -0
- package/dist/tools/sheet-query-tool-ui.d.ts +15 -0
- package/dist/tools/sheet-query-tool-ui.js +138 -0
- package/dist/tools/sheet-query-tool-ui.js.map +1 -0
- package/dist/tools/studio-screenshot-tool-uis.cjs +262 -0
- package/dist/tools/studio-screenshot-tool-uis.cjs.map +1 -0
- package/dist/tools/studio-screenshot-tool-uis.d.ts +52 -0
- package/dist/tools/studio-screenshot-tool-uis.js +262 -0
- package/dist/tools/studio-screenshot-tool-uis.js.map +1 -0
- package/dist/tools/subagent-task-tool-ui.cjs +24 -475
- package/dist/tools/subagent-task-tool-ui.cjs.map +1 -1
- package/dist/tools/subagent-task-tool-ui.d.ts +19 -103
- package/dist/tools/subagent-task-tool-ui.js +28 -479
- package/dist/tools/subagent-task-tool-ui.js.map +1 -1
- package/dist/tools/tool-summary.cjs +36 -0
- package/dist/tools/tool-summary.cjs.map +1 -1
- package/dist/tools/tool-summary.js +36 -0
- package/dist/tools/tool-summary.js.map +1 -1
- package/dist/tools/tool-uis.cjs +181 -53
- package/dist/tools/tool-uis.cjs.map +1 -1
- package/dist/tools/tool-uis.d.ts +40 -0
- package/dist/tools/tool-uis.js +183 -55
- package/dist/tools/tool-uis.js.map +1 -1
- package/dist/typed-interrupts/index.cjs +15 -0
- package/dist/typed-interrupts/index.cjs.map +1 -0
- package/dist/typed-interrupts/index.d.ts +20 -0
- package/dist/typed-interrupts/index.js +15 -0
- package/dist/typed-interrupts/index.js.map +1 -0
- package/dist/workbench/session-workbench-panes.cjs +6 -6
- package/dist/workbench/session-workbench-panes.cjs.map +1 -1
- package/package.json +28 -6
- package/dist/agent-runtime/src/chat-outbox-store.cjs +0 -510
- package/dist/agent-runtime/src/chat-outbox-store.cjs.map +0 -1
- package/dist/agent-runtime/src/chat-outbox-store.d.ts +0 -210
- package/dist/agent-runtime/src/chat-outbox-store.js +0 -510
- package/dist/agent-runtime/src/chat-outbox-store.js.map +0 -1
|
@@ -0,0 +1,789 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
+
const require$$0 = require("react");
|
|
5
|
+
const lucideReact = require("lucide-react");
|
|
6
|
+
const assetPanelStore = require("../assets/asset-panel-store.cjs");
|
|
7
|
+
const documentEditToolUis = require("./document-edit-tool-uis.cjs");
|
|
8
|
+
const primitives = require("./primitives.cjs");
|
|
9
|
+
const toolFallback = require("./tool-fallback.cjs");
|
|
10
|
+
const toolResult = require("../agent-runtime/src/tool-result.cjs");
|
|
11
|
+
const cnfast = require("cnfast");
|
|
12
|
+
function recordOf(value) {
|
|
13
|
+
return toolResult.isRecord(value) ? value : {};
|
|
14
|
+
}
|
|
15
|
+
function text(value) {
|
|
16
|
+
return typeof value === "string" ? value : "";
|
|
17
|
+
}
|
|
18
|
+
function nonEmpty(value) {
|
|
19
|
+
return typeof value === "string" && value.trim() ? value : null;
|
|
20
|
+
}
|
|
21
|
+
function list(value) {
|
|
22
|
+
return Array.isArray(value) ? value : [];
|
|
23
|
+
}
|
|
24
|
+
function plural(count, unit) {
|
|
25
|
+
return `${count} ${unit}${count === 1 ? "" : "s"}`;
|
|
26
|
+
}
|
|
27
|
+
const WRAPPED_MANAGE_URL = /\s*\(\s*\/dashboard\/email\/?\?[^\s)]*view=manage[^\s)]*\s*\)/i;
|
|
28
|
+
const MANAGE_URL = /\/dashboard\/email\/?\?[^\s)]*view=manage[^\s)]*/i;
|
|
29
|
+
function withoutManageLink(message) {
|
|
30
|
+
return message.replace(WRAPPED_MANAGE_URL, "").replace(MANAGE_URL, "").trim();
|
|
31
|
+
}
|
|
32
|
+
function FailureGuidance({ guidance }) {
|
|
33
|
+
if (!guidance) return null;
|
|
34
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-t border-border/40 px-4 py-2", children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[11px] leading-relaxed text-muted-foreground", children: guidance }) });
|
|
35
|
+
}
|
|
36
|
+
const EMAIL_NOT_CONNECTED_STATUS = "not_connected";
|
|
37
|
+
const EMAIL_NOT_CONNECTED_ERROR = "No email accounts connected";
|
|
38
|
+
function sanitizeErrorMessage(raw) {
|
|
39
|
+
return raw.replace(/Please fix your mistakes\.?/gi, "").replace(/\s{2,}/g, " ").trim();
|
|
40
|
+
}
|
|
41
|
+
const FAILED_TO_SEND = /^Failed to send:?\s*/;
|
|
42
|
+
function readAthenaEmailSendOutcome({
|
|
43
|
+
status,
|
|
44
|
+
result,
|
|
45
|
+
isError
|
|
46
|
+
}) {
|
|
47
|
+
const classification = toolResult.classifyToolResult({ status, result, isError });
|
|
48
|
+
if (classification.state === "error") {
|
|
49
|
+
return { kind: "failed", detail: sanitizeErrorMessage(classification.failure.message) };
|
|
50
|
+
}
|
|
51
|
+
if (typeof result === "string" && FAILED_TO_SEND.test(result.trim())) {
|
|
52
|
+
const detail = sanitizeErrorMessage(result.trim().replace(FAILED_TO_SEND, ""));
|
|
53
|
+
return { kind: "failed", detail: detail || "Something went wrong while sending the email." };
|
|
54
|
+
}
|
|
55
|
+
const data = primitives.normalizeResult(result);
|
|
56
|
+
const message = nonEmpty(data == null ? void 0 : data.message);
|
|
57
|
+
if ((data == null ? void 0 : data.status) === "skipped" && message) return { kind: "not-sent", message };
|
|
58
|
+
if ((data == null ? void 0 : data.status) === "duplicate_suppressed" && message) {
|
|
59
|
+
return { kind: "already-sent", message };
|
|
60
|
+
}
|
|
61
|
+
return { kind: "sent" };
|
|
62
|
+
}
|
|
63
|
+
function recipientsText(value) {
|
|
64
|
+
if (Array.isArray(value)) {
|
|
65
|
+
return value.filter((item) => typeof item === "string").join(", ");
|
|
66
|
+
}
|
|
67
|
+
return text(value).trim();
|
|
68
|
+
}
|
|
69
|
+
function attachmentIds(value) {
|
|
70
|
+
if (Array.isArray(value)) {
|
|
71
|
+
return value.filter((id) => typeof id === "string" && id.trim() !== "");
|
|
72
|
+
}
|
|
73
|
+
const raw = text(value).trim();
|
|
74
|
+
if (!raw) return [];
|
|
75
|
+
try {
|
|
76
|
+
const parsed = JSON.parse(raw);
|
|
77
|
+
if (Array.isArray(parsed)) {
|
|
78
|
+
return parsed.filter((id) => typeof id === "string" && id.trim() !== "");
|
|
79
|
+
}
|
|
80
|
+
} catch {
|
|
81
|
+
}
|
|
82
|
+
return [raw];
|
|
83
|
+
}
|
|
84
|
+
const BODY_EXCERPT_CHARS = 280;
|
|
85
|
+
function emailBodyExcerpt({
|
|
86
|
+
body,
|
|
87
|
+
contentType
|
|
88
|
+
}) {
|
|
89
|
+
const plain = contentType === "text/html" ? body.replace(/<(style|script)[^>]*>[\s\S]*?<\/\1>/gi, " ").replace(/<[^>]+>/g, " ").replace(/ /g, " ").replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">") : body;
|
|
90
|
+
return primitives.truncate(plain.replace(/\s+/g, " ").trim(), BODY_EXCERPT_CHARS);
|
|
91
|
+
}
|
|
92
|
+
function DetailRow({ label, children }) {
|
|
93
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
94
|
+
/* @__PURE__ */ jsxRuntime.jsx("dt", { className: "font-medium text-muted-foreground", children: label }),
|
|
95
|
+
/* @__PURE__ */ jsxRuntime.jsx("dd", { className: "min-w-0 break-all text-foreground", children })
|
|
96
|
+
] });
|
|
97
|
+
}
|
|
98
|
+
function AthenaEmailDetails({ args }) {
|
|
99
|
+
const openAsset = assetPanelStore.useAssetPanelStore((s) => s.openAsset);
|
|
100
|
+
const to = recipientsText(args.to);
|
|
101
|
+
const cc = recipientsText(args.cc);
|
|
102
|
+
const bcc = recipientsText(args.bcc);
|
|
103
|
+
const subject = text(args.subject).trim();
|
|
104
|
+
const files = attachmentIds(args.asset_ids);
|
|
105
|
+
const excerpt = emailBodyExcerpt({
|
|
106
|
+
body: text(args.body),
|
|
107
|
+
contentType: text(args.content_type)
|
|
108
|
+
});
|
|
109
|
+
if (!to && !cc && !bcc && !subject && files.length === 0 && !excerpt) return null;
|
|
110
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "border-t border-border/40 px-4 py-2.5", children: [
|
|
111
|
+
/* @__PURE__ */ jsxRuntime.jsxs("dl", { className: "grid grid-cols-[3.5rem_minmax(0,1fr)] gap-x-2 gap-y-1 text-[12px]", children: [
|
|
112
|
+
to ? /* @__PURE__ */ jsxRuntime.jsx(DetailRow, { label: "To", children: to }) : null,
|
|
113
|
+
cc ? /* @__PURE__ */ jsxRuntime.jsx(DetailRow, { label: "CC", children: cc }) : null,
|
|
114
|
+
bcc ? /* @__PURE__ */ jsxRuntime.jsx(DetailRow, { label: "BCC", children: bcc }) : null,
|
|
115
|
+
subject ? /* @__PURE__ */ jsxRuntime.jsx(DetailRow, { label: "Subject", children: subject }) : null,
|
|
116
|
+
files.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx(DetailRow, { label: "Files", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex flex-wrap gap-1.5", children: files.map((id) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
117
|
+
"button",
|
|
118
|
+
{
|
|
119
|
+
type: "button",
|
|
120
|
+
title: id,
|
|
121
|
+
onClick: () => openAsset(id),
|
|
122
|
+
className: "max-w-[200px] truncate rounded-md border border-border/60 bg-muted/40 px-2 py-0.5 text-[11px] text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",
|
|
123
|
+
children: `${id.slice(0, 8)}...`
|
|
124
|
+
},
|
|
125
|
+
id
|
|
126
|
+
)) }) }) : null
|
|
127
|
+
] }),
|
|
128
|
+
excerpt ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-2 border-t border-border/40 pt-2 text-[11px] leading-relaxed text-muted-foreground", children: excerpt }) : null
|
|
129
|
+
] });
|
|
130
|
+
}
|
|
131
|
+
const SendAthenaEmailToolUIImpl = (props) => {
|
|
132
|
+
const { toolName, args, result, status, isError } = props;
|
|
133
|
+
if (documentEditToolUis.rendersAsGenericCard(props)) return /* @__PURE__ */ jsxRuntime.jsx(toolFallback.ToolFallback, { ...props, icon: lucideReact.MailIcon });
|
|
134
|
+
const typedArgs = recordOf(args);
|
|
135
|
+
const subject = text(typedArgs.subject).trim();
|
|
136
|
+
const to = recipientsText(typedArgs.to);
|
|
137
|
+
const isRunning = (status == null ? void 0 : status.type) === "running";
|
|
138
|
+
const isWaiting = (status == null ? void 0 : status.type) === "requires-action";
|
|
139
|
+
const outcome = isRunning || isWaiting ? null : readAthenaEmailSendOutcome({ status, result, isError });
|
|
140
|
+
const cardStatus = isRunning ? "running" : isWaiting ? "requires-action" : (outcome == null ? void 0 : outcome.kind) === "failed" || (outcome == null ? void 0 : outcome.kind) === "not-sent" ? "incomplete" : "complete";
|
|
141
|
+
const title = isRunning ? "Sending email..." : isWaiting ? documentEditToolUis.waitingTitle(toolName) : (outcome == null ? void 0 : outcome.kind) === "failed" ? "Failed to send email" : (outcome == null ? void 0 : outcome.kind) === "not-sent" ? "Email not sent" : (outcome == null ? void 0 : outcome.kind) === "already-sent" ? "Email already sent" : "Email sent";
|
|
142
|
+
const error = (outcome == null ? void 0 : outcome.kind) === "failed" ? outcome.detail : (outcome == null ? void 0 : outcome.kind) === "not-sent" ? outcome.message : null;
|
|
143
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
144
|
+
primitives.ToolCard,
|
|
145
|
+
{
|
|
146
|
+
icon: lucideReact.MailIcon,
|
|
147
|
+
status: cardStatus,
|
|
148
|
+
title,
|
|
149
|
+
subtitle: subject ? primitives.truncate(subject, 60) : to ? `To: ${primitives.truncate(to, 40)}` : void 0,
|
|
150
|
+
toolName,
|
|
151
|
+
error,
|
|
152
|
+
args: typedArgs,
|
|
153
|
+
result,
|
|
154
|
+
children: [
|
|
155
|
+
(outcome == null ? void 0 : outcome.kind) === "already-sent" ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-t border-border/40 bg-amber-500/10 px-4 py-2.5", children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[12px] leading-relaxed text-amber-600", children: outcome.message }) }) : null,
|
|
156
|
+
(outcome == null ? void 0 : outcome.kind) !== "failed" ? /* @__PURE__ */ jsxRuntime.jsx(AthenaEmailDetails, { args: typedArgs }) : null
|
|
157
|
+
]
|
|
158
|
+
}
|
|
159
|
+
);
|
|
160
|
+
};
|
|
161
|
+
const SendAthenaEmailToolUI = require$$0.memo(
|
|
162
|
+
SendAthenaEmailToolUIImpl
|
|
163
|
+
);
|
|
164
|
+
SendAthenaEmailToolUI.displayName = "SendAthenaEmailToolUI";
|
|
165
|
+
function readEmailToolFailure(result) {
|
|
166
|
+
const record = primitives.normalizeResult(result);
|
|
167
|
+
if (!record) return null;
|
|
168
|
+
const error = text(record.error).trim();
|
|
169
|
+
if (record.status === EMAIL_NOT_CONNECTED_STATUS || error === EMAIL_NOT_CONNECTED_ERROR) {
|
|
170
|
+
return {
|
|
171
|
+
title: "Email Not Connected",
|
|
172
|
+
detail: "Connect your email account to use this feature.",
|
|
173
|
+
guidance: null
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
if (record.reconnect_required === true) {
|
|
177
|
+
return {
|
|
178
|
+
title: "Email Connection Expired",
|
|
179
|
+
detail: "Your email account's authorization has expired or been revoked. Reconnect it to continue.",
|
|
180
|
+
guidance: null
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
if (!error) return null;
|
|
184
|
+
return { title: "Error", detail: withoutManageLink(error), guidance: nonEmpty(record.guidance) };
|
|
185
|
+
}
|
|
186
|
+
const NAMED_ADDRESS = /^\s*"?([^"<>]*?)"?\s*<\s*([^<>\s]+)\s*>\s*$/;
|
|
187
|
+
function senderOf(value) {
|
|
188
|
+
if (toolResult.isRecord(value)) {
|
|
189
|
+
const name = text(value.name).trim();
|
|
190
|
+
const address = text(value.email).trim();
|
|
191
|
+
return { label: name || localPart(address), address };
|
|
192
|
+
}
|
|
193
|
+
const raw = text(value).trim();
|
|
194
|
+
const named = NAMED_ADDRESS.exec(raw);
|
|
195
|
+
if (named) {
|
|
196
|
+
const name = (named[1] ?? "").trim();
|
|
197
|
+
const address = named[2] ?? "";
|
|
198
|
+
return { label: name || localPart(address), address };
|
|
199
|
+
}
|
|
200
|
+
return raw.includes("@") ? { label: localPart(raw), address: raw } : { label: raw, address: "" };
|
|
201
|
+
}
|
|
202
|
+
function localPart(address) {
|
|
203
|
+
const at = address.indexOf("@");
|
|
204
|
+
return at > 0 ? address.slice(0, at) : address;
|
|
205
|
+
}
|
|
206
|
+
function parseEmailDate(value) {
|
|
207
|
+
const raw = value.trim();
|
|
208
|
+
if (!raw) return null;
|
|
209
|
+
const parsed = new Date(raw);
|
|
210
|
+
return Number.isNaN(parsed.getTime()) ? null : parsed;
|
|
211
|
+
}
|
|
212
|
+
const MESSAGE_SEPARATOR = /^--- Message \d+ of \d+ ---$/m;
|
|
213
|
+
const TEXT_HEADER_LINE = /^(Subject|From|To|Cc|Date):/;
|
|
214
|
+
const DRAFT_BANNER_LINE = /^\[UNSENT DRAFT\b/;
|
|
215
|
+
function legacyBody(block) {
|
|
216
|
+
const lines = block.replace(/^\n+/, "").split("\n");
|
|
217
|
+
let index = 0;
|
|
218
|
+
if (DRAFT_BANNER_LINE.test(lines[index] ?? "")) index += 1;
|
|
219
|
+
const headerStart = index;
|
|
220
|
+
while (index < lines.length && TEXT_HEADER_LINE.test(lines[index] ?? "")) index += 1;
|
|
221
|
+
if (index > headerStart && (lines[index] ?? "").trim() === "") index += 1;
|
|
222
|
+
return lines.slice(index).join("\n").trim();
|
|
223
|
+
}
|
|
224
|
+
function legacyBodies(content, count) {
|
|
225
|
+
const parts = content.split(MESSAGE_SEPARATOR);
|
|
226
|
+
const blocks = parts.length > 1 ? parts.slice(1) : parts;
|
|
227
|
+
const bodies = blocks.map(legacyBody);
|
|
228
|
+
if (bodies.length === count) return bodies;
|
|
229
|
+
if (count === 1) return [bodies.join("\n\n").trim()];
|
|
230
|
+
return Array.from({ length: count }, (_, index) => bodies[index] ?? "");
|
|
231
|
+
}
|
|
232
|
+
const SNIPPET_CHARS = 240;
|
|
233
|
+
function threadMessageOf(value, body) {
|
|
234
|
+
if (!toolResult.isRecord(value)) return null;
|
|
235
|
+
const labels = list(value.labels).filter(
|
|
236
|
+
(label) => typeof label === "string" && label !== ""
|
|
237
|
+
);
|
|
238
|
+
const sender = senderOf(value.from);
|
|
239
|
+
const dateText = text(value.date);
|
|
240
|
+
return {
|
|
241
|
+
sender: sender.label,
|
|
242
|
+
senderAddress: sender.address,
|
|
243
|
+
date: parseEmailDate(dateText),
|
|
244
|
+
dateText,
|
|
245
|
+
snippet: (text(value.text) || body).replace(/\s+/g, " ").trim().slice(0, SNIPPET_CHARS),
|
|
246
|
+
isDraft: value.is_draft === true || labels.includes("DRAFT"),
|
|
247
|
+
labels
|
|
248
|
+
};
|
|
249
|
+
}
|
|
250
|
+
function parseEmailThreadResult(result) {
|
|
251
|
+
const record = primitives.normalizeResult(result);
|
|
252
|
+
if (!record || record.success === false) return null;
|
|
253
|
+
let messages = list(record.messages).flatMap((item) => {
|
|
254
|
+
const message = threadMessageOf(item, "");
|
|
255
|
+
return message ? [message] : [];
|
|
256
|
+
});
|
|
257
|
+
if (messages.length === 0) {
|
|
258
|
+
const metadata = list(record.messages_metadata);
|
|
259
|
+
const content = text(record.content);
|
|
260
|
+
if (metadata.length === 0 && !content.trim()) return null;
|
|
261
|
+
const count = Math.max(metadata.length, 1);
|
|
262
|
+
const bodies = legacyBodies(content, count);
|
|
263
|
+
messages = Array.from(
|
|
264
|
+
{ length: count },
|
|
265
|
+
(_, index) => threadMessageOf(recordOf(metadata[index]), bodies[index] ?? "")
|
|
266
|
+
).filter((message) => message !== null);
|
|
267
|
+
}
|
|
268
|
+
if (messages.length === 0) return null;
|
|
269
|
+
const subjectSource = [...list(record.messages), ...list(record.messages_metadata)].find(
|
|
270
|
+
(item) => nonEmpty(recordOf(item).subject) !== null
|
|
271
|
+
);
|
|
272
|
+
return {
|
|
273
|
+
subject: text(recordOf(subjectSource).subject).trim(),
|
|
274
|
+
provider: text(record.provider),
|
|
275
|
+
messages,
|
|
276
|
+
isSingleMessage: nonEmpty(record.message_id) !== null && record.message_count === void 0
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
const MONTHS = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
|
|
280
|
+
const NARROW_SPACE = " ";
|
|
281
|
+
function gmailTime(date) {
|
|
282
|
+
const hours = date.getHours();
|
|
283
|
+
const hour12 = hours % 12 === 0 ? 12 : hours % 12;
|
|
284
|
+
const minutes = String(date.getMinutes()).padStart(2, "0");
|
|
285
|
+
return `${hour12}:${minutes}${NARROW_SPACE}${hours < 12 ? "AM" : "PM"}`;
|
|
286
|
+
}
|
|
287
|
+
function gmailListDate({ date, now }) {
|
|
288
|
+
if (date.toDateString() === now.toDateString()) return gmailTime(date);
|
|
289
|
+
if (date.getFullYear() === now.getFullYear()) {
|
|
290
|
+
return `${MONTHS[date.getMonth()]} ${date.getDate()}`;
|
|
291
|
+
}
|
|
292
|
+
const year = String(date.getFullYear() % 100).padStart(2, "0");
|
|
293
|
+
return `${date.getMonth() + 1}/${date.getDate()}/${year}`;
|
|
294
|
+
}
|
|
295
|
+
function gmailFullDate(date) {
|
|
296
|
+
return `${MONTHS[date.getMonth()]} ${date.getDate()}, ${date.getFullYear()}, ${gmailTime(date)}`;
|
|
297
|
+
}
|
|
298
|
+
const LABEL_CHIP_NAMES = {
|
|
299
|
+
INBOX: "Inbox",
|
|
300
|
+
SPAM: "Spam",
|
|
301
|
+
TRASH: "Trash"
|
|
302
|
+
};
|
|
303
|
+
function ThreadMessageRow({ message, now }) {
|
|
304
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-0.5 py-2 first:pt-0 last:pb-0", children: [
|
|
305
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-baseline justify-between gap-2", children: [
|
|
306
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex min-w-0 items-baseline gap-1 text-[12px] font-medium text-foreground", children: [
|
|
307
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", title: message.senderAddress || void 0, children: message.sender || message.senderAddress || "Unknown sender" }),
|
|
308
|
+
message.isDraft ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0 font-normal text-destructive", children: "Draft" }) : null
|
|
309
|
+
] }),
|
|
310
|
+
message.date ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
311
|
+
"span",
|
|
312
|
+
{
|
|
313
|
+
className: "shrink-0 text-[10px] text-muted-foreground",
|
|
314
|
+
title: gmailFullDate(message.date),
|
|
315
|
+
children: gmailListDate({ date: message.date, now })
|
|
316
|
+
}
|
|
317
|
+
) : message.dateText ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0 text-[10px] text-muted-foreground", children: message.dateText }) : null
|
|
318
|
+
] }),
|
|
319
|
+
message.snippet ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[11px] leading-relaxed text-muted-foreground/80", children: primitives.truncate(message.snippet, 150) }) : null
|
|
320
|
+
] });
|
|
321
|
+
}
|
|
322
|
+
function ThreadMessages({ messages }) {
|
|
323
|
+
var _a;
|
|
324
|
+
const now = /* @__PURE__ */ new Date();
|
|
325
|
+
const folded = messages.length > 3 ? messages.slice(1, -2) : [];
|
|
326
|
+
const head = folded.length > 0 ? messages.slice(0, 1) : messages;
|
|
327
|
+
const tail = folded.length > 0 ? messages.slice(-2) : [];
|
|
328
|
+
const chips = (((_a = messages[messages.length - 1]) == null ? void 0 : _a.labels) ?? []).flatMap((label) => {
|
|
329
|
+
const name = LABEL_CHIP_NAMES[label];
|
|
330
|
+
return name ? [name] : [];
|
|
331
|
+
});
|
|
332
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "border-t border-border/40 px-4 py-2.5", children: [
|
|
333
|
+
chips.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mb-2 flex flex-wrap gap-1", children: chips.map((chip) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
334
|
+
"span",
|
|
335
|
+
{
|
|
336
|
+
className: "rounded bg-muted px-1 py-px text-[10px] text-muted-foreground",
|
|
337
|
+
children: chip
|
|
338
|
+
},
|
|
339
|
+
chip
|
|
340
|
+
)) }) : null,
|
|
341
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col divide-y divide-border/30", children: head.map((message, index) => /* @__PURE__ */ jsxRuntime.jsx(ThreadMessageRow, { message, now }, index)) }),
|
|
342
|
+
folded.length > 0 ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
343
|
+
/* @__PURE__ */ jsxRuntime.jsx(primitives.ExpandableSection, { label: plural(folded.length, "older message"), children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col divide-y divide-border/30", children: folded.map((message, index) => /* @__PURE__ */ jsxRuntime.jsx(ThreadMessageRow, { message, now }, index)) }) }),
|
|
344
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col divide-y divide-border/30 border-t border-border/30 pt-2", children: tail.map((message, index) => /* @__PURE__ */ jsxRuntime.jsx(ThreadMessageRow, { message, now }, index)) })
|
|
345
|
+
] }) : null
|
|
346
|
+
] });
|
|
347
|
+
}
|
|
348
|
+
const EmailThreadToolUIImpl = (props) => {
|
|
349
|
+
const { toolName, args, result, status, isError } = props;
|
|
350
|
+
const view = require$$0.useMemo(() => parseEmailThreadResult(result), [result]);
|
|
351
|
+
if (documentEditToolUis.rendersAsGenericCard(props)) return /* @__PURE__ */ jsxRuntime.jsx(toolFallback.ToolFallback, { ...props, icon: lucideReact.MailIcon });
|
|
352
|
+
const typedArgs = recordOf(args);
|
|
353
|
+
const isMessage = toolName === "unified_email_get_message" || nonEmpty(typedArgs.message_id) !== null && nonEmpty(typedArgs.thread_id) === null;
|
|
354
|
+
const classification = toolResult.classifyToolResult({ status, result, isError });
|
|
355
|
+
const isRunning = classification.state === "running";
|
|
356
|
+
const isWaiting = classification.state === "requires-action";
|
|
357
|
+
const failure = isRunning || isWaiting ? null : readEmailToolFailure(result) ?? (classification.state === "error" ? { title: "Error", detail: classification.failure.message, guidance: null } : null);
|
|
358
|
+
const shown = failure ? null : view;
|
|
359
|
+
const cardStatus = isRunning ? "running" : isWaiting ? "requires-action" : failure ? "incomplete" : "complete";
|
|
360
|
+
const title = isRunning ? isMessage ? "Reading email..." : "Reading conversation..." : isWaiting ? documentEditToolUis.waitingTitle(toolName) : failure ? failure.title : isMessage ? "Email read" : "Conversation read";
|
|
361
|
+
const count = (shown == null ? void 0 : shown.messages.length) ?? 0;
|
|
362
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
363
|
+
primitives.ToolCard,
|
|
364
|
+
{
|
|
365
|
+
icon: lucideReact.MailIcon,
|
|
366
|
+
status: cardStatus,
|
|
367
|
+
title,
|
|
368
|
+
subtitle: shown ? primitives.truncate(shown.subject || "(no subject)", 90) : void 0,
|
|
369
|
+
toolName,
|
|
370
|
+
badge: shown && count > 0 ? `${plural(count, "message")}${shown.provider ? ` · ${shown.provider}` : ""}` : void 0,
|
|
371
|
+
error: (failure == null ? void 0 : failure.detail) ?? null,
|
|
372
|
+
args: typedArgs,
|
|
373
|
+
result,
|
|
374
|
+
children: [
|
|
375
|
+
failure ? /* @__PURE__ */ jsxRuntime.jsx(FailureGuidance, { guidance: failure.guidance }) : null,
|
|
376
|
+
shown && count > 0 ? /* @__PURE__ */ jsxRuntime.jsx(ThreadMessages, { messages: shown.messages }) : null
|
|
377
|
+
]
|
|
378
|
+
}
|
|
379
|
+
);
|
|
380
|
+
};
|
|
381
|
+
const EmailThreadToolUI = require$$0.memo(
|
|
382
|
+
EmailThreadToolUIImpl
|
|
383
|
+
);
|
|
384
|
+
EmailThreadToolUI.displayName = "EmailThreadToolUI";
|
|
385
|
+
function readCalendarToolFailure(result) {
|
|
386
|
+
const record = primitives.normalizeResult(result);
|
|
387
|
+
if (!record) return null;
|
|
388
|
+
const error = nonEmpty(record.error);
|
|
389
|
+
const notConnected = record.status === EMAIL_NOT_CONNECTED_STATUS || error === EMAIL_NOT_CONNECTED_ERROR;
|
|
390
|
+
const reconnect = record.reconnect_required === true;
|
|
391
|
+
if (!error && !notConnected && !reconnect) return null;
|
|
392
|
+
const raw = error ?? nonEmpty(record.message) ?? "Something went wrong.";
|
|
393
|
+
return {
|
|
394
|
+
title: notConnected ? "Connect a calendar to continue" : reconnect ? "Reconnect your calendar account" : "The calendar request didn’t go through",
|
|
395
|
+
detail: notConnected ? "Athena has no calendar account to use yet." : withoutManageLink(raw),
|
|
396
|
+
guidance: notConnected ? null : nonEmpty(record.guidance)
|
|
397
|
+
};
|
|
398
|
+
}
|
|
399
|
+
const DATE_ONLY = /^(\d{4})-(\d{2})-(\d{2})$/;
|
|
400
|
+
const HAS_OFFSET = /(?:Z|[+-]\d{2}:?\d{2})$/i;
|
|
401
|
+
function isDateOnly(value) {
|
|
402
|
+
return typeof value === "string" && DATE_ONLY.test(value);
|
|
403
|
+
}
|
|
404
|
+
function readTime(detail, flat) {
|
|
405
|
+
if (toolResult.isRecord(detail)) {
|
|
406
|
+
const time = {};
|
|
407
|
+
const date = nonEmpty(detail.date);
|
|
408
|
+
const dateTime = nonEmpty(detail.dateTime);
|
|
409
|
+
const timeZone = nonEmpty(detail.timeZone);
|
|
410
|
+
if (date) time.date = date;
|
|
411
|
+
if (dateTime) time.dateTime = dateTime;
|
|
412
|
+
if (timeZone) time.timeZone = timeZone;
|
|
413
|
+
if (time.date || time.dateTime) return time;
|
|
414
|
+
}
|
|
415
|
+
const raw = text(flat).trim();
|
|
416
|
+
if (!raw) return {};
|
|
417
|
+
return isDateOnly(raw) ? { date: raw } : { dateTime: raw };
|
|
418
|
+
}
|
|
419
|
+
function dateOnlyAsUtc(date) {
|
|
420
|
+
const match = DATE_ONLY.exec(date);
|
|
421
|
+
if (!match) return new Date(Number.NaN);
|
|
422
|
+
return new Date(Date.UTC(Number(match[1]), Number(match[2]) - 1, Number(match[3])));
|
|
423
|
+
}
|
|
424
|
+
function addDaysToDateOnly({ date, days }) {
|
|
425
|
+
const base = dateOnlyAsUtc(date);
|
|
426
|
+
if (Number.isNaN(base.getTime())) return date;
|
|
427
|
+
return new Date(base.getTime() + days * 864e5).toISOString().slice(0, 10);
|
|
428
|
+
}
|
|
429
|
+
function normalizeResponse(value) {
|
|
430
|
+
switch (text(value)) {
|
|
431
|
+
case "accepted":
|
|
432
|
+
case "organizer":
|
|
433
|
+
return "accepted";
|
|
434
|
+
case "declined":
|
|
435
|
+
return "declined";
|
|
436
|
+
case "tentative":
|
|
437
|
+
case "tentativelyAccepted":
|
|
438
|
+
return "tentative";
|
|
439
|
+
default:
|
|
440
|
+
return "needsAction";
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
function wholeNumber(value) {
|
|
444
|
+
return typeof value === "number" && Number.isFinite(value) ? Math.trunc(value) : null;
|
|
445
|
+
}
|
|
446
|
+
function myResponseOf(raw) {
|
|
447
|
+
const stated = nonEmpty(raw.my_response_status);
|
|
448
|
+
if (stated) return stated === "organizer" ? null : normalizeResponse(stated);
|
|
449
|
+
const self = list(raw.attendees).find((attendee) => recordOf(attendee).self === true);
|
|
450
|
+
if (self) return normalizeResponse(recordOf(self).response_status);
|
|
451
|
+
return recordOf(raw.organizer).self === true ? "accepted" : null;
|
|
452
|
+
}
|
|
453
|
+
function parseCalendarEvent(raw) {
|
|
454
|
+
if (!toolResult.isRecord(raw)) return null;
|
|
455
|
+
const start = readTime(raw.start_detail, raw.start ?? raw.start_time);
|
|
456
|
+
if (!start.date && !start.dateTime) return null;
|
|
457
|
+
let end = readTime(raw.end_detail, raw.end ?? raw.end_time);
|
|
458
|
+
const allDay = typeof raw.all_day === "boolean" ? raw.all_day : Boolean(start.date && !start.dateTime);
|
|
459
|
+
let endDateInclusive = nonEmpty(raw.end_date_inclusive);
|
|
460
|
+
if (allDay) {
|
|
461
|
+
const startDay = start.date ?? (start.dateTime ?? "").slice(0, 10);
|
|
462
|
+
if (!start.date && isDateOnly(startDay)) start.date = startDay;
|
|
463
|
+
if (!endDateInclusive) {
|
|
464
|
+
const exclusive = end.date ?? (end.dateTime ? end.dateTime.slice(0, 10) : "");
|
|
465
|
+
endDateInclusive = isDateOnly(exclusive) && exclusive > startDay ? addDaysToDateOnly({ date: exclusive, days: -1 }) : startDay;
|
|
466
|
+
}
|
|
467
|
+
if (!end.date && endDateInclusive) {
|
|
468
|
+
end = { date: addDaysToDateOnly({ date: endDateInclusive, days: 1 }) };
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
const guests = list(raw.attendees).filter(
|
|
472
|
+
(attendee) => toolResult.isRecord(attendee) && nonEmpty(attendee.email) !== null && attendee.resource !== true
|
|
473
|
+
);
|
|
474
|
+
const counted = wholeNumber(recordOf(raw.attendee_counts).total);
|
|
475
|
+
const response = myResponseOf(raw);
|
|
476
|
+
return {
|
|
477
|
+
id: text(raw.id) || text(raw.event_id),
|
|
478
|
+
title: text(raw.title) || text(raw.summary) || "(No title)",
|
|
479
|
+
start,
|
|
480
|
+
end,
|
|
481
|
+
allDay,
|
|
482
|
+
endDateInclusive: allDay ? endDateInclusive : null,
|
|
483
|
+
location: text(raw.location).trim(),
|
|
484
|
+
guestCount: counted ?? Math.max(wholeNumber(raw.attendee_count) ?? 0, guests.length),
|
|
485
|
+
declined: response === "declined",
|
|
486
|
+
awaiting: response === "needsAction"
|
|
487
|
+
};
|
|
488
|
+
}
|
|
489
|
+
function parseCalendarSearchResult(result) {
|
|
490
|
+
const record = primitives.normalizeResult(result);
|
|
491
|
+
if (!record) return null;
|
|
492
|
+
if (toolResult.isRecord(record.event)) {
|
|
493
|
+
const event = parseCalendarEvent(record.event);
|
|
494
|
+
return event ? { events: [event], isSingleEvent: true, hasMore: false, accountEmail: nonEmpty(record.account_email) } : null;
|
|
495
|
+
}
|
|
496
|
+
if (!Array.isArray(record.results)) return null;
|
|
497
|
+
return {
|
|
498
|
+
events: record.results.flatMap((raw) => {
|
|
499
|
+
const event = parseCalendarEvent(raw);
|
|
500
|
+
return event ? [event] : [];
|
|
501
|
+
}),
|
|
502
|
+
isSingleEvent: false,
|
|
503
|
+
hasMore: nonEmpty(record.next_page_token) !== null,
|
|
504
|
+
accountEmail: nonEmpty(record.account_email)
|
|
505
|
+
};
|
|
506
|
+
}
|
|
507
|
+
function viewerTimeZone() {
|
|
508
|
+
try {
|
|
509
|
+
return Intl.DateTimeFormat().resolvedOptions().timeZone || "UTC";
|
|
510
|
+
} catch {
|
|
511
|
+
return "UTC";
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
function dateOnlyInZone({ instant, timeZone }) {
|
|
515
|
+
const parts = new Intl.DateTimeFormat("en-CA", {
|
|
516
|
+
timeZone,
|
|
517
|
+
year: "numeric",
|
|
518
|
+
month: "2-digit",
|
|
519
|
+
day: "2-digit"
|
|
520
|
+
}).formatToParts(instant);
|
|
521
|
+
const get = (type) => {
|
|
522
|
+
var _a;
|
|
523
|
+
return ((_a = parts.find((part) => part.type === type)) == null ? void 0 : _a.value) ?? "";
|
|
524
|
+
};
|
|
525
|
+
return `${get("year")}-${get("month")}-${get("day")}`;
|
|
526
|
+
}
|
|
527
|
+
function zoneOffsetMinutes({ instant, timeZone }) {
|
|
528
|
+
const parts = new Intl.DateTimeFormat("en-US", {
|
|
529
|
+
timeZone,
|
|
530
|
+
hourCycle: "h23",
|
|
531
|
+
year: "numeric",
|
|
532
|
+
month: "2-digit",
|
|
533
|
+
day: "2-digit",
|
|
534
|
+
hour: "2-digit",
|
|
535
|
+
minute: "2-digit",
|
|
536
|
+
second: "2-digit"
|
|
537
|
+
}).formatToParts(instant);
|
|
538
|
+
const get = (type) => {
|
|
539
|
+
var _a;
|
|
540
|
+
return Number(((_a = parts.find((part) => part.type === type)) == null ? void 0 : _a.value) ?? 0);
|
|
541
|
+
};
|
|
542
|
+
const wall = Date.UTC(get("year"), get("month") - 1, get("day"), get("hour") % 24, get("minute"), get("second"));
|
|
543
|
+
return Math.round((wall - instant.getTime()) / 6e4);
|
|
544
|
+
}
|
|
545
|
+
function instantOf(time) {
|
|
546
|
+
var _a;
|
|
547
|
+
const raw = (_a = time.dateTime) == null ? void 0 : _a.trim().replace(/(\.\d{3})\d+/, "$1");
|
|
548
|
+
if (!raw) return null;
|
|
549
|
+
if (HAS_OFFSET.test(raw)) {
|
|
550
|
+
const parsed = new Date(raw);
|
|
551
|
+
return Number.isNaN(parsed.getTime()) ? null : parsed;
|
|
552
|
+
}
|
|
553
|
+
const asUtc = /* @__PURE__ */ new Date(`${raw}Z`);
|
|
554
|
+
if (Number.isNaN(asUtc.getTime())) return null;
|
|
555
|
+
const zone = time.timeZone;
|
|
556
|
+
if (!zone || zone.toUpperCase() === "UTC") return asUtc;
|
|
557
|
+
try {
|
|
558
|
+
const offset = zoneOffsetMinutes({ instant: asUtc, timeZone: zone });
|
|
559
|
+
const guess = new Date(asUtc.getTime() - offset * 6e4);
|
|
560
|
+
const settled = zoneOffsetMinutes({ instant: guess, timeZone: zone });
|
|
561
|
+
return settled === offset ? guess : new Date(asUtc.getTime() - settled * 6e4);
|
|
562
|
+
} catch {
|
|
563
|
+
return asUtc;
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
function clockParts({ instant, timeZone }) {
|
|
567
|
+
const parts = new Intl.DateTimeFormat("en-US", {
|
|
568
|
+
timeZone,
|
|
569
|
+
hour: "numeric",
|
|
570
|
+
minute: "2-digit",
|
|
571
|
+
hour12: true
|
|
572
|
+
}).formatToParts(instant);
|
|
573
|
+
const get = (type) => {
|
|
574
|
+
var _a;
|
|
575
|
+
return ((_a = parts.find((part) => part.type === type)) == null ? void 0 : _a.value) ?? "";
|
|
576
|
+
};
|
|
577
|
+
return {
|
|
578
|
+
hour: get("hour"),
|
|
579
|
+
minute: get("minute"),
|
|
580
|
+
period: get("dayPeriod").toLowerCase().startsWith("p") ? "pm" : "am"
|
|
581
|
+
};
|
|
582
|
+
}
|
|
583
|
+
function clockText({ parts, withPeriod }) {
|
|
584
|
+
const time = parts.minute !== "00" ? `${parts.hour}:${parts.minute}` : parts.hour;
|
|
585
|
+
return withPeriod ? `${time}${parts.period}` : time;
|
|
586
|
+
}
|
|
587
|
+
const RANGE_SEPARATOR = " – ";
|
|
588
|
+
function formatTimeRange({ start, end, timeZone }) {
|
|
589
|
+
const from = clockParts({ instant: start, timeZone });
|
|
590
|
+
if (start.getTime() === end.getTime()) return clockText({ parts: from, withPeriod: true });
|
|
591
|
+
const to = clockParts({ instant: end, timeZone });
|
|
592
|
+
return `${clockText({ parts: from, withPeriod: from.period !== to.period })}${RANGE_SEPARATOR}${clockText({ parts: to, withPeriod: true })}`;
|
|
593
|
+
}
|
|
594
|
+
function eventDays({ event, timeZone }) {
|
|
595
|
+
let first;
|
|
596
|
+
let last;
|
|
597
|
+
if (event.allDay) {
|
|
598
|
+
first = event.start.date ?? "";
|
|
599
|
+
last = event.endDateInclusive ?? first;
|
|
600
|
+
} else {
|
|
601
|
+
const start = instantOf(event.start);
|
|
602
|
+
if (!start) return [];
|
|
603
|
+
const end = instantOf(event.end) ?? start;
|
|
604
|
+
first = dateOnlyInZone({ instant: start, timeZone });
|
|
605
|
+
const lastInstant = end.getTime() > start.getTime() ? new Date(end.getTime() - 1) : end;
|
|
606
|
+
last = dateOnlyInZone({ instant: lastInstant, timeZone });
|
|
607
|
+
}
|
|
608
|
+
if (!isDateOnly(first)) return [];
|
|
609
|
+
if (!isDateOnly(last) || last < first) return [first];
|
|
610
|
+
const days = [];
|
|
611
|
+
for (let day = first; day <= last && days.length < 366; day = addDaysToDateOnly({ date: day, days: 1 })) {
|
|
612
|
+
days.push(day);
|
|
613
|
+
}
|
|
614
|
+
return days;
|
|
615
|
+
}
|
|
616
|
+
function formatAgendaTime({
|
|
617
|
+
event,
|
|
618
|
+
day,
|
|
619
|
+
timeZone
|
|
620
|
+
}) {
|
|
621
|
+
if (event.allDay) return "All day";
|
|
622
|
+
const start = instantOf(event.start);
|
|
623
|
+
if (!start) return "";
|
|
624
|
+
const end = instantOf(event.end) ?? start;
|
|
625
|
+
const days = eventDays({ event, timeZone });
|
|
626
|
+
const startDay = dateOnlyInZone({ instant: start, timeZone });
|
|
627
|
+
if (days.length <= 1) return formatTimeRange({ start, end, timeZone });
|
|
628
|
+
if (day === startDay) {
|
|
629
|
+
return `${clockText({ parts: clockParts({ instant: start, timeZone }), withPeriod: true })}${RANGE_SEPARATOR}12am`;
|
|
630
|
+
}
|
|
631
|
+
if (day === days[days.length - 1]) {
|
|
632
|
+
return `Until ${clockText({ parts: clockParts({ instant: end, timeZone }), withPeriod: true })}`;
|
|
633
|
+
}
|
|
634
|
+
return "All day";
|
|
635
|
+
}
|
|
636
|
+
function agendaRows({
|
|
637
|
+
events,
|
|
638
|
+
timeZone
|
|
639
|
+
}) {
|
|
640
|
+
const byDay = /* @__PURE__ */ new Map();
|
|
641
|
+
for (const event of events) {
|
|
642
|
+
for (const day of eventDays({ event, timeZone })) {
|
|
643
|
+
byDay.set(day, [...byDay.get(day) ?? [], event]);
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
const startOf = (event) => {
|
|
647
|
+
var _a;
|
|
648
|
+
return event.allDay ? Number.NEGATIVE_INFINITY : ((_a = instantOf(event.start)) == null ? void 0 : _a.getTime()) ?? 0;
|
|
649
|
+
};
|
|
650
|
+
return [...byDay.entries()].sort(([left], [right]) => left.localeCompare(right)).flatMap(
|
|
651
|
+
([day, dayEvents]) => [...dayEvents].sort((left, right) => startOf(left) - startOf(right)).map((event) => ({ day, event }))
|
|
652
|
+
);
|
|
653
|
+
}
|
|
654
|
+
function dayLabel(day) {
|
|
655
|
+
const date = dateOnlyAsUtc(day);
|
|
656
|
+
if (Number.isNaN(date.getTime())) return day;
|
|
657
|
+
return new Intl.DateTimeFormat("en-US", {
|
|
658
|
+
weekday: "short",
|
|
659
|
+
month: "short",
|
|
660
|
+
day: "numeric",
|
|
661
|
+
timeZone: "UTC"
|
|
662
|
+
}).format(date);
|
|
663
|
+
}
|
|
664
|
+
const COLLAPSED_ROW_COUNT = 8;
|
|
665
|
+
function AgendaRows({
|
|
666
|
+
rows,
|
|
667
|
+
timeZone,
|
|
668
|
+
today
|
|
669
|
+
}) {
|
|
670
|
+
return /* @__PURE__ */ jsxRuntime.jsx("ul", { className: "flex flex-col", children: rows.map(({ day, event }, index) => {
|
|
671
|
+
var _a;
|
|
672
|
+
const meta = [event.location, event.guestCount > 0 ? plural(event.guestCount, "guest") : ""].filter((part) => part !== "").join(" · ");
|
|
673
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("li", { className: "flex flex-col", children: [
|
|
674
|
+
index === 0 || ((_a = rows[index - 1]) == null ? void 0 : _a.day) !== day ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
675
|
+
"p",
|
|
676
|
+
{
|
|
677
|
+
className: cnfast.cn(
|
|
678
|
+
"pt-1.5 pb-0.5 text-[10px] font-semibold uppercase tracking-wide first:pt-0",
|
|
679
|
+
day === today ? "text-primary" : "text-muted-foreground"
|
|
680
|
+
),
|
|
681
|
+
children: dayLabel(day)
|
|
682
|
+
}
|
|
683
|
+
) : null,
|
|
684
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-2 py-1", children: [
|
|
685
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
686
|
+
"span",
|
|
687
|
+
{
|
|
688
|
+
"aria-hidden": "true",
|
|
689
|
+
className: cnfast.cn(
|
|
690
|
+
"mt-1 size-2 shrink-0 rounded-full",
|
|
691
|
+
event.awaiting || event.declined ? "border border-primary" : "bg-primary"
|
|
692
|
+
)
|
|
693
|
+
}
|
|
694
|
+
),
|
|
695
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "w-24 shrink-0 text-[11px] text-muted-foreground tabular-nums", children: formatAgendaTime({ event, day, timeZone }) }),
|
|
696
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex min-w-0 flex-1 flex-col", children: [
|
|
697
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
698
|
+
"span",
|
|
699
|
+
{
|
|
700
|
+
className: cnfast.cn(
|
|
701
|
+
"truncate text-[12px] font-medium text-foreground",
|
|
702
|
+
event.declined && "text-muted-foreground line-through"
|
|
703
|
+
),
|
|
704
|
+
children: event.title
|
|
705
|
+
}
|
|
706
|
+
),
|
|
707
|
+
meta ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate text-[11px] text-muted-foreground", children: meta }) : null
|
|
708
|
+
] })
|
|
709
|
+
] })
|
|
710
|
+
] }, `${day}:${event.id || event.title}:${index}`);
|
|
711
|
+
}) });
|
|
712
|
+
}
|
|
713
|
+
function CalendarAgenda({ view }) {
|
|
714
|
+
const timeZone = viewerTimeZone();
|
|
715
|
+
const rows = agendaRows({ events: view.events, timeZone });
|
|
716
|
+
const today = dateOnlyInZone({ instant: /* @__PURE__ */ new Date(), timeZone });
|
|
717
|
+
const inline = rows.slice(0, COLLAPSED_ROW_COUNT);
|
|
718
|
+
const overflow = rows.slice(COLLAPSED_ROW_COUNT);
|
|
719
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
720
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "border-t border-border/40 px-4 py-2.5", children: [
|
|
721
|
+
rows.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[12px] text-muted-foreground", children: "No events found" }) : /* @__PURE__ */ jsxRuntime.jsx(AgendaRows, { rows: inline, timeZone, today }),
|
|
722
|
+
overflow.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx(primitives.ExpandableSection, { label: `Show ${overflow.length} more`, children: /* @__PURE__ */ jsxRuntime.jsx(AgendaRows, { rows: overflow, timeZone, today }) }) : null
|
|
723
|
+
] }),
|
|
724
|
+
view.hasMore || view.accountEmail ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 border-t border-border/40 px-4 py-1.5 text-[11px] text-muted-foreground", children: [
|
|
725
|
+
view.hasMore ? /* @__PURE__ */ jsxRuntime.jsx("span", { children: "More events match; ask Athena for the next page" }) : null,
|
|
726
|
+
view.accountEmail ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-auto truncate", children: view.accountEmail }) : null
|
|
727
|
+
] }) : null
|
|
728
|
+
] });
|
|
729
|
+
}
|
|
730
|
+
const CalendarEventsToolUIImpl = (props) => {
|
|
731
|
+
const { toolName, args, result, status, isError } = props;
|
|
732
|
+
const view = require$$0.useMemo(() => parseCalendarSearchResult(result), [result]);
|
|
733
|
+
if (documentEditToolUis.rendersAsGenericCard(props)) return /* @__PURE__ */ jsxRuntime.jsx(toolFallback.ToolFallback, { ...props, icon: lucideReact.CalendarIcon });
|
|
734
|
+
const typedArgs = recordOf(args);
|
|
735
|
+
const readsOneEvent = nonEmpty(typedArgs.event_id) !== null;
|
|
736
|
+
const titleFilter = toolResult.stringField(typedArgs, ["title"]);
|
|
737
|
+
const classification = toolResult.classifyToolResult({ status, result, isError });
|
|
738
|
+
const isRunning = classification.state === "running";
|
|
739
|
+
const isWaiting = classification.state === "requires-action";
|
|
740
|
+
const failure = isRunning || isWaiting ? null : readCalendarToolFailure(result) ?? (classification.state === "error" ? {
|
|
741
|
+
title: "The calendar request didn’t go through",
|
|
742
|
+
detail: classification.failure.message,
|
|
743
|
+
guidance: null
|
|
744
|
+
} : null);
|
|
745
|
+
const shown = failure ? null : view;
|
|
746
|
+
const single = (shown == null ? void 0 : shown.isSingleEvent) ? shown.events[0] : void 0;
|
|
747
|
+
const count = (shown == null ? void 0 : shown.events.length) ?? 0;
|
|
748
|
+
const cardStatus = isRunning ? "running" : isWaiting ? "requires-action" : failure ? "incomplete" : "complete";
|
|
749
|
+
const title = isRunning ? readsOneEvent ? "Reading the event..." : "Searching your calendar..." : isWaiting ? documentEditToolUis.waitingTitle(toolName) : failure ? failure.title : single ? "Calendar event" : "Calendar events";
|
|
750
|
+
const subtitle = single ? primitives.truncate(single.title, 90) : titleFilter && !readsOneEvent ? `“${primitives.truncate(titleFilter, 80)}”` : void 0;
|
|
751
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
752
|
+
primitives.ToolCard,
|
|
753
|
+
{
|
|
754
|
+
icon: lucideReact.CalendarIcon,
|
|
755
|
+
status: cardStatus,
|
|
756
|
+
title,
|
|
757
|
+
subtitle,
|
|
758
|
+
toolName,
|
|
759
|
+
badge: shown && !single ? count > 0 ? plural(count, "event") : "No events" : void 0,
|
|
760
|
+
error: (failure == null ? void 0 : failure.detail) ?? null,
|
|
761
|
+
args: typedArgs,
|
|
762
|
+
result,
|
|
763
|
+
children: [
|
|
764
|
+
failure ? /* @__PURE__ */ jsxRuntime.jsx(FailureGuidance, { guidance: failure.guidance }) : null,
|
|
765
|
+
shown ? /* @__PURE__ */ jsxRuntime.jsx(CalendarAgenda, { view: shown }) : null
|
|
766
|
+
]
|
|
767
|
+
}
|
|
768
|
+
);
|
|
769
|
+
};
|
|
770
|
+
const CalendarEventsToolUI = require$$0.memo(
|
|
771
|
+
CalendarEventsToolUIImpl
|
|
772
|
+
);
|
|
773
|
+
CalendarEventsToolUI.displayName = "CalendarEventsToolUI";
|
|
774
|
+
exports.CalendarEventsToolUI = CalendarEventsToolUI;
|
|
775
|
+
exports.EmailThreadToolUI = EmailThreadToolUI;
|
|
776
|
+
exports.SendAthenaEmailToolUI = SendAthenaEmailToolUI;
|
|
777
|
+
exports.agendaRows = agendaRows;
|
|
778
|
+
exports.emailBodyExcerpt = emailBodyExcerpt;
|
|
779
|
+
exports.formatAgendaTime = formatAgendaTime;
|
|
780
|
+
exports.gmailFullDate = gmailFullDate;
|
|
781
|
+
exports.gmailListDate = gmailListDate;
|
|
782
|
+
exports.parseCalendarEvent = parseCalendarEvent;
|
|
783
|
+
exports.parseCalendarSearchResult = parseCalendarSearchResult;
|
|
784
|
+
exports.parseEmailThreadResult = parseEmailThreadResult;
|
|
785
|
+
exports.readAthenaEmailSendOutcome = readAthenaEmailSendOutcome;
|
|
786
|
+
exports.readCalendarToolFailure = readCalendarToolFailure;
|
|
787
|
+
exports.readEmailToolFailure = readEmailToolFailure;
|
|
788
|
+
exports.viewerTimeZone = viewerTimeZone;
|
|
789
|
+
//# sourceMappingURL=email-calendar-tool-uis.cjs.map
|