@absolutejs/voice 0.0.22-beta.62 → 0.0.22-beta.621

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 (502) hide show
  1. package/LICENSE +88 -0
  2. package/README.md +4543 -1181
  3. package/dist/angular/index.d.ts +36 -6
  4. package/dist/angular/index.js +4203 -457
  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 +1 -1
  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 +12 -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 +8 -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 +1345 -84
  58. package/dist/client/htmxDashboardRenderers.d.ts +71 -0
  59. package/dist/client/index.d.ts +107 -25
  60. package/dist/client/index.js +10531 -462
  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 +5 -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 +3 -3
  86. package/dist/client/providerSimulationControlsWidget.d.ts +5 -5
  87. package/dist/client/providerStatus.d.ts +5 -3
  88. package/dist/client/providerStatusWidget.d.ts +6 -6
  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 +5 -3
  96. package/dist/client/routingStatusWidget.d.ts +10 -6
  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/timeStretch.d.ts +5 -0
  103. package/dist/client/traceTimeline.d.ts +21 -0
  104. package/dist/client/traceTimelineWidget.d.ts +36 -0
  105. package/dist/client/turnLatency.d.ts +24 -0
  106. package/dist/client/turnLatencyWidget.d.ts +33 -0
  107. package/dist/client/turnQuality.d.ts +21 -0
  108. package/dist/client/turnQualityWidget.d.ts +32 -0
  109. package/dist/client/voiceWidgetView.d.ts +48 -0
  110. package/dist/client/workflowStatus.d.ts +5 -3
  111. package/dist/{agent.d.ts → core/agent.d.ts} +110 -7
  112. package/dist/core/agentPerformanceReport.d.ts +40 -0
  113. package/dist/core/agentSquadContract.d.ts +98 -0
  114. package/dist/core/agentState.d.ts +12 -0
  115. package/dist/core/agentTools.d.ts +132 -0
  116. package/dist/core/aiScorecard.d.ts +32 -0
  117. package/dist/core/aiVoiceModel.d.ts +15 -0
  118. package/dist/core/amdDetector.d.ts +25 -0
  119. package/dist/{assistant.d.ts → core/assistant.d.ts} +21 -14
  120. package/dist/core/assistantExperiment.d.ts +42 -0
  121. package/dist/{assistantHealth.d.ts → core/assistantHealth.d.ts} +9 -9
  122. package/dist/{assistantMemory.d.ts → core/assistantMemory.d.ts} +10 -10
  123. package/dist/core/assistantMode.d.ts +22 -0
  124. package/dist/{audioConditioning.d.ts → core/audioConditioning.d.ts} +2 -2
  125. package/dist/core/audit.d.ts +131 -0
  126. package/dist/core/auditDeliveryRoutes.d.ts +85 -0
  127. package/dist/core/auditExport.d.ts +34 -0
  128. package/dist/core/auditRoutes.d.ts +66 -0
  129. package/dist/core/auditSinks.d.ts +151 -0
  130. package/dist/core/backchannel.d.ts +25 -0
  131. package/dist/core/bargeInDetector.d.ts +51 -0
  132. package/dist/core/bargeInRoutes.d.ts +56 -0
  133. package/dist/core/bookingFlow.d.ts +43 -0
  134. package/dist/core/browserCallProfiles.d.ts +120 -0
  135. package/dist/core/browserMediaRoutes.d.ts +62 -0
  136. package/dist/core/cachedTTS.d.ts +54 -0
  137. package/dist/core/calendarAdapter.d.ts +47 -0
  138. package/dist/core/calendarSlots.d.ts +35 -0
  139. package/dist/core/callDebugger.d.ts +66 -0
  140. package/dist/core/callDisposition.d.ts +38 -0
  141. package/dist/core/callQuota.d.ts +54 -0
  142. package/dist/core/callScorecard.d.ts +53 -0
  143. package/dist/core/callerCRMLinker.d.ts +29 -0
  144. package/dist/core/callerMemory.d.ts +37 -0
  145. package/dist/core/callingWindow.d.ts +26 -0
  146. package/dist/core/campaign.d.ts +795 -0
  147. package/dist/core/campaignControls.d.ts +37 -0
  148. package/dist/core/campaignDialers.d.ts +111 -0
  149. package/dist/core/campaignTemplate.d.ts +16 -0
  150. package/dist/core/competitiveCoverage.d.ts +141 -0
  151. package/dist/core/conversationSimulator.d.ts +73 -0
  152. package/dist/{correction.d.ts → core/correction.d.ts} +5 -4
  153. package/dist/core/costAccounting.d.ts +90 -0
  154. package/dist/core/costPredictor.d.ts +74 -0
  155. package/dist/core/crmCallLogger.d.ts +37 -0
  156. package/dist/core/crmContract.d.ts +70 -0
  157. package/dist/core/dataControl.d.ts +180 -0
  158. package/dist/core/debugTiming.d.ts +11 -0
  159. package/dist/core/defineVoiceAssistant.d.ts +68 -0
  160. package/dist/core/deliveryRuntime.d.ts +159 -0
  161. package/dist/core/deliverySinkRoutes.d.ts +117 -0
  162. package/dist/core/demoReadyRoutes.d.ts +98 -0
  163. package/dist/{diagnosticsRoutes.d.ts → core/diagnosticsRoutes.d.ts} +2 -2
  164. package/dist/core/dncRegistry.d.ts +38 -0
  165. package/dist/core/dtmfCollector.d.ts +37 -0
  166. package/dist/{evalRoutes.d.ts → core/evalRoutes.d.ts} +26 -20
  167. package/dist/{fileStore.d.ts → core/fileStore.d.ts} +34 -20
  168. package/dist/core/guardrails.d.ts +128 -0
  169. package/dist/{handoff.d.ts → core/handoff.d.ts} +10 -10
  170. package/dist/{handoffHealth.d.ts → core/handoffHealth.d.ts} +9 -9
  171. package/dist/core/hardenedFetch.d.ts +3 -0
  172. package/dist/core/holdAudio.d.ts +23 -0
  173. package/dist/{htmx.d.ts → core/htmx.d.ts} +2 -2
  174. package/dist/core/htmxDashboardRoutes.d.ts +250 -0
  175. package/dist/core/iceServers.d.ts +34 -0
  176. package/dist/core/incidentBundle.d.ts +119 -0
  177. package/dist/core/incidentTimeline.d.ts +260 -0
  178. package/dist/core/ivrPlan.d.ts +40 -0
  179. package/dist/core/latencySlo.d.ts +56 -0
  180. package/dist/core/liveCoach.d.ts +43 -0
  181. package/dist/core/liveLatency.d.ts +78 -0
  182. package/dist/core/liveOps.d.ts +190 -0
  183. package/dist/core/llmJudge.d.ts +45 -0
  184. package/dist/{logger.d.ts → core/logger.d.ts} +1 -2
  185. package/dist/core/mcpToolset.d.ts +58 -0
  186. package/dist/core/mediaPipelineRoutes.d.ts +171 -0
  187. package/dist/core/mediaPipelineSurfaces.d.ts +48 -0
  188. package/dist/{memoryStore.d.ts → core/memoryStore.d.ts} +1 -1
  189. package/dist/core/midCallSummary.d.ts +27 -0
  190. package/dist/{modelAdapters.d.ts → core/modelAdapters.d.ts} +64 -7
  191. package/dist/core/monitor.d.ts +148 -0
  192. package/dist/core/multilingualProof.d.ts +77 -0
  193. package/dist/core/noShowPredictor.d.ts +46 -0
  194. package/dist/core/oauth2TokenSource.d.ts +21 -0
  195. package/dist/core/observabilityExport.d.ts +501 -0
  196. package/dist/core/openaiTTS.d.ts +18 -0
  197. package/dist/core/operationalStatus.d.ts +87 -0
  198. package/dist/core/operationsRecord.d.ts +371 -0
  199. package/dist/{ops.d.ts → core/ops.d.ts} +70 -70
  200. package/dist/core/opsActionAuditRoutes.d.ts +99 -0
  201. package/dist/{opsConsoleRoutes.d.ts → core/opsConsoleRoutes.d.ts} +11 -8
  202. package/dist/{opsPresets.d.ts → core/opsPresets.d.ts} +2 -2
  203. package/dist/core/opsRecovery.d.ts +137 -0
  204. package/dist/{opsRuntime.d.ts → core/opsRuntime.d.ts} +6 -6
  205. package/dist/{opsSinks.d.ts → core/opsSinks.d.ts} +19 -19
  206. package/dist/core/opsStatus.d.ts +76 -0
  207. package/dist/core/opsStatusRoutes.d.ts +33 -0
  208. package/dist/{opsWebhook.d.ts → core/opsWebhook.d.ts} +15 -15
  209. package/dist/core/otelExporter.d.ts +83 -0
  210. package/dist/core/outcomeContract.d.ts +146 -0
  211. package/dist/{outcomeRecipes.d.ts → core/outcomeRecipes.d.ts} +4 -4
  212. package/dist/core/pathway.d.ts +94 -0
  213. package/dist/core/pathwayCompiler.d.ts +31 -0
  214. package/dist/core/pathwayGenerator.d.ts +27 -0
  215. package/dist/core/pathwayRuntime.d.ts +57 -0
  216. package/dist/core/pathwaySlotCollector.d.ts +29 -0
  217. package/dist/core/pathwayVisualizer.d.ts +8 -0
  218. package/dist/core/phoneAgent.d.ts +139 -0
  219. package/dist/core/phoneAgentProductionSmoke.d.ts +115 -0
  220. package/dist/core/phoneProvisioning.d.ts +29 -0
  221. package/dist/core/platformCoverage.d.ts +91 -0
  222. package/dist/{plugin.d.ts → core/plugin.d.ts} +2 -2
  223. package/dist/core/postCallAnalysis.d.ts +98 -0
  224. package/dist/core/postCallSurvey.d.ts +41 -0
  225. package/dist/{postgresStore.d.ts → core/postgresStore.d.ts} +20 -9
  226. package/dist/{presets.d.ts → core/presets.d.ts} +3 -3
  227. package/dist/core/productionReadiness.d.ts +757 -0
  228. package/dist/core/profileSwitchRecommendation.d.ts +350 -0
  229. package/dist/core/promptInjectionGuard.d.ts +30 -0
  230. package/dist/core/proofAssertions.d.ts +32 -0
  231. package/dist/core/proofPack.d.ts +211 -0
  232. package/dist/core/proofRunner.d.ts +79 -0
  233. package/dist/core/proofTrends.d.ts +966 -0
  234. package/dist/{providerAdapters.d.ts → core/providerAdapters.d.ts} +5 -5
  235. package/dist/core/providerCapabilities.d.ts +92 -0
  236. package/dist/core/providerDecisionTraces.d.ts +130 -0
  237. package/dist/{providerHealth.d.ts → core/providerHealth.d.ts} +15 -5
  238. package/dist/core/providerOrchestration.d.ts +109 -0
  239. package/dist/core/providerRouterTraces.d.ts +35 -0
  240. package/dist/core/providerRoutingContract.d.ts +71 -0
  241. package/dist/core/providerSlo.d.ts +142 -0
  242. package/dist/core/providerStackRecommendations.d.ts +188 -0
  243. package/dist/core/qualityDriftDetector.d.ts +44 -0
  244. package/dist/{qualityRoutes.d.ts → core/qualityRoutes.d.ts} +7 -7
  245. package/dist/{queue.d.ts → core/queue.d.ts} +48 -39
  246. package/dist/core/ragTool.d.ts +52 -0
  247. package/dist/core/readinessProfiles.d.ts +45 -0
  248. package/dist/core/realtimeChannel.d.ts +136 -0
  249. package/dist/core/realtimeProviderContracts.d.ts +133 -0
  250. package/dist/core/reconnectContract.d.ts +177 -0
  251. package/dist/core/recordingRedaction.d.ts +47 -0
  252. package/dist/core/recordingStore.d.ts +60 -0
  253. package/dist/core/redaction.d.ts +13 -0
  254. package/dist/core/reminderScheduler.d.ts +43 -0
  255. package/dist/{resilienceRoutes.d.ts → core/resilienceRoutes.d.ts} +34 -5
  256. package/dist/core/retention.d.ts +37 -0
  257. package/dist/core/retryPolicy.d.ts +38 -0
  258. package/dist/core/routeAuth.d.ts +58 -0
  259. package/dist/{routing.d.ts → core/routing.d.ts} +2 -2
  260. package/dist/{runtimeOps.d.ts → core/runtimeOps.d.ts} +3 -3
  261. package/dist/{s3Store.d.ts → core/s3Store.d.ts} +12 -3
  262. package/dist/core/scorecardCalibration.d.ts +31 -0
  263. package/dist/core/scribe.d.ts +50 -0
  264. package/dist/core/semanticTurn.d.ts +37 -0
  265. package/dist/{session.d.ts → core/session.d.ts} +1 -1
  266. package/dist/core/sessionObservability.d.ts +145 -0
  267. package/dist/{sessionReplay.d.ts → core/sessionReplay.d.ts} +31 -19
  268. package/dist/core/sessionSnapshot.d.ts +109 -0
  269. package/dist/core/simulationSuite.d.ts +144 -0
  270. package/dist/core/sloCalibration.d.ts +185 -0
  271. package/dist/{sqliteStore.d.ts → core/sqliteStore.d.ts} +20 -9
  272. package/dist/{store.d.ts → core/store.d.ts} +1 -1
  273. package/dist/core/supervisorPermissions.d.ts +33 -0
  274. package/dist/core/supervisorPresence.d.ts +49 -0
  275. package/dist/core/telephonyMediaRoutes.d.ts +72 -0
  276. package/dist/core/telephonyOutcome.d.ts +269 -0
  277. package/dist/core/toolContract.d.ts +161 -0
  278. package/dist/{toolRuntime.d.ts → core/toolRuntime.d.ts} +4 -4
  279. package/dist/{trace.d.ts → core/trace.d.ts} +61 -22
  280. package/dist/core/traceDeliveryRoutes.d.ts +86 -0
  281. package/dist/core/traceTimeline.d.ts +97 -0
  282. package/dist/core/transcriptAnnotator.d.ts +41 -0
  283. package/dist/{turnDetection.d.ts → core/turnDetection.d.ts} +2 -1
  284. package/dist/core/turnLatency.d.ts +95 -0
  285. package/dist/core/turnProfiles.d.ts +3 -0
  286. package/dist/core/turnQuality.d.ts +94 -0
  287. package/dist/core/types.d.ts +1535 -0
  288. package/dist/core/vapiAdapter.d.ts +160 -0
  289. package/dist/core/variableAnalytics.d.ts +47 -0
  290. package/dist/core/voiceConfiguration.d.ts +8 -0
  291. package/dist/core/voiceMonitoring.d.ts +444 -0
  292. package/dist/core/webhookFanout.d.ts +48 -0
  293. package/dist/core/webhookVerification.d.ts +27 -0
  294. package/dist/core/whisperChannel.d.ts +50 -0
  295. package/dist/{workflowContract.d.ts → core/workflowContract.d.ts} +21 -21
  296. package/dist/core/writeBehindStore.d.ts +41 -0
  297. package/dist/core/zeroDataRetention.d.ts +31 -0
  298. package/dist/drizzle/assistantMemory.d.ts +100 -0
  299. package/dist/drizzle/eval.d.ts +55 -0
  300. package/dist/drizzle/handoff.d.ts +56 -0
  301. package/dist/drizzle/incidentBundle.d.ts +55 -0
  302. package/dist/drizzle/index.d.ts +991 -0
  303. package/dist/drizzle/index.js +3059 -0
  304. package/dist/drizzle/observabilityExport.d.ts +55 -0
  305. package/dist/drizzle/proofTrends.d.ts +114 -0
  306. package/dist/drizzle/runtimeStorage.d.ts +1183 -0
  307. package/dist/drizzle/shared.d.ts +69 -0
  308. package/dist/embed/index.d.ts +38 -0
  309. package/dist/embed/index.js +1775 -0
  310. package/dist/embed/voice-widget.js +10 -0
  311. package/dist/index.d.ts +378 -76
  312. package/dist/index.js +47418 -7749
  313. package/dist/internal/evidence.d.ts +10 -0
  314. package/dist/internal/html.d.ts +6 -0
  315. package/dist/internal/status.d.ts +7 -0
  316. package/dist/react/VoiceAgentSquadStatus.d.ts +5 -0
  317. package/dist/react/VoiceCallDebuggerLaunch.d.ts +6 -0
  318. package/dist/react/VoiceCallPlayer.d.ts +11 -0
  319. package/dist/react/VoiceCostDashboard.d.ts +10 -0
  320. package/dist/react/VoiceDeliveryRuntime.d.ts +7 -0
  321. package/dist/react/VoiceLiveAgentConsole.d.ts +11 -0
  322. package/dist/react/VoiceLiveCallViewer.d.ts +9 -0
  323. package/dist/react/VoiceOpsActionCenter.d.ts +5 -0
  324. package/dist/react/VoiceOpsStatus.d.ts +1 -1
  325. package/dist/react/VoicePlatformCoverage.d.ts +6 -0
  326. package/dist/react/VoiceProfileComparison.d.ts +6 -0
  327. package/dist/react/VoiceProfileSwitchRecommendation.d.ts +6 -0
  328. package/dist/react/VoiceProofTrends.d.ts +6 -0
  329. package/dist/react/VoiceProviderCapabilities.d.ts +6 -0
  330. package/dist/react/VoiceProviderContracts.d.ts +6 -0
  331. package/dist/react/VoiceProviderSimulationControls.d.ts +1 -1
  332. package/dist/react/VoiceProviderStatus.d.ts +1 -1
  333. package/dist/react/VoiceReadinessFailures.d.ts +6 -0
  334. package/dist/react/VoiceReconnectProfileEvidence.d.ts +6 -0
  335. package/dist/react/VoiceReplayTimeline.d.ts +6 -0
  336. package/dist/react/VoiceRoutingStatus.d.ts +1 -1
  337. package/dist/react/VoiceSessionObservability.d.ts +6 -0
  338. package/dist/react/VoiceSessionSnapshot.d.ts +6 -0
  339. package/dist/react/VoiceTraceTimeline.d.ts +6 -0
  340. package/dist/react/VoiceTurnLatency.d.ts +6 -0
  341. package/dist/react/VoiceTurnQuality.d.ts +6 -0
  342. package/dist/react/VoiceWidget.d.ts +13 -0
  343. package/dist/react/index.d.ts +80 -11
  344. package/dist/react/index.js +13545 -1593
  345. package/dist/react/useVoiceAgentSquadStatus.d.ts +8 -0
  346. package/dist/react/useVoiceCallDebugger.d.ts +8 -0
  347. package/dist/react/useVoiceCampaignDialerProof.d.ts +10 -0
  348. package/dist/react/useVoiceController.d.ts +5 -1
  349. package/dist/react/useVoiceDeliveryRuntime.d.ts +13 -0
  350. package/dist/react/useVoiceLiveOps.d.ts +9 -0
  351. package/dist/react/useVoiceOpsActionCenter.d.ts +11 -0
  352. package/dist/react/useVoiceOpsStatus.d.ts +8 -0
  353. package/dist/react/useVoicePlatformCoverage.d.ts +8 -0
  354. package/dist/react/useVoiceProfileComparison.d.ts +8 -0
  355. package/dist/react/useVoiceProfileSwitchRecommendation.d.ts +8 -0
  356. package/dist/react/useVoiceProofTrends.d.ts +8 -0
  357. package/dist/react/useVoiceProviderCapabilities.d.ts +8 -0
  358. package/dist/react/useVoiceProviderContracts.d.ts +8 -0
  359. package/dist/react/useVoiceProviderSimulationControls.d.ts +1 -1
  360. package/dist/react/useVoiceProviderStatus.d.ts +1 -1
  361. package/dist/react/useVoiceReadinessFailures.d.ts +8 -0
  362. package/dist/react/useVoiceReconnectProfileEvidence.d.ts +8 -0
  363. package/dist/react/useVoiceRoutingStatus.d.ts +1 -1
  364. package/dist/react/useVoiceSessionObservability.d.ts +8 -0
  365. package/dist/react/useVoiceSessionSnapshot.d.ts +9 -0
  366. package/dist/react/useVoiceStream.d.ts +5 -1
  367. package/dist/react/useVoiceTraceTimeline.d.ts +8 -0
  368. package/dist/react/useVoiceTurnLatency.d.ts +9 -0
  369. package/dist/react/useVoiceTurnQuality.d.ts +8 -0
  370. package/dist/react/useVoiceWorkflowStatus.d.ts +1 -1
  371. package/dist/svelte/createVoiceAgentSquadStatus.d.ts +9 -0
  372. package/dist/svelte/createVoiceCallDebugger.d.ts +10 -0
  373. package/dist/svelte/createVoiceCallPlayer.d.ts +33 -0
  374. package/dist/svelte/createVoiceCampaignDialerProof.d.ts +9 -0
  375. package/dist/svelte/createVoiceCostDashboard.d.ts +13 -0
  376. package/dist/svelte/createVoiceDeliveryRuntime.d.ts +11 -0
  377. package/dist/svelte/createVoiceLiveAgentConsole.d.ts +23 -0
  378. package/dist/svelte/createVoiceLiveCallViewer.d.ts +26 -0
  379. package/dist/svelte/createVoiceLiveOps.d.ts +13 -0
  380. package/dist/svelte/createVoiceOpsActionCenter.d.ts +10 -0
  381. package/dist/svelte/createVoiceOpsStatus.d.ts +4 -4
  382. package/dist/svelte/createVoicePlatformCoverage.d.ts +7 -0
  383. package/dist/svelte/createVoiceProfileComparison.d.ts +7 -0
  384. package/dist/svelte/createVoiceProofTrends.d.ts +7 -0
  385. package/dist/svelte/createVoiceProviderCapabilities.d.ts +10 -0
  386. package/dist/svelte/createVoiceProviderContracts.d.ts +10 -0
  387. package/dist/svelte/createVoiceProviderSimulationControls.d.ts +2 -2
  388. package/dist/svelte/createVoiceProviderStatus.d.ts +2 -2
  389. package/dist/svelte/createVoiceReadinessFailures.d.ts +7 -0
  390. package/dist/svelte/createVoiceReconnectProfileEvidence.d.ts +7 -0
  391. package/dist/svelte/createVoiceReplayTimeline.d.ts +13 -0
  392. package/dist/svelte/createVoiceRoutingStatus.d.ts +2 -2
  393. package/dist/svelte/createVoiceSessionObservability.d.ts +10 -0
  394. package/dist/svelte/createVoiceSessionSnapshot.d.ts +11 -0
  395. package/dist/svelte/createVoiceStream.d.ts +1 -1
  396. package/dist/svelte/createVoiceTraceTimeline.d.ts +10 -0
  397. package/dist/svelte/createVoiceTurnLatency.d.ts +11 -0
  398. package/dist/svelte/createVoiceTurnQuality.d.ts +10 -0
  399. package/dist/svelte/createVoiceWidget.d.ts +19 -0
  400. package/dist/svelte/createVoiceWorkflowStatus.d.ts +2 -2
  401. package/dist/svelte/index.d.ts +37 -8
  402. package/dist/svelte/index.js +7177 -1306
  403. package/dist/telephony/contract.d.ts +61 -0
  404. package/dist/telephony/matrix.d.ts +97 -0
  405. package/dist/telephony/plivo.d.ts +303 -0
  406. package/dist/telephony/response.d.ts +1 -1
  407. package/dist/telephony/security.d.ts +182 -0
  408. package/dist/telephony/telnyx.d.ts +291 -0
  409. package/dist/telephony/twilio.d.ts +153 -15
  410. package/dist/testing/accuracy.d.ts +1 -1
  411. package/dist/testing/benchmark.d.ts +15 -15
  412. package/dist/testing/corrected.d.ts +9 -9
  413. package/dist/testing/duplex.d.ts +5 -5
  414. package/dist/testing/fixtures.d.ts +4 -4
  415. package/dist/testing/index.d.ts +13 -13
  416. package/dist/testing/index.js +7419 -951
  417. package/dist/testing/ioProviderSimulator.d.ts +5 -5
  418. package/dist/testing/providerSimulator.d.ts +5 -5
  419. package/dist/testing/review.d.ts +8 -8
  420. package/dist/testing/sessionBenchmark.d.ts +13 -13
  421. package/dist/testing/stt.d.ts +3 -3
  422. package/dist/testing/telephony.d.ts +27 -2
  423. package/dist/testing/tts.d.ts +2 -2
  424. package/dist/vue/VoiceCallDebuggerLaunch.d.ts +72 -0
  425. package/dist/vue/VoiceCallPlayer.d.ts +40 -0
  426. package/dist/vue/VoiceCostDashboard.d.ts +57 -0
  427. package/dist/vue/VoiceDeliveryRuntime.d.ts +34 -0
  428. package/dist/vue/VoiceLiveAgentConsole.d.ts +50 -0
  429. package/dist/vue/VoiceLiveCallViewer.d.ts +35 -0
  430. package/dist/vue/VoiceOpsActionCenter.d.ts +13 -0
  431. package/dist/vue/VoiceOpsStatus.d.ts +4 -0
  432. package/dist/vue/VoicePlatformCoverage.d.ts +27 -0
  433. package/dist/vue/VoiceProofTrends.d.ts +25 -0
  434. package/dist/vue/VoiceProviderCapabilities.d.ts +55 -0
  435. package/dist/vue/VoiceProviderContracts.d.ts +25 -0
  436. package/dist/vue/VoiceProviderSimulationControls.d.ts +3 -3
  437. package/dist/vue/VoiceProviderStatus.d.ts +4 -0
  438. package/dist/vue/VoiceReadinessFailures.d.ts +25 -0
  439. package/dist/vue/VoiceReconnectProfileEvidence.d.ts +25 -0
  440. package/dist/vue/VoiceReplayTimeline.d.ts +17 -0
  441. package/dist/vue/VoiceRoutingStatus.d.ts +4 -0
  442. package/dist/vue/VoiceSessionObservability.d.ts +27 -0
  443. package/dist/vue/VoiceSessionSnapshot.d.ts +72 -0
  444. package/dist/vue/VoiceTurnLatency.d.ts +73 -0
  445. package/dist/vue/VoiceTurnQuality.d.ts +55 -0
  446. package/dist/vue/VoiceWidget.d.ts +77 -0
  447. package/dist/vue/index.d.ts +49 -11
  448. package/dist/vue/index.js +12844 -1711
  449. package/dist/vue/useVoiceAgentSquadStatus.d.ts +9 -0
  450. package/dist/vue/useVoiceCallDebugger.d.ts +10 -0
  451. package/dist/vue/useVoiceCampaignDialerProof.d.ts +11 -0
  452. package/dist/vue/useVoiceController.d.ts +10 -7
  453. package/dist/vue/useVoiceDeliveryRuntime.d.ts +13 -0
  454. package/dist/vue/useVoiceLiveOps.d.ts +9 -0
  455. package/dist/vue/useVoiceOpsActionCenter.d.ts +11 -0
  456. package/dist/vue/useVoiceOpsStatus.d.ts +9 -0
  457. package/dist/vue/useVoicePlatformCoverage.d.ts +9 -0
  458. package/dist/vue/useVoiceProfileComparison.d.ts +9 -0
  459. package/dist/vue/useVoiceProofTrends.d.ts +9 -0
  460. package/dist/vue/useVoiceProviderCapabilities.d.ts +9 -0
  461. package/dist/vue/useVoiceProviderContracts.d.ts +9 -0
  462. package/dist/vue/useVoiceProviderSimulationControls.d.ts +2 -2
  463. package/dist/vue/useVoiceProviderStatus.d.ts +3 -3
  464. package/dist/vue/useVoiceReadinessFailures.d.ts +959 -0
  465. package/dist/vue/useVoiceReconnectProfileEvidence.d.ts +9 -0
  466. package/dist/vue/useVoiceRoutingStatus.d.ts +2 -2
  467. package/dist/vue/useVoiceSessionObservability.d.ts +9 -0
  468. package/dist/vue/useVoiceSessionSnapshot.d.ts +10 -0
  469. package/dist/vue/useVoiceStream.d.ts +10 -6
  470. package/dist/vue/useVoiceTraceTimeline.d.ts +9 -0
  471. package/dist/vue/useVoiceTurnLatency.d.ts +10 -0
  472. package/dist/vue/useVoiceTurnQuality.d.ts +9 -0
  473. package/dist/vue/useVoiceWorkflowStatus.d.ts +3 -3
  474. package/package.json +159 -256
  475. package/dist/angular/voice-app-kit-status.service.d.ts +0 -12
  476. package/dist/angular/voice-ops-status.component.d.ts +0 -15
  477. package/dist/appKit.d.ts +0 -92
  478. package/dist/client/appKitStatus.d.ts +0 -19
  479. package/dist/react/useVoiceAppKitStatus.d.ts +0 -8
  480. package/dist/svelte/createVoiceAppKitStatus.d.ts +0 -8
  481. package/dist/turnProfiles.d.ts +0 -6
  482. package/dist/types.d.ts +0 -968
  483. package/dist/vue/useVoiceAppKitStatus.d.ts +0 -9
  484. package/fixtures/README.md +0 -57
  485. package/fixtures/manifest.json +0 -199
  486. package/fixtures/pcm/dialogue-three-clean.pcm +0 -0
  487. package/fixtures/pcm/dialogue-three-mixed.pcm +0 -0
  488. package/fixtures/pcm/dialogue-two-clean.pcm +0 -0
  489. package/fixtures/pcm/dialogue-two-noisy.pcm +0 -0
  490. package/fixtures/pcm/multiturn-three-mixed.pcm +0 -0
  491. package/fixtures/pcm/multiturn-two-clean.pcm +0 -0
  492. package/fixtures/pcm/quietly-alone-clean.pcm +0 -0
  493. package/fixtures/pcm/rainstorms-noisy.pcm +0 -0
  494. package/fixtures/pcm/stella-bulgaria-bulgarian20.pcm +0 -0
  495. package/fixtures/pcm/stella-ghana-english507.pcm +0 -0
  496. package/fixtures/pcm/stella-india-english37.pcm +0 -0
  497. package/fixtures/pcm/stella-jamaica-jamaican-creole-english1.pcm +0 -0
  498. package/fixtures/pcm/stella-liberia-liberian-pidgin-english2.pcm +0 -0
  499. package/fixtures/pcm/stella-pakistan-english519.pcm +0 -0
  500. package/fixtures/pcm/stella-sierra-leone-krio5.pcm +0 -0
  501. package/fixtures/pcm/stella-singapore-english655.pcm +0 -0
  502. package/fixtures/pcm/traveled-back-route-clean.pcm +0 -0
