@absolutejs/voice 0.0.22-beta.49 → 0.0.22-beta.491

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 (368) hide show
  1. package/README.md +4556 -603
  2. package/dist/agent.d.ts +67 -5
  3. package/dist/agentSquadContract.d.ts +98 -0
  4. package/dist/agentState.d.ts +12 -0
  5. package/dist/agentTools.d.ts +133 -0
  6. package/dist/aiVoiceModel.d.ts +15 -0
  7. package/dist/amdDetector.d.ts +25 -0
  8. package/dist/angular/index.d.ts +24 -4
  9. package/dist/angular/index.js +4147 -1164
  10. package/dist/angular/voice-agent-squad-status.service.d.ts +12 -0
  11. package/dist/angular/voice-call-debugger.service.d.ts +12 -0
  12. package/dist/angular/voice-campaign-dialer-proof.service.d.ts +14 -0
  13. package/dist/angular/voice-controller.service.d.ts +3 -1
  14. package/dist/angular/voice-delivery-runtime.component.d.ts +17 -0
  15. package/dist/angular/voice-delivery-runtime.service.d.ts +16 -0
  16. package/dist/angular/voice-live-ops.service.d.ts +11 -0
  17. package/dist/angular/voice-ops-action-center.service.d.ts +13 -0
  18. package/dist/angular/voice-ops-status.component.d.ts +15 -0
  19. package/dist/angular/voice-ops-status.service.d.ts +12 -0
  20. package/dist/angular/voice-platform-coverage.service.d.ts +12 -0
  21. package/dist/angular/voice-profile-comparison.service.d.ts +12 -0
  22. package/dist/angular/voice-proof-trends.service.d.ts +12 -0
  23. package/dist/angular/voice-provider-capabilities.service.d.ts +12 -0
  24. package/dist/angular/voice-provider-contracts.service.d.ts +12 -0
  25. package/dist/angular/voice-provider-status.service.d.ts +2 -2
  26. package/dist/angular/voice-readiness-failures.service.d.ts +13 -0
  27. package/dist/angular/voice-reconnect-profile-evidence.service.d.ts +12 -0
  28. package/dist/angular/voice-routing-status.service.d.ts +11 -0
  29. package/dist/angular/voice-session-observability.service.d.ts +12 -0
  30. package/dist/angular/voice-session-snapshot.service.d.ts +13 -0
  31. package/dist/angular/voice-stream.service.d.ts +4 -1
  32. package/dist/angular/voice-trace-timeline.service.d.ts +12 -0
  33. package/dist/angular/voice-turn-latency.service.d.ts +13 -0
  34. package/dist/angular/voice-turn-quality.service.d.ts +12 -0
  35. package/dist/angular/voice-workflow-status.service.d.ts +2 -2
  36. package/dist/assistant.d.ts +11 -11
  37. package/dist/assistantHealth.d.ts +6 -6
  38. package/dist/assistantMemory.d.ts +3 -3
  39. package/dist/assistantMode.d.ts +22 -0
  40. package/dist/audioConditioning.d.ts +1 -1
  41. package/dist/audit.d.ts +131 -0
  42. package/dist/auditDeliveryRoutes.d.ts +85 -0
  43. package/dist/auditExport.d.ts +34 -0
  44. package/dist/auditRoutes.d.ts +66 -0
  45. package/dist/auditSinks.d.ts +151 -0
  46. package/dist/backchannel.d.ts +18 -0
  47. package/dist/bargeInRoutes.d.ts +56 -0
  48. package/dist/browserCallProfiles.d.ts +120 -0
  49. package/dist/browserMediaRoutes.d.ts +62 -0
  50. package/dist/callDebugger.d.ts +66 -0
  51. package/dist/callerMemory.d.ts +37 -0
  52. package/dist/campaign.d.ts +794 -0
  53. package/dist/campaignControls.d.ts +37 -0
  54. package/dist/campaignDialers.d.ts +111 -0
  55. package/dist/client/actions.d.ts +95 -1
  56. package/dist/client/agentSquadStatus.d.ts +37 -0
  57. package/dist/client/agentSquadStatusWidget.d.ts +24 -0
  58. package/dist/client/audioPlayer.d.ts +2 -2
  59. package/dist/client/bargeInMonitor.d.ts +7 -0
  60. package/dist/client/browserMedia.d.ts +8 -0
  61. package/dist/client/callDebugger.d.ts +19 -0
  62. package/dist/client/callDebuggerWidget.d.ts +30 -0
  63. package/dist/client/campaignDialerProof.d.ts +23 -0
  64. package/dist/client/connection.d.ts +4 -3
  65. package/dist/client/controller.d.ts +1 -1
  66. package/dist/client/createVoiceStream.d.ts +1 -1
  67. package/dist/client/deliveryRuntime.d.ts +34 -0
  68. package/dist/client/deliveryRuntimeWidget.d.ts +37 -0
  69. package/dist/client/duplex.d.ts +2 -2
  70. package/dist/client/htmx.d.ts +1 -1
  71. package/dist/client/htmxBootstrap.js +967 -14
  72. package/dist/client/index.d.ts +104 -11
  73. package/dist/client/index.js +10215 -19
  74. package/dist/client/liveOps.d.ts +22 -0
  75. package/dist/client/liveOpsWidget.d.ts +23 -0
  76. package/dist/client/liveTurnLatency.d.ts +41 -0
  77. package/dist/client/microphone.d.ts +4 -4
  78. package/dist/client/opsActionCenter.d.ts +54 -0
  79. package/dist/client/opsActionCenterWidget.d.ts +29 -0
  80. package/dist/client/opsActionHistory.d.ts +19 -0
  81. package/dist/client/opsActionHistoryWidget.d.ts +11 -0
  82. package/dist/client/opsStatus.d.ts +19 -0
  83. package/dist/client/opsStatusWidget.d.ts +40 -0
  84. package/dist/client/platformCoverage.d.ts +19 -0
  85. package/dist/client/platformCoverageWidget.d.ts +37 -0
  86. package/dist/client/profileComparison.d.ts +19 -0
  87. package/dist/client/profileComparisonWidget.d.ts +41 -0
  88. package/dist/client/profileSwitchRecommendation.d.ts +19 -0
  89. package/dist/client/profileSwitchRecommendationWidget.d.ts +12 -0
  90. package/dist/client/proofTrends.d.ts +19 -0
  91. package/dist/client/proofTrendsWidget.d.ts +37 -0
  92. package/dist/client/providerCapabilities.d.ts +19 -0
  93. package/dist/client/providerCapabilitiesWidget.d.ts +32 -0
  94. package/dist/client/providerContracts.d.ts +19 -0
  95. package/dist/client/providerContractsWidget.d.ts +37 -0
  96. package/dist/client/providerSimulationControls.d.ts +33 -0
  97. package/dist/client/providerSimulationControlsWidget.d.ts +20 -0
  98. package/dist/client/providerStatus.d.ts +1 -1
  99. package/dist/client/providerStatusWidget.d.ts +32 -0
  100. package/dist/client/readinessFailures.d.ts +19 -0
  101. package/dist/client/readinessFailuresWidget.d.ts +42 -0
  102. package/dist/client/reconnectProfileEvidence.d.ts +19 -0
  103. package/dist/client/reconnectProfileEvidenceWidget.d.ts +39 -0
  104. package/dist/client/routingStatus.d.ts +19 -0
  105. package/dist/client/routingStatusWidget.d.ts +32 -0
  106. package/dist/client/sessionObservability.d.ts +19 -0
  107. package/dist/client/sessionObservabilityWidget.d.ts +31 -0
  108. package/dist/client/sessionSnapshot.d.ts +21 -0
  109. package/dist/client/sessionSnapshotWidget.d.ts +33 -0
  110. package/dist/client/store.d.ts +1 -1
  111. package/dist/client/traceTimeline.d.ts +19 -0
  112. package/dist/client/traceTimelineWidget.d.ts +36 -0
  113. package/dist/client/turnLatency.d.ts +22 -0
  114. package/dist/client/turnLatencyWidget.d.ts +33 -0
  115. package/dist/client/turnQuality.d.ts +19 -0
  116. package/dist/client/turnQualityWidget.d.ts +32 -0
  117. package/dist/client/workflowStatus.d.ts +1 -1
  118. package/dist/competitiveCoverage.d.ts +141 -0
  119. package/dist/correction.d.ts +2 -2
  120. package/dist/costAccounting.d.ts +76 -0
  121. package/dist/dataControl.d.ts +180 -0
  122. package/dist/deliveryRuntime.d.ts +158 -0
  123. package/dist/deliverySinkRoutes.d.ts +117 -0
  124. package/dist/demoReadyRoutes.d.ts +98 -0
  125. package/dist/diagnosticsRoutes.d.ts +2 -2
  126. package/dist/evalRoutes.d.ts +10 -4
  127. package/dist/fileStore.d.ts +21 -7
  128. package/dist/generated/htmxBootstrapBundle.d.ts +1 -0
  129. package/dist/guardrails.d.ts +128 -0
  130. package/dist/handoff.d.ts +6 -6
  131. package/dist/handoffHealth.d.ts +5 -5
  132. package/dist/htmx.d.ts +1 -1
  133. package/dist/incidentBundle.d.ts +119 -0
  134. package/dist/incidentTimeline.d.ts +260 -0
  135. package/dist/index.d.ts +260 -74
  136. package/dist/index.js +40511 -7214
  137. package/dist/ivrPlan.d.ts +40 -0
  138. package/dist/latencySlo.d.ts +56 -0
  139. package/dist/liveLatency.d.ts +78 -0
  140. package/dist/liveOps.d.ts +190 -0
  141. package/dist/llmJudge.d.ts +45 -0
  142. package/dist/logger.d.ts +1 -1
  143. package/dist/mediaPipelineRoutes.d.ts +171 -0
  144. package/dist/mediaPipelineSurfaces.d.ts +48 -0
  145. package/dist/memoryStore.d.ts +1 -1
  146. package/dist/modelAdapters.d.ts +59 -7
  147. package/dist/monitor.d.ts +148 -0
  148. package/dist/multilingualProof.d.ts +77 -0
  149. package/dist/observabilityExport.d.ts +501 -0
  150. package/dist/openaiTTS.d.ts +18 -0
  151. package/dist/operationalStatus.d.ts +87 -0
  152. package/dist/operationsRecord.d.ts +370 -0
  153. package/dist/ops.d.ts +12 -12
  154. package/dist/opsActionAuditRoutes.d.ts +99 -0
  155. package/dist/opsConsoleRoutes.d.ts +8 -5
  156. package/dist/opsPresets.d.ts +2 -2
  157. package/dist/opsRecovery.d.ts +137 -0
  158. package/dist/opsRuntime.d.ts +6 -6
  159. package/dist/opsSinks.d.ts +13 -13
  160. package/dist/opsStatus.d.ts +76 -0
  161. package/dist/opsStatusRoutes.d.ts +33 -0
  162. package/dist/opsWebhook.d.ts +6 -6
  163. package/dist/otelExporter.d.ts +83 -0
  164. package/dist/outcomeContract.d.ts +146 -0
  165. package/dist/outcomeRecipes.d.ts +4 -4
  166. package/dist/phoneAgent.d.ts +139 -0
  167. package/dist/phoneAgentProductionSmoke.d.ts +115 -0
  168. package/dist/platformCoverage.d.ts +91 -0
  169. package/dist/plugin.d.ts +2 -2
  170. package/dist/postCallAnalysis.d.ts +98 -0
  171. package/dist/postgresStore.d.ts +17 -6
  172. package/dist/presets.d.ts +3 -3
  173. package/dist/productionReadiness.d.ts +756 -0
  174. package/dist/profileSwitchRecommendation.d.ts +350 -0
  175. package/dist/proofAssertions.d.ts +32 -0
  176. package/dist/proofPack.d.ts +211 -0
  177. package/dist/proofRunner.d.ts +79 -0
  178. package/dist/proofTrends.d.ts +966 -0
  179. package/dist/providerAdapters.d.ts +16 -5
  180. package/dist/providerCapabilities.d.ts +92 -0
  181. package/dist/providerDecisionTraces.d.ts +130 -0
  182. package/dist/providerHealth.d.ts +3 -3
  183. package/dist/providerOrchestration.d.ts +109 -0
  184. package/dist/providerRouterTraces.d.ts +35 -0
  185. package/dist/providerRoutingContract.d.ts +71 -0
  186. package/dist/providerSlo.d.ts +142 -0
  187. package/dist/providerStackRecommendations.d.ts +187 -0
  188. package/dist/qualityRoutes.d.ts +4 -4
  189. package/dist/queue.d.ts +23 -14
  190. package/dist/ragTool.d.ts +47 -0
  191. package/dist/react/VoiceAgentSquadStatus.d.ts +5 -0
  192. package/dist/react/VoiceCallDebuggerLaunch.d.ts +6 -0
  193. package/dist/react/VoiceDeliveryRuntime.d.ts +7 -0
  194. package/dist/react/VoiceOpsActionCenter.d.ts +5 -0
  195. package/dist/react/VoiceOpsStatus.d.ts +6 -0
  196. package/dist/react/VoicePlatformCoverage.d.ts +6 -0
  197. package/dist/react/VoiceProfileComparison.d.ts +6 -0
  198. package/dist/react/VoiceProfileSwitchRecommendation.d.ts +6 -0
  199. package/dist/react/VoiceProofTrends.d.ts +6 -0
  200. package/dist/react/VoiceProviderCapabilities.d.ts +6 -0
  201. package/dist/react/VoiceProviderContracts.d.ts +6 -0
  202. package/dist/react/VoiceProviderSimulationControls.d.ts +5 -0
  203. package/dist/react/VoiceProviderStatus.d.ts +6 -0
  204. package/dist/react/VoiceReadinessFailures.d.ts +6 -0
  205. package/dist/react/VoiceReconnectProfileEvidence.d.ts +6 -0
  206. package/dist/react/VoiceRoutingStatus.d.ts +6 -0
  207. package/dist/react/VoiceSessionObservability.d.ts +6 -0
  208. package/dist/react/VoiceSessionSnapshot.d.ts +6 -0
  209. package/dist/react/VoiceTraceTimeline.d.ts +6 -0
  210. package/dist/react/VoiceTurnLatency.d.ts +6 -0
  211. package/dist/react/VoiceTurnQuality.d.ts +6 -0
  212. package/dist/react/index.d.ts +47 -4
  213. package/dist/react/index.js +11230 -116
  214. package/dist/react/useVoiceAgentSquadStatus.d.ts +8 -0
  215. package/dist/react/useVoiceCallDebugger.d.ts +8 -0
  216. package/dist/react/useVoiceCampaignDialerProof.d.ts +10 -0
  217. package/dist/react/useVoiceController.d.ts +4 -1
  218. package/dist/react/useVoiceDeliveryRuntime.d.ts +13 -0
  219. package/dist/react/useVoiceLiveOps.d.ts +9 -0
  220. package/dist/react/useVoiceOpsActionCenter.d.ts +11 -0
  221. package/dist/react/useVoiceOpsStatus.d.ts +8 -0
  222. package/dist/react/useVoicePlatformCoverage.d.ts +8 -0
  223. package/dist/react/useVoiceProfileComparison.d.ts +8 -0
  224. package/dist/react/useVoiceProfileSwitchRecommendation.d.ts +8 -0
  225. package/dist/react/useVoiceProofTrends.d.ts +8 -0
  226. package/dist/react/useVoiceProviderCapabilities.d.ts +8 -0
  227. package/dist/react/useVoiceProviderContracts.d.ts +8 -0
  228. package/dist/react/useVoiceProviderSimulationControls.d.ts +10 -0
  229. package/dist/react/useVoiceProviderStatus.d.ts +1 -1
  230. package/dist/react/useVoiceReadinessFailures.d.ts +8 -0
  231. package/dist/react/useVoiceReconnectProfileEvidence.d.ts +8 -0
  232. package/dist/react/useVoiceRoutingStatus.d.ts +8 -0
  233. package/dist/react/useVoiceSessionObservability.d.ts +8 -0
  234. package/dist/react/useVoiceSessionSnapshot.d.ts +9 -0
  235. package/dist/react/useVoiceStream.d.ts +4 -1
  236. package/dist/react/useVoiceTraceTimeline.d.ts +8 -0
  237. package/dist/react/useVoiceTurnLatency.d.ts +9 -0
  238. package/dist/react/useVoiceTurnQuality.d.ts +8 -0
  239. package/dist/react/useVoiceWorkflowStatus.d.ts +1 -1
  240. package/dist/readinessProfiles.d.ts +45 -0
  241. package/dist/realtimeChannel.d.ts +136 -0
  242. package/dist/realtimeProviderContracts.d.ts +133 -0
  243. package/dist/reconnectContract.d.ts +176 -0
  244. package/dist/recordingStore.d.ts +21 -0
  245. package/dist/redaction.d.ts +13 -0
  246. package/dist/resilienceRoutes.d.ts +45 -5
  247. package/dist/routing.d.ts +1 -1
  248. package/dist/runtimeOps.d.ts +3 -3
  249. package/dist/s3Store.d.ts +18 -3
  250. package/dist/semanticTurn.d.ts +27 -0
  251. package/dist/session.d.ts +1 -1
  252. package/dist/sessionObservability.d.ts +145 -0
  253. package/dist/sessionReplay.d.ts +19 -7
  254. package/dist/sessionSnapshot.d.ts +109 -0
  255. package/dist/simulationSuite.d.ts +143 -0
  256. package/dist/sloCalibration.d.ts +185 -0
  257. package/dist/sqliteStore.d.ts +17 -6
  258. package/dist/store.d.ts +1 -1
  259. package/dist/svelte/createVoiceAgentSquadStatus.d.ts +9 -0
  260. package/dist/svelte/createVoiceCallDebugger.d.ts +12 -0
  261. package/dist/svelte/createVoiceCampaignDialerProof.d.ts +9 -0
  262. package/dist/svelte/createVoiceDeliveryRuntime.d.ts +11 -0
  263. package/dist/svelte/createVoiceLiveOps.d.ts +13 -0
  264. package/dist/svelte/createVoiceOpsActionCenter.d.ts +10 -0
  265. package/dist/svelte/createVoiceOpsStatus.d.ts +9 -0
  266. package/dist/svelte/createVoicePlatformCoverage.d.ts +7 -0
  267. package/dist/svelte/createVoiceProfileComparison.d.ts +7 -0
  268. package/dist/svelte/createVoiceProofTrends.d.ts +7 -0
  269. package/dist/svelte/createVoiceProviderCapabilities.d.ts +10 -0
  270. package/dist/svelte/createVoiceProviderContracts.d.ts +10 -0
  271. package/dist/svelte/createVoiceProviderSimulationControls.d.ts +11 -0
  272. package/dist/svelte/createVoiceProviderStatus.d.ts +4 -2
  273. package/dist/svelte/createVoiceReadinessFailures.d.ts +7 -0
  274. package/dist/svelte/createVoiceReconnectProfileEvidence.d.ts +7 -0
  275. package/dist/svelte/createVoiceRoutingStatus.d.ts +10 -0
  276. package/dist/svelte/createVoiceSessionObservability.d.ts +10 -0
  277. package/dist/svelte/createVoiceSessionSnapshot.d.ts +13 -0
  278. package/dist/svelte/createVoiceStream.d.ts +1 -1
  279. package/dist/svelte/createVoiceTraceTimeline.d.ts +10 -0
  280. package/dist/svelte/createVoiceTurnLatency.d.ts +11 -0
  281. package/dist/svelte/createVoiceTurnQuality.d.ts +10 -0
  282. package/dist/svelte/createVoiceWorkflowStatus.d.ts +1 -1
  283. package/dist/svelte/index.d.ts +25 -4
  284. package/dist/svelte/index.js +5956 -462
  285. package/dist/telephony/contract.d.ts +61 -0
  286. package/dist/telephony/matrix.d.ts +97 -0
  287. package/dist/telephony/plivo.d.ts +303 -0
  288. package/dist/telephony/response.d.ts +1 -1
  289. package/dist/telephony/security.d.ts +182 -0
  290. package/dist/telephony/telnyx.d.ts +291 -0
  291. package/dist/telephony/twilio.d.ts +147 -13
  292. package/dist/telephonyMediaRoutes.d.ts +72 -0
  293. package/dist/telephonyOutcome.d.ts +273 -0
  294. package/dist/testing/accuracy.d.ts +1 -1
  295. package/dist/testing/benchmark.d.ts +9 -9
  296. package/dist/testing/corrected.d.ts +5 -5
  297. package/dist/testing/duplex.d.ts +3 -3
  298. package/dist/testing/fixtures.d.ts +3 -3
  299. package/dist/testing/index.d.ts +13 -13
  300. package/dist/testing/index.js +5199 -175
  301. package/dist/testing/ioProviderSimulator.d.ts +5 -5
  302. package/dist/testing/providerSimulator.d.ts +5 -5
  303. package/dist/testing/review.d.ts +4 -4
  304. package/dist/testing/sessionBenchmark.d.ts +3 -3
  305. package/dist/testing/stt.d.ts +3 -3
  306. package/dist/testing/telephony.d.ts +25 -0
  307. package/dist/testing/tts.d.ts +1 -1
  308. package/dist/toolContract.d.ts +161 -0
  309. package/dist/toolRuntime.d.ts +50 -0
  310. package/dist/trace.d.ts +46 -7
  311. package/dist/traceDeliveryRoutes.d.ts +86 -0
  312. package/dist/traceTimeline.d.ts +97 -0
  313. package/dist/turnDetection.d.ts +1 -1
  314. package/dist/turnLatency.d.ts +95 -0
  315. package/dist/turnProfiles.d.ts +2 -2
  316. package/dist/turnQuality.d.ts +94 -0
  317. package/dist/types.d.ts +277 -80
  318. package/dist/vapiAdapter.d.ts +160 -0
  319. package/dist/voiceMonitoring.d.ts +444 -0
  320. package/dist/vue/VoiceCallDebuggerLaunch.d.ts +68 -0
  321. package/dist/vue/VoiceDeliveryRuntime.d.ts +30 -0
  322. package/dist/vue/VoiceOpsActionCenter.d.ts +13 -0
  323. package/dist/vue/VoiceOpsStatus.d.ts +30 -0
  324. package/dist/vue/VoicePlatformCoverage.d.ts +23 -0
  325. package/dist/vue/VoiceProofTrends.d.ts +21 -0
  326. package/dist/vue/VoiceProviderCapabilities.d.ts +51 -0
  327. package/dist/vue/VoiceProviderContracts.d.ts +21 -0
  328. package/dist/vue/VoiceProviderSimulationControls.d.ts +88 -0
  329. package/dist/vue/VoiceProviderStatus.d.ts +51 -0
  330. package/dist/vue/VoiceReadinessFailures.d.ts +21 -0
  331. package/dist/vue/VoiceReconnectProfileEvidence.d.ts +21 -0
  332. package/dist/vue/VoiceRoutingStatus.d.ts +51 -0
  333. package/dist/vue/VoiceSessionObservability.d.ts +23 -0
  334. package/dist/vue/VoiceSessionSnapshot.d.ts +68 -0
  335. package/dist/vue/VoiceTurnLatency.d.ts +69 -0
  336. package/dist/vue/VoiceTurnQuality.d.ts +51 -0
  337. package/dist/vue/index.d.ts +42 -4
  338. package/dist/vue/index.js +10642 -135
  339. package/dist/vue/useVoiceAgentSquadStatus.d.ts +9 -0
  340. package/dist/vue/useVoiceCallDebugger.d.ts +10 -0
  341. package/dist/vue/useVoiceCampaignDialerProof.d.ts +11 -0
  342. package/dist/vue/useVoiceController.d.ts +4 -2
  343. package/dist/vue/useVoiceDeliveryRuntime.d.ts +13 -0
  344. package/dist/vue/useVoiceLiveOps.d.ts +9 -0
  345. package/dist/vue/useVoiceOpsActionCenter.d.ts +11 -0
  346. package/dist/vue/useVoiceOpsStatus.d.ts +9 -0
  347. package/dist/vue/useVoicePlatformCoverage.d.ts +9 -0
  348. package/dist/vue/useVoiceProfileComparison.d.ts +9 -0
  349. package/dist/vue/useVoiceProofTrends.d.ts +9 -0
  350. package/dist/vue/useVoiceProviderCapabilities.d.ts +9 -0
  351. package/dist/vue/useVoiceProviderContracts.d.ts +9 -0
  352. package/dist/vue/useVoiceProviderSimulationControls.d.ts +24 -0
  353. package/dist/vue/useVoiceProviderStatus.d.ts +3 -3
  354. package/dist/vue/useVoiceReadinessFailures.d.ts +959 -0
  355. package/dist/vue/useVoiceReconnectProfileEvidence.d.ts +9 -0
  356. package/dist/vue/useVoiceRoutingStatus.d.ts +8 -0
  357. package/dist/vue/useVoiceSessionObservability.d.ts +9 -0
  358. package/dist/vue/useVoiceSessionSnapshot.d.ts +10 -0
  359. package/dist/vue/useVoiceStream.d.ts +5 -2
  360. package/dist/vue/useVoiceTraceTimeline.d.ts +9 -0
  361. package/dist/vue/useVoiceTurnLatency.d.ts +10 -0
  362. package/dist/vue/useVoiceTurnQuality.d.ts +9 -0
  363. package/dist/vue/useVoiceWorkflowStatus.d.ts +3 -3
  364. package/dist/webhookVerification.d.ts +27 -0
  365. package/dist/workflowContract.d.ts +8 -8
  366. package/fixtures/manifest.json +356 -197
  367. package/package.json +265 -256
  368. package/dist/appKit.d.ts +0 -44
