@absolutejs/voice 0.0.22-beta.530 → 0.0.22-beta.531

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.
@@ -3911,6 +3911,14 @@ var defineVoicePlatformCoverageElement = (tagName = "absolute-voice-platform-cov
3911
3911
  }
3912
3912
  });
3913
3913
  };
3914
+ // src/internal/evidence.ts
3915
+ var assertVoiceEvidence = (failureMessage, assertion) => {
3916
+ if (!assertion.ok) {
3917
+ throw new Error(`${failureMessage}: ${assertion.issues.join(" ")}`);
3918
+ }
3919
+ return assertion;
3920
+ };
3921
+
3914
3922
  // src/proofTrends.ts
3915
3923
  import { Elysia as Elysia4 } from "elysia";
3916
3924
 
@@ -7987,11 +7995,7 @@ var evaluateVoiceProofTrendEvidence = (report, input = {}) => {
7987
7995
  };
7988
7996
  };
7989
7997
  var assertVoiceProofTrendEvidence = (report, input = {}) => {
7990
- const assertion = evaluateVoiceProofTrendEvidence(report, input);
7991
- if (!assertion.ok) {
7992
- throw new Error(`Voice proof trends assertion failed: ${assertion.issues.join(" ")}`);
7993
- }
7994
- return assertion;
7998
+ return assertVoiceEvidence("Voice proof trends assertion failed", evaluateVoiceProofTrendEvidence(report, input));
7995
7999
  };
7996
8000
  var DEFAULT_RECOMMENDATION_BUDGETS = {
7997
8001
  maxLiveP95Ms: 800,
@@ -9441,11 +9445,7 @@ var evaluateVoiceLiveOpsEvidence = (input = {}) => {
9441
9445
  };
9442
9446
  };
9443
9447
  var assertVoiceLiveOpsEvidence = (input = {}) => {
9444
- const assertion = evaluateVoiceLiveOpsEvidence(input);
9445
- if (!assertion.ok) {
9446
- throw new Error(`Voice live-ops evidence assertion failed: ${assertion.issues.join(" ")}`);
9447
- }
9448
- return assertion;
9448
+ return assertVoiceEvidence("Voice live-ops evidence assertion failed", evaluateVoiceLiveOpsEvidence(input));
9449
9449
  };
9450
9450
  var evaluateVoiceLiveOpsControlEvidence = (input = {}) => {
9451
9451
  const issues = [];
@@ -9493,11 +9493,7 @@ var evaluateVoiceLiveOpsControlEvidence = (input = {}) => {
9493
9493
  };
9494
9494
  };
9495
9495
  var assertVoiceLiveOpsControlEvidence = (input = {}) => {
9496
- const assertion = evaluateVoiceLiveOpsControlEvidence(input);
9497
- if (!assertion.ok) {
9498
- throw new Error(`Voice live-ops control evidence assertion failed: ${assertion.issues.join(" ")}`);
9499
- }
9500
- return assertion;
9496
+ return assertVoiceEvidence("Voice live-ops control evidence assertion failed", evaluateVoiceLiveOpsControlEvidence(input));
9501
9497
  };
9502
9498
  var createVoiceMemoryLiveOpsControlStore = () => {
9503
9499
  const states = new Map;
package/dist/index.js CHANGED
@@ -12271,6 +12271,14 @@ var createVoiceCallDebuggerRoutes = (options) => {
12271
12271
  return app;
12272
12272
  };
12273
12273
 
12274
+ // src/internal/evidence.ts
12275
+ var assertVoiceEvidence = (failureMessage, assertion) => {
12276
+ if (!assertion.ok) {
12277
+ throw new Error(`${failureMessage}: ${assertion.issues.join(" ")}`);
12278
+ }
12279
+ return assertion;
12280
+ };
12281
+
12274
12282
  // src/campaign.ts
12275
12283
  import { Elysia as Elysia14 } from "elysia";
12276
12284
  var createId2 = () => crypto.randomUUID();
@@ -13399,11 +13407,7 @@ var evaluateVoiceCampaignReadinessEvidence = (report, input = {}) => {
13399
13407
  };
13400
13408
  };
