@absolutejs/voice 0.0.22-beta.174 → 0.0.22-beta.176

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.
Files changed (2) hide show
  1. package/dist/index.js +68 -4
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -11917,11 +11917,33 @@ var renderVoiceDeliveryRuntimeHTML = (report, options = {}) => {
11917
11917
  const title = options.title ?? "AbsoluteJS Voice Delivery Runtime";
11918
11918
  const tickForm = options.tickPath === false ? "" : `<form method="post" action="${escapeHtml16(options.tickPath ?? "/api/voice-delivery-runtime/tick")}"><button type="submit">Tick delivery workers</button></form>`;
11919
11919
  const requeueForm = options.requeueDeadLettersPath === false ? "" : `<form method="post" action="${escapeHtml16(options.requeueDeadLettersPath ?? "/api/voice-delivery-runtime/requeue-dead-letters")}"><button type="submit">Requeue dead letters</button></form>`;
11920
- return `<!doctype html><html lang="en"><head><meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" /><title>${escapeHtml16(title)}</title><style>body{background:#0f1411;color:#f7f2df;font-family:ui-sans-serif,system-ui,sans-serif;margin:0}main{margin:auto;max-width:1080px;padding:32px}a{color:#86efac;text-decoration:none}.hero{background:linear-gradient(135deg,rgba(34,197,94,.18),rgba(14,165,233,.13));border:1px solid #263a30;border-radius:28px;margin-bottom:18px;padding:28px}.eyebrow{color:#86efac;font-weight:900;letter-spacing:.12em;text-transform:uppercase}h1{font-size:clamp(2.2rem,5vw,4.8rem);line-height:.92;margin:.2rem 0 1rem}.status{border:1px solid #64748b;border-radius:999px;display:inline-flex;font-weight:900;padding:8px 12px}.status.running{border-color:rgba(34,197,94,.7);color:#bbf7d0}.muted{color:#b9c3b4}.grid{display:grid;gap:14px;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));margin:18px 0}article,.card{background:#151d18;border:1px solid #263a30;border-radius:22px;padding:18px}article span{color:#b9c3b4;display:block;font-weight:800}article strong{display:block;font-size:2.3rem;margin-top:8px}.actions{display:flex;flex-wrap:wrap;gap:10px}button{background:#86efac;border:0;border-radius:999px;color:#07120b;cursor:pointer;font-weight:900;margin-top:12px;padding:10px 14px}pre{background:#09100c;border:1px solid #263a30;border-radius:18px;color:#dcfce7;overflow:auto;padding:16px}</style></head><body><main><p><a href="/delivery-sinks">Delivery sinks</a></p><section class="hero"><p class="eyebrow">Worker control plane</p><h1>${escapeHtml16(title)}</h1><p class="muted">Inspect queue summaries, manually tick failed/pending audit and trace deliveries, and requeue dead letters after operator review.</p><p class="status ${report.isRunning ? "running" : ""}">${report.isRunning ? "Running" : "Stopped"}</p><p class="muted">Checked ${escapeHtml16(new Date(report.checkedAt).toLocaleString())}</p><div class="actions">${tickForm}${requeueForm}</div></section><section class="grid">${renderSummaryCard("Audit", report.summary.audit)}${renderSummaryCard("Trace", report.summary.trace)}</section><section class="card"><h2>Runtime shape</h2><pre>const runtime = createVoiceDeliveryRuntime({ audit, trace })
11920
+ const snippet = escapeHtml16(`const deliveryRuntime = createVoiceDeliveryRuntime(
11921
+ createVoiceDeliveryRuntimePresetConfig({
11922
+ audit: {
11923
+ deliveries: runtimeStorage.auditDeliveries,
11924
+ leases: runtimeStorage.auditDeliveryLeases,
11925
+ sinks: [auditSink],
11926
+ workerId: 'voice-audit-delivery'
11927
+ },
11928
+ trace: {
11929
+ deliveries: runtimeStorage.traceDeliveries,
11930
+ leases: runtimeStorage.traceDeliveryLeases,
11931
+ sinks: [traceSink],
11932
+ workerId: 'voice-trace-delivery'
11933
+ }
11934
+ })
11935
+ );
11921
11936
 
11922
- await runtime.tick()
11923
- await runtime.requeueDeadLetters()
11924
- await runtime.summarize()</pre></section></main></body></html>`;
11937
+ app.use(createVoiceDeliveryRuntimeRoutes({ runtime: deliveryRuntime }));
11938
+
11939
+ app.use(
11940
+ createVoiceProductionReadinessRoutes({
11941
+ deliveryRuntime,
11942
+ auditDeliveries: runtimeStorage.auditDeliveries,
11943
+ traceDeliveries: runtimeStorage.traceDeliveries
11944
+ })
11945
+ );`);
11946
+ return `<!doctype html><html lang="en"><head><meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" /><title>${escapeHtml16(title)}</title><style>body{background:#0f1411;color:#f7f2df;font-family:ui-sans-serif,system-ui,sans-serif;margin:0}main{margin:auto;max-width:1080px;padding:32px}a{color:#86efac;text-decoration:none}.hero{background:linear-gradient(135deg,rgba(34,197,94,.18),rgba(14,165,233,.13));border:1px solid #263a30;border-radius:28px;margin-bottom:18px;padding:28px}.eyebrow{color:#86efac;font-weight:900;letter-spacing:.12em;text-transform:uppercase}h1{font-size:clamp(2.2rem,5vw,4.8rem);line-height:.92;margin:.2rem 0 1rem}.status{border:1px solid #64748b;border-radius:999px;display:inline-flex;font-weight:900;padding:8px 12px}.status.running{border-color:rgba(34,197,94,.7);color:#bbf7d0}.muted{color:#b9c3b4}.grid{display:grid;gap:14px;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));margin:18px 0}article,.card{background:#151d18;border:1px solid #263a30;border-radius:22px;padding:18px}.primitive{background:#111a15;border-color:#41604a}article span{color:#b9c3b4;display:block;font-weight:800}article strong{display:block;font-size:2.3rem;margin-top:8px}.actions{display:flex;flex-wrap:wrap;gap:10px}button{background:#86efac;border:0;border-radius:999px;color:#07120b;cursor:pointer;font-weight:900;margin-top:12px;padding:10px 14px}pre{background:#09100c;border:1px solid #263a30;border-radius:18px;color:#dcfce7;overflow:auto;padding:16px}.primitive p{color:#c8d8ca;line-height:1.55}.primitive code{color:#bbf7d0}</style></head><body><main><p><a href="/delivery-sinks">Delivery sinks</a></p><section class="hero"><p class="eyebrow">Worker control plane</p><h1>${escapeHtml16(title)}</h1><p class="muted">Inspect queue summaries, manually tick failed/pending audit and trace deliveries, and requeue dead letters after operator review.</p><p class="status ${report.isRunning ? "running" : ""}">${report.isRunning ? "Running" : "Stopped"}</p><p class="muted">Checked ${escapeHtml16(new Date(report.checkedAt).toLocaleString())}</p><div class="actions">${tickForm}${requeueForm}</div></section><section class="grid">${renderSummaryCard("Audit", report.summary.audit)}${renderSummaryCard("Trace", report.summary.trace)}</section><section class="card primitive"><p class="eyebrow">Copy into your app</p><h2><code>createVoiceDeliveryRuntimeRoutes(...)</code> builds this control plane</h2><p>Own the audit and trace delivery queues in your app, mount one runtime route group, and pass the same runtime into production readiness so failed or dead-lettered exports block deploys.</p><pre><code>${snippet}</code></pre></section></main></body></html>`;
11925
11947
  };