package/dist/types.d.ts CHANGED
@@ -1,24 +1,29 @@
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 { 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: 'raw';
8
- encoding: 'alaw' | 'mulaw' | 'pcm_s16le';
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: 'auto-detect';
19
+ mode: "auto-detect";
15
20
  allowedLanguages?: string[];
16
21
  } | {
17
- mode: 'fixed';
22
+ mode: "fixed";
18
23
  primaryLanguage: string;
19
24
  secondaryLanguages?: string[];
20
25
  } | {
21
- mode: 'allow-switching';
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 = 'safe' | 'balanced' | 'risky';
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: 'fallback' | 'primary';
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 = 'fallback-empty' | 'primary-empty' | 'word-count-margin' | 'confidence-margin' | 'word-count-tiebreak' | 'kept-primary';
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: 'empty-turn' | 'low-confidence' | 'empty-or-low-confidence' | 'always';
102
+ trigger: "empty-turn" | "low-confidence" | "empty-or-low-confidence" | "always";
98
103
  };
99
104
  export type VoicePartialEvent = {
100
- type: 'partial';
105
+ type: "partial";
101
106
  transcript: Transcript;
102
107
  receivedAt: number;
103
108
  };
104
109
  export type VoiceFinalEvent = {
105
- type: 'final';
110
+ type: "final";
106
111
  transcript: Transcript;
107
112
  receivedAt: number;
108
113
  };
