@athenaintel/react 0.42.2 → 0.48.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 +225 -3
- 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/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-list-groups.d.ts +74 -0
- 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 +15 -8
- package/dist/agent-runtime/src/interrupts.cjs +43 -18
- package/dist/agent-runtime/src/interrupts.cjs.map +1 -1
- package/dist/agent-runtime/src/interrupts.d.ts +19 -2
- package/dist/agent-runtime/src/interrupts.js +28 -3
- 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/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 +40 -0
- 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 +756 -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 -33
- 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 -33
- 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 +11 -11
- package/dist/agent-runtime/src/use-conversation-list.cjs.map +1 -1
- package/dist/agent-runtime/src/use-deep-agent-chat-outbox.cjs +24 -19
- 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 +2 -1
- package/dist/agent-runtime/src/use-deep-agent-chat-outbox.js +6 -1
- 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 +16 -16
- package/dist/agent-runtime/src/use-deep-agent-runtime.cjs.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 +572 -134
- package/dist/agent-runtime/src/use-deep-agent-voice.cjs.map +1 -1
- package/dist/agent-runtime/src/use-deep-agent-voice.d.ts +137 -10
- package/dist/agent-runtime/src/use-deep-agent-voice.js +514 -76
- 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 +28 -26
- 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 +49 -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-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 +7 -0
- 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 +11 -1
- 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 +125 -31
- package/dist/chat/StatewireApprovalCard.cjs.map +1 -1
- package/dist/chat/StatewireApprovalCard.d.ts +73 -1
- package/dist/chat/StatewireApprovalCard.js +115 -21
- 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 +25 -63
- package/dist/chat/StatewireQueuedMessages.cjs.map +1 -1
- package/dist/chat/StatewireQueuedMessages.d.ts +11 -13
- package/dist/chat/StatewireQueuedMessages.js +16 -54
- package/dist/chat/StatewireQueuedMessages.js.map +1 -1
- package/dist/chat/WaitingOnYouBanner.cjs +3 -3
- package/dist/chat/WaitingOnYouBanner.cjs.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 +93 -28
- package/dist/chat/chat-voice-controls.cjs.map +1 -1
- package/dist/chat/chat-voice-controls.d.ts +36 -2
- package/dist/chat/chat-voice-controls.js +89 -24
- 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 +60 -38
- package/dist/chat/super-grouping/SuperGroupingCard.cjs.map +1 -1
- package/dist/chat/super-grouping/SuperGroupingCard.d.ts +24 -4
- package/dist/chat/super-grouping/SuperGroupingCard.js +37 -15
- 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 +97 -37
- package/dist/chat/super-grouping/ToolTimeline.cjs.map +1 -1
- package/dist/chat/super-grouping/ToolTimeline.d.ts +14 -2
- package/dist/chat/super-grouping/ToolTimeline.js +94 -34
- 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 +6 -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/timeline-step.cjs +61 -2
- package/dist/chat/super-grouping/timeline-step.cjs.map +1 -1
- package/dist/chat/super-grouping/timeline-step.d.ts +13 -1
- package/dist/chat/super-grouping/timeline-step.js +61 -2
- package/dist/chat/super-grouping/timeline-step.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 +18 -0
- package/dist/chat-ui/index.cjs.map +1 -1
- package/dist/chat-ui/index.d.ts +7 -1
- package/dist/chat-ui/index.js +18 -0
- package/dist/chat-ui/index.js.map +1 -1
- package/dist/chat-ui/mentions/mention-chip.cjs +147 -38
- package/dist/chat-ui/mentions/mention-chip.cjs.map +1 -1
- package/dist/chat-ui/mentions/mention-chip.d.ts +17 -1
- package/dist/chat-ui/mentions/mention-chip.js +146 -37
- package/dist/chat-ui/mentions/mention-chip.js.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 +140 -0
- package/dist/chat-ui/mentions/use-mention-asset.cjs.map +1 -0
- package/dist/chat-ui/mentions/use-mention-asset.d.ts +16 -0
- package/dist/chat-ui/mentions/use-mention-asset.js +140 -0
- package/dist/chat-ui/mentions/use-mention-asset.js.map +1 -0
- 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/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 +7 -6
- package/dist/chat-ui/rich-text/chat-link.cjs.map +1 -1
- package/dist/chat-ui/rich-text/chat-link.d.ts +2 -3
- package/dist/chat-ui/rich-text/chat-link.js +6 -5
- package/dist/chat-ui/rich-text/chat-link.js.map +1 -1
- package/dist/chat-ui/rich-text/chat-message-body.cjs +8 -8
- package/dist/chat-ui/rich-text/chat-message-body.cjs.map +1 -1
- package/dist/chat-ui/rich-text/chat-node-views.cjs +7 -6
- package/dist/chat-ui/rich-text/chat-node-views.cjs.map +1 -1
- package/dist/chat-ui/rich-text/chat-node-views.js +1 -0
- package/dist/chat-ui/rich-text/chat-node-views.js.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 +43 -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 +35 -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 +40 -3
- package/dist/collab/client.cjs.map +1 -1
- package/dist/collab/client.d.ts +25 -0
- package/dist/collab/client.js +40 -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/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 +2 -2
- package/dist/composer/useReadComposerDraft.cjs.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 +26 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +15 -3
- package/dist/index.js +26 -2
- 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/update-attributions.cjs +111 -0
- package/dist/keryx-http/src/update-attributions.cjs.map +1 -0
- package/dist/keryx-http/src/update-attributions.d.ts +75 -0
- package/dist/keryx-http/src/update-attributions.js +111 -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 +116 -79
- package/dist/provider/AthenaProvider.cjs.map +1 -1
- package/dist/provider/AthenaProvider.js +40 -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/references/src/tool-option-schemas.d.ts +0 -34
- 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/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 +55 -51
- package/dist/threads/statewire-thread-list.cjs.map +1 -1
- package/dist/threads/statewire-thread-list.js +6 -2
- 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 +10 -10
- package/dist/threads/use-athena-sessions.cjs.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-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-summary.cjs +0 -2
- package/dist/tools/tool-summary.cjs.map +1 -1
- package/dist/tools/tool-summary.js +0 -2
- package/dist/tools/tool-summary.js.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,7 +232,9 @@ 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;
|
|
191
|
-
const
|
|
235
|
+
const TRANSFER_OFFER_TIMEOUT_MS = 15e3;
|
|
236
|
+
const TRANSFER_COMMIT_TIMEOUT_MS = 15e3;
|
|
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));
|
|
194
240
|
const hours = Math.floor(total / 3600);
|
|
@@ -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);
|
|
@@ -306,6 +393,15 @@ const useDeepAgentVoice = (options = {}) => {
|
|
|
306
393
|
const livekitRef = useRef(null);
|
|
307
394
|
const livekitAbortRef = useRef(null);
|
|
308
395
|
const attemptRef = useRef(0);
|
|
396
|
+
const callAttemptIdRef = useRef("");
|
|
397
|
+
const observedAttempt = useStatewireState((s) => {
|
|
398
|
+
if (!isDeepAgentStateHydrated(s)) return void 0;
|
|
399
|
+
const values = readDeepAgentStreamValues(s);
|
|
400
|
+
const value = values.voiceStartFence ?? values.voiceAttemptId;
|
|
401
|
+
return typeof value === "string" ? value : null;
|
|
402
|
+
});
|
|
403
|
+
const observedAttemptRef = useRef(void 0);
|
|
404
|
+
if (observedAttempt !== void 0) observedAttemptRef.current = observedAttempt ?? void 0;
|
|
309
405
|
const startingRef = useRef(false);
|
|
310
406
|
const startPromiseRef = useRef(null);
|
|
311
407
|
const autoRestartedRef = useRef(false);
|
|
@@ -331,6 +427,50 @@ const useDeepAgentVoice = (options = {}) => {
|
|
|
331
427
|
const activeAudioSessionRef = useRef(null);
|
|
332
428
|
const startingAudioSessionRef = useRef(null);
|
|
333
429
|
const audioSessionIdleRef = useRef(Promise.resolve());
|
|
430
|
+
const ownClientIdRef = useRef(null);
|
|
431
|
+
const lastOwnedClientIdRef = useRef(null);
|
|
432
|
+
const transferRef = useRef(null);
|
|
433
|
+
const [movedTo, setMovedTo] = useState(null);
|
|
434
|
+
const hydratedTransferCapable = useStatewireState(
|
|
435
|
+
(s) => isDeepAgentStateHydrated(s) ? "voiceOwner" in readDeepAgentStreamValues(s) : void 0
|
|
436
|
+
);
|
|
437
|
+
const hydratedVoiceOwner = useStatewireState(
|
|
438
|
+
(s) => isDeepAgentStateHydrated(s) ? readDeepAgentStreamValues(s).voiceOwner ?? null : void 0
|
|
439
|
+
);
|
|
440
|
+
const hydratedWireOwnerId = useStatewireState((s) => {
|
|
441
|
+
if (!isDeepAgentStateHydrated(s)) return void 0;
|
|
442
|
+
const wire = readDeepAgentStreamValues(s).voice;
|
|
443
|
+
return typeof (wire == null ? void 0 : wire.clientId) === "string" && wire.clientId !== "" ? wire.clientId : null;
|
|
444
|
+
});
|
|
445
|
+
const hydratedWireLive = useStatewireState((s) => {
|
|
446
|
+
if (!isDeepAgentStateHydrated(s)) return void 0;
|
|
447
|
+
const wire = readDeepAgentStreamValues(s).voice;
|
|
448
|
+
return (wire == null ? void 0 : wire.status) === "live";
|
|
449
|
+
});
|
|
450
|
+
const transferCapable = useRetainedHydrated(hydratedTransferCapable, false);
|
|
451
|
+
const wireVoiceOwner = useRetainedHydrated(hydratedVoiceOwner, null);
|
|
452
|
+
const wireOwnerId = useRetainedHydrated(hydratedWireOwnerId, null);
|
|
453
|
+
const wireLive = useRetainedHydrated(hydratedWireLive, false);
|
|
454
|
+
const voiceOwner = useMemo(
|
|
455
|
+
() => transferCapable ? parseVoiceOwner(wireVoiceOwner) : null,
|
|
456
|
+
[transferCapable, wireVoiceOwner]
|
|
457
|
+
);
|
|
458
|
+
const transferCapableRef = useRef(transferCapable);
|
|
459
|
+
transferCapableRef.current = transferCapable;
|
|
460
|
+
const voiceOwnerRef = useRef(voiceOwner);
|
|
461
|
+
voiceOwnerRef.current = voiceOwner;
|
|
462
|
+
const wireOwnerIdRef = useRef(wireOwnerId);
|
|
463
|
+
wireOwnerIdRef.current = wireOwnerId;
|
|
464
|
+
const canTakeCall = transportRef.current === "livekit" && livekitAdapterRef.current !== void 0;
|
|
465
|
+
const elsewhere = voiceOwner !== null && voiceOwner.transferable && wireLive && canTakeCall && (phase === "idle" || phase === "error") && voiceOwner.clientId !== lastOwnedClientIdRef.current ? voiceOwner : null;
|
|
466
|
+
const elsewhereSurface = (elsewhere == null ? void 0 : elsewhere.surface) ?? null;
|
|
467
|
+
const elsewhereSince = (elsewhere == null ? void 0 : elsewhere.since) ?? null;
|
|
468
|
+
const liveElsewhere = useMemo(
|
|
469
|
+
() => elsewhereSurface === null || elsewhereSince === null ? null : { surface: elsewhereSurface, since: elsewhereSince },
|
|
470
|
+
[elsewhereSurface, elsewhereSince]
|
|
471
|
+
);
|
|
472
|
+
const liveElsewhereRef = useRef(liveElsewhere);
|
|
473
|
+
liveElsewhereRef.current = liveElsewhere;
|
|
334
474
|
const report = useCallback(
|
|
335
475
|
(event, attempt, data) => {
|
|
336
476
|
const observer = onDiagnosticRef.current;
|
|
@@ -412,6 +552,89 @@ const useDeepAgentVoice = (options = {}) => {
|
|
|
412
552
|
},
|
|
413
553
|
[report, teardown]
|
|
414
554
|
);
|
|
555
|
+
const handleMovedAway = useCallback(() => {
|
|
556
|
+
var _a;
|
|
557
|
+
const surface = ((_a = voiceOwnerRef.current) == null ? void 0 : _a.surface) ?? "web";
|
|
558
|
+
report("moved", attemptRef.current, { toSurface: surface });
|
|
559
|
+
teardown();
|
|
560
|
+
ownClientIdRef.current = null;
|
|
561
|
+
micMutedRef.current = false;
|
|
562
|
+
setMicMutedState(false);
|
|
563
|
+
setHandoffTask(null);
|
|
564
|
+
setFailure(null);
|
|
565
|
+
setPhase("idle");
|
|
566
|
+
setMovedTo({ surface });
|
|
567
|
+
}, [report, teardown]);
|
|
568
|
+
const ownerMovedAway = useCallback(() => {
|
|
569
|
+
const own = ownClientIdRef.current;
|
|
570
|
+
const current = wireOwnerIdRef.current;
|
|
571
|
+
return transferCapableRef.current && own !== null && current !== null && current !== own;
|
|
572
|
+
}, []);
|
|
573
|
+
const acquireAudioSession = useCallback(
|
|
574
|
+
async ({
|
|
575
|
+
attempt,
|
|
576
|
+
audioSession
|
|
577
|
+
}) => {
|
|
578
|
+
await audioSessionIdleRef.current;
|
|
579
|
+
if (attemptRef.current !== attempt) {
|
|
580
|
+
report("stale-attempt", attempt, { stage: "audio-session" });
|
|
581
|
+
return false;
|
|
582
|
+
}
|
|
583
|
+
startingAudioSessionRef.current = audioSession;
|
|
584
|
+
try {
|
|
585
|
+
await audioSession.start();
|
|
586
|
+
} finally {
|
|
587
|
+
startingAudioSessionRef.current = null;
|
|
588
|
+
}
|
|
589
|
+
activeAudioSessionRef.current = audioSession;
|
|
590
|
+
if (attemptRef.current !== attempt) {
|
|
591
|
+
report("stale-attempt", attempt, { stage: "audio-session" });
|
|
592
|
+
releaseAudioSession();
|
|
593
|
+
return false;
|
|
594
|
+
}
|
|
595
|
+
report("audio-session-ready", attempt);
|
|
596
|
+
return true;
|
|
597
|
+
},
|
|
598
|
+
[releaseAudioSession, report]
|
|
599
|
+
);
|
|
600
|
+
const joinVoiceRoom = useCallback(
|
|
601
|
+
async ({
|
|
602
|
+
attempt,
|
|
603
|
+
room,
|
|
604
|
+
adapter,
|
|
605
|
+
controller = new AbortController(),
|
|
606
|
+
onDisconnectedAfterJoin
|
|
607
|
+
}) => {
|
|
608
|
+
let joined = false;
|
|
609
|
+
let disconnectedWhileJoining = false;
|
|
610
|
+
livekitAbortRef.current = controller;
|
|
611
|
+
const session = await adapter.connect(room, {
|
|
612
|
+
micMuted: micMutedRef.current,
|
|
613
|
+
signal: controller.signal,
|
|
614
|
+
onDisconnected: (reason) => {
|
|
615
|
+
if (attemptRef.current !== attempt) return;
|
|
616
|
+
if (!joined) {
|
|
617
|
+
disconnectedWhileJoining = true;
|
|
618
|
+
return;
|
|
619
|
+
}
|
|
620
|
+
onDisconnectedAfterJoin(reason);
|
|
621
|
+
}
|
|
622
|
+
});
|
|
623
|
+
if (attemptRef.current !== attempt) {
|
|
624
|
+
releaseSafely(() => session.disconnect());
|
|
625
|
+
return false;
|
|
626
|
+
}
|
|
627
|
+
if (disconnectedWhileJoining) {
|
|
628
|
+
releaseSafely(() => session.disconnect());
|
|
629
|
+
throw new Error("The voice room disconnected while joining");
|
|
630
|
+
}
|
|
631
|
+
joined = true;
|
|
632
|
+
livekitRef.current = session;
|
|
633
|
+
report("room-joined", attempt, { roomName: room.roomName });
|
|
634
|
+
return true;
|
|
635
|
+
},
|
|
636
|
+
[report]
|
|
637
|
+
);
|
|
415
638
|
const handleMediaLossRef = useRef(
|
|
416
639
|
async () => void 0
|
|
417
640
|
);
|
|
@@ -469,9 +692,15 @@ const useDeepAgentVoice = (options = {}) => {
|
|
|
469
692
|
node.start(startAt);
|
|
470
693
|
playheadRef.current = startAt + buffer.duration;
|
|
471
694
|
}, []);
|
|
472
|
-
const runStartSession = useCallback(async (
|
|
695
|
+
const runStartSession = useCallback(async ({
|
|
696
|
+
opening
|
|
697
|
+
} = {}) => {
|
|
473
698
|
var _a, _b, _c;
|
|
474
699
|
const attempt = attemptRef.current += 1;
|
|
700
|
+
const attemptId = mintVoiceId({ kind: "attempt" });
|
|
701
|
+
const previousAttemptId = observedAttemptRef.current;
|
|
702
|
+
callAttemptIdRef.current = attemptId;
|
|
703
|
+
ownClientIdRef.current = null;
|
|
475
704
|
startingRef.current = true;
|
|
476
705
|
attemptStartedAtRef.current = Date.now();
|
|
477
706
|
setFailure(null);
|
|
@@ -485,7 +714,10 @@ const useDeepAgentVoice = (options = {}) => {
|
|
|
485
714
|
report("stale-attempt", attempt, { stage });
|
|
486
715
|
releaseAudioSession();
|
|
487
716
|
};
|
|
488
|
-
report("start-requested", attempt, {
|
|
717
|
+
report("start-requested", attempt, {
|
|
718
|
+
transport: transportRef.current,
|
|
719
|
+
...opening !== void 0 && { opening }
|
|
720
|
+
});
|
|
489
721
|
try {
|
|
490
722
|
const transport = transportRef.current;
|
|
491
723
|
const mediaDevices = (_a = voiceGlobals.navigator) == null ? void 0 : _a.mediaDevices;
|
|
@@ -507,23 +739,7 @@ const useDeepAgentVoice = (options = {}) => {
|
|
|
507
739
|
const audioSession = audioSessionRef.current;
|
|
508
740
|
if (audioSession) {
|
|
509
741
|
stage = "audio-session";
|
|
510
|
-
await
|
|
511
|
-
if (attemptRef.current !== attempt) {
|
|
512
|
-
report("stale-attempt", attempt, { stage });
|
|
513
|
-
return;
|
|
514
|
-
}
|
|
515
|
-
startingAudioSessionRef.current = audioSession;
|
|
516
|
-
try {
|
|
517
|
-
await audioSession.start();
|
|
518
|
-
} finally {
|
|
519
|
-
startingAudioSessionRef.current = null;
|
|
520
|
-
}
|
|
521
|
-
activeAudioSessionRef.current = audioSession;
|
|
522
|
-
if (attemptRef.current !== attempt) {
|
|
523
|
-
stale();
|
|
524
|
-
return;
|
|
525
|
-
}
|
|
526
|
-
report("audio-session-ready", attempt);
|
|
742
|
+
if (!await acquireAudioSession({ attempt, audioSession })) return;
|
|
527
743
|
}
|
|
528
744
|
const modelOption = modelRef.current;
|
|
529
745
|
const requestedModel = typeof modelOption === "function" ? modelOption() : modelOption;
|
|
@@ -531,18 +747,22 @@ const useDeepAgentVoice = (options = {}) => {
|
|
|
531
747
|
const sendVoiceStart = (offer2) => sendCommand({
|
|
532
748
|
type: "voice/start",
|
|
533
749
|
offer: offer2,
|
|
534
|
-
|
|
750
|
+
attemptId,
|
|
751
|
+
...previousAttemptId !== void 0 && { previousAttemptId },
|
|
752
|
+
...model2 !== void 0 && { model: model2 },
|
|
753
|
+
...opening !== void 0 && { opening }
|
|
535
754
|
});
|
|
536
755
|
const negotiateStart = async (offer2) => {
|
|
537
756
|
stage = "negotiate";
|
|
538
757
|
const negotiationStartedAt = Date.now();
|
|
539
758
|
const commandPromise = sendVoiceStart(offer2).catch((commandError) => {
|
|
540
759
|
if (!isRecoveredCommandAuthRejection(commandError)) throw commandError;
|
|
760
|
+
if (attemptRef.current !== attempt) throw commandError;
|
|
541
761
|
return sendVoiceStart(offer2);
|
|
542
762
|
});
|
|
543
763
|
void commandPromise.then(() => {
|
|
544
764
|
if (attemptRef.current !== attempt)
|
|
545
|
-
void sendCommand({ type: "voice/end" }).catch(() => void 0);
|
|
765
|
+
void sendCommand({ type: "voice/end", attemptId }).catch(() => void 0);
|
|
546
766
|
}).catch(() => void 0);
|
|
547
767
|
let answerTimer = null;
|
|
548
768
|
let result;
|
|
@@ -575,42 +795,24 @@ const useDeepAgentVoice = (options = {}) => {
|
|
|
575
795
|
try {
|
|
576
796
|
const room = parseVoiceLiveKitAnswer(answer2);
|
|
577
797
|
stage = "room";
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
micMuted: micMutedRef.current,
|
|
584
|
-
signal: controller.signal,
|
|
585
|
-
onDisconnected: (reason) => {
|
|
586
|
-
if (attemptRef.current !== attempt) return;
|
|
587
|
-
if (!joined) {
|
|
588
|
-
disconnectedWhileJoining = true;
|
|
589
|
-
return;
|
|
590
|
-
}
|
|
591
|
-
void handleMediaLossRef.current(attempt, reason);
|
|
592
|
-
}
|
|
798
|
+
const joinedRoom = await joinVoiceRoom({
|
|
799
|
+
attempt,
|
|
800
|
+
room,
|
|
801
|
+
adapter: livekitAdapter,
|
|
802
|
+
onDisconnectedAfterJoin: (reason) => void handleMediaLossRef.current(attempt, reason)
|
|
593
803
|
});
|
|
594
|
-
if (
|
|
595
|
-
releaseSafely(() => session.disconnect());
|
|
804
|
+
if (!joinedRoom) {
|
|
596
805
|
stale();
|
|
597
806
|
return;
|
|
598
807
|
}
|
|
599
|
-
if (disconnectedWhileJoining) {
|
|
600
|
-
releaseSafely(() => session.disconnect());
|
|
601
|
-
throw new Error("The voice room disconnected while joining");
|
|
602
|
-
}
|
|
603
|
-
joined = true;
|
|
604
|
-
livekitRef.current = session;
|
|
605
|
-
report("room-joined", attempt, { roomName: room.roomName });
|
|
606
808
|
} catch (roomError) {
|
|
607
809
|
if (attemptRef.current === attempt)
|
|
608
|
-
void sendCommand({ type: "voice/end" }).catch(() => void 0);
|
|
810
|
+
void sendCommand({ type: "voice/end", attemptId }).catch(() => void 0);
|
|
609
811
|
throw roomError;
|
|
610
812
|
}
|
|
611
813
|
report("live", attempt, { transport, ...model2 !== void 0 && { model: model2 } });
|
|
612
814
|
if (micMutedRef.current) {
|
|
613
|
-
void sendCommand({ type: "voice/set-mic", paused: true }).catch(() => void 0);
|
|
815
|
+
void sendCommand({ type: "voice/set-mic", paused: true, attemptId }).catch(() => void 0);
|
|
614
816
|
}
|
|
615
817
|
setPhase("live");
|
|
616
818
|
setLiveSince(Date.now());
|
|
@@ -684,7 +886,7 @@ const useDeepAgentVoice = (options = {}) => {
|
|
|
684
886
|
});
|
|
685
887
|
report("live", attempt, { transport });
|
|
686
888
|
if (micMutedRef.current) {
|
|
687
|
-
void sendCommand({ type: "voice/set-mic", paused: true }).catch(() => void 0);
|
|
889
|
+
void sendCommand({ type: "voice/set-mic", paused: true, attemptId }).catch(() => void 0);
|
|
688
890
|
}
|
|
689
891
|
setPhase("live");
|
|
690
892
|
setLiveSince(Date.now());
|
|
@@ -704,7 +906,7 @@ const useDeepAgentVoice = (options = {}) => {
|
|
|
704
906
|
await ((_a2 = onRemoteStreamRef.current) == null ? void 0 : _a2.call(onRemoteStreamRef, remote));
|
|
705
907
|
} catch (playError) {
|
|
706
908
|
if (attemptRef.current !== attempt) return;
|
|
707
|
-
void sendCommand({ type: "voice/end" }).catch(() => void 0);
|
|
909
|
+
void sendCommand({ type: "voice/end", attemptId }).catch(() => void 0);
|
|
708
910
|
fail({
|
|
709
911
|
kind: "playback_failed",
|
|
710
912
|
stage: "playback",
|
|
@@ -751,7 +953,7 @@ const useDeepAgentVoice = (options = {}) => {
|
|
|
751
953
|
}
|
|
752
954
|
report("live", attempt, { transport });
|
|
753
955
|
if (micMutedRef.current) {
|
|
754
|
-
void sendCommand({ type: "voice/set-mic", paused: true }).catch(() => void 0);
|
|
956
|
+
void sendCommand({ type: "voice/set-mic", paused: true, attemptId }).catch(() => void 0);
|
|
755
957
|
}
|
|
756
958
|
setPhase("live");
|
|
757
959
|
setLiveSince(Date.now());
|
|
@@ -764,10 +966,19 @@ const useDeepAgentVoice = (options = {}) => {
|
|
|
764
966
|
} finally {
|
|
765
967
|
startingRef.current = false;
|
|
766
968
|
}
|
|
767
|
-
}, [
|
|
768
|
-
|
|
969
|
+
}, [
|
|
970
|
+
acquireAudioSession,
|
|
971
|
+
fail,
|
|
972
|
+
joinVoiceRoom,
|
|
973
|
+
playRelayChunk,
|
|
974
|
+
releaseAudioSession,
|
|
975
|
+
report,
|
|
976
|
+
sendCommand,
|
|
977
|
+
watchConnection
|
|
978
|
+
]);
|
|
979
|
+
const startSession = useCallback(async (options2 = {}) => {
|
|
769
980
|
if (pcRef.current || wsRef.current || livekitRef.current || startingRef.current) return;
|
|
770
|
-
const run = runStartSession();
|
|
981
|
+
const run = runStartSession(options2);
|
|
771
982
|
startPromiseRef.current = run;
|
|
772
983
|
try {
|
|
773
984
|
await run;
|
|
@@ -780,12 +991,16 @@ const useDeepAgentVoice = (options = {}) => {
|
|
|
780
991
|
const handleMediaLoss = useCallback(
|
|
781
992
|
async (attempt, reason) => {
|
|
782
993
|
if (attemptRef.current !== attempt) return;
|
|
994
|
+
if (ownerMovedAway()) {
|
|
995
|
+
handleMovedAway();
|
|
996
|
+
return;
|
|
997
|
+
}
|
|
783
998
|
report("media-loss", attempt, {
|
|
784
999
|
reason,
|
|
785
1000
|
restartBudgetLeft: !autoRestartedRef.current
|
|
786
1001
|
});
|
|
787
1002
|
if (lastActiveTaskRef.current) setHandoffTask(lastActiveTaskRef.current);
|
|
788
|
-
const ending = sendCommand({ type: "voice/end" }).catch(() => void 0);
|
|
1003
|
+
const ending = sendCommand({ type: "voice/end", attemptId: callAttemptIdRef.current }).catch(() => void 0);
|
|
789
1004
|
teardown();
|
|
790
1005
|
const recovery = attemptRef.current;
|
|
791
1006
|
setPhase("idle");
|
|
@@ -803,6 +1018,10 @@ const useDeepAgentVoice = (options = {}) => {
|
|
|
803
1018
|
const inflight = startPromiseRef.current;
|
|
804
1019
|
if (inflight) await inflight.catch(() => void 0);
|
|
805
1020
|
if (attemptRef.current !== recovery) return;
|
|
1021
|
+
if (ownerMovedAway()) {
|
|
1022
|
+
handleMovedAway();
|
|
1023
|
+
return;
|
|
1024
|
+
}
|
|
806
1025
|
if (!autoRestartedRef.current) {
|
|
807
1026
|
autoRestartedRef.current = true;
|
|
808
1027
|
report("auto-restart", recovery, { trigger: "media-loss", reason });
|
|
@@ -825,49 +1044,240 @@ const useDeepAgentVoice = (options = {}) => {
|
|
|
825
1044
|
setFailure(lost);
|
|
826
1045
|
setPhase("error");
|
|
827
1046
|
},
|
|
828
|
-
[report, sendCommand, teardown]
|
|
1047
|
+
[handleMovedAway, ownerMovedAway, report, sendCommand, teardown]
|
|
829
1048
|
);
|
|
830
1049
|
handleMediaLossRef.current = handleMediaLoss;
|
|
831
|
-
const start = useCallback(async () => {
|
|
1050
|
+
const start = useCallback(async (options2) => {
|
|
832
1051
|
if (pcRef.current || wsRef.current || livekitRef.current || startingRef.current) return;
|
|
833
1052
|
micMutedRef.current = false;
|
|
834
1053
|
setMicMutedState(false);
|
|
835
1054
|
autoRestartedRef.current = false;
|
|
836
1055
|
setHandoffTask(null);
|
|
837
|
-
|
|
1056
|
+
setMovedTo(null);
|
|
1057
|
+
await startSession((options2 == null ? void 0 : options2.opening) === "recap" ? { opening: "recap" } : {});
|
|
838
1058
|
}, [startSession]);
|
|
1059
|
+
const runTransferHere = useCallback(async () => {
|
|
1060
|
+
const attempt = attemptRef.current += 1;
|
|
1061
|
+
const attemptId = mintVoiceId({ kind: "attempt" });
|
|
1062
|
+
callAttemptIdRef.current = attemptId;
|
|
1063
|
+
ownClientIdRef.current = null;
|
|
1064
|
+
const transfer = { attempt, transferId: null };
|
|
1065
|
+
transferRef.current = transfer;
|
|
1066
|
+
startingRef.current = true;
|
|
1067
|
+
attemptStartedAtRef.current = Date.now();
|
|
1068
|
+
setFailure(null);
|
|
1069
|
+
setPhase("connecting");
|
|
1070
|
+
let stage = "preflight";
|
|
1071
|
+
const timeouts = timeoutsRef.current;
|
|
1072
|
+
const offerMs = Math.min((timeouts == null ? void 0 : timeouts.answerMs) ?? ANSWER_TIMEOUT_MS, TRANSFER_OFFER_TIMEOUT_MS);
|
|
1073
|
+
const commitMs = (timeouts == null ? void 0 : timeouts.transferCommitMs) ?? TRANSFER_COMMIT_TIMEOUT_MS;
|
|
1074
|
+
const cancel = () => {
|
|
1075
|
+
const transferId = transfer.transferId;
|
|
1076
|
+
if (transferId === null) return;
|
|
1077
|
+
void sendCommand({ type: "voice/transfer-cancel", transferId }).catch(() => void 0);
|
|
1078
|
+
};
|
|
1079
|
+
let promotedCallEnded = false;
|
|
1080
|
+
const endPromotedCall = () => {
|
|
1081
|
+
if (promotedCallEnded) return;
|
|
1082
|
+
promotedCallEnded = true;
|
|
1083
|
+
void sendCommand({ type: "voice/end", attemptId }).catch(() => void 0);
|
|
1084
|
+
};
|
|
1085
|
+
const stale = () => {
|
|
1086
|
+
report("stale-attempt", attempt, { stage, transfer: true });
|
|
1087
|
+
if (transferRef.current === transfer) {
|
|
1088
|
+
transferRef.current = null;
|
|
1089
|
+
cancel();
|
|
1090
|
+
}
|
|
1091
|
+
releaseAudioSession();
|
|
1092
|
+
};
|
|
1093
|
+
const controller = new AbortController();
|
|
1094
|
+
livekitAbortRef.current = controller;
|
|
1095
|
+
const superseded = new Promise((_, reject) => {
|
|
1096
|
+
controller.signal.addEventListener("abort", () => reject(new Error("The move was superseded")), {
|
|
1097
|
+
once: true
|
|
1098
|
+
});
|
|
1099
|
+
});
|
|
1100
|
+
void superseded.catch(() => void 0);
|
|
1101
|
+
report("start-requested", attempt, { transport: "livekit", transfer: true });
|
|
1102
|
+
try {
|
|
1103
|
+
const livekitAdapter = livekitAdapterRef.current;
|
|
1104
|
+
if (transportRef.current !== "livekit" || !livekitAdapter)
|
|
1105
|
+
throw new Error("Voice is unavailable in this environment");
|
|
1106
|
+
const audioSession = audioSessionRef.current;
|
|
1107
|
+
if (audioSession) {
|
|
1108
|
+
stage = "audio-session";
|
|
1109
|
+
if (!await acquireAudioSession({ attempt, audioSession })) {
|
|
1110
|
+
stale();
|
|
1111
|
+
return;
|
|
1112
|
+
}
|
|
1113
|
+
}
|
|
1114
|
+
stage = "negotiate";
|
|
1115
|
+
const negotiationStartedAt = Date.now();
|
|
1116
|
+
const offer = sendCommand({ type: "voice/transfer-offer", attemptId });
|
|
1117
|
+
void offer.then((result) => {
|
|
1118
|
+
if (attemptRef.current === attempt) return;
|
|
1119
|
+
const { transferId } = readTransferOffer(result);
|
|
1120
|
+
if (transferId !== null)
|
|
1121
|
+
void sendCommand({ type: "voice/transfer-cancel", transferId }).catch(() => void 0);
|
|
1122
|
+
}).catch(() => void 0);
|
|
1123
|
+
const offered = readTransferOffer(
|
|
1124
|
+
await withAnswerDeadline(Promise.race([offer, superseded]), offerMs)
|
|
1125
|
+
);
|
|
1126
|
+
report("answer-received", attempt, {
|
|
1127
|
+
negotiationMs: Date.now() - negotiationStartedAt,
|
|
1128
|
+
transfer: true
|
|
1129
|
+
});
|
|
1130
|
+
if (attemptRef.current !== attempt) {
|
|
1131
|
+
stale();
|
|
1132
|
+
return;
|
|
1133
|
+
}
|
|
1134
|
+
stage = "answer";
|
|
1135
|
+
transfer.transferId = offered.transferId;
|
|
1136
|
+
if (offered.transferId === null || offered.answer === null)
|
|
1137
|
+
throw new VoiceNoAnswerError("voice/transfer-offer returned no voice room");
|
|
1138
|
+
const room = parseVoiceLiveKitAnswer(offered.answer);
|
|
1139
|
+
stage = "room";
|
|
1140
|
+
let moved = false;
|
|
1141
|
+
let roomDropped = () => void 0;
|
|
1142
|
+
const dropped = new Promise((_, reject) => {
|
|
1143
|
+
roomDropped = (reason) => reject(new VoiceTransferRoomDroppedError(reason));
|
|
1144
|
+
});
|
|
1145
|
+
void dropped.catch(() => void 0);
|
|
1146
|
+
const joinedRoom = await joinVoiceRoom({
|
|
1147
|
+
attempt,
|
|
1148
|
+
room,
|
|
1149
|
+
adapter: livekitAdapter,
|
|
1150
|
+
controller,
|
|
1151
|
+
onDisconnectedAfterJoin: (reason) => {
|
|
1152
|
+
if (moved) void handleMediaLossRef.current(attempt, reason);
|
|
1153
|
+
else roomDropped(reason);
|
|
1154
|
+
}
|
|
1155
|
+
});
|
|
1156
|
+
if (!joinedRoom) {
|
|
1157
|
+
stale();
|
|
1158
|
+
return;
|
|
1159
|
+
}
|
|
1160
|
+
stage = "commit";
|
|
1161
|
+
const commit = sendCommand({
|
|
1162
|
+
type: "voice/transfer-commit",
|
|
1163
|
+
transferId: offered.transferId,
|
|
1164
|
+
attemptId
|
|
1165
|
+
});
|
|
1166
|
+
void commit.then(
|
|
1167
|
+
() => {
|
|
1168
|
+
if (attemptRef.current !== attempt) endPromotedCall();
|
|
1169
|
+
},
|
|
1170
|
+
(commitError) => {
|
|
1171
|
+
if (attemptRef.current === attempt) return;
|
|
1172
|
+
const failure2 = readSendFailure(commitError);
|
|
1173
|
+
if (failure2 !== null && failure2.fate !== "rejected") endPromotedCall();
|
|
1174
|
+
}
|
|
1175
|
+
);
|
|
1176
|
+
await withAnswerDeadline(Promise.race([commit, dropped, superseded]), commitMs);
|
|
1177
|
+
if (attemptRef.current !== attempt) {
|
|
1178
|
+
stale();
|
|
1179
|
+
return;
|
|
1180
|
+
}
|
|
1181
|
+
moved = true;
|
|
1182
|
+
transferRef.current = null;
|
|
1183
|
+
report("live", attempt, { transport: "livekit", transfer: true });
|
|
1184
|
+
setPhase("live");
|
|
1185
|
+
setLiveSince(Date.now());
|
|
1186
|
+
} catch (transferError) {
|
|
1187
|
+
if (attemptRef.current !== attempt) {
|
|
1188
|
+
stale();
|
|
1189
|
+
return;
|
|
1190
|
+
}
|
|
1191
|
+
cancel();
|
|
1192
|
+
const sendFailure = readSendFailure(transferError);
|
|
1193
|
+
if (stage === "commit" && sendFailure !== null && sendFailure.fate !== "rejected")
|
|
1194
|
+
endPromotedCall();
|
|
1195
|
+
transferRef.current = null;
|
|
1196
|
+
fail(classifyTransferFailure(transferError, stage));
|
|
1197
|
+
} finally {
|
|
1198
|
+
startingRef.current = false;
|
|
1199
|
+
}
|
|
1200
|
+
}, [acquireAudioSession, fail, joinVoiceRoom, releaseAudioSession, report, sendCommand]);
|
|
1201
|
+
const transferHere = useCallback(async () => {
|
|
1202
|
+
if (pcRef.current || wsRef.current || livekitRef.current || startingRef.current) return;
|
|
1203
|
+
if (liveElsewhereRef.current === null) return;
|
|
1204
|
+
micMutedRef.current = false;
|
|
1205
|
+
setMicMutedState(false);
|
|
1206
|
+
autoRestartedRef.current = false;
|
|
1207
|
+
setHandoffTask(null);
|
|
1208
|
+
setMovedTo(null);
|
|
1209
|
+
const run = runTransferHere();
|
|
1210
|
+
startPromiseRef.current = run;
|
|
1211
|
+
try {
|
|
1212
|
+
await run;
|
|
1213
|
+
} finally {
|
|
1214
|
+
if (startPromiseRef.current === run) startPromiseRef.current = null;
|
|
1215
|
+
}
|
|
1216
|
+
}, [runTransferHere]);
|
|
1217
|
+
const releaseCall = useCallback(() => {
|
|
1218
|
+
const transfer = transferRef.current;
|
|
1219
|
+
transferRef.current = null;
|
|
1220
|
+
if (transfer !== null) {
|
|
1221
|
+
if (transfer.transferId !== null) {
|
|
1222
|
+
void sendCommand({ type: "voice/transfer-cancel", transferId: transfer.transferId }).catch(
|
|
1223
|
+
() => void 0
|
|
1224
|
+
);
|
|
1225
|
+
}
|
|
1226
|
+
return;
|
|
1227
|
+
}
|
|
1228
|
+
void sendCommand({ type: "voice/end", attemptId: callAttemptIdRef.current }).catch(() => void 0);
|
|
1229
|
+
}, [sendCommand]);
|
|
839
1230
|
const end = useCallback(() => {
|
|
840
1231
|
if (phase === "connecting" || phase === "live") {
|
|
841
1232
|
report("end", attemptRef.current, { source: "user", phase });
|
|
842
|
-
|
|
843
|
-
|
|
1233
|
+
const moving = transferRef.current !== null;
|
|
1234
|
+
releaseCall();
|
|
1235
|
+
if (!moving && lastActiveTaskRef.current) setHandoffTask(lastActiveTaskRef.current);
|
|
844
1236
|
}
|
|
845
1237
|
teardown();
|
|
846
1238
|
micMutedRef.current = false;
|
|
847
1239
|
setMicMutedState(false);
|
|
848
1240
|
setPhase("idle");
|
|
849
|
-
}, [phase,
|
|
1241
|
+
}, [phase, releaseCall, report, teardown]);
|
|
850
1242
|
const setMicMuted = useCallback(
|
|
851
1243
|
(muted) => {
|
|
852
1244
|
if (phase !== "live") return;
|
|
853
1245
|
const attempt = attemptRef.current;
|
|
1246
|
+
const attemptId = callAttemptIdRef.current;
|
|
854
1247
|
const change = ++micChangeRef.current;
|
|
855
1248
|
const applyLocal = (value) => {
|
|
856
1249
|
var _a;
|
|
857
1250
|
micMutedRef.current = value;
|
|
858
1251
|
setMicMutedState(value);
|
|
859
|
-
for (const track of ((_a = streamRef.current) == null ? void 0 : _a.getTracks()) ?? []) track.enabled = !value;
|
|
860
1252
|
const room = livekitRef.current;
|
|
861
|
-
|
|
1253
|
+
const mediaFailed = () => {
|
|
1254
|
+
if (attemptRef.current !== attempt || micChangeRef.current !== change || livekitRef.current !== room) return;
|
|
1255
|
+
void sendCommand({ type: "voice/end", attemptId }).catch(() => void 0);
|
|
1256
|
+
if (lastActiveTaskRef.current) setHandoffTask(lastActiveTaskRef.current);
|
|
1257
|
+
fail({
|
|
1258
|
+
kind: "media_lost",
|
|
1259
|
+
stage: "media",
|
|
1260
|
+
reason: "microphone-control-failed",
|
|
1261
|
+
message: "Voice ended because the microphone could not be changed. Start a new call to try again."
|
|
1262
|
+
});
|
|
1263
|
+
};
|
|
1264
|
+
try {
|
|
1265
|
+
for (const track of ((_a = streamRef.current) == null ? void 0 : _a.getTracks()) ?? []) track.enabled = !value;
|
|
1266
|
+
if (room) void room.setMicrophoneEnabled(!value).catch(mediaFailed);
|
|
1267
|
+
return true;
|
|
1268
|
+
} catch {
|
|
1269
|
+
mediaFailed();
|
|
1270
|
+
return false;
|
|
1271
|
+
}
|
|
862
1272
|
};
|
|
863
|
-
applyLocal(muted);
|
|
864
|
-
void sendCommand({ type: "voice/set-mic", paused: muted }).catch(() => {
|
|
1273
|
+
if (!applyLocal(muted)) return;
|
|
1274
|
+
void sendCommand({ type: "voice/set-mic", paused: muted, attemptId }).catch(() => {
|
|
865
1275
|
if (!muted && attemptRef.current === attempt && micChangeRef.current === change) {
|
|
866
1276
|
applyLocal(true);
|
|
867
1277
|
}
|
|
868
1278
|
});
|
|
869
1279
|
},
|
|
870
|
-
[phase, sendCommand]
|
|
1280
|
+
[phase, sendCommand, fail]
|
|
871
1281
|
);
|
|
872
1282
|
const sessionGone = useStatewireState(
|
|
873
1283
|
(s) => isDeepAgentStateHydrated(s) && (readDeepAgentStreamValues(s).voice ?? null) === null
|
|
@@ -887,6 +1297,18 @@ const useDeepAgentVoice = (options = {}) => {
|
|
|
887
1297
|
void ((_a = startRef.current) == null ? void 0 : _a.call(startRef));
|
|
888
1298
|
}
|
|
889
1299
|
}, [phase, report, sessionGone, teardown]);
|
|
1300
|
+
useEffect(() => {
|
|
1301
|
+
if (phase !== "live" || !transferCapable || wireOwnerId === null) return;
|
|
1302
|
+
const own = ownClientIdRef.current;
|
|
1303
|
+
if (own === null) {
|
|
1304
|
+
const fence = observedAttemptRef.current;
|
|
1305
|
+
if (fence !== void 0 && fence !== callAttemptIdRef.current) return;
|
|
1306
|
+
ownClientIdRef.current = wireOwnerId;
|
|
1307
|
+
lastOwnedClientIdRef.current = wireOwnerId;
|
|
1308
|
+
return;
|
|
1309
|
+
}
|
|
1310
|
+
if (wireOwnerId !== own) handleMovedAway();
|
|
1311
|
+
}, [phase, transferCapable, wireOwnerId, observedAttempt, handleMovedAway]);
|
|
890
1312
|
useEffect(
|
|
891
1313
|
() => () => {
|
|
892
1314
|
const phaseAtUnmount = phaseRef.current;
|
|
@@ -895,11 +1317,12 @@ const useDeepAgentVoice = (options = {}) => {
|
|
|
895
1317
|
source: "unmount",
|
|
896
1318
|
phase: phaseAtUnmount
|
|
897
1319
|
});
|
|
898
|
-
|
|
1320
|
+
releaseCall();
|
|
899
1321
|
}
|
|
1322
|
+
transferRef.current = null;
|
|
900
1323
|
teardown();
|
|
901
1324
|
},
|
|
902
|
-
[
|
|
1325
|
+
[releaseCall, report, teardown]
|
|
903
1326
|
);
|
|
904
1327
|
const activeTask = (voice == null ? void 0 : voice.activeTask) ?? null;
|
|
905
1328
|
useEffect(() => {
|
|
@@ -936,22 +1359,22 @@ const useDeepAgentVoice = (options = {}) => {
|
|
|
936
1359
|
}, [wireModelOptions]);
|
|
937
1360
|
const syncProfile = useCallback(() => {
|
|
938
1361
|
if (phase !== "connecting" && phase !== "live") return;
|
|
939
|
-
void sendCommand({ type: "voice/profile-sync" }).catch(() => void 0);
|
|
1362
|
+
void sendCommand({ type: "voice/profile-sync", attemptId: callAttemptIdRef.current }).catch(() => void 0);
|
|
940
1363
|
}, [phase, sendCommand]);
|
|
941
1364
|
const sendContext = useCallback(
|
|
942
1365
|
(text) => {
|
|
943
1366
|
const trimmed = text.trim();
|
|
944
1367
|
if (phase !== "live" || !trimmed) return;
|
|
945
|
-
void sendCommand({ type: "voice/context", text: trimmed }).catch(() => void 0);
|
|
1368
|
+
void sendCommand({ type: "voice/context", text: trimmed, attemptId: callAttemptIdRef.current }).catch(() => void 0);
|
|
946
1369
|
},
|
|
947
1370
|
[phase, sendCommand]
|
|
948
1371
|
);
|
|
949
1372
|
const sendUserText = useCallback(
|
|
950
1373
|
async (text) => {
|
|
951
1374
|
if (phase !== "live" || !text.trim()) return false;
|
|
952
|
-
const messageId =
|
|
1375
|
+
const messageId = mintVoiceId({ kind: "text" });
|
|
953
1376
|
try {
|
|
954
|
-
await sendCommand({ type: "voice/user-text", text, messageId });
|
|
1377
|
+
await sendCommand({ type: "voice/user-text", text, messageId, attemptId: callAttemptIdRef.current });
|
|
955
1378
|
return true;
|
|
956
1379
|
} catch {
|
|
957
1380
|
return false;
|
|
@@ -976,7 +1399,10 @@ const useDeepAgentVoice = (options = {}) => {
|
|
|
976
1399
|
notice,
|
|
977
1400
|
sendContext,
|
|
978
1401
|
model,
|
|
979
|
-
modelOptions
|
|
1402
|
+
modelOptions,
|
|
1403
|
+
liveElsewhere,
|
|
1404
|
+
transferHere,
|
|
1405
|
+
movedTo
|
|
980
1406
|
}),
|
|
981
1407
|
[
|
|
982
1408
|
phase,
|
|
@@ -994,26 +1420,38 @@ const useDeepAgentVoice = (options = {}) => {
|
|
|
994
1420
|
notice,
|
|
995
1421
|
sendContext,
|
|
996
1422
|
model,
|
|
997
|
-
modelOptions
|
|
1423
|
+
modelOptions,
|
|
1424
|
+
liveElsewhere,
|
|
1425
|
+
transferHere,
|
|
1426
|
+
movedTo
|
|
998
1427
|
]
|
|
999
1428
|
);
|
|
1000
1429
|
};
|
|
1001
1430
|
export {
|
|
1431
|
+
VOICE_CONTINUE_BY_VOICE_LABEL,
|
|
1002
1432
|
VOICE_LIVEKIT_ANSWER_PREFIX,
|
|
1003
1433
|
VOICE_LIVEKIT_OFFER,
|
|
1434
|
+
VOICE_MOVED_NOTICE_MS,
|
|
1435
|
+
VOICE_MOVE_CALL_HERE_LABEL,
|
|
1436
|
+
VOICE_MOVE_HERE_ACTION,
|
|
1004
1437
|
VOICE_RELAY_ANSWER_PREFIX,
|
|
1005
1438
|
VOICE_RELAY_SAMPLE_RATE,
|
|
1006
1439
|
VOICE_WEBSOCKET_OFFER,
|
|
1007
1440
|
classifyVoiceStartError,
|
|
1008
1441
|
describeVoiceFailure,
|
|
1442
|
+
describeVoiceLiveElsewhere,
|
|
1443
|
+
describeVoiceMovedTo,
|
|
1009
1444
|
describeVoiceWireError,
|
|
1010
1445
|
float32FromPcm16,
|
|
1011
1446
|
formatVoiceElapsed,
|
|
1012
1447
|
parseVoiceLiveKitAnswer,
|
|
1013
1448
|
parseVoiceModelOptions,
|
|
1449
|
+
parseVoiceOwner,
|
|
1014
1450
|
pcm16FromFloat32,
|
|
1015
1451
|
useDeepAgentVoice,
|
|
1016
1452
|
useVoiceElapsed,
|
|
1017
|
-
|
|
1453
|
+
useVoiceMovedNotice,
|
|
1454
|
+
voiceRelayUrl,
|
|
1455
|
+
voiceSurfaceLabel
|
|
1018
1456
|
};
|
|
1019
1457
|
//# sourceMappingURL=use-deep-agent-voice.js.map
|