@absolutejs/voice 0.0.22-beta.195 → 0.0.22-beta.197

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.
@@ -0,0 +1,137 @@
1
+ import { Elysia } from 'elysia';
2
+ import { type VoiceAuditSinkDeliveryQueueSummary, type VoiceAuditSinkDeliveryStore } from './auditSinks';
3
+ import { type VoiceLatencySLOGateOptions, type VoiceLatencySLOGateReport } from './latencySlo';
4
+ import { type VoiceHandoffDeliveryQueueSummary, type VoiceTraceSinkDeliveryQueueSummary } from './queue';
5
+ import { type VoiceProviderHealthSummary } from './providerHealth';
6
+ import type { VoiceProductionReadinessCheck } from './productionReadiness';
7
+ import type { VoiceHandoffDeliveryStore } from './types';
8
+ import type { StoredVoiceTraceEvent, VoiceTraceEventStore, VoiceTraceSinkDeliveryStore } from './trace';
9
+ export type VoiceOpsRecoveryStatus = 'fail' | 'pass' | 'warn';
10
+ export type VoiceOpsRecoveryIssueCode = 'voice.ops_recovery.audit_delivery_failed' | 'voice.ops_recovery.audit_delivery_pending' | 'voice.ops_recovery.handoff_failed' | 'voice.ops_recovery.handoff_pending' | 'voice.ops_recovery.latency_slo_failed' | 'voice.ops_recovery.latency_slo_warn' | 'voice.ops_recovery.provider_unresolved_failure' | 'voice.ops_recovery.trace_delivery_failed' | 'voice.ops_recovery.trace_delivery_pending';
11
+ export type VoiceOpsRecoveryIssue = {
12
+ code: VoiceOpsRecoveryIssueCode;
13
+ detail?: string;
14
+ href?: string;
15
+ label: string;
16
+ severity: Exclude<VoiceOpsRecoveryStatus, 'pass'>;
17
+ value?: number | string;
18
+ };
19
+ export type VoiceOpsRecoveryProviderSummary<TProvider extends string = string> = {
20
+ healthy: number;
21
+ providers: VoiceProviderHealthSummary<TProvider>[];
22
+ recoveredFallbacks: number;
23
+ unresolvedFailures: number;
24
+ };
25
+ export type VoiceOpsRecoveryInterventionSummary = {
26
+ events: Array<{
27
+ action?: string;
28
+ at: number;
29
+ operatorId?: string;
30
+ sessionId: string;
31
+ traceId?: string;
32
+ }>;
33
+ total: number;
34
+ };
35
+ export type VoiceOpsRecoveryFailedSession = {
36
+ at: number;
37
+ error?: string;
38
+ operationsRecordHref?: string;
39
+ provider?: string;
40
+ sessionId: string;
41
+ traceId?: string;
42
+ };
43
+ export type VoiceOpsRecoveryReport<TProvider extends string = string> = {
44
+ auditDeliveries?: VoiceAuditSinkDeliveryQueueSummary;
45
+ checkedAt: number;
46
+ failedSessions: VoiceOpsRecoveryFailedSession[];
47
+ handoffDeliveries?: VoiceHandoffDeliveryQueueSummary;
48
+ interventions: VoiceOpsRecoveryInterventionSummary;
49
+ issues: VoiceOpsRecoveryIssue[];
50
+ latency?: VoiceLatencySLOGateReport;
51
+ providers: VoiceOpsRecoveryProviderSummary<TProvider>;
52
+ status: VoiceOpsRecoveryStatus;
53
+ traceDeliveries?: VoiceTraceSinkDeliveryQueueSummary;
54
+ };
55
+ export type VoiceOpsRecoveryLinks = {
56
+ auditDeliveries?: string;
57
+ handoffs?: string;
58
+ operationsRecords?: string | ((sessionId: string) => string);
59
+ providers?: string;
60
+ sessions?: string | ((sessionId: string) => string);
61
+ traceDeliveries?: string;
62
+ traces?: string | ((sessionId: string) => string);
63
+ };
64
+ export type VoiceOpsRecoveryReportOptions<TProvider extends string = string> = {
65
+ auditDeliveryDeadLetters?: VoiceAuditSinkDeliveryStore;
66
+ auditDeliveries?: VoiceAuditSinkDeliveryStore;
67
+ events?: StoredVoiceTraceEvent[];
68
+ handoffDeliveryDeadLetters?: VoiceHandoffDeliveryStore;
69
+ handoffDeliveries?: VoiceHandoffDeliveryStore;
70
+ latency?: VoiceLatencySLOGateOptions | false;
71
+ limit?: number;
72
+ links?: VoiceOpsRecoveryLinks;
73
+ providers?: readonly TProvider[];
74
+ traceDeliveryDeadLetters?: VoiceTraceSinkDeliveryStore;
75
+ traceDeliveries?: VoiceTraceSinkDeliveryStore;
76
+ traces?: VoiceTraceEventStore;
77
+ };
78
+ export type VoiceOpsRecoveryRoutesOptions<TProvider extends string = string> = VoiceOpsRecoveryReportOptions<TProvider> & {
79
+ headers?: HeadersInit;
80
+ htmlPath?: false | string;
81
+ markdownPath?: false | string;
82
+ name?: string;
83
+ path?: string;
84
+ render?: (report: VoiceOpsRecoveryReport<TProvider>) => string | Promise<string>;
85
+ title?: string;
86
+ };
87
+ export declare const buildVoiceOpsRecoveryReport: <TProvider extends string = string>(options?: VoiceOpsRecoveryReportOptions<TProvider>) => Promise<VoiceOpsRecoveryReport<TProvider>>;
88
+ export declare const buildVoiceOpsRecoveryReadinessCheck: (report: VoiceOpsRecoveryReport, options?: {
89
+ href?: string;
90
+ label?: string;
91
+ }) => VoiceProductionReadinessCheck;
92
+ export declare const renderVoiceOpsRecoveryMarkdown: (report: VoiceOpsRecoveryReport, options?: {
93
+ title?: string;
94
+ }) => string;
95
+ export declare const renderVoiceOpsRecoveryHTML: (report: VoiceOpsRecoveryReport, options?: {
96
+ title?: string;
97
+ }) => string;
98
+ export declare const createVoiceOpsRecoveryRoutes: <TProvider extends string = string>(options?: VoiceOpsRecoveryRoutesOptions<TProvider>) => Elysia<"", {
99
+ decorator: {};
100
+ store: {};
101
+ derive: {};
102
+ resolve: {};
103
+ }, {
104
+ typebox: {};
105
+ error: {};
106
+ }, {
107
+ schema: {};
108
+ standaloneSchema: {};
109
+ macro: {};
110
+ macroFn: {};
111
+ parser: {};
112
+ response: {};
113
+ }, {
114
+ [x: string]: {
115
+ get: {
116
+ body: unknown;
117
+ params: {};
118
+ query: unknown;
119
+ headers: unknown;
120
+ response: {
121
+ 200: VoiceOpsRecoveryReport<TProvider>;
122
+ };
123
+ };
124
+ };
125
+ }, {
126
+ derive: {};
127
+ resolve: {};
128
+ schema: {};
129
+ standaloneSchema: {};
130
+ response: {};
131
+ }, {
132
+ derive: {};
133
+ resolve: {};
134
+ schema: {};
135
+ standaloneSchema: {};
136
+ response: {};
137
+ }>;
@@ -13,6 +13,7 @@ import type { VoiceAuditEventStore, VoiceAuditEventType, VoiceAuditOutcome } fro
13
13
  import { type VoiceAuditSinkDeliveryStore } from './auditSinks';