109
114
  export type VoiceEndOfTurnEvent = {
110
- type: 'endOfTurn';
111
- reason: 'vendor' | 'silence' | 'manual';
115
+ type: "endOfTurn";
116
+ reason: "vendor" | "silence" | "manual";
112
117
  receivedAt: number;
113
118
  };
114
119
  export type VoiceErrorEvent = {
115
- type: 'error';
120
+ type: "error";
116
121
  error: Error;
117
122
  recoverable: boolean;
118
123
  code?: string;
119
124
  };
120
125
  export type VoiceCloseEvent = {
121
- type: 'close';
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: 'stt';
152
+ kind: "stt";
148
153
  open: (options: TOptions) => Promise<STTAdapterSession> | STTAdapterSession;
149
154
  };
150
155
  export type TTSAudioEvent = {
151
- type: 'audio';
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: 'tts';
181
+ kind: "tts";
173
182
  open: (options: TOptions) => Promise<TTSAdapterSession> | TTSAdapterSession;
174
183
  };
175
184
  export type RealtimeSessionEventMap = STTSessionEventMap & {
@@ -185,14 +194,26 @@ export type RealtimeAdapterOpenOptions = {
185
194
  format: AudioFormat;
186
195
  languageStrategy?: VoiceLanguageStrategy;
187
196
  lexicon?: VoiceLexiconEntry[];
197
+ modalities?: ReadonlyArray<"audio" | "text">;
188
198
  phraseHints?: VoicePhraseHint[];
199
+ promptCacheKey?: string;
200
+ semanticVAD?: import("./assistantMode").VoiceSemanticVADConfig;
189
201
  signal?: AbortSignal;
190
202
  };
191
203
  export type RealtimeAdapter<TOptions extends RealtimeAdapterOpenOptions = RealtimeAdapterOpenOptions> = {
192
- kind: 'realtime';
204
+ kind: "realtime";
193
205
  open: (options: TOptions) => Promise<RealtimeAdapterSession> | RealtimeAdapterSession;
194
206
  };
195
- export type VoiceSessionStatus = 'active' | 'reconnecting' | 'completed' | 'failed';
207
+ export type VoiceSessionStatus = "active" | "reconnecting" | "completed" | "failed";
208
+ export type VoiceReconnectClientStatus = "idle" | "reconnecting" | "resumed" | "exhausted";
209
+ export type VoiceReconnectClientState = {
210
+ attempts: number;
211
+ lastDisconnectAt?: number;
212
+ lastResumedAt?: number;
213
+ maxAttempts: number;
214
+ nextAttemptAt?: number;
215
+ status: VoiceReconnectClientStatus;
216
+ };
196
217
  export type VoiceTurnRecord<TResult = unknown> = {
197
218
  id: string;
198
219
  text: string;
@@ -253,10 +274,10 @@ export type VoiceSessionSummary = {
253
274
  status: VoiceSessionStatus;
254
275
  turnCount: number;
255
276
  };
256
- export type VoiceCallDisposition = 'completed' | 'transferred' | 'escalated' | 'voicemail' | 'no-answer' | 'failed' | 'closed';
277
+ export type VoiceCallDisposition = "completed" | "transferred" | "escalated" | "voicemail" | "no-answer" | "failed" | "silence-timeout" | "closed";
257
278
  export type VoiceCallLifecycleEvent = {
258
279
  at: number;
259
- type: 'start' | 'end' | 'transfer' | 'escalation' | 'voicemail' | 'no-answer';
280
+ type: "start" | "end" | "transfer" | "escalation" | "voicemail" | "no-answer";
260
281
  disposition?: VoiceCallDisposition;
261
282
  metadata?: Record<string, unknown>;
262
283
  reason?: string;
@@ -269,8 +290,8 @@ export type VoiceCallLifecycleState = {
269
290
  lastEventAt: number;
270
291
  startedAt: number;
271
292
  };
272
- export type VoiceHandoffAction = 'escalate' | 'no-answer' | 'transfer' | 'voicemail';
273
- export type VoiceHandoffStatus = 'delivered' | 'failed' | 'skipped';
293
+ export type VoiceHandoffAction = "escalate" | "no-answer" | "transfer" | "voicemail";
294
+ export type VoiceHandoffStatus = "delivered" | "failed" | "skipped";
274
295
  export type VoiceHandoffResult = {
275
296
  deliveredAt?: number;
276
297
  deliveredTo?: string;
@@ -278,7 +299,7 @@ export type VoiceHandoffResult = {
278
299
  metadata?: Record<string, unknown>;
279
300
  status: VoiceHandoffStatus;
280
301
  };
281
- export type VoiceHandoffDeliveryQueueStatus = VoiceHandoffStatus | 'pending';
302
+ export type VoiceHandoffDeliveryQueueStatus = VoiceHandoffStatus | "pending";
282
303
  export type StoredVoiceHandoffDelivery<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = {
283
304
  action: VoiceHandoffAction;
284
305
  context: TContext;
@@ -326,7 +347,7 @@ export type VoiceHandoffConfig<TContext = unknown, TSession extends VoiceSession
326
347
  adapters: VoiceHandoffAdapter<TContext, TSession, TResult>[];
327
348
  deliveryQueue?: VoiceHandoffDeliveryStore<StoredVoiceHandoffDelivery<TContext, TSession, TResult>>;
328
349
  enqueueOnly?: boolean;
329
- failMode?: 'record' | 'throw';
350
+ failMode?: "record" | "throw";
330
351
  };
331
352
  export type VoiceSessionStore<TSession extends VoiceSessionRecord = VoiceSessionRecord> = SessionStore<TSession, VoiceSessionSummary>;
332
353
  export type VoiceLogger = {
@@ -336,15 +357,15 @@ export type VoiceLogger = {
336
357
  error?: (message: string, meta?: Record<string, unknown>) => void;
337
358
  };
338
359
  export type VoiceReconnectConfig = {
339
- strategy?: 'resume-last-turn' | 'restart' | 'fail';
360
+ strategy?: "resume-last-turn" | "restart" | "fail";
340
361
  timeout?: number;
341
362
  maxAttempts?: number;
342
363
  };
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';
364
+ export type VoiceRuntimePreset = "default" | "chat" | "guided-intake" | "dictation" | "noisy-room" | "pstn-balanced" | "pstn-fast" | "reliability";
365
+ export type VoiceSTTLifecycle = "continuous" | "turn-scoped";
366
+ export type VoiceTurnProfile = "fast" | "balanced" | "long-form";
367
+ export type VoiceTurnQualityProfile = "general" | "accent-heavy" | "noisy-room" | "short-command";
368
+ export type VoiceTurnFallbackTrigger = "empty-turn" | "low-confidence" | "empty-or-low-confidence" | "always";
348
369
  export type VoiceSTTFallbackConfig = {
349
370
  adapter: STTAdapter;
350
371
  trigger?: VoiceTurnFallbackTrigger;
@@ -397,11 +418,25 @@ export type VoiceSocket = {
397
418
  send: (data: string | Uint8Array | ArrayBuffer) => void | Promise<void>;
398
419
  close: (code?: number, reason?: string) => void | Promise<void>;
399
420
  };
421
+ export type VoiceMonitorRuntimeSessionBinding = {
422
+ deregister: (reason?: string) => void;
423
+ emitAudio: (chunk: Uint8Array | ArrayBuffer, options?: {
424
+ source?: "assistant" | "caller" | (string & {});
425
+ }) => void;
426
+ };
427
+ export type VoiceMonitorRuntimeRegisterInput = {
428
+ handle: VoiceSessionHandle<unknown, VoiceSessionRecord, unknown>;
429
+ metadata?: Record<string, unknown>;
430
+ sessionId: string;
431
+ };
432
+ export type VoiceMonitorRuntimeBinding = {
433
+ registerSession: (input: VoiceMonitorRuntimeRegisterInput) => VoiceMonitorRuntimeSessionBinding;
434
+ };
400
435
  export type VoiceSessionHandle<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = {
401
436
  id: string;
402
437
  connect: (socket: VoiceSocket) => Promise<void>;
403
438
  receiveAudio: (audio: AudioChunk) => Promise<void>;
404
- commitTurn: (reason?: VoiceEndOfTurnEvent['reason']) => Promise<void>;
439
+ commitTurn: (reason?: VoiceEndOfTurnEvent["reason"]) => Promise<void>;
405
440
  disconnect: (event?: VoiceCloseEvent) => Promise<void>;
406
441
  complete: (result?: TResult) => Promise<void>;
407
442
  escalate: (input: {
@@ -423,6 +458,7 @@ export type VoiceSessionHandle<TContext = unknown, TSession extends VoiceSession
423
458
  reason?: string;
424
459
  result?: TResult;
425
460
  target: string;
461
+ transferMode?: "cold" | "warm";
426
462
  }) => Promise<void>;
427
463
  close: (reason?: string) => Promise<void>;
428
464
  snapshot: () => Promise<TSession>;
@@ -435,6 +471,7 @@ export type VoiceRouteResult<TResult = unknown> = {
435
471
  metadata?: Record<string, unknown>;
436
472
  reason?: string;
437
473
  target: string;
474
+ transferMode?: "cold" | "warm";
438
475
  };
439
476
  escalate?: {
440
477
  metadata?: Record<string, unknown>;
@@ -475,6 +512,10 @@ export type VoiceLexiconResolver<TContext = unknown> = (input: {
475
512
  }) => Promise<VoiceLexiconEntry[] | void> | VoiceLexiconEntry[] | void;
476
513
  export type VoiceOnTurnObjectHandler<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = (input: {
477
514
  context: TContext;
515
+ liveOps?: {
516
+ control: VoiceLiveOpsControlState;
517
+ injectedInstruction?: string;
518
+ };
478
519
  session: TSession;
479
520
  turn: VoiceTurnRecord;
480
521
  api: VoiceSessionHandle<TContext, TSession, TResult>;
@@ -559,7 +600,7 @@ export type VoiceRuntimeOpsConfig<TContext = unknown, TSession extends VoiceSess
559
600
  disposition: VoiceCallDisposition;
560
601
  review: StoredVoiceCallReviewArtifact;
561
602
  session: TSession;
562
- }) => Promise<Omit<VoiceOpsTask, 'id'> | VoiceOpsTask | StoredVoiceOpsTask | null | void> | Omit<VoiceOpsTask, 'id'> | VoiceOpsTask | StoredVoiceOpsTask | null | void;
603
+ }) => Promise<Omit<VoiceOpsTask, "id"> | VoiceOpsTask | StoredVoiceOpsTask | null | void> | Omit<VoiceOpsTask, "id"> | VoiceOpsTask | StoredVoiceOpsTask | null | void;
563
604
  resolveTaskPolicy?: (input: {
564
605
  api: VoiceSessionHandle<TContext, TSession, TResult>;
565
606
  context: TContext;
@@ -596,7 +637,37 @@ export type VoiceRuntimeOpsConfig<TContext = unknown, TSession extends VoiceSess
596
637
  tasks?: VoiceOpsTaskStore;
597
638
  webhook?: VoiceIntegrationWebhookConfig;
598
639
  };
599
- export type VoiceNormalizedRouteConfig<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = Omit<VoiceRouteConfig<TContext, TSession, TResult>, 'onTurn'> & {
640
+ export type VoiceLiveOpsRuntimeConfig = {
641
+ getControl: (sessionId: string) => Promise<VoiceLiveOpsControlState | null | undefined> | VoiceLiveOpsControlState | null | undefined;
642
+ };
643
+ export type VoiceProfileSwitchGuardResolverInput<TContext = unknown> = {
644
+ context: TContext;
645
+ scenarioId?: string;
646
+ sessionId: string;
647
+ };
648
+ export type VoicePluginProfileSwitchGuardConfig<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = {
649
+ actor?: VoiceAuditActor;
650
+ allowedProfileIds?: string[] | ((input: VoiceProfileSwitchGuardResolverInput<TContext>) => Promise<string[] | undefined> | string[] | undefined);
651
+ audit?: VoiceAuditEventStore;
652
+ blockedProfileIds?: string[] | ((input: VoiceProfileSwitchGuardResolverInput<TContext>) => Promise<string[] | undefined> | string[] | undefined);
653
+ currentProfileId?: string | ((input: VoiceProfileSwitchGuardResolverInput<TContext>) => Promise<string | undefined> | string | undefined);
654
+ defaultProfileId?: string;
655
+ defaults: VoiceRealCallProfileDefaultsReport | VoiceRealCallProfileHistoryReport | ((input: VoiceProfileSwitchGuardResolverInput<TContext>) => Promise<VoiceRealCallProfileDefaultsReport | VoiceRealCallProfileHistoryReport> | VoiceRealCallProfileDefaultsReport | VoiceRealCallProfileHistoryReport);
656
+ metadata?: Record<string, unknown> | ((input: VoiceProfileSwitchGuardResolverInput<TContext>) => Promise<Record<string, unknown> | undefined> | Record<string, unknown> | undefined);
657
+ minConfidence?: number | ((input: VoiceProfileSwitchGuardResolverInput<TContext>) => Promise<number | undefined> | number | undefined);
658
+ maxAutoSwitchesPerSession?: number | ((input: VoiceProfileSwitchGuardResolverInput<TContext>) => Promise<number | undefined> | number | undefined);
659
+ mode?: VoiceProfileSwitchGuardMode | ((input: VoiceProfileSwitchGuardResolverInput<TContext>) => Promise<VoiceProfileSwitchGuardMode | undefined> | VoiceProfileSwitchGuardMode | undefined);
660
+ observed?: VoiceProfileSwitchObservedSignals | ((input: VoiceProfileSwitchGuardResolverInput<TContext>) => Promise<VoiceProfileSwitchObservedSignals | undefined> | VoiceProfileSwitchObservedSignals | undefined);
661
+ onDecision?: (input: {
662
+ context: TContext;
663
+ decision: VoiceProfileSwitchGuardDecision;
664
+ scenarioId?: string;
665
+ sessionId: string;
666
+ }) => Promise<void> | void;
667
+ sessionMetadataKey?: string | false;
668
+ trace?: false | VoiceTraceEventStore;
669
+ };
670
+ export type VoiceNormalizedRouteConfig<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = Omit<VoiceRouteConfig<TContext, TSession, TResult>, "onTurn"> & {
600
671
  onTurn: VoiceOnTurnObjectHandler<TContext, TSession, TResult>;
601
672
  };
602
673
  export type VoiceScenario = {
@@ -616,9 +687,11 @@ export type VoicePluginConfig<TContext = unknown, TSession extends VoiceSessionR
616
687
  lexicon?: VoiceLexiconEntry[] | VoiceLexiconResolver<TContext>;
617
688
  phraseHints?: VoicePhraseHint[] | VoicePhraseHintResolver<TContext>;
618
689
  preset?: VoiceRuntimePreset;
619
- stt: STTAdapter;
690
+ stt?: STTAdapter;
620
691
  sttFallback?: VoiceSTTFallbackConfig;
621
692
  sttLifecycle?: VoiceSTTLifecycle;
693
+ realtime?: RealtimeAdapter;
694
+ realtimeInputFormat?: AudioFormat;
622
695
  tts?: TTSAdapter;
623
696
  session: VoiceSessionStore<NoInfer<TSession>>;
624
697
  reconnect?: VoiceReconnectConfig;
@@ -628,112 +701,174 @@ export type VoicePluginConfig<TContext = unknown, TSession extends VoiceSessionR
628
701
  htmx?: boolean | VoiceHTMXConfig<TSession, NoInfer<TResult>>;
629
702
  handoff?: VoiceHandoffConfig<TContext, TSession, TResult>;
630
703
  ops?: VoiceRuntimeOpsConfig<TContext, TSession, TResult>;
704
+ liveOps?: VoiceLiveOpsRuntimeConfig;
705
+ monitor?: VoiceMonitorRuntimeBinding;
706
+ profileSwitchGuard?: VoicePluginProfileSwitchGuardConfig<TContext, TSession, TResult>;
631
707
  trace?: VoiceTraceEventStore;
632
708
  } & VoiceRouteConfig<TContext, TSession, TResult>;
709
+ export type VoiceSessionRecordingConfig = {
710
+ channels?: ReadonlyArray<"assistant" | "user">;
711
+ maxBytesPerChannel?: number;
712
+ store: import("./recordingStore").VoiceRecordingStore;
713
+ userInputFormat?: AudioFormat;
714
+ };
633
715
  export type CreateVoiceSessionOptions<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = {
634
716
  costTelemetry?: VoiceCostTelemetryConfig<TContext, TSession, TResult>;
635
717
  id: string;
636
718
  context: TContext;
637
719
  socket: VoiceSocket;
638
- stt: STTAdapter;
720
+ stt?: STTAdapter;
721
+ realtime?: RealtimeAdapter;
722
+ realtimeInputFormat?: AudioFormat;
639
723
  tts?: TTSAdapter;
640
724
  languageStrategy?: VoiceLanguageStrategy;
641
725
  lexicon?: VoiceLexiconEntry[];
642
726
  sttFallback?: VoiceResolvedSTTFallbackConfig;
643
727
  store: VoiceSessionStore<TSession>;
644
728
  trace?: VoiceTraceEventStore;
729
+ recording?: VoiceSessionRecordingConfig;
730
+ callSilenceTimeoutMs?: number;
731
+ amd?: import("./amdDetector").VoiceAMDDetector<TContext, TSession, TResult>;
732
+ costAccountant?: import("./costAccounting").VoiceCostAccountant;
733
+ costTelephony?: {
734
+ provider?: string;
735
+ };
736
+ redact?: import("./redaction").VoiceTranscriptRedactor;
737
+ semanticTurnDetector?: import("./semanticTurn").VoiceSemanticTurnDetector;
738
+ assistantMode?: import("./assistantMode").VoiceAssistantMode;
739
+ modalities?: ReadonlyArray<"audio" | "text">;
645
740
  reconnect: Required<VoiceReconnectConfig>;
646
741
  phraseHints?: VoicePhraseHint[];
742
+ sessionMetadata?: Record<string, unknown>;
647
743
  scenarioId?: string;
648
744
  sttLifecycle: VoiceSTTLifecycle;
649
745
  turnDetection: VoiceResolvedTurnDetectionConfig;
650
746
  audioConditioning?: VoiceResolvedAudioConditioningConfig;
651
747
  handoff?: VoiceHandoffConfig<TContext, TSession, TResult>;
748
+ liveOps?: VoiceLiveOpsRuntimeConfig;
652
749
  route: VoiceNormalizedRouteConfig<TContext, TSession, TResult>;
653
750
  logger?: VoiceLogger;
654
751
  };
655
752
  export type CreateVoiceSession = <TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown>(options: CreateVoiceSessionOptions<TContext, TSession, TResult>) => VoiceSessionHandle<TContext, TSession, TResult>;
656
753
  export type VoiceClientStartMessage = {
657
- type: 'start';
754
+ type: "start";
658
755
  sessionId?: string;
659
756
  scenarioId?: string;
660
757
  };
661
758
  export type VoiceClientEndTurnMessage = {
662
- type: 'end_turn';
759
+ type: "end_turn";
663
760
  };
664
761
  export type VoiceClientCloseMessage = {
665
- type: 'close';
762
+ type: "close";
666
763
  reason?: string;
667
764
  };
668
765
  export type VoiceClientCallControlMessage = {
669
- type: 'call_control';
670
- action: 'complete' | 'escalate' | 'no-answer' | 'transfer' | 'voicemail';
766
+ type: "call_control";
767
+ action: "complete" | "escalate" | "no-answer" | "transfer" | "voicemail";
671
768
  metadata?: Record<string, unknown>;
672
769
  reason?: string;
673
770
  target?: string;
674
771
  };
675
772
  export type VoiceClientPingMessage = {
676
- type: 'ping';
773
+ type: "ping";
677
774
  };
678
775
  export type VoiceClientMessage = VoiceClientStartMessage | VoiceClientEndTurnMessage | VoiceClientCloseMessage | VoiceClientCallControlMessage | VoiceClientPingMessage;
679
776
  export type VoiceServerSessionMessage = {
680
- type: 'session';
777
+ type: "session";
681
778
  sessionId: string;
682
779
  status: VoiceSessionStatus;
683
780
  scenarioId?: string;
781
+ sessionMetadata?: Record<string, unknown>;
782
+ };
783
+ export type VoiceServerReplayMessage<TResult = unknown> = {
784
+ type: "replay";
785
+ assistantTexts: string[];
786
+ call?: VoiceCallLifecycleState;
787
+ partial: string;
788
+ scenarioId?: string;
789
+ sessionId: string;
790
+ sessionMetadata?: Record<string, unknown>;
791
+ status: VoiceSessionStatus;
792
+ turns: VoiceTurnRecord<TResult>[];
684
793
  };
685
794
  export type VoiceServerPartialMessage = {
686
- type: 'partial';
795
+ type: "partial";
687
796
  transcript: Transcript;
688
797
  };
689
798
  export type VoiceServerFinalMessage = {
690
- type: 'final';
799
+ type: "final";
691
800
  transcript: Transcript;
692
801
  };
693
802
  export type VoiceServerTurnMessage<TResult = unknown> = {
694
- type: 'turn';
803
+ type: "turn";
695
804
  turn: VoiceTurnRecord<TResult>;
696
805
  };
697
806
  export type VoiceServerAssistantMessage = {
698
- type: 'assistant';
807
+ type: "assistant";
699
808
  text: string;
700
809
  turnId?: string;
701
810
  };
702
811
  export type VoiceServerAudioMessage = {
703
- type: 'audio';
812
+ type: "audio";
704
813
  chunkBase64: string;
705
814
  format: AudioFormat;
706
815
  receivedAt: number;
707
816
  turnId?: string;
708
817
  };
709
818
  export type VoiceServerCompleteMessage = {
710
- type: 'complete';
819
+ type: "complete";
711
820
  sessionId: string;
712
821
  };
713
822
  export type VoiceServerCallLifecycleMessage = {
714
- type: 'call_lifecycle';
823
+ type: "call_lifecycle";
715
824
  event: VoiceCallLifecycleEvent;
716
825
  sessionId: string;
717
826
  };
718
827
  export type VoiceServerErrorMessage = {
719
- type: 'error';
828
+ type: "error";
720
829
  message: string;
721
830
  recoverable?: boolean;
722
831
  };
723
832
  export type VoiceServerPongMessage = {
724
- type: 'pong';
833
+ type: "pong";
725
834
  };
726
- export type VoiceServerMessage<TResult = unknown> = VoiceServerSessionMessage | VoiceServerPartialMessage | VoiceServerFinalMessage | VoiceServerTurnMessage<TResult> | VoiceServerAssistantMessage | VoiceServerAudioMessage | VoiceServerCallLifecycleMessage | VoiceServerCompleteMessage | VoiceServerErrorMessage | VoiceServerPongMessage;
835
+ export type VoiceServerConnectionMessage = {
836
+ type: "connection";
837
+ reconnect: VoiceReconnectClientState;
838
+ };
839
+ export type VoiceServerMessage<TResult = unknown> = VoiceServerSessionMessage | VoiceServerReplayMessage<TResult> | VoiceServerPartialMessage | VoiceServerFinalMessage | VoiceServerTurnMessage<TResult> | VoiceServerAssistantMessage | VoiceServerAudioMessage | VoiceServerCallLifecycleMessage | VoiceServerCompleteMessage | VoiceServerErrorMessage | VoiceServerPongMessage | VoiceServerConnectionMessage;
727
840
  export type VoiceConnectionOptions = {
841
+ browserMedia?: false | VoiceBrowserMediaReporterOptions;
728
842
  protocols?: string[];
729
843
  scenarioId?: string;
730
844
  reconnect?: boolean;
845
+ reconnectReportPath?: string;
731
846
  maxReconnectAttempts?: number;
732
847
  pingInterval?: number;
733
848
  sessionId?: string;
734
849
  };
850
+ export type VoiceBrowserMediaReportPayload = {
851
+ at: number;
852
+ continuity?: MediaWebRTCStreamContinuityReport;
853
+ report: MediaWebRTCStatsReport;
854
+ scenarioId?: string | null;
855
+ sessionId?: string | null;
856
+ };
857
+ export type VoiceBrowserMediaReporterOptions = Omit<MediaWebRTCStatsReportInput, "peerConnection"> & {
858
+ fetch?: typeof fetch;
859
+ getPeerConnection?: (() => MediaWebRTCStatsCollector | null | undefined) | (() => Promise<MediaWebRTCStatsCollector | null | undefined>);
860
+ getScenarioId?: () => string | null | undefined;
861
+ getSessionId?: () => string | null | undefined;
862
+ intervalMs?: number;
863
+ continuity?: false | Omit<MediaWebRTCStreamContinuityInput, "previousStats" | "stats">;
864
+ onError?: (error: unknown) => void;
865
+ onReport?: (payload: VoiceBrowserMediaReportPayload) => void;
866
+ path?: string;
867
+ peerConnection?: MediaWebRTCStatsCollector;
868
+ };
735
869
  export type VoiceCaptureOptions = {
736
870
  channelCount?: 1 | 2;
871
+ onAudio?: (audio: Uint8Array | ArrayBuffer, sendAudio: (audio: Uint8Array | ArrayBuffer) => void) => void;
737
872
  onLevel?: (level: number) => void;
738
873
  sampleRateHz?: number;
739
874
  };
@@ -747,6 +882,46 @@ export type VoiceBargeInOptions = {
747
882
  enabled?: boolean;
748
883
  interruptOnPartial?: boolean;
749
884
  interruptThreshold?: number;
885
+ monitor?: VoiceBargeInMonitor;
886
+ };
887
+ export type VoiceBargeInTriggerReason = "input-level" | "manual-audio" | "manual-interrupt" | "partial-transcript";
888
+ export type VoiceBargeInMonitorEvent = {
889
+ at: number;
890
+ id: string;
891
+ latencyMs?: number;
892
+ playbackStopLatencyMs?: number;
893
+ reason: VoiceBargeInTriggerReason;
894
+ sessionId?: string | null;
895
+ status: "requested" | "stopped" | "skipped";
896
+ thresholdMs?: number;
897
+ };
898
+ export type VoiceBargeInMonitorSnapshot = {
899
+ averageLatencyMs?: number;
900
+ events: VoiceBargeInMonitorEvent[];
901
+ failed: number;
902
+ lastEvent?: VoiceBargeInMonitorEvent;
903
+ passed: number;
904
+ status: "empty" | "fail" | "pass" | "warn";
905
+ thresholdMs: number;
906
+ total: number;
907
+ };
908
+ export type VoiceBargeInMonitor = {
909
+ getSnapshot: () => VoiceBargeInMonitorSnapshot;
910
+ recordRequested: (input: {
911
+ reason: VoiceBargeInTriggerReason;
912
+ sessionId?: string | null;
913
+ }) => VoiceBargeInMonitorEvent;
914
+ recordSkipped: (input: {
915
+ reason: VoiceBargeInTriggerReason;
916
+ sessionId?: string | null;
917
+ }) => VoiceBargeInMonitorEvent;
918
+ recordStopped: (input: {
919
+ latencyMs?: number;
920
+ playbackStopLatencyMs?: number;
921
+ reason: VoiceBargeInTriggerReason;
922
+ sessionId?: string | null;
923
+ }) => VoiceBargeInMonitorEvent;
924
+ subscribe: (subscriber: () => void) => () => void;
750
925
  };
751
926
  export type VoiceAudioPlayerOptions = {
752
927
  autoStart?: boolean;
@@ -757,10 +932,10 @@ export type VoiceDuplexControllerOptions = VoiceControllerOptions & {
757
932
  audioPlayer?: VoiceAudioPlayerOptions;
758
933
  bargeIn?: VoiceBargeInOptions;
759
934
  };
760
- export type VoiceSTTRoutingGoal = 'best' | 'low-cost';
761
- export type VoiceSTTRoutingCorrectionMode = 'generic' | 'none' | 'risky-turn';
935
+ export type VoiceSTTRoutingGoal = "best" | "low-cost";
936
+ export type VoiceSTTRoutingCorrectionMode = "generic" | "none" | "risky-turn";
762
937
  export type VoiceSTTRoutingStrategy = {
763
- benchmarkSessionTarget: 'deepgram-corrected' | 'deepgram-flux';
938
+ benchmarkSessionTarget: "deepgram-corrected" | "deepgram-flux";
764
939
  correctionMode: VoiceSTTRoutingCorrectionMode;
765
940
  goal: VoiceSTTRoutingGoal;
766
941
  notes: string[];
@@ -774,7 +949,7 @@ export type VoiceHTMXRenderInput<TResult = unknown, TSession extends VoiceSessio
774
949
  result?: TResult;
775
950
  session?: TSession;
776
951
  sessionId?: string;
777
- status: VoiceSessionStatus | 'idle';
952
+ status: VoiceSessionStatus | "idle";
778
953
  turnCount: number;
779
954
  turns: VoiceTurnRecord<TResult>[];
780
955
  };
@@ -802,9 +977,11 @@ export type VoiceHTMXOptions<TSession extends VoiceSessionRecord = VoiceSessionR
802
977
  export type VoiceHTMXConfig<TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = VoiceHTMXRenderer<TSession, TResult> | VoiceHTMXOptions<TSession, TResult>;
803
978
  export type VoiceStreamState<TResult = unknown> = {
804
979
  call: VoiceCallLifecycleState | null;
980
+ sessionMetadata: Record<string, unknown> | null;
805
981
  sessionId: string | null;
806
982
  scenarioId: string | null;
807
- status: VoiceSessionStatus | 'idle';
983
+ status: VoiceSessionStatus | "idle";
984
+ reconnect: VoiceReconnectClientState;
808
985
  partial: string;
809
986
  turns: VoiceTurnRecord<TResult>[];
810
987
  assistantTexts: string[];
@@ -819,7 +996,7 @@ export type VoiceStreamState<TResult = unknown> = {
819
996
  };
820
997
  export type VoiceStream<TResult = unknown> = {
821
998
  call: VoiceCallLifecycleState | null;
822
- callControl: (message: Omit<VoiceClientCallControlMessage, 'type'>) => void;
999
+ callControl: (message: Omit<VoiceClientCallControlMessage, "type">) => void;
823
1000
  close: () => void;
824
1001
  start: (input?: {
825
1002
  scenarioId?: string;
@@ -831,10 +1008,13 @@ export type VoiceStream<TResult = unknown> = {
831
1008
  getSnapshot: () => VoiceStreamState<TResult>;
832
1009
  isConnected: boolean;
833
1010
  partial: string;
1011
+ reconnect: VoiceReconnectClientState;
834
1012
  sendAudio: (audio: Uint8Array | ArrayBuffer) => void;
1013
+ simulateDisconnect: () => void;
835
1014
  sessionId: string | null;
1015
+ sessionMetadata: Record<string, unknown> | null;
836
1016
  scenarioId: string | null;
837
- status: VoiceSessionStatus | 'idle';
1017
+ status: VoiceSessionStatus | "idle";
838
1018
  subscribe: (subscriber: () => void) => () => void;
839
1019
  turns: VoiceTurnRecord<TResult>[];
840
1020
  assistantTexts: string[];
@@ -860,7 +1040,7 @@ export type VoiceAudioPlayerState = {
860
1040
  queuedChunkCount: number;
861
1041
  };
862
1042
  export type VoiceAudioPlayerSource = {
863
- assistantAudio: VoiceStreamState['assistantAudio'];
1043
+ assistantAudio: VoiceStreamState["assistantAudio"];
864
1044
  subscribe: (subscriber: () => void) => () => void;
865
1045
  };
866
1046
  export type VoiceAudioPlayer = {
@@ -887,7 +1067,7 @@ export type VoiceBargeInBinding = {
887
1067
  export type VoiceController<TResult = unknown> = {
888
1068
  bindHTMX: (options: VoiceHTMXBindingOptions) => () => void;
889
1069
  call: VoiceCallLifecycleState | null;
890
- callControl: (message: Omit<VoiceClientCallControlMessage, 'type'>) => void;
1070
+ callControl: (message: Omit<VoiceClientCallControlMessage, "type">) => void;
891
1071
  close: () => void;
892
1072
  endTurn: () => void;
893
1073
  start: (input?: {
@@ -900,12 +1080,15 @@ export type VoiceController<TResult = unknown> = {
900
1080
  isConnected: boolean;
901
1081
  isRecording: boolean;
902
1082
  partial: string;
1083
+ reconnect: VoiceReconnectClientState;
903
1084
  recordingError: string | null;
904
1085
  sendAudio: (audio: Uint8Array | ArrayBuffer) => void;
1086
+ simulateDisconnect: () => void;
905
1087
  sessionId: string | null;
1088
+ sessionMetadata: Record<string, unknown> | null;
906
1089
  scenarioId: string | null;
907
1090
  startRecording: () => Promise<void>;
908
- status: VoiceSessionStatus | 'idle';
1091
+ status: VoiceSessionStatus | "idle";
909
1092
  stopRecording: () => void;
910
1093
  subscribe: (subscriber: () => void) => () => void;
911
1094
  toggleRecording: () => Promise<void>;
@@ -929,40 +1112,54 @@ export type VoiceHTMXBindingOptions = {
929
1112
  sessionQueryParam?: string;
930
1113
  };
931
1114
  export type VoiceStoreAction<TResult = unknown> = {
932
- type: 'session';
1115
+ type: "session";
933
1116
  sessionId: string;
1117
+ sessionMetadata?: Record<string, unknown>;
934
1118
  scenarioId?: string;
935
1119
  status: VoiceSessionStatus;
936
1120
  } | {
937
- type: 'call_lifecycle';
1121
+ type: "replay";
1122
+ assistantTexts: string[];
1123
+ call?: VoiceCallLifecycleState;
1124
+ partial: string;
1125
+ scenarioId?: string;
1126
+ sessionId: string;
1127
+ sessionMetadata?: Record<string, unknown>;
1128
+ status: VoiceSessionStatus;
1129
+ turns: VoiceTurnRecord<TResult>[];
1130
+ } | {
1131
+ type: "call_lifecycle";
938
1132
  event: VoiceCallLifecycleEvent;
939
1133
  sessionId: string;
940
1134
  } | {
941
- type: 'partial';
1135
+ type: "partial";
942
1136
  transcript: Transcript;
943
1137
  } | {
944
- type: 'final';
1138
+ type: "final";
945
1139
  transcript: Transcript;
946
1140
  } | {
947
- type: 'turn';
1141
+ type: "turn";
948
1142
  turn: VoiceTurnRecord<TResult>;
949
1143
  } | {
950
- type: 'assistant';
1144
+ type: "assistant";
951
1145
  text: string;
952
1146
  } | {
953
- type: 'audio';
1147
+ type: "audio";
954
1148
  chunk: Uint8Array;
955
1149
  format: AudioFormat;
956
1150
  receivedAt: number;
957
1151
  turnId?: string;
958
1152
  } | {
959
- type: 'complete';
1153
+ type: "complete";
960
1154
  sessionId: string;
961
1155
  } | {
962
- type: 'error';
1156
+ type: "error";
963
1157
  message: string;
964
1158
  } | {
965
- type: 'connected';
1159
+ type: "connected";
1160
+ } | {
1161
+ type: "connection";
1162
+ reconnect: VoiceReconnectClientState;
966
1163
  } | {
967
- type: 'disconnected';
1164
+ type: "disconnected";
968
1165
  };