@absolutejs/voice 0.0.22-beta.57 → 0.0.22-beta.571

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.
Files changed (496) hide show
  1. package/LICENSE +88 -0
  2. package/README.md +4543 -1181
  3. package/dist/angular/index.d.ts +36 -5
  4. package/dist/angular/index.js +4220 -391
  5. package/dist/angular/voice-agent-squad-status.service.d.ts +12 -0
  6. package/dist/angular/voice-call-debugger.service.d.ts +12 -0
  7. package/dist/angular/voice-call-player.service.d.ts +19 -0
  8. package/dist/angular/voice-campaign-dialer-proof.service.d.ts +14 -0
  9. package/dist/angular/voice-controller.service.d.ts +4 -1
  10. package/dist/angular/voice-cost-dashboard.service.d.ts +15 -0
  11. package/dist/angular/voice-delivery-runtime.service.d.ts +16 -0
  12. package/dist/angular/voice-live-agent-console.service.d.ts +16 -0
  13. package/dist/angular/voice-live-call-viewer.service.d.ts +16 -0
  14. package/dist/angular/voice-live-ops.service.d.ts +11 -0
  15. package/dist/angular/voice-ops-action-center.service.d.ts +13 -0
  16. package/dist/angular/voice-ops-status.service.d.ts +12 -0
  17. package/dist/angular/voice-platform-coverage.service.d.ts +12 -0
  18. package/dist/angular/voice-profile-comparison.service.d.ts +12 -0
  19. package/dist/angular/voice-proof-trends.service.d.ts +12 -0
  20. package/dist/angular/voice-provider-capabilities.service.d.ts +12 -0
  21. package/dist/angular/voice-provider-contracts.service.d.ts +12 -0
  22. package/dist/angular/voice-provider-status.service.d.ts +2 -2
  23. package/dist/angular/voice-readiness-failures.service.d.ts +13 -0
  24. package/dist/angular/voice-reconnect-profile-evidence.service.d.ts +12 -0
  25. package/dist/angular/voice-replay-timeline.service.d.ts +13 -0
  26. package/dist/angular/voice-routing-status.service.d.ts +11 -0
  27. package/dist/angular/voice-session-observability.service.d.ts +12 -0
  28. package/dist/angular/voice-session-snapshot.service.d.ts +13 -0
  29. package/dist/angular/voice-stream.service.d.ts +5 -1
  30. package/dist/angular/voice-trace-timeline.service.d.ts +12 -0
  31. package/dist/angular/voice-turn-latency.service.d.ts +13 -0
  32. package/dist/angular/voice-turn-quality.service.d.ts +12 -0
  33. package/dist/angular/voice-widget.service.d.ts +18 -0
  34. package/dist/angular/voice-workflow-status.service.d.ts +2 -2
  35. package/dist/client/actions.d.ts +128 -2
  36. package/dist/client/agentSquadStatus.d.ts +37 -0
  37. package/dist/client/agentSquadStatusWidget.d.ts +24 -0
  38. package/dist/client/audioPlayer.d.ts +2 -2
  39. package/dist/client/bargeInMonitor.d.ts +7 -0
  40. package/dist/client/browserMedia.d.ts +8 -0
  41. package/dist/client/browserNoiseSuppression.d.ts +42 -0
  42. package/dist/client/browserVoiceSupport.d.ts +22 -0
  43. package/dist/client/callDebugger.d.ts +21 -0
  44. package/dist/client/callDebuggerWidget.d.ts +30 -0
  45. package/dist/client/callPlayer.d.ts +41 -0
  46. package/dist/client/campaignDialerProof.d.ts +25 -0
  47. package/dist/client/connection.d.ts +4 -3
  48. package/dist/client/controller.d.ts +1 -1
  49. package/dist/client/conversationAnalytics.d.ts +30 -0
  50. package/dist/client/costDashboard.d.ts +27 -0
  51. package/dist/client/createVoiceStream.d.ts +1 -1
  52. package/dist/client/deliveryRuntime.d.ts +36 -0
  53. package/dist/client/deliveryRuntimeWidget.d.ts +37 -0
  54. package/dist/client/duplex.d.ts +2 -2
  55. package/dist/client/htmx.d.ts +1 -1
  56. package/dist/client/htmxAttributes.d.ts +24 -0
  57. package/dist/client/htmxBootstrap.js +1068 -73
  58. package/dist/client/htmxDashboardRenderers.d.ts +71 -0
  59. package/dist/client/index.d.ts +106 -15
  60. package/dist/client/index.js +10548 -268
  61. package/dist/client/liveAgentConsole.d.ts +28 -0
  62. package/dist/client/liveCallViewer.d.ts +42 -0
  63. package/dist/client/liveOps.d.ts +22 -0
  64. package/dist/client/liveOpsWidget.d.ts +23 -0
  65. package/dist/client/liveTurnLatency.d.ts +41 -0
  66. package/dist/client/microphone.d.ts +4 -4
  67. package/dist/client/opsActionCenter.d.ts +56 -0
  68. package/dist/client/opsActionCenterWidget.d.ts +29 -0
  69. package/dist/client/opsActionHistory.d.ts +21 -0
  70. package/dist/client/opsActionHistoryWidget.d.ts +11 -0
  71. package/dist/client/opsStatus.d.ts +21 -0
  72. package/dist/client/opsStatusWidget.d.ts +10 -10
  73. package/dist/client/platformCoverage.d.ts +21 -0
  74. package/dist/client/platformCoverageWidget.d.ts +38 -0
  75. package/dist/client/profileComparison.d.ts +21 -0
  76. package/dist/client/profileComparisonWidget.d.ts +41 -0
  77. package/dist/client/profileSwitchRecommendation.d.ts +21 -0
  78. package/dist/client/profileSwitchRecommendationWidget.d.ts +12 -0
  79. package/dist/client/proofTrends.d.ts +21 -0
  80. package/dist/client/proofTrendsWidget.d.ts +38 -0
  81. package/dist/client/providerCapabilities.d.ts +21 -0
  82. package/dist/client/providerCapabilitiesWidget.d.ts +32 -0
  83. package/dist/client/providerContracts.d.ts +21 -0
  84. package/dist/client/providerContractsWidget.d.ts +37 -0
  85. package/dist/client/providerSimulationControls.d.ts +33 -0
  86. package/dist/client/providerSimulationControlsWidget.d.ts +20 -0
  87. package/dist/client/providerStatus.d.ts +5 -3
  88. package/dist/client/providerStatusWidget.d.ts +32 -0
  89. package/dist/client/reactiveSource.d.ts +8 -0
  90. package/dist/client/readinessFailures.d.ts +21 -0
  91. package/dist/client/readinessFailuresWidget.d.ts +42 -0
  92. package/dist/client/reconnectProfileEvidence.d.ts +21 -0
  93. package/dist/client/reconnectProfileEvidenceWidget.d.ts +39 -0
  94. package/dist/client/replayTimeline.d.ts +26 -0
  95. package/dist/client/routingStatus.d.ts +21 -0
  96. package/dist/client/routingStatusWidget.d.ts +32 -0
  97. package/dist/client/sessionObservability.d.ts +21 -0
  98. package/dist/client/sessionObservabilityWidget.d.ts +31 -0
  99. package/dist/client/sessionSnapshot.d.ts +23 -0
  100. package/dist/client/sessionSnapshotWidget.d.ts +33 -0
  101. package/dist/client/store.d.ts +1 -1
  102. package/dist/client/traceTimeline.d.ts +21 -0
  103. package/dist/client/traceTimelineWidget.d.ts +36 -0
  104. package/dist/client/turnLatency.d.ts +24 -0
  105. package/dist/client/turnLatencyWidget.d.ts +33 -0
  106. package/dist/client/turnQuality.d.ts +21 -0
  107. package/dist/client/turnQualityWidget.d.ts +32 -0
  108. package/dist/client/voiceWidgetView.d.ts +48 -0
  109. package/dist/client/workflowStatus.d.ts +5 -3
  110. package/dist/{agent.d.ts → core/agent.d.ts} +83 -6
  111. package/dist/core/agentPerformanceReport.d.ts +40 -0
  112. package/dist/core/agentSquadContract.d.ts +98 -0
  113. package/dist/core/agentState.d.ts +12 -0
  114. package/dist/core/agentTools.d.ts +132 -0
  115. package/dist/core/aiScorecard.d.ts +32 -0
  116. package/dist/core/aiVoiceModel.d.ts +15 -0
  117. package/dist/core/amdDetector.d.ts +25 -0
  118. package/dist/{assistant.d.ts → core/assistant.d.ts} +14 -14
  119. package/dist/core/assistantExperiment.d.ts +42 -0
  120. package/dist/{assistantHealth.d.ts → core/assistantHealth.d.ts} +9 -9
  121. package/dist/{assistantMemory.d.ts → core/assistantMemory.d.ts} +10 -10
  122. package/dist/core/assistantMode.d.ts +22 -0
  123. package/dist/{audioConditioning.d.ts → core/audioConditioning.d.ts} +2 -2
  124. package/dist/core/audit.d.ts +131 -0
  125. package/dist/core/auditDeliveryRoutes.d.ts +85 -0
  126. package/dist/core/auditExport.d.ts +34 -0
  127. package/dist/core/auditRoutes.d.ts +66 -0
  128. package/dist/core/auditSinks.d.ts +151 -0
  129. package/dist/core/backchannel.d.ts +18 -0
  130. package/dist/core/bargeInRoutes.d.ts +56 -0
  131. package/dist/core/bookingFlow.d.ts +43 -0
  132. package/dist/core/browserCallProfiles.d.ts +120 -0
  133. package/dist/core/browserMediaRoutes.d.ts +62 -0
  134. package/dist/core/cachedTTS.d.ts +30 -0
  135. package/dist/core/calendarAdapter.d.ts +47 -0
  136. package/dist/core/calendarSlots.d.ts +35 -0
  137. package/dist/core/callDebugger.d.ts +66 -0
  138. package/dist/core/callDisposition.d.ts +38 -0
  139. package/dist/core/callQuota.d.ts +54 -0
  140. package/dist/core/callScorecard.d.ts +53 -0
  141. package/dist/core/callerCRMLinker.d.ts +29 -0
  142. package/dist/core/callerMemory.d.ts +37 -0
  143. package/dist/core/callingWindow.d.ts +26 -0
  144. package/dist/core/campaign.d.ts +795 -0
  145. package/dist/core/campaignControls.d.ts +37 -0
  146. package/dist/core/campaignDialers.d.ts +111 -0
  147. package/dist/core/campaignTemplate.d.ts +16 -0
  148. package/dist/core/competitiveCoverage.d.ts +141 -0
  149. package/dist/core/conversationSimulator.d.ts +73 -0
  150. package/dist/{correction.d.ts → core/correction.d.ts} +5 -4
  151. package/dist/core/costAccounting.d.ts +76 -0
  152. package/dist/core/costPredictor.d.ts +74 -0
  153. package/dist/core/crmCallLogger.d.ts +37 -0
  154. package/dist/core/crmContract.d.ts +70 -0
  155. package/dist/core/dataControl.d.ts +180 -0
  156. package/dist/core/defineVoiceAssistant.d.ts +68 -0
  157. package/dist/core/deliveryRuntime.d.ts +159 -0
  158. package/dist/core/deliverySinkRoutes.d.ts +117 -0
  159. package/dist/core/demoReadyRoutes.d.ts +98 -0
  160. package/dist/{diagnosticsRoutes.d.ts → core/diagnosticsRoutes.d.ts} +2 -2
  161. package/dist/core/dncRegistry.d.ts +38 -0
  162. package/dist/core/dtmfCollector.d.ts +37 -0
  163. package/dist/{evalRoutes.d.ts → core/evalRoutes.d.ts} +26 -20
  164. package/dist/{fileStore.d.ts → core/fileStore.d.ts} +34 -20
  165. package/dist/core/guardrails.d.ts +128 -0
  166. package/dist/{handoff.d.ts → core/handoff.d.ts} +10 -10
  167. package/dist/{handoffHealth.d.ts → core/handoffHealth.d.ts} +9 -9
  168. package/dist/core/holdAudio.d.ts +23 -0
  169. package/dist/{htmx.d.ts → core/htmx.d.ts} +2 -2
  170. package/dist/core/htmxDashboardRoutes.d.ts +250 -0
  171. package/dist/core/iceServers.d.ts +34 -0
  172. package/dist/core/incidentBundle.d.ts +119 -0
  173. package/dist/core/incidentTimeline.d.ts +260 -0
  174. package/dist/core/ivrPlan.d.ts +40 -0
  175. package/dist/core/latencySlo.d.ts +56 -0
  176. package/dist/core/liveCoach.d.ts +43 -0
  177. package/dist/core/liveLatency.d.ts +78 -0
  178. package/dist/core/liveOps.d.ts +190 -0
  179. package/dist/core/llmJudge.d.ts +45 -0
  180. package/dist/{logger.d.ts → core/logger.d.ts} +1 -2
  181. package/dist/core/mcpToolset.d.ts +58 -0
  182. package/dist/core/mediaPipelineRoutes.d.ts +171 -0
  183. package/dist/core/mediaPipelineSurfaces.d.ts +48 -0
  184. package/dist/{memoryStore.d.ts → core/memoryStore.d.ts} +1 -1
  185. package/dist/core/midCallSummary.d.ts +27 -0
  186. package/dist/{modelAdapters.d.ts → core/modelAdapters.d.ts} +52 -7
  187. package/dist/core/monitor.d.ts +148 -0
  188. package/dist/core/multilingualProof.d.ts +77 -0
  189. package/dist/core/noShowPredictor.d.ts +46 -0
  190. package/dist/core/oauth2TokenSource.d.ts +21 -0
  191. package/dist/core/observabilityExport.d.ts +501 -0
  192. package/dist/core/openaiTTS.d.ts +18 -0
  193. package/dist/core/operationalStatus.d.ts +87 -0
  194. package/dist/core/operationsRecord.d.ts +371 -0
  195. package/dist/{ops.d.ts → core/ops.d.ts} +70 -70
  196. package/dist/core/opsActionAuditRoutes.d.ts +99 -0
  197. package/dist/{opsConsoleRoutes.d.ts → core/opsConsoleRoutes.d.ts} +11 -8
  198. package/dist/{opsPresets.d.ts → core/opsPresets.d.ts} +2 -2
  199. package/dist/core/opsRecovery.d.ts +137 -0
  200. package/dist/{opsRuntime.d.ts → core/opsRuntime.d.ts} +6 -6
  201. package/dist/{opsSinks.d.ts → core/opsSinks.d.ts} +19 -19
  202. package/dist/core/opsStatus.d.ts +76 -0
  203. package/dist/core/opsStatusRoutes.d.ts +33 -0
  204. package/dist/{opsWebhook.d.ts → core/opsWebhook.d.ts} +15 -15
  205. package/dist/core/otelExporter.d.ts +83 -0
  206. package/dist/core/outcomeContract.d.ts +146 -0
  207. package/dist/{outcomeRecipes.d.ts → core/outcomeRecipes.d.ts} +4 -4
  208. package/dist/core/pathway.d.ts +94 -0
  209. package/dist/core/pathwayCompiler.d.ts +31 -0
  210. package/dist/core/pathwayGenerator.d.ts +27 -0
  211. package/dist/core/pathwayRuntime.d.ts +57 -0
  212. package/dist/core/pathwaySlotCollector.d.ts +29 -0
  213. package/dist/core/pathwayVisualizer.d.ts +8 -0
  214. package/dist/core/phoneAgent.d.ts +139 -0
  215. package/dist/core/phoneAgentProductionSmoke.d.ts +115 -0
  216. package/dist/core/phoneProvisioning.d.ts +29 -0
  217. package/dist/core/platformCoverage.d.ts +91 -0
  218. package/dist/{plugin.d.ts → core/plugin.d.ts} +2 -2
  219. package/dist/core/postCallAnalysis.d.ts +98 -0
  220. package/dist/core/postCallSurvey.d.ts +41 -0
  221. package/dist/{postgresStore.d.ts → core/postgresStore.d.ts} +20 -9
  222. package/dist/{presets.d.ts → core/presets.d.ts} +3 -3
  223. package/dist/core/productionReadiness.d.ts +757 -0
  224. package/dist/core/profileSwitchRecommendation.d.ts +350 -0
  225. package/dist/core/promptInjectionGuard.d.ts +30 -0
  226. package/dist/core/proofAssertions.d.ts +32 -0
  227. package/dist/core/proofPack.d.ts +211 -0
  228. package/dist/core/proofRunner.d.ts +79 -0
  229. package/dist/core/proofTrends.d.ts +966 -0
  230. package/dist/{providerAdapters.d.ts → core/providerAdapters.d.ts} +5 -5
  231. package/dist/core/providerCapabilities.d.ts +92 -0
  232. package/dist/core/providerDecisionTraces.d.ts +130 -0
  233. package/dist/{providerHealth.d.ts → core/providerHealth.d.ts} +15 -5
  234. package/dist/core/providerOrchestration.d.ts +109 -0
  235. package/dist/core/providerRouterTraces.d.ts +35 -0
  236. package/dist/core/providerRoutingContract.d.ts +71 -0
  237. package/dist/core/providerSlo.d.ts +142 -0
  238. package/dist/core/providerStackRecommendations.d.ts +188 -0
  239. package/dist/core/qualityDriftDetector.d.ts +44 -0
  240. package/dist/{qualityRoutes.d.ts → core/qualityRoutes.d.ts} +7 -7
  241. package/dist/{queue.d.ts → core/queue.d.ts} +48 -39
  242. package/dist/core/ragTool.d.ts +52 -0
  243. package/dist/core/readinessProfiles.d.ts +45 -0
  244. package/dist/core/realtimeChannel.d.ts +136 -0
  245. package/dist/core/realtimeProviderContracts.d.ts +133 -0
  246. package/dist/core/reconnectContract.d.ts +177 -0
  247. package/dist/core/recordingRedaction.d.ts +47 -0
  248. package/dist/core/recordingStore.d.ts +60 -0
  249. package/dist/core/redaction.d.ts +13 -0
  250. package/dist/core/reminderScheduler.d.ts +43 -0
  251. package/dist/{resilienceRoutes.d.ts → core/resilienceRoutes.d.ts} +45 -5
  252. package/dist/core/retention.d.ts +37 -0
  253. package/dist/core/retryPolicy.d.ts +38 -0
  254. package/dist/core/routeAuth.d.ts +58 -0
  255. package/dist/{routing.d.ts → core/routing.d.ts} +2 -2
  256. package/dist/{runtimeOps.d.ts → core/runtimeOps.d.ts} +3 -3
  257. package/dist/{s3Store.d.ts → core/s3Store.d.ts} +12 -3
  258. package/dist/core/scorecardCalibration.d.ts +31 -0
  259. package/dist/core/scribe.d.ts +50 -0
  260. package/dist/core/semanticTurn.d.ts +27 -0
  261. package/dist/{session.d.ts → core/session.d.ts} +1 -1
  262. package/dist/core/sessionObservability.d.ts +145 -0
  263. package/dist/{sessionReplay.d.ts → core/sessionReplay.d.ts} +31 -19
  264. package/dist/core/sessionSnapshot.d.ts +109 -0
  265. package/dist/core/simulationSuite.d.ts +144 -0
  266. package/dist/core/sloCalibration.d.ts +185 -0
  267. package/dist/{sqliteStore.d.ts → core/sqliteStore.d.ts} +20 -9
  268. package/dist/{store.d.ts → core/store.d.ts} +1 -1
  269. package/dist/core/supervisorPermissions.d.ts +33 -0
  270. package/dist/core/supervisorPresence.d.ts +49 -0
  271. package/dist/core/telephonyMediaRoutes.d.ts +72 -0
  272. package/dist/core/telephonyOutcome.d.ts +269 -0
  273. package/dist/core/toolContract.d.ts +161 -0
  274. package/dist/core/toolRuntime.d.ts +50 -0
  275. package/dist/{trace.d.ts → core/trace.d.ts} +61 -22
  276. package/dist/core/traceDeliveryRoutes.d.ts +86 -0
  277. package/dist/core/traceTimeline.d.ts +97 -0
  278. package/dist/core/transcriptAnnotator.d.ts +41 -0
  279. package/dist/{turnDetection.d.ts → core/turnDetection.d.ts} +1 -1
  280. package/dist/core/turnLatency.d.ts +95 -0
  281. package/dist/core/turnProfiles.d.ts +3 -0
  282. package/dist/core/turnQuality.d.ts +94 -0
  283. package/dist/{types.d.ts → core/types.d.ts} +545 -81
  284. package/dist/core/vapiAdapter.d.ts +160 -0
  285. package/dist/core/variableAnalytics.d.ts +47 -0
  286. package/dist/core/voiceConfiguration.d.ts +8 -0
  287. package/dist/core/voiceMonitoring.d.ts +444 -0
  288. package/dist/core/webhookFanout.d.ts +48 -0
  289. package/dist/core/webhookVerification.d.ts +27 -0
  290. package/dist/core/whisperChannel.d.ts +50 -0
  291. package/dist/{workflowContract.d.ts → core/workflowContract.d.ts} +21 -21
  292. package/dist/core/zeroDataRetention.d.ts +31 -0
  293. package/dist/drizzle/assistantMemory.d.ts +112 -0
  294. package/dist/drizzle/eval.d.ts +61 -0
  295. package/dist/drizzle/handoff.d.ts +62 -0
  296. package/dist/drizzle/incidentBundle.d.ts +61 -0
  297. package/dist/drizzle/index.d.ts +1105 -0
  298. package/dist/drizzle/index.js +3059 -0
  299. package/dist/drizzle/observabilityExport.d.ts +61 -0
  300. package/dist/drizzle/proofTrends.d.ts +126 -0
  301. package/dist/drizzle/runtimeStorage.d.ts +1315 -0
  302. package/dist/drizzle/shared.d.ts +76 -0
  303. package/dist/embed/index.d.ts +38 -0
  304. package/dist/embed/index.js +1734 -0
  305. package/dist/embed/voice-widget.js +10 -0
  306. package/dist/index.d.ts +373 -74
  307. package/dist/index.js +46333 -7422
  308. package/dist/internal/evidence.d.ts +10 -0
  309. package/dist/internal/html.d.ts +6 -0
  310. package/dist/internal/status.d.ts +7 -0
  311. package/dist/react/VoiceAgentSquadStatus.d.ts +5 -0
  312. package/dist/react/VoiceCallDebuggerLaunch.d.ts +6 -0
  313. package/dist/react/VoiceCallPlayer.d.ts +11 -0
  314. package/dist/react/VoiceCostDashboard.d.ts +10 -0
  315. package/dist/react/VoiceDeliveryRuntime.d.ts +7 -0
  316. package/dist/react/VoiceLiveAgentConsole.d.ts +11 -0
  317. package/dist/react/VoiceLiveCallViewer.d.ts +9 -0
  318. package/dist/react/VoiceOpsActionCenter.d.ts +5 -0
  319. package/dist/react/VoiceOpsStatus.d.ts +1 -1
  320. package/dist/react/VoicePlatformCoverage.d.ts +6 -0
  321. package/dist/react/VoiceProfileComparison.d.ts +6 -0
  322. package/dist/react/VoiceProfileSwitchRecommendation.d.ts +6 -0
  323. package/dist/react/VoiceProofTrends.d.ts +6 -0
  324. package/dist/react/VoiceProviderCapabilities.d.ts +6 -0
  325. package/dist/react/VoiceProviderContracts.d.ts +6 -0
  326. package/dist/react/VoiceProviderSimulationControls.d.ts +5 -0
  327. package/dist/react/VoiceProviderStatus.d.ts +6 -0
  328. package/dist/react/VoiceReadinessFailures.d.ts +6 -0
  329. package/dist/react/VoiceReconnectProfileEvidence.d.ts +6 -0
  330. package/dist/react/VoiceReplayTimeline.d.ts +6 -0
  331. package/dist/react/VoiceRoutingStatus.d.ts +6 -0
  332. package/dist/react/VoiceSessionObservability.d.ts +6 -0
  333. package/dist/react/VoiceSessionSnapshot.d.ts +6 -0
  334. package/dist/react/VoiceTraceTimeline.d.ts +6 -0
  335. package/dist/react/VoiceTurnLatency.d.ts +6 -0
  336. package/dist/react/VoiceTurnQuality.d.ts +6 -0
  337. package/dist/react/VoiceWidget.d.ts +13 -0
  338. package/dist/react/index.d.ts +80 -6
  339. package/dist/react/index.js +12949 -319
  340. package/dist/react/useVoiceAgentSquadStatus.d.ts +8 -0
  341. package/dist/react/useVoiceCallDebugger.d.ts +8 -0
  342. package/dist/react/useVoiceCampaignDialerProof.d.ts +10 -0
  343. package/dist/react/useVoiceController.d.ts +5 -1
  344. package/dist/react/useVoiceDeliveryRuntime.d.ts +13 -0
  345. package/dist/react/useVoiceLiveOps.d.ts +9 -0
  346. package/dist/react/useVoiceOpsActionCenter.d.ts +11 -0
  347. package/dist/react/useVoiceOpsStatus.d.ts +8 -0
  348. package/dist/react/useVoicePlatformCoverage.d.ts +8 -0
  349. package/dist/react/useVoiceProfileComparison.d.ts +8 -0
  350. package/dist/react/useVoiceProfileSwitchRecommendation.d.ts +8 -0
  351. package/dist/react/useVoiceProofTrends.d.ts +8 -0
  352. package/dist/react/useVoiceProviderCapabilities.d.ts +8 -0
  353. package/dist/react/useVoiceProviderContracts.d.ts +8 -0
  354. package/dist/react/useVoiceProviderSimulationControls.d.ts +10 -0
  355. package/dist/react/useVoiceProviderStatus.d.ts +1 -1
  356. package/dist/react/useVoiceReadinessFailures.d.ts +8 -0
  357. package/dist/react/useVoiceReconnectProfileEvidence.d.ts +8 -0
  358. package/dist/react/useVoiceRoutingStatus.d.ts +8 -0
  359. package/dist/react/useVoiceSessionObservability.d.ts +8 -0
  360. package/dist/react/useVoiceSessionSnapshot.d.ts +9 -0
  361. package/dist/react/useVoiceStream.d.ts +5 -1
  362. package/dist/react/useVoiceTraceTimeline.d.ts +8 -0
  363. package/dist/react/useVoiceTurnLatency.d.ts +9 -0
  364. package/dist/react/useVoiceTurnQuality.d.ts +8 -0
  365. package/dist/react/useVoiceWorkflowStatus.d.ts +1 -1
  366. package/dist/svelte/createVoiceAgentSquadStatus.d.ts +9 -0
  367. package/dist/svelte/createVoiceCallDebugger.d.ts +10 -0
  368. package/dist/svelte/createVoiceCallPlayer.d.ts +33 -0
  369. package/dist/svelte/createVoiceCampaignDialerProof.d.ts +9 -0
  370. package/dist/svelte/createVoiceCostDashboard.d.ts +13 -0
  371. package/dist/svelte/createVoiceDeliveryRuntime.d.ts +11 -0
  372. package/dist/svelte/createVoiceLiveAgentConsole.d.ts +23 -0
  373. package/dist/svelte/createVoiceLiveCallViewer.d.ts +26 -0
  374. package/dist/svelte/createVoiceLiveOps.d.ts +13 -0
  375. package/dist/svelte/createVoiceOpsActionCenter.d.ts +10 -0
  376. package/dist/svelte/createVoiceOpsStatus.d.ts +4 -4
  377. package/dist/svelte/createVoicePlatformCoverage.d.ts +7 -0
  378. package/dist/svelte/createVoiceProfileComparison.d.ts +7 -0
  379. package/dist/svelte/createVoiceProofTrends.d.ts +7 -0
  380. package/dist/svelte/createVoiceProviderCapabilities.d.ts +10 -0
  381. package/dist/svelte/createVoiceProviderContracts.d.ts +10 -0
  382. package/dist/svelte/createVoiceProviderSimulationControls.d.ts +11 -0
  383. package/dist/svelte/createVoiceProviderStatus.d.ts +5 -3
  384. package/dist/svelte/createVoiceReadinessFailures.d.ts +7 -0
  385. package/dist/svelte/createVoiceReconnectProfileEvidence.d.ts +7 -0
  386. package/dist/svelte/createVoiceReplayTimeline.d.ts +13 -0
  387. package/dist/svelte/createVoiceRoutingStatus.d.ts +10 -0
  388. package/dist/svelte/createVoiceSessionObservability.d.ts +10 -0
  389. package/dist/svelte/createVoiceSessionSnapshot.d.ts +11 -0
  390. package/dist/svelte/createVoiceStream.d.ts +1 -1
  391. package/dist/svelte/createVoiceTraceTimeline.d.ts +10 -0
  392. package/dist/svelte/createVoiceTurnLatency.d.ts +11 -0
  393. package/dist/svelte/createVoiceTurnQuality.d.ts +10 -0
  394. package/dist/svelte/createVoiceWidget.d.ts +19 -0
  395. package/dist/svelte/createVoiceWorkflowStatus.d.ts +2 -2
  396. package/dist/svelte/index.d.ts +37 -6
  397. package/dist/svelte/index.js +7088 -765
  398. package/dist/telephony/contract.d.ts +61 -0
  399. package/dist/telephony/matrix.d.ts +97 -0
  400. package/dist/telephony/plivo.d.ts +303 -0
  401. package/dist/telephony/response.d.ts +1 -1
  402. package/dist/telephony/security.d.ts +182 -0
  403. package/dist/telephony/telnyx.d.ts +291 -0
  404. package/dist/telephony/twilio.d.ts +149 -15
  405. package/dist/testing/accuracy.d.ts +1 -1
  406. package/dist/testing/benchmark.d.ts +15 -15
  407. package/dist/testing/corrected.d.ts +9 -9
  408. package/dist/testing/duplex.d.ts +5 -5
  409. package/dist/testing/fixtures.d.ts +4 -4
  410. package/dist/testing/index.d.ts +13 -13
  411. package/dist/testing/index.js +6430 -894
  412. package/dist/testing/ioProviderSimulator.d.ts +5 -5
  413. package/dist/testing/providerSimulator.d.ts +5 -5
  414. package/dist/testing/review.d.ts +8 -8
  415. package/dist/testing/sessionBenchmark.d.ts +13 -13
  416. package/dist/testing/stt.d.ts +3 -3
  417. package/dist/testing/telephony.d.ts +27 -2
  418. package/dist/testing/tts.d.ts +2 -2
  419. package/dist/vue/VoiceCallDebuggerLaunch.d.ts +72 -0
  420. package/dist/vue/VoiceCallPlayer.d.ts +40 -0
  421. package/dist/vue/VoiceCostDashboard.d.ts +57 -0
  422. package/dist/vue/VoiceDeliveryRuntime.d.ts +34 -0
  423. package/dist/vue/VoiceLiveAgentConsole.d.ts +50 -0
  424. package/dist/vue/VoiceLiveCallViewer.d.ts +35 -0
  425. package/dist/vue/VoiceOpsActionCenter.d.ts +13 -0
  426. package/dist/vue/VoiceOpsStatus.d.ts +4 -0
  427. package/dist/vue/VoicePlatformCoverage.d.ts +27 -0
  428. package/dist/vue/VoiceProofTrends.d.ts +25 -0
  429. package/dist/vue/VoiceProviderCapabilities.d.ts +55 -0
  430. package/dist/vue/VoiceProviderContracts.d.ts +25 -0
  431. package/dist/vue/VoiceProviderSimulationControls.d.ts +88 -0
  432. package/dist/vue/VoiceProviderStatus.d.ts +55 -0
  433. package/dist/vue/VoiceReadinessFailures.d.ts +25 -0
  434. package/dist/vue/VoiceReconnectProfileEvidence.d.ts +25 -0
  435. package/dist/vue/VoiceReplayTimeline.d.ts +17 -0
  436. package/dist/vue/VoiceRoutingStatus.d.ts +55 -0
  437. package/dist/vue/VoiceSessionObservability.d.ts +27 -0
  438. package/dist/vue/VoiceSessionSnapshot.d.ts +72 -0
  439. package/dist/vue/VoiceTurnLatency.d.ts +73 -0
  440. package/dist/vue/VoiceTurnQuality.d.ts +55 -0
  441. package/dist/vue/VoiceWidget.d.ts +77 -0
  442. package/dist/vue/index.d.ts +49 -6
  443. package/dist/vue/index.js +12254 -413
  444. package/dist/vue/useVoiceAgentSquadStatus.d.ts +9 -0
  445. package/dist/vue/useVoiceCallDebugger.d.ts +10 -0
  446. package/dist/vue/useVoiceCampaignDialerProof.d.ts +11 -0
  447. package/dist/vue/useVoiceController.d.ts +10 -7
  448. package/dist/vue/useVoiceDeliveryRuntime.d.ts +13 -0
  449. package/dist/vue/useVoiceLiveOps.d.ts +9 -0
  450. package/dist/vue/useVoiceOpsActionCenter.d.ts +11 -0
  451. package/dist/vue/useVoiceOpsStatus.d.ts +9 -0
  452. package/dist/vue/useVoicePlatformCoverage.d.ts +9 -0
  453. package/dist/vue/useVoiceProfileComparison.d.ts +9 -0
  454. package/dist/vue/useVoiceProofTrends.d.ts +9 -0
  455. package/dist/vue/useVoiceProviderCapabilities.d.ts +9 -0
  456. package/dist/vue/useVoiceProviderContracts.d.ts +9 -0
  457. package/dist/vue/useVoiceProviderSimulationControls.d.ts +24 -0
  458. package/dist/vue/useVoiceProviderStatus.d.ts +3 -3
  459. package/dist/vue/useVoiceReadinessFailures.d.ts +959 -0
  460. package/dist/vue/useVoiceReconnectProfileEvidence.d.ts +9 -0
  461. package/dist/vue/useVoiceRoutingStatus.d.ts +8 -0
  462. package/dist/vue/useVoiceSessionObservability.d.ts +9 -0
  463. package/dist/vue/useVoiceSessionSnapshot.d.ts +10 -0
  464. package/dist/vue/useVoiceStream.d.ts +10 -6
  465. package/dist/vue/useVoiceTraceTimeline.d.ts +9 -0
  466. package/dist/vue/useVoiceTurnLatency.d.ts +10 -0
  467. package/dist/vue/useVoiceTurnQuality.d.ts +9 -0
  468. package/dist/vue/useVoiceWorkflowStatus.d.ts +3 -3
  469. package/package.json +155 -256
  470. package/dist/angular/voice-app-kit-status.service.d.ts +0 -12
  471. package/dist/angular/voice-ops-status.component.d.ts +0 -15
  472. package/dist/appKit.d.ts +0 -92
  473. package/dist/client/appKitStatus.d.ts +0 -19
  474. package/dist/react/useVoiceAppKitStatus.d.ts +0 -8
  475. package/dist/svelte/createVoiceAppKitStatus.d.ts +0 -8
  476. package/dist/turnProfiles.d.ts +0 -6
  477. package/dist/vue/useVoiceAppKitStatus.d.ts +0 -9
  478. package/fixtures/README.md +0 -57
  479. package/fixtures/manifest.json +0 -199
  480. package/fixtures/pcm/dialogue-three-clean.pcm +0 -0
  481. package/fixtures/pcm/dialogue-three-mixed.pcm +0 -0
  482. package/fixtures/pcm/dialogue-two-clean.pcm +0 -0
  483. package/fixtures/pcm/dialogue-two-noisy.pcm +0 -0
  484. package/fixtures/pcm/multiturn-three-mixed.pcm +0 -0
  485. package/fixtures/pcm/multiturn-two-clean.pcm +0 -0
  486. package/fixtures/pcm/quietly-alone-clean.pcm +0 -0
  487. package/fixtures/pcm/rainstorms-noisy.pcm +0 -0
  488. package/fixtures/pcm/stella-bulgaria-bulgarian20.pcm +0 -0
  489. package/fixtures/pcm/stella-ghana-english507.pcm +0 -0
  490. package/fixtures/pcm/stella-india-english37.pcm +0 -0
  491. package/fixtures/pcm/stella-jamaica-jamaican-creole-english1.pcm +0 -0
  492. package/fixtures/pcm/stella-liberia-liberian-pidgin-english2.pcm +0 -0
  493. package/fixtures/pcm/stella-pakistan-english519.pcm +0 -0
  494. package/fixtures/pcm/stella-sierra-leone-krio5.pcm +0 -0
  495. package/fixtures/pcm/stella-singapore-english655.pcm +0 -0
  496. package/fixtures/pcm/traveled-back-route-clean.pcm +0 -0
