@absolutejs/voice 0.0.22-beta.504 → 0.0.22-beta.506
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/dist/angular/index.d.ts +2 -0
- package/dist/angular/index.js +463 -277
- package/dist/angular/voice-call-player.service.d.ts +19 -0
- package/dist/assistantExperiment.d.ts +41 -0
- package/dist/client/callPlayer.d.ts +41 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +398 -2
- package/dist/phoneProvisioning.d.ts +29 -0
- package/dist/react/VoiceCallPlayer.d.ts +11 -0
- package/dist/react/index.d.ts +2 -0
- package/dist/react/index.js +433 -55
- package/dist/svelte/createVoiceCallPlayer.d.ts +33 -0
- package/dist/svelte/index.d.ts +2 -0
- package/dist/svelte/index.js +379 -190
- package/dist/vue/VoiceCallPlayer.d.ts +40 -0
- package/dist/vue/index.d.ts +1 -0
- package/dist/vue/index.js +412 -69
- package/dist/webhookFanout.d.ts +48 -0
- package/package.json +1 -1
package/dist/svelte/index.js
CHANGED
|
@@ -190,6 +190,193 @@ var createVoiceCampaignDialerProofStore = (path = "/api/voice/campaigns/dialer-p
|
|
|
190
190
|
|
|
191
191
|
// src/svelte/createVoiceCampaignDialerProof.ts
|
|
192
192
|
var createVoiceCampaignDialerProof = (path = "/api/voice/campaigns/dialer-proof", options = {}) => createVoiceCampaignDialerProofStore(path, options);
|
|
193
|
+
// src/client/callPlayer.ts
|
|
194
|
+
var cloneState = (state) => ({
|
|
195
|
+
...state
|
|
196
|
+
});
|
|
197
|
+
var normalizeTranscriptTimes = (transcripts, baseEpoch) => {
|
|
198
|
+
if (typeof baseEpoch !== "number") {
|
|
199
|
+
return transcripts;
|
|
200
|
+
}
|
|
201
|
+
return transcripts.map((transcript) => {
|
|
202
|
+
const adjusted = { ...transcript };
|
|
203
|
+
if (typeof adjusted.startedAtMs === "number" && adjusted.startedAtMs >= baseEpoch) {
|
|
204
|
+
adjusted.startedAtMs = adjusted.startedAtMs - baseEpoch;
|
|
205
|
+
}
|
|
206
|
+
if (typeof adjusted.endedAtMs === "number" && adjusted.endedAtMs >= baseEpoch) {
|
|
207
|
+
adjusted.endedAtMs = adjusted.endedAtMs - baseEpoch;
|
|
208
|
+
}
|
|
209
|
+
return adjusted;
|
|
210
|
+
});
|
|
211
|
+
};
|
|
212
|
+
var findActiveTranscript = (transcripts, positionMs) => {
|
|
213
|
+
let candidate;
|
|
214
|
+
for (let index = 0;index < transcripts.length; index += 1) {
|
|
215
|
+
const transcript = transcripts[index];
|
|
216
|
+
if (typeof transcript.startedAtMs !== "number")
|
|
217
|
+
continue;
|
|
218
|
+
if (transcript.startedAtMs > positionMs)
|
|
219
|
+
break;
|
|
220
|
+
if (typeof transcript.endedAtMs === "number" && transcript.endedAtMs < positionMs) {
|
|
221
|
+
continue;
|
|
222
|
+
}
|
|
223
|
+
candidate = { id: transcript.id, index };
|
|
224
|
+
}
|
|
225
|
+
return candidate ?? {};
|
|
226
|
+
};
|
|
227
|
+
var createVoiceCallPlayer = (options = {}) => {
|
|
228
|
+
let transcripts = normalizeTranscriptTimes(options.transcripts ?? [], options.recordingStartedAtEpochMs);
|
|
229
|
+
let state = {
|
|
230
|
+
audioUrl: options.audioUrl,
|
|
231
|
+
buffered: 0,
|
|
232
|
+
currentTimeMs: 0,
|
|
233
|
+
durationMs: 0,
|
|
234
|
+
isPlaying: false,
|
|
235
|
+
isReady: false,
|
|
236
|
+
playbackRate: options.initialPlaybackRate ?? 1
|
|
237
|
+
};
|
|
238
|
+
const listeners = new Set;
|
|
239
|
+
const notify = () => {
|
|
240
|
+
for (const listener of listeners)
|
|
241
|
+
listener();
|
|
242
|
+
};
|
|
243
|
+
const update = (next) => {
|
|
244
|
+
state = { ...state, ...next };
|
|
245
|
+
notify();
|
|
246
|
+
};
|
|
247
|
+
const refreshActive = () => {
|
|
248
|
+
const { id, index } = findActiveTranscript(transcripts, state.currentTimeMs);
|
|
249
|
+
if (id !== state.activeTranscriptId || index !== state.activeTranscriptIndex) {
|
|
250
|
+
state = {
|
|
251
|
+
...state,
|
|
252
|
+
activeTranscriptId: id,
|
|
253
|
+
activeTranscriptIndex: index
|
|
254
|
+
};
|
|
255
|
+
notify();
|
|
256
|
+
}
|
|
257
|
+
};
|
|
258
|
+
return {
|
|
259
|
+
getState: () => cloneState(state),
|
|
260
|
+
pause: () => {
|
|
261
|
+
if (!state.isPlaying)
|
|
262
|
+
return;
|
|
263
|
+
update({ isPlaying: false });
|
|
264
|
+
},
|
|
265
|
+
play: async () => {
|
|
266
|
+
update({ isPlaying: true });
|
|
267
|
+
},
|
|
268
|
+
reset: () => {
|
|
269
|
+
state = {
|
|
270
|
+
audioUrl: state.audioUrl,
|
|
271
|
+
buffered: 0,
|
|
272
|
+
currentTimeMs: 0,
|
|
273
|
+
durationMs: 0,
|
|
274
|
+
isPlaying: false,
|
|
275
|
+
isReady: false,
|
|
276
|
+
playbackRate: 1
|
|
277
|
+
};
|
|
278
|
+
notify();
|
|
279
|
+
},
|
|
280
|
+
seekMs: (positionMs) => {
|
|
281
|
+
const clamped = Math.max(0, Math.min(state.durationMs || Number.POSITIVE_INFINITY, positionMs));
|
|
282
|
+
update({ currentTimeMs: clamped });
|
|
283
|
+
refreshActive();
|
|
284
|
+
},
|
|
285
|
+
seekToTranscript: (transcriptId) => {
|
|
286
|
+
const found = transcripts.find((t) => t.id === transcriptId);
|
|
287
|
+
if (!found || typeof found.startedAtMs !== "number") {
|
|
288
|
+
return;
|
|
289
|
+
}
|
|
290
|
+
update({ currentTimeMs: Math.max(0, found.startedAtMs) });
|
|
291
|
+
refreshActive();
|
|
292
|
+
},
|
|
293
|
+
setAudioUrl: (url) => {
|
|
294
|
+
update({ audioUrl: url, isReady: false });
|
|
295
|
+
},
|
|
296
|
+
setBuffered: (seconds) => {
|
|
297
|
+
update({ buffered: Math.max(0, seconds) });
|
|
298
|
+
},
|
|
299
|
+
setDuration: (durationMs) => {
|
|
300
|
+
update({ durationMs: Math.max(0, durationMs) });
|
|
301
|
+
},
|
|
302
|
+
setError: (error) => {
|
|
303
|
+
update({ error });
|
|
304
|
+
},
|
|
305
|
+
setPlaybackRate: (rate) => {
|
|
306
|
+
update({ playbackRate: Math.max(0.25, Math.min(4, rate)) });
|
|
307
|
+
},
|
|
308
|
+
setPlaying: (playing) => {
|
|
309
|
+
if (playing === state.isPlaying)
|
|
310
|
+
return;
|
|
311
|
+
update({ isPlaying: playing });
|
|
312
|
+
},
|
|
313
|
+
setReady: (ready) => {
|
|
314
|
+
update({ isReady: ready });
|
|
315
|
+
},
|
|
316
|
+
setTime: (positionMs) => {
|
|
317
|
+
const next = Math.max(0, positionMs);
|
|
318
|
+
if (next === state.currentTimeMs)
|
|
319
|
+
return;
|
|
320
|
+
update({ currentTimeMs: next });
|
|
321
|
+
refreshActive();
|
|
322
|
+
},
|
|
323
|
+
setTranscripts: (next) => {
|
|
324
|
+
transcripts = normalizeTranscriptTimes(next, options.recordingStartedAtEpochMs);
|
|
325
|
+
refreshActive();
|
|
326
|
+
},
|
|
327
|
+
subscribe: (listener) => {
|
|
328
|
+
listeners.add(listener);
|
|
329
|
+
return () => {
|
|
330
|
+
listeners.delete(listener);
|
|
331
|
+
};
|
|
332
|
+
},
|
|
333
|
+
transcripts: () => transcripts
|
|
334
|
+
};
|
|
335
|
+
};
|
|
336
|
+
var formatVoiceCallPlayerTimestamp = (ms) => {
|
|
337
|
+
const seconds = Math.max(0, Math.floor(ms / 1000));
|
|
338
|
+
const minutes = Math.floor(seconds / 60);
|
|
339
|
+
const remaining = seconds % 60;
|
|
340
|
+
return `${String(minutes).padStart(2, "0")}:${String(remaining).padStart(2, "0")}`;
|
|
341
|
+
};
|
|
342
|
+
|
|
343
|
+
// src/svelte/createVoiceCallPlayer.ts
|
|
344
|
+
var escapeHtml = (text) => text.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
345
|
+
var renderVoiceCallPlayerHTML = (state, options = {}) => {
|
|
346
|
+
const title = options.title ?? "Call replay";
|
|
347
|
+
const transcripts = options.transcripts ?? [];
|
|
348
|
+
const items = transcripts.map((transcript) => `<li data-transcript-id="${escapeHtml(transcript.id)}" style="background:${transcript.id === state.activeTranscriptId ? "rgba(59,130,246,0.18)" : "transparent"};border-radius:8px;cursor:pointer;font-size:13px;padding:8px 12px;">
|
|
349
|
+
<div style="color:#cbd5e1;font-size:12px;">${formatVoiceCallPlayerTimestamp(transcript.startedAtMs ?? 0)}</div>
|
|
350
|
+
<div>${escapeHtml(transcript.text)}</div>
|
|
351
|
+
</li>`).join("");
|
|
352
|
+
return `<section aria-label="voice-call-player" class="absolute-voice-call-player" style="background:#0f172a;border-radius:16px;color:#f8fafc;font-family:ui-sans-serif,system-ui,sans-serif;padding:20px;">
|
|
353
|
+
<header style="align-items:center;display:flex;gap:12px;margin-bottom:12px;">
|
|
354
|
+
<strong style="font-size:16px;">${escapeHtml(title)}</strong>
|
|
355
|
+
<span style="font-size:13px;margin-left:auto;opacity:0.7;">${formatVoiceCallPlayerTimestamp(state.currentTimeMs)} / ${formatVoiceCallPlayerTimestamp(state.durationMs)}</span>
|
|
356
|
+
</header>
|
|
357
|
+
<audio src="${state.audioUrl ? escapeHtml(state.audioUrl) : ""}" preload="metadata" data-call-player-audio style="display:none;"></audio>
|
|
358
|
+
<div style="align-items:center;display:flex;gap:12px;margin-bottom:14px;">
|
|
359
|
+
<button type="button" data-action="${state.isPlaying ? "pause" : "play"}" style="background:#3b82f6;border:none;border-radius:12px;color:#f8fafc;cursor:pointer;font-size:14px;font-weight:500;padding:8px 14px;">${state.isPlaying ? "Pause" : "Play"}</button>
|
|
360
|
+
<input type="range" min="0" max="1" step="0.001" data-action="seek" value="${state.durationMs > 0 ? state.currentTimeMs / state.durationMs : 0}" style="flex:1;" />
|
|
361
|
+
</div>
|
|
362
|
+
<ol style="display:flex;flex-direction:column;gap:6px;list-style:none;margin:0;max-height:280px;overflow-y:auto;padding:0;">${items}</ol>
|
|
363
|
+
</section>`;
|
|
364
|
+
};
|
|
365
|
+
var createVoiceCallPlayer2 = (options = {}) => {
|
|
366
|
+
const player = createVoiceCallPlayer(options);
|
|
367
|
+
return {
|
|
368
|
+
...player,
|
|
369
|
+
getHTML: () => renderVoiceCallPlayerHTML(player.getState(), {
|
|
370
|
+
title: options.title,
|
|
371
|
+
transcripts: player.transcripts().map((t) => ({
|
|
372
|
+
id: t.id,
|
|
373
|
+
startedAtMs: t.startedAtMs,
|
|
374
|
+
text: t.text
|
|
375
|
+
}))
|
|
376
|
+
}),
|
|
377
|
+
title: options.title
|
|
378
|
+
};
|
|
379
|
+
};
|
|
193
380
|
// src/client/htmx.ts
|
|
194
381
|
var DEFAULT_EVENT_NAME = "voice-refresh";
|
|
195
382
|
var DEFAULT_QUERY_PARAM = "sessionId";
|
|
@@ -1688,7 +1875,7 @@ var createVoiceWidgetViewModel = (input) => {
|
|
|
1688
1875
|
title: input.title ?? "Voice"
|
|
1689
1876
|
};
|
|
1690
1877
|
};
|
|
1691
|
-
var
|
|
1878
|
+
var escapeHtml2 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
1692
1879
|
var resolveRadius = (radius) => typeof radius === "number" ? `${radius}px` : radius;
|
|
1693
1880
|
var renderVoiceWidgetHTML = (model) => {
|
|
1694
1881
|
const t = model.theme;
|
|
@@ -1696,23 +1883,23 @@ var renderVoiceWidgetHTML = (model) => {
|
|
|
1696
1883
|
const dotStyle = `background:${model.errorMessage ? t.errorAccent : model.agentState === "idle" ? "rgba(148,163,184,0.6)" : t.accent};border-radius:50%;height:10px;width:10px;`;
|
|
1697
1884
|
const buttons = [];
|
|
1698
1885
|
if (model.controls.canStart) {
|
|
1699
|
-
buttons.push(`<button type="button" data-action="start" style="background:${t.accent};border:none;border-radius:12px;color:${t.foreground};cursor:pointer;font-size:14px;font-weight:500;padding:10px 14px;">${
|
|
1886
|
+
buttons.push(`<button type="button" data-action="start" style="background:${t.accent};border:none;border-radius:12px;color:${t.foreground};cursor:pointer;font-size:14px;font-weight:500;padding:10px 14px;">${escapeHtml2(model.labels.startCall)}</button>`);
|
|
1700
1887
|
}
|
|
1701
1888
|
if (model.controls.canMute) {
|
|
1702
|
-
buttons.push(`<button type="button" data-action="mute" style="background:transparent;border:1px solid rgba(255,255,255,0.18);border-radius:12px;color:${t.foreground};cursor:pointer;font-size:14px;font-weight:500;padding:10px 14px;">${
|
|
1889
|
+
buttons.push(`<button type="button" data-action="mute" style="background:transparent;border:1px solid rgba(255,255,255,0.18);border-radius:12px;color:${t.foreground};cursor:pointer;font-size:14px;font-weight:500;padding:10px 14px;">${escapeHtml2(model.labels.mute)}</button>`);
|
|
1703
1890
|
}
|
|
1704
1891
|
if (model.controls.canEnd) {
|
|
1705
|
-
buttons.push(`<button type="button" data-action="end" style="background:${t.errorAccent};border:none;border-radius:12px;color:${t.foreground};cursor:pointer;font-size:14px;font-weight:500;padding:10px 14px;">${
|
|
1892
|
+
buttons.push(`<button type="button" data-action="end" style="background:${t.errorAccent};border:none;border-radius:12px;color:${t.foreground};cursor:pointer;font-size:14px;font-weight:500;padding:10px 14px;">${escapeHtml2(model.labels.endCall)}</button>`);
|
|
1706
1893
|
}
|
|
1707
|
-
return `<div role="region" aria-live="polite" data-agent-state="${model.agentState}" class="${
|
|
1894
|
+
return `<div role="region" aria-live="polite" data-agent-state="${model.agentState}" class="${escapeHtml2(model.classes.container)}" style="${containerStyle}">
|
|
1708
1895
|
<div style="align-items:center;display:flex;gap:10px;margin-bottom:12px;">
|
|
1709
|
-
<span aria-hidden="true" class="${
|
|
1710
|
-
<strong style="font-size:15px;">${
|
|
1711
|
-
<span style="font-size:13px;margin-left:auto;opacity:0.7;">${
|
|
1896
|
+
<span aria-hidden="true" class="${escapeHtml2(model.classes.dot)}" style="${dotStyle}"></span>
|
|
1897
|
+
<strong style="font-size:15px;">${escapeHtml2(model.title)}</strong>
|
|
1898
|
+
<span style="font-size:13px;margin-left:auto;opacity:0.7;">${escapeHtml2(model.statusLabel)}</span>
|
|
1712
1899
|
</div>
|
|
1713
|
-
${model.partial ? `<p style="font-size:13px;margin:8px 0 12px;opacity:0.85;word-break:break-word;">\u201C${
|
|
1900
|
+
${model.partial ? `<p style="font-size:13px;margin:8px 0 12px;opacity:0.85;word-break:break-word;">\u201C${escapeHtml2(model.partial)}\u201D</p>` : ""}
|
|
1714
1901
|
<div style="display:flex;gap:10px;">${buttons.join("")}</div>
|
|
1715
|
-
${model.errorMessage ? `<p style="color:${t.errorAccent};font-size:12px;margin-top:12px;">${
|
|
1902
|
+
${model.errorMessage ? `<p style="color:${t.errorAccent};font-size:12px;margin-top:12px;">${escapeHtml2(model.errorMessage)}</p>` : ""}
|
|
1716
1903
|
</div>`;
|
|
1717
1904
|
};
|
|
1718
1905
|
|
|
@@ -2247,7 +2434,7 @@ var createVoiceDeliveryRuntimeStore = (path = "/api/voice-delivery-runtime", opt
|
|
|
2247
2434
|
// src/client/deliveryRuntimeWidget.ts
|
|
2248
2435
|
var DEFAULT_TITLE = "Voice Delivery Runtime";
|
|
2249
2436
|
var DEFAULT_DESCRIPTION = "Audit and trace delivery worker health from your AbsoluteJS voice app.";
|
|
2250
|
-
var
|
|
2437
|
+
var escapeHtml3 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
2251
2438
|
var createSurface = (id, summary) => {
|
|
2252
2439
|
if (!summary) {
|
|
2253
2440
|
return {
|
|
@@ -2296,26 +2483,26 @@ var createVoiceDeliveryRuntimeViewModel = (snapshot, options = {}) => {
|
|
|
2296
2483
|
};
|
|
2297
2484
|
var renderVoiceDeliveryRuntimeHTML = (snapshot, options = {}) => {
|
|
2298
2485
|
const model = createVoiceDeliveryRuntimeViewModel(snapshot, options);
|
|
2299
|
-
const surfaces = model.surfaces.map((surface) => `<li class="absolute-voice-delivery-runtime__surface absolute-voice-delivery-runtime__surface--${
|
|
2300
|
-
<span>${
|
|
2301
|
-
<strong>${
|
|
2486
|
+
const surfaces = model.surfaces.map((surface) => `<li class="absolute-voice-delivery-runtime__surface absolute-voice-delivery-runtime__surface--${escapeHtml3(surface.status)}">
|
|
2487
|
+
<span>${escapeHtml3(surface.label)}</span>
|
|
2488
|
+
<strong>${escapeHtml3(surface.detail)}</strong>
|
|
2302
2489
|
<small>${String(surface.failed)} failed · ${String(surface.deadLettered)} dead-lettered</small>
|
|
2303
2490
|
</li>`).join("");
|
|
2304
2491
|
const actions = options.includeActions === false ? "" : `<div class="absolute-voice-delivery-runtime__actions">
|
|
2305
2492
|
<button type="button" data-absolute-voice-delivery-runtime-action="tick">${model.actionStatus === "running" ? "Working..." : "Tick workers"}</button>
|
|
2306
2493
|
<button type="button" data-absolute-voice-delivery-runtime-action="requeue-dead-letters"${model.surfaces.some((surface) => surface.deadLettered > 0) ? "" : " disabled"}>Requeue dead letters</button>
|
|
2307
2494
|
</div>`;
|
|
2308
|
-
const actionError = model.actionError ? `<p class="absolute-voice-delivery-runtime__error">${
|
|
2309
|
-
return `<section class="absolute-voice-delivery-runtime absolute-voice-delivery-runtime--${
|
|
2495
|
+
const actionError = model.actionError ? `<p class="absolute-voice-delivery-runtime__error">${escapeHtml3(model.actionError)}</p>` : "";
|
|
2496
|
+
return `<section class="absolute-voice-delivery-runtime absolute-voice-delivery-runtime--${escapeHtml3(model.status)}">
|
|
2310
2497
|
<header class="absolute-voice-delivery-runtime__header">
|
|
2311
|
-
<span class="absolute-voice-delivery-runtime__eyebrow">${
|
|
2312
|
-
<strong class="absolute-voice-delivery-runtime__label">${
|
|
2498
|
+
<span class="absolute-voice-delivery-runtime__eyebrow">${escapeHtml3(model.title)}</span>
|
|
2499
|
+
<strong class="absolute-voice-delivery-runtime__label">${escapeHtml3(model.label)}</strong>
|
|
2313
2500
|
</header>
|
|
2314
|
-
<p class="absolute-voice-delivery-runtime__description">${
|
|
2501
|
+
<p class="absolute-voice-delivery-runtime__description">${escapeHtml3(model.description)}</p>
|
|
2315
2502
|
<ul class="absolute-voice-delivery-runtime__surfaces">${surfaces}</ul>
|
|
2316
2503
|
${actions}
|
|
2317
2504
|
${actionError}
|
|
2318
|
-
${model.error ? `<p class="absolute-voice-delivery-runtime__error">${
|
|
2505
|
+
${model.error ? `<p class="absolute-voice-delivery-runtime__error">${escapeHtml3(model.error)}</p>` : ""}
|
|
2319
2506
|
</section>`;
|
|
2320
2507
|
};
|
|
2321
2508
|
var getVoiceDeliveryRuntimeCSS = () => `.absolute-voice-delivery-runtime{border:1px solid #c9d8cf;border-radius:20px;background:#f6fff9;color:#0d1b12;padding:18px;box-shadow:0 18px 40px rgba(19,55,35,.12);font-family:inherit}.absolute-voice-delivery-runtime--warn,.absolute-voice-delivery-runtime--error{border-color:#f2b56b;background:#fff9ed}.absolute-voice-delivery-runtime__header{align-items:start;display:flex;gap:12px;justify-content:space-between}.absolute-voice-delivery-runtime__eyebrow{color:#4e6b59;font-size:12px;font-weight:800;letter-spacing:.08em;text-transform:uppercase}.absolute-voice-delivery-runtime__label{font-size:28px;line-height:1}.absolute-voice-delivery-runtime__description{color:#33483b;margin:12px 0 0}.absolute-voice-delivery-runtime__surfaces{display:grid;gap:8px;list-style:none;margin:16px 0 0;padding:0}.absolute-voice-delivery-runtime__surface{background:#fff;border:1px solid #d9eadf;border-radius:14px;display:grid;gap:4px;padding:10px 12px}.absolute-voice-delivery-runtime__surface--warn{border-color:#f2b56b}.absolute-voice-delivery-runtime__surface--disabled{opacity:.72}.absolute-voice-delivery-runtime__surface span,.absolute-voice-delivery-runtime__surface small{color:#587063}.absolute-voice-delivery-runtime__actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:14px}.absolute-voice-delivery-runtime__actions button{background:#134e2d;border:0;border-radius:999px;color:#f6fff9;cursor:pointer;font:inherit;font-weight:800;padding:8px 12px}.absolute-voice-delivery-runtime__actions button:disabled{cursor:not-allowed;opacity:.48}.absolute-voice-delivery-runtime__error{color:#9f1239;font-weight:700}`;
|
|
@@ -2580,7 +2767,7 @@ var createVoiceOpsActionCenterStore = (options = {}) => {
|
|
|
2580
2767
|
// src/client/opsActionCenterWidget.ts
|
|
2581
2768
|
var DEFAULT_TITLE2 = "Voice Ops Action Center";
|
|
2582
2769
|
var DEFAULT_DESCRIPTION2 = "Run production voice proofs and operator actions from one primitive panel.";
|
|
2583
|
-
var
|
|
2770
|
+
var escapeHtml4 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
2584
2771
|
var createVoiceOpsActionCenterViewModel = (snapshot, options = {}) => {
|
|
2585
2772
|
const status = snapshot.error ? "error" : snapshot.isRunning ? "running" : snapshot.lastResult ? "completed" : "ready";
|
|
2586
2773
|
return {
|
|
@@ -2602,18 +2789,18 @@ var createVoiceOpsActionCenterViewModel = (snapshot, options = {}) => {
|
|
|
2602
2789
|
};
|
|
2603
2790
|
var renderVoiceOpsActionCenterHTML = (snapshot, options = {}) => {
|
|
2604
2791
|
const model = createVoiceOpsActionCenterViewModel(snapshot, options);
|
|
2605
|
-
const actions = model.actions.map((action) => `<button type="button" data-absolute-voice-ops-action="${
|
|
2606
|
-
${
|
|
2792
|
+
const actions = model.actions.map((action) => `<button type="button" data-absolute-voice-ops-action="${escapeHtml4(action.id)}"${action.disabled ? " disabled" : ""}>
|
|
2793
|
+
${escapeHtml4(action.isRunning ? "Working..." : action.label)}
|
|
2607
2794
|
</button>`).join("");
|
|
2608
|
-
return `<section class="absolute-voice-ops-action-center absolute-voice-ops-action-center--${
|
|
2795
|
+
return `<section class="absolute-voice-ops-action-center absolute-voice-ops-action-center--${escapeHtml4(model.status)}">
|
|
2609
2796
|
<header class="absolute-voice-ops-action-center__header">
|
|
2610
|
-
<span class="absolute-voice-ops-action-center__eyebrow">${
|
|
2611
|
-
<strong class="absolute-voice-ops-action-center__label">${
|
|
2797
|
+
<span class="absolute-voice-ops-action-center__eyebrow">${escapeHtml4(model.title)}</span>
|
|
2798
|
+
<strong class="absolute-voice-ops-action-center__label">${escapeHtml4(model.label)}</strong>
|
|
2612
2799
|
</header>
|
|
2613
|
-
<p class="absolute-voice-ops-action-center__description">${
|
|
2800
|
+
<p class="absolute-voice-ops-action-center__description">${escapeHtml4(model.description)}</p>
|
|
2614
2801
|
<div class="absolute-voice-ops-action-center__actions">${actions}</div>
|
|
2615
|
-
<p class="absolute-voice-ops-action-center__result">${
|
|
2616
|
-
${model.error ? `<p class="absolute-voice-ops-action-center__error">${
|
|
2802
|
+
<p class="absolute-voice-ops-action-center__result">${escapeHtml4(model.lastResultLabel)}</p>
|
|
2803
|
+
${model.error ? `<p class="absolute-voice-ops-action-center__error">${escapeHtml4(model.error)}</p>` : ""}
|
|
2617
2804
|
</section>`;
|
|
2618
2805
|
};
|
|
2619
2806
|
var getVoiceOpsActionCenterCSS = () => `.absolute-voice-ops-action-center{border:1px solid #d5cbb8;border-radius:20px;background:#fffaf1;color:#17130b;padding:18px;box-shadow:0 18px 40px rgba(58,42,16,.12);font-family:inherit}.absolute-voice-ops-action-center--error{border-color:#f2a7a7;background:#fff5f3}.absolute-voice-ops-action-center__header{align-items:start;display:flex;gap:12px;justify-content:space-between}.absolute-voice-ops-action-center__eyebrow{color:#725d37;font-size:12px;font-weight:800;letter-spacing:.08em;text-transform:uppercase}.absolute-voice-ops-action-center__label{font-size:28px;line-height:1}.absolute-voice-ops-action-center__description,.absolute-voice-ops-action-center__result{color:#5b4b2f;margin:12px 0 0}.absolute-voice-ops-action-center__actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:14px}.absolute-voice-ops-action-center__actions button{background:#7c4a03;border:0;border-radius:999px;color:#fff8e8;cursor:pointer;font:inherit;font-weight:800;padding:8px 12px}.absolute-voice-ops-action-center__actions button:disabled{cursor:not-allowed;opacity:.5}.absolute-voice-ops-action-center__error{color:#9f1239;font-weight:700}`;
|
|
@@ -3442,7 +3629,7 @@ var exportVoiceTrace = async (input) => {
|
|
|
3442
3629
|
};
|
|
3443
3630
|
};
|
|
3444
3631
|
var toNumber = (value) => typeof value === "number" && Number.isFinite(value) ? value : 0;
|
|
3445
|
-
var
|
|
3632
|
+
var escapeHtml5 = (value) => value.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
3446
3633
|
var formatTraceValue = (value) => {
|
|
3447
3634
|
if (value === undefined || value === null) {
|
|
3448
3635
|
return "";
|
|
@@ -3726,10 +3913,10 @@ var renderVoiceTraceHTML = (events, options = {}) => {
|
|
|
3726
3913
|
const offset = summary.startedAt === undefined ? event.at : Math.max(0, event.at - summary.startedAt);
|
|
3727
3914
|
return [
|
|
3728
3915
|
"<tr>",
|
|
3729
|
-
`<td>${
|
|
3730
|
-
`<td>${
|
|
3731
|
-
`<td>${
|
|
3732
|
-
`<td><code>${
|
|
3916
|
+
`<td>${escapeHtml5(String(offset))}</td>`,
|
|
3917
|
+
`<td>${escapeHtml5(event.type)}</td>`,
|
|
3918
|
+
`<td>${escapeHtml5(event.turnId ?? "")}</td>`,
|
|
3919
|
+
`<td><code>${escapeHtml5(JSON.stringify(event.payload))}</code></td>`,
|
|
3733
3920
|
"</tr>"
|
|
3734
3921
|
].join("");
|
|
3735
3922
|
}).join(`
|
|
@@ -3740,7 +3927,7 @@ var renderVoiceTraceHTML = (events, options = {}) => {
|
|
|
3740
3927
|
"<head>",
|
|
3741
3928
|
'<meta charset="utf-8" />',
|
|
3742
3929
|
'<meta name="viewport" content="width=device-width, initial-scale=1" />',
|
|
3743
|
-
`<title>${
|
|
3930
|
+
`<title>${escapeHtml5(options.title ?? "Voice Trace")}</title>`,
|
|
3744
3931
|
"<style>",
|
|
3745
3932
|
"body{font-family:ui-sans-serif,system-ui,sans-serif;margin:2rem;line-height:1.45;background:#f8f7f2;color:#181713}",
|
|
3746
3933
|
"main{max-width:1100px;margin:auto}",
|
|
@@ -3754,7 +3941,7 @@ var renderVoiceTraceHTML = (events, options = {}) => {
|
|
|
3754
3941
|
"</style>",
|
|
3755
3942
|
"</head>",
|
|
3756
3943
|
"<body><main>",
|
|
3757
|
-
`<h1>${
|
|
3944
|
+
`<h1>${escapeHtml5(options.title ?? `Voice Trace ${summary.sessionId ?? ""}`.trim())}</h1>`,
|
|
3758
3945
|
`<p class="${evaluation.pass ? "pass" : "fail"}">QA: ${evaluation.pass ? "pass" : "fail"}</p>`,
|
|
3759
3946
|
'<section class="summary">',
|
|
3760
3947
|
`<div class="card"><strong>Events</strong><br>${summary.eventCount}</div>`,
|
|
@@ -3768,7 +3955,7 @@ var renderVoiceTraceHTML = (events, options = {}) => {
|
|
|
3768
3955
|
eventRows,
|
|
3769
3956
|
"</tbody></table>",
|
|
3770
3957
|
"<h2>Markdown Export</h2>",
|
|
3771
|
-
`<pre>${
|
|
3958
|
+
`<pre>${escapeHtml5(markdown)}</pre>`,
|
|
3772
3959
|
"</main></body></html>"
|
|
3773
3960
|
].join(`
|
|
3774
3961
|
`);
|
|
@@ -4124,7 +4311,7 @@ var ACTION_LABELS = {
|
|
|
4124
4311
|
"resume-assistant": "Resume assistant",
|
|
4125
4312
|
tag: "Tag"
|
|
4126
4313
|
};
|
|
4127
|
-
var
|
|
4314
|
+
var escapeHtml6 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
4128
4315
|
var createVoiceLiveOpsInput = (action, input) => ({
|
|
4129
4316
|
action,
|
|
4130
4317
|
assignee: input.assignee,
|
|
@@ -4135,17 +4322,17 @@ var createVoiceLiveOpsInput = (action, input) => ({
|
|
|
4135
4322
|
var renderVoiceLiveOpsHTML = (snapshot, options = {}) => {
|
|
4136
4323
|
const sessionId = options.getSessionId?.() ?? "";
|
|
4137
4324
|
const disabled = snapshot.isRunning || !sessionId;
|
|
4138
|
-
const actions = VOICE_LIVE_OPS_ACTIONS.map((action) => `<button type="button" data-absolute-voice-live-ops-action="${
|
|
4139
|
-
const result = snapshot.error ? `<p class="absolute-voice-live-ops__error">${
|
|
4325
|
+
const actions = VOICE_LIVE_OPS_ACTIONS.map((action) => `<button type="button" data-absolute-voice-live-ops-action="${escapeHtml6(action)}"${disabled ? " disabled" : ""}>${escapeHtml6(snapshot.runningAction === action ? "Running..." : ACTION_LABELS[action])}</button>`).join("");
|
|
4326
|
+
const result = snapshot.error ? `<p class="absolute-voice-live-ops__error">${escapeHtml6(snapshot.error)}</p>` : snapshot.lastResult ? `<p class="absolute-voice-live-ops__result">Recorded ${escapeHtml6(snapshot.lastResult.action)}. Control: ${escapeHtml6(snapshot.lastResult.control.status)}.</p>` : '<p class="absolute-voice-live-ops__result">No live ops action has run yet.</p>';
|
|
4140
4327
|
return `<section class="absolute-voice-live-ops">
|
|
4141
4328
|
<header class="absolute-voice-live-ops__header">
|
|
4142
|
-
<span>${
|
|
4143
|
-
<strong>${
|
|
4329
|
+
<span>${escapeHtml6(options.title ?? "Live Ops")}</span>
|
|
4330
|
+
<strong>${escapeHtml6(sessionId || "No active session")}</strong>
|
|
4144
4331
|
</header>
|
|
4145
|
-
<p class="absolute-voice-live-ops__description">${
|
|
4146
|
-
<label><span>Operator</span><input data-absolute-voice-live-ops-assignee value="${
|
|
4147
|
-
<label><span>Tag / handoff target</span><input data-absolute-voice-live-ops-tag value="${
|
|
4148
|
-
<label><span>Detail / instruction</span><input data-absolute-voice-live-ops-detail value="${
|
|
4332
|
+
<p class="absolute-voice-live-ops__description">${escapeHtml6(options.description ?? "Pause, resume, take over, force handoff, or inject operator instructions during a live voice session.")}</p>
|
|
4333
|
+
<label><span>Operator</span><input data-absolute-voice-live-ops-assignee value="${escapeHtml6(options.defaultAssignee ?? "operator")}" /></label>
|
|
4334
|
+
<label><span>Tag / handoff target</span><input data-absolute-voice-live-ops-tag value="${escapeHtml6(options.defaultTag ?? "live-ops")}" /></label>
|
|
4335
|
+
<label><span>Detail / instruction</span><input data-absolute-voice-live-ops-detail value="${escapeHtml6(options.defaultDetail ?? "Operator marked this live session.")}" /></label>
|
|
4149
4336
|
<div class="absolute-voice-live-ops__actions">${actions}</div>
|
|
4150
4337
|
${result}
|
|
4151
4338
|
</section>`;
|
|
@@ -4333,7 +4520,7 @@ var SURFACE_LABELS = {
|
|
|
4333
4520
|
sessions: "Sessions",
|
|
4334
4521
|
workflows: "Workflows"
|
|
4335
4522
|
};
|
|
4336
|
-
var
|
|
4523
|
+
var escapeHtml7 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
4337
4524
|
var readNumber = (value, key) => value && typeof value === "object" && (key in value) ? Number(value[key] ?? 0) : 0;
|
|
4338
4525
|
var surfaceDetail = (surface) => {
|
|
4339
4526
|
const total = readNumber(surface, "total");
|
|
@@ -4388,24 +4575,24 @@ var createVoiceOpsStatusViewModel = (snapshot, options = {}) => {
|
|
|
4388
4575
|
};
|
|
4389
4576
|
var renderVoiceOpsStatusHTML = (snapshot, options = {}) => {
|
|
4390
4577
|
const model = createVoiceOpsStatusViewModel(snapshot, options);
|
|
4391
|
-
const surfaces = model.surfaces.length ? model.surfaces.map((surface) => `<li class="absolute-voice-ops-status__surface absolute-voice-ops-status__surface--${
|
|
4392
|
-
<span>${
|
|
4393
|
-
<strong>${
|
|
4578
|
+
const surfaces = model.surfaces.length ? model.surfaces.map((surface) => `<li class="absolute-voice-ops-status__surface absolute-voice-ops-status__surface--${escapeHtml7(surface.status)}">
|
|
4579
|
+
<span>${escapeHtml7(surface.label)}</span>
|
|
4580
|
+
<strong>${escapeHtml7(surface.detail)}</strong>
|
|
4394
4581
|
</li>`).join("") : '<li class="absolute-voice-ops-status__surface"><span>Status</span><strong>Waiting for first check</strong></li>';
|
|
4395
|
-
const links = model.links.length ? `<nav class="absolute-voice-ops-status__links">${model.links.slice(0, 4).map((link) => `<a href="${
|
|
4396
|
-
return `<section class="absolute-voice-ops-status absolute-voice-ops-status--${
|
|
4582
|
+
const links = model.links.length ? `<nav class="absolute-voice-ops-status__links">${model.links.slice(0, 4).map((link) => `<a href="${escapeHtml7(link.href)}">${escapeHtml7(link.label)}</a>`).join("")}</nav>` : "";
|
|
4583
|
+
return `<section class="absolute-voice-ops-status absolute-voice-ops-status--${escapeHtml7(model.status)}">
|
|
4397
4584
|
<header class="absolute-voice-ops-status__header">
|
|
4398
|
-
<span class="absolute-voice-ops-status__eyebrow">${
|
|
4399
|
-
<strong class="absolute-voice-ops-status__label">${
|
|
4585
|
+
<span class="absolute-voice-ops-status__eyebrow">${escapeHtml7(model.title)}</span>
|
|
4586
|
+
<strong class="absolute-voice-ops-status__label">${escapeHtml7(model.label)}</strong>
|
|
4400
4587
|
</header>
|
|
4401
|
-
<p class="absolute-voice-ops-status__description">${
|
|
4588
|
+
<p class="absolute-voice-ops-status__description">${escapeHtml7(model.description)}</p>
|
|
4402
4589
|
<div class="absolute-voice-ops-status__summary">
|
|
4403
4590
|
<span>${model.passed} passing</span>
|
|
4404
4591
|
<span>${Math.max(model.total - model.passed, 0)} failing</span>
|
|
4405
4592
|
<span>${model.total} checks</span>
|
|
4406
4593
|
</div>
|
|
4407
4594
|
<ul class="absolute-voice-ops-status__surfaces">${surfaces}</ul>
|
|
4408
|
-
${model.error ? `<p class="absolute-voice-ops-status__error">${
|
|
4595
|
+
${model.error ? `<p class="absolute-voice-ops-status__error">${escapeHtml7(model.error)}</p>` : ""}
|
|
4409
4596
|
${links}
|
|
4410
4597
|
</section>`;
|
|
4411
4598
|
};
|
|
@@ -4802,7 +4989,7 @@ var createVoiceCallDebuggerStore = (path, options = {}) => {
|
|
|
4802
4989
|
var DEFAULT_TITLE4 = "Call Debugger";
|
|
4803
4990
|
var DEFAULT_DESCRIPTION4 = "Open the latest call artifact with snapshot, operations record, failure replay, provider path, transcript, and incident markdown.";
|
|
4804
4991
|
var DEFAULT_LINK_LABEL = "Open debugger";
|
|
4805
|
-
var
|
|
4992
|
+
var escapeHtml8 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
4806
4993
|
var defaultHref = (path, report) => {
|
|
4807
4994
|
if (path.startsWith("/api/voice-call-debugger/")) {
|
|
4808
4995
|
return path.replace("/api/voice-call-debugger/", "/voice-call-debugger/");
|
|
@@ -4855,18 +5042,18 @@ var createVoiceCallDebuggerLaunchViewModel = (path, state, options = {}) => {
|
|
|
4855
5042
|
var renderVoiceCallDebuggerLaunchHTML = (path, state, options = {}) => {
|
|
4856
5043
|
const model = createVoiceCallDebuggerLaunchViewModel(path, state, options);
|
|
4857
5044
|
const rows = model.rows.length ? `<dl>${model.rows.map((row) => `<div>
|
|
4858
|
-
<dt>${
|
|
4859
|
-
<dd>${
|
|
5045
|
+
<dt>${escapeHtml8(row.label)}</dt>
|
|
5046
|
+
<dd>${escapeHtml8(row.value)}</dd>
|
|
4860
5047
|
</div>`).join("")}</dl>` : '<p class="absolute-voice-call-debugger-launch__empty">Load a call debugger report to see the latest support artifact.</p>';
|
|
4861
|
-
return `<section class="absolute-voice-call-debugger-launch absolute-voice-call-debugger-launch--${
|
|
5048
|
+
return `<section class="absolute-voice-call-debugger-launch absolute-voice-call-debugger-launch--${escapeHtml8(model.status)}">
|
|
4862
5049
|
<header class="absolute-voice-call-debugger-launch__header">
|
|
4863
|
-
<span class="absolute-voice-call-debugger-launch__eyebrow">${
|
|
4864
|
-
<strong class="absolute-voice-call-debugger-launch__label">${
|
|
5050
|
+
<span class="absolute-voice-call-debugger-launch__eyebrow">${escapeHtml8(model.title)}</span>
|
|
5051
|
+
<strong class="absolute-voice-call-debugger-launch__label">${escapeHtml8(model.label)}</strong>
|
|
4865
5052
|
</header>
|
|
4866
|
-
<p class="absolute-voice-call-debugger-launch__description">${
|
|
4867
|
-
<a class="absolute-voice-call-debugger-launch__link" href="${
|
|
5053
|
+
<p class="absolute-voice-call-debugger-launch__description">${escapeHtml8(model.description)}</p>
|
|
5054
|
+
<a class="absolute-voice-call-debugger-launch__link" href="${escapeHtml8(model.href)}">${escapeHtml8(options.linkLabel ?? DEFAULT_LINK_LABEL)}</a>
|
|
4868
5055
|
${rows}
|
|
4869
|
-
${model.error ? `<p class="absolute-voice-call-debugger-launch__error">${
|
|
5056
|
+
${model.error ? `<p class="absolute-voice-call-debugger-launch__error">${escapeHtml8(model.error)}</p>` : ""}
|
|
4870
5057
|
</section>`;
|
|
4871
5058
|
};
|
|
4872
5059
|
var mountVoiceCallDebuggerLaunch = (element, path, options = {}) => {
|
|
@@ -5014,7 +5201,7 @@ var createVoiceSessionSnapshotStore = (path, options = {}) => {
|
|
|
5014
5201
|
var DEFAULT_TITLE5 = "Session Snapshot";
|
|
5015
5202
|
var DEFAULT_DESCRIPTION5 = "Portable call artifact with media graph, provider routing, proof, quality, and telephony evidence.";
|
|
5016
5203
|
var DEFAULT_DOWNLOAD_LABEL = "Download snapshot";
|
|
5017
|
-
var
|
|
5204
|
+
var escapeHtml9 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
5018
5205
|
var formatStatus = (status) => status ?? "n/a";
|
|
5019
5206
|
var createVoiceSessionSnapshotViewModel = (state, options = {}) => {
|
|
5020
5207
|
const snapshot = state.snapshot;
|
|
@@ -5064,23 +5251,23 @@ var createVoiceSessionSnapshotViewModel = (state, options = {}) => {
|
|
|
5064
5251
|
var renderVoiceSessionSnapshotHTML = (state, options = {}) => {
|
|
5065
5252
|
const model = createVoiceSessionSnapshotViewModel(state, options);
|
|
5066
5253
|
const rows = model.rows.length ? `<dl>${model.rows.map((row) => `<div>
|
|
5067
|
-
<dt>${
|
|
5068
|
-
<dd>${
|
|
5254
|
+
<dt>${escapeHtml9(row.label)}</dt>
|
|
5255
|
+
<dd>${escapeHtml9(row.value)}</dd>
|
|
5069
5256
|
</div>`).join("")}</dl>` : '<p class="absolute-voice-session-snapshot__empty">Load a session snapshot to see support diagnostics.</p>';
|
|
5070
5257
|
const artifacts = model.artifacts.length ? `<div class="absolute-voice-session-snapshot__artifacts">${model.artifacts.map((artifact) => {
|
|
5071
|
-
const body = `<strong>${
|
|
5072
|
-
return artifact.href ? `<a href="${
|
|
5258
|
+
const body = `<strong>${escapeHtml9(artifact.label)}</strong><span>${escapeHtml9(artifact.status)}</span>`;
|
|
5259
|
+
return artifact.href ? `<a href="${escapeHtml9(artifact.href)}">${body}</a>` : `<div>${body}</div>`;
|
|
5073
5260
|
}).join("")}</div>` : "";
|
|
5074
|
-
return `<section class="absolute-voice-session-snapshot absolute-voice-session-snapshot--${
|
|
5261
|
+
return `<section class="absolute-voice-session-snapshot absolute-voice-session-snapshot--${escapeHtml9(model.status)}">
|
|
5075
5262
|
<header class="absolute-voice-session-snapshot__header">
|
|
5076
|
-
<span class="absolute-voice-session-snapshot__eyebrow">${
|
|
5077
|
-
<strong class="absolute-voice-session-snapshot__label">${
|
|
5263
|
+
<span class="absolute-voice-session-snapshot__eyebrow">${escapeHtml9(model.title)}</span>
|
|
5264
|
+
<strong class="absolute-voice-session-snapshot__label">${escapeHtml9(model.label)}</strong>
|
|
5078
5265
|
</header>
|
|
5079
|
-
<p class="absolute-voice-session-snapshot__description">${
|
|
5080
|
-
${model.showDownload ? `<button class="absolute-voice-session-snapshot__download" data-absolute-voice-session-snapshot-download type="button">${
|
|
5266
|
+
<p class="absolute-voice-session-snapshot__description">${escapeHtml9(model.description)}</p>
|
|
5267
|
+
${model.showDownload ? `<button class="absolute-voice-session-snapshot__download" data-absolute-voice-session-snapshot-download type="button">${escapeHtml9(options.downloadLabel ?? DEFAULT_DOWNLOAD_LABEL)}</button>` : ""}
|
|
5081
5268
|
${rows}
|
|
5082
5269
|
${artifacts}
|
|
5083
|
-
${model.error ? `<p class="absolute-voice-session-snapshot__error">${
|
|
5270
|
+
${model.error ? `<p class="absolute-voice-session-snapshot__error">${escapeHtml9(model.error)}</p>` : ""}
|
|
5084
5271
|
</section>`;
|
|
5085
5272
|
};
|
|
5086
5273
|
var downloadBlob = (blob, filename) => {
|
|
@@ -5235,7 +5422,7 @@ var createVoiceSessionObservabilityStore = (path, options = {}) => {
|
|
|
5235
5422
|
// src/client/sessionObservabilityWidget.ts
|
|
5236
5423
|
var DEFAULT_TITLE6 = "Session Observability";
|
|
5237
5424
|
var DEFAULT_DESCRIPTION6 = "One support/debug report for a voice call across traces, provider recovery, tools, handoffs, guardrails, turn waterfalls, and incident handoff.";
|
|
5238
|
-
var
|
|
5425
|
+
var escapeHtml10 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
5239
5426
|
var formatMs = (value) => typeof value === "number" ? `${value}ms` : "n/a";
|
|
5240
5427
|
var createVoiceSessionObservabilityViewModel = (snapshot, options = {}) => {
|
|
5241
5428
|
const report = snapshot.report;
|
|
@@ -5257,20 +5444,20 @@ var createVoiceSessionObservabilityViewModel = (snapshot, options = {}) => {
|
|
|
5257
5444
|
updatedAt: snapshot.updatedAt
|
|
5258
5445
|
};
|
|
5259
5446
|
};
|
|
5260
|
-
var renderLinks = (links) => links.length ? `<p class="absolute-voice-session-observability__actions">${links.map((link) => `<a href="${
|
|
5447
|
+
var renderLinks = (links) => links.length ? `<p class="absolute-voice-session-observability__actions">${links.map((link) => `<a href="${escapeHtml10(link.href)}">${escapeHtml10(link.label)}</a>`).join("")}</p>` : "";
|
|
5261
5448
|
var renderVoiceSessionObservabilityHTML = (snapshot, options = {}) => {
|
|
5262
5449
|
const model = createVoiceSessionObservabilityViewModel(snapshot, options);
|
|
5263
|
-
const turns = model.turns.length ? `<div class="absolute-voice-session-observability__turns">${model.turns.map((turn) => `<article class="absolute-voice-session-observability__turn"><header><strong>${
|
|
5264
|
-
return `<section class="absolute-voice-session-observability absolute-voice-session-observability--${
|
|
5450
|
+
const turns = model.turns.length ? `<div class="absolute-voice-session-observability__turns">${model.turns.map((turn) => `<article class="absolute-voice-session-observability__turn"><header><strong>${escapeHtml10(turn.turnId)}</strong><span>${escapeHtml10(turn.durationLabel)}</span></header><p>${escapeHtml10(turn.label)}</p></article>`).join("")}</div>` : '<p class="absolute-voice-session-observability__empty">Open a voice session to see turn waterfalls.</p>';
|
|
5451
|
+
return `<section class="absolute-voice-session-observability absolute-voice-session-observability--${escapeHtml10(model.status)}">
|
|
5265
5452
|
<header class="absolute-voice-session-observability__header">
|
|
5266
|
-
<span class="absolute-voice-session-observability__eyebrow">${
|
|
5267
|
-
<strong class="absolute-voice-session-observability__label">${
|
|
5453
|
+
<span class="absolute-voice-session-observability__eyebrow">${escapeHtml10(model.title)}</span>
|
|
5454
|
+
<strong class="absolute-voice-session-observability__label">${escapeHtml10(model.label)}</strong>
|
|
5268
5455
|
</header>
|
|
5269
|
-
<p class="absolute-voice-session-observability__description">${
|
|
5270
|
-
${model.sessionId ? `<p class="absolute-voice-session-observability__session">${
|
|
5456
|
+
<p class="absolute-voice-session-observability__description">${escapeHtml10(model.description)}</p>
|
|
5457
|
+
${model.sessionId ? `<p class="absolute-voice-session-observability__session">${escapeHtml10(model.sessionId)}</p>` : ""}
|
|
5271
5458
|
${renderLinks(model.links)}
|
|
5272
5459
|
${turns}
|
|
5273
|
-
${model.error ? `<p class="absolute-voice-session-observability__error">${
|
|
5460
|
+
${model.error ? `<p class="absolute-voice-session-observability__error">${escapeHtml10(model.error)}</p>` : ""}
|
|
5274
5461
|
</section>`;
|
|
5275
5462
|
};
|
|
5276
5463
|
var getVoiceSessionObservabilityCSS = () => `.absolute-voice-session-observability{border:1px solid #c8d9bf;border-radius:20px;background:#fbfff3;color:#18220d;padding:18px;box-shadow:0 18px 40px rgba(24,34,13,.12);font-family:inherit}.absolute-voice-session-observability--error,.absolute-voice-session-observability--failed{border-color:#f2a7a7;background:#fff5f3}.absolute-voice-session-observability--warning{border-color:#fbbf24;background:#fffaf0}.absolute-voice-session-observability__header,.absolute-voice-session-observability__turn header{align-items:start;display:flex;gap:12px;justify-content:space-between}.absolute-voice-session-observability__eyebrow{color:#4d7c0f;font-size:12px;font-weight:800;letter-spacing:.08em;text-transform:uppercase}.absolute-voice-session-observability__label{font-size:24px;line-height:1}.absolute-voice-session-observability__description,.absolute-voice-session-observability__turn p,.absolute-voice-session-observability__empty,.absolute-voice-session-observability__session{color:#4b5f3e}.absolute-voice-session-observability__actions{display:flex;flex-wrap:wrap;gap:10px;margin:14px 0}.absolute-voice-session-observability__actions a{color:#3f6212;font-weight:800}.absolute-voice-session-observability__turns{display:grid;gap:12px;margin-top:14px}.absolute-voice-session-observability__turn{background:#fff;border:1px solid #dcebcf;border-radius:16px;padding:14px}.absolute-voice-session-observability__turn p{margin:10px 0 0}.absolute-voice-session-observability__empty{margin:14px 0 0}.absolute-voice-session-observability__error{color:#9f1239;font-weight:700}`;
|
|
@@ -5572,7 +5759,7 @@ var createVoiceProviderSimulationControlsStore = (options) => {
|
|
|
5572
5759
|
};
|
|
5573
5760
|
|
|
5574
5761
|
// src/client/providerSimulationControlsWidget.ts
|
|
5575
|
-
var
|
|
5762
|
+
var escapeHtml11 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
5576
5763
|
var formatKind = (kind) => (kind ?? "stt").toUpperCase();
|
|
5577
5764
|
var createVoiceProviderSimulationControlsViewModel = (snapshot, options) => {
|
|
5578
5765
|
const configuredProviders = options.providers.filter((provider) => provider.configured !== false);
|
|
@@ -5592,18 +5779,18 @@ var createVoiceProviderSimulationControlsViewModel = (snapshot, options) => {
|
|
|
5592
5779
|
};
|
|
5593
5780
|
var renderVoiceProviderSimulationControlsHTML = (snapshot, options) => {
|
|
5594
5781
|
const model = createVoiceProviderSimulationControlsViewModel(snapshot, options);
|
|
5595
|
-
const failureButtons = model.failureProviders.map((provider) => `<button type="button" data-voice-provider-fail="${
|
|
5596
|
-
const recoveryButtons = model.providers.map((provider) => `<button type="button" data-voice-provider-recover="${
|
|
5782
|
+
const failureButtons = model.failureProviders.map((provider) => `<button type="button" data-voice-provider-fail="${escapeHtml11(provider.provider)}"${!model.canSimulateFailure || snapshot.isRunning ? " disabled" : ""}>Simulate ${escapeHtml11(provider.provider)} ${escapeHtml11(formatKind(options.kind))} failure</button>`).join("");
|
|
5783
|
+
const recoveryButtons = model.providers.map((provider) => `<button type="button" data-voice-provider-recover="${escapeHtml11(provider.provider)}"${snapshot.isRunning ? " disabled" : ""}>Mark ${escapeHtml11(provider.provider)} recovered</button>`).join("");
|
|
5597
5784
|
return `<section class="absolute-voice-provider-simulation absolute-voice-provider-simulation--${snapshot.error ? "error" : snapshot.isRunning ? "running" : "ready"}">
|
|
5598
5785
|
<header class="absolute-voice-provider-simulation__header">
|
|
5599
|
-
<span class="absolute-voice-provider-simulation__eyebrow">${
|
|
5600
|
-
<strong class="absolute-voice-provider-simulation__label">${
|
|
5786
|
+
<span class="absolute-voice-provider-simulation__eyebrow">${escapeHtml11(model.title)}</span>
|
|
5787
|
+
<strong class="absolute-voice-provider-simulation__label">${escapeHtml11(model.label)}</strong>
|
|
5601
5788
|
</header>
|
|
5602
|
-
<p class="absolute-voice-provider-simulation__description">${
|
|
5603
|
-
${model.canSimulateFailure ? "" : `<p class="absolute-voice-provider-simulation__empty">${
|
|
5789
|
+
<p class="absolute-voice-provider-simulation__description">${escapeHtml11(model.description)}</p>
|
|
5790
|
+
${model.canSimulateFailure ? "" : `<p class="absolute-voice-provider-simulation__empty">${escapeHtml11(options.fallbackRequiredMessage ?? "Configure fallback providers before simulating failure.")}</p>`}
|
|
5604
5791
|
<div class="absolute-voice-provider-simulation__actions">${failureButtons}${recoveryButtons}</div>
|
|
5605
|
-
${snapshot.error ? `<p class="absolute-voice-provider-simulation__error">${
|
|
5606
|
-
${model.resultText ? `<pre class="absolute-voice-provider-simulation__result">${
|
|
5792
|
+
${snapshot.error ? `<p class="absolute-voice-provider-simulation__error">${escapeHtml11(snapshot.error)}</p>` : ""}
|
|
5793
|
+
${model.resultText ? `<pre class="absolute-voice-provider-simulation__result">${escapeHtml11(model.resultText)}</pre>` : ""}
|
|
5607
5794
|
</section>`;
|
|
5608
5795
|
};
|
|
5609
5796
|
var bindVoiceProviderSimulationControls = (element, store) => {
|
|
@@ -5760,7 +5947,7 @@ var createVoiceProviderCapabilitiesStore = (path = "/api/provider-capabilities",
|
|
|
5760
5947
|
// src/client/providerCapabilitiesWidget.ts
|
|
5761
5948
|
var DEFAULT_TITLE7 = "Provider Capabilities";
|
|
5762
5949
|
var DEFAULT_DESCRIPTION7 = "Configured, selected, and healthy voice providers for this deployment.";
|
|
5763
|
-
var
|
|
5950
|
+
var escapeHtml12 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
5764
5951
|
var formatProvider = (provider) => provider.split(/[-_\s]+/).filter(Boolean).map((part) => `${part[0]?.toUpperCase() ?? ""}${part.slice(1)}`).join(" ") || provider;
|
|
5765
5952
|
var formatKind2 = (kind) => kind.toUpperCase();
|
|
5766
5953
|
var formatStatus2 = (status) => status.split("-").map((part) => `${part[0]?.toUpperCase() ?? ""}${part.slice(1)}`).join(" ");
|
|
@@ -5815,25 +6002,25 @@ var createVoiceProviderCapabilitiesViewModel = (snapshot, options = {}) => {
|
|
|
5815
6002
|
};
|
|
5816
6003
|
var renderVoiceProviderCapabilitiesHTML = (snapshot, options = {}) => {
|
|
5817
6004
|
const model = createVoiceProviderCapabilitiesViewModel(snapshot, options);
|
|
5818
|
-
const capabilities = model.capabilities.length ? `<div class="absolute-voice-provider-capabilities__providers">${model.capabilities.map((capability) => `<article class="absolute-voice-provider-capabilities__provider absolute-voice-provider-capabilities__provider--${
|
|
6005
|
+
const capabilities = model.capabilities.length ? `<div class="absolute-voice-provider-capabilities__providers">${model.capabilities.map((capability) => `<article class="absolute-voice-provider-capabilities__provider absolute-voice-provider-capabilities__provider--${escapeHtml12(capability.status)}">
|
|
5819
6006
|
<header>
|
|
5820
|
-
<strong>${
|
|
5821
|
-
<span>${
|
|
6007
|
+
<strong>${escapeHtml12(capability.label)}</strong>
|
|
6008
|
+
<span>${escapeHtml12(formatStatus2(capability.status))}</span>
|
|
5822
6009
|
</header>
|
|
5823
|
-
<p>${
|
|
6010
|
+
<p>${escapeHtml12(capability.detail)}</p>
|
|
5824
6011
|
<dl>${capability.rows.map((row) => `<div>
|
|
5825
|
-
<dt>${
|
|
5826
|
-
<dd>${
|
|
6012
|
+
<dt>${escapeHtml12(row.label)}</dt>
|
|
6013
|
+
<dd>${escapeHtml12(row.value)}</dd>
|
|
5827
6014
|
</div>`).join("")}</dl>
|
|
5828
6015
|
</article>`).join("")}</div>` : '<p class="absolute-voice-provider-capabilities__empty">Configure provider capabilities to see deployment coverage.</p>';
|
|
5829
|
-
return `<section class="absolute-voice-provider-capabilities absolute-voice-provider-capabilities--${
|
|
6016
|
+
return `<section class="absolute-voice-provider-capabilities absolute-voice-provider-capabilities--${escapeHtml12(model.status)}">
|
|
5830
6017
|
<header class="absolute-voice-provider-capabilities__header">
|
|
5831
|
-
<span class="absolute-voice-provider-capabilities__eyebrow">${
|
|
5832
|
-
<strong class="absolute-voice-provider-capabilities__label">${
|
|
6018
|
+
<span class="absolute-voice-provider-capabilities__eyebrow">${escapeHtml12(model.title)}</span>
|
|
6019
|
+
<strong class="absolute-voice-provider-capabilities__label">${escapeHtml12(model.label)}</strong>
|
|
5833
6020
|
</header>
|
|
5834
|
-
<p class="absolute-voice-provider-capabilities__description">${
|
|
6021
|
+
<p class="absolute-voice-provider-capabilities__description">${escapeHtml12(model.description)}</p>
|
|
5835
6022
|
${capabilities}
|
|
5836
|
-
${model.error ? `<p class="absolute-voice-provider-capabilities__error">${
|
|
6023
|
+
${model.error ? `<p class="absolute-voice-provider-capabilities__error">${escapeHtml12(model.error)}</p>` : ""}
|
|
5837
6024
|
</section>`;
|
|
5838
6025
|
};
|
|
5839
6026
|
var getVoiceProviderCapabilitiesCSS = () => `.absolute-voice-provider-capabilities{border:1px solid #bfd7ea;border-radius:20px;background:#f6fbff;color:#08131f;padding:18px;box-shadow:0 18px 40px rgba(14,51,78,.12);font-family:inherit}.absolute-voice-provider-capabilities--error,.absolute-voice-provider-capabilities--warning{border-color:#f2a7a7;background:#fff5f3}.absolute-voice-provider-capabilities__header,.absolute-voice-provider-capabilities__provider header{align-items:start;display:flex;gap:12px;justify-content:space-between}.absolute-voice-provider-capabilities__eyebrow{color:#255f85;font-size:12px;font-weight:800;letter-spacing:.08em;text-transform:uppercase}.absolute-voice-provider-capabilities__label{font-size:24px;line-height:1}.absolute-voice-provider-capabilities__description,.absolute-voice-provider-capabilities__provider p,.absolute-voice-provider-capabilities__provider dt,.absolute-voice-provider-capabilities__empty{color:#405467}.absolute-voice-provider-capabilities__providers{display:grid;gap:12px;margin-top:14px}.absolute-voice-provider-capabilities__provider{background:#fff;border:1px solid #d7e7f3;border-radius:16px;padding:14px}.absolute-voice-provider-capabilities__provider--selected,.absolute-voice-provider-capabilities__provider--healthy{border-color:#86efac}.absolute-voice-provider-capabilities__provider--degraded,.absolute-voice-provider-capabilities__provider--rate-limited,.absolute-voice-provider-capabilities__provider--suppressed,.absolute-voice-provider-capabilities__provider--unconfigured{border-color:#f2a7a7}.absolute-voice-provider-capabilities__provider p{margin:10px 0}.absolute-voice-provider-capabilities__provider dl{display:grid;gap:8px;grid-template-columns:repeat(2,minmax(0,1fr));margin:0}.absolute-voice-provider-capabilities__provider div{background:#f6fbff;border:1px solid #d7e7f3;border-radius:12px;padding:8px}.absolute-voice-provider-capabilities__provider dt{font-size:12px}.absolute-voice-provider-capabilities__provider dd{font-weight:800;margin:4px 0 0}.absolute-voice-provider-capabilities__empty{margin:14px 0 0}.absolute-voice-provider-capabilities__error{color:#9f1239;font-weight:700}`;
|
|
@@ -5961,7 +6148,7 @@ var createVoiceProviderContractsStore = (path = "/api/provider-contracts", optio
|
|
|
5961
6148
|
// src/client/providerContractsWidget.ts
|
|
5962
6149
|
var DEFAULT_TITLE8 = "Provider Contracts";
|
|
5963
6150
|
var DEFAULT_DESCRIPTION8 = "Production contract coverage for provider env, latency, fallback, streaming, and capabilities.";
|
|
5964
|
-
var
|
|
6151
|
+
var escapeHtml13 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
5965
6152
|
var formatProvider2 = (provider) => provider.split(/[-_\s]+/).filter(Boolean).map((part) => `${part[0]?.toUpperCase() ?? ""}${part.slice(1)}`).join(" ") || provider;
|
|
5966
6153
|
var formatStatus3 = (status) => status.split("-").map((part) => `${part[0]?.toUpperCase() ?? ""}${part.slice(1)}`).join(" ");
|
|
5967
6154
|
var contractDetail = (row) => {
|
|
@@ -6005,26 +6192,26 @@ var createVoiceProviderContractsViewModel = (snapshot, options = {}) => {
|
|
|
6005
6192
|
};
|
|
6006
6193
|
var renderVoiceProviderContractsHTML = (snapshot, options = {}) => {
|
|
6007
6194
|
const model = createVoiceProviderContractsViewModel(snapshot, options);
|
|
6008
|
-
const rows = model.rows.length ? `<div class="absolute-voice-provider-contracts__rows">${model.rows.map((row) => `<article class="absolute-voice-provider-contracts__row absolute-voice-provider-contracts__row--${
|
|
6195
|
+
const rows = model.rows.length ? `<div class="absolute-voice-provider-contracts__rows">${model.rows.map((row) => `<article class="absolute-voice-provider-contracts__row absolute-voice-provider-contracts__row--${escapeHtml13(row.status)}">
|
|
6009
6196
|
<header>
|
|
6010
|
-
<strong>${
|
|
6011
|
-
<span>${
|
|
6197
|
+
<strong>${escapeHtml13(row.label)}</strong>
|
|
6198
|
+
<span>${escapeHtml13(formatStatus3(row.status))}</span>
|
|
6012
6199
|
</header>
|
|
6013
|
-
<p>${
|
|
6014
|
-
${row.remediations.length ? `<ul class="absolute-voice-provider-contracts__remediations">${row.remediations.map((remediation) => `<li>${remediation.href ? `<a href="${
|
|
6200
|
+
<p>${escapeHtml13(row.detail)}</p>
|
|
6201
|
+
${row.remediations.length ? `<ul class="absolute-voice-provider-contracts__remediations">${row.remediations.map((remediation) => `<li>${remediation.href ? `<a href="${escapeHtml13(remediation.href)}">${escapeHtml13(remediation.label)}</a>` : `<strong>${escapeHtml13(remediation.label)}</strong>`}<span>${escapeHtml13(remediation.detail)}</span></li>`).join("")}</ul>` : ""}
|
|
6015
6202
|
<dl>${row.rows.map((item) => `<div>
|
|
6016
|
-
<dt>${
|
|
6017
|
-
<dd>${
|
|
6203
|
+
<dt>${escapeHtml13(item.label)}</dt>
|
|
6204
|
+
<dd>${escapeHtml13(item.value)}</dd>
|
|
6018
6205
|
</div>`).join("")}</dl>
|
|
6019
6206
|
</article>`).join("")}</div>` : '<p class="absolute-voice-provider-contracts__empty">Configure provider contracts to see production coverage.</p>';
|
|
6020
|
-
return `<section class="absolute-voice-provider-contracts absolute-voice-provider-contracts--${
|
|
6207
|
+
return `<section class="absolute-voice-provider-contracts absolute-voice-provider-contracts--${escapeHtml13(model.status)}">
|
|
6021
6208
|
<header class="absolute-voice-provider-contracts__header">
|
|
6022
|
-
<span class="absolute-voice-provider-contracts__eyebrow">${
|
|
6023
|
-
<strong class="absolute-voice-provider-contracts__label">${
|
|
6209
|
+
<span class="absolute-voice-provider-contracts__eyebrow">${escapeHtml13(model.title)}</span>
|
|
6210
|
+
<strong class="absolute-voice-provider-contracts__label">${escapeHtml13(model.label)}</strong>
|
|
6024
6211
|
</header>
|
|
6025
|
-
<p class="absolute-voice-provider-contracts__description">${
|
|
6212
|
+
<p class="absolute-voice-provider-contracts__description">${escapeHtml13(model.description)}</p>
|
|
6026
6213
|
${rows}
|
|
6027
|
-
${model.error ? `<p class="absolute-voice-provider-contracts__error">${
|
|
6214
|
+
${model.error ? `<p class="absolute-voice-provider-contracts__error">${escapeHtml13(model.error)}</p>` : ""}
|
|
6028
6215
|
</section>`;
|
|
6029
6216
|
};
|
|
6030
6217
|
var getVoiceProviderContractsCSS = () => `.absolute-voice-provider-contracts{border:1px solid #b8dcc7;border-radius:20px;background:#f7fff9;color:#09140d;padding:18px;box-shadow:0 18px 40px rgba(21,83,45,.12);font-family:inherit}.absolute-voice-provider-contracts--error,.absolute-voice-provider-contracts--warning{border-color:#f2a7a7;background:#fff7f4}.absolute-voice-provider-contracts__header,.absolute-voice-provider-contracts__row header{align-items:start;display:flex;gap:12px;justify-content:space-between}.absolute-voice-provider-contracts__eyebrow{color:#166534;font-size:12px;font-weight:800;letter-spacing:.08em;text-transform:uppercase}.absolute-voice-provider-contracts__label{font-size:24px;line-height:1}.absolute-voice-provider-contracts__description,.absolute-voice-provider-contracts__row p,.absolute-voice-provider-contracts__row dt,.absolute-voice-provider-contracts__empty{color:#405448}.absolute-voice-provider-contracts__rows{display:grid;gap:12px;margin-top:14px}.absolute-voice-provider-contracts__row{background:#fff;border:1px solid #d6eadb;border-radius:16px;padding:14px}.absolute-voice-provider-contracts__row--pass{border-color:#86efac}.absolute-voice-provider-contracts__row--warn,.absolute-voice-provider-contracts__row--fail{border-color:#f2a7a7}.absolute-voice-provider-contracts__row p{margin:10px 0}.absolute-voice-provider-contracts__remediations{display:grid;gap:8px;list-style:none;margin:0 0 10px;padding:0}.absolute-voice-provider-contracts__remediations li{background:#fff7ed;border:1px solid #fed7aa;border-radius:12px;display:grid;gap:3px;padding:8px}.absolute-voice-provider-contracts__remediations a,.absolute-voice-provider-contracts__remediations strong{color:#9a3412}.absolute-voice-provider-contracts__remediations span{color:#7c2d12}.absolute-voice-provider-contracts__row dl{display:grid;gap:8px;grid-template-columns:repeat(2,minmax(0,1fr));margin:0}.absolute-voice-provider-contracts__row div{background:#f7fff9;border:1px solid #d6eadb;border-radius:12px;padding:8px}.absolute-voice-provider-contracts__row dt{font-size:12px}.absolute-voice-provider-contracts__row dd{font-weight:800;margin:4px 0 0}.absolute-voice-provider-contracts__error{color:#9f1239;font-weight:700}`;
|
|
@@ -6159,7 +6346,7 @@ var createVoiceProviderStatusStore = (path = "/api/provider-status", options = {
|
|
|
6159
6346
|
// src/client/providerStatusWidget.ts
|
|
6160
6347
|
var DEFAULT_TITLE9 = "Voice Providers";
|
|
6161
6348
|
var DEFAULT_DESCRIPTION9 = "Live provider health, fallback counts, latency, and suppression state from your self-hosted trace store.";
|
|
6162
|
-
var
|
|
6349
|
+
var escapeHtml14 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
6163
6350
|
var formatProvider3 = (provider) => provider.split(/[-_\s]+/).filter(Boolean).map((part) => `${part[0]?.toUpperCase() ?? ""}${part.slice(1)}`).join(" ") || provider;
|
|
6164
6351
|
var formatStatus4 = (status) => status.split("-").map((part) => `${part[0]?.toUpperCase() ?? ""}${part.slice(1)}`).join(" ");
|
|
6165
6352
|
var formatLatency = (value) => typeof value === "number" ? `${value}ms` : "No samples";
|
|
@@ -6215,25 +6402,25 @@ var createVoiceProviderStatusViewModel = (snapshot, options = {}) => {
|
|
|
6215
6402
|
};
|
|
6216
6403
|
var renderVoiceProviderStatusHTML = (snapshot, options = {}) => {
|
|
6217
6404
|
const model = createVoiceProviderStatusViewModel(snapshot, options);
|
|
6218
|
-
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--${
|
|
6405
|
+
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--${escapeHtml14(provider.status)}">
|
|
6219
6406
|
<header>
|
|
6220
|
-
<strong>${
|
|
6221
|
-
<span>${
|
|
6407
|
+
<strong>${escapeHtml14(provider.label)}</strong>
|
|
6408
|
+
<span>${escapeHtml14(formatStatus4(provider.status))}</span>
|
|
6222
6409
|
</header>
|
|
6223
|
-
<p>${
|
|
6410
|
+
<p>${escapeHtml14(provider.detail)}</p>
|
|
6224
6411
|
<dl>${provider.rows.map((row) => `<div>
|
|
6225
|
-
<dt>${
|
|
6226
|
-
<dd>${
|
|
6412
|
+
<dt>${escapeHtml14(row.label)}</dt>
|
|
6413
|
+
<dd>${escapeHtml14(row.value)}</dd>
|
|
6227
6414
|
</div>`).join("")}</dl>
|
|
6228
6415
|
</article>`).join("")}</div>` : '<p class="absolute-voice-provider-status__empty">Run voice traffic to see provider health.</p>';
|
|
6229
|
-
return `<section class="absolute-voice-provider-status absolute-voice-provider-status--${
|
|
6416
|
+
return `<section class="absolute-voice-provider-status absolute-voice-provider-status--${escapeHtml14(model.status)}">
|
|
6230
6417
|
<header class="absolute-voice-provider-status__header">
|
|
6231
|
-
<span class="absolute-voice-provider-status__eyebrow">${
|
|
6232
|
-
<strong class="absolute-voice-provider-status__label">${
|
|
6418
|
+
<span class="absolute-voice-provider-status__eyebrow">${escapeHtml14(model.title)}</span>
|
|
6419
|
+
<strong class="absolute-voice-provider-status__label">${escapeHtml14(model.label)}</strong>
|
|
6233
6420
|
</header>
|
|
6234
|
-
<p class="absolute-voice-provider-status__description">${
|
|
6421
|
+
<p class="absolute-voice-provider-status__description">${escapeHtml14(model.description)}</p>
|
|
6235
6422
|
${providers}
|
|
6236
|
-
${model.error ? `<p class="absolute-voice-provider-status__error">${
|
|
6423
|
+
${model.error ? `<p class="absolute-voice-provider-status__error">${escapeHtml14(model.error)}</p>` : ""}
|
|
6237
6424
|
</section>`;
|
|
6238
6425
|
};
|
|
6239
6426
|
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}`;
|
|
@@ -6366,7 +6553,7 @@ var createVoiceRoutingStatusStore = (path = "/api/routing/latest", options = {})
|
|
|
6366
6553
|
// src/client/routingStatusWidget.ts
|
|
6367
6554
|
var DEFAULT_TITLE10 = "Voice Routing";
|
|
6368
6555
|
var DEFAULT_DESCRIPTION10 = "Latest provider routing decision from the self-hosted trace store.";
|
|
6369
|
-
var
|
|
6556
|
+
var escapeHtml15 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
6370
6557
|
var formatValue = (value, fallback = "None") => typeof value === "string" && value.trim() ? value : typeof value === "number" && Number.isFinite(value) ? String(value) : fallback;
|
|
6371
6558
|
var formatProviderRoutes = (routes) => routes && typeof routes === "object" ? Object.entries(routes).map(([role, provider]) => `${role}: ${formatValue(provider)}`).join(", ") || "None" : "None";
|
|
6372
6559
|
var getProviderRoute = (routes, role) => routes && typeof routes === "object" ? formatValue(routes[role], "Not configured") : "Not configured";
|
|
@@ -6448,22 +6635,22 @@ var createVoiceRoutingStatusViewModel = (snapshot, options = {}) => {
|
|
|
6448
6635
|
var renderVoiceRoutingStatusHTML = (snapshot, options = {}) => {
|
|
6449
6636
|
const model = createVoiceRoutingStatusViewModel(snapshot, options);
|
|
6450
6637
|
const activeStack = model.activeStack.length ? `<div class="absolute-voice-routing-status__stack" aria-label="Active voice stack">${model.activeStack.map((item) => `<div>
|
|
6451
|
-
<span>${
|
|
6452
|
-
<strong>${
|
|
6638
|
+
<span>${escapeHtml15(item.label)}</span>
|
|
6639
|
+
<strong>${escapeHtml15(item.value)}</strong>
|
|
6453
6640
|
</div>`).join("")}</div>` : "";
|
|
6454
6641
|
const rows = model.rows.length ? `<div class="absolute-voice-routing-status__grid">${model.rows.map((row) => `<div>
|
|
6455
|
-
<span>${
|
|
6456
|
-
<strong>${
|
|
6642
|
+
<span>${escapeHtml15(row.label)}</span>
|
|
6643
|
+
<strong>${escapeHtml15(row.value)}</strong>
|
|
6457
6644
|
</div>`).join("")}</div>` : '<p class="absolute-voice-routing-status__empty">Start a voice session to see the selected provider.</p>';
|
|
6458
|
-
return `<section class="absolute-voice-routing-status absolute-voice-routing-status--${
|
|
6645
|
+
return `<section class="absolute-voice-routing-status absolute-voice-routing-status--${escapeHtml15(model.status)}">
|
|
6459
6646
|
<header class="absolute-voice-routing-status__header">
|
|
6460
|
-
<span class="absolute-voice-routing-status__eyebrow">${
|
|
6461
|
-
<strong class="absolute-voice-routing-status__label">${
|
|
6647
|
+
<span class="absolute-voice-routing-status__eyebrow">${escapeHtml15(model.title)}</span>
|
|
6648
|
+
<strong class="absolute-voice-routing-status__label">${escapeHtml15(model.label)}</strong>
|
|
6462
6649
|
</header>
|
|
6463
|
-
<p class="absolute-voice-routing-status__description">${
|
|
6650
|
+
<p class="absolute-voice-routing-status__description">${escapeHtml15(model.description)}</p>
|
|
6464
6651
|
${activeStack}
|
|
6465
6652
|
${rows}
|
|
6466
|
-
${model.error ? `<p class="absolute-voice-routing-status__error">${
|
|
6653
|
+
${model.error ? `<p class="absolute-voice-routing-status__error">${escapeHtml15(model.error)}</p>` : ""}
|
|
6467
6654
|
</section>`;
|
|
6468
6655
|
};
|
|
6469
6656
|
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__stack{background:linear-gradient(135deg,#16130d,#49391f);border-radius:18px;color:#fff;display:grid;gap:8px;grid-template-columns:repeat(5,minmax(0,1fr));margin-top:14px;padding:12px}.absolute-voice-routing-status__stack div{border-left:1px solid rgba(255,255,255,.18);padding-left:10px}.absolute-voice-routing-status__stack div:first-child{border-left:0;padding-left:0}.absolute-voice-routing-status__stack span{color:#e9d9b8;display:block;font-size:11px;font-weight:800;letter-spacing:.08em;margin-bottom:5px;text-transform:uppercase}.absolute-voice-routing-status__stack strong{display:block;font-size:13px;line-height:1.25;overflow-wrap:anywhere}.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}@media (max-width:760px){.absolute-voice-routing-status__stack{grid-template-columns:repeat(2,minmax(0,1fr))}.absolute-voice-routing-status__stack div{border-left:0;border-top:1px solid rgba(255,255,255,.18);padding-left:0;padding-top:8px}.absolute-voice-routing-status__stack div:first-child{border-top:0;padding-top:0}}`;
|
|
@@ -6596,7 +6783,7 @@ var createVoiceTraceTimelineStore = (path = "/api/voice-traces", options = {}) =
|
|
|
6596
6783
|
// src/client/traceTimelineWidget.ts
|
|
6597
6784
|
var DEFAULT_TITLE11 = "Voice Traces";
|
|
6598
6785
|
var DEFAULT_DESCRIPTION11 = "Latest call timelines with provider latency, fallbacks, handoffs, and errors from your self-hosted trace store.";
|
|
6599
|
-
var
|
|
6786
|
+
var escapeHtml16 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
6600
6787
|
var formatMs2 = (value) => typeof value === "number" ? `${value}ms` : "n/a";
|
|
6601
6788
|
var formatProviders = (session) => session.providers.length ? session.providers.map((provider) => provider.provider).join(", ") : "No providers";
|
|
6602
6789
|
var createVoiceTraceTimelineViewModel = (snapshot, options = {}) => {
|
|
@@ -6626,27 +6813,27 @@ var renderVoiceTraceTimelineWidgetHTML = (snapshot, options = {}) => {
|
|
|
6626
6813
|
const model = createVoiceTraceTimelineViewModel(snapshot, options);
|
|
6627
6814
|
const sessions = model.sessions.length ? `<div class="absolute-voice-trace-timeline__sessions">${model.sessions.map((session) => {
|
|
6628
6815
|
const supportLinks = [
|
|
6629
|
-
`<a href="${
|
|
6630
|
-
session.operationsRecordHref ? `<a href="${
|
|
6631
|
-
session.incidentBundleHref ? `<a href="${
|
|
6816
|
+
`<a href="${escapeHtml16(session.detailHref)}">Open timeline</a>`,
|
|
6817
|
+
session.operationsRecordHref ? `<a href="${escapeHtml16(session.operationsRecordHref)}">Open operations record</a>` : undefined,
|
|
6818
|
+
session.incidentBundleHref ? `<a href="${escapeHtml16(session.incidentBundleHref)}">Export incident bundle</a>` : undefined
|
|
6632
6819
|
].filter(Boolean).join("");
|
|
6633
|
-
return `<article class="absolute-voice-trace-timeline__session absolute-voice-trace-timeline__session--${
|
|
6820
|
+
return `<article class="absolute-voice-trace-timeline__session absolute-voice-trace-timeline__session--${escapeHtml16(session.status)}">
|
|
6634
6821
|
<header>
|
|
6635
|
-
<strong>${
|
|
6636
|
-
<span>${
|
|
6822
|
+
<strong>${escapeHtml16(session.sessionId)}</strong>
|
|
6823
|
+
<span>${escapeHtml16(session.status)}</span>
|
|
6637
6824
|
</header>
|
|
6638
|
-
<p>${
|
|
6825
|
+
<p>${escapeHtml16(session.label)} \xB7 ${escapeHtml16(session.durationLabel)} \xB7 ${escapeHtml16(session.providerLabel)}</p>
|
|
6639
6826
|
<p class="absolute-voice-trace-timeline__actions">${supportLinks}</p>
|
|
6640
6827
|
</article>`;
|
|
6641
6828
|
}).join("")}</div>` : '<p class="absolute-voice-trace-timeline__empty">Run a voice session to see call timelines.</p>';
|
|
6642
|
-
return `<section class="absolute-voice-trace-timeline absolute-voice-trace-timeline--${
|
|
6829
|
+
return `<section class="absolute-voice-trace-timeline absolute-voice-trace-timeline--${escapeHtml16(model.status)}">
|
|
6643
6830
|
<header class="absolute-voice-trace-timeline__header">
|
|
6644
|
-
<span class="absolute-voice-trace-timeline__eyebrow">${
|
|
6645
|
-
<strong class="absolute-voice-trace-timeline__label">${
|
|
6831
|
+
<span class="absolute-voice-trace-timeline__eyebrow">${escapeHtml16(model.title)}</span>
|
|
6832
|
+
<strong class="absolute-voice-trace-timeline__label">${escapeHtml16(model.label)}</strong>
|
|
6646
6833
|
</header>
|
|
6647
|
-
<p class="absolute-voice-trace-timeline__description">${
|
|
6834
|
+
<p class="absolute-voice-trace-timeline__description">${escapeHtml16(model.description)}</p>
|
|
6648
6835
|
${sessions}
|
|
6649
|
-
${model.error ? `<p class="absolute-voice-trace-timeline__error">${
|
|
6836
|
+
${model.error ? `<p class="absolute-voice-trace-timeline__error">${escapeHtml16(model.error)}</p>` : ""}
|
|
6650
6837
|
</section>`;
|
|
6651
6838
|
};
|
|
6652
6839
|
var getVoiceTraceTimelineCSS = () => `.absolute-voice-trace-timeline{border:1px solid #bad7d3;border-radius:20px;background:#f3fffb;color:#09201c;padding:18px;box-shadow:0 18px 40px rgba(9,32,28,.12);font-family:inherit}.absolute-voice-trace-timeline--error,.absolute-voice-trace-timeline--failed{border-color:#f2a7a7;background:#fff5f3}.absolute-voice-trace-timeline--warning{border-color:#fbbf24;background:#fffaf0}.absolute-voice-trace-timeline__header,.absolute-voice-trace-timeline__session header{align-items:start;display:flex;gap:12px;justify-content:space-between}.absolute-voice-trace-timeline__eyebrow{color:#17665b;font-size:12px;font-weight:800;letter-spacing:.08em;text-transform:uppercase}.absolute-voice-trace-timeline__label{font-size:24px;line-height:1}.absolute-voice-trace-timeline__description,.absolute-voice-trace-timeline__session p,.absolute-voice-trace-timeline__empty{color:#35544f}.absolute-voice-trace-timeline__sessions{display:grid;gap:12px;margin-top:14px}.absolute-voice-trace-timeline__session{background:#fff;border:1px solid #cfe7e2;border-radius:16px;padding:14px}.absolute-voice-trace-timeline__session--failed{border-color:#f2a7a7}.absolute-voice-trace-timeline__session--warning{border-color:#fbbf24}.absolute-voice-trace-timeline__session p{margin:10px 0}.absolute-voice-trace-timeline__actions{display:flex;flex-wrap:wrap;gap:10px}.absolute-voice-trace-timeline__session a{color:#0f766e;font-weight:800}.absolute-voice-trace-timeline__empty{margin:14px 0 0}.absolute-voice-trace-timeline__error{color:#9f1239;font-weight:700}`;
|
|
@@ -6778,7 +6965,7 @@ var createVoiceAgentSquadStatusStore = (path = "/api/voice-traces", options = {}
|
|
|
6778
6965
|
// src/client/agentSquadStatusWidget.ts
|
|
6779
6966
|
var DEFAULT_TITLE12 = "Voice Agent Squad";
|
|
6780
6967
|
var DEFAULT_DESCRIPTION12 = "Current specialist and recent handoffs from your self-hosted voice traces.";
|
|
6781
|
-
var
|
|
6968
|
+
var escapeHtml17 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
6782
6969
|
var labelFor = (current) => {
|
|
6783
6970
|
if (!current)
|
|
6784
6971
|
return "Waiting for specialist activity";
|
|
@@ -6805,24 +6992,24 @@ var renderVoiceAgentSquadStatusHTML = (snapshot, options = {}) => {
|
|
|
6805
6992
|
const model = createVoiceAgentSquadStatusViewModel(snapshot, options);
|
|
6806
6993
|
const current = model.current;
|
|
6807
6994
|
const rows = model.sessions.length ? model.sessions.slice(0, 5).map((session) => `<li>
|
|
6808
|
-
<span>${
|
|
6809
|
-
<strong>${
|
|
6810
|
-
<em>${
|
|
6811
|
-
${session.summary || session.reason ? `<p>${
|
|
6995
|
+
<span>${escapeHtml17(session.sessionId)}</span>
|
|
6996
|
+
<strong>${escapeHtml17(session.targetAgentId ?? "none")}</strong>
|
|
6997
|
+
<em>${escapeHtml17(session.status)}</em>
|
|
6998
|
+
${session.summary || session.reason ? `<p>${escapeHtml17(session.summary ?? session.reason ?? "")}</p>` : ""}
|
|
6812
6999
|
</li>`).join("") : "<li><span>No squad traces yet.</span><strong>Waiting</strong></li>";
|
|
6813
7000
|
return `<section class="absolute-voice-agent-squad-status">
|
|
6814
7001
|
<header>
|
|
6815
|
-
<span>${
|
|
6816
|
-
<strong>${
|
|
7002
|
+
<span>${escapeHtml17(model.title)}</span>
|
|
7003
|
+
<strong>${escapeHtml17(model.label)}</strong>
|
|
6817
7004
|
</header>
|
|
6818
|
-
<p>${
|
|
7005
|
+
<p>${escapeHtml17(model.description)}</p>
|
|
6819
7006
|
<div>
|
|
6820
|
-
<span>Session</span><strong>${
|
|
6821
|
-
<span>From</span><strong>${
|
|
6822
|
-
<span>Status</span><strong>${
|
|
7007
|
+
<span>Session</span><strong>${escapeHtml17(current?.sessionId ?? "n/a")}</strong>
|
|
7008
|
+
<span>From</span><strong>${escapeHtml17(current?.fromAgentId ?? "n/a")}</strong>
|
|
7009
|
+
<span>Status</span><strong>${escapeHtml17(current?.status ?? "idle")}</strong>
|
|
6823
7010
|
</div>
|
|
6824
7011
|
<ul>${rows}</ul>
|
|
6825
|
-
${model.error ? `<p class="absolute-voice-agent-squad-status__error">${
|
|
7012
|
+
${model.error ? `<p class="absolute-voice-agent-squad-status__error">${escapeHtml17(model.error)}</p>` : ""}
|
|
6826
7013
|
</section>`;
|
|
6827
7014
|
};
|
|
6828
7015
|
var getVoiceAgentSquadStatusCSS = () => `.absolute-voice-agent-squad-status{border:1px solid #38bdf866;border-radius:20px;background:#0f172a;color:#f8fafc;padding:18px;font-family:inherit}.absolute-voice-agent-squad-status header{display:grid;gap:4px}.absolute-voice-agent-squad-status header span{color:#7dd3fc;font-size:12px;font-weight:900;letter-spacing:.08em;text-transform:uppercase}.absolute-voice-agent-squad-status header strong{font-size:20px}.absolute-voice-agent-squad-status p{color:#cbd5e1}.absolute-voice-agent-squad-status div{display:grid;gap:6px;grid-template-columns:max-content 1fr;margin:14px 0}.absolute-voice-agent-squad-status div span{color:#94a3b8}.absolute-voice-agent-squad-status ul{display:grid;gap:8px;list-style:none;margin:0;padding:0}.absolute-voice-agent-squad-status li{background:#020617;border:1px solid #1e293b;border-radius:14px;padding:10px}.absolute-voice-agent-squad-status li span{color:#94a3b8;display:block;font-size:12px}.absolute-voice-agent-squad-status li strong{display:block}.absolute-voice-agent-squad-status li em{color:#7dd3fc;font-style:normal}.absolute-voice-agent-squad-status__error{color:#fecaca;font-weight:800}`;
|
|
@@ -6985,7 +7172,7 @@ var createVoiceTurnLatencyStore = (path = "/api/turn-latency", options = {}) =>
|
|
|
6985
7172
|
var DEFAULT_TITLE13 = "Turn Latency";
|
|
6986
7173
|
var DEFAULT_DESCRIPTION13 = "Per-turn timing from first transcript to commit and assistant response start.";
|
|
6987
7174
|
var DEFAULT_PROOF_LABEL = "Run latency proof";
|
|
6988
|
-
var
|
|
7175
|
+
var escapeHtml18 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
6989
7176
|
var formatMs3 = (value) => typeof value === "number" ? `${Math.round(value)}ms` : "n/a";
|
|
6990
7177
|
var createVoiceTurnLatencyViewModel = (snapshot, options = {}) => {
|
|
6991
7178
|
const turns = (snapshot.report?.turns ?? []).map((turn) => ({
|
|
@@ -7013,25 +7200,25 @@ var createVoiceTurnLatencyViewModel = (snapshot, options = {}) => {
|
|
|
7013
7200
|
};
|
|
7014
7201
|
var renderVoiceTurnLatencyHTML = (snapshot, options = {}) => {
|
|
7015
7202
|
const model = createVoiceTurnLatencyViewModel(snapshot, options);
|
|
7016
|
-
const turns = model.turns.length ? `<div class="absolute-voice-turn-latency__turns">${model.turns.map((turn) => `<article class="absolute-voice-turn-latency__turn absolute-voice-turn-latency__turn--${
|
|
7203
|
+
const turns = model.turns.length ? `<div class="absolute-voice-turn-latency__turns">${model.turns.map((turn) => `<article class="absolute-voice-turn-latency__turn absolute-voice-turn-latency__turn--${escapeHtml18(turn.status)}">
|
|
7017
7204
|
<header>
|
|
7018
|
-
<strong>${
|
|
7019
|
-
<span>${
|
|
7205
|
+
<strong>${escapeHtml18(turn.label)}</strong>
|
|
7206
|
+
<span>${escapeHtml18(turn.status)}</span>
|
|
7020
7207
|
</header>
|
|
7021
7208
|
<dl>${turn.rows.map((row) => `<div>
|
|
7022
|
-
<dt>${
|
|
7023
|
-
<dd>${
|
|
7209
|
+
<dt>${escapeHtml18(row.label)}</dt>
|
|
7210
|
+
<dd>${escapeHtml18(row.value)}</dd>
|
|
7024
7211
|
</div>`).join("")}</dl>
|
|
7025
7212
|
</article>`).join("")}</div>` : '<p class="absolute-voice-turn-latency__empty">Complete a voice turn to see latency diagnostics.</p>';
|
|
7026
|
-
return `<section class="absolute-voice-turn-latency absolute-voice-turn-latency--${
|
|
7213
|
+
return `<section class="absolute-voice-turn-latency absolute-voice-turn-latency--${escapeHtml18(model.status)}">
|
|
7027
7214
|
<header class="absolute-voice-turn-latency__header">
|
|
7028
|
-
<span class="absolute-voice-turn-latency__eyebrow">${
|
|
7029
|
-
<strong class="absolute-voice-turn-latency__label">${
|
|
7215
|
+
<span class="absolute-voice-turn-latency__eyebrow">${escapeHtml18(model.title)}</span>
|
|
7216
|
+
<strong class="absolute-voice-turn-latency__label">${escapeHtml18(model.label)}</strong>
|
|
7030
7217
|
</header>
|
|
7031
|
-
<p class="absolute-voice-turn-latency__description">${
|
|
7032
|
-
${model.showProofAction ? `<button class="absolute-voice-turn-latency__proof" data-absolute-voice-turn-latency-proof type="button">${
|
|
7218
|
+
<p class="absolute-voice-turn-latency__description">${escapeHtml18(model.description)}</p>
|
|
7219
|
+
${model.showProofAction ? `<button class="absolute-voice-turn-latency__proof" data-absolute-voice-turn-latency-proof type="button">${escapeHtml18(model.proofLabel ?? DEFAULT_PROOF_LABEL)}</button>` : ""}
|
|
7033
7220
|
${turns}
|
|
7034
|
-
${model.error ? `<p class="absolute-voice-turn-latency__error">${
|
|
7221
|
+
${model.error ? `<p class="absolute-voice-turn-latency__error">${escapeHtml18(model.error)}</p>` : ""}
|
|
7035
7222
|
</section>`;
|
|
7036
7223
|
};
|
|
7037
7224
|
var mountVoiceTurnLatency = (element, path = "/api/turn-latency", options = {}) => {
|
|
@@ -7172,7 +7359,7 @@ var createVoiceTurnQualityStore = (path = "/api/turn-quality", options = {}) =>
|
|
|
7172
7359
|
// src/client/turnQualityWidget.ts
|
|
7173
7360
|
var DEFAULT_TITLE14 = "Turn Quality";
|
|
7174
7361
|
var DEFAULT_DESCRIPTION14 = "Per-turn STT confidence, fallback selection, corrections, and transcript coverage.";
|
|
7175
|
-
var
|
|
7362
|
+
var escapeHtml19 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
7176
7363
|
var formatConfidence = (value) => typeof value === "number" ? `${Math.round(value * 100)}%` : "n/a";
|
|
7177
7364
|
var formatMaybe = (value) => value === undefined || value === "" ? "n/a" : String(value);
|
|
7178
7365
|
var getTurnDetail = (turn) => {
|
|
@@ -7228,25 +7415,25 @@ var createVoiceTurnQualityViewModel = (snapshot, options = {}) => {
|
|
|
7228
7415
|
};
|
|
7229
7416
|
var renderVoiceTurnQualityHTML = (snapshot, options = {}) => {
|
|
7230
7417
|
const model = createVoiceTurnQualityViewModel(snapshot, options);
|
|
7231
|
-
const turns = model.turns.length ? `<div class="absolute-voice-turn-quality__turns">${model.turns.map((turn) => `<article class="absolute-voice-turn-quality__turn absolute-voice-turn-quality__turn--${
|
|
7418
|
+
const turns = model.turns.length ? `<div class="absolute-voice-turn-quality__turns">${model.turns.map((turn) => `<article class="absolute-voice-turn-quality__turn absolute-voice-turn-quality__turn--${escapeHtml19(turn.status)}">
|
|
7232
7419
|
<header>
|
|
7233
|
-
<strong>${
|
|
7234
|
-
<span>${
|
|
7420
|
+
<strong>${escapeHtml19(turn.label)}</strong>
|
|
7421
|
+
<span>${escapeHtml19(turn.status)}</span>
|
|
7235
7422
|
</header>
|
|
7236
|
-
<p>${
|
|
7423
|
+
<p>${escapeHtml19(turn.detail)}</p>
|
|
7237
7424
|
<dl>${turn.rows.map((row) => `<div>
|
|
7238
|
-
<dt>${
|
|
7239
|
-
<dd>${
|
|
7425
|
+
<dt>${escapeHtml19(row.label)}</dt>
|
|
7426
|
+
<dd>${escapeHtml19(row.value)}</dd>
|
|
7240
7427
|
</div>`).join("")}</dl>
|
|
7241
7428
|
</article>`).join("")}</div>` : '<p class="absolute-voice-turn-quality__empty">Complete a voice turn to see STT quality diagnostics.</p>';
|
|
7242
|
-
return `<section class="absolute-voice-turn-quality absolute-voice-turn-quality--${
|
|
7429
|
+
return `<section class="absolute-voice-turn-quality absolute-voice-turn-quality--${escapeHtml19(model.status)}">
|
|
7243
7430
|
<header class="absolute-voice-turn-quality__header">
|
|
7244
|
-
<span class="absolute-voice-turn-quality__eyebrow">${
|
|
7245
|
-
<strong class="absolute-voice-turn-quality__label">${
|
|
7431
|
+
<span class="absolute-voice-turn-quality__eyebrow">${escapeHtml19(model.title)}</span>
|
|
7432
|
+
<strong class="absolute-voice-turn-quality__label">${escapeHtml19(model.label)}</strong>
|
|
7246
7433
|
</header>
|
|
7247
|
-
<p class="absolute-voice-turn-quality__description">${
|
|
7434
|
+
<p class="absolute-voice-turn-quality__description">${escapeHtml19(model.description)}</p>
|
|
7248
7435
|
${turns}
|
|
7249
|
-
${model.error ? `<p class="absolute-voice-turn-quality__error">${
|
|
7436
|
+
${model.error ? `<p class="absolute-voice-turn-quality__error">${escapeHtml19(model.error)}</p>` : ""}
|
|
7250
7437
|
</section>`;
|
|
7251
7438
|
};
|
|
7252
7439
|
var getVoiceTurnQualityCSS = () => `.absolute-voice-turn-quality{border:1px solid #e4d1a3;border-radius:20px;background:#fff9eb;color:#17120a;padding:18px;box-shadow:0 18px 40px rgba(73,48,14,.12);font-family:inherit}.absolute-voice-turn-quality--error,.absolute-voice-turn-quality--warning{border-color:#f2a7a7;background:#fff5f3}.absolute-voice-turn-quality__header,.absolute-voice-turn-quality__turn header{align-items:start;display:flex;gap:12px;justify-content:space-between}.absolute-voice-turn-quality__eyebrow{color:#8a5a0a;font-size:12px;font-weight:800;letter-spacing:.08em;text-transform:uppercase}.absolute-voice-turn-quality__label{font-size:24px;line-height:1}.absolute-voice-turn-quality__description,.absolute-voice-turn-quality__turn p,.absolute-voice-turn-quality__turn dt,.absolute-voice-turn-quality__empty{color:#5a4930}.absolute-voice-turn-quality__turns{display:grid;gap:12px;margin-top:14px}.absolute-voice-turn-quality__turn{background:#fff;border:1px solid #f0dfba;border-radius:16px;padding:14px}.absolute-voice-turn-quality__turn--pass{border-color:#86efac}.absolute-voice-turn-quality__turn--warn,.absolute-voice-turn-quality__turn--unknown{border-color:#fbbf24}.absolute-voice-turn-quality__turn--fail{border-color:#f2a7a7}.absolute-voice-turn-quality__turn p{margin:10px 0}.absolute-voice-turn-quality__turn dl{display:grid;gap:8px;grid-template-columns:repeat(2,minmax(0,1fr));margin:0}.absolute-voice-turn-quality__turn div{background:#fff9eb;border:1px solid #f0dfba;border-radius:12px;padding:8px}.absolute-voice-turn-quality__turn dt{font-size:12px}.absolute-voice-turn-quality__turn dd{font-weight:800;margin:4px 0 0}.absolute-voice-turn-quality__empty{margin:14px 0 0}.absolute-voice-turn-quality__error{color:#9f1239;font-weight:700}`;
|
|
@@ -7381,6 +7568,7 @@ export {
|
|
|
7381
7568
|
renderVoiceReplayTimelineHTML,
|
|
7382
7569
|
renderVoiceLiveCallViewerHTML,
|
|
7383
7570
|
renderVoiceCostDashboardHTML,
|
|
7571
|
+
renderVoiceCallPlayerHTML,
|
|
7384
7572
|
createVoiceWorkflowStatus,
|
|
7385
7573
|
createVoiceWidget,
|
|
7386
7574
|
createVoiceTurnQuality,
|
|
@@ -7408,6 +7596,7 @@ export {
|
|
|
7408
7596
|
createVoiceCostDashboard,
|
|
7409
7597
|
createVoiceController,
|
|
7410
7598
|
createVoiceCampaignDialerProof,
|
|
7599
|
+
createVoiceCallPlayer2 as createVoiceCallPlayer,
|
|
7411
7600
|
createVoiceCallDebugger,
|
|
7412
7601
|
createVoiceAgentSquadStatus
|
|
7413
7602
|
};
|