@absolutejs/voice 0.0.22-beta.182 → 0.0.22-beta.184
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/dist/index.d.ts +3 -1
- package/dist/index.js +603 -400
- package/dist/operationsRecord.d.ts +102 -0
- package/dist/productionReadiness.d.ts +14 -0
- package/package.json +1 -1
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { Elysia } from 'elysia';
|
|
2
|
+
import { type StoredVoiceAuditEvent, type VoiceAuditEventStore } from './audit';
|
|
3
|
+
import { type VoiceSessionReplay } from './sessionReplay';
|
|
4
|
+
import { type VoiceTraceTimelineEvent, type VoiceTraceTimelineProviderSummary } from './traceTimeline';
|
|
5
|
+
import { type StoredVoiceTraceEvent, type VoiceTraceEvaluationOptions, type VoiceTraceEventStore, type VoiceTraceRedactionConfig, type VoiceTraceSummary } from './trace';
|
|
6
|
+
export type VoiceOperationsRecordStatus = 'failed' | 'healthy' | 'warning';
|
|
7
|
+
export type VoiceOperationsRecordOutcome = {
|
|
8
|
+
assistantReplies: number;
|
|
9
|
+
complete: boolean;
|
|
10
|
+
escalated: boolean;
|
|
11
|
+
noAnswer: boolean;
|
|
12
|
+
transferred: boolean;
|
|
13
|
+
voicemail: boolean;
|
|
14
|
+
};
|
|
15
|
+
export type VoiceOperationsRecordAgentHandoff = {
|
|
16
|
+
at: number;
|
|
17
|
+
fromAgentId?: string;
|
|
18
|
+
metadata?: Record<string, unknown>;
|
|
19
|
+
reason?: string;
|
|
20
|
+
status?: string;
|
|
21
|
+
summary?: string;
|
|
22
|
+
targetAgentId?: string;
|
|
23
|
+
turnId?: string;
|
|
24
|
+
};
|
|
25
|
+
export type VoiceOperationsRecordTool = {
|
|
26
|
+
at: number;
|
|
27
|
+
elapsedMs?: number;
|
|
28
|
+
error?: string;
|
|
29
|
+
status?: string;
|
|
30
|
+
toolCallId?: string;
|
|
31
|
+
toolName?: string;
|
|
32
|
+
turnId?: string;
|
|
33
|
+
};
|
|
34
|
+
export type VoiceOperationsRecordAuditSummary = {
|
|
35
|
+
error: number;
|
|
36
|
+
events: StoredVoiceAuditEvent[];
|
|
37
|
+
skipped: number;
|
|
38
|
+
success: number;
|
|
39
|
+
total: number;
|
|
40
|
+
};
|
|
41
|
+
export type VoiceOperationsRecord = {
|
|
42
|
+
audit?: VoiceOperationsRecordAuditSummary;
|
|
43
|
+
checkedAt: number;
|
|
44
|
+
handoffs: VoiceOperationsRecordAgentHandoff[];
|
|
45
|
+
outcome: VoiceOperationsRecordOutcome;
|
|
46
|
+
providers: VoiceTraceTimelineProviderSummary[];
|
|
47
|
+
replay: VoiceSessionReplay;
|
|
48
|
+
sessionId: string;
|
|
49
|
+
status: VoiceOperationsRecordStatus;
|
|
50
|
+
summary: VoiceTraceSummary;
|
|
51
|
+
timeline: VoiceTraceTimelineEvent[];
|
|
52
|
+
tools: VoiceOperationsRecordTool[];
|
|
53
|
+
traceEvents: StoredVoiceTraceEvent[];
|
|
54
|
+
};
|
|
55
|
+
export type VoiceOperationsRecordOptions = {
|
|
56
|
+
audit?: VoiceAuditEventStore;
|
|
57
|
+
evaluation?: VoiceTraceEvaluationOptions;
|
|
58
|
+
events?: StoredVoiceTraceEvent[];
|
|
59
|
+
redact?: VoiceTraceRedactionConfig;
|
|
60
|
+
sessionId: string;
|
|
61
|
+
store?: VoiceTraceEventStore;
|
|
62
|
+
};
|
|
63
|
+
export type VoiceOperationsRecordRoutesOptions = Omit<VoiceOperationsRecordOptions, 'sessionId'> & {
|
|
64
|
+
headers?: HeadersInit;
|
|
65
|
+
htmlPath?: false | string;
|
|
66
|
+
name?: string;
|
|
67
|
+
path?: string;
|
|
68
|
+
render?: (record: VoiceOperationsRecord) => string | Promise<string>;
|
|
69
|
+
title?: string;
|
|
70
|
+
};
|
|
71
|
+
export declare const buildVoiceOperationsRecord: (options: VoiceOperationsRecordOptions) => Promise<VoiceOperationsRecord>;
|
|
72
|
+
export declare const renderVoiceOperationsRecordHTML: (record: VoiceOperationsRecord, options?: {
|
|
73
|
+
title?: string;
|
|
74
|
+
}) => string;
|
|
75
|
+
export declare const createVoiceOperationsRecordRoutes: (options: VoiceOperationsRecordRoutesOptions) => Elysia<"", {
|
|
76
|
+
decorator: {};
|
|
77
|
+
store: {};
|
|
78
|
+
derive: {};
|
|
79
|
+
resolve: {};
|
|
80
|
+
}, {
|
|
81
|
+
typebox: {};
|
|
82
|
+
error: {};
|
|
83
|
+
}, {
|
|
84
|
+
schema: {};
|
|
85
|
+
standaloneSchema: {};
|
|
86
|
+
macro: {};
|
|
87
|
+
macroFn: {};
|
|
88
|
+
parser: {};
|
|
89
|
+
response: {};
|
|
90
|
+
}, {}, {
|
|
91
|
+
derive: {};
|
|
92
|
+
resolve: {};
|
|
93
|
+
schema: {};
|
|
94
|
+
standaloneSchema: {};
|
|
95
|
+
response: {};
|
|
96
|
+
}, {
|
|
97
|
+
derive: {};
|
|
98
|
+
resolve: {};
|
|
99
|
+
schema: {};
|
|
100
|
+
standaloneSchema: {};
|
|
101
|
+
response: {};
|
|
102
|
+
}>;
|
|
@@ -86,6 +86,7 @@ export type VoiceProductionReadinessReport = {
|
|
|
86
86
|
handoffs?: string;
|
|
87
87
|
handoffRetry?: string;
|
|
88
88
|
liveLatency?: string;
|
|
89
|
+
operationsRecords?: string;
|
|
89
90
|
opsActions?: string;
|
|
90
91
|
phoneAgentSmoke?: string;
|
|
91
92
|
providerContracts?: string;
|
|
@@ -98,6 +99,7 @@ export type VoiceProductionReadinessReport = {
|
|
|
98
99
|
};
|
|
99
100
|
profile?: VoiceProductionReadinessProfileExplanation;
|
|
100
101
|
proofSources?: Record<string, VoiceProductionReadinessProofSource>;
|
|
102
|
+
operationsRecords?: VoiceProductionReadinessOperationsRecordLinks;
|
|
101
103
|
status: VoiceProductionReadinessStatus;
|
|
102
104
|
summary: {
|
|
103
105
|
agentSquadContracts?: {
|
|
@@ -174,6 +176,18 @@ export type VoiceProductionReadinessReport = {
|
|
|
174
176
|
traceDeliveries?: VoiceProductionReadinessTraceDeliverySummary;
|
|
175
177
|
};
|
|
176
178
|
};
|
|
179
|
+
export type VoiceProductionReadinessOperationsRecordLink = {
|
|
180
|
+
detail?: string;
|
|
181
|
+
href: string;
|
|
182
|
+
label: string;
|
|
183
|
+
sessionId: string;
|
|
184
|
+
status: VoiceProductionReadinessStatus;
|
|
185
|
+
};
|
|
186
|
+
export type VoiceProductionReadinessOperationsRecordLinks = {
|
|
187
|
+
failedSessions: VoiceProductionReadinessOperationsRecordLink[];
|
|
188
|
+
failingLatency: VoiceProductionReadinessOperationsRecordLink[];
|
|
189
|
+
providerErrors: VoiceProductionReadinessOperationsRecordLink[];
|
|
190
|
+
};
|
|
177
191
|
export type VoiceProductionReadinessAuditRequirement = {
|
|
178
192
|
label?: string;
|
|
179
193
|
maxAgeMs?: number;
|