@@ -1,24 +1,48 @@
1
- import type { SessionStore } from '@absolutejs/absolute';
2
- import type { VoiceOpsDispositionTaskPolicies, VoiceOpsTaskAssignmentRule, VoiceOpsTaskAssignmentRules, VoiceIntegrationWebhookConfig, StoredVoiceIntegrationEvent, StoredVoiceOpsTask, VoiceIntegrationEventStore, VoiceOpsTaskPolicy, VoiceOpsTask, VoiceOpsTaskStore } from './ops';
3
- import type { VoiceIntegrationSink } from './opsSinks';
4
- import type { StoredVoiceCallReviewArtifact, VoiceCallReviewArtifact, VoiceCallReviewStore } from './testing/review';
5
- import type { VoiceTraceEventStore } from './trace';
1
+ import type { MediaWebRTCStatsCollector, MediaWebRTCStatsReport, MediaWebRTCStatsReportInput, MediaWebRTCStreamContinuityInput, MediaWebRTCStreamContinuityReport } from "@absolutejs/media";
2
+ import type { VoiceOpsDispositionTaskPolicies, VoiceOpsTaskAssignmentRule, VoiceOpsTaskAssignmentRules, VoiceIntegrationWebhookConfig, StoredVoiceIntegrationEvent, StoredVoiceOpsTask, VoiceIntegrationEventStore, VoiceOpsTaskPolicy, VoiceOpsTask, VoiceOpsTaskStore } from "./ops";
3
+ import type { VoiceIntegrationSink } from "./opsSinks";
4
+ import type { StoredVoiceCallReviewArtifact, VoiceCallReviewArtifact, VoiceCallReviewStore } from "../testing/review";
5
+ import type { VoiceTraceEventStore } from "./trace";
6
+ import type { VoiceLiveOpsControlState } from "./liveOps";
7
+ import type { VoiceAuditActor, VoiceAuditEventStore } from "./audit";
8
+ import type { VoiceProfileSwitchGuardDecision, VoiceProfileSwitchGuardMode, VoiceProfileSwitchObservedSignals } from "./profileSwitchRecommendation";
9
+ import type { VoiceRealCallProfileDefaultsReport, VoiceRealCallProfileHistoryReport } from "./proofTrends";
6
10
  export type AudioFormat = {
7
- container: 'raw';
8
- encoding: 'alaw' | 'mulaw' | 'pcm_s16le';
11
+ container: "raw";
12
+ encoding: "alaw" | "mulaw" | "pcm_s16le";
9
13
  sampleRateHz: number;
10
14
  channels: 1 | 2;
11
15
  };
