@absolutejs/voice 0.0.22-beta.48 → 0.0.22-beta.481
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 +67 -5
- package/dist/agentSquadContract.d.ts +98 -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 +24 -4
- package/dist/angular/index.js +4147 -1164
- 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 +2 -2
- 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 +4 -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-workflow-status.service.d.ts +2 -2
- package/dist/assistant.d.ts +11 -11
- package/dist/assistantHealth.d.ts +6 -6
- package/dist/assistantMemory.d.ts +3 -3
- 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/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/campaign.d.ts +794 -0
- package/dist/campaignDialers.d.ts +111 -0
- package/dist/client/actions.d.ts +95 -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 +4 -3
- package/dist/client/controller.d.ts +1 -1
- 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 +967 -14
- package/dist/client/index.d.ts +104 -11
- package/dist/client/index.js +10215 -19
- 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 +1 -1
- 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/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/workflowStatus.d.ts +1 -1
- 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/deliveryRuntime.d.ts +158 -0
- package/dist/deliverySinkRoutes.d.ts +117 -0
- package/dist/demoReadyRoutes.d.ts +98 -0
- package/dist/diagnosticsRoutes.d.ts +2 -2
- package/dist/evalRoutes.d.ts +10 -4
- 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 +6 -6
- package/dist/handoffHealth.d.ts +5 -5
- 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 +240 -72
- package/dist/index.js +38684 -6059
- package/dist/latencySlo.d.ts +56 -0
- package/dist/liveLatency.d.ts +78 -0
- package/dist/liveOps.d.ts +190 -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/modelAdapters.d.ts +59 -7
- package/dist/monitor.d.ts +148 -0
- package/dist/multilingualProof.d.ts +77 -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 +8 -5
- 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 +6 -6
- 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 +16 -5
- package/dist/providerCapabilities.d.ts +92 -0
- package/dist/providerDecisionTraces.d.ts +130 -0
- package/dist/providerHealth.d.ts +3 -3
- 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 +4 -4
- package/dist/queue.d.ts +23 -14
- package/dist/ragTool.d.ts +47 -0
- package/dist/react/VoiceAgentSquadStatus.d.ts +5 -0
- package/dist/react/VoiceCallDebuggerLaunch.d.ts +6 -0
- package/dist/react/VoiceDeliveryRuntime.d.ts +7 -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/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/index.d.ts +47 -4
- package/dist/react/index.js +11230 -116
- 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 +4 -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 +1 -1
- 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 +4 -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 +1 -1
- 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/recordingStore.d.ts +21 -0
- package/dist/redaction.d.ts +13 -0
- package/dist/resilienceRoutes.d.ts +45 -5
- package/dist/routing.d.ts +1 -1
- package/dist/runtimeOps.d.ts +3 -3
- package/dist/s3Store.d.ts +18 -3
- package/dist/session.d.ts +1 -1
- package/dist/sessionObservability.d.ts +145 -0
- package/dist/sessionReplay.d.ts +19 -7
- 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 +4 -2
- 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/createVoiceWorkflowStatus.d.ts +1 -1
- package/dist/svelte/index.d.ts +25 -4
- package/dist/svelte/index.js +5956 -462
- 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 -13
- package/dist/testing/index.js +5168 -186
- package/dist/testing/ioProviderSimulator.d.ts +5 -5
- package/dist/testing/providerSimulator.d.ts +5 -5
- 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 +271 -80
- 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/index.d.ts +42 -4
- package/dist/vue/index.js +10642 -135
- 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 +3 -3
- 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 +5 -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 +3 -3
- package/dist/workflowContract.d.ts +8 -8
- 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[];
|
|
@@ -65,7 +70,7 @@ export type VoiceTranscriptQuality = {
|
|
|
65
70
|
fallback?: VoiceFallbackDiagnostics;
|
|
66
71
|
partialTranscriptCount: number;
|
|
67
72
|
selectedTranscriptCount: number;
|
|
68
|
-
source:
|
|
73
|
+
source: "fallback" | "primary";
|
|
69
74
|
};
|
|
70
75
|
export type VoiceTurnCorrectionDiagnostics = {
|
|
71
76
|
attempted: boolean;
|
|
@@ -83,7 +88,7 @@ export type VoiceTurnCostEstimate = {
|
|
|
83
88
|
primaryAudioMs: number;
|
|
84
89
|
totalBillableAudioMs: number;
|
|
85
90
|
};
|
|
86
|
-
export type VoiceFallbackSelectionReason =
|
|
91
|
+
export type VoiceFallbackSelectionReason = "fallback-empty" | "primary-empty" | "word-count-margin" | "confidence-margin" | "word-count-tiebreak" | "kept-primary";
|
|
87
92
|
export type VoiceFallbackDiagnostics = {
|
|
88
93
|
attempted: boolean;
|
|
89
94
|
fallbackConfidence?: number;
|
|
@@ -94,31 +99,31 @@ export type VoiceFallbackDiagnostics = {
|
|
|
94
99
|
primaryWordCount: number;
|
|
95
100
|
selected: boolean;
|
|
96
101
|
selectionReason: VoiceFallbackSelectionReason;
|
|
97
|
-
trigger:
|
|
102
|
+
trigger: "empty-turn" | "low-confidence" | "empty-or-low-confidence" | "always";
|
|
98
103
|
};
|
|
99
104
|
export type VoicePartialEvent = {
|
|
100
|
-
type:
|
|
105
|
+
type: "partial";
|
|
101
106
|
transcript: Transcript;
|
|
102
107
|
receivedAt: number;
|
|
103
108
|
};
|
|
104
109
|
export type VoiceFinalEvent = {
|
|
105
|
-
type:
|
|
110
|
+
type: "final";
|
|
106
111
|
transcript: Transcript;
|
|
107
112
|
receivedAt: number;
|
|
108
113
|
};
|
|
109
114
|
export type VoiceEndOfTurnEvent = {
|
|
110
|
-
type:
|
|
111
|
-
reason:
|
|
115
|
+
type: "endOfTurn";
|
|
116
|
+
reason: "vendor" | "silence" | "manual";
|
|
112
117
|
receivedAt: number;
|
|
113
118
|
};
|
|
114
119
|
export type VoiceErrorEvent = {
|
|
115
|
-
type:
|
|
120
|
+
type: "error";
|
|
116
121
|
error: Error;
|
|
117
122
|
recoverable: boolean;
|
|
118
123
|
code?: string;
|
|
119
124
|
};
|
|
120
125
|
export type VoiceCloseEvent = {
|
|
121
|
-
type:
|
|
126
|
+
type: "close";
|
|
122
127
|
code?: number;
|
|
123
128
|
reason?: string;
|
|
124
129
|
recoverable?: boolean;
|
|
@@ -144,11 +149,11 @@ export type STTAdapterOpenOptions = {
|
|
|
144
149
|
signal?: AbortSignal;
|
|
145
150
|
};
|
|
146
151
|
export type STTAdapter<TOptions extends STTAdapterOpenOptions = STTAdapterOpenOptions> = {
|
|
147
|
-
kind:
|
|
152
|
+
kind: "stt";
|
|
148
153
|
open: (options: TOptions) => Promise<STTAdapterSession> | STTAdapterSession;
|
|
149
154
|
};
|
|
150
155
|
export type TTSAudioEvent = {
|
|
151
|
-
type:
|
|
156
|
+
type: "audio";
|
|
152
157
|
chunk: AudioChunk;
|
|
153
158
|
format: AudioFormat;
|
|
154
159
|
receivedAt: number;
|
|
@@ -161,15 +166,19 @@ export type TTSSessionEventMap = {
|
|
|
161
166
|
export type TTSAdapterSession = {
|
|
162
167
|
on: <K extends keyof TTSSessionEventMap>(event: K, handler: (payload: TTSSessionEventMap[K]) => void | Promise<void>) => () => void;
|
|
163
168
|
send: (text: string) => Promise<void>;
|
|
169
|
+
cancel?: (reason?: string) => Promise<void>;
|
|
164
170
|
close: (reason?: string) => Promise<void>;
|
|
165
171
|
};
|
|
172
|
+
export declare const ttsAdapterSessionCanCancel: (session: TTSAdapterSession) => session is TTSAdapterSession & {
|
|
173
|
+
cancel: (reason?: string) => Promise<void>;
|
|
174
|
+
};
|
|
166
175
|
export type TTSAdapterOpenOptions = {
|
|
167
176
|
sessionId: string;
|
|
168
177
|
lexicon?: VoiceLexiconEntry[];
|
|
169
178
|
signal?: AbortSignal;
|
|
170
179
|
};
|
|
171
180
|
export type TTSAdapter<TOptions extends TTSAdapterOpenOptions = TTSAdapterOpenOptions> = {
|
|
172
|
-
kind:
|
|
181
|
+
kind: "tts";
|
|
173
182
|
open: (options: TOptions) => Promise<TTSAdapterSession> | TTSAdapterSession;
|
|
174
183
|
};
|
|
175
184
|
export type RealtimeSessionEventMap = STTSessionEventMap & {
|
|
@@ -189,10 +198,19 @@ export type RealtimeAdapterOpenOptions = {
|
|
|
189
198
|
signal?: AbortSignal;
|
|
190
199
|
};
|
|
191
200
|
export type RealtimeAdapter<TOptions extends RealtimeAdapterOpenOptions = RealtimeAdapterOpenOptions> = {
|
|
192
|
-
kind:
|
|
201
|
+
kind: "realtime";
|
|
193
202
|
open: (options: TOptions) => Promise<RealtimeAdapterSession> | RealtimeAdapterSession;
|
|
194
203
|
};
|
|
195
|
-
export type VoiceSessionStatus =
|
|
204
|
+
export type VoiceSessionStatus = "active" | "reconnecting" | "completed" | "failed";
|
|
205
|
+
export type VoiceReconnectClientStatus = "idle" | "reconnecting" | "resumed" | "exhausted";
|
|
206
|
+
export type VoiceReconnectClientState = {
|
|
207
|
+
attempts: number;
|
|
208
|
+
lastDisconnectAt?: number;
|
|
209
|
+
lastResumedAt?: number;
|
|
210
|
+
maxAttempts: number;
|
|
211
|
+
nextAttemptAt?: number;
|
|
212
|
+
status: VoiceReconnectClientStatus;
|
|
213
|
+
};
|
|
196
214
|
export type VoiceTurnRecord<TResult = unknown> = {
|
|
197
215
|
id: string;
|
|
198
216
|
text: string;
|
|
@@ -253,10 +271,10 @@ export type VoiceSessionSummary = {
|
|
|
253
271
|
status: VoiceSessionStatus;
|
|
254
272
|
turnCount: number;
|
|
255
273
|
};
|
|
256
|
-
export type VoiceCallDisposition =
|
|
274
|
+
export type VoiceCallDisposition = "completed" | "transferred" | "escalated" | "voicemail" | "no-answer" | "failed" | "silence-timeout" | "closed";
|
|
257
275
|
export type VoiceCallLifecycleEvent = {
|
|
258
276
|
at: number;
|
|
259
|
-
type:
|
|
277
|
+
type: "start" | "end" | "transfer" | "escalation" | "voicemail" | "no-answer";
|
|
260
278
|
disposition?: VoiceCallDisposition;
|
|
261
279
|
metadata?: Record<string, unknown>;
|
|
262
280
|
reason?: string;
|
|
@@ -269,8 +287,8 @@ export type VoiceCallLifecycleState = {
|
|
|
269
287
|
lastEventAt: number;
|
|
270
288
|
startedAt: number;
|
|
271
289
|
};
|
|
272
|
-
export type VoiceHandoffAction =
|
|
273
|
-
export type VoiceHandoffStatus =
|
|
290
|
+
export type VoiceHandoffAction = "escalate" | "no-answer" | "transfer" | "voicemail";
|
|
291
|
+
export type VoiceHandoffStatus = "delivered" | "failed" | "skipped";
|
|
274
292
|
export type VoiceHandoffResult = {
|
|
275
293
|
deliveredAt?: number;
|
|
276
294
|
deliveredTo?: string;
|
|
@@ -278,7 +296,7 @@ export type VoiceHandoffResult = {
|
|
|
278
296
|
metadata?: Record<string, unknown>;
|
|
279
297
|
status: VoiceHandoffStatus;
|
|
280
298
|
};
|
|
281
|
-
export type VoiceHandoffDeliveryQueueStatus = VoiceHandoffStatus |
|
|
299
|
+
export type VoiceHandoffDeliveryQueueStatus = VoiceHandoffStatus | "pending";
|
|
282
300
|
export type StoredVoiceHandoffDelivery<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = {
|
|
283
301
|
action: VoiceHandoffAction;
|
|
284
302
|
context: TContext;
|
|
@@ -326,7 +344,7 @@ export type VoiceHandoffConfig<TContext = unknown, TSession extends VoiceSession
|
|
|
326
344
|
adapters: VoiceHandoffAdapter<TContext, TSession, TResult>[];
|
|
327
345
|
deliveryQueue?: VoiceHandoffDeliveryStore<StoredVoiceHandoffDelivery<TContext, TSession, TResult>>;
|
|
328
346
|
enqueueOnly?: boolean;
|
|
329
|
-
failMode?:
|
|
347
|
+
failMode?: "record" | "throw";
|
|
330
348
|
};
|
|
331
349
|
export type VoiceSessionStore<TSession extends VoiceSessionRecord = VoiceSessionRecord> = SessionStore<TSession, VoiceSessionSummary>;
|
|
332
350
|
export type VoiceLogger = {
|
|
@@ -336,15 +354,15 @@ export type VoiceLogger = {
|
|
|
336
354
|
error?: (message: string, meta?: Record<string, unknown>) => void;
|
|
337
355
|
};
|
|
338
356
|
export type VoiceReconnectConfig = {
|
|
339
|
-
strategy?:
|
|
357
|
+
strategy?: "resume-last-turn" | "restart" | "fail";
|
|
340
358
|
timeout?: number;
|
|
341
359
|
maxAttempts?: number;
|
|
342
360
|
};
|
|
343
|
-
export type VoiceRuntimePreset =
|
|
344
|
-
export type VoiceSTTLifecycle =
|
|
345
|
-
export type VoiceTurnProfile =
|
|
346
|
-
export type VoiceTurnQualityProfile =
|
|
347
|
-
export type VoiceTurnFallbackTrigger =
|
|
361
|
+
export type VoiceRuntimePreset = "default" | "chat" | "guided-intake" | "dictation" | "noisy-room" | "pstn-balanced" | "pstn-fast" | "reliability";
|
|
362
|
+
export type VoiceSTTLifecycle = "continuous" | "turn-scoped";
|
|
363
|
+
export type VoiceTurnProfile = "fast" | "balanced" | "long-form";
|
|
364
|
+
export type VoiceTurnQualityProfile = "general" | "accent-heavy" | "noisy-room" | "short-command";
|
|
365
|
+
export type VoiceTurnFallbackTrigger = "empty-turn" | "low-confidence" | "empty-or-low-confidence" | "always";
|
|
348
366
|
export type VoiceSTTFallbackConfig = {
|
|
349
367
|
adapter: STTAdapter;
|
|
350
368
|
trigger?: VoiceTurnFallbackTrigger;
|
|
@@ -397,11 +415,25 @@ export type VoiceSocket = {
|
|
|
397
415
|
send: (data: string | Uint8Array | ArrayBuffer) => void | Promise<void>;
|
|
398
416
|
close: (code?: number, reason?: string) => void | Promise<void>;
|
|
399
417
|
};
|
|
418
|
+
export type VoiceMonitorRuntimeSessionBinding = {
|
|
419
|
+
deregister: (reason?: string) => void;
|
|
420
|
+
emitAudio: (chunk: Uint8Array | ArrayBuffer, options?: {
|
|
421
|
+
source?: "assistant" | "caller" | (string & {});
|
|
422
|
+
}) => void;
|
|
423
|
+
};
|
|
424
|
+
export type VoiceMonitorRuntimeRegisterInput = {
|
|
425
|
+
handle: VoiceSessionHandle<unknown, VoiceSessionRecord, unknown>;
|
|
426
|
+
metadata?: Record<string, unknown>;
|
|
427
|
+
sessionId: string;
|
|
428
|
+
};
|
|
429
|
+
export type VoiceMonitorRuntimeBinding = {
|
|
430
|
+
registerSession: (input: VoiceMonitorRuntimeRegisterInput) => VoiceMonitorRuntimeSessionBinding;
|
|
431
|
+
};
|
|
400
432
|
export type VoiceSessionHandle<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = {
|
|
401
433
|
id: string;
|
|
402
434
|
connect: (socket: VoiceSocket) => Promise<void>;
|
|
403
435
|
receiveAudio: (audio: AudioChunk) => Promise<void>;
|
|
404
|
-
commitTurn: (reason?: VoiceEndOfTurnEvent[
|
|
436
|
+
commitTurn: (reason?: VoiceEndOfTurnEvent["reason"]) => Promise<void>;
|
|
405
437
|
disconnect: (event?: VoiceCloseEvent) => Promise<void>;
|
|
406
438
|
complete: (result?: TResult) => Promise<void>;
|
|
407
439
|
escalate: (input: {
|
|
@@ -423,6 +455,7 @@ export type VoiceSessionHandle<TContext = unknown, TSession extends VoiceSession
|
|
|
423
455
|
reason?: string;
|
|
424
456
|
result?: TResult;
|
|
425
457
|
target: string;
|
|
458
|
+
transferMode?: "cold" | "warm";
|
|
426
459
|
}) => Promise<void>;
|
|
427
460
|
close: (reason?: string) => Promise<void>;
|
|
428
461
|
snapshot: () => Promise<TSession>;
|
|
@@ -435,6 +468,7 @@ export type VoiceRouteResult<TResult = unknown> = {
|
|
|
435
468
|
metadata?: Record<string, unknown>;
|
|
436
469
|
reason?: string;
|
|
437
470
|
target: string;
|
|
471
|
+
transferMode?: "cold" | "warm";
|
|
438
472
|
};
|
|
439
473
|
escalate?: {
|
|
440
474
|
metadata?: Record<string, unknown>;
|
|
@@ -475,6 +509,10 @@ export type VoiceLexiconResolver<TContext = unknown> = (input: {
|
|
|
475
509
|
}) => Promise<VoiceLexiconEntry[] | void> | VoiceLexiconEntry[] | void;
|
|
476
510
|
export type VoiceOnTurnObjectHandler<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = (input: {
|
|
477
511
|
context: TContext;
|
|
512
|
+
liveOps?: {
|
|
513
|
+
control: VoiceLiveOpsControlState;
|
|
514
|
+
injectedInstruction?: string;
|
|
515
|
+
};
|
|
478
516
|
session: TSession;
|
|
479
517
|
turn: VoiceTurnRecord;
|
|
480
518
|
api: VoiceSessionHandle<TContext, TSession, TResult>;
|
|
@@ -559,7 +597,7 @@ export type VoiceRuntimeOpsConfig<TContext = unknown, TSession extends VoiceSess
|
|
|
559
597
|
disposition: VoiceCallDisposition;
|
|
560
598
|
review: StoredVoiceCallReviewArtifact;
|
|
561
599
|
session: TSession;
|
|
562
|
-
}) => Promise<Omit<VoiceOpsTask,
|
|
600
|
+
}) => Promise<Omit<VoiceOpsTask, "id"> | VoiceOpsTask | StoredVoiceOpsTask | null | void> | Omit<VoiceOpsTask, "id"> | VoiceOpsTask | StoredVoiceOpsTask | null | void;
|
|
563
601
|
resolveTaskPolicy?: (input: {
|
|
564
602
|
api: VoiceSessionHandle<TContext, TSession, TResult>;
|
|
565
603
|
context: TContext;
|
|
@@ -596,7 +634,37 @@ export type VoiceRuntimeOpsConfig<TContext = unknown, TSession extends VoiceSess
|
|
|
596
634
|
tasks?: VoiceOpsTaskStore;
|
|
597
635
|
webhook?: VoiceIntegrationWebhookConfig;
|
|
598
636
|
};
|
|
599
|
-
export type
|
|
637
|
+
export type VoiceLiveOpsRuntimeConfig = {
|
|
638
|
+
getControl: (sessionId: string) => Promise<VoiceLiveOpsControlState | null | undefined> | VoiceLiveOpsControlState | null | undefined;
|
|
639
|
+
};
|
|
640
|
+
export type VoiceProfileSwitchGuardResolverInput<TContext = unknown> = {
|
|
641
|
+
context: TContext;
|
|
642
|
+
scenarioId?: string;
|
|
643
|
+
sessionId: string;
|
|
644
|
+
};
|
|
645
|
+
export type VoicePluginProfileSwitchGuardConfig<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = {
|
|
646
|
+
actor?: VoiceAuditActor;
|
|
647
|
+
allowedProfileIds?: string[] | ((input: VoiceProfileSwitchGuardResolverInput<TContext>) => Promise<string[] | undefined> | string[] | undefined);
|
|
648
|
+
audit?: VoiceAuditEventStore;
|
|
649
|
+
blockedProfileIds?: string[] | ((input: VoiceProfileSwitchGuardResolverInput<TContext>) => Promise<string[] | undefined> | string[] | undefined);
|
|
650
|
+
currentProfileId?: string | ((input: VoiceProfileSwitchGuardResolverInput<TContext>) => Promise<string | undefined> | string | undefined);
|
|
651
|
+
defaultProfileId?: string;
|
|
652
|
+
defaults: VoiceRealCallProfileDefaultsReport | VoiceRealCallProfileHistoryReport | ((input: VoiceProfileSwitchGuardResolverInput<TContext>) => Promise<VoiceRealCallProfileDefaultsReport | VoiceRealCallProfileHistoryReport> | VoiceRealCallProfileDefaultsReport | VoiceRealCallProfileHistoryReport);
|
|
653
|
+
metadata?: Record<string, unknown> | ((input: VoiceProfileSwitchGuardResolverInput<TContext>) => Promise<Record<string, unknown> | undefined> | Record<string, unknown> | undefined);
|
|
654
|
+
minConfidence?: number | ((input: VoiceProfileSwitchGuardResolverInput<TContext>) => Promise<number | undefined> | number | undefined);
|
|
655
|
+
maxAutoSwitchesPerSession?: number | ((input: VoiceProfileSwitchGuardResolverInput<TContext>) => Promise<number | undefined> | number | undefined);
|
|
656
|
+
mode?: VoiceProfileSwitchGuardMode | ((input: VoiceProfileSwitchGuardResolverInput<TContext>) => Promise<VoiceProfileSwitchGuardMode | undefined> | VoiceProfileSwitchGuardMode | undefined);
|
|
657
|
+
observed?: VoiceProfileSwitchObservedSignals | ((input: VoiceProfileSwitchGuardResolverInput<TContext>) => Promise<VoiceProfileSwitchObservedSignals | undefined> | VoiceProfileSwitchObservedSignals | undefined);
|
|
658
|
+
onDecision?: (input: {
|
|
659
|
+
context: TContext;
|
|
660
|
+
decision: VoiceProfileSwitchGuardDecision;
|
|
661
|
+
scenarioId?: string;
|
|
662
|
+
sessionId: string;
|
|
663
|
+
}) => Promise<void> | void;
|
|
664
|
+
sessionMetadataKey?: string | false;
|
|
665
|
+
trace?: false | VoiceTraceEventStore;
|
|
666
|
+
};
|
|
667
|
+
export type VoiceNormalizedRouteConfig<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = Omit<VoiceRouteConfig<TContext, TSession, TResult>, "onTurn"> & {
|
|
600
668
|
onTurn: VoiceOnTurnObjectHandler<TContext, TSession, TResult>;
|
|
601
669
|
};
|
|
602
670
|
export type VoiceScenario = {
|
|
@@ -616,9 +684,11 @@ export type VoicePluginConfig<TContext = unknown, TSession extends VoiceSessionR
|
|
|
616
684
|
lexicon?: VoiceLexiconEntry[] | VoiceLexiconResolver<TContext>;
|
|
617
685
|
phraseHints?: VoicePhraseHint[] | VoicePhraseHintResolver<TContext>;
|
|
618
686
|
preset?: VoiceRuntimePreset;
|
|
619
|
-
stt
|
|
687
|
+
stt?: STTAdapter;
|
|
620
688
|
sttFallback?: VoiceSTTFallbackConfig;
|
|
621
689
|
sttLifecycle?: VoiceSTTLifecycle;
|
|
690
|
+
realtime?: RealtimeAdapter;
|
|
691
|
+
realtimeInputFormat?: AudioFormat;
|
|
622
692
|
tts?: TTSAdapter;
|
|
623
693
|
session: VoiceSessionStore<NoInfer<TSession>>;
|
|
624
694
|
reconnect?: VoiceReconnectConfig;
|
|
@@ -628,112 +698,171 @@ export type VoicePluginConfig<TContext = unknown, TSession extends VoiceSessionR
|
|
|
628
698
|
htmx?: boolean | VoiceHTMXConfig<TSession, NoInfer<TResult>>;
|
|
629
699
|
handoff?: VoiceHandoffConfig<TContext, TSession, TResult>;
|
|
630
700
|
ops?: VoiceRuntimeOpsConfig<TContext, TSession, TResult>;
|
|
701
|
+
liveOps?: VoiceLiveOpsRuntimeConfig;
|
|
702
|
+
monitor?: VoiceMonitorRuntimeBinding;
|
|
703
|
+
profileSwitchGuard?: VoicePluginProfileSwitchGuardConfig<TContext, TSession, TResult>;
|
|
631
704
|
trace?: VoiceTraceEventStore;
|
|
632
705
|
} & VoiceRouteConfig<TContext, TSession, TResult>;
|
|
706
|
+
export type VoiceSessionRecordingConfig = {
|
|
707
|
+
channels?: ReadonlyArray<"assistant" | "user">;
|
|
708
|
+
maxBytesPerChannel?: number;
|
|
709
|
+
store: import("./recordingStore").VoiceRecordingStore;
|
|
710
|
+
userInputFormat?: AudioFormat;
|
|
711
|
+
};
|
|
633
712
|
export type CreateVoiceSessionOptions<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = {
|
|
634
713
|
costTelemetry?: VoiceCostTelemetryConfig<TContext, TSession, TResult>;
|
|
635
714
|
id: string;
|
|
636
715
|
context: TContext;
|
|
637
716
|
socket: VoiceSocket;
|
|
638
|
-
stt
|
|
717
|
+
stt?: STTAdapter;
|
|
718
|
+
realtime?: RealtimeAdapter;
|
|
719
|
+
realtimeInputFormat?: AudioFormat;
|
|
639
720
|
tts?: TTSAdapter;
|
|
640
721
|
languageStrategy?: VoiceLanguageStrategy;
|
|
641
722
|
lexicon?: VoiceLexiconEntry[];
|
|
642
723
|
sttFallback?: VoiceResolvedSTTFallbackConfig;
|
|
643
724
|
store: VoiceSessionStore<TSession>;
|
|
644
725
|
trace?: VoiceTraceEventStore;
|
|
726
|
+
recording?: VoiceSessionRecordingConfig;
|
|
727
|
+
callSilenceTimeoutMs?: number;
|
|
728
|
+
amd?: import("./amdDetector").VoiceAMDDetector<TContext, TSession, TResult>;
|
|
729
|
+
costAccountant?: import("./costAccounting").VoiceCostAccountant;
|
|
730
|
+
costTelephony?: {
|
|
731
|
+
provider?: string;
|
|
732
|
+
};
|
|
733
|
+
redact?: import("./redaction").VoiceTranscriptRedactor;
|
|
645
734
|
reconnect: Required<VoiceReconnectConfig>;
|
|
646
735
|
phraseHints?: VoicePhraseHint[];
|
|
736
|
+
sessionMetadata?: Record<string, unknown>;
|
|
647
737
|
scenarioId?: string;
|
|
648
738
|
sttLifecycle: VoiceSTTLifecycle;
|
|
649
739
|
turnDetection: VoiceResolvedTurnDetectionConfig;
|
|
650
740
|
audioConditioning?: VoiceResolvedAudioConditioningConfig;
|
|
651
741
|
handoff?: VoiceHandoffConfig<TContext, TSession, TResult>;
|
|
742
|
+
liveOps?: VoiceLiveOpsRuntimeConfig;
|
|
652
743
|
route: VoiceNormalizedRouteConfig<TContext, TSession, TResult>;
|
|
653
744
|
logger?: VoiceLogger;
|
|
654
745
|
};
|
|
655
746
|
export type CreateVoiceSession = <TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown>(options: CreateVoiceSessionOptions<TContext, TSession, TResult>) => VoiceSessionHandle<TContext, TSession, TResult>;
|
|
656
747
|
export type VoiceClientStartMessage = {
|
|
657
|
-
type:
|
|
748
|
+
type: "start";
|
|
658
749
|
sessionId?: string;
|
|
659
750
|
scenarioId?: string;
|
|
660
751
|
};
|
|
661
752
|
export type VoiceClientEndTurnMessage = {
|
|
662
|
-
type:
|
|
753
|
+
type: "end_turn";
|
|
663
754
|
};
|
|
664
755
|
export type VoiceClientCloseMessage = {
|
|
665
|
-
type:
|
|
756
|
+
type: "close";
|
|
666
757
|
reason?: string;
|
|
667
758
|
};
|
|
668
759
|
export type VoiceClientCallControlMessage = {
|
|
669
|
-
type:
|
|
670
|
-
action:
|
|
760
|
+
type: "call_control";
|
|
761
|
+
action: "complete" | "escalate" | "no-answer" | "transfer" | "voicemail";
|
|
671
762
|
metadata?: Record<string, unknown>;
|
|
672
763
|
reason?: string;
|
|
673
764
|
target?: string;
|
|
674
765
|
};
|
|
675
766
|
export type VoiceClientPingMessage = {
|
|
676
|
-
type:
|
|
767
|
+
type: "ping";
|
|
677
768
|
};
|
|
678
769
|
export type VoiceClientMessage = VoiceClientStartMessage | VoiceClientEndTurnMessage | VoiceClientCloseMessage | VoiceClientCallControlMessage | VoiceClientPingMessage;
|
|
679
770
|
export type VoiceServerSessionMessage = {
|
|
680
|
-
type:
|
|
771
|
+
type: "session";
|
|
681
772
|
sessionId: string;
|
|
682
773
|
status: VoiceSessionStatus;
|
|
683
774
|
scenarioId?: string;
|
|
775
|
+
sessionMetadata?: Record<string, unknown>;
|
|
776
|
+
};
|
|
777
|
+
export type VoiceServerReplayMessage<TResult = unknown> = {
|
|
778
|
+
type: "replay";
|
|
779
|
+
assistantTexts: string[];
|
|
780
|
+
call?: VoiceCallLifecycleState;
|
|
781
|
+
partial: string;
|
|
782
|
+
scenarioId?: string;
|
|
783
|
+
sessionId: string;
|
|
784
|
+
sessionMetadata?: Record<string, unknown>;
|
|
785
|
+
status: VoiceSessionStatus;
|
|
786
|
+
turns: VoiceTurnRecord<TResult>[];
|
|
684
787
|
};
|
|
685
788
|
export type VoiceServerPartialMessage = {
|
|
686
|
-
type:
|
|
789
|
+
type: "partial";
|
|
687
790
|
transcript: Transcript;
|
|
688
791
|
};
|
|
689
792
|
export type VoiceServerFinalMessage = {
|
|
690
|
-
type:
|
|
793
|
+
type: "final";
|
|
691
794
|
transcript: Transcript;
|
|
692
795
|
};
|
|
693
796
|
export type VoiceServerTurnMessage<TResult = unknown> = {
|
|
694
|
-
type:
|
|
797
|
+
type: "turn";
|
|
695
798
|
turn: VoiceTurnRecord<TResult>;
|
|
696
799
|
};
|
|
697
800
|
export type VoiceServerAssistantMessage = {
|
|
698
|
-
type:
|
|
801
|
+
type: "assistant";
|
|
699
802
|
text: string;
|
|
700
803
|
turnId?: string;
|
|
701
804
|
};
|
|
702
805
|
export type VoiceServerAudioMessage = {
|
|
703
|
-
type:
|
|
806
|
+
type: "audio";
|
|
704
807
|
chunkBase64: string;
|
|
705
808
|
format: AudioFormat;
|
|
706
809
|
receivedAt: number;
|
|
707
810
|
turnId?: string;
|
|
708
811
|
};
|
|
709
812
|
export type VoiceServerCompleteMessage = {
|
|
710
|
-
type:
|
|
813
|
+
type: "complete";
|
|
711
814
|
sessionId: string;
|
|
712
815
|
};
|
|
713
816
|
export type VoiceServerCallLifecycleMessage = {
|
|
714
|
-
type:
|
|
817
|
+
type: "call_lifecycle";
|
|
715
818
|
event: VoiceCallLifecycleEvent;
|
|
716
819
|
sessionId: string;
|
|
717
820
|
};
|
|
718
821
|
export type VoiceServerErrorMessage = {
|
|
719
|
-
type:
|
|
822
|
+
type: "error";
|
|
720
823
|
message: string;
|
|
721
824
|
recoverable?: boolean;
|
|
722
825
|
};
|
|
723
826
|
export type VoiceServerPongMessage = {
|
|
724
|
-
type:
|
|
827
|
+
type: "pong";
|
|
725
828
|
};
|
|
726
|
-
export type
|
|
829
|
+
export type VoiceServerConnectionMessage = {
|
|
830
|
+
type: "connection";
|
|
831
|
+
reconnect: VoiceReconnectClientState;
|
|
832
|
+
};
|
|
833
|
+
export type VoiceServerMessage<TResult = unknown> = VoiceServerSessionMessage | VoiceServerReplayMessage<TResult> | VoiceServerPartialMessage | VoiceServerFinalMessage | VoiceServerTurnMessage<TResult> | VoiceServerAssistantMessage | VoiceServerAudioMessage | VoiceServerCallLifecycleMessage | VoiceServerCompleteMessage | VoiceServerErrorMessage | VoiceServerPongMessage | VoiceServerConnectionMessage;
|
|
727
834
|
export type VoiceConnectionOptions = {
|
|
835
|
+
browserMedia?: false | VoiceBrowserMediaReporterOptions;
|
|
728
836
|
protocols?: string[];
|
|
729
837
|
scenarioId?: string;
|
|
730
838
|
reconnect?: boolean;
|
|
839
|
+
reconnectReportPath?: string;
|
|
731
840
|
maxReconnectAttempts?: number;
|
|
732
841
|
pingInterval?: number;
|
|
733
842
|
sessionId?: string;
|
|
734
843
|
};
|
|
844
|
+
export type VoiceBrowserMediaReportPayload = {
|
|
845
|
+
at: number;
|
|
846
|
+
continuity?: MediaWebRTCStreamContinuityReport;
|
|
847
|
+
report: MediaWebRTCStatsReport;
|
|
848
|
+
scenarioId?: string | null;
|
|
849
|
+
sessionId?: string | null;
|
|
850
|
+
};
|
|
851
|
+
export type VoiceBrowserMediaReporterOptions = Omit<MediaWebRTCStatsReportInput, "peerConnection"> & {
|
|
852
|
+
fetch?: typeof fetch;
|
|
853
|
+
getPeerConnection?: (() => MediaWebRTCStatsCollector | null | undefined) | (() => Promise<MediaWebRTCStatsCollector | null | undefined>);
|
|
854
|
+
getScenarioId?: () => string | null | undefined;
|
|
855
|
+
getSessionId?: () => string | null | undefined;
|
|
856
|
+
intervalMs?: number;
|
|
857
|
+
continuity?: false | Omit<MediaWebRTCStreamContinuityInput, "previousStats" | "stats">;
|
|
858
|
+
onError?: (error: unknown) => void;
|
|
859
|
+
onReport?: (payload: VoiceBrowserMediaReportPayload) => void;
|
|
860
|
+
path?: string;
|
|
861
|
+
peerConnection?: MediaWebRTCStatsCollector;
|
|
862
|
+
};
|
|
735
863
|
export type VoiceCaptureOptions = {
|
|
736
864
|
channelCount?: 1 | 2;
|
|
865
|
+
onAudio?: (audio: Uint8Array | ArrayBuffer, sendAudio: (audio: Uint8Array | ArrayBuffer) => void) => void;
|
|
737
866
|
onLevel?: (level: number) => void;
|
|
738
867
|
sampleRateHz?: number;
|
|
739
868
|
};
|
|
@@ -747,6 +876,46 @@ export type VoiceBargeInOptions = {
|
|
|
747
876
|
enabled?: boolean;
|
|
748
877
|
interruptOnPartial?: boolean;
|
|
749
878
|
interruptThreshold?: number;
|
|
879
|
+
monitor?: VoiceBargeInMonitor;
|
|
880
|
+
};
|
|
881
|
+
export type VoiceBargeInTriggerReason = "input-level" | "manual-audio" | "manual-interrupt" | "partial-transcript";
|
|
882
|
+
export type VoiceBargeInMonitorEvent = {
|
|
883
|
+
at: number;
|
|
884
|
+
id: string;
|
|
885
|
+
latencyMs?: number;
|
|
886
|
+
playbackStopLatencyMs?: number;
|
|
887
|
+
reason: VoiceBargeInTriggerReason;
|
|
888
|
+
sessionId?: string | null;
|
|
889
|
+
status: "requested" | "stopped" | "skipped";
|
|
890
|
+
thresholdMs?: number;
|
|
891
|
+
};
|
|
892
|
+
export type VoiceBargeInMonitorSnapshot = {
|
|
893
|
+
averageLatencyMs?: number;
|
|
894
|
+
events: VoiceBargeInMonitorEvent[];
|
|
895
|
+
failed: number;
|
|
896
|
+
lastEvent?: VoiceBargeInMonitorEvent;
|
|
897
|
+
passed: number;
|
|
898
|
+
status: "empty" | "fail" | "pass" | "warn";
|
|
899
|
+
thresholdMs: number;
|
|
900
|
+
total: number;
|
|
901
|
+
};
|
|
902
|
+
export type VoiceBargeInMonitor = {
|
|
903
|
+
getSnapshot: () => VoiceBargeInMonitorSnapshot;
|
|
904
|
+
recordRequested: (input: {
|
|
905
|
+
reason: VoiceBargeInTriggerReason;
|
|
906
|
+
sessionId?: string | null;
|
|
907
|
+
}) => VoiceBargeInMonitorEvent;
|
|
908
|
+
recordSkipped: (input: {
|
|
909
|
+
reason: VoiceBargeInTriggerReason;
|
|
910
|
+
sessionId?: string | null;
|
|
911
|
+
}) => VoiceBargeInMonitorEvent;
|
|
912
|
+
recordStopped: (input: {
|
|
913
|
+
latencyMs?: number;
|
|
914
|
+
playbackStopLatencyMs?: number;
|
|
915
|
+
reason: VoiceBargeInTriggerReason;
|
|
916
|
+
sessionId?: string | null;
|
|
917
|
+
}) => VoiceBargeInMonitorEvent;
|
|
918
|
+
subscribe: (subscriber: () => void) => () => void;
|
|
750
919
|
};
|
|
751
920
|
export type VoiceAudioPlayerOptions = {
|
|
752
921
|
autoStart?: boolean;
|
|
@@ -757,10 +926,10 @@ export type VoiceDuplexControllerOptions = VoiceControllerOptions & {
|
|
|
757
926
|
audioPlayer?: VoiceAudioPlayerOptions;
|
|
758
927
|
bargeIn?: VoiceBargeInOptions;
|
|
759
928
|
};
|
|
760
|
-
export type VoiceSTTRoutingGoal =
|
|
761
|
-
export type VoiceSTTRoutingCorrectionMode =
|
|
929
|
+
export type VoiceSTTRoutingGoal = "best" | "low-cost";
|
|
930
|
+
export type VoiceSTTRoutingCorrectionMode = "generic" | "none" | "risky-turn";
|
|
762
931
|
export type VoiceSTTRoutingStrategy = {
|
|
763
|
-
benchmarkSessionTarget:
|
|
932
|
+
benchmarkSessionTarget: "deepgram-corrected" | "deepgram-flux";
|
|
764
933
|
correctionMode: VoiceSTTRoutingCorrectionMode;
|
|
765
934
|
goal: VoiceSTTRoutingGoal;
|
|
766
935
|
notes: string[];
|
|
@@ -774,7 +943,7 @@ export type VoiceHTMXRenderInput<TResult = unknown, TSession extends VoiceSessio
|
|
|
774
943
|
result?: TResult;
|
|
775
944
|
session?: TSession;
|
|
776
945
|
sessionId?: string;
|
|
777
|
-
status: VoiceSessionStatus |
|
|
946
|
+
status: VoiceSessionStatus | "idle";
|
|
778
947
|
turnCount: number;
|
|
779
948
|
turns: VoiceTurnRecord<TResult>[];
|
|
780
949
|
};
|
|
@@ -802,9 +971,11 @@ export type VoiceHTMXOptions<TSession extends VoiceSessionRecord = VoiceSessionR
|
|
|
802
971
|
export type VoiceHTMXConfig<TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = VoiceHTMXRenderer<TSession, TResult> | VoiceHTMXOptions<TSession, TResult>;
|
|
803
972
|
export type VoiceStreamState<TResult = unknown> = {
|
|
804
973
|
call: VoiceCallLifecycleState | null;
|
|
974
|
+
sessionMetadata: Record<string, unknown> | null;
|
|
805
975
|
sessionId: string | null;
|
|
806
976
|
scenarioId: string | null;
|
|
807
|
-
status: VoiceSessionStatus |
|
|
977
|
+
status: VoiceSessionStatus | "idle";
|
|
978
|
+
reconnect: VoiceReconnectClientState;
|
|
808
979
|
partial: string;
|
|
809
980
|
turns: VoiceTurnRecord<TResult>[];
|
|
810
981
|
assistantTexts: string[];
|
|
@@ -819,7 +990,7 @@ export type VoiceStreamState<TResult = unknown> = {
|
|
|
819
990
|
};
|
|
820
991
|
export type VoiceStream<TResult = unknown> = {
|
|
821
992
|
call: VoiceCallLifecycleState | null;
|
|
822
|
-
callControl: (message: Omit<VoiceClientCallControlMessage,
|
|
993
|
+
callControl: (message: Omit<VoiceClientCallControlMessage, "type">) => void;
|
|
823
994
|
close: () => void;
|
|
824
995
|
start: (input?: {
|
|
825
996
|
scenarioId?: string;
|
|
@@ -831,10 +1002,13 @@ export type VoiceStream<TResult = unknown> = {
|
|
|
831
1002
|
getSnapshot: () => VoiceStreamState<TResult>;
|
|
832
1003
|
isConnected: boolean;
|
|
833
1004
|
partial: string;
|
|
1005
|
+
reconnect: VoiceReconnectClientState;
|
|
834
1006
|
sendAudio: (audio: Uint8Array | ArrayBuffer) => void;
|
|
1007
|
+
simulateDisconnect: () => void;
|
|
835
1008
|
sessionId: string | null;
|
|
1009
|
+
sessionMetadata: Record<string, unknown> | null;
|
|
836
1010
|
scenarioId: string | null;
|
|
837
|
-
status: VoiceSessionStatus |
|
|
1011
|
+
status: VoiceSessionStatus | "idle";
|
|
838
1012
|
subscribe: (subscriber: () => void) => () => void;
|
|
839
1013
|
turns: VoiceTurnRecord<TResult>[];
|
|
840
1014
|
assistantTexts: string[];
|
|
@@ -860,7 +1034,7 @@ export type VoiceAudioPlayerState = {
|
|
|
860
1034
|
queuedChunkCount: number;
|
|
861
1035
|
};
|
|
862
1036
|
export type VoiceAudioPlayerSource = {
|
|
863
|
-
assistantAudio: VoiceStreamState[
|
|
1037
|
+
assistantAudio: VoiceStreamState["assistantAudio"];
|
|
864
1038
|
subscribe: (subscriber: () => void) => () => void;
|
|
865
1039
|
};
|
|
866
1040
|
export type VoiceAudioPlayer = {
|
|
@@ -887,7 +1061,7 @@ export type VoiceBargeInBinding = {
|
|
|
887
1061
|
export type VoiceController<TResult = unknown> = {
|
|
888
1062
|
bindHTMX: (options: VoiceHTMXBindingOptions) => () => void;
|
|
889
1063
|
call: VoiceCallLifecycleState | null;
|
|
890
|
-
callControl: (message: Omit<VoiceClientCallControlMessage,
|
|
1064
|
+
callControl: (message: Omit<VoiceClientCallControlMessage, "type">) => void;
|
|
891
1065
|
close: () => void;
|
|
892
1066
|
endTurn: () => void;
|
|
893
1067
|
start: (input?: {
|
|
@@ -900,12 +1074,15 @@ export type VoiceController<TResult = unknown> = {
|
|
|
900
1074
|
isConnected: boolean;
|
|
901
1075
|
isRecording: boolean;
|
|
902
1076
|
partial: string;
|
|
1077
|
+
reconnect: VoiceReconnectClientState;
|
|
903
1078
|
recordingError: string | null;
|
|
904
1079
|
sendAudio: (audio: Uint8Array | ArrayBuffer) => void;
|
|
1080
|
+
simulateDisconnect: () => void;
|
|
905
1081
|
sessionId: string | null;
|
|
1082
|
+
sessionMetadata: Record<string, unknown> | null;
|
|
906
1083
|
scenarioId: string | null;
|
|
907
1084
|
startRecording: () => Promise<void>;
|
|
908
|
-
status: VoiceSessionStatus |
|
|
1085
|
+
status: VoiceSessionStatus | "idle";
|
|
909
1086
|
stopRecording: () => void;
|
|
910
1087
|
subscribe: (subscriber: () => void) => () => void;
|
|
911
1088
|
toggleRecording: () => Promise<void>;
|
|
@@ -929,40 +1106,54 @@ export type VoiceHTMXBindingOptions = {
|
|
|
929
1106
|
sessionQueryParam?: string;
|
|
930
1107
|
};
|
|
931
1108
|
export type VoiceStoreAction<TResult = unknown> = {
|
|
932
|
-
type:
|
|
1109
|
+
type: "session";
|
|
933
1110
|
sessionId: string;
|
|
1111
|
+
sessionMetadata?: Record<string, unknown>;
|
|
934
1112
|
scenarioId?: string;
|
|
935
1113
|
status: VoiceSessionStatus;
|
|
936
1114
|
} | {
|
|
937
|
-
type:
|
|
1115
|
+
type: "replay";
|
|
1116
|
+
assistantTexts: string[];
|
|
1117
|
+
call?: VoiceCallLifecycleState;
|
|
1118
|
+
partial: string;
|
|
1119
|
+
scenarioId?: string;
|
|
1120
|
+
sessionId: string;
|
|
1121
|
+
sessionMetadata?: Record<string, unknown>;
|
|
1122
|
+
status: VoiceSessionStatus;
|
|
1123
|
+
turns: VoiceTurnRecord<TResult>[];
|
|
1124
|
+
} | {
|
|
1125
|
+
type: "call_lifecycle";
|
|
938
1126
|
event: VoiceCallLifecycleEvent;
|
|
939
1127
|
sessionId: string;
|
|
940
1128
|
} | {
|
|
941
|
-
type:
|
|
1129
|
+
type: "partial";
|
|
942
1130
|
transcript: Transcript;
|
|
943
1131
|
} | {
|
|
944
|
-
type:
|
|
1132
|
+
type: "final";
|
|
945
1133
|
transcript: Transcript;
|
|
946
1134
|
} | {
|
|
947
|
-
type:
|
|
1135
|
+
type: "turn";
|
|
948
1136
|
turn: VoiceTurnRecord<TResult>;
|
|
949
1137
|
} | {
|
|
950
|
-
type:
|
|
1138
|
+
type: "assistant";
|
|
951
1139
|
text: string;
|
|
952
1140
|
} | {
|
|
953
|
-
type:
|
|
1141
|
+
type: "audio";
|
|
954
1142
|
chunk: Uint8Array;
|
|
955
1143
|
format: AudioFormat;
|
|
956
1144
|
receivedAt: number;
|
|
957
1145
|
turnId?: string;
|
|
958
1146
|
} | {
|
|
959
|
-
type:
|
|
1147
|
+
type: "complete";
|
|
960
1148
|
sessionId: string;
|
|
961
1149
|
} | {
|
|
962
|
-
type:
|
|
1150
|
+
type: "error";
|
|
963
1151
|
message: string;
|
|
964
1152
|
} | {
|
|
965
|
-
type:
|
|
1153
|
+
type: "connected";
|
|
1154
|
+
} | {
|
|
1155
|
+
type: "connection";
|
|
1156
|
+
reconnect: VoiceReconnectClientState;
|
|
966
1157
|
} | {
|
|
967
|
-
type:
|
|
1158
|
+
type: "disconnected";
|
|
968
1159
|
};
|