@absolutejs/voice 0.0.22-beta.132 → 0.0.22-beta.134
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.js +67 -2
- package/dist/productionReadiness.d.ts +25 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -19483,6 +19483,18 @@ var resolvePhoneAgentSmokes = async (options, input) => {
|
|
|
19483
19483
|
}
|
|
19484
19484
|
return typeof options.phoneAgentSmokes === "function" ? await options.phoneAgentSmokes(input) : options.phoneAgentSmokes;
|
|
19485
19485
|
};
|
|
19486
|
+
var resolveReconnectContracts = async (options, input) => {
|
|
19487
|
+
if (options.reconnectContracts === false || options.reconnectContracts === undefined) {
|
|
19488
|
+
return;
|
|
19489
|
+
}
|
|
19490
|
+
return typeof options.reconnectContracts === "function" ? await options.reconnectContracts(input) : options.reconnectContracts;
|
|
19491
|
+
};
|
|
19492
|
+
var resolveBargeInReports = async (options, input) => {
|
|
19493
|
+
if (options.bargeInReports === false || options.bargeInReports === undefined) {
|
|
19494
|
+
return;
|
|
19495
|
+
}
|
|
19496
|
+
return typeof options.bargeInReports === "function" ? await options.bargeInReports(input) : options.bargeInReports;
|
|
19497
|
+
};
|
|
19486
19498
|
var defaultAuditRequirements = [
|
|
19487
19499
|
{
|
|
19488
19500
|
label: "Provider-call audit",
|
|
@@ -19640,7 +19652,9 @@ var buildVoiceProductionReadinessReport = async (options, input = {}) => {
|
|
|
19640
19652
|
carriers,
|
|
19641
19653
|
agentSquadContracts,
|
|
19642
19654
|
providerRoutingContracts,
|
|
19643
|
-
phoneAgentSmokes
|
|
19655
|
+
phoneAgentSmokes,
|
|
19656
|
+
reconnectContracts,
|
|
19657
|
+
bargeInReports
|
|
19644
19658
|
] = await Promise.all([
|
|
19645
19659
|
evaluateVoiceQuality({ events }),
|
|
19646
19660
|
Promise.all([
|
|
@@ -19665,7 +19679,9 @@ var buildVoiceProductionReadinessReport = async (options, input = {}) => {
|
|
|
19665
19679
|
resolveCarriers(options, { query, request }),
|
|
19666
19680
|
resolveAgentSquadContracts(options, { query, request }),
|
|
19667
19681
|
resolveProviderRoutingContracts(options, { query, request }),
|
|
19668
|
-
resolvePhoneAgentSmokes(options, { query, request })
|
|
19682
|
+
resolvePhoneAgentSmokes(options, { query, request }),
|
|
19683
|
+
resolveReconnectContracts(options, { query, request }),
|
|
19684
|
+
resolveBargeInReports(options, { query, request })
|
|
19669
19685
|
]);
|
|
19670
19686
|
const degradedProviders = providers.filter((provider) => provider.status === "degraded" || provider.status === "rate-limited" || provider.status === "suppressed").length;
|
|
19671
19687
|
const failedSessions = sessions.filter((session) => session.status === "failed").length;
|
|
@@ -19792,6 +19808,19 @@ var buildVoiceProductionReadinessReport = async (options, input = {}) => {
|
|
|
19792
19808
|
status: phoneAgentSmokes.some((report) => !report.pass) ? "fail" : phoneAgentSmokes.length === 0 ? "warn" : "pass",
|
|
19793
19809
|
total: phoneAgentSmokes.length
|
|
19794
19810
|
} : undefined;
|
|
19811
|
+
const reconnectContractSummary = reconnectContracts ? {
|
|
19812
|
+
failed: reconnectContracts.filter((report) => !report.pass).length,
|
|
19813
|
+
passed: reconnectContracts.filter((report) => report.pass).length,
|
|
19814
|
+
status: reconnectContracts.some((report) => !report.pass) ? "fail" : reconnectContracts.length === 0 ? "warn" : "pass",
|
|
19815
|
+
total: reconnectContracts.length
|
|
19816
|
+
} : undefined;
|
|
19817
|
+
const bargeInSummary = bargeInReports ? {
|
|
19818
|
+
failed: bargeInReports.reduce((total, report) => total + report.failed, 0),
|
|
19819
|
+
passed: bargeInReports.reduce((total, report) => total + report.passed, 0),
|
|
19820
|
+
status: bargeInReports.some((report) => report.status === "fail" || report.failed > 0) ? "fail" : bargeInReports.length === 0 || bargeInReports.some((report) => report.status === "empty" || report.status === "warn" || report.total === 0) ? "warn" : "pass",
|
|
19821
|
+
total: bargeInReports.reduce((total, report) => total + report.total, 0),
|
|
19822
|
+
warnings: bargeInReports.filter((report) => report.status === "warn").length
|
|
19823
|
+
} : undefined;
|
|
19795
19824
|
if (agentSquadContractSummary) {
|
|
19796
19825
|
checks.push({
|
|
19797
19826
|
detail: agentSquadContractSummary.status === "pass" ? `${agentSquadContractSummary.passed} agent squad contract(s) are passing.` : agentSquadContractSummary.total === 0 ? "No agent squad contracts are configured." : `${agentSquadContractSummary.failed} agent squad contract(s) failed.`,
|
|
@@ -19840,6 +19869,38 @@ var buildVoiceProductionReadinessReport = async (options, input = {}) => {
|
|
|
19840
19869
|
]
|
|
19841
19870
|
});
|
|
19842
19871
|
}
|
|
19872
|
+
if (reconnectContractSummary) {
|
|
19873
|
+
checks.push({
|
|
19874
|
+
detail: reconnectContractSummary.status === "pass" ? `${reconnectContractSummary.passed} reconnect contract(s) are passing.` : reconnectContractSummary.total === 0 ? "No reconnect contracts are configured." : `${reconnectContractSummary.failed} reconnect contract(s) failed.`,
|
|
19875
|
+
href: options.links?.reconnectContracts ?? options.links?.sessions ?? "/sessions",
|
|
19876
|
+
label: "Reconnect recovery contracts",
|
|
19877
|
+
status: reconnectContractSummary.status,
|
|
19878
|
+
value: `${reconnectContractSummary.passed}/${reconnectContractSummary.total}`,
|
|
19879
|
+
actions: reconnectContractSummary.status === "pass" ? [] : [
|
|
19880
|
+
{
|
|
19881
|
+
description: "Open reconnect proof and inspect disconnect, resume, and replay-safe turn state evidence.",
|
|
19882
|
+
href: options.links?.reconnectContracts ?? options.links?.sessions ?? "/sessions",
|
|
19883
|
+
label: "Open reconnect proof"
|
|
19884
|
+
}
|
|
19885
|
+
]
|
|
19886
|
+
});
|
|
19887
|
+
}
|
|
19888
|
+
if (bargeInSummary) {
|
|
19889
|
+
checks.push({
|
|
19890
|
+
detail: bargeInSummary.status === "pass" ? `${bargeInSummary.passed} barge-in interruption(s) stopped within threshold.` : bargeInSummary.total === 0 ? "No barge-in interruption proof is recorded yet." : bargeInSummary.status === "fail" ? `${bargeInSummary.failed} barge-in interruption(s) exceeded threshold.` : `${bargeInSummary.warnings} barge-in proof report(s) have warnings.`,
|
|
19891
|
+
href: options.links?.bargeIn ?? "/barge-in",
|
|
19892
|
+
label: "Barge-in interruption proof",
|
|
19893
|
+
status: bargeInSummary.status,
|
|
19894
|
+
value: `${bargeInSummary.passed}/${bargeInSummary.total}`,
|
|
19895
|
+
actions: bargeInSummary.status === "pass" ? [] : [
|
|
19896
|
+
{
|
|
19897
|
+
description: "Open barge-in proof and confirm assistant speech stops when the caller interrupts.",
|
|
19898
|
+
href: options.links?.bargeIn ?? "/barge-in",
|
|
19899
|
+
label: "Open barge-in proof"
|
|
19900
|
+
}
|
|
19901
|
+
]
|
|
19902
|
+
});
|
|
19903
|
+
}
|
|
19843
19904
|
if (audit) {
|
|
19844
19905
|
const missingLabels = audit.missing.map((requirement) => requirement.label ?? requirement.type);
|
|
19845
19906
|
checks.push({
|
|
@@ -19912,6 +19973,7 @@ var buildVoiceProductionReadinessReport = async (options, input = {}) => {
|
|
|
19912
19973
|
agentSquadContracts: "/agent-squad-contract",
|
|
19913
19974
|
audit: "/audit",
|
|
19914
19975
|
auditDeliveries: "/audit",
|
|
19976
|
+
bargeIn: "/barge-in",
|
|
19915
19977
|
carriers: "/carriers",
|
|
19916
19978
|
handoffs: "/handoffs",
|
|
19917
19979
|
handoffRetry: "/api/voice-handoffs/retry",
|
|
@@ -19919,6 +19981,7 @@ var buildVoiceProductionReadinessReport = async (options, input = {}) => {
|
|
|
19919
19981
|
phoneAgentSmoke: "/sessions",
|
|
19920
19982
|
providerRoutingContracts: "/resilience",
|
|
19921
19983
|
quality: "/quality",
|
|
19984
|
+
reconnectContracts: "/sessions",
|
|
19922
19985
|
resilience: "/resilience",
|
|
19923
19986
|
sessions: "/sessions",
|
|
19924
19987
|
traceDeliveries: "/traces/deliveries",
|
|
@@ -19929,6 +19992,7 @@ var buildVoiceProductionReadinessReport = async (options, input = {}) => {
|
|
|
19929
19992
|
agentSquadContracts: agentSquadContractSummary,
|
|
19930
19993
|
audit,
|
|
19931
19994
|
auditDeliveries,
|
|
19995
|
+
bargeIn: bargeInSummary,
|
|
19932
19996
|
carriers: carrierSummary,
|
|
19933
19997
|
handoffs: {
|
|
19934
19998
|
failed: handoffs.failed,
|
|
@@ -19941,6 +20005,7 @@ var buildVoiceProductionReadinessReport = async (options, input = {}) => {
|
|
|
19941
20005
|
},
|
|
19942
20006
|
phoneAgentSmokes: phoneAgentSmokeSummary,
|
|
19943
20007
|
providerRoutingContracts: providerRoutingContractSummary,
|
|
20008
|
+
reconnectContracts: reconnectContractSummary,
|
|
19944
20009
|
quality: {
|
|
19945
20010
|
status: quality.status
|
|
19946
20011
|
},
|
|
@@ -3,8 +3,10 @@ import { type VoiceTelephonyCarrierMatrixInput } from './telephony/matrix';
|
|
|
3
3
|
import type { VoiceTraceEventStore } from './trace';
|
|
4
4
|
import type { VoiceTraceSinkDeliveryStore } from './trace';
|
|
5
5
|
import type { VoiceAgentSquadContractReport } from './agentSquadContract';
|
|
6
|
+
import type { VoiceBargeInReport } from './bargeInRoutes';
|
|
6
7
|
import type { VoiceProviderRoutingContractReport } from './providerRoutingContract';
|
|
7
8
|
import type { VoicePhoneAgentProductionSmokeReport } from './phoneAgentProductionSmoke';
|
|
9
|
+
import type { VoiceReconnectContractReport } from './reconnectContract';
|
|
8
10
|
import type { VoiceAuditEventStore, VoiceAuditEventType, VoiceAuditOutcome } from './audit';
|
|
9
11
|
import { type VoiceAuditSinkDeliveryStore } from './auditSinks';
|
|
10
12
|
export type VoiceProductionReadinessStatus = 'fail' | 'pass' | 'warn';
|
|
@@ -29,6 +31,7 @@ export type VoiceProductionReadinessReport = {
|
|
|
29
31
|
agentSquadContracts?: string;
|
|
30
32
|
audit?: string;
|
|
31
33
|
auditDeliveries?: string;
|
|
34
|
+
bargeIn?: string;
|
|
32
35
|
carriers?: string;
|
|
33
36
|
handoffs?: string;
|
|
34
37
|
handoffRetry?: string;
|
|
@@ -36,6 +39,7 @@ export type VoiceProductionReadinessReport = {
|
|
|
36
39
|
phoneAgentSmoke?: string;
|
|
37
40
|
providerRoutingContracts?: string;
|
|
38
41
|
quality?: string;
|
|
42
|
+
reconnectContracts?: string;
|
|
39
43
|
resilience?: string;
|
|
40
44
|
sessions?: string;
|
|
41
45
|
traceDeliveries?: string;
|
|
@@ -50,6 +54,13 @@ export type VoiceProductionReadinessReport = {
|
|
|
50
54
|
};
|
|
51
55
|
audit?: VoiceProductionReadinessAuditSummary;
|
|
52
56
|
auditDeliveries?: VoiceProductionReadinessAuditDeliverySummary;
|
|
57
|
+
bargeIn?: {
|
|
58
|
+
failed: number;
|
|
59
|
+
passed: number;
|
|
60
|
+
status: VoiceProductionReadinessStatus;
|
|
61
|
+
total: number;
|
|
62
|
+
warnings: number;
|
|
63
|
+
};
|
|
53
64
|
carriers?: {
|
|
54
65
|
failing: number;
|
|
55
66
|
providers: number;
|
|
@@ -84,6 +95,12 @@ export type VoiceProductionReadinessReport = {
|
|
|
84
95
|
status: VoiceProductionReadinessStatus;
|
|
85
96
|
total: number;
|
|
86
97
|
};
|
|
98
|
+
reconnectContracts?: {
|
|
99
|
+
failed: number;
|
|
100
|
+
passed: number;
|
|
101
|
+
status: VoiceProductionReadinessStatus;
|
|
102
|
+
total: number;
|
|
103
|
+
};
|
|
87
104
|
quality: {
|
|
88
105
|
status: 'fail' | 'pass';
|
|
89
106
|
};
|
|
@@ -163,6 +180,10 @@ export type VoiceProductionReadinessRoutesOptions = {
|
|
|
163
180
|
}) => Promise<readonly VoiceAgentSquadContractReport[]> | readonly VoiceAgentSquadContractReport[]);
|
|
164
181
|
audit?: false | VoiceProductionReadinessAuditOptions;
|
|
165
182
|
auditDeliveries?: false | VoiceProductionReadinessAuditDeliveryOptions;
|
|
183
|
+
bargeInReports?: false | readonly VoiceBargeInReport[] | ((input: {
|
|
184
|
+
query: Record<string, unknown>;
|
|
185
|
+
request: Request;
|
|
186
|
+
}) => Promise<readonly VoiceBargeInReport[]> | readonly VoiceBargeInReport[]);
|
|
166
187
|
carriers?: false | readonly VoiceTelephonyCarrierMatrixInput[] | ((input: {
|
|
167
188
|
query: Record<string, unknown>;
|
|
168
189
|
request: Request;
|
|
@@ -181,6 +202,10 @@ export type VoiceProductionReadinessRoutesOptions = {
|
|
|
181
202
|
query: Record<string, unknown>;
|
|
182
203
|
request: Request;
|
|
183
204
|
}) => Promise<readonly VoiceProviderRoutingContractReport[]> | readonly VoiceProviderRoutingContractReport[]);
|
|
205
|
+
reconnectContracts?: false | readonly VoiceReconnectContractReport[] | ((input: {
|
|
206
|
+
query: Record<string, unknown>;
|
|
207
|
+
request: Request;
|
|
208
|
+
}) => Promise<readonly VoiceReconnectContractReport[]> | readonly VoiceReconnectContractReport[]);
|
|
184
209
|
render?: (report: VoiceProductionReadinessReport) => string | Promise<string>;
|
|
185
210
|
store: VoiceTraceEventStore;
|
|
186
211
|
sttProviders?: readonly string[];
|