package/dist/types.d.ts DELETED
@@ -1,968 +0,0 @@
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';
6
- export type AudioFormat = {
7
- container: 'raw';
8
- encoding: 'alaw' | 'mulaw' | 'pcm_s16le';
9
- sampleRateHz: number;
10
- channels: 1 | 2;
11
- };
12
- export type AudioChunk = ArrayBuffer | ArrayBufferView;
13
- export type VoiceLanguageStrategy = {
14
- mode: 'auto-detect';
15
- allowedLanguages?: string[];
16
- } | {
17
- mode: 'fixed';
18
- primaryLanguage: string;
19
- secondaryLanguages?: string[];
20
- } | {
21
- mode: 'allow-switching';
22
- primaryLanguage?: string;
23
- secondaryLanguages: string[];
24
- };
25
- export type VoicePhraseHint = {
26
- text: string;
27
- aliases?: string[];
28
- boost?: number;
29
- metadata?: Record<string, unknown>;
30
- };
31
- export type VoiceCorrectionRiskTier = 'safe' | 'balanced' | 'risky';
32
- export type VoiceDomainTerm = {
33
- text: string;
34
- aliases?: string[];
35
- boost?: number;
36
- language?: string;
37
- metadata?: Record<string, unknown>;
38
- pronunciation?: string;
39
- };
40
- export type VoiceLexiconEntry = {
41
- text: string;
42
- aliases?: string[];
43
- language?: string;
44
- metadata?: Record<string, unknown>;
45
- pronunciation?: string;
46
- };
47
- export type Transcript = {
48
- id: string;
49
- text: string;
50
- isFinal: boolean;
51
- confidence?: number;
52
- language?: string;
53
- speaker?: string | number;
54
- startedAtMs?: number;
55
- endedAtMs?: number;
56
- vendor?: string;
57
- };
58
- export type VoiceTranscriptQuality = {
59
- averageConfidence?: number;
60
- confidenceSampleCount: number;
61
- correction?: VoiceTurnCorrectionDiagnostics;
62
- cost?: VoiceTurnCostEstimate;
63
- fallbackUsed: boolean;
64
- finalTranscriptCount: number;
65
- fallback?: VoiceFallbackDiagnostics;
66
- partialTranscriptCount: number;
67
- selectedTranscriptCount: number;
68
- source: 'fallback' | 'primary';
69
- };
70
- export type VoiceTurnCorrectionDiagnostics = {
71
- attempted: boolean;
72
- changed: boolean;
73
- correctedText: string;
74
- metadata?: Record<string, unknown>;
75
- originalText: string;
76
- provider?: string;
77
- reason?: string;
78
- };
79
- export type VoiceTurnCostEstimate = {
80
- estimatedRelativeCostUnits: number;
81
- fallbackAttemptCount: number;
82
- fallbackReplayAudioMs: number;
83
- primaryAudioMs: number;
84
- totalBillableAudioMs: number;
85
- };
86
- export type VoiceFallbackSelectionReason = 'fallback-empty' | 'primary-empty' | 'word-count-margin' | 'confidence-margin' | 'word-count-tiebreak' | 'kept-primary';
87
- export type VoiceFallbackDiagnostics = {
88
- attempted: boolean;
89
- fallbackConfidence?: number;
90
- fallbackText?: string;
91
- fallbackWordCount?: number;
92
- primaryConfidence: number;
93
- primaryText: string;
94
- primaryWordCount: number;
95
- selected: boolean;
96
- selectionReason: VoiceFallbackSelectionReason;
97
- trigger: 'empty-turn' | 'low-confidence' | 'empty-or-low-confidence' | 'always';
98
- };
99
- export type VoicePartialEvent = {
100
- type: 'partial';
101
- transcript: Transcript;
102
- receivedAt: number;
103
- };
104
- export type VoiceFinalEvent = {
105
- type: 'final';
106
- transcript: Transcript;
107
- receivedAt: number;
108
- };
109
- export type VoiceEndOfTurnEvent = {
110
- type: 'endOfTurn';
111
- reason: 'vendor' | 'silence' | 'manual';
112
- receivedAt: number;
113
- };
114
- export type VoiceErrorEvent = {
115
- type: 'error';
116
- error: Error;
117
- recoverable: boolean;
118
- code?: string;
119
- };
120
- export type VoiceCloseEvent = {
121
- type: 'close';
122
- code?: number;
123
- reason?: string;
124
- recoverable?: boolean;
125
- };
126
- export type STTSessionEventMap = {
127
- partial: VoicePartialEvent;
128
- final: VoiceFinalEvent;
129
- endOfTurn: VoiceEndOfTurnEvent;
130
- error: VoiceErrorEvent;
131
- close: VoiceCloseEvent;
132
- };
133
- export type STTAdapterSession = {
134
- on: <K extends keyof STTSessionEventMap>(event: K, handler: (payload: STTSessionEventMap[K]) => void | Promise<void>) => () => void;
135
- send: (audio: AudioChunk) => Promise<void>;
136
- close: (reason?: string) => Promise<void>;
137
- };
138
- export type STTAdapterOpenOptions = {
139
- sessionId: string;
140
- format: AudioFormat;
141
- languageStrategy?: VoiceLanguageStrategy;
142
- lexicon?: VoiceLexiconEntry[];
143
- phraseHints?: VoicePhraseHint[];
144
- signal?: AbortSignal;
145
- };
146
- export type STTAdapter<TOptions extends STTAdapterOpenOptions = STTAdapterOpenOptions> = {
147
- kind: 'stt';
148
- open: (options: TOptions) => Promise<STTAdapterSession> | STTAdapterSession;
149
- };
150
- export type TTSAudioEvent = {
151
- type: 'audio';
152
- chunk: AudioChunk;
153
- format: AudioFormat;
154
- receivedAt: number;
155
- };
156
- export type TTSSessionEventMap = {
157
- audio: TTSAudioEvent;
158
- error: VoiceErrorEvent;
159
- close: VoiceCloseEvent;
160
- };
161
- export type TTSAdapterSession = {
162
- on: <K extends keyof TTSSessionEventMap>(event: K, handler: (payload: TTSSessionEventMap[K]) => void | Promise<void>) => () => void;
163
- send: (text: string) => Promise<void>;
164
- close: (reason?: string) => Promise<void>;
165
- };
166
- export type TTSAdapterOpenOptions = {
167
- sessionId: string;
168
- lexicon?: VoiceLexiconEntry[];
169
- signal?: AbortSignal;
170
- };
171
- export type TTSAdapter<TOptions extends TTSAdapterOpenOptions = TTSAdapterOpenOptions> = {
172
- kind: 'tts';
173
- open: (options: TOptions) => Promise<TTSAdapterSession> | TTSAdapterSession;
174
- };
175
- export type RealtimeSessionEventMap = STTSessionEventMap & {
176
- audio: TTSAudioEvent;
177
- };
178
- export type RealtimeAdapterSession = {
179
- on: <K extends keyof RealtimeSessionEventMap>(event: K, handler: (payload: RealtimeSessionEventMap[K]) => void | Promise<void>) => () => void;
180
- send: (input: AudioChunk | string) => Promise<void>;
181
- close: (reason?: string) => Promise<void>;
182
- };
183
- export type RealtimeAdapterOpenOptions = {
184
- sessionId: string;
185
- format: AudioFormat;
186
- languageStrategy?: VoiceLanguageStrategy;
187
- lexicon?: VoiceLexiconEntry[];
188
- phraseHints?: VoicePhraseHint[];
189
- signal?: AbortSignal;
190
- };
191
- export type RealtimeAdapter<TOptions extends RealtimeAdapterOpenOptions = RealtimeAdapterOpenOptions> = {
192
- kind: 'realtime';
193
- open: (options: TOptions) => Promise<RealtimeAdapterSession> | RealtimeAdapterSession;
194
- };
195
- export type VoiceSessionStatus = 'active' | 'reconnecting' | 'completed' | 'failed';
196
- export type VoiceTurnRecord<TResult = unknown> = {
197
- id: string;
198
- text: string;
199
- quality?: VoiceTranscriptQuality;
200
- transcripts: Transcript[];
201
- assistantText?: string;
202
- committedAt: number;
203
- result?: TResult;
204
- };
205
- export type VoiceCostTelemetryConfig<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = {
206
- fallbackPassCostUnit?: number;
207
- onTurnCost?: (input: {
208
- api: VoiceSessionHandle<TContext, TSession, TResult>;
209
- context: TContext;
210
- estimate: VoiceTurnCostEstimate;
211
- session: TSession;
212
- turn: VoiceTurnRecord<TResult>;
213
- }) => Promise<void> | void;
214
- primaryPassCostUnit?: number;
215
- };
216
- export type VoiceSessionRecord<TMeta = Record<string, never>, TResult = unknown> = {
217
- id: string;
218
- createdAt: number;
219
- lastActivityAt?: number;
220
- status: VoiceSessionStatus;
221
- transcripts: Transcript[];
222
- currentTurn: {
223
- transcripts: Transcript[];
224
- partialText: string;
225
- partialStartedAt?: number;
226
- partialEndedAt?: number;
227
- finalText: string;
228
- lastAudioAt?: number;
229
- lastSpeechAt?: number;
230
- lastTranscriptAt?: number;
231
- silenceStartedAt?: number;
232
- };
233
- turns: VoiceTurnRecord<TResult>[];
234
- committedTurnIds: string[];
235
- reconnect: {
236
- attempts: number;
237
- lastDisconnectAt?: number;
238
- };
239
- lastCommittedTurn?: {
240
- signature: string;
241
- text: string;
242
- transcriptIds: string[];
243
- committedAt: number;
244
- };
245
- call?: VoiceCallLifecycleState;
246
- metadata?: TMeta;
247
- scenarioId?: string;
248
- };
249
- export type VoiceSessionSummary = {
250
- id: string;
251
- createdAt: number;
252
- lastActivityAt?: number;
253
- status: VoiceSessionStatus;
254
- turnCount: number;
255
- };
256
- export type VoiceCallDisposition = 'completed' | 'transferred' | 'escalated' | 'voicemail' | 'no-answer' | 'failed' | 'closed';
257
- export type VoiceCallLifecycleEvent = {
258
- at: number;
259
- type: 'start' | 'end' | 'transfer' | 'escalation' | 'voicemail' | 'no-answer';
260
- disposition?: VoiceCallDisposition;
261
- metadata?: Record<string, unknown>;
262
- reason?: string;
263
- target?: string;
264
- };
265
- export type VoiceCallLifecycleState = {
266
- disposition?: VoiceCallDisposition;
267
- endedAt?: number;
268
- events: VoiceCallLifecycleEvent[];
269
- lastEventAt: number;
270
- startedAt: number;
271
- };
272
- export type VoiceHandoffAction = 'escalate' | 'no-answer' | 'transfer' | 'voicemail';
273
- export type VoiceHandoffStatus = 'delivered' | 'failed' | 'skipped';
274
- export type VoiceHandoffResult = {
275
- deliveredAt?: number;
276
- deliveredTo?: string;
277
- error?: string;
278
- metadata?: Record<string, unknown>;
279
- status: VoiceHandoffStatus;
280
- };
281
- export type VoiceHandoffDeliveryQueueStatus = VoiceHandoffStatus | 'pending';
282
- export type StoredVoiceHandoffDelivery<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = {
283
- action: VoiceHandoffAction;
284
- context: TContext;
285
- createdAt: number;
286
- deliveredAt?: number;
287
- deliveries?: Record<string, VoiceHandoffResult & {
288
- adapterId: string;
289
- adapterKind?: string;
290
- }>;
291
- deliveryAttempts?: number;
292
- deliveryError?: string;
293
- deliveryStatus: VoiceHandoffDeliveryQueueStatus;
294
- id: string;
295
- metadata?: Record<string, unknown>;
296
- reason?: string;
297
- result?: TResult;
298
- session: TSession;
299
- sessionId: string;
300
- target?: string;
301
- updatedAt: number;
302
- };
303
- export type VoiceHandoffDeliveryStore<TDelivery extends StoredVoiceHandoffDelivery = StoredVoiceHandoffDelivery> = {
304
- get: (id: string) => Promise<TDelivery | undefined> | TDelivery | undefined;
305
- list: () => Promise<TDelivery[]> | TDelivery[];
306
- remove: (id: string) => Promise<void> | void;
307
- set: (id: string, delivery: TDelivery) => Promise<void> | void;
308
- };
309
- export type VoiceHandoffInput<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = {
310
- action: VoiceHandoffAction;
311
- api: VoiceSessionHandle<TContext, TSession, TResult>;
312
- context: TContext;
313
- metadata?: Record<string, unknown>;
314
- reason?: string;
315
- result?: TResult;
316
- session: TSession;
317
- target?: string;
318
- };
319
- export type VoiceHandoffAdapter<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = {
320
- actions?: VoiceHandoffAction[];
321
- handoff: (input: VoiceHandoffInput<TContext, TSession, TResult>) => Promise<VoiceHandoffResult> | VoiceHandoffResult;
322
- id: string;
323
- kind?: string;
324
- };
325
- export type VoiceHandoffConfig<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = {
326
- adapters: VoiceHandoffAdapter<TContext, TSession, TResult>[];
327
- deliveryQueue?: VoiceHandoffDeliveryStore<StoredVoiceHandoffDelivery<TContext, TSession, TResult>>;
328
- enqueueOnly?: boolean;
329
- failMode?: 'record' | 'throw';
330
- };
331
- export type VoiceSessionStore<TSession extends VoiceSessionRecord = VoiceSessionRecord> = SessionStore<TSession, VoiceSessionSummary>;
332
- export type VoiceLogger = {
333
- debug?: (message: string, meta?: Record<string, unknown>) => void;
334
- info?: (message: string, meta?: Record<string, unknown>) => void;
335
- warn?: (message: string, meta?: Record<string, unknown>) => void;
336
- error?: (message: string, meta?: Record<string, unknown>) => void;
337
- };
338
- export type VoiceReconnectConfig = {
339
- strategy?: 'resume-last-turn' | 'restart' | 'fail';
340
- timeout?: number;
341
- maxAttempts?: number;
342
- };
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';
348
- export type VoiceSTTFallbackConfig = {
349
- adapter: STTAdapter;
350
- trigger?: VoiceTurnFallbackTrigger;
351
- confidenceThreshold?: number;
352
- minTextLength?: number;
353
- replayWindowMs?: number;
354
- settleMs?: number;
355
- completionTimeoutMs?: number;
356
- maxAttemptsPerTurn?: number;
357
- };
358
- export type VoiceResolvedSTTFallbackConfig = {
359
- adapter: STTAdapter;
360
- trigger: VoiceTurnFallbackTrigger;
361
- confidenceThreshold: number;
362
- minTextLength: number;
363
- replayWindowMs: number;
364
- settleMs: number;
365
- completionTimeoutMs: number;
366
- maxAttemptsPerTurn: number;
367
- };
368
- export type VoiceTurnDetectionConfig = {
369
- profile?: VoiceTurnProfile;
370
- qualityProfile?: VoiceTurnQualityProfile;
371
- silenceMs?: number;
372
- speechThreshold?: number;
373
- transcriptStabilityMs?: number;
374
- };
375
- export type VoiceResolvedTurnDetectionConfig = {
376
- qualityProfile: VoiceTurnQualityProfile;
377
- profile: VoiceTurnProfile;
378
- silenceMs: number;
379
- speechThreshold: number;
380
- transcriptStabilityMs: number;
381
- };
382
- export type VoiceAudioConditioningConfig = {
383
- enabled?: boolean;
384
- targetLevel?: number;
385
- maxGain?: number;
386
- noiseGateThreshold?: number;
387
- noiseGateAttenuation?: number;
388
- };
389
- export type VoiceResolvedAudioConditioningConfig = {
390
- enabled: true;
391
- targetLevel: number;
392
- maxGain: number;
393
- noiseGateThreshold: number;
394
- noiseGateAttenuation: number;
395
- };
396
- export type VoiceSocket = {
397
- send: (data: string | Uint8Array | ArrayBuffer) => void | Promise<void>;
398
- close: (code?: number, reason?: string) => void | Promise<void>;
399
- };
400
- export type VoiceSessionHandle<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = {
401
- id: string;
402
- connect: (socket: VoiceSocket) => Promise<void>;
403
- receiveAudio: (audio: AudioChunk) => Promise<void>;
404
- commitTurn: (reason?: VoiceEndOfTurnEvent['reason']) => Promise<void>;
405
- disconnect: (event?: VoiceCloseEvent) => Promise<void>;
406
- complete: (result?: TResult) => Promise<void>;
407
- escalate: (input: {
408
- metadata?: Record<string, unknown>;
409
- reason: string;
410
- result?: TResult;
411
- }) => Promise<void>;
412
- fail: (error: unknown) => Promise<void>;
413
- markNoAnswer: (input?: {
414
- metadata?: Record<string, unknown>;
415
- result?: TResult;
416
- }) => Promise<void>;
417
- markVoicemail: (input?: {
418
- metadata?: Record<string, unknown>;
419
- result?: TResult;
420
- }) => Promise<void>;
421
- transfer: (input: {
422
- metadata?: Record<string, unknown>;
423
- reason?: string;
424
- result?: TResult;
425
- target: string;
426
- }) => Promise<void>;
427
- close: (reason?: string) => Promise<void>;
428
- snapshot: () => Promise<TSession>;
429
- };
430
- export type VoiceRouteResult<TResult = unknown> = {
431
- complete?: boolean;
432
- result?: TResult;
433
- assistantText?: string;
434
- transfer?: {
435
- metadata?: Record<string, unknown>;
436
- reason?: string;
437
- target: string;
438
- };
439
- escalate?: {
440
- metadata?: Record<string, unknown>;
441
- reason: string;
442
- };
443
- voicemail?: {
444
- metadata?: Record<string, unknown>;
445
- };
446
- noAnswer?: {
447
- metadata?: Record<string, unknown>;
448
- };
449
- };
450
- export type VoiceTurnCorrectionResult = string | {
451
- text: string;
452
- reason?: string;
453
- provider?: string;
454
- metadata?: Record<string, unknown>;
455
- };
456
- export type VoiceTurnCorrectionHandler<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = (input: {
457
- api: VoiceSessionHandle<TContext, TSession, TResult>;
458
- context: TContext;
459
- fallback?: VoiceFallbackDiagnostics;
460
- lexicon: VoiceLexiconEntry[];
461
- phraseHints: VoicePhraseHint[];
462
- session: TSession;
463
- text: string;
464
- transcripts: Transcript[];
465
- }) => Promise<VoiceTurnCorrectionResult | void> | VoiceTurnCorrectionResult | void;
466
- export type VoicePhraseHintResolver<TContext = unknown> = (input: {
467
- context: TContext;
468
- scenarioId?: string;
469
- sessionId: string;
470
- }) => Promise<VoicePhraseHint[] | void> | VoicePhraseHint[] | void;
471
- export type VoiceLexiconResolver<TContext = unknown> = (input: {
472
- context: TContext;
473
- scenarioId?: string;
474
- sessionId: string;
475
- }) => Promise<VoiceLexiconEntry[] | void> | VoiceLexiconEntry[] | void;
476
- export type VoiceOnTurnObjectHandler<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = (input: {
477
- context: TContext;
478
- session: TSession;
479
- turn: VoiceTurnRecord;
480
- api: VoiceSessionHandle<TContext, TSession, TResult>;
481
- }) => Promise<VoiceRouteResult<TResult> | void> | VoiceRouteResult<TResult> | void;
482
- export type VoiceOnTurnHandler<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = VoiceOnTurnObjectHandler<TContext, TSession, TResult> | ((session: TSession, turn: VoiceTurnRecord, api: VoiceSessionHandle<TContext, TSession, TResult>, context: TContext) => Promise<VoiceRouteResult<TResult> | void> | VoiceRouteResult<TResult> | void);
483
- export type VoiceRouteConfig<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = {
484
- onCallStart?: (input: {
485
- context: TContext;
486
- session: TSession;
487
- api: VoiceSessionHandle<TContext, TSession, TResult>;
488
- }) => Promise<void> | void;
489
- onCallEnd?: (input: {
490
- api: VoiceSessionHandle<TContext, TSession, TResult>;
491
- context: TContext;
492
- disposition: VoiceCallDisposition;
493
- metadata?: Record<string, unknown>;
494
- reason?: string;
495
- session: TSession;
496
- target?: string;
497
- }) => Promise<void> | void;
498
- onSession?: (input: {
499
- context: TContext;
500
- session: TSession;
501
- api: VoiceSessionHandle<TContext, TSession, TResult>;
502
- }) => Promise<void> | void;
503
- correctTurn?: VoiceTurnCorrectionHandler<TContext, TSession, TResult>;
504
- onTurn: VoiceOnTurnHandler<TContext, TSession, TResult>;
505
- onComplete: (input: {
506
- context: TContext;
507
- session: TSession;
508
- api: VoiceSessionHandle<TContext, TSession, TResult>;
509
- }) => Promise<void> | void;
510
- onError?: (input: {
511
- context: TContext;
512
- sessionId: string;
513
- session?: TSession;
514
- error: unknown;
515
- api?: VoiceSessionHandle<TContext, TSession, TResult>;
516
- }) => Promise<void> | void;
517
- onEscalation?: (input: {
518
- api: VoiceSessionHandle<TContext, TSession, TResult>;
519
- context: TContext;
520
- metadata?: Record<string, unknown>;
521
- reason: string;
522
- session: TSession;
523
- }) => Promise<void> | void;
524
- onNoAnswer?: (input: {
525
- api: VoiceSessionHandle<TContext, TSession, TResult>;
526
- context: TContext;
527
- metadata?: Record<string, unknown>;
528
- session: TSession;
529
- }) => Promise<void> | void;
530
- onTransfer?: (input: {
531
- api: VoiceSessionHandle<TContext, TSession, TResult>;
532
- context: TContext;
533
- metadata?: Record<string, unknown>;
534
- reason?: string;
535
- session: TSession;
536
- target: string;
537
- }) => Promise<void> | void;
538
- onVoicemail?: (input: {
539
- api: VoiceSessionHandle<TContext, TSession, TResult>;
540
- context: TContext;
541
- metadata?: Record<string, unknown>;
542
- session: TSession;
543
- }) => Promise<void> | void;
544
- };
545
- export type VoiceRuntimeOpsConfig<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = {
546
- buildReview?: (input: {
547
- api: VoiceSessionHandle<TContext, TSession, TResult>;
548
- context: TContext;
549
- disposition: VoiceCallDisposition;
550
- metadata?: Record<string, unknown>;
551
- reason?: string;
552
- result?: TResult;
553
- session: TSession;
554
- target?: string;
555
- }) => Promise<VoiceCallReviewArtifact | StoredVoiceCallReviewArtifact | void> | VoiceCallReviewArtifact | StoredVoiceCallReviewArtifact | void;
556
- createTaskFromReview?: (input: {
557
- api: VoiceSessionHandle<TContext, TSession, TResult>;
558
- context: TContext;
559
- disposition: VoiceCallDisposition;
560
- review: StoredVoiceCallReviewArtifact;
561
- session: TSession;
562
- }) => Promise<Omit<VoiceOpsTask, 'id'> | VoiceOpsTask | StoredVoiceOpsTask | null | void> | Omit<VoiceOpsTask, 'id'> | VoiceOpsTask | StoredVoiceOpsTask | null | void;
563
- resolveTaskPolicy?: (input: {
564
- api: VoiceSessionHandle<TContext, TSession, TResult>;
565
- context: TContext;
566
- disposition: VoiceCallDisposition;
567
- metadata?: Record<string, unknown>;
568
- reason?: string;
569
- review?: StoredVoiceCallReviewArtifact;
570
- session: TSession;
571
- target?: string;
572
- task: StoredVoiceOpsTask;
573
- }) => Promise<VoiceOpsTaskPolicy | void> | VoiceOpsTaskPolicy | void;
574
- resolveTaskAssignment?: (input: {
575
- api: VoiceSessionHandle<TContext, TSession, TResult>;
576
- context: TContext;
577
- disposition: VoiceCallDisposition;
578
- metadata?: Record<string, unknown>;
579
- reason?: string;
580
- review?: StoredVoiceCallReviewArtifact;
581
- session: TSession;
582
- target?: string;
583
- task: StoredVoiceOpsTask;
584
- }) => Promise<VoiceOpsTaskAssignmentRule | void> | VoiceOpsTaskAssignmentRule | void;
585
- taskAssignmentRules?: VoiceOpsTaskAssignmentRules;
586
- taskPolicies?: VoiceOpsDispositionTaskPolicies;
587
- events?: VoiceIntegrationEventStore;
588
- onEvent?: (input: {
589
- api: VoiceSessionHandle<TContext, TSession, TResult>;
590
- context: TContext;
591
- event: StoredVoiceIntegrationEvent;
592
- session: TSession;
593
- }) => Promise<void> | void;
594
- reviews?: VoiceCallReviewStore;
595
- sinks?: VoiceIntegrationSink[];
596
- tasks?: VoiceOpsTaskStore;
597
- webhook?: VoiceIntegrationWebhookConfig;
598
- };
599
- export type VoiceNormalizedRouteConfig<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = Omit<VoiceRouteConfig<TContext, TSession, TResult>, 'onTurn'> & {
600
- onTurn: VoiceOnTurnObjectHandler<TContext, TSession, TResult>;
601
- };
602
- export type VoiceScenario = {
603
- id: string;
604
- name?: string;
605
- description?: string;
606
- metadata?: Record<string, unknown>;
607
- };
608
- export type VoiceExpectedSpeakerTurn = {
609
- speaker: string;
610
- text: string;
611
- };
612
- export type VoicePluginConfig<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = {
613
- costTelemetry?: VoiceCostTelemetryConfig<TContext, TSession, TResult>;
614
- path: string;
615
- languageStrategy?: VoiceLanguageStrategy;
616
- lexicon?: VoiceLexiconEntry[] | VoiceLexiconResolver<TContext>;
617
- phraseHints?: VoicePhraseHint[] | VoicePhraseHintResolver<TContext>;
618
- preset?: VoiceRuntimePreset;
619
- stt: STTAdapter;
620
- sttFallback?: VoiceSTTFallbackConfig;
621
- sttLifecycle?: VoiceSTTLifecycle;
622
- tts?: TTSAdapter;
623
- session: VoiceSessionStore<NoInfer<TSession>>;
624
- reconnect?: VoiceReconnectConfig;
625
- turnDetection?: VoiceTurnDetectionConfig;
626
- audioConditioning?: VoiceAudioConditioningConfig;
627
- logger?: VoiceLogger;
628
- htmx?: boolean | VoiceHTMXConfig<TSession, NoInfer<TResult>>;
629
- handoff?: VoiceHandoffConfig<TContext, TSession, TResult>;
630
- ops?: VoiceRuntimeOpsConfig<TContext, TSession, TResult>;
631
- trace?: VoiceTraceEventStore;
632
- } & VoiceRouteConfig<TContext, TSession, TResult>;
633
- export type CreateVoiceSessionOptions<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = {
634
- costTelemetry?: VoiceCostTelemetryConfig<TContext, TSession, TResult>;
635
- id: string;
636
- context: TContext;
637
- socket: VoiceSocket;
638
- stt: STTAdapter;
639
- tts?: TTSAdapter;
640
- languageStrategy?: VoiceLanguageStrategy;
641
- lexicon?: VoiceLexiconEntry[];
642
- sttFallback?: VoiceResolvedSTTFallbackConfig;
643
- store: VoiceSessionStore<TSession>;
644
- trace?: VoiceTraceEventStore;
645
- reconnect: Required<VoiceReconnectConfig>;
646
- phraseHints?: VoicePhraseHint[];
647
- scenarioId?: string;
648
- sttLifecycle: VoiceSTTLifecycle;
649
- turnDetection: VoiceResolvedTurnDetectionConfig;
650
- audioConditioning?: VoiceResolvedAudioConditioningConfig;
651
- handoff?: VoiceHandoffConfig<TContext, TSession, TResult>;
652
- route: VoiceNormalizedRouteConfig<TContext, TSession, TResult>;
653
- logger?: VoiceLogger;
654
- };
655
- export type CreateVoiceSession = <TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown>(options: CreateVoiceSessionOptions<TContext, TSession, TResult>) => VoiceSessionHandle<TContext, TSession, TResult>;
656
- export type VoiceClientStartMessage = {
657
- type: 'start';
658
- sessionId?: string;
659
- scenarioId?: string;
660
- };
661
- export type VoiceClientEndTurnMessage = {
662
- type: 'end_turn';
663
- };
664
- export type VoiceClientCloseMessage = {
665
- type: 'close';
666
- reason?: string;
667
- };
668
- export type VoiceClientCallControlMessage = {
669
- type: 'call_control';
670
- action: 'complete' | 'escalate' | 'no-answer' | 'transfer' | 'voicemail';
671
- metadata?: Record<string, unknown>;
672
- reason?: string;
673
- target?: string;
674
- };
675
- export type VoiceClientPingMessage = {
676
- type: 'ping';
677
- };
678
- export type VoiceClientMessage = VoiceClientStartMessage | VoiceClientEndTurnMessage | VoiceClientCloseMessage | VoiceClientCallControlMessage | VoiceClientPingMessage;
679
- export type VoiceServerSessionMessage = {
680
- type: 'session';
681
- sessionId: string;
682
- status: VoiceSessionStatus;
683
- scenarioId?: string;
684
- };
685
- export type VoiceServerPartialMessage = {
686
- type: 'partial';
687
- transcript: Transcript;
688
- };
689
- export type VoiceServerFinalMessage = {
690
- type: 'final';
691
- transcript: Transcript;
692
- };
693
- export type VoiceServerTurnMessage<TResult = unknown> = {
694
- type: 'turn';
695
- turn: VoiceTurnRecord<TResult>;
696
- };
697
- export type VoiceServerAssistantMessage = {
698
- type: 'assistant';
699
- text: string;
700
- turnId?: string;
701
- };
702
- export type VoiceServerAudioMessage = {
703
- type: 'audio';
704
- chunkBase64: string;
705
- format: AudioFormat;
706
- receivedAt: number;
707
- turnId?: string;
708
- };
709
- export type VoiceServerCompleteMessage = {
710
- type: 'complete';
711
- sessionId: string;
712
- };
713
- export type VoiceServerCallLifecycleMessage = {
714
- type: 'call_lifecycle';
715
- event: VoiceCallLifecycleEvent;
716
- sessionId: string;
717
- };
718
- export type VoiceServerErrorMessage = {
719
- type: 'error';
720
- message: string;
721
- recoverable?: boolean;
722
- };
723
- export type VoiceServerPongMessage = {
724
- type: 'pong';
725
- };
726
- export type VoiceServerMessage<TResult = unknown> = VoiceServerSessionMessage | VoiceServerPartialMessage | VoiceServerFinalMessage | VoiceServerTurnMessage<TResult> | VoiceServerAssistantMessage | VoiceServerAudioMessage | VoiceServerCallLifecycleMessage | VoiceServerCompleteMessage | VoiceServerErrorMessage | VoiceServerPongMessage;
727
- export type VoiceConnectionOptions = {
728
- protocols?: string[];
729
- scenarioId?: string;
730
- reconnect?: boolean;
731
- maxReconnectAttempts?: number;
732
- pingInterval?: number;
733
- sessionId?: string;
734
- };
735
- export type VoiceCaptureOptions = {
736
- channelCount?: 1 | 2;
737
- onLevel?: (level: number) => void;
738
- sampleRateHz?: number;
739
- };
740
- export type VoiceControllerOptions = {
741
- preset?: VoiceRuntimePreset;
742
- connection?: VoiceConnectionOptions;
743
- capture?: VoiceCaptureOptions;
744
- autoStopOnComplete?: boolean;
745
- };
746
- export type VoiceBargeInOptions = {
747
- enabled?: boolean;
748
- interruptOnPartial?: boolean;
749
- interruptThreshold?: number;
750
- };
751
- export type VoiceAudioPlayerOptions = {
752
- autoStart?: boolean;
753
- createAudioContext?: () => AudioContext;
754
- lookaheadMs?: number;
755
- };
756
- export type VoiceDuplexControllerOptions = VoiceControllerOptions & {
757
- audioPlayer?: VoiceAudioPlayerOptions;
758
- bargeIn?: VoiceBargeInOptions;
759
- };
760
- export type VoiceSTTRoutingGoal = 'best' | 'low-cost';
761
- export type VoiceSTTRoutingCorrectionMode = 'generic' | 'none' | 'risky-turn';
762
- export type VoiceSTTRoutingStrategy = {
763
- benchmarkSessionTarget: 'deepgram-corrected' | 'deepgram-flux';
764
- correctionMode: VoiceSTTRoutingCorrectionMode;
765
- goal: VoiceSTTRoutingGoal;
766
- notes: string[];
767
- preset: VoiceRuntimePreset;
768
- sttLifecycle: VoiceSTTLifecycle;
769
- };
770
- export type VoiceHTMXRenderInput<TResult = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord> = {
771
- assistantTexts: string[];
772
- partial: string;
773
- scenarioId?: string;
774
- result?: TResult;
775
- session?: TSession;
776
- sessionId?: string;
777
- status: VoiceSessionStatus | 'idle';
778
- turnCount: number;
779
- turns: VoiceTurnRecord<TResult>[];
780
- };
781
- export type VoiceHTMXRenderConfig<TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = {
782
- metrics?: (input: VoiceHTMXRenderInput<TResult, TSession>) => string;
783
- status?: (input: VoiceHTMXRenderInput<TResult, TSession>) => string;
784
- turns?: (input: VoiceHTMXRenderInput<TResult, TSession>) => string;
785
- assistant?: (input: VoiceHTMXRenderInput<TResult, TSession>) => string;
786
- result?: (input: VoiceHTMXRenderInput<TResult, TSession>) => string;
787
- emptyState?: (kind: keyof VoiceHTMXTargets, input: VoiceHTMXRenderInput<TResult, TSession>) => string;
788
- };
789
- export type VoiceHTMXRenderer<TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = (input: VoiceHTMXRenderInput<TResult, TSession>) => string;
790
- export type VoiceHTMXTargets = {
791
- assistant: string;
792
- metrics: string;
793
- result: string;
794
- status: string;
795
- turns: string;
796
- };
797
- export type VoiceHTMXOptions<TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = VoiceHTMXRenderConfig<TSession, TResult> & {
798
- bootstrapRoute?: string;
799
- route?: string;
800
- targets?: Partial<VoiceHTMXTargets>;
801
- };
802
- export type VoiceHTMXConfig<TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = VoiceHTMXRenderer<TSession, TResult> | VoiceHTMXOptions<TSession, TResult>;
803
- export type VoiceStreamState<TResult = unknown> = {
804
- call: VoiceCallLifecycleState | null;
805
- sessionId: string | null;
806
- scenarioId: string | null;
807
- status: VoiceSessionStatus | 'idle';
808
- partial: string;
809
- turns: VoiceTurnRecord<TResult>[];
810
- assistantTexts: string[];
811
- assistantAudio: Array<{
812
- chunk: Uint8Array;
813
- format: AudioFormat;
814
- receivedAt: number;
815
- turnId?: string;
816
- }>;
817
- error: string | null;
818
- isConnected: boolean;
819
- };
820
- export type VoiceStream<TResult = unknown> = {
821
- call: VoiceCallLifecycleState | null;
822
- callControl: (message: Omit<VoiceClientCallControlMessage, 'type'>) => void;
823
- close: () => void;
824
- start: (input?: {
825
- scenarioId?: string;
826
- sessionId?: string;
827
- }) => Promise<void>;
828
- endTurn: () => void;
829
- error: string | null;
830
- getServerSnapshot: () => VoiceStreamState<TResult>;
831
- getSnapshot: () => VoiceStreamState<TResult>;
832
- isConnected: boolean;
833
- partial: string;
834
- sendAudio: (audio: Uint8Array | ArrayBuffer) => void;
835
- sessionId: string | null;
836
- scenarioId: string | null;
837
- status: VoiceSessionStatus | 'idle';
838
- subscribe: (subscriber: () => void) => () => void;
839
- turns: VoiceTurnRecord<TResult>[];
840
- assistantTexts: string[];
841
- assistantAudio: Array<{
842
- chunk: Uint8Array;
843
- format: AudioFormat;
844
- receivedAt: number;
845
- turnId?: string;
846
- }>;
847
- };
848
- export type VoiceControllerState<TResult = unknown> = VoiceStreamState<TResult> & {
849
- isRecording: boolean;
850
- recordingError: string | null;
851
- };
852
- export type VoiceAudioPlayerState = {
853
- activeSourceCount: number;
854
- error: string | null;
855
- isActive: boolean;
856
- isPlaying: boolean;
857
- lastInterruptLatencyMs?: number;
858
- lastPlaybackStopLatencyMs?: number;
859
- processedChunkCount: number;
860
- queuedChunkCount: number;
861
- };
862
- export type VoiceAudioPlayerSource = {
863
- assistantAudio: VoiceStreamState['assistantAudio'];
864
- subscribe: (subscriber: () => void) => () => void;
865
- };
866
- export type VoiceAudioPlayer = {
867
- close: () => Promise<void>;
868
- error: string | null;
869
- getSnapshot: () => VoiceAudioPlayerState;
870
- activeSourceCount: number;
871
- isActive: boolean;
872
- isPlaying: boolean;
873
- interrupt: () => Promise<void>;
874
- lastInterruptLatencyMs?: number;
875
- lastPlaybackStopLatencyMs?: number;
876
- pause: () => Promise<void>;
877
- processedChunkCount: number;
878
- queuedChunkCount: number;
879
- start: () => Promise<void>;
880
- subscribe: (subscriber: () => void) => () => void;
881
- };
882
- export type VoiceBargeInBinding = {
883
- close: () => void;
884
- handleLevel: (level: number) => void;
885
- sendAudio: (audio: Uint8Array | ArrayBuffer) => void;
886
- };
887
- export type VoiceController<TResult = unknown> = {
888
- bindHTMX: (options: VoiceHTMXBindingOptions) => () => void;
889
- call: VoiceCallLifecycleState | null;
890
- callControl: (message: Omit<VoiceClientCallControlMessage, 'type'>) => void;
891
- close: () => void;
892
- endTurn: () => void;
893
- start: (input?: {
894
- scenarioId?: string;
895
- sessionId?: string;
896
- }) => Promise<void>;
897
- error: string | null;
898
- getServerSnapshot: () => VoiceControllerState<TResult>;
899
- getSnapshot: () => VoiceControllerState<TResult>;
900
- isConnected: boolean;
901
- isRecording: boolean;
902
- partial: string;
903
- recordingError: string | null;
904
- sendAudio: (audio: Uint8Array | ArrayBuffer) => void;
905
- sessionId: string | null;
906
- scenarioId: string | null;
907
- startRecording: () => Promise<void>;
908
- status: VoiceSessionStatus | 'idle';
909
- stopRecording: () => void;
910
- subscribe: (subscriber: () => void) => () => void;
911
- toggleRecording: () => Promise<void>;
912
- turns: VoiceTurnRecord<TResult>[];
913
- assistantTexts: string[];
914
- assistantAudio: Array<{
915
- chunk: Uint8Array;
916
- format: AudioFormat;
917
- receivedAt: number;
918
- turnId?: string;
919
- }>;
920
- };
921
- export type VoiceDuplexController<TResult = unknown> = VoiceController<TResult> & {
922
- audioPlayer: VoiceAudioPlayer;
923
- interruptAssistant: () => Promise<void>;
924
- };
925
- export type VoiceHTMXBindingOptions = {
926
- element: Element | string;
927
- eventName?: string;
928
- route?: string;
929
- sessionQueryParam?: string;
930
- };
931
- export type VoiceStoreAction<TResult = unknown> = {
932
- type: 'session';
933
- sessionId: string;
934
- scenarioId?: string;
935
- status: VoiceSessionStatus;
936
- } | {
937
- type: 'call_lifecycle';
938
- event: VoiceCallLifecycleEvent;
939
- sessionId: string;
940
- } | {
941
- type: 'partial';
942
- transcript: Transcript;
943
- } | {
944
- type: 'final';
945
- transcript: Transcript;
946
- } | {
947
- type: 'turn';
948
- turn: VoiceTurnRecord<TResult>;
949
- } | {
950
- type: 'assistant';
951
- text: string;
952
- } | {
953
- type: 'audio';
954
- chunk: Uint8Array;
955
- format: AudioFormat;
956
- receivedAt: number;
957
- turnId?: string;
958
- } | {
959
- type: 'complete';
960
- sessionId: string;
961
- } | {
962
- type: 'error';
963
- message: string;
964
- } | {
965
- type: 'connected';
966
- } | {
967
- type: 'disconnected';
968
- };