@absolutejs/voice 0.0.22-beta.25 → 0.0.22-beta.251

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 (226) hide show
  1. package/README.md +3234 -228
  2. package/dist/agent.d.ts +62 -0
  3. package/dist/agentSquadContract.d.ts +69 -0
  4. package/dist/angular/index.d.ts +15 -0
  5. package/dist/angular/index.js +3387 -1093
  6. package/dist/angular/voice-agent-squad-status.service.d.ts +12 -0
  7. package/dist/angular/voice-campaign-dialer-proof.service.d.ts +14 -0
  8. package/dist/angular/voice-controller.service.d.ts +1 -0
  9. package/dist/angular/voice-delivery-runtime.component.d.ts +17 -0
  10. package/dist/angular/voice-delivery-runtime.service.d.ts +16 -0
  11. package/dist/angular/voice-live-ops.service.d.ts +11 -0
  12. package/dist/angular/voice-ops-action-center.service.d.ts +13 -0
  13. package/dist/angular/voice-ops-status.component.d.ts +15 -0
  14. package/dist/angular/voice-ops-status.service.d.ts +12 -0
  15. package/dist/angular/voice-platform-coverage.service.d.ts +12 -0
  16. package/dist/angular/voice-proof-trends.service.d.ts +12 -0
  17. package/dist/angular/voice-provider-capabilities.service.d.ts +12 -0
  18. package/dist/angular/voice-provider-contracts.service.d.ts +12 -0
  19. package/dist/angular/voice-routing-status.service.d.ts +11 -0
  20. package/dist/angular/voice-stream.service.d.ts +3 -0
  21. package/dist/angular/voice-trace-timeline.service.d.ts +12 -0
  22. package/dist/angular/voice-turn-latency.service.d.ts +13 -0
  23. package/dist/angular/voice-turn-quality.service.d.ts +12 -0
  24. package/dist/angular/voice-workflow-status.service.d.ts +12 -0
  25. package/dist/audit.d.ts +128 -0
  26. package/dist/auditDeliveryRoutes.d.ts +85 -0
  27. package/dist/auditExport.d.ts +34 -0
  28. package/dist/auditRoutes.d.ts +66 -0
  29. package/dist/auditSinks.d.ts +151 -0
  30. package/dist/bargeInRoutes.d.ts +56 -0
  31. package/dist/campaign.d.ts +746 -0
  32. package/dist/campaignDialers.d.ts +90 -0
  33. package/dist/client/actions.d.ts +105 -0
  34. package/dist/client/agentSquadStatus.d.ts +37 -0
  35. package/dist/client/agentSquadStatusWidget.d.ts +24 -0
  36. package/dist/client/bargeInMonitor.d.ts +7 -0
  37. package/dist/client/campaignDialerProof.d.ts +23 -0
  38. package/dist/client/connection.d.ts +3 -0
  39. package/dist/client/deliveryRuntime.d.ts +34 -0
  40. package/dist/client/deliveryRuntimeWidget.d.ts +37 -0
  41. package/dist/client/duplex.d.ts +1 -1
  42. package/dist/client/htmxBootstrap.js +747 -15
  43. package/dist/client/index.d.ts +66 -0
  44. package/dist/client/index.js +4894 -21
  45. package/dist/client/liveOps.d.ts +22 -0
  46. package/dist/client/liveOpsWidget.d.ts +23 -0
  47. package/dist/client/liveTurnLatency.d.ts +41 -0
  48. package/dist/client/opsActionCenter.d.ts +54 -0
  49. package/dist/client/opsActionCenterWidget.d.ts +29 -0
  50. package/dist/client/opsActionHistory.d.ts +19 -0
  51. package/dist/client/opsActionHistoryWidget.d.ts +11 -0
  52. package/dist/client/opsStatus.d.ts +19 -0
  53. package/dist/client/opsStatusWidget.d.ts +40 -0
  54. package/dist/client/platformCoverage.d.ts +19 -0
  55. package/dist/client/platformCoverageWidget.d.ts +37 -0
  56. package/dist/client/proofTrends.d.ts +19 -0
  57. package/dist/client/proofTrendsWidget.d.ts +37 -0
  58. package/dist/client/providerCapabilities.d.ts +19 -0
  59. package/dist/client/providerCapabilitiesWidget.d.ts +32 -0
  60. package/dist/client/providerContracts.d.ts +19 -0
  61. package/dist/client/providerContractsWidget.d.ts +37 -0
  62. package/dist/client/providerSimulationControls.d.ts +33 -0
  63. package/dist/client/providerSimulationControlsWidget.d.ts +20 -0
  64. package/dist/client/providerStatusWidget.d.ts +32 -0
  65. package/dist/client/routingStatus.d.ts +19 -0
  66. package/dist/client/routingStatusWidget.d.ts +28 -0
  67. package/dist/client/traceTimeline.d.ts +19 -0
  68. package/dist/client/traceTimelineWidget.d.ts +36 -0
  69. package/dist/client/turnLatency.d.ts +22 -0
  70. package/dist/client/turnLatencyWidget.d.ts +33 -0
  71. package/dist/client/turnQuality.d.ts +19 -0
  72. package/dist/client/turnQualityWidget.d.ts +32 -0
  73. package/dist/client/workflowStatus.d.ts +19 -0
  74. package/dist/dataControl.d.ts +140 -0
  75. package/dist/deliveryRuntime.d.ts +158 -0
  76. package/dist/deliverySinkRoutes.d.ts +117 -0
  77. package/dist/demoReadyRoutes.d.ts +98 -0
  78. package/dist/diagnosticsRoutes.d.ts +44 -0
  79. package/dist/evalRoutes.d.ts +219 -0
  80. package/dist/fileStore.d.ts +14 -2
  81. package/dist/guardrails.d.ts +128 -0
  82. package/dist/handoff.d.ts +54 -0
  83. package/dist/handoffHealth.d.ts +94 -0
  84. package/dist/incidentBundle.d.ts +116 -0
  85. package/dist/index.d.ts +132 -13
  86. package/dist/index.js +24299 -4986
  87. package/dist/latencySlo.d.ts +56 -0
  88. package/dist/liveLatency.d.ts +78 -0
  89. package/dist/liveOps.d.ts +122 -0
  90. package/dist/modelAdapters.d.ts +23 -2
  91. package/dist/observabilityExport.d.ts +428 -0
  92. package/dist/openaiRealtime.d.ts +27 -0
  93. package/dist/openaiTTS.d.ts +18 -0
  94. package/dist/operationsRecord.d.ts +210 -0
  95. package/dist/opsActionAuditRoutes.d.ts +99 -0
  96. package/dist/opsConsoleRoutes.d.ts +80 -0
  97. package/dist/opsRecovery.d.ts +137 -0
  98. package/dist/opsStatus.d.ts +76 -0
  99. package/dist/opsStatusRoutes.d.ts +33 -0
  100. package/dist/outcomeContract.d.ts +115 -0
  101. package/dist/phoneAgent.d.ts +76 -0
  102. package/dist/phoneAgentProductionSmoke.d.ts +115 -0
  103. package/dist/platformCoverage.d.ts +91 -0
  104. package/dist/postCallAnalysis.d.ts +98 -0
  105. package/dist/postgresStore.d.ts +13 -2
  106. package/dist/productionReadiness.d.ts +484 -0
  107. package/dist/proofTrends.d.ts +108 -0
  108. package/dist/providerAdapters.d.ts +48 -0
  109. package/dist/providerCapabilities.d.ts +92 -0
  110. package/dist/providerHealth.d.ts +1 -0
  111. package/dist/providerRoutingContract.d.ts +38 -0
  112. package/dist/providerSlo.d.ts +142 -0
  113. package/dist/providerStackRecommendations.d.ts +145 -0
  114. package/dist/qualityRoutes.d.ts +76 -0
  115. package/dist/queue.d.ts +61 -0
  116. package/dist/react/VoiceAgentSquadStatus.d.ts +5 -0
  117. package/dist/react/VoiceDeliveryRuntime.d.ts +7 -0
  118. package/dist/react/VoiceOpsActionCenter.d.ts +5 -0
  119. package/dist/react/VoiceOpsStatus.d.ts +6 -0
  120. package/dist/react/VoicePlatformCoverage.d.ts +6 -0
  121. package/dist/react/VoiceProofTrends.d.ts +6 -0
  122. package/dist/react/VoiceProviderCapabilities.d.ts +6 -0
  123. package/dist/react/VoiceProviderContracts.d.ts +6 -0
  124. package/dist/react/VoiceProviderSimulationControls.d.ts +5 -0
  125. package/dist/react/VoiceProviderStatus.d.ts +6 -0
  126. package/dist/react/VoiceRoutingStatus.d.ts +6 -0
  127. package/dist/react/VoiceTraceTimeline.d.ts +6 -0
  128. package/dist/react/VoiceTurnLatency.d.ts +6 -0
  129. package/dist/react/VoiceTurnQuality.d.ts +6 -0
  130. package/dist/react/index.d.ts +30 -0
  131. package/dist/react/index.js +4739 -33
  132. package/dist/react/useVoiceAgentSquadStatus.d.ts +8 -0
  133. package/dist/react/useVoiceCampaignDialerProof.d.ts +10 -0
  134. package/dist/react/useVoiceController.d.ts +3 -0
  135. package/dist/react/useVoiceDeliveryRuntime.d.ts +13 -0
  136. package/dist/react/useVoiceLiveOps.d.ts +9 -0
  137. package/dist/react/useVoiceOpsActionCenter.d.ts +11 -0
  138. package/dist/react/useVoiceOpsStatus.d.ts +8 -0
  139. package/dist/react/useVoicePlatformCoverage.d.ts +8 -0
  140. package/dist/react/useVoiceProofTrends.d.ts +8 -0
  141. package/dist/react/useVoiceProviderCapabilities.d.ts +8 -0
  142. package/dist/react/useVoiceProviderContracts.d.ts +8 -0
  143. package/dist/react/useVoiceProviderSimulationControls.d.ts +10 -0
  144. package/dist/react/useVoiceRoutingStatus.d.ts +8 -0
  145. package/dist/react/useVoiceStream.d.ts +3 -0
  146. package/dist/react/useVoiceTraceTimeline.d.ts +8 -0
  147. package/dist/react/useVoiceTurnLatency.d.ts +9 -0
  148. package/dist/react/useVoiceTurnQuality.d.ts +8 -0
  149. package/dist/react/useVoiceWorkflowStatus.d.ts +8 -0
  150. package/dist/readinessProfiles.d.ts +37 -0
  151. package/dist/reconnectContract.d.ts +87 -0
  152. package/dist/resilienceRoutes.d.ts +143 -0
  153. package/dist/sessionReplay.d.ts +12 -0
  154. package/dist/simulationSuite.d.ts +121 -0
  155. package/dist/sqliteStore.d.ts +13 -2
  156. package/dist/svelte/createVoiceAgentSquadStatus.d.ts +9 -0
  157. package/dist/svelte/createVoiceCampaignDialerProof.d.ts +9 -0
  158. package/dist/svelte/createVoiceDeliveryRuntime.d.ts +11 -0
  159. package/dist/svelte/createVoiceLiveOps.d.ts +13 -0
  160. package/dist/svelte/createVoiceOpsActionCenter.d.ts +10 -0
  161. package/dist/svelte/createVoiceOpsStatus.d.ts +9 -0
  162. package/dist/svelte/createVoicePlatformCoverage.d.ts +7 -0
  163. package/dist/svelte/createVoiceProofTrends.d.ts +7 -0
  164. package/dist/svelte/createVoiceProviderCapabilities.d.ts +10 -0
  165. package/dist/svelte/createVoiceProviderContracts.d.ts +10 -0
  166. package/dist/svelte/createVoiceProviderSimulationControls.d.ts +11 -0
  167. package/dist/svelte/createVoiceProviderStatus.d.ts +4 -2
  168. package/dist/svelte/createVoiceRoutingStatus.d.ts +10 -0
  169. package/dist/svelte/createVoiceTraceTimeline.d.ts +10 -0
  170. package/dist/svelte/createVoiceTurnLatency.d.ts +11 -0
  171. package/dist/svelte/createVoiceTurnQuality.d.ts +10 -0
  172. package/dist/svelte/createVoiceWorkflowStatus.d.ts +8 -0
  173. package/dist/svelte/index.d.ts +16 -0
  174. package/dist/svelte/index.js +4754 -439
  175. package/dist/telephony/contract.d.ts +61 -0
  176. package/dist/telephony/matrix.d.ts +97 -0
  177. package/dist/telephony/plivo.d.ts +254 -0
  178. package/dist/telephony/telnyx.d.ts +247 -0
  179. package/dist/telephony/twilio.d.ts +135 -2
  180. package/dist/telephonyOutcome.d.ts +201 -0
  181. package/dist/testing/index.d.ts +1 -0
  182. package/dist/testing/index.js +2024 -69
  183. package/dist/testing/ioProviderSimulator.d.ts +41 -0
  184. package/dist/toolContract.d.ts +133 -0
  185. package/dist/toolRuntime.d.ts +50 -0
  186. package/dist/trace.d.ts +19 -1
  187. package/dist/traceDeliveryRoutes.d.ts +86 -0
  188. package/dist/traceTimeline.d.ts +97 -0
  189. package/dist/turnLatency.d.ts +95 -0
  190. package/dist/turnQuality.d.ts +94 -0
  191. package/dist/types.d.ts +180 -4
  192. package/dist/vue/VoiceDeliveryRuntime.d.ts +30 -0
  193. package/dist/vue/VoiceOpsActionCenter.d.ts +13 -0
  194. package/dist/vue/VoiceOpsStatus.d.ts +30 -0
  195. package/dist/vue/VoicePlatformCoverage.d.ts +23 -0
  196. package/dist/vue/VoiceProofTrends.d.ts +21 -0
  197. package/dist/vue/VoiceProviderCapabilities.d.ts +51 -0
  198. package/dist/vue/VoiceProviderContracts.d.ts +21 -0
  199. package/dist/vue/VoiceProviderSimulationControls.d.ts +88 -0
  200. package/dist/vue/VoiceProviderStatus.d.ts +51 -0
  201. package/dist/vue/VoiceRoutingStatus.d.ts +51 -0
  202. package/dist/vue/VoiceTurnLatency.d.ts +69 -0
  203. package/dist/vue/VoiceTurnQuality.d.ts +51 -0
  204. package/dist/vue/index.d.ts +28 -0
  205. package/dist/vue/index.js +4519 -57
  206. package/dist/vue/useVoiceAgentSquadStatus.d.ts +9 -0
  207. package/dist/vue/useVoiceCampaignDialerProof.d.ts +11 -0
  208. package/dist/vue/useVoiceController.d.ts +2 -1
  209. package/dist/vue/useVoiceDeliveryRuntime.d.ts +13 -0
  210. package/dist/vue/useVoiceLiveOps.d.ts +9 -0
  211. package/dist/vue/useVoiceOpsActionCenter.d.ts +11 -0
  212. package/dist/vue/useVoiceOpsStatus.d.ts +9 -0
  213. package/dist/vue/useVoicePlatformCoverage.d.ts +9 -0
  214. package/dist/vue/useVoiceProofTrends.d.ts +9 -0
  215. package/dist/vue/useVoiceProviderCapabilities.d.ts +9 -0
  216. package/dist/vue/useVoiceProviderContracts.d.ts +9 -0
  217. package/dist/vue/useVoiceProviderSimulationControls.d.ts +24 -0
  218. package/dist/vue/useVoiceProviderStatus.d.ts +1 -1
  219. package/dist/vue/useVoiceRoutingStatus.d.ts +8 -0
  220. package/dist/vue/useVoiceStream.d.ts +4 -1
  221. package/dist/vue/useVoiceTraceTimeline.d.ts +9 -0
  222. package/dist/vue/useVoiceTurnLatency.d.ts +10 -0
  223. package/dist/vue/useVoiceTurnQuality.d.ts +9 -0
  224. package/dist/vue/useVoiceWorkflowStatus.d.ts +9 -0
  225. package/dist/workflowContract.d.ts +91 -0
  226. package/package.json +1 -1
