@absolutejs/voice 0.0.22-beta.362 → 0.0.22-beta.363

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 CHANGED
@@ -31986,6 +31986,14 @@ var resolveProviderOrchestration = async (options, input) => {
31986
31986
  }
31987
31987
  return typeof options.providerOrchestration === "function" ? await options.providerOrchestration(input) : options.providerOrchestration;
31988
31988
  };
31989
+ var isVoiceProfileSwitchReadinessReport = (value) => typeof value.status === "string" && typeof value.generatedAt === "string" && typeof value.summary === "object";
31990
+ var resolveProfileSwitchReadiness = async (options, input) => {
31991
+ if (options.profileSwitchReadiness === false || options.profileSwitchReadiness === undefined) {
31992
+ return;
31993
+ }
31994
+ const value = typeof options.profileSwitchReadiness === "function" ? await options.profileSwitchReadiness(input) : options.profileSwitchReadiness;
31995
+ return isVoiceProfileSwitchReadinessReport(value) ? value : buildVoiceProfileSwitchReadinessReport(value);
31996
+ };
31989
31997
  var resolveProviderStack = async (options, input) => {
31990
31998
  if (options.providerStack === false || options.providerStack === undefined) {
31991
31999
  return;
@@ -32434,6 +32442,7 @@ var buildVoiceProductionReadinessReport = async (options, input = {}) => {
32434
32442
  providerRoutingContracts,
32435
32443
  providerSlo,
32436
32444
  providerOrchestration,
32445
+ profileSwitchReadiness,
32437
32446
  providerStack,
32438
32447
  providerContractMatrix,
32439
32448
  phoneAgentSmokes,
@@ -32480,6 +32489,7 @@ var buildVoiceProductionReadinessReport = async (options, input = {}) => {
32480
32489
  resolveProviderRoutingContracts(options, { query, request }),
32481
32490
  resolveProviderSlo(options, { query, request }),
32482
32491
  resolveProviderOrchestration(options, { query, request }),
32492
+ resolveProfileSwitchReadiness(options, { query, request }),
32483
32493
  resolveProviderStack(options, { query, request }),
32484
32494
  resolveProviderContractMatrix(options, { query, request }),
32485
32495
  resolvePhoneAgentSmokes(options, { query, request }),
@@ -33208,6 +33218,28 @@ var buildVoiceProductionReadinessReport = async (options, input = {}) => {
33208
33218
  ]
33209
33219
  });
33210
33220
  }
33221
+ if (profileSwitchReadiness) {
33222
+ const issueLabels = profileSwitchReadiness.issues.map((issue) => issue.code);
33223
+ checks.push({
33224
+ detail: profileSwitchReadiness.status === "pass" ? `${profileSwitchReadiness.summary.decisions} profile switch guard decision(s) are backed by readiness evidence.` : issueLabels.length > 0 ? `Profile switch readiness issues: ${issueLabels.join(", ")}.` : "Profile switch readiness needs attention.",
33225
+ href: options.links?.profileSwitchReadiness ?? "/voice/profile-switch-readiness",
33226
+ label: "Profile switch readiness",
33227
+ status: profileSwitchReadiness.status,
33228
+ value: `${profileSwitchReadiness.summary.sessions}/${profileSwitchReadiness.summary.decisions}`,
33229
+ actions: profileSwitchReadiness.status === "pass" ? [] : [
33230
+ {
33231
+ description: "Open profile switch readiness to inspect policy proof, audit evidence, trace evidence, and live decisions.",
33232
+ href: options.links?.profileSwitchReadiness ?? "/voice/profile-switch-readiness",
33233
+ label: "Open profile readiness"
33234
+ },
33235
+ {
33236
+ description: "Open live profile switch decisions recorded from audit and trace stores.",
33237
+ href: options.links?.profileSwitchLiveDecisions ?? "/voice/profile-switch-live-decisions",
33238
+ label: "Open live decisions"
33239
+ }
33240
+ ]
33241
+ });
33242
+ }
33211
33243
  if (audit) {
33212
33244
  const missingLabels = audit.missing.map((requirement) => requirement.label ?? requirement.type);
33213
33245
  checks.push({
@@ -33399,6 +33431,9 @@ var buildVoiceProductionReadinessReport = async (options, input = {}) => {
33399
33431
  opsActions: "/voice/ops-actions",
33400
33432
  opsRecovery: "/ops-recovery",
33401
33433
  phoneAgentSmoke: "/sessions",
33434
+ profileSwitchLiveDecisions: "/voice/profile-switch-live-decisions",
33435
+ profileSwitchPolicy: "/voice/profile-switch-policy",
33436
+ profileSwitchReadiness: "/voice/profile-switch-readiness",
33402
33437
  telephonyMedia: "/voice/telephony-media",
33403
33438
  telephonyWebhookSecurity: "/api/voice/telephony/webhook-security",
33404
33439
  providerContracts: "/provider-contracts",
@@ -33452,6 +33487,15 @@ var buildVoiceProductionReadinessReport = async (options, input = {}) => {
33452
33487
  providerContractMatrix,
33453
33488
  providerOrchestration: providerOrchestrationSummary,
33454
33489
  providerRecovery,
33490
+ profileSwitchReadiness: profileSwitchReadiness ? {
33491
+ auditEvents: profileSwitchReadiness.summary.auditEvents,
33492
+ decisions: profileSwitchReadiness.summary.decisions,
33493
+ issues: profileSwitchReadiness.issues.length,
33494
+ policyCases: profileSwitchReadiness.summary.policyCases,
33495
+ sessions: profileSwitchReadiness.summary.sessions,
33496
+ status: profileSwitchReadiness.status,
33497
+ traceEvents: profileSwitchReadiness.summary.traceEvents
33498
+ } : undefined,
33455
33499
  phoneAgentSmokes: phoneAgentSmokeSummary,
33456
33500
  telephonyMedia: telephonyMediaSummary,
33457
33501
  telephonyWebhookSecurity: telephonyWebhookSecuritySummary,
@@ -22,6 +22,7 @@ import { type VoiceObservabilityExportDeliveryHistory, type VoiceObservabilityEx
22
22
  import type { VoiceMediaPipelineReport } from './mediaPipelineRoutes';
23
23
  import type { VoiceTelephonyMediaReport } from './telephonyMediaRoutes';
24
24
  import type { MediaWebRTCStatsReport } from '@absolutejs/media';
25
+ import { type VoiceProfileSwitchReadinessOptions, type VoiceProfileSwitchReadinessReport } from './profileSwitchRecommendation';
25
26
  export type VoiceProductionReadinessObservabilityExportDeliveryHistoryOptions = {
26
27
  failOnMissing?: boolean;
27
28
  failOnStale?: boolean;
@@ -140,6 +141,9 @@ export type VoiceProductionReadinessReport = {
140
141
  opsActions?: string;
141
142
  opsRecovery?: string;
142
143
  phoneAgentSmoke?: string;
144
+ profileSwitchLiveDecisions?: string;
145
+ profileSwitchPolicy?: string;
146
+ profileSwitchReadiness?: string;
143
147
  telephonyWebhookSecurity?: string;
144
148
  telephonyMedia?: string;
145
149
  providerContracts?: string;
@@ -283,6 +287,15 @@ export type VoiceProductionReadinessReport = {
283
287
  warned: number;
284
288
  };
285
289
  providerRecovery: VoiceProviderFallbackRecoverySummary;
290
+ profileSwitchReadiness?: {
291
+ auditEvents: number;
292
+ decisions: number;
293
+ issues: number;
294
+ policyCases?: number;
295
+ sessions: number;
296
+ status: VoiceProductionReadinessStatus;
297
+ traceEvents: number;
298
+ };
286
299
  phoneAgentSmokes?: {
287
300
  failed: number;
288
301
  passed: number;
@@ -540,6 +553,10 @@ export type VoiceProductionReadinessRoutesOptions = {
540
553
  query: Record<string, unknown>;
541
554
  request: Request;
542
555
  }) => Promise<VoiceProviderOrchestrationReport> | VoiceProviderOrchestrationReport);
556
+ profileSwitchReadiness?: false | VoiceProfileSwitchReadinessReport | VoiceProfileSwitchReadinessOptions | ((input: {
557
+ query: Record<string, unknown>;
558
+ request: Request;
559
+ }) => Promise<VoiceProfileSwitchReadinessReport | VoiceProfileSwitchReadinessOptions> | VoiceProfileSwitchReadinessReport | VoiceProfileSwitchReadinessOptions);
543
560
  providerStack?: false | VoiceProviderStackCapabilityGapReport | ((input: {
544
561
  query: Record<string, unknown>;
545
562
  request: Request;
@@ -56,6 +56,9 @@ export declare const useVoiceReadinessFailures: (path?: string, options?: VoiceR
56
56
  readonly opsActions?: string | undefined;
57
57
  readonly opsRecovery?: string | undefined;
58
58
  readonly phoneAgentSmoke?: string | undefined;
59
+ readonly profileSwitchLiveDecisions?: string | undefined;
60
+ readonly profileSwitchPolicy?: string | undefined;
61
+ readonly profileSwitchReadiness?: string | undefined;
59
62
  readonly telephonyWebhookSecurity?: string | undefined;
60
63
  readonly telephonyMedia?: string | undefined;
61
64
  readonly providerContracts?: string | undefined;
@@ -369,6 +372,15 @@ export declare const useVoiceReadinessFailures: (path?: string, options?: VoiceR
369
372
  readonly unresolvedErrors: number;
370
373
  readonly unresolvedSessions: number;
371
374
  };
375
+ readonly profileSwitchReadiness?: {
376
+ readonly auditEvents: number;
377
+ readonly decisions: number;
378
+ readonly issues: number;
379
+ readonly policyCases?: number | undefined;
380
+ readonly sessions: number;
381
+ readonly status: import("..").VoiceProductionReadinessStatus;
382
+ readonly traceEvents: number;
383
+ } | undefined;
372
384
  readonly phoneAgentSmokes?: {
373
385
  readonly failed: number;
374
386
  readonly passed: number;
@@ -489,6 +501,9 @@ export declare const useVoiceReadinessFailures: (path?: string, options?: VoiceR
489
501
  readonly opsActions?: string | undefined;
490
502
  readonly opsRecovery?: string | undefined;
491
503
  readonly phoneAgentSmoke?: string | undefined;
504
+ readonly profileSwitchLiveDecisions?: string | undefined;
505
+ readonly profileSwitchPolicy?: string | undefined;
506
+ readonly profileSwitchReadiness?: string | undefined;
492
507
  readonly telephonyWebhookSecurity?: string | undefined;
493
508
  readonly telephonyMedia?: string | undefined;
494
509
  readonly providerContracts?: string | undefined;
@@ -802,6 +817,15 @@ export declare const useVoiceReadinessFailures: (path?: string, options?: VoiceR
802
817
  readonly unresolvedErrors: number;
803
818
  readonly unresolvedSessions: number;
804
819
  };
820
+ readonly profileSwitchReadiness?: {
821
+ readonly auditEvents: number;
822
+ readonly decisions: number;
823
+ readonly issues: number;
824
+ readonly policyCases?: number | undefined;
825
+ readonly sessions: number;
826
+ readonly status: import("..").VoiceProductionReadinessStatus;
827
+ readonly traceEvents: number;
828
+ } | undefined;
805
829
  readonly phoneAgentSmokes?: {
806
830
  readonly failed: number;
807
831
  readonly passed: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@absolutejs/voice",
3
- "version": "0.0.22-beta.362",
3
+ "version": "0.0.22-beta.363",
4
4
  "description": "Voice primitives and Elysia plugin for AbsoluteJS",
5
5
  "repository": {
6
6
  "type": "git",