@athenaintel/react 0.43.0 → 0.50.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 +258 -8
- package/dist/agent-runtime/src/answer-label.cjs +137 -0
- package/dist/agent-runtime/src/answer-label.cjs.map +1 -0
- package/dist/agent-runtime/src/answer-label.d.ts +104 -0
- package/dist/agent-runtime/src/answer-label.js +137 -0
- package/dist/agent-runtime/src/answer-label.js.map +1 -0
- package/dist/agent-runtime/src/answer-rows.cjs +180 -0
- package/dist/agent-runtime/src/answer-rows.cjs.map +1 -0
- package/dist/agent-runtime/src/answer-rows.d.ts +86 -0
- package/dist/agent-runtime/src/answer-rows.js +180 -0
- package/dist/agent-runtime/src/answer-rows.js.map +1 -0
- package/dist/agent-runtime/src/call-recap.cjs +319 -0
- package/dist/agent-runtime/src/call-recap.cjs.map +1 -0
- package/dist/agent-runtime/src/call-recap.d.ts +142 -0
- package/dist/agent-runtime/src/call-recap.js +319 -0
- package/dist/agent-runtime/src/call-recap.js.map +1 -0
- package/dist/agent-runtime/src/chat-outbox-store.cjs +1 -0
- package/dist/agent-runtime/src/chat-outbox-store.cjs.map +1 -1
- package/dist/agent-runtime/src/chat-outbox-store.d.ts +7 -0
- package/dist/agent-runtime/src/chat-outbox-store.js +1 -0
- package/dist/agent-runtime/src/chat-outbox-store.js.map +1 -1
- package/dist/agent-runtime/src/chat-outbox.cjs +46 -5
- package/dist/agent-runtime/src/chat-outbox.cjs.map +1 -1
- package/dist/agent-runtime/src/chat-outbox.d.ts +29 -0
- package/dist/agent-runtime/src/chat-outbox.js +46 -5
- package/dist/agent-runtime/src/chat-outbox.js.map +1 -1
- package/dist/agent-runtime/src/client-tool-bridge.cjs +15 -15
- package/dist/agent-runtime/src/client-tool-bridge.cjs.map +1 -1
- package/dist/agent-runtime/src/conversation-index.cjs +8 -8
- package/dist/agent-runtime/src/conversation-index.cjs.map +1 -1
- package/dist/agent-runtime/src/conversation-index.d.ts +7 -0
- package/dist/agent-runtime/src/conversation-index.js.map +1 -1
- package/dist/agent-runtime/src/conversation-list.cjs +2 -1
- package/dist/agent-runtime/src/conversation-list.cjs.map +1 -1
- package/dist/agent-runtime/src/conversation-list.d.ts +19 -3
- package/dist/agent-runtime/src/conversation-list.js +2 -1
- package/dist/agent-runtime/src/conversation-list.js.map +1 -1
- package/dist/agent-runtime/src/decision-checks.cjs +207 -0
- package/dist/agent-runtime/src/decision-checks.cjs.map +1 -0
- package/dist/agent-runtime/src/decision-checks.d.ts +142 -0
- package/dist/agent-runtime/src/decision-checks.js +207 -0
- package/dist/agent-runtime/src/decision-checks.js.map +1 -0
- package/dist/agent-runtime/src/desktop-handoff.d.ts +12 -0
- package/dist/agent-runtime/src/errors.cjs +18 -0
- package/dist/agent-runtime/src/errors.cjs.map +1 -1
- package/dist/agent-runtime/src/errors.d.ts +7 -0
- package/dist/agent-runtime/src/errors.js +18 -0
- package/dist/agent-runtime/src/errors.js.map +1 -1
- package/dist/agent-runtime/src/generated/runconfig-contract.cjs +12 -0
- package/dist/agent-runtime/src/generated/runconfig-contract.cjs.map +1 -1
- package/dist/agent-runtime/src/generated/runconfig-contract.d.ts +6 -6
- package/dist/agent-runtime/src/generated/runconfig-contract.js +12 -0
- package/dist/agent-runtime/src/generated/runconfig-contract.js.map +1 -1
- package/dist/agent-runtime/src/handoff-arrival.cjs +60 -0
- package/dist/agent-runtime/src/handoff-arrival.cjs.map +1 -0
- package/dist/agent-runtime/src/handoff-arrival.d.ts +46 -0
- package/dist/agent-runtime/src/handoff-arrival.js +60 -0
- package/dist/agent-runtime/src/handoff-arrival.js.map +1 -0
- package/dist/agent-runtime/src/index.d.ts +16 -9
- package/dist/agent-runtime/src/interrupts.cjs +71 -19
- package/dist/agent-runtime/src/interrupts.cjs.map +1 -1
- package/dist/agent-runtime/src/interrupts.d.ts +40 -3
- package/dist/agent-runtime/src/interrupts.js +56 -4
- package/dist/agent-runtime/src/interrupts.js.map +1 -1
- package/dist/agent-runtime/src/lane-history.cjs +8 -8
- package/dist/agent-runtime/src/lane-history.cjs.map +1 -1
- package/dist/agent-runtime/src/messages.cjs +43 -8
- package/dist/agent-runtime/src/messages.cjs.map +1 -1
- package/dist/agent-runtime/src/messages.d.ts +25 -3
- package/dist/agent-runtime/src/messages.js +43 -8
- package/dist/agent-runtime/src/messages.js.map +1 -1
- package/dist/agent-runtime/src/model-context.cjs +3 -2
- package/dist/agent-runtime/src/model-context.cjs.map +1 -1
- package/dist/agent-runtime/src/model-context.d.ts +6 -1
- package/dist/agent-runtime/src/model-context.js +3 -2
- package/dist/agent-runtime/src/model-context.js.map +1 -1
- package/dist/agent-runtime/src/offline-status.cjs +36 -0
- package/dist/agent-runtime/src/offline-status.cjs.map +1 -0
- package/dist/agent-runtime/src/offline-status.d.ts +118 -3
- package/dist/agent-runtime/src/offline-status.js +36 -0
- package/dist/agent-runtime/src/offline-status.js.map +1 -0
- package/dist/agent-runtime/src/queue.cjs +0 -9
- package/dist/agent-runtime/src/queue.cjs.map +1 -1
- package/dist/agent-runtime/src/queue.js +0 -9
- package/dist/agent-runtime/src/queue.js.map +1 -1
- package/dist/agent-runtime/src/quota-safe-local-storage-session.cjs +9 -9
- package/dist/agent-runtime/src/quota-safe-local-storage-session.cjs.map +1 -1
- package/dist/agent-runtime/src/runtime-catalog.cjs +42 -0
- package/dist/agent-runtime/src/runtime-catalog.cjs.map +1 -0
- package/dist/agent-runtime/src/runtime-catalog.d.ts +35 -0
- package/dist/agent-runtime/src/runtime-catalog.js +42 -0
- package/dist/agent-runtime/src/runtime-catalog.js.map +1 -0
- package/dist/agent-runtime/src/runtime-messages.cjs.map +1 -1
- package/dist/agent-runtime/src/runtime-messages.d.ts +1 -1
- package/dist/agent-runtime/src/runtime-messages.js.map +1 -1
- package/dist/agent-runtime/src/runtime.d.ts +41 -0
- package/dist/agent-runtime/src/send-recovery.cjs +37 -3
- package/dist/agent-runtime/src/send-recovery.cjs.map +1 -1
- package/dist/agent-runtime/src/send-recovery.d.ts +19 -0
- package/dist/agent-runtime/src/send-recovery.js +37 -3
- package/dist/agent-runtime/src/send-recovery.js.map +1 -1
- package/dist/agent-runtime/src/statewire-suspended.cjs +3 -3
- package/dist/agent-runtime/src/statewire-suspended.cjs.map +1 -1
- package/dist/agent-runtime/src/subagents.cjs +32 -2
- package/dist/agent-runtime/src/subagents.cjs.map +1 -1
- package/dist/agent-runtime/src/subagents.d.ts +9 -0
- package/dist/agent-runtime/src/subagents.js +30 -0
- package/dist/agent-runtime/src/subagents.js.map +1 -1
- package/dist/agent-runtime/src/thread-driver.cjs +67 -0
- package/dist/agent-runtime/src/thread-driver.cjs.map +1 -0
- package/dist/agent-runtime/src/thread-driver.d.ts +49 -0
- package/dist/agent-runtime/src/thread-driver.js +67 -0
- package/dist/agent-runtime/src/thread-driver.js.map +1 -0
- package/dist/agent-runtime/src/thread-handoff-flow-machine.d.ts +172 -0
- package/dist/agent-runtime/src/thread-handoff-protocol.d.ts +868 -0
- package/dist/agent-runtime/src/thread-handoff-qr.d.ts +11 -0
- package/dist/agent-runtime/src/thread-handoff.d.ts +3 -364
- package/dist/agent-runtime/src/thread-status.cjs +3 -3
- package/dist/agent-runtime/src/thread-status.cjs.map +1 -1
- package/dist/agent-runtime/src/tool-metadata.cjs +210 -25
- package/dist/agent-runtime/src/tool-metadata.cjs.map +1 -1
- package/dist/agent-runtime/src/tool-metadata.d.ts +12 -0
- package/dist/agent-runtime/src/tool-metadata.js +210 -25
- package/dist/agent-runtime/src/tool-metadata.js.map +1 -1
- package/dist/agent-runtime/src/tool-names.cjs +2 -0
- package/dist/agent-runtime/src/tool-names.cjs.map +1 -1
- package/dist/agent-runtime/src/tool-names.d.ts +2 -0
- package/dist/agent-runtime/src/tool-names.js +2 -0
- package/dist/agent-runtime/src/tool-names.js.map +1 -1
- package/dist/agent-runtime/src/types.d.ts +10 -2
- package/dist/agent-runtime/src/use-conversation-list.cjs +14 -13
- package/dist/agent-runtime/src/use-conversation-list.cjs.map +1 -1
- package/dist/agent-runtime/src/use-conversation-list.d.ts +6 -0
- package/dist/agent-runtime/src/use-conversation-list.js +3 -2
- package/dist/agent-runtime/src/use-conversation-list.js.map +1 -1
- package/dist/agent-runtime/src/use-deep-agent-chat-outbox.cjs +45 -20
- 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 +10 -3
- package/dist/agent-runtime/src/use-deep-agent-chat-outbox.js +27 -2
- package/dist/agent-runtime/src/use-deep-agent-chat-outbox.js.map +1 -1
- package/dist/agent-runtime/src/use-deep-agent-config.cjs +14 -14
- package/dist/agent-runtime/src/use-deep-agent-config.cjs.map +1 -1
- package/dist/agent-runtime/src/use-deep-agent-edit-submit.cjs +6 -6
- package/dist/agent-runtime/src/use-deep-agent-edit-submit.cjs.map +1 -1
- package/dist/agent-runtime/src/use-deep-agent-runtime.cjs +40 -22
- package/dist/agent-runtime/src/use-deep-agent-runtime.cjs.map +1 -1
- package/dist/agent-runtime/src/use-deep-agent-runtime.d.ts +17 -0
- package/dist/agent-runtime/src/use-deep-agent-runtime.js +24 -6
- package/dist/agent-runtime/src/use-deep-agent-runtime.js.map +1 -1
- package/dist/agent-runtime/src/use-deep-agent-thread.cjs +45 -45
- package/dist/agent-runtime/src/use-deep-agent-thread.cjs.map +1 -1
- package/dist/agent-runtime/src/use-deep-agent-voice.cjs +588 -130
- package/dist/agent-runtime/src/use-deep-agent-voice.cjs.map +1 -1
- package/dist/agent-runtime/src/use-deep-agent-voice.d.ts +162 -10
- package/dist/agent-runtime/src/use-deep-agent-voice.js +529 -71
- package/dist/agent-runtime/src/use-deep-agent-voice.js.map +1 -1
- package/dist/agent-runtime/src/use-deep-agent-window-sync.cjs +26 -26
- package/dist/agent-runtime/src/use-deep-agent-window-sync.cjs.map +1 -1
- package/dist/agent-runtime/src/use-historical-edit-attachments.cjs +4 -4
- package/dist/agent-runtime/src/use-historical-edit-attachments.cjs.map +1 -1
- package/dist/agent-runtime/src/use-thread-handoff-flow.d.ts +34 -26
- package/dist/agent-runtime/src/voice-earcon.cjs +139 -0
- package/dist/agent-runtime/src/voice-earcon.cjs.map +1 -0
- package/dist/agent-runtime/src/voice-earcon.d.ts +38 -0
- package/dist/agent-runtime/src/voice-earcon.js +139 -0
- package/dist/agent-runtime/src/voice-earcon.js.map +1 -0
- package/dist/agent-runtime/src/voice-media.cjs +117 -0
- package/dist/agent-runtime/src/voice-media.cjs.map +1 -0
- package/dist/agent-runtime/src/voice-media.d.ts +63 -0
- package/dist/agent-runtime/src/voice-media.js +117 -0
- package/dist/agent-runtime/src/voice-media.js.map +1 -0
- package/dist/agent-runtime/src/voice-presentation.cjs +2 -0
- package/dist/agent-runtime/src/voice-presentation.cjs.map +1 -1
- package/dist/agent-runtime/src/voice-presentation.js +2 -0
- package/dist/agent-runtime/src/voice-presentation.js.map +1 -1
- package/dist/agent-runtime/src/voice-wire-types.d.ts +32 -0
- package/dist/assets/AssetPanel.cjs +11 -11
- package/dist/assets/AssetPanel.cjs.map +1 -1
- package/dist/assets/AthenaAssetEmbed.cjs +11 -9
- package/dist/assets/AthenaAssetEmbed.cjs.map +1 -1
- package/dist/assets/AthenaAssetEmbed.d.ts +18 -5
- package/dist/assets/AthenaAssetEmbed.js +4 -2
- package/dist/assets/AthenaAssetEmbed.js.map +1 -1
- package/dist/assets/AthenaLayout.cjs +16 -16
- package/dist/assets/AthenaLayout.cjs.map +1 -1
- package/dist/assets/use-asset-content.cjs +4 -4
- package/dist/assets/use-asset-content.cjs.map +1 -1
- package/dist/assets/use-asset-embed.cjs +14 -7
- package/dist/assets/use-asset-embed.cjs.map +1 -1
- package/dist/assets/use-asset-embed.d.ts +23 -6
- package/dist/assets/use-asset-embed.js +10 -3
- package/dist/assets/use-asset-embed.js.map +1 -1
- package/dist/auth/AthenaAuthContext.cjs +3 -3
- package/dist/auth/AthenaAuthContext.cjs.map +1 -1
- package/dist/auth/AthenaAuthProvider.cjs +8 -8
- package/dist/auth/AthenaAuthProvider.cjs.map +1 -1
- package/dist/auth/AthenaCredentialSourceContext.cjs +5 -5
- package/dist/auth/AthenaCredentialSourceContext.cjs.map +1 -1
- package/dist/auth/AthenaSSOProvider.cjs +14 -14
- package/dist/auth/AthenaSSOProvider.cjs.map +1 -1
- package/dist/auth/credential-source.cjs +26 -13
- package/dist/auth/credential-source.cjs.map +1 -1
- package/dist/auth/credential-source.d.ts +8 -0
- package/dist/auth/credential-source.js +26 -13
- package/dist/auth/credential-source.js.map +1 -1
- package/dist/catalog/agent-model-options.cjs +25 -17
- package/dist/catalog/agent-model-options.cjs.map +1 -1
- package/dist/catalog/agent-model-options.d.ts +38 -5
- package/dist/catalog/agent-model-options.js +25 -17
- package/dist/catalog/agent-model-options.js.map +1 -1
- package/dist/catalog/channel-refusal.cjs +36 -0
- package/dist/catalog/channel-refusal.cjs.map +1 -0
- package/dist/catalog/channel-refusal.d.ts +29 -0
- package/dist/catalog/channel-refusal.js +36 -0
- package/dist/catalog/channel-refusal.js.map +1 -0
- package/dist/catalog/chat-pickers.cjs +60 -24
- package/dist/catalog/chat-pickers.cjs.map +1 -1
- package/dist/catalog/chat-pickers.d.ts +12 -2
- package/dist/catalog/chat-pickers.js +56 -20
- package/dist/catalog/chat-pickers.js.map +1 -1
- package/dist/catalog/runtime-catalog.cjs +89 -23
- package/dist/catalog/runtime-catalog.cjs.map +1 -1
- package/dist/catalog/runtime-catalog.d.ts +8 -2
- package/dist/catalog/runtime-catalog.js +83 -17
- package/dist/catalog/runtime-catalog.js.map +1 -1
- package/dist/catalog/use-athena-chat-mode.cjs +12 -12
- package/dist/catalog/use-athena-chat-mode.cjs.map +1 -1
- package/dist/chat/AthenaChat.cjs +155 -67
- package/dist/chat/AthenaChat.cjs.map +1 -1
- package/dist/chat/AthenaChat.d.ts +42 -2
- package/dist/chat/AthenaChat.js +106 -18
- package/dist/chat/AthenaChat.js.map +1 -1
- package/dist/chat/AthenaChatErrorBoundary.cjs +3 -3
- package/dist/chat/AthenaChatErrorBoundary.cjs.map +1 -1
- package/dist/chat/DrivingOnChip.cjs +23 -0
- package/dist/chat/DrivingOnChip.cjs.map +1 -0
- package/dist/chat/DrivingOnChip.d.ts +17 -0
- package/dist/chat/DrivingOnChip.js +23 -0
- package/dist/chat/DrivingOnChip.js.map +1 -0
- package/dist/chat/StatewireApprovalCard.cjs +166 -37
- package/dist/chat/StatewireApprovalCard.cjs.map +1 -1
- package/dist/chat/StatewireApprovalCard.d.ts +91 -2
- package/dist/chat/StatewireApprovalCard.js +156 -27
- package/dist/chat/StatewireApprovalCard.js.map +1 -1
- package/dist/chat/StatewireClientToolBridge.cjs +2 -2
- package/dist/chat/StatewireClientToolBridge.cjs.map +1 -1
- package/dist/chat/StatewireQueuedMessages.cjs +81 -69
- package/dist/chat/StatewireQueuedMessages.cjs.map +1 -1
- package/dist/chat/StatewireQueuedMessages.d.ts +25 -13
- package/dist/chat/StatewireQueuedMessages.js +73 -61
- package/dist/chat/StatewireQueuedMessages.js.map +1 -1
- package/dist/chat/WaitingOnYouBanner.cjs +9 -5
- package/dist/chat/WaitingOnYouBanner.cjs.map +1 -1
- package/dist/chat/WaitingOnYouBanner.js +7 -3
- package/dist/chat/WaitingOnYouBanner.js.map +1 -1
- package/dist/chat/athena-chat-welcome.cjs +2 -2
- package/dist/chat/athena-chat-welcome.cjs.map +1 -1
- package/dist/chat/athena-citation-links.cjs +5 -5
- package/dist/chat/athena-citation-links.cjs.map +1 -1
- package/dist/chat/athena-composer-controls.cjs +26 -16
- package/dist/chat/athena-composer-controls.cjs.map +1 -1
- package/dist/chat/athena-composer-controls.d.ts +6 -0
- package/dist/chat/athena-composer-controls.js +26 -16
- package/dist/chat/athena-composer-controls.js.map +1 -1
- package/dist/chat/athena-turn-end-status.cjs +42 -0
- package/dist/chat/athena-turn-end-status.cjs.map +1 -0
- package/dist/chat/athena-turn-end-status.d.ts +24 -0
- package/dist/chat/athena-turn-end-status.js +42 -0
- package/dist/chat/athena-turn-end-status.js.map +1 -0
- package/dist/chat/browser-decision-check.cjs +131 -0
- package/dist/chat/browser-decision-check.cjs.map +1 -0
- package/dist/chat/browser-decision-check.d.ts +61 -0
- package/dist/chat/browser-decision-check.js +131 -0
- package/dist/chat/browser-decision-check.js.map +1 -0
- package/dist/chat/chat-outbox-rows.cjs +3 -3
- package/dist/chat/chat-outbox-rows.cjs.map +1 -1
- package/dist/chat/chat-voice-controls.cjs +96 -29
- package/dist/chat/chat-voice-controls.cjs.map +1 -1
- package/dist/chat/chat-voice-controls.d.ts +42 -3
- package/dist/chat/chat-voice-controls.js +92 -25
- package/dist/chat/chat-voice-controls.js.map +1 -1
- package/dist/chat/composer-keyboard-hint.cjs +5 -5
- package/dist/chat/composer-keyboard-hint.cjs.map +1 -1
- package/dist/chat/device-operation.cjs +29 -0
- package/dist/chat/device-operation.cjs.map +1 -0
- package/dist/chat/device-operation.d.ts +34 -0
- package/dist/chat/device-operation.js +29 -0
- package/dist/chat/device-operation.js.map +1 -0
- package/dist/chat/super-grouping/CollapsibleGroup.cjs +14 -14
- package/dist/chat/super-grouping/CollapsibleGroup.cjs.map +1 -1
- package/dist/chat/super-grouping/GroupedMessageParts.cjs +4 -4
- package/dist/chat/super-grouping/GroupedMessageParts.cjs.map +1 -1
- package/dist/chat/super-grouping/SuperGroupingCard.cjs +52 -36
- package/dist/chat/super-grouping/SuperGroupingCard.cjs.map +1 -1
- package/dist/chat/super-grouping/SuperGroupingCard.d.ts +19 -4
- package/dist/chat/super-grouping/SuperGroupingCard.js +29 -13
- package/dist/chat/super-grouping/SuperGroupingCard.js.map +1 -1
- package/dist/chat/super-grouping/SuperGroupingTranscript.cjs +32 -32
- package/dist/chat/super-grouping/SuperGroupingTranscript.cjs.map +1 -1
- package/dist/chat/super-grouping/SuperGroupingTranscript.js +3 -3
- package/dist/chat/super-grouping/SuperGroupingTranscript.js.map +1 -1
- package/dist/chat/super-grouping/ToolTimeline.cjs +73 -40
- package/dist/chat/super-grouping/ToolTimeline.cjs.map +1 -1
- package/dist/chat/super-grouping/ToolTimeline.d.ts +10 -2
- package/dist/chat/super-grouping/ToolTimeline.js +69 -36
- package/dist/chat/super-grouping/ToolTimeline.js.map +1 -1
- package/dist/chat/super-grouping/activity-timeline.cjs +47 -12
- package/dist/chat/super-grouping/activity-timeline.cjs.map +1 -1
- package/dist/chat/super-grouping/activity-timeline.d.ts +21 -0
- package/dist/chat/super-grouping/activity-timeline.js +47 -12
- package/dist/chat/super-grouping/activity-timeline.js.map +1 -1
- package/dist/chat/super-grouping/grouping-function.cjs +4 -0
- package/dist/chat/super-grouping/grouping-function.cjs.map +1 -1
- package/dist/chat/super-grouping/grouping-function.d.ts +7 -0
- package/dist/chat/super-grouping/grouping-function.js +5 -1
- package/dist/chat/super-grouping/grouping-function.js.map +1 -1
- package/dist/chat/super-grouping/index.cjs +6 -0
- package/dist/chat/super-grouping/index.cjs.map +1 -1
- package/dist/chat/super-grouping/index.d.ts +5 -2
- package/dist/chat/super-grouping/index.js +7 -1
- package/dist/chat/super-grouping/index.js.map +1 -1
- package/dist/chat/super-grouping/tool-part-placement.cjs +17 -0
- package/dist/chat/super-grouping/tool-part-placement.cjs.map +1 -0
- package/dist/chat/super-grouping/tool-part-placement.d.ts +22 -0
- package/dist/chat/super-grouping/tool-part-placement.js +17 -0
- package/dist/chat/super-grouping/tool-part-placement.js.map +1 -0
- package/dist/chat/thread-scroll-to-bottom.cjs +2 -2
- package/dist/chat/thread-scroll-to-bottom.cjs.map +1 -1
- package/dist/chat/thread-scroll-to-bottom.d.ts +10 -7
- package/dist/chat/thread-scroll-to-bottom.js +2 -2
- package/dist/chat/thread-scroll-to-bottom.js.map +1 -1
- package/dist/chat/tooltip-icon-button.cjs +2 -2
- package/dist/chat/tooltip-icon-button.cjs.map +1 -1
- package/dist/chat/use-athena-voice-live.cjs +11 -0
- package/dist/chat/use-athena-voice-live.cjs.map +1 -0
- package/dist/chat/use-athena-voice-live.d.ts +11 -0
- package/dist/chat/use-athena-voice-live.js +11 -0
- package/dist/chat/use-athena-voice-live.js.map +1 -0
- package/dist/chat/use-statewire-approval-request.cjs +56 -24
- package/dist/chat/use-statewire-approval-request.cjs.map +1 -1
- package/dist/chat/use-statewire-approval-request.d.ts +33 -4
- package/dist/chat/use-statewire-approval-request.js +41 -9
- package/dist/chat/use-statewire-approval-request.js.map +1 -1
- package/dist/chat-ui/auth/sign-in-card.cjs +2 -2
- package/dist/chat-ui/auth/sign-in-card.cjs.map +1 -1
- package/dist/chat-ui/composer/tiptap-composer.cjs +138 -107
- package/dist/chat-ui/composer/tiptap-composer.cjs.map +1 -1
- package/dist/chat-ui/composer/tiptap-composer.d.ts +20 -4
- package/dist/chat-ui/composer/tiptap-composer.js +85 -54
- package/dist/chat-ui/composer/tiptap-composer.js.map +1 -1
- package/dist/chat-ui/header/conversation-history-panel.cjs +49 -23
- package/dist/chat-ui/header/conversation-history-panel.cjs.map +1 -1
- package/dist/chat-ui/header/conversation-history-panel.d.ts +12 -1
- package/dist/chat-ui/header/conversation-history-panel.js +38 -12
- package/dist/chat-ui/header/conversation-history-panel.js.map +1 -1
- package/dist/chat-ui/index.cjs +21 -0
- package/dist/chat-ui/index.cjs.map +1 -1
- package/dist/chat-ui/index.d.ts +8 -1
- package/dist/chat-ui/index.js +21 -0
- package/dist/chat-ui/index.js.map +1 -1
- package/dist/chat-ui/mentions/mention-chip.cjs +4 -4
- package/dist/chat-ui/mentions/mention-chip.cjs.map +1 -1
- package/dist/chat-ui/mentions/suggestions/components/mention-suggestion-list.cjs +10 -9
- package/dist/chat-ui/mentions/suggestions/components/mention-suggestion-list.cjs.map +1 -1
- package/dist/chat-ui/mentions/suggestions/components/mention-suggestion-list.js +3 -2
- package/dist/chat-ui/mentions/suggestions/components/mention-suggestion-list.js.map +1 -1
- package/dist/chat-ui/mentions/suggestions/components/mention-suggestion-popup.cjs +2 -2
- package/dist/chat-ui/mentions/suggestions/components/mention-suggestion-popup.cjs.map +1 -1
- package/dist/chat-ui/mentions/suggestions/components/menu-list.cjs +29 -6
- package/dist/chat-ui/mentions/suggestions/components/menu-list.cjs.map +1 -1
- package/dist/chat-ui/mentions/suggestions/components/menu-list.d.ts +7 -1
- package/dist/chat-ui/mentions/suggestions/components/menu-list.js +25 -2
- package/dist/chat-ui/mentions/suggestions/components/menu-list.js.map +1 -1
- package/dist/chat-ui/mentions/suggestions/components/use-keyboard-navigation.cjs +2 -2
- package/dist/chat-ui/mentions/suggestions/components/use-keyboard-navigation.cjs.map +1 -1
- package/dist/chat-ui/mentions/suggestions/components/use-menu-navigation.cjs +2 -2
- package/dist/chat-ui/mentions/suggestions/components/use-menu-navigation.cjs.map +1 -1
- package/dist/chat-ui/mentions/suggestions/data/api-client.cjs +3 -3
- package/dist/chat-ui/mentions/suggestions/data/api-client.cjs.map +1 -1
- package/dist/chat-ui/mentions/suggestions/data/orchestrator.cjs +56 -2
- package/dist/chat-ui/mentions/suggestions/data/orchestrator.cjs.map +1 -1
- package/dist/chat-ui/mentions/suggestions/data/orchestrator.d.ts +12 -0
- package/dist/chat-ui/mentions/suggestions/data/orchestrator.js +56 -2
- package/dist/chat-ui/mentions/suggestions/data/orchestrator.js.map +1 -1
- package/dist/chat-ui/mentions/suggestions/data/sources/index.cjs +24 -3
- package/dist/chat-ui/mentions/suggestions/data/sources/index.cjs.map +1 -1
- package/dist/chat-ui/mentions/suggestions/data/sources/index.d.ts +7 -0
- package/dist/chat-ui/mentions/suggestions/data/sources/index.js +24 -3
- package/dist/chat-ui/mentions/suggestions/data/sources/index.js.map +1 -1
- package/dist/chat-ui/mentions/suggestions/data/use-mention-suggestions.cjs +35 -13
- 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 +15 -1
- package/dist/chat-ui/mentions/suggestions/data/use-mention-suggestions.js +28 -6
- package/dist/chat-ui/mentions/suggestions/data/use-mention-suggestions.js.map +1 -1
- package/dist/chat-ui/mentions/suggestions/data/use-menu-items.cjs +9 -6
- package/dist/chat-ui/mentions/suggestions/data/use-menu-items.cjs.map +1 -1
- package/dist/chat-ui/mentions/suggestions/data/use-menu-items.d.ts +3 -0
- package/dist/chat-ui/mentions/suggestions/data/use-menu-items.js +5 -2
- package/dist/chat-ui/mentions/suggestions/data/use-menu-items.js.map +1 -1
- package/dist/chat-ui/mentions/use-account-workspace-id.cjs +45 -10
- package/dist/chat-ui/mentions/use-account-workspace-id.cjs.map +1 -1
- package/dist/chat-ui/mentions/use-account-workspace-id.d.ts +24 -1
- package/dist/chat-ui/mentions/use-account-workspace-id.js +46 -11
- package/dist/chat-ui/mentions/use-account-workspace-id.js.map +1 -1
- package/dist/chat-ui/mentions/use-member-avatar.cjs +4 -4
- package/dist/chat-ui/mentions/use-member-avatar.cjs.map +1 -1
- package/dist/chat-ui/mentions/use-mention-asset.cjs +3 -3
- package/dist/chat-ui/mentions/use-mention-asset.cjs.map +1 -1
- package/dist/chat-ui/messages/answer-label.cjs +42 -0
- package/dist/chat-ui/messages/answer-label.cjs.map +1 -0
- package/dist/chat-ui/messages/answer-label.d.ts +33 -0
- package/dist/chat-ui/messages/answer-label.js +42 -0
- package/dist/chat-ui/messages/answer-label.js.map +1 -0
- package/dist/chat-ui/messages/arrival-animation.cjs +13 -0
- package/dist/chat-ui/messages/arrival-animation.cjs.map +1 -0
- package/dist/chat-ui/messages/arrival-animation.d.ts +14 -0
- package/dist/chat-ui/messages/arrival-animation.js +13 -0
- package/dist/chat-ui/messages/arrival-animation.js.map +1 -0
- package/dist/chat-ui/messages/continue-pill.cjs +5 -5
- package/dist/chat-ui/messages/continue-pill.cjs.map +1 -1
- package/dist/chat-ui/messages/from-the-call-card.cjs +124 -0
- package/dist/chat-ui/messages/from-the-call-card.cjs.map +1 -0
- package/dist/chat-ui/messages/from-the-call-card.d.ts +17 -0
- package/dist/chat-ui/messages/from-the-call-card.js +124 -0
- package/dist/chat-ui/messages/from-the-call-card.js.map +1 -0
- package/dist/chat-ui/messages/handoff-arrival-divider.cjs +44 -0
- package/dist/chat-ui/messages/handoff-arrival-divider.cjs.map +1 -0
- package/dist/chat-ui/messages/handoff-arrival-divider.d.ts +17 -0
- package/dist/chat-ui/messages/handoff-arrival-divider.js +44 -0
- package/dist/chat-ui/messages/handoff-arrival-divider.js.map +1 -0
- package/dist/chat-ui/messages/message-actions-config.cjs +3 -3
- package/dist/chat-ui/messages/message-actions-config.cjs.map +1 -1
- package/dist/chat-ui/messages/message-components.cjs +8 -4
- package/dist/chat-ui/messages/message-components.cjs.map +1 -1
- package/dist/chat-ui/messages/message-components.js +5 -1
- package/dist/chat-ui/messages/message-components.js.map +1 -1
- package/dist/chat-ui/messages/message-images.cjs +66 -0
- package/dist/chat-ui/messages/message-images.cjs.map +1 -0
- package/dist/chat-ui/messages/message-images.d.ts +16 -0
- package/dist/chat-ui/messages/message-images.js +66 -0
- package/dist/chat-ui/messages/message-images.js.map +1 -0
- package/dist/chat-ui/messages/user-edit-composer.cjs +2 -2
- package/dist/chat-ui/messages/user-edit-composer.cjs.map +1 -1
- package/dist/chat-ui/messages/wake-marker.cjs +3 -3
- package/dist/chat-ui/messages/wake-marker.cjs.map +1 -1
- package/dist/chat-ui/rich-text/chat-link.cjs +3 -2
- package/dist/chat-ui/rich-text/chat-link.cjs.map +1 -1
- package/dist/chat-ui/rich-text/chat-link.d.ts +4 -0
- package/dist/chat-ui/rich-text/chat-link.js +4 -3
- package/dist/chat-ui/rich-text/chat-link.js.map +1 -1
- package/dist/chat-ui/rich-text/chat-message-body.cjs +9 -8
- package/dist/chat-ui/rich-text/chat-message-body.cjs.map +1 -1
- package/dist/chat-ui/rich-text/chat-message-body.d.ts +12 -0
- package/dist/chat-ui/rich-text/chat-message-body.js +2 -1
- package/dist/chat-ui/rich-text/chat-message-body.js.map +1 -1
- package/dist/chat-ui/rich-text/chat-node-views.cjs +6 -6
- package/dist/chat-ui/rich-text/chat-node-views.cjs.map +1 -1
- package/dist/chat-ui/rich-text/dom-output-spec.cjs +2 -2
- package/dist/chat-ui/rich-text/dom-output-spec.cjs.map +1 -1
- package/dist/chat-ui/statewire.cjs +3 -0
- package/dist/chat-ui/statewire.cjs.map +1 -1
- package/dist/chat-ui/statewire.d.ts +2 -1
- package/dist/chat-ui/statewire.js +3 -0
- package/dist/chat-ui/statewire.js.map +1 -1
- package/dist/chat-ui/thread/chat-thread-shell.cjs +45 -14
- package/dist/chat-ui/thread/chat-thread-shell.cjs.map +1 -1
- package/dist/chat-ui/thread/chat-thread-shell.d.ts +16 -2
- package/dist/chat-ui/thread/chat-thread-shell.js +37 -6
- package/dist/chat-ui/thread/chat-thread-shell.js.map +1 -1
- package/dist/chat-ui/thread/composer-send-or-stop.cjs +30 -20
- package/dist/chat-ui/thread/composer-send-or-stop.cjs.map +1 -1
- package/dist/chat-ui/thread/composer-send-or-stop.d.ts +8 -0
- package/dist/chat-ui/thread/composer-send-or-stop.js +29 -19
- package/dist/chat-ui/thread/composer-send-or-stop.js.map +1 -1
- package/dist/chat-ui/thread/statewire-history-edge.cjs +20 -21
- package/dist/chat-ui/thread/statewire-history-edge.cjs.map +1 -1
- package/dist/chat-ui/thread/statewire-history-edge.js +3 -4
- package/dist/chat-ui/thread/statewire-history-edge.js.map +1 -1
- package/dist/chat-ui/thread/thread-loading-overlay.cjs +5 -5
- package/dist/chat-ui/thread/thread-loading-overlay.cjs.map +1 -1
- package/dist/collab/client.cjs +52 -3
- package/dist/collab/client.cjs.map +1 -1
- package/dist/collab/client.d.ts +27 -0
- package/dist/collab/client.js +52 -3
- package/dist/collab/client.js.map +1 -1
- package/dist/collab/document-status.cjs +150 -0
- package/dist/collab/document-status.cjs.map +1 -0
- package/dist/collab/document-status.d.ts +68 -0
- package/dist/collab/document-status.js +150 -0
- package/dist/collab/document-status.js.map +1 -0
- package/dist/collab/index.cjs +7 -0
- package/dist/collab/index.cjs.map +1 -1
- package/dist/collab/index.d.ts +6 -1
- package/dist/collab/index.js +7 -0
- package/dist/collab/index.js.map +1 -1
- package/dist/collab/presence-react.cjs +11 -11
- package/dist/collab/presence-react.cjs.map +1 -1
- package/dist/collab/react.cjs +6 -6
- package/dist/collab/react.cjs.map +1 -1
- package/dist/composer/AttachmentContext.cjs +24 -11
- package/dist/composer/AttachmentContext.cjs.map +1 -1
- package/dist/composer/AttachmentContext.js +18 -5
- package/dist/composer/AttachmentContext.js.map +1 -1
- package/dist/composer/ComposerAttachmentPreview.cjs +78 -23
- package/dist/composer/ComposerAttachmentPreview.cjs.map +1 -1
- package/dist/composer/ComposerAttachmentPreview.d.ts +5 -3
- package/dist/composer/ComposerAttachmentPreview.js +79 -24
- package/dist/composer/ComposerAttachmentPreview.js.map +1 -1
- package/dist/composer/ComposerDropZone.cjs +7 -7
- package/dist/composer/ComposerDropZone.cjs.map +1 -1
- package/dist/composer/FileUploadButton.cjs +37 -22
- package/dist/composer/FileUploadButton.cjs.map +1 -1
- package/dist/composer/FileUploadButton.d.ts +6 -0
- package/dist/composer/FileUploadButton.js +34 -19
- package/dist/composer/FileUploadButton.js.map +1 -1
- package/dist/composer/QuoteContext.cjs +8 -8
- package/dist/composer/QuoteContext.cjs.map +1 -1
- package/dist/composer/composer-handoff.cjs +4 -4
- package/dist/composer/composer-handoff.cjs.map +1 -1
- package/dist/composer/index.d.ts +1 -1
- package/dist/composer/useAppendToComposer.cjs +4 -4
- package/dist/composer/useAppendToComposer.cjs.map +1 -1
- package/dist/composer/useAttachFiles.cjs +23 -6
- package/dist/composer/useAttachFiles.cjs.map +1 -1
- package/dist/composer/useAttachFiles.d.ts +15 -7
- package/dist/composer/useAttachFiles.js +22 -5
- package/dist/composer/useAttachFiles.js.map +1 -1
- package/dist/composer/useComposerAttachment.cjs +4 -4
- package/dist/composer/useComposerAttachment.cjs.map +1 -1
- package/dist/composer/useFileUpload.cjs +21 -16
- package/dist/composer/useFileUpload.cjs.map +1 -1
- package/dist/composer/useFileUpload.d.ts +12 -0
- package/dist/composer/useFileUpload.js +12 -7
- package/dist/composer/useFileUpload.js.map +1 -1
- package/dist/composer/useReadComposerDraft.cjs +27 -8
- package/dist/composer/useReadComposerDraft.cjs.map +1 -1
- package/dist/composer/useReadComposerDraft.d.ts +23 -1
- package/dist/composer/useReadComposerDraft.js +27 -8
- package/dist/composer/useReadComposerDraft.js.map +1 -1
- package/dist/composer/useSendMessage.cjs +4 -4
- package/dist/composer/useSendMessage.cjs.map +1 -1
- package/dist/diagnostics/useAthenaDiagnostics.cjs +4 -4
- package/dist/diagnostics/useAthenaDiagnostics.cjs.map +1 -1
- package/dist/dictation/audio-level-history.cjs +3 -3
- package/dist/dictation/audio-level-history.cjs.map +1 -1
- package/dist/dictation/dictation-controls.cjs +24 -20
- package/dist/dictation/dictation-controls.cjs.map +1 -1
- package/dist/dictation/dictation-controls.d.ts +6 -1
- package/dist/dictation/dictation-controls.js +24 -20
- package/dist/dictation/dictation-controls.js.map +1 -1
- package/dist/dictation/use-athena-dictation-engine.cjs +3 -3
- package/dist/dictation/use-athena-dictation-engine.cjs.map +1 -1
- package/dist/dictation/use-dictation.cjs +22 -22
- package/dist/dictation/use-dictation.cjs.map +1 -1
- package/dist/index.cjs +29 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +18 -4
- package/dist/index.js +30 -3
- package/dist/index.js.map +1 -1
- package/dist/keryx-http/src/receive-only-socket.cjs +40 -0
- package/dist/keryx-http/src/receive-only-socket.cjs.map +1 -0
- package/dist/keryx-http/src/receive-only-socket.d.ts +27 -0
- package/dist/keryx-http/src/receive-only-socket.js +40 -0
- package/dist/keryx-http/src/receive-only-socket.js.map +1 -0
- package/dist/keryx-http/src/unconfirmed-update-attributions.cjs +190 -0
- package/dist/keryx-http/src/unconfirmed-update-attributions.cjs.map +1 -0
- package/dist/keryx-http/src/unconfirmed-update-attributions.d.ts +132 -0
- package/dist/keryx-http/src/unconfirmed-update-attributions.js +190 -0
- package/dist/keryx-http/src/unconfirmed-update-attributions.js.map +1 -0
- package/dist/keryx-http/src/update-attributions.cjs +141 -0
- package/dist/keryx-http/src/update-attributions.cjs.map +1 -0
- package/dist/keryx-http/src/update-attributions.d.ts +107 -0
- package/dist/keryx-http/src/update-attributions.js +141 -0
- package/dist/keryx-http/src/update-attributions.js.map +1 -0
- package/dist/lib/owner-document.cjs +6 -6
- package/dist/lib/owner-document.cjs.map +1 -1
- package/dist/lib/use-athena-rest-query.cjs +4 -4
- package/dist/lib/use-athena-rest-query.cjs.map +1 -1
- package/dist/lib/use-document-active.cjs +4 -4
- package/dist/lib/use-document-active.cjs.map +1 -1
- package/dist/lib/use-prefers-reduced-motion.cjs +2 -2
- package/dist/lib/use-prefers-reduced-motion.cjs.map +1 -1
- package/dist/offline/offline-history.cjs +7 -7
- package/dist/offline/offline-history.cjs.map +1 -1
- package/dist/provider/AthenaContext.cjs +3 -3
- package/dist/provider/AthenaContext.cjs.map +1 -1
- package/dist/provider/AthenaProvider.cjs +120 -79
- package/dist/provider/AthenaProvider.cjs.map +1 -1
- package/dist/provider/AthenaProvider.d.ts +11 -1
- package/dist/provider/AthenaProvider.js +44 -3
- package/dist/provider/AthenaProvider.js.map +1 -1
- package/dist/provider/PostHogProvider.cjs +2 -2
- package/dist/provider/PostHogProvider.cjs.map +1 -1
- package/dist/provider/agent-selection-context.cjs +2 -2
- package/dist/provider/agent-selection-context.cjs.map +1 -1
- package/dist/provider/chat-mode-context.cjs +2 -2
- package/dist/provider/chat-mode-context.cjs.map +1 -1
- package/dist/provider/session-persistence-context.cjs +10 -0
- package/dist/provider/session-persistence-context.cjs.map +1 -0
- package/dist/provider/session-persistence-context.d.ts +15 -0
- package/dist/provider/session-persistence-context.js +10 -0
- package/dist/provider/session-persistence-context.js.map +1 -0
- package/dist/provider/statewire-history-context.cjs +4 -4
- package/dist/provider/statewire-history-context.cjs.map +1 -1
- package/dist/provider/statewire-lifecycle-context.cjs +3 -3
- package/dist/provider/statewire-lifecycle-context.cjs.map +1 -1
- package/dist/provider/statewire-window-context.cjs +3 -3
- package/dist/provider/statewire-window-context.cjs.map +1 -1
- package/dist/provider/theme-style-context.cjs +3 -3
- package/dist/provider/theme-style-context.cjs.map +1 -1
- package/dist/react/package.json.cjs +1 -1
- package/dist/react/package.json.js +1 -1
- package/dist/runtime/StatewireThreadConfigLaneSync.cjs +10 -10
- package/dist/runtime/StatewireThreadConfigLaneSync.cjs.map +1 -1
- package/dist/runtime/auth-refusal-restart.cjs +7 -7
- package/dist/runtime/auth-refusal-restart.cjs.map +1 -1
- package/dist/runtime/auth.cjs +13 -13
- package/dist/runtime/auth.cjs.map +1 -1
- package/dist/runtime/statewire-lifecycle.cjs +1 -0
- package/dist/runtime/statewire-lifecycle.cjs.map +1 -1
- package/dist/runtime/statewire-lifecycle.d.ts +3 -1
- package/dist/runtime/statewire-lifecycle.js +2 -1
- package/dist/runtime/statewire-lifecycle.js.map +1 -1
- package/dist/runtime/statewire-server-lane-context.cjs +2 -2
- package/dist/runtime/statewire-server-lane-context.cjs.map +1 -1
- package/dist/runtime/statewire-session-lane.cjs +4 -4
- package/dist/runtime/statewire-session-lane.cjs.map +1 -1
- package/dist/runtime/useAthenaStatewireRuntime.cjs +10 -8
- package/dist/runtime/useAthenaStatewireRuntime.cjs.map +1 -1
- package/dist/runtime/useAthenaStatewireRuntime.d.ts +2 -0
- package/dist/runtime/useAthenaStatewireRuntime.js +2 -0
- package/dist/runtime/useAthenaStatewireRuntime.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/threads/Inbox.cjs +8 -8
- package/dist/threads/Inbox.cjs.map +1 -1
- package/dist/threads/SessionList.cjs +9 -9
- package/dist/threads/SessionList.cjs.map +1 -1
- package/dist/threads/SessionsPage.cjs +11 -11
- package/dist/threads/SessionsPage.cjs.map +1 -1
- package/dist/threads/api.cjs.map +1 -1
- package/dist/threads/api.d.ts +15 -0
- package/dist/threads/api.js.map +1 -1
- package/dist/threads/conversation-list-fetcher.cjs +13 -5
- package/dist/threads/conversation-list-fetcher.cjs.map +1 -1
- package/dist/threads/conversation-list-fetcher.d.ts +4 -1
- package/dist/threads/conversation-list-fetcher.js +13 -5
- package/dist/threads/conversation-list-fetcher.js.map +1 -1
- package/dist/threads/index-triggered-refresh.cjs +10 -10
- package/dist/threads/index-triggered-refresh.cjs.map +1 -1
- package/dist/threads/mark-viewed-thread-read.cjs +12 -12
- package/dist/threads/mark-viewed-thread-read.cjs.map +1 -1
- package/dist/threads/offline-session-list.cjs +3 -3
- package/dist/threads/offline-session-list.cjs.map +1 -1
- package/dist/threads/session-list-tab-share.cjs +5 -5
- package/dist/threads/session-list-tab-share.cjs.map +1 -1
- package/dist/threads/statewire-thread-list.cjs +79 -57
- package/dist/threads/statewire-thread-list.cjs.map +1 -1
- package/dist/threads/statewire-thread-list.d.ts +20 -8
- package/dist/threads/statewire-thread-list.js +28 -6
- package/dist/threads/statewire-thread-list.js.map +1 -1
- package/dist/threads/thread-id-context.cjs +5 -5
- package/dist/threads/thread-id-context.cjs.map +1 -1
- package/dist/threads/use-athena-session-attention.cjs +2 -2
- package/dist/threads/use-athena-session-attention.cjs.map +1 -1
- package/dist/threads/use-athena-sessions.cjs +37 -15
- package/dist/threads/use-athena-sessions.cjs.map +1 -1
- package/dist/threads/use-athena-sessions.d.ts +10 -5
- package/dist/threads/use-athena-sessions.js +28 -6
- package/dist/threads/use-athena-sessions.js.map +1 -1
- package/dist/threads/use-athena-thread-model.cjs +3 -3
- package/dist/threads/use-athena-thread-model.cjs.map +1 -1
- package/dist/threads/use-rest-conversation-history.cjs +3 -3
- package/dist/threads/use-rest-conversation-history.cjs.map +1 -1
- package/dist/threads/use-rest-conversation-history.d.ts +1 -0
- package/dist/threads/use-statewire-conversation-history.cjs +8 -8
- package/dist/threads/use-statewire-conversation-history.cjs.map +1 -1
- package/dist/threads/use-thread-archive.cjs +9 -9
- package/dist/threads/use-thread-archive.cjs.map +1 -1
- package/dist/threads/use-thread-favorite.cjs +2 -2
- package/dist/threads/use-thread-favorite.cjs.map +1 -1
- package/dist/threads/use-thread-field-override.cjs +20 -20
- package/dist/threads/use-thread-field-override.cjs.map +1 -1
- package/dist/threads/use-thread-read-state.cjs +4 -4
- package/dist/threads/use-thread-read-state.cjs.map +1 -1
- package/dist/threads/use-thread-rename.cjs +2 -2
- package/dist/threads/use-thread-rename.cjs.map +1 -1
- package/dist/threads/useAthenaThreadManager.cjs +2 -2
- package/dist/threads/useAthenaThreadManager.cjs.map +1 -1
- package/dist/tools/NestedPtcMessages.cjs +6 -6
- package/dist/tools/NestedPtcMessages.cjs.map +1 -1
- package/dist/tools/append-document-tool-ui.cjs +7 -7
- package/dist/tools/append-document-tool-ui.cjs.map +1 -1
- package/dist/tools/file-tool-uis.cjs +2 -2
- package/dist/tools/file-tool-uis.cjs.map +1 -1
- package/dist/tools/misc-tool-uis.cjs +2 -2
- package/dist/tools/misc-tool-uis.cjs.map +1 -1
- package/dist/tools/primitives.cjs +6 -6
- package/dist/tools/primitives.cjs.map +1 -1
- package/dist/tools/read-asset-tool-ui.cjs +6 -6
- package/dist/tools/read-asset-tool-ui.cjs.map +1 -1
- package/dist/tools/subagent-task-tool-ui.cjs +21 -21
- package/dist/tools/subagent-task-tool-ui.cjs.map +1 -1
- package/dist/tools/test-recording-tool-uis.cjs +16 -16
- package/dist/tools/test-recording-tool-uis.cjs.map +1 -1
- package/dist/tools/todo-plan-store.cjs +4 -4
- package/dist/tools/todo-plan-store.cjs.map +1 -1
- package/dist/tools/tool-appearance.cjs +3 -3
- package/dist/tools/tool-appearance.cjs.map +1 -1
- package/dist/tools/tool-fallback.cjs +14 -14
- package/dist/tools/tool-fallback.cjs.map +1 -1
- package/dist/tools/tool-uis.cjs +74 -74
- package/dist/tools/tool-uis.cjs.map +1 -1
- package/dist/tools/use-elapsed-seconds.cjs +3 -3
- package/dist/tools/use-elapsed-seconds.cjs.map +1 -1
- package/dist/tools/write-todos-tool-ui.cjs +9 -9
- package/dist/tools/write-todos-tool-ui.cjs.map +1 -1
- package/dist/ui/image-viewer.cjs +382 -0
- package/dist/ui/image-viewer.cjs.map +1 -0
- package/dist/ui/image-viewer.d.ts +50 -0
- package/dist/ui/image-viewer.js +382 -0
- package/dist/ui/image-viewer.js.map +1 -0
- package/dist/voice/chat.cjs +6 -0
- package/dist/voice/chat.cjs.map +1 -1
- package/dist/voice/chat.d.ts +1 -1
- package/dist/voice/chat.js +8 -2
- package/dist/voice/livekit-join.cjs +52 -101
- package/dist/voice/livekit-join.cjs.map +1 -1
- package/dist/voice/livekit-join.d.ts +1 -6
- package/dist/voice/livekit-join.js +52 -101
- package/dist/voice/livekit-join.js.map +1 -1
- package/dist/voice/livekit.cjs.map +1 -1
- package/dist/voice/livekit.d.ts +11 -1
- package/dist/voice/livekit.js.map +1 -1
- package/dist/voice/use-athena-voice-session.cjs +34 -34
- package/dist/voice/use-athena-voice-session.cjs.map +1 -1
- package/dist/workbench/ComputerLiveDesktop.cjs +13 -13
- package/dist/workbench/ComputerLiveDesktop.cjs.map +1 -1
- package/dist/workbench/SessionWorkbench.cjs +22 -22
- package/dist/workbench/SessionWorkbench.cjs.map +1 -1
- package/dist/workbench/session-workbench-context.cjs +3 -3
- package/dist/workbench/session-workbench-context.cjs.map +1 -1
- package/dist/workbench/session-workbench-panes.cjs +8 -8
- package/dist/workbench/session-workbench-panes.cjs.map +1 -1
- package/dist/workbench/workbench-layout-context.cjs +3 -3
- package/dist/workbench/workbench-layout-context.cjs.map +1 -1
- package/package.json +2 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useStatewireSendCommand, useStatewireState } from "@assistant-ui/react-statewire";
|
|
2
|
-
import { useRef, useCallback, useState,
|
|
2
|
+
import { useRef, useCallback, useState, useMemo, useEffect } from "react";
|
|
3
3
|
import { statewireRejectionPayload } from "./errors.js";
|
|
4
4
|
import { readDeepAgentStreamValues, isDeepAgentStateHydrated } from "./statewire-state.js";
|
|
5
5
|
const readSendFailure = (error) => {
|
|
@@ -67,6 +67,47 @@ const parseVoiceLiveKitAnswer = (answer) => {
|
|
|
67
67
|
}
|
|
68
68
|
return { serverUrl, token, roomName };
|
|
69
69
|
};
|
|
70
|
+
class VoiceTransferRoomDroppedError extends Error {
|
|
71
|
+
constructor(reason) {
|
|
72
|
+
super(`The voice room disconnected before the call moved (${reason})`);
|
|
73
|
+
this.reason = reason;
|
|
74
|
+
this.name = "VoiceTransferRoomDroppedError";
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
const withAnswerDeadline = async (promise, ms) => {
|
|
78
|
+
let timer = null;
|
|
79
|
+
try {
|
|
80
|
+
return await Promise.race([
|
|
81
|
+
promise,
|
|
82
|
+
new Promise((_, reject) => {
|
|
83
|
+
timer = setTimeout(() => reject(new VoiceAnswerTimeoutError()), ms);
|
|
84
|
+
})
|
|
85
|
+
]);
|
|
86
|
+
} finally {
|
|
87
|
+
if (timer !== null) clearTimeout(timer);
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
const readTransferOffer = (result) => {
|
|
91
|
+
const record = result !== null && typeof result === "object" ? result : null;
|
|
92
|
+
const answer = record == null ? void 0 : record.answer;
|
|
93
|
+
const transferId = record == null ? void 0 : record.transferId;
|
|
94
|
+
return {
|
|
95
|
+
answer: typeof answer === "string" && answer !== "" ? answer : null,
|
|
96
|
+
transferId: typeof transferId === "string" && transferId !== "" ? transferId : null
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
const classifyTransferFailure = (error, stage) => {
|
|
100
|
+
const underlying = stage === "commit" ? error instanceof VoiceTransferRoomDroppedError ? { kind: "room_failed" } : classifyVoiceStartError(error) : classifyStartFailure(error, stage);
|
|
101
|
+
return {
|
|
102
|
+
kind: "transfer_failed",
|
|
103
|
+
stage,
|
|
104
|
+
message: describeVoiceTransferFailure({ reason: underlying.kind }),
|
|
105
|
+
reason: underlying.kind,
|
|
106
|
+
...underlying.code !== void 0 && { code: underlying.code },
|
|
107
|
+
...underlying.status !== void 0 && { status: underlying.status },
|
|
108
|
+
...underlying.fate !== void 0 && { fate: underlying.fate }
|
|
109
|
+
};
|
|
110
|
+
};
|
|
70
111
|
const classifyStartFailure = (error, stage) => {
|
|
71
112
|
const message = errorMessage(error);
|
|
72
113
|
switch (stage) {
|
|
@@ -109,6 +150,7 @@ const isMicrophoneDenied = (error) => {
|
|
|
109
150
|
}
|
|
110
151
|
return /permission|denied|not allowed/i.test(errorMessage(error));
|
|
111
152
|
};
|
|
153
|
+
const describeVoiceTransferFailure = ({ reason }) => reason === "microphone_denied" ? "Microphone access is blocked, so the call stayed on your other device. Allow the microphone for Athena and try again." : "The call couldn't move here and is still on your other device. Try again.";
|
|
112
154
|
const describeVoiceFailure = (failure) => {
|
|
113
155
|
switch (failure.kind) {
|
|
114
156
|
case "microphone_denied":
|
|
@@ -123,6 +165,8 @@ const describeVoiceFailure = (failure) => {
|
|
|
123
165
|
return "The voice room could not be joined. Check your connection and try again.";
|
|
124
166
|
case "media_lost":
|
|
125
167
|
return "The voice connection was lost. Start voice again to continue.";
|
|
168
|
+
case "transfer_failed":
|
|
169
|
+
return describeVoiceTransferFailure({ reason: failure.reason });
|
|
126
170
|
case "server_rejected":
|
|
127
171
|
if (failure.code === "voice-active") {
|
|
128
172
|
return "A voice session is already live on another device or tab. End it there first.";
|
|
@@ -188,6 +232,8 @@ const RELAY_CAPTURE_FRAME_SAMPLES = 1024;
|
|
|
188
232
|
const RELAY_PLAYBACK_LEAD_SECONDS = 0.02;
|
|
189
233
|
const MEDIA_DISCONNECT_GRACE_MS = 5e3;
|
|
190
234
|
const END_BEFORE_RESTART_TIMEOUT_MS = 3e3;
|
|
235
|
+
const TRANSFER_OFFER_TIMEOUT_MS = 15e3;
|
|
236
|
+
const TRANSFER_COMMIT_TIMEOUT_MS = 15e3;
|
|
191
237
|
const mintVoiceId = ({ kind }) => `voice${kind}_${Date.now().toString(36)}${Math.random().toString(36).slice(2, 12)}`;
|
|
192
238
|
const formatVoiceElapsed = (sinceMs, nowMs = Date.now()) => {
|
|
193
239
|
const total = Math.max(0, Math.floor((nowMs - sinceMs) / 1e3));
|
|
@@ -207,6 +253,42 @@ const useVoiceElapsed = (since) => {
|
|
|
207
253
|
}, [since]);
|
|
208
254
|
return since === null ? null : formatVoiceElapsed(since, now);
|
|
209
255
|
};
|
|
256
|
+
const VOICE_SURFACE_LABELS = {
|
|
257
|
+
web: "browser",
|
|
258
|
+
mobile: "phone",
|
|
259
|
+
chrome: "Chrome",
|
|
260
|
+
desktop: "desktop app",
|
|
261
|
+
office: "Office"
|
|
262
|
+
};
|
|
263
|
+
const voiceSurfaceLabel = (surface) => VOICE_SURFACE_LABELS[surface];
|
|
264
|
+
const VOICE_MOVE_CALL_HERE_LABEL = "Move call here";
|
|
265
|
+
const VOICE_MOVE_HERE_ACTION = "Move here";
|
|
266
|
+
const VOICE_CONTINUE_BY_VOICE_LABEL = "Continue by voice";
|
|
267
|
+
const describeVoiceLiveElsewhere = (surface) => `Live call on your ${voiceSurfaceLabel(surface)}`;
|
|
268
|
+
const describeVoiceMovedTo = (surface) => `Call moved to your ${voiceSurfaceLabel(surface)}`;
|
|
269
|
+
const VOICE_MOVED_NOTICE_MS = 6e3;
|
|
270
|
+
const useVoiceMovedNotice = (movedTo) => {
|
|
271
|
+
const [expired, setExpired] = useState(null);
|
|
272
|
+
useEffect(() => {
|
|
273
|
+
if (movedTo === null) return;
|
|
274
|
+
const timer = setTimeout(() => setExpired(movedTo), VOICE_MOVED_NOTICE_MS);
|
|
275
|
+
return () => clearTimeout(timer);
|
|
276
|
+
}, [movedTo]);
|
|
277
|
+
return movedTo !== null && expired !== movedTo ? describeVoiceMovedTo(movedTo.surface) : null;
|
|
278
|
+
};
|
|
279
|
+
const VOICE_SURFACES = new Set(Object.keys(VOICE_SURFACE_LABELS));
|
|
280
|
+
const parseVoiceOwner = (value) => {
|
|
281
|
+
if (value === null || typeof value !== "object") return null;
|
|
282
|
+
const { clientId, surface, since, transferable } = value;
|
|
283
|
+
if (typeof clientId !== "string" || clientId === "") return null;
|
|
284
|
+
if (typeof since !== "number" || !Number.isFinite(since)) return null;
|
|
285
|
+
return {
|
|
286
|
+
clientId,
|
|
287
|
+
surface: typeof surface === "string" && VOICE_SURFACES.has(surface) ? surface : "web",
|
|
288
|
+
since,
|
|
289
|
+
transferable: transferable === true
|
|
290
|
+
};
|
|
291
|
+
};
|
|
210
292
|
const REQUEST_LABELS = {
|
|
211
293
|
"session.commentary.append": "a result for the voice conversation",
|
|
212
294
|
"session.thinking.append": "a context update",
|
|
@@ -275,6 +357,11 @@ const waitForRelayOpen = (ws, timeoutMs) => new Promise((resolve, reject) => {
|
|
|
275
357
|
reject(new Error("The voice relay closed before it opened"));
|
|
276
358
|
});
|
|
277
359
|
});
|
|
360
|
+
const useRetainedHydrated = (value, initial) => {
|
|
361
|
+
const ref = useRef(initial);
|
|
362
|
+
if (value !== void 0) ref.current = value;
|
|
363
|
+
return ref.current;
|
|
364
|
+
};
|
|
278
365
|
const useDeepAgentVoice = (options = {}) => {
|
|
279
366
|
const wireSendCommand = useStatewireSendCommand();
|
|
280
367
|
const sendCommandRef = useRef(wireSendCommand);
|
|
@@ -332,6 +419,8 @@ const useDeepAgentVoice = (options = {}) => {
|
|
|
332
419
|
modelRef.current = options.model;
|
|
333
420
|
const onDiagnosticRef = useRef(options.onDiagnostic);
|
|
334
421
|
onDiagnosticRef.current = options.onDiagnostic;
|
|
422
|
+
const onCallMovedRef = useRef(options.onCallMoved);
|
|
423
|
+
onCallMovedRef.current = options.onCallMoved;
|
|
335
424
|
const timeoutsRef = useRef(options.timeouts);
|
|
336
425
|
timeoutsRef.current = options.timeouts;
|
|
337
426
|
const phaseRef = useRef("idle");
|
|
@@ -340,6 +429,50 @@ const useDeepAgentVoice = (options = {}) => {
|
|
|
340
429
|
const activeAudioSessionRef = useRef(null);
|
|
341
430
|
const startingAudioSessionRef = useRef(null);
|
|
342
431
|
const audioSessionIdleRef = useRef(Promise.resolve());
|
|
432
|
+
const ownClientIdRef = useRef(null);
|
|
433
|
+
const lastOwnedClientIdRef = useRef(null);
|
|
434
|
+
const transferRef = useRef(null);
|
|
435
|
+
const [movedTo, setMovedTo] = useState(null);
|
|
436
|
+
const hydratedTransferCapable = useStatewireState(
|
|
437
|
+
(s) => isDeepAgentStateHydrated(s) ? "voiceOwner" in readDeepAgentStreamValues(s) : void 0
|
|
438
|
+
);
|
|
439
|
+
const hydratedVoiceOwner = useStatewireState(
|
|
440
|
+
(s) => isDeepAgentStateHydrated(s) ? readDeepAgentStreamValues(s).voiceOwner ?? null : void 0
|
|
441
|
+
);
|
|
442
|
+
const hydratedWireOwnerId = useStatewireState((s) => {
|
|
443
|
+
if (!isDeepAgentStateHydrated(s)) return void 0;
|
|
444
|
+
const wire = readDeepAgentStreamValues(s).voice;
|
|
445
|
+
return typeof (wire == null ? void 0 : wire.clientId) === "string" && wire.clientId !== "" ? wire.clientId : null;
|
|
446
|
+
});
|
|
447
|
+
const hydratedWireLive = useStatewireState((s) => {
|
|
448
|
+
if (!isDeepAgentStateHydrated(s)) return void 0;
|
|
449
|
+
const wire = readDeepAgentStreamValues(s).voice;
|
|
450
|
+
return (wire == null ? void 0 : wire.status) === "live";
|
|
451
|
+
});
|
|
452
|
+
const transferCapable = useRetainedHydrated(hydratedTransferCapable, false);
|
|
453
|
+
const wireVoiceOwner = useRetainedHydrated(hydratedVoiceOwner, null);
|
|
454
|
+
const wireOwnerId = useRetainedHydrated(hydratedWireOwnerId, null);
|
|
455
|
+
const wireLive = useRetainedHydrated(hydratedWireLive, false);
|
|
456
|
+
const voiceOwner = useMemo(
|
|
457
|
+
() => transferCapable ? parseVoiceOwner(wireVoiceOwner) : null,
|
|
458
|
+
[transferCapable, wireVoiceOwner]
|
|
459
|
+
);
|
|
460
|
+
const transferCapableRef = useRef(transferCapable);
|
|
461
|
+
transferCapableRef.current = transferCapable;
|
|
462
|
+
const voiceOwnerRef = useRef(voiceOwner);
|
|
463
|
+
voiceOwnerRef.current = voiceOwner;
|
|
464
|
+
const wireOwnerIdRef = useRef(wireOwnerId);
|
|
465
|
+
wireOwnerIdRef.current = wireOwnerId;
|
|
466
|
+
const canTakeCall = transportRef.current === "livekit" && livekitAdapterRef.current !== void 0;
|
|
467
|
+
const elsewhere = voiceOwner !== null && voiceOwner.transferable && wireLive && canTakeCall && (phase === "idle" || phase === "error") && voiceOwner.clientId !== lastOwnedClientIdRef.current ? voiceOwner : null;
|
|
468
|
+
const elsewhereSurface = (elsewhere == null ? void 0 : elsewhere.surface) ?? null;
|
|
469
|
+
const elsewhereSince = (elsewhere == null ? void 0 : elsewhere.since) ?? null;
|
|
470
|
+
const liveElsewhere = useMemo(
|
|
471
|
+
() => elsewhereSurface === null || elsewhereSince === null ? null : { surface: elsewhereSurface, since: elsewhereSince },
|
|
472
|
+
[elsewhereSurface, elsewhereSince]
|
|
473
|
+
);
|
|
474
|
+
const liveElsewhereRef = useRef(liveElsewhere);
|
|
475
|
+
liveElsewhereRef.current = liveElsewhere;
|
|
343
476
|
const report = useCallback(
|
|
344
477
|
(event, attempt, data) => {
|
|
345
478
|
const observer = onDiagnosticRef.current;
|
|
@@ -364,7 +497,15 @@ const useDeepAgentVoice = (options = {}) => {
|
|
|
364
497
|
activeAudioSessionRef.current = null;
|
|
365
498
|
audioSessionIdleRef.current = audioSessionIdleRef.current.then(() => session.stop()).catch(() => void 0);
|
|
366
499
|
}, []);
|
|
367
|
-
const
|
|
500
|
+
const notifyCallMoved = useCallback((move) => {
|
|
501
|
+
const observer = onCallMovedRef.current;
|
|
502
|
+
if (!observer) return;
|
|
503
|
+
try {
|
|
504
|
+
void Promise.resolve(observer(move)).catch(() => void 0);
|
|
505
|
+
} catch {
|
|
506
|
+
}
|
|
507
|
+
}, []);
|
|
508
|
+
const teardown = useCallback((options2) => {
|
|
368
509
|
attemptRef.current += 1;
|
|
369
510
|
const livekitAbort = livekitAbortRef.current;
|
|
370
511
|
livekitAbortRef.current = null;
|
|
@@ -373,7 +514,7 @@ const useDeepAgentVoice = (options = {}) => {
|
|
|
373
514
|
var _a, _b;
|
|
374
515
|
return (_b = (_a = startingAudioSessionRef.current) == null ? void 0 : _a.cancelStart) == null ? void 0 : _b.call(_a);
|
|
375
516
|
});
|
|
376
|
-
releaseAudioSession();
|
|
517
|
+
if ((options2 == null ? void 0 : options2.keepAudioSession) !== true) releaseAudioSession();
|
|
377
518
|
const releasePeerListeners = releasePeerListenersRef.current;
|
|
378
519
|
releasePeerListenersRef.current = null;
|
|
379
520
|
releaseSafely(() => releasePeerListeners == null ? void 0 : releasePeerListeners());
|
|
@@ -421,6 +562,101 @@ const useDeepAgentVoice = (options = {}) => {
|
|
|
421
562
|
},
|
|
422
563
|
[report, teardown]
|
|
423
564
|
);
|
|
565
|
+
const handleMovedAway = useCallback(() => {
|
|
566
|
+
var _a;
|
|
567
|
+
const surface = ((_a = voiceOwnerRef.current) == null ? void 0 : _a.surface) ?? "web";
|
|
568
|
+
report("moved", attemptRef.current, { toSurface: surface });
|
|
569
|
+
notifyCallMoved({ direction: "away", surface });
|
|
570
|
+
teardown();
|
|
571
|
+
ownClientIdRef.current = null;
|
|
572
|
+
micMutedRef.current = false;
|
|
573
|
+
setMicMutedState(false);
|
|
574
|
+
setHandoffTask(null);
|
|
575
|
+
setFailure(null);
|
|
576
|
+
setPhase("idle");
|
|
577
|
+
setMovedTo({ surface });
|
|
578
|
+
}, [notifyCallMoved, report, teardown]);
|
|
579
|
+
const ownerMovedAway = useCallback(() => {
|
|
580
|
+
const own = ownClientIdRef.current;
|
|
581
|
+
const current = wireOwnerIdRef.current;
|
|
582
|
+
return transferCapableRef.current && own !== null && current !== null && current !== own;
|
|
583
|
+
}, []);
|
|
584
|
+
const acquireAudioSession = useCallback(
|
|
585
|
+
async ({
|
|
586
|
+
attempt,
|
|
587
|
+
audioSession
|
|
588
|
+
}) => {
|
|
589
|
+
const held = activeAudioSessionRef.current;
|
|
590
|
+
if (held !== null && held !== audioSession) releaseAudioSession();
|
|
591
|
+
await audioSessionIdleRef.current;
|
|
592
|
+
if (attemptRef.current !== attempt) {
|
|
593
|
+
report("stale-attempt", attempt, { stage: "audio-session" });
|
|
594
|
+
return false;
|
|
595
|
+
}
|
|
596
|
+
if (activeAudioSessionRef.current === audioSession) {
|
|
597
|
+
report("audio-session-ready", attempt, { reused: true });
|
|
598
|
+
return true;
|
|
599
|
+
}
|
|
600
|
+
startingAudioSessionRef.current = audioSession;
|
|
601
|
+
try {
|
|
602
|
+
await audioSession.start();
|
|
603
|
+
} finally {
|
|
604
|
+
startingAudioSessionRef.current = null;
|
|
605
|
+
}
|
|
606
|
+
activeAudioSessionRef.current = audioSession;
|
|
607
|
+
if (attemptRef.current !== attempt) {
|
|
608
|
+
report("stale-attempt", attempt, { stage: "audio-session" });
|
|
609
|
+
releaseAudioSession();
|
|
610
|
+
return false;
|
|
611
|
+
}
|
|
612
|
+
report("audio-session-ready", attempt);
|
|
613
|
+
return true;
|
|
614
|
+
},
|
|
615
|
+
[releaseAudioSession, report]
|
|
616
|
+
);
|
|
617
|
+
const joinVoiceRoom = useCallback(
|
|
618
|
+
async ({
|
|
619
|
+
attempt,
|
|
620
|
+
room,
|
|
621
|
+
adapter,
|
|
622
|
+
controller = new AbortController(),
|
|
623
|
+
onDisconnectedAfterJoin
|
|
624
|
+
}) => {
|
|
625
|
+
let joined = false;
|
|
626
|
+
let disconnectedWhileJoining = false;
|
|
627
|
+
livekitAbortRef.current = controller;
|
|
628
|
+
const session = await adapter.connect(room, {
|
|
629
|
+
micMuted: micMutedRef.current,
|
|
630
|
+
signal: controller.signal,
|
|
631
|
+
onDisconnected: (reason) => {
|
|
632
|
+
if (attemptRef.current !== attempt) return;
|
|
633
|
+
if (!joined) {
|
|
634
|
+
disconnectedWhileJoining = true;
|
|
635
|
+
return;
|
|
636
|
+
}
|
|
637
|
+
onDisconnectedAfterJoin(reason);
|
|
638
|
+
},
|
|
639
|
+
// Telemetry about this attempt's room stays this attempt's even after
|
|
640
|
+
// it ended: the room's closing summary arrives after teardown.
|
|
641
|
+
onEvent: (event) => {
|
|
642
|
+
report("media-event", attempt, { ...event.data, type: event.type });
|
|
643
|
+
}
|
|
644
|
+
});
|
|
645
|
+
if (attemptRef.current !== attempt) {
|
|
646
|
+
releaseSafely(() => session.disconnect());
|
|
647
|
+
return false;
|
|
648
|
+
}
|
|
649
|
+
if (disconnectedWhileJoining) {
|
|
650
|
+
releaseSafely(() => session.disconnect());
|
|
651
|
+
throw new Error("The voice room disconnected while joining");
|
|
652
|
+
}
|
|
653
|
+
joined = true;
|
|
654
|
+
livekitRef.current = session;
|
|
655
|
+
report("room-joined", attempt, { roomName: room.roomName });
|
|
656
|
+
return true;
|
|
657
|
+
},
|
|
658
|
+
[report]
|
|
659
|
+
);
|
|
424
660
|
const handleMediaLossRef = useRef(
|
|
425
661
|
async () => void 0
|
|
426
662
|
);
|
|
@@ -478,12 +714,15 @@ const useDeepAgentVoice = (options = {}) => {
|
|
|
478
714
|
node.start(startAt);
|
|
479
715
|
playheadRef.current = startAt + buffer.duration;
|
|
480
716
|
}, []);
|
|
481
|
-
const runStartSession = useCallback(async (
|
|
717
|
+
const runStartSession = useCallback(async ({
|
|
718
|
+
opening
|
|
719
|
+
} = {}) => {
|
|
482
720
|
var _a, _b, _c;
|
|
483
721
|
const attempt = attemptRef.current += 1;
|
|
484
722
|
const attemptId = mintVoiceId({ kind: "attempt" });
|
|
485
723
|
const previousAttemptId = observedAttemptRef.current;
|
|
486
724
|
callAttemptIdRef.current = attemptId;
|
|
725
|
+
ownClientIdRef.current = null;
|
|
487
726
|
startingRef.current = true;
|
|
488
727
|
attemptStartedAtRef.current = Date.now();
|
|
489
728
|
setFailure(null);
|
|
@@ -497,7 +736,10 @@ const useDeepAgentVoice = (options = {}) => {
|
|
|
497
736
|
report("stale-attempt", attempt, { stage });
|
|
498
737
|
releaseAudioSession();
|
|
499
738
|
};
|
|
500
|
-
report("start-requested", attempt, {
|
|
739
|
+
report("start-requested", attempt, {
|
|
740
|
+
transport: transportRef.current,
|
|
741
|
+
...opening !== void 0 && { opening }
|
|
742
|
+
});
|
|
501
743
|
try {
|
|
502
744
|
const transport = transportRef.current;
|
|
503
745
|
const mediaDevices = (_a = voiceGlobals.navigator) == null ? void 0 : _a.mediaDevices;
|
|
@@ -519,23 +761,7 @@ const useDeepAgentVoice = (options = {}) => {
|
|
|
519
761
|
const audioSession = audioSessionRef.current;
|
|
520
762
|
if (audioSession) {
|
|
521
763
|
stage = "audio-session";
|
|
522
|
-
await
|
|
523
|
-
if (attemptRef.current !== attempt) {
|
|
524
|
-
report("stale-attempt", attempt, { stage });
|
|
525
|
-
return;
|
|
526
|
-
}
|
|
527
|
-
startingAudioSessionRef.current = audioSession;
|
|
528
|
-
try {
|
|
529
|
-
await audioSession.start();
|
|
530
|
-
} finally {
|
|
531
|
-
startingAudioSessionRef.current = null;
|
|
532
|
-
}
|
|
533
|
-
activeAudioSessionRef.current = audioSession;
|
|
534
|
-
if (attemptRef.current !== attempt) {
|
|
535
|
-
stale();
|
|
536
|
-
return;
|
|
537
|
-
}
|
|
538
|
-
report("audio-session-ready", attempt);
|
|
764
|
+
if (!await acquireAudioSession({ attempt, audioSession })) return;
|
|
539
765
|
}
|
|
540
766
|
const modelOption = modelRef.current;
|
|
541
767
|
const requestedModel = typeof modelOption === "function" ? modelOption() : modelOption;
|
|
@@ -545,7 +771,8 @@ const useDeepAgentVoice = (options = {}) => {
|
|
|
545
771
|
offer: offer2,
|
|
546
772
|
attemptId,
|
|
547
773
|
...previousAttemptId !== void 0 && { previousAttemptId },
|
|
548
|
-
...model2 !== void 0 && { model: model2 }
|
|
774
|
+
...model2 !== void 0 && { model: model2 },
|
|
775
|
+
...opening !== void 0 && { opening }
|
|
549
776
|
});
|
|
550
777
|
const negotiateStart = async (offer2) => {
|
|
551
778
|
stage = "negotiate";
|
|
@@ -590,34 +817,16 @@ const useDeepAgentVoice = (options = {}) => {
|
|
|
590
817
|
try {
|
|
591
818
|
const room = parseVoiceLiveKitAnswer(answer2);
|
|
592
819
|
stage = "room";
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
micMuted: micMutedRef.current,
|
|
599
|
-
signal: controller.signal,
|
|
600
|
-
onDisconnected: (reason) => {
|
|
601
|
-
if (attemptRef.current !== attempt) return;
|
|
602
|
-
if (!joined) {
|
|
603
|
-
disconnectedWhileJoining = true;
|
|
604
|
-
return;
|
|
605
|
-
}
|
|
606
|
-
void handleMediaLossRef.current(attempt, reason);
|
|
607
|
-
}
|
|
820
|
+
const joinedRoom = await joinVoiceRoom({
|
|
821
|
+
attempt,
|
|
822
|
+
room,
|
|
823
|
+
adapter: livekitAdapter,
|
|
824
|
+
onDisconnectedAfterJoin: (reason) => void handleMediaLossRef.current(attempt, reason)
|
|
608
825
|
});
|
|
609
|
-
if (
|
|
610
|
-
releaseSafely(() => session.disconnect());
|
|
826
|
+
if (!joinedRoom) {
|
|
611
827
|
stale();
|
|
612
828
|
return;
|
|
613
829
|
}
|
|
614
|
-
if (disconnectedWhileJoining) {
|
|
615
|
-
releaseSafely(() => session.disconnect());
|
|
616
|
-
throw new Error("The voice room disconnected while joining");
|
|
617
|
-
}
|
|
618
|
-
joined = true;
|
|
619
|
-
livekitRef.current = session;
|
|
620
|
-
report("room-joined", attempt, { roomName: room.roomName });
|
|
621
830
|
} catch (roomError) {
|
|
622
831
|
if (attemptRef.current === attempt)
|
|
623
832
|
void sendCommand({ type: "voice/end", attemptId }).catch(() => void 0);
|
|
@@ -779,10 +988,19 @@ const useDeepAgentVoice = (options = {}) => {
|
|
|
779
988
|
} finally {
|
|
780
989
|
startingRef.current = false;
|
|
781
990
|
}
|
|
782
|
-
}, [
|
|
783
|
-
|
|
991
|
+
}, [
|
|
992
|
+
acquireAudioSession,
|
|
993
|
+
fail,
|
|
994
|
+
joinVoiceRoom,
|
|
995
|
+
playRelayChunk,
|
|
996
|
+
releaseAudioSession,
|
|
997
|
+
report,
|
|
998
|
+
sendCommand,
|
|
999
|
+
watchConnection
|
|
1000
|
+
]);
|
|
1001
|
+
const startSession = useCallback(async (options2 = {}) => {
|
|
784
1002
|
if (pcRef.current || wsRef.current || livekitRef.current || startingRef.current) return;
|
|
785
|
-
const run = runStartSession();
|
|
1003
|
+
const run = runStartSession(options2);
|
|
786
1004
|
startPromiseRef.current = run;
|
|
787
1005
|
try {
|
|
788
1006
|
await run;
|
|
@@ -795,13 +1013,18 @@ const useDeepAgentVoice = (options = {}) => {
|
|
|
795
1013
|
const handleMediaLoss = useCallback(
|
|
796
1014
|
async (attempt, reason) => {
|
|
797
1015
|
if (attemptRef.current !== attempt) return;
|
|
1016
|
+
if (ownerMovedAway()) {
|
|
1017
|
+
handleMovedAway();
|
|
1018
|
+
return;
|
|
1019
|
+
}
|
|
1020
|
+
const restarting = !autoRestartedRef.current;
|
|
798
1021
|
report("media-loss", attempt, {
|
|
799
1022
|
reason,
|
|
800
|
-
restartBudgetLeft:
|
|
1023
|
+
restartBudgetLeft: restarting
|
|
801
1024
|
});
|
|
802
1025
|
if (lastActiveTaskRef.current) setHandoffTask(lastActiveTaskRef.current);
|
|
803
1026
|
const ending = sendCommand({ type: "voice/end", attemptId: callAttemptIdRef.current }).catch(() => void 0);
|
|
804
|
-
teardown();
|
|
1027
|
+
teardown({ keepAudioSession: restarting });
|
|
805
1028
|
const recovery = attemptRef.current;
|
|
806
1029
|
setPhase("idle");
|
|
807
1030
|
let endTimer;
|
|
@@ -818,6 +1041,10 @@ const useDeepAgentVoice = (options = {}) => {
|
|
|
818
1041
|
const inflight = startPromiseRef.current;
|
|
819
1042
|
if (inflight) await inflight.catch(() => void 0);
|
|
820
1043
|
if (attemptRef.current !== recovery) return;
|
|
1044
|
+
if (ownerMovedAway()) {
|
|
1045
|
+
handleMovedAway();
|
|
1046
|
+
return;
|
|
1047
|
+
}
|
|
821
1048
|
if (!autoRestartedRef.current) {
|
|
822
1049
|
autoRestartedRef.current = true;
|
|
823
1050
|
report("auto-restart", recovery, { trigger: "media-loss", reason });
|
|
@@ -840,49 +1067,251 @@ const useDeepAgentVoice = (options = {}) => {
|
|
|
840
1067
|
setFailure(lost);
|
|
841
1068
|
setPhase("error");
|
|
842
1069
|
},
|
|
843
|
-
[report, sendCommand, teardown]
|
|
1070
|
+
[handleMovedAway, ownerMovedAway, report, sendCommand, teardown]
|
|
844
1071
|
);
|
|
845
1072
|
handleMediaLossRef.current = handleMediaLoss;
|
|
846
|
-
const start = useCallback(async () => {
|
|
1073
|
+
const start = useCallback(async (options2) => {
|
|
847
1074
|
if (pcRef.current || wsRef.current || livekitRef.current || startingRef.current) return;
|
|
848
1075
|
micMutedRef.current = false;
|
|
849
1076
|
setMicMutedState(false);
|
|
850
1077
|
autoRestartedRef.current = false;
|
|
851
1078
|
setHandoffTask(null);
|
|
852
|
-
|
|
1079
|
+
setMovedTo(null);
|
|
1080
|
+
await startSession((options2 == null ? void 0 : options2.opening) === "recap" ? { opening: "recap" } : {});
|
|
853
1081
|
}, [startSession]);
|
|
1082
|
+
const runTransferHere = useCallback(async () => {
|
|
1083
|
+
var _a;
|
|
1084
|
+
const fromSurface = ((_a = liveElsewhereRef.current) == null ? void 0 : _a.surface) ?? "web";
|
|
1085
|
+
const attempt = attemptRef.current += 1;
|
|
1086
|
+
const attemptId = mintVoiceId({ kind: "attempt" });
|
|
1087
|
+
callAttemptIdRef.current = attemptId;
|
|
1088
|
+
ownClientIdRef.current = null;
|
|
1089
|
+
const transfer = { attempt, transferId: null };
|
|
1090
|
+
transferRef.current = transfer;
|
|
1091
|
+
startingRef.current = true;
|
|
1092
|
+
attemptStartedAtRef.current = Date.now();
|
|
1093
|
+
setFailure(null);
|
|
1094
|
+
setPhase("connecting");
|
|
1095
|
+
let stage = "preflight";
|
|
1096
|
+
const timeouts = timeoutsRef.current;
|
|
1097
|
+
const offerMs = Math.min((timeouts == null ? void 0 : timeouts.answerMs) ?? ANSWER_TIMEOUT_MS, TRANSFER_OFFER_TIMEOUT_MS);
|
|
1098
|
+
const commitMs = (timeouts == null ? void 0 : timeouts.transferCommitMs) ?? TRANSFER_COMMIT_TIMEOUT_MS;
|
|
1099
|
+
const cancel = () => {
|
|
1100
|
+
const transferId = transfer.transferId;
|
|
1101
|
+
if (transferId === null) return;
|
|
1102
|
+
void sendCommand({ type: "voice/transfer-cancel", transferId }).catch(() => void 0);
|
|
1103
|
+
};
|
|
1104
|
+
let promotedCallEnded = false;
|
|
1105
|
+
const endPromotedCall = () => {
|
|
1106
|
+
if (promotedCallEnded) return;
|
|
1107
|
+
promotedCallEnded = true;
|
|
1108
|
+
void sendCommand({ type: "voice/end", attemptId }).catch(() => void 0);
|
|
1109
|
+
};
|
|
1110
|
+
const stale = () => {
|
|
1111
|
+
report("stale-attempt", attempt, { stage, transfer: true });
|
|
1112
|
+
if (transferRef.current === transfer) {
|
|
1113
|
+
transferRef.current = null;
|
|
1114
|
+
cancel();
|
|
1115
|
+
}
|
|
1116
|
+
releaseAudioSession();
|
|
1117
|
+
};
|
|
1118
|
+
const controller = new AbortController();
|
|
1119
|
+
livekitAbortRef.current = controller;
|
|
1120
|
+
const superseded = new Promise((_, reject) => {
|
|
1121
|
+
controller.signal.addEventListener("abort", () => reject(new Error("The move was superseded")), {
|
|
1122
|
+
once: true
|
|
1123
|
+
});
|
|
1124
|
+
});
|
|
1125
|
+
void superseded.catch(() => void 0);
|
|
1126
|
+
report("start-requested", attempt, { transport: "livekit", transfer: true });
|
|
1127
|
+
try {
|
|
1128
|
+
const livekitAdapter = livekitAdapterRef.current;
|
|
1129
|
+
if (transportRef.current !== "livekit" || !livekitAdapter)
|
|
1130
|
+
throw new Error("Voice is unavailable in this environment");
|
|
1131
|
+
const audioSession = audioSessionRef.current;
|
|
1132
|
+
if (audioSession) {
|
|
1133
|
+
stage = "audio-session";
|
|
1134
|
+
if (!await acquireAudioSession({ attempt, audioSession })) {
|
|
1135
|
+
stale();
|
|
1136
|
+
return;
|
|
1137
|
+
}
|
|
1138
|
+
}
|
|
1139
|
+
stage = "negotiate";
|
|
1140
|
+
const negotiationStartedAt = Date.now();
|
|
1141
|
+
const offer = sendCommand({ type: "voice/transfer-offer", attemptId });
|
|
1142
|
+
void offer.then((result) => {
|
|
1143
|
+
if (attemptRef.current === attempt) return;
|
|
1144
|
+
const { transferId } = readTransferOffer(result);
|
|
1145
|
+
if (transferId !== null)
|
|
1146
|
+
void sendCommand({ type: "voice/transfer-cancel", transferId }).catch(() => void 0);
|
|
1147
|
+
}).catch(() => void 0);
|
|
1148
|
+
const offered = readTransferOffer(
|
|
1149
|
+
await withAnswerDeadline(Promise.race([offer, superseded]), offerMs)
|
|
1150
|
+
);
|
|
1151
|
+
report("answer-received", attempt, {
|
|
1152
|
+
negotiationMs: Date.now() - negotiationStartedAt,
|
|
1153
|
+
transfer: true
|
|
1154
|
+
});
|
|
1155
|
+
if (attemptRef.current !== attempt) {
|
|
1156
|
+
stale();
|
|
1157
|
+
return;
|
|
1158
|
+
}
|
|
1159
|
+
stage = "answer";
|
|
1160
|
+
transfer.transferId = offered.transferId;
|
|
1161
|
+
if (offered.transferId === null || offered.answer === null)
|
|
1162
|
+
throw new VoiceNoAnswerError("voice/transfer-offer returned no voice room");
|
|
1163
|
+
const room = parseVoiceLiveKitAnswer(offered.answer);
|
|
1164
|
+
stage = "room";
|
|
1165
|
+
let moved = false;
|
|
1166
|
+
let roomDropped = () => void 0;
|
|
1167
|
+
const dropped = new Promise((_, reject) => {
|
|
1168
|
+
roomDropped = (reason) => reject(new VoiceTransferRoomDroppedError(reason));
|
|
1169
|
+
});
|
|
1170
|
+
void dropped.catch(() => void 0);
|
|
1171
|
+
const joinedRoom = await joinVoiceRoom({
|
|
1172
|
+
attempt,
|
|
1173
|
+
room,
|
|
1174
|
+
adapter: livekitAdapter,
|
|
1175
|
+
controller,
|
|
1176
|
+
onDisconnectedAfterJoin: (reason) => {
|
|
1177
|
+
if (moved) void handleMediaLossRef.current(attempt, reason);
|
|
1178
|
+
else roomDropped(reason);
|
|
1179
|
+
}
|
|
1180
|
+
});
|
|
1181
|
+
if (!joinedRoom) {
|
|
1182
|
+
stale();
|
|
1183
|
+
return;
|
|
1184
|
+
}
|
|
1185
|
+
stage = "commit";
|
|
1186
|
+
const commit = sendCommand({
|
|
1187
|
+
type: "voice/transfer-commit",
|
|
1188
|
+
transferId: offered.transferId,
|
|
1189
|
+
attemptId
|
|
1190
|
+
});
|
|
1191
|
+
void commit.then(
|
|
1192
|
+
() => {
|
|
1193
|
+
if (attemptRef.current !== attempt) endPromotedCall();
|
|
1194
|
+
},
|
|
1195
|
+
(commitError) => {
|
|
1196
|
+
if (attemptRef.current === attempt) return;
|
|
1197
|
+
const failure2 = readSendFailure(commitError);
|
|
1198
|
+
if (failure2 !== null && failure2.fate !== "rejected") endPromotedCall();
|
|
1199
|
+
}
|
|
1200
|
+
);
|
|
1201
|
+
await withAnswerDeadline(Promise.race([commit, dropped, superseded]), commitMs);
|
|
1202
|
+
if (attemptRef.current !== attempt) {
|
|
1203
|
+
stale();
|
|
1204
|
+
return;
|
|
1205
|
+
}
|
|
1206
|
+
moved = true;
|
|
1207
|
+
transferRef.current = null;
|
|
1208
|
+
report("live", attempt, { transport: "livekit", transfer: true });
|
|
1209
|
+
setPhase("live");
|
|
1210
|
+
setLiveSince(Date.now());
|
|
1211
|
+
notifyCallMoved({ direction: "here", surface: fromSurface });
|
|
1212
|
+
} catch (transferError) {
|
|
1213
|
+
if (attemptRef.current !== attempt) {
|
|
1214
|
+
stale();
|
|
1215
|
+
return;
|
|
1216
|
+
}
|
|
1217
|
+
cancel();
|
|
1218
|
+
const sendFailure = readSendFailure(transferError);
|
|
1219
|
+
if (stage === "commit" && sendFailure !== null && sendFailure.fate !== "rejected")
|
|
1220
|
+
endPromotedCall();
|
|
1221
|
+
transferRef.current = null;
|
|
1222
|
+
fail(classifyTransferFailure(transferError, stage));
|
|
1223
|
+
} finally {
|
|
1224
|
+
startingRef.current = false;
|
|
1225
|
+
}
|
|
1226
|
+
}, [
|
|
1227
|
+
acquireAudioSession,
|
|
1228
|
+
fail,
|
|
1229
|
+
joinVoiceRoom,
|
|
1230
|
+
notifyCallMoved,
|
|
1231
|
+
releaseAudioSession,
|
|
1232
|
+
report,
|
|
1233
|
+
sendCommand
|
|
1234
|
+
]);
|
|
1235
|
+
const transferHere = useCallback(async () => {
|
|
1236
|
+
if (pcRef.current || wsRef.current || livekitRef.current || startingRef.current) return;
|
|
1237
|
+
if (liveElsewhereRef.current === null) return;
|
|
1238
|
+
micMutedRef.current = false;
|
|
1239
|
+
setMicMutedState(false);
|
|
1240
|
+
autoRestartedRef.current = false;
|
|
1241
|
+
setHandoffTask(null);
|
|
1242
|
+
setMovedTo(null);
|
|
1243
|
+
const run = runTransferHere();
|
|
1244
|
+
startPromiseRef.current = run;
|
|
1245
|
+
try {
|
|
1246
|
+
await run;
|
|
1247
|
+
} finally {
|
|
1248
|
+
if (startPromiseRef.current === run) startPromiseRef.current = null;
|
|
1249
|
+
}
|
|
1250
|
+
}, [runTransferHere]);
|
|
1251
|
+
const releaseCall = useCallback(() => {
|
|
1252
|
+
const transfer = transferRef.current;
|
|
1253
|
+
transferRef.current = null;
|
|
1254
|
+
if (transfer !== null) {
|
|
1255
|
+
if (transfer.transferId !== null) {
|
|
1256
|
+
void sendCommand({ type: "voice/transfer-cancel", transferId: transfer.transferId }).catch(
|
|
1257
|
+
() => void 0
|
|
1258
|
+
);
|
|
1259
|
+
}
|
|
1260
|
+
return;
|
|
1261
|
+
}
|
|
1262
|
+
void sendCommand({ type: "voice/end", attemptId: callAttemptIdRef.current }).catch(() => void 0);
|
|
1263
|
+
}, [sendCommand]);
|
|
854
1264
|
const end = useCallback(() => {
|
|
855
1265
|
if (phase === "connecting" || phase === "live") {
|
|
856
1266
|
report("end", attemptRef.current, { source: "user", phase });
|
|
857
|
-
|
|
858
|
-
|
|
1267
|
+
const moving = transferRef.current !== null;
|
|
1268
|
+
releaseCall();
|
|
1269
|
+
if (!moving && lastActiveTaskRef.current) setHandoffTask(lastActiveTaskRef.current);
|
|
859
1270
|
}
|
|
860
1271
|
teardown();
|
|
861
1272
|
micMutedRef.current = false;
|
|
862
1273
|
setMicMutedState(false);
|
|
863
1274
|
setPhase("idle");
|
|
864
|
-
}, [phase,
|
|
1275
|
+
}, [phase, releaseCall, report, teardown]);
|
|
865
1276
|
const setMicMuted = useCallback(
|
|
866
1277
|
(muted) => {
|
|
867
1278
|
if (phase !== "live") return;
|
|
868
1279
|
const attempt = attemptRef.current;
|
|
1280
|
+
const attemptId = callAttemptIdRef.current;
|
|
869
1281
|
const change = ++micChangeRef.current;
|
|
870
1282
|
const applyLocal = (value) => {
|
|
871
1283
|
var _a;
|
|
872
1284
|
micMutedRef.current = value;
|
|
873
1285
|
setMicMutedState(value);
|
|
874
|
-
for (const track of ((_a = streamRef.current) == null ? void 0 : _a.getTracks()) ?? []) track.enabled = !value;
|
|
875
1286
|
const room = livekitRef.current;
|
|
876
|
-
|
|
1287
|
+
const mediaFailed = () => {
|
|
1288
|
+
if (attemptRef.current !== attempt || micChangeRef.current !== change || livekitRef.current !== room) return;
|
|
1289
|
+
void sendCommand({ type: "voice/end", attemptId }).catch(() => void 0);
|
|
1290
|
+
if (lastActiveTaskRef.current) setHandoffTask(lastActiveTaskRef.current);
|
|
1291
|
+
fail({
|
|
1292
|
+
kind: "media_lost",
|
|
1293
|
+
stage: "media",
|
|
1294
|
+
reason: "microphone-control-failed",
|
|
1295
|
+
message: "Voice ended because the microphone could not be changed. Start a new call to try again."
|
|
1296
|
+
});
|
|
1297
|
+
};
|
|
1298
|
+
try {
|
|
1299
|
+
for (const track of ((_a = streamRef.current) == null ? void 0 : _a.getTracks()) ?? []) track.enabled = !value;
|
|
1300
|
+
if (room) void room.setMicrophoneEnabled(!value).catch(mediaFailed);
|
|
1301
|
+
return true;
|
|
1302
|
+
} catch {
|
|
1303
|
+
mediaFailed();
|
|
1304
|
+
return false;
|
|
1305
|
+
}
|
|
877
1306
|
};
|
|
878
|
-
applyLocal(muted);
|
|
879
|
-
void sendCommand({ type: "voice/set-mic", paused: muted, attemptId
|
|
1307
|
+
if (!applyLocal(muted)) return;
|
|
1308
|
+
void sendCommand({ type: "voice/set-mic", paused: muted, attemptId }).catch(() => {
|
|
880
1309
|
if (!muted && attemptRef.current === attempt && micChangeRef.current === change) {
|
|
881
1310
|
applyLocal(true);
|
|
882
1311
|
}
|
|
883
1312
|
});
|
|
884
1313
|
},
|
|
885
|
-
[phase, sendCommand]
|
|
1314
|
+
[phase, sendCommand, fail]
|
|
886
1315
|
);
|
|
887
1316
|
const sessionGone = useStatewireState(
|
|
888
1317
|
(s) => isDeepAgentStateHydrated(s) && (readDeepAgentStreamValues(s).voice ?? null) === null
|
|
@@ -890,18 +1319,31 @@ const useDeepAgentVoice = (options = {}) => {
|
|
|
890
1319
|
useEffect(() => {
|
|
891
1320
|
var _a;
|
|
892
1321
|
if (phase !== "live" || !sessionGone) return;
|
|
1322
|
+
const restarting = !autoRestartedRef.current;
|
|
893
1323
|
report("server-ended", attemptRef.current, {
|
|
894
|
-
restartBudgetLeft:
|
|
1324
|
+
restartBudgetLeft: restarting
|
|
895
1325
|
});
|
|
896
1326
|
if (lastActiveTaskRef.current) setHandoffTask(lastActiveTaskRef.current);
|
|
897
|
-
teardown();
|
|
1327
|
+
teardown({ keepAudioSession: restarting });
|
|
898
1328
|
setPhase("idle");
|
|
899
|
-
if (
|
|
1329
|
+
if (restarting) {
|
|
900
1330
|
autoRestartedRef.current = true;
|
|
901
1331
|
report("auto-restart", attemptRef.current, { trigger: "server-ended" });
|
|
902
1332
|
void ((_a = startRef.current) == null ? void 0 : _a.call(startRef));
|
|
903
1333
|
}
|
|
904
1334
|
}, [phase, report, sessionGone, teardown]);
|
|
1335
|
+
useEffect(() => {
|
|
1336
|
+
if (phase !== "live" || !transferCapable || wireOwnerId === null) return;
|
|
1337
|
+
const own = ownClientIdRef.current;
|
|
1338
|
+
if (own === null) {
|
|
1339
|
+
const fence = observedAttemptRef.current;
|
|
1340
|
+
if (fence !== void 0 && fence !== callAttemptIdRef.current) return;
|
|
1341
|
+
ownClientIdRef.current = wireOwnerId;
|
|
1342
|
+
lastOwnedClientIdRef.current = wireOwnerId;
|
|
1343
|
+
return;
|
|
1344
|
+
}
|
|
1345
|
+
if (wireOwnerId !== own) handleMovedAway();
|
|
1346
|
+
}, [phase, transferCapable, wireOwnerId, observedAttempt, handleMovedAway]);
|
|
905
1347
|
useEffect(
|
|
906
1348
|
() => () => {
|
|
907
1349
|
const phaseAtUnmount = phaseRef.current;
|
|
@@ -910,11 +1352,12 @@ const useDeepAgentVoice = (options = {}) => {
|
|
|
910
1352
|
source: "unmount",
|
|
911
1353
|
phase: phaseAtUnmount
|
|
912
1354
|
});
|
|
913
|
-
|
|
1355
|
+
releaseCall();
|
|
914
1356
|
}
|
|
1357
|
+
transferRef.current = null;
|
|
915
1358
|
teardown();
|
|
916
1359
|
},
|
|
917
|
-
[
|
|
1360
|
+
[releaseCall, report, teardown]
|
|
918
1361
|
);
|
|
919
1362
|
const activeTask = (voice == null ? void 0 : voice.activeTask) ?? null;
|
|
920
1363
|
useEffect(() => {
|
|
@@ -991,7 +1434,10 @@ const useDeepAgentVoice = (options = {}) => {
|
|
|
991
1434
|
notice,
|
|
992
1435
|
sendContext,
|
|
993
1436
|
model,
|
|
994
|
-
modelOptions
|
|
1437
|
+
modelOptions,
|
|
1438
|
+
liveElsewhere,
|
|
1439
|
+
transferHere,
|
|
1440
|
+
movedTo
|
|
995
1441
|
}),
|
|
996
1442
|
[
|
|
997
1443
|
phase,
|
|
@@ -1009,26 +1455,38 @@ const useDeepAgentVoice = (options = {}) => {
|
|
|
1009
1455
|
notice,
|
|
1010
1456
|
sendContext,
|
|
1011
1457
|
model,
|
|
1012
|
-
modelOptions
|
|
1458
|
+
modelOptions,
|
|
1459
|
+
liveElsewhere,
|
|
1460
|
+
transferHere,
|
|
1461
|
+
movedTo
|
|
1013
1462
|
]
|
|
1014
1463
|
);
|
|
1015
1464
|
};
|
|
1016
1465
|
export {
|
|
1466
|
+
VOICE_CONTINUE_BY_VOICE_LABEL,
|
|
1017
1467
|
VOICE_LIVEKIT_ANSWER_PREFIX,
|
|
1018
1468
|
VOICE_LIVEKIT_OFFER,
|
|
1469
|
+
VOICE_MOVED_NOTICE_MS,
|
|
1470
|
+
VOICE_MOVE_CALL_HERE_LABEL,
|
|
1471
|
+
VOICE_MOVE_HERE_ACTION,
|
|
1019
1472
|
VOICE_RELAY_ANSWER_PREFIX,
|
|
1020
1473
|
VOICE_RELAY_SAMPLE_RATE,
|
|
1021
1474
|
VOICE_WEBSOCKET_OFFER,
|
|
1022
1475
|
classifyVoiceStartError,
|
|
1023
1476
|
describeVoiceFailure,
|
|
1477
|
+
describeVoiceLiveElsewhere,
|
|
1478
|
+
describeVoiceMovedTo,
|
|
1024
1479
|
describeVoiceWireError,
|
|
1025
1480
|
float32FromPcm16,
|
|
1026
1481
|
formatVoiceElapsed,
|
|
1027
1482
|
parseVoiceLiveKitAnswer,
|
|
1028
1483
|
parseVoiceModelOptions,
|
|
1484
|
+
parseVoiceOwner,
|
|
1029
1485
|
pcm16FromFloat32,
|
|
1030
1486
|
useDeepAgentVoice,
|
|
1031
1487
|
useVoiceElapsed,
|
|
1032
|
-
|
|
1488
|
+
useVoiceMovedNotice,
|
|
1489
|
+
voiceRelayUrl,
|
|
1490
|
+
voiceSurfaceLabel
|
|
1033
1491
|
};
|
|
1034
1492
|
//# sourceMappingURL=use-deep-agent-voice.js.map
|