@absolutejs/voice 0.0.22-beta.288 → 0.0.22-beta.289

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
@@ -28262,6 +28262,13 @@ var buildVoiceProductionReadinessReport = async (options, input = {}) => {
28262
28262
  }
28263
28263
  ];
28264
28264
  const proofSource = (...keys) => keys.map((key) => proofSources?.[key]).find((source) => source !== undefined);
28265
+ const calibratedThresholdActions = () => options.links?.sloReadinessThresholds ? [
28266
+ {
28267
+ description: "Open the calibrated thresholds currently driving this readiness gate.",
28268
+ href: options.links.sloReadinessThresholds,
28269
+ label: "Open calibrated gate source"
28270
+ }
28271
+ ] : [];
28265
28272
  checks.push({
28266
28273
  detail: liveLatency.total === 0 ? "No browser live-latency measurements are recorded yet." : liveLatency.status === "pass" ? `Live browser turn latency averages ${liveLatency.averageLatencyMs}ms.` : `${liveLatency.failed} failed and ${liveLatency.warnings} warned live-latency measurement(s).`,
28267
28274
  href: firstOperationsRecordHref(operationsRecords.failingLatency) ?? options.links?.liveLatency ?? "/traces",
@@ -28281,7 +28288,8 @@ var buildVoiceProductionReadinessReport = async (options, input = {}) => {
28281
28288
  description: "Run a live browser voice turn and inspect the persisted latency trace.",
28282
28289
  href: options.links?.liveLatency ?? "/traces",
28283
28290
  label: "Open live latency traces"
28284
- }
28291
+ },
28292
+ ...calibratedThresholdActions()
28285
28293
  ]
28286
28294
  });
28287
28295
  const carrierSummary = carriers ? {
@@ -28447,7 +28455,8 @@ var buildVoiceProductionReadinessReport = async (options, input = {}) => {
28447
28455
  description: "Open provider SLO proof and inspect latency, timeout, fallback, and unresolved error budgets.",
28448
28456
  href: options.links?.providerSlo ?? options.links?.resilience ?? "/voice/provider-slos",
28449
28457
  label: "Open provider SLO report"
28450
- }
28458
+ },
28459
+ ...calibratedThresholdActions()
28451
28460
  ]
28452
28461
  });
28453
28462
  }
@@ -28575,7 +28584,8 @@ var buildVoiceProductionReadinessReport = async (options, input = {}) => {
28575
28584
  description: "Open reconnect proof and inspect disconnect, resume, and replay-safe turn state evidence.",
28576
28585
  href: options.links?.reconnectContracts ?? options.links?.sessions ?? "/sessions",
28577
28586
  label: "Open reconnect proof"
28578
- }
28587
+ },
28588
+ ...calibratedThresholdActions()
28579
28589
  ]
28580
28590
  });
28581
28591
  }
@@ -28592,7 +28602,8 @@ var buildVoiceProductionReadinessReport = async (options, input = {}) => {
28592
28602
  description: "Open barge-in proof and confirm assistant speech stops when the caller interrupts.",
28593
28603
  href: options.links?.bargeIn ?? "/barge-in",
28594
28604
  label: "Open barge-in proof"
28595
- }
28605
+ },
28606
+ ...calibratedThresholdActions()
28596
28607
  ]
28597
28608
  });
28598
28609
  }
@@ -28743,7 +28754,8 @@ var buildVoiceProductionReadinessReport = async (options, input = {}) => {
28743
28754
  description: "Open monitor issues and resolve or acknowledge customer-owned alerts before deploy.",
28744
28755
  href: options.links?.monitoring ?? "/voice/monitors",
28745
28756
  label: "Open monitor issues"
28746
- }
28757
+ },
28758
+ ...calibratedThresholdActions()
28747
28759
  ]
28748
28760
  });
28749
28761
  }