13401
13409
  var assertVoiceCampaignReadinessEvidence = (report, input = {}) => {
13402
- const assertion = evaluateVoiceCampaignReadinessEvidence(report, input);
13403
- if (!assertion.ok) {
13404
- throw new Error(`Voice campaign readiness evidence assertion failed: ${assertion.issues.join(" ")}`);
13405
- }
13406
- return assertion;
13410
+ return assertVoiceEvidence("Voice campaign readiness evidence assertion failed", evaluateVoiceCampaignReadinessEvidence(report, input));
13407
13411
  };
13408
13412
  var getString8 = (value) => typeof value === "string" && value.length > 0 ? value : undefined;
13409
13413
  var campaignAttemptSessionId = (attempt) => getString8(attempt.metadata?.sessionId) ?? getString8(attempt.metadata?.voiceSessionId) ?? getString8(attempt.metadata?.callSessionId);
@@ -14151,11 +14155,7 @@ var evaluateVoiceDataControlEvidence = (report, input = {}) => {
14151
14155
  };
14152
14156
  };
14153
14157
  var assertVoiceDataControlEvidence = (report, input = {}) => {
14154
- const assertion = evaluateVoiceDataControlEvidence(report, input);
14155
- if (!assertion.ok) {
14156
- throw new Error(`Voice data-control evidence assertion failed: ${assertion.issues.join(" ")}`);
14157
- }
14158
- return assertion;
14158
+ return assertVoiceEvidence("Voice data-control evidence assertion failed", evaluateVoiceDataControlEvidence(report, input));
14159
14159
  };
