@absolutejs/voice 0.0.22-beta.363 → 0.0.22-beta.364

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
@@ -32423,10 +32423,12 @@ var buildVoiceProductionReadinessReport = async (options, input = {}) => {
32423
32423
  const request = input.request ?? new Request("http://localhost/");
32424
32424
  const query = input.query ?? {};
32425
32425
  const events = await options.store.list();
32426
- const routingEvents = listVoiceRoutingEvents(events);
32426
+ const minTraceAt = typeof options.traceMaxAgeMs === "number" && Number.isFinite(options.traceMaxAgeMs) && options.traceMaxAgeMs > 0 ? Date.now() - options.traceMaxAgeMs : undefined;
32427
+ const readinessEvents = minTraceAt === undefined ? events : events.filter((event) => event.at >= minTraceAt);
32428
+ const routingEvents = listVoiceRoutingEvents(readinessEvents);
32427
32429
  const routingSessions = summarizeVoiceRoutingSessions(routingEvents);
32428
- const liveLatency = summarizeLiveLatency(events, options);
32429
- const providerRecovery = summarizeVoiceProviderFallbackRecovery(events);
32430
+ const liveLatency = summarizeLiveLatency(readinessEvents, options);
32431
+ const providerRecovery = summarizeVoiceProviderFallbackRecovery(readinessEvents);
32430
32432
  const [
32431
32433
  quality,
32432
32434
  providers,
@@ -32462,23 +32464,23 @@ var buildVoiceProductionReadinessReport = async (options, input = {}) => {
32462
32464
  proofSources,
32463
32465
  additionalChecks
32464
32466
  ] = await Promise.all([
32465
- evaluateVoiceQuality({ events }),
32467
+ evaluateVoiceQuality({ events: readinessEvents }),
32466
32468
  Promise.all([
32467
32469
  summarizeVoiceProviderHealth({
32468
- events,
32470
+ events: readinessEvents,
32469
32471
  providers: options.llmProviders ?? []
32470
32472
  }),
32471
32473
  summarizeVoiceProviderHealth({
32472
- events: events.filter((event) => event.payload.kind === "stt"),
32474
+ events: readinessEvents.filter((event) => event.payload.kind === "stt"),
32473
32475
  providers: options.sttProviders ?? []
32474
32476
  }),
32475
32477
  summarizeVoiceProviderHealth({
32476
- events: events.filter((event) => event.payload.kind === "tts"),
32478
+ events: readinessEvents.filter((event) => event.payload.kind === "tts"),
32477
32479
  providers: options.ttsProviders ?? []
32478
32480
  })
32479
32481
  ]).then((groups) => groups.flat()),
32480
- summarizeVoiceSessions({ events, status: "all" }),
32481
- summarizeVoiceHandoffHealth({ events }),
32482
+ summarizeVoiceSessions({ events: readinessEvents, status: "all" }),
32483
+ summarizeVoiceHandoffHealth({ events: readinessEvents }),
32482
32484
  summarizeAuditEvidence(options),
32483
32485
  summarizeAuditDeliveries(options),
32484
32486
  summarizeOpsActionHistory(options),
@@ -32515,7 +32517,7 @@ var buildVoiceProductionReadinessReport = async (options, input = {}) => {
32515
32517
  const failedSessionItems = sessions.filter((session) => session.status === "failed");
32516
32518
  const operationsRecords = buildOperationsRecordLinks({
32517
32519
  base: options.links?.operationsRecords ?? "/voice-operations",
32518
- events,
32520
+ events: readinessEvents,
32519
32521
  failedSessionIds: failedSessionItems.map((session) => session.sessionId),
32520
32522
  liveLatencyFailAfterMs: options.liveLatencyFailAfterMs ?? 3200,
32521
32523
  liveLatencyMaxAgeMs: options.liveLatencyMaxAgeMs,
@@ -581,6 +581,7 @@ export type VoiceProductionReadinessRoutesOptions = {
581
581
  title?: string;
582
582
  traceDeliveries?: false | VoiceProductionReadinessTraceDeliveryOptions;
583
583
  ttsProviders?: readonly string[];
584
+ traceMaxAgeMs?: number;
584
585
  liveLatencyWarnAfterMs?: number;
585
586
  liveLatencyFailAfterMs?: number;
586
587
  liveLatencyMaxAgeMs?: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@absolutejs/voice",
3
- "version": "0.0.22-beta.363",
3
+ "version": "0.0.22-beta.364",
4
4
  "description": "Voice primitives and Elysia plugin for AbsoluteJS",
5
5
  "repository": {
6
6
  "type": "git",