@absolutejs/voice 0.0.22-beta.17 → 0.0.22-beta.170

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 (189) hide show
  1. package/README.md +1057 -5
  2. package/dist/agent.d.ts +24 -0
  3. package/dist/agentSquadContract.d.ts +64 -0
  4. package/dist/angular/index.d.ts +12 -0
  5. package/dist/angular/index.js +3196 -1111
  6. package/dist/angular/voice-campaign-dialer-proof.service.d.ts +14 -0
  7. package/dist/angular/voice-controller.service.d.ts +1 -0
  8. package/dist/angular/voice-delivery-runtime.component.d.ts +17 -0
  9. package/dist/angular/voice-delivery-runtime.service.d.ts +16 -0
  10. package/dist/angular/voice-ops-action-center.service.d.ts +13 -0
  11. package/dist/angular/voice-ops-status.component.d.ts +15 -0
  12. package/dist/angular/voice-ops-status.service.d.ts +12 -0
  13. package/dist/angular/voice-provider-capabilities.service.d.ts +12 -0
  14. package/dist/angular/voice-provider-contracts.service.d.ts +12 -0
  15. package/dist/angular/voice-routing-status.service.d.ts +11 -0
  16. package/dist/angular/voice-stream.service.d.ts +3 -0
  17. package/dist/angular/voice-trace-timeline.service.d.ts +12 -0
  18. package/dist/angular/voice-turn-latency.service.d.ts +13 -0
  19. package/dist/angular/voice-turn-quality.service.d.ts +12 -0
  20. package/dist/angular/voice-workflow-status.service.d.ts +12 -0
  21. package/dist/assistantHealth.d.ts +81 -0
  22. package/dist/audit.d.ts +128 -0
  23. package/dist/auditDeliveryRoutes.d.ts +85 -0
  24. package/dist/auditExport.d.ts +34 -0
  25. package/dist/auditRoutes.d.ts +66 -0
  26. package/dist/auditSinks.d.ts +151 -0
  27. package/dist/bargeInRoutes.d.ts +56 -0
  28. package/dist/campaign.d.ts +610 -0
  29. package/dist/campaignDialers.d.ts +90 -0
  30. package/dist/client/actions.d.ts +105 -0
  31. package/dist/client/bargeInMonitor.d.ts +7 -0
  32. package/dist/client/campaignDialerProof.d.ts +23 -0
  33. package/dist/client/connection.d.ts +3 -0
  34. package/dist/client/deliveryRuntime.d.ts +34 -0
  35. package/dist/client/deliveryRuntimeWidget.d.ts +37 -0
  36. package/dist/client/duplex.d.ts +1 -1
  37. package/dist/client/htmxBootstrap.js +747 -15
  38. package/dist/client/index.d.ts +54 -0
  39. package/dist/client/index.js +2944 -20
  40. package/dist/client/liveTurnLatency.d.ts +41 -0
  41. package/dist/client/opsActionCenter.d.ts +54 -0
  42. package/dist/client/opsActionCenterWidget.d.ts +29 -0
  43. package/dist/client/opsActionHistory.d.ts +19 -0
  44. package/dist/client/opsActionHistoryWidget.d.ts +11 -0
  45. package/dist/client/opsStatus.d.ts +19 -0
  46. package/dist/client/opsStatusWidget.d.ts +40 -0
  47. package/dist/client/providerCapabilities.d.ts +19 -0
  48. package/dist/client/providerCapabilitiesWidget.d.ts +32 -0
  49. package/dist/client/providerContracts.d.ts +19 -0
  50. package/dist/client/providerContractsWidget.d.ts +37 -0
  51. package/dist/client/providerSimulationControls.d.ts +33 -0
  52. package/dist/client/providerSimulationControlsWidget.d.ts +20 -0
  53. package/dist/client/providerStatusWidget.d.ts +32 -0
  54. package/dist/client/routingStatus.d.ts +19 -0
  55. package/dist/client/routingStatusWidget.d.ts +28 -0
  56. package/dist/client/traceTimeline.d.ts +19 -0
  57. package/dist/client/traceTimelineWidget.d.ts +32 -0
  58. package/dist/client/turnLatency.d.ts +22 -0
  59. package/dist/client/turnLatencyWidget.d.ts +33 -0
  60. package/dist/client/turnQuality.d.ts +19 -0
  61. package/dist/client/turnQualityWidget.d.ts +32 -0
  62. package/dist/client/workflowStatus.d.ts +19 -0
  63. package/dist/dataControl.d.ts +47 -0
  64. package/dist/deliveryRuntime.d.ts +158 -0
  65. package/dist/deliverySinkRoutes.d.ts +117 -0
  66. package/dist/demoReadyRoutes.d.ts +98 -0
  67. package/dist/diagnosticsRoutes.d.ts +44 -0
  68. package/dist/evalRoutes.d.ts +213 -0
  69. package/dist/fileStore.d.ts +11 -2
  70. package/dist/handoff.d.ts +54 -0
  71. package/dist/handoffHealth.d.ts +94 -0
  72. package/dist/index.d.ts +114 -11
  73. package/dist/index.js +18454 -4316
  74. package/dist/liveLatency.d.ts +78 -0
  75. package/dist/modelAdapters.d.ts +23 -2
  76. package/dist/openaiRealtime.d.ts +27 -0
  77. package/dist/openaiTTS.d.ts +18 -0
  78. package/dist/opsActionAuditRoutes.d.ts +99 -0
  79. package/dist/opsConsoleRoutes.d.ts +80 -0
  80. package/dist/opsStatus.d.ts +76 -0
  81. package/dist/opsStatusRoutes.d.ts +33 -0
  82. package/dist/opsWebhook.d.ts +126 -0
  83. package/dist/outcomeContract.d.ts +112 -0
  84. package/dist/phoneAgent.d.ts +62 -0
  85. package/dist/phoneAgentProductionSmoke.d.ts +115 -0
  86. package/dist/postgresStore.d.ts +13 -2
  87. package/dist/productionReadiness.d.ts +368 -0
  88. package/dist/providerAdapters.d.ts +48 -0
  89. package/dist/providerCapabilities.d.ts +92 -0
  90. package/dist/providerHealth.d.ts +1 -0
  91. package/dist/providerRoutingContract.d.ts +38 -0
  92. package/dist/providerStackRecommendations.d.ts +145 -0
  93. package/dist/qualityRoutes.d.ts +76 -0
  94. package/dist/queue.d.ts +61 -0
  95. package/dist/react/VoiceDeliveryRuntime.d.ts +7 -0
  96. package/dist/react/VoiceOpsActionCenter.d.ts +5 -0
  97. package/dist/react/VoiceOpsStatus.d.ts +6 -0
  98. package/dist/react/VoiceProviderCapabilities.d.ts +6 -0
  99. package/dist/react/VoiceProviderContracts.d.ts +6 -0
  100. package/dist/react/VoiceProviderSimulationControls.d.ts +5 -0
  101. package/dist/react/VoiceProviderStatus.d.ts +6 -0
  102. package/dist/react/VoiceRoutingStatus.d.ts +6 -0
  103. package/dist/react/VoiceTraceTimeline.d.ts +6 -0
  104. package/dist/react/VoiceTurnLatency.d.ts +6 -0
  105. package/dist/react/VoiceTurnQuality.d.ts +6 -0
  106. package/dist/react/index.d.ts +23 -0
  107. package/dist/react/index.js +3695 -33
  108. package/dist/react/useVoiceCampaignDialerProof.d.ts +10 -0
  109. package/dist/react/useVoiceController.d.ts +3 -0
  110. package/dist/react/useVoiceDeliveryRuntime.d.ts +13 -0
  111. package/dist/react/useVoiceOpsActionCenter.d.ts +11 -0
  112. package/dist/react/useVoiceOpsStatus.d.ts +8 -0
  113. package/dist/react/useVoiceProviderCapabilities.d.ts +8 -0
  114. package/dist/react/useVoiceProviderContracts.d.ts +8 -0
  115. package/dist/react/useVoiceProviderSimulationControls.d.ts +10 -0
  116. package/dist/react/useVoiceRoutingStatus.d.ts +8 -0
  117. package/dist/react/useVoiceStream.d.ts +3 -0
  118. package/dist/react/useVoiceTraceTimeline.d.ts +8 -0
  119. package/dist/react/useVoiceTurnLatency.d.ts +9 -0
  120. package/dist/react/useVoiceTurnQuality.d.ts +8 -0
  121. package/dist/react/useVoiceWorkflowStatus.d.ts +8 -0
  122. package/dist/readinessProfiles.d.ts +35 -0
  123. package/dist/reconnectContract.d.ts +87 -0
  124. package/dist/resilienceRoutes.d.ts +142 -0
  125. package/dist/sessionReplay.d.ts +185 -0
  126. package/dist/simulationSuite.d.ts +120 -0
  127. package/dist/sqliteStore.d.ts +13 -2
  128. package/dist/svelte/createVoiceCampaignDialerProof.d.ts +9 -0
  129. package/dist/svelte/createVoiceDeliveryRuntime.d.ts +11 -0
  130. package/dist/svelte/createVoiceOpsActionCenter.d.ts +10 -0
  131. package/dist/svelte/createVoiceOpsStatus.d.ts +9 -0
  132. package/dist/svelte/createVoiceProviderCapabilities.d.ts +10 -0
  133. package/dist/svelte/createVoiceProviderContracts.d.ts +10 -0
  134. package/dist/svelte/createVoiceProviderSimulationControls.d.ts +11 -0
  135. package/dist/svelte/createVoiceProviderStatus.d.ts +4 -2
  136. package/dist/svelte/createVoiceRoutingStatus.d.ts +10 -0
  137. package/dist/svelte/createVoiceTraceTimeline.d.ts +10 -0
  138. package/dist/svelte/createVoiceTurnLatency.d.ts +11 -0
  139. package/dist/svelte/createVoiceTurnQuality.d.ts +10 -0
  140. package/dist/svelte/createVoiceWorkflowStatus.d.ts +8 -0
  141. package/dist/svelte/index.d.ts +12 -0
  142. package/dist/svelte/index.js +3095 -439
  143. package/dist/telephony/contract.d.ts +61 -0
  144. package/dist/telephony/matrix.d.ts +97 -0
  145. package/dist/telephony/plivo.d.ts +254 -0
  146. package/dist/telephony/telnyx.d.ts +247 -0
  147. package/dist/telephony/twilio.d.ts +135 -2
  148. package/dist/telephonyOutcome.d.ts +201 -0
  149. package/dist/testing/index.d.ts +1 -0
  150. package/dist/testing/index.js +2008 -69
  151. package/dist/testing/ioProviderSimulator.d.ts +41 -0
  152. package/dist/testing/providerSimulator.d.ts +8 -0
  153. package/dist/toolContract.d.ts +130 -0
  154. package/dist/toolRuntime.d.ts +50 -0
  155. package/dist/trace.d.ts +19 -1
  156. package/dist/traceDeliveryRoutes.d.ts +86 -0
  157. package/dist/traceTimeline.d.ts +93 -0
  158. package/dist/turnLatency.d.ts +95 -0
  159. package/dist/turnQuality.d.ts +94 -0
  160. package/dist/types.d.ts +170 -4
  161. package/dist/vue/VoiceDeliveryRuntime.d.ts +30 -0
  162. package/dist/vue/VoiceOpsActionCenter.d.ts +13 -0
  163. package/dist/vue/VoiceOpsStatus.d.ts +30 -0
  164. package/dist/vue/VoiceProviderCapabilities.d.ts +51 -0
  165. package/dist/vue/VoiceProviderContracts.d.ts +21 -0
  166. package/dist/vue/VoiceProviderSimulationControls.d.ts +88 -0
  167. package/dist/vue/VoiceProviderStatus.d.ts +51 -0
  168. package/dist/vue/VoiceRoutingStatus.d.ts +51 -0
  169. package/dist/vue/VoiceTurnLatency.d.ts +69 -0
  170. package/dist/vue/VoiceTurnQuality.d.ts +51 -0
  171. package/dist/vue/index.d.ts +22 -0
  172. package/dist/vue/index.js +3617 -53
  173. package/dist/vue/useVoiceCampaignDialerProof.d.ts +11 -0
  174. package/dist/vue/useVoiceController.d.ts +2 -1
  175. package/dist/vue/useVoiceDeliveryRuntime.d.ts +13 -0
  176. package/dist/vue/useVoiceOpsActionCenter.d.ts +11 -0
  177. package/dist/vue/useVoiceOpsStatus.d.ts +9 -0
  178. package/dist/vue/useVoiceProviderCapabilities.d.ts +9 -0
  179. package/dist/vue/useVoiceProviderContracts.d.ts +9 -0
  180. package/dist/vue/useVoiceProviderSimulationControls.d.ts +24 -0
  181. package/dist/vue/useVoiceProviderStatus.d.ts +1 -1
  182. package/dist/vue/useVoiceRoutingStatus.d.ts +8 -0
  183. package/dist/vue/useVoiceStream.d.ts +4 -1
  184. package/dist/vue/useVoiceTraceTimeline.d.ts +9 -0
  185. package/dist/vue/useVoiceTurnLatency.d.ts +10 -0
  186. package/dist/vue/useVoiceTurnQuality.d.ts +9 -0
  187. package/dist/vue/useVoiceWorkflowStatus.d.ts +9 -0
  188. package/dist/workflowContract.d.ts +91 -0
  189. package/package.json +1 -1
