@absolutejs/voice 0.0.22-beta.65 → 0.0.22-beta.67

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.
@@ -1,6 +1,8 @@
1
1
  export { VoiceAppKitStatusService } from './voice-app-kit-status.service';
2
2
  export { VoiceStreamService } from './voice-stream.service';
3
3
  export { VoiceControllerService } from './voice-controller.service';
4
+ export { VoiceProviderCapabilitiesService } from './voice-provider-capabilities.service';
4
5
  export { VoiceProviderStatusService } from './voice-provider-status.service';
5
6
  export { VoiceRoutingStatusService } from './voice-routing-status.service';
7
+ export { VoiceTurnQualityService } from './voice-turn-quality.service';
6
8
  export { VoiceWorkflowStatusService } from './voice-workflow-status.service';
@@ -1458,9 +1458,131 @@ VoiceControllerService = __decorateElement(_init, 0, "VoiceControllerService", _
1458
1458
  __runInitializers(_init, 1, VoiceControllerService);
1459
1459
  __decoratorMetadata(_init, VoiceControllerService);
1460
1460
  let _VoiceControllerService = VoiceControllerService;
1461
- // src/angular/voice-provider-status.service.ts
1461
+ // src/angular/voice-provider-capabilities.service.ts
1462
1462
  import { computed as computed4, Injectable as Injectable4, signal as signal4 } from "@angular/core";
1463
1463
 
1464
+ // src/client/providerCapabilities.ts
1465
+ var fetchVoiceProviderCapabilities = async (path = "/api/provider-capabilities", options = {}) => {
1466
+ const fetchImpl = options.fetch ?? globalThis.fetch;
1467
+ const response = await fetchImpl(path);
1468
+ if (!response.ok) {
1469
+ throw new Error(`Voice provider capabilities failed: HTTP ${response.status}`);
1470
+ }
1471
+ return await response.json();
1472
+ };
1473
+ var createVoiceProviderCapabilitiesStore = (path = "/api/provider-capabilities", options = {}) => {
1474
+ const listeners = new Set;
1475
+ let closed = false;
1476
+ let timer;
1477
+ let snapshot = {
1478
+ error: null,
1479
+ isLoading: false
1480
+ };
1481
+ const emit = () => {
1482
+ for (const listener of listeners) {
1483
+ listener();
1484
+ }
1485
+ };
1486
+ const refresh = async () => {
1487
+ if (closed) {
1488
+ return snapshot.report;
1489
+ }
1490
+ snapshot = {
1491
+ ...snapshot,
1492
+ error: null,
1493
+ isLoading: true
1494
+ };
1495
+ emit();
1496
+ try {
1497
+ const report = await fetchVoiceProviderCapabilities(path, options);
1498
+ snapshot = {
1499
+ error: null,
1500
+ isLoading: false,
1501
+ report,
1502
+ updatedAt: Date.now()
1503
+ };
1504
+ emit();
1505
+ return report;
1506
+ } catch (error) {
1507
+ snapshot = {
1508
+ ...snapshot,
1509
+ error: error instanceof Error ? error.message : String(error),
1510
+ isLoading: false
1511
+ };
1512
+ emit();
1513
+ throw error;
1514
+ }
1515
+ };
1516
+ const close = () => {
1517
+ closed = true;
1518
+ if (timer) {
1519
+ clearInterval(timer);
1520
+ timer = undefined;
1521
+ }
1522
+ listeners.clear();
1523
+ };
1524
+ if (options.intervalMs && options.intervalMs > 0) {
1525
+ timer = setInterval(() => {
1526
+ refresh().catch(() => {});
1527
+ }, options.intervalMs);
1528
+ }
1529
+ return {
1530
+ close,
1531
+ getServerSnapshot: () => snapshot,
1532
+ getSnapshot: () => snapshot,
1533
+ refresh,
1534
+ subscribe: (listener) => {
1535
+ listeners.add(listener);
1536
+ return () => {
1537
+ listeners.delete(listener);
1538
+ };
1539
+ }
1540
+ };
1541
+ };
1542
+
1543
+ // src/angular/voice-provider-capabilities.service.ts
1544
+ var _dec = [
1545
+ Injectable4({ providedIn: "root" })
1546
+ ];
1547
+ var _init = __decoratorStart(undefined);
1548
+
1549
+ class VoiceProviderCapabilitiesService {
1550
+ connect(path = "/api/provider-capabilities", options = {}) {
1551
+ const store = createVoiceProviderCapabilitiesStore(path, options);
1552
+ const errorSignal = signal4(null);
1553
+ const isLoadingSignal = signal4(false);
1554
+ const reportSignal = signal4(undefined);
1555
+ const updatedAtSignal = signal4(undefined);
1556
+ const sync = () => {
1557
+ const snapshot = store.getSnapshot();
1558
+ errorSignal.set(snapshot.error);
1559
+ isLoadingSignal.set(snapshot.isLoading);
1560
+ reportSignal.set(snapshot.report);
1561
+ updatedAtSignal.set(snapshot.updatedAt);
1562
+ };
1563
+ const unsubscribe = store.subscribe(sync);
1564
+ sync();
1565
+ store.refresh().catch(() => {});
1566
+ return {
1567
+ close: () => {
1568
+ unsubscribe();
1569
+ store.close();
1570
+ },
1571
+ error: computed4(() => errorSignal()),
1572
+ isLoading: computed4(() => isLoadingSignal()),
1573
+ refresh: store.refresh,
1574
+ report: computed4(() => reportSignal()),
1575
+ updatedAt: computed4(() => updatedAtSignal())
1576
+ };
1577
+ }
1578
+ }
1579
+ VoiceProviderCapabilitiesService = __decorateElement(_init, 0, "VoiceProviderCapabilitiesService", _dec, VoiceProviderCapabilitiesService);
1580
+ __runInitializers(_init, 1, VoiceProviderCapabilitiesService);
1581
+ __decoratorMetadata(_init, VoiceProviderCapabilitiesService);
1582
+ let _VoiceProviderCapabilitiesService = VoiceProviderCapabilitiesService;
1583
+ // src/angular/voice-provider-status.service.ts
1584
+ import { computed as computed5, Injectable as Injectable5, signal as signal5 } from "@angular/core";
1585
+
1464
1586
  // src/client/providerStatus.ts
1465
1587
  var fetchVoiceProviderStatus = async (path = "/api/provider-status", options = {}) => {
1466
1588
  const fetchImpl = options.fetch ?? globalThis.fetch;
@@ -1543,17 +1665,17 @@ var createVoiceProviderStatusStore = (path = "/api/provider-status", options = {
1543
1665
 
1544
1666
  // src/angular/voice-provider-status.service.ts
1545
1667
  var _dec = [
1546
- Injectable4({ providedIn: "root" })
1668
+ Injectable5({ providedIn: "root" })
1547
1669
  ];
1548
1670
  var _init = __decoratorStart(undefined);
1549
1671
 
1550
1672
  class VoiceProviderStatusService {
1551
1673
  connect(path = "/api/provider-status", options = {}) {
1552
1674
  const store = createVoiceProviderStatusStore(path, options);
1553
- const errorSignal = signal4(null);
1554
- const isLoadingSignal = signal4(false);
1555
- const providersSignal = signal4([]);
1556
- const updatedAtSignal = signal4(undefined);
1675
+ const errorSignal = signal5(null);
1676
+ const isLoadingSignal = signal5(false);
1677
+ const providersSignal = signal5([]);
1678
+ const updatedAtSignal = signal5(undefined);
1557
1679
  const sync = () => {
1558
1680
  const snapshot = store.getSnapshot();
1559
1681
  errorSignal.set(snapshot.error);
@@ -1569,11 +1691,11 @@ class VoiceProviderStatusService {
1569
1691
  unsubscribe();
1570
1692
  store.close();
1571
1693
  },
1572
- error: computed4(() => errorSignal()),
1573
- isLoading: computed4(() => isLoadingSignal()),
1574
- providers: computed4(() => providersSignal()),
1694
+ error: computed5(() => errorSignal()),
1695
+ isLoading: computed5(() => isLoadingSignal()),
1696
+ providers: computed5(() => providersSignal()),
1575
1697
  refresh: store.refresh,
1576
- updatedAt: computed4(() => updatedAtSignal())
1698
+ updatedAt: computed5(() => updatedAtSignal())
1577
1699
  };
1578
1700
  }
1579
1701
  }
@@ -1582,7 +1704,7 @@ __runInitializers(_init, 1, VoiceProviderStatusService);
1582
1704
  __decoratorMetadata(_init, VoiceProviderStatusService);
1583
1705
  let _VoiceProviderStatusService = VoiceProviderStatusService;
1584
1706
  // src/angular/voice-routing-status.service.ts
1585
- import { Injectable as Injectable5, signal as signal5 } from "@angular/core";
1707
+ import { Injectable as Injectable6, signal as signal6 } from "@angular/core";
1586
1708
 
1587
1709
  // src/client/routingStatus.ts
1588
1710
  var fetchVoiceRoutingStatus = async (path = "/api/routing/latest", options = {}) => {
@@ -1666,17 +1788,17 @@ var createVoiceRoutingStatusStore = (path = "/api/routing/latest", options = {})
1666
1788
 
1667
1789
  // src/angular/voice-routing-status.service.ts
1668
1790
  var _dec = [
1669
- Injectable5({ providedIn: "root" })
1791
+ Injectable6({ providedIn: "root" })
1670
1792
  ];
1671
1793
  var _init = __decoratorStart(undefined);
1672
1794
 
1673
1795
  class VoiceRoutingStatusService {
1674
1796
  connect(path = "/api/routing/latest", options = {}) {
1675
1797
  const store = createVoiceRoutingStatusStore(path, options);
1676
- const decisionSignal = signal5(null);
1677
- const errorSignal = signal5(null);
1678
- const isLoadingSignal = signal5(false);
1679
- const updatedAtSignal = signal5(undefined);
1798
+ const decisionSignal = signal6(null);
1799
+ const errorSignal = signal6(null);
1800
+ const isLoadingSignal = signal6(false);
1801
+ const updatedAtSignal = signal6(undefined);
1680
1802
  const sync = () => {
1681
1803
  const snapshot = store.getSnapshot();
1682
1804
  decisionSignal.set(snapshot.decision);
@@ -1704,8 +1826,130 @@ VoiceRoutingStatusService = __decorateElement(_init, 0, "VoiceRoutingStatusServi
1704
1826
  __runInitializers(_init, 1, VoiceRoutingStatusService);
1705
1827
  __decoratorMetadata(_init, VoiceRoutingStatusService);
1706
1828
  let _VoiceRoutingStatusService = VoiceRoutingStatusService;
1829
+ // src/angular/voice-turn-quality.service.ts
1830
+ import { computed as computed6, Injectable as Injectable7, signal as signal7 } from "@angular/core";
1831
+
1832
+ // src/client/turnQuality.ts
1833
+ var fetchVoiceTurnQuality = async (path = "/api/turn-quality", options = {}) => {
1834
+ const fetchImpl = options.fetch ?? globalThis.fetch;
1835
+ const response = await fetchImpl(path);
1836
+ if (!response.ok) {
1837
+ throw new Error(`Voice turn quality failed: HTTP ${response.status}`);
1838
+ }
1839
+ return await response.json();
1840
+ };
1841
+ var createVoiceTurnQualityStore = (path = "/api/turn-quality", options = {}) => {
1842
+ const listeners = new Set;
1843
+ let closed = false;
1844
+ let timer;
1845
+ let snapshot = {
1846
+ error: null,
1847
+ isLoading: false
1848
+ };
1849
+ const emit = () => {
1850
+ for (const listener of listeners) {
1851
+ listener();
1852
+ }
1853
+ };
1854
+ const refresh = async () => {
1855
+ if (closed) {
1856
+ return snapshot.report;
1857
+ }
1858
+ snapshot = {
1859
+ ...snapshot,
1860
+ error: null,
1861
+ isLoading: true
1862
+ };
1863
+ emit();
1864
+ try {
1865
+ const report = await fetchVoiceTurnQuality(path, options);
1866
+ snapshot = {
1867
+ error: null,
1868
+ isLoading: false,
1869
+ report,
1870
+ updatedAt: Date.now()
1871
+ };
1872
+ emit();
1873
+ return report;
1874
+ } catch (error) {
1875
+ snapshot = {
1876
+ ...snapshot,
1877
+ error: error instanceof Error ? error.message : String(error),
1878
+ isLoading: false
1879
+ };
1880
+ emit();
1881
+ throw error;
1882
+ }
1883
+ };
1884
+ const close = () => {
1885
+ closed = true;
1886
+ if (timer) {
1887
+ clearInterval(timer);
1888
+ timer = undefined;
1889
+ }
1890
+ listeners.clear();
1891
+ };
1892
+ if (options.intervalMs && options.intervalMs > 0) {
1893
+ timer = setInterval(() => {
1894
+ refresh().catch(() => {});
1895
+ }, options.intervalMs);
1896
+ }
1897
+ return {
1898
+ close,
1899
+ getServerSnapshot: () => snapshot,
1900
+ getSnapshot: () => snapshot,
1901
+ refresh,
1902
+ subscribe: (listener) => {
1903
+ listeners.add(listener);
1904
+ return () => {
1905
+ listeners.delete(listener);
1906
+ };
1907
+ }
1908
+ };
1909
+ };
1910
+
1911
+ // src/angular/voice-turn-quality.service.ts
1912
+ var _dec = [
1913
+ Injectable7({ providedIn: "root" })
1914
+ ];
1915
+ var _init = __decoratorStart(undefined);
1916
+
1917
+ class VoiceTurnQualityService {
1918
+ connect(path = "/api/turn-quality", options = {}) {
1919
+ const store = createVoiceTurnQualityStore(path, options);
1920
+ const errorSignal = signal7(null);
1921
+ const isLoadingSignal = signal7(false);
1922
+ const reportSignal = signal7(undefined);
1923
+ const updatedAtSignal = signal7(undefined);
1924
+ const sync = () => {
1925
+ const snapshot = store.getSnapshot();
1926
+ errorSignal.set(snapshot.error);
1927
+ isLoadingSignal.set(snapshot.isLoading);
1928
+ reportSignal.set(snapshot.report);
1929
+ updatedAtSignal.set(snapshot.updatedAt);
1930
+ };
1931
+ const unsubscribe = store.subscribe(sync);
1932
+ sync();
1933
+ store.refresh().catch(() => {});
1934
+ return {
1935
+ close: () => {
1936
+ unsubscribe();
1937
+ store.close();
1938
+ },
1939
+ error: computed6(() => errorSignal()),
1940
+ isLoading: computed6(() => isLoadingSignal()),
1941
+ refresh: store.refresh,
1942
+ report: computed6(() => reportSignal()),
1943
+ updatedAt: computed6(() => updatedAtSignal())
1944
+ };
1945
+ }
1946
+ }
1947
+ VoiceTurnQualityService = __decorateElement(_init, 0, "VoiceTurnQualityService", _dec, VoiceTurnQualityService);
1948
+ __runInitializers(_init, 1, VoiceTurnQualityService);
1949
+ __decoratorMetadata(_init, VoiceTurnQualityService);
1950
+ let _VoiceTurnQualityService = VoiceTurnQualityService;
1707
1951
  // src/angular/voice-workflow-status.service.ts
1708
- import { computed as computed5, Injectable as Injectable6, signal as signal6 } from "@angular/core";
1952
+ import { computed as computed7, Injectable as Injectable8, signal as signal8 } from "@angular/core";
1709
1953
 
1710
1954
  // src/client/workflowStatus.ts
1711
1955
  var fetchVoiceWorkflowStatus = async (path = "/evals/scenarios/json", options = {}) => {
@@ -1788,17 +2032,17 @@ var createVoiceWorkflowStatusStore = (path = "/evals/scenarios/json", options =
1788
2032
 
1789
2033
  // src/angular/voice-workflow-status.service.ts
1790
2034
  var _dec = [
1791
- Injectable6({ providedIn: "root" })
2035
+ Injectable8({ providedIn: "root" })
1792
2036
  ];
1793
2037
  var _init = __decoratorStart(undefined);
1794
2038
 
1795
2039
  class VoiceWorkflowStatusService {
1796
2040
  connect(path = "/evals/scenarios/json", options = {}) {
1797
2041
  const store = createVoiceWorkflowStatusStore(path, options);
1798
- const errorSignal = signal6(null);
1799
- const isLoadingSignal = signal6(false);
1800
- const reportSignal = signal6(undefined);
1801
- const updatedAtSignal = signal6(undefined);
2042
+ const errorSignal = signal8(null);
2043
+ const isLoadingSignal = signal8(false);
2044
+ const reportSignal = signal8(undefined);
2045
+ const updatedAtSignal = signal8(undefined);
1802
2046
  const sync = () => {
1803
2047
  const snapshot = store.getSnapshot();
1804
2048
  errorSignal.set(snapshot.error);
@@ -1816,11 +2060,11 @@ class VoiceWorkflowStatusService {
1816
2060
  unsubscribe();
1817
2061
  store.close();
1818
2062
  },
1819
- error: computed5(() => errorSignal()),
1820
- isLoading: computed5(() => isLoadingSignal()),
2063
+ error: computed7(() => errorSignal()),
2064
+ isLoading: computed7(() => isLoadingSignal()),
1821
2065
  refresh: store.refresh,
1822
- report: computed5(() => reportSignal()),
1823
- updatedAt: computed5(() => updatedAtSignal())
2066
+ report: computed7(() => reportSignal()),
2067
+ updatedAt: computed7(() => updatedAtSignal())
1824
2068
  };
1825
2069
  }
1826
2070
  }
@@ -1830,9 +2074,11 @@ __decoratorMetadata(_init, VoiceWorkflowStatusService);
1830
2074
  let _VoiceWorkflowStatusService = VoiceWorkflowStatusService;
1831
2075
  export {
1832
2076
  VoiceWorkflowStatusService,
2077
+ VoiceTurnQualityService,
1833
2078
  VoiceStreamService,
1834
2079
  VoiceRoutingStatusService,
1835
2080
  VoiceProviderStatusService,
2081
+ VoiceProviderCapabilitiesService,
1836
2082
  VoiceControllerService,
1837
2083
  VoiceAppKitStatusService
1838
2084
  };
@@ -0,0 +1,12 @@
1
+ import { type VoiceProviderCapabilitiesClientOptions } from '../client/providerCapabilities';
2
+ import type { VoiceProviderCapabilityReport } from '../providerCapabilities';
3
+ export declare class VoiceProviderCapabilitiesService {
4
+ connect<TProvider extends string = string>(path?: string, options?: VoiceProviderCapabilitiesClientOptions): {
5
+ close: () => void;
6
+ error: import("@angular/core").Signal<string | null>;
7
+ isLoading: import("@angular/core").Signal<boolean>;
8
+ refresh: () => Promise<VoiceProviderCapabilityReport<TProvider> | undefined>;
9
+ report: import("@angular/core").Signal<VoiceProviderCapabilityReport<TProvider> | undefined>;
10
+ updatedAt: import("@angular/core").Signal<number | undefined>;
11
+ };
12
+ }
@@ -0,0 +1,12 @@
1
+ import { type VoiceTurnQualityClientOptions } from '../client/turnQuality';
2
+ import type { VoiceTurnQualityReport } from '../turnQuality';
3
+ export declare class VoiceTurnQualityService {
4
+ connect(path?: string, options?: VoiceTurnQualityClientOptions): {
5
+ close: () => void;
6
+ error: import("@angular/core").Signal<string | null>;
7
+ isLoading: import("@angular/core").Signal<boolean>;
8
+ refresh: () => Promise<VoiceTurnQualityReport | undefined>;
9
+ report: import("@angular/core").Signal<VoiceTurnQualityReport | undefined>;
10
+ updatedAt: import("@angular/core").Signal<number | undefined>;
11
+ };
12
+ }
@@ -10,16 +10,24 @@ export { createVoiceOpsStatusViewModel, defineVoiceOpsStatusElement, getVoiceOps
10
10
  export { createVoiceRoutingStatusStore, fetchVoiceRoutingStatus } from './routingStatus';
11
11
  export { createVoiceRoutingStatusViewModel, defineVoiceRoutingStatusElement, getVoiceRoutingStatusCSS, mountVoiceRoutingStatus, renderVoiceRoutingStatusHTML } from './routingStatusWidget';
12
12
  export { createVoiceProviderStatusStore, fetchVoiceProviderStatus } from './providerStatus';
13
+ export { createVoiceProviderCapabilitiesStore, fetchVoiceProviderCapabilities } from './providerCapabilities';
14
+ export { createVoiceTurnQualityStore, fetchVoiceTurnQuality } from './turnQuality';
13
15
  export { createVoiceProviderSimulationControlsStore } from './providerSimulationControls';
14
16
  export { bindVoiceProviderSimulationControls, createVoiceProviderSimulationControlsViewModel, defineVoiceProviderSimulationControlsElement, mountVoiceProviderSimulationControls, renderVoiceProviderSimulationControlsHTML } from './providerSimulationControlsWidget';
15
17
  export { createVoiceProviderStatusViewModel, defineVoiceProviderStatusElement, getVoiceProviderStatusCSS, mountVoiceProviderStatus, renderVoiceProviderStatusHTML } from './providerStatusWidget';
18
+ export { createVoiceProviderCapabilitiesViewModel, defineVoiceProviderCapabilitiesElement, getVoiceProviderCapabilitiesCSS, mountVoiceProviderCapabilities, renderVoiceProviderCapabilitiesHTML } from './providerCapabilitiesWidget';
19
+ export { createVoiceTurnQualityViewModel, defineVoiceTurnQualityElement, getVoiceTurnQualityCSS, mountVoiceTurnQuality, renderVoiceTurnQualityHTML } from './turnQualityWidget';
16
20
  export { createVoiceWorkflowStatusStore, fetchVoiceWorkflowStatus } from './workflowStatus';
17
21
  export type { VoiceAppKitStatusClientOptions, VoiceAppKitStatusSnapshot } from './appKitStatus';
18
22
  export type { VoiceOpsStatusSurfaceView, VoiceOpsStatusViewModel, VoiceOpsStatusWidgetOptions } from './opsStatusWidget';
19
23
  export type { VoiceRoutingStatusClientOptions, VoiceRoutingStatusSnapshot } from './routingStatus';
20
24
  export type { VoiceRoutingStatusViewModel, VoiceRoutingStatusWidgetOptions } from './routingStatusWidget';
21
25
  export type { VoiceProviderStatusClientOptions, VoiceProviderStatusSnapshot } from './providerStatus';
26
+ export type { VoiceProviderCapabilitiesClientOptions, VoiceProviderCapabilitiesSnapshot } from './providerCapabilities';
27
+ export type { VoiceTurnQualityClientOptions, VoiceTurnQualitySnapshot } from './turnQuality';
22
28
  export type { VoiceProviderSimulationControlsOptions, VoiceProviderSimulationControlsSnapshot, VoiceProviderSimulationProvider } from './providerSimulationControls';
23
29
  export type { VoiceProviderSimulationControlsViewModel } from './providerSimulationControlsWidget';
24
30
  export type { VoiceProviderStatusCardView, VoiceProviderStatusViewModel, VoiceProviderStatusWidgetOptions } from './providerStatusWidget';
31
+ export type { VoiceProviderCapabilitiesViewModel, VoiceProviderCapabilitiesWidgetOptions, VoiceProviderCapabilityCardView } from './providerCapabilitiesWidget';
32
+ export type { VoiceTurnQualityCardView, VoiceTurnQualityViewModel, VoiceTurnQualityWidgetOptions } from './turnQualityWidget';
25
33
  export type { VoiceWorkflowStatusClientOptions, VoiceWorkflowStatusSnapshot } from './workflowStatus';