@absolutejs/voice 0.0.22-beta.133 → 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 +35 -2
- package/dist/productionReadiness.d.ts +13 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -19489,6 +19489,12 @@ var resolveReconnectContracts = async (options, input) => {
|
|
|
19489
19489
|
}
|
|
19490
19490
|
return typeof options.reconnectContracts === "function" ? await options.reconnectContracts(input) : options.reconnectContracts;
|
|
19491
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
|
+
};
|
|
19492
19498
|
var defaultAuditRequirements = [
|
|
19493
19499
|
{
|
|
19494
19500
|
label: "Provider-call audit",
|
|
@@ -19647,7 +19653,8 @@ var buildVoiceProductionReadinessReport = async (options, input = {}) => {
|
|
|
19647
19653
|
agentSquadContracts,
|
|
19648
19654
|
providerRoutingContracts,
|
|
19649
19655
|
phoneAgentSmokes,
|
|
19650
|
-
reconnectContracts
|
|
19656
|
+
reconnectContracts,
|
|
19657
|
+
bargeInReports
|
|
19651
19658
|
] = await Promise.all([
|
|
19652
19659
|
evaluateVoiceQuality({ events }),
|
|
19653
19660
|
Promise.all([
|
|
@@ -19673,7 +19680,8 @@ var buildVoiceProductionReadinessReport = async (options, input = {}) => {
|
|
|
19673
19680
|
resolveAgentSquadContracts(options, { query, request }),
|
|
19674
19681
|
resolveProviderRoutingContracts(options, { query, request }),
|
|
19675
19682
|
resolvePhoneAgentSmokes(options, { query, request }),
|
|
19676
|
-
resolveReconnectContracts(options, { query, request })
|
|
19683
|
+
resolveReconnectContracts(options, { query, request }),
|
|
19684
|
+
resolveBargeInReports(options, { query, request })
|
|
19677
19685
|
]);
|
|
19678
19686
|
const degradedProviders = providers.filter((provider) => provider.status === "degraded" || provider.status === "rate-limited" || provider.status === "suppressed").length;
|
|
19679
19687
|
const failedSessions = sessions.filter((session) => session.status === "failed").length;
|
|
@@ -19806,6 +19814,13 @@ var buildVoiceProductionReadinessReport = async (options, input = {}) => {
|
|
|
19806
19814
|
status: reconnectContracts.some((report) => !report.pass) ? "fail" : reconnectContracts.length === 0 ? "warn" : "pass",
|
|
19807
19815
|
total: reconnectContracts.length
|
|
19808
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;
|
|
19809
19824
|
if (agentSquadContractSummary) {
|
|
19810
19825
|
checks.push({
|
|
19811
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.`,
|
|
@@ -19870,6 +19885,22 @@ var buildVoiceProductionReadinessReport = async (options, input = {}) => {
|
|
|
19870
19885
|
]
|
|
19871
19886
|
});
|
|
19872
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
|
+
}
|
|
19873
19904
|
if (audit) {
|
|
19874
19905
|
const missingLabels = audit.missing.map((requirement) => requirement.label ?? requirement.type);
|
|
19875
19906
|
checks.push({
|
|
@@ -19942,6 +19973,7 @@ var buildVoiceProductionReadinessReport = async (options, input = {}) => {
|
|
|
19942
19973
|
agentSquadContracts: "/agent-squad-contract",
|
|
19943
19974
|
audit: "/audit",
|
|
19944
19975
|
auditDeliveries: "/audit",
|
|
19976
|
+
bargeIn: "/barge-in",
|
|
19945
19977
|
carriers: "/carriers",
|
|
19946
19978
|
handoffs: "/handoffs",
|
|
19947
19979
|
handoffRetry: "/api/voice-handoffs/retry",
|
|
@@ -19960,6 +19992,7 @@ var buildVoiceProductionReadinessReport = async (options, input = {}) => {
|
|
|
19960
19992
|
agentSquadContracts: agentSquadContractSummary,
|
|
19961
19993
|
audit,
|
|
19962
19994
|
auditDeliveries,
|
|
19995
|
+
bargeIn: bargeInSummary,
|
|
19963
19996
|
carriers: carrierSummary,
|
|
19964
19997
|
handoffs: {
|
|
19965
19998
|
failed: handoffs.failed,
|
|
@@ -3,6 +3,7 @@ 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';
|
|
8
9
|
import type { VoiceReconnectContractReport } from './reconnectContract';
|
|
@@ -30,6 +31,7 @@ export type VoiceProductionReadinessReport = {
|
|
|
30
31
|
agentSquadContracts?: string;
|
|
31
32
|
audit?: string;
|
|
32
33
|
auditDeliveries?: string;
|
|
34
|
+
bargeIn?: string;
|
|
33
35
|
carriers?: string;
|
|
34
36
|
handoffs?: string;
|
|
35
37
|
handoffRetry?: string;
|
|
@@ -52,6 +54,13 @@ export type VoiceProductionReadinessReport = {
|
|
|
52
54
|
};
|
|
53
55
|
audit?: VoiceProductionReadinessAuditSummary;
|
|
54
56
|
auditDeliveries?: VoiceProductionReadinessAuditDeliverySummary;
|
|
57
|
+
bargeIn?: {
|
|
58
|
+
failed: number;
|
|
59
|
+
passed: number;
|
|
60
|
+
status: VoiceProductionReadinessStatus;
|
|
61
|
+
total: number;
|
|
62
|
+
warnings: number;
|
|
63
|
+
};
|
|
55
64
|
carriers?: {
|
|
56
65
|
failing: number;
|
|
57
66
|
providers: number;
|
|
@@ -171,6 +180,10 @@ export type VoiceProductionReadinessRoutesOptions = {
|
|
|
171
180
|
}) => Promise<readonly VoiceAgentSquadContractReport[]> | readonly VoiceAgentSquadContractReport[]);
|
|
172
181
|
audit?: false | VoiceProductionReadinessAuditOptions;
|
|
173
182
|
auditDeliveries?: false | VoiceProductionReadinessAuditDeliveryOptions;
|
|
183
|
+
bargeInReports?: false | readonly VoiceBargeInReport[] | ((input: {
|
|
184
|
+
query: Record<string, unknown>;
|
|
185
|
+
request: Request;
|
|
186
|
+
}) => Promise<readonly VoiceBargeInReport[]> | readonly VoiceBargeInReport[]);
|
|
174
187
|
carriers?: false | readonly VoiceTelephonyCarrierMatrixInput[] | ((input: {
|
|
175
188
|
query: Record<string, unknown>;
|
|
176
189
|
request: Request;
|