package/dist/types.d.ts CHANGED
@@ -3,6 +3,7 @@ import type { VoiceOpsDispositionTaskPolicies, VoiceOpsTaskAssignmentRule, Voice
3
3
  import type { VoiceIntegrationSink } from './opsSinks';
4
4
  import type { StoredVoiceCallReviewArtifact, VoiceCallReviewArtifact, VoiceCallReviewStore } from './testing/review';
5
5
  import type { VoiceTraceEventStore } from './trace';
6
+ import type { VoiceLiveOpsControlState } from './liveOps';
6
7
  export type AudioFormat = {
7
8
  container: 'raw';
8
9
  encoding: 'alaw' | 'mulaw' | 'pcm_s16le';
@@ -193,6 +194,15 @@ export type RealtimeAdapter<TOptions extends RealtimeAdapterOpenOptions = Realti
193
194
  open: (options: TOptions) => Promise<RealtimeAdapterSession> | RealtimeAdapterSession;
194
195
  };
195
196
  export type VoiceSessionStatus = 'active' | 'reconnecting' | 'completed' | 'failed';
197
+ export type VoiceReconnectClientStatus = 'idle' | 'reconnecting' | 'resumed' | 'exhausted';
198
+ export type VoiceReconnectClientState = {
199
+ attempts: number;
200
+ lastDisconnectAt?: number;
201
+ lastResumedAt?: number;
202
+ maxAttempts: number;
203
+ nextAttemptAt?: number;
204
+ status: VoiceReconnectClientStatus;
205
+ };
196
206
  export type VoiceTurnRecord<TResult = unknown> = {
197
207
  id: string;
198
208
  text: string;
@@ -269,6 +279,65 @@ export type VoiceCallLifecycleState = {
269
279
  lastEventAt: number;
270
280
  startedAt: number;
271
281
  };
282
+ export type VoiceHandoffAction = 'escalate' | 'no-answer' | 'transfer' | 'voicemail';
283
+ export type VoiceHandoffStatus = 'delivered' | 'failed' | 'skipped';
284
+ export type VoiceHandoffResult = {
285
+ deliveredAt?: number;
286
+ deliveredTo?: string;
287
+ error?: string;
288
+ metadata?: Record<string, unknown>;
289
+ status: VoiceHandoffStatus;
290
+ };
291
+ export type VoiceHandoffDeliveryQueueStatus = VoiceHandoffStatus | 'pending';
292
+ export type StoredVoiceHandoffDelivery<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = {
293
+ action: VoiceHandoffAction;
294
+ context: TContext;
295
+ createdAt: number;
296
+ deliveredAt?: number;
297
+ deliveries?: Record<string, VoiceHandoffResult & {
298
+ adapterId: string;
299
+ adapterKind?: string;
300
+ }>;
301
+ deliveryAttempts?: number;
302
+ deliveryError?: string;
303
+ deliveryStatus: VoiceHandoffDeliveryQueueStatus;
304
+ id: string;
305
+ metadata?: Record<string, unknown>;
306
+ reason?: string;
307
+ result?: TResult;
308
+ session: TSession;
309
+ sessionId: string;
310
+ target?: string;
311
+ updatedAt: number;
312
+ };
313
+ export type VoiceHandoffDeliveryStore<TDelivery extends StoredVoiceHandoffDelivery = StoredVoiceHandoffDelivery> = {
314
+ get: (id: string) => Promise<TDelivery | undefined> | TDelivery | undefined;
315
+ list: () => Promise<TDelivery[]> | TDelivery[];
316
+ remove: (id: string) => Promise<void> | void;
317
+ set: (id: string, delivery: TDelivery) => Promise<void> | void;
318
+ };
319
+ export type VoiceHandoffInput<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = {
320
+ action: VoiceHandoffAction;
321
+ api: VoiceSessionHandle<TContext, TSession, TResult>;
322
+ context: TContext;
323
+ metadata?: Record<string, unknown>;
324
+ reason?: string;
325
+ result?: TResult;
326
+ session: TSession;
327
+ target?: string;
328
+ };
329
+ export type VoiceHandoffAdapter<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = {
330
+ actions?: VoiceHandoffAction[];
331
+ handoff: (input: VoiceHandoffInput<TContext, TSession, TResult>) => Promise<VoiceHandoffResult> | VoiceHandoffResult;
332
+ id: string;
333
+ kind?: string;
334
+ };
335
+ export type VoiceHandoffConfig<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = {
336
+ adapters: VoiceHandoffAdapter<TContext, TSession, TResult>[];
337
+ deliveryQueue?: VoiceHandoffDeliveryStore<StoredVoiceHandoffDelivery<TContext, TSession, TResult>>;
338
+ enqueueOnly?: boolean;
339
+ failMode?: 'record' | 'throw';
340
+ };
272
341
  export type VoiceSessionStore<TSession extends VoiceSessionRecord = VoiceSessionRecord> = SessionStore<TSession, VoiceSessionSummary>;
273
342
  export type VoiceLogger = {
274
343
  debug?: (message: string, meta?: Record<string, unknown>) => void;
@@ -416,6 +485,10 @@ export type VoiceLexiconResolver<TContext = unknown> = (input: {
416
485
  }) => Promise<VoiceLexiconEntry[] | void> | VoiceLexiconEntry[] | void;
417
486
  export type VoiceOnTurnObjectHandler<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = (input: {
418
487
  context: TContext;
488
+ liveOps?: {
489
+ control: VoiceLiveOpsControlState;
490
+ injectedInstruction?: string;
491
+ };
419
492
  session: TSession;
420
493
  turn: VoiceTurnRecord;
421
494
  api: VoiceSessionHandle<TContext, TSession, TResult>;
@@ -537,6 +610,9 @@ export type VoiceRuntimeOpsConfig<TContext = unknown, TSession extends VoiceSess
537
610
  tasks?: VoiceOpsTaskStore;
538
611
  webhook?: VoiceIntegrationWebhookConfig;
539
612
  };
613
+ export type VoiceLiveOpsRuntimeConfig = {
614
+ getControl: (sessionId: string) => Promise<VoiceLiveOpsControlState | null | undefined> | VoiceLiveOpsControlState | null | undefined;
615
+ };
540
616
  export type VoiceNormalizedRouteConfig<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = Omit<VoiceRouteConfig<TContext, TSession, TResult>, 'onTurn'> & {
541
617
  onTurn: VoiceOnTurnObjectHandler<TContext, TSession, TResult>;
542
618
  };
@@ -557,9 +633,11 @@ export type VoicePluginConfig<TContext = unknown, TSession extends VoiceSessionR
557
633
  lexicon?: VoiceLexiconEntry[] | VoiceLexiconResolver<TContext>;
558
634
  phraseHints?: VoicePhraseHint[] | VoicePhraseHintResolver<TContext>;
559
635
  preset?: VoiceRuntimePreset;
560
- stt: STTAdapter;
636
+ stt?: STTAdapter;
561
637
  sttFallback?: VoiceSTTFallbackConfig;
562
638
  sttLifecycle?: VoiceSTTLifecycle;
639
+ realtime?: RealtimeAdapter;
640
+ realtimeInputFormat?: AudioFormat;
563
641
  tts?: TTSAdapter;
564
642
  session: VoiceSessionStore<NoInfer<TSession>>;
565
643
  reconnect?: VoiceReconnectConfig;
@@ -567,7 +645,9 @@ export type VoicePluginConfig<TContext = unknown, TSession extends VoiceSessionR
567
645
  audioConditioning?: VoiceAudioConditioningConfig;
568
646
  logger?: VoiceLogger;
569
647
  htmx?: boolean | VoiceHTMXConfig<TSession, NoInfer<TResult>>;
648
+ handoff?: VoiceHandoffConfig<TContext, TSession, TResult>;
570
649
  ops?: VoiceRuntimeOpsConfig<TContext, TSession, TResult>;
650
+ liveOps?: VoiceLiveOpsRuntimeConfig;
571
651
  trace?: VoiceTraceEventStore;
572
652
  } & VoiceRouteConfig<TContext, TSession, TResult>;
573
653
  export type CreateVoiceSessionOptions<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = {
@@ -575,7 +655,9 @@ export type CreateVoiceSessionOptions<TContext = unknown, TSession extends Voice
575
655
  id: string;
576
656
  context: TContext;
577
657
  socket: VoiceSocket;
578
- stt: STTAdapter;
658
+ stt?: STTAdapter;
659
+ realtime?: RealtimeAdapter;
660
+ realtimeInputFormat?: AudioFormat;
579
661
  tts?: TTSAdapter;
580
662
  languageStrategy?: VoiceLanguageStrategy;
581
663
  lexicon?: VoiceLexiconEntry[];
@@ -588,6 +670,8 @@ export type CreateVoiceSessionOptions<TContext = unknown, TSession extends Voice
588
670
  sttLifecycle: VoiceSTTLifecycle;
589
671
  turnDetection: VoiceResolvedTurnDetectionConfig;
590
672
  audioConditioning?: VoiceResolvedAudioConditioningConfig;
673
+ handoff?: VoiceHandoffConfig<TContext, TSession, TResult>;
674
+ liveOps?: VoiceLiveOpsRuntimeConfig;
591
675
  route: VoiceNormalizedRouteConfig<TContext, TSession, TResult>;
592
676
  logger?: VoiceLogger;
593
677
  };
@@ -604,16 +688,33 @@ export type VoiceClientCloseMessage = {
604
688
  type: 'close';
605
689
  reason?: string;
606
690
  };
691
+ export type VoiceClientCallControlMessage = {
692
+ type: 'call_control';
693
+ action: 'complete' | 'escalate' | 'no-answer' | 'transfer' | 'voicemail';
694
+ metadata?: Record<string, unknown>;
695
+ reason?: string;
696
+ target?: string;
697
+ };
607
698
  export type VoiceClientPingMessage = {
608
699
  type: 'ping';
609
700
  };
610
- export type VoiceClientMessage = VoiceClientStartMessage | VoiceClientEndTurnMessage | VoiceClientCloseMessage | VoiceClientPingMessage;
701
+ export type VoiceClientMessage = VoiceClientStartMessage | VoiceClientEndTurnMessage | VoiceClientCloseMessage | VoiceClientCallControlMessage | VoiceClientPingMessage;
611
702
  export type VoiceServerSessionMessage = {
612
703
  type: 'session';
613
704
  sessionId: string;
614
705
  status: VoiceSessionStatus;
615
706
  scenarioId?: string;
616
707
  };
708
+ export type VoiceServerReplayMessage<TResult = unknown> = {
709
+ type: 'replay';
710
+ assistantTexts: string[];
711
+ call?: VoiceCallLifecycleState;
712
+ partial: string;
713
+ scenarioId?: string;
714
+ sessionId: string;
715
+ status: VoiceSessionStatus;
716
+ turns: VoiceTurnRecord<TResult>[];
717
+ };
617
718
  export type VoiceServerPartialMessage = {
618
719
  type: 'partial';
619
720
  transcript: Transcript;
@@ -642,6 +743,11 @@ export type VoiceServerCompleteMessage = {
642
743
  type: 'complete';
643
744
  sessionId: string;
644
745
  };
746
+ export type VoiceServerCallLifecycleMessage = {
747
+ type: 'call_lifecycle';
748
+ event: VoiceCallLifecycleEvent;
749
+ sessionId: string;
750
+ };
645
751
  export type VoiceServerErrorMessage = {
646
752
  type: 'error';
647
753
  message: string;
@@ -650,17 +756,23 @@ export type VoiceServerErrorMessage = {
650
756
  export type VoiceServerPongMessage = {
651
757
  type: 'pong';
652
758
  };
653
- export type VoiceServerMessage<TResult = unknown> = VoiceServerSessionMessage | VoiceServerPartialMessage | VoiceServerFinalMessage | VoiceServerTurnMessage<TResult> | VoiceServerAssistantMessage | VoiceServerAudioMessage | VoiceServerCompleteMessage | VoiceServerErrorMessage | VoiceServerPongMessage;
759
+ export type VoiceServerConnectionMessage = {
760
+ type: 'connection';
761
+ reconnect: VoiceReconnectClientState;
762
+ };
763
+ export type VoiceServerMessage<TResult = unknown> = VoiceServerSessionMessage | VoiceServerReplayMessage<TResult> | VoiceServerPartialMessage | VoiceServerFinalMessage | VoiceServerTurnMessage<TResult> | VoiceServerAssistantMessage | VoiceServerAudioMessage | VoiceServerCallLifecycleMessage | VoiceServerCompleteMessage | VoiceServerErrorMessage | VoiceServerPongMessage | VoiceServerConnectionMessage;
654
764
  export type VoiceConnectionOptions = {
655
765
  protocols?: string[];
656
766
  scenarioId?: string;
657
767
  reconnect?: boolean;
768
+ reconnectReportPath?: string;
658
769
  maxReconnectAttempts?: number;
659
770
  pingInterval?: number;
660
771
  sessionId?: string;
661
772
  };
662
773
  export type VoiceCaptureOptions = {
663
774
  channelCount?: 1 | 2;
775
+ onAudio?: (audio: Uint8Array | ArrayBuffer, sendAudio: (audio: Uint8Array | ArrayBuffer) => void) => void;
664
776
  onLevel?: (level: number) => void;
665
777
  sampleRateHz?: number;
666
778
  };
@@ -674,6 +786,46 @@ export type VoiceBargeInOptions = {
674
786
  enabled?: boolean;
675
787
  interruptOnPartial?: boolean;
676
788
  interruptThreshold?: number;
789
+ monitor?: VoiceBargeInMonitor;
790
+ };
791
+ export type VoiceBargeInTriggerReason = 'input-level' | 'manual-audio' | 'manual-interrupt' | 'partial-transcript';
792
+ export type VoiceBargeInMonitorEvent = {
793
+ at: number;
794
+ id: string;
795
+ latencyMs?: number;
796
+ playbackStopLatencyMs?: number;
797
+ reason: VoiceBargeInTriggerReason;
798
+ sessionId?: string | null;
799
+ status: 'requested' | 'stopped' | 'skipped';
800
+ thresholdMs?: number;
801
+ };
802
+ export type VoiceBargeInMonitorSnapshot = {
803
+ averageLatencyMs?: number;
804
+ events: VoiceBargeInMonitorEvent[];
805
+ failed: number;
806
+ lastEvent?: VoiceBargeInMonitorEvent;
807
+ passed: number;
808
+ status: 'empty' | 'fail' | 'pass' | 'warn';
809
+ thresholdMs: number;
810
+ total: number;
811
+ };
812
+ export type VoiceBargeInMonitor = {
813
+ getSnapshot: () => VoiceBargeInMonitorSnapshot;
814
+ recordRequested: (input: {
815
+ reason: VoiceBargeInTriggerReason;
816
+ sessionId?: string | null;
817
+ }) => VoiceBargeInMonitorEvent;
818
+ recordSkipped: (input: {
819
+ reason: VoiceBargeInTriggerReason;
820
+ sessionId?: string | null;
821
+ }) => VoiceBargeInMonitorEvent;
822
+ recordStopped: (input: {
823
+ latencyMs?: number;
824
+ playbackStopLatencyMs?: number;
825
+ reason: VoiceBargeInTriggerReason;
826
+ sessionId?: string | null;
827
+ }) => VoiceBargeInMonitorEvent;
828
+ subscribe: (subscriber: () => void) => () => void;
677
829
  };
678
830
  export type VoiceAudioPlayerOptions = {
679
831
  autoStart?: boolean;
@@ -728,9 +880,11 @@ export type VoiceHTMXOptions<TSession extends VoiceSessionRecord = VoiceSessionR
728
880
  };
729
881
  export type VoiceHTMXConfig<TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = VoiceHTMXRenderer<TSession, TResult> | VoiceHTMXOptions<TSession, TResult>;
730
882
  export type VoiceStreamState<TResult = unknown> = {
883
+ call: VoiceCallLifecycleState | null;
731
884
  sessionId: string | null;
732
885
  scenarioId: string | null;
733
886
  status: VoiceSessionStatus | 'idle';
887
+ reconnect: VoiceReconnectClientState;
734
888
  partial: string;
735
889
  turns: VoiceTurnRecord<TResult>[];
736
890
  assistantTexts: string[];
@@ -744,6 +898,8 @@ export type VoiceStreamState<TResult = unknown> = {
744
898
  isConnected: boolean;
745
899
  };
746
900
  export type VoiceStream<TResult = unknown> = {
901
+ call: VoiceCallLifecycleState | null;
902
+ callControl: (message: Omit<VoiceClientCallControlMessage, 'type'>) => void;
747
903
  close: () => void;
748
904
  start: (input?: {
749
905
  scenarioId?: string;
@@ -755,6 +911,7 @@ export type VoiceStream<TResult = unknown> = {
755
911
  getSnapshot: () => VoiceStreamState<TResult>;
756
912
  isConnected: boolean;
757
913
  partial: string;
914
+ reconnect: VoiceReconnectClientState;
758
915
  sendAudio: (audio: Uint8Array | ArrayBuffer) => void;
759
916
  sessionId: string | null;
760
917
  scenarioId: string | null;
@@ -810,6 +967,8 @@ export type VoiceBargeInBinding = {
810
967
  };
811
968
  export type VoiceController<TResult = unknown> = {
812
969
  bindHTMX: (options: VoiceHTMXBindingOptions) => () => void;
970
+ call: VoiceCallLifecycleState | null;
971
+ callControl: (message: Omit<VoiceClientCallControlMessage, 'type'>) => void;
813
972
  close: () => void;
814
973
  endTurn: () => void;
815
974
  start: (input?: {
@@ -822,6 +981,7 @@ export type VoiceController<TResult = unknown> = {
822
981
  isConnected: boolean;
823
982
  isRecording: boolean;
824
983
  partial: string;
984
+ reconnect: VoiceReconnectClientState;
825
985
  recordingError: string | null;
826
986
  sendAudio: (audio: Uint8Array | ArrayBuffer) => void;
827
987
  sessionId: string | null;
@@ -855,6 +1015,19 @@ export type VoiceStoreAction<TResult = unknown> = {
855
1015
  sessionId: string;
856
1016
  scenarioId?: string;
857
1017
  status: VoiceSessionStatus;
1018
+ } | {
1019
+ type: 'replay';
1020
+ assistantTexts: string[];
1021
+ call?: VoiceCallLifecycleState;
1022
+ partial: string;
1023
+ scenarioId?: string;
1024
+ sessionId: string;
1025
+ status: VoiceSessionStatus;
1026
+ turns: VoiceTurnRecord<TResult>[];
1027
+ } | {
1028
+ type: 'call_lifecycle';
1029
+ event: VoiceCallLifecycleEvent;
1030
+ sessionId: string;
858
1031
  } | {
859
1032
  type: 'partial';
860
1033
  transcript: Transcript;
@@ -881,6 +1054,9 @@ export type VoiceStoreAction<TResult = unknown> = {
881
1054
  message: string;
882
1055
  } | {
883
1056
  type: 'connected';
1057
+ } | {
1058
+ type: 'connection';
1059
+ reconnect: VoiceReconnectClientState;
884
1060
  } | {
885
1061
  type: 'disconnected';
886
1062
  };
@@ -0,0 +1,30 @@
1
+ export declare const VoiceDeliveryRuntime: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
2
+ description: StringConstructor;
3
+ includeActions: {
4
+ default: boolean;
5
+ type: BooleanConstructor;
6
+ };
7
+ intervalMs: NumberConstructor;
8
+ path: {
9
+ default: string;
10
+ type: StringConstructor;
11
+ };
12
+ title: StringConstructor;
13
+ }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
14
+ [key: string]: any;
15
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
16
+ description: StringConstructor;
17
+ includeActions: {
18
+ default: boolean;
19
+ type: BooleanConstructor;
20
+ };
21
+ intervalMs: NumberConstructor;
22
+ path: {
23
+ default: string;
24
+ type: StringConstructor;
25
+ };
26
+ title: StringConstructor;
27
+ }>> & Readonly<{}>, {
28
+ path: string;
29
+ includeActions: boolean;
30
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -0,0 +1,13 @@
1
+ import { type PropType } from 'vue';
2
+ import type { VoiceOpsActionDescriptor } from '../client/opsActionCenter';
3
+ export declare const VoiceOpsActionCenter: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
4
+ actions: PropType<VoiceOpsActionDescriptor[]>;
5
+ description: StringConstructor;
6
+ title: StringConstructor;
7
+ }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
8
+ [key: string]: any;
9
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
10
+ actions: PropType<VoiceOpsActionDescriptor[]>;
11
+ description: StringConstructor;
12
+ title: StringConstructor;
13
+ }>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -0,0 +1,30 @@
1
+ export declare const VoiceOpsStatus: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
2
+ description: StringConstructor;
3
+ includeLinks: {
4
+ default: boolean;
5
+ type: BooleanConstructor;
6
+ };
7
+ intervalMs: NumberConstructor;
8
+ path: {
9
+ default: string;
10
+ type: StringConstructor;
11
+ };
12
+ title: StringConstructor;
13
+ }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
14
+ [key: string]: any;
15
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
16
+ description: StringConstructor;
17
+ includeLinks: {
18
+ default: boolean;
19
+ type: BooleanConstructor;
20
+ };
21
+ intervalMs: NumberConstructor;
22
+ path: {
23
+ default: string;
24
+ type: StringConstructor;
25
+ };
26
+ title: StringConstructor;
27
+ }>> & Readonly<{}>, {
28
+ path: string;
29
+ includeLinks: boolean;
30
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -0,0 +1,23 @@
1
+ export declare const VoicePlatformCoverage: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
2
+ description: StringConstructor;
3
+ intervalMs: NumberConstructor;
4
+ limit: NumberConstructor;
5
+ path: {
6
+ default: string;
7
+ type: StringConstructor;
8
+ };
9
+ title: StringConstructor;
10
+ }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
11
+ [key: string]: any;
12
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
13
+ description: StringConstructor;
14
+ intervalMs: NumberConstructor;
15
+ limit: NumberConstructor;
16
+ path: {
17
+ default: string;
18
+ type: StringConstructor;
19
+ };
20
+ title: StringConstructor;
21
+ }>> & Readonly<{}>, {
22
+ path: string;
23
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -0,0 +1,21 @@
1
+ export declare const VoiceProofTrends: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
2
+ description: StringConstructor;
3
+ intervalMs: NumberConstructor;
4
+ path: {
5
+ default: string;
6
+ type: StringConstructor;
7
+ };
8
+ title: StringConstructor;
9
+ }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
10
+ [key: string]: any;
11
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
12
+ description: StringConstructor;
13
+ intervalMs: NumberConstructor;
14
+ path: {
15
+ default: string;
16
+ type: StringConstructor;
17
+ };
18
+ title: StringConstructor;
19
+ }>> & Readonly<{}>, {
20
+ path: string;
21
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -0,0 +1,51 @@
1
+ export declare const VoiceProviderCapabilities: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
2
+ class: {
3
+ default: string;
4
+ type: StringConstructor;
5
+ };
6
+ description: {
7
+ default: undefined;
8
+ type: StringConstructor;
9
+ };
10
+ intervalMs: {
11
+ default: number;
12
+ type: NumberConstructor;
13
+ };
14
+ path: {
15
+ default: string;
16
+ type: StringConstructor;
17
+ };
18
+ title: {
19
+ default: undefined;
20
+ type: StringConstructor;
21
+ };
22
+ }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
23
+ [key: string]: any;
24
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
25
+ class: {
26
+ default: string;
27
+ type: StringConstructor;
28
+ };
29
+ description: {
30
+ default: undefined;
31
+ type: StringConstructor;
32
+ };
33
+ intervalMs: {
34
+ default: number;
35
+ type: NumberConstructor;
36
+ };
37
+ path: {
38
+ default: string;
39
+ type: StringConstructor;
40
+ };
41
+ title: {
42
+ default: undefined;
43
+ type: StringConstructor;
44
+ };
45
+ }>> & Readonly<{}>, {
46
+ description: string;
47
+ title: string;
48
+ path: string;
49
+ intervalMs: number;
50
+ class: string;
51
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -0,0 +1,21 @@
1
+ export declare const VoiceProviderContracts: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
2
+ description: StringConstructor;
3
+ intervalMs: NumberConstructor;
4
+ path: {
5
+ default: string;
6
+ type: StringConstructor;
7
+ };
8
+ title: StringConstructor;
9
+ }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
10
+ [key: string]: any;
11
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
12
+ description: StringConstructor;
13
+ intervalMs: NumberConstructor;
14
+ path: {
15
+ default: string;
16
+ type: StringConstructor;
17
+ };
18
+ title: StringConstructor;
19
+ }>> & Readonly<{}>, {
20
+ path: string;
21
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -0,0 +1,88 @@
1
+ import { type PropType } from 'vue';
2
+ import type { VoiceProviderSimulationProvider } from '../client/providerSimulationControls';
3
+ export declare const VoiceProviderSimulationControls: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
4
+ class: {
5
+ default: string;
6
+ type: StringConstructor;
7
+ };
8
+ fallbackRequiredMessage: {
9
+ default: undefined;
10
+ type: StringConstructor;
11
+ };
12
+ fallbackRequiredProvider: {
13
+ default: undefined;
14
+ type: StringConstructor;
15
+ };
16
+ failureMessage: {
17
+ default: undefined;
18
+ type: StringConstructor;
19
+ };
20
+ failureProviders: {
21
+ default: undefined;
22
+ type: PropType<readonly string[] | undefined>;
23
+ };
24
+ kind: {
25
+ default: string;
26
+ type: StringConstructor;
27
+ };
28
+ pathPrefix: {
29
+ default: undefined;
30
+ type: StringConstructor;
31
+ };
32
+ providers: {
33
+ required: true;
34
+ type: PropType<readonly VoiceProviderSimulationProvider[]>;
35
+ };
36
+ title: {
37
+ default: undefined;
38
+ type: StringConstructor;
39
+ };
40
+ }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
41
+ [key: string]: any;
42
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
43
+ class: {
44
+ default: string;
45
+ type: StringConstructor;
46
+ };
47
+ fallbackRequiredMessage: {
48
+ default: undefined;
49
+ type: StringConstructor;
50
+ };
51
+ fallbackRequiredProvider: {
52
+ default: undefined;
53
+ type: StringConstructor;
54
+ };
55
+ failureMessage: {
56
+ default: undefined;
57
+ type: StringConstructor;
58
+ };
59
+ failureProviders: {
60
+ default: undefined;
61
+ type: PropType<readonly string[] | undefined>;
62
+ };
63
+ kind: {
64
+ default: string;
65
+ type: StringConstructor;
66
+ };
67
+ pathPrefix: {
68
+ default: undefined;
69
+ type: StringConstructor;
70
+ };
71
+ providers: {
72
+ required: true;
73
+ type: PropType<readonly VoiceProviderSimulationProvider[]>;
74
+ };
75
+ title: {
76
+ default: undefined;
77
+ type: StringConstructor;
78
+ };
79
+ }>> & Readonly<{}>, {
80
+ kind: string;
81
+ title: string;
82
+ fallbackRequiredProvider: string;
83
+ fallbackRequiredMessage: string;
84
+ failureProviders: readonly string[] | undefined;
85
+ failureMessage: string;
86
+ pathPrefix: string;
87
+ class: string;
88
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -0,0 +1,51 @@
1
+ export declare const VoiceProviderStatus: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
2
+ class: {
3
+ default: string;
4
+ type: StringConstructor;
5
+ };
6
+ description: {
7
+ default: undefined;
8
+ type: StringConstructor;
9
+ };
10
+ intervalMs: {
11
+ default: number;
12
+ type: NumberConstructor;
13
+ };
14
+ path: {
15
+ default: string;
16
+ type: StringConstructor;
17
+ };
18
+ title: {
19
+ default: undefined;
20
+ type: StringConstructor;
21
+ };
22
+ }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
23
+ [key: string]: any;
24
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
25
+ class: {
26
+ default: string;
27
+ type: StringConstructor;
28
+ };
29
+ description: {
30
+ default: undefined;
31
+ type: StringConstructor;
32
+ };
33
+ intervalMs: {
34
+ default: number;
35
+ type: NumberConstructor;
36
+ };
37
+ path: {
38
+ default: string;
39
+ type: StringConstructor;
40
+ };
41
+ title: {
42
+ default: undefined;
43
+ type: StringConstructor;
44
+ };
45
+ }>> & Readonly<{}>, {
46
+ description: string;
47
+ title: string;
48
+ path: string;
49
+ intervalMs: number;
50
+ class: string;
51
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;