11926
11948
  var createVoiceDeliveryRuntimeRoutes = (options) => {
11927
11949
  const path = options.path ?? "/api/voice-delivery-runtime";
@@ -19899,6 +19921,39 @@ var renderVoiceResilienceHTML = (input) => {
19899
19921
  const summary = summarizeRoutingEvents(input.routingEvents);
19900
19922
  const kindCounts = [...summary.byKind.entries()].map(([kind, count]) => `<span class="pill">${escapeHtml34(kind)}: ${String(count)}</span>`).join("");
19901
19923
  const links = input.links?.length ? input.links.map((link) => `<a href="${escapeHtml34(link.href)}">${escapeHtml34(link.label)}</a>`).join(" \xB7 ") : "";
19924
+ const snippet = escapeHtml34(`const sttSimulator = createVoiceIOProviderFailureSimulator({
19925
+ kind: 'stt',
19926
+ providers: ['deepgram', 'assemblyai'],
19927
+ fallback: ['deepgram', 'assemblyai'],
19928
+ onProviderEvent: async (event, input) => {
19929
+ await traceStore.append({
19930
+ at: event.at,
19931
+ payload: { ...event, providerStatus: event.status },
19932
+ sessionId: input.sessionId,
19933
+ type: 'session.error'
19934
+ });
19935
+ }
19936
+ });
19937
+
19938
+ app.use(
19939
+ createVoiceResilienceRoutes({
19940
+ store: traceStore,
19941
+ sttProviders: ['deepgram', 'assemblyai'],
19942
+ sttSimulation: {
19943
+ failureProviders: ['deepgram'],
19944
+ fallbackRequiredProvider: 'assemblyai',
19945
+ providers: [{ provider: 'deepgram' }, { provider: 'assemblyai' }],
19946
+ run: sttSimulator.run
19947
+ }
19948
+ })
19949
+ );
19950
+
19951
+ app.use(
19952
+ createVoiceProductionReadinessRoutes({
19953
+ links: { resilience: '/resilience' },
19954
+ store: traceStore
19955
+ })
19956
+ );`);
19902
19957
  return `<!doctype html>
19903
19958
  <html lang="en">
19904
19959
  <head>
@@ -19933,6 +19988,9 @@ var renderVoiceResilienceHTML = (input) => {
19933
19988
  button:disabled { cursor: not-allowed; opacity: 0.45; }
19934
19989
  .simulate-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
19935
19990
  .simulate-output { background: #050505; border: 1px solid #27272a; border-radius: 14px; color: #d4d4d8; overflow: auto; padding: 12px; white-space: pre-wrap; }
19991
+ .primitive { border-color: rgba(245, 158, 11, 0.45); }
19992
+ .primitive pre { background: #050505; border: 1px solid #27272a; border-radius: 14px; color: #fef3c7; overflow: auto; padding: 14px; }
19993
+ .primitive code { color: #fef3c7; }
19936
19994
  a { color: #f59e0b; }
19937
19995
  @media (max-width: 850px) { .grid, .provider-grid, .session-grid, dl { grid-template-columns: 1fr; } }
19938
19996
  </style>
@@ -19945,6 +20003,12 @@ var renderVoiceResilienceHTML = (input) => {
19945
20003
  ${links ? `<p>${links}</p>` : ""}
19946
20004
  <p>${kindCounts || '<span class="pill">No routing events yet</span>'}</p>
19947
20005
  </section>
20006
+ <section class="primitive">
20007
+ <p class="muted">Copy into your app</p>
20008
+ <h2><code>createVoiceResilienceRoutes(...)</code> builds this failover proof surface</h2>
20009
+ <p class="muted">Mount one route group for provider health, routing traces, and failure simulation. Feed the same trace store into production readiness so unresolved provider errors fail the deploy gate while recovered fallback stays visible.</p>
20010
+ <pre><code>${snippet}</code></pre>
20011
+ </section>
19948
20012
  <section class="grid">
19949
20013
  <article class="card metric"><span>Total routing events</span><strong>${summary.total}</strong></article>
19950
20014
  <article class="card metric"><span>Fallbacks</span><strong>${summary.fallbacks}</strong></article>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@absolutejs/voice",
3
- "version": "0.0.22-beta.174",
3
+ "version": "0.0.22-beta.176",
4
4
  "description": "Voice primitives and Elysia plugin for AbsoluteJS",
5
5
  "repository": {
6
6
  "type": "git",