@absolutejs/voice 0.0.22-beta.283 → 0.0.22-beta.285

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
@@ -27833,7 +27833,8 @@ var summarizeDeliveryRuntime = (summary) => {
27833
27833
  var summarizeLiveLatency = (events, options) => {
27834
27834
  const warnAfterMs = options.liveLatencyWarnAfterMs ?? 1800;
27835
27835
  const failAfterMs = options.liveLatencyFailAfterMs ?? 3200;
27836
- const latencies = events.filter((event) => event.type === "client.live_latency").map((event) => typeof event.payload.latencyMs === "number" ? event.payload.latencyMs : typeof event.payload.elapsedMs === "number" ? event.payload.elapsedMs : undefined).filter((value) => typeof value === "number");
27836
+ const minAt = typeof options.liveLatencyMaxAgeMs === "number" && Number.isFinite(options.liveLatencyMaxAgeMs) && options.liveLatencyMaxAgeMs > 0 ? Date.now() - options.liveLatencyMaxAgeMs : undefined;
27837
+ const latencies = events.filter((event) => event.type === "client.live_latency" && (minAt === undefined || event.at >= minAt)).map((event) => typeof event.payload.latencyMs === "number" ? event.payload.latencyMs : typeof event.payload.elapsedMs === "number" ? event.payload.elapsedMs : undefined).filter((value) => typeof value === "number");
27837
27838
  const failed = latencies.filter((value) => value > failAfterMs).length;
27838
27839
  const warnings = latencies.filter((value) => value > warnAfterMs && value <= failAfterMs).length;
27839
27840
  const averageLatencyMs = latencies.length > 0 ? Math.round(latencies.reduce((total, value) => total + value, 0) / latencies.length) : undefined;
@@ -27856,6 +27857,7 @@ var voiceOperationsRecordHref = (base, sessionId) => {
27856
27857
  };
27857
27858
  var buildOperationsRecordLinks = (input) => {
27858
27859
  const failedSessionSet = new Set(input.failedSessionIds);
27860
+ const minLiveLatencyAt = typeof input.liveLatencyMaxAgeMs === "number" && Number.isFinite(input.liveLatencyMaxAgeMs) && input.liveLatencyMaxAgeMs > 0 ? Date.now() - input.liveLatencyMaxAgeMs : undefined;
27859
27861
  const providerErrors = input.events.filter((event) => event.type === "session.error" && (event.payload.providerStatus === "error" || typeof event.payload.error === "string")).map((event) => ({
27860
27862
  detail: getString18(event.payload.error),
27861
27863
  href: voiceOperationsRecordHref(input.base, event.sessionId),
@@ -27863,7 +27865,7 @@ var buildOperationsRecordLinks = (input) => {
27863
27865
  sessionId: event.sessionId,
27864
27866
  status: "fail"
27865
27867
  }));
27866
- const failingLatency = input.events.filter((event) => event.type === "client.live_latency").map((event) => ({
27868
+ const failingLatency = input.events.filter((event) => event.type === "client.live_latency" && (minLiveLatencyAt === undefined || event.at >= minLiveLatencyAt)).map((event) => ({
27867
27869
  event,
27868
27870
  latencyMs: getNumber10(event.payload.latencyMs) ?? getNumber10(event.payload.elapsedMs)
27869
27871
  })).filter((entry) => entry.latencyMs !== undefined && entry.latencyMs > input.liveLatencyWarnAfterMs).map(({ event, latencyMs }) => ({
@@ -27972,6 +27974,7 @@ var buildVoiceProductionReadinessReport = async (options, input = {}) => {
27972
27974
  events,
27973
27975
  failedSessionIds: failedSessionItems.map((session) => session.sessionId),
27974
27976
  liveLatencyFailAfterMs: options.liveLatencyFailAfterMs ?? 3200,
27977
+ liveLatencyMaxAgeMs: options.liveLatencyMaxAgeMs,
27975
27978
  liveLatencyWarnAfterMs: options.liveLatencyWarnAfterMs ?? 1800
27976
27979
  });
27977
27980
  const checks = [
@@ -481,6 +481,7 @@ export type VoiceProductionReadinessRoutesOptions = {
481
481
  ttsProviders?: readonly string[];
482
482
  liveLatencyWarnAfterMs?: number;
483
483
  liveLatencyFailAfterMs?: number;
484
+ liveLatencyMaxAgeMs?: number;
484
485
  };
485
486
  export declare const summarizeVoiceProductionReadinessGate: (report: VoiceProductionReadinessReport, options?: VoiceProductionReadinessGateOptions) => VoiceProductionReadinessGateReport;
486
487
  export declare const evaluateVoiceProductionReadinessEvidence: (report: VoiceProductionReadinessReport, input?: VoiceProductionReadinessAssertionInput) => VoiceProductionReadinessAssertionReport;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@absolutejs/voice",
3
- "version": "0.0.22-beta.283",
3
+ "version": "0.0.22-beta.285",
4
4
  "description": "Voice primitives and Elysia plugin for AbsoluteJS",
5
5
  "repository": {
6
6
  "type": "git",