@absolutejs/voice 0.0.22-beta.12 → 0.0.22-beta.121
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/README.md +411 -3
- package/dist/agent.d.ts +2 -0
- package/dist/angular/index.d.ts +9 -0
- package/dist/angular/index.js +1278 -44
- package/dist/angular/voice-app-kit-status.service.d.ts +12 -0
- package/dist/angular/voice-campaign-dialer-proof.service.d.ts +14 -0
- package/dist/angular/voice-ops-status.component.d.ts +15 -0
- package/dist/angular/voice-provider-capabilities.service.d.ts +12 -0
- package/dist/angular/voice-provider-status.service.d.ts +12 -0
- package/dist/angular/voice-routing-status.service.d.ts +11 -0
- package/dist/angular/voice-stream.service.d.ts +2 -0
- package/dist/angular/voice-trace-timeline.service.d.ts +12 -0
- package/dist/angular/voice-turn-latency.service.d.ts +13 -0
- package/dist/angular/voice-turn-quality.service.d.ts +12 -0
- package/dist/angular/voice-workflow-status.service.d.ts +12 -0
- package/dist/appKit.d.ts +100 -0
- package/dist/assistantHealth.d.ts +81 -0
- package/dist/bargeInRoutes.d.ts +56 -0
- package/dist/campaign.d.ts +610 -0
- package/dist/campaignDialers.d.ts +90 -0
- package/dist/client/actions.d.ts +22 -0
- package/dist/client/appKitStatus.d.ts +19 -0
- package/dist/client/bargeInMonitor.d.ts +7 -0
- package/dist/client/campaignDialerProof.d.ts +23 -0
- package/dist/client/connection.d.ts +3 -0
- package/dist/client/duplex.d.ts +1 -1
- package/dist/client/htmxBootstrap.js +587 -13
- package/dist/client/index.d.ts +40 -0
- package/dist/client/index.js +2028 -8
- package/dist/client/liveTurnLatency.d.ts +41 -0
- package/dist/client/opsStatusWidget.d.ts +40 -0
- package/dist/client/providerCapabilities.d.ts +19 -0
- package/dist/client/providerCapabilitiesWidget.d.ts +32 -0
- package/dist/client/providerSimulationControls.d.ts +33 -0
- package/dist/client/providerSimulationControlsWidget.d.ts +20 -0
- package/dist/client/providerStatus.d.ts +19 -0
- package/dist/client/providerStatusWidget.d.ts +32 -0
- package/dist/client/routingStatus.d.ts +19 -0
- package/dist/client/routingStatusWidget.d.ts +28 -0
- package/dist/client/traceTimeline.d.ts +19 -0
- package/dist/client/traceTimelineWidget.d.ts +32 -0
- package/dist/client/turnLatency.d.ts +22 -0
- package/dist/client/turnLatencyWidget.d.ts +33 -0
- package/dist/client/turnQuality.d.ts +19 -0
- package/dist/client/turnQualityWidget.d.ts +32 -0
- package/dist/client/workflowStatus.d.ts +19 -0
- package/dist/diagnosticsRoutes.d.ts +44 -0
- package/dist/evalRoutes.d.ts +213 -0
- package/dist/fileStore.d.ts +3 -0
- package/dist/handoff.d.ts +54 -0
- package/dist/handoffHealth.d.ts +94 -0
- package/dist/index.d.ts +77 -8
- package/dist/index.js +12658 -3061
- package/dist/liveLatency.d.ts +78 -0
- package/dist/modelAdapters.d.ts +41 -2
- package/dist/openaiTTS.d.ts +18 -0
- package/dist/opsConsoleRoutes.d.ts +77 -0
- package/dist/opsWebhook.d.ts +126 -0
- package/dist/outcomeContract.d.ts +112 -0
- package/dist/phoneAgent.d.ts +58 -0
- package/dist/postgresStore.d.ts +5 -0
- package/dist/productionReadiness.d.ts +121 -0
- package/dist/providerAdapters.d.ts +48 -0
- package/dist/providerCapabilities.d.ts +92 -0
- package/dist/providerHealth.d.ts +79 -0
- package/dist/qualityRoutes.d.ts +76 -0
- package/dist/queue.d.ts +61 -0
- package/dist/react/VoiceOpsStatus.d.ts +6 -0
- package/dist/react/VoiceProviderCapabilities.d.ts +6 -0
- package/dist/react/VoiceProviderSimulationControls.d.ts +5 -0
- package/dist/react/VoiceProviderStatus.d.ts +6 -0
- package/dist/react/VoiceRoutingStatus.d.ts +6 -0
- package/dist/react/VoiceTraceTimeline.d.ts +6 -0
- package/dist/react/VoiceTurnLatency.d.ts +6 -0
- package/dist/react/VoiceTurnQuality.d.ts +6 -0
- package/dist/react/index.d.ts +18 -0
- package/dist/react/index.js +2606 -12
- package/dist/react/useVoiceAppKitStatus.d.ts +8 -0
- package/dist/react/useVoiceCampaignDialerProof.d.ts +10 -0
- package/dist/react/useVoiceController.d.ts +2 -0
- package/dist/react/useVoiceProviderCapabilities.d.ts +8 -0
- package/dist/react/useVoiceProviderSimulationControls.d.ts +10 -0
- package/dist/react/useVoiceProviderStatus.d.ts +8 -0
- package/dist/react/useVoiceRoutingStatus.d.ts +8 -0
- package/dist/react/useVoiceStream.d.ts +2 -0
- package/dist/react/useVoiceTraceTimeline.d.ts +8 -0
- package/dist/react/useVoiceTurnLatency.d.ts +9 -0
- package/dist/react/useVoiceTurnQuality.d.ts +8 -0
- package/dist/react/useVoiceWorkflowStatus.d.ts +8 -0
- package/dist/resilienceRoutes.d.ts +142 -0
- package/dist/sessionReplay.d.ts +175 -0
- package/dist/simulationSuite.d.ts +120 -0
- package/dist/sqliteStore.d.ts +5 -0
- package/dist/svelte/createVoiceAppKitStatus.d.ts +8 -0
- package/dist/svelte/createVoiceCampaignDialerProof.d.ts +9 -0
- package/dist/svelte/createVoiceOpsStatus.d.ts +9 -0
- package/dist/svelte/createVoiceProviderCapabilities.d.ts +10 -0
- package/dist/svelte/createVoiceProviderSimulationControls.d.ts +11 -0
- package/dist/svelte/createVoiceProviderStatus.d.ts +10 -0
- package/dist/svelte/createVoiceRoutingStatus.d.ts +10 -0
- package/dist/svelte/createVoiceTraceTimeline.d.ts +10 -0
- package/dist/svelte/createVoiceTurnLatency.d.ts +11 -0
- package/dist/svelte/createVoiceTurnQuality.d.ts +10 -0
- package/dist/svelte/createVoiceWorkflowStatus.d.ts +8 -0
- package/dist/svelte/index.d.ts +11 -0
- package/dist/svelte/index.js +1849 -4
- package/dist/telephony/contract.d.ts +61 -0
- package/dist/telephony/matrix.d.ts +97 -0
- package/dist/telephony/plivo.d.ts +254 -0
- package/dist/telephony/telnyx.d.ts +247 -0
- package/dist/telephony/twilio.d.ts +132 -0
- package/dist/telephonyOutcome.d.ts +201 -0
- package/dist/testing/index.d.ts +2 -0
- package/dist/testing/index.js +2640 -21
- package/dist/testing/ioProviderSimulator.d.ts +41 -0
- package/dist/testing/providerSimulator.d.ts +44 -0
- package/dist/toolContract.d.ts +130 -0
- package/dist/toolRuntime.d.ts +50 -0
- package/dist/trace.d.ts +1 -1
- package/dist/traceTimeline.d.ts +93 -0
- package/dist/turnLatency.d.ts +95 -0
- package/dist/turnQuality.d.ts +94 -0
- package/dist/types.d.ts +125 -2
- package/dist/vue/VoiceOpsStatus.d.ts +30 -0
- package/dist/vue/VoiceProviderCapabilities.d.ts +51 -0
- package/dist/vue/VoiceProviderSimulationControls.d.ts +88 -0
- package/dist/vue/VoiceProviderStatus.d.ts +51 -0
- package/dist/vue/VoiceRoutingStatus.d.ts +51 -0
- package/dist/vue/VoiceTurnLatency.d.ts +69 -0
- package/dist/vue/VoiceTurnQuality.d.ts +51 -0
- package/dist/vue/index.d.ts +17 -0
- package/dist/vue/index.js +2520 -29
- package/dist/vue/useVoiceAppKitStatus.d.ts +9 -0
- package/dist/vue/useVoiceCampaignDialerProof.d.ts +11 -0
- package/dist/vue/useVoiceController.d.ts +1 -1
- package/dist/vue/useVoiceProviderCapabilities.d.ts +9 -0
- package/dist/vue/useVoiceProviderSimulationControls.d.ts +24 -0
- package/dist/vue/useVoiceProviderStatus.d.ts +9 -0
- package/dist/vue/useVoiceRoutingStatus.d.ts +8 -0
- package/dist/vue/useVoiceStream.d.ts +3 -1
- package/dist/vue/useVoiceTraceTimeline.d.ts +9 -0
- package/dist/vue/useVoiceTurnLatency.d.ts +10 -0
- package/dist/vue/useVoiceTurnQuality.d.ts +9 -0
- package/dist/vue/useVoiceWorkflowStatus.d.ts +9 -0
- package/dist/workflowContract.d.ts +91 -0
- package/package.json +1 -1
package/dist/angular/index.js
CHANGED
|
@@ -69,9 +69,298 @@ var __decorateElement = (array, flags, name, decorators, target, extra) => {
|
|
|
69
69
|
return k || __decoratorMetadata(array, target), desc && __defProp(target, name, desc), p ? k ^ 4 ? extra : desc : target;
|
|
70
70
|
};
|
|
71
71
|
|
|
72
|
-
// src/angular/voice-
|
|
72
|
+
// src/angular/voice-app-kit-status.service.ts
|
|
73
73
|
import { computed, Injectable, signal } from "@angular/core";
|
|
74
74
|
|
|
75
|
+
// src/client/appKitStatus.ts
|
|
76
|
+
var fetchVoiceAppKitStatus = async (path = "/app-kit/status", options = {}) => {
|
|
77
|
+
const fetchImpl = options.fetch ?? globalThis.fetch;
|
|
78
|
+
const response = await fetchImpl(path);
|
|
79
|
+
if (!response.ok) {
|
|
80
|
+
throw new Error(`Voice app kit status failed: HTTP ${response.status}`);
|
|
81
|
+
}
|
|
82
|
+
return await response.json();
|
|
83
|
+
};
|
|
84
|
+
var createVoiceAppKitStatusStore = (path = "/app-kit/status", options = {}) => {
|
|
85
|
+
const listeners = new Set;
|
|
86
|
+
let closed = false;
|
|
87
|
+
let timer;
|
|
88
|
+
let snapshot = {
|
|
89
|
+
error: null,
|
|
90
|
+
isLoading: false
|
|
91
|
+
};
|
|
92
|
+
const emit = () => {
|
|
93
|
+
for (const listener of listeners) {
|
|
94
|
+
listener();
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
const refresh = async () => {
|
|
98
|
+
if (closed) {
|
|
99
|
+
return snapshot.report;
|
|
100
|
+
}
|
|
101
|
+
snapshot = {
|
|
102
|
+
...snapshot,
|
|
103
|
+
error: null,
|
|
104
|
+
isLoading: true
|
|
105
|
+
};
|
|
106
|
+
emit();
|
|
107
|
+
try {
|
|
108
|
+
const report = await fetchVoiceAppKitStatus(path, options);
|
|
109
|
+
snapshot = {
|
|
110
|
+
error: null,
|
|
111
|
+
isLoading: false,
|
|
112
|
+
report,
|
|
113
|
+
updatedAt: Date.now()
|
|
114
|
+
};
|
|
115
|
+
emit();
|
|
116
|
+
return report;
|
|
117
|
+
} catch (error) {
|
|
118
|
+
snapshot = {
|
|
119
|
+
...snapshot,
|
|
120
|
+
error: error instanceof Error ? error.message : String(error),
|
|
121
|
+
isLoading: false
|
|
122
|
+
};
|
|
123
|
+
emit();
|
|
124
|
+
throw error;
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
const close = () => {
|
|
128
|
+
closed = true;
|
|
129
|
+
if (timer) {
|
|
130
|
+
clearInterval(timer);
|
|
131
|
+
timer = undefined;
|
|
132
|
+
}
|
|
133
|
+
listeners.clear();
|
|
134
|
+
};
|
|
135
|
+
if (typeof window !== "undefined" && options.intervalMs && options.intervalMs > 0) {
|
|
136
|
+
timer = setInterval(() => {
|
|
137
|
+
refresh().catch(() => {});
|
|
138
|
+
}, options.intervalMs);
|
|
139
|
+
}
|
|
140
|
+
return {
|
|
141
|
+
close,
|
|
142
|
+
getServerSnapshot: () => snapshot,
|
|
143
|
+
getSnapshot: () => snapshot,
|
|
144
|
+
refresh,
|
|
145
|
+
subscribe: (listener) => {
|
|
146
|
+
listeners.add(listener);
|
|
147
|
+
return () => {
|
|
148
|
+
listeners.delete(listener);
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
};
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
// src/angular/voice-app-kit-status.service.ts
|
|
155
|
+
var _dec = [
|
|
156
|
+
Injectable({ providedIn: "root" })
|
|
157
|
+
];
|
|
158
|
+
var _init = __decoratorStart(undefined);
|
|
159
|
+
|
|
160
|
+
class VoiceAppKitStatusService {
|
|
161
|
+
connect(path = "/app-kit/status", options = {}) {
|
|
162
|
+
const store = createVoiceAppKitStatusStore(path, options);
|
|
163
|
+
const errorSignal = signal(null);
|
|
164
|
+
const isLoadingSignal = signal(false);
|
|
165
|
+
const reportSignal = signal(undefined);
|
|
166
|
+
const updatedAtSignal = signal(undefined);
|
|
167
|
+
const sync = () => {
|
|
168
|
+
const snapshot = store.getSnapshot();
|
|
169
|
+
errorSignal.set(snapshot.error);
|
|
170
|
+
isLoadingSignal.set(snapshot.isLoading);
|
|
171
|
+
reportSignal.set(snapshot.report);
|
|
172
|
+
updatedAtSignal.set(snapshot.updatedAt);
|
|
173
|
+
};
|
|
174
|
+
const unsubscribe = store.subscribe(sync);
|
|
175
|
+
sync();
|
|
176
|
+
if (typeof window !== "undefined") {
|
|
177
|
+
store.refresh().catch(() => {});
|
|
178
|
+
}
|
|
179
|
+
return {
|
|
180
|
+
close: () => {
|
|
181
|
+
unsubscribe();
|
|
182
|
+
store.close();
|
|
183
|
+
},
|
|
184
|
+
error: computed(() => errorSignal()),
|
|
185
|
+
isLoading: computed(() => isLoadingSignal()),
|
|
186
|
+
refresh: store.refresh,
|
|
187
|
+
report: computed(() => reportSignal()),
|
|
188
|
+
updatedAt: computed(() => updatedAtSignal())
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
VoiceAppKitStatusService = __decorateElement(_init, 0, "VoiceAppKitStatusService", _dec, VoiceAppKitStatusService);
|
|
193
|
+
__runInitializers(_init, 1, VoiceAppKitStatusService);
|
|
194
|
+
__decoratorMetadata(_init, VoiceAppKitStatusService);
|
|
195
|
+
let _VoiceAppKitStatusService = VoiceAppKitStatusService;
|
|
196
|
+
// src/angular/voice-campaign-dialer-proof.service.ts
|
|
197
|
+
import { computed as computed2, Injectable as Injectable2, signal as signal2 } from "@angular/core";
|
|
198
|
+
|
|
199
|
+
// src/client/campaignDialerProof.ts
|
|
200
|
+
var fetchVoiceCampaignDialerProofStatus = async (path = "/api/voice/campaigns/dialer-proof", options = {}) => {
|
|
201
|
+
const fetchImpl = options.fetch ?? globalThis.fetch;
|
|
202
|
+
const response = await fetchImpl(path);
|
|
203
|
+
if (!response.ok) {
|
|
204
|
+
throw new Error(`Voice campaign dialer proof status failed: HTTP ${response.status}`);
|
|
205
|
+
}
|
|
206
|
+
return await response.json();
|
|
207
|
+
};
|
|
208
|
+
var runVoiceCampaignDialerProofAction = async (path = "/api/voice/campaigns/dialer-proof", options = {}) => {
|
|
209
|
+
const fetchImpl = options.fetch ?? globalThis.fetch;
|
|
210
|
+
const response = await fetchImpl(path, { method: "POST" });
|
|
211
|
+
if (!response.ok) {
|
|
212
|
+
throw new Error(`Voice campaign dialer proof failed: HTTP ${response.status}`);
|
|
213
|
+
}
|
|
214
|
+
return await response.json();
|
|
215
|
+
};
|
|
216
|
+
var createVoiceCampaignDialerProofStore = (path = "/api/voice/campaigns/dialer-proof", options = {}) => {
|
|
217
|
+
const listeners = new Set;
|
|
218
|
+
let closed = false;
|
|
219
|
+
let timer;
|
|
220
|
+
let snapshot = {
|
|
221
|
+
error: null,
|
|
222
|
+
isLoading: false
|
|
223
|
+
};
|
|
224
|
+
const emit = () => {
|
|
225
|
+
for (const listener of listeners) {
|
|
226
|
+
listener();
|
|
227
|
+
}
|
|
228
|
+
};
|
|
229
|
+
const refresh = async () => {
|
|
230
|
+
if (closed) {
|
|
231
|
+
return snapshot.status;
|
|
232
|
+
}
|
|
233
|
+
snapshot = { ...snapshot, error: null, isLoading: true };
|
|
234
|
+
emit();
|
|
235
|
+
try {
|
|
236
|
+
const status = await fetchVoiceCampaignDialerProofStatus(path, options);
|
|
237
|
+
snapshot = {
|
|
238
|
+
...snapshot,
|
|
239
|
+
error: null,
|
|
240
|
+
isLoading: false,
|
|
241
|
+
status,
|
|
242
|
+
updatedAt: Date.now()
|
|
243
|
+
};
|
|
244
|
+
emit();
|
|
245
|
+
return status;
|
|
246
|
+
} catch (error) {
|
|
247
|
+
snapshot = {
|
|
248
|
+
...snapshot,
|
|
249
|
+
error: error instanceof Error ? error.message : String(error),
|
|
250
|
+
isLoading: false
|
|
251
|
+
};
|
|
252
|
+
emit();
|
|
253
|
+
throw error;
|
|
254
|
+
}
|
|
255
|
+
};
|
|
256
|
+
const runProof = async () => {
|
|
257
|
+
const runPath = options.runPath ?? snapshot.status?.runPath ?? path;
|
|
258
|
+
snapshot = { ...snapshot, error: null, isLoading: true };
|
|
259
|
+
emit();
|
|
260
|
+
try {
|
|
261
|
+
const report = await runVoiceCampaignDialerProofAction(runPath, options);
|
|
262
|
+
snapshot = {
|
|
263
|
+
...snapshot,
|
|
264
|
+
error: null,
|
|
265
|
+
isLoading: false,
|
|
266
|
+
report,
|
|
267
|
+
status: {
|
|
268
|
+
generatedAt: Date.now(),
|
|
269
|
+
mode: report.mode,
|
|
270
|
+
ok: report.ok,
|
|
271
|
+
providers: report.providers.map((provider) => provider.provider),
|
|
272
|
+
runPath,
|
|
273
|
+
safe: true
|
|
274
|
+
},
|
|
275
|
+
updatedAt: Date.now()
|
|
276
|
+
};
|
|
277
|
+
emit();
|
|
278
|
+
return report;
|
|
279
|
+
} catch (error) {
|
|
280
|
+
snapshot = {
|
|
281
|
+
...snapshot,
|
|
282
|
+
error: error instanceof Error ? error.message : String(error),
|
|
283
|
+
isLoading: false
|
|
284
|
+
};
|
|
285
|
+
emit();
|
|
286
|
+
throw error;
|
|
287
|
+
}
|
|
288
|
+
};
|
|
289
|
+
const close = () => {
|
|
290
|
+
closed = true;
|
|
291
|
+
if (timer) {
|
|
292
|
+
clearInterval(timer);
|
|
293
|
+
timer = undefined;
|
|
294
|
+
}
|
|
295
|
+
listeners.clear();
|
|
296
|
+
};
|
|
297
|
+
if (options.intervalMs && options.intervalMs > 0) {
|
|
298
|
+
timer = setInterval(() => {
|
|
299
|
+
refresh().catch(() => {});
|
|
300
|
+
}, options.intervalMs);
|
|
301
|
+
}
|
|
302
|
+
return {
|
|
303
|
+
close,
|
|
304
|
+
getServerSnapshot: () => snapshot,
|
|
305
|
+
getSnapshot: () => snapshot,
|
|
306
|
+
refresh,
|
|
307
|
+
runProof,
|
|
308
|
+
subscribe: (listener) => {
|
|
309
|
+
listeners.add(listener);
|
|
310
|
+
return () => {
|
|
311
|
+
listeners.delete(listener);
|
|
312
|
+
};
|
|
313
|
+
}
|
|
314
|
+
};
|
|
315
|
+
};
|
|
316
|
+
|
|
317
|
+
// src/angular/voice-campaign-dialer-proof.service.ts
|
|
318
|
+
var _dec = [
|
|
319
|
+
Injectable2({ providedIn: "root" })
|
|
320
|
+
];
|
|
321
|
+
var _init = __decoratorStart(undefined);
|
|
322
|
+
|
|
323
|
+
class VoiceCampaignDialerProofService {
|
|
324
|
+
connect(path = "/api/voice/campaigns/dialer-proof", options = {}) {
|
|
325
|
+
const store = createVoiceCampaignDialerProofStore(path, options);
|
|
326
|
+
const errorSignal = signal2(null);
|
|
327
|
+
const isLoadingSignal = signal2(false);
|
|
328
|
+
const reportSignal = signal2(undefined);
|
|
329
|
+
const statusSignal = signal2(undefined);
|
|
330
|
+
const updatedAtSignal = signal2(undefined);
|
|
331
|
+
const sync = () => {
|
|
332
|
+
const snapshot = store.getSnapshot();
|
|
333
|
+
errorSignal.set(snapshot.error);
|
|
334
|
+
isLoadingSignal.set(snapshot.isLoading);
|
|
335
|
+
reportSignal.set(snapshot.report);
|
|
336
|
+
statusSignal.set(snapshot.status);
|
|
337
|
+
updatedAtSignal.set(snapshot.updatedAt);
|
|
338
|
+
};
|
|
339
|
+
const unsubscribe = store.subscribe(sync);
|
|
340
|
+
sync();
|
|
341
|
+
store.refresh().catch(() => {});
|
|
342
|
+
return {
|
|
343
|
+
close: () => {
|
|
344
|
+
unsubscribe();
|
|
345
|
+
store.close();
|
|
346
|
+
},
|
|
347
|
+
error: computed2(() => errorSignal()),
|
|
348
|
+
isLoading: computed2(() => isLoadingSignal()),
|
|
349
|
+
refresh: store.refresh,
|
|
350
|
+
report: computed2(() => reportSignal()),
|
|
351
|
+
runProof: store.runProof,
|
|
352
|
+
status: computed2(() => statusSignal()),
|
|
353
|
+
updatedAt: computed2(() => updatedAtSignal())
|
|
354
|
+
};
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
VoiceCampaignDialerProofService = __decorateElement(_init, 0, "VoiceCampaignDialerProofService", _dec, VoiceCampaignDialerProofService);
|
|
358
|
+
__runInitializers(_init, 1, VoiceCampaignDialerProofService);
|
|
359
|
+
__decoratorMetadata(_init, VoiceCampaignDialerProofService);
|
|
360
|
+
let _VoiceCampaignDialerProofService = VoiceCampaignDialerProofService;
|
|
361
|
+
// src/angular/voice-stream.service.ts
|
|
362
|
+
import { computed as computed3, Injectable as Injectable3, signal as signal3 } from "@angular/core";
|
|
363
|
+
|
|
75
364
|
// src/client/actions.ts
|
|
76
365
|
var normalizeErrorMessage = (value) => {
|
|
77
366
|
if (typeof value === "string" && value.trim()) {
|
|
@@ -120,6 +409,12 @@ var serverMessageToAction = (message) => {
|
|
|
120
409
|
sessionId: message.sessionId,
|
|
121
410
|
type: "complete"
|
|
122
411
|
};
|
|
412
|
+
case "call_lifecycle":
|
|
413
|
+
return {
|
|
414
|
+
event: message.event,
|
|
415
|
+
sessionId: message.sessionId,
|
|
416
|
+
type: "call_lifecycle"
|
|
417
|
+
};
|
|
123
418
|
case "error":
|
|
124
419
|
return {
|
|
125
420
|
message: normalizeErrorMessage(message.message),
|
|
@@ -163,7 +458,7 @@ var DEFAULT_SCENARIO_QUERY_PARAM = "scenarioId";
|
|
|
163
458
|
var noop = () => {};
|
|
164
459
|
var noopUnsubscribe = () => noop;
|
|
165
460
|
var NOOP_CONNECTION = {
|
|
166
|
-
|
|
461
|
+
callControl: noop,
|
|
167
462
|
close: noop,
|
|
168
463
|
endTurn: noop,
|
|
169
464
|
getReadyState: () => WS_CLOSED,
|
|
@@ -171,6 +466,7 @@ var NOOP_CONNECTION = {
|
|
|
171
466
|
getSessionId: () => "",
|
|
172
467
|
send: noop,
|
|
173
468
|
sendAudio: noop,
|
|
469
|
+
start: () => {},
|
|
174
470
|
subscribe: noopUnsubscribe
|
|
175
471
|
};
|
|
176
472
|
var createSessionId = () => crypto.randomUUID();
|
|
@@ -192,6 +488,7 @@ var isVoiceServerMessage = (value) => {
|
|
|
192
488
|
switch (value.type) {
|
|
193
489
|
case "audio":
|
|
194
490
|
case "assistant":
|
|
491
|
+
case "call_lifecycle":
|
|
195
492
|
case "complete":
|
|
196
493
|
case "error":
|
|
197
494
|
case "final":
|
|
@@ -332,6 +629,12 @@ var createVoiceConnection = (path, options = {}) => {
|
|
|
332
629
|
const endTurn = () => {
|
|
333
630
|
send({ type: "end_turn" });
|
|
334
631
|
};
|
|
632
|
+
const callControl = (message) => {
|
|
633
|
+
send({
|
|
634
|
+
...message,
|
|
635
|
+
type: "call_control"
|
|
636
|
+
});
|
|
637
|
+
};
|
|
335
638
|
const close = () => {
|
|
336
639
|
clearTimers();
|
|
337
640
|
if (state.ws) {
|
|
@@ -349,7 +652,7 @@ var createVoiceConnection = (path, options = {}) => {
|
|
|
349
652
|
};
|
|
350
653
|
connect();
|
|
351
654
|
return {
|
|
352
|
-
|
|
655
|
+
callControl,
|
|
353
656
|
close,
|
|
354
657
|
endTurn,
|
|
355
658
|
getReadyState: () => state.ws?.readyState ?? WS_CLOSED,
|
|
@@ -357,6 +660,7 @@ var createVoiceConnection = (path, options = {}) => {
|
|
|
357
660
|
getSessionId: () => state.sessionId,
|
|
358
661
|
send,
|
|
359
662
|
sendAudio,
|
|
663
|
+
start,
|
|
360
664
|
subscribe
|
|
361
665
|
};
|
|
362
666
|
};
|
|
@@ -365,6 +669,7 @@ var createVoiceConnection = (path, options = {}) => {
|
|
|
365
669
|
var createInitialState = () => ({
|
|
366
670
|
assistantAudio: [],
|
|
367
671
|
assistantTexts: [],
|
|
672
|
+
call: null,
|
|
368
673
|
error: null,
|
|
369
674
|
isConnected: false,
|
|
370
675
|
scenarioId: null,
|
|
@@ -408,6 +713,20 @@ var createVoiceStreamStore = () => {
|
|
|
408
713
|
status: "completed"
|
|
409
714
|
};
|
|
410
715
|
break;
|
|
716
|
+
case "call_lifecycle":
|
|
717
|
+
state = {
|
|
718
|
+
...state,
|
|
719
|
+
call: {
|
|
720
|
+
...state.call,
|
|
721
|
+
disposition: action.event.type === "end" ? action.event.disposition : state.call?.disposition,
|
|
722
|
+
endedAt: action.event.type === "end" ? action.event.at : state.call?.endedAt,
|
|
723
|
+
events: [...state.call?.events ?? [], action.event],
|
|
724
|
+
lastEventAt: action.event.at,
|
|
725
|
+
startedAt: state.call?.startedAt ?? action.event.at
|
|
726
|
+
},
|
|
727
|
+
sessionId: action.sessionId
|
|
728
|
+
};
|
|
729
|
+
break;
|
|
411
730
|
case "connected":
|
|
412
731
|
state = {
|
|
413
732
|
...state,
|
|
@@ -494,6 +813,9 @@ var createVoiceStream = (path, options = {}) => {
|
|
|
494
813
|
}
|
|
495
814
|
});
|
|
496
815
|
return {
|
|
816
|
+
callControl(message) {
|
|
817
|
+
connection.callControl(message);
|
|
818
|
+
},
|
|
497
819
|
close() {
|
|
498
820
|
unsubscribeConnection();
|
|
499
821
|
connection.close();
|
|
@@ -537,6 +859,9 @@ var createVoiceStream = (path, options = {}) => {
|
|
|
537
859
|
get assistantAudio() {
|
|
538
860
|
return store.getSnapshot().assistantAudio;
|
|
539
861
|
},
|
|
862
|
+
get call() {
|
|
863
|
+
return store.getSnapshot().call;
|
|
864
|
+
},
|
|
540
865
|
sendAudio(audio) {
|
|
541
866
|
connection.sendAudio(audio);
|
|
542
867
|
},
|
|
@@ -551,24 +876,26 @@ var createVoiceStream = (path, options = {}) => {
|
|
|
551
876
|
|
|
552
877
|
// src/angular/voice-stream.service.ts
|
|
553
878
|
var _dec = [
|
|
554
|
-
|
|
879
|
+
Injectable3({ providedIn: "root" })
|
|
555
880
|
];
|
|
556
881
|
var _init = __decoratorStart(undefined);
|
|
557
882
|
|
|
558
883
|
class VoiceStreamService {
|
|
559
884
|
connect(path, options = {}) {
|
|
560
885
|
const stream = createVoiceStream(path, options);
|
|
561
|
-
const assistantAudioSignal =
|
|
562
|
-
const assistantTextsSignal =
|
|
563
|
-
const
|
|
564
|
-
const
|
|
565
|
-
const
|
|
566
|
-
const
|
|
567
|
-
const
|
|
568
|
-
const
|
|
886
|
+
const assistantAudioSignal = signal3([]);
|
|
887
|
+
const assistantTextsSignal = signal3([]);
|
|
888
|
+
const callSignal = signal3(null);
|
|
889
|
+
const errorSignal = signal3(null);
|
|
890
|
+
const isConnectedSignal = signal3(false);
|
|
891
|
+
const partialSignal = signal3("");
|
|
892
|
+
const sessionIdSignal = signal3(stream.sessionId);
|
|
893
|
+
const statusSignal = signal3(stream.status);
|
|
894
|
+
const turnsSignal = signal3([]);
|
|
569
895
|
const sync = () => {
|
|
570
896
|
assistantAudioSignal.set([...stream.assistantAudio]);
|
|
571
897
|
assistantTextsSignal.set([...stream.assistantTexts]);
|
|
898
|
+
callSignal.set(stream.call);
|
|
572
899
|
errorSignal.set(stream.error);
|
|
573
900
|
isConnectedSignal.set(stream.isConnected);
|
|
574
901
|
partialSignal.set(stream.partial);
|
|
@@ -579,20 +906,22 @@ class VoiceStreamService {
|
|
|
579
906
|
const unsubscribe = stream.subscribe(sync);
|
|
580
907
|
sync();
|
|
581
908
|
return {
|
|
582
|
-
assistantAudio:
|
|
583
|
-
assistantTexts:
|
|
909
|
+
assistantAudio: computed3(() => assistantAudioSignal()),
|
|
910
|
+
assistantTexts: computed3(() => assistantTextsSignal()),
|
|
911
|
+
call: computed3(() => callSignal()),
|
|
912
|
+
callControl: (message) => stream.callControl(message),
|
|
584
913
|
close: () => {
|
|
585
914
|
unsubscribe();
|
|
586
915
|
stream.close();
|
|
587
916
|
},
|
|
588
917
|
endTurn: () => stream.endTurn(),
|
|
589
|
-
error:
|
|
590
|
-
isConnected:
|
|
591
|
-
partial:
|
|
918
|
+
error: computed3(() => errorSignal()),
|
|
919
|
+
isConnected: computed3(() => isConnectedSignal()),
|
|
920
|
+
partial: computed3(() => partialSignal()),
|
|
592
921
|
sendAudio: (audio) => stream.sendAudio(audio),
|
|
593
|
-
sessionId:
|
|
594
|
-
status:
|
|
595
|
-
turns:
|
|
922
|
+
sessionId: computed3(() => sessionIdSignal()),
|
|
923
|
+
status: computed3(() => statusSignal()),
|
|
924
|
+
turns: computed3(() => turnsSignal())
|
|
596
925
|
};
|
|
597
926
|
}
|
|
598
927
|
}
|
|
@@ -601,7 +930,7 @@ __runInitializers(_init, 1, VoiceStreamService);
|
|
|
601
930
|
__decoratorMetadata(_init, VoiceStreamService);
|
|
602
931
|
let _VoiceStreamService = VoiceStreamService;
|
|
603
932
|
// src/angular/voice-controller.service.ts
|
|
604
|
-
import { computed as
|
|
933
|
+
import { computed as computed4, Injectable as Injectable4, signal as signal4 } from "@angular/core";
|
|
605
934
|
|
|
606
935
|
// src/client/htmx.ts
|
|
607
936
|
var DEFAULT_EVENT_NAME = "voice-refresh";
|
|
@@ -1065,6 +1394,7 @@ var resolveVoiceRuntimePreset = (name = "default") => {
|
|
|
1065
1394
|
var createInitialState2 = (stream) => ({
|
|
1066
1395
|
assistantAudio: [...stream.assistantAudio],
|
|
1067
1396
|
assistantTexts: [...stream.assistantTexts],
|
|
1397
|
+
call: stream.call,
|
|
1068
1398
|
error: stream.error,
|
|
1069
1399
|
isConnected: stream.isConnected,
|
|
1070
1400
|
isRecording: false,
|
|
@@ -1094,6 +1424,7 @@ var createVoiceController = (path, options = {}) => {
|
|
|
1094
1424
|
...state,
|
|
1095
1425
|
assistantAudio: [...stream.assistantAudio],
|
|
1096
1426
|
assistantTexts: [...stream.assistantTexts],
|
|
1427
|
+
call: stream.call,
|
|
1097
1428
|
error: stream.error,
|
|
1098
1429
|
isConnected: stream.isConnected,
|
|
1099
1430
|
partial: stream.partial,
|
|
@@ -1121,7 +1452,13 @@ var createVoiceController = (path, options = {}) => {
|
|
|
1121
1452
|
capture = createMicrophoneCapture({
|
|
1122
1453
|
channelCount: options.capture?.channelCount ?? preset.capture.channelCount,
|
|
1123
1454
|
onLevel: options.capture?.onLevel,
|
|
1124
|
-
onAudio: (audio) =>
|
|
1455
|
+
onAudio: (audio) => {
|
|
1456
|
+
if (options.capture?.onAudio) {
|
|
1457
|
+
options.capture.onAudio(audio, stream.sendAudio);
|
|
1458
|
+
return;
|
|
1459
|
+
}
|
|
1460
|
+
stream.sendAudio(audio);
|
|
1461
|
+
},
|
|
1125
1462
|
sampleRateHz: options.capture?.sampleRateHz ?? preset.capture.sampleRateHz
|
|
1126
1463
|
});
|
|
1127
1464
|
return capture;
|
|
@@ -1171,6 +1508,7 @@ var createVoiceController = (path, options = {}) => {
|
|
|
1171
1508
|
bindHTMX(bindingOptions) {
|
|
1172
1509
|
return bindVoiceHTMX(stream, bindingOptions);
|
|
1173
1510
|
},
|
|
1511
|
+
callControl: (message) => stream.callControl(message),
|
|
1174
1512
|
close,
|
|
1175
1513
|
endTurn: () => stream.endTurn(),
|
|
1176
1514
|
get error() {
|
|
@@ -1223,29 +1561,32 @@ var createVoiceController = (path, options = {}) => {
|
|
|
1223
1561
|
},
|
|
1224
1562
|
get assistantAudio() {
|
|
1225
1563
|
return state.assistantAudio;
|
|
1564
|
+
},
|
|
1565
|
+
get call() {
|
|
1566
|
+
return state.call;
|
|
1226
1567
|
}
|
|
1227
1568
|
};
|
|
1228
1569
|
};
|
|
1229
1570
|
|
|
1230
1571
|
// src/angular/voice-controller.service.ts
|
|
1231
1572
|
var _dec = [
|
|
1232
|
-
|
|
1573
|
+
Injectable4({ providedIn: "root" })
|
|
1233
1574
|
];
|
|
1234
1575
|
var _init = __decoratorStart(undefined);
|
|
1235
1576
|
|
|
1236
1577
|
class VoiceControllerService {
|
|
1237
1578
|
connect(path, options = {}) {
|
|
1238
1579
|
const controller = createVoiceController(path, options);
|
|
1239
|
-
const assistantAudioSignal =
|
|
1240
|
-
const assistantTextsSignal =
|
|
1241
|
-
const errorSignal =
|
|
1242
|
-
const isConnectedSignal =
|
|
1243
|
-
const isRecordingSignal =
|
|
1244
|
-
const partialSignal =
|
|
1245
|
-
const recordingErrorSignal =
|
|
1246
|
-
const sessionIdSignal =
|
|
1247
|
-
const statusSignal =
|
|
1248
|
-
const turnsSignal =
|
|
1580
|
+
const assistantAudioSignal = signal4([]);
|
|
1581
|
+
const assistantTextsSignal = signal4([]);
|
|
1582
|
+
const errorSignal = signal4(null);
|
|
1583
|
+
const isConnectedSignal = signal4(false);
|
|
1584
|
+
const isRecordingSignal = signal4(false);
|
|
1585
|
+
const partialSignal = signal4("");
|
|
1586
|
+
const recordingErrorSignal = signal4(null);
|
|
1587
|
+
const sessionIdSignal = signal4(controller.sessionId);
|
|
1588
|
+
const statusSignal = signal4(controller.status);
|
|
1589
|
+
const turnsSignal = signal4([]);
|
|
1249
1590
|
const sync = () => {
|
|
1250
1591
|
assistantAudioSignal.set([...controller.assistantAudio]);
|
|
1251
1592
|
assistantTextsSignal.set([...controller.assistantTexts]);
|
|
@@ -1261,26 +1602,26 @@ class VoiceControllerService {
|
|
|
1261
1602
|
const unsubscribe = controller.subscribe(sync);
|
|
1262
1603
|
sync();
|
|
1263
1604
|
return {
|
|
1264
|
-
assistantAudio:
|
|
1265
|
-
assistantTexts:
|
|
1605
|
+
assistantAudio: computed4(() => assistantAudioSignal()),
|
|
1606
|
+
assistantTexts: computed4(() => assistantTextsSignal()),
|
|
1266
1607
|
bindHTMX: controller.bindHTMX,
|
|
1267
1608
|
close: () => {
|
|
1268
1609
|
unsubscribe();
|
|
1269
1610
|
controller.close();
|
|
1270
1611
|
},
|
|
1271
1612
|
endTurn: () => controller.endTurn(),
|
|
1272
|
-
error:
|
|
1273
|
-
isConnected:
|
|
1274
|
-
isRecording:
|
|
1275
|
-
partial:
|
|
1276
|
-
recordingError:
|
|
1613
|
+
error: computed4(() => errorSignal()),
|
|
1614
|
+
isConnected: computed4(() => isConnectedSignal()),
|
|
1615
|
+
isRecording: computed4(() => isRecordingSignal()),
|
|
1616
|
+
partial: computed4(() => partialSignal()),
|
|
1617
|
+
recordingError: computed4(() => recordingErrorSignal()),
|
|
1277
1618
|
sendAudio: (audio) => controller.sendAudio(audio),
|
|
1278
|
-
sessionId:
|
|
1619
|
+
sessionId: computed4(() => sessionIdSignal()),
|
|
1279
1620
|
startRecording: () => controller.startRecording(),
|
|
1280
|
-
status:
|
|
1621
|
+
status: computed4(() => statusSignal()),
|
|
1281
1622
|
stopRecording: () => controller.stopRecording(),
|
|
1282
1623
|
toggleRecording: () => controller.toggleRecording(),
|
|
1283
|
-
turns:
|
|
1624
|
+
turns: computed4(() => turnsSignal())
|
|
1284
1625
|
};
|
|
1285
1626
|
}
|
|
1286
1627
|
}
|
|
@@ -1288,7 +1629,900 @@ VoiceControllerService = __decorateElement(_init, 0, "VoiceControllerService", _
|
|
|
1288
1629
|
__runInitializers(_init, 1, VoiceControllerService);
|
|
1289
1630
|
__decoratorMetadata(_init, VoiceControllerService);
|
|
1290
1631
|
let _VoiceControllerService = VoiceControllerService;
|
|
1632
|
+
// src/angular/voice-provider-capabilities.service.ts
|
|
1633
|
+
import { computed as computed5, Injectable as Injectable5, signal as signal5 } from "@angular/core";
|
|
1634
|
+
|
|
1635
|
+
// src/client/providerCapabilities.ts
|
|
1636
|
+
var fetchVoiceProviderCapabilities = async (path = "/api/provider-capabilities", options = {}) => {
|
|
1637
|
+
const fetchImpl = options.fetch ?? globalThis.fetch;
|
|
1638
|
+
const response = await fetchImpl(path);
|
|
1639
|
+
if (!response.ok) {
|
|
1640
|
+
throw new Error(`Voice provider capabilities failed: HTTP ${response.status}`);
|
|
1641
|
+
}
|
|
1642
|
+
return await response.json();
|
|
1643
|
+
};
|
|
1644
|
+
var createVoiceProviderCapabilitiesStore = (path = "/api/provider-capabilities", options = {}) => {
|
|
1645
|
+
const listeners = new Set;
|
|
1646
|
+
let closed = false;
|
|
1647
|
+
let timer;
|
|
1648
|
+
let snapshot = {
|
|
1649
|
+
error: null,
|
|
1650
|
+
isLoading: false
|
|
1651
|
+
};
|
|
1652
|
+
const emit = () => {
|
|
1653
|
+
for (const listener of listeners) {
|
|
1654
|
+
listener();
|
|
1655
|
+
}
|
|
1656
|
+
};
|
|
1657
|
+
const refresh = async () => {
|
|
1658
|
+
if (closed) {
|
|
1659
|
+
return snapshot.report;
|
|
1660
|
+
}
|
|
1661
|
+
snapshot = {
|
|
1662
|
+
...snapshot,
|
|
1663
|
+
error: null,
|
|
1664
|
+
isLoading: true
|
|
1665
|
+
};
|
|
1666
|
+
emit();
|
|
1667
|
+
try {
|
|
1668
|
+
const report = await fetchVoiceProviderCapabilities(path, options);
|
|
1669
|
+
snapshot = {
|
|
1670
|
+
error: null,
|
|
1671
|
+
isLoading: false,
|
|
1672
|
+
report,
|
|
1673
|
+
updatedAt: Date.now()
|
|
1674
|
+
};
|
|
1675
|
+
emit();
|
|
1676
|
+
return report;
|
|
1677
|
+
} catch (error) {
|
|
1678
|
+
snapshot = {
|
|
1679
|
+
...snapshot,
|
|
1680
|
+
error: error instanceof Error ? error.message : String(error),
|
|
1681
|
+
isLoading: false
|
|
1682
|
+
};
|
|
1683
|
+
emit();
|
|
1684
|
+
throw error;
|
|
1685
|
+
}
|
|
1686
|
+
};
|
|
1687
|
+
const close = () => {
|
|
1688
|
+
closed = true;
|
|
1689
|
+
if (timer) {
|
|
1690
|
+
clearInterval(timer);
|
|
1691
|
+
timer = undefined;
|
|
1692
|
+
}
|
|
1693
|
+
listeners.clear();
|
|
1694
|
+
};
|
|
1695
|
+
if (options.intervalMs && options.intervalMs > 0) {
|
|
1696
|
+
timer = setInterval(() => {
|
|
1697
|
+
refresh().catch(() => {});
|
|
1698
|
+
}, options.intervalMs);
|
|
1699
|
+
}
|
|
1700
|
+
return {
|
|
1701
|
+
close,
|
|
1702
|
+
getServerSnapshot: () => snapshot,
|
|
1703
|
+
getSnapshot: () => snapshot,
|
|
1704
|
+
refresh,
|
|
1705
|
+
subscribe: (listener) => {
|
|
1706
|
+
listeners.add(listener);
|
|
1707
|
+
return () => {
|
|
1708
|
+
listeners.delete(listener);
|
|
1709
|
+
};
|
|
1710
|
+
}
|
|
1711
|
+
};
|
|
1712
|
+
};
|
|
1713
|
+
|
|
1714
|
+
// src/angular/voice-provider-capabilities.service.ts
|
|
1715
|
+
var _dec = [
|
|
1716
|
+
Injectable5({ providedIn: "root" })
|
|
1717
|
+
];
|
|
1718
|
+
var _init = __decoratorStart(undefined);
|
|
1719
|
+
|
|
1720
|
+
class VoiceProviderCapabilitiesService {
|
|
1721
|
+
connect(path = "/api/provider-capabilities", options = {}) {
|
|
1722
|
+
const store = createVoiceProviderCapabilitiesStore(path, options);
|
|
1723
|
+
const errorSignal = signal5(null);
|
|
1724
|
+
const isLoadingSignal = signal5(false);
|
|
1725
|
+
const reportSignal = signal5(undefined);
|
|
1726
|
+
const updatedAtSignal = signal5(undefined);
|
|
1727
|
+
const sync = () => {
|
|
1728
|
+
const snapshot = store.getSnapshot();
|
|
1729
|
+
errorSignal.set(snapshot.error);
|
|
1730
|
+
isLoadingSignal.set(snapshot.isLoading);
|
|
1731
|
+
reportSignal.set(snapshot.report);
|
|
1732
|
+
updatedAtSignal.set(snapshot.updatedAt);
|
|
1733
|
+
};
|
|
1734
|
+
const unsubscribe = store.subscribe(sync);
|
|
1735
|
+
sync();
|
|
1736
|
+
store.refresh().catch(() => {});
|
|
1737
|
+
return {
|
|
1738
|
+
close: () => {
|
|
1739
|
+
unsubscribe();
|
|
1740
|
+
store.close();
|
|
1741
|
+
},
|
|
1742
|
+
error: computed5(() => errorSignal()),
|
|
1743
|
+
isLoading: computed5(() => isLoadingSignal()),
|
|
1744
|
+
refresh: store.refresh,
|
|
1745
|
+
report: computed5(() => reportSignal()),
|
|
1746
|
+
updatedAt: computed5(() => updatedAtSignal())
|
|
1747
|
+
};
|
|
1748
|
+
}
|
|
1749
|
+
}
|
|
1750
|
+
VoiceProviderCapabilitiesService = __decorateElement(_init, 0, "VoiceProviderCapabilitiesService", _dec, VoiceProviderCapabilitiesService);
|
|
1751
|
+
__runInitializers(_init, 1, VoiceProviderCapabilitiesService);
|
|
1752
|
+
__decoratorMetadata(_init, VoiceProviderCapabilitiesService);
|
|
1753
|
+
let _VoiceProviderCapabilitiesService = VoiceProviderCapabilitiesService;
|
|
1754
|
+
// src/angular/voice-provider-status.service.ts
|
|
1755
|
+
import { computed as computed6, Injectable as Injectable6, signal as signal6 } from "@angular/core";
|
|
1756
|
+
|
|
1757
|
+
// src/client/providerStatus.ts
|
|
1758
|
+
var fetchVoiceProviderStatus = async (path = "/api/provider-status", options = {}) => {
|
|
1759
|
+
const fetchImpl = options.fetch ?? globalThis.fetch;
|
|
1760
|
+
const response = await fetchImpl(path);
|
|
1761
|
+
if (!response.ok) {
|
|
1762
|
+
throw new Error(`Voice provider status failed: HTTP ${response.status}`);
|
|
1763
|
+
}
|
|
1764
|
+
return await response.json();
|
|
1765
|
+
};
|
|
1766
|
+
var createVoiceProviderStatusStore = (path = "/api/provider-status", options = {}) => {
|
|
1767
|
+
const listeners = new Set;
|
|
1768
|
+
let closed = false;
|
|
1769
|
+
let timer;
|
|
1770
|
+
let snapshot = {
|
|
1771
|
+
error: null,
|
|
1772
|
+
isLoading: false,
|
|
1773
|
+
providers: []
|
|
1774
|
+
};
|
|
1775
|
+
const emit = () => {
|
|
1776
|
+
for (const listener of listeners) {
|
|
1777
|
+
listener();
|
|
1778
|
+
}
|
|
1779
|
+
};
|
|
1780
|
+
const refresh = async () => {
|
|
1781
|
+
if (closed) {
|
|
1782
|
+
return snapshot.providers;
|
|
1783
|
+
}
|
|
1784
|
+
snapshot = {
|
|
1785
|
+
...snapshot,
|
|
1786
|
+
error: null,
|
|
1787
|
+
isLoading: true
|
|
1788
|
+
};
|
|
1789
|
+
emit();
|
|
1790
|
+
try {
|
|
1791
|
+
const providers = await fetchVoiceProviderStatus(path, options);
|
|
1792
|
+
snapshot = {
|
|
1793
|
+
error: null,
|
|
1794
|
+
isLoading: false,
|
|
1795
|
+
providers,
|
|
1796
|
+
updatedAt: Date.now()
|
|
1797
|
+
};
|
|
1798
|
+
emit();
|
|
1799
|
+
return providers;
|
|
1800
|
+
} catch (error) {
|
|
1801
|
+
snapshot = {
|
|
1802
|
+
...snapshot,
|
|
1803
|
+
error: error instanceof Error ? error.message : String(error),
|
|
1804
|
+
isLoading: false
|
|
1805
|
+
};
|
|
1806
|
+
emit();
|
|
1807
|
+
throw error;
|
|
1808
|
+
}
|
|
1809
|
+
};
|
|
1810
|
+
const close = () => {
|
|
1811
|
+
closed = true;
|
|
1812
|
+
if (timer) {
|
|
1813
|
+
clearInterval(timer);
|
|
1814
|
+
timer = undefined;
|
|
1815
|
+
}
|
|
1816
|
+
listeners.clear();
|
|
1817
|
+
};
|
|
1818
|
+
if (options.intervalMs && options.intervalMs > 0) {
|
|
1819
|
+
timer = setInterval(() => {
|
|
1820
|
+
refresh().catch(() => {});
|
|
1821
|
+
}, options.intervalMs);
|
|
1822
|
+
}
|
|
1823
|
+
return {
|
|
1824
|
+
close,
|
|
1825
|
+
getServerSnapshot: () => snapshot,
|
|
1826
|
+
getSnapshot: () => snapshot,
|
|
1827
|
+
refresh,
|
|
1828
|
+
subscribe: (listener) => {
|
|
1829
|
+
listeners.add(listener);
|
|
1830
|
+
return () => {
|
|
1831
|
+
listeners.delete(listener);
|
|
1832
|
+
};
|
|
1833
|
+
}
|
|
1834
|
+
};
|
|
1835
|
+
};
|
|
1836
|
+
|
|
1837
|
+
// src/angular/voice-provider-status.service.ts
|
|
1838
|
+
var _dec = [
|
|
1839
|
+
Injectable6({ providedIn: "root" })
|
|
1840
|
+
];
|
|
1841
|
+
var _init = __decoratorStart(undefined);
|
|
1842
|
+
|
|
1843
|
+
class VoiceProviderStatusService {
|
|
1844
|
+
connect(path = "/api/provider-status", options = {}) {
|
|
1845
|
+
const store = createVoiceProviderStatusStore(path, options);
|
|
1846
|
+
const errorSignal = signal6(null);
|
|
1847
|
+
const isLoadingSignal = signal6(false);
|
|
1848
|
+
const providersSignal = signal6([]);
|
|
1849
|
+
const updatedAtSignal = signal6(undefined);
|
|
1850
|
+
const sync = () => {
|
|
1851
|
+
const snapshot = store.getSnapshot();
|
|
1852
|
+
errorSignal.set(snapshot.error);
|
|
1853
|
+
isLoadingSignal.set(snapshot.isLoading);
|
|
1854
|
+
providersSignal.set([...snapshot.providers]);
|
|
1855
|
+
updatedAtSignal.set(snapshot.updatedAt);
|
|
1856
|
+
};
|
|
1857
|
+
const unsubscribe = store.subscribe(sync);
|
|
1858
|
+
sync();
|
|
1859
|
+
store.refresh().catch(() => {});
|
|
1860
|
+
return {
|
|
1861
|
+
close: () => {
|
|
1862
|
+
unsubscribe();
|
|
1863
|
+
store.close();
|
|
1864
|
+
},
|
|
1865
|
+
error: computed6(() => errorSignal()),
|
|
1866
|
+
isLoading: computed6(() => isLoadingSignal()),
|
|
1867
|
+
providers: computed6(() => providersSignal()),
|
|
1868
|
+
refresh: store.refresh,
|
|
1869
|
+
updatedAt: computed6(() => updatedAtSignal())
|
|
1870
|
+
};
|
|
1871
|
+
}
|
|
1872
|
+
}
|
|
1873
|
+
VoiceProviderStatusService = __decorateElement(_init, 0, "VoiceProviderStatusService", _dec, VoiceProviderStatusService);
|
|
1874
|
+
__runInitializers(_init, 1, VoiceProviderStatusService);
|
|
1875
|
+
__decoratorMetadata(_init, VoiceProviderStatusService);
|
|
1876
|
+
let _VoiceProviderStatusService = VoiceProviderStatusService;
|
|
1877
|
+
// src/angular/voice-routing-status.service.ts
|
|
1878
|
+
import { Injectable as Injectable7, signal as signal7 } from "@angular/core";
|
|
1879
|
+
|
|
1880
|
+
// src/client/routingStatus.ts
|
|
1881
|
+
var fetchVoiceRoutingStatus = async (path = "/api/routing/latest", options = {}) => {
|
|
1882
|
+
const fetchImpl = options.fetch ?? globalThis.fetch;
|
|
1883
|
+
const response = await fetchImpl(path);
|
|
1884
|
+
if (!response.ok) {
|
|
1885
|
+
throw new Error(`Voice routing status failed: HTTP ${response.status}`);
|
|
1886
|
+
}
|
|
1887
|
+
return await response.json();
|
|
1888
|
+
};
|
|
1889
|
+
var createVoiceRoutingStatusStore = (path = "/api/routing/latest", options = {}) => {
|
|
1890
|
+
const listeners = new Set;
|
|
1891
|
+
let closed = false;
|
|
1892
|
+
let timer;
|
|
1893
|
+
let snapshot = {
|
|
1894
|
+
decision: null,
|
|
1895
|
+
error: null,
|
|
1896
|
+
isLoading: false
|
|
1897
|
+
};
|
|
1898
|
+
const emit = () => {
|
|
1899
|
+
for (const listener of listeners) {
|
|
1900
|
+
listener();
|
|
1901
|
+
}
|
|
1902
|
+
};
|
|
1903
|
+
const refresh = async () => {
|
|
1904
|
+
if (closed) {
|
|
1905
|
+
return snapshot.decision;
|
|
1906
|
+
}
|
|
1907
|
+
snapshot = {
|
|
1908
|
+
...snapshot,
|
|
1909
|
+
error: null,
|
|
1910
|
+
isLoading: true
|
|
1911
|
+
};
|
|
1912
|
+
emit();
|
|
1913
|
+
try {
|
|
1914
|
+
const decision = await fetchVoiceRoutingStatus(path, options);
|
|
1915
|
+
snapshot = {
|
|
1916
|
+
decision,
|
|
1917
|
+
error: null,
|
|
1918
|
+
isLoading: false,
|
|
1919
|
+
updatedAt: Date.now()
|
|
1920
|
+
};
|
|
1921
|
+
emit();
|
|
1922
|
+
return decision;
|
|
1923
|
+
} catch (error) {
|
|
1924
|
+
snapshot = {
|
|
1925
|
+
...snapshot,
|
|
1926
|
+
error: error instanceof Error ? error.message : String(error),
|
|
1927
|
+
isLoading: false
|
|
1928
|
+
};
|
|
1929
|
+
emit();
|
|
1930
|
+
throw error;
|
|
1931
|
+
}
|
|
1932
|
+
};
|
|
1933
|
+
const close = () => {
|
|
1934
|
+
closed = true;
|
|
1935
|
+
if (timer) {
|
|
1936
|
+
clearInterval(timer);
|
|
1937
|
+
timer = undefined;
|
|
1938
|
+
}
|
|
1939
|
+
listeners.clear();
|
|
1940
|
+
};
|
|
1941
|
+
if (options.intervalMs && options.intervalMs > 0) {
|
|
1942
|
+
timer = setInterval(() => {
|
|
1943
|
+
refresh().catch(() => {});
|
|
1944
|
+
}, options.intervalMs);
|
|
1945
|
+
}
|
|
1946
|
+
return {
|
|
1947
|
+
close,
|
|
1948
|
+
getServerSnapshot: () => snapshot,
|
|
1949
|
+
getSnapshot: () => snapshot,
|
|
1950
|
+
refresh,
|
|
1951
|
+
subscribe: (listener) => {
|
|
1952
|
+
listeners.add(listener);
|
|
1953
|
+
return () => {
|
|
1954
|
+
listeners.delete(listener);
|
|
1955
|
+
};
|
|
1956
|
+
}
|
|
1957
|
+
};
|
|
1958
|
+
};
|
|
1959
|
+
|
|
1960
|
+
// src/angular/voice-routing-status.service.ts
|
|
1961
|
+
var _dec = [
|
|
1962
|
+
Injectable7({ providedIn: "root" })
|
|
1963
|
+
];
|
|
1964
|
+
var _init = __decoratorStart(undefined);
|
|
1965
|
+
|
|
1966
|
+
class VoiceRoutingStatusService {
|
|
1967
|
+
connect(path = "/api/routing/latest", options = {}) {
|
|
1968
|
+
const store = createVoiceRoutingStatusStore(path, options);
|
|
1969
|
+
const decisionSignal = signal7(null);
|
|
1970
|
+
const errorSignal = signal7(null);
|
|
1971
|
+
const isLoadingSignal = signal7(false);
|
|
1972
|
+
const updatedAtSignal = signal7(undefined);
|
|
1973
|
+
const sync = () => {
|
|
1974
|
+
const snapshot = store.getSnapshot();
|
|
1975
|
+
decisionSignal.set(snapshot.decision);
|
|
1976
|
+
errorSignal.set(snapshot.error);
|
|
1977
|
+
isLoadingSignal.set(snapshot.isLoading);
|
|
1978
|
+
updatedAtSignal.set(snapshot.updatedAt);
|
|
1979
|
+
};
|
|
1980
|
+
const unsubscribe = store.subscribe(sync);
|
|
1981
|
+
sync();
|
|
1982
|
+
store.refresh().catch(() => {});
|
|
1983
|
+
return {
|
|
1984
|
+
close: () => {
|
|
1985
|
+
unsubscribe();
|
|
1986
|
+
store.close();
|
|
1987
|
+
},
|
|
1988
|
+
decision: decisionSignal.asReadonly(),
|
|
1989
|
+
error: errorSignal.asReadonly(),
|
|
1990
|
+
isLoading: isLoadingSignal.asReadonly(),
|
|
1991
|
+
refresh: store.refresh,
|
|
1992
|
+
updatedAt: updatedAtSignal.asReadonly()
|
|
1993
|
+
};
|
|
1994
|
+
}
|
|
1995
|
+
}
|
|
1996
|
+
VoiceRoutingStatusService = __decorateElement(_init, 0, "VoiceRoutingStatusService", _dec, VoiceRoutingStatusService);
|
|
1997
|
+
__runInitializers(_init, 1, VoiceRoutingStatusService);
|
|
1998
|
+
__decoratorMetadata(_init, VoiceRoutingStatusService);
|
|
1999
|
+
let _VoiceRoutingStatusService = VoiceRoutingStatusService;
|
|
2000
|
+
// src/angular/voice-trace-timeline.service.ts
|
|
2001
|
+
import { computed as computed7, Injectable as Injectable8, signal as signal8 } from "@angular/core";
|
|
2002
|
+
|
|
2003
|
+
// src/client/traceTimeline.ts
|
|
2004
|
+
var fetchVoiceTraceTimeline = async (path = "/api/voice-traces", options = {}) => {
|
|
2005
|
+
const fetchImpl = options.fetch ?? globalThis.fetch;
|
|
2006
|
+
const response = await fetchImpl(path);
|
|
2007
|
+
if (!response.ok) {
|
|
2008
|
+
throw new Error(`Voice trace timeline failed: HTTP ${response.status}`);
|
|
2009
|
+
}
|
|
2010
|
+
return await response.json();
|
|
2011
|
+
};
|
|
2012
|
+
var createVoiceTraceTimelineStore = (path = "/api/voice-traces", options = {}) => {
|
|
2013
|
+
const listeners = new Set;
|
|
2014
|
+
let closed = false;
|
|
2015
|
+
let timer;
|
|
2016
|
+
let snapshot = {
|
|
2017
|
+
error: null,
|
|
2018
|
+
isLoading: false,
|
|
2019
|
+
report: null
|
|
2020
|
+
};
|
|
2021
|
+
const emit = () => {
|
|
2022
|
+
for (const listener of listeners) {
|
|
2023
|
+
listener();
|
|
2024
|
+
}
|
|
2025
|
+
};
|
|
2026
|
+
const refresh = async () => {
|
|
2027
|
+
if (closed) {
|
|
2028
|
+
return snapshot.report;
|
|
2029
|
+
}
|
|
2030
|
+
snapshot = {
|
|
2031
|
+
...snapshot,
|
|
2032
|
+
error: null,
|
|
2033
|
+
isLoading: true
|
|
2034
|
+
};
|
|
2035
|
+
emit();
|
|
2036
|
+
try {
|
|
2037
|
+
const report = await fetchVoiceTraceTimeline(path, options);
|
|
2038
|
+
snapshot = {
|
|
2039
|
+
error: null,
|
|
2040
|
+
isLoading: false,
|
|
2041
|
+
report,
|
|
2042
|
+
updatedAt: Date.now()
|
|
2043
|
+
};
|
|
2044
|
+
emit();
|
|
2045
|
+
return report;
|
|
2046
|
+
} catch (error) {
|
|
2047
|
+
snapshot = {
|
|
2048
|
+
...snapshot,
|
|
2049
|
+
error: error instanceof Error ? error.message : String(error),
|
|
2050
|
+
isLoading: false
|
|
2051
|
+
};
|
|
2052
|
+
emit();
|
|
2053
|
+
throw error;
|
|
2054
|
+
}
|
|
2055
|
+
};
|
|
2056
|
+
const close = () => {
|
|
2057
|
+
closed = true;
|
|
2058
|
+
if (timer) {
|
|
2059
|
+
clearInterval(timer);
|
|
2060
|
+
timer = undefined;
|
|
2061
|
+
}
|
|
2062
|
+
listeners.clear();
|
|
2063
|
+
};
|
|
2064
|
+
if (options.intervalMs && options.intervalMs > 0) {
|
|
2065
|
+
timer = setInterval(() => {
|
|
2066
|
+
refresh().catch(() => {});
|
|
2067
|
+
}, options.intervalMs);
|
|
2068
|
+
}
|
|
2069
|
+
return {
|
|
2070
|
+
close,
|
|
2071
|
+
getServerSnapshot: () => snapshot,
|
|
2072
|
+
getSnapshot: () => snapshot,
|
|
2073
|
+
refresh,
|
|
2074
|
+
subscribe: (listener) => {
|
|
2075
|
+
listeners.add(listener);
|
|
2076
|
+
return () => {
|
|
2077
|
+
listeners.delete(listener);
|
|
2078
|
+
};
|
|
2079
|
+
}
|
|
2080
|
+
};
|
|
2081
|
+
};
|
|
2082
|
+
|
|
2083
|
+
// src/angular/voice-trace-timeline.service.ts
|
|
2084
|
+
var _dec = [
|
|
2085
|
+
Injectable8({ providedIn: "root" })
|
|
2086
|
+
];
|
|
2087
|
+
var _init = __decoratorStart(undefined);
|
|
2088
|
+
|
|
2089
|
+
class VoiceTraceTimelineService {
|
|
2090
|
+
connect(path = "/api/voice-traces", options = {}) {
|
|
2091
|
+
const store = createVoiceTraceTimelineStore(path, options);
|
|
2092
|
+
const errorSignal = signal8(null);
|
|
2093
|
+
const isLoadingSignal = signal8(false);
|
|
2094
|
+
const reportSignal = signal8(null);
|
|
2095
|
+
const updatedAtSignal = signal8(undefined);
|
|
2096
|
+
const sync = () => {
|
|
2097
|
+
const snapshot = store.getSnapshot();
|
|
2098
|
+
errorSignal.set(snapshot.error);
|
|
2099
|
+
isLoadingSignal.set(snapshot.isLoading);
|
|
2100
|
+
reportSignal.set(snapshot.report);
|
|
2101
|
+
updatedAtSignal.set(snapshot.updatedAt);
|
|
2102
|
+
};
|
|
2103
|
+
const unsubscribe = store.subscribe(sync);
|
|
2104
|
+
sync();
|
|
2105
|
+
store.refresh().catch(() => {});
|
|
2106
|
+
return {
|
|
2107
|
+
close: () => {
|
|
2108
|
+
unsubscribe();
|
|
2109
|
+
store.close();
|
|
2110
|
+
},
|
|
2111
|
+
error: computed7(() => errorSignal()),
|
|
2112
|
+
isLoading: computed7(() => isLoadingSignal()),
|
|
2113
|
+
refresh: store.refresh,
|
|
2114
|
+
report: computed7(() => reportSignal()),
|
|
2115
|
+
updatedAt: computed7(() => updatedAtSignal())
|
|
2116
|
+
};
|
|
2117
|
+
}
|
|
2118
|
+
}
|
|
2119
|
+
VoiceTraceTimelineService = __decorateElement(_init, 0, "VoiceTraceTimelineService", _dec, VoiceTraceTimelineService);
|
|
2120
|
+
__runInitializers(_init, 1, VoiceTraceTimelineService);
|
|
2121
|
+
__decoratorMetadata(_init, VoiceTraceTimelineService);
|
|
2122
|
+
let _VoiceTraceTimelineService = VoiceTraceTimelineService;
|
|
2123
|
+
// src/angular/voice-turn-latency.service.ts
|
|
2124
|
+
import { computed as computed8, Injectable as Injectable9, signal as signal9 } from "@angular/core";
|
|
2125
|
+
|
|
2126
|
+
// src/client/turnLatency.ts
|
|
2127
|
+
var fetchVoiceTurnLatency = async (path = "/api/turn-latency", options = {}) => {
|
|
2128
|
+
const fetchImpl = options.fetch ?? globalThis.fetch;
|
|
2129
|
+
const response = await fetchImpl(path);
|
|
2130
|
+
if (!response.ok) {
|
|
2131
|
+
throw new Error(`Voice turn latency failed: HTTP ${response.status}`);
|
|
2132
|
+
}
|
|
2133
|
+
return await response.json();
|
|
2134
|
+
};
|
|
2135
|
+
var runVoiceTurnLatencyProof = async (path, options = {}) => {
|
|
2136
|
+
const fetchImpl = options.fetch ?? globalThis.fetch;
|
|
2137
|
+
const response = await fetchImpl(path, { method: "POST" });
|
|
2138
|
+
if (!response.ok) {
|
|
2139
|
+
throw new Error(`Voice turn latency proof failed: HTTP ${response.status}`);
|
|
2140
|
+
}
|
|
2141
|
+
return response.json();
|
|
2142
|
+
};
|
|
2143
|
+
var createVoiceTurnLatencyStore = (path = "/api/turn-latency", options = {}) => {
|
|
2144
|
+
const listeners = new Set;
|
|
2145
|
+
let closed = false;
|
|
2146
|
+
let timer;
|
|
2147
|
+
let snapshot = {
|
|
2148
|
+
error: null,
|
|
2149
|
+
isLoading: false
|
|
2150
|
+
};
|
|
2151
|
+
const emit = () => {
|
|
2152
|
+
for (const listener of listeners) {
|
|
2153
|
+
listener();
|
|
2154
|
+
}
|
|
2155
|
+
};
|
|
2156
|
+
const refresh = async () => {
|
|
2157
|
+
if (closed) {
|
|
2158
|
+
return snapshot.report;
|
|
2159
|
+
}
|
|
2160
|
+
snapshot = { ...snapshot, error: null, isLoading: true };
|
|
2161
|
+
emit();
|
|
2162
|
+
try {
|
|
2163
|
+
const report = await fetchVoiceTurnLatency(path, options);
|
|
2164
|
+
snapshot = {
|
|
2165
|
+
error: null,
|
|
2166
|
+
isLoading: false,
|
|
2167
|
+
report,
|
|
2168
|
+
updatedAt: Date.now()
|
|
2169
|
+
};
|
|
2170
|
+
emit();
|
|
2171
|
+
return report;
|
|
2172
|
+
} catch (error) {
|
|
2173
|
+
snapshot = {
|
|
2174
|
+
...snapshot,
|
|
2175
|
+
error: error instanceof Error ? error.message : String(error),
|
|
2176
|
+
isLoading: false
|
|
2177
|
+
};
|
|
2178
|
+
emit();
|
|
2179
|
+
throw error;
|
|
2180
|
+
}
|
|
2181
|
+
};
|
|
2182
|
+
const runProof = async () => {
|
|
2183
|
+
if (!options.proofPath) {
|
|
2184
|
+
throw new Error("Voice turn latency proof path is not configured.");
|
|
2185
|
+
}
|
|
2186
|
+
snapshot = { ...snapshot, error: null, isLoading: true };
|
|
2187
|
+
emit();
|
|
2188
|
+
try {
|
|
2189
|
+
await runVoiceTurnLatencyProof(options.proofPath, options);
|
|
2190
|
+
return await refresh();
|
|
2191
|
+
} catch (error) {
|
|
2192
|
+
snapshot = {
|
|
2193
|
+
...snapshot,
|
|
2194
|
+
error: error instanceof Error ? error.message : String(error),
|
|
2195
|
+
isLoading: false
|
|
2196
|
+
};
|
|
2197
|
+
emit();
|
|
2198
|
+
throw error;
|
|
2199
|
+
}
|
|
2200
|
+
};
|
|
2201
|
+
const close = () => {
|
|
2202
|
+
closed = true;
|
|
2203
|
+
if (timer) {
|
|
2204
|
+
clearInterval(timer);
|
|
2205
|
+
timer = undefined;
|
|
2206
|
+
}
|
|
2207
|
+
listeners.clear();
|
|
2208
|
+
};
|
|
2209
|
+
if (options.intervalMs && options.intervalMs > 0) {
|
|
2210
|
+
timer = setInterval(() => {
|
|
2211
|
+
refresh().catch(() => {});
|
|
2212
|
+
}, options.intervalMs);
|
|
2213
|
+
}
|
|
2214
|
+
return {
|
|
2215
|
+
close,
|
|
2216
|
+
getServerSnapshot: () => snapshot,
|
|
2217
|
+
getSnapshot: () => snapshot,
|
|
2218
|
+
refresh,
|
|
2219
|
+
runProof,
|
|
2220
|
+
subscribe: (listener) => {
|
|
2221
|
+
listeners.add(listener);
|
|
2222
|
+
return () => {
|
|
2223
|
+
listeners.delete(listener);
|
|
2224
|
+
};
|
|
2225
|
+
}
|
|
2226
|
+
};
|
|
2227
|
+
};
|
|
2228
|
+
|
|
2229
|
+
// src/angular/voice-turn-latency.service.ts
|
|
2230
|
+
var _dec = [
|
|
2231
|
+
Injectable9({ providedIn: "root" })
|
|
2232
|
+
];
|
|
2233
|
+
var _init = __decoratorStart(undefined);
|
|
2234
|
+
|
|
2235
|
+
class VoiceTurnLatencyService {
|
|
2236
|
+
connect(path = "/api/turn-latency", options = {}) {
|
|
2237
|
+
const store = createVoiceTurnLatencyStore(path, options);
|
|
2238
|
+
const errorSignal = signal9(null);
|
|
2239
|
+
const isLoadingSignal = signal9(false);
|
|
2240
|
+
const reportSignal = signal9(undefined);
|
|
2241
|
+
const updatedAtSignal = signal9(undefined);
|
|
2242
|
+
const sync = () => {
|
|
2243
|
+
const snapshot = store.getSnapshot();
|
|
2244
|
+
errorSignal.set(snapshot.error);
|
|
2245
|
+
isLoadingSignal.set(snapshot.isLoading);
|
|
2246
|
+
reportSignal.set(snapshot.report);
|
|
2247
|
+
updatedAtSignal.set(snapshot.updatedAt);
|
|
2248
|
+
};
|
|
2249
|
+
const unsubscribe = store.subscribe(sync);
|
|
2250
|
+
sync();
|
|
2251
|
+
store.refresh().catch(() => {});
|
|
2252
|
+
return {
|
|
2253
|
+
close: () => {
|
|
2254
|
+
unsubscribe();
|
|
2255
|
+
store.close();
|
|
2256
|
+
},
|
|
2257
|
+
error: computed8(() => errorSignal()),
|
|
2258
|
+
isLoading: computed8(() => isLoadingSignal()),
|
|
2259
|
+
refresh: store.refresh,
|
|
2260
|
+
report: computed8(() => reportSignal()),
|
|
2261
|
+
runProof: store.runProof,
|
|
2262
|
+
updatedAt: computed8(() => updatedAtSignal())
|
|
2263
|
+
};
|
|
2264
|
+
}
|
|
2265
|
+
}
|
|
2266
|
+
VoiceTurnLatencyService = __decorateElement(_init, 0, "VoiceTurnLatencyService", _dec, VoiceTurnLatencyService);
|
|
2267
|
+
__runInitializers(_init, 1, VoiceTurnLatencyService);
|
|
2268
|
+
__decoratorMetadata(_init, VoiceTurnLatencyService);
|
|
2269
|
+
let _VoiceTurnLatencyService = VoiceTurnLatencyService;
|
|
2270
|
+
// src/angular/voice-turn-quality.service.ts
|
|
2271
|
+
import { computed as computed9, Injectable as Injectable10, signal as signal10 } from "@angular/core";
|
|
2272
|
+
|
|
2273
|
+
// src/client/turnQuality.ts
|
|
2274
|
+
var fetchVoiceTurnQuality = async (path = "/api/turn-quality", options = {}) => {
|
|
2275
|
+
const fetchImpl = options.fetch ?? globalThis.fetch;
|
|
2276
|
+
const response = await fetchImpl(path);
|
|
2277
|
+
if (!response.ok) {
|
|
2278
|
+
throw new Error(`Voice turn quality failed: HTTP ${response.status}`);
|
|
2279
|
+
}
|
|
2280
|
+
return await response.json();
|
|
2281
|
+
};
|
|
2282
|
+
var createVoiceTurnQualityStore = (path = "/api/turn-quality", options = {}) => {
|
|
2283
|
+
const listeners = new Set;
|
|
2284
|
+
let closed = false;
|
|
2285
|
+
let timer;
|
|
2286
|
+
let snapshot = {
|
|
2287
|
+
error: null,
|
|
2288
|
+
isLoading: false
|
|
2289
|
+
};
|
|
2290
|
+
const emit = () => {
|
|
2291
|
+
for (const listener of listeners) {
|
|
2292
|
+
listener();
|
|
2293
|
+
}
|
|
2294
|
+
};
|
|
2295
|
+
const refresh = async () => {
|
|
2296
|
+
if (closed) {
|
|
2297
|
+
return snapshot.report;
|
|
2298
|
+
}
|
|
2299
|
+
snapshot = {
|
|
2300
|
+
...snapshot,
|
|
2301
|
+
error: null,
|
|
2302
|
+
isLoading: true
|
|
2303
|
+
};
|
|
2304
|
+
emit();
|
|
2305
|
+
try {
|
|
2306
|
+
const report = await fetchVoiceTurnQuality(path, options);
|
|
2307
|
+
snapshot = {
|
|
2308
|
+
error: null,
|
|
2309
|
+
isLoading: false,
|
|
2310
|
+
report,
|
|
2311
|
+
updatedAt: Date.now()
|
|
2312
|
+
};
|
|
2313
|
+
emit();
|
|
2314
|
+
return report;
|
|
2315
|
+
} catch (error) {
|
|
2316
|
+
snapshot = {
|
|
2317
|
+
...snapshot,
|
|
2318
|
+
error: error instanceof Error ? error.message : String(error),
|
|
2319
|
+
isLoading: false
|
|
2320
|
+
};
|
|
2321
|
+
emit();
|
|
2322
|
+
throw error;
|
|
2323
|
+
}
|
|
2324
|
+
};
|
|
2325
|
+
const close = () => {
|
|
2326
|
+
closed = true;
|
|
2327
|
+
if (timer) {
|
|
2328
|
+
clearInterval(timer);
|
|
2329
|
+
timer = undefined;
|
|
2330
|
+
}
|
|
2331
|
+
listeners.clear();
|
|
2332
|
+
};
|
|
2333
|
+
if (options.intervalMs && options.intervalMs > 0) {
|
|
2334
|
+
timer = setInterval(() => {
|
|
2335
|
+
refresh().catch(() => {});
|
|
2336
|
+
}, options.intervalMs);
|
|
2337
|
+
}
|
|
2338
|
+
return {
|
|
2339
|
+
close,
|
|
2340
|
+
getServerSnapshot: () => snapshot,
|
|
2341
|
+
getSnapshot: () => snapshot,
|
|
2342
|
+
refresh,
|
|
2343
|
+
subscribe: (listener) => {
|
|
2344
|
+
listeners.add(listener);
|
|
2345
|
+
return () => {
|
|
2346
|
+
listeners.delete(listener);
|
|
2347
|
+
};
|
|
2348
|
+
}
|
|
2349
|
+
};
|
|
2350
|
+
};
|
|
2351
|
+
|
|
2352
|
+
// src/angular/voice-turn-quality.service.ts
|
|
2353
|
+
var _dec = [
|
|
2354
|
+
Injectable10({ providedIn: "root" })
|
|
2355
|
+
];
|
|
2356
|
+
var _init = __decoratorStart(undefined);
|
|
2357
|
+
|
|
2358
|
+
class VoiceTurnQualityService {
|
|
2359
|
+
connect(path = "/api/turn-quality", options = {}) {
|
|
2360
|
+
const store = createVoiceTurnQualityStore(path, options);
|
|
2361
|
+
const errorSignal = signal10(null);
|
|
2362
|
+
const isLoadingSignal = signal10(false);
|
|
2363
|
+
const reportSignal = signal10(undefined);
|
|
2364
|
+
const updatedAtSignal = signal10(undefined);
|
|
2365
|
+
const sync = () => {
|
|
2366
|
+
const snapshot = store.getSnapshot();
|
|
2367
|
+
errorSignal.set(snapshot.error);
|
|
2368
|
+
isLoadingSignal.set(snapshot.isLoading);
|
|
2369
|
+
reportSignal.set(snapshot.report);
|
|
2370
|
+
updatedAtSignal.set(snapshot.updatedAt);
|
|
2371
|
+
};
|
|
2372
|
+
const unsubscribe = store.subscribe(sync);
|
|
2373
|
+
sync();
|
|
2374
|
+
store.refresh().catch(() => {});
|
|
2375
|
+
return {
|
|
2376
|
+
close: () => {
|
|
2377
|
+
unsubscribe();
|
|
2378
|
+
store.close();
|
|
2379
|
+
},
|
|
2380
|
+
error: computed9(() => errorSignal()),
|
|
2381
|
+
isLoading: computed9(() => isLoadingSignal()),
|
|
2382
|
+
refresh: store.refresh,
|
|
2383
|
+
report: computed9(() => reportSignal()),
|
|
2384
|
+
updatedAt: computed9(() => updatedAtSignal())
|
|
2385
|
+
};
|
|
2386
|
+
}
|
|
2387
|
+
}
|
|
2388
|
+
VoiceTurnQualityService = __decorateElement(_init, 0, "VoiceTurnQualityService", _dec, VoiceTurnQualityService);
|
|
2389
|
+
__runInitializers(_init, 1, VoiceTurnQualityService);
|
|
2390
|
+
__decoratorMetadata(_init, VoiceTurnQualityService);
|
|
2391
|
+
let _VoiceTurnQualityService = VoiceTurnQualityService;
|
|
2392
|
+
// src/angular/voice-workflow-status.service.ts
|
|
2393
|
+
import { computed as computed10, Injectable as Injectable11, signal as signal11 } from "@angular/core";
|
|
2394
|
+
|
|
2395
|
+
// src/client/workflowStatus.ts
|
|
2396
|
+
var fetchVoiceWorkflowStatus = async (path = "/evals/scenarios/json", options = {}) => {
|
|
2397
|
+
const fetchImpl = options.fetch ?? globalThis.fetch;
|
|
2398
|
+
const response = await fetchImpl(path);
|
|
2399
|
+
if (!response.ok) {
|
|
2400
|
+
throw new Error(`Voice workflow status failed: HTTP ${response.status}`);
|
|
2401
|
+
}
|
|
2402
|
+
return await response.json();
|
|
2403
|
+
};
|
|
2404
|
+
var createVoiceWorkflowStatusStore = (path = "/evals/scenarios/json", options = {}) => {
|
|
2405
|
+
const listeners = new Set;
|
|
2406
|
+
let closed = false;
|
|
2407
|
+
let timer;
|
|
2408
|
+
let snapshot = {
|
|
2409
|
+
error: null,
|
|
2410
|
+
isLoading: false
|
|
2411
|
+
};
|
|
2412
|
+
const emit = () => {
|
|
2413
|
+
for (const listener of listeners) {
|
|
2414
|
+
listener();
|
|
2415
|
+
}
|
|
2416
|
+
};
|
|
2417
|
+
const refresh = async () => {
|
|
2418
|
+
if (closed) {
|
|
2419
|
+
return snapshot.report;
|
|
2420
|
+
}
|
|
2421
|
+
snapshot = {
|
|
2422
|
+
...snapshot,
|
|
2423
|
+
error: null,
|
|
2424
|
+
isLoading: true
|
|
2425
|
+
};
|
|
2426
|
+
emit();
|
|
2427
|
+
try {
|
|
2428
|
+
const report = await fetchVoiceWorkflowStatus(path, options);
|
|
2429
|
+
snapshot = {
|
|
2430
|
+
error: null,
|
|
2431
|
+
isLoading: false,
|
|
2432
|
+
report,
|
|
2433
|
+
updatedAt: Date.now()
|
|
2434
|
+
};
|
|
2435
|
+
emit();
|
|
2436
|
+
return report;
|
|
2437
|
+
} catch (error) {
|
|
2438
|
+
snapshot = {
|
|
2439
|
+
...snapshot,
|
|
2440
|
+
error: error instanceof Error ? error.message : String(error),
|
|
2441
|
+
isLoading: false
|
|
2442
|
+
};
|
|
2443
|
+
emit();
|
|
2444
|
+
throw error;
|
|
2445
|
+
}
|
|
2446
|
+
};
|
|
2447
|
+
const close = () => {
|
|
2448
|
+
closed = true;
|
|
2449
|
+
if (timer) {
|
|
2450
|
+
clearInterval(timer);
|
|
2451
|
+
timer = undefined;
|
|
2452
|
+
}
|
|
2453
|
+
listeners.clear();
|
|
2454
|
+
};
|
|
2455
|
+
if (typeof window !== "undefined" && options.intervalMs && options.intervalMs > 0) {
|
|
2456
|
+
timer = setInterval(() => {
|
|
2457
|
+
refresh().catch(() => {});
|
|
2458
|
+
}, options.intervalMs);
|
|
2459
|
+
}
|
|
2460
|
+
return {
|
|
2461
|
+
close,
|
|
2462
|
+
getServerSnapshot: () => snapshot,
|
|
2463
|
+
getSnapshot: () => snapshot,
|
|
2464
|
+
refresh,
|
|
2465
|
+
subscribe: (listener) => {
|
|
2466
|
+
listeners.add(listener);
|
|
2467
|
+
return () => {
|
|
2468
|
+
listeners.delete(listener);
|
|
2469
|
+
};
|
|
2470
|
+
}
|
|
2471
|
+
};
|
|
2472
|
+
};
|
|
2473
|
+
|
|
2474
|
+
// src/angular/voice-workflow-status.service.ts
|
|
2475
|
+
var _dec = [
|
|
2476
|
+
Injectable11({ providedIn: "root" })
|
|
2477
|
+
];
|
|
2478
|
+
var _init = __decoratorStart(undefined);
|
|
2479
|
+
|
|
2480
|
+
class VoiceWorkflowStatusService {
|
|
2481
|
+
connect(path = "/evals/scenarios/json", options = {}) {
|
|
2482
|
+
const store = createVoiceWorkflowStatusStore(path, options);
|
|
2483
|
+
const errorSignal = signal11(null);
|
|
2484
|
+
const isLoadingSignal = signal11(false);
|
|
2485
|
+
const reportSignal = signal11(undefined);
|
|
2486
|
+
const updatedAtSignal = signal11(undefined);
|
|
2487
|
+
const sync = () => {
|
|
2488
|
+
const snapshot = store.getSnapshot();
|
|
2489
|
+
errorSignal.set(snapshot.error);
|
|
2490
|
+
isLoadingSignal.set(snapshot.isLoading);
|
|
2491
|
+
reportSignal.set(snapshot.report);
|
|
2492
|
+
updatedAtSignal.set(snapshot.updatedAt);
|
|
2493
|
+
};
|
|
2494
|
+
const unsubscribe = store.subscribe(sync);
|
|
2495
|
+
sync();
|
|
2496
|
+
if (typeof window !== "undefined") {
|
|
2497
|
+
store.refresh().catch(() => {});
|
|
2498
|
+
}
|
|
2499
|
+
return {
|
|
2500
|
+
close: () => {
|
|
2501
|
+
unsubscribe();
|
|
2502
|
+
store.close();
|
|
2503
|
+
},
|
|
2504
|
+
error: computed10(() => errorSignal()),
|
|
2505
|
+
isLoading: computed10(() => isLoadingSignal()),
|
|
2506
|
+
refresh: store.refresh,
|
|
2507
|
+
report: computed10(() => reportSignal()),
|
|
2508
|
+
updatedAt: computed10(() => updatedAtSignal())
|
|
2509
|
+
};
|
|
2510
|
+
}
|
|
2511
|
+
}
|
|
2512
|
+
VoiceWorkflowStatusService = __decorateElement(_init, 0, "VoiceWorkflowStatusService", _dec, VoiceWorkflowStatusService);
|
|
2513
|
+
__runInitializers(_init, 1, VoiceWorkflowStatusService);
|
|
2514
|
+
__decoratorMetadata(_init, VoiceWorkflowStatusService);
|
|
2515
|
+
let _VoiceWorkflowStatusService = VoiceWorkflowStatusService;
|
|
1291
2516
|
export {
|
|
2517
|
+
VoiceWorkflowStatusService,
|
|
2518
|
+
VoiceTurnQualityService,
|
|
2519
|
+
VoiceTurnLatencyService,
|
|
2520
|
+
VoiceTraceTimelineService,
|
|
1292
2521
|
VoiceStreamService,
|
|
1293
|
-
|
|
2522
|
+
VoiceRoutingStatusService,
|
|
2523
|
+
VoiceProviderStatusService,
|
|
2524
|
+
VoiceProviderCapabilitiesService,
|
|
2525
|
+
VoiceControllerService,
|
|
2526
|
+
VoiceCampaignDialerProofService,
|
|
2527
|
+
VoiceAppKitStatusService
|
|
1294
2528
|
};
|