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

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
@@ -1504,6 +1504,21 @@ createVoiceProductionReadinessRoutes({
1504
1504
 
1505
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
1506
 
1507
+ Mount `createVoiceRealCallProfileRecoveryActionRoutes(...)` when those actions should be executable. The package owns the route contract and result shape; the app supplies safe handlers:
1508
+
1509
+ ```ts
1510
+ app.use(
1511
+ createVoiceRealCallProfileRecoveryActionRoutes({
1512
+ handlers: {
1513
+ 'collect-browser-proof': async () => runBrowserProfileProof(),
1514
+ 'collect-phone-proof': async () => runPhoneProfileProof(),
1515
+ refresh: async () => refreshReadinessProof()
1516
+ },
1517
+ source: buildRealCallHistory
1518
+ })
1519
+ );
1520
+ ```
1521
+
1507
1522
  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.
1508
1523
 
1509
1524
  ```ts
@@ -4571,11 +4571,13 @@ var buildVoiceRealCallProfileRecoveryActions = (report, options = {}) => {
4571
4571
  {
4572
4572
  description: "Open the current real-call profile history report and profile defaults.",
4573
4573
  href: options.href ?? "/voice/real-call-profile-history",
4574
+ id: "refresh",
4574
4575
  label: "Open real-call profile history"
4575
4576
  },
4576
4577
  {
4577
4578
  description: "Refresh production readiness after collecting or replaying profile evidence.",
4578
4579
  href: options.productionReadinessHref ?? "/production-readiness",
4580
+ id: "refresh",
4579
4581
  label: "Refresh production readiness"
4580
4582
  }
4581
4583
  ];
@@ -4589,11 +4591,13 @@ var buildVoiceRealCallProfileRecoveryActions = (report, options = {}) => {
4589
4591
  actions.push({
4590
4592
  description: "Run browser profile proof to collect microphone, WebSocket, live-latency, and provider traces for missing profiles.",
4591
4593
  href: options.browserProofHref ?? "/voice/browser-call-profiles",
4594
+ id: "collect-browser-proof",
4592
4595
  label: "Run browser profile proof"
4593
4596
  });
4594
4597
  actions.push({
4595
4598
  description: "Run phone profile proof when required profiles depend on carrier, telephony media, or noisy-call evidence.",
4596
4599
  href: options.phoneProofHref ?? "/api/voice/phone/smoke",
4600
+ id: "collect-phone-proof",
4597
4601
  label: "Run phone profile proof"
4598
4602
  });
4599
4603
  }
@@ -4601,6 +4605,7 @@ var buildVoiceRealCallProfileRecoveryActions = (report, options = {}) => {
4601
4605
  actions.push({
4602
4606
  description: "Collect fresh real-call profile traces because the current history artifact is stale.",
4603
4607
  href: options.browserProofHref ?? "/voice/browser-call-profiles",
4608
+ id: "collect-browser-proof",
4604
4609
  label: "Collect fresh profile evidence"
4605
4610
  });
4606
4611
  }
@@ -4608,6 +4613,7 @@ var buildVoiceRealCallProfileRecoveryActions = (report, options = {}) => {
4608
4613
  actions.push({
4609
4614
  description: "Collect missing LLM/STT/TTS provider-role evidence so profile defaults can become actionable.",
4610
4615
  href: options.sourceHref ?? "/api/voice/real-call-profile-history",
4616
+ id: "collect-provider-role-evidence",
4611
4617
  label: "Collect missing provider-role evidence"
4612
4618
  });
4613
4619
  }
@@ -4615,6 +4621,7 @@ var buildVoiceRealCallProfileRecoveryActions = (report, options = {}) => {
4615
4621
  actions.push({
4616
4622
  description: "Open operations records to inspect the sessions behind failing or warning profile evidence.",
4617
4623
  href: options.operationsRecordsHref ?? "/voice-operations",
4624
+ id: "refresh",
4618
4625
  label: "Open operations records"
4619
4626
  });
4620
4627
  }
@@ -5217,6 +5224,76 @@ var createVoiceRealCallProfileHistoryRoutes = (options = {}) => {
5217
5224
  }
5218
5225
  return routes;
5219
5226
  };
5227
+ var realCallProfileActionPaths = {
5228
+ "collect-browser-proof": "/collect-browser-proof",
5229
+ "collect-phone-proof": "/collect-phone-proof",
5230
+ "collect-provider-role-evidence": "/collect-provider-role-evidence",
5231
+ refresh: "/refresh"
5232
+ };
5233
+ var loadVoiceRealCallProfileHistoryRouteReport = async (options) => {
5234
+ const { source, ...routeOptions } = options;
5235
+ const sourceOptions = source === undefined ? routeOptions : typeof source === "function" ? await source() : source;
5236
+ return buildVoiceRealCallProfileHistoryReport({
5237
+ ...routeOptions,
5238
+ ...sourceOptions
5239
+ });
5240
+ };
5241
+ var createVoiceRealCallProfileRecoveryActionRoutes = (options = {}) => {
5242
+ const path = options.path ?? "/api/voice/real-call-profile-history";
5243
+ const routes = new Elysia({
5244
+ name: options.name ?? "absolutejs-voice-real-call-profile-recovery-actions"
5245
+ });
5246
+ const actionPath = (actionId) => `${path}${realCallProfileActionPaths[actionId]}`;
5247
+ const loadReport = () => loadVoiceRealCallProfileHistoryRouteReport(options);
5248
+ const listActions = async () => {
5249
+ const report = await loadReport();
5250
+ const actions = buildVoiceRealCallProfileRecoveryActions(report, {
5251
+ ...options,
5252
+ browserProofHref: options.browserProofHref ?? actionPath("collect-browser-proof"),
5253
+ phoneProofHref: options.phoneProofHref ?? actionPath("collect-phone-proof"),
5254
+ sourceHref: options.sourceHref ?? actionPath("collect-provider-role-evidence"),
5255
+ productionReadinessHref: options.productionReadinessHref ?? actionPath("refresh")
5256
+ }).map((action) => ({
5257
+ ...action,
5258
+ href: action.id === "collect-browser-proof" ? actionPath("collect-browser-proof") : action.id === "collect-phone-proof" ? actionPath("collect-phone-proof") : action.id === "collect-provider-role-evidence" ? actionPath("collect-provider-role-evidence") : action.href,
5259
+ method: action.id === "refresh" && (action.label === "Open real-call profile history" || action.label === "Open operations records") ? "GET" : "POST"
5260
+ }));
5261
+ return { actions, generatedAt: new Date().toISOString(), report };
5262
+ };
5263
+ const runAction = async (actionId) => {
5264
+ const report = await loadReport();
5265
+ const handler = options.handlers?.[actionId];
5266
+ if (!handler) {
5267
+ return {
5268
+ actionId,
5269
+ generatedAt: new Date().toISOString(),
5270
+ message: `No handler configured for real-call profile recovery action: ${actionId}.`,
5271
+ ok: false,
5272
+ status: "fail"
5273
+ };
5274
+ }
5275
+ const result = await handler({ actionId, report });
5276
+ return {
5277
+ actionId,
5278
+ generatedAt: new Date().toISOString(),
5279
+ message: result?.message,
5280
+ ok: result?.ok ?? true,
5281
+ report: result?.report,
5282
+ status: result?.status ?? "pass"
5283
+ };
5284
+ };
5285
+ routes.get(`${path}/actions`, async () => Response.json(await listActions(), { headers: options.headers }));
5286
+ for (const actionId of Object.keys(realCallProfileActionPaths)) {
5287
+ routes.post(actionPath(actionId), async ({ set }) => {
5288
+ const result = await runAction(actionId);
5289
+ if (!result.ok) {
5290
+ set.status = 501;
5291
+ }
5292
+ return Response.json(result, { headers: options.headers });
5293
+ });
5294
+ }
5295
+ return routes;
5296
+ };
5220
5297
  var createVoiceProofTrendRoutes = (options) => {
5221
5298
  const path = options.path ?? "/api/voice/proof-trends";
5222
5299
  const routes = new Elysia({
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, 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';
33
+ export { assertVoiceProofTrendEvidence, buildEmptyVoiceProofTrendReport, buildVoiceProofTrendProfileSummaries, buildVoiceProofTrendRecommendationReport, buildVoiceProofTrendReportFromRealCallProfiles, buildVoiceProofTrendReport, buildVoiceRealCallProfileEvidenceFromTraceEvents, buildVoiceRealCallProfileDefaults, buildVoiceRealCallProfileHistoryReport, buildVoiceRealCallProfileReadinessCheck, buildVoiceRealCallProfileRecoveryActions, createVoiceProofTrendRecommendationRoutes, createVoiceProofTrendRoutes, createVoiceRealCallProfileHistoryRoutes, createVoiceRealCallProfileRecoveryActionRoutes, 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, VoiceRealCallProfileRecoveryActionOptions, 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, VoiceRealCallProfileRecoveryAction, VoiceRealCallProfileRecoveryActionHandler, VoiceRealCallProfileRecoveryActionHandlerInput, VoiceRealCallProfileRecoveryActionId, VoiceRealCallProfileRecoveryActionResult, VoiceRealCallProfileRecoveryActionRoutesOptions, 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
@@ -16040,11 +16040,13 @@ var buildVoiceRealCallProfileRecoveryActions = (report, options = {}) => {
16040
16040
  {
16041
16041
  description: "Open the current real-call profile history report and profile defaults.",
16042
16042
  href: options.href ?? "/voice/real-call-profile-history",
16043
+ id: "refresh",
16043
16044
  label: "Open real-call profile history"
16044
16045
  },
16045
16046
  {
16046
16047
  description: "Refresh production readiness after collecting or replaying profile evidence.",
16047
16048
  href: options.productionReadinessHref ?? "/production-readiness",
16049
+ id: "refresh",
16048
16050
  label: "Refresh production readiness"
16049
16051
  }
16050
16052
  ];
@@ -16058,11 +16060,13 @@ var buildVoiceRealCallProfileRecoveryActions = (report, options = {}) => {
16058
16060
  actions.push({
16059
16061
  description: "Run browser profile proof to collect microphone, WebSocket, live-latency, and provider traces for missing profiles.",
16060
16062
  href: options.browserProofHref ?? "/voice/browser-call-profiles",
16063
+ id: "collect-browser-proof",
16061
16064
  label: "Run browser profile proof"
16062
16065
  });
16063
16066
  actions.push({
16064
16067
  description: "Run phone profile proof when required profiles depend on carrier, telephony media, or noisy-call evidence.",
16065
16068
  href: options.phoneProofHref ?? "/api/voice/phone/smoke",
16069
+ id: "collect-phone-proof",
16066
16070
  label: "Run phone profile proof"
16067
16071
  });
16068
16072
  }
@@ -16070,6 +16074,7 @@ var buildVoiceRealCallProfileRecoveryActions = (report, options = {}) => {
16070
16074
  actions.push({
16071
16075
  description: "Collect fresh real-call profile traces because the current history artifact is stale.",
16072
16076
  href: options.browserProofHref ?? "/voice/browser-call-profiles",
16077
+ id: "collect-browser-proof",
16073
16078
  label: "Collect fresh profile evidence"
16074
16079
  });
16075
16080
  }
@@ -16077,6 +16082,7 @@ var buildVoiceRealCallProfileRecoveryActions = (report, options = {}) => {
16077
16082
  actions.push({
16078
16083
  description: "Collect missing LLM/STT/TTS provider-role evidence so profile defaults can become actionable.",
16079
16084
  href: options.sourceHref ?? "/api/voice/real-call-profile-history",
16085
+ id: "collect-provider-role-evidence",
16080
16086
  label: "Collect missing provider-role evidence"
16081
16087
  });
16082
16088
  }
@@ -16084,6 +16090,7 @@ var buildVoiceRealCallProfileRecoveryActions = (report, options = {}) => {
16084
16090
  actions.push({
16085
16091
  description: "Open operations records to inspect the sessions behind failing or warning profile evidence.",
16086
16092
  href: options.operationsRecordsHref ?? "/voice-operations",
16093
+ id: "refresh",
16087
16094
  label: "Open operations records"
16088
16095
  });
16089
16096
  }
@@ -16686,6 +16693,76 @@ var createVoiceRealCallProfileHistoryRoutes = (options = {}) => {
16686
16693
  }
16687
16694
  return routes;
16688
16695
  };
16696
+ var realCallProfileActionPaths = {
16697
+ "collect-browser-proof": "/collect-browser-proof",
16698
+ "collect-phone-proof": "/collect-phone-proof",
16699
+ "collect-provider-role-evidence": "/collect-provider-role-evidence",
16700
+ refresh: "/refresh"
16701
+ };
16702
+ var loadVoiceRealCallProfileHistoryRouteReport = async (options) => {
16703
+ const { source, ...routeOptions } = options;
16704
+ const sourceOptions = source === undefined ? routeOptions : typeof source === "function" ? await source() : source;
16705
+ return buildVoiceRealCallProfileHistoryReport({
16706
+ ...routeOptions,
16707
+ ...sourceOptions
16708
+ });
16709
+ };
16710
+ var createVoiceRealCallProfileRecoveryActionRoutes = (options = {}) => {
16711
+ const path = options.path ?? "/api/voice/real-call-profile-history";
16712
+ const routes = new Elysia22({
16713
+ name: options.name ?? "absolutejs-voice-real-call-profile-recovery-actions"
16714
+ });
16715
+ const actionPath = (actionId) => `${path}${realCallProfileActionPaths[actionId]}`;
16716
+ const loadReport = () => loadVoiceRealCallProfileHistoryRouteReport(options);
16717
+ const listActions = async () => {
16718
+ const report = await loadReport();
16719
+ const actions = buildVoiceRealCallProfileRecoveryActions(report, {
16720
+ ...options,
16721
+ browserProofHref: options.browserProofHref ?? actionPath("collect-browser-proof"),
16722
+ phoneProofHref: options.phoneProofHref ?? actionPath("collect-phone-proof"),
16723
+ sourceHref: options.sourceHref ?? actionPath("collect-provider-role-evidence"),
16724
+ productionReadinessHref: options.productionReadinessHref ?? actionPath("refresh")
16725
+ }).map((action) => ({
16726
+ ...action,
16727
+ href: action.id === "collect-browser-proof" ? actionPath("collect-browser-proof") : action.id === "collect-phone-proof" ? actionPath("collect-phone-proof") : action.id === "collect-provider-role-evidence" ? actionPath("collect-provider-role-evidence") : action.href,
16728
+ method: action.id === "refresh" && (action.label === "Open real-call profile history" || action.label === "Open operations records") ? "GET" : "POST"
16729
+ }));
16730
+ return { actions, generatedAt: new Date().toISOString(), report };
16731
+ };
16732
+ const runAction = async (actionId) => {
16733
+ const report = await loadReport();
16734
+ const handler = options.handlers?.[actionId];
16735
+ if (!handler) {
16736
+ return {
16737
+ actionId,
16738
+ generatedAt: new Date().toISOString(),
16739
+ message: `No handler configured for real-call profile recovery action: ${actionId}.`,
16740
+ ok: false,
16741
+ status: "fail"
16742
+ };
16743
+ }
16744
+ const result = await handler({ actionId, report });
16745
+ return {
16746
+ actionId,
16747
+ generatedAt: new Date().toISOString(),
16748
+ message: result?.message,
16749
+ ok: result?.ok ?? true,
16750
+ report: result?.report,
16751
+ status: result?.status ?? "pass"
16752
+ };
16753
+ };
16754
+ routes.get(`${path}/actions`, async () => Response.json(await listActions(), { headers: options.headers }));
16755
+ for (const actionId of Object.keys(realCallProfileActionPaths)) {
16756
+ routes.post(actionPath(actionId), async ({ set }) => {
16757
+ const result = await runAction(actionId);
16758
+ if (!result.ok) {
16759
+ set.status = 501;
16760
+ }
16761
+ return Response.json(result, { headers: options.headers });
16762
+ });
16763
+ }
16764
+ return routes;
16765
+ };
16689
16766
  var createVoiceProofTrendRoutes = (options) => {
16690
16767
  const path = options.path ?? "/api/voice/proof-trends";
16691
16768
  const routes = new Elysia22({
@@ -38757,6 +38834,7 @@ export {
38757
38834
  createVoiceRealtimeProviderContractRoutes,
38758
38835
  createVoiceRealtimeProviderContractMatrixPreset,
38759
38836
  createVoiceRealtimeChannelRoutes,
38837
+ createVoiceRealCallProfileRecoveryActionRoutes,
38760
38838
  createVoiceRealCallProfileHistoryRoutes,
38761
38839
  createVoiceReadinessProfile,
38762
38840
  createVoiceQualityRoutes,
@@ -356,6 +356,10 @@ export type VoiceRealCallProfileHistoryRoutesOptions = Omit<VoiceRealCallProfile
356
356
  source?: (() => Promise<VoiceRealCallProfileHistoryOptions> | VoiceRealCallProfileHistoryOptions) | VoiceRealCallProfileHistoryOptions;
357
357
  title?: string;
358
358
  };
359
+ export type VoiceRealCallProfileRecoveryActionId = 'collect-browser-proof' | 'collect-phone-proof' | 'collect-provider-role-evidence' | 'refresh';
360
+ export type VoiceRealCallProfileRecoveryAction = VoiceProductionReadinessAction & {
361
+ id: VoiceRealCallProfileRecoveryActionId;
362
+ };
359
363
  export type VoiceRealCallProfileReadinessCheckOptions = {
360
364
  browserProofHref?: string;
361
365
  failOnWarnings?: boolean;
@@ -373,6 +377,22 @@ export type VoiceRealCallProfileReadinessCheckOptions = {
373
377
  sourceHref?: string;
374
378
  };
375
379
  export type VoiceRealCallProfileRecoveryActionOptions = VoiceRealCallProfileReadinessCheckOptions;
380
+ export type VoiceRealCallProfileRecoveryActionHandlerInput = {
381
+ actionId: VoiceRealCallProfileRecoveryActionId;
382
+ report: VoiceRealCallProfileHistoryReport;
383
+ };
384
+ export type VoiceRealCallProfileRecoveryActionResult = {
385
+ actionId: VoiceRealCallProfileRecoveryActionId;
386
+ generatedAt: string;
387
+ message?: string;
388
+ ok: boolean;
389
+ report?: VoiceRealCallProfileHistoryReport;
390
+ status: VoiceProofTrendStatus;
391
+ };
392
+ export type VoiceRealCallProfileRecoveryActionHandler = (input: VoiceRealCallProfileRecoveryActionHandlerInput) => Promise<Partial<VoiceRealCallProfileRecoveryActionResult> | void> | Partial<VoiceRealCallProfileRecoveryActionResult> | void;
393
+ export type VoiceRealCallProfileRecoveryActionRoutesOptions = VoiceRealCallProfileRecoveryActionOptions & Omit<VoiceRealCallProfileHistoryRoutesOptions, 'htmlPath' | 'markdownPath'> & {
394
+ handlers?: Partial<Record<VoiceRealCallProfileRecoveryActionId, VoiceRealCallProfileRecoveryActionHandler>>;
395
+ };
376
396
  export declare const DEFAULT_VOICE_PROOF_TRENDS_MAX_AGE_MS: number;
377
397
  export declare const DEFAULT_VOICE_PROOF_TREND_PROFILE_DEFINITIONS: ({
378
398
  description: string;
@@ -406,7 +426,7 @@ export declare const loadVoiceRealCallProfileEvidenceFromTraceStore: (options: V
406
426
  export declare const buildVoiceProofTrendProfileSummaries: (input: VoiceProofTrendReport | readonly VoiceProofTrendReport[], options?: VoiceProofTrendProfileSummaryOptions) => VoiceProofTrendProfileSummary[];
407
427
  export declare const buildVoiceProofTrendReportFromRealCallProfiles: (options: VoiceProofTrendRealCallProfileReportOptions) => VoiceProofTrendReport;
408
428
  export declare const buildVoiceRealCallProfileDefaults: (input: VoiceRealCallProfileHistoryReport | VoiceProofTrendReport, options?: VoiceRealCallProfileDefaultsOptions) => VoiceRealCallProfileDefaultsReport;
409
- export declare const buildVoiceRealCallProfileRecoveryActions: (report: VoiceRealCallProfileHistoryReport, options?: VoiceRealCallProfileRecoveryActionOptions) => VoiceProductionReadinessAction[];
429
+ export declare const buildVoiceRealCallProfileRecoveryActions: (report: VoiceRealCallProfileHistoryReport, options?: VoiceRealCallProfileRecoveryActionOptions) => VoiceRealCallProfileRecoveryAction[];
410
430
  export declare const buildVoiceRealCallProfileReadinessCheck: (report: VoiceRealCallProfileHistoryReport, options?: VoiceRealCallProfileReadinessCheckOptions) => VoiceProductionReadinessCheck;
411
431
  export declare const resolveVoiceRealCallProfileProviderRoute: <TProvider extends string = string>(options: VoiceRealCallProfileProviderRouteOptions<TProvider>) => TProvider | undefined;
412
432
  export declare const buildVoiceRealCallProfileHistoryReport: (options?: VoiceRealCallProfileHistoryOptions) => VoiceRealCallProfileHistoryReport;
@@ -473,6 +493,34 @@ export declare const createVoiceRealCallProfileHistoryRoutes: (options?: VoiceRe
473
493
  standaloneSchema: {};
474
494
  response: {};
475
495
  }>;
496
+ export declare const createVoiceRealCallProfileRecoveryActionRoutes: (options?: VoiceRealCallProfileRecoveryActionRoutesOptions) => Elysia<"", {
497
+ decorator: {};
498
+ store: {};
499
+ derive: {};
500
+ resolve: {};
501
+ }, {
502
+ typebox: {};
503
+ error: {};
504
+ }, {
505
+ schema: {};
506
+ standaloneSchema: {};
507
+ macro: {};
508
+ macroFn: {};
509
+ parser: {};
510
+ response: {};
511
+ }, {}, {
512
+ derive: {};
513
+ resolve: {};
514
+ schema: {};
515
+ standaloneSchema: {};
516
+ response: {};
517
+ }, {
518
+ derive: {};
519
+ resolve: {};
520
+ schema: {};
521
+ standaloneSchema: {};
522
+ response: {};
523
+ }>;
476
524
  export declare const createVoiceProofTrendRoutes: (options: VoiceProofTrendRoutesOptions) => Elysia<"", {
477
525
  decorator: {};
478
526
  store: {};
@@ -2158,11 +2158,13 @@ var buildVoiceRealCallProfileRecoveryActions = (report, options = {}) => {
2158
2158
  {
2159
2159
  description: "Open the current real-call profile history report and profile defaults.",
2160
2160
  href: options.href ?? "/voice/real-call-profile-history",
2161
+ id: "refresh",
2161
2162
  label: "Open real-call profile history"
2162
2163
  },
2163
2164
  {
2164
2165
  description: "Refresh production readiness after collecting or replaying profile evidence.",
2165
2166
  href: options.productionReadinessHref ?? "/production-readiness",
2167
+ id: "refresh",
2166
2168
  label: "Refresh production readiness"
2167
2169
  }
2168
2170
  ];
@@ -2176,11 +2178,13 @@ var buildVoiceRealCallProfileRecoveryActions = (report, options = {}) => {
2176
2178
  actions.push({
2177
2179
  description: "Run browser profile proof to collect microphone, WebSocket, live-latency, and provider traces for missing profiles.",
2178
2180
  href: options.browserProofHref ?? "/voice/browser-call-profiles",
2181
+ id: "collect-browser-proof",
2179
2182
  label: "Run browser profile proof"
2180
2183
  });
2181
2184
  actions.push({
2182
2185
  description: "Run phone profile proof when required profiles depend on carrier, telephony media, or noisy-call evidence.",
2183
2186
  href: options.phoneProofHref ?? "/api/voice/phone/smoke",
2187
+ id: "collect-phone-proof",
2184
2188
  label: "Run phone profile proof"
2185
2189
  });
2186
2190
  }
@@ -2188,6 +2192,7 @@ var buildVoiceRealCallProfileRecoveryActions = (report, options = {}) => {
2188
2192
  actions.push({
2189
2193
  description: "Collect fresh real-call profile traces because the current history artifact is stale.",
2190
2194
  href: options.browserProofHref ?? "/voice/browser-call-profiles",
2195
+ id: "collect-browser-proof",
2191
2196
  label: "Collect fresh profile evidence"
2192
2197
  });
2193
2198
  }
@@ -2195,6 +2200,7 @@ var buildVoiceRealCallProfileRecoveryActions = (report, options = {}) => {
2195
2200
  actions.push({
2196
2201
  description: "Collect missing LLM/STT/TTS provider-role evidence so profile defaults can become actionable.",
2197
2202
  href: options.sourceHref ?? "/api/voice/real-call-profile-history",
2203
+ id: "collect-provider-role-evidence",
2198
2204
  label: "Collect missing provider-role evidence"
2199
2205
  });
2200
2206
  }
@@ -2202,6 +2208,7 @@ var buildVoiceRealCallProfileRecoveryActions = (report, options = {}) => {
2202
2208
  actions.push({
2203
2209
  description: "Open operations records to inspect the sessions behind failing or warning profile evidence.",
2204
2210
  href: options.operationsRecordsHref ?? "/voice-operations",
2211
+ id: "refresh",
2205
2212
  label: "Open operations records"
2206
2213
  });
2207
2214
  }
@@ -2804,6 +2811,76 @@ var createVoiceRealCallProfileHistoryRoutes = (options = {}) => {
2804
2811
  }
2805
2812
  return routes;
2806
2813
  };
2814
+ var realCallProfileActionPaths = {
2815
+ "collect-browser-proof": "/collect-browser-proof",
2816
+ "collect-phone-proof": "/collect-phone-proof",
2817
+ "collect-provider-role-evidence": "/collect-provider-role-evidence",
2818
+ refresh: "/refresh"
2819
+ };
2820
+ var loadVoiceRealCallProfileHistoryRouteReport = async (options) => {
2821
+ const { source, ...routeOptions } = options;
2822
+ const sourceOptions = source === undefined ? routeOptions : typeof source === "function" ? await source() : source;
2823
+ return buildVoiceRealCallProfileHistoryReport({
2824
+ ...routeOptions,
2825
+ ...sourceOptions
2826
+ });
2827
+ };
2828
+ var createVoiceRealCallProfileRecoveryActionRoutes = (options = {}) => {
2829
+ const path = options.path ?? "/api/voice/real-call-profile-history";
2830
+ const routes = new Elysia({
2831
+ name: options.name ?? "absolutejs-voice-real-call-profile-recovery-actions"
2832
+ });
2833
+ const actionPath = (actionId) => `${path}${realCallProfileActionPaths[actionId]}`;
2834
+ const loadReport = () => loadVoiceRealCallProfileHistoryRouteReport(options);
2835
+ const listActions = async () => {
2836
+ const report = await loadReport();
2837
+ const actions = buildVoiceRealCallProfileRecoveryActions(report, {
2838
+ ...options,
2839
+ browserProofHref: options.browserProofHref ?? actionPath("collect-browser-proof"),
2840
+ phoneProofHref: options.phoneProofHref ?? actionPath("collect-phone-proof"),
2841
+ sourceHref: options.sourceHref ?? actionPath("collect-provider-role-evidence"),
2842
+ productionReadinessHref: options.productionReadinessHref ?? actionPath("refresh")
2843
+ }).map((action) => ({
2844
+ ...action,
2845
+ href: action.id === "collect-browser-proof" ? actionPath("collect-browser-proof") : action.id === "collect-phone-proof" ? actionPath("collect-phone-proof") : action.id === "collect-provider-role-evidence" ? actionPath("collect-provider-role-evidence") : action.href,
2846
+ method: action.id === "refresh" && (action.label === "Open real-call profile history" || action.label === "Open operations records") ? "GET" : "POST"
2847
+ }));
2848
+ return { actions, generatedAt: new Date().toISOString(), report };
2849
+ };
2850
+ const runAction = async (actionId) => {
2851
+ const report = await loadReport();
2852
+ const handler = options.handlers?.[actionId];
2853
+ if (!handler) {
2854
+ return {
2855
+ actionId,
2856
+ generatedAt: new Date().toISOString(),
2857
+ message: `No handler configured for real-call profile recovery action: ${actionId}.`,
2858
+ ok: false,
2859
+ status: "fail"
2860
+ };
2861
+ }
2862
+ const result = await handler({ actionId, report });
2863
+ return {
2864
+ actionId,
2865
+ generatedAt: new Date().toISOString(),
2866
+ message: result?.message,
2867
+ ok: result?.ok ?? true,
2868
+ report: result?.report,
2869
+ status: result?.status ?? "pass"
2870
+ };
2871
+ };
2872
+ routes.get(`${path}/actions`, async () => Response.json(await listActions(), { headers: options.headers }));
2873
+ for (const actionId of Object.keys(realCallProfileActionPaths)) {
2874
+ routes.post(actionPath(actionId), async ({ set }) => {
2875
+ const result = await runAction(actionId);
2876
+ if (!result.ok) {
2877
+ set.status = 501;
2878
+ }
2879
+ return Response.json(result, { headers: options.headers });
2880
+ });
2881
+ }
2882
+ return routes;
2883
+ };
2807
2884
  var createVoiceProofTrendRoutes = (options) => {
2808
2885
  const path = options.path ?? "/api/voice/proof-trends";
2809
2886
  const routes = new Elysia({
package/dist/vue/index.js CHANGED
@@ -2079,11 +2079,13 @@ var buildVoiceRealCallProfileRecoveryActions = (report, options = {}) => {
2079
2079
  {
2080
2080
  description: "Open the current real-call profile history report and profile defaults.",
2081
2081
  href: options.href ?? "/voice/real-call-profile-history",
2082
+ id: "refresh",
2082
2083
  label: "Open real-call profile history"
2083
2084
  },
2084
2085
  {
2085
2086
  description: "Refresh production readiness after collecting or replaying profile evidence.",
2086
2087
  href: options.productionReadinessHref ?? "/production-readiness",
2088
+ id: "refresh",
2087
2089
  label: "Refresh production readiness"
2088
2090
  }
2089
2091
  ];
@@ -2097,11 +2099,13 @@ var buildVoiceRealCallProfileRecoveryActions = (report, options = {}) => {
2097
2099
  actions.push({
2098
2100
  description: "Run browser profile proof to collect microphone, WebSocket, live-latency, and provider traces for missing profiles.",
2099
2101
  href: options.browserProofHref ?? "/voice/browser-call-profiles",
2102
+ id: "collect-browser-proof",
2100
2103
  label: "Run browser profile proof"
2101
2104
  });
2102
2105
  actions.push({
2103
2106
  description: "Run phone profile proof when required profiles depend on carrier, telephony media, or noisy-call evidence.",
2104
2107
  href: options.phoneProofHref ?? "/api/voice/phone/smoke",
2108
+ id: "collect-phone-proof",
2105
2109
  label: "Run phone profile proof"
2106
2110
  });
2107
2111
  }
@@ -2109,6 +2113,7 @@ var buildVoiceRealCallProfileRecoveryActions = (report, options = {}) => {
2109
2113
  actions.push({
2110
2114
  description: "Collect fresh real-call profile traces because the current history artifact is stale.",
2111
2115
  href: options.browserProofHref ?? "/voice/browser-call-profiles",
2116
+ id: "collect-browser-proof",
2112
2117
  label: "Collect fresh profile evidence"
2113
2118
  });
2114
2119
  }
@@ -2116,6 +2121,7 @@ var buildVoiceRealCallProfileRecoveryActions = (report, options = {}) => {
2116
2121
  actions.push({
2117
2122
  description: "Collect missing LLM/STT/TTS provider-role evidence so profile defaults can become actionable.",
2118
2123
  href: options.sourceHref ?? "/api/voice/real-call-profile-history",
2124
+ id: "collect-provider-role-evidence",
2119
2125
  label: "Collect missing provider-role evidence"
2120
2126
  });
2121
2127
  }
@@ -2123,6 +2129,7 @@ var buildVoiceRealCallProfileRecoveryActions = (report, options = {}) => {
2123
2129
  actions.push({
2124
2130
  description: "Open operations records to inspect the sessions behind failing or warning profile evidence.",
2125
2131
  href: options.operationsRecordsHref ?? "/voice-operations",
2132
+ id: "refresh",
2126
2133
  label: "Open operations records"
2127
2134
  });
2128
2135
  }
@@ -2725,6 +2732,76 @@ var createVoiceRealCallProfileHistoryRoutes = (options = {}) => {
2725
2732
  }
2726
2733
  return routes;
2727
2734
  };
2735
+ var realCallProfileActionPaths = {
2736
+ "collect-browser-proof": "/collect-browser-proof",
2737
+ "collect-phone-proof": "/collect-phone-proof",
2738
+ "collect-provider-role-evidence": "/collect-provider-role-evidence",
2739
+ refresh: "/refresh"
2740
+ };
2741
+ var loadVoiceRealCallProfileHistoryRouteReport = async (options) => {
2742
+ const { source, ...routeOptions } = options;
2743
+ const sourceOptions = source === undefined ? routeOptions : typeof source === "function" ? await source() : source;
2744
+ return buildVoiceRealCallProfileHistoryReport({
2745
+ ...routeOptions,
2746
+ ...sourceOptions
2747
+ });
2748
+ };
2749
+ var createVoiceRealCallProfileRecoveryActionRoutes = (options = {}) => {
2750
+ const path = options.path ?? "/api/voice/real-call-profile-history";
2751
+ const routes = new Elysia({
2752
+ name: options.name ?? "absolutejs-voice-real-call-profile-recovery-actions"
2753
+ });
2754
+ const actionPath = (actionId) => `${path}${realCallProfileActionPaths[actionId]}`;
2755
+ const loadReport = () => loadVoiceRealCallProfileHistoryRouteReport(options);
2756
+ const listActions = async () => {
2757
+ const report = await loadReport();
2758
+ const actions = buildVoiceRealCallProfileRecoveryActions(report, {
2759
+ ...options,
2760
+ browserProofHref: options.browserProofHref ?? actionPath("collect-browser-proof"),
2761
+ phoneProofHref: options.phoneProofHref ?? actionPath("collect-phone-proof"),
2762
+ sourceHref: options.sourceHref ?? actionPath("collect-provider-role-evidence"),
2763
+ productionReadinessHref: options.productionReadinessHref ?? actionPath("refresh")
2764
+ }).map((action) => ({
2765
+ ...action,
2766
+ href: action.id === "collect-browser-proof" ? actionPath("collect-browser-proof") : action.id === "collect-phone-proof" ? actionPath("collect-phone-proof") : action.id === "collect-provider-role-evidence" ? actionPath("collect-provider-role-evidence") : action.href,
2767
+ method: action.id === "refresh" && (action.label === "Open real-call profile history" || action.label === "Open operations records") ? "GET" : "POST"
2768
+ }));
2769
+ return { actions, generatedAt: new Date().toISOString(), report };
2770
+ };
2771
+ const runAction = async (actionId) => {
2772
+ const report = await loadReport();
2773
+ const handler = options.handlers?.[actionId];
2774
+ if (!handler) {
2775
+ return {
2776
+ actionId,
2777
+ generatedAt: new Date().toISOString(),
2778
+ message: `No handler configured for real-call profile recovery action: ${actionId}.`,
2779
+ ok: false,
2780
+ status: "fail"
2781
+ };
2782
+ }
2783
+ const result = await handler({ actionId, report });
2784
+ return {
2785
+ actionId,
2786
+ generatedAt: new Date().toISOString(),
2787
+ message: result?.message,
2788
+ ok: result?.ok ?? true,
2789
+ report: result?.report,
2790
+ status: result?.status ?? "pass"
2791
+ };
2792
+ };
2793
+ routes.get(`${path}/actions`, async () => Response.json(await listActions(), { headers: options.headers }));
2794
+ for (const actionId of Object.keys(realCallProfileActionPaths)) {
2795
+ routes.post(actionPath(actionId), async ({ set }) => {
2796
+ const result = await runAction(actionId);
2797
+ if (!result.ok) {
2798
+ set.status = 501;
2799
+ }
2800
+ return Response.json(result, { headers: options.headers });
2801
+ });
2802
+ }
2803
+ return routes;
2804
+ };
2728
2805
  var createVoiceProofTrendRoutes = (options) => {
2729
2806
  const path = options.path ?? "/api/voice/proof-trends";
2730
2807
  const routes = new Elysia({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@absolutejs/voice",
3
- "version": "0.0.22-beta.371",
3
+ "version": "0.0.22-beta.372",
4
4
  "description": "Voice primitives and Elysia plugin for AbsoluteJS",
5
5
  "repository": {
6
6
  "type": "git",