12
16
  export type AudioChunk = ArrayBuffer | ArrayBufferView;
17
+ /**
18
+ * Structural contract for an inbound noise suppressor applied before STT.
19
+ * Matches `@absolutejs/media`'s `NoiseSuppressor`, so any media suppressor
20
+ * (`createFFmpegNoiseSuppressor`, `createEnergyGateNoiseSuppressor`, a Krisp
21
+ * adapter, etc.) satisfies it without a hard import.
22
+ */
23
+ export type VoiceNoiseSuppressor = {
24
+ readonly kind: string;
25
+ process: (input: {
26
+ format: AudioFormat;
27
+ pcm: ArrayBuffer | ArrayBufferView;
28
+ }) => Promise<{
29
+ bytes: Uint8Array;
30
+ format: AudioFormat;
31
+ }> | {
32
+ bytes: Uint8Array;
33
+ format: AudioFormat;
34
+ };
35
+ close?: () => Promise<void> | void;
36
+ };
13
37
  export type VoiceLanguageStrategy = {
14
- mode: 'auto-detect';
38
+ mode: "auto-detect";
15
39
  allowedLanguages?: string[];
16
40
  } | {
17
- mode: 'fixed';
41
+ mode: "fixed";
18
42
  primaryLanguage: string;
19
43
  secondaryLanguages?: string[];
20
44
  } | {
21
- mode: 'allow-switching';
45
+ mode: "allow-switching";
22
46
  primaryLanguage?: string;
23
47
  secondaryLanguages: string[];
24
48
  };
