@absolutejs/voice 0.0.22-beta.90 → 0.0.22-beta.92

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.
@@ -4,5 +4,6 @@ export { VoiceControllerService } from './voice-controller.service';
4
4
  export { VoiceProviderCapabilitiesService } from './voice-provider-capabilities.service';
5
5
  export { VoiceProviderStatusService } from './voice-provider-status.service';
6
6
  export { VoiceRoutingStatusService } from './voice-routing-status.service';
7
+ export { VoiceTraceTimelineService } from './voice-trace-timeline.service';
7
8
  export { VoiceTurnQualityService } from './voice-turn-quality.service';
8
9
  export { VoiceWorkflowStatusService } from './voice-workflow-status.service';
@@ -1826,9 +1826,132 @@ VoiceRoutingStatusService = __decorateElement(_init, 0, "VoiceRoutingStatusServi
1826
1826
  __runInitializers(_init, 1, VoiceRoutingStatusService);
1827
1827
  __decoratorMetadata(_init, VoiceRoutingStatusService);
1828
1828
  let _VoiceRoutingStatusService = VoiceRoutingStatusService;
1829
- // src/angular/voice-turn-quality.service.ts
1829
+ // src/angular/voice-trace-timeline.service.ts
1830
1830
  import { computed as computed6, Injectable as Injectable7, signal as signal7 } from "@angular/core";
1831
1831
 
1832
+ // src/client/traceTimeline.ts
1833
+ var fetchVoiceTraceTimeline = async (path = "/api/voice-traces", options = {}) => {
1834
+ const fetchImpl = options.fetch ?? globalThis.fetch;
1835
+ const response = await fetchImpl(path);
1836
+ if (!response.ok) {
1837
+ throw new Error(`Voice trace timeline failed: HTTP ${response.status}`);
1838
+ }
1839
+ return await response.json();
1840
+ };
1841
+ var createVoiceTraceTimelineStore = (path = "/api/voice-traces", options = {}) => {
1842
+ const listeners = new Set;
1843
+ let closed = false;
1844
+ let timer;
1845
+ let snapshot = {
1846
+ error: null,
1847
+ isLoading: false,
1848
+ report: null
1849
+ };
1850
+ const emit = () => {
1851
+ for (const listener of listeners) {
1852
+ listener();
1853
+ }
1854
+ };
1855
+ const refresh = async () => {
1856
+ if (closed) {
1857
+ return snapshot.report;
1858
+ }
1859
+ snapshot = {
1860
+ ...snapshot,
1861
+ error: null,
1862
+ isLoading: true
1863
+ };
1864
+ emit();
1865
+ try {
1866
+ const report = await fetchVoiceTraceTimeline(path, options);
1867
+ snapshot = {
1868
+ error: null,
1869
+ isLoading: false,
1870
+ report,
1871
+ updatedAt: Date.now()
1872
+ };
1873
+ emit();
1874
+ return report;
1875
+ } catch (error) {
1876
+ snapshot = {
1877
+ ...snapshot,
1878
+ error: error instanceof Error ? error.message : String(error),
1879
+ isLoading: false
1880
+ };
1881
+ emit();
1882
+ throw error;
1883
+ }
1884
+ };
1885
+ const close = () => {
1886
+ closed = true;
1887
+ if (timer) {
1888
+ clearInterval(timer);
1889
+ timer = undefined;
1890
+ }
1891
+ listeners.clear();
1892
+ };
1893
+ if (options.intervalMs && options.intervalMs > 0) {
1894
+ timer = setInterval(() => {
1895
+ refresh().catch(() => {});
1896
+ }, options.intervalMs);
1897
+ }
1898
+ return {
1899
+ close,
1900
+ getServerSnapshot: () => snapshot,
1901
+ getSnapshot: () => snapshot,
1902
+ refresh,
1903
+ subscribe: (listener) => {
1904
+ listeners.add(listener);
1905
+ return () => {
1906
+ listeners.delete(listener);
1907
+ };
1908
+ }
1909
+ };
1910
+ };
1911
+
1912
+ // src/angular/voice-trace-timeline.service.ts
1913
+ var _dec = [
1914
+ Injectable7({ providedIn: "root" })
1915
+ ];
1916
+ var _init = __decoratorStart(undefined);
1917
+
1918
+ class VoiceTraceTimelineService {
1919
+ connect(path = "/api/voice-traces", options = {}) {
1920
+ const store = createVoiceTraceTimelineStore(path, options);
1921
+ const errorSignal = signal7(null);
1922
+ const isLoadingSignal = signal7(false);
1923
+ const reportSignal = signal7(null);
1924
+ const updatedAtSignal = signal7(undefined);
1925
+ const sync = () => {
1926
+ const snapshot = store.getSnapshot();
1927
+ errorSignal.set(snapshot.error);
1928
+ isLoadingSignal.set(snapshot.isLoading);
1929
+ reportSignal.set(snapshot.report);
1930
+ updatedAtSignal.set(snapshot.updatedAt);
1931
+ };
1932
+ const unsubscribe = store.subscribe(sync);
1933
+ sync();
1934
+ store.refresh().catch(() => {});
1935
+ return {
1936
+ close: () => {
1937
+ unsubscribe();
1938
+ store.close();
1939
+ },
1940
+ error: computed6(() => errorSignal()),
1941
+ isLoading: computed6(() => isLoadingSignal()),
1942
+ refresh: store.refresh,
1943
+ report: computed6(() => reportSignal()),
1944
+ updatedAt: computed6(() => updatedAtSignal())
1945
+ };
1946
+ }
1947
+ }
1948
+ VoiceTraceTimelineService = __decorateElement(_init, 0, "VoiceTraceTimelineService", _dec, VoiceTraceTimelineService);
1949
+ __runInitializers(_init, 1, VoiceTraceTimelineService);
1950
+ __decoratorMetadata(_init, VoiceTraceTimelineService);
1951
+ let _VoiceTraceTimelineService = VoiceTraceTimelineService;
1952
+ // src/angular/voice-turn-quality.service.ts
1953
+ import { computed as computed7, Injectable as Injectable8, signal as signal8 } from "@angular/core";
1954
+
1832
1955
  // src/client/turnQuality.ts
1833
1956
  var fetchVoiceTurnQuality = async (path = "/api/turn-quality", options = {}) => {
1834
1957
  const fetchImpl = options.fetch ?? globalThis.fetch;
@@ -1910,17 +2033,17 @@ var createVoiceTurnQualityStore = (path = "/api/turn-quality", options = {}) =>
1910
2033
 
1911
2034
  // src/angular/voice-turn-quality.service.ts
1912
2035
  var _dec = [
1913
- Injectable7({ providedIn: "root" })
2036
+ Injectable8({ providedIn: "root" })
1914
2037
  ];
1915
2038
  var _init = __decoratorStart(undefined);
1916
2039
 
1917
2040
  class VoiceTurnQualityService {
1918
2041
  connect(path = "/api/turn-quality", options = {}) {
1919
2042
  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);
2043
+ const errorSignal = signal8(null);
2044
+ const isLoadingSignal = signal8(false);
2045
+ const reportSignal = signal8(undefined);
2046
+ const updatedAtSignal = signal8(undefined);
1924
2047
  const sync = () => {
1925
2048
  const snapshot = store.getSnapshot();
1926
2049
  errorSignal.set(snapshot.error);
@@ -1936,11 +2059,11 @@ class VoiceTurnQualityService {
1936
2059
  unsubscribe();
1937
2060
  store.close();
1938
2061
  },
1939
- error: computed6(() => errorSignal()),
1940
- isLoading: computed6(() => isLoadingSignal()),
2062
+ error: computed7(() => errorSignal()),
2063
+ isLoading: computed7(() => isLoadingSignal()),
1941
2064
  refresh: store.refresh,
1942
- report: computed6(() => reportSignal()),
1943
- updatedAt: computed6(() => updatedAtSignal())
2065
+ report: computed7(() => reportSignal()),
2066
+ updatedAt: computed7(() => updatedAtSignal())
1944
2067
  };
1945
2068
  }
1946
2069
  }
@@ -1949,7 +2072,7 @@ __runInitializers(_init, 1, VoiceTurnQualityService);
1949
2072
  __decoratorMetadata(_init, VoiceTurnQualityService);
1950
2073
  let _VoiceTurnQualityService = VoiceTurnQualityService;
1951
2074
  // src/angular/voice-workflow-status.service.ts
1952
- import { computed as computed7, Injectable as Injectable8, signal as signal8 } from "@angular/core";
2075
+ import { computed as computed8, Injectable as Injectable9, signal as signal9 } from "@angular/core";
1953
2076
 
1954
2077
  // src/client/workflowStatus.ts
1955
2078
  var fetchVoiceWorkflowStatus = async (path = "/evals/scenarios/json", options = {}) => {
@@ -2032,17 +2155,17 @@ var createVoiceWorkflowStatusStore = (path = "/evals/scenarios/json", options =
2032
2155
 
2033
2156
  // src/angular/voice-workflow-status.service.ts
2034
2157
  var _dec = [
2035
- Injectable8({ providedIn: "root" })
2158
+ Injectable9({ providedIn: "root" })
2036
2159
  ];
2037
2160
  var _init = __decoratorStart(undefined);
2038
2161
 
2039
2162
  class VoiceWorkflowStatusService {
2040
2163
  connect(path = "/evals/scenarios/json", options = {}) {
2041
2164
  const store = createVoiceWorkflowStatusStore(path, options);
2042
- const errorSignal = signal8(null);
2043
- const isLoadingSignal = signal8(false);
2044
- const reportSignal = signal8(undefined);
2045
- const updatedAtSignal = signal8(undefined);
2165
+ const errorSignal = signal9(null);
2166
+ const isLoadingSignal = signal9(false);
2167
+ const reportSignal = signal9(undefined);
2168
+ const updatedAtSignal = signal9(undefined);
2046
2169
  const sync = () => {
2047
2170
  const snapshot = store.getSnapshot();
2048
2171
  errorSignal.set(snapshot.error);
@@ -2060,11 +2183,11 @@ class VoiceWorkflowStatusService {
2060
2183
  unsubscribe();
2061
2184
  store.close();
2062
2185
  },
2063
- error: computed7(() => errorSignal()),
2064
- isLoading: computed7(() => isLoadingSignal()),
2186
+ error: computed8(() => errorSignal()),
2187
+ isLoading: computed8(() => isLoadingSignal()),
2065
2188
  refresh: store.refresh,
2066
- report: computed7(() => reportSignal()),
2067
- updatedAt: computed7(() => updatedAtSignal())
2189
+ report: computed8(() => reportSignal()),
2190
+ updatedAt: computed8(() => updatedAtSignal())
2068
2191
  };
2069
2192
  }
2070
2193
  }
@@ -2075,6 +2198,7 @@ let _VoiceWorkflowStatusService = VoiceWorkflowStatusService;
2075
2198
  export {
2076
2199
  VoiceWorkflowStatusService,
2077
2200
  VoiceTurnQualityService,
2201
+ VoiceTraceTimelineService,
2078
2202
  VoiceStreamService,
2079
2203
  VoiceRoutingStatusService,
2080
2204
  VoiceProviderStatusService,
@@ -0,0 +1,12 @@
1
+ import { type VoiceTraceTimelineClientOptions } from '../client/traceTimeline';
2
+ import type { VoiceTraceTimelineReport } from '../traceTimeline';
3
+ export declare class VoiceTraceTimelineService {
4
+ connect(path?: string, options?: VoiceTraceTimelineClientOptions): {
5
+ close: () => void;
6
+ error: import("@angular/core").Signal<string | null>;
7
+ isLoading: import("@angular/core").Signal<boolean>;
8
+ refresh: () => Promise<VoiceTraceTimelineReport | null>;
9
+ report: import("@angular/core").Signal<VoiceTraceTimelineReport | null>;
10
+ updatedAt: import("@angular/core").Signal<number | undefined>;
11
+ };
12
+ }
package/dist/appKit.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { Elysia } from 'elysia';
2
2
  import { type VoiceAssistantHealthRoutesOptions } from './assistantHealth';
3
+ import { type VoiceBargeInRoutesOptions } from './bargeInRoutes';
3
4
  import { type VoiceDiagnosticsRoutesOptions } from './diagnosticsRoutes';
4
5
  import { type VoiceEvalRoutesOptions, type VoiceEvalLink } from './evalRoutes';
5
6
  import { type VoiceHandoffHealthRoutesOptions } from './handoffHealth';
@@ -12,7 +13,7 @@ import { type VoiceResilienceRoutesOptions } from './resilienceRoutes';
12
13
  import { type VoiceSessionListRoutesOptions, type VoiceSessionReplayRoutesOptions } from './sessionReplay';
13
14
  import { type VoiceTraceEventStore } from './trace';
14
15
  import { type VoiceTraceTimelineRoutesOptions } from './traceTimeline';
15
- export type VoiceAppKitSurface = 'assistantHealth' | 'diagnostics' | 'evals' | 'handoffs' | 'opsConsole' | 'providerCapabilities' | 'providerHealth' | 'productionReadiness' | 'quality' | 'resilience' | 'sessionReplay' | 'sessions' | 'traceTimeline';
16
+ export type VoiceAppKitSurface = 'assistantHealth' | 'bargeIn' | 'diagnostics' | 'evals' | 'handoffs' | 'opsConsole' | 'providerCapabilities' | 'providerHealth' | 'productionReadiness' | 'quality' | 'resilience' | 'sessionReplay' | 'sessions' | 'traceTimeline';
16
17
  export type VoiceAppKitLink = VoiceEvalLink & {
17
18
  description?: string;
18
19
  statusHref?: string;
@@ -20,6 +21,7 @@ export type VoiceAppKitLink = VoiceEvalLink & {
20
21
  export type VoiceAppKitRoutesOptions<TProvider extends string = string> = {
21
22
  appStatus?: false | VoiceAppKitStatusOptions;
22
23
  assistantHealth?: false | Partial<VoiceAssistantHealthRoutesOptions<TProvider>>;
24
+ bargeIn?: false | Partial<VoiceBargeInRoutesOptions>;
23
25
  diagnostics?: false | Partial<Omit<VoiceDiagnosticsRoutesOptions, 'store'>>;
24
26
  evals?: false | Partial<VoiceEvalRoutesOptions>;
25
27
  handoffs?: false | Partial<VoiceHandoffHealthRoutesOptions>;
@@ -0,0 +1,56 @@
1
+ import { Elysia } from 'elysia';
2
+ import type { StoredVoiceTraceEvent, VoiceTraceEventStore } from './trace';
3
+ import type { VoiceBargeInMonitorSnapshot } from './types';
4
+ export type VoiceBargeInRoutesOptions = {
5
+ headers?: HeadersInit;
6
+ htmlPath?: string;
7
+ name?: string;
8
+ path?: string;
9
+ store: VoiceTraceEventStore;
10
+ thresholdMs?: number;
11
+ title?: string;
12
+ };
13
+ export type VoiceBargeInReport = VoiceBargeInMonitorSnapshot & {
14
+ checkedAt: number;
15
+ sessions: Array<{
16
+ averageLatencyMs?: number;
17
+ failed: number;
18
+ passed: number;
19
+ sessionId: string;
20
+ total: number;
21
+ }>;
22
+ };
23
+ export declare const summarizeVoiceBargeIn: (events: StoredVoiceTraceEvent[], options?: {
24
+ thresholdMs?: number;
25
+ }) => VoiceBargeInReport;
26
+ export declare const renderVoiceBargeInHTML: (report: VoiceBargeInReport, options?: {
27
+ title?: string;
28
+ }) => string;
29
+ export declare const createVoiceBargeInRoutes: (options: VoiceBargeInRoutesOptions) => Elysia<"", {
30
+ decorator: {};
31
+ store: {};
32
+ derive: {};
33
+ resolve: {};
34
+ }, {
35
+ typebox: {};
36
+ error: {};
37
+ }, {
38
+ schema: {};
39
+ standaloneSchema: {};
40
+ macro: {};
41
+ macroFn: {};
42
+ parser: {};
43
+ response: {};
44
+ }, {}, {
45
+ derive: {};
46
+ resolve: {};
47
+ schema: {};
48
+ standaloneSchema: {};
49
+ response: {};
50
+ }, {
51
+ derive: {};
52
+ resolve: {};
53
+ schema: {};
54
+ standaloneSchema: {};
55
+ response: {};
56
+ }>;
@@ -0,0 +1,7 @@
1
+ import type { VoiceBargeInMonitor } from '../types';
2
+ export type VoiceBargeInMonitorOptions = {
3
+ fetch?: typeof fetch;
4
+ path?: string;
5
+ thresholdMs?: number;
6
+ };
7
+ export declare const createVoiceBargeInMonitor: (options?: VoiceBargeInMonitorOptions) => VoiceBargeInMonitor;
@@ -1,3 +1,3 @@
1
1
  import type { VoiceAudioPlayer, VoiceBargeInBinding, VoiceBargeInOptions, VoiceController, VoiceDuplexController, VoiceDuplexControllerOptions } from '../types';
2
- export declare const bindVoiceBargeIn: <TResult = unknown>(controller: Pick<VoiceController<TResult>, "partial" | "sendAudio" | "subscribe">, player: Pick<VoiceAudioPlayer, "interrupt" | "isPlaying">, options?: VoiceBargeInOptions) => VoiceBargeInBinding;
2
+ export declare const bindVoiceBargeIn: <TResult = unknown>(controller: Pick<VoiceController<TResult>, "partial" | "sendAudio" | "sessionId" | "subscribe">, player: Pick<VoiceAudioPlayer, "interrupt" | "isPlaying" | "lastInterruptLatencyMs" | "lastPlaybackStopLatencyMs">, options?: VoiceBargeInOptions) => VoiceBargeInBinding;
3
3
  export declare const createVoiceDuplexController: <TResult = unknown>(path: string, options?: VoiceDuplexControllerOptions) => VoiceDuplexController<TResult>;
@@ -5,6 +5,7 @@ export { createVoiceController } from './controller';
5
5
  export { bindVoiceBargeIn, createVoiceDuplexController } from './duplex';
6
6
  export { bindVoiceHTMX } from './htmx';
7
7
  export { createMicrophoneCapture } from './microphone';
8
+ export { createVoiceBargeInMonitor } from './bargeInMonitor';
8
9
  export { createVoiceAppKitStatusStore, fetchVoiceAppKitStatus } from './appKitStatus';
9
10
  export { createVoiceOpsStatusViewModel, defineVoiceOpsStatusElement, getVoiceOpsStatusCSS, getVoiceOpsStatusLabel, mountVoiceOpsStatus, renderVoiceOpsStatusHTML } from './opsStatusWidget';
10
11
  export { createVoiceRoutingStatusStore, fetchVoiceRoutingStatus } from './routingStatus';
@@ -12,22 +13,27 @@ export { createVoiceRoutingStatusViewModel, defineVoiceRoutingStatusElement, get
12
13
  export { createVoiceProviderStatusStore, fetchVoiceProviderStatus } from './providerStatus';
13
14
  export { createVoiceProviderCapabilitiesStore, fetchVoiceProviderCapabilities } from './providerCapabilities';
14
15
  export { createVoiceTurnQualityStore, fetchVoiceTurnQuality } from './turnQuality';
16
+ export { createVoiceTraceTimelineStore, fetchVoiceTraceTimeline } from './traceTimeline';
15
17
  export { createVoiceProviderSimulationControlsStore } from './providerSimulationControls';
16
18
  export { bindVoiceProviderSimulationControls, createVoiceProviderSimulationControlsViewModel, defineVoiceProviderSimulationControlsElement, mountVoiceProviderSimulationControls, renderVoiceProviderSimulationControlsHTML } from './providerSimulationControlsWidget';
17
19
  export { createVoiceProviderStatusViewModel, defineVoiceProviderStatusElement, getVoiceProviderStatusCSS, mountVoiceProviderStatus, renderVoiceProviderStatusHTML } from './providerStatusWidget';
18
20
  export { createVoiceProviderCapabilitiesViewModel, defineVoiceProviderCapabilitiesElement, getVoiceProviderCapabilitiesCSS, mountVoiceProviderCapabilities, renderVoiceProviderCapabilitiesHTML } from './providerCapabilitiesWidget';
19
21
  export { createVoiceTurnQualityViewModel, defineVoiceTurnQualityElement, getVoiceTurnQualityCSS, mountVoiceTurnQuality, renderVoiceTurnQualityHTML } from './turnQualityWidget';
22
+ export { createVoiceTraceTimelineViewModel, defineVoiceTraceTimelineElement, getVoiceTraceTimelineCSS, mountVoiceTraceTimeline, renderVoiceTraceTimelineWidgetHTML } from './traceTimelineWidget';
20
23
  export { createVoiceWorkflowStatusStore, fetchVoiceWorkflowStatus } from './workflowStatus';
21
24
  export type { VoiceAppKitStatusClientOptions, VoiceAppKitStatusSnapshot } from './appKitStatus';
25
+ export type { VoiceBargeInMonitorOptions } from './bargeInMonitor';
22
26
  export type { VoiceOpsStatusSurfaceView, VoiceOpsStatusViewModel, VoiceOpsStatusWidgetOptions } from './opsStatusWidget';
23
27
  export type { VoiceRoutingStatusClientOptions, VoiceRoutingStatusSnapshot } from './routingStatus';
24
28
  export type { VoiceRoutingStatusViewModel, VoiceRoutingStatusWidgetOptions } from './routingStatusWidget';
25
29
  export type { VoiceProviderStatusClientOptions, VoiceProviderStatusSnapshot } from './providerStatus';
26
30
  export type { VoiceProviderCapabilitiesClientOptions, VoiceProviderCapabilitiesSnapshot } from './providerCapabilities';
27
31
  export type { VoiceTurnQualityClientOptions, VoiceTurnQualitySnapshot } from './turnQuality';
32
+ export type { VoiceTraceTimelineClientOptions, VoiceTraceTimelineSnapshot } from './traceTimeline';
28
33
  export type { VoiceProviderSimulationControlsOptions, VoiceProviderSimulationControlsSnapshot, VoiceProviderSimulationProvider } from './providerSimulationControls';
29
34
  export type { VoiceProviderSimulationControlsViewModel } from './providerSimulationControlsWidget';
30
35
  export type { VoiceProviderStatusCardView, VoiceProviderStatusViewModel, VoiceProviderStatusWidgetOptions } from './providerStatusWidget';
31
36
  export type { VoiceProviderCapabilitiesViewModel, VoiceProviderCapabilitiesWidgetOptions, VoiceProviderCapabilityCardView } from './providerCapabilitiesWidget';
32
37
  export type { VoiceTurnQualityCardView, VoiceTurnQualityViewModel, VoiceTurnQualityWidgetOptions } from './turnQualityWidget';
38
+ export type { VoiceTraceTimelineSessionView, VoiceTraceTimelineViewModel, VoiceTraceTimelineWidgetOptions } from './traceTimelineWidget';
33
39
  export type { VoiceWorkflowStatusClientOptions, VoiceWorkflowStatusSnapshot } from './workflowStatus';