@absolutejs/voice 0.0.22-beta.157 → 0.0.22-beta.158
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 +2 -2
- package/dist/index.js +60 -0
- package/dist/productionReadiness.d.ts +25 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -44,7 +44,7 @@ export { createVoiceProviderHealthHTMLHandler, createVoiceProviderHealthJSONHand
|
|
|
44
44
|
export { createVoiceProviderCapabilityHTMLHandler, createVoiceProviderCapabilityJSONHandler, createVoiceProviderCapabilityRoutes, renderVoiceProviderCapabilityHTML, summarizeVoiceProviderCapabilities } from './providerCapabilities';
|
|
45
45
|
export { assertVoiceProviderRoutingContract, runVoiceProviderRoutingContract } from './providerRoutingContract';
|
|
46
46
|
export { createVoicePhoneAgentProductionSmokeHTMLHandler, createVoicePhoneAgentProductionSmokeJSONHandler, createVoicePhoneAgentProductionSmokeRoutes, renderVoicePhoneAgentProductionSmokeHTML, runVoicePhoneAgentProductionSmokeContract } from './phoneAgentProductionSmoke';
|
|
47
|
-
export { buildVoiceProductionReadinessReport, createVoiceProductionReadinessRoutes, renderVoiceProductionReadinessHTML } from './productionReadiness';
|
|
47
|
+
export { buildVoiceProductionReadinessGate, buildVoiceProductionReadinessReport, createVoiceProductionReadinessRoutes, renderVoiceProductionReadinessHTML, summarizeVoiceProductionReadinessGate } from './productionReadiness';
|
|
48
48
|
export { buildVoiceOpsConsoleReport, createVoiceOpsConsoleRoutes, renderVoiceOpsConsoleHTML } from './opsConsoleRoutes';
|
|
49
49
|
export { summarizeVoiceOpsStatus } from './opsStatus';
|
|
50
50
|
export { createVoiceOpsStatusRoutes, renderVoiceOpsStatusHTML } from './opsStatusRoutes';
|
|
@@ -102,7 +102,7 @@ export type { VoicePhoneAgentCarrier, VoicePhoneAgentCarrierSummary, VoicePhoneA
|
|
|
102
102
|
export type { VoicePhoneAgentProductionSmokeIssue, VoicePhoneAgentProductionSmokeHandlerOptions, VoicePhoneAgentProductionSmokeHTMLHandlerOptions, VoicePhoneAgentProductionSmokeOptions, VoicePhoneAgentProductionSmokeReport, VoicePhoneAgentProductionSmokeRoutesOptions, VoicePhoneAgentProductionSmokeRequirement } from './phoneAgentProductionSmoke';
|
|
103
103
|
export type { VoiceOpsConsoleLink, VoiceOpsConsoleReport, VoiceOpsConsoleRoutesOptions } from './opsConsoleRoutes';
|
|
104
104
|
export type { VoiceOpsStatus, VoiceOpsStatusLink, VoiceOpsStatusOptions, VoiceOpsStatusReport, VoiceOpsStatusRoutesOptions } from './opsStatus';
|
|
105
|
-
export type { VoiceProductionReadinessAction, VoiceProductionReadinessAuditOptions, VoiceProductionReadinessAuditRequirement, VoiceProductionReadinessAuditSummary, VoiceProductionReadinessCheck, VoiceProductionReadinessOpsActionHistoryOptions, VoiceProductionReadinessOpsActionHistorySummary, VoiceProductionReadinessProofSource, VoiceProductionReadinessReport, VoiceProductionReadinessRoutesOptions, VoiceProductionReadinessTraceDeliverySummary, VoiceProductionReadinessAuditDeliveryOptions, VoiceProductionReadinessAuditDeliverySummary, VoiceProductionReadinessTraceDeliveryOptions, VoiceProductionReadinessStatus } from './productionReadiness';
|
|
105
|
+
export type { VoiceProductionReadinessAction, VoiceProductionReadinessAuditOptions, VoiceProductionReadinessAuditRequirement, VoiceProductionReadinessAuditSummary, VoiceProductionReadinessCheck, VoiceProductionReadinessGateIssue, VoiceProductionReadinessGateOptions, VoiceProductionReadinessGateReport, VoiceProductionReadinessOpsActionHistoryOptions, VoiceProductionReadinessOpsActionHistorySummary, VoiceProductionReadinessProofSource, VoiceProductionReadinessReport, VoiceProductionReadinessRoutesOptions, VoiceProductionReadinessTraceDeliverySummary, VoiceProductionReadinessAuditDeliveryOptions, VoiceProductionReadinessAuditDeliverySummary, VoiceProductionReadinessTraceDeliveryOptions, VoiceProductionReadinessStatus } from './productionReadiness';
|
|
106
106
|
export type { VoiceQualityLink, VoiceQualityMetric, VoiceQualityReport, VoiceQualityRoutesOptions, VoiceQualityStatus, VoiceQualityThresholds } from './qualityRoutes';
|
|
107
107
|
export type { VoiceResilienceIOSimulator, VoiceResilienceLink, VoiceResiliencePageData, VoiceResilienceRoutesOptions, VoiceResilienceSimulationProvider, VoiceRoutingKindSummary, VoiceRoutingDecisionSummary, VoiceRoutingDecisionSummaryOptions, VoiceRoutingEvent, VoiceRoutingEventKind, VoiceRoutingSessionSummary, VoiceRoutingSessionSummaryOptions } from './resilienceRoutes';
|
|
108
108
|
export type { VoiceIOProviderRouterEvent, VoiceIOProviderRouterOptions, VoiceIOProviderRouterPolicy, VoiceIOProviderRouterPolicyConfig, VoiceSTTProviderRouterOptions, VoiceTTSProviderRouterOptions } from './providerAdapters';
|
package/dist/index.js
CHANGED
|
@@ -20128,6 +20128,47 @@ var assertVoiceProviderRoutingContract = async (options) => {
|
|
|
20128
20128
|
import { Elysia as Elysia33 } from "elysia";
|
|
20129
20129
|
var escapeHtml35 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
20130
20130
|
var rollupStatus2 = (checks) => checks.some((check) => check.status === "fail") ? "fail" : checks.some((check) => check.status === "warn") ? "warn" : "pass";
|
|
20131
|
+
var readinessGateCodes = {
|
|
20132
|
+
"Agent squad contracts": "voice.readiness.agent_squad_contracts",
|
|
20133
|
+
"Audit evidence": "voice.readiness.audit_evidence",
|
|
20134
|
+
"Audit sink delivery": "voice.readiness.audit_sink_delivery",
|
|
20135
|
+
"Barge-in interruption proof": "voice.readiness.barge_in_interruption",
|
|
20136
|
+
"Carrier readiness": "voice.readiness.carrier_readiness",
|
|
20137
|
+
"Delivery runtime": "voice.readiness.delivery_runtime",
|
|
20138
|
+
"Handoff delivery": "voice.readiness.handoff_delivery",
|
|
20139
|
+
"Live latency proof": "voice.readiness.live_latency",
|
|
20140
|
+
"Operator action history": "voice.readiness.operator_action_history",
|
|
20141
|
+
"Phone agent production smoke": "voice.readiness.phone_agent_smoke",
|
|
20142
|
+
"Provider fallback recovery": "voice.readiness.provider_fallback_recovery",
|
|
20143
|
+
"Provider health": "voice.readiness.provider_health",
|
|
20144
|
+
"Provider routing contracts": "voice.readiness.provider_routing_contracts",
|
|
20145
|
+
"Quality gates": "voice.readiness.quality_gates",
|
|
20146
|
+
"Reconnect recovery contracts": "voice.readiness.reconnect_contracts",
|
|
20147
|
+
"Routing evidence": "voice.readiness.routing_evidence",
|
|
20148
|
+
"Session health": "voice.readiness.session_health",
|
|
20149
|
+
"Trace sink delivery": "voice.readiness.trace_sink_delivery"
|
|
20150
|
+
};
|
|
20151
|
+
var readinessGateCodeForCheck = (check) => readinessGateCodes[check.label] ?? `voice.readiness.${check.label.toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "")}`;
|
|
20152
|
+
var summarizeVoiceProductionReadinessGate = (report, options = {}) => {
|
|
20153
|
+
const issues = report.checks.filter((check) => check.status !== "pass").map((check) => ({
|
|
20154
|
+
code: readinessGateCodeForCheck(check),
|
|
20155
|
+
detail: check.detail,
|
|
20156
|
+
href: check.href,
|
|
20157
|
+
label: check.label,
|
|
20158
|
+
status: check.status,
|
|
20159
|
+
value: check.value
|
|
20160
|
+
}));
|
|
20161
|
+
const failures = issues.filter((issue) => issue.status === "fail");
|
|
20162
|
+
const warnings = issues.filter((issue) => issue.status === "warn");
|
|
20163
|
+
const ok = failures.length === 0 && (options.failOnWarnings ? warnings.length === 0 : true);
|
|
20164
|
+
return {
|
|
20165
|
+
checkedAt: report.checkedAt,
|
|
20166
|
+
failures,
|
|
20167
|
+
ok,
|
|
20168
|
+
status: ok ? report.status : "fail",
|
|
20169
|
+
warnings
|
|
20170
|
+
};
|
|
20171
|
+
};
|
|
20131
20172
|
var carrierStatus = (matrix) => matrix.summary.failing > 0 ? "fail" : matrix.summary.warnings > 0 || matrix.summary.ready < matrix.summary.providers ? "warn" : "pass";
|
|
20132
20173
|
var resolveCarriers = async (options, input) => {
|
|
20133
20174
|
if (options.carriers === false || options.carriers === undefined) {
|
|
@@ -20844,6 +20885,7 @@ var buildVoiceProductionReadinessReport = async (options, input = {}) => {
|
|
|
20844
20885
|
}
|
|
20845
20886
|
};
|
|
20846
20887
|
};
|
|
20888
|
+
var buildVoiceProductionReadinessGate = async (options, input = {}) => summarizeVoiceProductionReadinessGate(await buildVoiceProductionReadinessReport(options, input), options.gate || undefined);
|
|
20847
20889
|
var renderVoiceProductionReadinessHTML = (report, options = {}) => {
|
|
20848
20890
|
const title = options.title ?? "AbsoluteJS Voice Production Readiness";
|
|
20849
20891
|
const checks = report.checks.map((check, index) => {
|
|
@@ -20864,11 +20906,27 @@ var renderVoiceProductionReadinessHTML = (report, options = {}) => {
|
|
|
20864
20906
|
};
|
|
20865
20907
|
var createVoiceProductionReadinessRoutes = (options) => {
|
|
20866
20908
|
const path = options.path ?? "/api/production-readiness";
|
|
20909
|
+
const gatePath = options.gatePath === undefined ? "/api/production-readiness/gate" : options.gatePath;
|
|
20867
20910
|
const htmlPath = options.htmlPath ?? "/production-readiness";
|
|
20868
20911
|
const routes = new Elysia33({
|
|
20869
20912
|
name: options.name ?? "absolutejs-voice-production-readiness"
|
|
20870
20913
|
});
|
|
20871
20914
|
routes.get(path, async ({ query, request }) => buildVoiceProductionReadinessReport(options, { query, request }));
|
|
20915
|
+
if (gatePath !== false) {
|
|
20916
|
+
routes.get(gatePath, async ({ query, request }) => {
|
|
20917
|
+
const gate = await buildVoiceProductionReadinessGate(options, {
|
|
20918
|
+
query,
|
|
20919
|
+
request
|
|
20920
|
+
});
|
|
20921
|
+
return new Response(JSON.stringify(gate), {
|
|
20922
|
+
headers: {
|
|
20923
|
+
"Content-Type": "application/json; charset=utf-8",
|
|
20924
|
+
...options.headers
|
|
20925
|
+
},
|
|
20926
|
+
status: gate.ok ? 200 : 503
|
|
20927
|
+
});
|
|
20928
|
+
});
|
|
20929
|
+
}
|
|
20872
20930
|
if (htmlPath !== false) {
|
|
20873
20931
|
routes.get(htmlPath, async ({ query, request }) => {
|
|
20874
20932
|
const report = await buildVoiceProductionReadinessReport(options, {
|
|
@@ -23594,6 +23652,7 @@ export {
|
|
|
23594
23652
|
summarizeVoiceProviderHealth,
|
|
23595
23653
|
summarizeVoiceProviderFallbackRecovery,
|
|
23596
23654
|
summarizeVoiceProviderCapabilities,
|
|
23655
|
+
summarizeVoiceProductionReadinessGate,
|
|
23597
23656
|
summarizeVoiceOpsTasks,
|
|
23598
23657
|
summarizeVoiceOpsTaskQueue,
|
|
23599
23658
|
summarizeVoiceOpsTaskAnalytics,
|
|
@@ -23967,6 +24026,7 @@ export {
|
|
|
23967
24026
|
buildVoiceTraceReplay,
|
|
23968
24027
|
buildVoiceTraceDeliveryReport,
|
|
23969
24028
|
buildVoiceProductionReadinessReport,
|
|
24029
|
+
buildVoiceProductionReadinessGate,
|
|
23970
24030
|
buildVoiceOpsTaskFromSLABreach,
|
|
23971
24031
|
buildVoiceOpsTaskFromReview,
|
|
23972
24032
|
buildVoiceOpsConsoleReport,
|
|
@@ -27,6 +27,24 @@ export type VoiceProductionReadinessCheck = {
|
|
|
27
27
|
status: VoiceProductionReadinessStatus;
|
|
28
28
|
value?: number | string;
|
|
29
29
|
};
|
|
30
|
+
export type VoiceProductionReadinessGateIssue = {
|
|
31
|
+
code: string;
|
|
32
|
+
detail?: string;
|
|
33
|
+
href?: string;
|
|
34
|
+
label: string;
|
|
35
|
+
status: Exclude<VoiceProductionReadinessStatus, 'pass'>;
|
|
36
|
+
value?: number | string;
|
|
37
|
+
};
|
|
38
|
+
export type VoiceProductionReadinessGateOptions = {
|
|
39
|
+
failOnWarnings?: boolean;
|
|
40
|
+
};
|
|
41
|
+
export type VoiceProductionReadinessGateReport = {
|
|
42
|
+
checkedAt: number;
|
|
43
|
+
failures: VoiceProductionReadinessGateIssue[];
|
|
44
|
+
ok: boolean;
|
|
45
|
+
status: VoiceProductionReadinessStatus;
|
|
46
|
+
warnings: VoiceProductionReadinessGateIssue[];
|
|
47
|
+
};
|
|
30
48
|
export type VoiceProductionReadinessProofSource = {
|
|
31
49
|
detail?: string;
|
|
32
50
|
href?: string;
|
|
@@ -242,6 +260,8 @@ export type VoiceProductionReadinessRoutesOptions = {
|
|
|
242
260
|
request: Request;
|
|
243
261
|
}) => Promise<VoiceDeliveryRuntime | VoiceDeliveryRuntimeSummary> | VoiceDeliveryRuntime | VoiceDeliveryRuntimeSummary);
|
|
244
262
|
headers?: HeadersInit;
|
|
263
|
+
gate?: false | VoiceProductionReadinessGateOptions;
|
|
264
|
+
gatePath?: false | string;
|
|
245
265
|
htmlPath?: false | string;
|
|
246
266
|
links?: VoiceProductionReadinessReport['links'];
|
|
247
267
|
llmProviders?: readonly string[];
|
|
@@ -273,10 +293,15 @@ export type VoiceProductionReadinessRoutesOptions = {
|
|
|
273
293
|
liveLatencyWarnAfterMs?: number;
|
|
274
294
|
liveLatencyFailAfterMs?: number;
|
|
275
295
|
};
|
|
296
|
+
export declare const summarizeVoiceProductionReadinessGate: (report: VoiceProductionReadinessReport, options?: VoiceProductionReadinessGateOptions) => VoiceProductionReadinessGateReport;
|
|
276
297
|
export declare const buildVoiceProductionReadinessReport: (options: VoiceProductionReadinessRoutesOptions, input?: {
|
|
277
298
|
query?: Record<string, unknown>;
|
|
278
299
|
request?: Request;
|
|
279
300
|
}) => Promise<VoiceProductionReadinessReport>;
|
|
301
|
+
export declare const buildVoiceProductionReadinessGate: (options: VoiceProductionReadinessRoutesOptions, input?: {
|
|
302
|
+
query?: Record<string, unknown>;
|
|
303
|
+
request?: Request;
|
|
304
|
+
}) => Promise<VoiceProductionReadinessGateReport>;
|
|
280
305
|
export declare const renderVoiceProductionReadinessHTML: (report: VoiceProductionReadinessReport, options?: {
|
|
281
306
|
title?: string;
|
|
282
307
|
}) => string;
|