@@ -28,7 +52,7 @@ export type VoicePhraseHint = {
28
52
  boost?: number;
29
53
  metadata?: Record<string, unknown>;
30
54
  };
31
- export type VoiceCorrectionRiskTier = 'safe' | 'balanced' | 'risky';
55
+ export type VoiceCorrectionRiskTier = "safe" | "balanced" | "risky";
32
56
  export type VoiceDomainTerm = {
33
57
  text: string;
34
58
  aliases?: string[];
@@ -44,12 +68,18 @@ export type VoiceLexiconEntry = {
44
68
  metadata?: Record<string, unknown>;
45
69
  pronunciation?: string;
46
70
  };
71
+ export type VoiceTranscriptSentiment = {
72
+ label: "negative" | "neutral" | "positive" | (string & {});
73
+ metadata?: Record<string, unknown>;
74
+ score?: number;
75
+ };
47
76
  export type Transcript = {
48
77
  id: string;
49
78
  text: string;
50
79
  isFinal: boolean;
51
80
  confidence?: number;
52
81
  language?: string;
82
+ sentiment?: VoiceTranscriptSentiment;
53
83
  speaker?: string | number;
54
84
  startedAtMs?: number;
55
85
  endedAtMs?: number;
@@ -65,7 +95,7 @@ export type VoiceTranscriptQuality = {
65
95
  fallback?: VoiceFallbackDiagnostics;
66
96
  partialTranscriptCount: number;
67
97
  selectedTranscriptCount: number;
68
- source: 'fallback' | 'primary';
98
+ source: "fallback" | "primary";
69
99
  };
70
100
  export type VoiceTurnCorrectionDiagnostics = {
71
101
  attempted: boolean;
@@ -83,7 +113,7 @@ export type VoiceTurnCostEstimate = {
83
113
  primaryAudioMs: number;
84
114
  totalBillableAudioMs: number;
85
115
  };
86
- export type VoiceFallbackSelectionReason = 'fallback-empty' | 'primary-empty' | 'word-count-margin' | 'confidence-margin' | 'word-count-tiebreak' | 'kept-primary';
116
+ export type VoiceFallbackSelectionReason = "fallback-empty" | "primary-empty" | "word-count-margin" | "confidence-margin" | "word-count-tiebreak" | "kept-primary";
87
117
  export type VoiceFallbackDiagnostics = {
88
118
  attempted: boolean;
89
119
  fallbackConfidence?: number;
@@ -94,31 +124,31 @@ export type VoiceFallbackDiagnostics = {
94
124
  primaryWordCount: number;
95
125
  selected: boolean;
96
126
  selectionReason: VoiceFallbackSelectionReason;
97
- trigger: 'empty-turn' | 'low-confidence' | 'empty-or-low-confidence' | 'always';
127
+ trigger: "empty-turn" | "low-confidence" | "empty-or-low-confidence" | "always";
98
128
  };
99
129
  export type VoicePartialEvent = {
100
- type: 'partial';
130
+ type: "partial";
101
131
  transcript: Transcript;
102
132
  receivedAt: number;
103
133
  };
104
134
  export type VoiceFinalEvent = {
105
- type: 'final';
135
+ type: "final";
106
136
  transcript: Transcript;
107
137
  receivedAt: number;
108
138
  };
109
139
  export type VoiceEndOfTurnEvent = {
110
- type: 'endOfTurn';
111
- reason: 'vendor' | 'silence' | 'manual';
140
+ type: "endOfTurn";
141
+ reason: "vendor" | "silence" | "manual";
112
142
  receivedAt: number;
113
143
  };
114
144
  export type VoiceErrorEvent = {
115
- type: 'error';
145
+ type: "error";
116
146
  error: Error;
117
147
  recoverable: boolean;
118
148
  code?: string;
119
149
  };
120
150
  export type VoiceCloseEvent = {
121
- type: 'close';
151
+ type: "close";
122
152
  code?: number;
123
153
  reason?: string;
124
154
  recoverable?: boolean;
@@ -144,11 +174,11 @@ export type STTAdapterOpenOptions = {
144
174
  signal?: AbortSignal;
145
175
  };
146
176
  export type STTAdapter<TOptions extends STTAdapterOpenOptions = STTAdapterOpenOptions> = {
147
- kind: 'stt';
177
+ kind: "stt";
148
178
  open: (options: TOptions) => Promise<STTAdapterSession> | STTAdapterSession;
149
179
  };
150
180
  export type TTSAudioEvent = {
151
- type: 'audio';
181
+ type: "audio";
152
182
  chunk: AudioChunk;
153
183
  format: AudioFormat;
154
184
  receivedAt: number;
@@ -161,15 +191,26 @@ export type TTSSessionEventMap = {
161
191
  export type TTSAdapterSession = {
162
192
  on: <K extends keyof TTSSessionEventMap>(event: K, handler: (payload: TTSSessionEventMap[K]) => void | Promise<void>) => () => void;
163
193
  send: (text: string) => Promise<void>;
194
+ cancel?: (reason?: string) => Promise<void>;
164
195
  close: (reason?: string) => Promise<void>;
165
196
  };
197
+ export declare const ttsAdapterSessionCanCancel: (session: TTSAdapterSession) => session is TTSAdapterSession & {
198
+ cancel: (reason?: string) => Promise<void>;
199
+ };
200
+ export type VoiceTTSProsody = {
201
+ emphasis?: number;
202
+ pitch?: number;
203
+ speed?: number;
204
+ style?: string;
205
+ };
166
206
  export type TTSAdapterOpenOptions = {
167
207
  sessionId: string;
168
208
  lexicon?: VoiceLexiconEntry[];
209
+ prosody?: VoiceTTSProsody;
169
210
  signal?: AbortSignal;
170
211
  };
171
212
  export type TTSAdapter<TOptions extends TTSAdapterOpenOptions = TTSAdapterOpenOptions> = {
172
- kind: 'tts';
213
+ kind: "tts";
173
214
  open: (options: TOptions) => Promise<TTSAdapterSession> | TTSAdapterSession;
174
215
  };
175
216
  export type RealtimeSessionEventMap = STTSessionEventMap & {
@@ -185,20 +226,40 @@ export type RealtimeAdapterOpenOptions = {
185
226
  format: AudioFormat;
186
227
  languageStrategy?: VoiceLanguageStrategy;
187
228
  lexicon?: VoiceLexiconEntry[];
229
+ modalities?: ReadonlyArray<"audio" | "text">;
188
230
  phraseHints?: VoicePhraseHint[];
231
+ promptCacheKey?: string;
232
+ semanticVAD?: import("./assistantMode").VoiceSemanticVADConfig;
189
233
  signal?: AbortSignal;
190
234
  };
191
235
  export type RealtimeAdapter<TOptions extends RealtimeAdapterOpenOptions = RealtimeAdapterOpenOptions> = {
192
- kind: 'realtime';
236
+ kind: "realtime";
193
237
  open: (options: TOptions) => Promise<RealtimeAdapterSession> | RealtimeAdapterSession;
194
238
  };
195
- export type VoiceSessionStatus = 'active' | 'reconnecting' | 'completed' | 'failed';
239
+ export type VoiceSessionStatus = "active" | "reconnecting" | "completed" | "failed";
240
+ export type VoiceReconnectClientStatus = "idle" | "reconnecting" | "resumed" | "exhausted";
241
+ export type VoiceReconnectClientState = {
242
+ attempts: number;
243
+ lastDisconnectAt?: number;
244
+ lastResumedAt?: number;
245
+ maxAttempts: number;
246
+ nextAttemptAt?: number;
247
+ status: VoiceReconnectClientStatus;
248
+ };
249
+ export type VoiceTurnCitation = {
250
+ chunkId: string;
251
+ score: number;
252
+ source?: string;
253
+ title?: string;
254
+ };
196
255
  export type VoiceTurnRecord<TResult = unknown> = {
197
256
  id: string;
198
257
  text: string;
199
258
  quality?: VoiceTranscriptQuality;
200
259
  transcripts: Transcript[];
201
260
  assistantText?: string;
261
+ attachments?: import("./agent").VoiceAgentMessageAttachment[];
262
+ citations?: VoiceTurnCitation[];
202
263
  committedAt: number;
203
264
  result?: TResult;
204
265
  };
@@ -253,10 +314,10 @@ export type VoiceSessionSummary = {
253
314
  status: VoiceSessionStatus;
254
315
  turnCount: number;
255
316
  };
256
- export type VoiceCallDisposition = 'completed' | 'transferred' | 'escalated' | 'voicemail' | 'no-answer' | 'failed' | 'closed';
317
+ export type VoiceCallDisposition = "completed" | "transferred" | "escalated" | "voicemail" | "no-answer" | "failed" | "silence-timeout" | "closed";
257
318
  export type VoiceCallLifecycleEvent = {
258
319
  at: number;
259
- type: 'start' | 'end' | 'transfer' | 'escalation' | 'voicemail' | 'no-answer';
320
+ type: "start" | "end" | "transfer" | "escalation" | "voicemail" | "no-answer";
260
321
  disposition?: VoiceCallDisposition;
261
322
  metadata?: Record<string, unknown>;
262
323
  reason?: string;
@@ -269,8 +330,8 @@ export type VoiceCallLifecycleState = {
269
330
  lastEventAt: number;
270
331
  startedAt: number;
271
332
  };
272
- export type VoiceHandoffAction = 'escalate' | 'no-answer' | 'transfer' | 'voicemail';
273
- export type VoiceHandoffStatus = 'delivered' | 'failed' | 'skipped';
333
+ export type VoiceHandoffAction = "escalate" | "no-answer" | "transfer" | "voicemail";
334
+ export type VoiceHandoffStatus = "delivered" | "failed" | "skipped";
274
335
  export type VoiceHandoffResult = {
275
336
  deliveredAt?: number;
276
337
  deliveredTo?: string;
@@ -278,7 +339,7 @@ export type VoiceHandoffResult = {
278
339
  metadata?: Record<string, unknown>;
279
340
  status: VoiceHandoffStatus;
280
341
  };
281
- export type VoiceHandoffDeliveryQueueStatus = VoiceHandoffStatus | 'pending';
342
+ export type VoiceHandoffDeliveryQueueStatus = VoiceHandoffStatus | "pending";
282
343
  export type StoredVoiceHandoffDelivery<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = {
283
344
  action: VoiceHandoffAction;
284
345
  context: TContext;
@@ -326,9 +387,15 @@ export type VoiceHandoffConfig<TContext = unknown, TSession extends VoiceSession
326
387
  adapters: VoiceHandoffAdapter<TContext, TSession, TResult>[];
327
388
  deliveryQueue?: VoiceHandoffDeliveryStore<StoredVoiceHandoffDelivery<TContext, TSession, TResult>>;
328
389
  enqueueOnly?: boolean;
329
- failMode?: 'record' | 'throw';
390
+ failMode?: "record" | "throw";
391
+ };
392
+ export type VoiceSessionStore<TSession extends VoiceSessionRecord = VoiceSessionRecord> = {
393
+ get: (id: string) => Promise<TSession | undefined>;
394
+ getOrCreate: (id: string) => Promise<TSession>;
395
+ set: (id: string, value: TSession) => Promise<void>;
396
+ list: () => Promise<VoiceSessionSummary[]>;
397
+ remove: (id: string) => Promise<void>;
330
398
  };
331
- export type VoiceSessionStore<TSession extends VoiceSessionRecord = VoiceSessionRecord> = SessionStore<TSession, VoiceSessionSummary>;
332
399
  export type VoiceLogger = {
333
400
  debug?: (message: string, meta?: Record<string, unknown>) => void;
334
401
  info?: (message: string, meta?: Record<string, unknown>) => void;
@@ -336,15 +403,15 @@ export type VoiceLogger = {
336
403
  error?: (message: string, meta?: Record<string, unknown>) => void;
337
404
  };
338
405
  export type VoiceReconnectConfig = {
339
- strategy?: 'resume-last-turn' | 'restart' | 'fail';
406
+ strategy?: "resume-last-turn" | "restart" | "fail";
340
407
  timeout?: number;
341
408
  maxAttempts?: number;
342
409
  };
343
- export type VoiceRuntimePreset = 'default' | 'chat' | 'guided-intake' | 'dictation' | 'noisy-room' | 'pstn-balanced' | 'pstn-fast' | 'reliability';
344
- export type VoiceSTTLifecycle = 'continuous' | 'turn-scoped';
345
- export type VoiceTurnProfile = 'fast' | 'balanced' | 'long-form';
346
- export type VoiceTurnQualityProfile = 'general' | 'accent-heavy' | 'noisy-room' | 'short-command';
347
- export type VoiceTurnFallbackTrigger = 'empty-turn' | 'low-confidence' | 'empty-or-low-confidence' | 'always';
410
+ export type VoiceRuntimePreset = "default" | "chat" | "guided-intake" | "dictation" | "noisy-room" | "pstn-balanced" | "pstn-fast" | "reliability";
411
+ export type VoiceSTTLifecycle = "continuous" | "turn-scoped";
412
+ export type VoiceTurnProfile = "fast" | "balanced" | "long-form";
413
+ export type VoiceTurnQualityProfile = "general" | "accent-heavy" | "noisy-room" | "short-command";
414
+ export type VoiceTurnFallbackTrigger = "empty-turn" | "low-confidence" | "empty-or-low-confidence" | "always";
348
415
  export type VoiceSTTFallbackConfig = {
349
416
  adapter: STTAdapter;
350
417
  trigger?: VoiceTurnFallbackTrigger;
@@ -396,12 +463,34 @@ export type VoiceResolvedAudioConditioningConfig = {
396
463
  export type VoiceSocket = {
397
464
  send: (data: string | Uint8Array | ArrayBuffer) => void | Promise<void>;
398
465
  close: (code?: number, reason?: string) => void | Promise<void>;
466
+ /**
467
+ * Discard any audio already buffered downstream (e.g. a telephony carrier's
468
+ * outbound media buffer). Called on barge-in so the caller stops hearing the
469
+ * assistant immediately, even when frames have already been flushed to the
470
+ * transport. Optional: transports without a flush concept omit it.
471
+ */
472
+ clear?: () => void | Promise<void>;
473
+ };
474
+ export type VoiceMonitorRuntimeSessionBinding = {
475
+ deregister: (reason?: string) => void;
476
+ emitAudio: (chunk: Uint8Array | ArrayBuffer, options?: {
477
+ source?: "assistant" | "caller" | (string & {});
478
+ }) => void;
479
+ };
480
+ export type VoiceMonitorRuntimeRegisterInput = {
481
+ handle: VoiceSessionHandle<unknown, VoiceSessionRecord, unknown>;
482
+ metadata?: Record<string, unknown>;
483
+ sessionId: string;
484
+ };
485
+ export type VoiceMonitorRuntimeBinding = {
486
+ registerSession: (input: VoiceMonitorRuntimeRegisterInput) => VoiceMonitorRuntimeSessionBinding;
399
487
  };
400
488
  export type VoiceSessionHandle<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = {
401
489
  id: string;
402
490
  connect: (socket: VoiceSocket) => Promise<void>;
403
491
  receiveAudio: (audio: AudioChunk) => Promise<void>;
404
- commitTurn: (reason?: VoiceEndOfTurnEvent['reason']) => Promise<void>;
492
+ attachUserMedia: (attachment: import("./agent").VoiceAgentMessageAttachment) => Promise<void>;
493
+ commitTurn: (reason?: VoiceEndOfTurnEvent["reason"]) => Promise<void>;
405
494
  disconnect: (event?: VoiceCloseEvent) => Promise<void>;
406
495
  complete: (result?: TResult) => Promise<void>;
407
496
  escalate: (input: {
@@ -423,18 +512,33 @@ export type VoiceSessionHandle<TContext = unknown, TSession extends VoiceSession
423
512
  reason?: string;
424
513
  result?: TResult;
425
514
  target: string;
515
+ transferMode?: "cold" | "warm";
426
516
  }) => Promise<void>;
427
517
  close: (reason?: string) => Promise<void>;
428
518
  snapshot: () => Promise<TSession>;
519
+ /**
520
+ * Mutate the live turn-detection config for this session — useful when a
521
+ * tool call wants to dial silenceMs up ("the caller asked for more time")
522
+ * or down. The change takes effect on the NEXT silence-timer schedule, so
523
+ * an in-flight commit isn't cancelled. Returns the merged config so the
524
+ * caller can confirm.
525
+ */
526
+ setTurnDetection: (patch: Partial<VoiceTurnDetectionConfig>) => Promise<{
527
+ silenceMs: number;
528
+ speechThreshold: number;
529
+ transcriptStabilityMs: number;
530
+ }>;
429
531
  };
430
532
  export type VoiceRouteResult<TResult = unknown> = {
431
533
  complete?: boolean;
432
534
  result?: TResult;
433
535
  assistantText?: string;
536
+ citations?: ReadonlyArray<VoiceTurnCitation>;
434
537
  transfer?: {
435
538
  metadata?: Record<string, unknown>;
436
539
  reason?: string;
437
540
  target: string;
541
+ transferMode?: "cold" | "warm";
438
542
  };
439
543
  escalate?: {
440
544
  metadata?: Record<string, unknown>;
@@ -475,6 +579,11 @@ export type VoiceLexiconResolver<TContext = unknown> = (input: {
475
579
  }) => Promise<VoiceLexiconEntry[] | void> | VoiceLexiconEntry[] | void;
476
580
  export type VoiceOnTurnObjectHandler<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = (input: {
477
581
  context: TContext;
582
+ liveOps?: {
583
+ control: VoiceLiveOpsControlState;
584
+ injectedInstruction?: string;
585
+ };
586
+ onTextDelta?: (delta: string) => void;
478
587
  session: TSession;
479
588
  turn: VoiceTurnRecord;
480
589
  api: VoiceSessionHandle<TContext, TSession, TResult>;
@@ -559,7 +668,7 @@ export type VoiceRuntimeOpsConfig<TContext = unknown, TSession extends VoiceSess
559
668
  disposition: VoiceCallDisposition;
560
669
  review: StoredVoiceCallReviewArtifact;
561
670
  session: TSession;
562
- }) => Promise<Omit<VoiceOpsTask, 'id'> | VoiceOpsTask | StoredVoiceOpsTask | null | void> | Omit<VoiceOpsTask, 'id'> | VoiceOpsTask | StoredVoiceOpsTask | null | void;
671
+ }) => Promise<Omit<VoiceOpsTask, "id"> | VoiceOpsTask | StoredVoiceOpsTask | null | void> | Omit<VoiceOpsTask, "id"> | VoiceOpsTask | StoredVoiceOpsTask | null | void;
563
672
  resolveTaskPolicy?: (input: {
564
673
  api: VoiceSessionHandle<TContext, TSession, TResult>;
565
674
  context: TContext;
@@ -596,7 +705,37 @@ export type VoiceRuntimeOpsConfig<TContext = unknown, TSession extends VoiceSess
596
705
  tasks?: VoiceOpsTaskStore;
597
706
  webhook?: VoiceIntegrationWebhookConfig;
598
707
  };
599
- export type VoiceNormalizedRouteConfig<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = Omit<VoiceRouteConfig<TContext, TSession, TResult>, 'onTurn'> & {
708
+ export type VoiceLiveOpsRuntimeConfig = {
709
+ getControl: (sessionId: string) => Promise<VoiceLiveOpsControlState | null | undefined> | VoiceLiveOpsControlState | null | undefined;
710
+ };
711
+ export type VoiceProfileSwitchGuardResolverInput<TContext = unknown> = {
712
+ context: TContext;
713
+ scenarioId?: string;
714
+ sessionId: string;
715
+ };
716
+ export type VoicePluginProfileSwitchGuardConfig<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = {
717
+ actor?: VoiceAuditActor;
718
+ allowedProfileIds?: string[] | ((input: VoiceProfileSwitchGuardResolverInput<TContext>) => Promise<string[] | undefined> | string[] | undefined);
719
+ audit?: VoiceAuditEventStore;
720
+ blockedProfileIds?: string[] | ((input: VoiceProfileSwitchGuardResolverInput<TContext>) => Promise<string[] | undefined> | string[] | undefined);
721
+ currentProfileId?: string | ((input: VoiceProfileSwitchGuardResolverInput<TContext>) => Promise<string | undefined> | string | undefined);
722
+ defaultProfileId?: string;
723
+ defaults: VoiceRealCallProfileDefaultsReport | VoiceRealCallProfileHistoryReport | ((input: VoiceProfileSwitchGuardResolverInput<TContext>) => Promise<VoiceRealCallProfileDefaultsReport | VoiceRealCallProfileHistoryReport> | VoiceRealCallProfileDefaultsReport | VoiceRealCallProfileHistoryReport);
724
+ metadata?: Record<string, unknown> | ((input: VoiceProfileSwitchGuardResolverInput<TContext>) => Promise<Record<string, unknown> | undefined> | Record<string, unknown> | undefined);
725
+ minConfidence?: number | ((input: VoiceProfileSwitchGuardResolverInput<TContext>) => Promise<number | undefined> | number | undefined);
726
+ maxAutoSwitchesPerSession?: number | ((input: VoiceProfileSwitchGuardResolverInput<TContext>) => Promise<number | undefined> | number | undefined);
727
+ mode?: VoiceProfileSwitchGuardMode | ((input: VoiceProfileSwitchGuardResolverInput<TContext>) => Promise<VoiceProfileSwitchGuardMode | undefined> | VoiceProfileSwitchGuardMode | undefined);
728
+ observed?: VoiceProfileSwitchObservedSignals | ((input: VoiceProfileSwitchGuardResolverInput<TContext>) => Promise<VoiceProfileSwitchObservedSignals | undefined> | VoiceProfileSwitchObservedSignals | undefined);
729
+ onDecision?: (input: {
730
+ context: TContext;
731
+ decision: VoiceProfileSwitchGuardDecision;
732
+ scenarioId?: string;
733
+ sessionId: string;
734
+ }) => Promise<void> | void;
735
+ sessionMetadataKey?: string | false;
736
+ trace?: false | VoiceTraceEventStore;
737
+ };
738
+ export type VoiceNormalizedRouteConfig<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = Omit<VoiceRouteConfig<TContext, TSession, TResult>, "onTurn"> & {
600
739
  onTurn: VoiceOnTurnObjectHandler<TContext, TSession, TResult>;
601
740
  };
602
741
  export type VoiceScenario = {
@@ -609,131 +748,383 @@ export type VoiceExpectedSpeakerTurn = {
609
748
  speaker: string;
610
749
  text: string;
611
750
  };
751
+ /**
752
+ * Configures one of the plugin's optional route surfaces. Pass that surface's
753
+ * options object to mount it, `false` (or omit) to leave it off. Surfaces whose
754
+ * options are entirely optional may also be enabled with `true` for defaults.
755
+ */
756
+ export type VoiceSurfaceConfig<O> = false | O | (Record<string, never> extends O ? true : never);
612
757
  export type VoicePluginConfig<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = {
613
758
  costTelemetry?: VoiceCostTelemetryConfig<TContext, TSession, TResult>;
614
759
  path: string;
760
+ greeting?: string | ((input: {
761
+ session: TSession;
762
+ }) => string | Promise<string>);
615
763
  languageStrategy?: VoiceLanguageStrategy;
616
764
  lexicon?: VoiceLexiconEntry[] | VoiceLexiconResolver<TContext>;
617
765
  phraseHints?: VoicePhraseHint[] | VoicePhraseHintResolver<TContext>;
618
766
  preset?: VoiceRuntimePreset;
619
- stt: STTAdapter;
767
+ stt?: STTAdapter;
620
768
  sttFallback?: VoiceSTTFallbackConfig;
621
769
  sttLifecycle?: VoiceSTTLifecycle;
770
+ realtime?: RealtimeAdapter;
771
+ realtimeInputFormat?: AudioFormat;
622
772
  tts?: TTSAdapter;
623
773
  session: VoiceSessionStore<NoInfer<TSession>>;
624
774
  reconnect?: VoiceReconnectConfig;
625
775
  turnDetection?: VoiceTurnDetectionConfig;
776
+ semanticTurnDetector?: import("./semanticTurn").VoiceSemanticTurnDetector;
777
+ bargeInMinPartialWords?: number;
778
+ fillerPhrases?: ReadonlyArray<string>;
779
+ fillerDelayMs?: number;
780
+ fillerFor?: (input: {
781
+ sessionId: string;
782
+ turnId: string;
783
+ userText: string;
784
+ }) => Promise<string | null>;
785
+ fillerForTimeoutMs?: number;
786
+ defaultSilentTurnAck?: string;
787
+ routeOnTurnTimeoutMs?: number;
626
788
  audioConditioning?: VoiceAudioConditioningConfig;
789
+ noiseSuppressor?: VoiceNoiseSuppressor;
790
+ noiseSuppressorFormat?: AudioFormat;
627
791
  logger?: VoiceLogger;
628
792
  htmx?: boolean | VoiceHTMXConfig<TSession, NoInfer<TResult>>;
629
793
  handoff?: VoiceHandoffConfig<TContext, TSession, TResult>;
630
794
  ops?: VoiceRuntimeOpsConfig<TContext, TSession, TResult>;
795
+ liveOps?: VoiceLiveOpsRuntimeConfig;
796
+ monitor?: VoiceMonitorRuntimeBinding;
797
+ profileSwitchGuard?: VoicePluginProfileSwitchGuardConfig<TContext, TSession, TResult>;
631
798
  trace?: VoiceTraceEventStore;
799
+ assistantHealth?: VoiceSurfaceConfig<import("./assistantHealth").VoiceAssistantHealthRoutesOptions>;
800
+ auditDelivery?: VoiceSurfaceConfig<import("./auditDeliveryRoutes").VoiceAuditDeliveryRoutesOptions>;
801
+ auditTrail?: VoiceSurfaceConfig<import("./auditRoutes").VoiceAuditTrailRoutesOptions>;
802
+ bargeIn?: VoiceSurfaceConfig<import("./bargeInRoutes").VoiceBargeInRoutesOptions>;
803
+ browserCallProfile?: VoiceSurfaceConfig<import("./browserCallProfiles").VoiceBrowserCallProfileRoutesOptions>;
804
+ browserMedia?: VoiceSurfaceConfig<import("./browserMediaRoutes").VoiceBrowserMediaRoutesOptions>;
805
+ callDebugger?: VoiceSurfaceConfig<import("./callDebugger").VoiceCallDebuggerRoutesOptions>;
806
+ campaign?: VoiceSurfaceConfig<import("./campaign").VoiceCampaignRoutesOptions>;
807
+ competitiveCoverage?: VoiceSurfaceConfig<import("./competitiveCoverage").VoiceCompetitiveCoverageRoutesOptions>;
808
+ dataControl?: VoiceSurfaceConfig<import("./dataControl").VoiceDataControlRoutesOptions>;
809
+ deliveryRuntime?: VoiceSurfaceConfig<import("./deliveryRuntime").VoiceDeliveryRuntimeRoutesOptions>;
810
+ deliverySink?: VoiceSurfaceConfig<import("./deliverySinkRoutes").VoiceDeliverySinkRoutesOptions>;
811
+ demoReady?: VoiceSurfaceConfig<import("./demoReadyRoutes").VoiceDemoReadyRoutesOptions>;
812
+ diagnostics?: VoiceSurfaceConfig<import("./diagnosticsRoutes").VoiceDiagnosticsRoutesOptions>;
813
+ eval?: VoiceSurfaceConfig<import("./evalRoutes").VoiceEvalRoutesOptions>;
814
+ guardrail?: VoiceSurfaceConfig<import("./guardrails").VoiceGuardrailRoutesOptions>;
815
+ handoffHealth?: VoiceSurfaceConfig<import("./handoffHealth").VoiceHandoffHealthRoutesOptions>;
816
+ htmxDashboard?: VoiceSurfaceConfig<import("./htmxDashboardRoutes").VoiceHTMXDashboardRoutesOptions>;
817
+ incidentBundle?: VoiceSurfaceConfig<import("./incidentBundle").VoiceIncidentBundleRoutesOptions>;
818
+ incidentTimeline?: VoiceSurfaceConfig<import("./incidentTimeline").VoiceIncidentTimelineRoutesOptions>;
819
+ liveLatency?: VoiceSurfaceConfig<import("./liveLatency").VoiceLiveLatencyRoutesOptions>;
820
+ liveMonitor?: VoiceSurfaceConfig<import("./monitor").VoiceLiveMonitorRoutesOptions>;
821
+ liveOpsConsole?: VoiceSurfaceConfig<import("./liveOps").VoiceLiveOpsRoutesOptions>;
822
+ mediaPipeline?: VoiceSurfaceConfig<import("./mediaPipelineRoutes").VoiceMediaPipelineRoutesOptions>;
823
+ monitorReport?: VoiceSurfaceConfig<import("./voiceMonitoring").VoiceMonitorRoutesOptions>;
824
+ monitorRunner?: VoiceSurfaceConfig<import("./voiceMonitoring").VoiceMonitorRunnerRoutesOptions>;
825
+ observabilityExport?: VoiceSurfaceConfig<import("./observabilityExport").VoiceObservabilityExportRoutesOptions>;
826
+ observabilityExportReplay?: VoiceSurfaceConfig<import("./observabilityExport").VoiceObservabilityExportReplayRoutesOptions>;
827
+ operationalStatus?: VoiceSurfaceConfig<import("./operationalStatus").VoiceOperationalStatusRoutesOptions>;
828
+ operationsRecord?: VoiceSurfaceConfig<import("./operationsRecord").VoiceOperationsRecordRoutesOptions>;
829
+ opsActionAudit?: VoiceSurfaceConfig<import("./opsActionAuditRoutes").VoiceOpsActionAuditRoutesOptions>;
830
+ opsConsole?: VoiceSurfaceConfig<import("./opsConsoleRoutes").VoiceOpsConsoleRoutesOptions>;
831
+ opsRecovery?: VoiceSurfaceConfig<import("./opsRecovery").VoiceOpsRecoveryRoutesOptions>;
832
+ opsStatus?: VoiceSurfaceConfig<import("./opsStatus").VoiceOpsStatusRoutesOptions>;
833
+ opsWebhookReceiver?: VoiceSurfaceConfig<import("./opsWebhook").VoiceOpsWebhookReceiverRoutesOptions>;
834
+ outcomeContract?: VoiceSurfaceConfig<import("./outcomeContract").VoiceOutcomeContractRoutesOptions>;
835
+ phoneAgentProductionSmoke?: VoiceSurfaceConfig<import("./phoneAgentProductionSmoke").VoicePhoneAgentProductionSmokeRoutesOptions>;
836
+ platformCoverage?: VoiceSurfaceConfig<import("./platformCoverage").VoicePlatformCoverageRoutesOptions>;
837
+ postCallAnalysis?: VoiceSurfaceConfig<import("./postCallAnalysis").VoicePostCallAnalysisRoutesOptions>;
838
+ productionReadiness?: VoiceSurfaceConfig<import("./productionReadiness").VoiceProductionReadinessRoutesOptions>;
839
+ profileSwitchLiveDecision?: VoiceSurfaceConfig<import("./profileSwitchRecommendation").VoiceProfileSwitchLiveDecisionRoutesOptions>;
840
+ profileSwitchPolicyProof?: VoiceSurfaceConfig<import("./profileSwitchRecommendation").VoiceProfileSwitchPolicyProofRoutesOptions>;
841
+ profileSwitchReadiness?: VoiceSurfaceConfig<import("./profileSwitchRecommendation").VoiceProfileSwitchReadinessRoutesOptions>;
842
+ proofPack?: VoiceSurfaceConfig<import("./proofPack").VoiceProofPackRoutesOptions>;
843
+ proofTrend?: VoiceSurfaceConfig<import("./proofTrends").VoiceProofTrendRoutesOptions>;
844
+ proofTrendRecommendation?: VoiceSurfaceConfig<import("./proofTrends").VoiceProofTrendRecommendationRoutesOptions>;
845
+ providerCapability?: VoiceSurfaceConfig<import("./providerCapabilities").VoiceProviderCapabilityRoutesOptions>;
846
+ providerContractMatrix?: VoiceSurfaceConfig<import("./providerStackRecommendations").VoiceProviderContractMatrixRoutesOptions>;
847
+ providerDecisionTrace?: VoiceSurfaceConfig<import("./providerDecisionTraces").VoiceProviderDecisionTraceRoutesOptions>;
848
+ providerHealth?: VoiceSurfaceConfig<import("./providerHealth").VoiceProviderHealthRoutesOptions>;
849
+ providerOrchestration?: VoiceSurfaceConfig<import("./providerOrchestration").VoiceProviderOrchestrationRoutesOptions>;
850
+ providerSlo?: VoiceSurfaceConfig<import("./providerSlo").VoiceProviderSloRoutesOptions>;
851
+ quality?: VoiceSurfaceConfig<import("./qualityRoutes").VoiceQualityRoutesOptions>;
852
+ realCallEvidenceRuntime?: VoiceSurfaceConfig<import("./proofTrends").VoiceRealCallEvidenceRuntimeRoutesOptions>;
853
+ realCallProfileHistory?: VoiceSurfaceConfig<import("./proofTrends").VoiceRealCallProfileHistoryRoutesOptions>;
854
+ realCallProfileRecoveryAction?: VoiceSurfaceConfig<import("./proofTrends").VoiceRealCallProfileRecoveryActionRoutesOptions>;
855
+ realtimeChannel?: VoiceSurfaceConfig<import("./realtimeChannel").VoiceRealtimeChannelRoutesOptions>;
856
+ realtimeProviderContract?: VoiceSurfaceConfig<import("./realtimeProviderContracts").VoiceRealtimeProviderContractRoutesOptions>;
857
+ reconnectContract?: VoiceSurfaceConfig<import("./reconnectContract").VoiceReconnectContractRoutesOptions>;
858
+ reconnectProof?: VoiceSurfaceConfig<import("./reconnectContract").VoiceReconnectProofRoutesOptions>;
859
+ resilience?: VoiceSurfaceConfig<import("./resilienceRoutes").VoiceResilienceRoutesOptions>;
860
+ sessionList?: VoiceSurfaceConfig<import("./sessionReplay").VoiceSessionListRoutesOptions>;
861
+ sessionObservability?: VoiceSurfaceConfig<import("./sessionObservability").VoiceSessionObservabilityRoutesOptions>;
862
+ sessionReplay?: VoiceSurfaceConfig<import("./sessionReplay").VoiceSessionReplayRoutesOptions>;
863
+ sessionSnapshot?: VoiceSurfaceConfig<import("./sessionSnapshot").VoiceSessionSnapshotRoutesOptions>;
864
+ simulationSuite?: VoiceSurfaceConfig<import("./simulationSuite").VoiceSimulationSuiteRoutesOptions>;
865
+ sloCalibration?: VoiceSurfaceConfig<import("./sloCalibration").VoiceSloCalibrationRoutesOptions>;
866
+ sloReadinessThreshold?: VoiceSurfaceConfig<import("./sloCalibration").VoiceSloReadinessThresholdRoutesOptions>;
867
+ telephonyCarrierMatrix?: VoiceSurfaceConfig<import("../telephony/matrix").VoiceTelephonyCarrierMatrixRoutesOptions>;
868
+ telephonyMedia?: VoiceSurfaceConfig<import("./telephonyMediaRoutes").VoiceTelephonyMediaRoutesOptions>;
869
+ telephonyWebhook?: VoiceSurfaceConfig<import("./telephonyOutcome").VoiceTelephonyWebhookRoutesOptions>;
870
+ telephonyWebhookSecurity?: VoiceSurfaceConfig<import("../telephony/security").VoiceTelephonyWebhookSecurityRoutesOptions>;
871
+ toolContract?: VoiceSurfaceConfig<import("./toolContract").VoiceToolContractRoutesOptions>;
872
+ traceDelivery?: VoiceSurfaceConfig<import("./traceDeliveryRoutes").VoiceTraceDeliveryRoutesOptions>;
873
+ traceTimeline?: VoiceSurfaceConfig<import("./traceTimeline").VoiceTraceTimelineRoutesOptions>;
874
+ turnLatency?: VoiceSurfaceConfig<import("./turnLatency").VoiceTurnLatencyRoutesOptions>;
875
+ turnQuality?: VoiceSurfaceConfig<import("./turnQuality").VoiceTurnQualityRoutesOptions>;
632
876
  } & VoiceRouteConfig<TContext, TSession, TResult>;
877
+ export type VoiceSessionRecordingConfig = {
878
+ channels?: ReadonlyArray<"assistant" | "user">;
879
+ maxBytesPerChannel?: number;
880
+ store: import("./recordingStore").VoiceRecordingStore;
881
+ userInputFormat?: AudioFormat;
882
+ };
633
883
  export type CreateVoiceSessionOptions<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = {
634
884
  costTelemetry?: VoiceCostTelemetryConfig<TContext, TSession, TResult>;
635
885
  id: string;
636
886
  context: TContext;
637
887
  socket: VoiceSocket;
638
- stt: STTAdapter;
888
+ greeting?: string | ((input: {
889
+ session: TSession;
890
+ }) => string | Promise<string>);
891
+ stt?: STTAdapter;
892
+ realtime?: RealtimeAdapter;
893
+ realtimeInputFormat?: AudioFormat;
639
894
  tts?: TTSAdapter;
640
895
  languageStrategy?: VoiceLanguageStrategy;
641
896
  lexicon?: VoiceLexiconEntry[];
642
897
  sttFallback?: VoiceResolvedSTTFallbackConfig;
643
898
  store: VoiceSessionStore<TSession>;
644
899
  trace?: VoiceTraceEventStore;
900
+ recording?: VoiceSessionRecordingConfig;
901
+ callSilenceTimeoutMs?: number;
902
+ amd?: import("./amdDetector").VoiceAMDDetector<TContext, TSession, TResult>;
903
+ costAccountant?: import("./costAccounting").VoiceCostAccountant;
904
+ costTelephony?: {
905
+ provider?: string;
906
+ };
907
+ redact?: import("./redaction").VoiceTranscriptRedactor;
908
+ semanticTurnDetector?: import("./semanticTurn").VoiceSemanticTurnDetector;
909
+ /**
910
+ * Pre-rendered filler phrases the runtime plays in the gap between
911
+ * user-turn-commit and real assistant audio (typically 800-1500ms). The
912
+ * caller hears something within ~150-300ms of stopping speaking, so the
913
+ * LLM/TTS latency feels like the bot thinking instead of dead air. Boardy's
914
+ * killer UX feature.
915
+ *
916
+ * Behavior:
917
+ * - After a turn commits, a timer fires at `fillerDelayMs` (default
918
+ * 250ms). At that point, if the real assistant audio for this turn
919
+ * hasn't started flowing yet, a random phrase is rendered via the
920
+ * configured `tts` adapter and pushed to the socket.
921
+ * - When the real assistant audio's first chunk arrives, any in-flight
922
+ * filler is cancelled (`cancelActiveTTS` clears the carrier buffer).
923
+ * - Cooldown protects against double-fillers per turn.
924
+ *
925
+ * Set `fillerPhrases: []` (or omit) to disable. Reasonable defaults if
926
+ * you enable: `["Hmm.", "Got it.", "Right.", "Mm-hm.", "Let me think.", "Okay."]`.
927
+ */
928
+ /**
929
+ * Minimum word count in an STT partial transcript before speech-gated
930
+ * barge-in cancels the in-flight assistant TTS. Default 1 (any non-empty
931
+ * partial triggers barge-in — backwards-compatible).
932
+ *
933
+ * Set to 2 (or higher) on phone routes where the caller's brief
934
+ * acknowledgements ("yeah", "uh-huh", "you", "am i") would otherwise
935
+ * cut the bot off mid-question. Each extra word added typically delays
936
+ * barge-in by ~100-200ms (one extra STT partial cycle) — cheap compared
937
+ * to losing the bot's response.
938
+ *
939
+ * Word splitting is whitespace-based. Punctuation is left attached.
940
+ */
941
+ bargeInMinPartialWords?: number;
942
+ fillerPhrases?: ReadonlyArray<string>;
943
+ /** Milliseconds after turn-commit before the filler fires. Default 250ms — short enough to feel instant, long enough to skip if the LLM is very fast. */
944
+ fillerDelayMs?: number;
945
+ /**
946
+ * Latency Theater — content-aware filler (Boardy parity move). When
947
+ * defined, the runtime calls `fillerFor({ userText, ... })` in parallel
948
+ * with the main LLM call to generate a brief acknowledgement of what the
949
+ * caller just said ("Freelance CFOs — interesting.", "Yeah, I hear you.").
950
+ * The runtime races the promise against `fillerForTimeoutMs` (default
951
+ * 600ms). If `fillerFor` returns a non-empty string in time, it's spoken
952
+ * INSTEAD of a random `fillerPhrases` entry. On timeout or null return,
953
+ * the runtime falls back to a static random phrase, so a slow / failed
954
+ * acknowledgement call never costs you the filler entirely.
955
+ *
956
+ * Return `null` (or an empty string) to explicitly skip filler for this
957
+ * turn — useful when `userText` is so short ("yes", "no", "okay") that
958
+ * acknowledging it back sounds robotic. Return throws are caught and
959
+ * treated as null.
960
+ *
961
+ * Cost-aware: callers typically wire this to a cheap nano/haiku model
962
+ * (gpt-4.1-nano, claude-haiku-4-5) that returns 2–5 words.
963
+ */
964
+ fillerFor?: (input: {
965
+ sessionId: string;
966
+ turnId: string;
967
+ userText: string;
968
+ }) => Promise<string | null>;
969
+ /** Ceiling for the `fillerFor` call before we fall back to a static phrase. Default 600ms. */
970
+ fillerForTimeoutMs?: number;
971
+ /**
972
+ * Default spoken ack if the model returns ONLY tool calls (no text) and the
973
+ * turn isn't ending. Without this, the caller hears total silence after
974
+ * their turn and assumes the line dropped. Default is "Sorry, one moment."
975
+ * Set to "" to opt out entirely.
976
+ */
977
+ defaultSilentTurnAck?: string;
978
+ /**
979
+ * Hard timeout on a single `route.onTurn` call. If onTurn hasn't resolved
980
+ * in this many ms, it's rejected with a hard-timeout error which falls
981
+ * through to defaultSilentTurnAck. Default 45s — generous for normal
982
+ * conversational LLM calls (1-3s typical), but catches hangs where the
983
+ * model adapter's own timeout doesn't fire. Set to 0 to disable.
984
+ */
985
+ routeOnTurnTimeoutMs?: number;
986
+ assistantMode?: import("./assistantMode").VoiceAssistantMode;
987
+ modalities?: ReadonlyArray<"audio" | "text">;
988
+ prosody?: VoiceTTSProsody;
645
989
  reconnect: Required<VoiceReconnectConfig>;
646
990
  phraseHints?: VoicePhraseHint[];
991
+ sessionMetadata?: Record<string, unknown>;
647
992
  scenarioId?: string;
648
993
  sttLifecycle: VoiceSTTLifecycle;
649
994
  turnDetection: VoiceResolvedTurnDetectionConfig;
650
995
  audioConditioning?: VoiceResolvedAudioConditioningConfig;
996
+ noiseSuppressor?: VoiceNoiseSuppressor;
997
+ noiseSuppressorFormat?: AudioFormat;
651
998
  handoff?: VoiceHandoffConfig<TContext, TSession, TResult>;
999
+ liveOps?: VoiceLiveOpsRuntimeConfig;
652
1000
  route: VoiceNormalizedRouteConfig<TContext, TSession, TResult>;
653
1001
  logger?: VoiceLogger;
654
1002
  };
655
1003
  export type CreateVoiceSession = <TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown>(options: CreateVoiceSessionOptions<TContext, TSession, TResult>) => VoiceSessionHandle<TContext, TSession, TResult>;
656
1004
  export type VoiceClientStartMessage = {
657
- type: 'start';
1005
+ type: "start";
658
1006
  sessionId?: string;
659
1007
  scenarioId?: string;
660
1008
  };
661
1009
  export type VoiceClientEndTurnMessage = {
662
- type: 'end_turn';
1010
+ type: "end_turn";
663
1011
  };
664
1012
  export type VoiceClientCloseMessage = {
665
- type: 'close';
1013
+ type: "close";
666
1014
  reason?: string;
667
1015
  };
668
1016
  export type VoiceClientCallControlMessage = {
669
- type: 'call_control';
670
- action: 'complete' | 'escalate' | 'no-answer' | 'transfer' | 'voicemail';
1017
+ type: "call_control";
1018
+ action: "complete" | "escalate" | "no-answer" | "transfer" | "voicemail";
671
1019
  metadata?: Record<string, unknown>;
672
1020
  reason?: string;
673
1021
  target?: string;
674
1022
  };
675
1023
  export type VoiceClientPingMessage = {
676
- type: 'ping';
1024
+ type: "ping";
677
1025
  };
678
1026
  export type VoiceClientMessage = VoiceClientStartMessage | VoiceClientEndTurnMessage | VoiceClientCloseMessage | VoiceClientCallControlMessage | VoiceClientPingMessage;
679
1027
  export type VoiceServerSessionMessage = {
680
- type: 'session';
1028
+ type: "session";
681
1029
  sessionId: string;
682
1030
  status: VoiceSessionStatus;
683
1031
  scenarioId?: string;
1032
+ sessionMetadata?: Record<string, unknown>;
1033
+ };
1034
+ export type VoiceServerReplayMessage<TResult = unknown> = {
1035
+ type: "replay";
1036
+ assistantTexts: string[];
1037
+ call?: VoiceCallLifecycleState;
1038
+ partial: string;
1039
+ scenarioId?: string;
1040
+ sessionId: string;
1041
+ sessionMetadata?: Record<string, unknown>;
1042
+ status: VoiceSessionStatus;
1043
+ turns: VoiceTurnRecord<TResult>[];
684
1044
  };
685
1045
  export type VoiceServerPartialMessage = {
686
- type: 'partial';
1046
+ type: "partial";
687
1047
  transcript: Transcript;
688
1048
  };
689
1049
  export type VoiceServerFinalMessage = {
690
- type: 'final';
1050
+ type: "final";
691
1051
  transcript: Transcript;
692
1052
  };
693
1053
  export type VoiceServerTurnMessage<TResult = unknown> = {
694
- type: 'turn';
1054
+ type: "turn";
695
1055
  turn: VoiceTurnRecord<TResult>;
696
1056
  };
697
1057
  export type VoiceServerAssistantMessage = {
698
- type: 'assistant';
1058
+ type: "assistant";
699
1059
  text: string;
700
1060
  turnId?: string;
701
1061
  };
1062
+ export type VoiceServerAssistantDeltaMessage = {
1063
+ type: "assistant_delta";
1064
+ delta: string;
1065
+ turnId?: string;
1066
+ };
702
1067
  export type VoiceServerAudioMessage = {
703
- type: 'audio';
1068
+ type: "audio";
704
1069
  chunkBase64: string;
705
1070
  format: AudioFormat;
706
1071
  receivedAt: number;
707
1072
  turnId?: string;
708
1073
  };
709
1074
  export type VoiceServerCompleteMessage = {
710
- type: 'complete';
1075
+ type: "complete";
711
1076
  sessionId: string;
712
1077
  };
713
1078
  export type VoiceServerCallLifecycleMessage = {
714
- type: 'call_lifecycle';
1079
+ type: "call_lifecycle";
715
1080
  event: VoiceCallLifecycleEvent;
716
1081
  sessionId: string;
717
1082
  };
718
1083
  export type VoiceServerErrorMessage = {
719
- type: 'error';
1084
+ type: "error";
720
1085
  message: string;
721
1086
  recoverable?: boolean;
722
1087
  };
723
1088
  export type VoiceServerPongMessage = {
724
- type: 'pong';
1089
+ type: "pong";
1090
+ };
1091
+ export type VoiceServerConnectionMessage = {
1092
+ type: "connection";
1093
+ reconnect: VoiceReconnectClientState;
725
1094
  };
726
- export type VoiceServerMessage<TResult = unknown> = VoiceServerSessionMessage | VoiceServerPartialMessage | VoiceServerFinalMessage | VoiceServerTurnMessage<TResult> | VoiceServerAssistantMessage | VoiceServerAudioMessage | VoiceServerCallLifecycleMessage | VoiceServerCompleteMessage | VoiceServerErrorMessage | VoiceServerPongMessage;
1095
+ export type VoiceServerMessage<TResult = unknown> = VoiceServerSessionMessage | VoiceServerReplayMessage<TResult> | VoiceServerPartialMessage | VoiceServerFinalMessage | VoiceServerTurnMessage<TResult> | VoiceServerAssistantMessage | VoiceServerAssistantDeltaMessage | VoiceServerAudioMessage | VoiceServerCallLifecycleMessage | VoiceServerCompleteMessage | VoiceServerErrorMessage | VoiceServerPongMessage | VoiceServerConnectionMessage;
727
1096
  export type VoiceConnectionOptions = {
1097
+ browserMedia?: false | VoiceBrowserMediaReporterOptions;
728
1098
  protocols?: string[];
729
1099
  scenarioId?: string;
730
1100
  reconnect?: boolean;
1101
+ reconnectReportPath?: string;
731
1102
  maxReconnectAttempts?: number;
732
1103
  pingInterval?: number;
733
1104
  sessionId?: string;
734
1105
  };
1106
+ export type VoiceBrowserMediaReportPayload = {
1107
+ at: number;
1108
+ continuity?: MediaWebRTCStreamContinuityReport;
1109
+ report: MediaWebRTCStatsReport;
1110
+ scenarioId?: string | null;
1111
+ sessionId?: string | null;
1112
+ };
1113
+ export type VoiceBrowserMediaReporterOptions = Omit<MediaWebRTCStatsReportInput, "peerConnection"> & {
1114
+ fetch?: typeof fetch;
1115
+ getPeerConnection?: (() => MediaWebRTCStatsCollector | null | undefined) | (() => Promise<MediaWebRTCStatsCollector | null | undefined>);
1116
+ getScenarioId?: () => string | null | undefined;
1117
+ getSessionId?: () => string | null | undefined;
1118
+ intervalMs?: number;
1119
+ continuity?: false | Omit<MediaWebRTCStreamContinuityInput, "previousStats" | "stats">;
1120
+ onError?: (error: unknown) => void;
1121
+ onReport?: (payload: VoiceBrowserMediaReportPayload) => void;
1122
+ path?: string;
1123
+ peerConnection?: MediaWebRTCStatsCollector;
1124
+ };
735
1125
  export type VoiceCaptureOptions = {
736
1126
  channelCount?: 1 | 2;
1127
+ onAudio?: (audio: Uint8Array | ArrayBuffer, sendAudio: (audio: Uint8Array | ArrayBuffer) => void) => void;
737
1128
  onLevel?: (level: number) => void;
738
1129
  sampleRateHz?: number;
739
1130
  };
@@ -747,20 +1138,61 @@ export type VoiceBargeInOptions = {
747
1138
  enabled?: boolean;
748
1139
  interruptOnPartial?: boolean;
749
1140
  interruptThreshold?: number;
1141
+ monitor?: VoiceBargeInMonitor;
1142
+ };
1143
+ export type VoiceBargeInTriggerReason = "input-level" | "manual-audio" | "manual-interrupt" | "partial-transcript";
1144
+ export type VoiceBargeInMonitorEvent = {
1145
+ at: number;
1146
+ id: string;
1147
+ latencyMs?: number;
1148
+ playbackStopLatencyMs?: number;
1149
+ reason: VoiceBargeInTriggerReason;
1150
+ sessionId?: string | null;
1151
+ status: "requested" | "stopped" | "skipped";
1152
+ thresholdMs?: number;
1153
+ };
1154
+ export type VoiceBargeInMonitorSnapshot = {
1155
+ averageLatencyMs?: number;
1156
+ events: VoiceBargeInMonitorEvent[];
1157
+ failed: number;
1158
+ lastEvent?: VoiceBargeInMonitorEvent;
1159
+ passed: number;
1160
+ status: "empty" | "fail" | "pass" | "warn";
1161
+ thresholdMs: number;
1162
+ total: number;
1163
+ };
1164
+ export type VoiceBargeInMonitor = {
1165
+ getSnapshot: () => VoiceBargeInMonitorSnapshot;
1166
+ recordRequested: (input: {
1167
+ reason: VoiceBargeInTriggerReason;
1168
+ sessionId?: string | null;
1169
+ }) => VoiceBargeInMonitorEvent;
1170
+ recordSkipped: (input: {
1171
+ reason: VoiceBargeInTriggerReason;
1172
+ sessionId?: string | null;
1173
+ }) => VoiceBargeInMonitorEvent;
1174
+ recordStopped: (input: {
1175
+ latencyMs?: number;
1176
+ playbackStopLatencyMs?: number;
1177
+ reason: VoiceBargeInTriggerReason;
1178
+ sessionId?: string | null;
1179
+ }) => VoiceBargeInMonitorEvent;
1180
+ subscribe: (subscriber: () => void) => () => void;
750
1181
  };
751
1182
  export type VoiceAudioPlayerOptions = {
752
1183
  autoStart?: boolean;
753
1184
  createAudioContext?: () => AudioContext;
754
1185
  lookaheadMs?: number;
1186
+ volume?: number;
755
1187
  };
756
1188
  export type VoiceDuplexControllerOptions = VoiceControllerOptions & {
757
1189
  audioPlayer?: VoiceAudioPlayerOptions;
758
1190
  bargeIn?: VoiceBargeInOptions;
759
1191
  };
760
- export type VoiceSTTRoutingGoal = 'best' | 'low-cost';
761
- export type VoiceSTTRoutingCorrectionMode = 'generic' | 'none' | 'risky-turn';
1192
+ export type VoiceSTTRoutingGoal = "best" | "low-cost";
1193
+ export type VoiceSTTRoutingCorrectionMode = "generic" | "none" | "risky-turn";
762
1194
  export type VoiceSTTRoutingStrategy = {
763
- benchmarkSessionTarget: 'deepgram-corrected' | 'deepgram-flux';
1195
+ benchmarkSessionTarget: "deepgram-corrected" | "deepgram-flux";
764
1196
  correctionMode: VoiceSTTRoutingCorrectionMode;
765
1197
  goal: VoiceSTTRoutingGoal;
766
1198
  notes: string[];
@@ -774,7 +1206,7 @@ export type VoiceHTMXRenderInput<TResult = unknown, TSession extends VoiceSessio
774
1206
  result?: TResult;
775
1207
  session?: TSession;
776
1208
  sessionId?: string;
777
- status: VoiceSessionStatus | 'idle';
1209
+ status: VoiceSessionStatus | "idle";
778
1210
  turnCount: number;
779
1211
  turns: VoiceTurnRecord<TResult>[];
780
1212
  };
@@ -802,12 +1234,15 @@ export type VoiceHTMXOptions<TSession extends VoiceSessionRecord = VoiceSessionR
802
1234
  export type VoiceHTMXConfig<TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = VoiceHTMXRenderer<TSession, TResult> | VoiceHTMXOptions<TSession, TResult>;
803
1235
  export type VoiceStreamState<TResult = unknown> = {
804
1236
  call: VoiceCallLifecycleState | null;
1237
+ sessionMetadata: Record<string, unknown> | null;
805
1238
  sessionId: string | null;
806
1239
  scenarioId: string | null;
807
- status: VoiceSessionStatus | 'idle';
1240
+ status: VoiceSessionStatus | "idle";
1241
+ reconnect: VoiceReconnectClientState;
808
1242
  partial: string;
809
1243
  turns: VoiceTurnRecord<TResult>[];
810
1244
  assistantTexts: string[];
1245
+ assistantStreamingText: string;
811
1246
  assistantAudio: Array<{
812
1247
  chunk: Uint8Array;
813
1248
  format: AudioFormat;
@@ -819,7 +1254,7 @@ export type VoiceStreamState<TResult = unknown> = {
819
1254
  };
820
1255
  export type VoiceStream<TResult = unknown> = {
821
1256
  call: VoiceCallLifecycleState | null;
822
- callControl: (message: Omit<VoiceClientCallControlMessage, 'type'>) => void;
1257
+ callControl: (message: Omit<VoiceClientCallControlMessage, "type">) => void;
823
1258
  close: () => void;
824
1259
  start: (input?: {
825
1260
  scenarioId?: string;
@@ -831,13 +1266,17 @@ export type VoiceStream<TResult = unknown> = {
831
1266
  getSnapshot: () => VoiceStreamState<TResult>;
832
1267
  isConnected: boolean;
833
1268
  partial: string;
1269
+ reconnect: VoiceReconnectClientState;
834
1270
  sendAudio: (audio: Uint8Array | ArrayBuffer) => void;
1271
+ simulateDisconnect: () => void;
835
1272
  sessionId: string | null;
1273
+ sessionMetadata: Record<string, unknown> | null;
836
1274
  scenarioId: string | null;
837
- status: VoiceSessionStatus | 'idle';
1275
+ status: VoiceSessionStatus | "idle";
838
1276
  subscribe: (subscriber: () => void) => () => void;
839
1277
  turns: VoiceTurnRecord<TResult>[];
840
1278
  assistantTexts: string[];
1279
+ assistantStreamingText: string;
841
1280
  assistantAudio: Array<{
842
1281
  chunk: Uint8Array;
843
1282
  format: AudioFormat;
@@ -860,7 +1299,7 @@ export type VoiceAudioPlayerState = {
860
1299
  queuedChunkCount: number;
861
1300
  };
862
1301
  export type VoiceAudioPlayerSource = {
863
- assistantAudio: VoiceStreamState['assistantAudio'];
1302
+ assistantAudio: VoiceStreamState["assistantAudio"];
864
1303
  subscribe: (subscriber: () => void) => () => void;
865
1304
  };
866
1305
  export type VoiceAudioPlayer = {
@@ -876,8 +1315,10 @@ export type VoiceAudioPlayer = {
876
1315
  pause: () => Promise<void>;
877
1316
  processedChunkCount: number;
878
1317
  queuedChunkCount: number;
1318
+ setVolume: (volume: number) => void;
879
1319
  start: () => Promise<void>;
880
1320
  subscribe: (subscriber: () => void) => () => void;
1321
+ volume: number;
881
1322
  };
882
1323
  export type VoiceBargeInBinding = {
883
1324
  close: () => void;
@@ -887,7 +1328,7 @@ export type VoiceBargeInBinding = {
887
1328
  export type VoiceController<TResult = unknown> = {
888
1329
  bindHTMX: (options: VoiceHTMXBindingOptions) => () => void;
889
1330
  call: VoiceCallLifecycleState | null;
890
- callControl: (message: Omit<VoiceClientCallControlMessage, 'type'>) => void;
1331
+ callControl: (message: Omit<VoiceClientCallControlMessage, "type">) => void;
891
1332
  close: () => void;
892
1333
  endTurn: () => void;
893
1334
  start: (input?: {
@@ -900,17 +1341,21 @@ export type VoiceController<TResult = unknown> = {
900
1341
  isConnected: boolean;
901
1342
  isRecording: boolean;
902
1343
  partial: string;
1344
+ reconnect: VoiceReconnectClientState;
903
1345
  recordingError: string | null;
904
1346
  sendAudio: (audio: Uint8Array | ArrayBuffer) => void;
1347
+ simulateDisconnect: () => void;
905
1348
  sessionId: string | null;
1349
+ sessionMetadata: Record<string, unknown> | null;
906
1350
  scenarioId: string | null;
907
1351
  startRecording: () => Promise<void>;
908
- status: VoiceSessionStatus | 'idle';
1352
+ status: VoiceSessionStatus | "idle";
909
1353
  stopRecording: () => void;
910
1354
  subscribe: (subscriber: () => void) => () => void;
911
1355
  toggleRecording: () => Promise<void>;
912
1356
  turns: VoiceTurnRecord<TResult>[];
913
1357
  assistantTexts: string[];
1358
+ assistantStreamingText: string;
914
1359
  assistantAudio: Array<{
915
1360
  chunk: Uint8Array;
916
1361
  format: AudioFormat;
@@ -929,40 +1374,59 @@ export type VoiceHTMXBindingOptions = {
929
1374
  sessionQueryParam?: string;
930
1375
  };
931
1376
  export type VoiceStoreAction<TResult = unknown> = {
932
- type: 'session';
1377
+ type: "session";
933
1378
  sessionId: string;
1379
+ sessionMetadata?: Record<string, unknown>;
934
1380
  scenarioId?: string;
935
1381
  status: VoiceSessionStatus;
936
1382
  } | {
937
- type: 'call_lifecycle';
1383
+ type: "replay";
1384
+ assistantTexts: string[];
1385
+ call?: VoiceCallLifecycleState;
1386
+ partial: string;
1387
+ scenarioId?: string;
1388
+ sessionId: string;
1389
+ sessionMetadata?: Record<string, unknown>;
1390
+ status: VoiceSessionStatus;
1391
+ turns: VoiceTurnRecord<TResult>[];
1392
+ } | {
1393
+ type: "call_lifecycle";
938
1394
  event: VoiceCallLifecycleEvent;
939
1395
  sessionId: string;
940
1396
  } | {
941
- type: 'partial';
1397
+ type: "partial";
942
1398
  transcript: Transcript;
943
1399
  } | {
944
- type: 'final';
1400
+ type: "final";
945
1401
  transcript: Transcript;
946
1402
  } | {
947
- type: 'turn';
1403
+ type: "turn";
948
1404
  turn: VoiceTurnRecord<TResult>;
949
1405
  } | {
950
- type: 'assistant';
1406
+ type: "assistant";
951
1407
  text: string;
1408
+ turnId?: string;
952
1409
  } | {
953
- type: 'audio';
1410
+ type: "assistant_delta";
1411
+ delta: string;
1412
+ turnId?: string;
1413
+ } | {
1414
+ type: "audio";
954
1415
  chunk: Uint8Array;
955
1416
  format: AudioFormat;
956
1417
  receivedAt: number;
957
1418
  turnId?: string;
958
1419
  } | {
959
- type: 'complete';
1420
+ type: "complete";
960
1421
  sessionId: string;
961
1422
  } | {
962
- type: 'error';
1423
+ type: "error";
963
1424
  message: string;
964
1425
  } | {
965
- type: 'connected';
1426
+ type: "connected";
1427
+ } | {
1428
+ type: "connection";
1429
+ reconnect: VoiceReconnectClientState;
966
1430
  } | {
967
- type: 'disconnected';
1431
+ type: "disconnected";
968
1432
  };