@absolutejs/voice 0.0.22-beta.6 → 0.0.22-beta.61
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 +205 -0
- package/dist/angular/index.d.ts +4 -0
- package/dist/angular/index.js +587 -43
- package/dist/angular/voice-app-kit-status.service.d.ts +12 -0
- package/dist/angular/voice-ops-status.component.d.ts +15 -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-workflow-status.service.d.ts +12 -0
- package/dist/appKit.d.ts +92 -0
- package/dist/assistantHealth.d.ts +81 -0
- package/dist/client/actions.d.ts +22 -0
- package/dist/client/appKitStatus.d.ts +19 -0
- package/dist/client/connection.d.ts +3 -0
- package/dist/client/htmxBootstrap.js +44 -2
- package/dist/client/index.d.ts +18 -0
- package/dist/client/index.js +893 -2
- package/dist/client/opsStatusWidget.d.ts +40 -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/workflowStatus.d.ts +19 -0
- package/dist/diagnosticsRoutes.d.ts +44 -0
- package/dist/evalRoutes.d.ts +213 -0
- package/dist/handoff.d.ts +54 -0
- package/dist/handoffHealth.d.ts +94 -0
- package/dist/index.d.ts +32 -4
- package/dist/index.js +4222 -133
- package/dist/modelAdapters.d.ts +75 -0
- package/dist/opsConsoleRoutes.d.ts +77 -0
- package/dist/opsWebhook.d.ts +126 -0
- package/dist/providerAdapters.d.ts +48 -0
- package/dist/providerHealth.d.ts +79 -0
- package/dist/qualityRoutes.d.ts +76 -0
- package/dist/queue.d.ts +52 -0
- package/dist/react/VoiceOpsStatus.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/index.d.ts +9 -0
- package/dist/react/index.js +1295 -11
- package/dist/react/useVoiceAppKitStatus.d.ts +8 -0
- package/dist/react/useVoiceController.d.ts +2 -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/useVoiceWorkflowStatus.d.ts +8 -0
- package/dist/resilienceRoutes.d.ts +117 -0
- package/dist/sessionReplay.d.ts +175 -0
- package/dist/svelte/createVoiceAppKitStatus.d.ts +8 -0
- package/dist/svelte/createVoiceOpsStatus.d.ts +9 -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/createVoiceWorkflowStatus.d.ts +8 -0
- package/dist/svelte/index.d.ts +6 -0
- package/dist/svelte/index.js +923 -3
- package/dist/testing/index.d.ts +2 -0
- package/dist/testing/index.js +1537 -7
- package/dist/testing/ioProviderSimulator.d.ts +41 -0
- package/dist/testing/providerSimulator.d.ts +44 -0
- package/dist/trace.d.ts +1 -1
- package/dist/types.d.ts +84 -2
- package/dist/vue/VoiceOpsStatus.d.ts +30 -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/index.d.ts +9 -0
- package/dist/vue/index.js +1354 -25
- package/dist/vue/useVoiceAppKitStatus.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 +2 -0
- package/dist/vue/useVoiceWorkflowStatus.d.ts +9 -0
- package/dist/workflowContract.d.ts +91 -0
- package/package.json +1 -1
package/dist/vue/index.js
CHANGED
|
@@ -69,8 +69,1169 @@ 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/vue/
|
|
72
|
+
// src/vue/VoiceOpsStatus.ts
|
|
73
|
+
import { defineComponent, h } from "vue";
|
|
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/client/opsStatusWidget.ts
|
|
155
|
+
var DEFAULT_TITLE = "Voice Ops Status";
|
|
156
|
+
var DEFAULT_DESCRIPTION = "Certified workflow, provider, and handoff readiness from the AbsoluteJS voice app kit.";
|
|
157
|
+
var SURFACE_LABELS = {
|
|
158
|
+
handoffs: "Handoffs",
|
|
159
|
+
providers: "Providers",
|
|
160
|
+
quality: "Quality",
|
|
161
|
+
sessions: "Sessions",
|
|
162
|
+
workflows: "Workflows"
|
|
163
|
+
};
|
|
164
|
+
var escapeHtml = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
165
|
+
var readNumber = (value, key) => value && typeof value === "object" && (key in value) ? Number(value[key] ?? 0) : 0;
|
|
166
|
+
var surfaceDetail = (surface) => {
|
|
167
|
+
const total = readNumber(surface, "total");
|
|
168
|
+
const failed = readNumber(surface, "failed");
|
|
169
|
+
const degraded = readNumber(surface, "degraded");
|
|
170
|
+
const source = surface && typeof surface === "object" && "source" in surface && typeof surface.source === "string" ? ` from ${surface.source}` : "";
|
|
171
|
+
if (degraded > 0) {
|
|
172
|
+
return `${degraded} degraded of ${total}`;
|
|
173
|
+
}
|
|
174
|
+
if (failed > 0) {
|
|
175
|
+
return `${failed} failing of ${total}${source}`;
|
|
176
|
+
}
|
|
177
|
+
return total > 0 ? `${total} passing${source}` : `No failures${source}`;
|
|
178
|
+
};
|
|
179
|
+
var getVoiceOpsStatusLabel = (report, error) => {
|
|
180
|
+
if (error) {
|
|
181
|
+
return "Unavailable";
|
|
182
|
+
}
|
|
183
|
+
if (!report) {
|
|
184
|
+
return "Checking";
|
|
185
|
+
}
|
|
186
|
+
return report.status === "pass" ? "Passing" : "Needs attention";
|
|
187
|
+
};
|
|
188
|
+
var createVoiceOpsStatusViewModel = (snapshot, options = {}) => {
|
|
189
|
+
const report = snapshot.report;
|
|
190
|
+
const surfaces = Object.entries(report?.surfaces ?? {}).map(([id, surface]) => {
|
|
191
|
+
const failed = readNumber(surface, "failed") || readNumber(surface, "degraded");
|
|
192
|
+
const total = readNumber(surface, "total");
|
|
193
|
+
const status = surface && typeof surface === "object" && "status" in surface ? surface.status ?? "pass" : "pass";
|
|
194
|
+
return {
|
|
195
|
+
detail: surfaceDetail(surface),
|
|
196
|
+
failed,
|
|
197
|
+
id,
|
|
198
|
+
label: SURFACE_LABELS[id] ?? id,
|
|
199
|
+
status,
|
|
200
|
+
total
|
|
201
|
+
};
|
|
202
|
+
});
|
|
203
|
+
return {
|
|
204
|
+
description: options.description ?? DEFAULT_DESCRIPTION,
|
|
205
|
+
error: snapshot.error,
|
|
206
|
+
isLoading: snapshot.isLoading,
|
|
207
|
+
label: getVoiceOpsStatusLabel(report, snapshot.error),
|
|
208
|
+
links: options.includeLinks === false ? [] : report?.links ?? [],
|
|
209
|
+
passed: report?.passed ?? 0,
|
|
210
|
+
status: snapshot.error ? "error" : report ? report.status : snapshot.isLoading ? "loading" : "loading",
|
|
211
|
+
surfaces,
|
|
212
|
+
title: options.title ?? DEFAULT_TITLE,
|
|
213
|
+
total: report?.total ?? 0,
|
|
214
|
+
updatedAt: snapshot.updatedAt
|
|
215
|
+
};
|
|
216
|
+
};
|
|
217
|
+
var renderVoiceOpsStatusHTML = (snapshot, options = {}) => {
|
|
218
|
+
const model = createVoiceOpsStatusViewModel(snapshot, options);
|
|
219
|
+
const surfaces = model.surfaces.length ? model.surfaces.map((surface) => `<li class="absolute-voice-ops-status__surface absolute-voice-ops-status__surface--${escapeHtml(surface.status)}">
|
|
220
|
+
<span>${escapeHtml(surface.label)}</span>
|
|
221
|
+
<strong>${escapeHtml(surface.detail)}</strong>
|
|
222
|
+
</li>`).join("") : '<li class="absolute-voice-ops-status__surface"><span>Status</span><strong>Waiting for first check</strong></li>';
|
|
223
|
+
const links = model.links.length ? `<nav class="absolute-voice-ops-status__links">${model.links.slice(0, 4).map((link) => `<a href="${escapeHtml(link.href)}">${escapeHtml(link.label)}</a>`).join("")}</nav>` : "";
|
|
224
|
+
return `<section class="absolute-voice-ops-status absolute-voice-ops-status--${escapeHtml(model.status)}">
|
|
225
|
+
<header class="absolute-voice-ops-status__header">
|
|
226
|
+
<span class="absolute-voice-ops-status__eyebrow">${escapeHtml(model.title)}</span>
|
|
227
|
+
<strong class="absolute-voice-ops-status__label">${escapeHtml(model.label)}</strong>
|
|
228
|
+
</header>
|
|
229
|
+
<p class="absolute-voice-ops-status__description">${escapeHtml(model.description)}</p>
|
|
230
|
+
<div class="absolute-voice-ops-status__summary">
|
|
231
|
+
<span>${model.passed} passing</span>
|
|
232
|
+
<span>${Math.max(model.total - model.passed, 0)} failing</span>
|
|
233
|
+
<span>${model.total} checks</span>
|
|
234
|
+
</div>
|
|
235
|
+
<ul class="absolute-voice-ops-status__surfaces">${surfaces}</ul>
|
|
236
|
+
${model.error ? `<p class="absolute-voice-ops-status__error">${escapeHtml(model.error)}</p>` : ""}
|
|
237
|
+
${links}
|
|
238
|
+
</section>`;
|
|
239
|
+
};
|
|
240
|
+
var getVoiceOpsStatusCSS = () => `.absolute-voice-ops-status{border:1px solid #d8d2c4;border-radius:20px;background:#fffaf0;color:#16130d;padding:18px;box-shadow:0 18px 40px rgba(47,37,18,.12);font-family:inherit}.absolute-voice-ops-status--fail,.absolute-voice-ops-status--error{border-color:#f2a7a7;background:#fff5f3}.absolute-voice-ops-status__header{align-items:start;display:flex;gap:12px;justify-content:space-between}.absolute-voice-ops-status__eyebrow{color:#73664f;font-size:12px;font-weight:800;letter-spacing:.08em;text-transform:uppercase}.absolute-voice-ops-status__label{font-size:28px;line-height:1}.absolute-voice-ops-status__description{color:#514733;margin:12px 0 0}.absolute-voice-ops-status__summary,.absolute-voice-ops-status__links{display:flex;flex-wrap:wrap;gap:8px;margin-top:14px}.absolute-voice-ops-status__summary span,.absolute-voice-ops-status__links a{border:1px solid #e6ddca;border-radius:999px;color:inherit;padding:6px 10px;text-decoration:none}.absolute-voice-ops-status__surfaces{display:grid;gap:8px;list-style:none;margin:16px 0 0;padding:0}.absolute-voice-ops-status__surface{align-items:center;background:#fff;border:1px solid #eee4d2;border-radius:14px;display:flex;gap:12px;justify-content:space-between;padding:10px 12px}.absolute-voice-ops-status__surface--fail{border-color:#f2a7a7}.absolute-voice-ops-status__surface span{color:#655944}.absolute-voice-ops-status__error{color:#9f1239;font-weight:700}`;
|
|
241
|
+
var mountVoiceOpsStatus = (element, path = "/app-kit/status", options = {}) => {
|
|
242
|
+
const store = createVoiceAppKitStatusStore(path, options);
|
|
243
|
+
const render = () => {
|
|
244
|
+
element.innerHTML = renderVoiceOpsStatusHTML(store.getSnapshot(), options);
|
|
245
|
+
};
|
|
246
|
+
const unsubscribe = store.subscribe(render);
|
|
247
|
+
render();
|
|
248
|
+
store.refresh().catch(() => {});
|
|
249
|
+
return {
|
|
250
|
+
close: () => {
|
|
251
|
+
unsubscribe();
|
|
252
|
+
store.close();
|
|
253
|
+
},
|
|
254
|
+
refresh: store.refresh
|
|
255
|
+
};
|
|
256
|
+
};
|
|
257
|
+
var defineVoiceOpsStatusElement = (tagName = "absolute-voice-ops-status") => {
|
|
258
|
+
if (typeof window === "undefined" || typeof customElements === "undefined" || customElements.get(tagName)) {
|
|
259
|
+
return;
|
|
260
|
+
}
|
|
261
|
+
customElements.define(tagName, class AbsoluteVoiceOpsStatusElement extends HTMLElement {
|
|
262
|
+
mounted;
|
|
263
|
+
connectedCallback() {
|
|
264
|
+
const intervalMs = Number(this.getAttribute("interval-ms") ?? 5000);
|
|
265
|
+
this.mounted = mountVoiceOpsStatus(this, this.getAttribute("path") ?? "/app-kit/status", {
|
|
266
|
+
description: this.getAttribute("description") ?? undefined,
|
|
267
|
+
includeLinks: this.getAttribute("include-links") !== "false",
|
|
268
|
+
intervalMs: Number.isFinite(intervalMs) ? intervalMs : 5000,
|
|
269
|
+
title: this.getAttribute("title") ?? undefined
|
|
270
|
+
});
|
|
271
|
+
}
|
|
272
|
+
disconnectedCallback() {
|
|
273
|
+
this.mounted?.close();
|
|
274
|
+
this.mounted = undefined;
|
|
275
|
+
}
|
|
276
|
+
});
|
|
277
|
+
};
|
|
278
|
+
|
|
279
|
+
// src/vue/useVoiceAppKitStatus.ts
|
|
73
280
|
import { onUnmounted, ref, shallowRef } from "vue";
|
|
281
|
+
var useVoiceAppKitStatus = (path = "/app-kit/status", options = {}) => {
|
|
282
|
+
const store = createVoiceAppKitStatusStore(path, options);
|
|
283
|
+
const error = ref(null);
|
|
284
|
+
const isLoading = ref(false);
|
|
285
|
+
const report = shallowRef(undefined);
|
|
286
|
+
const updatedAt = ref(undefined);
|
|
287
|
+
const sync = () => {
|
|
288
|
+
const snapshot = store.getSnapshot();
|
|
289
|
+
error.value = snapshot.error;
|
|
290
|
+
isLoading.value = snapshot.isLoading;
|
|
291
|
+
report.value = snapshot.report;
|
|
292
|
+
updatedAt.value = snapshot.updatedAt;
|
|
293
|
+
};
|
|
294
|
+
const unsubscribe = store.subscribe(sync);
|
|
295
|
+
sync();
|
|
296
|
+
if (typeof window !== "undefined") {
|
|
297
|
+
store.refresh().catch(() => {});
|
|
298
|
+
}
|
|
299
|
+
onUnmounted(() => {
|
|
300
|
+
unsubscribe();
|
|
301
|
+
store.close();
|
|
302
|
+
});
|
|
303
|
+
return {
|
|
304
|
+
error,
|
|
305
|
+
isLoading,
|
|
306
|
+
refresh: store.refresh,
|
|
307
|
+
report,
|
|
308
|
+
updatedAt
|
|
309
|
+
};
|
|
310
|
+
};
|
|
311
|
+
|
|
312
|
+
// src/vue/VoiceOpsStatus.ts
|
|
313
|
+
var VoiceOpsStatus = defineComponent({
|
|
314
|
+
name: "VoiceOpsStatus",
|
|
315
|
+
props: {
|
|
316
|
+
description: String,
|
|
317
|
+
includeLinks: {
|
|
318
|
+
default: true,
|
|
319
|
+
type: Boolean
|
|
320
|
+
},
|
|
321
|
+
intervalMs: Number,
|
|
322
|
+
path: {
|
|
323
|
+
default: "/app-kit/status",
|
|
324
|
+
type: String
|
|
325
|
+
},
|
|
326
|
+
title: String
|
|
327
|
+
},
|
|
328
|
+
setup(props) {
|
|
329
|
+
const options = {
|
|
330
|
+
description: props.description,
|
|
331
|
+
includeLinks: props.includeLinks,
|
|
332
|
+
intervalMs: props.intervalMs,
|
|
333
|
+
title: props.title
|
|
334
|
+
};
|
|
335
|
+
const status = useVoiceAppKitStatus(props.path, options);
|
|
336
|
+
return () => {
|
|
337
|
+
const model = createVoiceOpsStatusViewModel({
|
|
338
|
+
error: status.error.value,
|
|
339
|
+
isLoading: status.isLoading.value,
|
|
340
|
+
report: status.report.value,
|
|
341
|
+
updatedAt: status.updatedAt.value
|
|
342
|
+
}, options);
|
|
343
|
+
return h("section", {
|
|
344
|
+
class: [
|
|
345
|
+
"absolute-voice-ops-status",
|
|
346
|
+
`absolute-voice-ops-status--${model.status}`
|
|
347
|
+
]
|
|
348
|
+
}, [
|
|
349
|
+
h("header", { class: "absolute-voice-ops-status__header" }, [
|
|
350
|
+
h("span", { class: "absolute-voice-ops-status__eyebrow" }, model.title),
|
|
351
|
+
h("strong", { class: "absolute-voice-ops-status__label" }, model.label)
|
|
352
|
+
]),
|
|
353
|
+
h("p", { class: "absolute-voice-ops-status__description" }, model.description),
|
|
354
|
+
h("div", { class: "absolute-voice-ops-status__summary" }, [
|
|
355
|
+
h("span", `${model.passed} passing`),
|
|
356
|
+
h("span", `${Math.max(model.total - model.passed, 0)} failing`),
|
|
357
|
+
h("span", `${model.total} checks`)
|
|
358
|
+
]),
|
|
359
|
+
h("ul", { class: "absolute-voice-ops-status__surfaces" }, model.surfaces.length > 0 ? model.surfaces.map((surface) => h("li", {
|
|
360
|
+
class: [
|
|
361
|
+
"absolute-voice-ops-status__surface",
|
|
362
|
+
`absolute-voice-ops-status__surface--${surface.status}`
|
|
363
|
+
],
|
|
364
|
+
key: surface.id
|
|
365
|
+
}, [h("span", surface.label), h("strong", surface.detail)])) : [
|
|
366
|
+
h("li", { class: "absolute-voice-ops-status__surface" }, [
|
|
367
|
+
h("span", "Status"),
|
|
368
|
+
h("strong", "Waiting for first check")
|
|
369
|
+
])
|
|
370
|
+
]),
|
|
371
|
+
model.error ? h("p", { class: "absolute-voice-ops-status__error" }, model.error) : null,
|
|
372
|
+
model.links.length > 0 ? h("nav", { class: "absolute-voice-ops-status__links" }, model.links.slice(0, 4).map((link) => h("a", { href: link.href, key: link.href }, link.label))) : null
|
|
373
|
+
]);
|
|
374
|
+
};
|
|
375
|
+
}
|
|
376
|
+
});
|
|
377
|
+
// src/vue/VoiceProviderSimulationControls.ts
|
|
378
|
+
import { computed, defineComponent as defineComponent2, h as h2 } from "vue";
|
|
379
|
+
|
|
380
|
+
// src/client/providerSimulationControls.ts
|
|
381
|
+
var postSimulation = async (pathPrefix, mode, provider, fetchImpl) => {
|
|
382
|
+
const response = await fetchImpl(`${pathPrefix}/${mode}?provider=${encodeURIComponent(provider)}`, { method: "POST" });
|
|
383
|
+
const body = await response.json().catch(() => null);
|
|
384
|
+
if (!response.ok) {
|
|
385
|
+
const message = body && typeof body === "object" && "error" in body ? String(body.error) : `Voice provider simulation failed: HTTP ${response.status}`;
|
|
386
|
+
throw new Error(message);
|
|
387
|
+
}
|
|
388
|
+
return body;
|
|
389
|
+
};
|
|
390
|
+
var createVoiceProviderSimulationControlsStore = (options) => {
|
|
391
|
+
const listeners = new Set;
|
|
392
|
+
const fetchImpl = options.fetch ?? globalThis.fetch;
|
|
393
|
+
const pathPrefix = options.pathPrefix ?? `/api/${options.kind ?? "stt"}-simulate`;
|
|
394
|
+
let closed = false;
|
|
395
|
+
let snapshot = {
|
|
396
|
+
error: null,
|
|
397
|
+
isRunning: false,
|
|
398
|
+
lastResult: null,
|
|
399
|
+
mode: null,
|
|
400
|
+
provider: null
|
|
401
|
+
};
|
|
402
|
+
const emit = () => {
|
|
403
|
+
for (const listener of listeners) {
|
|
404
|
+
listener();
|
|
405
|
+
}
|
|
406
|
+
};
|
|
407
|
+
const run = async (provider, mode) => {
|
|
408
|
+
if (closed) {
|
|
409
|
+
return snapshot.lastResult;
|
|
410
|
+
}
|
|
411
|
+
snapshot = {
|
|
412
|
+
...snapshot,
|
|
413
|
+
error: null,
|
|
414
|
+
isRunning: true,
|
|
415
|
+
mode,
|
|
416
|
+
provider
|
|
417
|
+
};
|
|
418
|
+
emit();
|
|
419
|
+
try {
|
|
420
|
+
const result = await postSimulation(pathPrefix, mode, provider, fetchImpl);
|
|
421
|
+
snapshot = {
|
|
422
|
+
error: null,
|
|
423
|
+
isRunning: false,
|
|
424
|
+
lastResult: result,
|
|
425
|
+
mode,
|
|
426
|
+
provider,
|
|
427
|
+
updatedAt: Date.now()
|
|
428
|
+
};
|
|
429
|
+
emit();
|
|
430
|
+
return result;
|
|
431
|
+
} catch (error) {
|
|
432
|
+
snapshot = {
|
|
433
|
+
...snapshot,
|
|
434
|
+
error: error instanceof Error ? error.message : String(error),
|
|
435
|
+
isRunning: false
|
|
436
|
+
};
|
|
437
|
+
emit();
|
|
438
|
+
throw error;
|
|
439
|
+
}
|
|
440
|
+
};
|
|
441
|
+
const close = () => {
|
|
442
|
+
closed = true;
|
|
443
|
+
listeners.clear();
|
|
444
|
+
};
|
|
445
|
+
return {
|
|
446
|
+
close,
|
|
447
|
+
getServerSnapshot: () => snapshot,
|
|
448
|
+
getSnapshot: () => snapshot,
|
|
449
|
+
run,
|
|
450
|
+
subscribe: (listener) => {
|
|
451
|
+
listeners.add(listener);
|
|
452
|
+
return () => {
|
|
453
|
+
listeners.delete(listener);
|
|
454
|
+
};
|
|
455
|
+
}
|
|
456
|
+
};
|
|
457
|
+
};
|
|
458
|
+
|
|
459
|
+
// src/client/providerSimulationControlsWidget.ts
|
|
460
|
+
var escapeHtml2 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
461
|
+
var formatKind = (kind) => (kind ?? "stt").toUpperCase();
|
|
462
|
+
var createVoiceProviderSimulationControlsViewModel = (snapshot, options) => {
|
|
463
|
+
const configuredProviders = options.providers.filter((provider) => provider.configured !== false);
|
|
464
|
+
const fallbackReady = !options.fallbackRequiredProvider || configuredProviders.some((entry) => entry.provider === options.fallbackRequiredProvider);
|
|
465
|
+
const failureProviders = (options.failureProviders ? options.failureProviders.map((provider) => ({ provider })) : configuredProviders).filter((provider) => configuredProviders.some((entry) => entry.provider === provider.provider));
|
|
466
|
+
return {
|
|
467
|
+
canSimulateFailure: configuredProviders.length > 0 && fallbackReady,
|
|
468
|
+
description: options.failureMessage ?? `Simulate ${formatKind(options.kind)} provider failure and recovery without changing credentials.`,
|
|
469
|
+
error: snapshot.error,
|
|
470
|
+
failureProviders,
|
|
471
|
+
isRunning: snapshot.isRunning,
|
|
472
|
+
label: snapshot.isRunning ? `Running ${snapshot.mode ?? "simulation"}` : snapshot.lastResult ? `${snapshot.lastResult.provider} ${snapshot.lastResult.mode} simulated` : configuredProviders.length ? `${configuredProviders.length} configured` : "No configured providers",
|
|
473
|
+
providers: configuredProviders,
|
|
474
|
+
resultText: snapshot.lastResult ? JSON.stringify(snapshot.lastResult, null, 2) : null,
|
|
475
|
+
title: options.title ?? `${formatKind(options.kind)} Failure Simulation`
|
|
476
|
+
};
|
|
477
|
+
};
|
|
478
|
+
var renderVoiceProviderSimulationControlsHTML = (snapshot, options) => {
|
|
479
|
+
const model = createVoiceProviderSimulationControlsViewModel(snapshot, options);
|
|
480
|
+
const failureButtons = model.failureProviders.map((provider) => `<button type="button" data-voice-provider-fail="${escapeHtml2(provider.provider)}"${!model.canSimulateFailure || snapshot.isRunning ? " disabled" : ""}>Simulate ${escapeHtml2(provider.provider)} ${escapeHtml2(formatKind(options.kind))} failure</button>`).join("");
|
|
481
|
+
const recoveryButtons = model.providers.map((provider) => `<button type="button" data-voice-provider-recover="${escapeHtml2(provider.provider)}"${snapshot.isRunning ? " disabled" : ""}>Mark ${escapeHtml2(provider.provider)} recovered</button>`).join("");
|
|
482
|
+
return `<section class="absolute-voice-provider-simulation absolute-voice-provider-simulation--${snapshot.error ? "error" : snapshot.isRunning ? "running" : "ready"}">
|
|
483
|
+
<header class="absolute-voice-provider-simulation__header">
|
|
484
|
+
<span class="absolute-voice-provider-simulation__eyebrow">${escapeHtml2(model.title)}</span>
|
|
485
|
+
<strong class="absolute-voice-provider-simulation__label">${escapeHtml2(model.label)}</strong>
|
|
486
|
+
</header>
|
|
487
|
+
<p class="absolute-voice-provider-simulation__description">${escapeHtml2(model.description)}</p>
|
|
488
|
+
${model.canSimulateFailure ? "" : `<p class="absolute-voice-provider-simulation__empty">${escapeHtml2(options.fallbackRequiredMessage ?? "Configure fallback providers before simulating failure.")}</p>`}
|
|
489
|
+
<div class="absolute-voice-provider-simulation__actions">${failureButtons}${recoveryButtons}</div>
|
|
490
|
+
${snapshot.error ? `<p class="absolute-voice-provider-simulation__error">${escapeHtml2(snapshot.error)}</p>` : ""}
|
|
491
|
+
${model.resultText ? `<pre class="absolute-voice-provider-simulation__result">${escapeHtml2(model.resultText)}</pre>` : ""}
|
|
492
|
+
</section>`;
|
|
493
|
+
};
|
|
494
|
+
var bindVoiceProviderSimulationControls = (element, store) => {
|
|
495
|
+
const onClick = (event) => {
|
|
496
|
+
const target = event.target;
|
|
497
|
+
if (!(target instanceof HTMLElement)) {
|
|
498
|
+
return;
|
|
499
|
+
}
|
|
500
|
+
const failProvider = target.getAttribute("data-voice-provider-fail");
|
|
501
|
+
const recoverProvider = target.getAttribute("data-voice-provider-recover");
|
|
502
|
+
if (failProvider) {
|
|
503
|
+
store.run(failProvider, "failure").catch(() => {});
|
|
504
|
+
}
|
|
505
|
+
if (recoverProvider) {
|
|
506
|
+
store.run(recoverProvider, "recovery").catch(() => {});
|
|
507
|
+
}
|
|
508
|
+
};
|
|
509
|
+
element.addEventListener("click", onClick);
|
|
510
|
+
return () => element.removeEventListener("click", onClick);
|
|
511
|
+
};
|
|
512
|
+
var mountVoiceProviderSimulationControls = (element, options) => {
|
|
513
|
+
const store = createVoiceProviderSimulationControlsStore(options);
|
|
514
|
+
const render = () => {
|
|
515
|
+
element.innerHTML = renderVoiceProviderSimulationControlsHTML(store.getSnapshot(), options);
|
|
516
|
+
};
|
|
517
|
+
const unsubscribeStore = store.subscribe(render);
|
|
518
|
+
const unsubscribeDom = bindVoiceProviderSimulationControls(element, store);
|
|
519
|
+
render();
|
|
520
|
+
return {
|
|
521
|
+
close: () => {
|
|
522
|
+
unsubscribeDom();
|
|
523
|
+
unsubscribeStore();
|
|
524
|
+
store.close();
|
|
525
|
+
},
|
|
526
|
+
run: store.run
|
|
527
|
+
};
|
|
528
|
+
};
|
|
529
|
+
var defineVoiceProviderSimulationControlsElement = (tagName = "absolute-voice-provider-simulation") => {
|
|
530
|
+
if (typeof window === "undefined" || typeof customElements === "undefined" || customElements.get(tagName)) {
|
|
531
|
+
return;
|
|
532
|
+
}
|
|
533
|
+
customElements.define(tagName, class AbsoluteVoiceProviderSimulationElement extends HTMLElement {
|
|
534
|
+
mounted;
|
|
535
|
+
connectedCallback() {
|
|
536
|
+
const providers = (this.getAttribute("providers") ?? "").split(",").map((provider) => provider.trim()).filter(Boolean).map((provider) => ({ provider }));
|
|
537
|
+
const failureProviders = (this.getAttribute("failure-providers") ?? "").split(",").map((provider) => provider.trim()).filter(Boolean);
|
|
538
|
+
this.mounted = mountVoiceProviderSimulationControls(this, {
|
|
539
|
+
failureProviders: failureProviders.length ? failureProviders : undefined,
|
|
540
|
+
fallbackRequiredMessage: this.getAttribute("fallback-required-message") ?? undefined,
|
|
541
|
+
fallbackRequiredProvider: this.getAttribute("fallback-required-provider") ?? undefined,
|
|
542
|
+
failureMessage: this.getAttribute("failure-message") ?? undefined,
|
|
543
|
+
kind: this.getAttribute("kind") ?? "stt",
|
|
544
|
+
pathPrefix: this.getAttribute("path-prefix") ?? undefined,
|
|
545
|
+
providers,
|
|
546
|
+
title: this.getAttribute("title") ?? undefined
|
|
547
|
+
});
|
|
548
|
+
}
|
|
549
|
+
disconnectedCallback() {
|
|
550
|
+
this.mounted?.close();
|
|
551
|
+
this.mounted = undefined;
|
|
552
|
+
}
|
|
553
|
+
});
|
|
554
|
+
};
|
|
555
|
+
|
|
556
|
+
// src/vue/useVoiceProviderSimulationControls.ts
|
|
557
|
+
import { onUnmounted as onUnmounted2, ref as ref2 } from "vue";
|
|
558
|
+
var useVoiceProviderSimulationControls = (options) => {
|
|
559
|
+
const store = createVoiceProviderSimulationControlsStore(options);
|
|
560
|
+
const error = ref2(null);
|
|
561
|
+
const isRunning = ref2(false);
|
|
562
|
+
const lastResult = ref2(null);
|
|
563
|
+
const mode = ref2(null);
|
|
564
|
+
const provider = ref2(null);
|
|
565
|
+
const updatedAt = ref2(undefined);
|
|
566
|
+
const sync = () => {
|
|
567
|
+
const snapshot = store.getSnapshot();
|
|
568
|
+
error.value = snapshot.error;
|
|
569
|
+
isRunning.value = snapshot.isRunning;
|
|
570
|
+
lastResult.value = snapshot.lastResult;
|
|
571
|
+
mode.value = snapshot.mode;
|
|
572
|
+
provider.value = snapshot.provider;
|
|
573
|
+
updatedAt.value = snapshot.updatedAt;
|
|
574
|
+
};
|
|
575
|
+
const unsubscribe = store.subscribe(sync);
|
|
576
|
+
sync();
|
|
577
|
+
onUnmounted2(() => {
|
|
578
|
+
unsubscribe();
|
|
579
|
+
store.close();
|
|
580
|
+
});
|
|
581
|
+
return {
|
|
582
|
+
error,
|
|
583
|
+
isRunning,
|
|
584
|
+
lastResult,
|
|
585
|
+
mode,
|
|
586
|
+
provider,
|
|
587
|
+
run: store.run,
|
|
588
|
+
updatedAt
|
|
589
|
+
};
|
|
590
|
+
};
|
|
591
|
+
|
|
592
|
+
// src/vue/VoiceProviderSimulationControls.ts
|
|
593
|
+
var VoiceProviderSimulationControls = defineComponent2({
|
|
594
|
+
name: "VoiceProviderSimulationControls",
|
|
595
|
+
props: {
|
|
596
|
+
class: { default: "", type: String },
|
|
597
|
+
fallbackRequiredMessage: { default: undefined, type: String },
|
|
598
|
+
fallbackRequiredProvider: { default: undefined, type: String },
|
|
599
|
+
failureMessage: { default: undefined, type: String },
|
|
600
|
+
failureProviders: {
|
|
601
|
+
default: undefined,
|
|
602
|
+
type: Array
|
|
603
|
+
},
|
|
604
|
+
kind: { default: "stt", type: String },
|
|
605
|
+
pathPrefix: { default: undefined, type: String },
|
|
606
|
+
providers: {
|
|
607
|
+
required: true,
|
|
608
|
+
type: Array
|
|
609
|
+
},
|
|
610
|
+
title: { default: undefined, type: String }
|
|
611
|
+
},
|
|
612
|
+
setup(props) {
|
|
613
|
+
const options = {
|
|
614
|
+
fallbackRequiredMessage: props.fallbackRequiredMessage,
|
|
615
|
+
fallbackRequiredProvider: props.fallbackRequiredProvider,
|
|
616
|
+
failureMessage: props.failureMessage,
|
|
617
|
+
failureProviders: props.failureProviders,
|
|
618
|
+
kind: props.kind,
|
|
619
|
+
pathPrefix: props.pathPrefix,
|
|
620
|
+
providers: props.providers,
|
|
621
|
+
title: props.title
|
|
622
|
+
};
|
|
623
|
+
const controls = useVoiceProviderSimulationControls(options);
|
|
624
|
+
const model = computed(() => createVoiceProviderSimulationControlsViewModel({
|
|
625
|
+
error: controls.error.value,
|
|
626
|
+
isRunning: controls.isRunning.value,
|
|
627
|
+
lastResult: controls.lastResult.value,
|
|
628
|
+
mode: controls.mode.value,
|
|
629
|
+
provider: controls.provider.value,
|
|
630
|
+
updatedAt: controls.updatedAt.value
|
|
631
|
+
}, options));
|
|
632
|
+
const run = (provider, mode) => {
|
|
633
|
+
controls.run(provider, mode).catch(() => {});
|
|
634
|
+
};
|
|
635
|
+
return () => h2("section", {
|
|
636
|
+
class: [
|
|
637
|
+
"absolute-voice-provider-simulation",
|
|
638
|
+
`absolute-voice-provider-simulation--${controls.error.value ? "error" : controls.isRunning.value ? "running" : "ready"}`,
|
|
639
|
+
props.class
|
|
640
|
+
]
|
|
641
|
+
}, [
|
|
642
|
+
h2("header", { class: "absolute-voice-provider-simulation__header" }, [
|
|
643
|
+
h2("span", { class: "absolute-voice-provider-simulation__eyebrow" }, model.value.title),
|
|
644
|
+
h2("strong", { class: "absolute-voice-provider-simulation__label" }, model.value.label)
|
|
645
|
+
]),
|
|
646
|
+
h2("p", { class: "absolute-voice-provider-simulation__description" }, model.value.description),
|
|
647
|
+
model.value.canSimulateFailure ? null : h2("p", { class: "absolute-voice-provider-simulation__empty" }, props.fallbackRequiredMessage ?? "Configure fallback providers before simulating failure."),
|
|
648
|
+
h2("div", { class: "absolute-voice-provider-simulation__actions" }, [
|
|
649
|
+
...model.value.failureProviders.map((provider) => h2("button", {
|
|
650
|
+
disabled: !model.value.canSimulateFailure || controls.isRunning.value,
|
|
651
|
+
key: `fail-${provider.provider}`,
|
|
652
|
+
onClick: () => run(provider.provider, "failure"),
|
|
653
|
+
type: "button"
|
|
654
|
+
}, `Simulate ${provider.provider} ${props.kind.toUpperCase()} failure`)),
|
|
655
|
+
...model.value.providers.map((provider) => h2("button", {
|
|
656
|
+
disabled: controls.isRunning.value,
|
|
657
|
+
key: `recover-${provider.provider}`,
|
|
658
|
+
onClick: () => run(provider.provider, "recovery"),
|
|
659
|
+
type: "button"
|
|
660
|
+
}, `Mark ${provider.provider} recovered`))
|
|
661
|
+
]),
|
|
662
|
+
controls.error.value ? h2("p", { class: "absolute-voice-provider-simulation__error" }, controls.error.value) : null,
|
|
663
|
+
model.value.resultText ? h2("pre", { class: "absolute-voice-provider-simulation__result" }, model.value.resultText) : null
|
|
664
|
+
]);
|
|
665
|
+
}
|
|
666
|
+
});
|
|
667
|
+
// src/vue/VoiceProviderStatus.ts
|
|
668
|
+
import { computed as computed2, defineComponent as defineComponent3, h as h3 } from "vue";
|
|
669
|
+
|
|
670
|
+
// src/client/providerStatus.ts
|
|
671
|
+
var fetchVoiceProviderStatus = async (path = "/api/provider-status", options = {}) => {
|
|
672
|
+
const fetchImpl = options.fetch ?? globalThis.fetch;
|
|
673
|
+
const response = await fetchImpl(path);
|
|
674
|
+
if (!response.ok) {
|
|
675
|
+
throw new Error(`Voice provider status failed: HTTP ${response.status}`);
|
|
676
|
+
}
|
|
677
|
+
return await response.json();
|
|
678
|
+
};
|
|
679
|
+
var createVoiceProviderStatusStore = (path = "/api/provider-status", options = {}) => {
|
|
680
|
+
const listeners = new Set;
|
|
681
|
+
let closed = false;
|
|
682
|
+
let timer;
|
|
683
|
+
let snapshot = {
|
|
684
|
+
error: null,
|
|
685
|
+
isLoading: false,
|
|
686
|
+
providers: []
|
|
687
|
+
};
|
|
688
|
+
const emit = () => {
|
|
689
|
+
for (const listener of listeners) {
|
|
690
|
+
listener();
|
|
691
|
+
}
|
|
692
|
+
};
|
|
693
|
+
const refresh = async () => {
|
|
694
|
+
if (closed) {
|
|
695
|
+
return snapshot.providers;
|
|
696
|
+
}
|
|
697
|
+
snapshot = {
|
|
698
|
+
...snapshot,
|
|
699
|
+
error: null,
|
|
700
|
+
isLoading: true
|
|
701
|
+
};
|
|
702
|
+
emit();
|
|
703
|
+
try {
|
|
704
|
+
const providers = await fetchVoiceProviderStatus(path, options);
|
|
705
|
+
snapshot = {
|
|
706
|
+
error: null,
|
|
707
|
+
isLoading: false,
|
|
708
|
+
providers,
|
|
709
|
+
updatedAt: Date.now()
|
|
710
|
+
};
|
|
711
|
+
emit();
|
|
712
|
+
return providers;
|
|
713
|
+
} catch (error) {
|
|
714
|
+
snapshot = {
|
|
715
|
+
...snapshot,
|
|
716
|
+
error: error instanceof Error ? error.message : String(error),
|
|
717
|
+
isLoading: false
|
|
718
|
+
};
|
|
719
|
+
emit();
|
|
720
|
+
throw error;
|
|
721
|
+
}
|
|
722
|
+
};
|
|
723
|
+
const close = () => {
|
|
724
|
+
closed = true;
|
|
725
|
+
if (timer) {
|
|
726
|
+
clearInterval(timer);
|
|
727
|
+
timer = undefined;
|
|
728
|
+
}
|
|
729
|
+
listeners.clear();
|
|
730
|
+
};
|
|
731
|
+
if (options.intervalMs && options.intervalMs > 0) {
|
|
732
|
+
timer = setInterval(() => {
|
|
733
|
+
refresh().catch(() => {});
|
|
734
|
+
}, options.intervalMs);
|
|
735
|
+
}
|
|
736
|
+
return {
|
|
737
|
+
close,
|
|
738
|
+
getServerSnapshot: () => snapshot,
|
|
739
|
+
getSnapshot: () => snapshot,
|
|
740
|
+
refresh,
|
|
741
|
+
subscribe: (listener) => {
|
|
742
|
+
listeners.add(listener);
|
|
743
|
+
return () => {
|
|
744
|
+
listeners.delete(listener);
|
|
745
|
+
};
|
|
746
|
+
}
|
|
747
|
+
};
|
|
748
|
+
};
|
|
749
|
+
|
|
750
|
+
// src/client/providerStatusWidget.ts
|
|
751
|
+
var DEFAULT_TITLE2 = "Voice Providers";
|
|
752
|
+
var DEFAULT_DESCRIPTION2 = "Live provider health, fallback counts, latency, and suppression state from your self-hosted trace store.";
|
|
753
|
+
var escapeHtml3 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
754
|
+
var formatProvider = (provider) => provider.split(/[-_\s]+/).filter(Boolean).map((part) => `${part[0]?.toUpperCase() ?? ""}${part.slice(1)}`).join(" ") || provider;
|
|
755
|
+
var formatStatus = (status) => status.split("-").map((part) => `${part[0]?.toUpperCase() ?? ""}${part.slice(1)}`).join(" ");
|
|
756
|
+
var formatLatency = (value) => typeof value === "number" ? `${value}ms` : "No samples";
|
|
757
|
+
var formatSuppression = (value) => typeof value === "number" ? `${Math.ceil(value / 1000)}s` : "None";
|
|
758
|
+
var getProviderDetail = (provider) => {
|
|
759
|
+
if (provider.status === "suppressed") {
|
|
760
|
+
return provider.lastError ? `Suppressed for ${formatSuppression(provider.suppressionRemainingMs)} after ${provider.lastError}.` : `Suppressed for ${formatSuppression(provider.suppressionRemainingMs)}.`;
|
|
761
|
+
}
|
|
762
|
+
if (provider.status === "recoverable") {
|
|
763
|
+
return "Cooldown expired; ready for recovery traffic.";
|
|
764
|
+
}
|
|
765
|
+
if (provider.status === "rate-limited") {
|
|
766
|
+
return "Rate limit detected; router should avoid this provider.";
|
|
767
|
+
}
|
|
768
|
+
if (provider.status === "degraded") {
|
|
769
|
+
return provider.lastError ?? "Recent provider errors detected.";
|
|
770
|
+
}
|
|
771
|
+
if (provider.status === "healthy") {
|
|
772
|
+
return provider.recommended ? "Healthy and currently recommended." : "Healthy and available for routing.";
|
|
773
|
+
}
|
|
774
|
+
return "No provider traffic observed yet.";
|
|
775
|
+
};
|
|
776
|
+
var isWarningStatus = (status) => status === "degraded" || status === "rate-limited" || status === "recoverable" || status === "suppressed";
|
|
777
|
+
var createVoiceProviderStatusViewModel = (snapshot, options = {}) => {
|
|
778
|
+
const providers = snapshot.providers.map((provider) => ({
|
|
779
|
+
...provider,
|
|
780
|
+
detail: getProviderDetail(provider),
|
|
781
|
+
label: `${formatProvider(provider.provider)}${provider.recommended ? " recommended" : ""}`,
|
|
782
|
+
rows: [
|
|
783
|
+
{ label: "Runs", value: String(provider.runCount) },
|
|
784
|
+
{ label: "Avg latency", value: formatLatency(provider.averageElapsedMs) },
|
|
785
|
+
{ label: "Errors", value: String(provider.errorCount) },
|
|
786
|
+
{ label: "Timeouts", value: String(provider.timeoutCount) },
|
|
787
|
+
{ label: "Fallbacks", value: String(provider.fallbackCount) },
|
|
788
|
+
{
|
|
789
|
+
label: "Suppression",
|
|
790
|
+
value: formatSuppression(provider.suppressionRemainingMs)
|
|
791
|
+
}
|
|
792
|
+
]
|
|
793
|
+
}));
|
|
794
|
+
const warningCount = providers.filter((provider) => isWarningStatus(provider.status)).length;
|
|
795
|
+
const healthyCount = providers.filter((provider) => provider.status === "healthy").length;
|
|
796
|
+
return {
|
|
797
|
+
description: options.description ?? DEFAULT_DESCRIPTION2,
|
|
798
|
+
error: snapshot.error,
|
|
799
|
+
isLoading: snapshot.isLoading,
|
|
800
|
+
label: snapshot.error ? "Unavailable" : providers.length ? warningCount > 0 ? `${warningCount} needs attention` : `${healthyCount} healthy` : snapshot.isLoading ? "Checking" : "No provider traffic",
|
|
801
|
+
providers,
|
|
802
|
+
status: snapshot.error ? "error" : providers.length ? warningCount > 0 ? "warning" : "ready" : snapshot.isLoading ? "loading" : "empty",
|
|
803
|
+
title: options.title ?? DEFAULT_TITLE2,
|
|
804
|
+
updatedAt: snapshot.updatedAt
|
|
805
|
+
};
|
|
806
|
+
};
|
|
807
|
+
var renderVoiceProviderStatusHTML = (snapshot, options = {}) => {
|
|
808
|
+
const model = createVoiceProviderStatusViewModel(snapshot, options);
|
|
809
|
+
const providers = model.providers.length ? `<div class="absolute-voice-provider-status__providers">${model.providers.map((provider) => `<article class="absolute-voice-provider-status__provider absolute-voice-provider-status__provider--${escapeHtml3(provider.status)}">
|
|
810
|
+
<header>
|
|
811
|
+
<strong>${escapeHtml3(provider.label)}</strong>
|
|
812
|
+
<span>${escapeHtml3(formatStatus(provider.status))}</span>
|
|
813
|
+
</header>
|
|
814
|
+
<p>${escapeHtml3(provider.detail)}</p>
|
|
815
|
+
<dl>${provider.rows.map((row) => `<div>
|
|
816
|
+
<dt>${escapeHtml3(row.label)}</dt>
|
|
817
|
+
<dd>${escapeHtml3(row.value)}</dd>
|
|
818
|
+
</div>`).join("")}</dl>
|
|
819
|
+
</article>`).join("")}</div>` : '<p class="absolute-voice-provider-status__empty">Run voice traffic to see provider health.</p>';
|
|
820
|
+
return `<section class="absolute-voice-provider-status absolute-voice-provider-status--${escapeHtml3(model.status)}">
|
|
821
|
+
<header class="absolute-voice-provider-status__header">
|
|
822
|
+
<span class="absolute-voice-provider-status__eyebrow">${escapeHtml3(model.title)}</span>
|
|
823
|
+
<strong class="absolute-voice-provider-status__label">${escapeHtml3(model.label)}</strong>
|
|
824
|
+
</header>
|
|
825
|
+
<p class="absolute-voice-provider-status__description">${escapeHtml3(model.description)}</p>
|
|
826
|
+
${providers}
|
|
827
|
+
${model.error ? `<p class="absolute-voice-provider-status__error">${escapeHtml3(model.error)}</p>` : ""}
|
|
828
|
+
</section>`;
|
|
829
|
+
};
|
|
830
|
+
var getVoiceProviderStatusCSS = () => `.absolute-voice-provider-status{border:1px solid #d8d2c4;border-radius:20px;background:#fffaf0;color:#16130d;padding:18px;box-shadow:0 18px 40px rgba(47,37,18,.12);font-family:inherit}.absolute-voice-provider-status--error,.absolute-voice-provider-status--warning{border-color:#f2a7a7;background:#fff5f3}.absolute-voice-provider-status__header,.absolute-voice-provider-status__provider header{align-items:start;display:flex;gap:12px;justify-content:space-between}.absolute-voice-provider-status__eyebrow{color:#73664f;font-size:12px;font-weight:800;letter-spacing:.08em;text-transform:uppercase}.absolute-voice-provider-status__label{font-size:24px;line-height:1}.absolute-voice-provider-status__description,.absolute-voice-provider-status__provider p,.absolute-voice-provider-status__provider dt,.absolute-voice-provider-status__empty{color:#514733}.absolute-voice-provider-status__providers{display:grid;gap:12px;margin-top:14px}.absolute-voice-provider-status__provider{background:#fff;border:1px solid #eee4d2;border-radius:16px;padding:14px}.absolute-voice-provider-status__provider--degraded,.absolute-voice-provider-status__provider--rate-limited,.absolute-voice-provider-status__provider--suppressed{border-color:#f2a7a7}.absolute-voice-provider-status__provider--recoverable{border-color:#fbbf24}.absolute-voice-provider-status__provider p{margin:10px 0}.absolute-voice-provider-status__provider dl{display:grid;gap:8px;grid-template-columns:repeat(2,minmax(0,1fr));margin:0}.absolute-voice-provider-status__provider div{background:#fffaf0;border:1px solid #eee4d2;border-radius:12px;padding:8px}.absolute-voice-provider-status__provider dt{font-size:12px}.absolute-voice-provider-status__provider dd{font-weight:800;margin:4px 0 0}.absolute-voice-provider-status__empty{margin:14px 0 0}.absolute-voice-provider-status__error{color:#9f1239;font-weight:700}`;
|
|
831
|
+
var mountVoiceProviderStatus = (element, path = "/api/provider-status", options = {}) => {
|
|
832
|
+
const store = createVoiceProviderStatusStore(path, options);
|
|
833
|
+
const render = () => {
|
|
834
|
+
element.innerHTML = renderVoiceProviderStatusHTML(store.getSnapshot(), options);
|
|
835
|
+
};
|
|
836
|
+
const unsubscribe = store.subscribe(render);
|
|
837
|
+
render();
|
|
838
|
+
store.refresh().catch(() => {});
|
|
839
|
+
return {
|
|
840
|
+
close: () => {
|
|
841
|
+
unsubscribe();
|
|
842
|
+
store.close();
|
|
843
|
+
},
|
|
844
|
+
refresh: store.refresh
|
|
845
|
+
};
|
|
846
|
+
};
|
|
847
|
+
var defineVoiceProviderStatusElement = (tagName = "absolute-voice-provider-status") => {
|
|
848
|
+
if (typeof window === "undefined" || typeof customElements === "undefined" || customElements.get(tagName)) {
|
|
849
|
+
return;
|
|
850
|
+
}
|
|
851
|
+
customElements.define(tagName, class AbsoluteVoiceProviderStatusElement extends HTMLElement {
|
|
852
|
+
mounted;
|
|
853
|
+
connectedCallback() {
|
|
854
|
+
const intervalMs = Number(this.getAttribute("interval-ms") ?? 5000);
|
|
855
|
+
this.mounted = mountVoiceProviderStatus(this, this.getAttribute("path") ?? "/api/provider-status", {
|
|
856
|
+
description: this.getAttribute("description") ?? undefined,
|
|
857
|
+
intervalMs: Number.isFinite(intervalMs) ? intervalMs : 5000,
|
|
858
|
+
title: this.getAttribute("title") ?? undefined
|
|
859
|
+
});
|
|
860
|
+
}
|
|
861
|
+
disconnectedCallback() {
|
|
862
|
+
this.mounted?.close();
|
|
863
|
+
this.mounted = undefined;
|
|
864
|
+
}
|
|
865
|
+
});
|
|
866
|
+
};
|
|
867
|
+
|
|
868
|
+
// src/vue/useVoiceProviderStatus.ts
|
|
869
|
+
import { onUnmounted as onUnmounted3, ref as ref3, shallowRef as shallowRef2 } from "vue";
|
|
870
|
+
var useVoiceProviderStatus = (path = "/api/provider-status", options = {}) => {
|
|
871
|
+
const store = createVoiceProviderStatusStore(path, options);
|
|
872
|
+
const error = ref3(null);
|
|
873
|
+
const isLoading = ref3(false);
|
|
874
|
+
const providers = shallowRef2([]);
|
|
875
|
+
const updatedAt = ref3(undefined);
|
|
876
|
+
const sync = () => {
|
|
877
|
+
const snapshot = store.getSnapshot();
|
|
878
|
+
error.value = snapshot.error;
|
|
879
|
+
isLoading.value = snapshot.isLoading;
|
|
880
|
+
providers.value = [...snapshot.providers];
|
|
881
|
+
updatedAt.value = snapshot.updatedAt;
|
|
882
|
+
};
|
|
883
|
+
const unsubscribe = store.subscribe(sync);
|
|
884
|
+
sync();
|
|
885
|
+
store.refresh().catch(() => {});
|
|
886
|
+
onUnmounted3(() => {
|
|
887
|
+
unsubscribe();
|
|
888
|
+
store.close();
|
|
889
|
+
});
|
|
890
|
+
return {
|
|
891
|
+
error,
|
|
892
|
+
isLoading,
|
|
893
|
+
providers,
|
|
894
|
+
refresh: store.refresh,
|
|
895
|
+
updatedAt
|
|
896
|
+
};
|
|
897
|
+
};
|
|
898
|
+
|
|
899
|
+
// src/vue/VoiceProviderStatus.ts
|
|
900
|
+
var VoiceProviderStatus = defineComponent3({
|
|
901
|
+
name: "VoiceProviderStatus",
|
|
902
|
+
props: {
|
|
903
|
+
class: {
|
|
904
|
+
default: "",
|
|
905
|
+
type: String
|
|
906
|
+
},
|
|
907
|
+
description: {
|
|
908
|
+
default: undefined,
|
|
909
|
+
type: String
|
|
910
|
+
},
|
|
911
|
+
intervalMs: {
|
|
912
|
+
default: 5000,
|
|
913
|
+
type: Number
|
|
914
|
+
},
|
|
915
|
+
path: {
|
|
916
|
+
default: "/api/provider-status",
|
|
917
|
+
type: String
|
|
918
|
+
},
|
|
919
|
+
title: {
|
|
920
|
+
default: undefined,
|
|
921
|
+
type: String
|
|
922
|
+
}
|
|
923
|
+
},
|
|
924
|
+
setup(props) {
|
|
925
|
+
const options = {
|
|
926
|
+
description: props.description,
|
|
927
|
+
intervalMs: props.intervalMs,
|
|
928
|
+
title: props.title
|
|
929
|
+
};
|
|
930
|
+
const status = useVoiceProviderStatus(props.path, options);
|
|
931
|
+
const model = computed2(() => createVoiceProviderStatusViewModel({
|
|
932
|
+
error: status.error.value,
|
|
933
|
+
isLoading: status.isLoading.value,
|
|
934
|
+
providers: status.providers.value,
|
|
935
|
+
updatedAt: status.updatedAt.value
|
|
936
|
+
}, options));
|
|
937
|
+
return () => h3("section", {
|
|
938
|
+
class: [
|
|
939
|
+
"absolute-voice-provider-status",
|
|
940
|
+
`absolute-voice-provider-status--${model.value.status}`,
|
|
941
|
+
props.class
|
|
942
|
+
]
|
|
943
|
+
}, [
|
|
944
|
+
h3("header", { class: "absolute-voice-provider-status__header" }, [
|
|
945
|
+
h3("span", { class: "absolute-voice-provider-status__eyebrow" }, model.value.title),
|
|
946
|
+
h3("strong", { class: "absolute-voice-provider-status__label" }, model.value.label)
|
|
947
|
+
]),
|
|
948
|
+
h3("p", { class: "absolute-voice-provider-status__description" }, model.value.description),
|
|
949
|
+
model.value.providers.length ? h3("div", { class: "absolute-voice-provider-status__providers" }, model.value.providers.map((provider) => h3("article", {
|
|
950
|
+
class: [
|
|
951
|
+
"absolute-voice-provider-status__provider",
|
|
952
|
+
`absolute-voice-provider-status__provider--${provider.status}`
|
|
953
|
+
],
|
|
954
|
+
key: provider.provider
|
|
955
|
+
}, [
|
|
956
|
+
h3("header", [
|
|
957
|
+
h3("strong", provider.label),
|
|
958
|
+
h3("span", provider.status)
|
|
959
|
+
]),
|
|
960
|
+
h3("p", provider.detail),
|
|
961
|
+
h3("dl", provider.rows.map((row) => h3("div", { key: row.label }, [
|
|
962
|
+
h3("dt", row.label),
|
|
963
|
+
h3("dd", row.value)
|
|
964
|
+
])))
|
|
965
|
+
]))) : h3("p", { class: "absolute-voice-provider-status__empty" }, "Run voice traffic to see provider health."),
|
|
966
|
+
model.value.error ? h3("p", { class: "absolute-voice-provider-status__error" }, model.value.error) : null
|
|
967
|
+
]);
|
|
968
|
+
}
|
|
969
|
+
});
|
|
970
|
+
// src/vue/VoiceRoutingStatus.ts
|
|
971
|
+
import { computed as computed3, defineComponent as defineComponent4, h as h4 } from "vue";
|
|
972
|
+
|
|
973
|
+
// src/client/routingStatus.ts
|
|
974
|
+
var fetchVoiceRoutingStatus = async (path = "/api/routing/latest", options = {}) => {
|
|
975
|
+
const fetchImpl = options.fetch ?? globalThis.fetch;
|
|
976
|
+
const response = await fetchImpl(path);
|
|
977
|
+
if (!response.ok) {
|
|
978
|
+
throw new Error(`Voice routing status failed: HTTP ${response.status}`);
|
|
979
|
+
}
|
|
980
|
+
return await response.json();
|
|
981
|
+
};
|
|
982
|
+
var createVoiceRoutingStatusStore = (path = "/api/routing/latest", options = {}) => {
|
|
983
|
+
const listeners = new Set;
|
|
984
|
+
let closed = false;
|
|
985
|
+
let timer;
|
|
986
|
+
let snapshot = {
|
|
987
|
+
decision: null,
|
|
988
|
+
error: null,
|
|
989
|
+
isLoading: false
|
|
990
|
+
};
|
|
991
|
+
const emit = () => {
|
|
992
|
+
for (const listener of listeners) {
|
|
993
|
+
listener();
|
|
994
|
+
}
|
|
995
|
+
};
|
|
996
|
+
const refresh = async () => {
|
|
997
|
+
if (closed) {
|
|
998
|
+
return snapshot.decision;
|
|
999
|
+
}
|
|
1000
|
+
snapshot = {
|
|
1001
|
+
...snapshot,
|
|
1002
|
+
error: null,
|
|
1003
|
+
isLoading: true
|
|
1004
|
+
};
|
|
1005
|
+
emit();
|
|
1006
|
+
try {
|
|
1007
|
+
const decision = await fetchVoiceRoutingStatus(path, options);
|
|
1008
|
+
snapshot = {
|
|
1009
|
+
decision,
|
|
1010
|
+
error: null,
|
|
1011
|
+
isLoading: false,
|
|
1012
|
+
updatedAt: Date.now()
|
|
1013
|
+
};
|
|
1014
|
+
emit();
|
|
1015
|
+
return decision;
|
|
1016
|
+
} catch (error) {
|
|
1017
|
+
snapshot = {
|
|
1018
|
+
...snapshot,
|
|
1019
|
+
error: error instanceof Error ? error.message : String(error),
|
|
1020
|
+
isLoading: false
|
|
1021
|
+
};
|
|
1022
|
+
emit();
|
|
1023
|
+
throw error;
|
|
1024
|
+
}
|
|
1025
|
+
};
|
|
1026
|
+
const close = () => {
|
|
1027
|
+
closed = true;
|
|
1028
|
+
if (timer) {
|
|
1029
|
+
clearInterval(timer);
|
|
1030
|
+
timer = undefined;
|
|
1031
|
+
}
|
|
1032
|
+
listeners.clear();
|
|
1033
|
+
};
|
|
1034
|
+
if (options.intervalMs && options.intervalMs > 0) {
|
|
1035
|
+
timer = setInterval(() => {
|
|
1036
|
+
refresh().catch(() => {});
|
|
1037
|
+
}, options.intervalMs);
|
|
1038
|
+
}
|
|
1039
|
+
return {
|
|
1040
|
+
close,
|
|
1041
|
+
getServerSnapshot: () => snapshot,
|
|
1042
|
+
getSnapshot: () => snapshot,
|
|
1043
|
+
refresh,
|
|
1044
|
+
subscribe: (listener) => {
|
|
1045
|
+
listeners.add(listener);
|
|
1046
|
+
return () => {
|
|
1047
|
+
listeners.delete(listener);
|
|
1048
|
+
};
|
|
1049
|
+
}
|
|
1050
|
+
};
|
|
1051
|
+
};
|
|
1052
|
+
|
|
1053
|
+
// src/client/routingStatusWidget.ts
|
|
1054
|
+
var DEFAULT_TITLE3 = "Voice Routing";
|
|
1055
|
+
var DEFAULT_DESCRIPTION3 = "Latest provider routing decision from the self-hosted trace store.";
|
|
1056
|
+
var escapeHtml4 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
1057
|
+
var formatValue = (value, fallback = "None") => typeof value === "string" && value.trim() ? value : typeof value === "number" && Number.isFinite(value) ? String(value) : fallback;
|
|
1058
|
+
var createVoiceRoutingStatusViewModel = (snapshot, options = {}) => {
|
|
1059
|
+
const decision = snapshot.decision;
|
|
1060
|
+
const rows = decision ? [
|
|
1061
|
+
{ label: "Kind", value: decision.kind.toUpperCase() },
|
|
1062
|
+
{ label: "Policy", value: formatValue(decision.routing, "Unknown") },
|
|
1063
|
+
{ label: "Provider", value: formatValue(decision.provider, "Unknown") },
|
|
1064
|
+
{
|
|
1065
|
+
label: "Selected",
|
|
1066
|
+
value: formatValue(decision.selectedProvider, "Unknown")
|
|
1067
|
+
},
|
|
1068
|
+
{
|
|
1069
|
+
label: "Fallback",
|
|
1070
|
+
value: formatValue(decision.fallbackProvider)
|
|
1071
|
+
},
|
|
1072
|
+
{ label: "Status", value: formatValue(decision.status, "unknown") },
|
|
1073
|
+
{
|
|
1074
|
+
label: "Latency budget",
|
|
1075
|
+
value: typeof decision.latencyBudgetMs === "number" ? `${decision.latencyBudgetMs}ms` : "None"
|
|
1076
|
+
}
|
|
1077
|
+
] : [];
|
|
1078
|
+
return {
|
|
1079
|
+
decision,
|
|
1080
|
+
description: options.description ?? DEFAULT_DESCRIPTION3,
|
|
1081
|
+
error: snapshot.error,
|
|
1082
|
+
isLoading: snapshot.isLoading,
|
|
1083
|
+
label: snapshot.error ? "Unavailable" : decision ? `${formatValue(decision.kind).toUpperCase()} ${formatValue(decision.status, "unknown")}` : snapshot.isLoading ? "Checking" : "No routing yet",
|
|
1084
|
+
rows,
|
|
1085
|
+
status: snapshot.error ? "error" : decision ? "ready" : snapshot.isLoading ? "loading" : "empty",
|
|
1086
|
+
title: options.title ?? DEFAULT_TITLE3,
|
|
1087
|
+
updatedAt: snapshot.updatedAt
|
|
1088
|
+
};
|
|
1089
|
+
};
|
|
1090
|
+
var renderVoiceRoutingStatusHTML = (snapshot, options = {}) => {
|
|
1091
|
+
const model = createVoiceRoutingStatusViewModel(snapshot, options);
|
|
1092
|
+
const rows = model.rows.length ? `<div class="absolute-voice-routing-status__grid">${model.rows.map((row) => `<div>
|
|
1093
|
+
<span>${escapeHtml4(row.label)}</span>
|
|
1094
|
+
<strong>${escapeHtml4(row.value)}</strong>
|
|
1095
|
+
</div>`).join("")}</div>` : '<p class="absolute-voice-routing-status__empty">Start a voice session to see the selected provider.</p>';
|
|
1096
|
+
return `<section class="absolute-voice-routing-status absolute-voice-routing-status--${escapeHtml4(model.status)}">
|
|
1097
|
+
<header class="absolute-voice-routing-status__header">
|
|
1098
|
+
<span class="absolute-voice-routing-status__eyebrow">${escapeHtml4(model.title)}</span>
|
|
1099
|
+
<strong class="absolute-voice-routing-status__label">${escapeHtml4(model.label)}</strong>
|
|
1100
|
+
</header>
|
|
1101
|
+
<p class="absolute-voice-routing-status__description">${escapeHtml4(model.description)}</p>
|
|
1102
|
+
${rows}
|
|
1103
|
+
${model.error ? `<p class="absolute-voice-routing-status__error">${escapeHtml4(model.error)}</p>` : ""}
|
|
1104
|
+
</section>`;
|
|
1105
|
+
};
|
|
1106
|
+
var getVoiceRoutingStatusCSS = () => `.absolute-voice-routing-status{border:1px solid #d8d2c4;border-radius:20px;background:#fffaf0;color:#16130d;padding:18px;box-shadow:0 18px 40px rgba(47,37,18,.12);font-family:inherit}.absolute-voice-routing-status--error{border-color:#f2a7a7;background:#fff5f3}.absolute-voice-routing-status__header{align-items:start;display:flex;gap:12px;justify-content:space-between}.absolute-voice-routing-status__eyebrow{color:#73664f;font-size:12px;font-weight:800;letter-spacing:.08em;text-transform:uppercase}.absolute-voice-routing-status__label{font-size:24px;line-height:1}.absolute-voice-routing-status__description{color:#514733;margin:12px 0 0}.absolute-voice-routing-status__grid{display:grid;gap:8px;grid-template-columns:repeat(2,minmax(0,1fr));margin-top:14px}.absolute-voice-routing-status__grid div{background:#fff;border:1px solid #eee4d2;border-radius:14px;padding:10px 12px}.absolute-voice-routing-status__grid span{color:#655944;display:block;font-size:12px;margin-bottom:4px}.absolute-voice-routing-status__grid strong{overflow-wrap:anywhere}.absolute-voice-routing-status__empty{color:#655944;margin:14px 0 0}.absolute-voice-routing-status__error{color:#9f1239;font-weight:700}`;
|
|
1107
|
+
var mountVoiceRoutingStatus = (element, path = "/api/routing/latest", options = {}) => {
|
|
1108
|
+
const store = createVoiceRoutingStatusStore(path, options);
|
|
1109
|
+
const render = () => {
|
|
1110
|
+
element.innerHTML = renderVoiceRoutingStatusHTML(store.getSnapshot(), options);
|
|
1111
|
+
};
|
|
1112
|
+
const unsubscribe = store.subscribe(render);
|
|
1113
|
+
render();
|
|
1114
|
+
store.refresh().catch(() => {});
|
|
1115
|
+
return {
|
|
1116
|
+
close: () => {
|
|
1117
|
+
unsubscribe();
|
|
1118
|
+
store.close();
|
|
1119
|
+
},
|
|
1120
|
+
refresh: store.refresh
|
|
1121
|
+
};
|
|
1122
|
+
};
|
|
1123
|
+
var defineVoiceRoutingStatusElement = (tagName = "absolute-voice-routing-status") => {
|
|
1124
|
+
if (typeof window === "undefined" || typeof customElements === "undefined" || customElements.get(tagName)) {
|
|
1125
|
+
return;
|
|
1126
|
+
}
|
|
1127
|
+
customElements.define(tagName, class AbsoluteVoiceRoutingStatusElement extends HTMLElement {
|
|
1128
|
+
mounted;
|
|
1129
|
+
connectedCallback() {
|
|
1130
|
+
const intervalMs = Number(this.getAttribute("interval-ms") ?? 5000);
|
|
1131
|
+
this.mounted = mountVoiceRoutingStatus(this, this.getAttribute("path") ?? "/api/routing/latest", {
|
|
1132
|
+
description: this.getAttribute("description") ?? undefined,
|
|
1133
|
+
intervalMs: Number.isFinite(intervalMs) ? intervalMs : 5000,
|
|
1134
|
+
title: this.getAttribute("title") ?? undefined
|
|
1135
|
+
});
|
|
1136
|
+
}
|
|
1137
|
+
disconnectedCallback() {
|
|
1138
|
+
this.mounted?.close();
|
|
1139
|
+
this.mounted = undefined;
|
|
1140
|
+
}
|
|
1141
|
+
});
|
|
1142
|
+
};
|
|
1143
|
+
|
|
1144
|
+
// src/vue/useVoiceRoutingStatus.ts
|
|
1145
|
+
import { onUnmounted as onUnmounted4, ref as ref4, shallowRef as shallowRef3 } from "vue";
|
|
1146
|
+
var useVoiceRoutingStatus = (path = "/api/routing/latest", options = {}) => {
|
|
1147
|
+
const store = createVoiceRoutingStatusStore(path, options);
|
|
1148
|
+
const decision = shallowRef3(null);
|
|
1149
|
+
const error = ref4(null);
|
|
1150
|
+
const isLoading = ref4(false);
|
|
1151
|
+
const updatedAt = ref4(undefined);
|
|
1152
|
+
const sync = () => {
|
|
1153
|
+
const snapshot = store.getSnapshot();
|
|
1154
|
+
decision.value = snapshot.decision;
|
|
1155
|
+
error.value = snapshot.error;
|
|
1156
|
+
isLoading.value = snapshot.isLoading;
|
|
1157
|
+
updatedAt.value = snapshot.updatedAt;
|
|
1158
|
+
};
|
|
1159
|
+
const unsubscribe = store.subscribe(sync);
|
|
1160
|
+
sync();
|
|
1161
|
+
store.refresh().catch(() => {});
|
|
1162
|
+
onUnmounted4(() => {
|
|
1163
|
+
unsubscribe();
|
|
1164
|
+
store.close();
|
|
1165
|
+
});
|
|
1166
|
+
return {
|
|
1167
|
+
decision,
|
|
1168
|
+
error,
|
|
1169
|
+
isLoading,
|
|
1170
|
+
refresh: store.refresh,
|
|
1171
|
+
updatedAt
|
|
1172
|
+
};
|
|
1173
|
+
};
|
|
1174
|
+
|
|
1175
|
+
// src/vue/VoiceRoutingStatus.ts
|
|
1176
|
+
var VoiceRoutingStatus = defineComponent4({
|
|
1177
|
+
name: "VoiceRoutingStatus",
|
|
1178
|
+
props: {
|
|
1179
|
+
class: {
|
|
1180
|
+
default: "",
|
|
1181
|
+
type: String
|
|
1182
|
+
},
|
|
1183
|
+
description: {
|
|
1184
|
+
default: undefined,
|
|
1185
|
+
type: String
|
|
1186
|
+
},
|
|
1187
|
+
intervalMs: {
|
|
1188
|
+
default: 5000,
|
|
1189
|
+
type: Number
|
|
1190
|
+
},
|
|
1191
|
+
path: {
|
|
1192
|
+
default: "/api/routing/latest",
|
|
1193
|
+
type: String
|
|
1194
|
+
},
|
|
1195
|
+
title: {
|
|
1196
|
+
default: undefined,
|
|
1197
|
+
type: String
|
|
1198
|
+
}
|
|
1199
|
+
},
|
|
1200
|
+
setup(props) {
|
|
1201
|
+
const options = {
|
|
1202
|
+
description: props.description,
|
|
1203
|
+
intervalMs: props.intervalMs,
|
|
1204
|
+
title: props.title
|
|
1205
|
+
};
|
|
1206
|
+
const status = useVoiceRoutingStatus(props.path, options);
|
|
1207
|
+
const model = computed3(() => createVoiceRoutingStatusViewModel({
|
|
1208
|
+
decision: status.decision.value,
|
|
1209
|
+
error: status.error.value,
|
|
1210
|
+
isLoading: status.isLoading.value,
|
|
1211
|
+
updatedAt: status.updatedAt.value
|
|
1212
|
+
}, options));
|
|
1213
|
+
return () => h4("section", {
|
|
1214
|
+
class: [
|
|
1215
|
+
"absolute-voice-routing-status",
|
|
1216
|
+
`absolute-voice-routing-status--${model.value.status}`,
|
|
1217
|
+
props.class
|
|
1218
|
+
]
|
|
1219
|
+
}, [
|
|
1220
|
+
h4("header", { class: "absolute-voice-routing-status__header" }, [
|
|
1221
|
+
h4("span", { class: "absolute-voice-routing-status__eyebrow" }, model.value.title),
|
|
1222
|
+
h4("strong", { class: "absolute-voice-routing-status__label" }, model.value.label)
|
|
1223
|
+
]),
|
|
1224
|
+
h4("p", { class: "absolute-voice-routing-status__description" }, model.value.description),
|
|
1225
|
+
model.value.rows.length ? h4("div", { class: "absolute-voice-routing-status__grid" }, model.value.rows.map((row) => h4("div", { key: row.label }, [
|
|
1226
|
+
h4("span", row.label),
|
|
1227
|
+
h4("strong", row.value)
|
|
1228
|
+
]))) : h4("p", { class: "absolute-voice-routing-status__empty" }, "Start a voice session to see the selected provider."),
|
|
1229
|
+
model.value.error ? h4("p", { class: "absolute-voice-routing-status__error" }, model.value.error) : null
|
|
1230
|
+
]);
|
|
1231
|
+
}
|
|
1232
|
+
});
|
|
1233
|
+
// src/vue/useVoiceStream.ts
|
|
1234
|
+
import { onUnmounted as onUnmounted5, ref as ref5, shallowRef as shallowRef4 } from "vue";
|
|
74
1235
|
|
|
75
1236
|
// src/client/actions.ts
|
|
76
1237
|
var normalizeErrorMessage = (value) => {
|
|
@@ -120,6 +1281,12 @@ var serverMessageToAction = (message) => {
|
|
|
120
1281
|
sessionId: message.sessionId,
|
|
121
1282
|
type: "complete"
|
|
122
1283
|
};
|
|
1284
|
+
case "call_lifecycle":
|
|
1285
|
+
return {
|
|
1286
|
+
event: message.event,
|
|
1287
|
+
sessionId: message.sessionId,
|
|
1288
|
+
type: "call_lifecycle"
|
|
1289
|
+
};
|
|
123
1290
|
case "error":
|
|
124
1291
|
return {
|
|
125
1292
|
message: normalizeErrorMessage(message.message),
|
|
@@ -163,7 +1330,7 @@ var DEFAULT_SCENARIO_QUERY_PARAM = "scenarioId";
|
|
|
163
1330
|
var noop = () => {};
|
|
164
1331
|
var noopUnsubscribe = () => noop;
|
|
165
1332
|
var NOOP_CONNECTION = {
|
|
166
|
-
|
|
1333
|
+
callControl: noop,
|
|
167
1334
|
close: noop,
|
|
168
1335
|
endTurn: noop,
|
|
169
1336
|
getReadyState: () => WS_CLOSED,
|
|
@@ -171,6 +1338,7 @@ var NOOP_CONNECTION = {
|
|
|
171
1338
|
getSessionId: () => "",
|
|
172
1339
|
send: noop,
|
|
173
1340
|
sendAudio: noop,
|
|
1341
|
+
start: () => {},
|
|
174
1342
|
subscribe: noopUnsubscribe
|
|
175
1343
|
};
|
|
176
1344
|
var createSessionId = () => crypto.randomUUID();
|
|
@@ -192,6 +1360,7 @@ var isVoiceServerMessage = (value) => {
|
|
|
192
1360
|
switch (value.type) {
|
|
193
1361
|
case "audio":
|
|
194
1362
|
case "assistant":
|
|
1363
|
+
case "call_lifecycle":
|
|
195
1364
|
case "complete":
|
|
196
1365
|
case "error":
|
|
197
1366
|
case "final":
|
|
@@ -332,6 +1501,12 @@ var createVoiceConnection = (path, options = {}) => {
|
|
|
332
1501
|
const endTurn = () => {
|
|
333
1502
|
send({ type: "end_turn" });
|
|
334
1503
|
};
|
|
1504
|
+
const callControl = (message) => {
|
|
1505
|
+
send({
|
|
1506
|
+
...message,
|
|
1507
|
+
type: "call_control"
|
|
1508
|
+
});
|
|
1509
|
+
};
|
|
335
1510
|
const close = () => {
|
|
336
1511
|
clearTimers();
|
|
337
1512
|
if (state.ws) {
|
|
@@ -349,7 +1524,7 @@ var createVoiceConnection = (path, options = {}) => {
|
|
|
349
1524
|
};
|
|
350
1525
|
connect();
|
|
351
1526
|
return {
|
|
352
|
-
|
|
1527
|
+
callControl,
|
|
353
1528
|
close,
|
|
354
1529
|
endTurn,
|
|
355
1530
|
getReadyState: () => state.ws?.readyState ?? WS_CLOSED,
|
|
@@ -357,6 +1532,7 @@ var createVoiceConnection = (path, options = {}) => {
|
|
|
357
1532
|
getSessionId: () => state.sessionId,
|
|
358
1533
|
send,
|
|
359
1534
|
sendAudio,
|
|
1535
|
+
start,
|
|
360
1536
|
subscribe
|
|
361
1537
|
};
|
|
362
1538
|
};
|
|
@@ -365,6 +1541,7 @@ var createVoiceConnection = (path, options = {}) => {
|
|
|
365
1541
|
var createInitialState = () => ({
|
|
366
1542
|
assistantAudio: [],
|
|
367
1543
|
assistantTexts: [],
|
|
1544
|
+
call: null,
|
|
368
1545
|
error: null,
|
|
369
1546
|
isConnected: false,
|
|
370
1547
|
scenarioId: null,
|
|
@@ -408,6 +1585,20 @@ var createVoiceStreamStore = () => {
|
|
|
408
1585
|
status: "completed"
|
|
409
1586
|
};
|
|
410
1587
|
break;
|
|
1588
|
+
case "call_lifecycle":
|
|
1589
|
+
state = {
|
|
1590
|
+
...state,
|
|
1591
|
+
call: {
|
|
1592
|
+
...state.call,
|
|
1593
|
+
disposition: action.event.type === "end" ? action.event.disposition : state.call?.disposition,
|
|
1594
|
+
endedAt: action.event.type === "end" ? action.event.at : state.call?.endedAt,
|
|
1595
|
+
events: [...state.call?.events ?? [], action.event],
|
|
1596
|
+
lastEventAt: action.event.at,
|
|
1597
|
+
startedAt: state.call?.startedAt ?? action.event.at
|
|
1598
|
+
},
|
|
1599
|
+
sessionId: action.sessionId
|
|
1600
|
+
};
|
|
1601
|
+
break;
|
|
411
1602
|
case "connected":
|
|
412
1603
|
state = {
|
|
413
1604
|
...state,
|
|
@@ -494,6 +1685,9 @@ var createVoiceStream = (path, options = {}) => {
|
|
|
494
1685
|
}
|
|
495
1686
|
});
|
|
496
1687
|
return {
|
|
1688
|
+
callControl(message) {
|
|
1689
|
+
connection.callControl(message);
|
|
1690
|
+
},
|
|
497
1691
|
close() {
|
|
498
1692
|
unsubscribeConnection();
|
|
499
1693
|
connection.close();
|
|
@@ -537,6 +1731,9 @@ var createVoiceStream = (path, options = {}) => {
|
|
|
537
1731
|
get assistantAudio() {
|
|
538
1732
|
return store.getSnapshot().assistantAudio;
|
|
539
1733
|
},
|
|
1734
|
+
get call() {
|
|
1735
|
+
return store.getSnapshot().call;
|
|
1736
|
+
},
|
|
540
1737
|
sendAudio(audio) {
|
|
541
1738
|
connection.sendAudio(audio);
|
|
542
1739
|
},
|
|
@@ -552,17 +1749,19 @@ var createVoiceStream = (path, options = {}) => {
|
|
|
552
1749
|
// src/vue/useVoiceStream.ts
|
|
553
1750
|
var useVoiceStream = (path, options = {}) => {
|
|
554
1751
|
const stream = createVoiceStream(path, options);
|
|
555
|
-
const assistantAudio =
|
|
556
|
-
const assistantTexts =
|
|
557
|
-
const
|
|
558
|
-
const
|
|
559
|
-
const
|
|
560
|
-
const
|
|
561
|
-
const
|
|
562
|
-
const
|
|
1752
|
+
const assistantAudio = shallowRef4([]);
|
|
1753
|
+
const assistantTexts = shallowRef4([]);
|
|
1754
|
+
const call = shallowRef4(null);
|
|
1755
|
+
const error = ref5(null);
|
|
1756
|
+
const isConnected = ref5(false);
|
|
1757
|
+
const partial = ref5("");
|
|
1758
|
+
const sessionId = ref5(stream.sessionId);
|
|
1759
|
+
const status = ref5(stream.status);
|
|
1760
|
+
const turns = shallowRef4([]);
|
|
563
1761
|
const sync = () => {
|
|
564
1762
|
assistantAudio.value = [...stream.assistantAudio];
|
|
565
1763
|
assistantTexts.value = [...stream.assistantTexts];
|
|
1764
|
+
call.value = stream.call;
|
|
566
1765
|
error.value = stream.error;
|
|
567
1766
|
isConnected.value = stream.isConnected;
|
|
568
1767
|
partial.value = stream.partial;
|
|
@@ -576,10 +1775,12 @@ var useVoiceStream = (path, options = {}) => {
|
|
|
576
1775
|
unsubscribe();
|
|
577
1776
|
stream.close();
|
|
578
1777
|
};
|
|
579
|
-
|
|
1778
|
+
onUnmounted5(destroy);
|
|
580
1779
|
return {
|
|
581
1780
|
assistantAudio,
|
|
582
1781
|
assistantTexts,
|
|
1782
|
+
call,
|
|
1783
|
+
callControl: (message) => stream.callControl(message),
|
|
583
1784
|
close: () => destroy(),
|
|
584
1785
|
endTurn: () => stream.endTurn(),
|
|
585
1786
|
error,
|
|
@@ -592,7 +1793,7 @@ var useVoiceStream = (path, options = {}) => {
|
|
|
592
1793
|
};
|
|
593
1794
|
};
|
|
594
1795
|
// src/vue/useVoiceController.ts
|
|
595
|
-
import { onUnmounted as
|
|
1796
|
+
import { onUnmounted as onUnmounted6, ref as ref6, shallowRef as shallowRef5 } from "vue";
|
|
596
1797
|
|
|
597
1798
|
// src/client/htmx.ts
|
|
598
1799
|
var DEFAULT_EVENT_NAME = "voice-refresh";
|
|
@@ -1056,6 +2257,7 @@ var resolveVoiceRuntimePreset = (name = "default") => {
|
|
|
1056
2257
|
var createInitialState2 = (stream) => ({
|
|
1057
2258
|
assistantAudio: [...stream.assistantAudio],
|
|
1058
2259
|
assistantTexts: [...stream.assistantTexts],
|
|
2260
|
+
call: stream.call,
|
|
1059
2261
|
error: stream.error,
|
|
1060
2262
|
isConnected: stream.isConnected,
|
|
1061
2263
|
isRecording: false,
|
|
@@ -1085,6 +2287,7 @@ var createVoiceController = (path, options = {}) => {
|
|
|
1085
2287
|
...state,
|
|
1086
2288
|
assistantAudio: [...stream.assistantAudio],
|
|
1087
2289
|
assistantTexts: [...stream.assistantTexts],
|
|
2290
|
+
call: stream.call,
|
|
1088
2291
|
error: stream.error,
|
|
1089
2292
|
isConnected: stream.isConnected,
|
|
1090
2293
|
partial: stream.partial,
|
|
@@ -1162,6 +2365,7 @@ var createVoiceController = (path, options = {}) => {
|
|
|
1162
2365
|
bindHTMX(bindingOptions) {
|
|
1163
2366
|
return bindVoiceHTMX(stream, bindingOptions);
|
|
1164
2367
|
},
|
|
2368
|
+
callControl: (message) => stream.callControl(message),
|
|
1165
2369
|
close,
|
|
1166
2370
|
endTurn: () => stream.endTurn(),
|
|
1167
2371
|
get error() {
|
|
@@ -1214,6 +2418,9 @@ var createVoiceController = (path, options = {}) => {
|
|
|
1214
2418
|
},
|
|
1215
2419
|
get assistantAudio() {
|
|
1216
2420
|
return state.assistantAudio;
|
|
2421
|
+
},
|
|
2422
|
+
get call() {
|
|
2423
|
+
return state.call;
|
|
1217
2424
|
}
|
|
1218
2425
|
};
|
|
1219
2426
|
};
|
|
@@ -1221,16 +2428,16 @@ var createVoiceController = (path, options = {}) => {
|
|
|
1221
2428
|
// src/vue/useVoiceController.ts
|
|
1222
2429
|
var useVoiceController = (path, options = {}) => {
|
|
1223
2430
|
const controller = createVoiceController(path, options);
|
|
1224
|
-
const assistantAudio =
|
|
1225
|
-
const assistantTexts =
|
|
1226
|
-
const error =
|
|
1227
|
-
const isConnected =
|
|
1228
|
-
const isRecording =
|
|
1229
|
-
const partial =
|
|
1230
|
-
const recordingError =
|
|
1231
|
-
const sessionId =
|
|
1232
|
-
const status =
|
|
1233
|
-
const turns =
|
|
2431
|
+
const assistantAudio = shallowRef5([]);
|
|
2432
|
+
const assistantTexts = shallowRef5([]);
|
|
2433
|
+
const error = ref6(null);
|
|
2434
|
+
const isConnected = ref6(false);
|
|
2435
|
+
const isRecording = ref6(false);
|
|
2436
|
+
const partial = ref6("");
|
|
2437
|
+
const recordingError = ref6(null);
|
|
2438
|
+
const sessionId = ref6(controller.sessionId);
|
|
2439
|
+
const status = ref6(controller.status);
|
|
2440
|
+
const turns = shallowRef5([]);
|
|
1234
2441
|
const sync = () => {
|
|
1235
2442
|
assistantAudio.value = [...controller.assistantAudio];
|
|
1236
2443
|
assistantTexts.value = [...controller.assistantTexts];
|
|
@@ -1249,7 +2456,7 @@ var useVoiceController = (path, options = {}) => {
|
|
|
1249
2456
|
unsubscribe();
|
|
1250
2457
|
controller.close();
|
|
1251
2458
|
};
|
|
1252
|
-
|
|
2459
|
+
onUnmounted6(destroy);
|
|
1253
2460
|
return {
|
|
1254
2461
|
assistantAudio,
|
|
1255
2462
|
assistantTexts,
|
|
@@ -1270,7 +2477,129 @@ var useVoiceController = (path, options = {}) => {
|
|
|
1270
2477
|
turns
|
|
1271
2478
|
};
|
|
1272
2479
|
};
|
|
2480
|
+
// src/vue/useVoiceWorkflowStatus.ts
|
|
2481
|
+
import { onUnmounted as onUnmounted7, ref as ref7, shallowRef as shallowRef6 } from "vue";
|
|
2482
|
+
|
|
2483
|
+
// src/client/workflowStatus.ts
|
|
2484
|
+
var fetchVoiceWorkflowStatus = async (path = "/evals/scenarios/json", options = {}) => {
|
|
2485
|
+
const fetchImpl = options.fetch ?? globalThis.fetch;
|
|
2486
|
+
const response = await fetchImpl(path);
|
|
2487
|
+
if (!response.ok) {
|
|
2488
|
+
throw new Error(`Voice workflow status failed: HTTP ${response.status}`);
|
|
2489
|
+
}
|
|
2490
|
+
return await response.json();
|
|
2491
|
+
};
|
|
2492
|
+
var createVoiceWorkflowStatusStore = (path = "/evals/scenarios/json", options = {}) => {
|
|
2493
|
+
const listeners = new Set;
|
|
2494
|
+
let closed = false;
|
|
2495
|
+
let timer;
|
|
2496
|
+
let snapshot = {
|
|
2497
|
+
error: null,
|
|
2498
|
+
isLoading: false
|
|
2499
|
+
};
|
|
2500
|
+
const emit = () => {
|
|
2501
|
+
for (const listener of listeners) {
|
|
2502
|
+
listener();
|
|
2503
|
+
}
|
|
2504
|
+
};
|
|
2505
|
+
const refresh = async () => {
|
|
2506
|
+
if (closed) {
|
|
2507
|
+
return snapshot.report;
|
|
2508
|
+
}
|
|
2509
|
+
snapshot = {
|
|
2510
|
+
...snapshot,
|
|
2511
|
+
error: null,
|
|
2512
|
+
isLoading: true
|
|
2513
|
+
};
|
|
2514
|
+
emit();
|
|
2515
|
+
try {
|
|
2516
|
+
const report = await fetchVoiceWorkflowStatus(path, options);
|
|
2517
|
+
snapshot = {
|
|
2518
|
+
error: null,
|
|
2519
|
+
isLoading: false,
|
|
2520
|
+
report,
|
|
2521
|
+
updatedAt: Date.now()
|
|
2522
|
+
};
|
|
2523
|
+
emit();
|
|
2524
|
+
return report;
|
|
2525
|
+
} catch (error) {
|
|
2526
|
+
snapshot = {
|
|
2527
|
+
...snapshot,
|
|
2528
|
+
error: error instanceof Error ? error.message : String(error),
|
|
2529
|
+
isLoading: false
|
|
2530
|
+
};
|
|
2531
|
+
emit();
|
|
2532
|
+
throw error;
|
|
2533
|
+
}
|
|
2534
|
+
};
|
|
2535
|
+
const close = () => {
|
|
2536
|
+
closed = true;
|
|
2537
|
+
if (timer) {
|
|
2538
|
+
clearInterval(timer);
|
|
2539
|
+
timer = undefined;
|
|
2540
|
+
}
|
|
2541
|
+
listeners.clear();
|
|
2542
|
+
};
|
|
2543
|
+
if (typeof window !== "undefined" && options.intervalMs && options.intervalMs > 0) {
|
|
2544
|
+
timer = setInterval(() => {
|
|
2545
|
+
refresh().catch(() => {});
|
|
2546
|
+
}, options.intervalMs);
|
|
2547
|
+
}
|
|
2548
|
+
return {
|
|
2549
|
+
close,
|
|
2550
|
+
getServerSnapshot: () => snapshot,
|
|
2551
|
+
getSnapshot: () => snapshot,
|
|
2552
|
+
refresh,
|
|
2553
|
+
subscribe: (listener) => {
|
|
2554
|
+
listeners.add(listener);
|
|
2555
|
+
return () => {
|
|
2556
|
+
listeners.delete(listener);
|
|
2557
|
+
};
|
|
2558
|
+
}
|
|
2559
|
+
};
|
|
2560
|
+
};
|
|
2561
|
+
|
|
2562
|
+
// src/vue/useVoiceWorkflowStatus.ts
|
|
2563
|
+
var useVoiceWorkflowStatus = (path = "/evals/scenarios/json", options = {}) => {
|
|
2564
|
+
const store = createVoiceWorkflowStatusStore(path, options);
|
|
2565
|
+
const error = ref7(null);
|
|
2566
|
+
const isLoading = ref7(false);
|
|
2567
|
+
const report = shallowRef6(undefined);
|
|
2568
|
+
const updatedAt = ref7(undefined);
|
|
2569
|
+
const sync = () => {
|
|
2570
|
+
const snapshot = store.getSnapshot();
|
|
2571
|
+
error.value = snapshot.error;
|
|
2572
|
+
isLoading.value = snapshot.isLoading;
|
|
2573
|
+
report.value = snapshot.report;
|
|
2574
|
+
updatedAt.value = snapshot.updatedAt;
|
|
2575
|
+
};
|
|
2576
|
+
const unsubscribe = store.subscribe(sync);
|
|
2577
|
+
sync();
|
|
2578
|
+
if (typeof window !== "undefined") {
|
|
2579
|
+
store.refresh().catch(() => {});
|
|
2580
|
+
}
|
|
2581
|
+
onUnmounted7(() => {
|
|
2582
|
+
unsubscribe();
|
|
2583
|
+
store.close();
|
|
2584
|
+
});
|
|
2585
|
+
return {
|
|
2586
|
+
error,
|
|
2587
|
+
isLoading,
|
|
2588
|
+
refresh: store.refresh,
|
|
2589
|
+
report,
|
|
2590
|
+
updatedAt
|
|
2591
|
+
};
|
|
2592
|
+
};
|
|
1273
2593
|
export {
|
|
2594
|
+
useVoiceWorkflowStatus,
|
|
1274
2595
|
useVoiceStream,
|
|
1275
|
-
|
|
2596
|
+
useVoiceRoutingStatus,
|
|
2597
|
+
useVoiceProviderStatus,
|
|
2598
|
+
useVoiceProviderSimulationControls,
|
|
2599
|
+
useVoiceController,
|
|
2600
|
+
useVoiceAppKitStatus,
|
|
2601
|
+
VoiceRoutingStatus,
|
|
2602
|
+
VoiceProviderStatus,
|
|
2603
|
+
VoiceProviderSimulationControls,
|
|
2604
|
+
VoiceOpsStatus
|
|
1276
2605
|
};
|