14
14
  import type { VoiceProviderContractMatrixReport, VoiceProviderStackCapabilityGapReport } from './providerStackRecommendations';
15
15
  import type { VoiceCampaignReadinessProofReport } from './campaign';
16
+ import { type VoiceOpsRecoveryReport } from './opsRecovery';
16
17
  export type VoiceProductionReadinessStatus = 'fail' | 'pass' | 'warn';
17
18
  export type VoiceProductionReadinessAction = {
18
19
  description?: string;
@@ -90,6 +91,7 @@ export type VoiceProductionReadinessReport = {
90
91
  liveLatency?: string;
91
92
  operationsRecords?: string;
92
93
  opsActions?: string;
94
+ opsRecovery?: string;
93
95
  phoneAgentSmoke?: string;
94
96
  providerContracts?: string;
95
97
  providerRoutingContracts?: string;
@@ -145,6 +147,12 @@ export type VoiceProductionReadinessReport = {
145
147
  warnings: number;
146
148
  };
147
149
  opsActionHistory?: VoiceProductionReadinessOpsActionHistorySummary;
150
+ opsRecovery?: {
151
+ issues: number;
152
+ recoveredFallbacks: number;
153
+ status: VoiceProductionReadinessStatus;
154
+ unresolvedProviderFailures: number;
155
+ };
148
156
  providers: {
149
157
  degraded: number;
150
158
  total: number;
@@ -318,6 +326,10 @@ export type VoiceProductionReadinessRoutesOptions = {
318
326
  llmProviders?: readonly string[];
319
327
  name?: string;
320
328
  opsActionHistory?: false | VoiceProductionReadinessOpsActionHistoryOptions;
329
+ opsRecovery?: false | VoiceOpsRecoveryReport | ((input: {
330
+ query: Record<string, unknown>;
331
+ request: Request;
332
+ }) => Promise<VoiceOpsRecoveryReport> | VoiceOpsRecoveryReport);
321
333
  path?: string;
322
334
  phoneAgentSmokes?: false | readonly VoicePhoneAgentProductionSmokeReport[] | ((input: {
323
335
  query: Record<string, unknown>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@absolutejs/voice",
3
- "version": "0.0.22-beta.195",
3
+ "version": "0.0.22-beta.197",
4
4
  "description": "Voice primitives and Elysia plugin for AbsoluteJS",
5
5
  "repository": {
6
6
  "type": "git",