@absolutejs/voice 0.0.22-beta.216 → 0.0.22-beta.217

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
@@ -21397,6 +21397,7 @@ var listVoiceRoutingEvents = (events) => {
21397
21397
  operation: getString13(event.payload.operation),
21398
21398
  provider,
21399
21399
  routing: getString13(event.payload.routing),
21400
+ scenarioId: event.scenarioId,
21400
21401
  selectedProvider: getString13(event.payload.selectedProvider),
21401
21402
  sessionId: event.sessionId,
21402
21403
  status: providerStatus,
@@ -22067,7 +22068,7 @@ var summarizeSessions = (events) => {
22067
22068
  var buildVoiceProviderSloReport = async (options = {}) => {
22068
22069
  const rawEvents = options.events ?? await options.store?.list() ?? [];
22069
22070
  const now = options.now ?? Date.now();
22070
- const events = normalizeEvents2(rawEvents).filter((event) => typeof options.maxAgeMs !== "number" || now - event.at <= options.maxAgeMs);
22071
+ const events = normalizeEvents2(rawEvents).filter((event) => (typeof options.maxAgeMs !== "number" || now - event.at <= options.maxAgeMs) && (!options.sessionId || event.sessionId === options.sessionId) && (!options.scenarioId || event.scenarioId === options.scenarioId));
22071
22072
  const thresholds = mergeThresholds(options.thresholds);
22072
22073
  const observedKinds = new Set(events.map((event) => event.kind));
22073
22074
  const requiredKinds = new Set(options.requiredKinds ?? [...observedKinds]);
@@ -65,6 +65,8 @@ export type VoiceProviderSloReportOptions = {
65
65
  maxAgeMs?: number;
66
66
  now?: number;
67
67
  requiredKinds?: readonly VoiceRoutingEventKind[];
68
+ scenarioId?: string;
69
+ sessionId?: string;
68
70
  store?: VoiceTraceEventStore;
69
71
  thresholds?: VoiceProviderSloThresholdConfig;
70
72
  };
@@ -14,6 +14,7 @@ export type VoiceRoutingEvent = {
14
14
  operation?: string;
15
15
  provider?: string;
16
16
  routing?: string;
17
+ scenarioId?: string;
17
18
  selectedProvider?: string;
18
19
  sessionId: string;
19
20
  status?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@absolutejs/voice",
3
- "version": "0.0.22-beta.216",
3
+ "version": "0.0.22-beta.217",
4
4
  "description": "Voice primitives and Elysia plugin for AbsoluteJS",
5
5
  "repository": {
6
6
  "type": "git",