@@ -0,0 +1,78 @@
1
+ import { Elysia } from 'elysia';
2
+ import type { VoiceTraceEventStore } from './trace';
3
+ export type VoiceLiveLatencyStatus = 'empty' | 'fail' | 'pass' | 'warn';
4
+ export type VoiceLiveLatencySample = {
5
+ at: number;
6
+ latencyMs: number;
7
+ sessionId: string;
8
+ status?: string;
9
+ traceId?: string;
10
+ };
11
+ export type VoiceLiveLatencyReport = {
12
+ averageLatencyMs?: number;
13
+ checkedAt: number;
14
+ failed: number;
15
+ p50LatencyMs?: number;
16
+ p95LatencyMs?: number;
17
+ recent: VoiceLiveLatencySample[];
18
+ status: VoiceLiveLatencyStatus;
19
+ total: number;
20
+ warnings: number;
21
+ };
22
+ export type VoiceLiveLatencyOptions = {
23
+ failAfterMs?: number;
24
+ limit?: number;
25
+ store: VoiceTraceEventStore;
26
+ warnAfterMs?: number;
27
+ };
28
+ export type VoiceLiveLatencyRoutesOptions = VoiceLiveLatencyOptions & {
29
+ headers?: HeadersInit;
30
+ htmlPath?: false | string;
31
+ name?: string;
32
+ path?: string;
33
+ title?: string;
34
+ };
35
+ export declare const summarizeVoiceLiveLatency: (options: VoiceLiveLatencyOptions) => Promise<VoiceLiveLatencyReport>;
36
+ export declare const renderVoiceLiveLatencyHTML: (report: VoiceLiveLatencyReport, options?: {
37
+ title?: string;
38
+ }) => string;
39
+ export declare const createVoiceLiveLatencyRoutes: (options: VoiceLiveLatencyRoutesOptions) => Elysia<"", {
40
+ decorator: {};
41
+ store: {};
42
+ derive: {};
43
+ resolve: {};
44
+ }, {
45
+ typebox: {};
46
+ error: {};
47
+ }, {
48
+ schema: {};
49
+ standaloneSchema: {};
50
+ macro: {};
51
+ macroFn: {};
52
+ parser: {};
53
+ response: {};
54
+ }, {
55
+ [x: string]: {
56
+ get: {
57
+ body: unknown;
58
+ params: {};
59
+ query: unknown;
60
+ headers: unknown;
61
+ response: {
62
+ 200: VoiceLiveLatencyReport;
63
+ };
64
+ };
65
+ };
66
+ }, {
67
+ derive: {};
68
+ resolve: {};
69
+ schema: {};
70
+ standaloneSchema: {};
71
+ response: {};
72
+ }, {
73
+ derive: {};
74
+ resolve: {};
75
+ schema: {};
76
+ standaloneSchema: {};
77
+ response: {};
78
+ }>;
@@ -36,9 +36,11 @@ export type GeminiVoiceAssistantModelOptions = {
36
36
  };
