@absolutejs/voice 0.0.22-beta.150 → 0.0.22-beta.152

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
@@ -214,6 +214,129 @@ Recommended proof routes:
214
214
  - `/live-latency`: browser-measured speech-to-assistant p50/p95 latency.
215
215
  - `/turn-quality`: STT confidence, correction, fallback, and transcript diagnostics.
216
216
 
217
+ ## Delivery Runtime Presets
218
+
219
+ Use `createVoiceDeliveryRuntimePresetConfig(...)` when you want one primitive to create paired audit and trace delivery workers for the same target. The preset returns a normal `VoiceDeliveryRuntimeConfig`, so you can still inspect or override worker options before passing it to `createVoiceDeliveryRuntime(...)`.
220
+
221
+ ### File Delivery
222
+
223
+ Use file delivery for local demos, dev environments, or self-hosted deployments that collect exports from disk.
224
+
225
+ ```ts
226
+ import {
227
+ createVoiceDeliveryRuntime,
228
+ createVoiceDeliveryRuntimePresetConfig,
229
+ createVoiceDeliveryRuntimeRoutes,
230
+ createVoiceFileRuntimeStorage
231
+ } from '@absolutejs/voice';
232
+
233
+ const runtimeStorage = createVoiceFileRuntimeStorage({
234
+ directory: '.voice-runtime/support'
235
+ });
236
+
237
+ const deliveryRuntime = createVoiceDeliveryRuntime(
238
+ createVoiceDeliveryRuntimePresetConfig({
239
+ auditDeliveries: runtimeStorage.auditDeliveries,
240
+ directory: '.voice-runtime/support/delivery-exports',
241
+ leases: createLeaseCoordinator(),
242
+ mode: 'file',
243
+ traceDeliveries: runtimeStorage.traceDeliveries
244
+ })
245
+ );
246
+
247
+ app.use(
248
+ createVoiceDeliveryRuntimeRoutes({
249
+ runtime: deliveryRuntime
250
+ })
251
+ );
252
+ ```
253
+
254
+ ### Webhook Delivery
255
+
256
+ Use webhook delivery when audit and trace exports should go to your own ingestion service, SIEM bridge, warehouse collector, or internal ops backend. The built-in HTTP sinks support retries, optional HMAC signing, custom headers, timeouts, and custom envelope bodies.
257
+
258
+ ```ts
259
+ const deliveryRuntime = createVoiceDeliveryRuntime(
260
+ createVoiceDeliveryRuntimePresetConfig({
261
+ auditDeliveries: runtimeStorage.auditDeliveries,
262
+ auditSinkId: 'support-audit-webhook',
263
+ body: {
264
+ audit: ({ events }) => ({
265
+ eventCount: events.length,
266
+ events,
267
+ source: 'support-app',
268
+ surface: 'audit-deliveries'
269
+ }),
270
+ trace: ({ events }) => ({
271
+ eventCount: events.length,
272
+ events,
273
+ source: 'support-app',
274
+ surface: 'trace-deliveries'
275
+ })
276
+ },
277
+ failures: {
278
+ maxFailures: 3
279
+ },
280
+ leases: {
281
+ audit: createLeaseCoordinator(),
282
+ trace: createLeaseCoordinator()
283
+ },
284
+ mode: 'webhook',
285
+ signingSecret: process.env.VOICE_DELIVERY_WEBHOOK_SECRET,
286
+ traceDeliveries: runtimeStorage.traceDeliveries,
287
+ traceSinkId: 'support-trace-webhook',
288
+ url: process.env.VOICE_DELIVERY_WEBHOOK_URL!
289
+ })
290
+ );
291
+ ```
292
+
293
+ ### S3 Delivery
294
+
295
+ Use S3 delivery when exports should land directly in object storage through Bun's native S3 client. Set `bucket` and `keyPrefix`; the preset writes audit and trace exports under separate prefixes.
296
+
297
+ ```ts
298
+ const deliveryRuntime = createVoiceDeliveryRuntime(
299
+ createVoiceDeliveryRuntimePresetConfig({
300
+ auditDeliveries: runtimeStorage.auditDeliveries,
301
+ auditSinkId: 'support-audit-s3',
302
+ bucket: process.env.VOICE_DELIVERY_S3_BUCKET,
303
+ failures: {
304
+ maxFailures: 3
305
+ },
306
+ keyPrefix: 'support/voice-deliveries',
307
+ leases: {
308
+ audit: createLeaseCoordinator(),
309
+ trace: createLeaseCoordinator()
310
+ },
311
+ mode: 's3',
312
+ traceDeliveries: runtimeStorage.traceDeliveries,
313
+ traceSinkId: 'support-trace-s3'
314
+ })
315
+ );
316
+ ```
317
+
318
+ Mount `createVoiceDeliveryRuntimeRoutes({ runtime: deliveryRuntime })` to expose:
319
+
320
+ - `/api/voice-delivery-runtime`: combined audit and trace worker summary.
321
+ - `/api/voice-delivery-runtime/tick`: manual tick for both workers.
322
+ - `/delivery-runtime`: HTML worker control plane.
323
+
324
+ Pass the same runtime to production readiness so failed, dead-lettered, or pending export queues become deploy-blocking evidence:
325
+
326
+ ```ts
327
+ app.use(
328
+ createVoiceProductionReadinessRoutes({
329
+ auditDeliveries: runtimeStorage.auditDeliveries,
330
+ deliveryRuntime,
331
+ links: {
332
+ deliveryRuntime: '/delivery-runtime'
333
+ },
334
+ store: runtimeStorage.traces,
335
+ traceDeliveries: runtimeStorage.traceDeliveries
336
+ })
337
+ );
338
+ ```
339
+
217
340
  ## Simulation Suite Path
