@absolutejs/voice 0.0.22-beta.5 → 0.0.22-beta.500
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 +4556 -603
- package/dist/agent.d.ts +79 -5
- package/dist/agentSquadContract.d.ts +98 -0
- package/dist/agentState.d.ts +12 -0
- package/dist/agentTools.d.ts +133 -0
- package/dist/aiVoiceModel.d.ts +15 -0
- package/dist/amdDetector.d.ts +25 -0
- package/dist/angular/index.d.ts +26 -2
- package/dist/angular/index.js +3703 -246
- package/dist/angular/voice-agent-squad-status.service.d.ts +12 -0
- package/dist/angular/voice-call-debugger.service.d.ts +12 -0
- package/dist/angular/voice-campaign-dialer-proof.service.d.ts +14 -0
- package/dist/angular/voice-controller.service.d.ts +3 -1
- package/dist/angular/voice-delivery-runtime.component.d.ts +17 -0
- package/dist/angular/voice-delivery-runtime.service.d.ts +16 -0
- package/dist/angular/voice-live-ops.service.d.ts +11 -0
- package/dist/angular/voice-ops-action-center.service.d.ts +13 -0
- package/dist/angular/voice-ops-status.component.d.ts +15 -0
- package/dist/angular/voice-ops-status.service.d.ts +12 -0
- package/dist/angular/voice-platform-coverage.service.d.ts +12 -0
- package/dist/angular/voice-profile-comparison.service.d.ts +12 -0
- package/dist/angular/voice-proof-trends.service.d.ts +12 -0
- package/dist/angular/voice-provider-capabilities.service.d.ts +12 -0
- package/dist/angular/voice-provider-contracts.service.d.ts +12 -0
- package/dist/angular/voice-provider-status.service.d.ts +12 -0
- package/dist/angular/voice-readiness-failures.service.d.ts +13 -0
- package/dist/angular/voice-reconnect-profile-evidence.service.d.ts +12 -0
- package/dist/angular/voice-routing-status.service.d.ts +11 -0
- package/dist/angular/voice-session-observability.service.d.ts +12 -0
- package/dist/angular/voice-session-snapshot.service.d.ts +13 -0
- package/dist/angular/voice-stream.service.d.ts +6 -1
- package/dist/angular/voice-trace-timeline.service.d.ts +12 -0
- package/dist/angular/voice-turn-latency.service.d.ts +13 -0
- package/dist/angular/voice-turn-quality.service.d.ts +12 -0
- package/dist/angular/voice-widget.service.d.ts +18 -0
- package/dist/angular/voice-workflow-status.service.d.ts +12 -0
- package/dist/assistant.d.ts +12 -13
- package/dist/assistantHealth.d.ts +81 -0
- package/dist/assistantMemory.d.ts +3 -3
- package/dist/assistantMode.d.ts +22 -0
- package/dist/audioConditioning.d.ts +1 -1
- package/dist/audit.d.ts +131 -0
- package/dist/auditDeliveryRoutes.d.ts +85 -0
- package/dist/auditExport.d.ts +34 -0
- package/dist/auditRoutes.d.ts +66 -0
- package/dist/auditSinks.d.ts +151 -0
- package/dist/backchannel.d.ts +18 -0
- package/dist/bargeInRoutes.d.ts +56 -0
- package/dist/browserCallProfiles.d.ts +120 -0
- package/dist/browserMediaRoutes.d.ts +62 -0
- package/dist/callDebugger.d.ts +66 -0
- package/dist/callQuota.d.ts +54 -0
- package/dist/callerMemory.d.ts +37 -0
- package/dist/campaign.d.ts +794 -0
- package/dist/campaignControls.d.ts +37 -0
- package/dist/campaignDialers.d.ts +111 -0
- package/dist/client/actions.d.ts +117 -1
- package/dist/client/agentSquadStatus.d.ts +37 -0
- package/dist/client/agentSquadStatusWidget.d.ts +24 -0
- package/dist/client/audioPlayer.d.ts +2 -2
- package/dist/client/bargeInMonitor.d.ts +7 -0
- package/dist/client/browserMedia.d.ts +8 -0
- package/dist/client/callDebugger.d.ts +19 -0
- package/dist/client/callDebuggerWidget.d.ts +30 -0
- package/dist/client/campaignDialerProof.d.ts +23 -0
- package/dist/client/connection.d.ts +5 -1
- package/dist/client/controller.d.ts +1 -1
- package/dist/client/costDashboard.d.ts +27 -0
- package/dist/client/createVoiceStream.d.ts +1 -1
- package/dist/client/deliveryRuntime.d.ts +34 -0
- package/dist/client/deliveryRuntimeWidget.d.ts +37 -0
- package/dist/client/duplex.d.ts +2 -2
- package/dist/client/htmx.d.ts +1 -1
- package/dist/client/htmxBootstrap.js +1011 -16
- package/dist/client/index.d.ts +104 -7
- package/dist/client/index.js +10409 -10
- package/dist/client/liveCallViewer.d.ts +42 -0
- package/dist/client/liveOps.d.ts +22 -0
- package/dist/client/liveOpsWidget.d.ts +23 -0
- package/dist/client/liveTurnLatency.d.ts +41 -0
- package/dist/client/microphone.d.ts +4 -4
- package/dist/client/opsActionCenter.d.ts +54 -0
- package/dist/client/opsActionCenterWidget.d.ts +29 -0
- package/dist/client/opsActionHistory.d.ts +19 -0
- package/dist/client/opsActionHistoryWidget.d.ts +11 -0
- package/dist/client/opsStatus.d.ts +19 -0
- package/dist/client/opsStatusWidget.d.ts +40 -0
- package/dist/client/platformCoverage.d.ts +19 -0
- package/dist/client/platformCoverageWidget.d.ts +37 -0
- package/dist/client/profileComparison.d.ts +19 -0
- package/dist/client/profileComparisonWidget.d.ts +41 -0
- package/dist/client/profileSwitchRecommendation.d.ts +19 -0
- package/dist/client/profileSwitchRecommendationWidget.d.ts +12 -0
- package/dist/client/proofTrends.d.ts +19 -0
- package/dist/client/proofTrendsWidget.d.ts +37 -0
- package/dist/client/providerCapabilities.d.ts +19 -0
- package/dist/client/providerCapabilitiesWidget.d.ts +32 -0
- package/dist/client/providerContracts.d.ts +19 -0
- package/dist/client/providerContractsWidget.d.ts +37 -0
- package/dist/client/providerSimulationControls.d.ts +33 -0
- package/dist/client/providerSimulationControlsWidget.d.ts +20 -0
- package/dist/client/providerStatus.d.ts +19 -0
- package/dist/client/providerStatusWidget.d.ts +32 -0
- package/dist/client/readinessFailures.d.ts +19 -0
- package/dist/client/readinessFailuresWidget.d.ts +42 -0
- package/dist/client/reconnectProfileEvidence.d.ts +19 -0
- package/dist/client/reconnectProfileEvidenceWidget.d.ts +39 -0
- package/dist/client/replayTimeline.d.ts +26 -0
- package/dist/client/routingStatus.d.ts +19 -0
- package/dist/client/routingStatusWidget.d.ts +32 -0
- package/dist/client/sessionObservability.d.ts +19 -0
- package/dist/client/sessionObservabilityWidget.d.ts +31 -0
- package/dist/client/sessionSnapshot.d.ts +21 -0
- package/dist/client/sessionSnapshotWidget.d.ts +33 -0
- package/dist/client/store.d.ts +1 -1
- package/dist/client/traceTimeline.d.ts +19 -0
- package/dist/client/traceTimelineWidget.d.ts +36 -0
- package/dist/client/turnLatency.d.ts +22 -0
- package/dist/client/turnLatencyWidget.d.ts +33 -0
- package/dist/client/turnQuality.d.ts +19 -0
- package/dist/client/turnQualityWidget.d.ts +32 -0
- package/dist/client/voiceWidgetView.d.ts +50 -0
- package/dist/client/workflowStatus.d.ts +19 -0
- package/dist/competitiveCoverage.d.ts +141 -0
- package/dist/correction.d.ts +2 -2
- package/dist/costAccounting.d.ts +76 -0
- package/dist/dataControl.d.ts +180 -0
- package/dist/defineVoiceAssistant.d.ts +68 -0
- package/dist/deliveryRuntime.d.ts +158 -0
- package/dist/deliverySinkRoutes.d.ts +117 -0
- package/dist/demoReadyRoutes.d.ts +98 -0
- package/dist/diagnosticsRoutes.d.ts +44 -0
- package/dist/evalRoutes.d.ts +219 -0
- package/dist/fileStore.d.ts +21 -7
- package/dist/generated/htmxBootstrapBundle.d.ts +1 -0
- package/dist/guardrails.d.ts +128 -0
- package/dist/handoff.d.ts +54 -0
- package/dist/handoffHealth.d.ts +94 -0
- package/dist/htmx.d.ts +1 -1
- package/dist/incidentBundle.d.ts +119 -0
- package/dist/incidentTimeline.d.ts +260 -0
- package/dist/index.d.ts +278 -46
- package/dist/index.js +42417 -4242
- package/dist/ivrPlan.d.ts +40 -0
- package/dist/latencySlo.d.ts +56 -0
- package/dist/liveLatency.d.ts +78 -0
- package/dist/liveOps.d.ts +190 -0
- package/dist/llmJudge.d.ts +45 -0
- package/dist/logger.d.ts +1 -1
- package/dist/mediaPipelineRoutes.d.ts +171 -0
- package/dist/mediaPipelineSurfaces.d.ts +48 -0
- package/dist/memoryStore.d.ts +1 -1
- package/dist/midCallSummary.d.ts +27 -0
- package/dist/modelAdapters.d.ts +135 -2
- package/dist/monitor.d.ts +148 -0
- package/dist/multilingualProof.d.ts +77 -0
- package/dist/oauth2TokenSource.d.ts +21 -0
- package/dist/observabilityExport.d.ts +501 -0
- package/dist/openaiTTS.d.ts +18 -0
- package/dist/operationalStatus.d.ts +87 -0
- package/dist/operationsRecord.d.ts +370 -0
- package/dist/ops.d.ts +12 -12
- package/dist/opsActionAuditRoutes.d.ts +99 -0
- package/dist/opsConsoleRoutes.d.ts +80 -0
- package/dist/opsPresets.d.ts +2 -2
- package/dist/opsRecovery.d.ts +137 -0
- package/dist/opsRuntime.d.ts +6 -6
- package/dist/opsSinks.d.ts +13 -13
- package/dist/opsStatus.d.ts +76 -0
- package/dist/opsStatusRoutes.d.ts +33 -0
- package/dist/opsWebhook.d.ts +126 -0
- package/dist/otelExporter.d.ts +83 -0
- package/dist/outcomeContract.d.ts +146 -0
- package/dist/outcomeRecipes.d.ts +4 -4
- package/dist/phoneAgent.d.ts +139 -0
- package/dist/phoneAgentProductionSmoke.d.ts +115 -0
- package/dist/platformCoverage.d.ts +91 -0
- package/dist/plugin.d.ts +2 -2
- package/dist/postCallAnalysis.d.ts +98 -0
- package/dist/postgresStore.d.ts +17 -6
- package/dist/presets.d.ts +3 -3
- package/dist/productionReadiness.d.ts +756 -0
- package/dist/profileSwitchRecommendation.d.ts +350 -0
- package/dist/proofAssertions.d.ts +32 -0
- package/dist/proofPack.d.ts +211 -0
- package/dist/proofRunner.d.ts +79 -0
- package/dist/proofTrends.d.ts +966 -0
- package/dist/providerAdapters.d.ts +48 -0
- package/dist/providerCapabilities.d.ts +92 -0
- package/dist/providerDecisionTraces.d.ts +130 -0
- package/dist/providerHealth.d.ts +79 -0
- package/dist/providerOrchestration.d.ts +109 -0
- package/dist/providerRouterTraces.d.ts +35 -0
- package/dist/providerRoutingContract.d.ts +71 -0
- package/dist/providerSlo.d.ts +142 -0
- package/dist/providerStackRecommendations.d.ts +187 -0
- package/dist/qualityRoutes.d.ts +76 -0
- package/dist/queue.d.ts +72 -11
- package/dist/ragTool.d.ts +57 -0
- package/dist/react/VoiceAgentSquadStatus.d.ts +5 -0
- package/dist/react/VoiceCallDebuggerLaunch.d.ts +6 -0
- package/dist/react/VoiceCostDashboard.d.ts +10 -0
- package/dist/react/VoiceDeliveryRuntime.d.ts +7 -0
- package/dist/react/VoiceLiveCallViewer.d.ts +9 -0
- package/dist/react/VoiceOpsActionCenter.d.ts +5 -0
- package/dist/react/VoiceOpsStatus.d.ts +6 -0
- package/dist/react/VoicePlatformCoverage.d.ts +6 -0
- package/dist/react/VoiceProfileComparison.d.ts +6 -0
- package/dist/react/VoiceProfileSwitchRecommendation.d.ts +6 -0
- package/dist/react/VoiceProofTrends.d.ts +6 -0
- package/dist/react/VoiceProviderCapabilities.d.ts +6 -0
- package/dist/react/VoiceProviderContracts.d.ts +6 -0
- package/dist/react/VoiceProviderSimulationControls.d.ts +5 -0
- package/dist/react/VoiceProviderStatus.d.ts +6 -0
- package/dist/react/VoiceReadinessFailures.d.ts +6 -0
- package/dist/react/VoiceReconnectProfileEvidence.d.ts +6 -0
- package/dist/react/VoiceReplayTimeline.d.ts +6 -0
- package/dist/react/VoiceRoutingStatus.d.ts +6 -0
- package/dist/react/VoiceSessionObservability.d.ts +6 -0
- package/dist/react/VoiceSessionSnapshot.d.ts +6 -0
- package/dist/react/VoiceTraceTimeline.d.ts +6 -0
- package/dist/react/VoiceTurnLatency.d.ts +6 -0
- package/dist/react/VoiceTurnQuality.d.ts +6 -0
- package/dist/react/VoiceWidget.d.ts +13 -0
- package/dist/react/index.d.ts +55 -2
- package/dist/react/index.js +12290 -15
- package/dist/react/useVoiceAgentSquadStatus.d.ts +8 -0
- package/dist/react/useVoiceCallDebugger.d.ts +8 -0
- package/dist/react/useVoiceCampaignDialerProof.d.ts +10 -0
- package/dist/react/useVoiceController.d.ts +6 -1
- package/dist/react/useVoiceDeliveryRuntime.d.ts +13 -0
- package/dist/react/useVoiceLiveOps.d.ts +9 -0
- package/dist/react/useVoiceOpsActionCenter.d.ts +11 -0
- package/dist/react/useVoiceOpsStatus.d.ts +8 -0
- package/dist/react/useVoicePlatformCoverage.d.ts +8 -0
- package/dist/react/useVoiceProfileComparison.d.ts +8 -0
- package/dist/react/useVoiceProfileSwitchRecommendation.d.ts +8 -0
- package/dist/react/useVoiceProofTrends.d.ts +8 -0
- package/dist/react/useVoiceProviderCapabilities.d.ts +8 -0
- package/dist/react/useVoiceProviderContracts.d.ts +8 -0
- package/dist/react/useVoiceProviderSimulationControls.d.ts +10 -0
- package/dist/react/useVoiceProviderStatus.d.ts +8 -0
- package/dist/react/useVoiceReadinessFailures.d.ts +8 -0
- package/dist/react/useVoiceReconnectProfileEvidence.d.ts +8 -0
- package/dist/react/useVoiceRoutingStatus.d.ts +8 -0
- package/dist/react/useVoiceSessionObservability.d.ts +8 -0
- package/dist/react/useVoiceSessionSnapshot.d.ts +9 -0
- package/dist/react/useVoiceStream.d.ts +6 -1
- package/dist/react/useVoiceTraceTimeline.d.ts +8 -0
- package/dist/react/useVoiceTurnLatency.d.ts +9 -0
- package/dist/react/useVoiceTurnQuality.d.ts +8 -0
- package/dist/react/useVoiceWorkflowStatus.d.ts +8 -0
- package/dist/readinessProfiles.d.ts +45 -0
- package/dist/realtimeChannel.d.ts +136 -0
- package/dist/realtimeProviderContracts.d.ts +133 -0
- package/dist/reconnectContract.d.ts +176 -0
- package/dist/recordingRedaction.d.ts +18 -0
- package/dist/recordingStore.d.ts +60 -0
- package/dist/redaction.d.ts +13 -0
- package/dist/resilienceRoutes.d.ts +146 -0
- package/dist/retention.d.ts +37 -0
- package/dist/routeAuth.d.ts +58 -0
- package/dist/routing.d.ts +1 -1
- package/dist/runtimeOps.d.ts +3 -3
- package/dist/s3Store.d.ts +18 -3
- package/dist/semanticTurn.d.ts +27 -0
- package/dist/session.d.ts +1 -1
- package/dist/sessionObservability.d.ts +145 -0
- package/dist/sessionReplay.d.ts +187 -0
- package/dist/sessionSnapshot.d.ts +109 -0
- package/dist/simulationSuite.d.ts +143 -0
- package/dist/sloCalibration.d.ts +185 -0
- package/dist/sqliteStore.d.ts +17 -6
- package/dist/store.d.ts +1 -1
- package/dist/svelte/createVoiceAgentSquadStatus.d.ts +9 -0
- package/dist/svelte/createVoiceCallDebugger.d.ts +12 -0
- package/dist/svelte/createVoiceCampaignDialerProof.d.ts +9 -0
- package/dist/svelte/createVoiceDeliveryRuntime.d.ts +11 -0
- package/dist/svelte/createVoiceLiveOps.d.ts +13 -0
- package/dist/svelte/createVoiceOpsActionCenter.d.ts +10 -0
- package/dist/svelte/createVoiceOpsStatus.d.ts +9 -0
- package/dist/svelte/createVoicePlatformCoverage.d.ts +7 -0
- package/dist/svelte/createVoiceProfileComparison.d.ts +7 -0
- package/dist/svelte/createVoiceProofTrends.d.ts +7 -0
- package/dist/svelte/createVoiceProviderCapabilities.d.ts +10 -0
- package/dist/svelte/createVoiceProviderContracts.d.ts +10 -0
- package/dist/svelte/createVoiceProviderSimulationControls.d.ts +11 -0
- package/dist/svelte/createVoiceProviderStatus.d.ts +10 -0
- package/dist/svelte/createVoiceReadinessFailures.d.ts +7 -0
- package/dist/svelte/createVoiceReconnectProfileEvidence.d.ts +7 -0
- package/dist/svelte/createVoiceRoutingStatus.d.ts +10 -0
- package/dist/svelte/createVoiceSessionObservability.d.ts +10 -0
- package/dist/svelte/createVoiceSessionSnapshot.d.ts +13 -0
- package/dist/svelte/createVoiceStream.d.ts +1 -1
- package/dist/svelte/createVoiceTraceTimeline.d.ts +10 -0
- package/dist/svelte/createVoiceTurnLatency.d.ts +11 -0
- package/dist/svelte/createVoiceTurnQuality.d.ts +10 -0
- package/dist/svelte/createVoiceWidget.d.ts +19 -0
- package/dist/svelte/createVoiceWorkflowStatus.d.ts +8 -0
- package/dist/svelte/index.d.ts +27 -2
- package/dist/svelte/index.js +6010 -150
- package/dist/telephony/contract.d.ts +61 -0
- package/dist/telephony/matrix.d.ts +97 -0
- package/dist/telephony/plivo.d.ts +303 -0
- package/dist/telephony/response.d.ts +1 -1
- package/dist/telephony/security.d.ts +182 -0
- package/dist/telephony/telnyx.d.ts +291 -0
- package/dist/telephony/twilio.d.ts +147 -13
- package/dist/telephonyMediaRoutes.d.ts +72 -0
- package/dist/telephonyOutcome.d.ts +273 -0
- package/dist/testing/accuracy.d.ts +1 -1
- package/dist/testing/benchmark.d.ts +9 -9
- package/dist/testing/corrected.d.ts +5 -5
- package/dist/testing/duplex.d.ts +3 -3
- package/dist/testing/fixtures.d.ts +3 -3
- package/dist/testing/index.d.ts +13 -11
- package/dist/testing/index.js +9117 -2592
- package/dist/testing/ioProviderSimulator.d.ts +41 -0
- package/dist/testing/providerSimulator.d.ts +44 -0
- package/dist/testing/review.d.ts +4 -4
- package/dist/testing/sessionBenchmark.d.ts +3 -3
- package/dist/testing/stt.d.ts +3 -3
- package/dist/testing/telephony.d.ts +25 -0
- package/dist/testing/tts.d.ts +1 -1
- package/dist/toolContract.d.ts +161 -0
- package/dist/toolRuntime.d.ts +50 -0
- package/dist/trace.d.ts +46 -7
- package/dist/traceDeliveryRoutes.d.ts +86 -0
- package/dist/traceTimeline.d.ts +97 -0
- package/dist/turnDetection.d.ts +1 -1
- package/dist/turnLatency.d.ts +95 -0
- package/dist/turnProfiles.d.ts +2 -2
- package/dist/turnQuality.d.ts +94 -0
- package/dist/types.d.ts +366 -71
- package/dist/vapiAdapter.d.ts +160 -0
- package/dist/voiceMonitoring.d.ts +444 -0
- package/dist/vue/VoiceCallDebuggerLaunch.d.ts +68 -0
- package/dist/vue/VoiceDeliveryRuntime.d.ts +30 -0
- package/dist/vue/VoiceOpsActionCenter.d.ts +13 -0
- package/dist/vue/VoiceOpsStatus.d.ts +30 -0
- package/dist/vue/VoicePlatformCoverage.d.ts +23 -0
- package/dist/vue/VoiceProofTrends.d.ts +21 -0
- package/dist/vue/VoiceProviderCapabilities.d.ts +51 -0
- package/dist/vue/VoiceProviderContracts.d.ts +21 -0
- package/dist/vue/VoiceProviderSimulationControls.d.ts +88 -0
- package/dist/vue/VoiceProviderStatus.d.ts +51 -0
- package/dist/vue/VoiceReadinessFailures.d.ts +21 -0
- package/dist/vue/VoiceReconnectProfileEvidence.d.ts +21 -0
- package/dist/vue/VoiceRoutingStatus.d.ts +51 -0
- package/dist/vue/VoiceSessionObservability.d.ts +23 -0
- package/dist/vue/VoiceSessionSnapshot.d.ts +68 -0
- package/dist/vue/VoiceTurnLatency.d.ts +69 -0
- package/dist/vue/VoiceTurnQuality.d.ts +51 -0
- package/dist/vue/VoiceWidget.d.ts +77 -0
- package/dist/vue/index.d.ts +44 -2
- package/dist/vue/index.js +11027 -31
- package/dist/vue/useVoiceAgentSquadStatus.d.ts +9 -0
- package/dist/vue/useVoiceCallDebugger.d.ts +10 -0
- package/dist/vue/useVoiceCampaignDialerProof.d.ts +11 -0
- package/dist/vue/useVoiceController.d.ts +4 -2
- package/dist/vue/useVoiceDeliveryRuntime.d.ts +13 -0
- package/dist/vue/useVoiceLiveOps.d.ts +9 -0
- package/dist/vue/useVoiceOpsActionCenter.d.ts +11 -0
- package/dist/vue/useVoiceOpsStatus.d.ts +9 -0
- package/dist/vue/useVoicePlatformCoverage.d.ts +9 -0
- package/dist/vue/useVoiceProfileComparison.d.ts +9 -0
- package/dist/vue/useVoiceProofTrends.d.ts +9 -0
- package/dist/vue/useVoiceProviderCapabilities.d.ts +9 -0
- package/dist/vue/useVoiceProviderContracts.d.ts +9 -0
- package/dist/vue/useVoiceProviderSimulationControls.d.ts +24 -0
- package/dist/vue/useVoiceProviderStatus.d.ts +9 -0
- package/dist/vue/useVoiceReadinessFailures.d.ts +959 -0
- package/dist/vue/useVoiceReconnectProfileEvidence.d.ts +9 -0
- package/dist/vue/useVoiceRoutingStatus.d.ts +8 -0
- package/dist/vue/useVoiceSessionObservability.d.ts +9 -0
- package/dist/vue/useVoiceSessionSnapshot.d.ts +10 -0
- package/dist/vue/useVoiceStream.d.ts +7 -2
- package/dist/vue/useVoiceTraceTimeline.d.ts +9 -0
- package/dist/vue/useVoiceTurnLatency.d.ts +10 -0
- package/dist/vue/useVoiceTurnQuality.d.ts +9 -0
- package/dist/vue/useVoiceWorkflowStatus.d.ts +9 -0
- package/dist/webhookVerification.d.ts +27 -0
- package/dist/workflowContract.d.ts +91 -0
- package/fixtures/manifest.json +356 -197
- package/package.json +265 -256
package/dist/types.d.ts
CHANGED
|
@@ -1,24 +1,29 @@
|
|
|
1
|
-
import type { SessionStore } from
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
5
|
-
import type {
|
|
1
|
+
import type { SessionStore } from "@absolutejs/absolute";
|
|
2
|
+
import type { MediaWebRTCStatsCollector, MediaWebRTCStatsReport, MediaWebRTCStatsReportInput, MediaWebRTCStreamContinuityInput, MediaWebRTCStreamContinuityReport } from "@absolutejs/media";
|
|
3
|
+
import type { VoiceOpsDispositionTaskPolicies, VoiceOpsTaskAssignmentRule, VoiceOpsTaskAssignmentRules, VoiceIntegrationWebhookConfig, StoredVoiceIntegrationEvent, StoredVoiceOpsTask, VoiceIntegrationEventStore, VoiceOpsTaskPolicy, VoiceOpsTask, VoiceOpsTaskStore } from "./ops";
|
|
4
|
+
import type { VoiceIntegrationSink } from "./opsSinks";
|
|
5
|
+
import type { StoredVoiceCallReviewArtifact, VoiceCallReviewArtifact, VoiceCallReviewStore } from "./testing/review";
|
|
6
|
+
import type { VoiceTraceEventStore } from "./trace";
|
|
7
|
+
import type { VoiceLiveOpsControlState } from "./liveOps";
|
|
8
|
+
import type { VoiceAuditActor, VoiceAuditEventStore } from "./audit";
|
|
9
|
+
import type { VoiceProfileSwitchGuardDecision, VoiceProfileSwitchGuardMode, VoiceProfileSwitchObservedSignals } from "./profileSwitchRecommendation";
|
|
10
|
+
import type { VoiceRealCallProfileDefaultsReport, VoiceRealCallProfileHistoryReport } from "./proofTrends";
|
|
6
11
|
export type AudioFormat = {
|
|
7
|
-
container:
|
|
8
|
-
encoding:
|
|
12
|
+
container: "raw";
|
|
13
|
+
encoding: "alaw" | "mulaw" | "pcm_s16le";
|
|
9
14
|
sampleRateHz: number;
|
|
10
15
|
channels: 1 | 2;
|
|
11
16
|
};
|
|
12
17
|
export type AudioChunk = ArrayBuffer | ArrayBufferView;
|
|
13
18
|
export type VoiceLanguageStrategy = {
|
|
14
|
-
mode:
|
|
19
|
+
mode: "auto-detect";
|
|
15
20
|
allowedLanguages?: string[];
|
|
16
21
|
} | {
|
|
17
|
-
mode:
|
|
22
|
+
mode: "fixed";
|
|
18
23
|
primaryLanguage: string;
|
|
19
24
|
secondaryLanguages?: string[];
|
|
20
25
|
} | {
|
|
21
|
-
mode:
|
|
26
|
+
mode: "allow-switching";
|
|
22
27
|
primaryLanguage?: string;
|
|
23
28
|
secondaryLanguages: string[];
|
|
24
29
|
};
|
|
@@ -28,7 +33,7 @@ export type VoicePhraseHint = {
|
|
|
28
33
|
boost?: number;
|
|
29
34
|
metadata?: Record<string, unknown>;
|
|
30
35
|
};
|
|
31
|
-
export type VoiceCorrectionRiskTier =
|
|
36
|
+
export type VoiceCorrectionRiskTier = "safe" | "balanced" | "risky";
|
|
32
37
|
export type VoiceDomainTerm = {
|
|
33
38
|
text: string;
|
|
34
39
|
aliases?: string[];
|
|
@@ -44,12 +49,18 @@ export type VoiceLexiconEntry = {
|
|
|
44
49
|
metadata?: Record<string, unknown>;
|
|
45
50
|
pronunciation?: string;
|
|
46
51
|
};
|
|
52
|
+
export type VoiceTranscriptSentiment = {
|
|
53
|
+
label: "negative" | "neutral" | "positive" | (string & {});
|
|
54
|
+
metadata?: Record<string, unknown>;
|
|
55
|
+
score?: number;
|
|
56
|
+
};
|
|
47
57
|
export type Transcript = {
|
|
48
58
|
id: string;
|
|
49
59
|
text: string;
|
|
50
60
|
isFinal: boolean;
|
|
51
61
|
confidence?: number;
|
|
52
62
|
language?: string;
|
|
63
|
+
sentiment?: VoiceTranscriptSentiment;
|
|
53
64
|
speaker?: string | number;
|
|
54
65
|
startedAtMs?: number;
|
|
55
66
|
endedAtMs?: number;
|
|
@@ -65,7 +76,7 @@ export type VoiceTranscriptQuality = {
|
|
|
65
76
|
fallback?: VoiceFallbackDiagnostics;
|
|
66
77
|
partialTranscriptCount: number;
|
|
67
78
|
selectedTranscriptCount: number;
|
|
68
|
-
source:
|
|
79
|
+
source: "fallback" | "primary";
|
|
69
80
|
};
|
|
70
81
|
export type VoiceTurnCorrectionDiagnostics = {
|
|
71
82
|
attempted: boolean;
|
|
@@ -83,7 +94,7 @@ export type VoiceTurnCostEstimate = {
|
|
|
83
94
|
primaryAudioMs: number;
|
|
84
95
|
totalBillableAudioMs: number;
|
|
85
96
|
};
|
|
86
|
-
export type VoiceFallbackSelectionReason =
|
|
97
|
+
export type VoiceFallbackSelectionReason = "fallback-empty" | "primary-empty" | "word-count-margin" | "confidence-margin" | "word-count-tiebreak" | "kept-primary";
|
|
87
98
|
export type VoiceFallbackDiagnostics = {
|
|
88
99
|
attempted: boolean;
|
|
89
100
|
fallbackConfidence?: number;
|
|
@@ -94,31 +105,31 @@ export type VoiceFallbackDiagnostics = {
|
|
|
94
105
|
primaryWordCount: number;
|
|
95
106
|
selected: boolean;
|
|
96
107
|
selectionReason: VoiceFallbackSelectionReason;
|
|
97
|
-
trigger:
|
|
108
|
+
trigger: "empty-turn" | "low-confidence" | "empty-or-low-confidence" | "always";
|
|
98
109
|
};
|
|
99
110
|
export type VoicePartialEvent = {
|
|
100
|
-
type:
|
|
111
|
+
type: "partial";
|
|
101
112
|
transcript: Transcript;
|
|
102
113
|
receivedAt: number;
|
|
103
114
|
};
|
|
104
115
|
export type VoiceFinalEvent = {
|
|
105
|
-
type:
|
|
116
|
+
type: "final";
|
|
106
117
|
transcript: Transcript;
|
|
107
118
|
receivedAt: number;
|
|
108
119
|
};
|
|
109
120
|
export type VoiceEndOfTurnEvent = {
|
|
110
|
-
type:
|
|
111
|
-
reason:
|
|
121
|
+
type: "endOfTurn";
|
|
122
|
+
reason: "vendor" | "silence" | "manual";
|
|
112
123
|
receivedAt: number;
|
|
113
124
|
};
|
|
114
125
|
export type VoiceErrorEvent = {
|
|
115
|
-
type:
|
|
126
|
+
type: "error";
|
|
116
127
|
error: Error;
|
|
117
128
|
recoverable: boolean;
|
|
118
129
|
code?: string;
|
|
119
130
|
};
|
|
120
131
|
export type VoiceCloseEvent = {
|
|
121
|
-
type:
|
|
132
|
+
type: "close";
|
|
122
133
|
code?: number;
|
|
123
134
|
reason?: string;
|
|
124
135
|
recoverable?: boolean;
|
|
@@ -144,11 +155,11 @@ export type STTAdapterOpenOptions = {
|
|
|
144
155
|
signal?: AbortSignal;
|
|
145
156
|
};
|
|
146
157
|
export type STTAdapter<TOptions extends STTAdapterOpenOptions = STTAdapterOpenOptions> = {
|
|
147
|
-
kind:
|
|
158
|
+
kind: "stt";
|
|
148
159
|
open: (options: TOptions) => Promise<STTAdapterSession> | STTAdapterSession;
|
|
149
160
|
};
|
|
150
161
|
export type TTSAudioEvent = {
|
|
151
|
-
type:
|
|
162
|
+
type: "audio";
|
|
152
163
|
chunk: AudioChunk;
|
|
153
164
|
format: AudioFormat;
|
|
154
165
|
receivedAt: number;
|
|
@@ -161,15 +172,26 @@ export type TTSSessionEventMap = {
|
|
|
161
172
|
export type TTSAdapterSession = {
|
|
162
173
|
on: <K extends keyof TTSSessionEventMap>(event: K, handler: (payload: TTSSessionEventMap[K]) => void | Promise<void>) => () => void;
|
|
163
174
|
send: (text: string) => Promise<void>;
|
|
175
|
+
cancel?: (reason?: string) => Promise<void>;
|
|
164
176
|
close: (reason?: string) => Promise<void>;
|
|
165
177
|
};
|
|
178
|
+
export declare const ttsAdapterSessionCanCancel: (session: TTSAdapterSession) => session is TTSAdapterSession & {
|
|
179
|
+
cancel: (reason?: string) => Promise<void>;
|
|
180
|
+
};
|
|
181
|
+
export type VoiceTTSProsody = {
|
|
182
|
+
emphasis?: number;
|
|
183
|
+
pitch?: number;
|
|
184
|
+
speed?: number;
|
|
185
|
+
style?: string;
|
|
186
|
+
};
|
|
166
187
|
export type TTSAdapterOpenOptions = {
|
|
167
188
|
sessionId: string;
|
|
168
189
|
lexicon?: VoiceLexiconEntry[];
|
|
190
|
+
prosody?: VoiceTTSProsody;
|
|
169
191
|
signal?: AbortSignal;
|
|
170
192
|
};
|
|
171
193
|
export type TTSAdapter<TOptions extends TTSAdapterOpenOptions = TTSAdapterOpenOptions> = {
|
|
172
|
-
kind:
|
|
194
|
+
kind: "tts";
|
|
173
195
|
open: (options: TOptions) => Promise<TTSAdapterSession> | TTSAdapterSession;
|
|
174
196
|
};
|
|
175
197
|
export type RealtimeSessionEventMap = STTSessionEventMap & {
|
|
@@ -185,20 +207,33 @@ export type RealtimeAdapterOpenOptions = {
|
|
|
185
207
|
format: AudioFormat;
|
|
186
208
|
languageStrategy?: VoiceLanguageStrategy;
|
|
187
209
|
lexicon?: VoiceLexiconEntry[];
|
|
210
|
+
modalities?: ReadonlyArray<"audio" | "text">;
|
|
188
211
|
phraseHints?: VoicePhraseHint[];
|
|
212
|
+
promptCacheKey?: string;
|
|
213
|
+
semanticVAD?: import("./assistantMode").VoiceSemanticVADConfig;
|
|
189
214
|
signal?: AbortSignal;
|
|
190
215
|
};
|
|
191
216
|
export type RealtimeAdapter<TOptions extends RealtimeAdapterOpenOptions = RealtimeAdapterOpenOptions> = {
|
|
192
|
-
kind:
|
|
217
|
+
kind: "realtime";
|
|
193
218
|
open: (options: TOptions) => Promise<RealtimeAdapterSession> | RealtimeAdapterSession;
|
|
194
219
|
};
|
|
195
|
-
export type VoiceSessionStatus =
|
|
220
|
+
export type VoiceSessionStatus = "active" | "reconnecting" | "completed" | "failed";
|
|
221
|
+
export type VoiceReconnectClientStatus = "idle" | "reconnecting" | "resumed" | "exhausted";
|
|
222
|
+
export type VoiceReconnectClientState = {
|
|
223
|
+
attempts: number;
|
|
224
|
+
lastDisconnectAt?: number;
|
|
225
|
+
lastResumedAt?: number;
|
|
226
|
+
maxAttempts: number;
|
|
227
|
+
nextAttemptAt?: number;
|
|
228
|
+
status: VoiceReconnectClientStatus;
|
|
229
|
+
};
|
|
196
230
|
export type VoiceTurnRecord<TResult = unknown> = {
|
|
197
231
|
id: string;
|
|
198
232
|
text: string;
|
|
199
233
|
quality?: VoiceTranscriptQuality;
|
|
200
234
|
transcripts: Transcript[];
|
|
201
235
|
assistantText?: string;
|
|
236
|
+
attachments?: import("./agent").VoiceAgentMessageAttachment[];
|
|
202
237
|
committedAt: number;
|
|
203
238
|
result?: TResult;
|
|
204
239
|
};
|
|
@@ -253,10 +288,10 @@ export type VoiceSessionSummary = {
|
|
|
253
288
|
status: VoiceSessionStatus;
|
|
254
289
|
turnCount: number;
|
|
255
290
|
};
|
|
256
|
-
export type VoiceCallDisposition =
|
|
291
|
+
export type VoiceCallDisposition = "completed" | "transferred" | "escalated" | "voicemail" | "no-answer" | "failed" | "silence-timeout" | "closed";
|
|
257
292
|
export type VoiceCallLifecycleEvent = {
|
|
258
293
|
at: number;
|
|
259
|
-
type:
|
|
294
|
+
type: "start" | "end" | "transfer" | "escalation" | "voicemail" | "no-answer";
|
|
260
295
|
disposition?: VoiceCallDisposition;
|
|
261
296
|
metadata?: Record<string, unknown>;
|
|
262
297
|
reason?: string;
|
|
@@ -269,6 +304,65 @@ export type VoiceCallLifecycleState = {
|
|
|
269
304
|
lastEventAt: number;
|
|
270
305
|
startedAt: number;
|
|
271
306
|
};
|
|
307
|
+
export type VoiceHandoffAction = "escalate" | "no-answer" | "transfer" | "voicemail";
|
|
308
|
+
export type VoiceHandoffStatus = "delivered" | "failed" | "skipped";
|
|
309
|
+
export type VoiceHandoffResult = {
|
|
310
|
+
deliveredAt?: number;
|
|
311
|
+
deliveredTo?: string;
|
|
312
|
+
error?: string;
|
|
313
|
+
metadata?: Record<string, unknown>;
|
|
314
|
+
status: VoiceHandoffStatus;
|
|
315
|
+
};
|
|
316
|
+
export type VoiceHandoffDeliveryQueueStatus = VoiceHandoffStatus | "pending";
|
|
317
|
+
export type StoredVoiceHandoffDelivery<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = {
|
|
318
|
+
action: VoiceHandoffAction;
|
|
319
|
+
context: TContext;
|
|
320
|
+
createdAt: number;
|
|
321
|
+
deliveredAt?: number;
|
|
322
|
+
deliveries?: Record<string, VoiceHandoffResult & {
|
|
323
|
+
adapterId: string;
|
|
324
|
+
adapterKind?: string;
|
|
325
|
+
}>;
|
|
326
|
+
deliveryAttempts?: number;
|
|
327
|
+
deliveryError?: string;
|
|
328
|
+
deliveryStatus: VoiceHandoffDeliveryQueueStatus;
|
|
329
|
+
id: string;
|
|
330
|
+
metadata?: Record<string, unknown>;
|
|
331
|
+
reason?: string;
|
|
332
|
+
result?: TResult;
|
|
333
|
+
session: TSession;
|
|
334
|
+
sessionId: string;
|
|
335
|
+
target?: string;
|
|
336
|
+
updatedAt: number;
|
|
337
|
+
};
|
|
338
|
+
export type VoiceHandoffDeliveryStore<TDelivery extends StoredVoiceHandoffDelivery = StoredVoiceHandoffDelivery> = {
|
|
339
|
+
get: (id: string) => Promise<TDelivery | undefined> | TDelivery | undefined;
|
|
340
|
+
list: () => Promise<TDelivery[]> | TDelivery[];
|
|
341
|
+
remove: (id: string) => Promise<void> | void;
|
|
342
|
+
set: (id: string, delivery: TDelivery) => Promise<void> | void;
|
|
343
|
+
};
|
|
344
|
+
export type VoiceHandoffInput<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = {
|
|
345
|
+
action: VoiceHandoffAction;
|
|
346
|
+
api: VoiceSessionHandle<TContext, TSession, TResult>;
|
|
347
|
+
context: TContext;
|
|
348
|
+
metadata?: Record<string, unknown>;
|
|
349
|
+
reason?: string;
|
|
350
|
+
result?: TResult;
|
|
351
|
+
session: TSession;
|
|
352
|
+
target?: string;
|
|
353
|
+
};
|
|
354
|
+
export type VoiceHandoffAdapter<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = {
|
|
355
|
+
actions?: VoiceHandoffAction[];
|
|
356
|
+
handoff: (input: VoiceHandoffInput<TContext, TSession, TResult>) => Promise<VoiceHandoffResult> | VoiceHandoffResult;
|
|
357
|
+
id: string;
|
|
358
|
+
kind?: string;
|
|
359
|
+
};
|
|
360
|
+
export type VoiceHandoffConfig<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = {
|
|
361
|
+
adapters: VoiceHandoffAdapter<TContext, TSession, TResult>[];
|
|
362
|
+
deliveryQueue?: VoiceHandoffDeliveryStore<StoredVoiceHandoffDelivery<TContext, TSession, TResult>>;
|
|
363
|
+
enqueueOnly?: boolean;
|
|
364
|
+
failMode?: "record" | "throw";
|
|
365
|
+
};
|
|
272
366
|
export type VoiceSessionStore<TSession extends VoiceSessionRecord = VoiceSessionRecord> = SessionStore<TSession, VoiceSessionSummary>;
|
|
273
367
|
export type VoiceLogger = {
|
|
274
368
|
debug?: (message: string, meta?: Record<string, unknown>) => void;
|
|
@@ -277,15 +371,15 @@ export type VoiceLogger = {
|
|
|
277
371
|
error?: (message: string, meta?: Record<string, unknown>) => void;
|
|
278
372
|
};
|
|
279
373
|
export type VoiceReconnectConfig = {
|
|
280
|
-
strategy?:
|
|
374
|
+
strategy?: "resume-last-turn" | "restart" | "fail";
|
|
281
375
|
timeout?: number;
|
|
282
376
|
maxAttempts?: number;
|
|
283
377
|
};
|
|
284
|
-
export type VoiceRuntimePreset =
|
|
285
|
-
export type VoiceSTTLifecycle =
|
|
286
|
-
export type VoiceTurnProfile =
|
|
287
|
-
export type VoiceTurnQualityProfile =
|
|
288
|
-
export type VoiceTurnFallbackTrigger =
|
|
378
|
+
export type VoiceRuntimePreset = "default" | "chat" | "guided-intake" | "dictation" | "noisy-room" | "pstn-balanced" | "pstn-fast" | "reliability";
|
|
379
|
+
export type VoiceSTTLifecycle = "continuous" | "turn-scoped";
|
|
380
|
+
export type VoiceTurnProfile = "fast" | "balanced" | "long-form";
|
|
381
|
+
export type VoiceTurnQualityProfile = "general" | "accent-heavy" | "noisy-room" | "short-command";
|
|
382
|
+
export type VoiceTurnFallbackTrigger = "empty-turn" | "low-confidence" | "empty-or-low-confidence" | "always";
|
|
289
383
|
export type VoiceSTTFallbackConfig = {
|
|
290
384
|
adapter: STTAdapter;
|
|
291
385
|
trigger?: VoiceTurnFallbackTrigger;
|
|
@@ -338,11 +432,26 @@ export type VoiceSocket = {
|
|
|
338
432
|
send: (data: string | Uint8Array | ArrayBuffer) => void | Promise<void>;
|
|
339
433
|
close: (code?: number, reason?: string) => void | Promise<void>;
|
|
340
434
|
};
|
|
435
|
+
export type VoiceMonitorRuntimeSessionBinding = {
|
|
436
|
+
deregister: (reason?: string) => void;
|
|
437
|
+
emitAudio: (chunk: Uint8Array | ArrayBuffer, options?: {
|
|
438
|
+
source?: "assistant" | "caller" | (string & {});
|
|
439
|
+
}) => void;
|
|
440
|
+
};
|
|
441
|
+
export type VoiceMonitorRuntimeRegisterInput = {
|
|
442
|
+
handle: VoiceSessionHandle<unknown, VoiceSessionRecord, unknown>;
|
|
443
|
+
metadata?: Record<string, unknown>;
|
|
444
|
+
sessionId: string;
|
|
445
|
+
};
|
|
446
|
+
export type VoiceMonitorRuntimeBinding = {
|
|
447
|
+
registerSession: (input: VoiceMonitorRuntimeRegisterInput) => VoiceMonitorRuntimeSessionBinding;
|
|
448
|
+
};
|
|
341
449
|
export type VoiceSessionHandle<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = {
|
|
342
450
|
id: string;
|
|
343
451
|
connect: (socket: VoiceSocket) => Promise<void>;
|
|
344
452
|
receiveAudio: (audio: AudioChunk) => Promise<void>;
|
|
345
|
-
|
|
453
|
+
attachUserMedia: (attachment: import("./agent").VoiceAgentMessageAttachment) => Promise<void>;
|
|
454
|
+
commitTurn: (reason?: VoiceEndOfTurnEvent["reason"]) => Promise<void>;
|
|
346
455
|
disconnect: (event?: VoiceCloseEvent) => Promise<void>;
|
|
347
456
|
complete: (result?: TResult) => Promise<void>;
|
|
348
457
|
escalate: (input: {
|
|
@@ -364,6 +473,7 @@ export type VoiceSessionHandle<TContext = unknown, TSession extends VoiceSession
|
|
|
364
473
|
reason?: string;
|
|
365
474
|
result?: TResult;
|
|
366
475
|
target: string;
|
|
476
|
+
transferMode?: "cold" | "warm";
|
|
367
477
|
}) => Promise<void>;
|
|
368
478
|
close: (reason?: string) => Promise<void>;
|
|
369
479
|
snapshot: () => Promise<TSession>;
|
|
@@ -376,6 +486,7 @@ export type VoiceRouteResult<TResult = unknown> = {
|
|
|
376
486
|
metadata?: Record<string, unknown>;
|
|
377
487
|
reason?: string;
|
|
378
488
|
target: string;
|
|
489
|
+
transferMode?: "cold" | "warm";
|
|
379
490
|
};
|
|
380
491
|
escalate?: {
|
|
381
492
|
metadata?: Record<string, unknown>;
|
|
@@ -416,6 +527,10 @@ export type VoiceLexiconResolver<TContext = unknown> = (input: {
|
|
|
416
527
|
}) => Promise<VoiceLexiconEntry[] | void> | VoiceLexiconEntry[] | void;
|
|
417
528
|
export type VoiceOnTurnObjectHandler<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = (input: {
|
|
418
529
|
context: TContext;
|
|
530
|
+
liveOps?: {
|
|
531
|
+
control: VoiceLiveOpsControlState;
|
|
532
|
+
injectedInstruction?: string;
|
|
533
|
+
};
|
|
419
534
|
session: TSession;
|
|
420
535
|
turn: VoiceTurnRecord;
|
|
421
536
|
api: VoiceSessionHandle<TContext, TSession, TResult>;
|
|
@@ -500,7 +615,7 @@ export type VoiceRuntimeOpsConfig<TContext = unknown, TSession extends VoiceSess
|
|
|
500
615
|
disposition: VoiceCallDisposition;
|
|
501
616
|
review: StoredVoiceCallReviewArtifact;
|
|
502
617
|
session: TSession;
|
|
503
|
-
}) => Promise<Omit<VoiceOpsTask,
|
|
618
|
+
}) => Promise<Omit<VoiceOpsTask, "id"> | VoiceOpsTask | StoredVoiceOpsTask | null | void> | Omit<VoiceOpsTask, "id"> | VoiceOpsTask | StoredVoiceOpsTask | null | void;
|
|
504
619
|
resolveTaskPolicy?: (input: {
|
|
505
620
|
api: VoiceSessionHandle<TContext, TSession, TResult>;
|
|
506
621
|
context: TContext;
|
|
@@ -537,7 +652,37 @@ export type VoiceRuntimeOpsConfig<TContext = unknown, TSession extends VoiceSess
|
|
|
537
652
|
tasks?: VoiceOpsTaskStore;
|
|
538
653
|
webhook?: VoiceIntegrationWebhookConfig;
|
|
539
654
|
};
|
|
540
|
-
export type
|
|
655
|
+
export type VoiceLiveOpsRuntimeConfig = {
|
|
656
|
+
getControl: (sessionId: string) => Promise<VoiceLiveOpsControlState | null | undefined> | VoiceLiveOpsControlState | null | undefined;
|
|
657
|
+
};
|
|
658
|
+
export type VoiceProfileSwitchGuardResolverInput<TContext = unknown> = {
|
|
659
|
+
context: TContext;
|
|
660
|
+
scenarioId?: string;
|
|
661
|
+
sessionId: string;
|
|
662
|
+
};
|
|
663
|
+
export type VoicePluginProfileSwitchGuardConfig<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = {
|
|
664
|
+
actor?: VoiceAuditActor;
|
|
665
|
+
allowedProfileIds?: string[] | ((input: VoiceProfileSwitchGuardResolverInput<TContext>) => Promise<string[] | undefined> | string[] | undefined);
|
|
666
|
+
audit?: VoiceAuditEventStore;
|
|
667
|
+
blockedProfileIds?: string[] | ((input: VoiceProfileSwitchGuardResolverInput<TContext>) => Promise<string[] | undefined> | string[] | undefined);
|
|
668
|
+
currentProfileId?: string | ((input: VoiceProfileSwitchGuardResolverInput<TContext>) => Promise<string | undefined> | string | undefined);
|
|
669
|
+
defaultProfileId?: string;
|
|
670
|
+
defaults: VoiceRealCallProfileDefaultsReport | VoiceRealCallProfileHistoryReport | ((input: VoiceProfileSwitchGuardResolverInput<TContext>) => Promise<VoiceRealCallProfileDefaultsReport | VoiceRealCallProfileHistoryReport> | VoiceRealCallProfileDefaultsReport | VoiceRealCallProfileHistoryReport);
|
|
671
|
+
metadata?: Record<string, unknown> | ((input: VoiceProfileSwitchGuardResolverInput<TContext>) => Promise<Record<string, unknown> | undefined> | Record<string, unknown> | undefined);
|
|
672
|
+
minConfidence?: number | ((input: VoiceProfileSwitchGuardResolverInput<TContext>) => Promise<number | undefined> | number | undefined);
|
|
673
|
+
maxAutoSwitchesPerSession?: number | ((input: VoiceProfileSwitchGuardResolverInput<TContext>) => Promise<number | undefined> | number | undefined);
|
|
674
|
+
mode?: VoiceProfileSwitchGuardMode | ((input: VoiceProfileSwitchGuardResolverInput<TContext>) => Promise<VoiceProfileSwitchGuardMode | undefined> | VoiceProfileSwitchGuardMode | undefined);
|
|
675
|
+
observed?: VoiceProfileSwitchObservedSignals | ((input: VoiceProfileSwitchGuardResolverInput<TContext>) => Promise<VoiceProfileSwitchObservedSignals | undefined> | VoiceProfileSwitchObservedSignals | undefined);
|
|
676
|
+
onDecision?: (input: {
|
|
677
|
+
context: TContext;
|
|
678
|
+
decision: VoiceProfileSwitchGuardDecision;
|
|
679
|
+
scenarioId?: string;
|
|
680
|
+
sessionId: string;
|
|
681
|
+
}) => Promise<void> | void;
|
|
682
|
+
sessionMetadataKey?: string | false;
|
|
683
|
+
trace?: false | VoiceTraceEventStore;
|
|
684
|
+
};
|
|
685
|
+
export type VoiceNormalizedRouteConfig<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = Omit<VoiceRouteConfig<TContext, TSession, TResult>, "onTurn"> & {
|
|
541
686
|
onTurn: VoiceOnTurnObjectHandler<TContext, TSession, TResult>;
|
|
542
687
|
};
|
|
543
688
|
export type VoiceScenario = {
|
|
@@ -557,9 +702,11 @@ export type VoicePluginConfig<TContext = unknown, TSession extends VoiceSessionR
|
|
|
557
702
|
lexicon?: VoiceLexiconEntry[] | VoiceLexiconResolver<TContext>;
|
|
558
703
|
phraseHints?: VoicePhraseHint[] | VoicePhraseHintResolver<TContext>;
|
|
559
704
|
preset?: VoiceRuntimePreset;
|
|
560
|
-
stt
|
|
705
|
+
stt?: STTAdapter;
|
|
561
706
|
sttFallback?: VoiceSTTFallbackConfig;
|
|
562
707
|
sttLifecycle?: VoiceSTTLifecycle;
|
|
708
|
+
realtime?: RealtimeAdapter;
|
|
709
|
+
realtimeInputFormat?: AudioFormat;
|
|
563
710
|
tts?: TTSAdapter;
|
|
564
711
|
session: VoiceSessionStore<NoInfer<TSession>>;
|
|
565
712
|
reconnect?: VoiceReconnectConfig;
|
|
@@ -567,100 +714,177 @@ export type VoicePluginConfig<TContext = unknown, TSession extends VoiceSessionR
|
|
|
567
714
|
audioConditioning?: VoiceAudioConditioningConfig;
|
|
568
715
|
logger?: VoiceLogger;
|
|
569
716
|
htmx?: boolean | VoiceHTMXConfig<TSession, NoInfer<TResult>>;
|
|
717
|
+
handoff?: VoiceHandoffConfig<TContext, TSession, TResult>;
|
|
570
718
|
ops?: VoiceRuntimeOpsConfig<TContext, TSession, TResult>;
|
|
719
|
+
liveOps?: VoiceLiveOpsRuntimeConfig;
|
|
720
|
+
monitor?: VoiceMonitorRuntimeBinding;
|
|
721
|
+
profileSwitchGuard?: VoicePluginProfileSwitchGuardConfig<TContext, TSession, TResult>;
|
|
571
722
|
trace?: VoiceTraceEventStore;
|
|
572
723
|
} & VoiceRouteConfig<TContext, TSession, TResult>;
|
|
724
|
+
export type VoiceSessionRecordingConfig = {
|
|
725
|
+
channels?: ReadonlyArray<"assistant" | "user">;
|
|
726
|
+
maxBytesPerChannel?: number;
|
|
727
|
+
store: import("./recordingStore").VoiceRecordingStore;
|
|
728
|
+
userInputFormat?: AudioFormat;
|
|
729
|
+
};
|
|
573
730
|
export type CreateVoiceSessionOptions<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = {
|
|
574
731
|
costTelemetry?: VoiceCostTelemetryConfig<TContext, TSession, TResult>;
|
|
575
732
|
id: string;
|
|
576
733
|
context: TContext;
|
|
577
734
|
socket: VoiceSocket;
|
|
578
|
-
stt
|
|
735
|
+
stt?: STTAdapter;
|
|
736
|
+
realtime?: RealtimeAdapter;
|
|
737
|
+
realtimeInputFormat?: AudioFormat;
|
|
579
738
|
tts?: TTSAdapter;
|
|
580
739
|
languageStrategy?: VoiceLanguageStrategy;
|
|
581
740
|
lexicon?: VoiceLexiconEntry[];
|
|
582
741
|
sttFallback?: VoiceResolvedSTTFallbackConfig;
|
|
583
742
|
store: VoiceSessionStore<TSession>;
|
|
584
743
|
trace?: VoiceTraceEventStore;
|
|
744
|
+
recording?: VoiceSessionRecordingConfig;
|
|
745
|
+
callSilenceTimeoutMs?: number;
|
|
746
|
+
amd?: import("./amdDetector").VoiceAMDDetector<TContext, TSession, TResult>;
|
|
747
|
+
costAccountant?: import("./costAccounting").VoiceCostAccountant;
|
|
748
|
+
costTelephony?: {
|
|
749
|
+
provider?: string;
|
|
750
|
+
};
|
|
751
|
+
redact?: import("./redaction").VoiceTranscriptRedactor;
|
|
752
|
+
semanticTurnDetector?: import("./semanticTurn").VoiceSemanticTurnDetector;
|
|
753
|
+
assistantMode?: import("./assistantMode").VoiceAssistantMode;
|
|
754
|
+
modalities?: ReadonlyArray<"audio" | "text">;
|
|
755
|
+
prosody?: VoiceTTSProsody;
|
|
585
756
|
reconnect: Required<VoiceReconnectConfig>;
|
|
586
757
|
phraseHints?: VoicePhraseHint[];
|
|
758
|
+
sessionMetadata?: Record<string, unknown>;
|
|
587
759
|
scenarioId?: string;
|
|
588
760
|
sttLifecycle: VoiceSTTLifecycle;
|
|
589
761
|
turnDetection: VoiceResolvedTurnDetectionConfig;
|
|
590
762
|
audioConditioning?: VoiceResolvedAudioConditioningConfig;
|
|
763
|
+
handoff?: VoiceHandoffConfig<TContext, TSession, TResult>;
|
|
764
|
+
liveOps?: VoiceLiveOpsRuntimeConfig;
|
|
591
765
|
route: VoiceNormalizedRouteConfig<TContext, TSession, TResult>;
|
|
592
766
|
logger?: VoiceLogger;
|
|
593
767
|
};
|
|
594
768
|
export type CreateVoiceSession = <TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown>(options: CreateVoiceSessionOptions<TContext, TSession, TResult>) => VoiceSessionHandle<TContext, TSession, TResult>;
|
|
595
769
|
export type VoiceClientStartMessage = {
|
|
596
|
-
type:
|
|
770
|
+
type: "start";
|
|
597
771
|
sessionId?: string;
|
|
598
772
|
scenarioId?: string;
|
|
599
773
|
};
|
|
600
774
|
export type VoiceClientEndTurnMessage = {
|
|
601
|
-
type:
|
|
775
|
+
type: "end_turn";
|
|
602
776
|
};
|
|
603
777
|
export type VoiceClientCloseMessage = {
|
|
604
|
-
type:
|
|
778
|
+
type: "close";
|
|
779
|
+
reason?: string;
|
|
780
|
+
};
|
|
781
|
+
export type VoiceClientCallControlMessage = {
|
|
782
|
+
type: "call_control";
|
|
783
|
+
action: "complete" | "escalate" | "no-answer" | "transfer" | "voicemail";
|
|
784
|
+
metadata?: Record<string, unknown>;
|
|
605
785
|
reason?: string;
|
|
786
|
+
target?: string;
|
|
606
787
|
};
|
|
607
788
|
export type VoiceClientPingMessage = {
|
|
608
|
-
type:
|
|
789
|
+
type: "ping";
|
|
609
790
|
};
|
|
610
|
-
export type VoiceClientMessage = VoiceClientStartMessage | VoiceClientEndTurnMessage | VoiceClientCloseMessage | VoiceClientPingMessage;
|
|
791
|
+
export type VoiceClientMessage = VoiceClientStartMessage | VoiceClientEndTurnMessage | VoiceClientCloseMessage | VoiceClientCallControlMessage | VoiceClientPingMessage;
|
|
611
792
|
export type VoiceServerSessionMessage = {
|
|
612
|
-
type:
|
|
793
|
+
type: "session";
|
|
613
794
|
sessionId: string;
|
|
614
795
|
status: VoiceSessionStatus;
|
|
615
796
|
scenarioId?: string;
|
|
797
|
+
sessionMetadata?: Record<string, unknown>;
|
|
798
|
+
};
|
|
799
|
+
export type VoiceServerReplayMessage<TResult = unknown> = {
|
|
800
|
+
type: "replay";
|
|
801
|
+
assistantTexts: string[];
|
|
802
|
+
call?: VoiceCallLifecycleState;
|
|
803
|
+
partial: string;
|
|
804
|
+
scenarioId?: string;
|
|
805
|
+
sessionId: string;
|
|
806
|
+
sessionMetadata?: Record<string, unknown>;
|
|
807
|
+
status: VoiceSessionStatus;
|
|
808
|
+
turns: VoiceTurnRecord<TResult>[];
|
|
616
809
|
};
|
|
617
810
|
export type VoiceServerPartialMessage = {
|
|
618
|
-
type:
|
|
811
|
+
type: "partial";
|
|
619
812
|
transcript: Transcript;
|
|
620
813
|
};
|
|
621
814
|
export type VoiceServerFinalMessage = {
|
|
622
|
-
type:
|
|
815
|
+
type: "final";
|
|
623
816
|
transcript: Transcript;
|
|
624
817
|
};
|
|
625
818
|
export type VoiceServerTurnMessage<TResult = unknown> = {
|
|
626
|
-
type:
|
|
819
|
+
type: "turn";
|
|
627
820
|
turn: VoiceTurnRecord<TResult>;
|
|
628
821
|
};
|
|
629
822
|
export type VoiceServerAssistantMessage = {
|
|
630
|
-
type:
|
|
823
|
+
type: "assistant";
|
|
631
824
|
text: string;
|
|
632
825
|
turnId?: string;
|
|
633
826
|
};
|
|
634
827
|
export type VoiceServerAudioMessage = {
|
|
635
|
-
type:
|
|
828
|
+
type: "audio";
|
|
636
829
|
chunkBase64: string;
|
|
637
830
|
format: AudioFormat;
|
|
638
831
|
receivedAt: number;
|
|
639
832
|
turnId?: string;
|
|
640
833
|
};
|
|
641
834
|
export type VoiceServerCompleteMessage = {
|
|
642
|
-
type:
|
|
835
|
+
type: "complete";
|
|
836
|
+
sessionId: string;
|
|
837
|
+
};
|
|
838
|
+
export type VoiceServerCallLifecycleMessage = {
|
|
839
|
+
type: "call_lifecycle";
|
|
840
|
+
event: VoiceCallLifecycleEvent;
|
|
643
841
|
sessionId: string;
|
|
644
842
|
};
|
|
645
843
|
export type VoiceServerErrorMessage = {
|
|
646
|
-
type:
|
|
844
|
+
type: "error";
|
|
647
845
|
message: string;
|
|
648
846
|
recoverable?: boolean;
|
|
649
847
|
};
|
|
650
848
|
export type VoiceServerPongMessage = {
|
|
651
|
-
type:
|
|
849
|
+
type: "pong";
|
|
850
|
+
};
|
|
851
|
+
export type VoiceServerConnectionMessage = {
|
|
852
|
+
type: "connection";
|
|
853
|
+
reconnect: VoiceReconnectClientState;
|
|
652
854
|
};
|
|
653
|
-
export type VoiceServerMessage<TResult = unknown> = VoiceServerSessionMessage | VoiceServerPartialMessage | VoiceServerFinalMessage | VoiceServerTurnMessage<TResult> | VoiceServerAssistantMessage | VoiceServerAudioMessage | VoiceServerCompleteMessage | VoiceServerErrorMessage | VoiceServerPongMessage;
|
|
855
|
+
export type VoiceServerMessage<TResult = unknown> = VoiceServerSessionMessage | VoiceServerReplayMessage<TResult> | VoiceServerPartialMessage | VoiceServerFinalMessage | VoiceServerTurnMessage<TResult> | VoiceServerAssistantMessage | VoiceServerAudioMessage | VoiceServerCallLifecycleMessage | VoiceServerCompleteMessage | VoiceServerErrorMessage | VoiceServerPongMessage | VoiceServerConnectionMessage;
|
|
654
856
|
export type VoiceConnectionOptions = {
|
|
857
|
+
browserMedia?: false | VoiceBrowserMediaReporterOptions;
|
|
655
858
|
protocols?: string[];
|
|
656
859
|
scenarioId?: string;
|
|
657
860
|
reconnect?: boolean;
|
|
861
|
+
reconnectReportPath?: string;
|
|
658
862
|
maxReconnectAttempts?: number;
|
|
659
863
|
pingInterval?: number;
|
|
660
864
|
sessionId?: string;
|
|
661
865
|
};
|
|
866
|
+
export type VoiceBrowserMediaReportPayload = {
|
|
867
|
+
at: number;
|
|
868
|
+
continuity?: MediaWebRTCStreamContinuityReport;
|
|
869
|
+
report: MediaWebRTCStatsReport;
|
|
870
|
+
scenarioId?: string | null;
|
|
871
|
+
sessionId?: string | null;
|
|
872
|
+
};
|
|
873
|
+
export type VoiceBrowserMediaReporterOptions = Omit<MediaWebRTCStatsReportInput, "peerConnection"> & {
|
|
874
|
+
fetch?: typeof fetch;
|
|
875
|
+
getPeerConnection?: (() => MediaWebRTCStatsCollector | null | undefined) | (() => Promise<MediaWebRTCStatsCollector | null | undefined>);
|
|
876
|
+
getScenarioId?: () => string | null | undefined;
|
|
877
|
+
getSessionId?: () => string | null | undefined;
|
|
878
|
+
intervalMs?: number;
|
|
879
|
+
continuity?: false | Omit<MediaWebRTCStreamContinuityInput, "previousStats" | "stats">;
|
|
880
|
+
onError?: (error: unknown) => void;
|
|
881
|
+
onReport?: (payload: VoiceBrowserMediaReportPayload) => void;
|
|
882
|
+
path?: string;
|
|
883
|
+
peerConnection?: MediaWebRTCStatsCollector;
|
|
884
|
+
};
|
|
662
885
|
export type VoiceCaptureOptions = {
|
|
663
886
|
channelCount?: 1 | 2;
|
|
887
|
+
onAudio?: (audio: Uint8Array | ArrayBuffer, sendAudio: (audio: Uint8Array | ArrayBuffer) => void) => void;
|
|
664
888
|
onLevel?: (level: number) => void;
|
|
665
889
|
sampleRateHz?: number;
|
|
666
890
|
};
|
|
@@ -674,6 +898,46 @@ export type VoiceBargeInOptions = {
|
|
|
674
898
|
enabled?: boolean;
|
|
675
899
|
interruptOnPartial?: boolean;
|
|
676
900
|
interruptThreshold?: number;
|
|
901
|
+
monitor?: VoiceBargeInMonitor;
|
|
902
|
+
};
|
|
903
|
+
export type VoiceBargeInTriggerReason = "input-level" | "manual-audio" | "manual-interrupt" | "partial-transcript";
|
|
904
|
+
export type VoiceBargeInMonitorEvent = {
|
|
905
|
+
at: number;
|
|
906
|
+
id: string;
|
|
907
|
+
latencyMs?: number;
|
|
908
|
+
playbackStopLatencyMs?: number;
|
|
909
|
+
reason: VoiceBargeInTriggerReason;
|
|
910
|
+
sessionId?: string | null;
|
|
911
|
+
status: "requested" | "stopped" | "skipped";
|
|
912
|
+
thresholdMs?: number;
|
|
913
|
+
};
|
|
914
|
+
export type VoiceBargeInMonitorSnapshot = {
|
|
915
|
+
averageLatencyMs?: number;
|
|
916
|
+
events: VoiceBargeInMonitorEvent[];
|
|
917
|
+
failed: number;
|
|
918
|
+
lastEvent?: VoiceBargeInMonitorEvent;
|
|
919
|
+
passed: number;
|
|
920
|
+
status: "empty" | "fail" | "pass" | "warn";
|
|
921
|
+
thresholdMs: number;
|
|
922
|
+
total: number;
|
|
923
|
+
};
|
|
924
|
+
export type VoiceBargeInMonitor = {
|
|
925
|
+
getSnapshot: () => VoiceBargeInMonitorSnapshot;
|
|
926
|
+
recordRequested: (input: {
|
|
927
|
+
reason: VoiceBargeInTriggerReason;
|
|
928
|
+
sessionId?: string | null;
|
|
929
|
+
}) => VoiceBargeInMonitorEvent;
|
|
930
|
+
recordSkipped: (input: {
|
|
931
|
+
reason: VoiceBargeInTriggerReason;
|
|
932
|
+
sessionId?: string | null;
|
|
933
|
+
}) => VoiceBargeInMonitorEvent;
|
|
934
|
+
recordStopped: (input: {
|
|
935
|
+
latencyMs?: number;
|
|
936
|
+
playbackStopLatencyMs?: number;
|
|
937
|
+
reason: VoiceBargeInTriggerReason;
|
|
938
|
+
sessionId?: string | null;
|
|
939
|
+
}) => VoiceBargeInMonitorEvent;
|
|
940
|
+
subscribe: (subscriber: () => void) => () => void;
|
|
677
941
|
};
|
|
678
942
|
export type VoiceAudioPlayerOptions = {
|
|
679
943
|
autoStart?: boolean;
|
|
@@ -684,10 +948,10 @@ export type VoiceDuplexControllerOptions = VoiceControllerOptions & {
|
|
|
684
948
|
audioPlayer?: VoiceAudioPlayerOptions;
|
|
685
949
|
bargeIn?: VoiceBargeInOptions;
|
|
686
950
|
};
|
|
687
|
-
export type VoiceSTTRoutingGoal =
|
|
688
|
-
export type VoiceSTTRoutingCorrectionMode =
|
|
951
|
+
export type VoiceSTTRoutingGoal = "best" | "low-cost";
|
|
952
|
+
export type VoiceSTTRoutingCorrectionMode = "generic" | "none" | "risky-turn";
|
|
689
953
|
export type VoiceSTTRoutingStrategy = {
|
|
690
|
-
benchmarkSessionTarget:
|
|
954
|
+
benchmarkSessionTarget: "deepgram-corrected" | "deepgram-flux";
|
|
691
955
|
correctionMode: VoiceSTTRoutingCorrectionMode;
|
|
692
956
|
goal: VoiceSTTRoutingGoal;
|
|
693
957
|
notes: string[];
|
|
@@ -701,7 +965,7 @@ export type VoiceHTMXRenderInput<TResult = unknown, TSession extends VoiceSessio
|
|
|
701
965
|
result?: TResult;
|
|
702
966
|
session?: TSession;
|
|
703
967
|
sessionId?: string;
|
|
704
|
-
status: VoiceSessionStatus |
|
|
968
|
+
status: VoiceSessionStatus | "idle";
|
|
705
969
|
turnCount: number;
|
|
706
970
|
turns: VoiceTurnRecord<TResult>[];
|
|
707
971
|
};
|
|
@@ -728,9 +992,12 @@ export type VoiceHTMXOptions<TSession extends VoiceSessionRecord = VoiceSessionR
|
|
|
728
992
|
};
|
|
729
993
|
export type VoiceHTMXConfig<TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = VoiceHTMXRenderer<TSession, TResult> | VoiceHTMXOptions<TSession, TResult>;
|
|
730
994
|
export type VoiceStreamState<TResult = unknown> = {
|
|
995
|
+
call: VoiceCallLifecycleState | null;
|
|
996
|
+
sessionMetadata: Record<string, unknown> | null;
|
|
731
997
|
sessionId: string | null;
|
|
732
998
|
scenarioId: string | null;
|
|
733
|
-
status: VoiceSessionStatus |
|
|
999
|
+
status: VoiceSessionStatus | "idle";
|
|
1000
|
+
reconnect: VoiceReconnectClientState;
|
|
734
1001
|
partial: string;
|
|
735
1002
|
turns: VoiceTurnRecord<TResult>[];
|
|
736
1003
|
assistantTexts: string[];
|
|
@@ -744,6 +1011,8 @@ export type VoiceStreamState<TResult = unknown> = {
|
|
|
744
1011
|
isConnected: boolean;
|
|
745
1012
|
};
|
|
746
1013
|
export type VoiceStream<TResult = unknown> = {
|
|
1014
|
+
call: VoiceCallLifecycleState | null;
|
|
1015
|
+
callControl: (message: Omit<VoiceClientCallControlMessage, "type">) => void;
|
|
747
1016
|
close: () => void;
|
|
748
1017
|
start: (input?: {
|
|
749
1018
|
scenarioId?: string;
|
|
@@ -755,10 +1024,13 @@ export type VoiceStream<TResult = unknown> = {
|
|
|
755
1024
|
getSnapshot: () => VoiceStreamState<TResult>;
|
|
756
1025
|
isConnected: boolean;
|
|
757
1026
|
partial: string;
|
|
1027
|
+
reconnect: VoiceReconnectClientState;
|
|
758
1028
|
sendAudio: (audio: Uint8Array | ArrayBuffer) => void;
|
|
1029
|
+
simulateDisconnect: () => void;
|
|
759
1030
|
sessionId: string | null;
|
|
1031
|
+
sessionMetadata: Record<string, unknown> | null;
|
|
760
1032
|
scenarioId: string | null;
|
|
761
|
-
status: VoiceSessionStatus |
|
|
1033
|
+
status: VoiceSessionStatus | "idle";
|
|
762
1034
|
subscribe: (subscriber: () => void) => () => void;
|
|
763
1035
|
turns: VoiceTurnRecord<TResult>[];
|
|
764
1036
|
assistantTexts: string[];
|
|
@@ -784,7 +1056,7 @@ export type VoiceAudioPlayerState = {
|
|
|
784
1056
|
queuedChunkCount: number;
|
|
785
1057
|
};
|
|
786
1058
|
export type VoiceAudioPlayerSource = {
|
|
787
|
-
assistantAudio: VoiceStreamState[
|
|
1059
|
+
assistantAudio: VoiceStreamState["assistantAudio"];
|
|
788
1060
|
subscribe: (subscriber: () => void) => () => void;
|
|
789
1061
|
};
|
|
790
1062
|
export type VoiceAudioPlayer = {
|
|
@@ -810,6 +1082,8 @@ export type VoiceBargeInBinding = {
|
|
|
810
1082
|
};
|
|
811
1083
|
export type VoiceController<TResult = unknown> = {
|
|
812
1084
|
bindHTMX: (options: VoiceHTMXBindingOptions) => () => void;
|
|
1085
|
+
call: VoiceCallLifecycleState | null;
|
|
1086
|
+
callControl: (message: Omit<VoiceClientCallControlMessage, "type">) => void;
|
|
813
1087
|
close: () => void;
|
|
814
1088
|
endTurn: () => void;
|
|
815
1089
|
start: (input?: {
|
|
@@ -822,12 +1096,15 @@ export type VoiceController<TResult = unknown> = {
|
|
|
822
1096
|
isConnected: boolean;
|
|
823
1097
|
isRecording: boolean;
|
|
824
1098
|
partial: string;
|
|
1099
|
+
reconnect: VoiceReconnectClientState;
|
|
825
1100
|
recordingError: string | null;
|
|
826
1101
|
sendAudio: (audio: Uint8Array | ArrayBuffer) => void;
|
|
1102
|
+
simulateDisconnect: () => void;
|
|
827
1103
|
sessionId: string | null;
|
|
1104
|
+
sessionMetadata: Record<string, unknown> | null;
|
|
828
1105
|
scenarioId: string | null;
|
|
829
1106
|
startRecording: () => Promise<void>;
|
|
830
|
-
status: VoiceSessionStatus |
|
|
1107
|
+
status: VoiceSessionStatus | "idle";
|
|
831
1108
|
stopRecording: () => void;
|
|
832
1109
|
subscribe: (subscriber: () => void) => () => void;
|
|
833
1110
|
toggleRecording: () => Promise<void>;
|
|
@@ -851,36 +1128,54 @@ export type VoiceHTMXBindingOptions = {
|
|
|
851
1128
|
sessionQueryParam?: string;
|
|
852
1129
|
};
|
|
853
1130
|
export type VoiceStoreAction<TResult = unknown> = {
|
|
854
|
-
type:
|
|
1131
|
+
type: "session";
|
|
855
1132
|
sessionId: string;
|
|
1133
|
+
sessionMetadata?: Record<string, unknown>;
|
|
1134
|
+
scenarioId?: string;
|
|
1135
|
+
status: VoiceSessionStatus;
|
|
1136
|
+
} | {
|
|
1137
|
+
type: "replay";
|
|
1138
|
+
assistantTexts: string[];
|
|
1139
|
+
call?: VoiceCallLifecycleState;
|
|
1140
|
+
partial: string;
|
|
856
1141
|
scenarioId?: string;
|
|
1142
|
+
sessionId: string;
|
|
1143
|
+
sessionMetadata?: Record<string, unknown>;
|
|
857
1144
|
status: VoiceSessionStatus;
|
|
1145
|
+
turns: VoiceTurnRecord<TResult>[];
|
|
858
1146
|
} | {
|
|
859
|
-
type:
|
|
1147
|
+
type: "call_lifecycle";
|
|
1148
|
+
event: VoiceCallLifecycleEvent;
|
|
1149
|
+
sessionId: string;
|
|
1150
|
+
} | {
|
|
1151
|
+
type: "partial";
|
|
860
1152
|
transcript: Transcript;
|
|
861
1153
|
} | {
|
|
862
|
-
type:
|
|
1154
|
+
type: "final";
|
|
863
1155
|
transcript: Transcript;
|
|
864
1156
|
} | {
|
|
865
|
-
type:
|
|
1157
|
+
type: "turn";
|
|
866
1158
|
turn: VoiceTurnRecord<TResult>;
|
|
867
1159
|
} | {
|
|
868
|
-
type:
|
|
1160
|
+
type: "assistant";
|
|
869
1161
|
text: string;
|
|
870
1162
|
} | {
|
|
871
|
-
type:
|
|
1163
|
+
type: "audio";
|
|
872
1164
|
chunk: Uint8Array;
|
|
873
1165
|
format: AudioFormat;
|
|
874
1166
|
receivedAt: number;
|
|
875
1167
|
turnId?: string;
|
|
876
1168
|
} | {
|
|
877
|
-
type:
|
|
1169
|
+
type: "complete";
|
|
878
1170
|
sessionId: string;
|
|
879
1171
|
} | {
|
|
880
|
-
type:
|
|
1172
|
+
type: "error";
|
|
881
1173
|
message: string;
|
|
882
1174
|
} | {
|
|
883
|
-
type:
|
|
1175
|
+
type: "connected";
|
|
1176
|
+
} | {
|
|
1177
|
+
type: "connection";
|
|
1178
|
+
reconnect: VoiceReconnectClientState;
|
|
884
1179
|
} | {
|
|
885
|
-
type:
|
|
1180
|
+
type: "disconnected";
|
|
886
1181
|
};
|