@absolutejs/voice 0.0.22-beta.250 → 0.0.22-beta.251

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/README.md CHANGED
@@ -1386,6 +1386,21 @@ app.use(
1386
1386
  );
1387
1387
  ```
1388
1388
 
1389
+ Use `evaluateVoiceProductionReadinessEvidence(...)` or `assertVoiceProductionReadinessEvidence(...)` when a proof pack should check the readiness JSON directly. This keeps release gates tied to structured evidence instead of route text:
1390
+
1391
+ ```ts
1392
+ const readiness = await buildVoiceProductionReadinessReport({
1393
+ store: runtime.traces,
1394
+ providerSlo,
1395
+ opsRecovery
1396
+ });
1397
+
1398
+ assertVoiceProductionReadinessEvidence(readiness, {
1399
+ requireStatus: 'pass',
1400
+ requiredChecks: ['Provider SLO gates', 'Session health', 'Turn quality']
1401
+ });
1402
+ ```
1403
+
1389
1404
  Built-in profiles:
1390
1405
 
1391
1406
  - `meeting-recorder`: live latency, session health, provider fallback, routing contracts, reconnect proof, and barge-in interruption proof.
@@ -2874,6 +2889,21 @@ console.log(voiceObservabilityExportSchemaId, voiceObservabilityExportSchemaVers
2874
2889
 
2875
2890
  Use `validateVoiceObservabilityExportRecord(...)` or `assertVoiceObservabilityExportRecord(...)` when reading customer-owned records back from SQLite, Postgres, S3, a webhook collector, a warehouse, or a SIEM. The validator accepts manifests, artifact indexes, delivery reports, delivery receipts, delivery histories, and database payload records, then checks the stable schema id/version plus the minimum shape required for safe ingestion.
2876
2891
 
2892
+ Use `evaluateVoicePlatformCoverage(...)` or `assertVoicePlatformCoverage(...)` when the product needs a structured "Vapi replacement surface coverage" gate. The assertion checks required buyer surfaces, evidence artifact names, total surface count, and failed-surface count:
2893
+
2894
+ ```ts
2895
+ const coverage = buildVoicePlatformCoverageSummary({
2896
+ coverage: latestProofPack.vapiCoverage,
2897
+ runId: latestProofPack.runId
2898
+ });
2899
+
2900
+ assertVoicePlatformCoverage(coverage, {
2901
+ minSurfaces: 12,
2902
+ requiredEvidence: ['productionReadiness', 'operationsRecord', 'providerSlo'],
2903
+ requiredSurfaces: ['Web voice assistant', 'Call logs and incident handoff']
2904
+ });
2905
+ ```
2906
+
2877
2907
  Use `replayVoiceObservabilityExport(...)` when you need to prove an already-delivered evidence bundle is still usable:
2878
2908
 
2879
2909
  ```ts