14160
14160
  var createVoiceZeroRetentionPolicy = (options) => ({
14161
14161
  ...options,
@@ -19130,11 +19130,7 @@ var evaluateVoiceLiveOpsEvidence = (input = {}) => {
19130
19130
  };
19131
19131
  };
19132
19132
  var assertVoiceLiveOpsEvidence = (input = {}) => {
19133
- const assertion = evaluateVoiceLiveOpsEvidence(input);
19134
- if (!assertion.ok) {
19135
- throw new Error(`Voice live-ops evidence assertion failed: ${assertion.issues.join(" ")}`);
19136
- }
19137
- return assertion;
19133
+ return assertVoiceEvidence("Voice live-ops evidence assertion failed", evaluateVoiceLiveOpsEvidence(input));
19138
19134
  };
19139
19135
  var evaluateVoiceLiveOpsControlEvidence = (input = {}) => {
19140
19136
  const issues = [];
@@ -19182,11 +19178,7 @@ var evaluateVoiceLiveOpsControlEvidence = (input = {}) => {
19182
19178
  };
19183
19179
  };
19184
19180
  var assertVoiceLiveOpsControlEvidence = (input = {}) => {
19185
- const assertion = evaluateVoiceLiveOpsControlEvidence(input);
19186
- if (!assertion.ok) {
19187
- throw new Error(`Voice live-ops control evidence assertion failed: ${assertion.issues.join(" ")}`);
19188
- }
19189
- return assertion;
19181
+ return assertVoiceEvidence("Voice live-ops control evidence assertion failed", evaluateVoiceLiveOpsControlEvidence(input));
19190
19182
  };
19191
19183
  var createVoiceMemoryLiveOpsControlStore = () => {
19192
19184
  const states = new Map;
@@ -19505,11 +19497,7 @@ var evaluateVoiceMediaPipelineEvidence = (report, input = {}) => {
19505
19497
  };
19506
19498
  };
19507
19499
  var assertVoiceMediaPipelineEvidence = (report, input = {}) => {
19508
- const assertion = evaluateVoiceMediaPipelineEvidence(report, input);
19509
- if (!assertion.ok) {
19510
- throw new Error(`Voice media pipeline assertion failed: ${assertion.issues.join(" ")}`);
19511
- }
19512
- return assertion;
19500
+ return assertVoiceEvidence("Voice media pipeline assertion failed", evaluateVoiceMediaPipelineEvidence(report, input));
19513
19501
  };
19514
19502
  var renderVoiceMediaPipelineMarkdown = (report) => [
19515
19503
  "# Voice Media Pipeline Proof",
@@ -20703,11 +20691,7 @@ var evaluateVoiceObservabilityExportReplayEvidence = (report, input = {}) => {
20703
20691
  };
20704
20692
  };
20705
20693
  var assertVoiceObservabilityExportReplayEvidence = (report, input = {}) => {
20706
- const assertion = evaluateVoiceObservabilityExportReplayEvidence(report, input);
20707
- if (!assertion.ok) {
20708
- throw new Error(`Voice observability export replay assertion failed: ${assertion.issues.join(" ")}`);
20709
- }
20710
- return assertion;
20694
+ return assertVoiceEvidence("Voice observability export replay assertion failed", evaluateVoiceObservabilityExportReplayEvidence(report, input));
20711
20695
  };
20712
20696
  var loadVoiceObservabilityExportReplaySource = async (source) => {
20713
20697
  if (source.kind === "records") {
@@ -21056,11 +21040,7 @@ var evaluateVoiceObservabilityExportDeliveryEvidence = (history, input = {}) =>
21056
21040
  };
21057
21041
  };
21058
21042
  var assertVoiceObservabilityExportDeliveryEvidence = (history, input = {}) => {
21059
- const assertion = evaluateVoiceObservabilityExportDeliveryEvidence(history, input);
21060
- if (!assertion.ok) {
21061
- throw new Error(`Voice observability export delivery assertion failed: ${assertion.issues.join(" ")}`);
21062
- }
21063
- return assertion;
21043
+ return assertVoiceEvidence("Voice observability export delivery assertion failed", evaluateVoiceObservabilityExportDeliveryEvidence(history, input));
21064
21044
  };
21065
21045
  var inferContentType = (artifact) => {
21066
21046
  if (artifact.contentType) {
@@ -22584,11 +22564,7 @@ var evaluateVoiceTelephonyWebhookNormalizationEvidence = (input = {}) => {
22584
22564
  };
22585
22565
  };
22586
22566
  var assertVoiceTelephonyWebhookNormalizationEvidence = (input = {}) => {
22587
- const assertion = evaluateVoiceTelephonyWebhookNormalizationEvidence(input);
22588
- if (!assertion.ok) {
22589
- throw new Error(`Voice telephony webhook normalization evidence assertion failed: ${assertion.issues.join(" ")}`);
22590
- }
22591
- return assertion;
22567
+ return assertVoiceEvidence("Voice telephony webhook normalization evidence assertion failed", evaluateVoiceTelephonyWebhookNormalizationEvidence(input));
22592
22568
  };
22593
22569
  var normalizeToken = (value) => typeof value === "string" ? value.trim().toLowerCase().replace(/\s+/g, "-").replace(/_+/g, "-") : undefined;
22594
22570
  var firstString2 = (source, keys) => {
@@ -26003,11 +25979,7 @@ var evaluateVoiceTelephonyWebhookSecurityEvidence = (report, input = {}) => {
26003
25979
  };
26004
25980
  };
26005
25981
  var assertVoiceTelephonyWebhookSecurityEvidence = (report, input = {}) => {
26006
- const assertion = evaluateVoiceTelephonyWebhookSecurityEvidence(report, input);
26007
- if (!assertion.ok) {
26008
- throw new Error(`Voice telephony webhook security assertion failed: ${assertion.issues.join(" ")}`);
26009
- }
26010
- return assertion;
25982
+ return assertVoiceEvidence("Voice telephony webhook security assertion failed", evaluateVoiceTelephonyWebhookSecurityEvidence(report, input));
26011
25983
  };
26012
25984
  var createVoiceTelephonyWebhookSecurityRoutes = (options) => {
26013
25985
  const path = options.path ?? "/api/voice/telephony/webhook-security";
@@ -26356,11 +26328,7 @@ var evaluateVoiceProviderSloEvidence = (report, input = {}) => {
26356
26328
  };
26357
26329
  };
26358
26330
  var assertVoiceProviderSloEvidence = (report, input = {}) => {
26359
- const assertion = evaluateVoiceProviderSloEvidence(report, input);
26360
- if (!assertion.ok) {
26361
- throw new Error(`Voice provider SLO assertion failed: ${assertion.issues.join(" ")}`);
26362
- }
26363
- return assertion;
26331
+ return assertVoiceEvidence("Voice provider SLO assertion failed", evaluateVoiceProviderSloEvidence(report, input));
26364
26332
  };
26365
26333
  var formatMetricValue2 = (metric) => metric.unit === "rate" ? `${(metric.actual * 100).toFixed(2)}%` : metric.unit === "ms" ? `${Math.round(metric.actual)}ms` : String(metric.actual);
26366
26334
  var formatMetricThreshold = (metric) => metric.unit === "rate" ? `${(metric.threshold * 100).toFixed(2)}%` : metric.unit === "ms" ? `${Math.round(metric.threshold)}ms` : String(metric.threshold);
@@ -26722,11 +26690,7 @@ var evaluateVoiceSessionObservabilityEvidence = (report, input = {}) => {
26722
26690
  };
26723
26691
  };
26724
26692
  var assertVoiceSessionObservabilityEvidence = (report, input = {}) => {
26725
- const assertion = evaluateVoiceSessionObservabilityEvidence(report, input);
26726
- if (!assertion.ok) {
26727
- throw new Error(`Voice session observability evidence assertion failed: ${assertion.issues.join(" ")}`);
26728
- }
26729
- return assertion;
26693
+ return assertVoiceEvidence("Voice session observability evidence assertion failed", evaluateVoiceSessionObservabilityEvidence(report, input));
26730
26694
  };
26731
26695
  var createVoiceSessionObservabilityRoutes = (options) => {
26732
26696
  const path = options.path ?? "/api/voice/session-observability/:sessionId";
@@ -27653,11 +27617,7 @@ var evaluateVoiceProductionReadinessEvidence = (report, input = {}) => {
27653
27617
  };
27654
27618
  };
27655
27619
  var assertVoiceProductionReadinessEvidence = (report, input = {}) => {
27656
- const assertion = evaluateVoiceProductionReadinessEvidence(report, input);
27657
- if (!assertion.ok) {
27658
- throw new Error(`Voice production readiness assertion failed: ${assertion.issues.join(" ")}`);
27659
- }
27660
- return assertion;
27620
+ return assertVoiceEvidence("Voice production readiness assertion failed", evaluateVoiceProductionReadinessEvidence(report, input));
27661
27621
  };
27662
27622
  var carrierStatus = (matrix) => matrix.summary.failing > 0 ? "fail" : matrix.summary.warnings > 0 || matrix.summary.ready < matrix.summary.providers ? "warn" : "pass";
27663
27623
  var resolveCarriers = async (options, input) => {
@@ -30360,11 +30320,7 @@ var evaluateVoiceOutcomeContractEvidence = (report, input = {}) => {
30360
30320
  };
30361
30321
  };
30362
30322
  var assertVoiceOutcomeContractEvidence = (report, input = {}) => {
30363
- const assertion = evaluateVoiceOutcomeContractEvidence(report, input);
30364
- if (!assertion.ok) {
30365
- throw new Error(`Voice outcome contract evidence assertion failed: ${assertion.issues.join(" ")}`);
30366
- }
30367
- return assertion;
30323
+ return assertVoiceEvidence("Voice outcome contract evidence assertion failed", evaluateVoiceOutcomeContractEvidence(report, input));
30368
30324
  };
30369
30325
  var renderVoiceOutcomeContractHTML = (report, options = {}) => {
30370
30326
  const title = options.title ?? "Voice Outcome Contracts";
@@ -34010,11 +33966,7 @@ var evaluateVoiceProofTrendEvidence = (report, input = {}) => {
34010
33966
  };
34011
33967
  };
34012
33968
  var assertVoiceProofTrendEvidence = (report, input = {}) => {
34013
- const assertion = evaluateVoiceProofTrendEvidence(report, input);
34014
- if (!assertion.ok) {
34015
- throw new Error(`Voice proof trends assertion failed: ${assertion.issues.join(" ")}`);
34016
- }
34017
- return assertion;
33969
+ return assertVoiceEvidence("Voice proof trends assertion failed", evaluateVoiceProofTrendEvidence(report, input));
34018
33970
  };
34019
33971
  var DEFAULT_RECOMMENDATION_BUDGETS = {
34020
33972
  maxLiveP95Ms: 800,
@@ -35186,11 +35138,7 @@ var evaluateVoiceProviderContractMatrixEvidence = (report, input = {}) => {
35186
35138
  };
35187
35139
  };
35188
35140
  var assertVoiceProviderContractMatrixEvidence = (report, input = {}) => {
35189
- const assertion = evaluateVoiceProviderContractMatrixEvidence(report, input);
35190
- if (!assertion.ok) {
35191
- throw new Error(`Voice provider contract matrix assertion failed: ${assertion.issues.join(" ")}`);
35192
- }
35193
- return assertion;
35141
+ return assertVoiceEvidence("Voice provider contract matrix assertion failed", evaluateVoiceProviderContractMatrixEvidence(report, input));
35194
35142
  };
35195
35143
  var createVoiceProviderContractMatrixPreset = (profile, options) => {
35196
35144
  const contracts = ["llm", "stt", "tts"].flatMap((kind) => {
@@ -35380,11 +35328,7 @@ var evaluateVoiceProviderStackEvidence = (report, input = {}) => {
35380
35328
  };
35381
35329
  };
35382
35330
  var assertVoiceProviderStackEvidence = (report, input = {}) => {
35383
- const assertion = evaluateVoiceProviderStackEvidence(report, input);
35384
- if (!assertion.ok) {
35385
- throw new Error(`Voice provider stack assertion failed: ${assertion.issues.join(" ")}`);
35386
- }
35387
- return assertion;
35331
+ return assertVoiceEvidence("Voice provider stack assertion failed", evaluateVoiceProviderStackEvidence(report, input));
35388
35332
  };
35389
35333
 
35390
35334
  // src/realtimeChannel.ts
@@ -35622,11 +35566,7 @@ var evaluateVoiceRealtimeChannelEvidence = (report, input = {}) => {
35622
35566
  };
35623
35567
  };
35624
35568
  var assertVoiceRealtimeChannelEvidence = (report, input = {}) => {
35625
- const assertion = evaluateVoiceRealtimeChannelEvidence(report, input);
35626
- if (!assertion.ok) {
35627
- throw new Error(`Voice realtime channel assertion failed: ${assertion.issues.join(" ")}`);
35628
- }
35629
- return assertion;
35569
+ return assertVoiceEvidence("Voice realtime channel assertion failed", evaluateVoiceRealtimeChannelEvidence(report, input));
35630
35570
  };
35631
35571
  var renderVoiceRealtimeChannelMarkdown = (report) => [
35632
35572
  "# Voice Realtime Channel Proof",
@@ -35896,11 +35836,7 @@ var evaluateVoiceRealtimeProviderContractEvidence = (report, input = {}) => {
35896
35836
  };
35897
35837
  };
35898
35838
  var assertVoiceRealtimeProviderContractEvidence = (report, input = {}) => {
35899
- const assertion = evaluateVoiceRealtimeProviderContractEvidence(report, input);
35900
- if (!assertion.ok) {
35901
- throw new Error(`Voice realtime provider contract assertion failed: ${assertion.issues.join(" ")}`);
35902
- }
35903
- return assertion;
35839
+ return assertVoiceEvidence("Voice realtime provider contract assertion failed", evaluateVoiceRealtimeProviderContractEvidence(report, input));
35904
35840
  };
35905
35841
  var resolveMatrix = async (matrix) => typeof matrix === "function" ? await matrix() : matrix;
35906
35842
  var renderVoiceRealtimeProviderContractHTML = (report, title = "Voice Realtime Provider Contracts") => {
@@ -36644,11 +36580,7 @@ var evaluateVoiceToolContractEvidence = (report, input = {}) => {
36644
36580
  };
36645
36581
  };
36646
36582
  var assertVoiceToolContractEvidence = (report, input = {}) => {
36647
- const assertion = evaluateVoiceToolContractEvidence(report, input);
36648
- if (!assertion.ok) {
36649
- throw new Error(`Voice tool contract evidence assertion failed: ${assertion.issues.join(" ")}`);
36650
- }
36651
- return assertion;
36583
+ return assertVoiceEvidence("Voice tool contract evidence assertion failed", evaluateVoiceToolContractEvidence(report, input));
36652
36584
  };
36653
36585
  var renderVoiceToolContractHTML = (report, options = {}) => {
36654
36586
  const title = options.title ?? "Voice Tool Contracts";
@@ -36913,11 +36845,7 @@ var evaluateVoiceSimulationSuiteEvidence = (report, input = {}) => {
36913
36845
  };
36914
36846
  };
36915
36847
  var assertVoiceSimulationSuiteEvidence = (report, input = {}) => {
36916
- const assertion = evaluateVoiceSimulationSuiteEvidence(report, input);
36917
- if (!assertion.ok) {
36918
- throw new Error(`Voice simulation suite evidence assertion failed: ${assertion.issues.join(" ")}`);
36919
- }
36920
- return assertion;
36848
+ return assertVoiceEvidence("Voice simulation suite evidence assertion failed", evaluateVoiceSimulationSuiteEvidence(report, input));
36921
36849
  };
36922
36850
  var renderSection = (label, summary) => {
36923
36851
  if (!summary) {
@@ -39358,11 +39286,7 @@ var evaluateVoiceCampaignDialerProofEvidence = (report, input = {}) => {
39358
39286
  };
39359
39287
  };
39360
39288
  var assertVoiceCampaignDialerProofEvidence = (report, input = {}) => {
39361
- const assertion = evaluateVoiceCampaignDialerProofEvidence(report, input);
39362
- if (!assertion.ok) {
39363
- throw new Error(`Voice campaign dialer proof evidence assertion failed: ${assertion.issues.join(" ")}`);
39364
- }
39365
- return assertion;
39289
+ return assertVoiceEvidence("Voice campaign dialer proof evidence assertion failed", evaluateVoiceCampaignDialerProofEvidence(report, input));
39366
39290
  };
39367
39291
  // src/mediaPipelineSurfaces.ts
39368
39292
  import {
@@ -43112,11 +43036,7 @@ var evaluateVoiceAgentSquadContractEvidence = (reports, input = {}) => {
43112
43036
  };
43113
43037
  };
43114
43038
  var assertVoiceAgentSquadContractEvidence = (reports, input = {}) => {
43115
- const report = evaluateVoiceAgentSquadContractEvidence(reports, input);
43116
- if (!report.ok) {
43117
- throw new Error(`Voice agent squad contract evidence assertion failed: ${report.issues.join(" ")}`);
43118
- }
43119
- return report;
43039
+ return assertVoiceEvidence("Voice agent squad contract evidence assertion failed", evaluateVoiceAgentSquadContractEvidence(reports, input));
43120
43040
  };
43121
43041
  // src/phoneAgent.ts
43122
43042
  import { Elysia as Elysia72 } from "elysia";
@@ -43283,11 +43203,7 @@ var evaluateVoicePhoneAssistantEvidence = (report, input = {}) => {
43283
43203
  };
43284
43204
  };
43285
43205
  var assertVoicePhoneAssistantEvidence = (report, input = {}) => {
43286
- const assertion = evaluateVoicePhoneAssistantEvidence(report, input);
43287
- if (!assertion.ok) {
43288
- throw new Error(`Voice phone assistant evidence assertion failed: ${assertion.issues.join(" ")}`);
43289
- }
43290
- return assertion;
43206
+ return assertVoiceEvidence("Voice phone assistant evidence assertion failed", evaluateVoicePhoneAssistantEvidence(report, input));
43291
43207
  };
43292
43208
  var evaluateVoicePhoneCallControlEvidence = (input = {}) => {
43293
43209
  const issues = [];
@@ -43333,11 +43249,7 @@ var evaluateVoicePhoneCallControlEvidence = (input = {}) => {
43333
43249
  };
43334
43250
  };
43335
43251
  var assertVoicePhoneCallControlEvidence = (input = {}) => {
43336
- const assertion = evaluateVoicePhoneCallControlEvidence(input);
43337
- if (!assertion.ok) {
43338
- throw new Error(`Voice phone call-control evidence assertion failed: ${assertion.issues.join(" ")}`);
43339
- }
43340
- return assertion;
43252
+ return assertVoiceEvidence("Voice phone call-control evidence assertion failed", evaluateVoicePhoneCallControlEvidence(input));
43341
43253
  };
43342
43254
  var buildVoicePhoneAgentSetupInstructions = (input) => input.carriers.map((carrier) => {
43343
43255
  const entry = findCarrierMatrixEntry(input.matrix, carrier);
@@ -45385,11 +45297,7 @@ var evaluateVoiceProviderRoutingContractEvidence = (reports, input = {}) => {
45385
45297
  };
45386
45298
  };
45387
45299
  var assertVoiceProviderRoutingContractEvidence = (reports, input = {}) => {
45388
- const report = evaluateVoiceProviderRoutingContractEvidence(reports, input);
45389
- if (!report.ok) {
45390
- throw new Error(`Voice provider routing contract evidence assertion failed: ${report.issues.join(" ")}`);
45391
- }
45392
- return report;
45300
+ return assertVoiceEvidence("Voice provider routing contract evidence assertion failed", evaluateVoiceProviderRoutingContractEvidence(reports, input));
45393
45301
  };
45394
45302
  // src/readinessProfiles.ts
45395
45303
  var profileSurfaceLabels = {
@@ -0,0 +1,10 @@
1
+ export type VoiceEvidenceAssertion = {
2
+ ok: boolean;
3
+ issues: string[];
4
+ };
5
+ /**
6
+ * Throw if an evidence assertion failed, formatting its issues into the error
7
+ * message. Returns the assertion unchanged when it passed, so callers can
8
+ * `return assertVoiceEvidence(label, evaluate(...))`.
9
+ */
10
+ export declare const assertVoiceEvidence: <A extends VoiceEvidenceAssertion>(failureMessage: string, assertion: A) => A;
@@ -1505,6 +1505,14 @@ var useVoiceProofTrends = (path = "/api/voice/proof-trends", options = {}) => {
1505
1505
  };
1506
1506
  };
1507
1507
 
1508
+ // src/internal/evidence.ts
1509
+ var assertVoiceEvidence = (failureMessage, assertion) => {
1510
+ if (!assertion.ok) {
1511
+ throw new Error(`${failureMessage}: ${assertion.issues.join(" ")}`);
1512
+ }
1513
+ return assertion;
1514
+ };
1515
+
1508
1516
  // src/proofTrends.ts
1509
1517
  import { Elysia as Elysia4 } from "elysia";
1510
1518
 
@@ -5581,11 +5589,7 @@ var evaluateVoiceProofTrendEvidence = (report, input = {}) => {
5581
5589
  };
5582
5590
  };
5583
5591
  var assertVoiceProofTrendEvidence = (report, input = {}) => {
5584
- const assertion = evaluateVoiceProofTrendEvidence(report, input);
5585
- if (!assertion.ok) {
5586
- throw new Error(`Voice proof trends assertion failed: ${assertion.issues.join(" ")}`);
5587
- }
5588
- return assertion;
5592
+ return assertVoiceEvidence("Voice proof trends assertion failed", evaluateVoiceProofTrendEvidence(report, input));
5589
5593
  };
5590
5594
  var DEFAULT_RECOMMENDATION_BUDGETS = {
5591
5595
  maxLiveP95Ms: 800,
@@ -3071,6 +3071,14 @@ var createVoiceLiveOpsStore = (options = {}) => {
3071
3071
  };
3072
3072
  };
3073
3073
 
3074
+ // src/internal/evidence.ts
3075
+ var assertVoiceEvidence = (failureMessage, assertion) => {
3076
+ if (!assertion.ok) {
3077
+ throw new Error(`${failureMessage}: ${assertion.issues.join(" ")}`);
3078
+ }
3079
+ return assertion;
3080
+ };
3081
+
3074
3082
  // src/liveOps.ts
3075
3083
  import { Elysia } from "elysia";
3076
3084
 
@@ -4187,11 +4195,7 @@ var evaluateVoiceLiveOpsEvidence = (input = {}) => {
4187
4195
  };
4188
4196
  };
4189
4197
  var assertVoiceLiveOpsEvidence = (input = {}) => {
4190
- const assertion = evaluateVoiceLiveOpsEvidence(input);
4191
- if (!assertion.ok) {
4192
- throw new Error(`Voice live-ops evidence assertion failed: ${assertion.issues.join(" ")}`);
4193
- }
4194
- return assertion;
4198
+ return assertVoiceEvidence("Voice live-ops evidence assertion failed", evaluateVoiceLiveOpsEvidence(input));
4195
4199
  };
4196
4200
  var evaluateVoiceLiveOpsControlEvidence = (input = {}) => {
4197
4201
  const issues = [];
@@ -4239,11 +4243,7 @@ var evaluateVoiceLiveOpsControlEvidence = (input = {}) => {
4239
4243
  };
4240
4244
  };
4241
4245
  var assertVoiceLiveOpsControlEvidence = (input = {}) => {
4242
- const assertion = evaluateVoiceLiveOpsControlEvidence(input);
4243
- if (!assertion.ok) {
4244
- throw new Error(`Voice live-ops control evidence assertion failed: ${assertion.issues.join(" ")}`);
4245
- }
4246
- return assertion;
4246
+ return assertVoiceEvidence("Voice live-ops control evidence assertion failed", evaluateVoiceLiveOpsControlEvidence(input));
4247
4247
  };
4248
4248
  var createVoiceMemoryLiveOpsControlStore = () => {
4249
4249
  const states = new Map;
@@ -11593,6 +11593,14 @@ var createVoiceOperationsRecordRoutes = (options) => {
11593
11593
  import { Buffer as Buffer3 } from "buffer";
11594
11594
  import { Elysia as Elysia6 } from "elysia";
11595
11595
 
11596
+ // src/internal/evidence.ts
11597
+ var assertVoiceEvidence = (failureMessage, assertion) => {
11598
+ if (!assertion.ok) {
11599
+ throw new Error(`${failureMessage}: ${assertion.issues.join(" ")}`);
11600
+ }
11601
+ return assertion;
11602
+ };
11603
+
11596
11604
  // src/telephonyOutcome.ts
11597
11605
  import { Elysia as Elysia5 } from "elysia";
11598
11606
  var DEFAULT_COMPLETED_STATUSES = [
@@ -11758,11 +11766,7 @@ var evaluateVoiceTelephonyWebhookNormalizationEvidence = (input = {}) => {
11758
11766
  };
11759
11767
  };
11760
11768
  var assertVoiceTelephonyWebhookNormalizationEvidence = (input = {}) => {
11761
- const assertion = evaluateVoiceTelephonyWebhookNormalizationEvidence(input);
11762
- if (!assertion.ok) {
11763
- throw new Error(`Voice telephony webhook normalization evidence assertion failed: ${assertion.issues.join(" ")}`);
11764
- }
11765
- return assertion;
11769
+ return assertVoiceEvidence("Voice telephony webhook normalization evidence assertion failed", evaluateVoiceTelephonyWebhookNormalizationEvidence(input));
11766
11770
  };
11767
11771
  var normalizeToken = (value) => typeof value === "string" ? value.trim().toLowerCase().replace(/\s+/g, "-").replace(/_+/g, "-") : undefined;
11768
11772
  var firstString2 = (source, keys) => {
package/dist/vue/index.js CHANGED
@@ -1426,6 +1426,14 @@ var VoicePlatformCoverage = defineComponent4({
1426
1426
  // src/vue/VoiceProofTrends.ts
1427
1427
  import { defineComponent as defineComponent5, h as h5 } from "vue";
1428
1428
 
1429
+ // src/internal/evidence.ts
1430
+ var assertVoiceEvidence = (failureMessage, assertion) => {
1431
+ if (!assertion.ok) {
1432
+ throw new Error(`${failureMessage}: ${assertion.issues.join(" ")}`);
1433
+ }
1434
+ return assertion;
1435
+ };
1436
+
1429
1437
  // src/proofTrends.ts
1430
1438
  import { Elysia as Elysia4 } from "elysia";
1431
1439
 
@@ -5502,11 +5510,7 @@ var evaluateVoiceProofTrendEvidence = (report, input = {}) => {
5502
5510
  };
5503
5511
  };
5504
5512
  var assertVoiceProofTrendEvidence = (report, input = {}) => {
5505
- const assertion = evaluateVoiceProofTrendEvidence(report, input);
5506
- if (!assertion.ok) {
5507
- throw new Error(`Voice proof trends assertion failed: ${assertion.issues.join(" ")}`);
5508
- }
5509
- return assertion;
5513
+ return assertVoiceEvidence("Voice proof trends assertion failed", evaluateVoiceProofTrendEvidence(report, input));
5510
5514
  };
5511
5515
  var DEFAULT_RECOMMENDATION_BUDGETS = {
5512
5516
  maxLiveP95Ms: 800,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@absolutejs/voice",
3
- "version": "0.0.22-beta.530",
3
+ "version": "0.0.22-beta.531",
4
4
  "description": "Voice primitives and Elysia plugin for AbsoluteJS",
5
5
  "repository": {
6
6
  "type": "git",