@absolutejs/voice 0.0.22-beta.5 → 0.0.22-beta.51

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 (57) hide show
  1. package/dist/angular/index.d.ts +3 -0
  2. package/dist/angular/index.js +463 -43
  3. package/dist/angular/voice-app-kit-status.service.d.ts +12 -0
  4. package/dist/angular/voice-provider-status.service.d.ts +12 -0
  5. package/dist/angular/voice-stream.service.d.ts +2 -0
  6. package/dist/angular/voice-workflow-status.service.d.ts +12 -0
  7. package/dist/appKit.d.ts +92 -0
  8. package/dist/assistantHealth.d.ts +81 -0
  9. package/dist/client/actions.d.ts +22 -0
  10. package/dist/client/appKitStatus.d.ts +19 -0
  11. package/dist/client/connection.d.ts +3 -0
  12. package/dist/client/htmxBootstrap.js +44 -2
  13. package/dist/client/index.d.ts +6 -0
  14. package/dist/client/index.js +285 -2
  15. package/dist/client/providerStatus.d.ts +19 -0
  16. package/dist/client/workflowStatus.d.ts +19 -0
  17. package/dist/diagnosticsRoutes.d.ts +44 -0
  18. package/dist/evalRoutes.d.ts +213 -0
  19. package/dist/handoff.d.ts +54 -0
  20. package/dist/handoffHealth.d.ts +94 -0
  21. package/dist/index.d.ts +32 -4
  22. package/dist/index.js +4425 -166
  23. package/dist/modelAdapters.d.ts +81 -0
  24. package/dist/opsConsoleRoutes.d.ts +77 -0
  25. package/dist/opsWebhook.d.ts +126 -0
  26. package/dist/providerAdapters.d.ts +37 -0
  27. package/dist/providerHealth.d.ts +79 -0
  28. package/dist/qualityRoutes.d.ts +76 -0
  29. package/dist/queue.d.ts +52 -0
  30. package/dist/react/index.d.ts +3 -0
  31. package/dist/react/index.js +355 -11
  32. package/dist/react/useVoiceAppKitStatus.d.ts +8 -0
  33. package/dist/react/useVoiceController.d.ts +2 -0
  34. package/dist/react/useVoiceProviderStatus.d.ts +8 -0
  35. package/dist/react/useVoiceStream.d.ts +2 -0
  36. package/dist/react/useVoiceWorkflowStatus.d.ts +8 -0
  37. package/dist/resilienceRoutes.d.ts +106 -0
  38. package/dist/sessionReplay.d.ts +175 -0
  39. package/dist/svelte/createVoiceAppKitStatus.d.ts +8 -0
  40. package/dist/svelte/createVoiceProviderStatus.d.ts +8 -0
  41. package/dist/svelte/createVoiceWorkflowStatus.d.ts +8 -0
  42. package/dist/svelte/index.d.ts +3 -0
  43. package/dist/svelte/index.js +292 -3
  44. package/dist/testing/index.d.ts +2 -0
  45. package/dist/testing/index.js +1468 -7
  46. package/dist/testing/ioProviderSimulator.d.ts +41 -0
  47. package/dist/testing/providerSimulator.d.ts +44 -0
  48. package/dist/trace.d.ts +1 -1
  49. package/dist/types.d.ts +84 -2
  50. package/dist/vue/index.d.ts +3 -0
  51. package/dist/vue/index.js +412 -25
  52. package/dist/vue/useVoiceAppKitStatus.d.ts +9 -0
  53. package/dist/vue/useVoiceProviderStatus.d.ts +9 -0
  54. package/dist/vue/useVoiceStream.d.ts +2 -0
  55. package/dist/vue/useVoiceWorkflowStatus.d.ts +9 -0
  56. package/dist/workflowContract.d.ts +91 -0
  57. package/package.json +1 -1
@@ -80,7 +80,7 @@ var DEFAULT_SCENARIO_QUERY_PARAM = "scenarioId";
80
80
  var noop = () => {};
81
81
  var noopUnsubscribe = () => noop;