package/dist/index.d.ts CHANGED
@@ -14,8 +14,8 @@ export { buildVoiceDiagnosticsMarkdown, createVoiceDiagnosticsRoutes, resolveVoi
14
14
  export { buildVoiceDemoReadyReport, createVoiceDemoReadyRoutes, renderVoiceDemoReadyHTML } from './demoReadyRoutes';
15
15
  export { buildVoiceDeliverySinkReport, createVoiceDeliverySinkDescriptor, createVoiceDeliverySinkPair, createVoiceDeliverySinkRoutes, createVoiceFileDeliverySink, createVoicePostgresDeliverySink, createVoiceS3DeliverySink, createVoiceSQLiteDeliverySink, createVoiceWebhookDeliverySink, renderVoiceDeliverySinkHTML } from './deliverySinkRoutes';
16
16
  export { buildVoiceOpsActionHistoryReport, createVoiceOpsActionAuditRoutes, recordVoiceOpsActionAudit, renderVoiceOpsActionHistoryHTML } from './opsActionAuditRoutes';
17
- export { buildVoicePlatformCoverageSummary, createVoicePlatformCoverageRoutes } from './platformCoverage';
18
- export type { VoicePlatformCoverageEvidence, VoicePlatformCoverageRoutesOptions, VoicePlatformCoverageStatus, VoicePlatformCoverageSummary, VoicePlatformCoverageSummaryInput, VoicePlatformCoverageSurface } from './platformCoverage';
17
+ export { assertVoicePlatformCoverage, buildVoicePlatformCoverageSummary, createVoicePlatformCoverageRoutes, evaluateVoicePlatformCoverage } from './platformCoverage';
18
+ export type { VoicePlatformCoverageAssertionInput, VoicePlatformCoverageAssertionReport, VoicePlatformCoverageEvidence, VoicePlatformCoverageRoutesOptions, VoicePlatformCoverageStatus, VoicePlatformCoverageSummary, VoicePlatformCoverageSummaryInput, VoicePlatformCoverageSurface } from './platformCoverage';
19
19
  export { buildEmptyVoiceProofTrendReport, buildVoiceProofTrendReport, createVoiceProofTrendRoutes, DEFAULT_VOICE_PROOF_TRENDS_MAX_AGE_MS, formatVoiceProofTrendAge, normalizeVoiceProofTrendReport, readVoiceProofTrendReportFile } from './proofTrends';
20
20
  export type { VoiceProofTrendCycle, VoiceProofTrendReport, VoiceProofTrendReportInput, VoiceProofTrendRoutesOptions, VoiceProofTrendStatus, VoiceProofTrendSummary } from './proofTrends';
21
21
  export { buildVoiceLiveOpsControlState, createVoiceLiveOpsController, createVoiceLiveOpsRoutes, createVoiceMemoryLiveOpsControlStore, getVoiceLiveOpsControlStatus, VOICE_LIVE_OPS_ACTIONS } from './liveOps';
@@ -52,7 +52,7 @@ export { createVoiceProviderCapabilityHTMLHandler, createVoiceProviderCapability
52
52
  export { assertVoiceProviderRoutingContract, runVoiceProviderRoutingContract } from './providerRoutingContract';
53
53
  export { assertVoiceProviderSloEvidence, buildVoiceProviderSloReport, createVoiceProviderSloRoutes, evaluateVoiceProviderSloEvidence, renderVoiceProviderSloHTML, renderVoiceProviderSloMarkdown } from './providerSlo';
54
54
  export { createVoicePhoneAgentProductionSmokeHTMLHandler, createVoicePhoneAgentProductionSmokeJSONHandler, createVoicePhoneAgentProductionSmokeRoutes, renderVoicePhoneAgentProductionSmokeHTML, runVoicePhoneAgentProductionSmokeContract } from './phoneAgentProductionSmoke';
55
- export { buildVoiceProductionReadinessGate, buildVoiceProductionReadinessReport, createVoiceProductionReadinessRoutes, renderVoiceProductionReadinessHTML, summarizeVoiceProductionReadinessGate } from './productionReadiness';
55
+ export { assertVoiceProductionReadinessEvidence, buildVoiceProductionReadinessGate, buildVoiceProductionReadinessReport, createVoiceProductionReadinessRoutes, evaluateVoiceProductionReadinessEvidence, renderVoiceProductionReadinessHTML, summarizeVoiceProductionReadinessGate } from './productionReadiness';
56
56
  export { createVoiceReadinessProfile, recommendVoiceReadinessProfile } from './readinessProfiles';
57
57
  export { buildVoiceProviderContractMatrix, createVoiceProviderContractMatrixHTMLHandler, createVoiceProviderContractMatrixJSONHandler, createVoiceProviderContractMatrixPreset, createVoiceProviderContractMatrixRoutes, evaluateVoiceProviderStackGaps, renderVoiceProviderContractMatrixHTML, recommendVoiceProviderStack } from './providerStackRecommendations';
58
58
  export { buildVoiceOpsConsoleReport, createVoiceOpsConsoleRoutes, renderVoiceOpsConsoleHTML } from './opsConsoleRoutes';
@@ -120,7 +120,7 @@ export type { VoicePhoneAgentCarrier, VoicePhoneAgentCarrierSummary, VoicePhoneA
120
120
  export type { VoicePhoneAgentProductionSmokeIssue, VoicePhoneAgentProductionSmokeHandlerOptions, VoicePhoneAgentProductionSmokeHTMLHandlerOptions, VoicePhoneAgentProductionSmokeOptions, VoicePhoneAgentProductionSmokeReport, VoicePhoneAgentProductionSmokeRoutesOptions, VoicePhoneAgentProductionSmokeRequirement } from './phoneAgentProductionSmoke';
121
121
  export type { VoiceOpsConsoleLink, VoiceOpsConsoleReport, VoiceOpsConsoleRoutesOptions } from './opsConsoleRoutes';
122
122
  export type { VoiceOpsStatus, VoiceOpsStatusLink, VoiceOpsStatusOptions, VoiceOpsStatusReport, VoiceOpsStatusRoutesOptions } from './opsStatus';
123
- export type { VoiceProductionReadinessAction, VoiceProductionReadinessAuditOptions, VoiceProductionReadinessAuditRequirement, VoiceProductionReadinessAuditSummary, VoiceProductionReadinessCheck, VoiceProductionReadinessGateIssue, VoiceProductionReadinessGateOptions, VoiceProductionReadinessGateProfile, VoiceProductionReadinessGateProfileSurface, VoiceProductionReadinessGateReport, VoiceProductionReadinessOpsActionHistoryOptions, VoiceProductionReadinessOpsActionHistorySummary, VoiceProductionReadinessOperationsRecordLink, VoiceProductionReadinessOperationsRecordLinks, VoiceProductionReadinessProfileExplanation, VoiceProductionReadinessProfileSurface, VoiceProductionReadinessProofSource, VoiceProductionReadinessReport, VoiceProductionReadinessRoutesOptions, VoiceProductionReadinessTraceDeliverySummary, VoiceProductionReadinessAuditDeliveryOptions, VoiceProductionReadinessAuditDeliverySummary, VoiceProductionReadinessTraceDeliveryOptions, VoiceProductionReadinessStatus } from './productionReadiness';
123
+ export type { VoiceProductionReadinessAction, VoiceProductionReadinessAuditOptions, VoiceProductionReadinessAuditRequirement, VoiceProductionReadinessAuditSummary, VoiceProductionReadinessAssertionInput, VoiceProductionReadinessAssertionReport, VoiceProductionReadinessCheck, VoiceProductionReadinessGateIssue, VoiceProductionReadinessGateOptions, VoiceProductionReadinessGateProfile, VoiceProductionReadinessGateProfileSurface, VoiceProductionReadinessGateReport, VoiceProductionReadinessOpsActionHistoryOptions, VoiceProductionReadinessOpsActionHistorySummary, VoiceProductionReadinessOperationsRecordLink, VoiceProductionReadinessOperationsRecordLinks, VoiceProductionReadinessProfileExplanation, VoiceProductionReadinessProfileSurface, VoiceProductionReadinessProofSource, VoiceProductionReadinessReport, VoiceProductionReadinessRoutesOptions, VoiceProductionReadinessTraceDeliverySummary, VoiceProductionReadinessAuditDeliveryOptions, VoiceProductionReadinessAuditDeliverySummary, VoiceProductionReadinessTraceDeliveryOptions, VoiceProductionReadinessStatus } from './productionReadiness';
124
124
  export type { VoiceReadinessProfileName, VoiceReadinessProfileOptions, VoiceReadinessProfileRecommendation, VoiceReadinessProfileRecommendationScore, VoiceReadinessProfileRoutesOptions } from './readinessProfiles';
125
125
  export type { VoiceProviderStackChoice, VoiceProviderStackCapabilities, VoiceProviderStackCapabilityGap, VoiceProviderStackCapabilityGapInput, VoiceProviderStackCapabilityGapReport, VoiceProviderContractCheck, VoiceProviderContractCheckStatus, VoiceProviderContractDefinition, VoiceProviderContractMatrixHandlerOptions, VoiceProviderContractMatrixHTMLHandlerOptions, VoiceProviderContractMatrixInput, VoiceProviderContractMatrixPresetOptions, VoiceProviderContractMatrixReport, VoiceProviderContractMatrixRoutesOptions, VoiceProviderContractMatrixRow, VoiceProviderStackInput, VoiceProviderStackKind, VoiceProviderStackRecommendation } from './providerStackRecommendations';
126
126
  export type { VoiceOperationsRecord, VoiceOperationsRecordAgentHandoff, VoiceOperationsRecordAuditSummary, VoiceOperationsRecordGuardrailAssertionInput, VoiceOperationsRecordGuardrailAssertionReport, VoiceOperationsRecordGuardrailDecision, VoiceOperationsRecordGuardrailFinding, VoiceOperationsRecordGuardrailSummary, VoiceOperationsRecordIntegrationEventSummary, VoiceOperationsRecordOptions, VoiceOperationsRecordOutcome, VoiceOperationsRecordProviderDecision, VoiceOperationsRecordReviewSummary, VoiceOperationsRecordRoutesOptions, VoiceOperationsRecordStatus, VoiceOperationsRecordTaskSummary, VoiceOperationsRecordTranscriptTurn, VoiceOperationsRecordTool } from './operationsRecord';
package/dist/index.js CHANGED
@@ -12277,6 +12277,48 @@ var buildVoicePlatformCoverageSummary = (input) => {
12277
12277
  total: coverage.length
12278
12278
  };
12279
12279
  };
12280
+ var evaluateVoicePlatformCoverage = (summary, input = {}) => {
12281
+ const issues = [];
12282
+ const surfaces = summary.coverage.map((surface) => surface.surface).sort();
12283
+ const failed = summary.coverage.filter((surface) => surface.status !== "pass").length;
12284
+ const missing = summary.coverage.reduce((total, surface) => total + (surface.missing ?? 0), 0);
12285
+ const evidenceNames = new Set(summary.coverage.flatMap((surface) => surface.evidence.map((evidence) => evidence.name)));
12286
+ if ((input.requirePass ?? true) && !summary.ok) {
12287
+ issues.push(`Expected platform coverage to pass, found ${summary.status}.`);
12288
+ }
12289
+ if (input.minSurfaces !== undefined && summary.total < input.minSurfaces) {
12290
+ issues.push(`Expected at least ${String(input.minSurfaces)} platform coverage surfaces, found ${String(summary.total)}.`);
12291
+ }
12292
+ if (input.maxFailedSurfaces !== undefined && failed > input.maxFailedSurfaces) {
12293
+ issues.push(`Expected at most ${String(input.maxFailedSurfaces)} failing platform coverage surfaces, found ${String(failed)}.`);
12294
+ }
12295
+ for (const surface of input.requiredSurfaces ?? []) {
12296
+ if (!surfaces.includes(surface)) {
12297
+ issues.push(`Missing platform coverage surface: ${surface}.`);
12298
+ }
12299
+ }
12300
+ for (const evidence of input.requiredEvidence ?? []) {
12301
+ if (!evidenceNames.has(evidence)) {
12302
+ issues.push(`Missing platform coverage evidence: ${evidence}.`);
12303
+ }
12304
+ }
12305
+ return {
12306
+ failed,
12307
+ issues,
12308
+ missing,
12309
+ ok: issues.length === 0,
12310
+ status: summary.status,
12311
+ surfaces,
12312
+ total: summary.total
12313
+ };
12314
+ };
12315
+ var assertVoicePlatformCoverage = (summary, input = {}) => {
12316
+ const report = evaluateVoicePlatformCoverage(summary, input);
12317
+ if (!report.ok) {
12318
+ throw new Error(`Voice platform coverage assertion failed: ${report.issues.join(" ")}`);
12319
+ }
12320
+ return report;
12321
+ };
12280
12322
  var normalizeCoverageSummary = (value) => ("status" in value) && ("total" in value) && ("coverage" in value) ? value : buildVoicePlatformCoverageSummary(value);
12281
12323
  var createVoicePlatformCoverageRoutes = (options) => {
12282
12324
  const path = options.path ?? "/api/voice/platform-coverage";
@@ -24776,6 +24818,48 @@ var summarizeVoiceProductionReadinessGate = (report, options = {}) => {
24776
24818
  warnings
24777
24819
  };
24778
24820
  };
24821
+ var evaluateVoiceProductionReadinessEvidence = (report, input = {}) => {
24822
+ const gate = summarizeVoiceProductionReadinessGate(report);
24823
+ const issues = [];
24824
+ const checks = report.checks.map((check) => check.label).sort();
24825
+ const requiredStatus = input.requireStatus ?? "pass";
24826
+ const requireGateOk = input.requireGateOk ?? true;
24827
+ const maxFailures = input.maxFailures ?? 0;
24828
+ const maxWarnings = input.maxWarnings;
24829
+ if (report.status !== requiredStatus) {
24830
+ issues.push(`Expected production readiness status ${requiredStatus}, found ${report.status}.`);
24831
+ }
24832
+ if (requireGateOk && !gate.ok) {
24833
+ issues.push(`Expected production readiness gate to pass, found ${gate.status}.`);
24834
+ }
24835
+ if (gate.failures.length > maxFailures) {
24836
+ issues.push(`Expected at most ${String(maxFailures)} production readiness failures, found ${String(gate.failures.length)}.`);
24837
+ }
24838
+ if (maxWarnings !== undefined && gate.warnings.length > maxWarnings) {
24839
+ issues.push(`Expected at most ${String(maxWarnings)} production readiness warnings, found ${String(gate.warnings.length)}.`);
24840
+ }
24841
+ for (const check of input.requiredChecks ?? []) {
24842
+ if (!checks.includes(check)) {
24843
+ issues.push(`Missing production readiness check: ${check}.`);
24844
+ }
24845
+ }
24846
+ return {
24847
+ checks,
24848
+ failures: gate.failures.length,
24849
+ gateOk: gate.ok,
24850
+ issues,
24851
+ ok: issues.length === 0,
24852
+ status: report.status,
24853
+ warnings: gate.warnings.length
24854
+ };
24855
+ };
24856
+ var assertVoiceProductionReadinessEvidence = (report, input = {}) => {
24857
+ const assertion = evaluateVoiceProductionReadinessEvidence(report, input);
24858
+ if (!assertion.ok) {
24859
+ throw new Error(`Voice production readiness assertion failed: ${assertion.issues.join(" ")}`);
24860
+ }
24861
+ return assertion;
24862
+ };
24779
24863
  var carrierStatus = (matrix) => matrix.summary.failing > 0 ? "fail" : matrix.summary.warnings > 0 || matrix.summary.ready < matrix.summary.providers ? "warn" : "pass";
24780
24864
  var resolveCarriers = async (options, input) => {
24781
24865
  if (options.carriers === false || options.carriers === undefined) {
@@ -30074,6 +30158,8 @@ export {
30074
30158
  evaluateVoiceQuality,
30075
30159
  evaluateVoiceProviderStackGaps,
30076
30160
  evaluateVoiceProviderSloEvidence,
30161
+ evaluateVoiceProductionReadinessEvidence,
30162
+ evaluateVoicePlatformCoverage,
30077
30163
  evaluateVoiceOperationsRecordGuardrails,
30078
30164
  evaluateVoiceGuardrailPolicy,
30079
30165
  encodeTwilioMulawBase64,
@@ -30389,6 +30475,8 @@ export {
30389
30475
  assignVoiceOpsTask,
30390
30476
  assertVoiceProviderSloEvidence,
30391
30477
  assertVoiceProviderRoutingContract,
30478
+ assertVoiceProductionReadinessEvidence,
30479
+ assertVoicePlatformCoverage,
30392
30480
  assertVoiceOperationsRecordGuardrails,
30393
30481
  assertVoiceObservabilityExportSchema,
30394
30482
  assertVoiceObservabilityExportRecord,
@@ -42,7 +42,25 @@ export type VoicePlatformCoverageRoutesOptions = {
42
42
  path?: string;
43
43
  source: (() => Promise<VoicePlatformCoverageSummary | VoicePlatformCoverageSummaryInput> | VoicePlatformCoverageSummary | VoicePlatformCoverageSummaryInput) | VoicePlatformCoverageSummary | VoicePlatformCoverageSummaryInput;
44
44
  };
45
+ export type VoicePlatformCoverageAssertionInput = {
46
+ maxFailedSurfaces?: number;
47
+ minSurfaces?: number;
48
+ requiredEvidence?: string[];
49
+ requiredSurfaces?: string[];
50
+ requirePass?: boolean;
51
+ };
52
+ export type VoicePlatformCoverageAssertionReport = {
53
+ failed: number;
54
+ issues: string[];
55
+ missing: number;
56
+ ok: boolean;
57
+ status: VoicePlatformCoverageStatus;
58
+ surfaces: string[];
59
+ total: number;
60
+ };
45
61
  export declare const buildVoicePlatformCoverageSummary: (input: VoicePlatformCoverageSummaryInput) => VoicePlatformCoverageSummary;
62
+ export declare const evaluateVoicePlatformCoverage: (summary: VoicePlatformCoverageSummary, input?: VoicePlatformCoverageAssertionInput) => VoicePlatformCoverageAssertionReport;
63
+ export declare const assertVoicePlatformCoverage: (summary: VoicePlatformCoverageSummary, input?: VoicePlatformCoverageAssertionInput) => VoicePlatformCoverageAssertionReport;
46
64
  export declare const createVoicePlatformCoverageRoutes: (options: VoicePlatformCoverageRoutesOptions) => Elysia<"", {
47
65
  decorator: {};
48
66
  store: {};
@@ -58,6 +58,22 @@ export type VoiceProductionReadinessGateReport = {
58
58
  status: VoiceProductionReadinessStatus;
59
59
  warnings: VoiceProductionReadinessGateIssue[];
60
60
  };
61
+ export type VoiceProductionReadinessAssertionInput = {
62
+ maxFailures?: number;
63
+ maxWarnings?: number;
64
+ requiredChecks?: string[];
65
+ requireGateOk?: boolean;
66
+ requireStatus?: VoiceProductionReadinessStatus;
67
+ };
68
+ export type VoiceProductionReadinessAssertionReport = {
69
+ checks: string[];
70
+ failures: number;
71
+ gateOk: boolean;
72
+ issues: string[];
73
+ ok: boolean;
74
+ status: VoiceProductionReadinessStatus;
75
+ warnings: number;
76
+ };
61
77
  export type VoiceProductionReadinessProofSource = {
62
78
  detail?: string;
63
79
  href?: string;
@@ -425,6 +441,8 @@ export type VoiceProductionReadinessRoutesOptions = {
425
441
  liveLatencyFailAfterMs?: number;
426
442
  };
427
443
  export declare const summarizeVoiceProductionReadinessGate: (report: VoiceProductionReadinessReport, options?: VoiceProductionReadinessGateOptions) => VoiceProductionReadinessGateReport;
444
+ export declare const evaluateVoiceProductionReadinessEvidence: (report: VoiceProductionReadinessReport, input?: VoiceProductionReadinessAssertionInput) => VoiceProductionReadinessAssertionReport;
445
+ export declare const assertVoiceProductionReadinessEvidence: (report: VoiceProductionReadinessReport, input?: VoiceProductionReadinessAssertionInput) => VoiceProductionReadinessAssertionReport;
428
446
  export declare const buildVoiceProductionReadinessReport: (options: VoiceProductionReadinessRoutesOptions, input?: {
429
447
  query?: Record<string, unknown>;
430
448
  request?: Request;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@absolutejs/voice",
3
- "version": "0.0.22-beta.250",
3
+ "version": "0.0.22-beta.251",
4
4
  "description": "Voice primitives and Elysia plugin for AbsoluteJS",
5
5
  "repository": {
6
6
  "type": "git",