@absolutejs/voice 0.0.22-beta.292 → 0.0.22-beta.294
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.
- package/README.md +78 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +10954 -10447
- package/dist/productionReadiness.d.ts +15 -0
- package/dist/providerDecisionTraces.d.ts +122 -0
- package/dist/providerOrchestration.d.ts +109 -0
- package/dist/trace.d.ts +1 -1
- package/dist/vue/useVoiceReadinessFailures.d.ts +20 -0
- package/package.json +1 -1
|
@@ -15,6 +15,7 @@ import type { VoiceAuditEventStore, VoiceAuditEventType, VoiceAuditOutcome } fro
|
|
|
15
15
|
import { type VoiceAuditSinkDeliveryStore } from './auditSinks';
|
|
16
16
|
import type { VoiceProviderContractMatrixReport, VoiceProviderStackCapabilityGapReport } from './providerStackRecommendations';
|
|
17
17
|
import { type VoiceProviderSloReport, type VoiceProviderSloReportOptions } from './providerSlo';
|
|
18
|
+
import type { VoiceProviderOrchestrationReport } from './providerOrchestration';
|
|
18
19
|
import type { VoiceCampaignReadinessProofReport } from './campaign';
|
|
19
20
|
import { type VoiceOpsRecoveryReport } from './opsRecovery';
|
|
20
21
|
import { type VoiceObservabilityExportDeliveryHistory, type VoiceObservabilityExportDeliveryReceiptStore, type VoiceObservabilityExportReplayReport, type VoiceObservabilityExportReplaySource, type VoiceObservabilityExportReport } from './observabilityExport';
|
|
@@ -136,6 +137,7 @@ export type VoiceProductionReadinessReport = {
|
|
|
136
137
|
phoneAgentSmoke?: string;
|
|
137
138
|
telephonyWebhookSecurity?: string;
|
|
138
139
|
providerContracts?: string;
|
|
140
|
+
providerOrchestration?: string;
|
|
139
141
|
providerRoutingContracts?: string;
|
|
140
142
|
providerSlo?: string;
|
|
141
143
|
quality?: string;
|
|
@@ -243,6 +245,15 @@ export type VoiceProductionReadinessReport = {
|
|
|
243
245
|
};
|
|
244
246
|
providerStack?: VoiceProviderStackCapabilityGapReport;
|
|
245
247
|
providerContractMatrix?: VoiceProviderContractMatrixReport;
|
|
248
|
+
providerOrchestration?: {
|
|
249
|
+
failed: number;
|
|
250
|
+
issues: number;
|
|
251
|
+
passed: number;
|
|
252
|
+
providers: number;
|
|
253
|
+
status: VoiceProductionReadinessStatus;
|
|
254
|
+
surfaces: number;
|
|
255
|
+
warned: number;
|
|
256
|
+
};
|
|
246
257
|
providerRecovery: VoiceProviderFallbackRecoverySummary;
|
|
247
258
|
phoneAgentSmokes?: {
|
|
248
259
|
failed: number;
|
|
@@ -469,6 +480,10 @@ export type VoiceProductionReadinessRoutesOptions = {
|
|
|
469
480
|
query: Record<string, unknown>;
|
|
470
481
|
request: Request;
|
|
471
482
|
}) => Promise<VoiceProviderSloReport | VoiceProviderSloReportOptions> | VoiceProviderSloReport | VoiceProviderSloReportOptions);
|
|
483
|
+
providerOrchestration?: false | VoiceProviderOrchestrationReport | ((input: {
|
|
484
|
+
query: Record<string, unknown>;
|
|
485
|
+
request: Request;
|
|
486
|
+
}) => Promise<VoiceProviderOrchestrationReport> | VoiceProviderOrchestrationReport);
|
|
472
487
|
providerStack?: false | VoiceProviderStackCapabilityGapReport | ((input: {
|
|
473
488
|
query: Record<string, unknown>;
|
|
474
489
|
request: Request;
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { Elysia } from 'elysia';
|
|
2
|
+
import { type VoiceRoutingEventKind } from './resilienceRoutes';
|
|
3
|
+
import type { StoredVoiceTraceEvent, VoiceTraceEvent, VoiceTraceEventStore } from './trace';
|
|
4
|
+
export type VoiceProviderDecisionStatus = 'error' | 'fallback' | 'selected' | 'skipped' | 'success';
|
|
5
|
+
export type VoiceProviderDecisionTrace = {
|
|
6
|
+
at: number;
|
|
7
|
+
elapsedMs?: number;
|
|
8
|
+
error?: string;
|
|
9
|
+
fallbackProvider?: string;
|
|
10
|
+
kind?: VoiceRoutingEventKind;
|
|
11
|
+
latencyBudgetMs?: number;
|
|
12
|
+
provider: string;
|
|
13
|
+
reason: string;
|
|
14
|
+
scenarioId?: string;
|
|
15
|
+
selectedProvider?: string;
|
|
16
|
+
sessionId: string;
|
|
17
|
+
status: VoiceProviderDecisionStatus;
|
|
18
|
+
surface: string;
|
|
19
|
+
turnId?: string;
|
|
20
|
+
};
|
|
21
|
+
export type VoiceProviderDecisionTraceInput = Omit<VoiceProviderDecisionTrace, 'at' | 'reason' | 'sessionId' | 'surface'> & {
|
|
22
|
+
at?: number;
|
|
23
|
+
reason?: string;
|
|
24
|
+
sessionId?: string;
|
|
25
|
+
surface?: string;
|
|
26
|
+
};
|
|
27
|
+
export type VoiceProviderDecisionTraceIssue = {
|
|
28
|
+
code: string;
|
|
29
|
+
message: string;
|
|
30
|
+
status: 'fail' | 'warn';
|
|
31
|
+
surface?: string;
|
|
32
|
+
};
|
|
33
|
+
export type VoiceProviderDecisionSurfaceReport = {
|
|
34
|
+
decisions: number;
|
|
35
|
+
errors: number;
|
|
36
|
+
fallbacks: number;
|
|
37
|
+
issues: VoiceProviderDecisionTraceIssue[];
|
|
38
|
+
latestAt?: number;
|
|
39
|
+
providers: string[];
|
|
40
|
+
reasons: string[];
|
|
41
|
+
selected: number;
|
|
42
|
+
status: 'fail' | 'pass' | 'warn';
|
|
43
|
+
surface: string;
|
|
44
|
+
};
|
|
45
|
+
export type VoiceProviderDecisionTraceReport = {
|
|
46
|
+
checkedAt: number;
|
|
47
|
+
decisions: VoiceProviderDecisionTrace[];
|
|
48
|
+
issues: VoiceProviderDecisionTraceIssue[];
|
|
49
|
+
status: 'fail' | 'pass' | 'warn';
|
|
50
|
+
summary: {
|
|
51
|
+
decisions: number;
|
|
52
|
+
errors: number;
|
|
53
|
+
fallbacks: number;
|
|
54
|
+
providers: number;
|
|
55
|
+
selected: number;
|
|
56
|
+
surfaces: number;
|
|
57
|
+
};
|
|
58
|
+
surfaces: VoiceProviderDecisionSurfaceReport[];
|
|
59
|
+
};
|
|
60
|
+
export type VoiceProviderDecisionTraceReportOptions = {
|
|
61
|
+
events?: StoredVoiceTraceEvent[] | VoiceProviderDecisionTrace[];
|
|
62
|
+
maxAgeMs?: number;
|
|
63
|
+
minDecisions?: number;
|
|
64
|
+
now?: number;
|
|
65
|
+
requiredSurfaces?: readonly string[];
|
|
66
|
+
sessionId?: string;
|
|
67
|
+
store?: VoiceTraceEventStore;
|
|
68
|
+
};
|
|
69
|
+
export type VoiceProviderDecisionTraceRoutesOptions = VoiceProviderDecisionTraceReportOptions & {
|
|
70
|
+
headers?: HeadersInit;
|
|
71
|
+
htmlPath?: false | string;
|
|
72
|
+
markdownPath?: false | string;
|
|
73
|
+
name?: string;
|
|
74
|
+
path?: string;
|
|
75
|
+
render?: (report: VoiceProviderDecisionTraceReport) => string | Promise<string>;
|
|
76
|
+
title?: string;
|
|
77
|
+
};
|
|
78
|
+
export declare const createVoiceProviderDecisionTraceEvent: (input: VoiceProviderDecisionTraceInput) => VoiceTraceEvent;
|
|
79
|
+
export declare const listVoiceProviderDecisionTraces: (events: StoredVoiceTraceEvent[] | VoiceProviderDecisionTrace[]) => VoiceProviderDecisionTrace[];
|
|
80
|
+
export declare const buildVoiceProviderDecisionTraceReport: (options: VoiceProviderDecisionTraceReportOptions) => Promise<VoiceProviderDecisionTraceReport>;
|
|
81
|
+
export declare const renderVoiceProviderDecisionTraceMarkdown: (report: VoiceProviderDecisionTraceReport) => string;
|
|
82
|
+
export declare const renderVoiceProviderDecisionTraceHTML: (report: VoiceProviderDecisionTraceReport, title?: string) => string;
|
|
83
|
+
export declare const createVoiceProviderDecisionTraceRoutes: (options: VoiceProviderDecisionTraceRoutesOptions) => Elysia<"", {
|
|
84
|
+
decorator: {};
|
|
85
|
+
store: {};
|
|
86
|
+
derive: {};
|
|
87
|
+
resolve: {};
|
|
88
|
+
}, {
|
|
89
|
+
typebox: {};
|
|
90
|
+
error: {};
|
|
91
|
+
}, {
|
|
92
|
+
schema: {};
|
|
93
|
+
standaloneSchema: {};
|
|
94
|
+
macro: {};
|
|
95
|
+
macroFn: {};
|
|
96
|
+
parser: {};
|
|
97
|
+
response: {};
|
|
98
|
+
}, {
|
|
99
|
+
[x: string]: {
|
|
100
|
+
get: {
|
|
101
|
+
body: unknown;
|
|
102
|
+
params: {};
|
|
103
|
+
query: unknown;
|
|
104
|
+
headers: unknown;
|
|
105
|
+
response: {
|
|
106
|
+
200: Response;
|
|
107
|
+
};
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
}, {
|
|
111
|
+
derive: {};
|
|
112
|
+
resolve: {};
|
|
113
|
+
schema: {};
|
|
114
|
+
standaloneSchema: {};
|
|
115
|
+
response: {};
|
|
116
|
+
}, {
|
|
117
|
+
derive: {};
|
|
118
|
+
resolve: {};
|
|
119
|
+
schema: {};
|
|
120
|
+
standaloneSchema: {};
|
|
121
|
+
response: {};
|
|
122
|
+
}>;
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { Elysia } from 'elysia';
|
|
2
|
+
import type { VoiceProviderOrchestrationProfile, VoiceProviderRouterProviderProfile } from './modelAdapters';
|
|
3
|
+
import type { VoiceSessionRecord } from './types';
|
|
4
|
+
export type VoiceProviderOrchestrationStatus = 'fail' | 'pass' | 'warn';
|
|
5
|
+
export type VoiceProviderOrchestrationRequirement = {
|
|
6
|
+
minProviders?: number;
|
|
7
|
+
requireBudgetPolicy?: boolean;
|
|
8
|
+
requireCircuitBreaker?: boolean;
|
|
9
|
+
requireFallback?: boolean;
|
|
10
|
+
requireTimeoutBudget?: boolean;
|
|
11
|
+
};
|
|
12
|
+
export type VoiceProviderOrchestrationIssue = {
|
|
13
|
+
code: string;
|
|
14
|
+
message: string;
|
|
15
|
+
status: Exclude<VoiceProviderOrchestrationStatus, 'pass'>;
|
|
16
|
+
surface?: string;
|
|
17
|
+
};
|
|
18
|
+
export type VoiceProviderOrchestrationSurfaceReport = {
|
|
19
|
+
allowProviders: string[];
|
|
20
|
+
budgetPolicy: {
|
|
21
|
+
maxCost?: number;
|
|
22
|
+
maxLatencyMs?: number;
|
|
23
|
+
minQuality?: number;
|
|
24
|
+
};
|
|
25
|
+
circuitBreaker: boolean;
|
|
26
|
+
fallbackMode?: string;
|
|
27
|
+
fallbackProviders: string[];
|
|
28
|
+
issues: VoiceProviderOrchestrationIssue[];
|
|
29
|
+
providerProfiles: Record<string, VoiceProviderRouterProviderProfile>;
|
|
30
|
+
providers: string[];
|
|
31
|
+
status: VoiceProviderOrchestrationStatus;
|
|
32
|
+
strategy?: string;
|
|
33
|
+
surface: string;
|
|
34
|
+
timeoutBudget: boolean;
|
|
35
|
+
timeoutMs?: number;
|
|
36
|
+
};
|
|
37
|
+
export type VoiceProviderOrchestrationReport = {
|
|
38
|
+
checkedAt: number;
|
|
39
|
+
issues: VoiceProviderOrchestrationIssue[];
|
|
40
|
+
profileId: string;
|
|
41
|
+
status: VoiceProviderOrchestrationStatus;
|
|
42
|
+
summary: {
|
|
43
|
+
failed: number;
|
|
44
|
+
passed: number;
|
|
45
|
+
providers: number;
|
|
46
|
+
surfaces: number;
|
|
47
|
+
warned: number;
|
|
48
|
+
};
|
|
49
|
+
surfaces: VoiceProviderOrchestrationSurfaceReport[];
|
|
50
|
+
};
|
|
51
|
+
export type VoiceProviderOrchestrationReportOptions<TProvider extends string = string, TSurface extends string = string> = {
|
|
52
|
+
defaultRequirement?: VoiceProviderOrchestrationRequirement;
|
|
53
|
+
profile: VoiceProviderOrchestrationProfile<unknown, VoiceSessionRecord, TProvider, TSurface>;
|
|
54
|
+
requirements?: Partial<Record<TSurface, VoiceProviderOrchestrationRequirement>>;
|
|
55
|
+
};
|
|
56
|
+
export type VoiceProviderOrchestrationRoutesOptions<TProvider extends string = string, TSurface extends string = string> = VoiceProviderOrchestrationReportOptions<TProvider, TSurface> & {
|
|
57
|
+
headers?: HeadersInit;
|
|
58
|
+
htmlPath?: false | string;
|
|
59
|
+
markdownPath?: false | string;
|
|
60
|
+
name?: string;
|
|
61
|
+
path?: string;
|
|
62
|
+
render?: (report: VoiceProviderOrchestrationReport) => string | Promise<string>;
|
|
63
|
+
title?: string;
|
|
64
|
+
};
|
|
65
|
+
export declare const buildVoiceProviderOrchestrationReport: <TProvider extends string = string, TSurface extends string = string>(options: VoiceProviderOrchestrationReportOptions<TProvider, TSurface>) => VoiceProviderOrchestrationReport;
|
|
66
|
+
export declare const renderVoiceProviderOrchestrationMarkdown: (report: VoiceProviderOrchestrationReport) => string;
|
|
67
|
+
export declare const renderVoiceProviderOrchestrationHTML: (report: VoiceProviderOrchestrationReport, options?: {
|
|
68
|
+
title?: string;
|
|
69
|
+
}) => string;
|
|
70
|
+
export declare const createVoiceProviderOrchestrationRoutes: <TProvider extends string = string, TSurface extends string = string>(options: VoiceProviderOrchestrationRoutesOptions<TProvider, TSurface>) => Elysia<"", {
|
|
71
|
+
decorator: {};
|
|
72
|
+
store: {};
|
|
73
|
+
derive: {};
|
|
74
|
+
resolve: {};
|
|
75
|
+
}, {
|
|
76
|
+
typebox: {};
|
|
77
|
+
error: {};
|
|
78
|
+
}, {
|
|
79
|
+
schema: {};
|
|
80
|
+
standaloneSchema: {};
|
|
81
|
+
macro: {};
|
|
82
|
+
macroFn: {};
|
|
83
|
+
parser: {};
|
|
84
|
+
response: {};
|
|
85
|
+
}, {
|
|
86
|
+
[x: string]: {
|
|
87
|
+
get: {
|
|
88
|
+
body: unknown;
|
|
89
|
+
params: {};
|
|
90
|
+
query: unknown;
|
|
91
|
+
headers: unknown;
|
|
92
|
+
response: {
|
|
93
|
+
200: VoiceProviderOrchestrationReport;
|
|
94
|
+
};
|
|
95
|
+
};
|
|
96
|
+
};
|
|
97
|
+
}, {
|
|
98
|
+
derive: {};
|
|
99
|
+
resolve: {};
|
|
100
|
+
schema: {};
|
|
101
|
+
standaloneSchema: {};
|
|
102
|
+
response: {};
|
|
103
|
+
}, {
|
|
104
|
+
derive: {};
|
|
105
|
+
resolve: {};
|
|
106
|
+
schema: {};
|
|
107
|
+
standaloneSchema: {};
|
|
108
|
+
response: {};
|
|
109
|
+
}>;
|
package/dist/trace.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { S3Client, S3Options } from 'bun';
|
|
2
|
-
export type VoiceTraceEventType = 'assistant.guardrail' | 'assistant.memory' | 'assistant.run' | 'agent.context' | 'agent.handoff' | 'agent.model' | 'agent.result' | 'agent.tool' | 'call.handoff' | 'call.lifecycle' | 'client.barge_in' | 'client.live_latency' | 'client.reconnect' | 'operator.action' | 'session.error' | 'turn.assistant' | 'turn.committed' | 'turn.cost' | 'turn_latency.stage' | 'turn.transcript' | 'workflow.contract';
|
|
2
|
+
export type VoiceTraceEventType = 'assistant.guardrail' | 'assistant.memory' | 'assistant.run' | 'agent.context' | 'agent.handoff' | 'agent.model' | 'agent.result' | 'agent.tool' | 'call.handoff' | 'call.lifecycle' | 'client.barge_in' | 'client.live_latency' | 'client.reconnect' | 'operator.action' | 'provider.decision' | 'session.error' | 'turn.assistant' | 'turn.committed' | 'turn.cost' | 'turn_latency.stage' | 'turn.transcript' | 'workflow.contract';
|
|
3
3
|
export type VoiceTraceEvent<TPayload extends Record<string, unknown> = Record<string, unknown>> = {
|
|
4
4
|
at: number;
|
|
5
5
|
id?: string;
|
|
@@ -56,6 +56,7 @@ export declare const useVoiceReadinessFailures: (path?: string, options?: VoiceR
|
|
|
56
56
|
readonly phoneAgentSmoke?: string | undefined;
|
|
57
57
|
readonly telephonyWebhookSecurity?: string | undefined;
|
|
58
58
|
readonly providerContracts?: string | undefined;
|
|
59
|
+
readonly providerOrchestration?: string | undefined;
|
|
59
60
|
readonly providerRoutingContracts?: string | undefined;
|
|
60
61
|
readonly providerSlo?: string | undefined;
|
|
61
62
|
readonly quality?: string | undefined;
|
|
@@ -310,6 +311,15 @@ export declare const useVoiceReadinessFailures: (path?: string, options?: VoiceR
|
|
|
310
311
|
readonly total: number;
|
|
311
312
|
readonly warned: number;
|
|
312
313
|
} | undefined;
|
|
314
|
+
readonly providerOrchestration?: {
|
|
315
|
+
readonly failed: number;
|
|
316
|
+
readonly issues: number;
|
|
317
|
+
readonly passed: number;
|
|
318
|
+
readonly providers: number;
|
|
319
|
+
readonly status: import("..").VoiceProductionReadinessStatus;
|
|
320
|
+
readonly surfaces: number;
|
|
321
|
+
readonly warned: number;
|
|
322
|
+
} | undefined;
|
|
313
323
|
readonly providerRecovery: {
|
|
314
324
|
readonly recovered: number;
|
|
315
325
|
readonly recoveredSessions: number;
|
|
@@ -429,6 +439,7 @@ export declare const useVoiceReadinessFailures: (path?: string, options?: VoiceR
|
|
|
429
439
|
readonly phoneAgentSmoke?: string | undefined;
|
|
430
440
|
readonly telephonyWebhookSecurity?: string | undefined;
|
|
431
441
|
readonly providerContracts?: string | undefined;
|
|
442
|
+
readonly providerOrchestration?: string | undefined;
|
|
432
443
|
readonly providerRoutingContracts?: string | undefined;
|
|
433
444
|
readonly providerSlo?: string | undefined;
|
|
434
445
|
readonly quality?: string | undefined;
|
|
@@ -683,6 +694,15 @@ export declare const useVoiceReadinessFailures: (path?: string, options?: VoiceR
|
|
|
683
694
|
readonly total: number;
|
|
684
695
|
readonly warned: number;
|
|
685
696
|
} | undefined;
|
|
697
|
+
readonly providerOrchestration?: {
|
|
698
|
+
readonly failed: number;
|
|
699
|
+
readonly issues: number;
|
|
700
|
+
readonly passed: number;
|
|
701
|
+
readonly providers: number;
|
|
702
|
+
readonly status: import("..").VoiceProductionReadinessStatus;
|
|
703
|
+
readonly surfaces: number;
|
|
704
|
+
readonly warned: number;
|
|
705
|
+
} | undefined;
|
|
686
706
|
readonly providerRecovery: {
|
|
687
707
|
readonly recovered: number;
|
|
688
708
|
readonly recoveredSessions: number;
|