218
341
 
219
342
  Use `createVoiceSimulationSuiteRoutes(...)` when you want one pre-production proof surface for the things that usually live in separate dashboards or scripts:
@@ -518,6 +641,34 @@ For custom elements:
518
641
  </script>
519
642
  ```
520
643
 
644
+ ## Delivery Runtime Widgets
645
+
646
+ After mounting `createVoiceDeliveryRuntimeRoutes(...)`, apps can expose audit and trace worker health through the same framework-native primitives:
647
+
648
+ ```tsx
649
+ import { VoiceDeliveryRuntime } from '@absolutejs/voice/react';
650
+
651
+ export function DeliveryWorkers() {
652
+ return <VoiceDeliveryRuntime intervalMs={5000} />;
653
+ }
654
+ ```
655
+
656
+ ```ts
657
+ import { VoiceDeliveryRuntime } from '@absolutejs/voice/vue';
658
+ import { createVoiceDeliveryRuntime } from '@absolutejs/voice/svelte';
659
+ import { VoiceDeliveryRuntimeService } from '@absolutejs/voice/angular';
660
+ ```
661
+
662
+ For HTML or HTMX pages:
663
+
664
+ ```html
665
+ <absolute-voice-delivery-runtime interval-ms="5000"></absolute-voice-delivery-runtime>
666
+ <script type="module">
667
+ import { defineVoiceDeliveryRuntimeElement } from '@absolutejs/voice/client';
668
+ defineVoiceDeliveryRuntimeElement();
669
+ </script>
670
+ ```
671
+
521
672
  ## Voice Assistants
522
673
 
523
674
  Use `createVoiceAssistant(...)` when you want one product-level surface for a voice agent instead of wiring tools, guardrails, experiments, traces, and ops recipes separately. It returns a standard `onTurn` handler, plus an `ops` object you can pass to `voice(...)`.
@@ -1,4 +1,5 @@
1
1
  export { VoiceOpsStatusService } from './voice-ops-status.service';
2
+ export { VoiceDeliveryRuntimeService } from './voice-delivery-runtime.service';
2
3
  export { VoiceCampaignDialerProofService } from './voice-campaign-dialer-proof.service';
3
4
  export { VoiceStreamService } from './voice-stream.service';
4
5
  export { VoiceControllerService } from './voice-controller.service';
@@ -9,3 +10,4 @@ export { VoiceTraceTimelineService } from './voice-trace-timeline.service';
9
10
  export { VoiceTurnLatencyService } from './voice-turn-latency.service';
10
11
  export { VoiceTurnQualityService } from './voice-turn-quality.service';
11
12
  export { VoiceWorkflowStatusService } from './voice-workflow-status.service';
13
+ export { VoiceDeliveryRuntimeComponent } from './voice-delivery-runtime.component';