@absolutejs/voice 0.0.22-beta.370 → 0.0.22-beta.371

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
@@ -1502,6 +1502,8 @@ createVoiceProductionReadinessRoutes({
1502
1502
  });
1503
1503
  ```
1504
1504
 
1505
+ The readiness check includes recovery actions from `buildVoiceRealCallProfileRecoveryActions(...)`, so failed gates can point operators at the profile history report, browser/phone proof, missing provider-role evidence, operations records, and production-readiness refresh instead of only saying "failed."
1506
+
1505
1507
  Use `createVoiceProfileTraceTagger(...)` when the app already has a trace store and needs every appended trace to carry a benchmark profile label. It wraps any `VoiceTraceEventStore`, preserves the underlying store behavior, and adds `profileId`/`benchmarkProfileId` metadata and payload fields that real-call profile history can ingest later.
1506
1508
 
1507
1509
  ```ts
@@ -4555,11 +4555,77 @@ var buildRealCallProfileReadinessIssues = (report, options) => {
4555
4555
  }
4556
4556
  return { issues, warnings };
4557
4557
  };
4558
+ var uniqueRealCallProfileActions = (actions) => {
4559
+ const seen = new Set;
4560
+ return actions.filter((action) => {
4561
+ const key = `${action.method ?? "GET"}:${action.href}:${action.label}`;
4562
+ if (seen.has(key)) {
4563
+ return false;
4564
+ }
4565
+ seen.add(key);
4566
+ return true;
4567
+ });
4568
+ };
4569
+ var buildVoiceRealCallProfileRecoveryActions = (report, options = {}) => {
4570
+ const actions = [
4571
+ {
4572
+ description: "Open the current real-call profile history report and profile defaults.",
4573
+ href: options.href ?? "/voice/real-call-profile-history",
4574
+ label: "Open real-call profile history"
4575
+ },
4576
+ {
4577
+ description: "Refresh production readiness after collecting or replaying profile evidence.",
4578
+ href: options.productionReadinessHref ?? "/production-readiness",
4579
+ label: "Refresh production readiness"
4580
+ }
4581
+ ];
4582
+ const requiredProfiles = new Set(options.requiredProfileIds ?? []);
4583
+ const profilesById = new Map(report.defaults.profiles.map((profile) => [profile.profileId, profile]));
4584
+ const missingProfiles = [...requiredProfiles].filter((profileId) => !profilesById.has(profileId));
4585
+ const warningProfiles = report.defaults.profiles.filter((profile) => (requiredProfiles.size === 0 || requiredProfiles.has(profile.profileId)) && profile.status !== "pass");
4586
+ const missingRoleProfiles = report.defaults.profiles.filter((profile) => (options.requiredProviderRoles ?? []).some((role) => !profile.providerRoutes[role]));
4587
+ const ageMs = report.trend.ageMs ?? (report.generatedAt ? Date.now() - new Date(report.generatedAt).getTime() : undefined);
4588
+ if (missingProfiles.length > 0 || warningProfiles.length > 0 || missingRoleProfiles.length > 0 || options.minCycles !== undefined && (report.summary.cycles ?? 0) < options.minCycles || options.minActionableProfiles !== undefined && report.defaults.summary.actionableProfiles < options.minActionableProfiles) {
4589
+ actions.push({
4590
+ description: "Run browser profile proof to collect microphone, WebSocket, live-latency, and provider traces for missing profiles.",
4591
+ href: options.browserProofHref ?? "/voice/browser-call-profiles",
4592
+ label: "Run browser profile proof"
4593
+ });
4594
+ actions.push({
4595
+ description: "Run phone profile proof when required profiles depend on carrier, telephony media, or noisy-call evidence.",
4596
+ href: options.phoneProofHref ?? "/api/voice/phone/smoke",
4597
+ label: "Run phone profile proof"
4598
+ });
4599
+ }
4600
+ if (options.maxAgeMs !== undefined && (ageMs === undefined || ageMs > options.maxAgeMs)) {
4601
+ actions.push({
4602
+ description: "Collect fresh real-call profile traces because the current history artifact is stale.",
4603
+ href: options.browserProofHref ?? "/voice/browser-call-profiles",
4604
+ label: "Collect fresh profile evidence"
4605
+ });
4606
+ }
4607
+ if (missingRoleProfiles.length > 0 || report.defaults.summary.actionableProfiles < (options.minActionableProfiles ?? 1)) {
4608
+ actions.push({
4609
+ description: "Collect missing LLM/STT/TTS provider-role evidence so profile defaults can become actionable.",
4610
+ href: options.sourceHref ?? "/api/voice/real-call-profile-history",
4611
+ label: "Collect missing provider-role evidence"
4612
+ });
4613
+ }
4614
+ if (report.recommendations.profiles.some((profile) => profile.status !== "pass") || report.defaults.profiles.some((profile) => profile.status !== "pass")) {
4615
+ actions.push({
4616
+ description: "Open operations records to inspect the sessions behind failing or warning profile evidence.",
4617
+ href: options.operationsRecordsHref ?? "/voice-operations",
4618
+ label: "Open operations records"
4619
+ });
4620
+ }
4621
+ return uniqueRealCallProfileActions(actions);
4622
+ };
4558
4623
  var buildVoiceRealCallProfileReadinessCheck = (report, options = {}) => {
4559
4624
  const { issues, warnings } = buildRealCallProfileReadinessIssues(report, options);
4560
4625
  const status = issues.length > 0 ? "fail" : warnings.length > 0 && options.failOnWarnings === true ? "fail" : warnings.length > 0 ? "warn" : "pass";
4561
4626
  const detail = status === "pass" ? `${String(report.summary.profileCount)} profile(s), ${String(report.summary.cycles ?? 0)} cycle(s), ${String(report.defaults.summary.actionableProfiles)} actionable default(s).` : [...issues, ...warnings].join(" ");
4562
4627
  return {
4628
+ actions: buildVoiceRealCallProfileRecoveryActions(report, options),
4563
4629
  detail,
4564
4630
  gateExplanation: {
4565
4631
  evidenceHref: options.href ?? "/api/voice/real-call-profile-history",
package/dist/index.d.ts CHANGED
@@ -30,12 +30,12 @@ export { assertVoicePlatformCoverage, buildVoicePlatformCoverageSummary, createV
30
30
  export { assertVoiceCompetitiveCoverage, buildVoiceCompetitiveCoverageReport, createVoiceCompetitiveCoverageRoutes, evaluateVoiceCompetitiveCoverage, renderVoiceCompetitiveCoverageHTML, renderVoiceCompetitiveCoverageMarkdown } from './competitiveCoverage';
31
31
  export type { VoiceCompetitiveCoverageAssertionInput, VoiceCompetitiveCoverageAssertionReport, VoiceCompetitiveCoverageIssue, VoiceCompetitiveCoverageLevel, VoiceCompetitiveCoverageReport, VoiceCompetitiveCoverageReportInput, VoiceCompetitiveCoverageRoutesOptions, VoiceCompetitiveCoverageStatus, VoiceCompetitiveCoverageSummary, VoiceCompetitiveDepthLevel, VoiceCompetitiveEvidence, VoiceCompetitiveSurface } from './competitiveCoverage';
32
32
  export type { VoicePlatformCoverageAssertionInput, VoicePlatformCoverageAssertionReport, VoicePlatformCoverageEvidence, VoicePlatformCoverageRoutesOptions, VoicePlatformCoverageStatus, VoicePlatformCoverageSummary, VoicePlatformCoverageSummaryInput, VoicePlatformCoverageSurface } from './platformCoverage';
33
- export { assertVoiceProofTrendEvidence, buildEmptyVoiceProofTrendReport, buildVoiceProofTrendProfileSummaries, buildVoiceProofTrendRecommendationReport, buildVoiceProofTrendReportFromRealCallProfiles, buildVoiceProofTrendReport, buildVoiceRealCallProfileEvidenceFromTraceEvents, buildVoiceRealCallProfileDefaults, buildVoiceRealCallProfileHistoryReport, buildVoiceRealCallProfileReadinessCheck, createVoiceProofTrendRecommendationRoutes, createVoiceProofTrendRoutes, createVoiceRealCallProfileHistoryRoutes, DEFAULT_VOICE_PROOF_TREND_PROFILE_DEFINITIONS, DEFAULT_VOICE_PROOF_TRENDS_MAX_AGE_MS, evaluateVoiceProofTrendEvidence, formatVoiceProofTrendAge, loadVoiceRealCallProfileEvidenceFromTraceStore, normalizeVoiceProofTrendReport, readVoiceProofTrendReportFile, renderVoiceProofTrendRecommendationHTML, renderVoiceProofTrendRecommendationMarkdown, renderVoiceRealCallProfileHistoryHTML, renderVoiceRealCallProfileHistoryMarkdown, resolveVoiceRealCallProfileProviderRoute } from './proofTrends';
33
+ export { assertVoiceProofTrendEvidence, buildEmptyVoiceProofTrendReport, buildVoiceProofTrendProfileSummaries, buildVoiceProofTrendRecommendationReport, buildVoiceProofTrendReportFromRealCallProfiles, buildVoiceProofTrendReport, buildVoiceRealCallProfileEvidenceFromTraceEvents, buildVoiceRealCallProfileDefaults, buildVoiceRealCallProfileHistoryReport, buildVoiceRealCallProfileReadinessCheck, buildVoiceRealCallProfileRecoveryActions, createVoiceProofTrendRecommendationRoutes, createVoiceProofTrendRoutes, createVoiceRealCallProfileHistoryRoutes, DEFAULT_VOICE_PROOF_TREND_PROFILE_DEFINITIONS, DEFAULT_VOICE_PROOF_TRENDS_MAX_AGE_MS, evaluateVoiceProofTrendEvidence, formatVoiceProofTrendAge, loadVoiceRealCallProfileEvidenceFromTraceStore, normalizeVoiceProofTrendReport, readVoiceProofTrendReportFile, renderVoiceProofTrendRecommendationHTML, renderVoiceProofTrendRecommendationMarkdown, renderVoiceRealCallProfileHistoryHTML, renderVoiceRealCallProfileHistoryMarkdown, resolveVoiceRealCallProfileProviderRoute } from './proofTrends';
34
34
  export { applyVoiceProfileSwitchGuard, buildVoiceProfileSwitchReadinessReport, buildVoiceProfileSwitchLiveDecisionReport, createVoiceProfileSwitchLiveDecisionRoutes, createVoiceProfileSwitchPolicyProofRoutes, createVoiceProfileSwitchReadinessRoutes, recommendVoiceProfileSwitch, renderVoiceProfileSwitchLiveDecisionHTML, renderVoiceProfileSwitchPolicyProofHTML, renderVoiceProfileSwitchReadinessHTML, runVoiceProfileSwitchPolicyProof } from './profileSwitchRecommendation';
35
35
  export type { VoiceProfileSwitchGuardAction, VoiceProfileSwitchGuardDecision, VoiceProfileSwitchGuardMode, VoiceProfileSwitchGuardOptions, VoiceProfileSwitchObservedSignals, VoiceProfileSwitchLiveDecisionEvidence, VoiceProfileSwitchLiveDecisionReport, VoiceProfileSwitchLiveDecisionReportOptions, VoiceProfileSwitchLiveDecisionRoutesOptions, VoiceProfileSwitchLiveDecisionSession, VoiceProfileSwitchPolicyProofCase, VoiceProfileSwitchPolicyProofCaseResult, VoiceProfileSwitchPolicyProofOptions, VoiceProfileSwitchPolicyProofReport, VoiceProfileSwitchPolicyProofRoutesOptions, VoiceProfileSwitchReadinessIssue, VoiceProfileSwitchReadinessOptions, VoiceProfileSwitchReadinessReport, VoiceProfileSwitchReadinessRoutesOptions, VoiceProfileSwitchReadinessStatus, VoiceProfileSwitchRecommendation, VoiceProfileSwitchRecommendationOptions } from './profileSwitchRecommendation';
36
36
  export { buildVoiceProviderDecisionTraceReport, createVoiceProviderDecisionTraceEvent, createVoiceProviderDecisionTraceRoutes, listVoiceProviderDecisionTraces, renderVoiceProviderDecisionTraceHTML, renderVoiceProviderDecisionTraceMarkdown } from './providerDecisionTraces';
37
37
  export type { VoiceProviderDecisionStatus, VoiceProviderDecisionSurfaceReport, VoiceProviderDecisionTrace, VoiceProviderDecisionTraceInput, VoiceProviderDecisionTraceIssue, VoiceProviderDecisionTraceReport, VoiceProviderDecisionTraceReportOptions, VoiceProviderDecisionTraceRoutesOptions } from './providerDecisionTraces';
38
- export type { VoiceProofTrendAssertionInput, VoiceProofTrendAssertionReport, VoiceProofTrendCycle, VoiceProofTrendProfileDefinition, VoiceProofTrendProfileRecommendation, VoiceProofTrendProfileSummaryOptions, VoiceProofTrendProfileSummary, VoiceProofTrendProviderRecommendation, VoiceProofTrendProviderSummary, VoiceProofTrendRecommendation, VoiceProofTrendRecommendationOptions, VoiceProofTrendRecommendationReport, VoiceProofTrendRecommendationRoutesOptions, VoiceProofTrendRecommendationStatus, VoiceProofTrendRecommendationSurface, VoiceProofTrendRealCallProfileEvidence, VoiceProofTrendRealCallProfileReportOptions, VoiceProofTrendReport, VoiceProofTrendReportInput, VoiceProofTrendRoutesOptions, VoiceProofTrendRuntimeChannelSummary, VoiceProofTrendStatus, VoiceProofTrendSummary, VoiceRealCallProfileDefault, VoiceRealCallProfileDefaultsOptions, VoiceRealCallProfileDefaultsReport, VoiceRealCallProfileHistoryOptions, VoiceRealCallProfileHistoryReport, VoiceRealCallProfileHistoryRoutesOptions, VoiceRealCallProfileProviderRouteOptions, VoiceRealCallProfileReadinessCheckOptions, VoiceRealCallProfileTraceEvidenceOptions, VoiceRealCallProfileTraceStoreEvidenceOptions } from './proofTrends';
38
+ export type { VoiceProofTrendAssertionInput, VoiceProofTrendAssertionReport, VoiceProofTrendCycle, VoiceProofTrendProfileDefinition, VoiceProofTrendProfileRecommendation, VoiceProofTrendProfileSummaryOptions, VoiceProofTrendProfileSummary, VoiceProofTrendProviderRecommendation, VoiceProofTrendProviderSummary, VoiceProofTrendRecommendation, VoiceProofTrendRecommendationOptions, VoiceProofTrendRecommendationReport, VoiceProofTrendRecommendationRoutesOptions, VoiceProofTrendRecommendationStatus, VoiceProofTrendRecommendationSurface, VoiceProofTrendRealCallProfileEvidence, VoiceProofTrendRealCallProfileReportOptions, VoiceProofTrendReport, VoiceProofTrendReportInput, VoiceProofTrendRoutesOptions, VoiceProofTrendRuntimeChannelSummary, VoiceProofTrendStatus, VoiceProofTrendSummary, VoiceRealCallProfileDefault, VoiceRealCallProfileDefaultsOptions, VoiceRealCallProfileDefaultsReport, VoiceRealCallProfileHistoryOptions, VoiceRealCallProfileHistoryReport, VoiceRealCallProfileHistoryRoutesOptions, VoiceRealCallProfileProviderRouteOptions, VoiceRealCallProfileReadinessCheckOptions, VoiceRealCallProfileRecoveryActionOptions, VoiceRealCallProfileTraceEvidenceOptions, VoiceRealCallProfileTraceStoreEvidenceOptions } from './proofTrends';
39
39
  export { assertVoiceSloCalibration, buildVoiceSloCalibrationReport, buildVoiceSloReadinessThresholdReport, createVoiceSloReadinessThresholdOptions, createVoiceSloReadinessThresholdRoutes, createVoiceSloThresholdProfile, createVoiceSloCalibrationRoutes, renderVoiceSloCalibrationMarkdown, renderVoiceSloReadinessThresholdHTML, renderVoiceSloReadinessThresholdMarkdown } from './sloCalibration';
40
40
  export type { VoiceSloCalibrationMetricKey, VoiceSloCalibrationOptions, VoiceSloCalibrationReport, VoiceSloCalibrationRoutesOptions, VoiceSloCalibrationSample, VoiceSloCalibrationStatus, VoiceSloCalibrationThreshold, VoiceSloCalibrationThresholds, VoiceSloReadinessThresholdReport, VoiceSloReadinessThresholdReportOptions, VoiceSloReadinessThresholdOptions, VoiceSloReadinessThresholdRoutesOptions, VoiceSloThresholdProfile } from './sloCalibration';
41
41
  export { assertVoiceLiveOpsControlEvidence, assertVoiceLiveOpsEvidence, buildVoiceLiveOpsControlState, createVoiceLiveOpsController, createVoiceLiveOpsRoutes, createVoiceMemoryLiveOpsControlStore, evaluateVoiceLiveOpsControlEvidence, evaluateVoiceLiveOpsEvidence, getVoiceLiveOpsControlStatus, VOICE_LIVE_OPS_ACTIONS } from './liveOps';
package/dist/index.js CHANGED
@@ -16024,11 +16024,77 @@ var buildRealCallProfileReadinessIssues = (report, options) => {
16024
16024
  }
16025
16025
  return { issues, warnings };
16026
16026
  };
16027
+ var uniqueRealCallProfileActions = (actions) => {
16028
+ const seen = new Set;
16029
+ return actions.filter((action) => {
16030
+ const key = `${action.method ?? "GET"}:${action.href}:${action.label}`;
16031
+ if (seen.has(key)) {
16032
+ return false;
16033
+ }
16034
+ seen.add(key);
16035
+ return true;
16036
+ });
16037
+ };
16038
+ var buildVoiceRealCallProfileRecoveryActions = (report, options = {}) => {
16039
+ const actions = [
16040
+ {
16041
+ description: "Open the current real-call profile history report and profile defaults.",
16042
+ href: options.href ?? "/voice/real-call-profile-history",
16043
+ label: "Open real-call profile history"
16044
+ },
16045
+ {
16046
+ description: "Refresh production readiness after collecting or replaying profile evidence.",
16047
+ href: options.productionReadinessHref ?? "/production-readiness",
16048
+ label: "Refresh production readiness"
16049
+ }
16050
+ ];
16051
+ const requiredProfiles = new Set(options.requiredProfileIds ?? []);
16052
+ const profilesById = new Map(report.defaults.profiles.map((profile) => [profile.profileId, profile]));
16053
+ const missingProfiles = [...requiredProfiles].filter((profileId) => !profilesById.has(profileId));
16054
+ const warningProfiles = report.defaults.profiles.filter((profile) => (requiredProfiles.size === 0 || requiredProfiles.has(profile.profileId)) && profile.status !== "pass");
16055
+ const missingRoleProfiles = report.defaults.profiles.filter((profile) => (options.requiredProviderRoles ?? []).some((role) => !profile.providerRoutes[role]));
16056
+ const ageMs = report.trend.ageMs ?? (report.generatedAt ? Date.now() - new Date(report.generatedAt).getTime() : undefined);
16057
+ if (missingProfiles.length > 0 || warningProfiles.length > 0 || missingRoleProfiles.length > 0 || options.minCycles !== undefined && (report.summary.cycles ?? 0) < options.minCycles || options.minActionableProfiles !== undefined && report.defaults.summary.actionableProfiles < options.minActionableProfiles) {
16058
+ actions.push({
16059
+ description: "Run browser profile proof to collect microphone, WebSocket, live-latency, and provider traces for missing profiles.",
16060
+ href: options.browserProofHref ?? "/voice/browser-call-profiles",
16061
+ label: "Run browser profile proof"
16062
+ });
16063
+ actions.push({
16064
+ description: "Run phone profile proof when required profiles depend on carrier, telephony media, or noisy-call evidence.",
16065
+ href: options.phoneProofHref ?? "/api/voice/phone/smoke",
16066
+ label: "Run phone profile proof"
16067
+ });
16068
+ }
16069
+ if (options.maxAgeMs !== undefined && (ageMs === undefined || ageMs > options.maxAgeMs)) {
16070
+ actions.push({
16071
+ description: "Collect fresh real-call profile traces because the current history artifact is stale.",
16072
+ href: options.browserProofHref ?? "/voice/browser-call-profiles",
16073
+ label: "Collect fresh profile evidence"
16074
+ });
16075
+ }
16076
+ if (missingRoleProfiles.length > 0 || report.defaults.summary.actionableProfiles < (options.minActionableProfiles ?? 1)) {
16077
+ actions.push({
16078
+ description: "Collect missing LLM/STT/TTS provider-role evidence so profile defaults can become actionable.",
16079
+ href: options.sourceHref ?? "/api/voice/real-call-profile-history",
16080
+ label: "Collect missing provider-role evidence"
16081
+ });
16082
+ }
16083
+ if (report.recommendations.profiles.some((profile) => profile.status !== "pass") || report.defaults.profiles.some((profile) => profile.status !== "pass")) {
16084
+ actions.push({
16085
+ description: "Open operations records to inspect the sessions behind failing or warning profile evidence.",
16086
+ href: options.operationsRecordsHref ?? "/voice-operations",
16087
+ label: "Open operations records"
16088
+ });
16089
+ }
16090
+ return uniqueRealCallProfileActions(actions);
16091
+ };
16027
16092
  var buildVoiceRealCallProfileReadinessCheck = (report, options = {}) => {
16028
16093
  const { issues, warnings } = buildRealCallProfileReadinessIssues(report, options);
16029
16094
  const status = issues.length > 0 ? "fail" : warnings.length > 0 && options.failOnWarnings === true ? "fail" : warnings.length > 0 ? "warn" : "pass";
16030
16095
  const detail = status === "pass" ? `${String(report.summary.profileCount)} profile(s), ${String(report.summary.cycles ?? 0)} cycle(s), ${String(report.defaults.summary.actionableProfiles)} actionable default(s).` : [...issues, ...warnings].join(" ");
16031
16096
  return {
16097
+ actions: buildVoiceRealCallProfileRecoveryActions(report, options),
16032
16098
  detail,
16033
16099
  gateExplanation: {
16034
16100
  evidenceHref: options.href ?? "/api/voice/real-call-profile-history",
@@ -38907,6 +38973,7 @@ export {
38907
38973
  buildVoiceRealtimeProviderContractMatrix,
38908
38974
  buildVoiceRealtimeChannelRuntimeSamplesFromTrace,
38909
38975
  buildVoiceRealtimeChannelReport,
38976
+ buildVoiceRealCallProfileRecoveryActions,
38910
38977
  buildVoiceRealCallProfileReadinessCheck,
38911
38978
  buildVoiceRealCallProfileHistoryReport,
38912
38979
  buildVoiceRealCallProfileEvidenceFromTraceEvents,
@@ -1,5 +1,5 @@
1
1
  import { Elysia } from 'elysia';
2
- import type { VoiceProductionReadinessCheck } from './productionReadiness';
2
+ import type { VoiceProductionReadinessAction, VoiceProductionReadinessCheck } from './productionReadiness';
3
3
  import type { StoredVoiceTraceEvent, VoiceTraceEventStore } from './trace';
4
4
  export type VoiceProofTrendStatus = 'empty' | 'fail' | 'pass' | 'stale';
5
5
  export type VoiceProofTrendSummary = {
@@ -357,6 +357,7 @@ export type VoiceRealCallProfileHistoryRoutesOptions = Omit<VoiceRealCallProfile
357
357
  title?: string;
358
358
  };
359
359
  export type VoiceRealCallProfileReadinessCheckOptions = {
360
+ browserProofHref?: string;
360
361
  failOnWarnings?: boolean;
361
362
  href?: string;
362
363
  label?: string;
@@ -366,8 +367,12 @@ export type VoiceRealCallProfileReadinessCheckOptions = {
366
367
  minProfiles?: number;
367
368
  requiredProfileIds?: readonly string[];
368
369
  requiredProviderRoles?: readonly string[];
370
+ operationsRecordsHref?: string;
371
+ phoneProofHref?: string;
372
+ productionReadinessHref?: string;
369
373
  sourceHref?: string;
370
374
  };
375
+ export type VoiceRealCallProfileRecoveryActionOptions = VoiceRealCallProfileReadinessCheckOptions;
371
376
  export declare const DEFAULT_VOICE_PROOF_TRENDS_MAX_AGE_MS: number;
372
377
  export declare const DEFAULT_VOICE_PROOF_TREND_PROFILE_DEFINITIONS: ({
373
378
  description: string;
@@ -401,6 +406,7 @@ export declare const loadVoiceRealCallProfileEvidenceFromTraceStore: (options: V
401
406
  export declare const buildVoiceProofTrendProfileSummaries: (input: VoiceProofTrendReport | readonly VoiceProofTrendReport[], options?: VoiceProofTrendProfileSummaryOptions) => VoiceProofTrendProfileSummary[];
402
407
  export declare const buildVoiceProofTrendReportFromRealCallProfiles: (options: VoiceProofTrendRealCallProfileReportOptions) => VoiceProofTrendReport;
403
408
  export declare const buildVoiceRealCallProfileDefaults: (input: VoiceRealCallProfileHistoryReport | VoiceProofTrendReport, options?: VoiceRealCallProfileDefaultsOptions) => VoiceRealCallProfileDefaultsReport;
409
+ export declare const buildVoiceRealCallProfileRecoveryActions: (report: VoiceRealCallProfileHistoryReport, options?: VoiceRealCallProfileRecoveryActionOptions) => VoiceProductionReadinessAction[];
404
410
  export declare const buildVoiceRealCallProfileReadinessCheck: (report: VoiceRealCallProfileHistoryReport, options?: VoiceRealCallProfileReadinessCheckOptions) => VoiceProductionReadinessCheck;
405
411
  export declare const resolveVoiceRealCallProfileProviderRoute: <TProvider extends string = string>(options: VoiceRealCallProfileProviderRouteOptions<TProvider>) => TProvider | undefined;
406
412
  export declare const buildVoiceRealCallProfileHistoryReport: (options?: VoiceRealCallProfileHistoryOptions) => VoiceRealCallProfileHistoryReport;
@@ -2142,11 +2142,77 @@ var buildRealCallProfileReadinessIssues = (report, options) => {
2142
2142
  }
2143
2143
  return { issues, warnings };
2144
2144
  };
2145
+ var uniqueRealCallProfileActions = (actions) => {
2146
+ const seen = new Set;
2147
+ return actions.filter((action) => {
2148
+ const key = `${action.method ?? "GET"}:${action.href}:${action.label}`;
2149
+ if (seen.has(key)) {
2150
+ return false;
2151
+ }
2152
+ seen.add(key);
2153
+ return true;
2154
+ });
2155
+ };
2156
+ var buildVoiceRealCallProfileRecoveryActions = (report, options = {}) => {
2157
+ const actions = [
2158
+ {
2159
+ description: "Open the current real-call profile history report and profile defaults.",
2160
+ href: options.href ?? "/voice/real-call-profile-history",
2161
+ label: "Open real-call profile history"
2162
+ },
2163
+ {
2164
+ description: "Refresh production readiness after collecting or replaying profile evidence.",
2165
+ href: options.productionReadinessHref ?? "/production-readiness",
2166
+ label: "Refresh production readiness"
2167
+ }
2168
+ ];
2169
+ const requiredProfiles = new Set(options.requiredProfileIds ?? []);
2170
+ const profilesById = new Map(report.defaults.profiles.map((profile) => [profile.profileId, profile]));
2171
+ const missingProfiles = [...requiredProfiles].filter((profileId) => !profilesById.has(profileId));
2172
+ const warningProfiles = report.defaults.profiles.filter((profile) => (requiredProfiles.size === 0 || requiredProfiles.has(profile.profileId)) && profile.status !== "pass");
2173
+ const missingRoleProfiles = report.defaults.profiles.filter((profile) => (options.requiredProviderRoles ?? []).some((role) => !profile.providerRoutes[role]));
2174
+ const ageMs = report.trend.ageMs ?? (report.generatedAt ? Date.now() - new Date(report.generatedAt).getTime() : undefined);
2175
+ if (missingProfiles.length > 0 || warningProfiles.length > 0 || missingRoleProfiles.length > 0 || options.minCycles !== undefined && (report.summary.cycles ?? 0) < options.minCycles || options.minActionableProfiles !== undefined && report.defaults.summary.actionableProfiles < options.minActionableProfiles) {
2176
+ actions.push({
2177
+ description: "Run browser profile proof to collect microphone, WebSocket, live-latency, and provider traces for missing profiles.",
2178
+ href: options.browserProofHref ?? "/voice/browser-call-profiles",
2179
+ label: "Run browser profile proof"
2180
+ });
2181
+ actions.push({
2182
+ description: "Run phone profile proof when required profiles depend on carrier, telephony media, or noisy-call evidence.",
2183
+ href: options.phoneProofHref ?? "/api/voice/phone/smoke",
2184
+ label: "Run phone profile proof"
2185
+ });
2186
+ }
2187
+ if (options.maxAgeMs !== undefined && (ageMs === undefined || ageMs > options.maxAgeMs)) {
2188
+ actions.push({
2189
+ description: "Collect fresh real-call profile traces because the current history artifact is stale.",
2190
+ href: options.browserProofHref ?? "/voice/browser-call-profiles",
2191
+ label: "Collect fresh profile evidence"
2192
+ });
2193
+ }
2194
+ if (missingRoleProfiles.length > 0 || report.defaults.summary.actionableProfiles < (options.minActionableProfiles ?? 1)) {
2195
+ actions.push({
2196
+ description: "Collect missing LLM/STT/TTS provider-role evidence so profile defaults can become actionable.",
2197
+ href: options.sourceHref ?? "/api/voice/real-call-profile-history",
2198
+ label: "Collect missing provider-role evidence"
2199
+ });
2200
+ }
2201
+ if (report.recommendations.profiles.some((profile) => profile.status !== "pass") || report.defaults.profiles.some((profile) => profile.status !== "pass")) {
2202
+ actions.push({
2203
+ description: "Open operations records to inspect the sessions behind failing or warning profile evidence.",
2204
+ href: options.operationsRecordsHref ?? "/voice-operations",
2205
+ label: "Open operations records"
2206
+ });
2207
+ }
2208
+ return uniqueRealCallProfileActions(actions);
2209
+ };
2145
2210
  var buildVoiceRealCallProfileReadinessCheck = (report, options = {}) => {
2146
2211
  const { issues, warnings } = buildRealCallProfileReadinessIssues(report, options);
2147
2212
  const status = issues.length > 0 ? "fail" : warnings.length > 0 && options.failOnWarnings === true ? "fail" : warnings.length > 0 ? "warn" : "pass";
2148
2213
  const detail = status === "pass" ? `${String(report.summary.profileCount)} profile(s), ${String(report.summary.cycles ?? 0)} cycle(s), ${String(report.defaults.summary.actionableProfiles)} actionable default(s).` : [...issues, ...warnings].join(" ");
2149
2214
  return {
2215
+ actions: buildVoiceRealCallProfileRecoveryActions(report, options),
2150
2216
  detail,
2151
2217
  gateExplanation: {
2152
2218
  evidenceHref: options.href ?? "/api/voice/real-call-profile-history",
package/dist/vue/index.js CHANGED
@@ -2063,11 +2063,77 @@ var buildRealCallProfileReadinessIssues = (report, options) => {
2063
2063
  }
2064
2064
  return { issues, warnings };
2065
2065
  };
2066
+ var uniqueRealCallProfileActions = (actions) => {
2067
+ const seen = new Set;
2068
+ return actions.filter((action) => {
2069
+ const key = `${action.method ?? "GET"}:${action.href}:${action.label}`;
2070
+ if (seen.has(key)) {
2071
+ return false;
2072
+ }
2073
+ seen.add(key);
2074
+ return true;
2075
+ });
2076
+ };
2077
+ var buildVoiceRealCallProfileRecoveryActions = (report, options = {}) => {
2078
+ const actions = [
2079
+ {
2080
+ description: "Open the current real-call profile history report and profile defaults.",
2081
+ href: options.href ?? "/voice/real-call-profile-history",
2082
+ label: "Open real-call profile history"
2083
+ },
2084
+ {
2085
+ description: "Refresh production readiness after collecting or replaying profile evidence.",
2086
+ href: options.productionReadinessHref ?? "/production-readiness",
2087
+ label: "Refresh production readiness"
2088
+ }
2089
+ ];
2090
+ const requiredProfiles = new Set(options.requiredProfileIds ?? []);
2091
+ const profilesById = new Map(report.defaults.profiles.map((profile) => [profile.profileId, profile]));
2092
+ const missingProfiles = [...requiredProfiles].filter((profileId) => !profilesById.has(profileId));
2093
+ const warningProfiles = report.defaults.profiles.filter((profile) => (requiredProfiles.size === 0 || requiredProfiles.has(profile.profileId)) && profile.status !== "pass");
2094
+ const missingRoleProfiles = report.defaults.profiles.filter((profile) => (options.requiredProviderRoles ?? []).some((role) => !profile.providerRoutes[role]));
2095
+ const ageMs = report.trend.ageMs ?? (report.generatedAt ? Date.now() - new Date(report.generatedAt).getTime() : undefined);
2096
+ if (missingProfiles.length > 0 || warningProfiles.length > 0 || missingRoleProfiles.length > 0 || options.minCycles !== undefined && (report.summary.cycles ?? 0) < options.minCycles || options.minActionableProfiles !== undefined && report.defaults.summary.actionableProfiles < options.minActionableProfiles) {
2097
+ actions.push({
2098
+ description: "Run browser profile proof to collect microphone, WebSocket, live-latency, and provider traces for missing profiles.",
2099
+ href: options.browserProofHref ?? "/voice/browser-call-profiles",
2100
+ label: "Run browser profile proof"
2101
+ });
2102
+ actions.push({
2103
+ description: "Run phone profile proof when required profiles depend on carrier, telephony media, or noisy-call evidence.",
2104
+ href: options.phoneProofHref ?? "/api/voice/phone/smoke",
2105
+ label: "Run phone profile proof"
2106
+ });
2107
+ }
2108
+ if (options.maxAgeMs !== undefined && (ageMs === undefined || ageMs > options.maxAgeMs)) {
2109
+ actions.push({
2110
+ description: "Collect fresh real-call profile traces because the current history artifact is stale.",
2111
+ href: options.browserProofHref ?? "/voice/browser-call-profiles",
2112
+ label: "Collect fresh profile evidence"
2113
+ });
2114
+ }
2115
+ if (missingRoleProfiles.length > 0 || report.defaults.summary.actionableProfiles < (options.minActionableProfiles ?? 1)) {
2116
+ actions.push({
2117
+ description: "Collect missing LLM/STT/TTS provider-role evidence so profile defaults can become actionable.",
2118
+ href: options.sourceHref ?? "/api/voice/real-call-profile-history",
2119
+ label: "Collect missing provider-role evidence"
2120
+ });
2121
+ }
2122
+ if (report.recommendations.profiles.some((profile) => profile.status !== "pass") || report.defaults.profiles.some((profile) => profile.status !== "pass")) {
2123
+ actions.push({
2124
+ description: "Open operations records to inspect the sessions behind failing or warning profile evidence.",
2125
+ href: options.operationsRecordsHref ?? "/voice-operations",
2126
+ label: "Open operations records"
2127
+ });
2128
+ }
2129
+ return uniqueRealCallProfileActions(actions);
2130
+ };
2066
2131
  var buildVoiceRealCallProfileReadinessCheck = (report, options = {}) => {
2067
2132
  const { issues, warnings } = buildRealCallProfileReadinessIssues(report, options);
2068
2133
  const status = issues.length > 0 ? "fail" : warnings.length > 0 && options.failOnWarnings === true ? "fail" : warnings.length > 0 ? "warn" : "pass";
2069
2134
  const detail = status === "pass" ? `${String(report.summary.profileCount)} profile(s), ${String(report.summary.cycles ?? 0)} cycle(s), ${String(report.defaults.summary.actionableProfiles)} actionable default(s).` : [...issues, ...warnings].join(" ");
2070
2135
  return {
2136
+ actions: buildVoiceRealCallProfileRecoveryActions(report, options),
2071
2137
  detail,
2072
2138
  gateExplanation: {
2073
2139
  evidenceHref: options.href ?? "/api/voice/real-call-profile-history",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@absolutejs/voice",
3
- "version": "0.0.22-beta.370",
3
+ "version": "0.0.22-beta.371",
4
4
  "description": "Voice primitives and Elysia plugin for AbsoluteJS",
5
5
  "repository": {
6
6
  "type": "git",