@absolutejs/voice 0.0.22-beta.459 → 0.0.22-beta.460
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 +1 -0
- package/dist/angular/index.js +328 -204
- package/dist/angular/voice-session-observability.service.d.ts +12 -0
- package/dist/client/index.d.ts +4 -0
- package/dist/client/index.js +528 -362
- package/dist/client/sessionObservability.d.ts +19 -0
- package/dist/client/sessionObservabilityWidget.d.ts +31 -0
- package/dist/react/VoiceSessionObservability.d.ts +6 -0
- package/dist/react/index.d.ts +2 -0
- package/dist/react/index.js +716 -460
- package/dist/react/useVoiceSessionObservability.d.ts +8 -0
- package/dist/svelte/createVoiceSessionObservability.d.ts +10 -0
- package/dist/svelte/index.d.ts +1 -0
- package/dist/svelte/index.js +313 -142
- package/dist/vue/VoiceSessionObservability.d.ts +23 -0
- package/dist/vue/index.d.ts +2 -0
- package/dist/vue/index.js +589 -339
- package/dist/vue/useVoiceSessionObservability.d.ts +9 -0
- package/package.json +1 -1
package/dist/react/index.js
CHANGED
|
@@ -7096,6 +7096,260 @@ var VoiceSessionSnapshot = ({
|
|
|
7096
7096
|
]
|
|
7097
7097
|
}, undefined, true, undefined, this);
|
|
7098
7098
|
};
|
|
7099
|
+
// src/client/sessionObservability.ts
|
|
7100
|
+
var fetchVoiceSessionObservability = async (path, options = {}) => {
|
|
7101
|
+
const fetchImpl = options.fetch ?? globalThis.fetch;
|
|
7102
|
+
const response = await fetchImpl(path);
|
|
7103
|
+
if (!response.ok) {
|
|
7104
|
+
throw new Error(`Voice session observability failed: HTTP ${response.status}`);
|
|
7105
|
+
}
|
|
7106
|
+
return await response.json();
|
|
7107
|
+
};
|
|
7108
|
+
var createVoiceSessionObservabilityStore = (path, options = {}) => {
|
|
7109
|
+
const listeners = new Set;
|
|
7110
|
+
let closed = false;
|
|
7111
|
+
let timer;
|
|
7112
|
+
let snapshot = {
|
|
7113
|
+
error: null,
|
|
7114
|
+
isLoading: false,
|
|
7115
|
+
report: null
|
|
7116
|
+
};
|
|
7117
|
+
const emit = () => {
|
|
7118
|
+
for (const listener of listeners) {
|
|
7119
|
+
listener();
|
|
7120
|
+
}
|
|
7121
|
+
};
|
|
7122
|
+
const refresh = async () => {
|
|
7123
|
+
if (closed) {
|
|
7124
|
+
return snapshot.report;
|
|
7125
|
+
}
|
|
7126
|
+
snapshot = {
|
|
7127
|
+
...snapshot,
|
|
7128
|
+
error: null,
|
|
7129
|
+
isLoading: true
|
|
7130
|
+
};
|
|
7131
|
+
emit();
|
|
7132
|
+
try {
|
|
7133
|
+
const report = await fetchVoiceSessionObservability(path, options);
|
|
7134
|
+
snapshot = {
|
|
7135
|
+
error: null,
|
|
7136
|
+
isLoading: false,
|
|
7137
|
+
report,
|
|
7138
|
+
updatedAt: Date.now()
|
|
7139
|
+
};
|
|
7140
|
+
emit();
|
|
7141
|
+
return report;
|
|
7142
|
+
} catch (error) {
|
|
7143
|
+
snapshot = {
|
|
7144
|
+
...snapshot,
|
|
7145
|
+
error: error instanceof Error ? error.message : String(error),
|
|
7146
|
+
isLoading: false
|
|
7147
|
+
};
|
|
7148
|
+
emit();
|
|
7149
|
+
throw error;
|
|
7150
|
+
}
|
|
7151
|
+
};
|
|
7152
|
+
const close = () => {
|
|
7153
|
+
closed = true;
|
|
7154
|
+
if (timer) {
|
|
7155
|
+
clearInterval(timer);
|
|
7156
|
+
timer = undefined;
|
|
7157
|
+
}
|
|
7158
|
+
listeners.clear();
|
|
7159
|
+
};
|
|
7160
|
+
if (options.intervalMs && options.intervalMs > 0) {
|
|
7161
|
+
timer = setInterval(() => {
|
|
7162
|
+
refresh().catch(() => {});
|
|
7163
|
+
}, options.intervalMs);
|
|
7164
|
+
}
|
|
7165
|
+
return {
|
|
7166
|
+
close,
|
|
7167
|
+
getServerSnapshot: () => snapshot,
|
|
7168
|
+
getSnapshot: () => snapshot,
|
|
7169
|
+
refresh,
|
|
7170
|
+
subscribe: (listener) => {
|
|
7171
|
+
listeners.add(listener);
|
|
7172
|
+
return () => {
|
|
7173
|
+
listeners.delete(listener);
|
|
7174
|
+
};
|
|
7175
|
+
}
|
|
7176
|
+
};
|
|
7177
|
+
};
|
|
7178
|
+
|
|
7179
|
+
// src/client/sessionObservabilityWidget.ts
|
|
7180
|
+
var DEFAULT_TITLE9 = "Session Observability";
|
|
7181
|
+
var DEFAULT_DESCRIPTION9 = "One support/debug report for a voice call across traces, provider recovery, tools, handoffs, guardrails, turn waterfalls, and incident handoff.";
|
|
7182
|
+
var escapeHtml14 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
7183
|
+
var formatMs3 = (value) => typeof value === "number" ? `${value}ms` : "n/a";
|
|
7184
|
+
var createVoiceSessionObservabilityViewModel = (snapshot, options = {}) => {
|
|
7185
|
+
const report = snapshot.report;
|
|
7186
|
+
const turns = (report?.turns ?? []).slice(0, options.maxTurns ?? 3).map((turn) => ({
|
|
7187
|
+
...turn,
|
|
7188
|
+
durationLabel: formatMs3(turn.durationMs),
|
|
7189
|
+
label: `${turn.transcripts} transcripts / ${turn.toolCalls} tools / ${turn.providerDecisions} provider decisions`
|
|
7190
|
+
}));
|
|
7191
|
+
return {
|
|
7192
|
+
description: options.description ?? DEFAULT_DESCRIPTION9,
|
|
7193
|
+
error: snapshot.error,
|
|
7194
|
+
isLoading: snapshot.isLoading,
|
|
7195
|
+
label: snapshot.error ? "Unavailable" : report ? `${report.summary.turns} turns / ${report.summary.fallbacks} fallbacks / ${report.summary.errors} errors` : snapshot.isLoading ? "Checking" : "No session loaded",
|
|
7196
|
+
links: report?.links ?? [],
|
|
7197
|
+
sessionId: report?.sessionId,
|
|
7198
|
+
status: snapshot.error ? "error" : report?.status === "failed" ? "failed" : report?.status === "warning" ? "warning" : report ? "ready" : snapshot.isLoading ? "loading" : "empty",
|
|
7199
|
+
title: options.title ?? DEFAULT_TITLE9,
|
|
7200
|
+
turns,
|
|
7201
|
+
updatedAt: snapshot.updatedAt
|
|
7202
|
+
};
|
|
7203
|
+
};
|
|
7204
|
+
var renderLinks = (links) => links.length ? `<p class="absolute-voice-session-observability__actions">${links.map((link) => `<a href="${escapeHtml14(link.href)}">${escapeHtml14(link.label)}</a>`).join("")}</p>` : "";
|
|
7205
|
+
var renderVoiceSessionObservabilityHTML = (snapshot, options = {}) => {
|
|
7206
|
+
const model = createVoiceSessionObservabilityViewModel(snapshot, options);
|
|
7207
|
+
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>${escapeHtml14(turn.turnId)}</strong><span>${escapeHtml14(turn.durationLabel)}</span></header><p>${escapeHtml14(turn.label)}</p></article>`).join("")}</div>` : '<p class="absolute-voice-session-observability__empty">Open a voice session to see turn waterfalls.</p>';
|
|
7208
|
+
return `<section class="absolute-voice-session-observability absolute-voice-session-observability--${escapeHtml14(model.status)}">
|
|
7209
|
+
<header class="absolute-voice-session-observability__header">
|
|
7210
|
+
<span class="absolute-voice-session-observability__eyebrow">${escapeHtml14(model.title)}</span>
|
|
7211
|
+
<strong class="absolute-voice-session-observability__label">${escapeHtml14(model.label)}</strong>
|
|
7212
|
+
</header>
|
|
7213
|
+
<p class="absolute-voice-session-observability__description">${escapeHtml14(model.description)}</p>
|
|
7214
|
+
${model.sessionId ? `<p class="absolute-voice-session-observability__session">${escapeHtml14(model.sessionId)}</p>` : ""}
|
|
7215
|
+
${renderLinks(model.links)}
|
|
7216
|
+
${turns}
|
|
7217
|
+
${model.error ? `<p class="absolute-voice-session-observability__error">${escapeHtml14(model.error)}</p>` : ""}
|
|
7218
|
+
</section>`;
|
|
7219
|
+
};
|
|
7220
|
+
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}`;
|
|
7221
|
+
var mountVoiceSessionObservability = (element, path, options = {}) => {
|
|
7222
|
+
const store = createVoiceSessionObservabilityStore(path, options);
|
|
7223
|
+
const render = () => {
|
|
7224
|
+
element.innerHTML = renderVoiceSessionObservabilityHTML(store.getSnapshot(), options);
|
|
7225
|
+
};
|
|
7226
|
+
const unsubscribe = store.subscribe(render);
|
|
7227
|
+
render();
|
|
7228
|
+
store.refresh().catch(() => {});
|
|
7229
|
+
return {
|
|
7230
|
+
close: () => {
|
|
7231
|
+
unsubscribe();
|
|
7232
|
+
store.close();
|
|
7233
|
+
},
|
|
7234
|
+
refresh: store.refresh
|
|
7235
|
+
};
|
|
7236
|
+
};
|
|
7237
|
+
var defineVoiceSessionObservabilityElement = (tagName = "absolute-voice-session-observability") => {
|
|
7238
|
+
if (typeof window === "undefined" || typeof customElements === "undefined" || customElements.get(tagName)) {
|
|
7239
|
+
return;
|
|
7240
|
+
}
|
|
7241
|
+
customElements.define(tagName, class AbsoluteVoiceSessionObservabilityElement extends HTMLElement {
|
|
7242
|
+
mounted;
|
|
7243
|
+
connectedCallback() {
|
|
7244
|
+
const intervalMs = Number(this.getAttribute("interval-ms") ?? 5000);
|
|
7245
|
+
const maxTurns = Number(this.getAttribute("max-turns") ?? 3);
|
|
7246
|
+
this.mounted = mountVoiceSessionObservability(this, this.getAttribute("path") ?? "/api/voice/session-observability/latest", {
|
|
7247
|
+
description: this.getAttribute("description") ?? undefined,
|
|
7248
|
+
intervalMs: Number.isFinite(intervalMs) ? intervalMs : 5000,
|
|
7249
|
+
maxTurns: Number.isFinite(maxTurns) ? maxTurns : 3,
|
|
7250
|
+
title: this.getAttribute("title") ?? undefined
|
|
7251
|
+
});
|
|
7252
|
+
}
|
|
7253
|
+
disconnectedCallback() {
|
|
7254
|
+
this.mounted?.close();
|
|
7255
|
+
this.mounted = undefined;
|
|
7256
|
+
}
|
|
7257
|
+
});
|
|
7258
|
+
};
|
|
7259
|
+
|
|
7260
|
+
// src/react/useVoiceSessionObservability.tsx
|
|
7261
|
+
import { useEffect as useEffect9, useRef as useRef9, useSyncExternalStore as useSyncExternalStore9 } from "react";
|
|
7262
|
+
var useVoiceSessionObservability = (path = "/api/voice/session-observability/latest", options = {}) => {
|
|
7263
|
+
const storeRef = useRef9(null);
|
|
7264
|
+
if (!storeRef.current) {
|
|
7265
|
+
storeRef.current = createVoiceSessionObservabilityStore(path, options);
|
|
7266
|
+
}
|
|
7267
|
+
const store = storeRef.current;
|
|
7268
|
+
useEffect9(() => {
|
|
7269
|
+
store.refresh().catch(() => {});
|
|
7270
|
+
return () => store.close();
|
|
7271
|
+
}, [store]);
|
|
7272
|
+
return {
|
|
7273
|
+
...useSyncExternalStore9(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
7274
|
+
refresh: store.refresh
|
|
7275
|
+
};
|
|
7276
|
+
};
|
|
7277
|
+
|
|
7278
|
+
// src/react/VoiceSessionObservability.tsx
|
|
7279
|
+
import { jsxDEV as jsxDEV9 } from "react/jsx-dev-runtime";
|
|
7280
|
+
var VoiceSessionObservability = ({
|
|
7281
|
+
className,
|
|
7282
|
+
path = "/api/voice/session-observability/latest",
|
|
7283
|
+
...options
|
|
7284
|
+
}) => {
|
|
7285
|
+
const snapshot = useVoiceSessionObservability(path, options);
|
|
7286
|
+
const model = createVoiceSessionObservabilityViewModel(snapshot, options);
|
|
7287
|
+
return /* @__PURE__ */ jsxDEV9("section", {
|
|
7288
|
+
className: [
|
|
7289
|
+
"absolute-voice-session-observability",
|
|
7290
|
+
`absolute-voice-session-observability--${model.status}`,
|
|
7291
|
+
className
|
|
7292
|
+
].filter(Boolean).join(" "),
|
|
7293
|
+
children: [
|
|
7294
|
+
/* @__PURE__ */ jsxDEV9("header", {
|
|
7295
|
+
className: "absolute-voice-session-observability__header",
|
|
7296
|
+
children: [
|
|
7297
|
+
/* @__PURE__ */ jsxDEV9("span", {
|
|
7298
|
+
className: "absolute-voice-session-observability__eyebrow",
|
|
7299
|
+
children: model.title
|
|
7300
|
+
}, undefined, false, undefined, this),
|
|
7301
|
+
/* @__PURE__ */ jsxDEV9("strong", {
|
|
7302
|
+
className: "absolute-voice-session-observability__label",
|
|
7303
|
+
children: model.label
|
|
7304
|
+
}, undefined, false, undefined, this)
|
|
7305
|
+
]
|
|
7306
|
+
}, undefined, true, undefined, this),
|
|
7307
|
+
/* @__PURE__ */ jsxDEV9("p", {
|
|
7308
|
+
className: "absolute-voice-session-observability__description",
|
|
7309
|
+
children: model.description
|
|
7310
|
+
}, undefined, false, undefined, this),
|
|
7311
|
+
model.sessionId ? /* @__PURE__ */ jsxDEV9("p", {
|
|
7312
|
+
className: "absolute-voice-session-observability__session",
|
|
7313
|
+
children: model.sessionId
|
|
7314
|
+
}, undefined, false, undefined, this) : null,
|
|
7315
|
+
model.links.length ? /* @__PURE__ */ jsxDEV9("p", {
|
|
7316
|
+
className: "absolute-voice-session-observability__actions",
|
|
7317
|
+
children: model.links.map((link) => /* @__PURE__ */ jsxDEV9("a", {
|
|
7318
|
+
href: link.href,
|
|
7319
|
+
children: link.label
|
|
7320
|
+
}, `${link.rel}:${link.href}`, false, undefined, this))
|
|
7321
|
+
}, undefined, false, undefined, this) : null,
|
|
7322
|
+
model.turns.length ? /* @__PURE__ */ jsxDEV9("div", {
|
|
7323
|
+
className: "absolute-voice-session-observability__turns",
|
|
7324
|
+
children: model.turns.map((turn) => /* @__PURE__ */ jsxDEV9("article", {
|
|
7325
|
+
className: "absolute-voice-session-observability__turn",
|
|
7326
|
+
children: [
|
|
7327
|
+
/* @__PURE__ */ jsxDEV9("header", {
|
|
7328
|
+
children: [
|
|
7329
|
+
/* @__PURE__ */ jsxDEV9("strong", {
|
|
7330
|
+
children: turn.turnId
|
|
7331
|
+
}, undefined, false, undefined, this),
|
|
7332
|
+
/* @__PURE__ */ jsxDEV9("span", {
|
|
7333
|
+
children: turn.durationLabel
|
|
7334
|
+
}, undefined, false, undefined, this)
|
|
7335
|
+
]
|
|
7336
|
+
}, undefined, true, undefined, this),
|
|
7337
|
+
/* @__PURE__ */ jsxDEV9("p", {
|
|
7338
|
+
children: turn.label
|
|
7339
|
+
}, undefined, false, undefined, this)
|
|
7340
|
+
]
|
|
7341
|
+
}, turn.turnId, true, undefined, this))
|
|
7342
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV9("p", {
|
|
7343
|
+
className: "absolute-voice-session-observability__empty",
|
|
7344
|
+
children: "Open a voice session to see turn waterfalls."
|
|
7345
|
+
}, undefined, false, undefined, this),
|
|
7346
|
+
model.error ? /* @__PURE__ */ jsxDEV9("p", {
|
|
7347
|
+
className: "absolute-voice-session-observability__error",
|
|
7348
|
+
children: model.error
|
|
7349
|
+
}, undefined, false, undefined, this) : null
|
|
7350
|
+
]
|
|
7351
|
+
}, undefined, true, undefined, this);
|
|
7352
|
+
};
|
|
7099
7353
|
// src/client/profileComparison.ts
|
|
7100
7354
|
var fetchVoiceProfileComparison = async (path = "/api/voice/real-call-profile-history", options = {}) => {
|
|
7101
7355
|
const fetchImpl = options.fetch ?? globalThis.fetch;
|
|
@@ -7172,20 +7426,20 @@ var createVoiceProfileComparisonStore = (path = "/api/voice/real-call-profile-hi
|
|
|
7172
7426
|
};
|
|
7173
7427
|
|
|
7174
7428
|
// src/client/profileComparisonWidget.ts
|
|
7175
|
-
var
|
|
7176
|
-
var
|
|
7429
|
+
var DEFAULT_TITLE10 = "Profile Stack Comparison";
|
|
7430
|
+
var DEFAULT_DESCRIPTION10 = "Measured real-call evidence behind each profile default: provider routes, latency, and the next move.";
|
|
7177
7431
|
var DEFAULT_LINKS4 = [
|
|
7178
7432
|
{ href: "/voice/real-call-profile-history", label: "Profile history" },
|
|
7179
7433
|
{ href: "/api/voice/real-call-profile-history", label: "JSON" }
|
|
7180
7434
|
];
|
|
7181
|
-
var
|
|
7182
|
-
var
|
|
7435
|
+
var escapeHtml15 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
7436
|
+
var formatMs4 = (value) => typeof value === "number" && Number.isFinite(value) ? `${Math.round(value)}ms` : "n/a";
|
|
7183
7437
|
var formatProviderRoutes = (profile) => Object.entries(profile.providerRoutes).map(([role, provider]) => `${role}: ${provider}`).join(", ") || "No complete route yet";
|
|
7184
7438
|
var createProfileView = (profile) => ({
|
|
7185
7439
|
evidence: [
|
|
7186
|
-
{ label: "Live p95", value:
|
|
7187
|
-
{ label: "Provider p95", value:
|
|
7188
|
-
{ label: "Turn p95", value:
|
|
7440
|
+
{ label: "Live p95", value: formatMs4(profile.evidence.liveP95Ms) },
|
|
7441
|
+
{ label: "Provider p95", value: formatMs4(profile.evidence.providerP95Ms) },
|
|
7442
|
+
{ label: "Turn p95", value: formatMs4(profile.evidence.turnP95Ms) }
|
|
7189
7443
|
],
|
|
7190
7444
|
label: profile.label ?? profile.profileId,
|
|
7191
7445
|
nextMove: profile.nextMove,
|
|
@@ -7197,37 +7451,37 @@ var createVoiceProfileComparisonViewModel = (snapshot, options = {}) => {
|
|
|
7197
7451
|
const report = snapshot.report;
|
|
7198
7452
|
const profiles = report?.defaults.profiles.map(createProfileView) ?? [];
|
|
7199
7453
|
return {
|
|
7200
|
-
description: options.description ??
|
|
7454
|
+
description: options.description ?? DEFAULT_DESCRIPTION10,
|
|
7201
7455
|
error: snapshot.error,
|
|
7202
7456
|
isLoading: snapshot.isLoading,
|
|
7203
7457
|
label: snapshot.error ? "Unavailable" : report ? `${report.defaults.summary.actionableProfiles}/${report.defaults.summary.profileCount} profiles ready` : snapshot.isLoading ? "Checking" : "No profile evidence",
|
|
7204
7458
|
links: options.links ?? DEFAULT_LINKS4,
|
|
7205
7459
|
profiles,
|
|
7206
7460
|
status: snapshot.error ? "error" : report ? report.status === "pass" ? "ready" : "warning" : snapshot.isLoading ? "loading" : "empty",
|
|
7207
|
-
title: options.title ??
|
|
7461
|
+
title: options.title ?? DEFAULT_TITLE10
|
|
7208
7462
|
};
|
|
7209
7463
|
};
|
|
7210
7464
|
var renderVoiceProfileComparisonHTML = (snapshot, options = {}) => {
|
|
7211
7465
|
const model = createVoiceProfileComparisonViewModel(snapshot, options);
|
|
7212
|
-
const profiles = model.profiles.length ? `<div class="absolute-voice-profile-comparison__profiles">${model.profiles.map((profile) => `<article class="absolute-voice-profile-comparison__profile absolute-voice-profile-comparison__profile--${
|
|
7466
|
+
const profiles = model.profiles.length ? `<div class="absolute-voice-profile-comparison__profiles">${model.profiles.map((profile) => `<article class="absolute-voice-profile-comparison__profile absolute-voice-profile-comparison__profile--${escapeHtml15(profile.status)}">
|
|
7213
7467
|
<header>
|
|
7214
|
-
<span>${
|
|
7215
|
-
<strong>${
|
|
7468
|
+
<span>${escapeHtml15(profile.status)}</span>
|
|
7469
|
+
<strong>${escapeHtml15(profile.label)}</strong>
|
|
7216
7470
|
</header>
|
|
7217
|
-
<p>${
|
|
7218
|
-
<div>${profile.evidence.map((metric) => `<span><small>${
|
|
7219
|
-
<em>${
|
|
7220
|
-
</article>`).join("")}</div>` : `<p class="absolute-voice-profile-comparison__empty">${model.error ?
|
|
7221
|
-
const links = model.links.length ? `<p class="absolute-voice-profile-comparison__links">${model.links.map((link) => `<a href="${
|
|
7222
|
-
return `<section class="absolute-voice-profile-comparison absolute-voice-profile-comparison--${
|
|
7471
|
+
<p>${escapeHtml15(profile.providerRoutes)}</p>
|
|
7472
|
+
<div>${profile.evidence.map((metric) => `<span><small>${escapeHtml15(metric.label)}</small><b>${escapeHtml15(metric.value)}</b></span>`).join("")}</div>
|
|
7473
|
+
<em>${escapeHtml15(profile.nextMove)}</em>
|
|
7474
|
+
</article>`).join("")}</div>` : `<p class="absolute-voice-profile-comparison__empty">${model.error ? escapeHtml15(model.error) : "Run real-call profile collection to populate profile comparisons."}</p>`;
|
|
7475
|
+
const links = model.links.length ? `<p class="absolute-voice-profile-comparison__links">${model.links.map((link) => `<a href="${escapeHtml15(link.href)}">${escapeHtml15(link.label)}</a>`).join("")}</p>` : "";
|
|
7476
|
+
return `<section class="absolute-voice-profile-comparison absolute-voice-profile-comparison--${escapeHtml15(model.status)}">
|
|
7223
7477
|
<header class="absolute-voice-profile-comparison__header">
|
|
7224
|
-
<span class="absolute-voice-profile-comparison__eyebrow">${
|
|
7225
|
-
<strong class="absolute-voice-profile-comparison__label">${
|
|
7478
|
+
<span class="absolute-voice-profile-comparison__eyebrow">${escapeHtml15(model.title)}</span>
|
|
7479
|
+
<strong class="absolute-voice-profile-comparison__label">${escapeHtml15(model.label)}</strong>
|
|
7226
7480
|
</header>
|
|
7227
|
-
<p class="absolute-voice-profile-comparison__description">${
|
|
7481
|
+
<p class="absolute-voice-profile-comparison__description">${escapeHtml15(model.description)}</p>
|
|
7228
7482
|
${profiles}
|
|
7229
7483
|
${links}
|
|
7230
|
-
${model.error ? `<p class="absolute-voice-profile-comparison__error">${
|
|
7484
|
+
${model.error ? `<p class="absolute-voice-profile-comparison__error">${escapeHtml15(model.error)}</p>` : ""}
|
|
7231
7485
|
</section>`;
|
|
7232
7486
|
};
|
|
7233
7487
|
var getVoiceProfileComparisonCSS = () => `.absolute-voice-profile-comparison{border:1px solid #c7d2fe;border-radius:20px;background:#eef2ff;color:#111827;padding:18px;box-shadow:0 18px 40px rgba(79,70,229,.12);font-family:inherit}.absolute-voice-profile-comparison--warning,.absolute-voice-profile-comparison--error{border-color:#fbbf24;background:#fffbeb}.absolute-voice-profile-comparison__header{align-items:start;display:flex;gap:12px;justify-content:space-between}.absolute-voice-profile-comparison__eyebrow{color:#4338ca;font-size:12px;font-weight:800;letter-spacing:.08em;text-transform:uppercase}.absolute-voice-profile-comparison__label{font-size:24px;line-height:1}.absolute-voice-profile-comparison__description,.absolute-voice-profile-comparison__empty{color:#4b5563}.absolute-voice-profile-comparison__profiles{display:grid;gap:12px;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));margin-top:14px}.absolute-voice-profile-comparison__profile{background:#fff;border:1px solid #c7d2fe;border-radius:16px;padding:14px}.absolute-voice-profile-comparison__profile--warn{border-color:#fbbf24}.absolute-voice-profile-comparison__profile--fail{border-color:#f87171}.absolute-voice-profile-comparison__profile header{align-items:center;display:flex;gap:8px;justify-content:space-between}.absolute-voice-profile-comparison__profile header span{border:1px solid currentColor;border-radius:999px;color:#4338ca;font-size:11px;font-weight:900;padding:3px 7px;text-transform:uppercase}.absolute-voice-profile-comparison__profile p{color:#1f2937;font-weight:800;overflow-wrap:anywhere}.absolute-voice-profile-comparison__profile div{display:grid;gap:8px;grid-template-columns:repeat(3,minmax(0,1fr))}.absolute-voice-profile-comparison__profile small{color:#6b7280;display:block;font-size:11px}.absolute-voice-profile-comparison__profile b{display:block}.absolute-voice-profile-comparison__profile em{color:#4b5563;display:block;font-size:13px;margin-top:12px}.absolute-voice-profile-comparison__links{display:flex;flex-wrap:wrap;gap:8px;margin:14px 0 0}.absolute-voice-profile-comparison__links a{border:1px solid #a5b4fc;border-radius:999px;color:#4338ca;font-weight:800;padding:6px 10px;text-decoration:none}.absolute-voice-profile-comparison__error{color:#9f1239;font-weight:700}`;
|
|
@@ -7269,25 +7523,25 @@ var defineVoiceProfileComparisonElement = (tagName = "absolute-voice-profile-com
|
|
|
7269
7523
|
};
|
|
7270
7524
|
|
|
7271
7525
|
// src/react/useVoiceProfileComparison.tsx
|
|
7272
|
-
import { useEffect as
|
|
7526
|
+
import { useEffect as useEffect10, useRef as useRef10, useSyncExternalStore as useSyncExternalStore10 } from "react";
|
|
7273
7527
|
var useVoiceProfileComparison = (path = "/api/voice/real-call-profile-history", options = {}) => {
|
|
7274
|
-
const storeRef =
|
|
7528
|
+
const storeRef = useRef10(null);
|
|
7275
7529
|
if (!storeRef.current) {
|
|
7276
7530
|
storeRef.current = createVoiceProfileComparisonStore(path, options);
|
|
7277
7531
|
}
|
|
7278
7532
|
const store = storeRef.current;
|
|
7279
|
-
|
|
7533
|
+
useEffect10(() => {
|
|
7280
7534
|
store.refresh().catch(() => {});
|
|
7281
7535
|
return () => store.close();
|
|
7282
7536
|
}, [store]);
|
|
7283
7537
|
return {
|
|
7284
|
-
...
|
|
7538
|
+
...useSyncExternalStore10(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
7285
7539
|
refresh: store.refresh
|
|
7286
7540
|
};
|
|
7287
7541
|
};
|
|
7288
7542
|
|
|
7289
7543
|
// src/react/VoiceProfileComparison.tsx
|
|
7290
|
-
import { jsxDEV as
|
|
7544
|
+
import { jsxDEV as jsxDEV10 } from "react/jsx-dev-runtime";
|
|
7291
7545
|
var VoiceProfileComparison = ({
|
|
7292
7546
|
className,
|
|
7293
7547
|
path = "/api/voice/real-call-profile-history",
|
|
@@ -7295,77 +7549,77 @@ var VoiceProfileComparison = ({
|
|
|
7295
7549
|
}) => {
|
|
7296
7550
|
const snapshot = useVoiceProfileComparison(path, options);
|
|
7297
7551
|
const model = createVoiceProfileComparisonViewModel(snapshot, options);
|
|
7298
|
-
return /* @__PURE__ */
|
|
7552
|
+
return /* @__PURE__ */ jsxDEV10("section", {
|
|
7299
7553
|
className: [
|
|
7300
7554
|
"absolute-voice-profile-comparison",
|
|
7301
7555
|
`absolute-voice-profile-comparison--${model.status}`,
|
|
7302
7556
|
className
|
|
7303
7557
|
].filter(Boolean).join(" "),
|
|
7304
7558
|
children: [
|
|
7305
|
-
/* @__PURE__ */
|
|
7559
|
+
/* @__PURE__ */ jsxDEV10("header", {
|
|
7306
7560
|
className: "absolute-voice-profile-comparison__header",
|
|
7307
7561
|
children: [
|
|
7308
|
-
/* @__PURE__ */
|
|
7562
|
+
/* @__PURE__ */ jsxDEV10("span", {
|
|
7309
7563
|
className: "absolute-voice-profile-comparison__eyebrow",
|
|
7310
7564
|
children: model.title
|
|
7311
7565
|
}, undefined, false, undefined, this),
|
|
7312
|
-
/* @__PURE__ */
|
|
7566
|
+
/* @__PURE__ */ jsxDEV10("strong", {
|
|
7313
7567
|
className: "absolute-voice-profile-comparison__label",
|
|
7314
7568
|
children: model.label
|
|
7315
7569
|
}, undefined, false, undefined, this)
|
|
7316
7570
|
]
|
|
7317
7571
|
}, undefined, true, undefined, this),
|
|
7318
|
-
/* @__PURE__ */
|
|
7572
|
+
/* @__PURE__ */ jsxDEV10("p", {
|
|
7319
7573
|
className: "absolute-voice-profile-comparison__description",
|
|
7320
7574
|
children: model.description
|
|
7321
7575
|
}, undefined, false, undefined, this),
|
|
7322
|
-
model.profiles.length ? /* @__PURE__ */
|
|
7576
|
+
model.profiles.length ? /* @__PURE__ */ jsxDEV10("div", {
|
|
7323
7577
|
className: "absolute-voice-profile-comparison__profiles",
|
|
7324
|
-
children: model.profiles.map((profile) => /* @__PURE__ */
|
|
7578
|
+
children: model.profiles.map((profile) => /* @__PURE__ */ jsxDEV10("article", {
|
|
7325
7579
|
className: `absolute-voice-profile-comparison__profile absolute-voice-profile-comparison__profile--${profile.status}`,
|
|
7326
7580
|
children: [
|
|
7327
|
-
/* @__PURE__ */
|
|
7581
|
+
/* @__PURE__ */ jsxDEV10("header", {
|
|
7328
7582
|
children: [
|
|
7329
|
-
/* @__PURE__ */
|
|
7583
|
+
/* @__PURE__ */ jsxDEV10("span", {
|
|
7330
7584
|
children: profile.status
|
|
7331
7585
|
}, undefined, false, undefined, this),
|
|
7332
|
-
/* @__PURE__ */
|
|
7586
|
+
/* @__PURE__ */ jsxDEV10("strong", {
|
|
7333
7587
|
children: profile.label
|
|
7334
7588
|
}, undefined, false, undefined, this)
|
|
7335
7589
|
]
|
|
7336
7590
|
}, undefined, true, undefined, this),
|
|
7337
|
-
/* @__PURE__ */
|
|
7591
|
+
/* @__PURE__ */ jsxDEV10("p", {
|
|
7338
7592
|
children: profile.providerRoutes
|
|
7339
7593
|
}, undefined, false, undefined, this),
|
|
7340
|
-
/* @__PURE__ */
|
|
7341
|
-
children: profile.evidence.map((metric) => /* @__PURE__ */
|
|
7594
|
+
/* @__PURE__ */ jsxDEV10("div", {
|
|
7595
|
+
children: profile.evidence.map((metric) => /* @__PURE__ */ jsxDEV10("span", {
|
|
7342
7596
|
children: [
|
|
7343
|
-
/* @__PURE__ */
|
|
7597
|
+
/* @__PURE__ */ jsxDEV10("small", {
|
|
7344
7598
|
children: metric.label
|
|
7345
7599
|
}, undefined, false, undefined, this),
|
|
7346
|
-
/* @__PURE__ */
|
|
7600
|
+
/* @__PURE__ */ jsxDEV10("b", {
|
|
7347
7601
|
children: metric.value
|
|
7348
7602
|
}, undefined, false, undefined, this)
|
|
7349
7603
|
]
|
|
7350
7604
|
}, metric.label, true, undefined, this))
|
|
7351
7605
|
}, undefined, false, undefined, this),
|
|
7352
|
-
/* @__PURE__ */
|
|
7606
|
+
/* @__PURE__ */ jsxDEV10("em", {
|
|
7353
7607
|
children: profile.nextMove
|
|
7354
7608
|
}, undefined, false, undefined, this)
|
|
7355
7609
|
]
|
|
7356
7610
|
}, profile.profileId, true, undefined, this))
|
|
7357
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
7611
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV10("p", {
|
|
7358
7612
|
className: "absolute-voice-profile-comparison__empty",
|
|
7359
7613
|
children: model.error ?? "Run real-call profile collection to populate profile comparisons."
|
|
7360
7614
|
}, undefined, false, undefined, this),
|
|
7361
|
-
model.links.length ? /* @__PURE__ */
|
|
7615
|
+
model.links.length ? /* @__PURE__ */ jsxDEV10("p", {
|
|
7362
7616
|
className: "absolute-voice-profile-comparison__links",
|
|
7363
|
-
children: model.links.map((link) => /* @__PURE__ */
|
|
7617
|
+
children: model.links.map((link) => /* @__PURE__ */ jsxDEV10("a", {
|
|
7364
7618
|
href: link.href,
|
|
7365
7619
|
children: link.label
|
|
7366
7620
|
}, link.href, false, undefined, this))
|
|
7367
7621
|
}, undefined, false, undefined, this) : null,
|
|
7368
|
-
model.error ? /* @__PURE__ */
|
|
7622
|
+
model.error ? /* @__PURE__ */ jsxDEV10("p", {
|
|
7369
7623
|
className: "absolute-voice-profile-comparison__error",
|
|
7370
7624
|
children: model.error
|
|
7371
7625
|
}, undefined, false, undefined, this) : null
|
|
@@ -7448,29 +7702,29 @@ var createVoiceProfileSwitchRecommendationStore = (path = "/api/voice/profile-sw
|
|
|
7448
7702
|
};
|
|
7449
7703
|
|
|
7450
7704
|
// src/client/profileSwitchRecommendationWidget.ts
|
|
7451
|
-
var
|
|
7452
|
-
var
|
|
7453
|
-
var
|
|
7705
|
+
var DEFAULT_TITLE11 = "Profile Switch Recommendation";
|
|
7706
|
+
var DEFAULT_DESCRIPTION11 = "Compares the current session against measured profile evidence and recommends whether to switch stacks.";
|
|
7707
|
+
var escapeHtml16 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
7454
7708
|
var formatRoute = (routes) => routes ? Object.entries(routes).map(([role, provider]) => `${role}: ${provider}`).join(", ") : "No route";
|
|
7455
7709
|
var renderVoiceProfileSwitchRecommendationHTML = (snapshot, options = {}) => {
|
|
7456
7710
|
const recommendation = snapshot.recommendation;
|
|
7457
7711
|
const status = snapshot.error ? "error" : recommendation ? recommendation.status : snapshot.isLoading ? "loading" : "empty";
|
|
7458
7712
|
const label = snapshot.error ? "Unavailable" : recommendation ? recommendation.status === "switch" ? `Switch to ${recommendation.recommendedProfile?.label ?? recommendation.recommendedProfile?.profileId ?? "recommended profile"}` : recommendation.status === "stay" ? "Keep current profile" : "Needs evidence" : snapshot.isLoading ? "Checking" : "No recommendation";
|
|
7459
7713
|
const body = recommendation ? `<div class="absolute-voice-profile-switch__body">
|
|
7460
|
-
<p><strong>Current:</strong> ${
|
|
7461
|
-
<p><strong>Recommended:</strong> ${
|
|
7462
|
-
<p><strong>Routes:</strong> ${
|
|
7463
|
-
<ul>${recommendation.reasons.map((reason) => `<li>${
|
|
7464
|
-
<em>${
|
|
7465
|
-
</div>` : `<p class="absolute-voice-profile-switch__empty">${
|
|
7466
|
-
return `<section class="absolute-voice-profile-switch absolute-voice-profile-switch--${
|
|
7714
|
+
<p><strong>Current:</strong> ${escapeHtml16(recommendation.currentProfile?.label ?? recommendation.currentProfile?.profileId ?? "Unknown")}</p>
|
|
7715
|
+
<p><strong>Recommended:</strong> ${escapeHtml16(recommendation.recommendedProfile?.label ?? recommendation.recommendedProfile?.profileId ?? "None")}</p>
|
|
7716
|
+
<p><strong>Routes:</strong> ${escapeHtml16(formatRoute(recommendation.recommendedProfile?.providerRoutes))}</p>
|
|
7717
|
+
<ul>${recommendation.reasons.map((reason) => `<li>${escapeHtml16(reason)}</li>`).join("")}</ul>
|
|
7718
|
+
<em>${escapeHtml16(recommendation.nextMove)}</em>
|
|
7719
|
+
</div>` : `<p class="absolute-voice-profile-switch__empty">${escapeHtml16(snapshot.error ?? "Run session traffic to populate a recommendation.")}</p>`;
|
|
7720
|
+
return `<section class="absolute-voice-profile-switch absolute-voice-profile-switch--${escapeHtml16(status)}">
|
|
7467
7721
|
<header class="absolute-voice-profile-switch__header">
|
|
7468
|
-
<span class="absolute-voice-profile-switch__eyebrow">${
|
|
7469
|
-
<strong class="absolute-voice-profile-switch__label">${
|
|
7722
|
+
<span class="absolute-voice-profile-switch__eyebrow">${escapeHtml16(options.title ?? DEFAULT_TITLE11)}</span>
|
|
7723
|
+
<strong class="absolute-voice-profile-switch__label">${escapeHtml16(label)}</strong>
|
|
7470
7724
|
</header>
|
|
7471
|
-
<p class="absolute-voice-profile-switch__description">${
|
|
7725
|
+
<p class="absolute-voice-profile-switch__description">${escapeHtml16(options.description ?? DEFAULT_DESCRIPTION11)}</p>
|
|
7472
7726
|
${body}
|
|
7473
|
-
${snapshot.error ? `<p class="absolute-voice-profile-switch__error">${
|
|
7727
|
+
${snapshot.error ? `<p class="absolute-voice-profile-switch__error">${escapeHtml16(snapshot.error)}</p>` : ""}
|
|
7474
7728
|
</section>`;
|
|
7475
7729
|
};
|
|
7476
7730
|
var getVoiceProfileSwitchRecommendationCSS = () => `.absolute-voice-profile-switch{border:1px solid #fed7aa;border-radius:20px;background:#fff7ed;color:#1c1917;padding:18px;box-shadow:0 18px 40px rgba(234,88,12,.12);font-family:inherit}.absolute-voice-profile-switch--switch{border-color:#fdba74}.absolute-voice-profile-switch--stay{border-color:#86efac;background:#f0fdf4}.absolute-voice-profile-switch--warn,.absolute-voice-profile-switch--error{border-color:#fca5a5;background:#fff1f2}.absolute-voice-profile-switch__header{align-items:start;display:flex;gap:12px;justify-content:space-between}.absolute-voice-profile-switch__eyebrow{color:#c2410c;font-size:12px;font-weight:800;letter-spacing:.08em;text-transform:uppercase}.absolute-voice-profile-switch__label{font-size:24px;line-height:1}.absolute-voice-profile-switch__description,.absolute-voice-profile-switch__body em,.absolute-voice-profile-switch__empty{color:#57534e}.absolute-voice-profile-switch__body{background:#fff;border:1px solid #fed7aa;border-radius:16px;margin-top:14px;padding:14px}.absolute-voice-profile-switch__body p{margin:.35rem 0}.absolute-voice-profile-switch__body ul{margin:.75rem 0;padding-left:1.2rem}.absolute-voice-profile-switch__body em{display:block}.absolute-voice-profile-switch__error{color:#9f1239;font-weight:700}`;
|
|
@@ -7512,25 +7766,25 @@ var defineVoiceProfileSwitchRecommendationElement = (tagName = "absolute-voice-p
|
|
|
7512
7766
|
};
|
|
7513
7767
|
|
|
7514
7768
|
// src/react/useVoiceProfileSwitchRecommendation.tsx
|
|
7515
|
-
import { useEffect as
|
|
7769
|
+
import { useEffect as useEffect11, useRef as useRef11, useSyncExternalStore as useSyncExternalStore11 } from "react";
|
|
7516
7770
|
var useVoiceProfileSwitchRecommendation = (path = "/api/voice/profile-switch-recommendation", options = {}) => {
|
|
7517
|
-
const storeRef =
|
|
7771
|
+
const storeRef = useRef11(null);
|
|
7518
7772
|
if (!storeRef.current) {
|
|
7519
7773
|
storeRef.current = createVoiceProfileSwitchRecommendationStore(path, options);
|
|
7520
7774
|
}
|
|
7521
7775
|
const store = storeRef.current;
|
|
7522
|
-
|
|
7776
|
+
useEffect11(() => {
|
|
7523
7777
|
store.refresh().catch(() => {});
|
|
7524
7778
|
return () => store.close();
|
|
7525
7779
|
}, [store]);
|
|
7526
7780
|
return {
|
|
7527
|
-
...
|
|
7781
|
+
...useSyncExternalStore11(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
7528
7782
|
refresh: store.refresh
|
|
7529
7783
|
};
|
|
7530
7784
|
};
|
|
7531
7785
|
|
|
7532
7786
|
// src/react/VoiceProfileSwitchRecommendation.tsx
|
|
7533
|
-
import { jsxDEV as
|
|
7787
|
+
import { jsxDEV as jsxDEV11 } from "react/jsx-dev-runtime";
|
|
7534
7788
|
var VoiceProfileSwitchRecommendation = ({
|
|
7535
7789
|
className,
|
|
7536
7790
|
path = "/api/voice/profile-switch-recommendation",
|
|
@@ -7538,7 +7792,7 @@ var VoiceProfileSwitchRecommendation = ({
|
|
|
7538
7792
|
}) => {
|
|
7539
7793
|
const snapshot = useVoiceProfileSwitchRecommendation(path, options);
|
|
7540
7794
|
const html = renderVoiceProfileSwitchRecommendationHTML(snapshot, options);
|
|
7541
|
-
return /* @__PURE__ */
|
|
7795
|
+
return /* @__PURE__ */ jsxDEV11("div", {
|
|
7542
7796
|
className,
|
|
7543
7797
|
dangerouslySetInnerHTML: { __html: html }
|
|
7544
7798
|
}, undefined, false, undefined, this);
|
|
@@ -7619,13 +7873,13 @@ var createVoiceReadinessFailuresStore = (path = "/api/production-readiness", opt
|
|
|
7619
7873
|
};
|
|
7620
7874
|
|
|
7621
7875
|
// src/client/readinessFailuresWidget.ts
|
|
7622
|
-
var
|
|
7623
|
-
var
|
|
7876
|
+
var DEFAULT_TITLE12 = "Readiness Gate Explanations";
|
|
7877
|
+
var DEFAULT_DESCRIPTION12 = "Structured reasons for calibrated production-readiness warnings and failures.";
|
|
7624
7878
|
var DEFAULT_LINKS5 = [
|
|
7625
7879
|
{ href: "/production-readiness", label: "Readiness page" },
|
|
7626
7880
|
{ href: "/voice/slo-readiness-thresholds", label: "Gate thresholds" }
|
|
7627
7881
|
];
|
|
7628
|
-
var
|
|
7882
|
+
var escapeHtml17 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
7629
7883
|
var formatExplanationValue = (value, unit) => {
|
|
7630
7884
|
if (value === undefined || value === null) {
|
|
7631
7885
|
return "n/a";
|
|
@@ -7653,36 +7907,36 @@ var createVoiceReadinessFailuresViewModel = (snapshot, options = {}) => {
|
|
|
7653
7907
|
const failures = snapshot.report?.checks.map(toFailureView).filter((value) => !!value) ?? [];
|
|
7654
7908
|
const hasOpenIssues = failures.length > 0;
|
|
7655
7909
|
return {
|
|
7656
|
-
description: options.description ??
|
|
7910
|
+
description: options.description ?? DEFAULT_DESCRIPTION12,
|
|
7657
7911
|
error: snapshot.error,
|
|
7658
7912
|
failures,
|
|
7659
7913
|
isLoading: snapshot.isLoading,
|
|
7660
7914
|
label: snapshot.error ? "Unavailable" : snapshot.report ? hasOpenIssues ? `${failures.length} calibrated gate issue(s)` : "No calibrated gate issues" : snapshot.isLoading ? "Checking" : "No readiness report",
|
|
7661
7915
|
links: options.links ?? DEFAULT_LINKS5,
|
|
7662
7916
|
status: snapshot.error ? "error" : snapshot.report ? hasOpenIssues ? "warning" : "ready" : snapshot.isLoading ? "loading" : "empty",
|
|
7663
|
-
title: options.title ??
|
|
7917
|
+
title: options.title ?? DEFAULT_TITLE12,
|
|
7664
7918
|
updatedAt: snapshot.updatedAt
|
|
7665
7919
|
};
|
|
7666
7920
|
};
|
|
7667
7921
|
var renderVoiceReadinessFailuresHTML = (snapshot, options = {}) => {
|
|
7668
7922
|
const model = createVoiceReadinessFailuresViewModel(snapshot, options);
|
|
7669
|
-
const failures = model.failures.length ? `<div class="absolute-voice-readiness-failures__items">${model.failures.map((failure) => `<article class="absolute-voice-readiness-failures__item absolute-voice-readiness-failures__item--${
|
|
7670
|
-
<span>${
|
|
7671
|
-
<strong>${
|
|
7672
|
-
<p>Observed ${
|
|
7673
|
-
<p>${
|
|
7674
|
-
<p class="absolute-voice-readiness-failures__links">${failure.evidenceHref ? `<a href="${
|
|
7675
|
-
</article>`).join("")}</div>` : `<p class="absolute-voice-readiness-failures__empty">${model.error ?
|
|
7676
|
-
const links = model.links.length ? `<p class="absolute-voice-readiness-failures__links">${model.links.map((link) => `<a href="${
|
|
7677
|
-
return `<section class="absolute-voice-readiness-failures absolute-voice-readiness-failures--${
|
|
7923
|
+
const failures = model.failures.length ? `<div class="absolute-voice-readiness-failures__items">${model.failures.map((failure) => `<article class="absolute-voice-readiness-failures__item absolute-voice-readiness-failures__item--${escapeHtml17(failure.status)}">
|
|
7924
|
+
<span>${escapeHtml17(failure.status.toUpperCase())}</span>
|
|
7925
|
+
<strong>${escapeHtml17(failure.label)}</strong>
|
|
7926
|
+
<p>Observed ${escapeHtml17(failure.observed)} against ${escapeHtml17(failure.thresholdLabel)} ${escapeHtml17(failure.threshold)}.</p>
|
|
7927
|
+
<p>${escapeHtml17(failure.remediation)}</p>
|
|
7928
|
+
<p class="absolute-voice-readiness-failures__links">${failure.evidenceHref ? `<a href="${escapeHtml17(failure.evidenceHref)}">Evidence</a>` : ""}${failure.sourceHref ? `<a href="${escapeHtml17(failure.sourceHref)}">Threshold source</a>` : ""}</p>
|
|
7929
|
+
</article>`).join("")}</div>` : `<p class="absolute-voice-readiness-failures__empty">${model.error ? escapeHtml17(model.error) : "No calibrated readiness gate explanations are open."}</p>`;
|
|
7930
|
+
const links = model.links.length ? `<p class="absolute-voice-readiness-failures__links">${model.links.map((link) => `<a href="${escapeHtml17(link.href)}">${escapeHtml17(link.label)}</a>`).join("")}</p>` : "";
|
|
7931
|
+
return `<section class="absolute-voice-readiness-failures absolute-voice-readiness-failures--${escapeHtml17(model.status)}">
|
|
7678
7932
|
<header class="absolute-voice-readiness-failures__header">
|
|
7679
|
-
<span class="absolute-voice-readiness-failures__eyebrow">${
|
|
7680
|
-
<strong class="absolute-voice-readiness-failures__label">${
|
|
7933
|
+
<span class="absolute-voice-readiness-failures__eyebrow">${escapeHtml17(model.title)}</span>
|
|
7934
|
+
<strong class="absolute-voice-readiness-failures__label">${escapeHtml17(model.label)}</strong>
|
|
7681
7935
|
</header>
|
|
7682
|
-
<p class="absolute-voice-readiness-failures__description">${
|
|
7936
|
+
<p class="absolute-voice-readiness-failures__description">${escapeHtml17(model.description)}</p>
|
|
7683
7937
|
${failures}
|
|
7684
7938
|
${links}
|
|
7685
|
-
${model.error ? `<p class="absolute-voice-readiness-failures__error">${
|
|
7939
|
+
${model.error ? `<p class="absolute-voice-readiness-failures__error">${escapeHtml17(model.error)}</p>` : ""}
|
|
7686
7940
|
</section>`;
|
|
7687
7941
|
};
|
|
7688
7942
|
var getVoiceReadinessFailuresCSS = () => `.absolute-voice-readiness-failures{border:1px solid #fed7aa;border-radius:20px;background:#fff7ed;color:#1c1917;padding:18px;box-shadow:0 18px 40px rgba(234,88,12,.12);font-family:inherit}.absolute-voice-readiness-failures--ready{border-color:#86efac;background:#f0fdf4}.absolute-voice-readiness-failures--error{border-color:#fda4af;background:#fff1f2}.absolute-voice-readiness-failures__header{align-items:start;display:flex;gap:12px;justify-content:space-between}.absolute-voice-readiness-failures__eyebrow{color:#9a3412;font-size:12px;font-weight:800;letter-spacing:.08em;text-transform:uppercase}.absolute-voice-readiness-failures__label{font-size:24px;line-height:1}.absolute-voice-readiness-failures__description,.absolute-voice-readiness-failures__empty{color:#57534e}.absolute-voice-readiness-failures__items{display:grid;gap:10px;margin-top:14px}.absolute-voice-readiness-failures__item{background:white;border:1px solid #fed7aa;border-radius:16px;padding:12px}.absolute-voice-readiness-failures__item--fail{border-color:#fb7185}.absolute-voice-readiness-failures__item span{color:#9a3412;display:block;font-size:12px;font-weight:900;text-transform:uppercase}.absolute-voice-readiness-failures__item strong{display:block;font-size:18px;margin-top:4px}.absolute-voice-readiness-failures__item p{margin:.45rem 0 0}.absolute-voice-readiness-failures__links{display:flex;flex-wrap:wrap;gap:8px;margin:14px 0 0}.absolute-voice-readiness-failures__links a{border:1px solid #fdba74;border-radius:999px;color:#9a3412;font-weight:800;padding:6px 10px;text-decoration:none}.absolute-voice-readiness-failures__error{color:#9f1239;font-weight:700}`;
|
|
@@ -7723,25 +7977,25 @@ var defineVoiceReadinessFailuresElement = (tagName = "absolute-voice-readiness-f
|
|
|
7723
7977
|
};
|
|
7724
7978
|
|
|
7725
7979
|
// src/react/useVoiceReadinessFailures.tsx
|
|
7726
|
-
import { useEffect as
|
|
7980
|
+
import { useEffect as useEffect12, useRef as useRef12, useSyncExternalStore as useSyncExternalStore12 } from "react";
|
|
7727
7981
|
var useVoiceReadinessFailures = (path = "/api/production-readiness", options = {}) => {
|
|
7728
|
-
const storeRef =
|
|
7982
|
+
const storeRef = useRef12(null);
|
|
7729
7983
|
if (!storeRef.current) {
|
|
7730
7984
|
storeRef.current = createVoiceReadinessFailuresStore(path, options);
|
|
7731
7985
|
}
|
|
7732
7986
|
const store = storeRef.current;
|
|
7733
|
-
|
|
7987
|
+
useEffect12(() => {
|
|
7734
7988
|
store.refresh().catch(() => {});
|
|
7735
7989
|
return () => store.close();
|
|
7736
7990
|
}, [store]);
|
|
7737
7991
|
return {
|
|
7738
|
-
...
|
|
7992
|
+
...useSyncExternalStore12(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
7739
7993
|
refresh: store.refresh
|
|
7740
7994
|
};
|
|
7741
7995
|
};
|
|
7742
7996
|
|
|
7743
7997
|
// src/react/VoiceReadinessFailures.tsx
|
|
7744
|
-
import { jsxDEV as
|
|
7998
|
+
import { jsxDEV as jsxDEV12 } from "react/jsx-dev-runtime";
|
|
7745
7999
|
var VoiceReadinessFailures = ({
|
|
7746
8000
|
className,
|
|
7747
8001
|
path = "/api/production-readiness",
|
|
@@ -7749,42 +8003,42 @@ var VoiceReadinessFailures = ({
|
|
|
7749
8003
|
}) => {
|
|
7750
8004
|
const snapshot = useVoiceReadinessFailures(path, options);
|
|
7751
8005
|
const model = createVoiceReadinessFailuresViewModel(snapshot, options);
|
|
7752
|
-
return /* @__PURE__ */
|
|
8006
|
+
return /* @__PURE__ */ jsxDEV12("section", {
|
|
7753
8007
|
className: [
|
|
7754
8008
|
"absolute-voice-readiness-failures",
|
|
7755
8009
|
`absolute-voice-readiness-failures--${model.status}`,
|
|
7756
8010
|
className
|
|
7757
8011
|
].filter(Boolean).join(" "),
|
|
7758
8012
|
children: [
|
|
7759
|
-
/* @__PURE__ */
|
|
8013
|
+
/* @__PURE__ */ jsxDEV12("header", {
|
|
7760
8014
|
className: "absolute-voice-readiness-failures__header",
|
|
7761
8015
|
children: [
|
|
7762
|
-
/* @__PURE__ */
|
|
8016
|
+
/* @__PURE__ */ jsxDEV12("span", {
|
|
7763
8017
|
className: "absolute-voice-readiness-failures__eyebrow",
|
|
7764
8018
|
children: model.title
|
|
7765
8019
|
}, undefined, false, undefined, this),
|
|
7766
|
-
/* @__PURE__ */
|
|
8020
|
+
/* @__PURE__ */ jsxDEV12("strong", {
|
|
7767
8021
|
className: "absolute-voice-readiness-failures__label",
|
|
7768
8022
|
children: model.label
|
|
7769
8023
|
}, undefined, false, undefined, this)
|
|
7770
8024
|
]
|
|
7771
8025
|
}, undefined, true, undefined, this),
|
|
7772
|
-
/* @__PURE__ */
|
|
8026
|
+
/* @__PURE__ */ jsxDEV12("p", {
|
|
7773
8027
|
className: "absolute-voice-readiness-failures__description",
|
|
7774
8028
|
children: model.description
|
|
7775
8029
|
}, undefined, false, undefined, this),
|
|
7776
|
-
model.failures.length ? /* @__PURE__ */
|
|
8030
|
+
model.failures.length ? /* @__PURE__ */ jsxDEV12("div", {
|
|
7777
8031
|
className: "absolute-voice-readiness-failures__items",
|
|
7778
|
-
children: model.failures.map((failure) => /* @__PURE__ */
|
|
8032
|
+
children: model.failures.map((failure) => /* @__PURE__ */ jsxDEV12("article", {
|
|
7779
8033
|
className: `absolute-voice-readiness-failures__item absolute-voice-readiness-failures__item--${failure.status}`,
|
|
7780
8034
|
children: [
|
|
7781
|
-
/* @__PURE__ */
|
|
8035
|
+
/* @__PURE__ */ jsxDEV12("span", {
|
|
7782
8036
|
children: failure.status.toUpperCase()
|
|
7783
8037
|
}, undefined, false, undefined, this),
|
|
7784
|
-
/* @__PURE__ */
|
|
8038
|
+
/* @__PURE__ */ jsxDEV12("strong", {
|
|
7785
8039
|
children: failure.label
|
|
7786
8040
|
}, undefined, false, undefined, this),
|
|
7787
|
-
/* @__PURE__ */
|
|
8041
|
+
/* @__PURE__ */ jsxDEV12("p", {
|
|
7788
8042
|
children: [
|
|
7789
8043
|
"Observed ",
|
|
7790
8044
|
failure.observed,
|
|
@@ -7795,17 +8049,17 @@ var VoiceReadinessFailures = ({
|
|
|
7795
8049
|
"."
|
|
7796
8050
|
]
|
|
7797
8051
|
}, undefined, true, undefined, this),
|
|
7798
|
-
/* @__PURE__ */
|
|
8052
|
+
/* @__PURE__ */ jsxDEV12("p", {
|
|
7799
8053
|
children: failure.remediation
|
|
7800
8054
|
}, undefined, false, undefined, this),
|
|
7801
|
-
/* @__PURE__ */
|
|
8055
|
+
/* @__PURE__ */ jsxDEV12("p", {
|
|
7802
8056
|
className: "absolute-voice-readiness-failures__links",
|
|
7803
8057
|
children: [
|
|
7804
|
-
failure.evidenceHref ? /* @__PURE__ */
|
|
8058
|
+
failure.evidenceHref ? /* @__PURE__ */ jsxDEV12("a", {
|
|
7805
8059
|
href: failure.evidenceHref,
|
|
7806
8060
|
children: "Evidence"
|
|
7807
8061
|
}, undefined, false, undefined, this) : null,
|
|
7808
|
-
failure.sourceHref ? /* @__PURE__ */
|
|
8062
|
+
failure.sourceHref ? /* @__PURE__ */ jsxDEV12("a", {
|
|
7809
8063
|
href: failure.sourceHref,
|
|
7810
8064
|
children: "Threshold source"
|
|
7811
8065
|
}, undefined, false, undefined, this) : null
|
|
@@ -7813,18 +8067,18 @@ var VoiceReadinessFailures = ({
|
|
|
7813
8067
|
}, undefined, true, undefined, this)
|
|
7814
8068
|
]
|
|
7815
8069
|
}, failure.label, true, undefined, this))
|
|
7816
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
8070
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV12("p", {
|
|
7817
8071
|
className: "absolute-voice-readiness-failures__empty",
|
|
7818
8072
|
children: model.error ?? "No calibrated readiness gate explanations are open."
|
|
7819
8073
|
}, undefined, false, undefined, this),
|
|
7820
|
-
model.links.length ? /* @__PURE__ */
|
|
8074
|
+
model.links.length ? /* @__PURE__ */ jsxDEV12("p", {
|
|
7821
8075
|
className: "absolute-voice-readiness-failures__links",
|
|
7822
|
-
children: model.links.map((link) => /* @__PURE__ */
|
|
8076
|
+
children: model.links.map((link) => /* @__PURE__ */ jsxDEV12("a", {
|
|
7823
8077
|
href: link.href,
|
|
7824
8078
|
children: link.label
|
|
7825
8079
|
}, link.href, false, undefined, this))
|
|
7826
8080
|
}, undefined, false, undefined, this) : null,
|
|
7827
|
-
model.error ? /* @__PURE__ */
|
|
8081
|
+
model.error ? /* @__PURE__ */ jsxDEV12("p", {
|
|
7828
8082
|
className: "absolute-voice-readiness-failures__error",
|
|
7829
8083
|
children: model.error
|
|
7830
8084
|
}, undefined, false, undefined, this) : null
|
|
@@ -7911,7 +8165,7 @@ var createVoiceProviderSimulationControlsStore = (options) => {
|
|
|
7911
8165
|
};
|
|
7912
8166
|
|
|
7913
8167
|
// src/client/providerSimulationControlsWidget.ts
|
|
7914
|
-
var
|
|
8168
|
+
var escapeHtml18 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
7915
8169
|
var formatKind = (kind) => (kind ?? "stt").toUpperCase();
|
|
7916
8170
|
var createVoiceProviderSimulationControlsViewModel = (snapshot, options) => {
|
|
7917
8171
|
const configuredProviders = options.providers.filter((provider) => provider.configured !== false);
|
|
@@ -7931,18 +8185,18 @@ var createVoiceProviderSimulationControlsViewModel = (snapshot, options) => {
|
|
|
7931
8185
|
};
|
|
7932
8186
|
var renderVoiceProviderSimulationControlsHTML = (snapshot, options) => {
|
|
7933
8187
|
const model = createVoiceProviderSimulationControlsViewModel(snapshot, options);
|
|
7934
|
-
const failureButtons = model.failureProviders.map((provider) => `<button type="button" data-voice-provider-fail="${
|
|
7935
|
-
const recoveryButtons = model.providers.map((provider) => `<button type="button" data-voice-provider-recover="${
|
|
8188
|
+
const failureButtons = model.failureProviders.map((provider) => `<button type="button" data-voice-provider-fail="${escapeHtml18(provider.provider)}"${!model.canSimulateFailure || snapshot.isRunning ? " disabled" : ""}>Simulate ${escapeHtml18(provider.provider)} ${escapeHtml18(formatKind(options.kind))} failure</button>`).join("");
|
|
8189
|
+
const recoveryButtons = model.providers.map((provider) => `<button type="button" data-voice-provider-recover="${escapeHtml18(provider.provider)}"${snapshot.isRunning ? " disabled" : ""}>Mark ${escapeHtml18(provider.provider)} recovered</button>`).join("");
|
|
7936
8190
|
return `<section class="absolute-voice-provider-simulation absolute-voice-provider-simulation--${snapshot.error ? "error" : snapshot.isRunning ? "running" : "ready"}">
|
|
7937
8191
|
<header class="absolute-voice-provider-simulation__header">
|
|
7938
|
-
<span class="absolute-voice-provider-simulation__eyebrow">${
|
|
7939
|
-
<strong class="absolute-voice-provider-simulation__label">${
|
|
8192
|
+
<span class="absolute-voice-provider-simulation__eyebrow">${escapeHtml18(model.title)}</span>
|
|
8193
|
+
<strong class="absolute-voice-provider-simulation__label">${escapeHtml18(model.label)}</strong>
|
|
7940
8194
|
</header>
|
|
7941
|
-
<p class="absolute-voice-provider-simulation__description">${
|
|
7942
|
-
${model.canSimulateFailure ? "" : `<p class="absolute-voice-provider-simulation__empty">${
|
|
8195
|
+
<p class="absolute-voice-provider-simulation__description">${escapeHtml18(model.description)}</p>
|
|
8196
|
+
${model.canSimulateFailure ? "" : `<p class="absolute-voice-provider-simulation__empty">${escapeHtml18(options.fallbackRequiredMessage ?? "Configure fallback providers before simulating failure.")}</p>`}
|
|
7943
8197
|
<div class="absolute-voice-provider-simulation__actions">${failureButtons}${recoveryButtons}</div>
|
|
7944
|
-
${snapshot.error ? `<p class="absolute-voice-provider-simulation__error">${
|
|
7945
|
-
${model.resultText ? `<pre class="absolute-voice-provider-simulation__result">${
|
|
8198
|
+
${snapshot.error ? `<p class="absolute-voice-provider-simulation__error">${escapeHtml18(snapshot.error)}</p>` : ""}
|
|
8199
|
+
${model.resultText ? `<pre class="absolute-voice-provider-simulation__result">${escapeHtml18(model.resultText)}</pre>` : ""}
|
|
7946
8200
|
</section>`;
|
|
7947
8201
|
};
|
|
7948
8202
|
var bindVoiceProviderSimulationControls = (element, store) => {
|
|
@@ -8008,22 +8262,22 @@ var defineVoiceProviderSimulationControlsElement = (tagName = "absolute-voice-pr
|
|
|
8008
8262
|
};
|
|
8009
8263
|
|
|
8010
8264
|
// src/react/useVoiceProviderSimulationControls.tsx
|
|
8011
|
-
import { useEffect as
|
|
8265
|
+
import { useEffect as useEffect13, useRef as useRef13, useSyncExternalStore as useSyncExternalStore13 } from "react";
|
|
8012
8266
|
var useVoiceProviderSimulationControls = (options) => {
|
|
8013
|
-
const storeRef =
|
|
8267
|
+
const storeRef = useRef13(null);
|
|
8014
8268
|
if (!storeRef.current) {
|
|
8015
8269
|
storeRef.current = createVoiceProviderSimulationControlsStore(options);
|
|
8016
8270
|
}
|
|
8017
8271
|
const store = storeRef.current;
|
|
8018
|
-
|
|
8272
|
+
useEffect13(() => () => store.close(), [store]);
|
|
8019
8273
|
return {
|
|
8020
|
-
...
|
|
8274
|
+
...useSyncExternalStore13(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
8021
8275
|
run: store.run
|
|
8022
8276
|
};
|
|
8023
8277
|
};
|
|
8024
8278
|
|
|
8025
8279
|
// src/react/VoiceProviderSimulationControls.tsx
|
|
8026
|
-
import { jsxDEV as
|
|
8280
|
+
import { jsxDEV as jsxDEV13 } from "react/jsx-dev-runtime";
|
|
8027
8281
|
var VoiceProviderSimulationControls = ({
|
|
8028
8282
|
className,
|
|
8029
8283
|
...options
|
|
@@ -8033,38 +8287,38 @@ var VoiceProviderSimulationControls = ({
|
|
|
8033
8287
|
const run = (provider, mode) => {
|
|
8034
8288
|
snapshot.run(provider, mode).catch(() => {});
|
|
8035
8289
|
};
|
|
8036
|
-
return /* @__PURE__ */
|
|
8290
|
+
return /* @__PURE__ */ jsxDEV13("section", {
|
|
8037
8291
|
className: [
|
|
8038
8292
|
"absolute-voice-provider-simulation",
|
|
8039
8293
|
`absolute-voice-provider-simulation--${snapshot.error ? "error" : snapshot.isRunning ? "running" : "ready"}`,
|
|
8040
8294
|
className
|
|
8041
8295
|
].filter(Boolean).join(" "),
|
|
8042
8296
|
children: [
|
|
8043
|
-
/* @__PURE__ */
|
|
8297
|
+
/* @__PURE__ */ jsxDEV13("header", {
|
|
8044
8298
|
className: "absolute-voice-provider-simulation__header",
|
|
8045
8299
|
children: [
|
|
8046
|
-
/* @__PURE__ */
|
|
8300
|
+
/* @__PURE__ */ jsxDEV13("span", {
|
|
8047
8301
|
className: "absolute-voice-provider-simulation__eyebrow",
|
|
8048
8302
|
children: model.title
|
|
8049
8303
|
}, undefined, false, undefined, this),
|
|
8050
|
-
/* @__PURE__ */
|
|
8304
|
+
/* @__PURE__ */ jsxDEV13("strong", {
|
|
8051
8305
|
className: "absolute-voice-provider-simulation__label",
|
|
8052
8306
|
children: model.label
|
|
8053
8307
|
}, undefined, false, undefined, this)
|
|
8054
8308
|
]
|
|
8055
8309
|
}, undefined, true, undefined, this),
|
|
8056
|
-
/* @__PURE__ */
|
|
8310
|
+
/* @__PURE__ */ jsxDEV13("p", {
|
|
8057
8311
|
className: "absolute-voice-provider-simulation__description",
|
|
8058
8312
|
children: model.description
|
|
8059
8313
|
}, undefined, false, undefined, this),
|
|
8060
|
-
model.canSimulateFailure ? null : /* @__PURE__ */
|
|
8314
|
+
model.canSimulateFailure ? null : /* @__PURE__ */ jsxDEV13("p", {
|
|
8061
8315
|
className: "absolute-voice-provider-simulation__empty",
|
|
8062
8316
|
children: options.fallbackRequiredMessage ?? "Configure fallback providers before simulating failure."
|
|
8063
8317
|
}, undefined, false, undefined, this),
|
|
8064
|
-
/* @__PURE__ */
|
|
8318
|
+
/* @__PURE__ */ jsxDEV13("div", {
|
|
8065
8319
|
className: "absolute-voice-provider-simulation__actions",
|
|
8066
8320
|
children: [
|
|
8067
|
-
model.failureProviders.map((provider) => /* @__PURE__ */
|
|
8321
|
+
model.failureProviders.map((provider) => /* @__PURE__ */ jsxDEV13("button", {
|
|
8068
8322
|
disabled: !model.canSimulateFailure || snapshot.isRunning,
|
|
8069
8323
|
onClick: () => run(provider.provider, "failure"),
|
|
8070
8324
|
type: "button",
|
|
@@ -8077,7 +8331,7 @@ var VoiceProviderSimulationControls = ({
|
|
|
8077
8331
|
"failure"
|
|
8078
8332
|
]
|
|
8079
8333
|
}, `fail-${provider.provider}`, true, undefined, this)),
|
|
8080
|
-
model.providers.map((provider) => /* @__PURE__ */
|
|
8334
|
+
model.providers.map((provider) => /* @__PURE__ */ jsxDEV13("button", {
|
|
8081
8335
|
disabled: snapshot.isRunning,
|
|
8082
8336
|
onClick: () => run(provider.provider, "recovery"),
|
|
8083
8337
|
type: "button",
|
|
@@ -8089,11 +8343,11 @@ var VoiceProviderSimulationControls = ({
|
|
|
8089
8343
|
}, `recover-${provider.provider}`, true, undefined, this))
|
|
8090
8344
|
]
|
|
8091
8345
|
}, undefined, true, undefined, this),
|
|
8092
|
-
snapshot.error ? /* @__PURE__ */
|
|
8346
|
+
snapshot.error ? /* @__PURE__ */ jsxDEV13("p", {
|
|
8093
8347
|
className: "absolute-voice-provider-simulation__error",
|
|
8094
8348
|
children: snapshot.error
|
|
8095
8349
|
}, undefined, false, undefined, this) : null,
|
|
8096
|
-
model.resultText ? /* @__PURE__ */
|
|
8350
|
+
model.resultText ? /* @__PURE__ */ jsxDEV13("pre", {
|
|
8097
8351
|
className: "absolute-voice-provider-simulation__result",
|
|
8098
8352
|
children: model.resultText
|
|
8099
8353
|
}, undefined, false, undefined, this) : null
|
|
@@ -8101,7 +8355,7 @@ var VoiceProviderSimulationControls = ({
|
|
|
8101
8355
|
}, undefined, true, undefined, this);
|
|
8102
8356
|
};
|
|
8103
8357
|
// src/react/useVoiceProviderCapabilities.tsx
|
|
8104
|
-
import { useEffect as
|
|
8358
|
+
import { useEffect as useEffect14, useRef as useRef14, useSyncExternalStore as useSyncExternalStore14 } from "react";
|
|
8105
8359
|
|
|
8106
8360
|
// src/client/providerCapabilities.ts
|
|
8107
8361
|
var fetchVoiceProviderCapabilities = async (path = "/api/provider-capabilities", options = {}) => {
|
|
@@ -8184,25 +8438,25 @@ var createVoiceProviderCapabilitiesStore = (path = "/api/provider-capabilities",
|
|
|
8184
8438
|
|
|
8185
8439
|
// src/react/useVoiceProviderCapabilities.tsx
|
|
8186
8440
|
var useVoiceProviderCapabilities = (path = "/api/provider-capabilities", options = {}) => {
|
|
8187
|
-
const storeRef =
|
|
8441
|
+
const storeRef = useRef14(null);
|
|
8188
8442
|
if (!storeRef.current) {
|
|
8189
8443
|
storeRef.current = createVoiceProviderCapabilitiesStore(path, options);
|
|
8190
8444
|
}
|
|
8191
8445
|
const store = storeRef.current;
|
|
8192
|
-
|
|
8446
|
+
useEffect14(() => {
|
|
8193
8447
|
store.refresh().catch(() => {});
|
|
8194
8448
|
return () => store.close();
|
|
8195
8449
|
}, [store]);
|
|
8196
8450
|
return {
|
|
8197
|
-
...
|
|
8451
|
+
...useSyncExternalStore14(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
8198
8452
|
refresh: store.refresh
|
|
8199
8453
|
};
|
|
8200
8454
|
};
|
|
8201
8455
|
|
|
8202
8456
|
// src/client/providerCapabilitiesWidget.ts
|
|
8203
|
-
var
|
|
8204
|
-
var
|
|
8205
|
-
var
|
|
8457
|
+
var DEFAULT_TITLE13 = "Provider Capabilities";
|
|
8458
|
+
var DEFAULT_DESCRIPTION13 = "Configured, selected, and healthy voice providers for this deployment.";
|
|
8459
|
+
var escapeHtml19 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
8206
8460
|
var formatProvider = (provider) => provider.split(/[-_\s]+/).filter(Boolean).map((part) => `${part[0]?.toUpperCase() ?? ""}${part.slice(1)}`).join(" ") || provider;
|
|
8207
8461
|
var formatKind2 = (kind) => kind.toUpperCase();
|
|
8208
8462
|
var formatStatus3 = (status) => status.split("-").map((part) => `${part[0]?.toUpperCase() ?? ""}${part.slice(1)}`).join(" ");
|
|
@@ -8246,36 +8500,36 @@ var createVoiceProviderCapabilitiesViewModel = (snapshot, options = {}) => {
|
|
|
8246
8500
|
const selectedCount = snapshot.report?.selected ?? capabilities.filter((capability) => capability.selected).length;
|
|
8247
8501
|
return {
|
|
8248
8502
|
capabilities,
|
|
8249
|
-
description: options.description ??
|
|
8503
|
+
description: options.description ?? DEFAULT_DESCRIPTION13,
|
|
8250
8504
|
error: snapshot.error,
|
|
8251
8505
|
isLoading: snapshot.isLoading,
|
|
8252
8506
|
label: snapshot.error ? "Unavailable" : capabilities.length ? warningCount > 0 ? `${warningCount} needs attention` : `${selectedCount} selected` : snapshot.isLoading ? "Checking" : "No capabilities",
|
|
8253
8507
|
status: snapshot.error ? "error" : capabilities.length ? warningCount > 0 ? "warning" : "ready" : snapshot.isLoading ? "loading" : "empty",
|
|
8254
|
-
title: options.title ??
|
|
8508
|
+
title: options.title ?? DEFAULT_TITLE13,
|
|
8255
8509
|
updatedAt: snapshot.updatedAt
|
|
8256
8510
|
};
|
|
8257
8511
|
};
|
|
8258
8512
|
var renderVoiceProviderCapabilitiesHTML = (snapshot, options = {}) => {
|
|
8259
8513
|
const model = createVoiceProviderCapabilitiesViewModel(snapshot, options);
|
|
8260
|
-
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--${
|
|
8514
|
+
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--${escapeHtml19(capability.status)}">
|
|
8261
8515
|
<header>
|
|
8262
|
-
<strong>${
|
|
8263
|
-
<span>${
|
|
8516
|
+
<strong>${escapeHtml19(capability.label)}</strong>
|
|
8517
|
+
<span>${escapeHtml19(formatStatus3(capability.status))}</span>
|
|
8264
8518
|
</header>
|
|
8265
|
-
<p>${
|
|
8519
|
+
<p>${escapeHtml19(capability.detail)}</p>
|
|
8266
8520
|
<dl>${capability.rows.map((row) => `<div>
|
|
8267
|
-
<dt>${
|
|
8268
|
-
<dd>${
|
|
8521
|
+
<dt>${escapeHtml19(row.label)}</dt>
|
|
8522
|
+
<dd>${escapeHtml19(row.value)}</dd>
|
|
8269
8523
|
</div>`).join("")}</dl>
|
|
8270
8524
|
</article>`).join("")}</div>` : '<p class="absolute-voice-provider-capabilities__empty">Configure provider capabilities to see deployment coverage.</p>';
|
|
8271
|
-
return `<section class="absolute-voice-provider-capabilities absolute-voice-provider-capabilities--${
|
|
8525
|
+
return `<section class="absolute-voice-provider-capabilities absolute-voice-provider-capabilities--${escapeHtml19(model.status)}">
|
|
8272
8526
|
<header class="absolute-voice-provider-capabilities__header">
|
|
8273
|
-
<span class="absolute-voice-provider-capabilities__eyebrow">${
|
|
8274
|
-
<strong class="absolute-voice-provider-capabilities__label">${
|
|
8527
|
+
<span class="absolute-voice-provider-capabilities__eyebrow">${escapeHtml19(model.title)}</span>
|
|
8528
|
+
<strong class="absolute-voice-provider-capabilities__label">${escapeHtml19(model.label)}</strong>
|
|
8275
8529
|
</header>
|
|
8276
|
-
<p class="absolute-voice-provider-capabilities__description">${
|
|
8530
|
+
<p class="absolute-voice-provider-capabilities__description">${escapeHtml19(model.description)}</p>
|
|
8277
8531
|
${capabilities}
|
|
8278
|
-
${model.error ? `<p class="absolute-voice-provider-capabilities__error">${
|
|
8532
|
+
${model.error ? `<p class="absolute-voice-provider-capabilities__error">${escapeHtml19(model.error)}</p>` : ""}
|
|
8279
8533
|
</section>`;
|
|
8280
8534
|
};
|
|
8281
8535
|
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}`;
|
|
@@ -8317,7 +8571,7 @@ var defineVoiceProviderCapabilitiesElement = (tagName = "absolute-voice-provider
|
|
|
8317
8571
|
};
|
|
8318
8572
|
|
|
8319
8573
|
// src/react/VoiceProviderCapabilities.tsx
|
|
8320
|
-
import { jsxDEV as
|
|
8574
|
+
import { jsxDEV as jsxDEV14 } from "react/jsx-dev-runtime";
|
|
8321
8575
|
var VoiceProviderCapabilities = ({
|
|
8322
8576
|
className,
|
|
8323
8577
|
path = "/api/provider-capabilities",
|
|
@@ -8325,58 +8579,58 @@ var VoiceProviderCapabilities = ({
|
|
|
8325
8579
|
}) => {
|
|
8326
8580
|
const snapshot = useVoiceProviderCapabilities(path, options);
|
|
8327
8581
|
const model = createVoiceProviderCapabilitiesViewModel(snapshot, options);
|
|
8328
|
-
return /* @__PURE__ */
|
|
8582
|
+
return /* @__PURE__ */ jsxDEV14("section", {
|
|
8329
8583
|
className: [
|
|
8330
8584
|
"absolute-voice-provider-capabilities",
|
|
8331
8585
|
`absolute-voice-provider-capabilities--${model.status}`,
|
|
8332
8586
|
className
|
|
8333
8587
|
].filter(Boolean).join(" "),
|
|
8334
8588
|
children: [
|
|
8335
|
-
/* @__PURE__ */
|
|
8589
|
+
/* @__PURE__ */ jsxDEV14("header", {
|
|
8336
8590
|
className: "absolute-voice-provider-capabilities__header",
|
|
8337
8591
|
children: [
|
|
8338
|
-
/* @__PURE__ */
|
|
8592
|
+
/* @__PURE__ */ jsxDEV14("span", {
|
|
8339
8593
|
className: "absolute-voice-provider-capabilities__eyebrow",
|
|
8340
8594
|
children: model.title
|
|
8341
8595
|
}, undefined, false, undefined, this),
|
|
8342
|
-
/* @__PURE__ */
|
|
8596
|
+
/* @__PURE__ */ jsxDEV14("strong", {
|
|
8343
8597
|
className: "absolute-voice-provider-capabilities__label",
|
|
8344
8598
|
children: model.label
|
|
8345
8599
|
}, undefined, false, undefined, this)
|
|
8346
8600
|
]
|
|
8347
8601
|
}, undefined, true, undefined, this),
|
|
8348
|
-
/* @__PURE__ */
|
|
8602
|
+
/* @__PURE__ */ jsxDEV14("p", {
|
|
8349
8603
|
className: "absolute-voice-provider-capabilities__description",
|
|
8350
8604
|
children: model.description
|
|
8351
8605
|
}, undefined, false, undefined, this),
|
|
8352
|
-
model.capabilities.length ? /* @__PURE__ */
|
|
8606
|
+
model.capabilities.length ? /* @__PURE__ */ jsxDEV14("div", {
|
|
8353
8607
|
className: "absolute-voice-provider-capabilities__providers",
|
|
8354
|
-
children: model.capabilities.map((capability) => /* @__PURE__ */
|
|
8608
|
+
children: model.capabilities.map((capability) => /* @__PURE__ */ jsxDEV14("article", {
|
|
8355
8609
|
className: [
|
|
8356
8610
|
"absolute-voice-provider-capabilities__provider",
|
|
8357
8611
|
`absolute-voice-provider-capabilities__provider--${capability.status}`
|
|
8358
8612
|
].join(" "),
|
|
8359
8613
|
children: [
|
|
8360
|
-
/* @__PURE__ */
|
|
8614
|
+
/* @__PURE__ */ jsxDEV14("header", {
|
|
8361
8615
|
children: [
|
|
8362
|
-
/* @__PURE__ */
|
|
8616
|
+
/* @__PURE__ */ jsxDEV14("strong", {
|
|
8363
8617
|
children: capability.label
|
|
8364
8618
|
}, undefined, false, undefined, this),
|
|
8365
|
-
/* @__PURE__ */
|
|
8619
|
+
/* @__PURE__ */ jsxDEV14("span", {
|
|
8366
8620
|
children: capability.status
|
|
8367
8621
|
}, undefined, false, undefined, this)
|
|
8368
8622
|
]
|
|
8369
8623
|
}, undefined, true, undefined, this),
|
|
8370
|
-
/* @__PURE__ */
|
|
8624
|
+
/* @__PURE__ */ jsxDEV14("p", {
|
|
8371
8625
|
children: capability.detail
|
|
8372
8626
|
}, undefined, false, undefined, this),
|
|
8373
|
-
/* @__PURE__ */
|
|
8374
|
-
children: capability.rows.map((row) => /* @__PURE__ */
|
|
8627
|
+
/* @__PURE__ */ jsxDEV14("dl", {
|
|
8628
|
+
children: capability.rows.map((row) => /* @__PURE__ */ jsxDEV14("div", {
|
|
8375
8629
|
children: [
|
|
8376
|
-
/* @__PURE__ */
|
|
8630
|
+
/* @__PURE__ */ jsxDEV14("dt", {
|
|
8377
8631
|
children: row.label
|
|
8378
8632
|
}, undefined, false, undefined, this),
|
|
8379
|
-
/* @__PURE__ */
|
|
8633
|
+
/* @__PURE__ */ jsxDEV14("dd", {
|
|
8380
8634
|
children: row.value
|
|
8381
8635
|
}, undefined, false, undefined, this)
|
|
8382
8636
|
]
|
|
@@ -8384,11 +8638,11 @@ var VoiceProviderCapabilities = ({
|
|
|
8384
8638
|
}, undefined, false, undefined, this)
|
|
8385
8639
|
]
|
|
8386
8640
|
}, `${capability.kind}:${capability.provider}`, true, undefined, this))
|
|
8387
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
8641
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV14("p", {
|
|
8388
8642
|
className: "absolute-voice-provider-capabilities__empty",
|
|
8389
8643
|
children: "Configure provider capabilities to see deployment coverage."
|
|
8390
8644
|
}, undefined, false, undefined, this),
|
|
8391
|
-
model.error ? /* @__PURE__ */
|
|
8645
|
+
model.error ? /* @__PURE__ */ jsxDEV14("p", {
|
|
8392
8646
|
className: "absolute-voice-provider-capabilities__error",
|
|
8393
8647
|
children: model.error
|
|
8394
8648
|
}, undefined, false, undefined, this) : null
|
|
@@ -8396,7 +8650,7 @@ var VoiceProviderCapabilities = ({
|
|
|
8396
8650
|
}, undefined, true, undefined, this);
|
|
8397
8651
|
};
|
|
8398
8652
|
// src/react/useVoiceProviderContracts.tsx
|
|
8399
|
-
import { useEffect as
|
|
8653
|
+
import { useEffect as useEffect15, useRef as useRef15, useSyncExternalStore as useSyncExternalStore15 } from "react";
|
|
8400
8654
|
|
|
8401
8655
|
// src/client/providerContracts.ts
|
|
8402
8656
|
var fetchVoiceProviderContracts = async (path = "/api/provider-contracts", options = {}) => {
|
|
@@ -8475,25 +8729,25 @@ var createVoiceProviderContractsStore = (path = "/api/provider-contracts", optio
|
|
|
8475
8729
|
|
|
8476
8730
|
// src/react/useVoiceProviderContracts.tsx
|
|
8477
8731
|
var useVoiceProviderContracts = (path = "/api/provider-contracts", options = {}) => {
|
|
8478
|
-
const storeRef =
|
|
8732
|
+
const storeRef = useRef15(null);
|
|
8479
8733
|
if (!storeRef.current) {
|
|
8480
8734
|
storeRef.current = createVoiceProviderContractsStore(path, options);
|
|
8481
8735
|
}
|
|
8482
8736
|
const store = storeRef.current;
|
|
8483
|
-
|
|
8737
|
+
useEffect15(() => {
|
|
8484
8738
|
store.refresh().catch(() => {});
|
|
8485
8739
|
return () => store.close();
|
|
8486
8740
|
}, [store]);
|
|
8487
8741
|
return {
|
|
8488
|
-
...
|
|
8742
|
+
...useSyncExternalStore15(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
8489
8743
|
refresh: store.refresh
|
|
8490
8744
|
};
|
|
8491
8745
|
};
|
|
8492
8746
|
|
|
8493
8747
|
// src/client/providerContractsWidget.ts
|
|
8494
|
-
var
|
|
8495
|
-
var
|
|
8496
|
-
var
|
|
8748
|
+
var DEFAULT_TITLE14 = "Provider Contracts";
|
|
8749
|
+
var DEFAULT_DESCRIPTION14 = "Production contract coverage for provider env, latency, fallback, streaming, and capabilities.";
|
|
8750
|
+
var escapeHtml20 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
8497
8751
|
var formatProvider2 = (provider) => provider.split(/[-_\s]+/).filter(Boolean).map((part) => `${part[0]?.toUpperCase() ?? ""}${part.slice(1)}`).join(" ") || provider;
|
|
8498
8752
|
var formatStatus4 = (status) => status.split("-").map((part) => `${part[0]?.toUpperCase() ?? ""}${part.slice(1)}`).join(" ");
|
|
8499
8753
|
var contractDetail = (row) => {
|
|
@@ -8525,38 +8779,38 @@ var createVoiceProviderContractsViewModel = (snapshot, options = {}) => {
|
|
|
8525
8779
|
}));
|
|
8526
8780
|
const warningCount = snapshot.report ? snapshot.report.failed + snapshot.report.warned : rows.filter((row) => row.status !== "pass").length;
|
|
8527
8781
|
return {
|
|
8528
|
-
description: options.description ??
|
|
8782
|
+
description: options.description ?? DEFAULT_DESCRIPTION14,
|
|
8529
8783
|
error: snapshot.error,
|
|
8530
8784
|
isLoading: snapshot.isLoading,
|
|
8531
8785
|
label: snapshot.error ? "Unavailable" : rows.length ? warningCount > 0 ? `${warningCount} needs attention` : `${rows.length} passing` : snapshot.isLoading ? "Checking" : "No contracts",
|
|
8532
8786
|
rows,
|
|
8533
8787
|
status: snapshot.error ? "error" : rows.length ? warningCount > 0 ? "warning" : "ready" : snapshot.isLoading ? "loading" : "empty",
|
|
8534
|
-
title: options.title ??
|
|
8788
|
+
title: options.title ?? DEFAULT_TITLE14,
|
|
8535
8789
|
updatedAt: snapshot.updatedAt
|
|
8536
8790
|
};
|
|
8537
8791
|
};
|
|
8538
8792
|
var renderVoiceProviderContractsHTML = (snapshot, options = {}) => {
|
|
8539
8793
|
const model = createVoiceProviderContractsViewModel(snapshot, options);
|
|
8540
|
-
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--${
|
|
8794
|
+
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--${escapeHtml20(row.status)}">
|
|
8541
8795
|
<header>
|
|
8542
|
-
<strong>${
|
|
8543
|
-
<span>${
|
|
8796
|
+
<strong>${escapeHtml20(row.label)}</strong>
|
|
8797
|
+
<span>${escapeHtml20(formatStatus4(row.status))}</span>
|
|
8544
8798
|
</header>
|
|
8545
|
-
<p>${
|
|
8546
|
-
${row.remediations.length ? `<ul class="absolute-voice-provider-contracts__remediations">${row.remediations.map((remediation) => `<li>${remediation.href ? `<a href="${
|
|
8799
|
+
<p>${escapeHtml20(row.detail)}</p>
|
|
8800
|
+
${row.remediations.length ? `<ul class="absolute-voice-provider-contracts__remediations">${row.remediations.map((remediation) => `<li>${remediation.href ? `<a href="${escapeHtml20(remediation.href)}">${escapeHtml20(remediation.label)}</a>` : `<strong>${escapeHtml20(remediation.label)}</strong>`}<span>${escapeHtml20(remediation.detail)}</span></li>`).join("")}</ul>` : ""}
|
|
8547
8801
|
<dl>${row.rows.map((item) => `<div>
|
|
8548
|
-
<dt>${
|
|
8549
|
-
<dd>${
|
|
8802
|
+
<dt>${escapeHtml20(item.label)}</dt>
|
|
8803
|
+
<dd>${escapeHtml20(item.value)}</dd>
|
|
8550
8804
|
</div>`).join("")}</dl>
|
|
8551
8805
|
</article>`).join("")}</div>` : '<p class="absolute-voice-provider-contracts__empty">Configure provider contracts to see production coverage.</p>';
|
|
8552
|
-
return `<section class="absolute-voice-provider-contracts absolute-voice-provider-contracts--${
|
|
8806
|
+
return `<section class="absolute-voice-provider-contracts absolute-voice-provider-contracts--${escapeHtml20(model.status)}">
|
|
8553
8807
|
<header class="absolute-voice-provider-contracts__header">
|
|
8554
|
-
<span class="absolute-voice-provider-contracts__eyebrow">${
|
|
8555
|
-
<strong class="absolute-voice-provider-contracts__label">${
|
|
8808
|
+
<span class="absolute-voice-provider-contracts__eyebrow">${escapeHtml20(model.title)}</span>
|
|
8809
|
+
<strong class="absolute-voice-provider-contracts__label">${escapeHtml20(model.label)}</strong>
|
|
8556
8810
|
</header>
|
|
8557
|
-
<p class="absolute-voice-provider-contracts__description">${
|
|
8811
|
+
<p class="absolute-voice-provider-contracts__description">${escapeHtml20(model.description)}</p>
|
|
8558
8812
|
${rows}
|
|
8559
|
-
${model.error ? `<p class="absolute-voice-provider-contracts__error">${
|
|
8813
|
+
${model.error ? `<p class="absolute-voice-provider-contracts__error">${escapeHtml20(model.error)}</p>` : ""}
|
|
8560
8814
|
</section>`;
|
|
8561
8815
|
};
|
|
8562
8816
|
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}`;
|
|
@@ -8598,7 +8852,7 @@ var defineVoiceProviderContractsElement = (tagName = "absolute-voice-provider-co
|
|
|
8598
8852
|
};
|
|
8599
8853
|
|
|
8600
8854
|
// src/react/VoiceProviderContracts.tsx
|
|
8601
|
-
import { jsxDEV as
|
|
8855
|
+
import { jsxDEV as jsxDEV15 } from "react/jsx-dev-runtime";
|
|
8602
8856
|
var VoiceProviderContracts = ({
|
|
8603
8857
|
className,
|
|
8604
8858
|
path = "/api/provider-contracts",
|
|
@@ -8606,74 +8860,74 @@ var VoiceProviderContracts = ({
|
|
|
8606
8860
|
}) => {
|
|
8607
8861
|
const snapshot = useVoiceProviderContracts(path, options);
|
|
8608
8862
|
const model = createVoiceProviderContractsViewModel(snapshot, options);
|
|
8609
|
-
return /* @__PURE__ */
|
|
8863
|
+
return /* @__PURE__ */ jsxDEV15("section", {
|
|
8610
8864
|
className: [
|
|
8611
8865
|
"absolute-voice-provider-contracts",
|
|
8612
8866
|
`absolute-voice-provider-contracts--${model.status}`,
|
|
8613
8867
|
className
|
|
8614
8868
|
].filter(Boolean).join(" "),
|
|
8615
8869
|
children: [
|
|
8616
|
-
/* @__PURE__ */
|
|
8870
|
+
/* @__PURE__ */ jsxDEV15("header", {
|
|
8617
8871
|
className: "absolute-voice-provider-contracts__header",
|
|
8618
8872
|
children: [
|
|
8619
|
-
/* @__PURE__ */
|
|
8873
|
+
/* @__PURE__ */ jsxDEV15("span", {
|
|
8620
8874
|
className: "absolute-voice-provider-contracts__eyebrow",
|
|
8621
8875
|
children: model.title
|
|
8622
8876
|
}, undefined, false, undefined, this),
|
|
8623
|
-
/* @__PURE__ */
|
|
8877
|
+
/* @__PURE__ */ jsxDEV15("strong", {
|
|
8624
8878
|
className: "absolute-voice-provider-contracts__label",
|
|
8625
8879
|
children: model.label
|
|
8626
8880
|
}, undefined, false, undefined, this)
|
|
8627
8881
|
]
|
|
8628
8882
|
}, undefined, true, undefined, this),
|
|
8629
|
-
/* @__PURE__ */
|
|
8883
|
+
/* @__PURE__ */ jsxDEV15("p", {
|
|
8630
8884
|
className: "absolute-voice-provider-contracts__description",
|
|
8631
8885
|
children: model.description
|
|
8632
8886
|
}, undefined, false, undefined, this),
|
|
8633
|
-
model.rows.length ? /* @__PURE__ */
|
|
8887
|
+
model.rows.length ? /* @__PURE__ */ jsxDEV15("div", {
|
|
8634
8888
|
className: "absolute-voice-provider-contracts__rows",
|
|
8635
|
-
children: model.rows.map((row) => /* @__PURE__ */
|
|
8889
|
+
children: model.rows.map((row) => /* @__PURE__ */ jsxDEV15("article", {
|
|
8636
8890
|
className: [
|
|
8637
8891
|
"absolute-voice-provider-contracts__row",
|
|
8638
8892
|
`absolute-voice-provider-contracts__row--${row.status}`
|
|
8639
8893
|
].join(" "),
|
|
8640
8894
|
children: [
|
|
8641
|
-
/* @__PURE__ */
|
|
8895
|
+
/* @__PURE__ */ jsxDEV15("header", {
|
|
8642
8896
|
children: [
|
|
8643
|
-
/* @__PURE__ */
|
|
8897
|
+
/* @__PURE__ */ jsxDEV15("strong", {
|
|
8644
8898
|
children: row.label
|
|
8645
8899
|
}, undefined, false, undefined, this),
|
|
8646
|
-
/* @__PURE__ */
|
|
8900
|
+
/* @__PURE__ */ jsxDEV15("span", {
|
|
8647
8901
|
children: row.status
|
|
8648
8902
|
}, undefined, false, undefined, this)
|
|
8649
8903
|
]
|
|
8650
8904
|
}, undefined, true, undefined, this),
|
|
8651
|
-
/* @__PURE__ */
|
|
8905
|
+
/* @__PURE__ */ jsxDEV15("p", {
|
|
8652
8906
|
children: row.detail
|
|
8653
8907
|
}, undefined, false, undefined, this),
|
|
8654
|
-
row.remediations.length ? /* @__PURE__ */
|
|
8908
|
+
row.remediations.length ? /* @__PURE__ */ jsxDEV15("ul", {
|
|
8655
8909
|
className: "absolute-voice-provider-contracts__remediations",
|
|
8656
|
-
children: row.remediations.map((remediation) => /* @__PURE__ */
|
|
8910
|
+
children: row.remediations.map((remediation) => /* @__PURE__ */ jsxDEV15("li", {
|
|
8657
8911
|
children: [
|
|
8658
|
-
remediation.href ? /* @__PURE__ */
|
|
8912
|
+
remediation.href ? /* @__PURE__ */ jsxDEV15("a", {
|
|
8659
8913
|
href: remediation.href,
|
|
8660
8914
|
children: remediation.label
|
|
8661
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
8915
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV15("strong", {
|
|
8662
8916
|
children: remediation.label
|
|
8663
8917
|
}, undefined, false, undefined, this),
|
|
8664
|
-
/* @__PURE__ */
|
|
8918
|
+
/* @__PURE__ */ jsxDEV15("span", {
|
|
8665
8919
|
children: remediation.detail
|
|
8666
8920
|
}, undefined, false, undefined, this)
|
|
8667
8921
|
]
|
|
8668
8922
|
}, `${row.kind}:${row.provider}:${remediation.label}`, true, undefined, this))
|
|
8669
8923
|
}, undefined, false, undefined, this) : null,
|
|
8670
|
-
/* @__PURE__ */
|
|
8671
|
-
children: row.rows.map((item) => /* @__PURE__ */
|
|
8924
|
+
/* @__PURE__ */ jsxDEV15("dl", {
|
|
8925
|
+
children: row.rows.map((item) => /* @__PURE__ */ jsxDEV15("div", {
|
|
8672
8926
|
children: [
|
|
8673
|
-
/* @__PURE__ */
|
|
8927
|
+
/* @__PURE__ */ jsxDEV15("dt", {
|
|
8674
8928
|
children: item.label
|
|
8675
8929
|
}, undefined, false, undefined, this),
|
|
8676
|
-
/* @__PURE__ */
|
|
8930
|
+
/* @__PURE__ */ jsxDEV15("dd", {
|
|
8677
8931
|
children: item.value
|
|
8678
8932
|
}, undefined, false, undefined, this)
|
|
8679
8933
|
]
|
|
@@ -8681,11 +8935,11 @@ var VoiceProviderContracts = ({
|
|
|
8681
8935
|
}, undefined, false, undefined, this)
|
|
8682
8936
|
]
|
|
8683
8937
|
}, `${row.kind}:${row.provider}`, true, undefined, this))
|
|
8684
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
8938
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV15("p", {
|
|
8685
8939
|
className: "absolute-voice-provider-contracts__empty",
|
|
8686
8940
|
children: "Configure provider contracts to see production coverage."
|
|
8687
8941
|
}, undefined, false, undefined, this),
|
|
8688
|
-
model.error ? /* @__PURE__ */
|
|
8942
|
+
model.error ? /* @__PURE__ */ jsxDEV15("p", {
|
|
8689
8943
|
className: "absolute-voice-provider-contracts__error",
|
|
8690
8944
|
children: model.error
|
|
8691
8945
|
}, undefined, false, undefined, this) : null
|
|
@@ -8693,7 +8947,7 @@ var VoiceProviderContracts = ({
|
|
|
8693
8947
|
}, undefined, true, undefined, this);
|
|
8694
8948
|
};
|
|
8695
8949
|
// src/react/useVoiceProviderStatus.tsx
|
|
8696
|
-
import { useEffect as
|
|
8950
|
+
import { useEffect as useEffect16, useRef as useRef16, useSyncExternalStore as useSyncExternalStore16 } from "react";
|
|
8697
8951
|
|
|
8698
8952
|
// src/client/providerStatus.ts
|
|
8699
8953
|
var fetchVoiceProviderStatus = async (path = "/api/provider-status", options = {}) => {
|
|
@@ -8777,25 +9031,25 @@ var createVoiceProviderStatusStore = (path = "/api/provider-status", options = {
|
|
|
8777
9031
|
|
|
8778
9032
|
// src/react/useVoiceProviderStatus.tsx
|
|
8779
9033
|
var useVoiceProviderStatus = (path = "/api/provider-status", options = {}) => {
|
|
8780
|
-
const storeRef =
|
|
9034
|
+
const storeRef = useRef16(null);
|
|
8781
9035
|
if (!storeRef.current) {
|
|
8782
9036
|
storeRef.current = createVoiceProviderStatusStore(path, options);
|
|
8783
9037
|
}
|
|
8784
9038
|
const store = storeRef.current;
|
|
8785
|
-
|
|
9039
|
+
useEffect16(() => {
|
|
8786
9040
|
store.refresh().catch(() => {});
|
|
8787
9041
|
return () => store.close();
|
|
8788
9042
|
}, [store]);
|
|
8789
9043
|
return {
|
|
8790
|
-
...
|
|
9044
|
+
...useSyncExternalStore16(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
8791
9045
|
refresh: store.refresh
|
|
8792
9046
|
};
|
|
8793
9047
|
};
|
|
8794
9048
|
|
|
8795
9049
|
// src/client/providerStatusWidget.ts
|
|
8796
|
-
var
|
|
8797
|
-
var
|
|
8798
|
-
var
|
|
9050
|
+
var DEFAULT_TITLE15 = "Voice Providers";
|
|
9051
|
+
var DEFAULT_DESCRIPTION15 = "Live provider health, fallback counts, latency, and suppression state from your self-hosted trace store.";
|
|
9052
|
+
var escapeHtml21 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
8799
9053
|
var formatProvider3 = (provider) => provider.split(/[-_\s]+/).filter(Boolean).map((part) => `${part[0]?.toUpperCase() ?? ""}${part.slice(1)}`).join(" ") || provider;
|
|
8800
9054
|
var formatStatus5 = (status) => status.split("-").map((part) => `${part[0]?.toUpperCase() ?? ""}${part.slice(1)}`).join(" ");
|
|
8801
9055
|
var formatLatency = (value) => typeof value === "number" ? `${value}ms` : "No samples";
|
|
@@ -8839,37 +9093,37 @@ var createVoiceProviderStatusViewModel = (snapshot, options = {}) => {
|
|
|
8839
9093
|
const warningCount = providers.filter((provider) => isWarningStatus2(provider.status)).length;
|
|
8840
9094
|
const healthyCount = providers.filter((provider) => provider.status === "healthy").length;
|
|
8841
9095
|
return {
|
|
8842
|
-
description: options.description ??
|
|
9096
|
+
description: options.description ?? DEFAULT_DESCRIPTION15,
|
|
8843
9097
|
error: snapshot.error,
|
|
8844
9098
|
isLoading: snapshot.isLoading,
|
|
8845
9099
|
label: snapshot.error ? "Unavailable" : providers.length ? warningCount > 0 ? `${warningCount} needs attention` : `${healthyCount} healthy` : snapshot.isLoading ? "Checking" : "No provider traffic",
|
|
8846
9100
|
providers,
|
|
8847
9101
|
status: snapshot.error ? "error" : providers.length ? warningCount > 0 ? "warning" : "ready" : snapshot.isLoading ? "loading" : "empty",
|
|
8848
|
-
title: options.title ??
|
|
9102
|
+
title: options.title ?? DEFAULT_TITLE15,
|
|
8849
9103
|
updatedAt: snapshot.updatedAt
|
|
8850
9104
|
};
|
|
8851
9105
|
};
|
|
8852
9106
|
var renderVoiceProviderStatusHTML = (snapshot, options = {}) => {
|
|
8853
9107
|
const model = createVoiceProviderStatusViewModel(snapshot, options);
|
|
8854
|
-
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--${
|
|
9108
|
+
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--${escapeHtml21(provider.status)}">
|
|
8855
9109
|
<header>
|
|
8856
|
-
<strong>${
|
|
8857
|
-
<span>${
|
|
9110
|
+
<strong>${escapeHtml21(provider.label)}</strong>
|
|
9111
|
+
<span>${escapeHtml21(formatStatus5(provider.status))}</span>
|
|
8858
9112
|
</header>
|
|
8859
|
-
<p>${
|
|
9113
|
+
<p>${escapeHtml21(provider.detail)}</p>
|
|
8860
9114
|
<dl>${provider.rows.map((row) => `<div>
|
|
8861
|
-
<dt>${
|
|
8862
|
-
<dd>${
|
|
9115
|
+
<dt>${escapeHtml21(row.label)}</dt>
|
|
9116
|
+
<dd>${escapeHtml21(row.value)}</dd>
|
|
8863
9117
|
</div>`).join("")}</dl>
|
|
8864
9118
|
</article>`).join("")}</div>` : '<p class="absolute-voice-provider-status__empty">Run voice traffic to see provider health.</p>';
|
|
8865
|
-
return `<section class="absolute-voice-provider-status absolute-voice-provider-status--${
|
|
9119
|
+
return `<section class="absolute-voice-provider-status absolute-voice-provider-status--${escapeHtml21(model.status)}">
|
|
8866
9120
|
<header class="absolute-voice-provider-status__header">
|
|
8867
|
-
<span class="absolute-voice-provider-status__eyebrow">${
|
|
8868
|
-
<strong class="absolute-voice-provider-status__label">${
|
|
9121
|
+
<span class="absolute-voice-provider-status__eyebrow">${escapeHtml21(model.title)}</span>
|
|
9122
|
+
<strong class="absolute-voice-provider-status__label">${escapeHtml21(model.label)}</strong>
|
|
8869
9123
|
</header>
|
|
8870
|
-
<p class="absolute-voice-provider-status__description">${
|
|
9124
|
+
<p class="absolute-voice-provider-status__description">${escapeHtml21(model.description)}</p>
|
|
8871
9125
|
${providers}
|
|
8872
|
-
${model.error ? `<p class="absolute-voice-provider-status__error">${
|
|
9126
|
+
${model.error ? `<p class="absolute-voice-provider-status__error">${escapeHtml21(model.error)}</p>` : ""}
|
|
8873
9127
|
</section>`;
|
|
8874
9128
|
};
|
|
8875
9129
|
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}`;
|
|
@@ -8911,7 +9165,7 @@ var defineVoiceProviderStatusElement = (tagName = "absolute-voice-provider-statu
|
|
|
8911
9165
|
};
|
|
8912
9166
|
|
|
8913
9167
|
// src/react/VoiceProviderStatus.tsx
|
|
8914
|
-
import { jsxDEV as
|
|
9168
|
+
import { jsxDEV as jsxDEV16 } from "react/jsx-dev-runtime";
|
|
8915
9169
|
var VoiceProviderStatus = ({
|
|
8916
9170
|
className,
|
|
8917
9171
|
path = "/api/provider-status",
|
|
@@ -8919,58 +9173,58 @@ var VoiceProviderStatus = ({
|
|
|
8919
9173
|
}) => {
|
|
8920
9174
|
const snapshot = useVoiceProviderStatus(path, options);
|
|
8921
9175
|
const model = createVoiceProviderStatusViewModel(snapshot, options);
|
|
8922
|
-
return /* @__PURE__ */
|
|
9176
|
+
return /* @__PURE__ */ jsxDEV16("section", {
|
|
8923
9177
|
className: [
|
|
8924
9178
|
"absolute-voice-provider-status",
|
|
8925
9179
|
`absolute-voice-provider-status--${model.status}`,
|
|
8926
9180
|
className
|
|
8927
9181
|
].filter(Boolean).join(" "),
|
|
8928
9182
|
children: [
|
|
8929
|
-
/* @__PURE__ */
|
|
9183
|
+
/* @__PURE__ */ jsxDEV16("header", {
|
|
8930
9184
|
className: "absolute-voice-provider-status__header",
|
|
8931
9185
|
children: [
|
|
8932
|
-
/* @__PURE__ */
|
|
9186
|
+
/* @__PURE__ */ jsxDEV16("span", {
|
|
8933
9187
|
className: "absolute-voice-provider-status__eyebrow",
|
|
8934
9188
|
children: model.title
|
|
8935
9189
|
}, undefined, false, undefined, this),
|
|
8936
|
-
/* @__PURE__ */
|
|
9190
|
+
/* @__PURE__ */ jsxDEV16("strong", {
|
|
8937
9191
|
className: "absolute-voice-provider-status__label",
|
|
8938
9192
|
children: model.label
|
|
8939
9193
|
}, undefined, false, undefined, this)
|
|
8940
9194
|
]
|
|
8941
9195
|
}, undefined, true, undefined, this),
|
|
8942
|
-
/* @__PURE__ */
|
|
9196
|
+
/* @__PURE__ */ jsxDEV16("p", {
|
|
8943
9197
|
className: "absolute-voice-provider-status__description",
|
|
8944
9198
|
children: model.description
|
|
8945
9199
|
}, undefined, false, undefined, this),
|
|
8946
|
-
model.providers.length ? /* @__PURE__ */
|
|
9200
|
+
model.providers.length ? /* @__PURE__ */ jsxDEV16("div", {
|
|
8947
9201
|
className: "absolute-voice-provider-status__providers",
|
|
8948
|
-
children: model.providers.map((provider) => /* @__PURE__ */
|
|
9202
|
+
children: model.providers.map((provider) => /* @__PURE__ */ jsxDEV16("article", {
|
|
8949
9203
|
className: [
|
|
8950
9204
|
"absolute-voice-provider-status__provider",
|
|
8951
9205
|
`absolute-voice-provider-status__provider--${provider.status}`
|
|
8952
9206
|
].join(" "),
|
|
8953
9207
|
children: [
|
|
8954
|
-
/* @__PURE__ */
|
|
9208
|
+
/* @__PURE__ */ jsxDEV16("header", {
|
|
8955
9209
|
children: [
|
|
8956
|
-
/* @__PURE__ */
|
|
9210
|
+
/* @__PURE__ */ jsxDEV16("strong", {
|
|
8957
9211
|
children: provider.label
|
|
8958
9212
|
}, undefined, false, undefined, this),
|
|
8959
|
-
/* @__PURE__ */
|
|
9213
|
+
/* @__PURE__ */ jsxDEV16("span", {
|
|
8960
9214
|
children: provider.status
|
|
8961
9215
|
}, undefined, false, undefined, this)
|
|
8962
9216
|
]
|
|
8963
9217
|
}, undefined, true, undefined, this),
|
|
8964
|
-
/* @__PURE__ */
|
|
9218
|
+
/* @__PURE__ */ jsxDEV16("p", {
|
|
8965
9219
|
children: provider.detail
|
|
8966
9220
|
}, undefined, false, undefined, this),
|
|
8967
|
-
/* @__PURE__ */
|
|
8968
|
-
children: provider.rows.map((row) => /* @__PURE__ */
|
|
9221
|
+
/* @__PURE__ */ jsxDEV16("dl", {
|
|
9222
|
+
children: provider.rows.map((row) => /* @__PURE__ */ jsxDEV16("div", {
|
|
8969
9223
|
children: [
|
|
8970
|
-
/* @__PURE__ */
|
|
9224
|
+
/* @__PURE__ */ jsxDEV16("dt", {
|
|
8971
9225
|
children: row.label
|
|
8972
9226
|
}, undefined, false, undefined, this),
|
|
8973
|
-
/* @__PURE__ */
|
|
9227
|
+
/* @__PURE__ */ jsxDEV16("dd", {
|
|
8974
9228
|
children: row.value
|
|
8975
9229
|
}, undefined, false, undefined, this)
|
|
8976
9230
|
]
|
|
@@ -8978,11 +9232,11 @@ var VoiceProviderStatus = ({
|
|
|
8978
9232
|
}, undefined, false, undefined, this)
|
|
8979
9233
|
]
|
|
8980
9234
|
}, provider.provider, true, undefined, this))
|
|
8981
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
9235
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV16("p", {
|
|
8982
9236
|
className: "absolute-voice-provider-status__empty",
|
|
8983
9237
|
children: "Run voice traffic to see provider health."
|
|
8984
9238
|
}, undefined, false, undefined, this),
|
|
8985
|
-
model.error ? /* @__PURE__ */
|
|
9239
|
+
model.error ? /* @__PURE__ */ jsxDEV16("p", {
|
|
8986
9240
|
className: "absolute-voice-provider-status__error",
|
|
8987
9241
|
children: model.error
|
|
8988
9242
|
}, undefined, false, undefined, this) : null
|
|
@@ -8990,7 +9244,7 @@ var VoiceProviderStatus = ({
|
|
|
8990
9244
|
}, undefined, true, undefined, this);
|
|
8991
9245
|
};
|
|
8992
9246
|
// src/react/useVoiceRoutingStatus.tsx
|
|
8993
|
-
import { useEffect as
|
|
9247
|
+
import { useEffect as useEffect17, useRef as useRef17, useSyncExternalStore as useSyncExternalStore17 } from "react";
|
|
8994
9248
|
|
|
8995
9249
|
// src/client/routingStatus.ts
|
|
8996
9250
|
var fetchVoiceRoutingStatus = async (path = "/api/routing/latest", options = {}) => {
|
|
@@ -9074,25 +9328,25 @@ var createVoiceRoutingStatusStore = (path = "/api/routing/latest", options = {})
|
|
|
9074
9328
|
|
|
9075
9329
|
// src/react/useVoiceRoutingStatus.tsx
|
|
9076
9330
|
var useVoiceRoutingStatus = (path = "/api/routing/latest", options = {}) => {
|
|
9077
|
-
const storeRef =
|
|
9331
|
+
const storeRef = useRef17(null);
|
|
9078
9332
|
if (!storeRef.current) {
|
|
9079
9333
|
storeRef.current = createVoiceRoutingStatusStore(path, options);
|
|
9080
9334
|
}
|
|
9081
9335
|
const store = storeRef.current;
|
|
9082
|
-
|
|
9336
|
+
useEffect17(() => {
|
|
9083
9337
|
store.refresh().catch(() => {});
|
|
9084
9338
|
return () => store.close();
|
|
9085
9339
|
}, [store]);
|
|
9086
9340
|
return {
|
|
9087
|
-
...
|
|
9341
|
+
...useSyncExternalStore17(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
9088
9342
|
refresh: store.refresh
|
|
9089
9343
|
};
|
|
9090
9344
|
};
|
|
9091
9345
|
|
|
9092
9346
|
// src/client/routingStatusWidget.ts
|
|
9093
|
-
var
|
|
9094
|
-
var
|
|
9095
|
-
var
|
|
9347
|
+
var DEFAULT_TITLE16 = "Voice Routing";
|
|
9348
|
+
var DEFAULT_DESCRIPTION16 = "Latest provider routing decision from the self-hosted trace store.";
|
|
9349
|
+
var escapeHtml22 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
9096
9350
|
var formatValue = (value, fallback = "None") => typeof value === "string" && value.trim() ? value : typeof value === "number" && Number.isFinite(value) ? String(value) : fallback;
|
|
9097
9351
|
var formatProviderRoutes2 = (routes) => routes && typeof routes === "object" ? Object.entries(routes).map(([role, provider]) => `${role}: ${formatValue(provider)}`).join(", ") || "None" : "None";
|
|
9098
9352
|
var getProviderRoute = (routes, role) => routes && typeof routes === "object" ? formatValue(routes[role], "Not configured") : "Not configured";
|
|
@@ -9161,35 +9415,35 @@ var createVoiceRoutingStatusViewModel = (snapshot, options = {}) => {
|
|
|
9161
9415
|
return {
|
|
9162
9416
|
activeStack,
|
|
9163
9417
|
decision,
|
|
9164
|
-
description: options.description ??
|
|
9418
|
+
description: options.description ?? DEFAULT_DESCRIPTION16,
|
|
9165
9419
|
error: snapshot.error,
|
|
9166
9420
|
isLoading: snapshot.isLoading,
|
|
9167
9421
|
label: snapshot.error ? "Unavailable" : decision ? `${formatValue(decision.kind).toUpperCase()} ${formatValue(decision.status, "unknown")}` : snapshot.isLoading ? "Checking" : "No routing yet",
|
|
9168
9422
|
rows,
|
|
9169
9423
|
status: snapshot.error ? "error" : decision ? "ready" : snapshot.isLoading ? "loading" : "empty",
|
|
9170
|
-
title: options.title ??
|
|
9424
|
+
title: options.title ?? DEFAULT_TITLE16,
|
|
9171
9425
|
updatedAt: snapshot.updatedAt
|
|
9172
9426
|
};
|
|
9173
9427
|
};
|
|
9174
9428
|
var renderVoiceRoutingStatusHTML = (snapshot, options = {}) => {
|
|
9175
9429
|
const model = createVoiceRoutingStatusViewModel(snapshot, options);
|
|
9176
9430
|
const activeStack = model.activeStack.length ? `<div class="absolute-voice-routing-status__stack" aria-label="Active voice stack">${model.activeStack.map((item) => `<div>
|
|
9177
|
-
<span>${
|
|
9178
|
-
<strong>${
|
|
9431
|
+
<span>${escapeHtml22(item.label)}</span>
|
|
9432
|
+
<strong>${escapeHtml22(item.value)}</strong>
|
|
9179
9433
|
</div>`).join("")}</div>` : "";
|
|
9180
9434
|
const rows = model.rows.length ? `<div class="absolute-voice-routing-status__grid">${model.rows.map((row) => `<div>
|
|
9181
|
-
<span>${
|
|
9182
|
-
<strong>${
|
|
9435
|
+
<span>${escapeHtml22(row.label)}</span>
|
|
9436
|
+
<strong>${escapeHtml22(row.value)}</strong>
|
|
9183
9437
|
</div>`).join("")}</div>` : '<p class="absolute-voice-routing-status__empty">Start a voice session to see the selected provider.</p>';
|
|
9184
|
-
return `<section class="absolute-voice-routing-status absolute-voice-routing-status--${
|
|
9438
|
+
return `<section class="absolute-voice-routing-status absolute-voice-routing-status--${escapeHtml22(model.status)}">
|
|
9185
9439
|
<header class="absolute-voice-routing-status__header">
|
|
9186
|
-
<span class="absolute-voice-routing-status__eyebrow">${
|
|
9187
|
-
<strong class="absolute-voice-routing-status__label">${
|
|
9440
|
+
<span class="absolute-voice-routing-status__eyebrow">${escapeHtml22(model.title)}</span>
|
|
9441
|
+
<strong class="absolute-voice-routing-status__label">${escapeHtml22(model.label)}</strong>
|
|
9188
9442
|
</header>
|
|
9189
|
-
<p class="absolute-voice-routing-status__description">${
|
|
9443
|
+
<p class="absolute-voice-routing-status__description">${escapeHtml22(model.description)}</p>
|
|
9190
9444
|
${activeStack}
|
|
9191
9445
|
${rows}
|
|
9192
|
-
${model.error ? `<p class="absolute-voice-routing-status__error">${
|
|
9446
|
+
${model.error ? `<p class="absolute-voice-routing-status__error">${escapeHtml22(model.error)}</p>` : ""}
|
|
9193
9447
|
</section>`;
|
|
9194
9448
|
};
|
|
9195
9449
|
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}}`;
|
|
@@ -9231,7 +9485,7 @@ var defineVoiceRoutingStatusElement = (tagName = "absolute-voice-routing-status"
|
|
|
9231
9485
|
};
|
|
9232
9486
|
|
|
9233
9487
|
// src/react/VoiceRoutingStatus.tsx
|
|
9234
|
-
import { jsxDEV as
|
|
9488
|
+
import { jsxDEV as jsxDEV17 } from "react/jsx-dev-runtime";
|
|
9235
9489
|
var VoiceRoutingStatus = ({
|
|
9236
9490
|
className,
|
|
9237
9491
|
path = "/api/routing/latest",
|
|
@@ -9239,47 +9493,47 @@ var VoiceRoutingStatus = ({
|
|
|
9239
9493
|
}) => {
|
|
9240
9494
|
const snapshot = useVoiceRoutingStatus(path, options);
|
|
9241
9495
|
const model = createVoiceRoutingStatusViewModel(snapshot, options);
|
|
9242
|
-
return /* @__PURE__ */
|
|
9496
|
+
return /* @__PURE__ */ jsxDEV17("section", {
|
|
9243
9497
|
className: [
|
|
9244
9498
|
"absolute-voice-routing-status",
|
|
9245
9499
|
`absolute-voice-routing-status--${model.status}`,
|
|
9246
9500
|
className
|
|
9247
9501
|
].filter(Boolean).join(" "),
|
|
9248
9502
|
children: [
|
|
9249
|
-
/* @__PURE__ */
|
|
9503
|
+
/* @__PURE__ */ jsxDEV17("header", {
|
|
9250
9504
|
className: "absolute-voice-routing-status__header",
|
|
9251
9505
|
children: [
|
|
9252
|
-
/* @__PURE__ */
|
|
9506
|
+
/* @__PURE__ */ jsxDEV17("span", {
|
|
9253
9507
|
className: "absolute-voice-routing-status__eyebrow",
|
|
9254
9508
|
children: model.title
|
|
9255
9509
|
}, undefined, false, undefined, this),
|
|
9256
|
-
/* @__PURE__ */
|
|
9510
|
+
/* @__PURE__ */ jsxDEV17("strong", {
|
|
9257
9511
|
className: "absolute-voice-routing-status__label",
|
|
9258
9512
|
children: model.label
|
|
9259
9513
|
}, undefined, false, undefined, this)
|
|
9260
9514
|
]
|
|
9261
9515
|
}, undefined, true, undefined, this),
|
|
9262
|
-
/* @__PURE__ */
|
|
9516
|
+
/* @__PURE__ */ jsxDEV17("p", {
|
|
9263
9517
|
className: "absolute-voice-routing-status__description",
|
|
9264
9518
|
children: model.description
|
|
9265
9519
|
}, undefined, false, undefined, this),
|
|
9266
|
-
model.rows.length ? /* @__PURE__ */
|
|
9520
|
+
model.rows.length ? /* @__PURE__ */ jsxDEV17("div", {
|
|
9267
9521
|
className: "absolute-voice-routing-status__grid",
|
|
9268
|
-
children: model.rows.map((row) => /* @__PURE__ */
|
|
9522
|
+
children: model.rows.map((row) => /* @__PURE__ */ jsxDEV17("div", {
|
|
9269
9523
|
children: [
|
|
9270
|
-
/* @__PURE__ */
|
|
9524
|
+
/* @__PURE__ */ jsxDEV17("span", {
|
|
9271
9525
|
children: row.label
|
|
9272
9526
|
}, undefined, false, undefined, this),
|
|
9273
|
-
/* @__PURE__ */
|
|
9527
|
+
/* @__PURE__ */ jsxDEV17("strong", {
|
|
9274
9528
|
children: row.value
|
|
9275
9529
|
}, undefined, false, undefined, this)
|
|
9276
9530
|
]
|
|
9277
9531
|
}, row.label, true, undefined, this))
|
|
9278
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
9532
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV17("p", {
|
|
9279
9533
|
className: "absolute-voice-routing-status__empty",
|
|
9280
9534
|
children: "Start a voice session to see the selected provider."
|
|
9281
9535
|
}, undefined, false, undefined, this),
|
|
9282
|
-
model.error ? /* @__PURE__ */
|
|
9536
|
+
model.error ? /* @__PURE__ */ jsxDEV17("p", {
|
|
9283
9537
|
className: "absolute-voice-routing-status__error",
|
|
9284
9538
|
children: model.error
|
|
9285
9539
|
}, undefined, false, undefined, this) : null
|
|
@@ -9367,16 +9621,16 @@ var createVoiceTraceTimelineStore = (path = "/api/voice-traces", options = {}) =
|
|
|
9367
9621
|
};
|
|
9368
9622
|
|
|
9369
9623
|
// src/client/traceTimelineWidget.ts
|
|
9370
|
-
var
|
|
9371
|
-
var
|
|
9372
|
-
var
|
|
9373
|
-
var
|
|
9624
|
+
var DEFAULT_TITLE17 = "Voice Traces";
|
|
9625
|
+
var DEFAULT_DESCRIPTION17 = "Latest call timelines with provider latency, fallbacks, handoffs, and errors from your self-hosted trace store.";
|
|
9626
|
+
var escapeHtml23 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
9627
|
+
var formatMs5 = (value) => typeof value === "number" ? `${value}ms` : "n/a";
|
|
9374
9628
|
var formatProviders = (session) => session.providers.length ? session.providers.map((provider) => provider.provider).join(", ") : "No providers";
|
|
9375
9629
|
var createVoiceTraceTimelineViewModel = (snapshot, options = {}) => {
|
|
9376
9630
|
const sessions = (snapshot.report?.sessions ?? []).slice(0, options.limit ?? 3).map((session) => ({
|
|
9377
9631
|
...session,
|
|
9378
9632
|
detailHref: `${options.detailBasePath ?? "/traces"}/${encodeURIComponent(session.sessionId)}`,
|
|
9379
|
-
durationLabel:
|
|
9633
|
+
durationLabel: formatMs5(session.summary.callDurationMs),
|
|
9380
9634
|
incidentBundleHref: options.incidentBundleBasePath === false ? undefined : `${options.incidentBundleBasePath ?? "/voice-incidents"}/${encodeURIComponent(session.sessionId)}/markdown`,
|
|
9381
9635
|
label: `${session.summary.eventCount} events / ${session.summary.turnCount} turns`,
|
|
9382
9636
|
operationsRecordHref: options.operationsRecordBasePath === false ? undefined : `${options.operationsRecordBasePath ?? "/voice-operations"}/${encodeURIComponent(session.sessionId)}`,
|
|
@@ -9385,13 +9639,13 @@ var createVoiceTraceTimelineViewModel = (snapshot, options = {}) => {
|
|
|
9385
9639
|
const failed = sessions.filter((session) => session.status === "failed").length;
|
|
9386
9640
|
const warnings = sessions.filter((session) => session.status === "warning").length;
|
|
9387
9641
|
return {
|
|
9388
|
-
description: options.description ??
|
|
9642
|
+
description: options.description ?? DEFAULT_DESCRIPTION17,
|
|
9389
9643
|
error: snapshot.error,
|
|
9390
9644
|
isLoading: snapshot.isLoading,
|
|
9391
9645
|
label: snapshot.error ? "Unavailable" : failed > 0 ? `${failed} failed` : warnings > 0 ? `${warnings} warning` : sessions.length ? `${sessions.length} recent` : snapshot.isLoading ? "Checking" : "No traces yet",
|
|
9392
9646
|
sessions,
|
|
9393
9647
|
status: snapshot.error ? "error" : failed > 0 ? "failed" : warnings > 0 ? "warning" : sessions.length ? "ready" : snapshot.isLoading ? "loading" : "empty",
|
|
9394
|
-
title: options.title ??
|
|
9648
|
+
title: options.title ?? DEFAULT_TITLE17,
|
|
9395
9649
|
updatedAt: snapshot.updatedAt
|
|
9396
9650
|
};
|
|
9397
9651
|
};
|
|
@@ -9399,27 +9653,27 @@ var renderVoiceTraceTimelineWidgetHTML = (snapshot, options = {}) => {
|
|
|
9399
9653
|
const model = createVoiceTraceTimelineViewModel(snapshot, options);
|
|
9400
9654
|
const sessions = model.sessions.length ? `<div class="absolute-voice-trace-timeline__sessions">${model.sessions.map((session) => {
|
|
9401
9655
|
const supportLinks = [
|
|
9402
|
-
`<a href="${
|
|
9403
|
-
session.operationsRecordHref ? `<a href="${
|
|
9404
|
-
session.incidentBundleHref ? `<a href="${
|
|
9656
|
+
`<a href="${escapeHtml23(session.detailHref)}">Open timeline</a>`,
|
|
9657
|
+
session.operationsRecordHref ? `<a href="${escapeHtml23(session.operationsRecordHref)}">Open operations record</a>` : undefined,
|
|
9658
|
+
session.incidentBundleHref ? `<a href="${escapeHtml23(session.incidentBundleHref)}">Export incident bundle</a>` : undefined
|
|
9405
9659
|
].filter(Boolean).join("");
|
|
9406
|
-
return `<article class="absolute-voice-trace-timeline__session absolute-voice-trace-timeline__session--${
|
|
9660
|
+
return `<article class="absolute-voice-trace-timeline__session absolute-voice-trace-timeline__session--${escapeHtml23(session.status)}">
|
|
9407
9661
|
<header>
|
|
9408
|
-
<strong>${
|
|
9409
|
-
<span>${
|
|
9662
|
+
<strong>${escapeHtml23(session.sessionId)}</strong>
|
|
9663
|
+
<span>${escapeHtml23(session.status)}</span>
|
|
9410
9664
|
</header>
|
|
9411
|
-
<p>${
|
|
9665
|
+
<p>${escapeHtml23(session.label)} \xB7 ${escapeHtml23(session.durationLabel)} \xB7 ${escapeHtml23(session.providerLabel)}</p>
|
|
9412
9666
|
<p class="absolute-voice-trace-timeline__actions">${supportLinks}</p>
|
|
9413
9667
|
</article>`;
|
|
9414
9668
|
}).join("")}</div>` : '<p class="absolute-voice-trace-timeline__empty">Run a voice session to see call timelines.</p>';
|
|
9415
|
-
return `<section class="absolute-voice-trace-timeline absolute-voice-trace-timeline--${
|
|
9669
|
+
return `<section class="absolute-voice-trace-timeline absolute-voice-trace-timeline--${escapeHtml23(model.status)}">
|
|
9416
9670
|
<header class="absolute-voice-trace-timeline__header">
|
|
9417
|
-
<span class="absolute-voice-trace-timeline__eyebrow">${
|
|
9418
|
-
<strong class="absolute-voice-trace-timeline__label">${
|
|
9671
|
+
<span class="absolute-voice-trace-timeline__eyebrow">${escapeHtml23(model.title)}</span>
|
|
9672
|
+
<strong class="absolute-voice-trace-timeline__label">${escapeHtml23(model.label)}</strong>
|
|
9419
9673
|
</header>
|
|
9420
|
-
<p class="absolute-voice-trace-timeline__description">${
|
|
9674
|
+
<p class="absolute-voice-trace-timeline__description">${escapeHtml23(model.description)}</p>
|
|
9421
9675
|
${sessions}
|
|
9422
|
-
${model.error ? `<p class="absolute-voice-trace-timeline__error">${
|
|
9676
|
+
${model.error ? `<p class="absolute-voice-trace-timeline__error">${escapeHtml23(model.error)}</p>` : ""}
|
|
9423
9677
|
</section>`;
|
|
9424
9678
|
};
|
|
9425
9679
|
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}`;
|
|
@@ -9466,25 +9720,25 @@ var defineVoiceTraceTimelineElement = (tagName = "absolute-voice-trace-timeline"
|
|
|
9466
9720
|
};
|
|
9467
9721
|
|
|
9468
9722
|
// src/react/useVoiceTraceTimeline.tsx
|
|
9469
|
-
import { useEffect as
|
|
9723
|
+
import { useEffect as useEffect18, useRef as useRef18, useSyncExternalStore as useSyncExternalStore18 } from "react";
|
|
9470
9724
|
var useVoiceTraceTimeline = (path = "/api/voice-traces", options = {}) => {
|
|
9471
|
-
const storeRef =
|
|
9725
|
+
const storeRef = useRef18(null);
|
|
9472
9726
|
if (!storeRef.current) {
|
|
9473
9727
|
storeRef.current = createVoiceTraceTimelineStore(path, options);
|
|
9474
9728
|
}
|
|
9475
9729
|
const store = storeRef.current;
|
|
9476
|
-
|
|
9730
|
+
useEffect18(() => {
|
|
9477
9731
|
store.refresh().catch(() => {});
|
|
9478
9732
|
return () => store.close();
|
|
9479
9733
|
}, [store]);
|
|
9480
9734
|
return {
|
|
9481
|
-
...
|
|
9735
|
+
...useSyncExternalStore18(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
9482
9736
|
refresh: store.refresh
|
|
9483
9737
|
};
|
|
9484
9738
|
};
|
|
9485
9739
|
|
|
9486
9740
|
// src/react/VoiceTraceTimeline.tsx
|
|
9487
|
-
import { jsxDEV as
|
|
9741
|
+
import { jsxDEV as jsxDEV18 } from "react/jsx-dev-runtime";
|
|
9488
9742
|
var VoiceTraceTimeline = ({
|
|
9489
9743
|
className,
|
|
9490
9744
|
path = "/api/voice-traces",
|
|
@@ -9492,49 +9746,49 @@ var VoiceTraceTimeline = ({
|
|
|
9492
9746
|
}) => {
|
|
9493
9747
|
const snapshot = useVoiceTraceTimeline(path, options);
|
|
9494
9748
|
const model = createVoiceTraceTimelineViewModel(snapshot, options);
|
|
9495
|
-
return /* @__PURE__ */
|
|
9749
|
+
return /* @__PURE__ */ jsxDEV18("section", {
|
|
9496
9750
|
className: [
|
|
9497
9751
|
"absolute-voice-trace-timeline",
|
|
9498
9752
|
`absolute-voice-trace-timeline--${model.status}`,
|
|
9499
9753
|
className
|
|
9500
9754
|
].filter(Boolean).join(" "),
|
|
9501
9755
|
children: [
|
|
9502
|
-
/* @__PURE__ */
|
|
9756
|
+
/* @__PURE__ */ jsxDEV18("header", {
|
|
9503
9757
|
className: "absolute-voice-trace-timeline__header",
|
|
9504
9758
|
children: [
|
|
9505
|
-
/* @__PURE__ */
|
|
9759
|
+
/* @__PURE__ */ jsxDEV18("span", {
|
|
9506
9760
|
className: "absolute-voice-trace-timeline__eyebrow",
|
|
9507
9761
|
children: model.title
|
|
9508
9762
|
}, undefined, false, undefined, this),
|
|
9509
|
-
/* @__PURE__ */
|
|
9763
|
+
/* @__PURE__ */ jsxDEV18("strong", {
|
|
9510
9764
|
className: "absolute-voice-trace-timeline__label",
|
|
9511
9765
|
children: model.label
|
|
9512
9766
|
}, undefined, false, undefined, this)
|
|
9513
9767
|
]
|
|
9514
9768
|
}, undefined, true, undefined, this),
|
|
9515
|
-
/* @__PURE__ */
|
|
9769
|
+
/* @__PURE__ */ jsxDEV18("p", {
|
|
9516
9770
|
className: "absolute-voice-trace-timeline__description",
|
|
9517
9771
|
children: model.description
|
|
9518
9772
|
}, undefined, false, undefined, this),
|
|
9519
|
-
model.sessions.length ? /* @__PURE__ */
|
|
9773
|
+
model.sessions.length ? /* @__PURE__ */ jsxDEV18("div", {
|
|
9520
9774
|
className: "absolute-voice-trace-timeline__sessions",
|
|
9521
|
-
children: model.sessions.map((session) => /* @__PURE__ */
|
|
9775
|
+
children: model.sessions.map((session) => /* @__PURE__ */ jsxDEV18("article", {
|
|
9522
9776
|
className: [
|
|
9523
9777
|
"absolute-voice-trace-timeline__session",
|
|
9524
9778
|
`absolute-voice-trace-timeline__session--${session.status}`
|
|
9525
9779
|
].join(" "),
|
|
9526
9780
|
children: [
|
|
9527
|
-
/* @__PURE__ */
|
|
9781
|
+
/* @__PURE__ */ jsxDEV18("header", {
|
|
9528
9782
|
children: [
|
|
9529
|
-
/* @__PURE__ */
|
|
9783
|
+
/* @__PURE__ */ jsxDEV18("strong", {
|
|
9530
9784
|
children: session.sessionId
|
|
9531
9785
|
}, undefined, false, undefined, this),
|
|
9532
|
-
/* @__PURE__ */
|
|
9786
|
+
/* @__PURE__ */ jsxDEV18("span", {
|
|
9533
9787
|
children: session.status
|
|
9534
9788
|
}, undefined, false, undefined, this)
|
|
9535
9789
|
]
|
|
9536
9790
|
}, undefined, true, undefined, this),
|
|
9537
|
-
/* @__PURE__ */
|
|
9791
|
+
/* @__PURE__ */ jsxDEV18("p", {
|
|
9538
9792
|
children: [
|
|
9539
9793
|
session.label,
|
|
9540
9794
|
" \xB7 ",
|
|
@@ -9544,18 +9798,18 @@ var VoiceTraceTimeline = ({
|
|
|
9544
9798
|
session.providerLabel
|
|
9545
9799
|
]
|
|
9546
9800
|
}, undefined, true, undefined, this),
|
|
9547
|
-
/* @__PURE__ */
|
|
9801
|
+
/* @__PURE__ */ jsxDEV18("p", {
|
|
9548
9802
|
className: "absolute-voice-trace-timeline__actions",
|
|
9549
9803
|
children: [
|
|
9550
|
-
/* @__PURE__ */
|
|
9804
|
+
/* @__PURE__ */ jsxDEV18("a", {
|
|
9551
9805
|
href: session.detailHref,
|
|
9552
9806
|
children: "Open timeline"
|
|
9553
9807
|
}, undefined, false, undefined, this),
|
|
9554
|
-
session.operationsRecordHref ? /* @__PURE__ */
|
|
9808
|
+
session.operationsRecordHref ? /* @__PURE__ */ jsxDEV18("a", {
|
|
9555
9809
|
href: session.operationsRecordHref,
|
|
9556
9810
|
children: "Open operations record"
|
|
9557
9811
|
}, undefined, false, undefined, this) : null,
|
|
9558
|
-
session.incidentBundleHref ? /* @__PURE__ */
|
|
9812
|
+
session.incidentBundleHref ? /* @__PURE__ */ jsxDEV18("a", {
|
|
9559
9813
|
href: session.incidentBundleHref,
|
|
9560
9814
|
children: "Export incident bundle"
|
|
9561
9815
|
}, undefined, false, undefined, this) : null
|
|
@@ -9563,11 +9817,11 @@ var VoiceTraceTimeline = ({
|
|
|
9563
9817
|
}, undefined, true, undefined, this)
|
|
9564
9818
|
]
|
|
9565
9819
|
}, session.sessionId, true, undefined, this))
|
|
9566
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
9820
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV18("p", {
|
|
9567
9821
|
className: "absolute-voice-trace-timeline__empty",
|
|
9568
9822
|
children: "Run a voice session to see call timelines."
|
|
9569
9823
|
}, undefined, false, undefined, this),
|
|
9570
|
-
model.error ? /* @__PURE__ */
|
|
9824
|
+
model.error ? /* @__PURE__ */ jsxDEV18("p", {
|
|
9571
9825
|
className: "absolute-voice-trace-timeline__error",
|
|
9572
9826
|
children: model.error
|
|
9573
9827
|
}, undefined, false, undefined, this) : null
|
|
@@ -9575,7 +9829,7 @@ var VoiceTraceTimeline = ({
|
|
|
9575
9829
|
}, undefined, true, undefined, this);
|
|
9576
9830
|
};
|
|
9577
9831
|
// src/react/useVoiceAgentSquadStatus.tsx
|
|
9578
|
-
import { useEffect as
|
|
9832
|
+
import { useEffect as useEffect19, useRef as useRef19, useSyncExternalStore as useSyncExternalStore19 } from "react";
|
|
9579
9833
|
|
|
9580
9834
|
// src/client/agentSquadStatus.ts
|
|
9581
9835
|
var getString4 = (value) => typeof value === "string" && value.trim() ? value.trim() : undefined;
|
|
@@ -9653,25 +9907,25 @@ var createVoiceAgentSquadStatusStore = (path = "/api/voice-traces", options = {}
|
|
|
9653
9907
|
|
|
9654
9908
|
// src/react/useVoiceAgentSquadStatus.tsx
|
|
9655
9909
|
var useVoiceAgentSquadStatus = (path = "/api/voice-traces", options = {}) => {
|
|
9656
|
-
const storeRef =
|
|
9910
|
+
const storeRef = useRef19(null);
|
|
9657
9911
|
if (!storeRef.current) {
|
|
9658
9912
|
storeRef.current = createVoiceAgentSquadStatusStore(path, options);
|
|
9659
9913
|
}
|
|
9660
9914
|
const store = storeRef.current;
|
|
9661
|
-
|
|
9915
|
+
useEffect19(() => {
|
|
9662
9916
|
store.refresh().catch(() => {});
|
|
9663
9917
|
return () => store.close();
|
|
9664
9918
|
}, [store]);
|
|
9665
9919
|
return {
|
|
9666
|
-
...
|
|
9920
|
+
...useSyncExternalStore19(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
9667
9921
|
refresh: store.refresh
|
|
9668
9922
|
};
|
|
9669
9923
|
};
|
|
9670
9924
|
|
|
9671
9925
|
// src/client/agentSquadStatusWidget.ts
|
|
9672
|
-
var
|
|
9673
|
-
var
|
|
9674
|
-
var
|
|
9926
|
+
var DEFAULT_TITLE18 = "Voice Agent Squad";
|
|
9927
|
+
var DEFAULT_DESCRIPTION18 = "Current specialist and recent handoffs from your self-hosted voice traces.";
|
|
9928
|
+
var escapeHtml24 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
9675
9929
|
var labelFor = (current) => {
|
|
9676
9930
|
if (!current)
|
|
9677
9931
|
return "Waiting for specialist activity";
|
|
@@ -9685,37 +9939,37 @@ var labelFor = (current) => {
|
|
|
9685
9939
|
};
|
|
9686
9940
|
var createVoiceAgentSquadStatusViewModel = (snapshot, options = {}) => ({
|
|
9687
9941
|
current: snapshot.report.current,
|
|
9688
|
-
description: options.description ??
|
|
9942
|
+
description: options.description ?? DEFAULT_DESCRIPTION18,
|
|
9689
9943
|
error: snapshot.error,
|
|
9690
9944
|
isLoading: snapshot.isLoading,
|
|
9691
9945
|
label: snapshot.error ? "Unavailable" : labelFor(snapshot.report.current),
|
|
9692
9946
|
sessionCount: snapshot.report.sessionCount,
|
|
9693
9947
|
sessions: snapshot.report.sessions,
|
|
9694
|
-
title: options.title ??
|
|
9948
|
+
title: options.title ?? DEFAULT_TITLE18,
|
|
9695
9949
|
updatedAt: snapshot.updatedAt
|
|
9696
9950
|
});
|
|
9697
9951
|
var renderVoiceAgentSquadStatusHTML = (snapshot, options = {}) => {
|
|
9698
9952
|
const model = createVoiceAgentSquadStatusViewModel(snapshot, options);
|
|
9699
9953
|
const current = model.current;
|
|
9700
9954
|
const rows = model.sessions.length ? model.sessions.slice(0, 5).map((session) => `<li>
|
|
9701
|
-
<span>${
|
|
9702
|
-
<strong>${
|
|
9703
|
-
<em>${
|
|
9704
|
-
${session.summary || session.reason ? `<p>${
|
|
9955
|
+
<span>${escapeHtml24(session.sessionId)}</span>
|
|
9956
|
+
<strong>${escapeHtml24(session.targetAgentId ?? "none")}</strong>
|
|
9957
|
+
<em>${escapeHtml24(session.status)}</em>
|
|
9958
|
+
${session.summary || session.reason ? `<p>${escapeHtml24(session.summary ?? session.reason ?? "")}</p>` : ""}
|
|
9705
9959
|
</li>`).join("") : "<li><span>No squad traces yet.</span><strong>Waiting</strong></li>";
|
|
9706
9960
|
return `<section class="absolute-voice-agent-squad-status">
|
|
9707
9961
|
<header>
|
|
9708
|
-
<span>${
|
|
9709
|
-
<strong>${
|
|
9962
|
+
<span>${escapeHtml24(model.title)}</span>
|
|
9963
|
+
<strong>${escapeHtml24(model.label)}</strong>
|
|
9710
9964
|
</header>
|
|
9711
|
-
<p>${
|
|
9965
|
+
<p>${escapeHtml24(model.description)}</p>
|
|
9712
9966
|
<div>
|
|
9713
|
-
<span>Session</span><strong>${
|
|
9714
|
-
<span>From</span><strong>${
|
|
9715
|
-
<span>Status</span><strong>${
|
|
9967
|
+
<span>Session</span><strong>${escapeHtml24(current?.sessionId ?? "n/a")}</strong>
|
|
9968
|
+
<span>From</span><strong>${escapeHtml24(current?.fromAgentId ?? "n/a")}</strong>
|
|
9969
|
+
<span>Status</span><strong>${escapeHtml24(current?.status ?? "idle")}</strong>
|
|
9716
9970
|
</div>
|
|
9717
9971
|
<ul>${rows}</ul>
|
|
9718
|
-
${model.error ? `<p class="absolute-voice-agent-squad-status__error">${
|
|
9972
|
+
${model.error ? `<p class="absolute-voice-agent-squad-status__error">${escapeHtml24(model.error)}</p>` : ""}
|
|
9719
9973
|
</section>`;
|
|
9720
9974
|
};
|
|
9721
9975
|
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}`;
|
|
@@ -9760,7 +10014,7 @@ var defineVoiceAgentSquadStatusElement = (tagName = "absolute-voice-agent-squad-
|
|
|
9760
10014
|
};
|
|
9761
10015
|
|
|
9762
10016
|
// src/react/VoiceAgentSquadStatus.tsx
|
|
9763
|
-
import { jsxDEV as
|
|
10017
|
+
import { jsxDEV as jsxDEV19 } from "react/jsx-dev-runtime";
|
|
9764
10018
|
function VoiceAgentSquadStatus({
|
|
9765
10019
|
path = "/api/voice-traces",
|
|
9766
10020
|
...options
|
|
@@ -9768,64 +10022,64 @@ function VoiceAgentSquadStatus({
|
|
|
9768
10022
|
const snapshot = useVoiceAgentSquadStatus(path, options);
|
|
9769
10023
|
const model = createVoiceAgentSquadStatusViewModel(snapshot, options);
|
|
9770
10024
|
const current = model.current;
|
|
9771
|
-
return /* @__PURE__ */
|
|
10025
|
+
return /* @__PURE__ */ jsxDEV19("section", {
|
|
9772
10026
|
className: "absolute-voice-agent-squad-status",
|
|
9773
10027
|
children: [
|
|
9774
|
-
/* @__PURE__ */
|
|
10028
|
+
/* @__PURE__ */ jsxDEV19("header", {
|
|
9775
10029
|
children: [
|
|
9776
|
-
/* @__PURE__ */
|
|
10030
|
+
/* @__PURE__ */ jsxDEV19("span", {
|
|
9777
10031
|
children: model.title
|
|
9778
10032
|
}, undefined, false, undefined, this),
|
|
9779
|
-
/* @__PURE__ */
|
|
10033
|
+
/* @__PURE__ */ jsxDEV19("strong", {
|
|
9780
10034
|
children: model.label
|
|
9781
10035
|
}, undefined, false, undefined, this)
|
|
9782
10036
|
]
|
|
9783
10037
|
}, undefined, true, undefined, this),
|
|
9784
|
-
/* @__PURE__ */
|
|
10038
|
+
/* @__PURE__ */ jsxDEV19("p", {
|
|
9785
10039
|
children: model.description
|
|
9786
10040
|
}, undefined, false, undefined, this),
|
|
9787
|
-
/* @__PURE__ */
|
|
10041
|
+
/* @__PURE__ */ jsxDEV19("dl", {
|
|
9788
10042
|
children: [
|
|
9789
|
-
/* @__PURE__ */
|
|
10043
|
+
/* @__PURE__ */ jsxDEV19("div", {
|
|
9790
10044
|
children: [
|
|
9791
|
-
/* @__PURE__ */
|
|
10045
|
+
/* @__PURE__ */ jsxDEV19("dt", {
|
|
9792
10046
|
children: "Session"
|
|
9793
10047
|
}, undefined, false, undefined, this),
|
|
9794
|
-
/* @__PURE__ */
|
|
10048
|
+
/* @__PURE__ */ jsxDEV19("dd", {
|
|
9795
10049
|
children: current?.sessionId ?? "n/a"
|
|
9796
10050
|
}, undefined, false, undefined, this)
|
|
9797
10051
|
]
|
|
9798
10052
|
}, undefined, true, undefined, this),
|
|
9799
|
-
/* @__PURE__ */
|
|
10053
|
+
/* @__PURE__ */ jsxDEV19("div", {
|
|
9800
10054
|
children: [
|
|
9801
|
-
/* @__PURE__ */
|
|
10055
|
+
/* @__PURE__ */ jsxDEV19("dt", {
|
|
9802
10056
|
children: "Current specialist"
|
|
9803
10057
|
}, undefined, false, undefined, this),
|
|
9804
|
-
/* @__PURE__ */
|
|
10058
|
+
/* @__PURE__ */ jsxDEV19("dd", {
|
|
9805
10059
|
children: current?.targetAgentId ?? "none"
|
|
9806
10060
|
}, undefined, false, undefined, this)
|
|
9807
10061
|
]
|
|
9808
10062
|
}, undefined, true, undefined, this),
|
|
9809
|
-
/* @__PURE__ */
|
|
10063
|
+
/* @__PURE__ */ jsxDEV19("div", {
|
|
9810
10064
|
children: [
|
|
9811
|
-
/* @__PURE__ */
|
|
10065
|
+
/* @__PURE__ */ jsxDEV19("dt", {
|
|
9812
10066
|
children: "Status"
|
|
9813
10067
|
}, undefined, false, undefined, this),
|
|
9814
|
-
/* @__PURE__ */
|
|
10068
|
+
/* @__PURE__ */ jsxDEV19("dd", {
|
|
9815
10069
|
children: current?.status ?? "idle"
|
|
9816
10070
|
}, undefined, false, undefined, this)
|
|
9817
10071
|
]
|
|
9818
10072
|
}, undefined, true, undefined, this)
|
|
9819
10073
|
]
|
|
9820
10074
|
}, undefined, true, undefined, this),
|
|
9821
|
-
model.error ? /* @__PURE__ */
|
|
10075
|
+
model.error ? /* @__PURE__ */ jsxDEV19("p", {
|
|
9822
10076
|
children: model.error
|
|
9823
10077
|
}, undefined, false, undefined, this) : null
|
|
9824
10078
|
]
|
|
9825
10079
|
}, undefined, true, undefined, this);
|
|
9826
10080
|
}
|
|
9827
10081
|
// src/react/useVoiceTurnLatency.tsx
|
|
9828
|
-
import { useEffect as
|
|
10082
|
+
import { useEffect as useEffect20, useRef as useRef20, useSyncExternalStore as useSyncExternalStore20 } from "react";
|
|
9829
10083
|
|
|
9830
10084
|
// src/client/turnLatency.ts
|
|
9831
10085
|
var fetchVoiceTurnLatency = async (path = "/api/turn-latency", options = {}) => {
|
|
@@ -9932,73 +10186,73 @@ var createVoiceTurnLatencyStore = (path = "/api/turn-latency", options = {}) =>
|
|
|
9932
10186
|
|
|
9933
10187
|
// src/react/useVoiceTurnLatency.tsx
|
|
9934
10188
|
var useVoiceTurnLatency = (path = "/api/turn-latency", options = {}) => {
|
|
9935
|
-
const storeRef =
|
|
10189
|
+
const storeRef = useRef20(null);
|
|
9936
10190
|
if (!storeRef.current) {
|
|
9937
10191
|
storeRef.current = createVoiceTurnLatencyStore(path, options);
|
|
9938
10192
|
}
|
|
9939
10193
|
const store = storeRef.current;
|
|
9940
|
-
|
|
10194
|
+
useEffect20(() => {
|
|
9941
10195
|
store.refresh().catch(() => {});
|
|
9942
10196
|
return () => store.close();
|
|
9943
10197
|
}, [store]);
|
|
9944
10198
|
return {
|
|
9945
|
-
...
|
|
10199
|
+
...useSyncExternalStore20(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
9946
10200
|
refresh: store.refresh,
|
|
9947
10201
|
runProof: store.runProof
|
|
9948
10202
|
};
|
|
9949
10203
|
};
|
|
9950
10204
|
|
|
9951
10205
|
// src/client/turnLatencyWidget.ts
|
|
9952
|
-
var
|
|
9953
|
-
var
|
|
10206
|
+
var DEFAULT_TITLE19 = "Turn Latency";
|
|
10207
|
+
var DEFAULT_DESCRIPTION19 = "Per-turn timing from first transcript to commit and assistant response start.";
|
|
9954
10208
|
var DEFAULT_PROOF_LABEL = "Run latency proof";
|
|
9955
|
-
var
|
|
9956
|
-
var
|
|
10209
|
+
var escapeHtml25 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
10210
|
+
var formatMs6 = (value) => typeof value === "number" ? `${Math.round(value)}ms` : "n/a";
|
|
9957
10211
|
var createVoiceTurnLatencyViewModel = (snapshot, options = {}) => {
|
|
9958
10212
|
const turns = (snapshot.report?.turns ?? []).map((turn) => ({
|
|
9959
10213
|
...turn,
|
|
9960
10214
|
label: turn.text || "Empty turn",
|
|
9961
10215
|
rows: turn.stages.map((stage) => ({
|
|
9962
10216
|
label: stage.label,
|
|
9963
|
-
value:
|
|
10217
|
+
value: formatMs6(stage.valueMs)
|
|
9964
10218
|
}))
|
|
9965
10219
|
}));
|
|
9966
10220
|
const warningCount = snapshot.report?.warnings ?? turns.filter((turn) => turn.status === "warn").length;
|
|
9967
10221
|
const failedCount = snapshot.report?.failed ?? turns.filter((turn) => turn.status === "fail").length;
|
|
9968
10222
|
return {
|
|
9969
|
-
description: options.description ??
|
|
10223
|
+
description: options.description ?? DEFAULT_DESCRIPTION19,
|
|
9970
10224
|
error: snapshot.error,
|
|
9971
10225
|
isLoading: snapshot.isLoading,
|
|
9972
|
-
label: snapshot.error ? "Unavailable" : turns.length ? failedCount > 0 ? `${failedCount} slow` : warningCount > 0 ? `${warningCount} warnings` : `avg ${
|
|
10226
|
+
label: snapshot.error ? "Unavailable" : turns.length ? failedCount > 0 ? `${failedCount} slow` : warningCount > 0 ? `${warningCount} warnings` : `avg ${formatMs6(snapshot.report?.averageTotalMs)}` : snapshot.isLoading ? "Checking" : "No turns",
|
|
9973
10227
|
proofLabel: options.proofPath ? options.proofLabel ?? DEFAULT_PROOF_LABEL : undefined,
|
|
9974
10228
|
showProofAction: Boolean(options.proofPath),
|
|
9975
10229
|
status: snapshot.error ? "error" : turns.length ? failedCount > 0 || warningCount > 0 ? "warning" : "ready" : snapshot.isLoading ? "loading" : "empty",
|
|
9976
|
-
title: options.title ??
|
|
10230
|
+
title: options.title ?? DEFAULT_TITLE19,
|
|
9977
10231
|
turns,
|
|
9978
10232
|
updatedAt: snapshot.updatedAt
|
|
9979
10233
|
};
|
|
9980
10234
|
};
|
|
9981
10235
|
var renderVoiceTurnLatencyHTML = (snapshot, options = {}) => {
|
|
9982
10236
|
const model = createVoiceTurnLatencyViewModel(snapshot, options);
|
|
9983
|
-
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--${
|
|
10237
|
+
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--${escapeHtml25(turn.status)}">
|
|
9984
10238
|
<header>
|
|
9985
|
-
<strong>${
|
|
9986
|
-
<span>${
|
|
10239
|
+
<strong>${escapeHtml25(turn.label)}</strong>
|
|
10240
|
+
<span>${escapeHtml25(turn.status)}</span>
|
|
9987
10241
|
</header>
|
|
9988
10242
|
<dl>${turn.rows.map((row) => `<div>
|
|
9989
|
-
<dt>${
|
|
9990
|
-
<dd>${
|
|
10243
|
+
<dt>${escapeHtml25(row.label)}</dt>
|
|
10244
|
+
<dd>${escapeHtml25(row.value)}</dd>
|
|
9991
10245
|
</div>`).join("")}</dl>
|
|
9992
10246
|
</article>`).join("")}</div>` : '<p class="absolute-voice-turn-latency__empty">Complete a voice turn to see latency diagnostics.</p>';
|
|
9993
|
-
return `<section class="absolute-voice-turn-latency absolute-voice-turn-latency--${
|
|
10247
|
+
return `<section class="absolute-voice-turn-latency absolute-voice-turn-latency--${escapeHtml25(model.status)}">
|
|
9994
10248
|
<header class="absolute-voice-turn-latency__header">
|
|
9995
|
-
<span class="absolute-voice-turn-latency__eyebrow">${
|
|
9996
|
-
<strong class="absolute-voice-turn-latency__label">${
|
|
10249
|
+
<span class="absolute-voice-turn-latency__eyebrow">${escapeHtml25(model.title)}</span>
|
|
10250
|
+
<strong class="absolute-voice-turn-latency__label">${escapeHtml25(model.label)}</strong>
|
|
9997
10251
|
</header>
|
|
9998
|
-
<p class="absolute-voice-turn-latency__description">${
|
|
9999
|
-
${model.showProofAction ? `<button class="absolute-voice-turn-latency__proof" data-absolute-voice-turn-latency-proof type="button">${
|
|
10252
|
+
<p class="absolute-voice-turn-latency__description">${escapeHtml25(model.description)}</p>
|
|
10253
|
+
${model.showProofAction ? `<button class="absolute-voice-turn-latency__proof" data-absolute-voice-turn-latency-proof type="button">${escapeHtml25(model.proofLabel ?? DEFAULT_PROOF_LABEL)}</button>` : ""}
|
|
10000
10254
|
${turns}
|
|
10001
|
-
${model.error ? `<p class="absolute-voice-turn-latency__error">${
|
|
10255
|
+
${model.error ? `<p class="absolute-voice-turn-latency__error">${escapeHtml25(model.error)}</p>` : ""}
|
|
10002
10256
|
</section>`;
|
|
10003
10257
|
};
|
|
10004
10258
|
var mountVoiceTurnLatency = (element, path = "/api/turn-latency", options = {}) => {
|
|
@@ -10049,7 +10303,7 @@ var defineVoiceTurnLatencyElement = (tagName = "absolute-voice-turn-latency") =>
|
|
|
10049
10303
|
};
|
|
10050
10304
|
|
|
10051
10305
|
// src/react/VoiceTurnLatency.tsx
|
|
10052
|
-
import { jsxDEV as
|
|
10306
|
+
import { jsxDEV as jsxDEV20 } from "react/jsx-dev-runtime";
|
|
10053
10307
|
var VoiceTurnLatency = ({
|
|
10054
10308
|
className,
|
|
10055
10309
|
path = "/api/turn-latency",
|
|
@@ -10057,31 +10311,31 @@ var VoiceTurnLatency = ({
|
|
|
10057
10311
|
}) => {
|
|
10058
10312
|
const latency = useVoiceTurnLatency(path, options);
|
|
10059
10313
|
const model = createVoiceTurnLatencyViewModel(latency, options);
|
|
10060
|
-
return /* @__PURE__ */
|
|
10314
|
+
return /* @__PURE__ */ jsxDEV20("section", {
|
|
10061
10315
|
className: [
|
|
10062
10316
|
"absolute-voice-turn-latency",
|
|
10063
10317
|
`absolute-voice-turn-latency--${model.status}`,
|
|
10064
10318
|
className
|
|
10065
10319
|
].filter(Boolean).join(" "),
|
|
10066
10320
|
children: [
|
|
10067
|
-
/* @__PURE__ */
|
|
10321
|
+
/* @__PURE__ */ jsxDEV20("header", {
|
|
10068
10322
|
className: "absolute-voice-turn-latency__header",
|
|
10069
10323
|
children: [
|
|
10070
|
-
/* @__PURE__ */
|
|
10324
|
+
/* @__PURE__ */ jsxDEV20("span", {
|
|
10071
10325
|
className: "absolute-voice-turn-latency__eyebrow",
|
|
10072
10326
|
children: model.title
|
|
10073
10327
|
}, undefined, false, undefined, this),
|
|
10074
|
-
/* @__PURE__ */
|
|
10328
|
+
/* @__PURE__ */ jsxDEV20("strong", {
|
|
10075
10329
|
className: "absolute-voice-turn-latency__label",
|
|
10076
10330
|
children: model.label
|
|
10077
10331
|
}, undefined, false, undefined, this)
|
|
10078
10332
|
]
|
|
10079
10333
|
}, undefined, true, undefined, this),
|
|
10080
|
-
/* @__PURE__ */
|
|
10334
|
+
/* @__PURE__ */ jsxDEV20("p", {
|
|
10081
10335
|
className: "absolute-voice-turn-latency__description",
|
|
10082
10336
|
children: model.description
|
|
10083
10337
|
}, undefined, false, undefined, this),
|
|
10084
|
-
model.showProofAction ? /* @__PURE__ */
|
|
10338
|
+
model.showProofAction ? /* @__PURE__ */ jsxDEV20("button", {
|
|
10085
10339
|
className: "absolute-voice-turn-latency__proof",
|
|
10086
10340
|
onClick: () => {
|
|
10087
10341
|
latency.runProof().catch(() => {});
|
|
@@ -10089,31 +10343,31 @@ var VoiceTurnLatency = ({
|
|
|
10089
10343
|
type: "button",
|
|
10090
10344
|
children: model.proofLabel
|
|
10091
10345
|
}, undefined, false, undefined, this) : null,
|
|
10092
|
-
model.turns.length ? /* @__PURE__ */
|
|
10346
|
+
model.turns.length ? /* @__PURE__ */ jsxDEV20("div", {
|
|
10093
10347
|
className: "absolute-voice-turn-latency__turns",
|
|
10094
|
-
children: model.turns.map((turn) => /* @__PURE__ */
|
|
10348
|
+
children: model.turns.map((turn) => /* @__PURE__ */ jsxDEV20("article", {
|
|
10095
10349
|
className: [
|
|
10096
10350
|
"absolute-voice-turn-latency__turn",
|
|
10097
10351
|
`absolute-voice-turn-latency__turn--${turn.status}`
|
|
10098
10352
|
].join(" "),
|
|
10099
10353
|
children: [
|
|
10100
|
-
/* @__PURE__ */
|
|
10354
|
+
/* @__PURE__ */ jsxDEV20("header", {
|
|
10101
10355
|
children: [
|
|
10102
|
-
/* @__PURE__ */
|
|
10356
|
+
/* @__PURE__ */ jsxDEV20("strong", {
|
|
10103
10357
|
children: turn.label
|
|
10104
10358
|
}, undefined, false, undefined, this),
|
|
10105
|
-
/* @__PURE__ */
|
|
10359
|
+
/* @__PURE__ */ jsxDEV20("span", {
|
|
10106
10360
|
children: turn.status
|
|
10107
10361
|
}, undefined, false, undefined, this)
|
|
10108
10362
|
]
|
|
10109
10363
|
}, undefined, true, undefined, this),
|
|
10110
|
-
/* @__PURE__ */
|
|
10111
|
-
children: turn.rows.map((row) => /* @__PURE__ */
|
|
10364
|
+
/* @__PURE__ */ jsxDEV20("dl", {
|
|
10365
|
+
children: turn.rows.map((row) => /* @__PURE__ */ jsxDEV20("div", {
|
|
10112
10366
|
children: [
|
|
10113
|
-
/* @__PURE__ */
|
|
10367
|
+
/* @__PURE__ */ jsxDEV20("dt", {
|
|
10114
10368
|
children: row.label
|
|
10115
10369
|
}, undefined, false, undefined, this),
|
|
10116
|
-
/* @__PURE__ */
|
|
10370
|
+
/* @__PURE__ */ jsxDEV20("dd", {
|
|
10117
10371
|
children: row.value
|
|
10118
10372
|
}, undefined, false, undefined, this)
|
|
10119
10373
|
]
|
|
@@ -10121,11 +10375,11 @@ var VoiceTurnLatency = ({
|
|
|
10121
10375
|
}, undefined, false, undefined, this)
|
|
10122
10376
|
]
|
|
10123
10377
|
}, `${turn.sessionId}:${turn.turnId}`, true, undefined, this))
|
|
10124
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
10378
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV20("p", {
|
|
10125
10379
|
className: "absolute-voice-turn-latency__empty",
|
|
10126
10380
|
children: "Complete a voice turn to see latency diagnostics."
|
|
10127
10381
|
}, undefined, false, undefined, this),
|
|
10128
|
-
model.error ? /* @__PURE__ */
|
|
10382
|
+
model.error ? /* @__PURE__ */ jsxDEV20("p", {
|
|
10129
10383
|
className: "absolute-voice-turn-latency__error",
|
|
10130
10384
|
children: model.error
|
|
10131
10385
|
}, undefined, false, undefined, this) : null
|
|
@@ -10133,7 +10387,7 @@ var VoiceTurnLatency = ({
|
|
|
10133
10387
|
}, undefined, true, undefined, this);
|
|
10134
10388
|
};
|
|
10135
10389
|
// src/react/useVoiceTurnQuality.tsx
|
|
10136
|
-
import { useEffect as
|
|
10390
|
+
import { useEffect as useEffect21, useRef as useRef21, useSyncExternalStore as useSyncExternalStore21 } from "react";
|
|
10137
10391
|
|
|
10138
10392
|
// src/client/turnQuality.ts
|
|
10139
10393
|
var fetchVoiceTurnQuality = async (path = "/api/turn-quality", options = {}) => {
|
|
@@ -10216,25 +10470,25 @@ var createVoiceTurnQualityStore = (path = "/api/turn-quality", options = {}) =>
|
|
|
10216
10470
|
|
|
10217
10471
|
// src/react/useVoiceTurnQuality.tsx
|
|
10218
10472
|
var useVoiceTurnQuality = (path = "/api/turn-quality", options = {}) => {
|
|
10219
|
-
const storeRef =
|
|
10473
|
+
const storeRef = useRef21(null);
|
|
10220
10474
|
if (!storeRef.current) {
|
|
10221
10475
|
storeRef.current = createVoiceTurnQualityStore(path, options);
|
|
10222
10476
|
}
|
|
10223
10477
|
const store = storeRef.current;
|
|
10224
|
-
|
|
10478
|
+
useEffect21(() => {
|
|
10225
10479
|
store.refresh().catch(() => {});
|
|
10226
10480
|
return () => store.close();
|
|
10227
10481
|
}, [store]);
|
|
10228
10482
|
return {
|
|
10229
|
-
...
|
|
10483
|
+
...useSyncExternalStore21(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
10230
10484
|
refresh: store.refresh
|
|
10231
10485
|
};
|
|
10232
10486
|
};
|
|
10233
10487
|
|
|
10234
10488
|
// src/client/turnQualityWidget.ts
|
|
10235
|
-
var
|
|
10236
|
-
var
|
|
10237
|
-
var
|
|
10489
|
+
var DEFAULT_TITLE20 = "Turn Quality";
|
|
10490
|
+
var DEFAULT_DESCRIPTION20 = "Per-turn STT confidence, fallback selection, corrections, and transcript coverage.";
|
|
10491
|
+
var escapeHtml26 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
10238
10492
|
var formatConfidence = (value) => typeof value === "number" ? `${Math.round(value * 100)}%` : "n/a";
|
|
10239
10493
|
var formatMaybe = (value) => value === undefined || value === "" ? "n/a" : String(value);
|
|
10240
10494
|
var getTurnDetail = (turn) => {
|
|
@@ -10278,37 +10532,37 @@ var createVoiceTurnQualityViewModel = (snapshot, options = {}) => {
|
|
|
10278
10532
|
const warningCount = snapshot.report?.warnings ?? turns.filter((turn) => turn.status === "warn").length;
|
|
10279
10533
|
const failedCount = snapshot.report?.failed ?? turns.filter((turn) => turn.status === "fail").length;
|
|
10280
10534
|
return {
|
|
10281
|
-
description: options.description ??
|
|
10535
|
+
description: options.description ?? DEFAULT_DESCRIPTION20,
|
|
10282
10536
|
error: snapshot.error,
|
|
10283
10537
|
isLoading: snapshot.isLoading,
|
|
10284
10538
|
label: snapshot.error ? "Unavailable" : turns.length ? failedCount > 0 ? `${failedCount} failed` : warningCount > 0 ? `${warningCount} warnings` : `${turns.length} healthy` : snapshot.isLoading ? "Checking" : "No turns",
|
|
10285
10539
|
status: snapshot.error ? "error" : turns.length ? failedCount > 0 || warningCount > 0 ? "warning" : "ready" : snapshot.isLoading ? "loading" : "empty",
|
|
10286
|
-
title: options.title ??
|
|
10540
|
+
title: options.title ?? DEFAULT_TITLE20,
|
|
10287
10541
|
turns,
|
|
10288
10542
|
updatedAt: snapshot.updatedAt
|
|
10289
10543
|
};
|
|
10290
10544
|
};
|
|
10291
10545
|
var renderVoiceTurnQualityHTML = (snapshot, options = {}) => {
|
|
10292
10546
|
const model = createVoiceTurnQualityViewModel(snapshot, options);
|
|
10293
|
-
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--${
|
|
10547
|
+
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--${escapeHtml26(turn.status)}">
|
|
10294
10548
|
<header>
|
|
10295
|
-
<strong>${
|
|
10296
|
-
<span>${
|
|
10549
|
+
<strong>${escapeHtml26(turn.label)}</strong>
|
|
10550
|
+
<span>${escapeHtml26(turn.status)}</span>
|
|
10297
10551
|
</header>
|
|
10298
|
-
<p>${
|
|
10552
|
+
<p>${escapeHtml26(turn.detail)}</p>
|
|
10299
10553
|
<dl>${turn.rows.map((row) => `<div>
|
|
10300
|
-
<dt>${
|
|
10301
|
-
<dd>${
|
|
10554
|
+
<dt>${escapeHtml26(row.label)}</dt>
|
|
10555
|
+
<dd>${escapeHtml26(row.value)}</dd>
|
|
10302
10556
|
</div>`).join("")}</dl>
|
|
10303
10557
|
</article>`).join("")}</div>` : '<p class="absolute-voice-turn-quality__empty">Complete a voice turn to see STT quality diagnostics.</p>';
|
|
10304
|
-
return `<section class="absolute-voice-turn-quality absolute-voice-turn-quality--${
|
|
10558
|
+
return `<section class="absolute-voice-turn-quality absolute-voice-turn-quality--${escapeHtml26(model.status)}">
|
|
10305
10559
|
<header class="absolute-voice-turn-quality__header">
|
|
10306
|
-
<span class="absolute-voice-turn-quality__eyebrow">${
|
|
10307
|
-
<strong class="absolute-voice-turn-quality__label">${
|
|
10560
|
+
<span class="absolute-voice-turn-quality__eyebrow">${escapeHtml26(model.title)}</span>
|
|
10561
|
+
<strong class="absolute-voice-turn-quality__label">${escapeHtml26(model.label)}</strong>
|
|
10308
10562
|
</header>
|
|
10309
|
-
<p class="absolute-voice-turn-quality__description">${
|
|
10563
|
+
<p class="absolute-voice-turn-quality__description">${escapeHtml26(model.description)}</p>
|
|
10310
10564
|
${turns}
|
|
10311
|
-
${model.error ? `<p class="absolute-voice-turn-quality__error">${
|
|
10565
|
+
${model.error ? `<p class="absolute-voice-turn-quality__error">${escapeHtml26(model.error)}</p>` : ""}
|
|
10312
10566
|
</section>`;
|
|
10313
10567
|
};
|
|
10314
10568
|
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}`;
|
|
@@ -10350,7 +10604,7 @@ var defineVoiceTurnQualityElement = (tagName = "absolute-voice-turn-quality") =>
|
|
|
10350
10604
|
};
|
|
10351
10605
|
|
|
10352
10606
|
// src/react/VoiceTurnQuality.tsx
|
|
10353
|
-
import { jsxDEV as
|
|
10607
|
+
import { jsxDEV as jsxDEV21 } from "react/jsx-dev-runtime";
|
|
10354
10608
|
var VoiceTurnQuality = ({
|
|
10355
10609
|
className,
|
|
10356
10610
|
path = "/api/turn-quality",
|
|
@@ -10358,58 +10612,58 @@ var VoiceTurnQuality = ({
|
|
|
10358
10612
|
}) => {
|
|
10359
10613
|
const snapshot = useVoiceTurnQuality(path, options);
|
|
10360
10614
|
const model = createVoiceTurnQualityViewModel(snapshot, options);
|
|
10361
|
-
return /* @__PURE__ */
|
|
10615
|
+
return /* @__PURE__ */ jsxDEV21("section", {
|
|
10362
10616
|
className: [
|
|
10363
10617
|
"absolute-voice-turn-quality",
|
|
10364
10618
|
`absolute-voice-turn-quality--${model.status}`,
|
|
10365
10619
|
className
|
|
10366
10620
|
].filter(Boolean).join(" "),
|
|
10367
10621
|
children: [
|
|
10368
|
-
/* @__PURE__ */
|
|
10622
|
+
/* @__PURE__ */ jsxDEV21("header", {
|
|
10369
10623
|
className: "absolute-voice-turn-quality__header",
|
|
10370
10624
|
children: [
|
|
10371
|
-
/* @__PURE__ */
|
|
10625
|
+
/* @__PURE__ */ jsxDEV21("span", {
|
|
10372
10626
|
className: "absolute-voice-turn-quality__eyebrow",
|
|
10373
10627
|
children: model.title
|
|
10374
10628
|
}, undefined, false, undefined, this),
|
|
10375
|
-
/* @__PURE__ */
|
|
10629
|
+
/* @__PURE__ */ jsxDEV21("strong", {
|
|
10376
10630
|
className: "absolute-voice-turn-quality__label",
|
|
10377
10631
|
children: model.label
|
|
10378
10632
|
}, undefined, false, undefined, this)
|
|
10379
10633
|
]
|
|
10380
10634
|
}, undefined, true, undefined, this),
|
|
10381
|
-
/* @__PURE__ */
|
|
10635
|
+
/* @__PURE__ */ jsxDEV21("p", {
|
|
10382
10636
|
className: "absolute-voice-turn-quality__description",
|
|
10383
10637
|
children: model.description
|
|
10384
10638
|
}, undefined, false, undefined, this),
|
|
10385
|
-
model.turns.length ? /* @__PURE__ */
|
|
10639
|
+
model.turns.length ? /* @__PURE__ */ jsxDEV21("div", {
|
|
10386
10640
|
className: "absolute-voice-turn-quality__turns",
|
|
10387
|
-
children: model.turns.map((turn) => /* @__PURE__ */
|
|
10641
|
+
children: model.turns.map((turn) => /* @__PURE__ */ jsxDEV21("article", {
|
|
10388
10642
|
className: [
|
|
10389
10643
|
"absolute-voice-turn-quality__turn",
|
|
10390
10644
|
`absolute-voice-turn-quality__turn--${turn.status}`
|
|
10391
10645
|
].join(" "),
|
|
10392
10646
|
children: [
|
|
10393
|
-
/* @__PURE__ */
|
|
10647
|
+
/* @__PURE__ */ jsxDEV21("header", {
|
|
10394
10648
|
children: [
|
|
10395
|
-
/* @__PURE__ */
|
|
10649
|
+
/* @__PURE__ */ jsxDEV21("strong", {
|
|
10396
10650
|
children: turn.label
|
|
10397
10651
|
}, undefined, false, undefined, this),
|
|
10398
|
-
/* @__PURE__ */
|
|
10652
|
+
/* @__PURE__ */ jsxDEV21("span", {
|
|
10399
10653
|
children: turn.status
|
|
10400
10654
|
}, undefined, false, undefined, this)
|
|
10401
10655
|
]
|
|
10402
10656
|
}, undefined, true, undefined, this),
|
|
10403
|
-
/* @__PURE__ */
|
|
10657
|
+
/* @__PURE__ */ jsxDEV21("p", {
|
|
10404
10658
|
children: turn.detail
|
|
10405
10659
|
}, undefined, false, undefined, this),
|
|
10406
|
-
/* @__PURE__ */
|
|
10407
|
-
children: turn.rows.map((row) => /* @__PURE__ */
|
|
10660
|
+
/* @__PURE__ */ jsxDEV21("dl", {
|
|
10661
|
+
children: turn.rows.map((row) => /* @__PURE__ */ jsxDEV21("div", {
|
|
10408
10662
|
children: [
|
|
10409
|
-
/* @__PURE__ */
|
|
10663
|
+
/* @__PURE__ */ jsxDEV21("dt", {
|
|
10410
10664
|
children: row.label
|
|
10411
10665
|
}, undefined, false, undefined, this),
|
|
10412
|
-
/* @__PURE__ */
|
|
10666
|
+
/* @__PURE__ */ jsxDEV21("dd", {
|
|
10413
10667
|
children: row.value
|
|
10414
10668
|
}, undefined, false, undefined, this)
|
|
10415
10669
|
]
|
|
@@ -10417,11 +10671,11 @@ var VoiceTurnQuality = ({
|
|
|
10417
10671
|
}, undefined, false, undefined, this)
|
|
10418
10672
|
]
|
|
10419
10673
|
}, `${turn.sessionId}:${turn.turnId}`, true, undefined, this))
|
|
10420
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
10674
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV21("p", {
|
|
10421
10675
|
className: "absolute-voice-turn-quality__empty",
|
|
10422
10676
|
children: "Complete a voice turn to see STT quality diagnostics."
|
|
10423
10677
|
}, undefined, false, undefined, this),
|
|
10424
|
-
model.error ? /* @__PURE__ */
|
|
10678
|
+
model.error ? /* @__PURE__ */ jsxDEV21("p", {
|
|
10425
10679
|
className: "absolute-voice-turn-quality__error",
|
|
10426
10680
|
children: model.error
|
|
10427
10681
|
}, undefined, false, undefined, this) : null
|
|
@@ -10429,7 +10683,7 @@ var VoiceTurnQuality = ({
|
|
|
10429
10683
|
}, undefined, true, undefined, this);
|
|
10430
10684
|
};
|
|
10431
10685
|
// src/react/useVoiceLiveOps.tsx
|
|
10432
|
-
import { useEffect as
|
|
10686
|
+
import { useEffect as useEffect22, useRef as useRef22, useSyncExternalStore as useSyncExternalStore22 } from "react";
|
|
10433
10687
|
|
|
10434
10688
|
// src/client/liveOps.ts
|
|
10435
10689
|
var postVoiceLiveOpsAction = async (input, options = {}) => {
|
|
@@ -10519,19 +10773,19 @@ var createVoiceLiveOpsStore = (options = {}) => {
|
|
|
10519
10773
|
|
|
10520
10774
|
// src/react/useVoiceLiveOps.tsx
|
|
10521
10775
|
var useVoiceLiveOps = (options = {}) => {
|
|
10522
|
-
const storeRef =
|
|
10776
|
+
const storeRef = useRef22(null);
|
|
10523
10777
|
if (!storeRef.current) {
|
|
10524
10778
|
storeRef.current = createVoiceLiveOpsStore(options);
|
|
10525
10779
|
}
|
|
10526
10780
|
const store = storeRef.current;
|
|
10527
|
-
|
|
10781
|
+
useEffect22(() => () => store.close(), [store]);
|
|
10528
10782
|
return {
|
|
10529
|
-
...
|
|
10783
|
+
...useSyncExternalStore22(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
10530
10784
|
run: store.run
|
|
10531
10785
|
};
|
|
10532
10786
|
};
|
|
10533
10787
|
// src/react/useVoiceCampaignDialerProof.tsx
|
|
10534
|
-
import { useEffect as
|
|
10788
|
+
import { useEffect as useEffect23, useRef as useRef23, useSyncExternalStore as useSyncExternalStore23 } from "react";
|
|
10535
10789
|
|
|
10536
10790
|
// src/client/campaignDialerProof.ts
|
|
10537
10791
|
var fetchVoiceCampaignDialerProofStatus = async (path = "/api/voice/campaigns/dialer-proof", options = {}) => {
|
|
@@ -10653,23 +10907,23 @@ var createVoiceCampaignDialerProofStore = (path = "/api/voice/campaigns/dialer-p
|
|
|
10653
10907
|
|
|
10654
10908
|
// src/react/useVoiceCampaignDialerProof.tsx
|
|
10655
10909
|
var useVoiceCampaignDialerProof = (path = "/api/voice/campaigns/dialer-proof", options = {}) => {
|
|
10656
|
-
const storeRef =
|
|
10910
|
+
const storeRef = useRef23(null);
|
|
10657
10911
|
if (!storeRef.current) {
|
|
10658
10912
|
storeRef.current = createVoiceCampaignDialerProofStore(path, options);
|
|
10659
10913
|
}
|
|
10660
10914
|
const store = storeRef.current;
|
|
10661
|
-
|
|
10915
|
+
useEffect23(() => {
|
|
10662
10916
|
store.refresh().catch(() => {});
|
|
10663
10917
|
return () => store.close();
|
|
10664
10918
|
}, [store]);
|
|
10665
10919
|
return {
|
|
10666
|
-
...
|
|
10920
|
+
...useSyncExternalStore23(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
10667
10921
|
refresh: store.refresh,
|
|
10668
10922
|
runProof: store.runProof
|
|
10669
10923
|
};
|
|
10670
10924
|
};
|
|
10671
10925
|
// src/react/useVoiceStream.tsx
|
|
10672
|
-
import { useEffect as
|
|
10926
|
+
import { useEffect as useEffect24, useRef as useRef24, useSyncExternalStore as useSyncExternalStore24 } from "react";
|
|
10673
10927
|
|
|
10674
10928
|
// src/client/actions.ts
|
|
10675
10929
|
var normalizeErrorMessage = (value) => {
|
|
@@ -12090,13 +12344,13 @@ var EMPTY_SNAPSHOT = {
|
|
|
12090
12344
|
turns: []
|
|
12091
12345
|
};
|
|
12092
12346
|
var useVoiceStream = (path, options = {}) => {
|
|
12093
|
-
const streamRef =
|
|
12347
|
+
const streamRef = useRef24(null);
|
|
12094
12348
|
if (!streamRef.current) {
|
|
12095
12349
|
streamRef.current = createVoiceStream(path, options);
|
|
12096
12350
|
}
|
|
12097
12351
|
const stream = streamRef.current;
|
|
12098
|
-
|
|
12099
|
-
const snapshot =
|
|
12352
|
+
useEffect24(() => () => stream.close(), [stream]);
|
|
12353
|
+
const snapshot = useSyncExternalStore24(stream.subscribe, stream.getSnapshot, stream.getServerSnapshot) ?? EMPTY_SNAPSHOT;
|
|
12100
12354
|
return {
|
|
12101
12355
|
...snapshot,
|
|
12102
12356
|
callControl: (message) => stream.callControl(message),
|
|
@@ -12107,7 +12361,7 @@ var useVoiceStream = (path, options = {}) => {
|
|
|
12107
12361
|
};
|
|
12108
12362
|
};
|
|
12109
12363
|
// src/react/useVoiceController.tsx
|
|
12110
|
-
import { useEffect as
|
|
12364
|
+
import { useEffect as useEffect25, useRef as useRef25, useSyncExternalStore as useSyncExternalStore25 } from "react";
|
|
12111
12365
|
|
|
12112
12366
|
// src/client/htmx.ts
|
|
12113
12367
|
var DEFAULT_EVENT_NAME = "voice-refresh";
|
|
@@ -12776,13 +13030,13 @@ var EMPTY_SNAPSHOT2 = {
|
|
|
12776
13030
|
turns: []
|
|
12777
13031
|
};
|
|
12778
13032
|
var useVoiceController = (path, options = {}) => {
|
|
12779
|
-
const controllerRef =
|
|
13033
|
+
const controllerRef = useRef25(null);
|
|
12780
13034
|
if (!controllerRef.current) {
|
|
12781
13035
|
controllerRef.current = createVoiceController(path, options);
|
|
12782
13036
|
}
|
|
12783
13037
|
const controller = controllerRef.current;
|
|
12784
|
-
|
|
12785
|
-
const snapshot =
|
|
13038
|
+
useEffect25(() => () => controller.close(), [controller]);
|
|
13039
|
+
const snapshot = useSyncExternalStore25(controller.subscribe, controller.getSnapshot, controller.getServerSnapshot) ?? EMPTY_SNAPSHOT2;
|
|
12786
13040
|
return {
|
|
12787
13041
|
...snapshot,
|
|
12788
13042
|
bindHTMX: controller.bindHTMX,
|
|
@@ -12797,7 +13051,7 @@ var useVoiceController = (path, options = {}) => {
|
|
|
12797
13051
|
};
|
|
12798
13052
|
};
|
|
12799
13053
|
// src/react/useVoiceWorkflowStatus.tsx
|
|
12800
|
-
import { useEffect as
|
|
13054
|
+
import { useEffect as useEffect26, useRef as useRef26, useSyncExternalStore as useSyncExternalStore26 } from "react";
|
|
12801
13055
|
|
|
12802
13056
|
// src/client/workflowStatus.ts
|
|
12803
13057
|
var fetchVoiceWorkflowStatus = async (path = "/evals/scenarios/json", options = {}) => {
|
|
@@ -12880,17 +13134,17 @@ var createVoiceWorkflowStatusStore = (path = "/evals/scenarios/json", options =
|
|
|
12880
13134
|
|
|
12881
13135
|
// src/react/useVoiceWorkflowStatus.tsx
|
|
12882
13136
|
var useVoiceWorkflowStatus = (path = "/evals/scenarios/json", options = {}) => {
|
|
12883
|
-
const storeRef =
|
|
13137
|
+
const storeRef = useRef26(null);
|
|
12884
13138
|
if (!storeRef.current) {
|
|
12885
13139
|
storeRef.current = createVoiceWorkflowStatusStore(path, options);
|
|
12886
13140
|
}
|
|
12887
13141
|
const store = storeRef.current;
|
|
12888
|
-
|
|
13142
|
+
useEffect26(() => {
|
|
12889
13143
|
store.refresh().catch(() => {});
|
|
12890
13144
|
return () => store.close();
|
|
12891
13145
|
}, [store]);
|
|
12892
13146
|
return {
|
|
12893
|
-
...
|
|
13147
|
+
...useSyncExternalStore26(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
12894
13148
|
refresh: store.refresh
|
|
12895
13149
|
};
|
|
12896
13150
|
};
|
|
@@ -12901,6 +13155,7 @@ export {
|
|
|
12901
13155
|
useVoiceTraceTimeline,
|
|
12902
13156
|
useVoiceStream,
|
|
12903
13157
|
useVoiceSessionSnapshot,
|
|
13158
|
+
useVoiceSessionObservability,
|
|
12904
13159
|
useVoiceRoutingStatus,
|
|
12905
13160
|
useVoiceReconnectProfileEvidence,
|
|
12906
13161
|
useVoiceReadinessFailures,
|
|
@@ -12924,6 +13179,7 @@ export {
|
|
|
12924
13179
|
VoiceTurnLatency,
|
|
12925
13180
|
VoiceTraceTimeline,
|
|
12926
13181
|
VoiceSessionSnapshot,
|
|
13182
|
+
VoiceSessionObservability,
|
|
12927
13183
|
VoiceRoutingStatus,
|
|
12928
13184
|
VoiceReconnectProfileEvidence,
|
|
12929
13185
|
VoiceReadinessFailures,
|