82
82
  var NOOP_CONNECTION = {
83
- start: () => {},
83
+ callControl: noop,
84
84
  close: noop,
85
85
  endTurn: noop,
86
86
  getReadyState: () => WS_CLOSED,
@@ -88,6 +88,7 @@ var NOOP_CONNECTION = {
88
88
  getSessionId: () => "",
89
89
  send: noop,
90
90
  sendAudio: noop,
91
+ start: () => {},
91
92
  subscribe: noopUnsubscribe
92
93
  };
93
94
  var createSessionId = () => crypto.randomUUID();
@@ -109,6 +110,7 @@ var isVoiceServerMessage = (value) => {
109
110
  switch (value.type) {
110
111
  case "audio":
111
112
  case "assistant":
113
+ case "call_lifecycle":
112
114
  case "complete":
113
115
  case "error":
114
116
  case "final":
@@ -249,6 +251,12 @@ var createVoiceConnection = (path, options = {}) => {
249
251
  const endTurn = () => {
250
252
  send({ type: "end_turn" });
251
253
  };
254
+ const callControl = (message) => {
255
+ send({
256
+ ...message,
257
+ type: "call_control"
258
+ });
259
+ };
252
260
  const close = () => {
253
261
  clearTimers();
254
262
  if (state.ws) {
@@ -266,7 +274,7 @@ var createVoiceConnection = (path, options = {}) => {
266
274
  };
267
275
  connect();
268
276
  return {
269
- start,
277
+ callControl,
270
278
  close,
271
279
  endTurn,
272
280
  getReadyState: () => state.ws?.readyState ?? WS_CLOSED,
@@ -274,6 +282,7 @@ var createVoiceConnection = (path, options = {}) => {
274
282
  getSessionId: () => state.sessionId,
275
283
  send,
276
284
  sendAudio,
285
+ start,
277
286
  subscribe
278
287
  };
279
288
  };
@@ -671,6 +680,12 @@ var serverMessageToAction = (message) => {
671
680
  sessionId: message.sessionId,
672
681
  type: "complete"
673
682
  };
683
+ case "call_lifecycle":
684
+ return {
685
+ event: message.event,
686
+ sessionId: message.sessionId,
687
+ type: "call_lifecycle"
688
+ };
674
689
  case "error":
675
690
  return {
676
691
  message: normalizeErrorMessage(message.message),
@@ -707,6 +722,7 @@ var serverMessageToAction = (message) => {
707
722
  var createInitialState2 = () => ({
708
723
  assistantAudio: [],
709
724
  assistantTexts: [],
725
+ call: null,
710
726
  error: null,
711
727
  isConnected: false,
712
728
  scenarioId: null,
@@ -750,6 +766,20 @@ var createVoiceStreamStore = () => {
750
766
  status: "completed"
751
767
  };
752
768
  break;
769
+ case "call_lifecycle":
770
+ state = {
771
+ ...state,
772
+ call: {
773
+ ...state.call,
774
+ disposition: action.event.type === "end" ? action.event.disposition : state.call?.disposition,
775
+ endedAt: action.event.type === "end" ? action.event.at : state.call?.endedAt,
776
+ events: [...state.call?.events ?? [], action.event],
777
+ lastEventAt: action.event.at,
778
+ startedAt: state.call?.startedAt ?? action.event.at
779
+ },
780
+ sessionId: action.sessionId
781
+ };
782
+ break;
753
783
  case "connected":
754
784
  state = {
755
785
  ...state,
@@ -836,6 +866,9 @@ var createVoiceStream = (path, options = {}) => {
836
866
  }
837
867
  });
838
868
  return {
869
+ callControl(message) {
870
+ connection.callControl(message);
871
+ },
839
872
  close() {
840
873
  unsubscribeConnection();
841
874
  connection.close();
@@ -879,6 +912,9 @@ var createVoiceStream = (path, options = {}) => {
879
912
  get assistantAudio() {
880
913
  return store.getSnapshot().assistantAudio;
881
914
  },
915
+ get call() {
916
+ return store.getSnapshot().call;
917
+ },
882
918
  sendAudio(audio) {
883
919
  connection.sendAudio(audio);
884
920
  },
@@ -1352,6 +1388,7 @@ var resolveVoiceRuntimePreset = (name = "default") => {
1352
1388
  var createInitialState3 = (stream) => ({
1353
1389
  assistantAudio: [...stream.assistantAudio],
1354
1390
  assistantTexts: [...stream.assistantTexts],
1391
+ call: stream.call,
1355
1392
  error: stream.error,
1356
1393
  isConnected: stream.isConnected,
1357
1394
  isRecording: false,
@@ -1381,6 +1418,7 @@ var createVoiceController = (path, options = {}) => {
1381
1418
  ...state,
1382
1419
  assistantAudio: [...stream.assistantAudio],
1383
1420
  assistantTexts: [...stream.assistantTexts],
1421
+ call: stream.call,
1384
1422
  error: stream.error,
1385
1423
  isConnected: stream.isConnected,
1386
1424
  partial: stream.partial,
@@ -1458,6 +1496,7 @@ var createVoiceController = (path, options = {}) => {
1458
1496
  bindHTMX(bindingOptions) {
1459
1497
  return bindVoiceHTMX(stream, bindingOptions);
1460
1498
  },
1499
+ callControl: (message) => stream.callControl(message),
1461
1500
  close,
1462
1501
  endTurn: () => stream.endTurn(),
1463
1502
  get error() {
@@ -1510,6 +1549,9 @@ var createVoiceController = (path, options = {}) => {
1510
1549
  },
1511
1550
  get assistantAudio() {
1512
1551
  return state.assistantAudio;
1552
+ },
1553
+ get call() {
1554
+ return state.call;
1513
1555
  }
1514
1556
  };
1515
1557
  };
@@ -1581,13 +1623,254 @@ var createVoiceDuplexController = (path, options = {}) => {
1581
1623
  }
1582
1624
  };
1583
1625
  };
1626
+ // src/client/appKitStatus.ts
1627
+ var fetchVoiceAppKitStatus = async (path = "/app-kit/status", options = {}) => {
1628
+ const fetchImpl = options.fetch ?? globalThis.fetch;
1629
+ const response = await fetchImpl(path);
1630
+ if (!response.ok) {
1631
+ throw new Error(`Voice app kit status failed: HTTP ${response.status}`);
1632
+ }
1633
+ return await response.json();
1634
+ };
1635
+ var createVoiceAppKitStatusStore = (path = "/app-kit/status", options = {}) => {
1636
+ const listeners = new Set;
1637
+ let closed = false;
1638
+ let timer;
1639
+ let snapshot = {
1640
+ error: null,
1641
+ isLoading: false
1642
+ };
1643
+ const emit = () => {
1644
+ for (const listener of listeners) {
1645
+ listener();
1646
+ }
1647
+ };
1648
+ const refresh = async () => {
1649
+ if (closed) {
1650
+ return snapshot.report;
1651
+ }
1652
+ snapshot = {
1653
+ ...snapshot,
1654
+ error: null,
1655
+ isLoading: true
1656
+ };
1657
+ emit();
1658
+ try {
1659
+ const report = await fetchVoiceAppKitStatus(path, options);
1660
+ snapshot = {
1661
+ error: null,
1662
+ isLoading: false,
1663
+ report,
1664
+ updatedAt: Date.now()
1665
+ };
1666
+ emit();
1667
+ return report;
1668
+ } catch (error) {
1669
+ snapshot = {
1670
+ ...snapshot,
1671
+ error: error instanceof Error ? error.message : String(error),
1672
+ isLoading: false
1673
+ };
1674
+ emit();
1675
+ throw error;
1676
+ }
1677
+ };
1678
+ const close = () => {
1679
+ closed = true;
1680
+ if (timer) {
1681
+ clearInterval(timer);
1682
+ timer = undefined;
1683
+ }
1684
+ listeners.clear();
1685
+ };
1686
+ if (typeof window !== "undefined" && options.intervalMs && options.intervalMs > 0) {
1687
+ timer = setInterval(() => {
1688
+ refresh().catch(() => {});
1689
+ }, options.intervalMs);
1690
+ }
1691
+ return {
1692
+ close,
1693
+ getServerSnapshot: () => snapshot,
1694
+ getSnapshot: () => snapshot,
1695
+ refresh,
1696
+ subscribe: (listener) => {
1697
+ listeners.add(listener);
1698
+ return () => {
1699
+ listeners.delete(listener);
1700
+ };
1701
+ }
1702
+ };
1703
+ };
1704
+ // src/client/providerStatus.ts
1705
+ var fetchVoiceProviderStatus = async (path = "/api/provider-status", options = {}) => {
1706
+ const fetchImpl = options.fetch ?? globalThis.fetch;
1707
+ const response = await fetchImpl(path);
1708
+ if (!response.ok) {
1709
+ throw new Error(`Voice provider status failed: HTTP ${response.status}`);
1710
+ }
1711
+ return await response.json();
1712
+ };
1713
+ var createVoiceProviderStatusStore = (path = "/api/provider-status", options = {}) => {
1714
+ const listeners = new Set;
1715
+ let closed = false;
1716
+ let timer;
1717
+ let snapshot = {
1718
+ error: null,
1719
+ isLoading: false,
1720
+ providers: []
1721
+ };
1722
+ const emit = () => {
1723
+ for (const listener of listeners) {
1724
+ listener();
1725
+ }
1726
+ };
1727
+ const refresh = async () => {
1728
+ if (closed) {
1729
+ return snapshot.providers;
1730
+ }
1731
+ snapshot = {
1732
+ ...snapshot,
1733
+ error: null,
1734
+ isLoading: true
1735
+ };
1736
+ emit();
1737
+ try {
1738
+ const providers = await fetchVoiceProviderStatus(path, options);
1739
+ snapshot = {
1740
+ error: null,
1741
+ isLoading: false,
1742
+ providers,
1743
+ updatedAt: Date.now()
1744
+ };
1745
+ emit();
1746
+ return providers;
1747
+ } catch (error) {
1748
+ snapshot = {
1749
+ ...snapshot,
1750
+ error: error instanceof Error ? error.message : String(error),
1751
+ isLoading: false
1752
+ };
1753
+ emit();
1754
+ throw error;
1755
+ }
1756
+ };
1757
+ const close = () => {
1758
+ closed = true;
1759
+ if (timer) {
1760
+ clearInterval(timer);
1761
+ timer = undefined;
1762
+ }
1763
+ listeners.clear();
1764
+ };
1765
+ if (options.intervalMs && options.intervalMs > 0) {
1766
+ timer = setInterval(() => {
1767
+ refresh().catch(() => {});
1768
+ }, options.intervalMs);
1769
+ }
1770
+ return {
1771
+ close,
1772
+ getServerSnapshot: () => snapshot,
1773
+ getSnapshot: () => snapshot,
1774
+ refresh,
1775
+ subscribe: (listener) => {
1776
+ listeners.add(listener);
1777
+ return () => {
1778
+ listeners.delete(listener);
1779
+ };
1780
+ }
1781
+ };
1782
+ };
1783
+ // src/client/workflowStatus.ts
1784
+ var fetchVoiceWorkflowStatus = async (path = "/evals/scenarios/json", options = {}) => {
1785
+ const fetchImpl = options.fetch ?? globalThis.fetch;
1786
+ const response = await fetchImpl(path);
1787
+ if (!response.ok) {
1788
+ throw new Error(`Voice workflow status failed: HTTP ${response.status}`);
1789
+ }
1790
+ return await response.json();
1791
+ };
1792
+ var createVoiceWorkflowStatusStore = (path = "/evals/scenarios/json", options = {}) => {
1793
+ const listeners = new Set;
1794
+ let closed = false;
1795
+ let timer;
1796
+ let snapshot = {
1797
+ error: null,
1798
+ isLoading: false
1799
+ };
1800
+ const emit = () => {
1801
+ for (const listener of listeners) {
1802
+ listener();
1803
+ }
1804
+ };
1805
+ const refresh = async () => {
1806
+ if (closed) {
1807
+ return snapshot.report;
1808
+ }
1809
+ snapshot = {
1810
+ ...snapshot,
1811
+ error: null,
1812
+ isLoading: true
1813
+ };
1814
+ emit();
1815
+ try {
1816
+ const report = await fetchVoiceWorkflowStatus(path, options);
1817
+ snapshot = {
1818
+ error: null,
1819
+ isLoading: false,
1820
+ report,
1821
+ updatedAt: Date.now()
1822
+ };
1823
+ emit();
1824
+ return report;
1825
+ } catch (error) {
1826
+ snapshot = {
1827
+ ...snapshot,
1828
+ error: error instanceof Error ? error.message : String(error),
1829
+ isLoading: false
1830
+ };
1831
+ emit();
1832
+ throw error;
1833
+ }
1834
+ };
1835
+ const close = () => {
1836
+ closed = true;
1837
+ if (timer) {
1838
+ clearInterval(timer);
1839
+ timer = undefined;
1840
+ }
1841
+ listeners.clear();
1842
+ };
1843
+ if (typeof window !== "undefined" && options.intervalMs && options.intervalMs > 0) {
1844
+ timer = setInterval(() => {
1845
+ refresh().catch(() => {});
1846
+ }, options.intervalMs);
1847
+ }
1848
+ return {
1849
+ close,
1850
+ getServerSnapshot: () => snapshot,
1851
+ getSnapshot: () => snapshot,
1852
+ refresh,
1853
+ subscribe: (listener) => {
1854
+ listeners.add(listener);
1855
+ return () => {
1856
+ listeners.delete(listener);
1857
+ };
1858
+ }
1859
+ };
1860
+ };
1584
1861
  export {
1862
+ fetchVoiceWorkflowStatus,
1863
+ fetchVoiceProviderStatus,
1864
+ fetchVoiceAppKitStatus,
1585
1865
  decodeVoiceAudioChunk,
1866
+ createVoiceWorkflowStatusStore,
1586
1867
  createVoiceStream,
1868
+ createVoiceProviderStatusStore,
1587
1869
  createVoiceDuplexController,
1588
1870
  createVoiceController,
1589
1871
  createVoiceConnection,
1590
1872
  createVoiceAudioPlayer,
1873
+ createVoiceAppKitStatusStore,
1591
1874
  createMicrophoneCapture,
1592
1875
  bindVoiceHTMX,
1593
1876
  bindVoiceBargeIn
@@ -0,0 +1,19 @@
1
+ import type { VoiceProviderHealthSummary } from '../providerHealth';
2
+ export type VoiceProviderStatusClientOptions = {
3
+ fetch?: typeof fetch;
4
+ intervalMs?: number;
5
+ };
6
+ export type VoiceProviderStatusSnapshot<TProvider extends string = string> = {
7
+ error: string | null;
8
+ isLoading: boolean;
9
+ providers: VoiceProviderHealthSummary<TProvider>[];
10
+ updatedAt?: number;
11
+ };
12
+ export declare const fetchVoiceProviderStatus: <TProvider extends string = string>(path?: string, options?: Pick<VoiceProviderStatusClientOptions, "fetch">) => Promise<VoiceProviderHealthSummary<TProvider>[]>;
13
+ export declare const createVoiceProviderStatusStore: <TProvider extends string = string>(path?: string, options?: VoiceProviderStatusClientOptions) => {
14
+ close: () => void;
15
+ getServerSnapshot: () => VoiceProviderStatusSnapshot<TProvider>;
16
+ getSnapshot: () => VoiceProviderStatusSnapshot<TProvider>;
17
+ refresh: () => Promise<VoiceProviderHealthSummary<TProvider>[]>;
18
+ subscribe: (listener: () => void) => () => void;
19
+ };
@@ -0,0 +1,19 @@
1
+ import type { VoiceScenarioEvalReport } from '../evalRoutes';
2
+ export type VoiceWorkflowStatusClientOptions = {
3
+ fetch?: typeof fetch;
4
+ intervalMs?: number;
5
+ };
6
+ export type VoiceWorkflowStatusSnapshot = {
7
+ error: string | null;
8
+ isLoading: boolean;
9
+ report?: VoiceScenarioEvalReport;
10
+ updatedAt?: number;
11
+ };
12
+ export declare const fetchVoiceWorkflowStatus: (path?: string, options?: Pick<VoiceWorkflowStatusClientOptions, "fetch">) => Promise<VoiceScenarioEvalReport>;
13
+ export declare const createVoiceWorkflowStatusStore: (path?: string, options?: VoiceWorkflowStatusClientOptions) => {
14
+ close: () => void;
15
+ getServerSnapshot: () => VoiceWorkflowStatusSnapshot;
16
+ getSnapshot: () => VoiceWorkflowStatusSnapshot;
17
+ refresh: () => Promise<VoiceScenarioEvalReport | undefined>;
18
+ subscribe: (listener: () => void) => () => void;
19
+ };
@@ -0,0 +1,44 @@
1
+ import { Elysia } from 'elysia';
2
+ import { evaluateVoiceTrace, type StoredVoiceTraceEvent, type VoiceTraceEventFilter, type VoiceTraceEventStore, type VoiceTraceRedactionConfig } from './trace';
3
+ export type VoiceDiagnosticsRoutesOptions = {
4
+ evaluation?: Parameters<typeof evaluateVoiceTrace>[1];
5
+ headers?: HeadersInit;
6
+ name?: string;
7
+ path?: string;
8
+ redact?: VoiceTraceRedactionConfig;
9
+ store: VoiceTraceEventStore;
10
+ title?: string;
11
+ };
12
+ export declare const resolveVoiceDiagnosticsTraceFilter: (query: Record<string, unknown>) => VoiceTraceEventFilter;
13
+ export declare const buildVoiceDiagnosticsMarkdown: (events: StoredVoiceTraceEvent[], options?: {
14
+ evaluation?: Parameters<typeof evaluateVoiceTrace>[1];
15
+ title?: string;
16
+ }) => string;
17
+ export declare const createVoiceDiagnosticsRoutes: (options: VoiceDiagnosticsRoutesOptions) => Elysia<"", {
18
+ decorator: {};
19
+ store: {};
20
+ derive: {};
21
+ resolve: {};
22
+ }, {
23
+ typebox: {};
24
+ error: {};
25
+ }, {
26
+ schema: {};
27
+ standaloneSchema: {};
28
+ macro: {};
29
+ macroFn: {};
30
+ parser: {};
31
+ response: {};
32
+ }, {}, {
33
+ derive: {};
34
+ resolve: {};
35
+ schema: {};
36
+ standaloneSchema: {};
37
+ response: {};
38
+ }, {
39
+ derive: {};
40
+ resolve: {};
41
+ schema: {};
42
+ standaloneSchema: {};
43
+ response: {};
44
+ }>;
@@ -0,0 +1,213 @@
1
+ import { Elysia } from 'elysia';
2
+ import { type VoiceQualityReport, type VoiceQualityThresholds } from './qualityRoutes';
3
+ import { summarizeVoiceTrace, type StoredVoiceTraceEvent, type VoiceTraceEventStore } from './trace';
4
+ export type VoiceEvalStatus = 'pass' | 'fail';
5
+ export type VoiceEvalSessionReport = {
6
+ endedAt?: number;
7
+ eventCount: number;
8
+ quality: VoiceQualityReport;
9
+ scenarioId?: string;
10
+ sessionId: string;
11
+ startedAt?: number;
12
+ status: VoiceEvalStatus;
13
+ summary: ReturnType<typeof summarizeVoiceTrace>;
14
+ };
15
+ export type VoiceEvalTrendBucket = {
16
+ endedAt: number;
17
+ failed: number;
18
+ key: string;
19
+ passed: number;
20
+ total: number;
21
+ };
22
+ export type VoiceEvalReport = {
23
+ checkedAt: number;
24
+ failed: number;
25
+ passed: number;
26
+ sessions: VoiceEvalSessionReport[];
27
+ status: VoiceEvalStatus;
28
+ total: number;
29
+ trend: VoiceEvalTrendBucket[];
30
+ };
31
+ export type VoiceEvalBaselineSummary = {
32
+ failed: number;
33
+ failedSessionIds: string[];
34
+ passRate: number;
35
+ passed: number;
36
+ total: number;
37
+ };
38
+ export type VoiceEvalBaselineComparison = {
39
+ baseline: VoiceEvalBaselineSummary;
40
+ checkedAt: number;
41
+ current: VoiceEvalBaselineSummary;
42
+ deltas: {
43
+ failed: number;
44
+ passRate: number;
45
+ passed: number;
46
+ total: number;
47
+ };
48
+ newFailedSessionIds: string[];
49
+ recoveredSessionIds: string[];
50
+ reasons: string[];
51
+ status: VoiceEvalStatus;
52
+ };
53
+ export type VoiceEvalBaselineComparisonOptions = {
54
+ failOnNewFailedSessions?: boolean;
55
+ maxFailedDelta?: number;
56
+ maxPassRateDrop?: number;
57
+ };
58
+ export type VoiceEvalBaselineStore = {
59
+ get: () => Promise<VoiceEvalReport | undefined>;
60
+ set: (report: VoiceEvalReport) => Promise<void>;
61
+ };
62
+ export type VoiceScenarioEvalDefinition = {
63
+ description?: string;
64
+ forbiddenHandoffActions?: string[];
65
+ forbiddenLifecycleTypes?: string[];
66
+ id: string;
67
+ label?: string;
68
+ maxProviderErrors?: number;
69
+ maxSessionErrors?: number;
70
+ minSessions?: number;
71
+ minTurns?: number;
72
+ requiredAssistantIncludes?: string[];
73
+ requiredDisposition?: string;
74
+ requiredHandoffActions?: string[];
75
+ requiredLifecycleTypes?: string[];
76
+ requiredPayloadPaths?: string[];
77
+ requiredTranscriptIncludes?: string[];
78
+ requiredWorkflowContracts?: string[];
79
+ scenarioId?: string;
80
+ };
81
+ export type VoiceScenarioEvalSessionResult = {
82
+ eventCount: number;
83
+ issues: string[];
84
+ sessionId: string;
85
+ status: VoiceEvalStatus;
86
+ };
87
+ export type VoiceScenarioEvalResult = {
88
+ description?: string;
89
+ failed: number;
90
+ id: string;
91
+ issues: string[];
92
+ label: string;
93
+ matchedSessions: number;
94
+ passed: number;
95
+ sessions: VoiceScenarioEvalSessionResult[];
96
+ status: VoiceEvalStatus;
97
+ };
98
+ export type VoiceScenarioEvalReport = {
99
+ checkedAt: number;
100
+ failed: number;
101
+ passed: number;
102
+ scenarios: VoiceScenarioEvalResult[];
103
+ status: VoiceEvalStatus;
104
+ total: number;
105
+ };
106
+ export type VoiceScenarioFixture = {
107
+ description?: string;
108
+ events: StoredVoiceTraceEvent[];
109
+ id: string;
110
+ label?: string;
111
+ };
112
+ export type VoiceScenarioFixtureStore = {
113
+ list: () => Promise<VoiceScenarioFixture[]>;
114
+ };
115
+ export type VoiceScenarioFixtureEvalResult = {
116
+ description?: string;
117
+ fixtureId: string;
118
+ label: string;
119
+ report: VoiceScenarioEvalReport;
120
+ status: VoiceEvalStatus;
121
+ };
122
+ export type VoiceScenarioFixtureEvalReport = {
123
+ checkedAt: number;
124
+ failed: number;
125
+ fixtures: VoiceScenarioFixtureEvalResult[];
126
+ passed: number;
127
+ status: VoiceEvalStatus;
128
+ total: number;
129
+ };
130
+ export type VoiceEvalLink = {
131
+ href: string;
132
+ label: string;
133
+ };
134
+ export type VoiceEvalRoutesOptions = {
135
+ baseline?: VoiceEvalReport | (() => Promise<VoiceEvalReport | undefined>);
136
+ baselineComparison?: VoiceEvalBaselineComparisonOptions;
137
+ baselineStore?: VoiceEvalBaselineStore;
138
+ events?: StoredVoiceTraceEvent[];
139
+ fixtures?: VoiceScenarioFixture[];
140
+ fixtureStore?: VoiceScenarioFixtureStore;
141
+ headers?: HeadersInit;
142
+ links?: VoiceEvalLink[];
143
+ limit?: number;
144
+ name?: string;
145
+ path?: string;
146
+ scenarios?: VoiceScenarioEvalDefinition[];
147
+ store?: VoiceTraceEventStore;
148
+ thresholds?: VoiceQualityThresholds;
149
+ title?: string;
150
+ };
151
+ export declare const runVoiceSessionEvals: (options?: {
152
+ events?: StoredVoiceTraceEvent[];
153
+ limit?: number;
154
+ store?: VoiceTraceEventStore;
155
+ thresholds?: VoiceQualityThresholds;
156
+ }) => Promise<VoiceEvalReport>;
157
+ export declare const runVoiceScenarioEvals: (options?: {
158
+ events?: StoredVoiceTraceEvent[];
159
+ scenarios?: VoiceScenarioEvalDefinition[];
160
+ store?: VoiceTraceEventStore;
161
+ }) => Promise<VoiceScenarioEvalReport>;
162
+ export declare const runVoiceScenarioFixtureEvals: (options?: {
163
+ fixtures?: VoiceScenarioFixture[];
164
+ fixtureStore?: VoiceScenarioFixtureStore;
165
+ scenarios?: VoiceScenarioEvalDefinition[];
166
+ }) => Promise<VoiceScenarioFixtureEvalReport>;
167
+ export declare const compareVoiceEvalBaseline: (currentReport: VoiceEvalReport, baselineReport: VoiceEvalReport, options?: VoiceEvalBaselineComparisonOptions) => VoiceEvalBaselineComparison;
168
+ export declare const createVoiceFileEvalBaselineStore: (filePath: string) => VoiceEvalBaselineStore;
169
+ export declare const createVoiceFileScenarioFixtureStore: (filePath: string) => VoiceScenarioFixtureStore;
170
+ export declare const renderVoiceEvalHTML: (report: VoiceEvalReport, options?: {
171
+ links?: VoiceEvalLink[];
172
+ title?: string;
173
+ }) => string;
174
+ export declare const renderVoiceEvalBaselineHTML: (comparison: VoiceEvalBaselineComparison, options?: {
175
+ links?: VoiceEvalLink[];
176
+ title?: string;
177
+ }) => string;
178
+ export declare const renderVoiceScenarioEvalHTML: (report: VoiceScenarioEvalReport, options?: {
179
+ links?: VoiceEvalLink[];
180
+ title?: string;
181
+ }) => string;
182
+ export declare const renderVoiceScenarioFixtureEvalHTML: (report: VoiceScenarioFixtureEvalReport, options?: {
183
+ links?: VoiceEvalLink[];
184
+ title?: string;
185
+ }) => string;
186
+ export declare const createVoiceEvalRoutes: (options: VoiceEvalRoutesOptions) => Elysia<"", {
187
+ decorator: {};
188
+ store: {};
189
+ derive: {};
190
+ resolve: {};
191
+ }, {
192
+ typebox: {};
193
+ error: {};
194
+ }, {
195
+ schema: {};
196
+ standaloneSchema: {};
197
+ macro: {};
198
+ macroFn: {};
199
+ parser: {};
200
+ response: {};
201
+ }, {}, {
202
+ derive: {};
203
+ resolve: {};
204
+ schema: {};
205
+ standaloneSchema: {};
206
+ response: {};
207
+ }, {
208
+ derive: {};
209
+ resolve: {};
210
+ schema: {};
211
+ standaloneSchema: {};
212
+ response: {};
213
+ }>;