@absolutejs/voice 0.0.22-beta.460 → 0.0.22-beta.463
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/client/index.js +57 -0
- package/dist/index.d.ts +4 -4
- package/dist/index.js +831 -618
- package/dist/productionReadiness.d.ts +17 -0
- package/dist/proofPack.d.ts +6 -1
- package/dist/proofTrends.d.ts +25 -0
- package/dist/react/index.js +57 -0
- package/dist/sessionObservability.d.ts +41 -0
- package/dist/vue/index.js +57 -0
- package/dist/vue/useVoiceReadinessFailures.d.ts +16 -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 VoiceSessionObservabilityEvidenceInput, type VoiceSessionObservabilityReport } from "./sessionObservability";
|
|
18
19
|
import type { VoiceProviderOrchestrationReport } from "./providerOrchestration";
|
|
19
20
|
import type { VoiceCampaignReadinessProofReport } from "./campaign";
|
|
20
21
|
import { type VoiceOpsRecoveryReport } from "./opsRecovery";
|
|
@@ -214,6 +215,7 @@ export type VoiceProductionReadinessReport = {
|
|
|
214
215
|
resilience?: string;
|
|
215
216
|
sessions?: string;
|
|
216
217
|
sloReadinessThresholds?: string;
|
|
218
|
+
sessionObservability?: string;
|
|
217
219
|
traceDeliveries?: string;
|
|
218
220
|
};
|
|
219
221
|
profile?: VoiceProductionReadinessProfileExplanation;
|
|
@@ -418,6 +420,13 @@ export type VoiceProductionReadinessReport = {
|
|
|
418
420
|
status: VoiceProductionReadinessStatus;
|
|
419
421
|
total: number;
|
|
420
422
|
};
|
|
423
|
+
sessionObservability?: {
|
|
424
|
+
failed: number;
|
|
425
|
+
passed: number;
|
|
426
|
+
status: VoiceProductionReadinessStatus;
|
|
427
|
+
total: number;
|
|
428
|
+
warnings: number;
|
|
429
|
+
};
|
|
421
430
|
quality: {
|
|
422
431
|
status: "fail" | "pass";
|
|
423
432
|
};
|
|
@@ -677,6 +686,14 @@ export type VoiceProductionReadinessRoutesOptions = {
|
|
|
677
686
|
store: VoiceTraceEventStore;
|
|
678
687
|
sttProviders?: readonly string[];
|
|
679
688
|
title?: string;
|
|
689
|
+
sessionObservability?: false | VoiceSessionObservabilityReport | ((input: {
|
|
690
|
+
query: Record<string, unknown>;
|
|
691
|
+
request: Request;
|
|
692
|
+
}) => Promise<VoiceSessionObservabilityReport> | VoiceSessionObservabilityReport);
|
|
693
|
+
sessionObservabilityEvidence?: false | VoiceSessionObservabilityEvidenceInput | ((input: {
|
|
694
|
+
query: Record<string, unknown>;
|
|
695
|
+
request: Request;
|
|
696
|
+
}) => Promise<VoiceSessionObservabilityEvidenceInput> | VoiceSessionObservabilityEvidenceInput);
|
|
680
697
|
traceDeliveries?: false | VoiceProductionReadinessTraceDeliveryOptions;
|
|
681
698
|
ttsProviders?: readonly string[];
|
|
682
699
|
traceMaxAgeMs?: number;
|
package/dist/proofPack.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import type { VoiceCallDebuggerReport } from "./callDebugger";
|
|
|
5
5
|
import type { VoiceOperationsRecord } from "./operationsRecord";
|
|
6
6
|
import type { VoiceProductionReadinessReport } from "./productionReadiness";
|
|
7
7
|
import type { VoiceProviderSloReport } from "./providerSlo";
|
|
8
|
+
import type { VoiceSessionObservabilityReport } from "./sessionObservability";
|
|
8
9
|
import type { VoiceSessionSnapshot } from "./sessionSnapshot";
|
|
9
10
|
import { type StoredVoiceTraceEvent, type VoiceTraceEventFilter, type VoiceTraceEventStore, type VoiceTraceSinkDeliveryRecord, type VoiceTraceSinkDeliveryStore } from "./trace";
|
|
10
11
|
export type VoiceProofPackStatus = "fail" | "pass" | "warn";
|
|
@@ -47,6 +48,7 @@ export type VoiceProofPackInput = {
|
|
|
47
48
|
providerSlo?: VoiceProviderSloReport;
|
|
48
49
|
runId?: string;
|
|
49
50
|
sections?: VoiceProofPackSection[];
|
|
51
|
+
sessionObservabilityReports?: VoiceSessionObservabilityReport[];
|
|
50
52
|
sessionSnapshots?: VoiceSessionSnapshot[];
|
|
51
53
|
};
|
|
52
54
|
export type VoiceProofPackWriteResult = {
|
|
@@ -94,6 +96,7 @@ export type VoiceProofRefreshSnapshot = {
|
|
|
94
96
|
};
|
|
95
97
|
export type VoiceProofPackInputBuilderSupportBundle = {
|
|
96
98
|
callDebuggerReports?: VoiceCallDebuggerReport[];
|
|
99
|
+
sessionObservabilityReports?: VoiceSessionObservabilityReport[];
|
|
97
100
|
sessionSnapshots?: VoiceSessionSnapshot[];
|
|
98
101
|
};
|
|
99
102
|
export type VoiceProofPackInputBuilderLoaderInput = {
|
|
@@ -102,7 +105,7 @@ export type VoiceProofPackInputBuilderLoaderInput = {
|
|
|
102
105
|
export type VoiceProofPackInputBuilderOperationsLoaderInput = VoiceProofPackInputBuilderLoaderInput & {
|
|
103
106
|
supportBundle?: VoiceProofPackInputBuilderSupportBundle;
|
|
104
107
|
};
|
|
105
|
-
export type VoiceProofPackInputBuilderOptions = Omit<VoiceProofPackInput, "callDebuggerReports" | "observabilityExport" | "operationsRecords" | "productionReadiness" | "providerSlo" | "sessionSnapshots"> & {
|
|
108
|
+
export type VoiceProofPackInputBuilderOptions = Omit<VoiceProofPackInput, "callDebuggerReports" | "observabilityExport" | "operationsRecords" | "productionReadiness" | "providerSlo" | "sessionObservabilityReports" | "sessionSnapshots"> & {
|
|
106
109
|
callDebuggerReports?: VoiceCallDebuggerReport[];
|
|
107
110
|
context?: VoiceProofPackBuildContext;
|
|
108
111
|
loadObservabilityExport?: (input: VoiceProofPackInputBuilderLoaderInput) => Promise<VoiceObservabilityExportReport> | VoiceObservabilityExportReport;
|
|
@@ -111,6 +114,7 @@ export type VoiceProofPackInputBuilderOptions = Omit<VoiceProofPackInput, "callD
|
|
|
111
114
|
loadProviderSlo?: (input: VoiceProofPackInputBuilderLoaderInput) => Promise<VoiceProviderSloReport> | VoiceProviderSloReport;
|
|
112
115
|
loadSupportBundle?: (input: VoiceProofPackInputBuilderLoaderInput) => Promise<VoiceProofPackInputBuilderSupportBundle> | VoiceProofPackInputBuilderSupportBundle;
|
|
113
116
|
operationsRecords?: VoiceOperationsRecord[];
|
|
117
|
+
sessionObservabilityReports?: VoiceSessionObservabilityReport[];
|
|
114
118
|
sessionSnapshots?: VoiceSessionSnapshot[];
|
|
115
119
|
};
|
|
116
120
|
export type VoiceProofPackSourceValue = VoiceProofPack | VoiceProofPackInput;
|
|
@@ -159,6 +163,7 @@ export declare const createVoiceProofPackOperationsRecordSection: (records: read
|
|
|
159
163
|
}) => VoiceProofPackSection;
|
|
160
164
|
export declare const createVoiceProofPackSupportBundleSection: (input: {
|
|
161
165
|
callDebuggerReports?: readonly VoiceCallDebuggerReport[];
|
|
166
|
+
sessionObservabilityReports?: readonly VoiceSessionObservabilityReport[];
|
|
162
167
|
sessionSnapshots?: readonly VoiceSessionSnapshot[];
|
|
163
168
|
title?: string;
|
|
164
169
|
}) => VoiceProofPackSection;
|
package/dist/proofTrends.d.ts
CHANGED
|
@@ -237,14 +237,28 @@ export type VoiceRealCallProfileTraceCollector<TEvent extends StoredVoiceTraceEv
|
|
|
237
237
|
listEvidence: (options?: VoiceRealCallProfileTraceCollectorEvidenceOptions) => Promise<VoiceProofTrendRealCallProfileEvidence[]>;
|
|
238
238
|
};
|
|
239
239
|
export type VoiceRealCallEvidenceRuntimeSourceOptions = {
|
|
240
|
+
browserEvidence?: VoiceRealCallEvidenceRuntimeSurfaceEvidenceSource;
|
|
240
241
|
existingEvidenceLimit?: number;
|
|
241
242
|
evidenceStore: VoiceRealCallProfileEvidenceStore;
|
|
242
243
|
history?: Omit<VoiceRealCallProfileHistoryOptions, "evidence">;
|
|
244
|
+
phoneEvidence?: VoiceRealCallEvidenceRuntimeSurfaceEvidenceSource;
|
|
245
|
+
providerRoleEvidence?: VoiceRealCallEvidenceRuntimeProviderRoleEvidenceSource;
|
|
243
246
|
reconnectEvidence?: VoiceReconnectRealCallProfileEvidenceOptions;
|
|
244
247
|
reconnectReports?: ((options: VoiceRealCallEvidenceRuntimeCollectOptions) => Promise<VoiceReconnectProofReport | VoiceReconnectContractReport | readonly (VoiceReconnectProofReport | VoiceReconnectContractReport)[] | undefined> | VoiceReconnectProofReport | VoiceReconnectContractReport | readonly (VoiceReconnectProofReport | VoiceReconnectContractReport)[] | undefined) | VoiceReconnectProofReport | VoiceReconnectContractReport | readonly (VoiceReconnectProofReport | VoiceReconnectContractReport)[];
|
|
245
248
|
traceEvidence?: VoiceRealCallProfileTraceCollectorEvidenceOptions;
|
|
246
249
|
traceStore?: VoiceTraceEventStore;
|
|
247
250
|
};
|
|
251
|
+
export type VoiceRealCallEvidenceRuntimeSurfaceEvidenceOptions = Omit<VoiceProofTrendRealCallProfileEvidence, "profileId" | "providers" | "sessionId" | "surfaces"> & {
|
|
252
|
+
profileId?: string;
|
|
253
|
+
providers?: readonly VoiceProofTrendProviderSummary[];
|
|
254
|
+
sessionId?: string;
|
|
255
|
+
surfaces?: readonly string[];
|
|
256
|
+
};
|
|
257
|
+
export type VoiceRealCallEvidenceRuntimeProviderRoleEvidenceOptions = Omit<VoiceRealCallEvidenceRuntimeSurfaceEvidenceOptions, "providers"> & {
|
|
258
|
+
providers: readonly VoiceProofTrendProviderSummary[];
|
|
259
|
+
};
|
|
260
|
+
export type VoiceRealCallEvidenceRuntimeSurfaceEvidenceSource = VoiceRealCallEvidenceRuntimeSurfaceEvidenceOptions | readonly VoiceRealCallEvidenceRuntimeSurfaceEvidenceOptions[] | ((options: VoiceRealCallEvidenceRuntimeCollectOptions) => Promise<VoiceRealCallEvidenceRuntimeSurfaceEvidenceOptions | readonly VoiceRealCallEvidenceRuntimeSurfaceEvidenceOptions[] | undefined> | VoiceRealCallEvidenceRuntimeSurfaceEvidenceOptions | readonly VoiceRealCallEvidenceRuntimeSurfaceEvidenceOptions[] | undefined);
|
|
261
|
+
export type VoiceRealCallEvidenceRuntimeProviderRoleEvidenceSource = VoiceRealCallEvidenceRuntimeProviderRoleEvidenceOptions | readonly VoiceRealCallEvidenceRuntimeProviderRoleEvidenceOptions[] | ((options: VoiceRealCallEvidenceRuntimeCollectOptions) => Promise<VoiceRealCallEvidenceRuntimeProviderRoleEvidenceOptions | readonly VoiceRealCallEvidenceRuntimeProviderRoleEvidenceOptions[] | undefined> | VoiceRealCallEvidenceRuntimeProviderRoleEvidenceOptions | readonly VoiceRealCallEvidenceRuntimeProviderRoleEvidenceOptions[] | undefined);
|
|
248
262
|
export type VoiceRealCallEvidenceRuntimeOptions = VoiceRealCallEvidenceRuntimeSourceOptions & {
|
|
249
263
|
dedupe?: boolean;
|
|
250
264
|
now?: () => Date;
|
|
@@ -764,6 +778,17 @@ export declare const loadVoiceRealCallProfileEvidenceFromTraceStore: (options: V
|
|
|
764
778
|
export declare const loadVoiceRealCallProfileEvidenceFromStore: (options: VoiceRealCallProfileEvidenceListOptions & {
|
|
765
779
|
store: VoiceRealCallProfileEvidenceStore;
|
|
766
780
|
}) => Promise<VoiceRealCallProfileEvidenceRecord[]>;
|
|
781
|
+
export declare const buildVoiceRealCallProfileEvidenceFromRuntimeSurface: (input: VoiceRealCallEvidenceRuntimeSurfaceEvidenceOptions | readonly VoiceRealCallEvidenceRuntimeSurfaceEvidenceOptions[], options: {
|
|
782
|
+
defaultProfileId: string;
|
|
783
|
+
defaultSessionPrefix: string;
|
|
784
|
+
defaultSurfaces: readonly string[];
|
|
785
|
+
now?: () => Date;
|
|
786
|
+
}) => VoiceProofTrendRealCallProfileEvidence[];
|
|
787
|
+
export declare const buildVoiceRealCallProfileEvidenceFromRuntimeProviderRoles: (input: VoiceRealCallEvidenceRuntimeProviderRoleEvidenceOptions | readonly VoiceRealCallEvidenceRuntimeProviderRoleEvidenceOptions[], options?: {
|
|
788
|
+
defaultProfileId?: string;
|
|
789
|
+
defaultSessionPrefix?: string;
|
|
790
|
+
now?: () => Date;
|
|
791
|
+
}) => VoiceProofTrendRealCallProfileEvidence[];
|
|
767
792
|
export declare const createVoiceRealCallEvidenceRuntime: (options: VoiceRealCallEvidenceRuntimeOptions) => VoiceRealCallEvidenceRuntime;
|
|
768
793
|
export declare const buildVoiceRealCallEvidenceRuntimeReadinessCheck: (report: VoiceRealCallEvidenceRuntimeReport, options?: VoiceRealCallEvidenceRuntimeReadinessCheckOptions) => VoiceProductionReadinessCheck;
|
|
769
794
|
export declare const createVoiceRealCallEvidenceRuntimeWorker: (options: VoiceRealCallEvidenceRuntimeWorkerOptions) => VoiceRealCallEvidenceRuntimeWorker;
|
package/dist/react/index.js
CHANGED
|
@@ -3769,7 +3769,38 @@ var resolveRealCallEvidenceRuntimeReconnectReports = async (reports, options) =>
|
|
|
3769
3769
|
}
|
|
3770
3770
|
return Array.isArray(resolved) ? resolved : [resolved];
|
|
3771
3771
|
};
|
|
3772
|
+
var resolveRealCallEvidenceRuntimeSurfaceEvidence = async (source, options) => {
|
|
3773
|
+
const resolved = typeof source === "function" ? await source(options) : source;
|
|
3774
|
+
if (!resolved) {
|
|
3775
|
+
return [];
|
|
3776
|
+
}
|
|
3777
|
+
return Array.isArray(resolved) ? [...resolved] : [resolved];
|
|
3778
|
+
};
|
|
3779
|
+
var createRealCallEvidenceRuntimeSessionId = (prefix, generatedAt) => `${prefix}-${Date.parse(generatedAt) || Date.now()}-${Math.random().toString(36).slice(2, 8)}`;
|
|
3780
|
+
var buildVoiceRealCallProfileEvidenceFromRuntimeSurface = (input, options) => {
|
|
3781
|
+
const evidence = Array.isArray(input) ? input : [input];
|
|
3782
|
+
return evidence.map((item) => {
|
|
3783
|
+
const generatedAt = item.generatedAt ?? (options.now ?? (() => new Date))().toISOString();
|
|
3784
|
+
return {
|
|
3785
|
+
...item,
|
|
3786
|
+
generatedAt,
|
|
3787
|
+
profileId: item.profileId ?? options.defaultProfileId,
|
|
3788
|
+
providers: item.providers ? [...item.providers] : undefined,
|
|
3789
|
+
sessionId: item.sessionId ?? createRealCallEvidenceRuntimeSessionId(options.defaultSessionPrefix, generatedAt),
|
|
3790
|
+
surfaces: [
|
|
3791
|
+
...new Set([...item.surfaces ?? [], ...options.defaultSurfaces])
|
|
3792
|
+
].sort()
|
|
3793
|
+
};
|
|
3794
|
+
});
|
|
3795
|
+
};
|
|
3796
|
+
var buildVoiceRealCallProfileEvidenceFromRuntimeProviderRoles = (input, options = {}) => buildVoiceRealCallProfileEvidenceFromRuntimeSurface(input, {
|
|
3797
|
+
defaultProfileId: options.defaultProfileId ?? "provider-role-evidence",
|
|
3798
|
+
defaultSessionPrefix: options.defaultSessionPrefix ?? "provider-role-evidence",
|
|
3799
|
+
defaultSurfaces: ["provider-path"],
|
|
3800
|
+
now: options.now
|
|
3801
|
+
});
|
|
3772
3802
|
var mergeRealCallEvidenceRuntimeOptions = (base, override = {}) => ({
|
|
3803
|
+
browserEvidence: override.browserEvidence ?? base.browserEvidence,
|
|
3773
3804
|
dedupe: override.dedupe ?? base.dedupe,
|
|
3774
3805
|
evidenceStore: override.evidenceStore ?? base.evidenceStore,
|
|
3775
3806
|
existingEvidenceLimit: override.existingEvidenceLimit ?? base.existingEvidenceLimit,
|
|
@@ -3778,6 +3809,8 @@ var mergeRealCallEvidenceRuntimeOptions = (base, override = {}) => ({
|
|
|
3778
3809
|
...override.history ?? {}
|
|
3779
3810
|
},
|
|
3780
3811
|
now: override.now ?? base.now,
|
|
3812
|
+
phoneEvidence: override.phoneEvidence ?? base.phoneEvidence,
|
|
3813
|
+
providerRoleEvidence: override.providerRoleEvidence ?? base.providerRoleEvidence,
|
|
3781
3814
|
reconnectEvidence: {
|
|
3782
3815
|
...base.reconnectEvidence ?? {},
|
|
3783
3816
|
...override.reconnectEvidence ?? {}
|
|
@@ -3826,6 +3859,30 @@ var buildRealCallEvidenceRuntimeReport = async (options, input = {}) => {
|
|
|
3826
3859
|
};
|
|
3827
3860
|
var collectVoiceRealCallEvidenceRuntimeEvidence = async (options) => {
|
|
3828
3861
|
const evidence = [];
|
|
3862
|
+
const browserEvidence = await resolveRealCallEvidenceRuntimeSurfaceEvidence(options.browserEvidence, options);
|
|
3863
|
+
if (browserEvidence.length > 0) {
|
|
3864
|
+
evidence.push(...buildVoiceRealCallProfileEvidenceFromRuntimeSurface(browserEvidence, {
|
|
3865
|
+
defaultProfileId: "browser-call",
|
|
3866
|
+
defaultSessionPrefix: "browser-call",
|
|
3867
|
+
defaultSurfaces: ["browser"],
|
|
3868
|
+
now: options.now
|
|
3869
|
+
}));
|
|
3870
|
+
}
|
|
3871
|
+
const phoneEvidence = await resolveRealCallEvidenceRuntimeSurfaceEvidence(options.phoneEvidence, options);
|
|
3872
|
+
if (phoneEvidence.length > 0) {
|
|
3873
|
+
evidence.push(...buildVoiceRealCallProfileEvidenceFromRuntimeSurface(phoneEvidence, {
|
|
3874
|
+
defaultProfileId: "phone-agent",
|
|
3875
|
+
defaultSessionPrefix: "phone-agent",
|
|
3876
|
+
defaultSurfaces: ["phone", "telephony"],
|
|
3877
|
+
now: options.now
|
|
3878
|
+
}));
|
|
3879
|
+
}
|
|
3880
|
+
const providerRoleEvidence = await resolveRealCallEvidenceRuntimeSurfaceEvidence(options.providerRoleEvidence, options);
|
|
3881
|
+
if (providerRoleEvidence.length > 0) {
|
|
3882
|
+
evidence.push(...buildVoiceRealCallProfileEvidenceFromRuntimeProviderRoles(providerRoleEvidence, {
|
|
3883
|
+
now: options.now
|
|
3884
|
+
}));
|
|
3885
|
+
}
|
|
3829
3886
|
if (options.traceStore) {
|
|
3830
3887
|
evidence.push(...buildVoiceRealCallProfileEvidenceFromTraceEvents(await options.traceStore.list({
|
|
3831
3888
|
limit: options.traceEvidence?.limit ?? 5000
|
|
@@ -51,6 +51,45 @@ export type VoiceSessionObservabilityReport = {
|
|
|
51
51
|
};
|
|
52
52
|
turns: VoiceSessionObservabilityTurn[];
|
|
53
53
|
};
|
|
54
|
+
export type VoiceSessionObservabilityEvidenceStatus = "pass" | "warn" | "fail";
|
|
55
|
+
export type VoiceSessionObservabilityEvidenceInput = {
|
|
56
|
+
requireHealthy?: boolean;
|
|
57
|
+
minStageCount?: number;
|
|
58
|
+
minTurns?: number;
|
|
59
|
+
minTurnWaterfalls?: number;
|
|
60
|
+
minProviderDecisions?: number;
|
|
61
|
+
minToolCalls?: number;
|
|
62
|
+
requireOperationsRecordLink?: boolean;
|
|
63
|
+
requireTraceTimelineLink?: boolean;
|
|
64
|
+
requireCallDebuggerLink?: boolean;
|
|
65
|
+
requireIncidentMarkdownLink?: boolean;
|
|
66
|
+
requireIncidentMarkdown?: boolean;
|
|
67
|
+
maxErrors?: number;
|
|
68
|
+
maxFallbacks?: number;
|
|
69
|
+
requireProviderRecoveryStatus?: VoiceOperationsRecord["providerDecisionSummary"]["recoveryStatus"] | readonly VoiceOperationsRecord["providerDecisionSummary"]["recoveryStatus"][];
|
|
70
|
+
};
|
|
71
|
+
export type VoiceSessionObservabilityEvidenceReport = {
|
|
72
|
+
checkedAt: number;
|
|
73
|
+
issues: string[];
|
|
74
|
+
ok: boolean;
|
|
75
|
+
status: VoiceSessionObservabilityEvidenceStatus;
|
|
76
|
+
summary: {
|
|
77
|
+
incidentMarkdownLength: number;
|
|
78
|
+
providerDecisions: number;
|
|
79
|
+
providerRecoveryStatus: VoiceOperationsRecord["providerDecisionSummary"]["recoveryStatus"];
|
|
80
|
+
reportStatus: VoiceSessionObservabilityStatus;
|
|
81
|
+
stages: number;
|
|
82
|
+
turns: number;
|
|
83
|
+
turnsWithWaterfalls: number;
|
|
84
|
+
toolCalls: number;
|
|
85
|
+
links: {
|
|
86
|
+
callDebugger: boolean;
|
|
87
|
+
incidentMarkdown: boolean;
|
|
88
|
+
operationsRecord: boolean;
|
|
89
|
+
traceTimeline: boolean;
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
};
|
|
54
93
|
export type VoiceSessionObservabilityReportOptions = Omit<VoiceOperationsRecordOptions, "sessionId"> & {
|
|
55
94
|
callDebuggerHref?: false | string | ((sessionId: string) => string);
|
|
56
95
|
customLinks?: readonly VoiceSessionObservabilityLink[];
|
|
@@ -74,6 +113,8 @@ export declare const renderVoiceSessionObservabilityMarkdown: (report: VoiceSess
|
|
|
74
113
|
export declare const renderVoiceSessionObservabilityHTML: (report: VoiceSessionObservabilityReport, options?: {
|
|
75
114
|
title?: string;
|
|
76
115
|
}) => string;
|
|
116
|
+
export declare const evaluateVoiceSessionObservabilityEvidence: (report: VoiceSessionObservabilityReport, input?: VoiceSessionObservabilityEvidenceInput) => VoiceSessionObservabilityEvidenceReport;
|
|
117
|
+
export declare const assertVoiceSessionObservabilityEvidence: (report: VoiceSessionObservabilityReport, input?: VoiceSessionObservabilityEvidenceInput) => VoiceSessionObservabilityEvidenceReport;
|
|
77
118
|
export declare const createVoiceSessionObservabilityRoutes: (options: VoiceSessionObservabilityRoutesOptions) => Elysia<"", {
|
|
78
119
|
decorator: {};
|
|
79
120
|
store: {};
|
package/dist/vue/index.js
CHANGED
|
@@ -3690,7 +3690,38 @@ var resolveRealCallEvidenceRuntimeReconnectReports = async (reports, options) =>
|
|
|
3690
3690
|
}
|
|
3691
3691
|
return Array.isArray(resolved) ? resolved : [resolved];
|
|
3692
3692
|
};
|
|
3693
|
+
var resolveRealCallEvidenceRuntimeSurfaceEvidence = async (source, options) => {
|
|
3694
|
+
const resolved = typeof source === "function" ? await source(options) : source;
|
|
3695
|
+
if (!resolved) {
|
|
3696
|
+
return [];
|
|
3697
|
+
}
|
|
3698
|
+
return Array.isArray(resolved) ? [...resolved] : [resolved];
|
|
3699
|
+
};
|
|
3700
|
+
var createRealCallEvidenceRuntimeSessionId = (prefix, generatedAt) => `${prefix}-${Date.parse(generatedAt) || Date.now()}-${Math.random().toString(36).slice(2, 8)}`;
|
|
3701
|
+
var buildVoiceRealCallProfileEvidenceFromRuntimeSurface = (input, options) => {
|
|
3702
|
+
const evidence = Array.isArray(input) ? input : [input];
|
|
3703
|
+
return evidence.map((item) => {
|
|
3704
|
+
const generatedAt = item.generatedAt ?? (options.now ?? (() => new Date))().toISOString();
|
|
3705
|
+
return {
|
|
3706
|
+
...item,
|
|
3707
|
+
generatedAt,
|
|
3708
|
+
profileId: item.profileId ?? options.defaultProfileId,
|
|
3709
|
+
providers: item.providers ? [...item.providers] : undefined,
|
|
3710
|
+
sessionId: item.sessionId ?? createRealCallEvidenceRuntimeSessionId(options.defaultSessionPrefix, generatedAt),
|
|
3711
|
+
surfaces: [
|
|
3712
|
+
...new Set([...item.surfaces ?? [], ...options.defaultSurfaces])
|
|
3713
|
+
].sort()
|
|
3714
|
+
};
|
|
3715
|
+
});
|
|
3716
|
+
};
|
|
3717
|
+
var buildVoiceRealCallProfileEvidenceFromRuntimeProviderRoles = (input, options = {}) => buildVoiceRealCallProfileEvidenceFromRuntimeSurface(input, {
|
|
3718
|
+
defaultProfileId: options.defaultProfileId ?? "provider-role-evidence",
|
|
3719
|
+
defaultSessionPrefix: options.defaultSessionPrefix ?? "provider-role-evidence",
|
|
3720
|
+
defaultSurfaces: ["provider-path"],
|
|
3721
|
+
now: options.now
|
|
3722
|
+
});
|
|
3693
3723
|
var mergeRealCallEvidenceRuntimeOptions = (base, override = {}) => ({
|
|
3724
|
+
browserEvidence: override.browserEvidence ?? base.browserEvidence,
|
|
3694
3725
|
dedupe: override.dedupe ?? base.dedupe,
|
|
3695
3726
|
evidenceStore: override.evidenceStore ?? base.evidenceStore,
|
|
3696
3727
|
existingEvidenceLimit: override.existingEvidenceLimit ?? base.existingEvidenceLimit,
|
|
@@ -3699,6 +3730,8 @@ var mergeRealCallEvidenceRuntimeOptions = (base, override = {}) => ({
|
|
|
3699
3730
|
...override.history ?? {}
|
|
3700
3731
|
},
|
|
3701
3732
|
now: override.now ?? base.now,
|
|
3733
|
+
phoneEvidence: override.phoneEvidence ?? base.phoneEvidence,
|
|
3734
|
+
providerRoleEvidence: override.providerRoleEvidence ?? base.providerRoleEvidence,
|
|
3702
3735
|
reconnectEvidence: {
|
|
3703
3736
|
...base.reconnectEvidence ?? {},
|
|
3704
3737
|
...override.reconnectEvidence ?? {}
|
|
@@ -3747,6 +3780,30 @@ var buildRealCallEvidenceRuntimeReport = async (options, input = {}) => {
|
|
|
3747
3780
|
};
|
|
3748
3781
|
var collectVoiceRealCallEvidenceRuntimeEvidence = async (options) => {
|
|
3749
3782
|
const evidence = [];
|
|
3783
|
+
const browserEvidence = await resolveRealCallEvidenceRuntimeSurfaceEvidence(options.browserEvidence, options);
|
|
3784
|
+
if (browserEvidence.length > 0) {
|
|
3785
|
+
evidence.push(...buildVoiceRealCallProfileEvidenceFromRuntimeSurface(browserEvidence, {
|
|
3786
|
+
defaultProfileId: "browser-call",
|
|
3787
|
+
defaultSessionPrefix: "browser-call",
|
|
3788
|
+
defaultSurfaces: ["browser"],
|
|
3789
|
+
now: options.now
|
|
3790
|
+
}));
|
|
3791
|
+
}
|
|
3792
|
+
const phoneEvidence = await resolveRealCallEvidenceRuntimeSurfaceEvidence(options.phoneEvidence, options);
|
|
3793
|
+
if (phoneEvidence.length > 0) {
|
|
3794
|
+
evidence.push(...buildVoiceRealCallProfileEvidenceFromRuntimeSurface(phoneEvidence, {
|
|
3795
|
+
defaultProfileId: "phone-agent",
|
|
3796
|
+
defaultSessionPrefix: "phone-agent",
|
|
3797
|
+
defaultSurfaces: ["phone", "telephony"],
|
|
3798
|
+
now: options.now
|
|
3799
|
+
}));
|
|
3800
|
+
}
|
|
3801
|
+
const providerRoleEvidence = await resolveRealCallEvidenceRuntimeSurfaceEvidence(options.providerRoleEvidence, options);
|
|
3802
|
+
if (providerRoleEvidence.length > 0) {
|
|
3803
|
+
evidence.push(...buildVoiceRealCallProfileEvidenceFromRuntimeProviderRoles(providerRoleEvidence, {
|
|
3804
|
+
now: options.now
|
|
3805
|
+
}));
|
|
3806
|
+
}
|
|
3750
3807
|
if (options.traceStore) {
|
|
3751
3808
|
evidence.push(...buildVoiceRealCallProfileEvidenceFromTraceEvents(await options.traceStore.list({
|
|
3752
3809
|
limit: options.traceEvidence?.limit ?? 5000
|
|
@@ -71,6 +71,7 @@ export declare const useVoiceReadinessFailures: (path?: string, options?: VoiceR
|
|
|
71
71
|
readonly resilience?: string | undefined;
|
|
72
72
|
readonly sessions?: string | undefined;
|
|
73
73
|
readonly sloReadinessThresholds?: string | undefined;
|
|
74
|
+
readonly sessionObservability?: string | undefined;
|
|
74
75
|
readonly traceDeliveries?: string | undefined;
|
|
75
76
|
};
|
|
76
77
|
readonly profile?: {
|
|
@@ -445,6 +446,13 @@ export declare const useVoiceReadinessFailures: (path?: string, options?: VoiceR
|
|
|
445
446
|
readonly status: import("..").VoiceProductionReadinessStatus;
|
|
446
447
|
readonly total: number;
|
|
447
448
|
} | undefined;
|
|
449
|
+
readonly sessionObservability?: {
|
|
450
|
+
readonly failed: number;
|
|
451
|
+
readonly passed: number;
|
|
452
|
+
readonly status: import("..").VoiceProductionReadinessStatus;
|
|
453
|
+
readonly total: number;
|
|
454
|
+
readonly warnings: number;
|
|
455
|
+
} | undefined;
|
|
448
456
|
readonly quality: {
|
|
449
457
|
readonly status: "fail" | "pass";
|
|
450
458
|
};
|
|
@@ -538,6 +546,7 @@ export declare const useVoiceReadinessFailures: (path?: string, options?: VoiceR
|
|
|
538
546
|
readonly resilience?: string | undefined;
|
|
539
547
|
readonly sessions?: string | undefined;
|
|
540
548
|
readonly sloReadinessThresholds?: string | undefined;
|
|
549
|
+
readonly sessionObservability?: string | undefined;
|
|
541
550
|
readonly traceDeliveries?: string | undefined;
|
|
542
551
|
};
|
|
543
552
|
readonly profile?: {
|
|
@@ -912,6 +921,13 @@ export declare const useVoiceReadinessFailures: (path?: string, options?: VoiceR
|
|
|
912
921
|
readonly status: import("..").VoiceProductionReadinessStatus;
|
|
913
922
|
readonly total: number;
|
|
914
923
|
} | undefined;
|
|
924
|
+
readonly sessionObservability?: {
|
|
925
|
+
readonly failed: number;
|
|
926
|
+
readonly passed: number;
|
|
927
|
+
readonly status: import("..").VoiceProductionReadinessStatus;
|
|
928
|
+
readonly total: number;
|
|
929
|
+
readonly warnings: number;
|
|
930
|
+
} | undefined;
|
|
915
931
|
readonly quality: {
|
|
916
932
|
readonly status: "fail" | "pass";
|
|
917
933
|
};
|