37
37
  export type VoiceProviderRouterEvent<TProvider extends string = string> = {
38
38
  at: number;
39
+ attempt: number;
39
40
  elapsedMs: number;
40
41
  error?: string;
41
42
  fallbackProvider?: TProvider;
43
+ latencyBudgetMs?: number;
42
44
  provider: TProvider;
43
45
  providerHealth?: VoiceProviderRouterProviderHealth<TProvider>;
44
46
  rateLimited?: boolean;
@@ -47,18 +49,35 @@ export type VoiceProviderRouterEvent<TProvider extends string = string> = {
47
49
  suppressionRemainingMs?: number;
48
50
  suppressedUntil?: number;
49
51
  status: 'error' | 'fallback' | 'success';
52
+ timedOut?: boolean;
50
53
  };
51
54
  export type VoiceProviderRouterFallbackMode = 'never' | 'provider-error' | 'rate-limit';
52
- export type VoiceProviderRouterPolicy<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TProvider extends string = string> = 'ordered' | 'prefer-cheapest' | 'prefer-fastest' | 'prefer-selected' | {
55
+ export type VoiceProviderRouterStrategy = 'balanced' | 'ordered' | 'prefer-cheapest' | 'prefer-fastest' | 'prefer-selected' | 'quality-first';
56
+ export type VoiceProviderRouterPolicyPreset = 'balanced' | 'cost-cap' | 'cost-first' | 'latency-first' | 'quality-first';
57
+ export type VoiceProviderRouterPolicyWeights = {
58
+ cost?: number;
59
+ latencyMs?: number;
60
+ priority?: number;
61
+ quality?: number;
62
+ };
63
+ export type VoiceProviderRouterPolicy<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TProvider extends string = string> = VoiceProviderRouterStrategy | VoiceProviderRouterPolicyPreset | {
53
64
  allowProviders?: readonly TProvider[] | ((input: VoiceAgentModelInput<TContext, TSession>) => readonly TProvider[] | Promise<readonly TProvider[]>);
54
65
  fallbackMode?: VoiceProviderRouterFallbackMode;
55
- strategy?: 'ordered' | 'prefer-cheapest' | 'prefer-fastest' | 'prefer-selected';
66
+ maxCost?: number;
67
+ maxLatencyMs?: number;
68
+ minQuality?: number;
69
+ scoreProvider?: (provider: TProvider, profile: VoiceProviderRouterProviderProfile | undefined) => number;
70
+ strategy?: VoiceProviderRouterStrategy;
71
+ weights?: VoiceProviderRouterPolicyWeights;
56
72
  };
57
73
  export type VoiceProviderRouterProviderProfile = {
58
74
  cost?: number;
59
75
  latencyMs?: number;
60
76
  priority?: number;
77
+ quality?: number;
78
+ timeoutMs?: number;
61
79
  };
80
+ export declare const resolveVoiceProviderRoutingPolicyPreset: <TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TProvider extends string = string>(preset: VoiceProviderRouterPolicyPreset, options?: Omit<Extract<VoiceProviderRouterPolicy<TContext, TSession, TProvider>, Record<string, unknown>>, "strategy">) => Extract<VoiceProviderRouterPolicy<TContext, TSession, TProvider>, Record<string, unknown>>;
62
81
  export type VoiceProviderRouterHealthOptions = {
63
82
  cooldownMs?: number;
64
83
  failureThreshold?: number;
@@ -79,10 +98,12 @@ export type VoiceProviderRouterOptions<TContext = unknown, TSession extends Voic
79
98
  fallbackMode?: VoiceProviderRouterFallbackMode;
80
99
  isProviderError?: (error: unknown, provider: TProvider) => boolean;
81
100
  isRateLimitError?: (error: unknown, provider: TProvider) => boolean;
101
+ isTimeoutError?: (error: unknown, provider: TProvider) => boolean;
82
102
  onProviderEvent?: (event: VoiceProviderRouterEvent<TProvider>, input: VoiceAgentModelInput<TContext, TSession>) => Promise<void> | void;
83
103
  policy?: VoiceProviderRouterPolicy<TContext, TSession, TProvider>;
84
104
  providerHealth?: boolean | VoiceProviderRouterHealthOptions;
85
105
  providerProfiles?: Partial<Record<TProvider, VoiceProviderRouterProviderProfile>>;
106
+ timeoutMs?: number;
86
107
  providers: Partial<Record<TProvider, VoiceAgentModel<TContext, TSession, TResult>>>;
87
108
  selectProvider?: (input: VoiceAgentModelInput<TContext, TSession>) => TProvider | undefined | Promise<TProvider | undefined>;
88
109
  };
@@ -0,0 +1,27 @@
1
+ import type { RealtimeAdapter } from './types';
2
+ export type OpenAIRealtimeModel = 'gpt-realtime' | 'gpt-realtime-mini' | 'gpt-4o-realtime-preview' | 'gpt-4o-mini-realtime-preview' | (string & {});
3
+ export type OpenAIRealtimeVoice = 'alloy' | 'ash' | 'ballad' | 'cedar' | 'coral' | 'echo' | 'marin' | 'sage' | 'shimmer' | 'verse' | {
4
+ id: string;
5
+ } | (string & {});
6
+ export type OpenAIRealtimeTranscriptionModel = 'gpt-4o-mini-transcribe' | 'gpt-4o-transcribe' | 'whisper-1' | (string & {});
7
+ export type OpenAIRealtimeNoiseReduction = 'near_field' | 'far_field';
8
+ export type OpenAIRealtimeResponseMode = 'audio' | 'text';
9
+ export type OpenAIRealtimeAdapterOptions = {
10
+ apiKey: string;
11
+ autoCommitSilenceMs?: number;
12
+ baseUrl?: string;
13
+ emitResponseTranscripts?: boolean;
14
+ inputTranscriptionLanguage?: string;
15
+ inputTranscriptionModel?: OpenAIRealtimeTranscriptionModel | null;
16
+ inputTranscriptionPrompt?: string;
17
+ instructions?: string;
18
+ maxOutputTokens?: number | 'inf';
19
+ model?: OpenAIRealtimeModel;
20
+ noiseReduction?: OpenAIRealtimeNoiseReduction;
21
+ responseMode?: OpenAIRealtimeResponseMode;
22
+ speed?: number;
23
+ temperature?: number;
24
+ voice?: OpenAIRealtimeVoice;
25
+ webSocket?: typeof WebSocket;
26
+ };
27
+ export declare const createOpenAIRealtimeAdapter: (options: OpenAIRealtimeAdapterOptions) => RealtimeAdapter;
@@ -0,0 +1,18 @@
1
+ import type { TTSAdapter, TTSAdapterOpenOptions, VoiceLexiconEntry } from './types';
2
+ export type OpenAIVoiceTTSVoice = 'alloy' | 'ash' | 'ballad' | 'cedar' | 'coral' | 'echo' | 'fable' | 'marin' | 'nova' | 'onyx' | 'sage' | 'shimmer' | 'verse' | (string & {});
3
+ export type OpenAIVoiceTTSOptions = {
4
+ apiKey: string;
5
+ baseUrl?: string;
6
+ fetch?: typeof fetch;
7
+ instructions?: string | ((input: {
8
+ lexicon?: VoiceLexiconEntry[];
9
+ sessionId: string;
10
+ text: string;
11
+ }) => Promise<string | undefined> | string | undefined);
12
+ model?: 'gpt-4o-mini-tts' | 'tts-1' | 'tts-1-hd' | (string & {});
13
+ speed?: number;
14
+ voice?: OpenAIVoiceTTSVoice | {
15
+ id: string;
16
+ };
17
+ };
18
+ export declare const createOpenAIVoiceTTS: (options: OpenAIVoiceTTSOptions) => TTSAdapter<TTSAdapterOpenOptions>;
@@ -0,0 +1,99 @@
1
+ import { Elysia } from 'elysia';
2
+ import { type StoredVoiceAuditEvent, type VoiceAuditEventStore } from './audit';
3
+ import { type VoiceTraceEventStore } from './trace';
4
+ export type VoiceOpsActionAuditRecord = {
5
+ actionId: string;
6
+ body?: unknown;
7
+ error?: string;
8
+ ok: boolean;
9
+ ranAt: number;
10
+ status: number;
11
+ };
12
+ export type VoiceOpsActionAuditRoutesOptions = {
13
+ audit?: VoiceAuditEventStore;
14
+ historyHtmlPath?: false | string;
15
+ historyPath?: false | string;
16
+ name?: string;
17
+ path?: string;
18
+ trace?: VoiceTraceEventStore;
19
+ };
20
+ export type VoiceOpsActionHistoryEntry = {
21
+ actionId: string;
22
+ at: number;
23
+ error?: string;
24
+ eventId: string;
25
+ ok: boolean;
26
+ status?: number;
27
+ traceId?: string;
28
+ };
29
+ export type VoiceOpsActionHistoryReport = {
30
+ checkedAt: number;
31
+ entries: VoiceOpsActionHistoryEntry[];
32
+ failed: number;
33
+ passed: number;
34
+ total: number;
35
+ };
36
+ export declare const recordVoiceOpsActionAudit: (record: VoiceOpsActionAuditRecord, options: Pick<VoiceOpsActionAuditRoutesOptions, "audit" | "trace">) => Promise<{
37
+ audit: StoredVoiceAuditEvent<Record<string, unknown>> | (Omit<import("./audit").VoiceAuditEvent<Record<string, unknown>>, "at" | "id"> & {
38
+ at: number;
39
+ id: string;
40
+ }) | undefined;
41
+ ok: boolean;
42
+ trace: (import("./trace").VoiceTraceEvent<Record<string, unknown>> & {
43
+ id: string;
44
+ }) | undefined;
45
+ }>;
46
+ export declare const createVoiceOpsActionAuditRoutes: (options: VoiceOpsActionAuditRoutesOptions) => Elysia<"", {
47
+ decorator: {};
48
+ store: {};
49
+ derive: {};
50
+ resolve: {};
51
+ }, {
52
+ typebox: {};
53
+ error: {};
54
+ }, {
55
+ schema: {};
56
+ standaloneSchema: {};
57
+ macro: {};
58
+ macroFn: {};
59
+ parser: {};
60
+ response: {};
61
+ }, {
62
+ [x: string]: {
63
+ post: {
64
+ body: unknown;
65
+ params: {};
66
+ query: unknown;
67
+ headers: unknown;
68
+ response: {
69
+ 200: {
70
+ audit: StoredVoiceAuditEvent<Record<string, unknown>> | (Omit<import("./audit").VoiceAuditEvent<Record<string, unknown>>, "at" | "id"> & {
71
+ at: number;
72
+ id: string;
73
+ }) | undefined;
74
+ ok: boolean;
75
+ trace: (import("./trace").VoiceTraceEvent<Record<string, unknown>> & {
76
+ id: string;
77
+ }) | undefined;
78
+ } | {
79
+ error: string;
80
+ ok: boolean;
81
+ };
82
+ };
83
+ };
84
+ };
85
+ }, {
86
+ derive: {};
87
+ resolve: {};
88
+ schema: {};
89
+ standaloneSchema: {};
90
+ response: {};
91
+ }, {
92
+ derive: {};
93
+ resolve: {};
94
+ schema: {};
95
+ standaloneSchema: {};
96
+ response: {};
97
+ }>;
98
+ export declare const buildVoiceOpsActionHistoryReport: (options: Pick<VoiceOpsActionAuditRoutesOptions, "audit">) => Promise<VoiceOpsActionHistoryReport>;
99
+ export declare const renderVoiceOpsActionHistoryHTML: (report: VoiceOpsActionHistoryReport) => string;
@@ -0,0 +1,80 @@
1
+ import { Elysia } from 'elysia';
2
+ import { type VoiceDeliverySinkReport, type VoiceDeliverySinkRoutesOptions } from './deliverySinkRoutes';
3
+ import { type VoiceQualityReport } from './qualityRoutes';
4
+ import { type VoiceRoutingEvent } from './resilienceRoutes';
5
+ import { type VoiceSessionListItem } from './sessionReplay';
6
+ import { summarizeVoiceTrace, type VoiceTraceEventStore } from './trace';
7
+ export type VoiceOpsConsoleLink = {
8
+ description?: string;
9
+ href: string;
10
+ label: string;
11
+ statusHref?: string;
12
+ };
13
+ export type VoiceOpsConsoleReport = {
14
+ checkedAt: number;
15
+ eventCount: number;
16
+ handoffs: {
17
+ failed: number;
18
+ total: number;
19
+ };
20
+ links: VoiceOpsConsoleLink[];
21
+ deliverySinks?: VoiceDeliverySinkReport;
22
+ providers: {
23
+ degraded: number;
24
+ healthy: number;
25
+ total: number;
26
+ };
27
+ quality: VoiceQualityReport;
28
+ recentRoutingEvents: VoiceRoutingEvent[];
29
+ recentSessions: VoiceSessionListItem[];
30
+ sessions: {
31
+ failed: number;
32
+ healthy: number;
33
+ total: number;
34
+ };
35
+ trace: ReturnType<typeof summarizeVoiceTrace>;
36
+ };
37
+ export type VoiceOpsConsoleRoutesOptions = {
38
+ headers?: HeadersInit;
39
+ deliverySinks?: false | VoiceDeliverySinkRoutesOptions;
40
+ links?: VoiceOpsConsoleLink[];
41
+ llmProviders?: readonly string[];
42
+ name?: string;
43
+ path?: string;
44
+ store: VoiceTraceEventStore;
45
+ sttProviders?: readonly string[];
46
+ title?: string;
47
+ ttsProviders?: readonly string[];
48
+ };
49
+ export declare const buildVoiceOpsConsoleReport: (options: VoiceOpsConsoleRoutesOptions) => Promise<VoiceOpsConsoleReport>;
50
+ export declare const renderVoiceOpsConsoleHTML: (report: VoiceOpsConsoleReport, options?: {
51
+ title?: string;
52
+ }) => string;
53
+ export declare const createVoiceOpsConsoleRoutes: (options: VoiceOpsConsoleRoutesOptions) => Elysia<"", {
54
+ decorator: {};
55
+ store: {};
56
+ derive: {};
57
+ resolve: {};
58
+ }, {
59
+ typebox: {};
60
+ error: {};
61
+ }, {
62
+ schema: {};
63
+ standaloneSchema: {};
64
+ macro: {};
65
+ macroFn: {};
66
+ parser: {};
67
+ response: {};
68
+ }, {}, {
69
+ derive: {};
70
+ resolve: {};
71
+ schema: {};
72
+ standaloneSchema: {};
73
+ response: {};
74
+ }, {
75
+ derive: {};
76
+ resolve: {};
77
+ schema: {};
78
+ standaloneSchema: {};
79
+ response: {};
80
+ }>;
@@ -0,0 +1,76 @@
1
+ import { type VoiceEvalLink, type VoiceEvalRoutesOptions } from './evalRoutes';
2
+ import { type VoiceDeliverySinkRoutesOptions } from './deliverySinkRoutes';
3
+ import { type VoiceQualityRoutesOptions } from './qualityRoutes';
4
+ import { type VoiceProviderFallbackRecoverySummary } from './sessionReplay';
5
+ import { type VoiceTraceEventStore } from './trace';
6
+ export type VoiceOpsStatus = 'pass' | 'fail';
7
+ export type VoiceOpsStatusLink = VoiceEvalLink & {
8
+ description?: string;
9
+ statusHref?: string;
10
+ };
11
+ export type VoiceOpsStatusOptions<TProvider extends string = string> = {
12
+ deliverySinks?: false | VoiceDeliverySinkRoutesOptions;
13
+ evals?: false | Partial<VoiceEvalRoutesOptions>;
14
+ include?: {
15
+ deliverySinks?: boolean;
16
+ handoffs?: boolean;
17
+ providers?: boolean;
18
+ providerRecovery?: boolean;
19
+ quality?: boolean;
20
+ sessions?: boolean;
21
+ workflows?: boolean;
22
+ };
23
+ links?: VoiceOpsStatusLink[];
24
+ llmProviders?: readonly TProvider[];
25
+ preferFixtureWorkflows?: boolean;
26
+ quality?: false | Partial<VoiceQualityRoutesOptions>;
27
+ store: VoiceTraceEventStore;
28
+ sttProviders?: readonly string[];
29
+ ttsProviders?: readonly string[];
30
+ };
31
+ export type VoiceOpsStatusReport = {
32
+ checkedAt: number;
33
+ failed: number;
34
+ links: VoiceOpsStatusLink[];
35
+ passed: number;
36
+ status: VoiceOpsStatus;
37
+ surfaces: {
38
+ handoffs?: {
39
+ failed: number;
40
+ status: VoiceOpsStatus;
41
+ total: number;
42
+ };
43
+ deliverySinks?: {
44
+ auditTotal: number;
45
+ status: VoiceOpsStatus;
46
+ traceTotal: number;
47
+ };
48
+ providers?: {
49
+ degraded: number;
50
+ status: VoiceOpsStatus;
51
+ total: number;
52
+ };
53
+ providerRecovery?: VoiceProviderFallbackRecoverySummary;
54
+ quality?: {
55
+ status: VoiceOpsStatus;
56
+ };
57
+ sessions?: {
58
+ failed: number;
59
+ status: VoiceOpsStatus;
60
+ total: number;
61
+ };
62
+ workflows?: {
63
+ failed: number;
64
+ source: 'fixtures' | 'live';
65
+ status: VoiceOpsStatus;
66
+ total: number;
67
+ };
68
+ };
69
+ total: number;
70
+ };
71
+ export type VoiceOpsStatusRoutesOptions<TProvider extends string = string> = VoiceOpsStatusOptions<TProvider> & {
72
+ headers?: HeadersInit;
73
+ name?: string;
74
+ path?: string;
75
+ };
76
+ export declare const summarizeVoiceOpsStatus: <TProvider extends string = string>(options: VoiceOpsStatusOptions<TProvider>) => Promise<VoiceOpsStatusReport>;
@@ -0,0 +1,33 @@
1
+ import { Elysia } from 'elysia';
2
+ import { type VoiceOpsStatusReport, type VoiceOpsStatusRoutesOptions } from './opsStatus';
3
+ export declare const renderVoiceOpsStatusHTML: (report: VoiceOpsStatusReport, options?: {
4
+ title?: string;
5
+ }) => string;
6
+ export declare const createVoiceOpsStatusRoutes: (options: VoiceOpsStatusRoutesOptions) => Elysia<"", {
7
+ decorator: {};
8
+ store: {};
9
+ derive: {};
10
+ resolve: {};
11
+ }, {
12
+ typebox: {};
13
+ error: {};
14
+ }, {
15
+ schema: {};
16
+ standaloneSchema: {};
17
+ macro: {};
18
+ macroFn: {};
19
+ parser: {};
20
+ response: {};
21
+ }, {}, {
22
+ derive: {};
23
+ resolve: {};
24
+ schema: {};
25
+ standaloneSchema: {};
26
+ response: {};
27
+ }, {
28
+ derive: {};
29
+ resolve: {};
30
+ schema: {};
31
+ standaloneSchema: {};
32
+ response: {};
33
+ }>;
@@ -0,0 +1,126 @@
1
+ import { Elysia } from 'elysia';
2
+ import type { StoredVoiceIntegrationEvent, VoiceIntegrationEventType } from './ops';
3
+ import type { VoiceIntegrationHTTPSinkOptions, VoiceIntegrationSink } from './opsSinks';
4
+ type MaybePromise<T> = T | Promise<T>;
5
+ export type VoiceOpsWebhookLinkResolver = string | ((input: {
6
+ event: StoredVoiceIntegrationEvent;
7
+ }) => MaybePromise<string | undefined>);
8
+ export type VoiceOpsWebhookEntity = {
9
+ disposition?: string;
10
+ outcome?: string;
11
+ priority?: string;
12
+ queue?: string;
13
+ reviewId?: string;
14
+ scenarioId?: string;
15
+ sessionId?: string;
16
+ status?: string;
17
+ target?: string;
18
+ taskId?: string;
19
+ };
20
+ export type VoiceOpsWebhookEnvelope = {
21
+ entity: VoiceOpsWebhookEntity;
22
+ event: {
23
+ createdAt: number;
24
+ id: string;
25
+ payload: Record<string, unknown>;
26
+ type: VoiceIntegrationEventType;
27
+ };
28
+ links?: {
29
+ event?: string;
30
+ replay?: string;
31
+ review?: string;
32
+ task?: string;
33
+ };
34
+ schemaVersion: 1;
35
+ source: 'absolutejs-voice';
36
+ };
37
+ export type VoiceOpsWebhookSinkOptions = Omit<VoiceIntegrationHTTPSinkOptions<VoiceOpsWebhookEnvelope>, 'body'> & {
38
+ baseUrl?: string;
39
+ eventHref?: VoiceOpsWebhookLinkResolver;
40
+ replayHref?: VoiceOpsWebhookLinkResolver;
41
+ reviewHref?: VoiceOpsWebhookLinkResolver;
42
+ taskHref?: VoiceOpsWebhookLinkResolver;
43
+ };
44
+ export type VoiceOpsWebhookVerificationResult = {
45
+ ok: true;
46
+ } | {
47
+ ok: false;
48
+ reason: 'invalid-signature' | 'missing-secret' | 'missing-signature' | 'missing-timestamp' | 'stale-timestamp' | 'unsupported-algorithm';
49
+ };
50
+ export type VoiceOpsWebhookReceiverRoutesOptions = {
51
+ onEnvelope?: (input: {
52
+ envelope: VoiceOpsWebhookEnvelope;
53
+ request: Request;
54
+ }) => MaybePromise<void>;
55
+ path?: string;
56
+ signingSecret?: string;
57
+ toleranceMs?: number;
58
+ };
59
+ export declare const createVoiceOpsWebhookEnvelope: (input: {
60
+ baseUrl?: string;
61
+ event: StoredVoiceIntegrationEvent;
62
+ eventHref?: VoiceOpsWebhookLinkResolver;
63
+ replayHref?: VoiceOpsWebhookLinkResolver;
64
+ reviewHref?: VoiceOpsWebhookLinkResolver;
65
+ taskHref?: VoiceOpsWebhookLinkResolver;
66
+ }) => Promise<VoiceOpsWebhookEnvelope>;
67
+ export declare const createVoiceOpsWebhookSink: (options: VoiceOpsWebhookSinkOptions) => VoiceIntegrationSink;
68
+ export declare const verifyVoiceOpsWebhookSignature: (input: {
69
+ body: string;
70
+ now?: number;
71
+ secret?: string;
72
+ signature?: string | null;
73
+ timestamp?: string | null;
74
+ toleranceMs?: number;
75
+ }) => Promise<VoiceOpsWebhookVerificationResult>;
76
+ export declare const createVoiceOpsWebhookReceiverRoutes: (options?: VoiceOpsWebhookReceiverRoutesOptions) => Elysia<"", {
77
+ decorator: {};
78
+ store: {};
79
+ derive: {};
80
+ resolve: {};
81
+ }, {
82
+ typebox: {};
83
+ error: {};
84
+ }, {
85
+ schema: {};
86
+ standaloneSchema: {};
87
+ macro: {};
88
+ macroFn: {};
89
+ parser: {};
90
+ response: {};
91
+ }, {
92
+ [x: string]: {
93
+ post: {
94
+ body: unknown;
95
+ params: {};
96
+ query: unknown;
97
+ headers: unknown;
98
+ response: {
99
+ 200: {
100
+ ok: boolean;
101
+ reason: "invalid-signature" | "missing-secret" | "missing-signature" | "missing-timestamp" | "stale-timestamp" | "unsupported-algorithm";
102
+ eventId?: undefined;
103
+ type?: undefined;
104
+ } | {
105
+ eventId: string;
106
+ ok: boolean;
107
+ type: VoiceIntegrationEventType;
108
+ reason?: undefined;
109
+ };
110
+ };
111
+ };
112
+ };
113
+ }, {
114
+ derive: {};
115
+ resolve: {};
116
+ schema: {};
117
+ standaloneSchema: {};
118
+ response: {};
119
+ }, {
120
+ derive: {};
121
+ resolve: {};
122
+ schema: {};
123
+ standaloneSchema: {};
124
+ response: {};
125
+ }>;
126
+ export {};