@absolutejs/voice 0.0.22-beta.175 → 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 +42 -0
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -19921,6 +19921,39 @@ var renderVoiceResilienceHTML = (input) => {
19921
19921
  const summary = summarizeRoutingEvents(input.routingEvents);
19922
19922
  const kindCounts = [...summary.byKind.entries()].map(([kind, count]) => `<span class="pill">${escapeHtml34(kind)}: ${String(count)}</span>`).join("");
19923
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
+ );`);
19924
19957
  return `<!doctype html>
19925
19958
  <html lang="en">
19926
19959
  <head>
@@ -19955,6 +19988,9 @@ var renderVoiceResilienceHTML = (input) => {
19955
19988
  button:disabled { cursor: not-allowed; opacity: 0.45; }
19956
19989
  .simulate-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
19957
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; }
19958
19994
  a { color: #f59e0b; }
19959
19995
  @media (max-width: 850px) { .grid, .provider-grid, .session-grid, dl { grid-template-columns: 1fr; } }
19960
19996
  </style>
@@ -19967,6 +20003,12 @@ var renderVoiceResilienceHTML = (input) => {
19967
20003
  ${links ? `<p>${links}</p>` : ""}
19968
20004
  <p>${kindCounts || '<span class="pill">No routing events yet</span>'}</p>
19969
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>
19970
20012
  <section class="grid">
19971
20013
  <article class="card metric"><span>Total routing events</span><strong>${summary.total}</strong></article>
19972
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.175",
3
+ "version": "0.0.22-beta.176",
4
4
  "description": "Voice primitives and Elysia plugin for AbsoluteJS",
5
5
  "repository": {
6
6
  "type": "git",