@@ -28759,7 +28771,8 @@ var buildVoiceProductionReadinessReport = async (options, input = {}) => {
28759
28771
  description: "Open monitor notification receipts and confirm webhook, Slack, email, or audit destinations are receiving issue alerts.",
28760
28772
  href: options.links?.monitoringNotifierDelivery ?? "/api/voice/monitor-issues/notifications",
28761
28773
  label: "Open monitor notification receipts"
28762
- }
28774
+ },
28775
+ ...calibratedThresholdActions()
28763
28776
  ]
28764
28777
  });
28765
28778
  }
@@ -28793,6 +28806,7 @@ var buildVoiceProductionReadinessReport = async (options, input = {}) => {
28793
28806
  reconnectContracts: "/sessions",
28794
28807
  resilience: "/resilience",
28795
28808
  sessions: "/sessions",
28809
+ sloReadinessThresholds: "/voice/slo-readiness-thresholds",
28796
28810
  traceDeliveries: "/traces/deliveries",
28797
28811
  ...options.links
28798
28812
  },
@@ -28855,6 +28869,7 @@ var buildVoiceProductionReadinessReport = async (options, input = {}) => {
28855
28869
  var buildVoiceProductionReadinessGate = async (options, input = {}) => summarizeVoiceProductionReadinessGate(await buildVoiceProductionReadinessReport(options, input), options.gate || undefined);
28856
28870
  var renderVoiceProductionReadinessHTML = (report, options = {}) => {
28857
28871
  const title = options.title ?? "AbsoluteJS Voice Production Readiness";
28872
+ const thresholdLink = report.links.sloReadinessThresholds ? `<p><a href="${escapeHtml41(report.links.sloReadinessThresholds)}">Open Calibration -&gt; Active Readiness Gate</a> to inspect the thresholds currently driving calibrated provider, latency, interruption, reconnect, and monitoring gates.</p>` : "";
28858
28873
  const profile = report.profile ? `<section class="profile"><p class="eyebrow">Readiness profile</p><h2>${escapeHtml41(report.profile.name)}</h2><p>${escapeHtml41(report.profile.description)}</p><p>${escapeHtml41(report.profile.purpose)}</p><div class="profile-surfaces">${report.profile.surfaces.map((surface) => `<article class="${surface.configured ? "pass" : "warn"}"><span>${surface.configured ? "CONFIGURED" : "EXPECTED"}</span><strong>${surface.href ? `<a href="${escapeHtml41(surface.href)}">${escapeHtml41(surface.label)}</a>` : escapeHtml41(surface.label)}</strong></article>`).join("")}</div></section>` : "";
28859
28874
  const checks = report.checks.map((check, index) => {
28860
28875
  const actions = (check.actions ?? []).map((action) => action.method === "POST" ? `<button type="button" data-readiness-action="${index}" data-action-url="${escapeHtml41(action.href)}">${escapeHtml41(action.label)}</button>` : `<a href="${escapeHtml41(action.href)}">${escapeHtml41(action.label)}</a>`).join("");
@@ -28886,7 +28901,7 @@ var renderVoiceProductionReadinessHTML = (report, options = {}) => {
28886
28901
  providerRoutingContracts: loadProviderRoutingContracts,
28887
28902
  store: traceStore
28888
28903
  });`);
28889
- return `<!doctype html><html lang="en"><head><meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" /><title>${escapeHtml41(title)}</title><style>body{background:#0c0f14;color:#f6f2e8;font-family:ui-sans-serif,system-ui,sans-serif;margin:0}main{margin:auto;max-width:1060px;padding:32px}.hero,.primitive,.profile{background:linear-gradient(135deg,rgba(20,184,166,.18),rgba(245,158,11,.12));border:1px solid #26313d;border-radius:28px;margin-bottom:18px;padding:28px}.primitive,.profile{background:#111722}.primitive{border-color:#3a3f2d}.eyebrow{color:#fbbf24;font-weight:900;letter-spacing:.12em;text-transform:uppercase}h1{font-size:clamp(2.4rem,6vw,5rem);line-height:.9;margin:.2rem 0 1rem}.status{display:inline-flex;border:1px solid #3f3f46;border-radius:999px;padding:8px 12px}.primitive code{color:#fde68a}.primitive p{color:#c8ccd3;line-height:1.55;margin:.45rem 0 0}.primitive pre{background:#0b0f16;border:1px solid #2c3440;border-radius:18px;color:#fef3c7;margin:16px 0 0;overflow:auto;padding:16px}.status.pass,.check.pass,.profile-surfaces .pass{border-color:rgba(34,197,94,.55)}.status.warn,.check.warn,.profile-surfaces .warn{border-color:rgba(245,158,11,.65)}.status.fail,.check.fail{border-color:rgba(239,68,68,.75)}.checks{display:grid;gap:14px}.check{align-items:center;background:#141922;border:1px solid #26313d;border-radius:22px;display:grid;gap:16px;grid-template-columns:1fr auto auto;padding:18px}.check span,.profile-surfaces span{color:#a8b0b8;font-size:.78rem;font-weight:900;letter-spacing:.08em}.check h2{margin:.2rem 0}.check p,.profile p{color:#b9c0c8;margin:.2rem 0 0}.check .proof-source{color:#f9d77e;font-weight:800}.check strong{font-size:1.5rem}.profile-surfaces{display:grid;gap:10px;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));margin-top:16px}.profile-surfaces article{background:#141922;border:1px solid #26313d;border-radius:16px;padding:14px}.profile-surfaces strong{display:block;margin-top:6px}.actions{display:flex;flex-wrap:wrap;gap:10px}.check a,a{color:#fbbf24}button{background:#fbbf24;border:0;border-radius:999px;color:#111827;cursor:pointer;font-weight:800;padding:9px 12px}button:disabled{cursor:wait;opacity:.65}@media(max-width:760px){main{padding:20px}.check{grid-template-columns:1fr}}</style></head><body><main><section class="hero"><p class="eyebrow">Self-hosted readiness</p><h1>${escapeHtml41(title)}</h1><p>One deployable pass/fail report for quality gates, provider failover, session health, handoffs, routing evidence, and optional carrier readiness.</p><p class="status ${escapeHtml41(report.status)}">Overall: ${escapeHtml41(report.status.toUpperCase())}</p><p>Checked ${escapeHtml41(new Date(report.checkedAt).toLocaleString())}</p></section>${profile}<section class="primitive"><p class="eyebrow">Copy into your app</p><h2><code>createVoiceProductionReadinessRoutes(...)</code> builds this deploy gate</h2><p>Mount one package primitive to expose JSON readiness, HTML readiness, and a machine-readable gate route. Feed it the proof stores and contract reports your app already owns.</p><pre><code>${snippet}</code></pre></section><section class="checks">${checks}</section></main><script>document.querySelectorAll("[data-readiness-action]").forEach((button)=>{button.addEventListener("click",async()=>{const url=button.getAttribute("data-action-url");if(!url)return;button.disabled=true;const original=button.textContent;button.textContent="Running...";try{const response=await fetch(url,{method:"POST"});button.textContent=response.ok?"Done. Reloading...":"Failed";if(response.ok)setTimeout(()=>location.reload(),500)}catch{button.textContent="Failed"}finally{setTimeout(()=>{button.disabled=false;button.textContent=original},1500)}})});</script></body></html>`;
28904
+ return `<!doctype html><html lang="en"><head><meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" /><title>${escapeHtml41(title)}</title><style>body{background:#0c0f14;color:#f6f2e8;font-family:ui-sans-serif,system-ui,sans-serif;margin:0}main{margin:auto;max-width:1060px;padding:32px}.hero,.primitive,.profile{background:linear-gradient(135deg,rgba(20,184,166,.18),rgba(245,158,11,.12));border:1px solid #26313d;border-radius:28px;margin-bottom:18px;padding:28px}.primitive,.profile{background:#111722}.primitive{border-color:#3a3f2d}.eyebrow{color:#fbbf24;font-weight:900;letter-spacing:.12em;text-transform:uppercase}h1{font-size:clamp(2.4rem,6vw,5rem);line-height:.9;margin:.2rem 0 1rem}.status{display:inline-flex;border:1px solid #3f3f46;border-radius:999px;padding:8px 12px}.primitive code{color:#fde68a}.primitive p{color:#c8ccd3;line-height:1.55;margin:.45rem 0 0}.primitive pre{background:#0b0f16;border:1px solid #2c3440;border-radius:18px;color:#fef3c7;margin:16px 0 0;overflow:auto;padding:16px}.status.pass,.check.pass,.profile-surfaces .pass{border-color:rgba(34,197,94,.55)}.status.warn,.check.warn,.profile-surfaces .warn{border-color:rgba(245,158,11,.65)}.status.fail,.check.fail{border-color:rgba(239,68,68,.75)}.checks{display:grid;gap:14px}.check{align-items:center;background:#141922;border:1px solid #26313d;border-radius:22px;display:grid;gap:16px;grid-template-columns:1fr auto auto;padding:18px}.check span,.profile-surfaces span{color:#a8b0b8;font-size:.78rem;font-weight:900;letter-spacing:.08em}.check h2{margin:.2rem 0}.check p,.profile p{color:#b9c0c8;margin:.2rem 0 0}.check .proof-source{color:#f9d77e;font-weight:800}.check strong{font-size:1.5rem}.profile-surfaces{display:grid;gap:10px;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));margin-top:16px}.profile-surfaces article{background:#141922;border:1px solid #26313d;border-radius:16px;padding:14px}.profile-surfaces strong{display:block;margin-top:6px}.actions{display:flex;flex-wrap:wrap;gap:10px}.check a,a{color:#fbbf24}button{background:#fbbf24;border:0;border-radius:999px;color:#111827;cursor:pointer;font-weight:800;padding:9px 12px}button:disabled{cursor:wait;opacity:.65}@media(max-width:760px){main{padding:20px}.check{grid-template-columns:1fr}}</style></head><body><main><section class="hero"><p class="eyebrow">Self-hosted readiness</p><h1>${escapeHtml41(title)}</h1><p>One deployable pass/fail report for quality gates, provider failover, session health, handoffs, routing evidence, and optional carrier readiness.</p><p class="status ${escapeHtml41(report.status)}">Overall: ${escapeHtml41(report.status.toUpperCase())}</p><p>Checked ${escapeHtml41(new Date(report.checkedAt).toLocaleString())}</p>${thresholdLink}</section>${profile}<section class="primitive"><p class="eyebrow">Copy into your app</p><h2><code>createVoiceProductionReadinessRoutes(...)</code> builds this deploy gate</h2><p>Mount one package primitive to expose JSON readiness, HTML readiness, and a machine-readable gate route. Feed it the proof stores and contract reports your app already owns.</p><pre><code>${snippet}</code></pre></section><section class="checks">${checks}</section></main><script>document.querySelectorAll("[data-readiness-action]").forEach((button)=>{button.addEventListener("click",async()=>{const url=button.getAttribute("data-action-url");if(!url)return;button.disabled=true;const original=button.textContent;button.textContent="Running...";try{const response=await fetch(url,{method:"POST"});button.textContent=response.ok?"Done. Reloading...":"Failed";if(response.ok)setTimeout(()=>location.reload(),500)}catch{button.textContent="Failed"}finally{setTimeout(()=>{button.disabled=false;button.textContent=original},1500)}})});</script></body></html>`;
28890
28905
  };
28891
28906
  var createVoiceProductionReadinessRoutes = (options) => {
28892
28907
  const path = options.path ?? "/api/production-readiness";
@@ -132,6 +132,7 @@ export type VoiceProductionReadinessReport = {
132
132
  reconnectContracts?: string;
133
133
  resilience?: string;
134
134
  sessions?: string;
135
+ sloReadinessThresholds?: string;
135
136
  traceDeliveries?: string;
136
137
  };
137
138
  profile?: VoiceProductionReadinessProfileExplanation;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@absolutejs/voice",
3
- "version": "0.0.22-beta.288",
3
+ "version": "0.0.22-beta.289",
4
4
  "description": "Voice primitives and Elysia plugin for AbsoluteJS",
5
5
  "repository": {
6
6
  "type": "git",