@absolutejs/voice 0.0.22-beta.453 → 0.0.22-beta.454
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 +345 -224
- package/dist/angular/voice-reconnect-profile-evidence.service.d.ts +12 -0
- package/dist/client/index.d.ts +4 -0
- package/dist/client/index.js +467 -240
- package/dist/client/reconnectProfileEvidence.d.ts +19 -0
- package/dist/client/reconnectProfileEvidenceWidget.d.ts +39 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +28 -0
- package/dist/proofTrends.d.ts +18 -0
- package/dist/react/VoiceReconnectProfileEvidence.d.ts +6 -0
- package/dist/react/index.d.ts +2 -0
- package/dist/react/index.js +843 -526
- package/dist/react/useVoiceReconnectProfileEvidence.d.ts +8 -0
- package/dist/svelte/createVoiceReconnectProfileEvidence.d.ts +7 -0
- package/dist/svelte/index.d.ts +1 -0
- package/dist/svelte/index.js +86 -0
- package/dist/vue/VoiceReconnectProfileEvidence.d.ts +21 -0
- package/dist/vue/index.d.ts +2 -0
- package/dist/vue/index.js +749 -438
- package/dist/vue/useVoiceReconnectProfileEvidence.d.ts +9 -0
- package/package.json +1 -1
package/dist/react/index.js
CHANGED
|
@@ -3414,6 +3414,33 @@ var maxNumber = (values) => {
|
|
|
3414
3414
|
const finite = values.filter((value) => typeof value === "number" && Number.isFinite(value));
|
|
3415
3415
|
return finite.length > 0 ? Math.max(...finite) : undefined;
|
|
3416
3416
|
};
|
|
3417
|
+
var buildVoiceReconnectProfileEvidenceSummary = (evidence, options = {}) => {
|
|
3418
|
+
const profileId = options.profileId ?? "reconnect-resume";
|
|
3419
|
+
const filtered = evidence.filter((record) => record.profileId === profileId).sort((left, right) => {
|
|
3420
|
+
const leftAt = Date.parse(left.generatedAt ?? left.createdAt);
|
|
3421
|
+
const rightAt = Date.parse(right.generatedAt ?? right.createdAt);
|
|
3422
|
+
return (Number.isFinite(rightAt) ? rightAt : 0) - (Number.isFinite(leftAt) ? leftAt : 0);
|
|
3423
|
+
});
|
|
3424
|
+
const latest = filtered[0];
|
|
3425
|
+
const sampleCount = filtered.reduce((total, record) => total + (record.reconnect?.samples ?? 1), 0);
|
|
3426
|
+
const snapshotCount = filtered.reduce((total, record) => total + (record.reconnect?.snapshotCount ?? 0), 0);
|
|
3427
|
+
const resumeLatencyP95Ms = maxNumber(filtered.map((record) => record.reconnect?.resumeLatencyP95Ms));
|
|
3428
|
+
const failed = filtered.some((record) => record.ok === false || record.reconnect?.status === "fail");
|
|
3429
|
+
const passed = filtered.some((record) => record.ok === true && record.reconnect?.resumed === true && record.reconnect?.reconnected === true);
|
|
3430
|
+
const status = filtered.length === 0 ? "empty" : failed ? "fail" : passed ? "pass" : "warn";
|
|
3431
|
+
return {
|
|
3432
|
+
evidence: filtered,
|
|
3433
|
+
generatedAt: options.generatedAt ?? new Date().toISOString(),
|
|
3434
|
+
latest,
|
|
3435
|
+
ok: status === "pass",
|
|
3436
|
+
profileId,
|
|
3437
|
+
resumeLatencyP95Ms,
|
|
3438
|
+
sampleCount,
|
|
3439
|
+
snapshotCount,
|
|
3440
|
+
sourceHref: options.sourceHref,
|
|
3441
|
+
status
|
|
3442
|
+
};
|
|
3443
|
+
};
|
|
3417
3444
|
var percentile = (values, rank) => {
|
|
3418
3445
|
const finite = values.filter((value) => Number.isFinite(value)).sort((left, right) => left - right);
|
|
3419
3446
|
if (finite.length === 0) {
|
|
@@ -5801,6 +5828,294 @@ var VoiceProofTrends = ({
|
|
|
5801
5828
|
]
|
|
5802
5829
|
}, undefined, true, undefined, this);
|
|
5803
5830
|
};
|
|
5831
|
+
// src/client/reconnectProfileEvidence.ts
|
|
5832
|
+
var fetchVoiceReconnectProfileEvidence = async (path = "/api/voice/reconnect-profile-evidence", options = {}) => {
|
|
5833
|
+
const fetchImpl = options.fetch ?? globalThis.fetch;
|
|
5834
|
+
const response = await fetchImpl(path);
|
|
5835
|
+
if (!response.ok) {
|
|
5836
|
+
throw new Error(`Voice reconnect profile evidence failed: HTTP ${response.status}`);
|
|
5837
|
+
}
|
|
5838
|
+
return await response.json();
|
|
5839
|
+
};
|
|
5840
|
+
var createVoiceReconnectProfileEvidenceStore = (path = "/api/voice/reconnect-profile-evidence", options = {}) => {
|
|
5841
|
+
const listeners = new Set;
|
|
5842
|
+
let closed = false;
|
|
5843
|
+
let timer;
|
|
5844
|
+
let snapshot = {
|
|
5845
|
+
error: null,
|
|
5846
|
+
isLoading: false
|
|
5847
|
+
};
|
|
5848
|
+
const emit = () => {
|
|
5849
|
+
for (const listener of listeners) {
|
|
5850
|
+
listener();
|
|
5851
|
+
}
|
|
5852
|
+
};
|
|
5853
|
+
const refresh = async () => {
|
|
5854
|
+
if (closed) {
|
|
5855
|
+
return snapshot.report;
|
|
5856
|
+
}
|
|
5857
|
+
snapshot = { ...snapshot, error: null, isLoading: true };
|
|
5858
|
+
emit();
|
|
5859
|
+
try {
|
|
5860
|
+
const report = await fetchVoiceReconnectProfileEvidence(path, options);
|
|
5861
|
+
snapshot = {
|
|
5862
|
+
error: null,
|
|
5863
|
+
isLoading: false,
|
|
5864
|
+
report,
|
|
5865
|
+
updatedAt: Date.now()
|
|
5866
|
+
};
|
|
5867
|
+
emit();
|
|
5868
|
+
return report;
|
|
5869
|
+
} catch (error) {
|
|
5870
|
+
snapshot = {
|
|
5871
|
+
...snapshot,
|
|
5872
|
+
error: error instanceof Error ? error.message : String(error),
|
|
5873
|
+
isLoading: false
|
|
5874
|
+
};
|
|
5875
|
+
emit();
|
|
5876
|
+
throw error;
|
|
5877
|
+
}
|
|
5878
|
+
};
|
|
5879
|
+
const close = () => {
|
|
5880
|
+
closed = true;
|
|
5881
|
+
if (timer) {
|
|
5882
|
+
clearInterval(timer);
|
|
5883
|
+
timer = undefined;
|
|
5884
|
+
}
|
|
5885
|
+
listeners.clear();
|
|
5886
|
+
};
|
|
5887
|
+
if (typeof window !== "undefined" && options.intervalMs && options.intervalMs > 0) {
|
|
5888
|
+
timer = setInterval(() => {
|
|
5889
|
+
refresh().catch(() => {});
|
|
5890
|
+
}, options.intervalMs);
|
|
5891
|
+
}
|
|
5892
|
+
return {
|
|
5893
|
+
close,
|
|
5894
|
+
getServerSnapshot: () => snapshot,
|
|
5895
|
+
getSnapshot: () => snapshot,
|
|
5896
|
+
refresh,
|
|
5897
|
+
subscribe: (listener) => {
|
|
5898
|
+
listeners.add(listener);
|
|
5899
|
+
return () => {
|
|
5900
|
+
listeners.delete(listener);
|
|
5901
|
+
};
|
|
5902
|
+
}
|
|
5903
|
+
};
|
|
5904
|
+
};
|
|
5905
|
+
|
|
5906
|
+
// src/client/reconnectProfileEvidenceWidget.ts
|
|
5907
|
+
var DEFAULT_TITLE6 = "Persisted Reconnect Evidence";
|
|
5908
|
+
var DEFAULT_DESCRIPTION6 = "Real browser reconnect/resume evidence persisted into profile history so recovery claims are backed by durable traces.";
|
|
5909
|
+
var DEFAULT_LINKS3 = [
|
|
5910
|
+
{ href: "/voice/reconnect-contract", label: "Reconnect contract" },
|
|
5911
|
+
{
|
|
5912
|
+
href: "/api/voice/real-call-profile-history",
|
|
5913
|
+
label: "Profile history JSON"
|
|
5914
|
+
}
|
|
5915
|
+
];
|
|
5916
|
+
var escapeHtml11 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
5917
|
+
var formatMs2 = (value) => typeof value === "number" && Number.isFinite(value) ? `${Math.round(value)}ms` : "n/a";
|
|
5918
|
+
var formatCount = (value) => new Intl.NumberFormat("en-US").format(value);
|
|
5919
|
+
var formatAge = (value) => {
|
|
5920
|
+
if (!value) {
|
|
5921
|
+
return "No evidence";
|
|
5922
|
+
}
|
|
5923
|
+
const elapsedMs = Date.now() - Date.parse(value);
|
|
5924
|
+
if (!Number.isFinite(elapsedMs) || elapsedMs < 0) {
|
|
5925
|
+
return "Just now";
|
|
5926
|
+
}
|
|
5927
|
+
const minutes = Math.floor(elapsedMs / 60000);
|
|
5928
|
+
if (minutes < 1) {
|
|
5929
|
+
return "Just now";
|
|
5930
|
+
}
|
|
5931
|
+
if (minutes < 60) {
|
|
5932
|
+
return `${minutes}m ago`;
|
|
5933
|
+
}
|
|
5934
|
+
const hours = Math.floor(minutes / 60);
|
|
5935
|
+
if (hours < 24) {
|
|
5936
|
+
return `${hours}h ago`;
|
|
5937
|
+
}
|
|
5938
|
+
return `${Math.floor(hours / 24)}d ago`;
|
|
5939
|
+
};
|
|
5940
|
+
var createVoiceReconnectProfileEvidenceViewModel = (snapshot, options = {}) => {
|
|
5941
|
+
const report = snapshot.report;
|
|
5942
|
+
const latest = report?.latest;
|
|
5943
|
+
const latestAt = latest?.generatedAt ?? latest?.createdAt;
|
|
5944
|
+
return {
|
|
5945
|
+
description: options.description ?? latest?.profileDescription ?? DEFAULT_DESCRIPTION6,
|
|
5946
|
+
error: snapshot.error,
|
|
5947
|
+
isLoading: snapshot.isLoading,
|
|
5948
|
+
label: snapshot.error ? "Unavailable" : report ? report.status === "pass" ? "Reconnect evidence passing" : report.status === "warn" ? "Reconnect evidence incomplete" : report.status === "fail" ? "Reconnect evidence failing" : "Waiting for reconnect evidence" : snapshot.isLoading ? "Checking" : "No reconnect evidence",
|
|
5949
|
+
latest: latest ? {
|
|
5950
|
+
profileLabel: latest.profileLabel ?? latest.profileId,
|
|
5951
|
+
sessionId: latest.sessionId,
|
|
5952
|
+
surfaces: (latest.surfaces ?? []).join(", ") || "browser"
|
|
5953
|
+
} : undefined,
|
|
5954
|
+
links: options.links ?? DEFAULT_LINKS3,
|
|
5955
|
+
metrics: [
|
|
5956
|
+
{ label: "Samples", value: formatCount(report?.sampleCount ?? 0) },
|
|
5957
|
+
{ label: "Snapshots", value: formatCount(report?.snapshotCount ?? 0) },
|
|
5958
|
+
{
|
|
5959
|
+
label: "Resume p95",
|
|
5960
|
+
value: formatMs2(report?.resumeLatencyP95Ms ?? latest?.reconnect?.resumeLatencyP95Ms)
|
|
5961
|
+
},
|
|
5962
|
+
{ label: "Last proof", value: formatAge(latestAt) }
|
|
5963
|
+
],
|
|
5964
|
+
status: snapshot.error ? "error" : report ? report.status === "pass" ? "ready" : report.status === "empty" ? "empty" : "warning" : snapshot.isLoading ? "loading" : "empty",
|
|
5965
|
+
title: options.title ?? DEFAULT_TITLE6
|
|
5966
|
+
};
|
|
5967
|
+
};
|
|
5968
|
+
var renderVoiceReconnectProfileEvidenceHTML = (snapshot, options = {}) => {
|
|
5969
|
+
const model = createVoiceReconnectProfileEvidenceViewModel(snapshot, options);
|
|
5970
|
+
const metrics = `<div class="absolute-voice-reconnect-evidence__metrics">${model.metrics.map((metric) => `<article>
|
|
5971
|
+
<span>${escapeHtml11(metric.label)}</span>
|
|
5972
|
+
<strong>${escapeHtml11(metric.value)}</strong>
|
|
5973
|
+
</article>`).join("")}</div>`;
|
|
5974
|
+
const latest = model.latest ? `<p class="absolute-voice-reconnect-evidence__latest">Latest ${escapeHtml11(model.latest.profileLabel)} \xB7 ${escapeHtml11(model.latest.sessionId)} \xB7 ${escapeHtml11(model.latest.surfaces)}</p>` : `<p class="absolute-voice-reconnect-evidence__empty">No persisted reconnect profile evidence yet.</p>`;
|
|
5975
|
+
const links = model.links.length ? `<p class="absolute-voice-reconnect-evidence__links">${model.links.map((link) => `<a href="${escapeHtml11(link.href)}">${escapeHtml11(link.label)}</a>`).join("")}</p>` : "";
|
|
5976
|
+
return `<section class="absolute-voice-reconnect-evidence absolute-voice-reconnect-evidence--${escapeHtml11(model.status)}">
|
|
5977
|
+
<header class="absolute-voice-reconnect-evidence__header">
|
|
5978
|
+
<span class="absolute-voice-reconnect-evidence__eyebrow">${escapeHtml11(model.title)}</span>
|
|
5979
|
+
<strong class="absolute-voice-reconnect-evidence__label">${escapeHtml11(model.label)}</strong>
|
|
5980
|
+
</header>
|
|
5981
|
+
<p class="absolute-voice-reconnect-evidence__description">${escapeHtml11(model.description)}</p>
|
|
5982
|
+
${metrics}
|
|
5983
|
+
${latest}
|
|
5984
|
+
${links}
|
|
5985
|
+
${model.error ? `<p class="absolute-voice-reconnect-evidence__error">${escapeHtml11(model.error)}</p>` : ""}
|
|
5986
|
+
</section>`;
|
|
5987
|
+
};
|
|
5988
|
+
var getVoiceReconnectProfileEvidenceCSS = () => `.absolute-voice-reconnect-evidence{border:1px solid #bae6fd;border-radius:20px;background:#f0f9ff;color:#0f172a;padding:18px;box-shadow:0 18px 40px rgba(14,165,233,.12);font-family:inherit}.absolute-voice-reconnect-evidence--warning,.absolute-voice-reconnect-evidence--error{border-color:#fbbf24;background:#fffbeb}.absolute-voice-reconnect-evidence__header{align-items:start;display:flex;gap:12px;justify-content:space-between}.absolute-voice-reconnect-evidence__eyebrow{color:#0369a1;font-size:12px;font-weight:800;letter-spacing:.08em;text-transform:uppercase}.absolute-voice-reconnect-evidence__label{font-size:24px;line-height:1}.absolute-voice-reconnect-evidence__description,.absolute-voice-reconnect-evidence__empty,.absolute-voice-reconnect-evidence__latest{color:#475569}.absolute-voice-reconnect-evidence__metrics{display:grid;gap:10px;grid-template-columns:repeat(4,minmax(0,1fr));margin-top:14px}.absolute-voice-reconnect-evidence__metrics article{background:#fff;border:1px solid #bae6fd;border-radius:16px;padding:12px}.absolute-voice-reconnect-evidence__metrics span{color:#64748b;display:block;font-size:11px;font-weight:800;text-transform:uppercase}.absolute-voice-reconnect-evidence__metrics strong{display:block;font-size:20px;margin-top:4px}.absolute-voice-reconnect-evidence__links{display:flex;flex-wrap:wrap;gap:8px;margin:14px 0 0}.absolute-voice-reconnect-evidence__links a{border:1px solid #7dd3fc;border-radius:999px;color:#0369a1;font-weight:800;padding:6px 10px;text-decoration:none}.absolute-voice-reconnect-evidence__error{color:#9f1239;font-weight:700}@media (max-width:720px){.absolute-voice-reconnect-evidence__metrics{grid-template-columns:repeat(2,minmax(0,1fr))}}`;
|
|
5989
|
+
var mountVoiceReconnectProfileEvidence = (element, path = "/api/voice/reconnect-profile-evidence", options = {}) => {
|
|
5990
|
+
const store = createVoiceReconnectProfileEvidenceStore(path, options);
|
|
5991
|
+
const render = () => {
|
|
5992
|
+
element.innerHTML = renderVoiceReconnectProfileEvidenceHTML(store.getSnapshot(), options);
|
|
5993
|
+
};
|
|
5994
|
+
const unsubscribe = store.subscribe(render);
|
|
5995
|
+
render();
|
|
5996
|
+
store.refresh().catch(() => {});
|
|
5997
|
+
return {
|
|
5998
|
+
close: () => {
|
|
5999
|
+
unsubscribe();
|
|
6000
|
+
store.close();
|
|
6001
|
+
},
|
|
6002
|
+
refresh: store.refresh
|
|
6003
|
+
};
|
|
6004
|
+
};
|
|
6005
|
+
var defineVoiceReconnectProfileEvidenceElement = (tagName = "absolute-voice-reconnect-profile-evidence") => {
|
|
6006
|
+
if (typeof window === "undefined" || typeof customElements === "undefined" || customElements.get(tagName)) {
|
|
6007
|
+
return;
|
|
6008
|
+
}
|
|
6009
|
+
customElements.define(tagName, class AbsoluteVoiceReconnectProfileEvidenceElement extends HTMLElement {
|
|
6010
|
+
mounted;
|
|
6011
|
+
connectedCallback() {
|
|
6012
|
+
const intervalMs = Number(this.getAttribute("interval-ms") ?? 5000);
|
|
6013
|
+
this.mounted = mountVoiceReconnectProfileEvidence(this, this.getAttribute("path") ?? "/api/voice/reconnect-profile-evidence", {
|
|
6014
|
+
description: this.getAttribute("description") ?? undefined,
|
|
6015
|
+
intervalMs: Number.isFinite(intervalMs) ? intervalMs : 5000,
|
|
6016
|
+
title: this.getAttribute("title") ?? undefined
|
|
6017
|
+
});
|
|
6018
|
+
}
|
|
6019
|
+
disconnectedCallback() {
|
|
6020
|
+
this.mounted?.close();
|
|
6021
|
+
this.mounted = undefined;
|
|
6022
|
+
}
|
|
6023
|
+
});
|
|
6024
|
+
};
|
|
6025
|
+
|
|
6026
|
+
// src/react/useVoiceReconnectProfileEvidence.tsx
|
|
6027
|
+
import { useEffect as useEffect6, useRef as useRef6, useSyncExternalStore as useSyncExternalStore6 } from "react";
|
|
6028
|
+
var useVoiceReconnectProfileEvidence = (path = "/api/voice/reconnect-profile-evidence", options = {}) => {
|
|
6029
|
+
const storeRef = useRef6(null);
|
|
6030
|
+
if (!storeRef.current) {
|
|
6031
|
+
storeRef.current = createVoiceReconnectProfileEvidenceStore(path, options);
|
|
6032
|
+
}
|
|
6033
|
+
const store = storeRef.current;
|
|
6034
|
+
useEffect6(() => {
|
|
6035
|
+
store.refresh().catch(() => {});
|
|
6036
|
+
return () => store.close();
|
|
6037
|
+
}, [store]);
|
|
6038
|
+
return {
|
|
6039
|
+
...useSyncExternalStore6(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
6040
|
+
refresh: store.refresh
|
|
6041
|
+
};
|
|
6042
|
+
};
|
|
6043
|
+
|
|
6044
|
+
// src/react/VoiceReconnectProfileEvidence.tsx
|
|
6045
|
+
import { jsxDEV as jsxDEV6 } from "react/jsx-dev-runtime";
|
|
6046
|
+
var VoiceReconnectProfileEvidence = ({
|
|
6047
|
+
className,
|
|
6048
|
+
path = "/api/voice/reconnect-profile-evidence",
|
|
6049
|
+
...options
|
|
6050
|
+
}) => {
|
|
6051
|
+
const snapshot = useVoiceReconnectProfileEvidence(path, options);
|
|
6052
|
+
const model = createVoiceReconnectProfileEvidenceViewModel(snapshot, options);
|
|
6053
|
+
return /* @__PURE__ */ jsxDEV6("section", {
|
|
6054
|
+
className: [
|
|
6055
|
+
"absolute-voice-reconnect-evidence",
|
|
6056
|
+
`absolute-voice-reconnect-evidence--${model.status}`,
|
|
6057
|
+
className
|
|
6058
|
+
].filter(Boolean).join(" "),
|
|
6059
|
+
children: [
|
|
6060
|
+
/* @__PURE__ */ jsxDEV6("header", {
|
|
6061
|
+
className: "absolute-voice-reconnect-evidence__header",
|
|
6062
|
+
children: [
|
|
6063
|
+
/* @__PURE__ */ jsxDEV6("span", {
|
|
6064
|
+
className: "absolute-voice-reconnect-evidence__eyebrow",
|
|
6065
|
+
children: model.title
|
|
6066
|
+
}, undefined, false, undefined, this),
|
|
6067
|
+
/* @__PURE__ */ jsxDEV6("strong", {
|
|
6068
|
+
className: "absolute-voice-reconnect-evidence__label",
|
|
6069
|
+
children: model.label
|
|
6070
|
+
}, undefined, false, undefined, this)
|
|
6071
|
+
]
|
|
6072
|
+
}, undefined, true, undefined, this),
|
|
6073
|
+
/* @__PURE__ */ jsxDEV6("p", {
|
|
6074
|
+
className: "absolute-voice-reconnect-evidence__description",
|
|
6075
|
+
children: model.description
|
|
6076
|
+
}, undefined, false, undefined, this),
|
|
6077
|
+
/* @__PURE__ */ jsxDEV6("div", {
|
|
6078
|
+
className: "absolute-voice-reconnect-evidence__metrics",
|
|
6079
|
+
children: model.metrics.map((metric) => /* @__PURE__ */ jsxDEV6("article", {
|
|
6080
|
+
children: [
|
|
6081
|
+
/* @__PURE__ */ jsxDEV6("span", {
|
|
6082
|
+
children: metric.label
|
|
6083
|
+
}, undefined, false, undefined, this),
|
|
6084
|
+
/* @__PURE__ */ jsxDEV6("strong", {
|
|
6085
|
+
children: metric.value
|
|
6086
|
+
}, undefined, false, undefined, this)
|
|
6087
|
+
]
|
|
6088
|
+
}, metric.label, true, undefined, this))
|
|
6089
|
+
}, undefined, false, undefined, this),
|
|
6090
|
+
model.latest ? /* @__PURE__ */ jsxDEV6("p", {
|
|
6091
|
+
className: "absolute-voice-reconnect-evidence__latest",
|
|
6092
|
+
children: [
|
|
6093
|
+
"Latest ",
|
|
6094
|
+
model.latest.profileLabel,
|
|
6095
|
+
" \xB7 ",
|
|
6096
|
+
model.latest.sessionId,
|
|
6097
|
+
" \xB7",
|
|
6098
|
+
" ",
|
|
6099
|
+
model.latest.surfaces
|
|
6100
|
+
]
|
|
6101
|
+
}, undefined, true, undefined, this) : /* @__PURE__ */ jsxDEV6("p", {
|
|
6102
|
+
className: "absolute-voice-reconnect-evidence__empty",
|
|
6103
|
+
children: "No persisted reconnect profile evidence yet."
|
|
6104
|
+
}, undefined, false, undefined, this),
|
|
6105
|
+
model.links.length ? /* @__PURE__ */ jsxDEV6("p", {
|
|
6106
|
+
className: "absolute-voice-reconnect-evidence__links",
|
|
6107
|
+
children: model.links.map((link) => /* @__PURE__ */ jsxDEV6("a", {
|
|
6108
|
+
href: link.href,
|
|
6109
|
+
children: link.label
|
|
6110
|
+
}, link.href, false, undefined, this))
|
|
6111
|
+
}, undefined, false, undefined, this) : null,
|
|
6112
|
+
model.error ? /* @__PURE__ */ jsxDEV6("p", {
|
|
6113
|
+
className: "absolute-voice-reconnect-evidence__error",
|
|
6114
|
+
children: model.error
|
|
6115
|
+
}, undefined, false, undefined, this) : null
|
|
6116
|
+
]
|
|
6117
|
+
}, undefined, true, undefined, this);
|
|
6118
|
+
};
|
|
5804
6119
|
// src/client/callDebugger.ts
|
|
5805
6120
|
var fetchVoiceCallDebugger = async (path, options = {}) => {
|
|
5806
6121
|
const fetchImpl = options.fetch ?? globalThis.fetch;
|
|
@@ -5877,10 +6192,10 @@ var createVoiceCallDebuggerStore = (path, options = {}) => {
|
|
|
5877
6192
|
};
|
|
5878
6193
|
|
|
5879
6194
|
// src/client/callDebuggerWidget.ts
|
|
5880
|
-
var
|
|
5881
|
-
var
|
|
6195
|
+
var DEFAULT_TITLE7 = "Call Debugger";
|
|
6196
|
+
var DEFAULT_DESCRIPTION7 = "Open the latest call artifact with snapshot, operations record, failure replay, provider path, transcript, and incident markdown.";
|
|
5882
6197
|
var DEFAULT_LINK_LABEL = "Open debugger";
|
|
5883
|
-
var
|
|
6198
|
+
var escapeHtml12 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
5884
6199
|
var defaultHref = (path, report) => {
|
|
5885
6200
|
if (path.startsWith("/api/voice-call-debugger/")) {
|
|
5886
6201
|
return path.replace("/api/voice-call-debugger/", "/voice-call-debugger/");
|
|
@@ -5897,7 +6212,7 @@ var createVoiceCallDebuggerLaunchViewModel = (path, state, options = {}) => {
|
|
|
5897
6212
|
const report = state.report;
|
|
5898
6213
|
const href = resolveHref(path, state, options);
|
|
5899
6214
|
return {
|
|
5900
|
-
description: options.description ??
|
|
6215
|
+
description: options.description ?? DEFAULT_DESCRIPTION7,
|
|
5901
6216
|
error: state.error,
|
|
5902
6217
|
href,
|
|
5903
6218
|
isLoading: state.isLoading,
|
|
@@ -5926,25 +6241,25 @@ var createVoiceCallDebuggerLaunchViewModel = (path, state, options = {}) => {
|
|
|
5926
6241
|
{ label: "Snapshot", value: report.snapshot.status }
|
|
5927
6242
|
] : [],
|
|
5928
6243
|
status: state.error ? "error" : report ? report.status === "healthy" ? "ready" : "warning" : state.isLoading ? "loading" : "empty",
|
|
5929
|
-
title: options.title ??
|
|
6244
|
+
title: options.title ?? DEFAULT_TITLE7,
|
|
5930
6245
|
updatedAt: state.updatedAt
|
|
5931
6246
|
};
|
|
5932
6247
|
};
|
|
5933
6248
|
var renderVoiceCallDebuggerLaunchHTML = (path, state, options = {}) => {
|
|
5934
6249
|
const model = createVoiceCallDebuggerLaunchViewModel(path, state, options);
|
|
5935
6250
|
const rows = model.rows.length ? `<dl>${model.rows.map((row) => `<div>
|
|
5936
|
-
<dt>${
|
|
5937
|
-
<dd>${
|
|
6251
|
+
<dt>${escapeHtml12(row.label)}</dt>
|
|
6252
|
+
<dd>${escapeHtml12(row.value)}</dd>
|
|
5938
6253
|
</div>`).join("")}</dl>` : '<p class="absolute-voice-call-debugger-launch__empty">Load a call debugger report to see the latest support artifact.</p>';
|
|
5939
|
-
return `<section class="absolute-voice-call-debugger-launch absolute-voice-call-debugger-launch--${
|
|
6254
|
+
return `<section class="absolute-voice-call-debugger-launch absolute-voice-call-debugger-launch--${escapeHtml12(model.status)}">
|
|
5940
6255
|
<header class="absolute-voice-call-debugger-launch__header">
|
|
5941
|
-
<span class="absolute-voice-call-debugger-launch__eyebrow">${
|
|
5942
|
-
<strong class="absolute-voice-call-debugger-launch__label">${
|
|
6256
|
+
<span class="absolute-voice-call-debugger-launch__eyebrow">${escapeHtml12(model.title)}</span>
|
|
6257
|
+
<strong class="absolute-voice-call-debugger-launch__label">${escapeHtml12(model.label)}</strong>
|
|
5943
6258
|
</header>
|
|
5944
|
-
<p class="absolute-voice-call-debugger-launch__description">${
|
|
5945
|
-
<a class="absolute-voice-call-debugger-launch__link" href="${
|
|
6259
|
+
<p class="absolute-voice-call-debugger-launch__description">${escapeHtml12(model.description)}</p>
|
|
6260
|
+
<a class="absolute-voice-call-debugger-launch__link" href="${escapeHtml12(model.href)}">${escapeHtml12(options.linkLabel ?? DEFAULT_LINK_LABEL)}</a>
|
|
5946
6261
|
${rows}
|
|
5947
|
-
${model.error ? `<p class="absolute-voice-call-debugger-launch__error">${
|
|
6262
|
+
${model.error ? `<p class="absolute-voice-call-debugger-launch__error">${escapeHtml12(model.error)}</p>` : ""}
|
|
5948
6263
|
</section>`;
|
|
5949
6264
|
};
|
|
5950
6265
|
var mountVoiceCallDebuggerLaunch = (element, path, options = {}) => {
|
|
@@ -5987,25 +6302,25 @@ var defineVoiceCallDebuggerLaunchElement = (tagName = "absolute-voice-call-debug
|
|
|
5987
6302
|
};
|
|
5988
6303
|
|
|
5989
6304
|
// src/react/useVoiceCallDebugger.tsx
|
|
5990
|
-
import { useEffect as
|
|
6305
|
+
import { useEffect as useEffect7, useRef as useRef7, useSyncExternalStore as useSyncExternalStore7 } from "react";
|
|
5991
6306
|
var useVoiceCallDebugger = (path, options = {}) => {
|
|
5992
|
-
const storeRef =
|
|
6307
|
+
const storeRef = useRef7(null);
|
|
5993
6308
|
if (!storeRef.current) {
|
|
5994
6309
|
storeRef.current = createVoiceCallDebuggerStore(path, options);
|
|
5995
6310
|
}
|
|
5996
6311
|
const store = storeRef.current;
|
|
5997
|
-
|
|
6312
|
+
useEffect7(() => {
|
|
5998
6313
|
store.refresh().catch(() => {});
|
|
5999
6314
|
return () => store.close();
|
|
6000
6315
|
}, [store]);
|
|
6001
6316
|
return {
|
|
6002
|
-
...
|
|
6317
|
+
...useSyncExternalStore7(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
6003
6318
|
refresh: store.refresh
|
|
6004
6319
|
};
|
|
6005
6320
|
};
|
|
6006
6321
|
|
|
6007
6322
|
// src/react/VoiceCallDebuggerLaunch.tsx
|
|
6008
|
-
import { jsxDEV as
|
|
6323
|
+
import { jsxDEV as jsxDEV7 } from "react/jsx-dev-runtime";
|
|
6009
6324
|
var VoiceCallDebuggerLaunch = ({
|
|
6010
6325
|
className,
|
|
6011
6326
|
path,
|
|
@@ -6013,51 +6328,51 @@ var VoiceCallDebuggerLaunch = ({
|
|
|
6013
6328
|
}) => {
|
|
6014
6329
|
const state = useVoiceCallDebugger(path, options);
|
|
6015
6330
|
const model = createVoiceCallDebuggerLaunchViewModel(path, state, options);
|
|
6016
|
-
return /* @__PURE__ */
|
|
6331
|
+
return /* @__PURE__ */ jsxDEV7("section", {
|
|
6017
6332
|
className: [
|
|
6018
6333
|
"absolute-voice-call-debugger-launch",
|
|
6019
6334
|
`absolute-voice-call-debugger-launch--${model.status}`,
|
|
6020
6335
|
className
|
|
6021
6336
|
].filter(Boolean).join(" "),
|
|
6022
6337
|
children: [
|
|
6023
|
-
/* @__PURE__ */
|
|
6338
|
+
/* @__PURE__ */ jsxDEV7("header", {
|
|
6024
6339
|
className: "absolute-voice-call-debugger-launch__header",
|
|
6025
6340
|
children: [
|
|
6026
|
-
/* @__PURE__ */
|
|
6341
|
+
/* @__PURE__ */ jsxDEV7("span", {
|
|
6027
6342
|
className: "absolute-voice-call-debugger-launch__eyebrow",
|
|
6028
6343
|
children: model.title
|
|
6029
6344
|
}, undefined, false, undefined, this),
|
|
6030
|
-
/* @__PURE__ */
|
|
6345
|
+
/* @__PURE__ */ jsxDEV7("strong", {
|
|
6031
6346
|
className: "absolute-voice-call-debugger-launch__label",
|
|
6032
6347
|
children: model.label
|
|
6033
6348
|
}, undefined, false, undefined, this)
|
|
6034
6349
|
]
|
|
6035
6350
|
}, undefined, true, undefined, this),
|
|
6036
|
-
/* @__PURE__ */
|
|
6351
|
+
/* @__PURE__ */ jsxDEV7("p", {
|
|
6037
6352
|
className: "absolute-voice-call-debugger-launch__description",
|
|
6038
6353
|
children: model.description
|
|
6039
6354
|
}, undefined, false, undefined, this),
|
|
6040
|
-
/* @__PURE__ */
|
|
6355
|
+
/* @__PURE__ */ jsxDEV7("a", {
|
|
6041
6356
|
className: "absolute-voice-call-debugger-launch__link",
|
|
6042
6357
|
href: model.href,
|
|
6043
6358
|
children: options.linkLabel ?? "Open debugger"
|
|
6044
6359
|
}, undefined, false, undefined, this),
|
|
6045
|
-
model.rows.length ? /* @__PURE__ */
|
|
6046
|
-
children: model.rows.map((row) => /* @__PURE__ */
|
|
6360
|
+
model.rows.length ? /* @__PURE__ */ jsxDEV7("dl", {
|
|
6361
|
+
children: model.rows.map((row) => /* @__PURE__ */ jsxDEV7("div", {
|
|
6047
6362
|
children: [
|
|
6048
|
-
/* @__PURE__ */
|
|
6363
|
+
/* @__PURE__ */ jsxDEV7("dt", {
|
|
6049
6364
|
children: row.label
|
|
6050
6365
|
}, undefined, false, undefined, this),
|
|
6051
|
-
/* @__PURE__ */
|
|
6366
|
+
/* @__PURE__ */ jsxDEV7("dd", {
|
|
6052
6367
|
children: row.value
|
|
6053
6368
|
}, undefined, false, undefined, this)
|
|
6054
6369
|
]
|
|
6055
6370
|
}, row.label, true, undefined, this))
|
|
6056
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
6371
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV7("p", {
|
|
6057
6372
|
className: "absolute-voice-call-debugger-launch__empty",
|
|
6058
6373
|
children: "Load a call debugger report to see the latest support artifact."
|
|
6059
6374
|
}, undefined, false, undefined, this),
|
|
6060
|
-
model.error ? /* @__PURE__ */
|
|
6375
|
+
model.error ? /* @__PURE__ */ jsxDEV7("p", {
|
|
6061
6376
|
className: "absolute-voice-call-debugger-launch__error",
|
|
6062
6377
|
children: model.error
|
|
6063
6378
|
}, undefined, false, undefined, this) : null
|
|
@@ -6158,10 +6473,10 @@ var createVoiceSessionSnapshotStore = (path, options = {}) => {
|
|
|
6158
6473
|
};
|
|
6159
6474
|
|
|
6160
6475
|
// src/client/sessionSnapshotWidget.ts
|
|
6161
|
-
var
|
|
6162
|
-
var
|
|
6476
|
+
var DEFAULT_TITLE8 = "Session Snapshot";
|
|
6477
|
+
var DEFAULT_DESCRIPTION8 = "Portable call artifact with media graph, provider routing, proof, quality, and telephony evidence.";
|
|
6163
6478
|
var DEFAULT_DOWNLOAD_LABEL = "Download snapshot";
|
|
6164
|
-
var
|
|
6479
|
+
var escapeHtml13 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
6165
6480
|
var formatStatus2 = (status) => status ?? "n/a";
|
|
6166
6481
|
var createVoiceSessionSnapshotViewModel = (state, options = {}) => {
|
|
6167
6482
|
const snapshot = state.snapshot;
|
|
@@ -6177,7 +6492,7 @@ var createVoiceSessionSnapshotViewModel = (state, options = {}) => {
|
|
|
6177
6492
|
label: artifact.label,
|
|
6178
6493
|
status: formatStatus2(artifact.status)
|
|
6179
6494
|
})) ?? [],
|
|
6180
|
-
description: options.description ??
|
|
6495
|
+
description: options.description ?? DEFAULT_DESCRIPTION8,
|
|
6181
6496
|
error: state.error,
|
|
6182
6497
|
isLoading: state.isLoading,
|
|
6183
6498
|
label: state.error ? "Unavailable" : snapshot ? `${snapshot.status} \xB7 ${snapshot.sessionId}` : state.isLoading ? "Loading" : "No snapshot",
|
|
@@ -6204,30 +6519,30 @@ var createVoiceSessionSnapshotViewModel = (state, options = {}) => {
|
|
|
6204
6519
|
] : [],
|
|
6205
6520
|
showDownload: snapshot !== undefined,
|
|
6206
6521
|
status: state.error ? "error" : snapshot ? snapshot.status === "pass" ? "ready" : "warning" : state.isLoading ? "loading" : "empty",
|
|
6207
|
-
title: options.title ??
|
|
6522
|
+
title: options.title ?? DEFAULT_TITLE8,
|
|
6208
6523
|
updatedAt: state.updatedAt
|
|
6209
6524
|
};
|
|
6210
6525
|
};
|
|
6211
6526
|
var renderVoiceSessionSnapshotHTML = (state, options = {}) => {
|
|
6212
6527
|
const model = createVoiceSessionSnapshotViewModel(state, options);
|
|
6213
6528
|
const rows = model.rows.length ? `<dl>${model.rows.map((row) => `<div>
|
|
6214
|
-
<dt>${
|
|
6215
|
-
<dd>${
|
|
6529
|
+
<dt>${escapeHtml13(row.label)}</dt>
|
|
6530
|
+
<dd>${escapeHtml13(row.value)}</dd>
|
|
6216
6531
|
</div>`).join("")}</dl>` : '<p class="absolute-voice-session-snapshot__empty">Load a session snapshot to see support diagnostics.</p>';
|
|
6217
6532
|
const artifacts = model.artifacts.length ? `<div class="absolute-voice-session-snapshot__artifacts">${model.artifacts.map((artifact) => {
|
|
6218
|
-
const body = `<strong>${
|
|
6219
|
-
return artifact.href ? `<a href="${
|
|
6533
|
+
const body = `<strong>${escapeHtml13(artifact.label)}</strong><span>${escapeHtml13(artifact.status)}</span>`;
|
|
6534
|
+
return artifact.href ? `<a href="${escapeHtml13(artifact.href)}">${body}</a>` : `<div>${body}</div>`;
|
|
6220
6535
|
}).join("")}</div>` : "";
|
|
6221
|
-
return `<section class="absolute-voice-session-snapshot absolute-voice-session-snapshot--${
|
|
6536
|
+
return `<section class="absolute-voice-session-snapshot absolute-voice-session-snapshot--${escapeHtml13(model.status)}">
|
|
6222
6537
|
<header class="absolute-voice-session-snapshot__header">
|
|
6223
|
-
<span class="absolute-voice-session-snapshot__eyebrow">${
|
|
6224
|
-
<strong class="absolute-voice-session-snapshot__label">${
|
|
6538
|
+
<span class="absolute-voice-session-snapshot__eyebrow">${escapeHtml13(model.title)}</span>
|
|
6539
|
+
<strong class="absolute-voice-session-snapshot__label">${escapeHtml13(model.label)}</strong>
|
|
6225
6540
|
</header>
|
|
6226
|
-
<p class="absolute-voice-session-snapshot__description">${
|
|
6227
|
-
${model.showDownload ? `<button class="absolute-voice-session-snapshot__download" data-absolute-voice-session-snapshot-download type="button">${
|
|
6541
|
+
<p class="absolute-voice-session-snapshot__description">${escapeHtml13(model.description)}</p>
|
|
6542
|
+
${model.showDownload ? `<button class="absolute-voice-session-snapshot__download" data-absolute-voice-session-snapshot-download type="button">${escapeHtml13(options.downloadLabel ?? DEFAULT_DOWNLOAD_LABEL)}</button>` : ""}
|
|
6228
6543
|
${rows}
|
|
6229
6544
|
${artifacts}
|
|
6230
|
-
${model.error ? `<p class="absolute-voice-session-snapshot__error">${
|
|
6545
|
+
${model.error ? `<p class="absolute-voice-session-snapshot__error">${escapeHtml13(model.error)}</p>` : ""}
|
|
6231
6546
|
</section>`;
|
|
6232
6547
|
};
|
|
6233
6548
|
var downloadBlob = (blob, filename) => {
|
|
@@ -6291,26 +6606,26 @@ var defineVoiceSessionSnapshotElement = (tagName = "absolute-voice-session-snaps
|
|
|
6291
6606
|
};
|
|
6292
6607
|
|
|
6293
6608
|
// src/react/useVoiceSessionSnapshot.tsx
|
|
6294
|
-
import { useEffect as
|
|
6609
|
+
import { useEffect as useEffect8, useRef as useRef8, useSyncExternalStore as useSyncExternalStore8 } from "react";
|
|
6295
6610
|
var useVoiceSessionSnapshot = (path, options = {}) => {
|
|
6296
|
-
const storeRef =
|
|
6611
|
+
const storeRef = useRef8(null);
|
|
6297
6612
|
if (!storeRef.current) {
|
|
6298
6613
|
storeRef.current = createVoiceSessionSnapshotStore(path, options);
|
|
6299
6614
|
}
|
|
6300
6615
|
const store = storeRef.current;
|
|
6301
|
-
|
|
6616
|
+
useEffect8(() => {
|
|
6302
6617
|
store.refresh().catch(() => {});
|
|
6303
6618
|
return () => store.close();
|
|
6304
6619
|
}, [store]);
|
|
6305
6620
|
return {
|
|
6306
|
-
...
|
|
6621
|
+
...useSyncExternalStore8(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
6307
6622
|
download: store.download,
|
|
6308
6623
|
refresh: store.refresh
|
|
6309
6624
|
};
|
|
6310
6625
|
};
|
|
6311
6626
|
|
|
6312
6627
|
// src/react/VoiceSessionSnapshot.tsx
|
|
6313
|
-
import { jsxDEV as
|
|
6628
|
+
import { jsxDEV as jsxDEV8 } from "react/jsx-dev-runtime";
|
|
6314
6629
|
var VoiceSessionSnapshot = ({
|
|
6315
6630
|
className,
|
|
6316
6631
|
path,
|
|
@@ -6318,52 +6633,52 @@ var VoiceSessionSnapshot = ({
|
|
|
6318
6633
|
}) => {
|
|
6319
6634
|
const state = useVoiceSessionSnapshot(path, options);
|
|
6320
6635
|
const model = createVoiceSessionSnapshotViewModel(state, options);
|
|
6321
|
-
return /* @__PURE__ */
|
|
6636
|
+
return /* @__PURE__ */ jsxDEV8("section", {
|
|
6322
6637
|
className: [
|
|
6323
6638
|
"absolute-voice-session-snapshot",
|
|
6324
6639
|
`absolute-voice-session-snapshot--${model.status}`,
|
|
6325
6640
|
className
|
|
6326
6641
|
].filter(Boolean).join(" "),
|
|
6327
6642
|
children: [
|
|
6328
|
-
/* @__PURE__ */
|
|
6643
|
+
/* @__PURE__ */ jsxDEV8("header", {
|
|
6329
6644
|
className: "absolute-voice-session-snapshot__header",
|
|
6330
6645
|
children: [
|
|
6331
|
-
/* @__PURE__ */
|
|
6646
|
+
/* @__PURE__ */ jsxDEV8("span", {
|
|
6332
6647
|
className: "absolute-voice-session-snapshot__eyebrow",
|
|
6333
6648
|
children: model.title
|
|
6334
6649
|
}, undefined, false, undefined, this),
|
|
6335
|
-
/* @__PURE__ */
|
|
6650
|
+
/* @__PURE__ */ jsxDEV8("strong", {
|
|
6336
6651
|
className: "absolute-voice-session-snapshot__label",
|
|
6337
6652
|
children: model.label
|
|
6338
6653
|
}, undefined, false, undefined, this)
|
|
6339
6654
|
]
|
|
6340
6655
|
}, undefined, true, undefined, this),
|
|
6341
|
-
/* @__PURE__ */
|
|
6656
|
+
/* @__PURE__ */ jsxDEV8("p", {
|
|
6342
6657
|
className: "absolute-voice-session-snapshot__description",
|
|
6343
6658
|
children: model.description
|
|
6344
6659
|
}, undefined, false, undefined, this),
|
|
6345
|
-
model.showDownload ? /* @__PURE__ */
|
|
6660
|
+
model.showDownload ? /* @__PURE__ */ jsxDEV8("button", {
|
|
6346
6661
|
className: "absolute-voice-session-snapshot__download",
|
|
6347
6662
|
onClick: () => state.download(),
|
|
6348
6663
|
type: "button",
|
|
6349
6664
|
children: options.downloadLabel ?? "Download snapshot"
|
|
6350
6665
|
}, undefined, false, undefined, this) : null,
|
|
6351
|
-
model.rows.length ? /* @__PURE__ */
|
|
6352
|
-
children: model.rows.map((row) => /* @__PURE__ */
|
|
6666
|
+
model.rows.length ? /* @__PURE__ */ jsxDEV8("dl", {
|
|
6667
|
+
children: model.rows.map((row) => /* @__PURE__ */ jsxDEV8("div", {
|
|
6353
6668
|
children: [
|
|
6354
|
-
/* @__PURE__ */
|
|
6669
|
+
/* @__PURE__ */ jsxDEV8("dt", {
|
|
6355
6670
|
children: row.label
|
|
6356
6671
|
}, undefined, false, undefined, this),
|
|
6357
|
-
/* @__PURE__ */
|
|
6672
|
+
/* @__PURE__ */ jsxDEV8("dd", {
|
|
6358
6673
|
children: row.value
|
|
6359
6674
|
}, undefined, false, undefined, this)
|
|
6360
6675
|
]
|
|
6361
6676
|
}, row.label, true, undefined, this))
|
|
6362
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
6677
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV8("p", {
|
|
6363
6678
|
className: "absolute-voice-session-snapshot__empty",
|
|
6364
6679
|
children: "Load a session snapshot to see support diagnostics."
|
|
6365
6680
|
}, undefined, false, undefined, this),
|
|
6366
|
-
model.error ? /* @__PURE__ */
|
|
6681
|
+
model.error ? /* @__PURE__ */ jsxDEV8("p", {
|
|
6367
6682
|
className: "absolute-voice-session-snapshot__error",
|
|
6368
6683
|
children: model.error
|
|
6369
6684
|
}, undefined, false, undefined, this) : null
|
|
@@ -6446,20 +6761,20 @@ var createVoiceProfileComparisonStore = (path = "/api/voice/real-call-profile-hi
|
|
|
6446
6761
|
};
|
|
6447
6762
|
|
|
6448
6763
|
// src/client/profileComparisonWidget.ts
|
|
6449
|
-
var
|
|
6450
|
-
var
|
|
6451
|
-
var
|
|
6764
|
+
var DEFAULT_TITLE9 = "Profile Stack Comparison";
|
|
6765
|
+
var DEFAULT_DESCRIPTION9 = "Measured real-call evidence behind each profile default: provider routes, latency, and the next move.";
|
|
6766
|
+
var DEFAULT_LINKS4 = [
|
|
6452
6767
|
{ href: "/voice/real-call-profile-history", label: "Profile history" },
|
|
6453
6768
|
{ href: "/api/voice/real-call-profile-history", label: "JSON" }
|
|
6454
6769
|
];
|
|
6455
|
-
var
|
|
6456
|
-
var
|
|
6770
|
+
var escapeHtml14 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
6771
|
+
var formatMs3 = (value) => typeof value === "number" && Number.isFinite(value) ? `${Math.round(value)}ms` : "n/a";
|
|
6457
6772
|
var formatProviderRoutes = (profile) => Object.entries(profile.providerRoutes).map(([role, provider]) => `${role}: ${provider}`).join(", ") || "No complete route yet";
|
|
6458
6773
|
var createProfileView = (profile) => ({
|
|
6459
6774
|
evidence: [
|
|
6460
|
-
{ label: "Live p95", value:
|
|
6461
|
-
{ label: "Provider p95", value:
|
|
6462
|
-
{ label: "Turn p95", value:
|
|
6775
|
+
{ label: "Live p95", value: formatMs3(profile.evidence.liveP95Ms) },
|
|
6776
|
+
{ label: "Provider p95", value: formatMs3(profile.evidence.providerP95Ms) },
|
|
6777
|
+
{ label: "Turn p95", value: formatMs3(profile.evidence.turnP95Ms) }
|
|
6463
6778
|
],
|
|
6464
6779
|
label: profile.label ?? profile.profileId,
|
|
6465
6780
|
nextMove: profile.nextMove,
|
|
@@ -6471,37 +6786,37 @@ var createVoiceProfileComparisonViewModel = (snapshot, options = {}) => {
|
|
|
6471
6786
|
const report = snapshot.report;
|
|
6472
6787
|
const profiles = report?.defaults.profiles.map(createProfileView) ?? [];
|
|
6473
6788
|
return {
|
|
6474
|
-
description: options.description ??
|
|
6789
|
+
description: options.description ?? DEFAULT_DESCRIPTION9,
|
|
6475
6790
|
error: snapshot.error,
|
|
6476
6791
|
isLoading: snapshot.isLoading,
|
|
6477
6792
|
label: snapshot.error ? "Unavailable" : report ? `${report.defaults.summary.actionableProfiles}/${report.defaults.summary.profileCount} profiles ready` : snapshot.isLoading ? "Checking" : "No profile evidence",
|
|
6478
|
-
links: options.links ??
|
|
6793
|
+
links: options.links ?? DEFAULT_LINKS4,
|
|
6479
6794
|
profiles,
|
|
6480
6795
|
status: snapshot.error ? "error" : report ? report.status === "pass" ? "ready" : "warning" : snapshot.isLoading ? "loading" : "empty",
|
|
6481
|
-
title: options.title ??
|
|
6796
|
+
title: options.title ?? DEFAULT_TITLE9
|
|
6482
6797
|
};
|
|
6483
6798
|
};
|
|
6484
6799
|
var renderVoiceProfileComparisonHTML = (snapshot, options = {}) => {
|
|
6485
6800
|
const model = createVoiceProfileComparisonViewModel(snapshot, options);
|
|
6486
|
-
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--${
|
|
6801
|
+
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--${escapeHtml14(profile.status)}">
|
|
6487
6802
|
<header>
|
|
6488
|
-
<span>${
|
|
6489
|
-
<strong>${
|
|
6803
|
+
<span>${escapeHtml14(profile.status)}</span>
|
|
6804
|
+
<strong>${escapeHtml14(profile.label)}</strong>
|
|
6490
6805
|
</header>
|
|
6491
|
-
<p>${
|
|
6492
|
-
<div>${profile.evidence.map((metric) => `<span><small>${
|
|
6493
|
-
<em>${
|
|
6494
|
-
</article>`).join("")}</div>` : `<p class="absolute-voice-profile-comparison__empty">${model.error ?
|
|
6495
|
-
const links = model.links.length ? `<p class="absolute-voice-profile-comparison__links">${model.links.map((link) => `<a href="${
|
|
6496
|
-
return `<section class="absolute-voice-profile-comparison absolute-voice-profile-comparison--${
|
|
6806
|
+
<p>${escapeHtml14(profile.providerRoutes)}</p>
|
|
6807
|
+
<div>${profile.evidence.map((metric) => `<span><small>${escapeHtml14(metric.label)}</small><b>${escapeHtml14(metric.value)}</b></span>`).join("")}</div>
|
|
6808
|
+
<em>${escapeHtml14(profile.nextMove)}</em>
|
|
6809
|
+
</article>`).join("")}</div>` : `<p class="absolute-voice-profile-comparison__empty">${model.error ? escapeHtml14(model.error) : "Run real-call profile collection to populate profile comparisons."}</p>`;
|
|
6810
|
+
const links = model.links.length ? `<p class="absolute-voice-profile-comparison__links">${model.links.map((link) => `<a href="${escapeHtml14(link.href)}">${escapeHtml14(link.label)}</a>`).join("")}</p>` : "";
|
|
6811
|
+
return `<section class="absolute-voice-profile-comparison absolute-voice-profile-comparison--${escapeHtml14(model.status)}">
|
|
6497
6812
|
<header class="absolute-voice-profile-comparison__header">
|
|
6498
|
-
<span class="absolute-voice-profile-comparison__eyebrow">${
|
|
6499
|
-
<strong class="absolute-voice-profile-comparison__label">${
|
|
6813
|
+
<span class="absolute-voice-profile-comparison__eyebrow">${escapeHtml14(model.title)}</span>
|
|
6814
|
+
<strong class="absolute-voice-profile-comparison__label">${escapeHtml14(model.label)}</strong>
|
|
6500
6815
|
</header>
|
|
6501
|
-
<p class="absolute-voice-profile-comparison__description">${
|
|
6816
|
+
<p class="absolute-voice-profile-comparison__description">${escapeHtml14(model.description)}</p>
|
|
6502
6817
|
${profiles}
|
|
6503
6818
|
${links}
|
|
6504
|
-
${model.error ? `<p class="absolute-voice-profile-comparison__error">${
|
|
6819
|
+
${model.error ? `<p class="absolute-voice-profile-comparison__error">${escapeHtml14(model.error)}</p>` : ""}
|
|
6505
6820
|
</section>`;
|
|
6506
6821
|
};
|
|
6507
6822
|
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}`;
|
|
@@ -6543,25 +6858,25 @@ var defineVoiceProfileComparisonElement = (tagName = "absolute-voice-profile-com
|
|
|
6543
6858
|
};
|
|
6544
6859
|
|
|
6545
6860
|
// src/react/useVoiceProfileComparison.tsx
|
|
6546
|
-
import { useEffect as
|
|
6861
|
+
import { useEffect as useEffect9, useRef as useRef9, useSyncExternalStore as useSyncExternalStore9 } from "react";
|
|
6547
6862
|
var useVoiceProfileComparison = (path = "/api/voice/real-call-profile-history", options = {}) => {
|
|
6548
|
-
const storeRef =
|
|
6863
|
+
const storeRef = useRef9(null);
|
|
6549
6864
|
if (!storeRef.current) {
|
|
6550
6865
|
storeRef.current = createVoiceProfileComparisonStore(path, options);
|
|
6551
6866
|
}
|
|
6552
6867
|
const store = storeRef.current;
|
|
6553
|
-
|
|
6868
|
+
useEffect9(() => {
|
|
6554
6869
|
store.refresh().catch(() => {});
|
|
6555
6870
|
return () => store.close();
|
|
6556
6871
|
}, [store]);
|
|
6557
6872
|
return {
|
|
6558
|
-
...
|
|
6873
|
+
...useSyncExternalStore9(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
6559
6874
|
refresh: store.refresh
|
|
6560
6875
|
};
|
|
6561
6876
|
};
|
|
6562
6877
|
|
|
6563
6878
|
// src/react/VoiceProfileComparison.tsx
|
|
6564
|
-
import { jsxDEV as
|
|
6879
|
+
import { jsxDEV as jsxDEV9 } from "react/jsx-dev-runtime";
|
|
6565
6880
|
var VoiceProfileComparison = ({
|
|
6566
6881
|
className,
|
|
6567
6882
|
path = "/api/voice/real-call-profile-history",
|
|
@@ -6569,77 +6884,77 @@ var VoiceProfileComparison = ({
|
|
|
6569
6884
|
}) => {
|
|
6570
6885
|
const snapshot = useVoiceProfileComparison(path, options);
|
|
6571
6886
|
const model = createVoiceProfileComparisonViewModel(snapshot, options);
|
|
6572
|
-
return /* @__PURE__ */
|
|
6887
|
+
return /* @__PURE__ */ jsxDEV9("section", {
|
|
6573
6888
|
className: [
|
|
6574
6889
|
"absolute-voice-profile-comparison",
|
|
6575
6890
|
`absolute-voice-profile-comparison--${model.status}`,
|
|
6576
6891
|
className
|
|
6577
6892
|
].filter(Boolean).join(" "),
|
|
6578
6893
|
children: [
|
|
6579
|
-
/* @__PURE__ */
|
|
6894
|
+
/* @__PURE__ */ jsxDEV9("header", {
|
|
6580
6895
|
className: "absolute-voice-profile-comparison__header",
|
|
6581
6896
|
children: [
|
|
6582
|
-
/* @__PURE__ */
|
|
6897
|
+
/* @__PURE__ */ jsxDEV9("span", {
|
|
6583
6898
|
className: "absolute-voice-profile-comparison__eyebrow",
|
|
6584
6899
|
children: model.title
|
|
6585
6900
|
}, undefined, false, undefined, this),
|
|
6586
|
-
/* @__PURE__ */
|
|
6901
|
+
/* @__PURE__ */ jsxDEV9("strong", {
|
|
6587
6902
|
className: "absolute-voice-profile-comparison__label",
|
|
6588
6903
|
children: model.label
|
|
6589
6904
|
}, undefined, false, undefined, this)
|
|
6590
6905
|
]
|
|
6591
6906
|
}, undefined, true, undefined, this),
|
|
6592
|
-
/* @__PURE__ */
|
|
6907
|
+
/* @__PURE__ */ jsxDEV9("p", {
|
|
6593
6908
|
className: "absolute-voice-profile-comparison__description",
|
|
6594
6909
|
children: model.description
|
|
6595
6910
|
}, undefined, false, undefined, this),
|
|
6596
|
-
model.profiles.length ? /* @__PURE__ */
|
|
6911
|
+
model.profiles.length ? /* @__PURE__ */ jsxDEV9("div", {
|
|
6597
6912
|
className: "absolute-voice-profile-comparison__profiles",
|
|
6598
|
-
children: model.profiles.map((profile) => /* @__PURE__ */
|
|
6913
|
+
children: model.profiles.map((profile) => /* @__PURE__ */ jsxDEV9("article", {
|
|
6599
6914
|
className: `absolute-voice-profile-comparison__profile absolute-voice-profile-comparison__profile--${profile.status}`,
|
|
6600
6915
|
children: [
|
|
6601
|
-
/* @__PURE__ */
|
|
6916
|
+
/* @__PURE__ */ jsxDEV9("header", {
|
|
6602
6917
|
children: [
|
|
6603
|
-
/* @__PURE__ */
|
|
6918
|
+
/* @__PURE__ */ jsxDEV9("span", {
|
|
6604
6919
|
children: profile.status
|
|
6605
6920
|
}, undefined, false, undefined, this),
|
|
6606
|
-
/* @__PURE__ */
|
|
6921
|
+
/* @__PURE__ */ jsxDEV9("strong", {
|
|
6607
6922
|
children: profile.label
|
|
6608
6923
|
}, undefined, false, undefined, this)
|
|
6609
6924
|
]
|
|
6610
6925
|
}, undefined, true, undefined, this),
|
|
6611
|
-
/* @__PURE__ */
|
|
6926
|
+
/* @__PURE__ */ jsxDEV9("p", {
|
|
6612
6927
|
children: profile.providerRoutes
|
|
6613
6928
|
}, undefined, false, undefined, this),
|
|
6614
|
-
/* @__PURE__ */
|
|
6615
|
-
children: profile.evidence.map((metric) => /* @__PURE__ */
|
|
6929
|
+
/* @__PURE__ */ jsxDEV9("div", {
|
|
6930
|
+
children: profile.evidence.map((metric) => /* @__PURE__ */ jsxDEV9("span", {
|
|
6616
6931
|
children: [
|
|
6617
|
-
/* @__PURE__ */
|
|
6932
|
+
/* @__PURE__ */ jsxDEV9("small", {
|
|
6618
6933
|
children: metric.label
|
|
6619
6934
|
}, undefined, false, undefined, this),
|
|
6620
|
-
/* @__PURE__ */
|
|
6935
|
+
/* @__PURE__ */ jsxDEV9("b", {
|
|
6621
6936
|
children: metric.value
|
|
6622
6937
|
}, undefined, false, undefined, this)
|
|
6623
6938
|
]
|
|
6624
6939
|
}, metric.label, true, undefined, this))
|
|
6625
6940
|
}, undefined, false, undefined, this),
|
|
6626
|
-
/* @__PURE__ */
|
|
6941
|
+
/* @__PURE__ */ jsxDEV9("em", {
|
|
6627
6942
|
children: profile.nextMove
|
|
6628
6943
|
}, undefined, false, undefined, this)
|
|
6629
6944
|
]
|
|
6630
6945
|
}, profile.profileId, true, undefined, this))
|
|
6631
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
6946
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV9("p", {
|
|
6632
6947
|
className: "absolute-voice-profile-comparison__empty",
|
|
6633
6948
|
children: model.error ?? "Run real-call profile collection to populate profile comparisons."
|
|
6634
6949
|
}, undefined, false, undefined, this),
|
|
6635
|
-
model.links.length ? /* @__PURE__ */
|
|
6950
|
+
model.links.length ? /* @__PURE__ */ jsxDEV9("p", {
|
|
6636
6951
|
className: "absolute-voice-profile-comparison__links",
|
|
6637
|
-
children: model.links.map((link) => /* @__PURE__ */
|
|
6952
|
+
children: model.links.map((link) => /* @__PURE__ */ jsxDEV9("a", {
|
|
6638
6953
|
href: link.href,
|
|
6639
6954
|
children: link.label
|
|
6640
6955
|
}, link.href, false, undefined, this))
|
|
6641
6956
|
}, undefined, false, undefined, this) : null,
|
|
6642
|
-
model.error ? /* @__PURE__ */
|
|
6957
|
+
model.error ? /* @__PURE__ */ jsxDEV9("p", {
|
|
6643
6958
|
className: "absolute-voice-profile-comparison__error",
|
|
6644
6959
|
children: model.error
|
|
6645
6960
|
}, undefined, false, undefined, this) : null
|
|
@@ -6722,29 +7037,29 @@ var createVoiceProfileSwitchRecommendationStore = (path = "/api/voice/profile-sw
|
|
|
6722
7037
|
};
|
|
6723
7038
|
|
|
6724
7039
|
// src/client/profileSwitchRecommendationWidget.ts
|
|
6725
|
-
var
|
|
6726
|
-
var
|
|
6727
|
-
var
|
|
7040
|
+
var DEFAULT_TITLE10 = "Profile Switch Recommendation";
|
|
7041
|
+
var DEFAULT_DESCRIPTION10 = "Compares the current session against measured profile evidence and recommends whether to switch stacks.";
|
|
7042
|
+
var escapeHtml15 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
6728
7043
|
var formatRoute = (routes) => routes ? Object.entries(routes).map(([role, provider]) => `${role}: ${provider}`).join(", ") : "No route";
|
|
6729
7044
|
var renderVoiceProfileSwitchRecommendationHTML = (snapshot, options = {}) => {
|
|
6730
7045
|
const recommendation = snapshot.recommendation;
|
|
6731
7046
|
const status = snapshot.error ? "error" : recommendation ? recommendation.status : snapshot.isLoading ? "loading" : "empty";
|
|
6732
7047
|
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";
|
|
6733
7048
|
const body = recommendation ? `<div class="absolute-voice-profile-switch__body">
|
|
6734
|
-
<p><strong>Current:</strong> ${
|
|
6735
|
-
<p><strong>Recommended:</strong> ${
|
|
6736
|
-
<p><strong>Routes:</strong> ${
|
|
6737
|
-
<ul>${recommendation.reasons.map((reason) => `<li>${
|
|
6738
|
-
<em>${
|
|
6739
|
-
</div>` : `<p class="absolute-voice-profile-switch__empty">${
|
|
6740
|
-
return `<section class="absolute-voice-profile-switch absolute-voice-profile-switch--${
|
|
7049
|
+
<p><strong>Current:</strong> ${escapeHtml15(recommendation.currentProfile?.label ?? recommendation.currentProfile?.profileId ?? "Unknown")}</p>
|
|
7050
|
+
<p><strong>Recommended:</strong> ${escapeHtml15(recommendation.recommendedProfile?.label ?? recommendation.recommendedProfile?.profileId ?? "None")}</p>
|
|
7051
|
+
<p><strong>Routes:</strong> ${escapeHtml15(formatRoute(recommendation.recommendedProfile?.providerRoutes))}</p>
|
|
7052
|
+
<ul>${recommendation.reasons.map((reason) => `<li>${escapeHtml15(reason)}</li>`).join("")}</ul>
|
|
7053
|
+
<em>${escapeHtml15(recommendation.nextMove)}</em>
|
|
7054
|
+
</div>` : `<p class="absolute-voice-profile-switch__empty">${escapeHtml15(snapshot.error ?? "Run session traffic to populate a recommendation.")}</p>`;
|
|
7055
|
+
return `<section class="absolute-voice-profile-switch absolute-voice-profile-switch--${escapeHtml15(status)}">
|
|
6741
7056
|
<header class="absolute-voice-profile-switch__header">
|
|
6742
|
-
<span class="absolute-voice-profile-switch__eyebrow">${
|
|
6743
|
-
<strong class="absolute-voice-profile-switch__label">${
|
|
7057
|
+
<span class="absolute-voice-profile-switch__eyebrow">${escapeHtml15(options.title ?? DEFAULT_TITLE10)}</span>
|
|
7058
|
+
<strong class="absolute-voice-profile-switch__label">${escapeHtml15(label)}</strong>
|
|
6744
7059
|
</header>
|
|
6745
|
-
<p class="absolute-voice-profile-switch__description">${
|
|
7060
|
+
<p class="absolute-voice-profile-switch__description">${escapeHtml15(options.description ?? DEFAULT_DESCRIPTION10)}</p>
|
|
6746
7061
|
${body}
|
|
6747
|
-
${snapshot.error ? `<p class="absolute-voice-profile-switch__error">${
|
|
7062
|
+
${snapshot.error ? `<p class="absolute-voice-profile-switch__error">${escapeHtml15(snapshot.error)}</p>` : ""}
|
|
6748
7063
|
</section>`;
|
|
6749
7064
|
};
|
|
6750
7065
|
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}`;
|
|
@@ -6786,25 +7101,25 @@ var defineVoiceProfileSwitchRecommendationElement = (tagName = "absolute-voice-p
|
|
|
6786
7101
|
};
|
|
6787
7102
|
|
|
6788
7103
|
// src/react/useVoiceProfileSwitchRecommendation.tsx
|
|
6789
|
-
import { useEffect as
|
|
7104
|
+
import { useEffect as useEffect10, useRef as useRef10, useSyncExternalStore as useSyncExternalStore10 } from "react";
|
|
6790
7105
|
var useVoiceProfileSwitchRecommendation = (path = "/api/voice/profile-switch-recommendation", options = {}) => {
|
|
6791
|
-
const storeRef =
|
|
7106
|
+
const storeRef = useRef10(null);
|
|
6792
7107
|
if (!storeRef.current) {
|
|
6793
7108
|
storeRef.current = createVoiceProfileSwitchRecommendationStore(path, options);
|
|
6794
7109
|
}
|
|
6795
7110
|
const store = storeRef.current;
|
|
6796
|
-
|
|
7111
|
+
useEffect10(() => {
|
|
6797
7112
|
store.refresh().catch(() => {});
|
|
6798
7113
|
return () => store.close();
|
|
6799
7114
|
}, [store]);
|
|
6800
7115
|
return {
|
|
6801
|
-
...
|
|
7116
|
+
...useSyncExternalStore10(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
6802
7117
|
refresh: store.refresh
|
|
6803
7118
|
};
|
|
6804
7119
|
};
|
|
6805
7120
|
|
|
6806
7121
|
// src/react/VoiceProfileSwitchRecommendation.tsx
|
|
6807
|
-
import { jsxDEV as
|
|
7122
|
+
import { jsxDEV as jsxDEV10 } from "react/jsx-dev-runtime";
|
|
6808
7123
|
var VoiceProfileSwitchRecommendation = ({
|
|
6809
7124
|
className,
|
|
6810
7125
|
path = "/api/voice/profile-switch-recommendation",
|
|
@@ -6812,7 +7127,7 @@ var VoiceProfileSwitchRecommendation = ({
|
|
|
6812
7127
|
}) => {
|
|
6813
7128
|
const snapshot = useVoiceProfileSwitchRecommendation(path, options);
|
|
6814
7129
|
const html = renderVoiceProfileSwitchRecommendationHTML(snapshot, options);
|
|
6815
|
-
return /* @__PURE__ */
|
|
7130
|
+
return /* @__PURE__ */ jsxDEV10("div", {
|
|
6816
7131
|
className,
|
|
6817
7132
|
dangerouslySetInnerHTML: { __html: html }
|
|
6818
7133
|
}, undefined, false, undefined, this);
|
|
@@ -6893,13 +7208,13 @@ var createVoiceReadinessFailuresStore = (path = "/api/production-readiness", opt
|
|
|
6893
7208
|
};
|
|
6894
7209
|
|
|
6895
7210
|
// src/client/readinessFailuresWidget.ts
|
|
6896
|
-
var
|
|
6897
|
-
var
|
|
6898
|
-
var
|
|
7211
|
+
var DEFAULT_TITLE11 = "Readiness Gate Explanations";
|
|
7212
|
+
var DEFAULT_DESCRIPTION11 = "Structured reasons for calibrated production-readiness warnings and failures.";
|
|
7213
|
+
var DEFAULT_LINKS5 = [
|
|
6899
7214
|
{ href: "/production-readiness", label: "Readiness page" },
|
|
6900
7215
|
{ href: "/voice/slo-readiness-thresholds", label: "Gate thresholds" }
|
|
6901
7216
|
];
|
|
6902
|
-
var
|
|
7217
|
+
var escapeHtml16 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
6903
7218
|
var formatExplanationValue = (value, unit) => {
|
|
6904
7219
|
if (value === undefined || value === null) {
|
|
6905
7220
|
return "n/a";
|
|
@@ -6927,36 +7242,36 @@ var createVoiceReadinessFailuresViewModel = (snapshot, options = {}) => {
|
|
|
6927
7242
|
const failures = snapshot.report?.checks.map(toFailureView).filter((value) => !!value) ?? [];
|
|
6928
7243
|
const hasOpenIssues = failures.length > 0;
|
|
6929
7244
|
return {
|
|
6930
|
-
description: options.description ??
|
|
7245
|
+
description: options.description ?? DEFAULT_DESCRIPTION11,
|
|
6931
7246
|
error: snapshot.error,
|
|
6932
7247
|
failures,
|
|
6933
7248
|
isLoading: snapshot.isLoading,
|
|
6934
7249
|
label: snapshot.error ? "Unavailable" : snapshot.report ? hasOpenIssues ? `${failures.length} calibrated gate issue(s)` : "No calibrated gate issues" : snapshot.isLoading ? "Checking" : "No readiness report",
|
|
6935
|
-
links: options.links ??
|
|
7250
|
+
links: options.links ?? DEFAULT_LINKS5,
|
|
6936
7251
|
status: snapshot.error ? "error" : snapshot.report ? hasOpenIssues ? "warning" : "ready" : snapshot.isLoading ? "loading" : "empty",
|
|
6937
|
-
title: options.title ??
|
|
7252
|
+
title: options.title ?? DEFAULT_TITLE11,
|
|
6938
7253
|
updatedAt: snapshot.updatedAt
|
|
6939
7254
|
};
|
|
6940
7255
|
};
|
|
6941
7256
|
var renderVoiceReadinessFailuresHTML = (snapshot, options = {}) => {
|
|
6942
7257
|
const model = createVoiceReadinessFailuresViewModel(snapshot, options);
|
|
6943
|
-
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--${
|
|
6944
|
-
<span>${
|
|
6945
|
-
<strong>${
|
|
6946
|
-
<p>Observed ${
|
|
6947
|
-
<p>${
|
|
6948
|
-
<p class="absolute-voice-readiness-failures__links">${failure.evidenceHref ? `<a href="${
|
|
6949
|
-
</article>`).join("")}</div>` : `<p class="absolute-voice-readiness-failures__empty">${model.error ?
|
|
6950
|
-
const links = model.links.length ? `<p class="absolute-voice-readiness-failures__links">${model.links.map((link) => `<a href="${
|
|
6951
|
-
return `<section class="absolute-voice-readiness-failures absolute-voice-readiness-failures--${
|
|
7258
|
+
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--${escapeHtml16(failure.status)}">
|
|
7259
|
+
<span>${escapeHtml16(failure.status.toUpperCase())}</span>
|
|
7260
|
+
<strong>${escapeHtml16(failure.label)}</strong>
|
|
7261
|
+
<p>Observed ${escapeHtml16(failure.observed)} against ${escapeHtml16(failure.thresholdLabel)} ${escapeHtml16(failure.threshold)}.</p>
|
|
7262
|
+
<p>${escapeHtml16(failure.remediation)}</p>
|
|
7263
|
+
<p class="absolute-voice-readiness-failures__links">${failure.evidenceHref ? `<a href="${escapeHtml16(failure.evidenceHref)}">Evidence</a>` : ""}${failure.sourceHref ? `<a href="${escapeHtml16(failure.sourceHref)}">Threshold source</a>` : ""}</p>
|
|
7264
|
+
</article>`).join("")}</div>` : `<p class="absolute-voice-readiness-failures__empty">${model.error ? escapeHtml16(model.error) : "No calibrated readiness gate explanations are open."}</p>`;
|
|
7265
|
+
const links = model.links.length ? `<p class="absolute-voice-readiness-failures__links">${model.links.map((link) => `<a href="${escapeHtml16(link.href)}">${escapeHtml16(link.label)}</a>`).join("")}</p>` : "";
|
|
7266
|
+
return `<section class="absolute-voice-readiness-failures absolute-voice-readiness-failures--${escapeHtml16(model.status)}">
|
|
6952
7267
|
<header class="absolute-voice-readiness-failures__header">
|
|
6953
|
-
<span class="absolute-voice-readiness-failures__eyebrow">${
|
|
6954
|
-
<strong class="absolute-voice-readiness-failures__label">${
|
|
7268
|
+
<span class="absolute-voice-readiness-failures__eyebrow">${escapeHtml16(model.title)}</span>
|
|
7269
|
+
<strong class="absolute-voice-readiness-failures__label">${escapeHtml16(model.label)}</strong>
|
|
6955
7270
|
</header>
|
|
6956
|
-
<p class="absolute-voice-readiness-failures__description">${
|
|
7271
|
+
<p class="absolute-voice-readiness-failures__description">${escapeHtml16(model.description)}</p>
|
|
6957
7272
|
${failures}
|
|
6958
7273
|
${links}
|
|
6959
|
-
${model.error ? `<p class="absolute-voice-readiness-failures__error">${
|
|
7274
|
+
${model.error ? `<p class="absolute-voice-readiness-failures__error">${escapeHtml16(model.error)}</p>` : ""}
|
|
6960
7275
|
</section>`;
|
|
6961
7276
|
};
|
|
6962
7277
|
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}`;
|
|
@@ -6997,25 +7312,25 @@ var defineVoiceReadinessFailuresElement = (tagName = "absolute-voice-readiness-f
|
|
|
6997
7312
|
};
|
|
6998
7313
|
|
|
6999
7314
|
// src/react/useVoiceReadinessFailures.tsx
|
|
7000
|
-
import { useEffect as
|
|
7315
|
+
import { useEffect as useEffect11, useRef as useRef11, useSyncExternalStore as useSyncExternalStore11 } from "react";
|
|
7001
7316
|
var useVoiceReadinessFailures = (path = "/api/production-readiness", options = {}) => {
|
|
7002
|
-
const storeRef =
|
|
7317
|
+
const storeRef = useRef11(null);
|
|
7003
7318
|
if (!storeRef.current) {
|
|
7004
7319
|
storeRef.current = createVoiceReadinessFailuresStore(path, options);
|
|
7005
7320
|
}
|
|
7006
7321
|
const store = storeRef.current;
|
|
7007
|
-
|
|
7322
|
+
useEffect11(() => {
|
|
7008
7323
|
store.refresh().catch(() => {});
|
|
7009
7324
|
return () => store.close();
|
|
7010
7325
|
}, [store]);
|
|
7011
7326
|
return {
|
|
7012
|
-
...
|
|
7327
|
+
...useSyncExternalStore11(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
7013
7328
|
refresh: store.refresh
|
|
7014
7329
|
};
|
|
7015
7330
|
};
|
|
7016
7331
|
|
|
7017
7332
|
// src/react/VoiceReadinessFailures.tsx
|
|
7018
|
-
import { jsxDEV as
|
|
7333
|
+
import { jsxDEV as jsxDEV11 } from "react/jsx-dev-runtime";
|
|
7019
7334
|
var VoiceReadinessFailures = ({
|
|
7020
7335
|
className,
|
|
7021
7336
|
path = "/api/production-readiness",
|
|
@@ -7023,42 +7338,42 @@ var VoiceReadinessFailures = ({
|
|
|
7023
7338
|
}) => {
|
|
7024
7339
|
const snapshot = useVoiceReadinessFailures(path, options);
|
|
7025
7340
|
const model = createVoiceReadinessFailuresViewModel(snapshot, options);
|
|
7026
|
-
return /* @__PURE__ */
|
|
7341
|
+
return /* @__PURE__ */ jsxDEV11("section", {
|
|
7027
7342
|
className: [
|
|
7028
7343
|
"absolute-voice-readiness-failures",
|
|
7029
7344
|
`absolute-voice-readiness-failures--${model.status}`,
|
|
7030
7345
|
className
|
|
7031
7346
|
].filter(Boolean).join(" "),
|
|
7032
7347
|
children: [
|
|
7033
|
-
/* @__PURE__ */
|
|
7348
|
+
/* @__PURE__ */ jsxDEV11("header", {
|
|
7034
7349
|
className: "absolute-voice-readiness-failures__header",
|
|
7035
7350
|
children: [
|
|
7036
|
-
/* @__PURE__ */
|
|
7351
|
+
/* @__PURE__ */ jsxDEV11("span", {
|
|
7037
7352
|
className: "absolute-voice-readiness-failures__eyebrow",
|
|
7038
7353
|
children: model.title
|
|
7039
7354
|
}, undefined, false, undefined, this),
|
|
7040
|
-
/* @__PURE__ */
|
|
7355
|
+
/* @__PURE__ */ jsxDEV11("strong", {
|
|
7041
7356
|
className: "absolute-voice-readiness-failures__label",
|
|
7042
7357
|
children: model.label
|
|
7043
7358
|
}, undefined, false, undefined, this)
|
|
7044
7359
|
]
|
|
7045
7360
|
}, undefined, true, undefined, this),
|
|
7046
|
-
/* @__PURE__ */
|
|
7361
|
+
/* @__PURE__ */ jsxDEV11("p", {
|
|
7047
7362
|
className: "absolute-voice-readiness-failures__description",
|
|
7048
7363
|
children: model.description
|
|
7049
7364
|
}, undefined, false, undefined, this),
|
|
7050
|
-
model.failures.length ? /* @__PURE__ */
|
|
7365
|
+
model.failures.length ? /* @__PURE__ */ jsxDEV11("div", {
|
|
7051
7366
|
className: "absolute-voice-readiness-failures__items",
|
|
7052
|
-
children: model.failures.map((failure) => /* @__PURE__ */
|
|
7367
|
+
children: model.failures.map((failure) => /* @__PURE__ */ jsxDEV11("article", {
|
|
7053
7368
|
className: `absolute-voice-readiness-failures__item absolute-voice-readiness-failures__item--${failure.status}`,
|
|
7054
7369
|
children: [
|
|
7055
|
-
/* @__PURE__ */
|
|
7370
|
+
/* @__PURE__ */ jsxDEV11("span", {
|
|
7056
7371
|
children: failure.status.toUpperCase()
|
|
7057
7372
|
}, undefined, false, undefined, this),
|
|
7058
|
-
/* @__PURE__ */
|
|
7373
|
+
/* @__PURE__ */ jsxDEV11("strong", {
|
|
7059
7374
|
children: failure.label
|
|
7060
7375
|
}, undefined, false, undefined, this),
|
|
7061
|
-
/* @__PURE__ */
|
|
7376
|
+
/* @__PURE__ */ jsxDEV11("p", {
|
|
7062
7377
|
children: [
|
|
7063
7378
|
"Observed ",
|
|
7064
7379
|
failure.observed,
|
|
@@ -7069,17 +7384,17 @@ var VoiceReadinessFailures = ({
|
|
|
7069
7384
|
"."
|
|
7070
7385
|
]
|
|
7071
7386
|
}, undefined, true, undefined, this),
|
|
7072
|
-
/* @__PURE__ */
|
|
7387
|
+
/* @__PURE__ */ jsxDEV11("p", {
|
|
7073
7388
|
children: failure.remediation
|
|
7074
7389
|
}, undefined, false, undefined, this),
|
|
7075
|
-
/* @__PURE__ */
|
|
7390
|
+
/* @__PURE__ */ jsxDEV11("p", {
|
|
7076
7391
|
className: "absolute-voice-readiness-failures__links",
|
|
7077
7392
|
children: [
|
|
7078
|
-
failure.evidenceHref ? /* @__PURE__ */
|
|
7393
|
+
failure.evidenceHref ? /* @__PURE__ */ jsxDEV11("a", {
|
|
7079
7394
|
href: failure.evidenceHref,
|
|
7080
7395
|
children: "Evidence"
|
|
7081
7396
|
}, undefined, false, undefined, this) : null,
|
|
7082
|
-
failure.sourceHref ? /* @__PURE__ */
|
|
7397
|
+
failure.sourceHref ? /* @__PURE__ */ jsxDEV11("a", {
|
|
7083
7398
|
href: failure.sourceHref,
|
|
7084
7399
|
children: "Threshold source"
|
|
7085
7400
|
}, undefined, false, undefined, this) : null
|
|
@@ -7087,18 +7402,18 @@ var VoiceReadinessFailures = ({
|
|
|
7087
7402
|
}, undefined, true, undefined, this)
|
|
7088
7403
|
]
|
|
7089
7404
|
}, failure.label, true, undefined, this))
|
|
7090
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
7405
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV11("p", {
|
|
7091
7406
|
className: "absolute-voice-readiness-failures__empty",
|
|
7092
7407
|
children: model.error ?? "No calibrated readiness gate explanations are open."
|
|
7093
7408
|
}, undefined, false, undefined, this),
|
|
7094
|
-
model.links.length ? /* @__PURE__ */
|
|
7409
|
+
model.links.length ? /* @__PURE__ */ jsxDEV11("p", {
|
|
7095
7410
|
className: "absolute-voice-readiness-failures__links",
|
|
7096
|
-
children: model.links.map((link) => /* @__PURE__ */
|
|
7411
|
+
children: model.links.map((link) => /* @__PURE__ */ jsxDEV11("a", {
|
|
7097
7412
|
href: link.href,
|
|
7098
7413
|
children: link.label
|
|
7099
7414
|
}, link.href, false, undefined, this))
|
|
7100
7415
|
}, undefined, false, undefined, this) : null,
|
|
7101
|
-
model.error ? /* @__PURE__ */
|
|
7416
|
+
model.error ? /* @__PURE__ */ jsxDEV11("p", {
|
|
7102
7417
|
className: "absolute-voice-readiness-failures__error",
|
|
7103
7418
|
children: model.error
|
|
7104
7419
|
}, undefined, false, undefined, this) : null
|
|
@@ -7185,7 +7500,7 @@ var createVoiceProviderSimulationControlsStore = (options) => {
|
|
|
7185
7500
|
};
|
|
7186
7501
|
|
|
7187
7502
|
// src/client/providerSimulationControlsWidget.ts
|
|
7188
|
-
var
|
|
7503
|
+
var escapeHtml17 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
7189
7504
|
var formatKind = (kind) => (kind ?? "stt").toUpperCase();
|
|
7190
7505
|
var createVoiceProviderSimulationControlsViewModel = (snapshot, options) => {
|
|
7191
7506
|
const configuredProviders = options.providers.filter((provider) => provider.configured !== false);
|
|
@@ -7205,18 +7520,18 @@ var createVoiceProviderSimulationControlsViewModel = (snapshot, options) => {
|
|
|
7205
7520
|
};
|
|
7206
7521
|
var renderVoiceProviderSimulationControlsHTML = (snapshot, options) => {
|
|
7207
7522
|
const model = createVoiceProviderSimulationControlsViewModel(snapshot, options);
|
|
7208
|
-
const failureButtons = model.failureProviders.map((provider) => `<button type="button" data-voice-provider-fail="${
|
|
7209
|
-
const recoveryButtons = model.providers.map((provider) => `<button type="button" data-voice-provider-recover="${
|
|
7523
|
+
const failureButtons = model.failureProviders.map((provider) => `<button type="button" data-voice-provider-fail="${escapeHtml17(provider.provider)}"${!model.canSimulateFailure || snapshot.isRunning ? " disabled" : ""}>Simulate ${escapeHtml17(provider.provider)} ${escapeHtml17(formatKind(options.kind))} failure</button>`).join("");
|
|
7524
|
+
const recoveryButtons = model.providers.map((provider) => `<button type="button" data-voice-provider-recover="${escapeHtml17(provider.provider)}"${snapshot.isRunning ? " disabled" : ""}>Mark ${escapeHtml17(provider.provider)} recovered</button>`).join("");
|
|
7210
7525
|
return `<section class="absolute-voice-provider-simulation absolute-voice-provider-simulation--${snapshot.error ? "error" : snapshot.isRunning ? "running" : "ready"}">
|
|
7211
7526
|
<header class="absolute-voice-provider-simulation__header">
|
|
7212
|
-
<span class="absolute-voice-provider-simulation__eyebrow">${
|
|
7213
|
-
<strong class="absolute-voice-provider-simulation__label">${
|
|
7527
|
+
<span class="absolute-voice-provider-simulation__eyebrow">${escapeHtml17(model.title)}</span>
|
|
7528
|
+
<strong class="absolute-voice-provider-simulation__label">${escapeHtml17(model.label)}</strong>
|
|
7214
7529
|
</header>
|
|
7215
|
-
<p class="absolute-voice-provider-simulation__description">${
|
|
7216
|
-
${model.canSimulateFailure ? "" : `<p class="absolute-voice-provider-simulation__empty">${
|
|
7530
|
+
<p class="absolute-voice-provider-simulation__description">${escapeHtml17(model.description)}</p>
|
|
7531
|
+
${model.canSimulateFailure ? "" : `<p class="absolute-voice-provider-simulation__empty">${escapeHtml17(options.fallbackRequiredMessage ?? "Configure fallback providers before simulating failure.")}</p>`}
|
|
7217
7532
|
<div class="absolute-voice-provider-simulation__actions">${failureButtons}${recoveryButtons}</div>
|
|
7218
|
-
${snapshot.error ? `<p class="absolute-voice-provider-simulation__error">${
|
|
7219
|
-
${model.resultText ? `<pre class="absolute-voice-provider-simulation__result">${
|
|
7533
|
+
${snapshot.error ? `<p class="absolute-voice-provider-simulation__error">${escapeHtml17(snapshot.error)}</p>` : ""}
|
|
7534
|
+
${model.resultText ? `<pre class="absolute-voice-provider-simulation__result">${escapeHtml17(model.resultText)}</pre>` : ""}
|
|
7220
7535
|
</section>`;
|
|
7221
7536
|
};
|
|
7222
7537
|
var bindVoiceProviderSimulationControls = (element, store) => {
|
|
@@ -7282,22 +7597,22 @@ var defineVoiceProviderSimulationControlsElement = (tagName = "absolute-voice-pr
|
|
|
7282
7597
|
};
|
|
7283
7598
|
|
|
7284
7599
|
// src/react/useVoiceProviderSimulationControls.tsx
|
|
7285
|
-
import { useEffect as
|
|
7600
|
+
import { useEffect as useEffect12, useRef as useRef12, useSyncExternalStore as useSyncExternalStore12 } from "react";
|
|
7286
7601
|
var useVoiceProviderSimulationControls = (options) => {
|
|
7287
|
-
const storeRef =
|
|
7602
|
+
const storeRef = useRef12(null);
|
|
7288
7603
|
if (!storeRef.current) {
|
|
7289
7604
|
storeRef.current = createVoiceProviderSimulationControlsStore(options);
|
|
7290
7605
|
}
|
|
7291
7606
|
const store = storeRef.current;
|
|
7292
|
-
|
|
7607
|
+
useEffect12(() => () => store.close(), [store]);
|
|
7293
7608
|
return {
|
|
7294
|
-
...
|
|
7609
|
+
...useSyncExternalStore12(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
7295
7610
|
run: store.run
|
|
7296
7611
|
};
|
|
7297
7612
|
};
|
|
7298
7613
|
|
|
7299
7614
|
// src/react/VoiceProviderSimulationControls.tsx
|
|
7300
|
-
import { jsxDEV as
|
|
7615
|
+
import { jsxDEV as jsxDEV12 } from "react/jsx-dev-runtime";
|
|
7301
7616
|
var VoiceProviderSimulationControls = ({
|
|
7302
7617
|
className,
|
|
7303
7618
|
...options
|
|
@@ -7307,38 +7622,38 @@ var VoiceProviderSimulationControls = ({
|
|
|
7307
7622
|
const run = (provider, mode) => {
|
|
7308
7623
|
snapshot.run(provider, mode).catch(() => {});
|
|
7309
7624
|
};
|
|
7310
|
-
return /* @__PURE__ */
|
|
7625
|
+
return /* @__PURE__ */ jsxDEV12("section", {
|
|
7311
7626
|
className: [
|
|
7312
7627
|
"absolute-voice-provider-simulation",
|
|
7313
7628
|
`absolute-voice-provider-simulation--${snapshot.error ? "error" : snapshot.isRunning ? "running" : "ready"}`,
|
|
7314
7629
|
className
|
|
7315
7630
|
].filter(Boolean).join(" "),
|
|
7316
7631
|
children: [
|
|
7317
|
-
/* @__PURE__ */
|
|
7632
|
+
/* @__PURE__ */ jsxDEV12("header", {
|
|
7318
7633
|
className: "absolute-voice-provider-simulation__header",
|
|
7319
7634
|
children: [
|
|
7320
|
-
/* @__PURE__ */
|
|
7635
|
+
/* @__PURE__ */ jsxDEV12("span", {
|
|
7321
7636
|
className: "absolute-voice-provider-simulation__eyebrow",
|
|
7322
7637
|
children: model.title
|
|
7323
7638
|
}, undefined, false, undefined, this),
|
|
7324
|
-
/* @__PURE__ */
|
|
7639
|
+
/* @__PURE__ */ jsxDEV12("strong", {
|
|
7325
7640
|
className: "absolute-voice-provider-simulation__label",
|
|
7326
7641
|
children: model.label
|
|
7327
7642
|
}, undefined, false, undefined, this)
|
|
7328
7643
|
]
|
|
7329
7644
|
}, undefined, true, undefined, this),
|
|
7330
|
-
/* @__PURE__ */
|
|
7645
|
+
/* @__PURE__ */ jsxDEV12("p", {
|
|
7331
7646
|
className: "absolute-voice-provider-simulation__description",
|
|
7332
7647
|
children: model.description
|
|
7333
7648
|
}, undefined, false, undefined, this),
|
|
7334
|
-
model.canSimulateFailure ? null : /* @__PURE__ */
|
|
7649
|
+
model.canSimulateFailure ? null : /* @__PURE__ */ jsxDEV12("p", {
|
|
7335
7650
|
className: "absolute-voice-provider-simulation__empty",
|
|
7336
7651
|
children: options.fallbackRequiredMessage ?? "Configure fallback providers before simulating failure."
|
|
7337
7652
|
}, undefined, false, undefined, this),
|
|
7338
|
-
/* @__PURE__ */
|
|
7653
|
+
/* @__PURE__ */ jsxDEV12("div", {
|
|
7339
7654
|
className: "absolute-voice-provider-simulation__actions",
|
|
7340
7655
|
children: [
|
|
7341
|
-
model.failureProviders.map((provider) => /* @__PURE__ */
|
|
7656
|
+
model.failureProviders.map((provider) => /* @__PURE__ */ jsxDEV12("button", {
|
|
7342
7657
|
disabled: !model.canSimulateFailure || snapshot.isRunning,
|
|
7343
7658
|
onClick: () => run(provider.provider, "failure"),
|
|
7344
7659
|
type: "button",
|
|
@@ -7351,7 +7666,7 @@ var VoiceProviderSimulationControls = ({
|
|
|
7351
7666
|
"failure"
|
|
7352
7667
|
]
|
|
7353
7668
|
}, `fail-${provider.provider}`, true, undefined, this)),
|
|
7354
|
-
model.providers.map((provider) => /* @__PURE__ */
|
|
7669
|
+
model.providers.map((provider) => /* @__PURE__ */ jsxDEV12("button", {
|
|
7355
7670
|
disabled: snapshot.isRunning,
|
|
7356
7671
|
onClick: () => run(provider.provider, "recovery"),
|
|
7357
7672
|
type: "button",
|
|
@@ -7363,11 +7678,11 @@ var VoiceProviderSimulationControls = ({
|
|
|
7363
7678
|
}, `recover-${provider.provider}`, true, undefined, this))
|
|
7364
7679
|
]
|
|
7365
7680
|
}, undefined, true, undefined, this),
|
|
7366
|
-
snapshot.error ? /* @__PURE__ */
|
|
7681
|
+
snapshot.error ? /* @__PURE__ */ jsxDEV12("p", {
|
|
7367
7682
|
className: "absolute-voice-provider-simulation__error",
|
|
7368
7683
|
children: snapshot.error
|
|
7369
7684
|
}, undefined, false, undefined, this) : null,
|
|
7370
|
-
model.resultText ? /* @__PURE__ */
|
|
7685
|
+
model.resultText ? /* @__PURE__ */ jsxDEV12("pre", {
|
|
7371
7686
|
className: "absolute-voice-provider-simulation__result",
|
|
7372
7687
|
children: model.resultText
|
|
7373
7688
|
}, undefined, false, undefined, this) : null
|
|
@@ -7375,7 +7690,7 @@ var VoiceProviderSimulationControls = ({
|
|
|
7375
7690
|
}, undefined, true, undefined, this);
|
|
7376
7691
|
};
|
|
7377
7692
|
// src/react/useVoiceProviderCapabilities.tsx
|
|
7378
|
-
import { useEffect as
|
|
7693
|
+
import { useEffect as useEffect13, useRef as useRef13, useSyncExternalStore as useSyncExternalStore13 } from "react";
|
|
7379
7694
|
|
|
7380
7695
|
// src/client/providerCapabilities.ts
|
|
7381
7696
|
var fetchVoiceProviderCapabilities = async (path = "/api/provider-capabilities", options = {}) => {
|
|
@@ -7458,25 +7773,25 @@ var createVoiceProviderCapabilitiesStore = (path = "/api/provider-capabilities",
|
|
|
7458
7773
|
|
|
7459
7774
|
// src/react/useVoiceProviderCapabilities.tsx
|
|
7460
7775
|
var useVoiceProviderCapabilities = (path = "/api/provider-capabilities", options = {}) => {
|
|
7461
|
-
const storeRef =
|
|
7776
|
+
const storeRef = useRef13(null);
|
|
7462
7777
|
if (!storeRef.current) {
|
|
7463
7778
|
storeRef.current = createVoiceProviderCapabilitiesStore(path, options);
|
|
7464
7779
|
}
|
|
7465
7780
|
const store = storeRef.current;
|
|
7466
|
-
|
|
7781
|
+
useEffect13(() => {
|
|
7467
7782
|
store.refresh().catch(() => {});
|
|
7468
7783
|
return () => store.close();
|
|
7469
7784
|
}, [store]);
|
|
7470
7785
|
return {
|
|
7471
|
-
...
|
|
7786
|
+
...useSyncExternalStore13(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
7472
7787
|
refresh: store.refresh
|
|
7473
7788
|
};
|
|
7474
7789
|
};
|
|
7475
7790
|
|
|
7476
7791
|
// src/client/providerCapabilitiesWidget.ts
|
|
7477
|
-
var
|
|
7478
|
-
var
|
|
7479
|
-
var
|
|
7792
|
+
var DEFAULT_TITLE12 = "Provider Capabilities";
|
|
7793
|
+
var DEFAULT_DESCRIPTION12 = "Configured, selected, and healthy voice providers for this deployment.";
|
|
7794
|
+
var escapeHtml18 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
7480
7795
|
var formatProvider = (provider) => provider.split(/[-_\s]+/).filter(Boolean).map((part) => `${part[0]?.toUpperCase() ?? ""}${part.slice(1)}`).join(" ") || provider;
|
|
7481
7796
|
var formatKind2 = (kind) => kind.toUpperCase();
|
|
7482
7797
|
var formatStatus3 = (status) => status.split("-").map((part) => `${part[0]?.toUpperCase() ?? ""}${part.slice(1)}`).join(" ");
|
|
@@ -7520,36 +7835,36 @@ var createVoiceProviderCapabilitiesViewModel = (snapshot, options = {}) => {
|
|
|
7520
7835
|
const selectedCount = snapshot.report?.selected ?? capabilities.filter((capability) => capability.selected).length;
|
|
7521
7836
|
return {
|
|
7522
7837
|
capabilities,
|
|
7523
|
-
description: options.description ??
|
|
7838
|
+
description: options.description ?? DEFAULT_DESCRIPTION12,
|
|
7524
7839
|
error: snapshot.error,
|
|
7525
7840
|
isLoading: snapshot.isLoading,
|
|
7526
7841
|
label: snapshot.error ? "Unavailable" : capabilities.length ? warningCount > 0 ? `${warningCount} needs attention` : `${selectedCount} selected` : snapshot.isLoading ? "Checking" : "No capabilities",
|
|
7527
7842
|
status: snapshot.error ? "error" : capabilities.length ? warningCount > 0 ? "warning" : "ready" : snapshot.isLoading ? "loading" : "empty",
|
|
7528
|
-
title: options.title ??
|
|
7843
|
+
title: options.title ?? DEFAULT_TITLE12,
|
|
7529
7844
|
updatedAt: snapshot.updatedAt
|
|
7530
7845
|
};
|
|
7531
7846
|
};
|
|
7532
7847
|
var renderVoiceProviderCapabilitiesHTML = (snapshot, options = {}) => {
|
|
7533
7848
|
const model = createVoiceProviderCapabilitiesViewModel(snapshot, options);
|
|
7534
|
-
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--${
|
|
7849
|
+
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--${escapeHtml18(capability.status)}">
|
|
7535
7850
|
<header>
|
|
7536
|
-
<strong>${
|
|
7537
|
-
<span>${
|
|
7851
|
+
<strong>${escapeHtml18(capability.label)}</strong>
|
|
7852
|
+
<span>${escapeHtml18(formatStatus3(capability.status))}</span>
|
|
7538
7853
|
</header>
|
|
7539
|
-
<p>${
|
|
7854
|
+
<p>${escapeHtml18(capability.detail)}</p>
|
|
7540
7855
|
<dl>${capability.rows.map((row) => `<div>
|
|
7541
|
-
<dt>${
|
|
7542
|
-
<dd>${
|
|
7856
|
+
<dt>${escapeHtml18(row.label)}</dt>
|
|
7857
|
+
<dd>${escapeHtml18(row.value)}</dd>
|
|
7543
7858
|
</div>`).join("")}</dl>
|
|
7544
7859
|
</article>`).join("")}</div>` : '<p class="absolute-voice-provider-capabilities__empty">Configure provider capabilities to see deployment coverage.</p>';
|
|
7545
|
-
return `<section class="absolute-voice-provider-capabilities absolute-voice-provider-capabilities--${
|
|
7860
|
+
return `<section class="absolute-voice-provider-capabilities absolute-voice-provider-capabilities--${escapeHtml18(model.status)}">
|
|
7546
7861
|
<header class="absolute-voice-provider-capabilities__header">
|
|
7547
|
-
<span class="absolute-voice-provider-capabilities__eyebrow">${
|
|
7548
|
-
<strong class="absolute-voice-provider-capabilities__label">${
|
|
7862
|
+
<span class="absolute-voice-provider-capabilities__eyebrow">${escapeHtml18(model.title)}</span>
|
|
7863
|
+
<strong class="absolute-voice-provider-capabilities__label">${escapeHtml18(model.label)}</strong>
|
|
7549
7864
|
</header>
|
|
7550
|
-
<p class="absolute-voice-provider-capabilities__description">${
|
|
7865
|
+
<p class="absolute-voice-provider-capabilities__description">${escapeHtml18(model.description)}</p>
|
|
7551
7866
|
${capabilities}
|
|
7552
|
-
${model.error ? `<p class="absolute-voice-provider-capabilities__error">${
|
|
7867
|
+
${model.error ? `<p class="absolute-voice-provider-capabilities__error">${escapeHtml18(model.error)}</p>` : ""}
|
|
7553
7868
|
</section>`;
|
|
7554
7869
|
};
|
|
7555
7870
|
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}`;
|
|
@@ -7591,7 +7906,7 @@ var defineVoiceProviderCapabilitiesElement = (tagName = "absolute-voice-provider
|
|
|
7591
7906
|
};
|
|
7592
7907
|
|
|
7593
7908
|
// src/react/VoiceProviderCapabilities.tsx
|
|
7594
|
-
import { jsxDEV as
|
|
7909
|
+
import { jsxDEV as jsxDEV13 } from "react/jsx-dev-runtime";
|
|
7595
7910
|
var VoiceProviderCapabilities = ({
|
|
7596
7911
|
className,
|
|
7597
7912
|
path = "/api/provider-capabilities",
|
|
@@ -7599,58 +7914,58 @@ var VoiceProviderCapabilities = ({
|
|
|
7599
7914
|
}) => {
|
|
7600
7915
|
const snapshot = useVoiceProviderCapabilities(path, options);
|
|
7601
7916
|
const model = createVoiceProviderCapabilitiesViewModel(snapshot, options);
|
|
7602
|
-
return /* @__PURE__ */
|
|
7917
|
+
return /* @__PURE__ */ jsxDEV13("section", {
|
|
7603
7918
|
className: [
|
|
7604
7919
|
"absolute-voice-provider-capabilities",
|
|
7605
7920
|
`absolute-voice-provider-capabilities--${model.status}`,
|
|
7606
7921
|
className
|
|
7607
7922
|
].filter(Boolean).join(" "),
|
|
7608
7923
|
children: [
|
|
7609
|
-
/* @__PURE__ */
|
|
7924
|
+
/* @__PURE__ */ jsxDEV13("header", {
|
|
7610
7925
|
className: "absolute-voice-provider-capabilities__header",
|
|
7611
7926
|
children: [
|
|
7612
|
-
/* @__PURE__ */
|
|
7927
|
+
/* @__PURE__ */ jsxDEV13("span", {
|
|
7613
7928
|
className: "absolute-voice-provider-capabilities__eyebrow",
|
|
7614
7929
|
children: model.title
|
|
7615
7930
|
}, undefined, false, undefined, this),
|
|
7616
|
-
/* @__PURE__ */
|
|
7931
|
+
/* @__PURE__ */ jsxDEV13("strong", {
|
|
7617
7932
|
className: "absolute-voice-provider-capabilities__label",
|
|
7618
7933
|
children: model.label
|
|
7619
7934
|
}, undefined, false, undefined, this)
|
|
7620
7935
|
]
|
|
7621
7936
|
}, undefined, true, undefined, this),
|
|
7622
|
-
/* @__PURE__ */
|
|
7937
|
+
/* @__PURE__ */ jsxDEV13("p", {
|
|
7623
7938
|
className: "absolute-voice-provider-capabilities__description",
|
|
7624
7939
|
children: model.description
|
|
7625
7940
|
}, undefined, false, undefined, this),
|
|
7626
|
-
model.capabilities.length ? /* @__PURE__ */
|
|
7941
|
+
model.capabilities.length ? /* @__PURE__ */ jsxDEV13("div", {
|
|
7627
7942
|
className: "absolute-voice-provider-capabilities__providers",
|
|
7628
|
-
children: model.capabilities.map((capability) => /* @__PURE__ */
|
|
7943
|
+
children: model.capabilities.map((capability) => /* @__PURE__ */ jsxDEV13("article", {
|
|
7629
7944
|
className: [
|
|
7630
7945
|
"absolute-voice-provider-capabilities__provider",
|
|
7631
7946
|
`absolute-voice-provider-capabilities__provider--${capability.status}`
|
|
7632
7947
|
].join(" "),
|
|
7633
7948
|
children: [
|
|
7634
|
-
/* @__PURE__ */
|
|
7949
|
+
/* @__PURE__ */ jsxDEV13("header", {
|
|
7635
7950
|
children: [
|
|
7636
|
-
/* @__PURE__ */
|
|
7951
|
+
/* @__PURE__ */ jsxDEV13("strong", {
|
|
7637
7952
|
children: capability.label
|
|
7638
7953
|
}, undefined, false, undefined, this),
|
|
7639
|
-
/* @__PURE__ */
|
|
7954
|
+
/* @__PURE__ */ jsxDEV13("span", {
|
|
7640
7955
|
children: capability.status
|
|
7641
7956
|
}, undefined, false, undefined, this)
|
|
7642
7957
|
]
|
|
7643
7958
|
}, undefined, true, undefined, this),
|
|
7644
|
-
/* @__PURE__ */
|
|
7959
|
+
/* @__PURE__ */ jsxDEV13("p", {
|
|
7645
7960
|
children: capability.detail
|
|
7646
7961
|
}, undefined, false, undefined, this),
|
|
7647
|
-
/* @__PURE__ */
|
|
7648
|
-
children: capability.rows.map((row) => /* @__PURE__ */
|
|
7962
|
+
/* @__PURE__ */ jsxDEV13("dl", {
|
|
7963
|
+
children: capability.rows.map((row) => /* @__PURE__ */ jsxDEV13("div", {
|
|
7649
7964
|
children: [
|
|
7650
|
-
/* @__PURE__ */
|
|
7965
|
+
/* @__PURE__ */ jsxDEV13("dt", {
|
|
7651
7966
|
children: row.label
|
|
7652
7967
|
}, undefined, false, undefined, this),
|
|
7653
|
-
/* @__PURE__ */
|
|
7968
|
+
/* @__PURE__ */ jsxDEV13("dd", {
|
|
7654
7969
|
children: row.value
|
|
7655
7970
|
}, undefined, false, undefined, this)
|
|
7656
7971
|
]
|
|
@@ -7658,11 +7973,11 @@ var VoiceProviderCapabilities = ({
|
|
|
7658
7973
|
}, undefined, false, undefined, this)
|
|
7659
7974
|
]
|
|
7660
7975
|
}, `${capability.kind}:${capability.provider}`, true, undefined, this))
|
|
7661
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
7976
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV13("p", {
|
|
7662
7977
|
className: "absolute-voice-provider-capabilities__empty",
|
|
7663
7978
|
children: "Configure provider capabilities to see deployment coverage."
|
|
7664
7979
|
}, undefined, false, undefined, this),
|
|
7665
|
-
model.error ? /* @__PURE__ */
|
|
7980
|
+
model.error ? /* @__PURE__ */ jsxDEV13("p", {
|
|
7666
7981
|
className: "absolute-voice-provider-capabilities__error",
|
|
7667
7982
|
children: model.error
|
|
7668
7983
|
}, undefined, false, undefined, this) : null
|
|
@@ -7670,7 +7985,7 @@ var VoiceProviderCapabilities = ({
|
|
|
7670
7985
|
}, undefined, true, undefined, this);
|
|
7671
7986
|
};
|
|
7672
7987
|
// src/react/useVoiceProviderContracts.tsx
|
|
7673
|
-
import { useEffect as
|
|
7988
|
+
import { useEffect as useEffect14, useRef as useRef14, useSyncExternalStore as useSyncExternalStore14 } from "react";
|
|
7674
7989
|
|
|
7675
7990
|
// src/client/providerContracts.ts
|
|
7676
7991
|
var fetchVoiceProviderContracts = async (path = "/api/provider-contracts", options = {}) => {
|
|
@@ -7749,25 +8064,25 @@ var createVoiceProviderContractsStore = (path = "/api/provider-contracts", optio
|
|
|
7749
8064
|
|
|
7750
8065
|
// src/react/useVoiceProviderContracts.tsx
|
|
7751
8066
|
var useVoiceProviderContracts = (path = "/api/provider-contracts", options = {}) => {
|
|
7752
|
-
const storeRef =
|
|
8067
|
+
const storeRef = useRef14(null);
|
|
7753
8068
|
if (!storeRef.current) {
|
|
7754
8069
|
storeRef.current = createVoiceProviderContractsStore(path, options);
|
|
7755
8070
|
}
|
|
7756
8071
|
const store = storeRef.current;
|
|
7757
|
-
|
|
8072
|
+
useEffect14(() => {
|
|
7758
8073
|
store.refresh().catch(() => {});
|
|
7759
8074
|
return () => store.close();
|
|
7760
8075
|
}, [store]);
|
|
7761
8076
|
return {
|
|
7762
|
-
...
|
|
8077
|
+
...useSyncExternalStore14(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
7763
8078
|
refresh: store.refresh
|
|
7764
8079
|
};
|
|
7765
8080
|
};
|
|
7766
8081
|
|
|
7767
8082
|
// src/client/providerContractsWidget.ts
|
|
7768
|
-
var
|
|
7769
|
-
var
|
|
7770
|
-
var
|
|
8083
|
+
var DEFAULT_TITLE13 = "Provider Contracts";
|
|
8084
|
+
var DEFAULT_DESCRIPTION13 = "Production contract coverage for provider env, latency, fallback, streaming, and capabilities.";
|
|
8085
|
+
var escapeHtml19 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
7771
8086
|
var formatProvider2 = (provider) => provider.split(/[-_\s]+/).filter(Boolean).map((part) => `${part[0]?.toUpperCase() ?? ""}${part.slice(1)}`).join(" ") || provider;
|
|
7772
8087
|
var formatStatus4 = (status) => status.split("-").map((part) => `${part[0]?.toUpperCase() ?? ""}${part.slice(1)}`).join(" ");
|
|
7773
8088
|
var contractDetail = (row) => {
|
|
@@ -7799,38 +8114,38 @@ var createVoiceProviderContractsViewModel = (snapshot, options = {}) => {
|
|
|
7799
8114
|
}));
|
|
7800
8115
|
const warningCount = snapshot.report ? snapshot.report.failed + snapshot.report.warned : rows.filter((row) => row.status !== "pass").length;
|
|
7801
8116
|
return {
|
|
7802
|
-
description: options.description ??
|
|
8117
|
+
description: options.description ?? DEFAULT_DESCRIPTION13,
|
|
7803
8118
|
error: snapshot.error,
|
|
7804
8119
|
isLoading: snapshot.isLoading,
|
|
7805
8120
|
label: snapshot.error ? "Unavailable" : rows.length ? warningCount > 0 ? `${warningCount} needs attention` : `${rows.length} passing` : snapshot.isLoading ? "Checking" : "No contracts",
|
|
7806
8121
|
rows,
|
|
7807
8122
|
status: snapshot.error ? "error" : rows.length ? warningCount > 0 ? "warning" : "ready" : snapshot.isLoading ? "loading" : "empty",
|
|
7808
|
-
title: options.title ??
|
|
8123
|
+
title: options.title ?? DEFAULT_TITLE13,
|
|
7809
8124
|
updatedAt: snapshot.updatedAt
|
|
7810
8125
|
};
|
|
7811
8126
|
};
|
|
7812
8127
|
var renderVoiceProviderContractsHTML = (snapshot, options = {}) => {
|
|
7813
8128
|
const model = createVoiceProviderContractsViewModel(snapshot, options);
|
|
7814
|
-
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--${
|
|
8129
|
+
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--${escapeHtml19(row.status)}">
|
|
7815
8130
|
<header>
|
|
7816
|
-
<strong>${
|
|
7817
|
-
<span>${
|
|
8131
|
+
<strong>${escapeHtml19(row.label)}</strong>
|
|
8132
|
+
<span>${escapeHtml19(formatStatus4(row.status))}</span>
|
|
7818
8133
|
</header>
|
|
7819
|
-
<p>${
|
|
7820
|
-
${row.remediations.length ? `<ul class="absolute-voice-provider-contracts__remediations">${row.remediations.map((remediation) => `<li>${remediation.href ? `<a href="${
|
|
8134
|
+
<p>${escapeHtml19(row.detail)}</p>
|
|
8135
|
+
${row.remediations.length ? `<ul class="absolute-voice-provider-contracts__remediations">${row.remediations.map((remediation) => `<li>${remediation.href ? `<a href="${escapeHtml19(remediation.href)}">${escapeHtml19(remediation.label)}</a>` : `<strong>${escapeHtml19(remediation.label)}</strong>`}<span>${escapeHtml19(remediation.detail)}</span></li>`).join("")}</ul>` : ""}
|
|
7821
8136
|
<dl>${row.rows.map((item) => `<div>
|
|
7822
|
-
<dt>${
|
|
7823
|
-
<dd>${
|
|
8137
|
+
<dt>${escapeHtml19(item.label)}</dt>
|
|
8138
|
+
<dd>${escapeHtml19(item.value)}</dd>
|
|
7824
8139
|
</div>`).join("")}</dl>
|
|
7825
8140
|
</article>`).join("")}</div>` : '<p class="absolute-voice-provider-contracts__empty">Configure provider contracts to see production coverage.</p>';
|
|
7826
|
-
return `<section class="absolute-voice-provider-contracts absolute-voice-provider-contracts--${
|
|
8141
|
+
return `<section class="absolute-voice-provider-contracts absolute-voice-provider-contracts--${escapeHtml19(model.status)}">
|
|
7827
8142
|
<header class="absolute-voice-provider-contracts__header">
|
|
7828
|
-
<span class="absolute-voice-provider-contracts__eyebrow">${
|
|
7829
|
-
<strong class="absolute-voice-provider-contracts__label">${
|
|
8143
|
+
<span class="absolute-voice-provider-contracts__eyebrow">${escapeHtml19(model.title)}</span>
|
|
8144
|
+
<strong class="absolute-voice-provider-contracts__label">${escapeHtml19(model.label)}</strong>
|
|
7830
8145
|
</header>
|
|
7831
|
-
<p class="absolute-voice-provider-contracts__description">${
|
|
8146
|
+
<p class="absolute-voice-provider-contracts__description">${escapeHtml19(model.description)}</p>
|
|
7832
8147
|
${rows}
|
|
7833
|
-
${model.error ? `<p class="absolute-voice-provider-contracts__error">${
|
|
8148
|
+
${model.error ? `<p class="absolute-voice-provider-contracts__error">${escapeHtml19(model.error)}</p>` : ""}
|
|
7834
8149
|
</section>`;
|
|
7835
8150
|
};
|
|
7836
8151
|
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}`;
|
|
@@ -7872,7 +8187,7 @@ var defineVoiceProviderContractsElement = (tagName = "absolute-voice-provider-co
|
|
|
7872
8187
|
};
|
|
7873
8188
|
|
|
7874
8189
|
// src/react/VoiceProviderContracts.tsx
|
|
7875
|
-
import { jsxDEV as
|
|
8190
|
+
import { jsxDEV as jsxDEV14 } from "react/jsx-dev-runtime";
|
|
7876
8191
|
var VoiceProviderContracts = ({
|
|
7877
8192
|
className,
|
|
7878
8193
|
path = "/api/provider-contracts",
|
|
@@ -7880,74 +8195,74 @@ var VoiceProviderContracts = ({
|
|
|
7880
8195
|
}) => {
|
|
7881
8196
|
const snapshot = useVoiceProviderContracts(path, options);
|
|
7882
8197
|
const model = createVoiceProviderContractsViewModel(snapshot, options);
|
|
7883
|
-
return /* @__PURE__ */
|
|
8198
|
+
return /* @__PURE__ */ jsxDEV14("section", {
|
|
7884
8199
|
className: [
|
|
7885
8200
|
"absolute-voice-provider-contracts",
|
|
7886
8201
|
`absolute-voice-provider-contracts--${model.status}`,
|
|
7887
8202
|
className
|
|
7888
8203
|
].filter(Boolean).join(" "),
|
|
7889
8204
|
children: [
|
|
7890
|
-
/* @__PURE__ */
|
|
8205
|
+
/* @__PURE__ */ jsxDEV14("header", {
|
|
7891
8206
|
className: "absolute-voice-provider-contracts__header",
|
|
7892
8207
|
children: [
|
|
7893
|
-
/* @__PURE__ */
|
|
8208
|
+
/* @__PURE__ */ jsxDEV14("span", {
|
|
7894
8209
|
className: "absolute-voice-provider-contracts__eyebrow",
|
|
7895
8210
|
children: model.title
|
|
7896
8211
|
}, undefined, false, undefined, this),
|
|
7897
|
-
/* @__PURE__ */
|
|
8212
|
+
/* @__PURE__ */ jsxDEV14("strong", {
|
|
7898
8213
|
className: "absolute-voice-provider-contracts__label",
|
|
7899
8214
|
children: model.label
|
|
7900
8215
|
}, undefined, false, undefined, this)
|
|
7901
8216
|
]
|
|
7902
8217
|
}, undefined, true, undefined, this),
|
|
7903
|
-
/* @__PURE__ */
|
|
8218
|
+
/* @__PURE__ */ jsxDEV14("p", {
|
|
7904
8219
|
className: "absolute-voice-provider-contracts__description",
|
|
7905
8220
|
children: model.description
|
|
7906
8221
|
}, undefined, false, undefined, this),
|
|
7907
|
-
model.rows.length ? /* @__PURE__ */
|
|
8222
|
+
model.rows.length ? /* @__PURE__ */ jsxDEV14("div", {
|
|
7908
8223
|
className: "absolute-voice-provider-contracts__rows",
|
|
7909
|
-
children: model.rows.map((row) => /* @__PURE__ */
|
|
8224
|
+
children: model.rows.map((row) => /* @__PURE__ */ jsxDEV14("article", {
|
|
7910
8225
|
className: [
|
|
7911
8226
|
"absolute-voice-provider-contracts__row",
|
|
7912
8227
|
`absolute-voice-provider-contracts__row--${row.status}`
|
|
7913
8228
|
].join(" "),
|
|
7914
8229
|
children: [
|
|
7915
|
-
/* @__PURE__ */
|
|
8230
|
+
/* @__PURE__ */ jsxDEV14("header", {
|
|
7916
8231
|
children: [
|
|
7917
|
-
/* @__PURE__ */
|
|
8232
|
+
/* @__PURE__ */ jsxDEV14("strong", {
|
|
7918
8233
|
children: row.label
|
|
7919
8234
|
}, undefined, false, undefined, this),
|
|
7920
|
-
/* @__PURE__ */
|
|
8235
|
+
/* @__PURE__ */ jsxDEV14("span", {
|
|
7921
8236
|
children: row.status
|
|
7922
8237
|
}, undefined, false, undefined, this)
|
|
7923
8238
|
]
|
|
7924
8239
|
}, undefined, true, undefined, this),
|
|
7925
|
-
/* @__PURE__ */
|
|
8240
|
+
/* @__PURE__ */ jsxDEV14("p", {
|
|
7926
8241
|
children: row.detail
|
|
7927
8242
|
}, undefined, false, undefined, this),
|
|
7928
|
-
row.remediations.length ? /* @__PURE__ */
|
|
8243
|
+
row.remediations.length ? /* @__PURE__ */ jsxDEV14("ul", {
|
|
7929
8244
|
className: "absolute-voice-provider-contracts__remediations",
|
|
7930
|
-
children: row.remediations.map((remediation) => /* @__PURE__ */
|
|
8245
|
+
children: row.remediations.map((remediation) => /* @__PURE__ */ jsxDEV14("li", {
|
|
7931
8246
|
children: [
|
|
7932
|
-
remediation.href ? /* @__PURE__ */
|
|
8247
|
+
remediation.href ? /* @__PURE__ */ jsxDEV14("a", {
|
|
7933
8248
|
href: remediation.href,
|
|
7934
8249
|
children: remediation.label
|
|
7935
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
8250
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV14("strong", {
|
|
7936
8251
|
children: remediation.label
|
|
7937
8252
|
}, undefined, false, undefined, this),
|
|
7938
|
-
/* @__PURE__ */
|
|
8253
|
+
/* @__PURE__ */ jsxDEV14("span", {
|
|
7939
8254
|
children: remediation.detail
|
|
7940
8255
|
}, undefined, false, undefined, this)
|
|
7941
8256
|
]
|
|
7942
8257
|
}, `${row.kind}:${row.provider}:${remediation.label}`, true, undefined, this))
|
|
7943
8258
|
}, undefined, false, undefined, this) : null,
|
|
7944
|
-
/* @__PURE__ */
|
|
7945
|
-
children: row.rows.map((item) => /* @__PURE__ */
|
|
8259
|
+
/* @__PURE__ */ jsxDEV14("dl", {
|
|
8260
|
+
children: row.rows.map((item) => /* @__PURE__ */ jsxDEV14("div", {
|
|
7946
8261
|
children: [
|
|
7947
|
-
/* @__PURE__ */
|
|
8262
|
+
/* @__PURE__ */ jsxDEV14("dt", {
|
|
7948
8263
|
children: item.label
|
|
7949
8264
|
}, undefined, false, undefined, this),
|
|
7950
|
-
/* @__PURE__ */
|
|
8265
|
+
/* @__PURE__ */ jsxDEV14("dd", {
|
|
7951
8266
|
children: item.value
|
|
7952
8267
|
}, undefined, false, undefined, this)
|
|
7953
8268
|
]
|
|
@@ -7955,11 +8270,11 @@ var VoiceProviderContracts = ({
|
|
|
7955
8270
|
}, undefined, false, undefined, this)
|
|
7956
8271
|
]
|
|
7957
8272
|
}, `${row.kind}:${row.provider}`, true, undefined, this))
|
|
7958
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
8273
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV14("p", {
|
|
7959
8274
|
className: "absolute-voice-provider-contracts__empty",
|
|
7960
8275
|
children: "Configure provider contracts to see production coverage."
|
|
7961
8276
|
}, undefined, false, undefined, this),
|
|
7962
|
-
model.error ? /* @__PURE__ */
|
|
8277
|
+
model.error ? /* @__PURE__ */ jsxDEV14("p", {
|
|
7963
8278
|
className: "absolute-voice-provider-contracts__error",
|
|
7964
8279
|
children: model.error
|
|
7965
8280
|
}, undefined, false, undefined, this) : null
|
|
@@ -7967,7 +8282,7 @@ var VoiceProviderContracts = ({
|
|
|
7967
8282
|
}, undefined, true, undefined, this);
|
|
7968
8283
|
};
|
|
7969
8284
|
// src/react/useVoiceProviderStatus.tsx
|
|
7970
|
-
import { useEffect as
|
|
8285
|
+
import { useEffect as useEffect15, useRef as useRef15, useSyncExternalStore as useSyncExternalStore15 } from "react";
|
|
7971
8286
|
|
|
7972
8287
|
// src/client/providerStatus.ts
|
|
7973
8288
|
var fetchVoiceProviderStatus = async (path = "/api/provider-status", options = {}) => {
|
|
@@ -8051,25 +8366,25 @@ var createVoiceProviderStatusStore = (path = "/api/provider-status", options = {
|
|
|
8051
8366
|
|
|
8052
8367
|
// src/react/useVoiceProviderStatus.tsx
|
|
8053
8368
|
var useVoiceProviderStatus = (path = "/api/provider-status", options = {}) => {
|
|
8054
|
-
const storeRef =
|
|
8369
|
+
const storeRef = useRef15(null);
|
|
8055
8370
|
if (!storeRef.current) {
|
|
8056
8371
|
storeRef.current = createVoiceProviderStatusStore(path, options);
|
|
8057
8372
|
}
|
|
8058
8373
|
const store = storeRef.current;
|
|
8059
|
-
|
|
8374
|
+
useEffect15(() => {
|
|
8060
8375
|
store.refresh().catch(() => {});
|
|
8061
8376
|
return () => store.close();
|
|
8062
8377
|
}, [store]);
|
|
8063
8378
|
return {
|
|
8064
|
-
...
|
|
8379
|
+
...useSyncExternalStore15(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
8065
8380
|
refresh: store.refresh
|
|
8066
8381
|
};
|
|
8067
8382
|
};
|
|
8068
8383
|
|
|
8069
8384
|
// src/client/providerStatusWidget.ts
|
|
8070
|
-
var
|
|
8071
|
-
var
|
|
8072
|
-
var
|
|
8385
|
+
var DEFAULT_TITLE14 = "Voice Providers";
|
|
8386
|
+
var DEFAULT_DESCRIPTION14 = "Live provider health, fallback counts, latency, and suppression state from your self-hosted trace store.";
|
|
8387
|
+
var escapeHtml20 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
8073
8388
|
var formatProvider3 = (provider) => provider.split(/[-_\s]+/).filter(Boolean).map((part) => `${part[0]?.toUpperCase() ?? ""}${part.slice(1)}`).join(" ") || provider;
|
|
8074
8389
|
var formatStatus5 = (status) => status.split("-").map((part) => `${part[0]?.toUpperCase() ?? ""}${part.slice(1)}`).join(" ");
|
|
8075
8390
|
var formatLatency = (value) => typeof value === "number" ? `${value}ms` : "No samples";
|
|
@@ -8113,37 +8428,37 @@ var createVoiceProviderStatusViewModel = (snapshot, options = {}) => {
|
|
|
8113
8428
|
const warningCount = providers.filter((provider) => isWarningStatus2(provider.status)).length;
|
|
8114
8429
|
const healthyCount = providers.filter((provider) => provider.status === "healthy").length;
|
|
8115
8430
|
return {
|
|
8116
|
-
description: options.description ??
|
|
8431
|
+
description: options.description ?? DEFAULT_DESCRIPTION14,
|
|
8117
8432
|
error: snapshot.error,
|
|
8118
8433
|
isLoading: snapshot.isLoading,
|
|
8119
8434
|
label: snapshot.error ? "Unavailable" : providers.length ? warningCount > 0 ? `${warningCount} needs attention` : `${healthyCount} healthy` : snapshot.isLoading ? "Checking" : "No provider traffic",
|
|
8120
8435
|
providers,
|
|
8121
8436
|
status: snapshot.error ? "error" : providers.length ? warningCount > 0 ? "warning" : "ready" : snapshot.isLoading ? "loading" : "empty",
|
|
8122
|
-
title: options.title ??
|
|
8437
|
+
title: options.title ?? DEFAULT_TITLE14,
|
|
8123
8438
|
updatedAt: snapshot.updatedAt
|
|
8124
8439
|
};
|
|
8125
8440
|
};
|
|
8126
8441
|
var renderVoiceProviderStatusHTML = (snapshot, options = {}) => {
|
|
8127
8442
|
const model = createVoiceProviderStatusViewModel(snapshot, options);
|
|
8128
|
-
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--${
|
|
8443
|
+
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--${escapeHtml20(provider.status)}">
|
|
8129
8444
|
<header>
|
|
8130
|
-
<strong>${
|
|
8131
|
-
<span>${
|
|
8445
|
+
<strong>${escapeHtml20(provider.label)}</strong>
|
|
8446
|
+
<span>${escapeHtml20(formatStatus5(provider.status))}</span>
|
|
8132
8447
|
</header>
|
|
8133
|
-
<p>${
|
|
8448
|
+
<p>${escapeHtml20(provider.detail)}</p>
|
|
8134
8449
|
<dl>${provider.rows.map((row) => `<div>
|
|
8135
|
-
<dt>${
|
|
8136
|
-
<dd>${
|
|
8450
|
+
<dt>${escapeHtml20(row.label)}</dt>
|
|
8451
|
+
<dd>${escapeHtml20(row.value)}</dd>
|
|
8137
8452
|
</div>`).join("")}</dl>
|
|
8138
8453
|
</article>`).join("")}</div>` : '<p class="absolute-voice-provider-status__empty">Run voice traffic to see provider health.</p>';
|
|
8139
|
-
return `<section class="absolute-voice-provider-status absolute-voice-provider-status--${
|
|
8454
|
+
return `<section class="absolute-voice-provider-status absolute-voice-provider-status--${escapeHtml20(model.status)}">
|
|
8140
8455
|
<header class="absolute-voice-provider-status__header">
|
|
8141
|
-
<span class="absolute-voice-provider-status__eyebrow">${
|
|
8142
|
-
<strong class="absolute-voice-provider-status__label">${
|
|
8456
|
+
<span class="absolute-voice-provider-status__eyebrow">${escapeHtml20(model.title)}</span>
|
|
8457
|
+
<strong class="absolute-voice-provider-status__label">${escapeHtml20(model.label)}</strong>
|
|
8143
8458
|
</header>
|
|
8144
|
-
<p class="absolute-voice-provider-status__description">${
|
|
8459
|
+
<p class="absolute-voice-provider-status__description">${escapeHtml20(model.description)}</p>
|
|
8145
8460
|
${providers}
|
|
8146
|
-
${model.error ? `<p class="absolute-voice-provider-status__error">${
|
|
8461
|
+
${model.error ? `<p class="absolute-voice-provider-status__error">${escapeHtml20(model.error)}</p>` : ""}
|
|
8147
8462
|
</section>`;
|
|
8148
8463
|
};
|
|
8149
8464
|
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}`;
|
|
@@ -8185,7 +8500,7 @@ var defineVoiceProviderStatusElement = (tagName = "absolute-voice-provider-statu
|
|
|
8185
8500
|
};
|
|
8186
8501
|
|
|
8187
8502
|
// src/react/VoiceProviderStatus.tsx
|
|
8188
|
-
import { jsxDEV as
|
|
8503
|
+
import { jsxDEV as jsxDEV15 } from "react/jsx-dev-runtime";
|
|
8189
8504
|
var VoiceProviderStatus = ({
|
|
8190
8505
|
className,
|
|
8191
8506
|
path = "/api/provider-status",
|
|
@@ -8193,58 +8508,58 @@ var VoiceProviderStatus = ({
|
|
|
8193
8508
|
}) => {
|
|
8194
8509
|
const snapshot = useVoiceProviderStatus(path, options);
|
|
8195
8510
|
const model = createVoiceProviderStatusViewModel(snapshot, options);
|
|
8196
|
-
return /* @__PURE__ */
|
|
8511
|
+
return /* @__PURE__ */ jsxDEV15("section", {
|
|
8197
8512
|
className: [
|
|
8198
8513
|
"absolute-voice-provider-status",
|
|
8199
8514
|
`absolute-voice-provider-status--${model.status}`,
|
|
8200
8515
|
className
|
|
8201
8516
|
].filter(Boolean).join(" "),
|
|
8202
8517
|
children: [
|
|
8203
|
-
/* @__PURE__ */
|
|
8518
|
+
/* @__PURE__ */ jsxDEV15("header", {
|
|
8204
8519
|
className: "absolute-voice-provider-status__header",
|
|
8205
8520
|
children: [
|
|
8206
|
-
/* @__PURE__ */
|
|
8521
|
+
/* @__PURE__ */ jsxDEV15("span", {
|
|
8207
8522
|
className: "absolute-voice-provider-status__eyebrow",
|
|
8208
8523
|
children: model.title
|
|
8209
8524
|
}, undefined, false, undefined, this),
|
|
8210
|
-
/* @__PURE__ */
|
|
8525
|
+
/* @__PURE__ */ jsxDEV15("strong", {
|
|
8211
8526
|
className: "absolute-voice-provider-status__label",
|
|
8212
8527
|
children: model.label
|
|
8213
8528
|
}, undefined, false, undefined, this)
|
|
8214
8529
|
]
|
|
8215
8530
|
}, undefined, true, undefined, this),
|
|
8216
|
-
/* @__PURE__ */
|
|
8531
|
+
/* @__PURE__ */ jsxDEV15("p", {
|
|
8217
8532
|
className: "absolute-voice-provider-status__description",
|
|
8218
8533
|
children: model.description
|
|
8219
8534
|
}, undefined, false, undefined, this),
|
|
8220
|
-
model.providers.length ? /* @__PURE__ */
|
|
8535
|
+
model.providers.length ? /* @__PURE__ */ jsxDEV15("div", {
|
|
8221
8536
|
className: "absolute-voice-provider-status__providers",
|
|
8222
|
-
children: model.providers.map((provider) => /* @__PURE__ */
|
|
8537
|
+
children: model.providers.map((provider) => /* @__PURE__ */ jsxDEV15("article", {
|
|
8223
8538
|
className: [
|
|
8224
8539
|
"absolute-voice-provider-status__provider",
|
|
8225
8540
|
`absolute-voice-provider-status__provider--${provider.status}`
|
|
8226
8541
|
].join(" "),
|
|
8227
8542
|
children: [
|
|
8228
|
-
/* @__PURE__ */
|
|
8543
|
+
/* @__PURE__ */ jsxDEV15("header", {
|
|
8229
8544
|
children: [
|
|
8230
|
-
/* @__PURE__ */
|
|
8545
|
+
/* @__PURE__ */ jsxDEV15("strong", {
|
|
8231
8546
|
children: provider.label
|
|
8232
8547
|
}, undefined, false, undefined, this),
|
|
8233
|
-
/* @__PURE__ */
|
|
8548
|
+
/* @__PURE__ */ jsxDEV15("span", {
|
|
8234
8549
|
children: provider.status
|
|
8235
8550
|
}, undefined, false, undefined, this)
|
|
8236
8551
|
]
|
|
8237
8552
|
}, undefined, true, undefined, this),
|
|
8238
|
-
/* @__PURE__ */
|
|
8553
|
+
/* @__PURE__ */ jsxDEV15("p", {
|
|
8239
8554
|
children: provider.detail
|
|
8240
8555
|
}, undefined, false, undefined, this),
|
|
8241
|
-
/* @__PURE__ */
|
|
8242
|
-
children: provider.rows.map((row) => /* @__PURE__ */
|
|
8556
|
+
/* @__PURE__ */ jsxDEV15("dl", {
|
|
8557
|
+
children: provider.rows.map((row) => /* @__PURE__ */ jsxDEV15("div", {
|
|
8243
8558
|
children: [
|
|
8244
|
-
/* @__PURE__ */
|
|
8559
|
+
/* @__PURE__ */ jsxDEV15("dt", {
|
|
8245
8560
|
children: row.label
|
|
8246
8561
|
}, undefined, false, undefined, this),
|
|
8247
|
-
/* @__PURE__ */
|
|
8562
|
+
/* @__PURE__ */ jsxDEV15("dd", {
|
|
8248
8563
|
children: row.value
|
|
8249
8564
|
}, undefined, false, undefined, this)
|
|
8250
8565
|
]
|
|
@@ -8252,11 +8567,11 @@ var VoiceProviderStatus = ({
|
|
|
8252
8567
|
}, undefined, false, undefined, this)
|
|
8253
8568
|
]
|
|
8254
8569
|
}, provider.provider, true, undefined, this))
|
|
8255
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
8570
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV15("p", {
|
|
8256
8571
|
className: "absolute-voice-provider-status__empty",
|
|
8257
8572
|
children: "Run voice traffic to see provider health."
|
|
8258
8573
|
}, undefined, false, undefined, this),
|
|
8259
|
-
model.error ? /* @__PURE__ */
|
|
8574
|
+
model.error ? /* @__PURE__ */ jsxDEV15("p", {
|
|
8260
8575
|
className: "absolute-voice-provider-status__error",
|
|
8261
8576
|
children: model.error
|
|
8262
8577
|
}, undefined, false, undefined, this) : null
|
|
@@ -8264,7 +8579,7 @@ var VoiceProviderStatus = ({
|
|
|
8264
8579
|
}, undefined, true, undefined, this);
|
|
8265
8580
|
};
|
|
8266
8581
|
// src/react/useVoiceRoutingStatus.tsx
|
|
8267
|
-
import { useEffect as
|
|
8582
|
+
import { useEffect as useEffect16, useRef as useRef16, useSyncExternalStore as useSyncExternalStore16 } from "react";
|
|
8268
8583
|
|
|
8269
8584
|
// src/client/routingStatus.ts
|
|
8270
8585
|
var fetchVoiceRoutingStatus = async (path = "/api/routing/latest", options = {}) => {
|
|
@@ -8348,25 +8663,25 @@ var createVoiceRoutingStatusStore = (path = "/api/routing/latest", options = {})
|
|
|
8348
8663
|
|
|
8349
8664
|
// src/react/useVoiceRoutingStatus.tsx
|
|
8350
8665
|
var useVoiceRoutingStatus = (path = "/api/routing/latest", options = {}) => {
|
|
8351
|
-
const storeRef =
|
|
8666
|
+
const storeRef = useRef16(null);
|
|
8352
8667
|
if (!storeRef.current) {
|
|
8353
8668
|
storeRef.current = createVoiceRoutingStatusStore(path, options);
|
|
8354
8669
|
}
|
|
8355
8670
|
const store = storeRef.current;
|
|
8356
|
-
|
|
8671
|
+
useEffect16(() => {
|
|
8357
8672
|
store.refresh().catch(() => {});
|
|
8358
8673
|
return () => store.close();
|
|
8359
8674
|
}, [store]);
|
|
8360
8675
|
return {
|
|
8361
|
-
...
|
|
8676
|
+
...useSyncExternalStore16(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
8362
8677
|
refresh: store.refresh
|
|
8363
8678
|
};
|
|
8364
8679
|
};
|
|
8365
8680
|
|
|
8366
8681
|
// src/client/routingStatusWidget.ts
|
|
8367
|
-
var
|
|
8368
|
-
var
|
|
8369
|
-
var
|
|
8682
|
+
var DEFAULT_TITLE15 = "Voice Routing";
|
|
8683
|
+
var DEFAULT_DESCRIPTION15 = "Latest provider routing decision from the self-hosted trace store.";
|
|
8684
|
+
var escapeHtml21 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
8370
8685
|
var formatValue = (value, fallback = "None") => typeof value === "string" && value.trim() ? value : typeof value === "number" && Number.isFinite(value) ? String(value) : fallback;
|
|
8371
8686
|
var formatProviderRoutes2 = (routes) => routes && typeof routes === "object" ? Object.entries(routes).map(([role, provider]) => `${role}: ${formatValue(provider)}`).join(", ") || "None" : "None";
|
|
8372
8687
|
var getProviderRoute = (routes, role) => routes && typeof routes === "object" ? formatValue(routes[role], "Not configured") : "Not configured";
|
|
@@ -8435,35 +8750,35 @@ var createVoiceRoutingStatusViewModel = (snapshot, options = {}) => {
|
|
|
8435
8750
|
return {
|
|
8436
8751
|
activeStack,
|
|
8437
8752
|
decision,
|
|
8438
|
-
description: options.description ??
|
|
8753
|
+
description: options.description ?? DEFAULT_DESCRIPTION15,
|
|
8439
8754
|
error: snapshot.error,
|
|
8440
8755
|
isLoading: snapshot.isLoading,
|
|
8441
8756
|
label: snapshot.error ? "Unavailable" : decision ? `${formatValue(decision.kind).toUpperCase()} ${formatValue(decision.status, "unknown")}` : snapshot.isLoading ? "Checking" : "No routing yet",
|
|
8442
8757
|
rows,
|
|
8443
8758
|
status: snapshot.error ? "error" : decision ? "ready" : snapshot.isLoading ? "loading" : "empty",
|
|
8444
|
-
title: options.title ??
|
|
8759
|
+
title: options.title ?? DEFAULT_TITLE15,
|
|
8445
8760
|
updatedAt: snapshot.updatedAt
|
|
8446
8761
|
};
|
|
8447
8762
|
};
|
|
8448
8763
|
var renderVoiceRoutingStatusHTML = (snapshot, options = {}) => {
|
|
8449
8764
|
const model = createVoiceRoutingStatusViewModel(snapshot, options);
|
|
8450
8765
|
const activeStack = model.activeStack.length ? `<div class="absolute-voice-routing-status__stack" aria-label="Active voice stack">${model.activeStack.map((item) => `<div>
|
|
8451
|
-
<span>${
|
|
8452
|
-
<strong>${
|
|
8766
|
+
<span>${escapeHtml21(item.label)}</span>
|
|
8767
|
+
<strong>${escapeHtml21(item.value)}</strong>
|
|
8453
8768
|
</div>`).join("")}</div>` : "";
|
|
8454
8769
|
const rows = model.rows.length ? `<div class="absolute-voice-routing-status__grid">${model.rows.map((row) => `<div>
|
|
8455
|
-
<span>${
|
|
8456
|
-
<strong>${
|
|
8770
|
+
<span>${escapeHtml21(row.label)}</span>
|
|
8771
|
+
<strong>${escapeHtml21(row.value)}</strong>
|
|
8457
8772
|
</div>`).join("")}</div>` : '<p class="absolute-voice-routing-status__empty">Start a voice session to see the selected provider.</p>';
|
|
8458
|
-
return `<section class="absolute-voice-routing-status absolute-voice-routing-status--${
|
|
8773
|
+
return `<section class="absolute-voice-routing-status absolute-voice-routing-status--${escapeHtml21(model.status)}">
|
|
8459
8774
|
<header class="absolute-voice-routing-status__header">
|
|
8460
|
-
<span class="absolute-voice-routing-status__eyebrow">${
|
|
8461
|
-
<strong class="absolute-voice-routing-status__label">${
|
|
8775
|
+
<span class="absolute-voice-routing-status__eyebrow">${escapeHtml21(model.title)}</span>
|
|
8776
|
+
<strong class="absolute-voice-routing-status__label">${escapeHtml21(model.label)}</strong>
|
|
8462
8777
|
</header>
|
|
8463
|
-
<p class="absolute-voice-routing-status__description">${
|
|
8778
|
+
<p class="absolute-voice-routing-status__description">${escapeHtml21(model.description)}</p>
|
|
8464
8779
|
${activeStack}
|
|
8465
8780
|
${rows}
|
|
8466
|
-
${model.error ? `<p class="absolute-voice-routing-status__error">${
|
|
8781
|
+
${model.error ? `<p class="absolute-voice-routing-status__error">${escapeHtml21(model.error)}</p>` : ""}
|
|
8467
8782
|
</section>`;
|
|
8468
8783
|
};
|
|
8469
8784
|
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}}`;
|
|
@@ -8505,7 +8820,7 @@ var defineVoiceRoutingStatusElement = (tagName = "absolute-voice-routing-status"
|
|
|
8505
8820
|
};
|
|
8506
8821
|
|
|
8507
8822
|
// src/react/VoiceRoutingStatus.tsx
|
|
8508
|
-
import { jsxDEV as
|
|
8823
|
+
import { jsxDEV as jsxDEV16 } from "react/jsx-dev-runtime";
|
|
8509
8824
|
var VoiceRoutingStatus = ({
|
|
8510
8825
|
className,
|
|
8511
8826
|
path = "/api/routing/latest",
|
|
@@ -8513,47 +8828,47 @@ var VoiceRoutingStatus = ({
|
|
|
8513
8828
|
}) => {
|
|
8514
8829
|
const snapshot = useVoiceRoutingStatus(path, options);
|
|
8515
8830
|
const model = createVoiceRoutingStatusViewModel(snapshot, options);
|
|
8516
|
-
return /* @__PURE__ */
|
|
8831
|
+
return /* @__PURE__ */ jsxDEV16("section", {
|
|
8517
8832
|
className: [
|
|
8518
8833
|
"absolute-voice-routing-status",
|
|
8519
8834
|
`absolute-voice-routing-status--${model.status}`,
|
|
8520
8835
|
className
|
|
8521
8836
|
].filter(Boolean).join(" "),
|
|
8522
8837
|
children: [
|
|
8523
|
-
/* @__PURE__ */
|
|
8838
|
+
/* @__PURE__ */ jsxDEV16("header", {
|
|
8524
8839
|
className: "absolute-voice-routing-status__header",
|
|
8525
8840
|
children: [
|
|
8526
|
-
/* @__PURE__ */
|
|
8841
|
+
/* @__PURE__ */ jsxDEV16("span", {
|
|
8527
8842
|
className: "absolute-voice-routing-status__eyebrow",
|
|
8528
8843
|
children: model.title
|
|
8529
8844
|
}, undefined, false, undefined, this),
|
|
8530
|
-
/* @__PURE__ */
|
|
8845
|
+
/* @__PURE__ */ jsxDEV16("strong", {
|
|
8531
8846
|
className: "absolute-voice-routing-status__label",
|
|
8532
8847
|
children: model.label
|
|
8533
8848
|
}, undefined, false, undefined, this)
|
|
8534
8849
|
]
|
|
8535
8850
|
}, undefined, true, undefined, this),
|
|
8536
|
-
/* @__PURE__ */
|
|
8851
|
+
/* @__PURE__ */ jsxDEV16("p", {
|
|
8537
8852
|
className: "absolute-voice-routing-status__description",
|
|
8538
8853
|
children: model.description
|
|
8539
8854
|
}, undefined, false, undefined, this),
|
|
8540
|
-
model.rows.length ? /* @__PURE__ */
|
|
8855
|
+
model.rows.length ? /* @__PURE__ */ jsxDEV16("div", {
|
|
8541
8856
|
className: "absolute-voice-routing-status__grid",
|
|
8542
|
-
children: model.rows.map((row) => /* @__PURE__ */
|
|
8857
|
+
children: model.rows.map((row) => /* @__PURE__ */ jsxDEV16("div", {
|
|
8543
8858
|
children: [
|
|
8544
|
-
/* @__PURE__ */
|
|
8859
|
+
/* @__PURE__ */ jsxDEV16("span", {
|
|
8545
8860
|
children: row.label
|
|
8546
8861
|
}, undefined, false, undefined, this),
|
|
8547
|
-
/* @__PURE__ */
|
|
8862
|
+
/* @__PURE__ */ jsxDEV16("strong", {
|
|
8548
8863
|
children: row.value
|
|
8549
8864
|
}, undefined, false, undefined, this)
|
|
8550
8865
|
]
|
|
8551
8866
|
}, row.label, true, undefined, this))
|
|
8552
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
8867
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV16("p", {
|
|
8553
8868
|
className: "absolute-voice-routing-status__empty",
|
|
8554
8869
|
children: "Start a voice session to see the selected provider."
|
|
8555
8870
|
}, undefined, false, undefined, this),
|
|
8556
|
-
model.error ? /* @__PURE__ */
|
|
8871
|
+
model.error ? /* @__PURE__ */ jsxDEV16("p", {
|
|
8557
8872
|
className: "absolute-voice-routing-status__error",
|
|
8558
8873
|
children: model.error
|
|
8559
8874
|
}, undefined, false, undefined, this) : null
|
|
@@ -8641,16 +8956,16 @@ var createVoiceTraceTimelineStore = (path = "/api/voice-traces", options = {}) =
|
|
|
8641
8956
|
};
|
|
8642
8957
|
|
|
8643
8958
|
// src/client/traceTimelineWidget.ts
|
|
8644
|
-
var
|
|
8645
|
-
var
|
|
8646
|
-
var
|
|
8647
|
-
var
|
|
8959
|
+
var DEFAULT_TITLE16 = "Voice Traces";
|
|
8960
|
+
var DEFAULT_DESCRIPTION16 = "Latest call timelines with provider latency, fallbacks, handoffs, and errors from your self-hosted trace store.";
|
|
8961
|
+
var escapeHtml22 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
8962
|
+
var formatMs4 = (value) => typeof value === "number" ? `${value}ms` : "n/a";
|
|
8648
8963
|
var formatProviders = (session) => session.providers.length ? session.providers.map((provider) => provider.provider).join(", ") : "No providers";
|
|
8649
8964
|
var createVoiceTraceTimelineViewModel = (snapshot, options = {}) => {
|
|
8650
8965
|
const sessions = (snapshot.report?.sessions ?? []).slice(0, options.limit ?? 3).map((session) => ({
|
|
8651
8966
|
...session,
|
|
8652
8967
|
detailHref: `${options.detailBasePath ?? "/traces"}/${encodeURIComponent(session.sessionId)}`,
|
|
8653
|
-
durationLabel:
|
|
8968
|
+
durationLabel: formatMs4(session.summary.callDurationMs),
|
|
8654
8969
|
incidentBundleHref: options.incidentBundleBasePath === false ? undefined : `${options.incidentBundleBasePath ?? "/voice-incidents"}/${encodeURIComponent(session.sessionId)}/markdown`,
|
|
8655
8970
|
label: `${session.summary.eventCount} events / ${session.summary.turnCount} turns`,
|
|
8656
8971
|
operationsRecordHref: options.operationsRecordBasePath === false ? undefined : `${options.operationsRecordBasePath ?? "/voice-operations"}/${encodeURIComponent(session.sessionId)}`,
|
|
@@ -8659,13 +8974,13 @@ var createVoiceTraceTimelineViewModel = (snapshot, options = {}) => {
|
|
|
8659
8974
|
const failed = sessions.filter((session) => session.status === "failed").length;
|
|
8660
8975
|
const warnings = sessions.filter((session) => session.status === "warning").length;
|
|
8661
8976
|
return {
|
|
8662
|
-
description: options.description ??
|
|
8977
|
+
description: options.description ?? DEFAULT_DESCRIPTION16,
|
|
8663
8978
|
error: snapshot.error,
|
|
8664
8979
|
isLoading: snapshot.isLoading,
|
|
8665
8980
|
label: snapshot.error ? "Unavailable" : failed > 0 ? `${failed} failed` : warnings > 0 ? `${warnings} warning` : sessions.length ? `${sessions.length} recent` : snapshot.isLoading ? "Checking" : "No traces yet",
|
|
8666
8981
|
sessions,
|
|
8667
8982
|
status: snapshot.error ? "error" : failed > 0 ? "failed" : warnings > 0 ? "warning" : sessions.length ? "ready" : snapshot.isLoading ? "loading" : "empty",
|
|
8668
|
-
title: options.title ??
|
|
8983
|
+
title: options.title ?? DEFAULT_TITLE16,
|
|
8669
8984
|
updatedAt: snapshot.updatedAt
|
|
8670
8985
|
};
|
|
8671
8986
|
};
|
|
@@ -8673,27 +8988,27 @@ var renderVoiceTraceTimelineWidgetHTML = (snapshot, options = {}) => {
|
|
|
8673
8988
|
const model = createVoiceTraceTimelineViewModel(snapshot, options);
|
|
8674
8989
|
const sessions = model.sessions.length ? `<div class="absolute-voice-trace-timeline__sessions">${model.sessions.map((session) => {
|
|
8675
8990
|
const supportLinks = [
|
|
8676
|
-
`<a href="${
|
|
8677
|
-
session.operationsRecordHref ? `<a href="${
|
|
8678
|
-
session.incidentBundleHref ? `<a href="${
|
|
8991
|
+
`<a href="${escapeHtml22(session.detailHref)}">Open timeline</a>`,
|
|
8992
|
+
session.operationsRecordHref ? `<a href="${escapeHtml22(session.operationsRecordHref)}">Open operations record</a>` : undefined,
|
|
8993
|
+
session.incidentBundleHref ? `<a href="${escapeHtml22(session.incidentBundleHref)}">Export incident bundle</a>` : undefined
|
|
8679
8994
|
].filter(Boolean).join("");
|
|
8680
|
-
return `<article class="absolute-voice-trace-timeline__session absolute-voice-trace-timeline__session--${
|
|
8995
|
+
return `<article class="absolute-voice-trace-timeline__session absolute-voice-trace-timeline__session--${escapeHtml22(session.status)}">
|
|
8681
8996
|
<header>
|
|
8682
|
-
<strong>${
|
|
8683
|
-
<span>${
|
|
8997
|
+
<strong>${escapeHtml22(session.sessionId)}</strong>
|
|
8998
|
+
<span>${escapeHtml22(session.status)}</span>
|
|
8684
8999
|
</header>
|
|
8685
|
-
<p>${
|
|
9000
|
+
<p>${escapeHtml22(session.label)} \xB7 ${escapeHtml22(session.durationLabel)} \xB7 ${escapeHtml22(session.providerLabel)}</p>
|
|
8686
9001
|
<p class="absolute-voice-trace-timeline__actions">${supportLinks}</p>
|
|
8687
9002
|
</article>`;
|
|
8688
9003
|
}).join("")}</div>` : '<p class="absolute-voice-trace-timeline__empty">Run a voice session to see call timelines.</p>';
|
|
8689
|
-
return `<section class="absolute-voice-trace-timeline absolute-voice-trace-timeline--${
|
|
9004
|
+
return `<section class="absolute-voice-trace-timeline absolute-voice-trace-timeline--${escapeHtml22(model.status)}">
|
|
8690
9005
|
<header class="absolute-voice-trace-timeline__header">
|
|
8691
|
-
<span class="absolute-voice-trace-timeline__eyebrow">${
|
|
8692
|
-
<strong class="absolute-voice-trace-timeline__label">${
|
|
9006
|
+
<span class="absolute-voice-trace-timeline__eyebrow">${escapeHtml22(model.title)}</span>
|
|
9007
|
+
<strong class="absolute-voice-trace-timeline__label">${escapeHtml22(model.label)}</strong>
|
|
8693
9008
|
</header>
|
|
8694
|
-
<p class="absolute-voice-trace-timeline__description">${
|
|
9009
|
+
<p class="absolute-voice-trace-timeline__description">${escapeHtml22(model.description)}</p>
|
|
8695
9010
|
${sessions}
|
|
8696
|
-
${model.error ? `<p class="absolute-voice-trace-timeline__error">${
|
|
9011
|
+
${model.error ? `<p class="absolute-voice-trace-timeline__error">${escapeHtml22(model.error)}</p>` : ""}
|
|
8697
9012
|
</section>`;
|
|
8698
9013
|
};
|
|
8699
9014
|
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}`;
|
|
@@ -8740,25 +9055,25 @@ var defineVoiceTraceTimelineElement = (tagName = "absolute-voice-trace-timeline"
|
|
|
8740
9055
|
};
|
|
8741
9056
|
|
|
8742
9057
|
// src/react/useVoiceTraceTimeline.tsx
|
|
8743
|
-
import { useEffect as
|
|
9058
|
+
import { useEffect as useEffect17, useRef as useRef17, useSyncExternalStore as useSyncExternalStore17 } from "react";
|
|
8744
9059
|
var useVoiceTraceTimeline = (path = "/api/voice-traces", options = {}) => {
|
|
8745
|
-
const storeRef =
|
|
9060
|
+
const storeRef = useRef17(null);
|
|
8746
9061
|
if (!storeRef.current) {
|
|
8747
9062
|
storeRef.current = createVoiceTraceTimelineStore(path, options);
|
|
8748
9063
|
}
|
|
8749
9064
|
const store = storeRef.current;
|
|
8750
|
-
|
|
9065
|
+
useEffect17(() => {
|
|
8751
9066
|
store.refresh().catch(() => {});
|
|
8752
9067
|
return () => store.close();
|
|
8753
9068
|
}, [store]);
|
|
8754
9069
|
return {
|
|
8755
|
-
...
|
|
9070
|
+
...useSyncExternalStore17(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
8756
9071
|
refresh: store.refresh
|
|
8757
9072
|
};
|
|
8758
9073
|
};
|
|
8759
9074
|
|
|
8760
9075
|
// src/react/VoiceTraceTimeline.tsx
|
|
8761
|
-
import { jsxDEV as
|
|
9076
|
+
import { jsxDEV as jsxDEV17 } from "react/jsx-dev-runtime";
|
|
8762
9077
|
var VoiceTraceTimeline = ({
|
|
8763
9078
|
className,
|
|
8764
9079
|
path = "/api/voice-traces",
|
|
@@ -8766,49 +9081,49 @@ var VoiceTraceTimeline = ({
|
|
|
8766
9081
|
}) => {
|
|
8767
9082
|
const snapshot = useVoiceTraceTimeline(path, options);
|
|
8768
9083
|
const model = createVoiceTraceTimelineViewModel(snapshot, options);
|
|
8769
|
-
return /* @__PURE__ */
|
|
9084
|
+
return /* @__PURE__ */ jsxDEV17("section", {
|
|
8770
9085
|
className: [
|
|
8771
9086
|
"absolute-voice-trace-timeline",
|
|
8772
9087
|
`absolute-voice-trace-timeline--${model.status}`,
|
|
8773
9088
|
className
|
|
8774
9089
|
].filter(Boolean).join(" "),
|
|
8775
9090
|
children: [
|
|
8776
|
-
/* @__PURE__ */
|
|
9091
|
+
/* @__PURE__ */ jsxDEV17("header", {
|
|
8777
9092
|
className: "absolute-voice-trace-timeline__header",
|
|
8778
9093
|
children: [
|
|
8779
|
-
/* @__PURE__ */
|
|
9094
|
+
/* @__PURE__ */ jsxDEV17("span", {
|
|
8780
9095
|
className: "absolute-voice-trace-timeline__eyebrow",
|
|
8781
9096
|
children: model.title
|
|
8782
9097
|
}, undefined, false, undefined, this),
|
|
8783
|
-
/* @__PURE__ */
|
|
9098
|
+
/* @__PURE__ */ jsxDEV17("strong", {
|
|
8784
9099
|
className: "absolute-voice-trace-timeline__label",
|
|
8785
9100
|
children: model.label
|
|
8786
9101
|
}, undefined, false, undefined, this)
|
|
8787
9102
|
]
|
|
8788
9103
|
}, undefined, true, undefined, this),
|
|
8789
|
-
/* @__PURE__ */
|
|
9104
|
+
/* @__PURE__ */ jsxDEV17("p", {
|
|
8790
9105
|
className: "absolute-voice-trace-timeline__description",
|
|
8791
9106
|
children: model.description
|
|
8792
9107
|
}, undefined, false, undefined, this),
|
|
8793
|
-
model.sessions.length ? /* @__PURE__ */
|
|
9108
|
+
model.sessions.length ? /* @__PURE__ */ jsxDEV17("div", {
|
|
8794
9109
|
className: "absolute-voice-trace-timeline__sessions",
|
|
8795
|
-
children: model.sessions.map((session) => /* @__PURE__ */
|
|
9110
|
+
children: model.sessions.map((session) => /* @__PURE__ */ jsxDEV17("article", {
|
|
8796
9111
|
className: [
|
|
8797
9112
|
"absolute-voice-trace-timeline__session",
|
|
8798
9113
|
`absolute-voice-trace-timeline__session--${session.status}`
|
|
8799
9114
|
].join(" "),
|
|
8800
9115
|
children: [
|
|
8801
|
-
/* @__PURE__ */
|
|
9116
|
+
/* @__PURE__ */ jsxDEV17("header", {
|
|
8802
9117
|
children: [
|
|
8803
|
-
/* @__PURE__ */
|
|
9118
|
+
/* @__PURE__ */ jsxDEV17("strong", {
|
|
8804
9119
|
children: session.sessionId
|
|
8805
9120
|
}, undefined, false, undefined, this),
|
|
8806
|
-
/* @__PURE__ */
|
|
9121
|
+
/* @__PURE__ */ jsxDEV17("span", {
|
|
8807
9122
|
children: session.status
|
|
8808
9123
|
}, undefined, false, undefined, this)
|
|
8809
9124
|
]
|
|
8810
9125
|
}, undefined, true, undefined, this),
|
|
8811
|
-
/* @__PURE__ */
|
|
9126
|
+
/* @__PURE__ */ jsxDEV17("p", {
|
|
8812
9127
|
children: [
|
|
8813
9128
|
session.label,
|
|
8814
9129
|
" \xB7 ",
|
|
@@ -8818,18 +9133,18 @@ var VoiceTraceTimeline = ({
|
|
|
8818
9133
|
session.providerLabel
|
|
8819
9134
|
]
|
|
8820
9135
|
}, undefined, true, undefined, this),
|
|
8821
|
-
/* @__PURE__ */
|
|
9136
|
+
/* @__PURE__ */ jsxDEV17("p", {
|
|
8822
9137
|
className: "absolute-voice-trace-timeline__actions",
|
|
8823
9138
|
children: [
|
|
8824
|
-
/* @__PURE__ */
|
|
9139
|
+
/* @__PURE__ */ jsxDEV17("a", {
|
|
8825
9140
|
href: session.detailHref,
|
|
8826
9141
|
children: "Open timeline"
|
|
8827
9142
|
}, undefined, false, undefined, this),
|
|
8828
|
-
session.operationsRecordHref ? /* @__PURE__ */
|
|
9143
|
+
session.operationsRecordHref ? /* @__PURE__ */ jsxDEV17("a", {
|
|
8829
9144
|
href: session.operationsRecordHref,
|
|
8830
9145
|
children: "Open operations record"
|
|
8831
9146
|
}, undefined, false, undefined, this) : null,
|
|
8832
|
-
session.incidentBundleHref ? /* @__PURE__ */
|
|
9147
|
+
session.incidentBundleHref ? /* @__PURE__ */ jsxDEV17("a", {
|
|
8833
9148
|
href: session.incidentBundleHref,
|
|
8834
9149
|
children: "Export incident bundle"
|
|
8835
9150
|
}, undefined, false, undefined, this) : null
|
|
@@ -8837,11 +9152,11 @@ var VoiceTraceTimeline = ({
|
|
|
8837
9152
|
}, undefined, true, undefined, this)
|
|
8838
9153
|
]
|
|
8839
9154
|
}, session.sessionId, true, undefined, this))
|
|
8840
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
9155
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV17("p", {
|
|
8841
9156
|
className: "absolute-voice-trace-timeline__empty",
|
|
8842
9157
|
children: "Run a voice session to see call timelines."
|
|
8843
9158
|
}, undefined, false, undefined, this),
|
|
8844
|
-
model.error ? /* @__PURE__ */
|
|
9159
|
+
model.error ? /* @__PURE__ */ jsxDEV17("p", {
|
|
8845
9160
|
className: "absolute-voice-trace-timeline__error",
|
|
8846
9161
|
children: model.error
|
|
8847
9162
|
}, undefined, false, undefined, this) : null
|
|
@@ -8849,7 +9164,7 @@ var VoiceTraceTimeline = ({
|
|
|
8849
9164
|
}, undefined, true, undefined, this);
|
|
8850
9165
|
};
|
|
8851
9166
|
// src/react/useVoiceAgentSquadStatus.tsx
|
|
8852
|
-
import { useEffect as
|
|
9167
|
+
import { useEffect as useEffect18, useRef as useRef18, useSyncExternalStore as useSyncExternalStore18 } from "react";
|
|
8853
9168
|
|
|
8854
9169
|
// src/client/agentSquadStatus.ts
|
|
8855
9170
|
var getString4 = (value) => typeof value === "string" && value.trim() ? value.trim() : undefined;
|
|
@@ -8927,25 +9242,25 @@ var createVoiceAgentSquadStatusStore = (path = "/api/voice-traces", options = {}
|
|
|
8927
9242
|
|
|
8928
9243
|
// src/react/useVoiceAgentSquadStatus.tsx
|
|
8929
9244
|
var useVoiceAgentSquadStatus = (path = "/api/voice-traces", options = {}) => {
|
|
8930
|
-
const storeRef =
|
|
9245
|
+
const storeRef = useRef18(null);
|
|
8931
9246
|
if (!storeRef.current) {
|
|
8932
9247
|
storeRef.current = createVoiceAgentSquadStatusStore(path, options);
|
|
8933
9248
|
}
|
|
8934
9249
|
const store = storeRef.current;
|
|
8935
|
-
|
|
9250
|
+
useEffect18(() => {
|
|
8936
9251
|
store.refresh().catch(() => {});
|
|
8937
9252
|
return () => store.close();
|
|
8938
9253
|
}, [store]);
|
|
8939
9254
|
return {
|
|
8940
|
-
...
|
|
9255
|
+
...useSyncExternalStore18(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
8941
9256
|
refresh: store.refresh
|
|
8942
9257
|
};
|
|
8943
9258
|
};
|
|
8944
9259
|
|
|
8945
9260
|
// src/client/agentSquadStatusWidget.ts
|
|
8946
|
-
var
|
|
8947
|
-
var
|
|
8948
|
-
var
|
|
9261
|
+
var DEFAULT_TITLE17 = "Voice Agent Squad";
|
|
9262
|
+
var DEFAULT_DESCRIPTION17 = "Current specialist and recent handoffs from your self-hosted voice traces.";
|
|
9263
|
+
var escapeHtml23 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
8949
9264
|
var labelFor = (current) => {
|
|
8950
9265
|
if (!current)
|
|
8951
9266
|
return "Waiting for specialist activity";
|
|
@@ -8959,37 +9274,37 @@ var labelFor = (current) => {
|
|
|
8959
9274
|
};
|
|
8960
9275
|
var createVoiceAgentSquadStatusViewModel = (snapshot, options = {}) => ({
|
|
8961
9276
|
current: snapshot.report.current,
|
|
8962
|
-
description: options.description ??
|
|
9277
|
+
description: options.description ?? DEFAULT_DESCRIPTION17,
|
|
8963
9278
|
error: snapshot.error,
|
|
8964
9279
|
isLoading: snapshot.isLoading,
|
|
8965
9280
|
label: snapshot.error ? "Unavailable" : labelFor(snapshot.report.current),
|
|
8966
9281
|
sessionCount: snapshot.report.sessionCount,
|
|
8967
9282
|
sessions: snapshot.report.sessions,
|
|
8968
|
-
title: options.title ??
|
|
9283
|
+
title: options.title ?? DEFAULT_TITLE17,
|
|
8969
9284
|
updatedAt: snapshot.updatedAt
|
|
8970
9285
|
});
|
|
8971
9286
|
var renderVoiceAgentSquadStatusHTML = (snapshot, options = {}) => {
|
|
8972
9287
|
const model = createVoiceAgentSquadStatusViewModel(snapshot, options);
|
|
8973
9288
|
const current = model.current;
|
|
8974
9289
|
const rows = model.sessions.length ? model.sessions.slice(0, 5).map((session) => `<li>
|
|
8975
|
-
<span>${
|
|
8976
|
-
<strong>${
|
|
8977
|
-
<em>${
|
|
8978
|
-
${session.summary || session.reason ? `<p>${
|
|
9290
|
+
<span>${escapeHtml23(session.sessionId)}</span>
|
|
9291
|
+
<strong>${escapeHtml23(session.targetAgentId ?? "none")}</strong>
|
|
9292
|
+
<em>${escapeHtml23(session.status)}</em>
|
|
9293
|
+
${session.summary || session.reason ? `<p>${escapeHtml23(session.summary ?? session.reason ?? "")}</p>` : ""}
|
|
8979
9294
|
</li>`).join("") : "<li><span>No squad traces yet.</span><strong>Waiting</strong></li>";
|
|
8980
9295
|
return `<section class="absolute-voice-agent-squad-status">
|
|
8981
9296
|
<header>
|
|
8982
|
-
<span>${
|
|
8983
|
-
<strong>${
|
|
9297
|
+
<span>${escapeHtml23(model.title)}</span>
|
|
9298
|
+
<strong>${escapeHtml23(model.label)}</strong>
|
|
8984
9299
|
</header>
|
|
8985
|
-
<p>${
|
|
9300
|
+
<p>${escapeHtml23(model.description)}</p>
|
|
8986
9301
|
<div>
|
|
8987
|
-
<span>Session</span><strong>${
|
|
8988
|
-
<span>From</span><strong>${
|
|
8989
|
-
<span>Status</span><strong>${
|
|
9302
|
+
<span>Session</span><strong>${escapeHtml23(current?.sessionId ?? "n/a")}</strong>
|
|
9303
|
+
<span>From</span><strong>${escapeHtml23(current?.fromAgentId ?? "n/a")}</strong>
|
|
9304
|
+
<span>Status</span><strong>${escapeHtml23(current?.status ?? "idle")}</strong>
|
|
8990
9305
|
</div>
|
|
8991
9306
|
<ul>${rows}</ul>
|
|
8992
|
-
${model.error ? `<p class="absolute-voice-agent-squad-status__error">${
|
|
9307
|
+
${model.error ? `<p class="absolute-voice-agent-squad-status__error">${escapeHtml23(model.error)}</p>` : ""}
|
|
8993
9308
|
</section>`;
|
|
8994
9309
|
};
|
|
8995
9310
|
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}`;
|
|
@@ -9034,7 +9349,7 @@ var defineVoiceAgentSquadStatusElement = (tagName = "absolute-voice-agent-squad-
|
|
|
9034
9349
|
};
|
|
9035
9350
|
|
|
9036
9351
|
// src/react/VoiceAgentSquadStatus.tsx
|
|
9037
|
-
import { jsxDEV as
|
|
9352
|
+
import { jsxDEV as jsxDEV18 } from "react/jsx-dev-runtime";
|
|
9038
9353
|
function VoiceAgentSquadStatus({
|
|
9039
9354
|
path = "/api/voice-traces",
|
|
9040
9355
|
...options
|
|
@@ -9042,64 +9357,64 @@ function VoiceAgentSquadStatus({
|
|
|
9042
9357
|
const snapshot = useVoiceAgentSquadStatus(path, options);
|
|
9043
9358
|
const model = createVoiceAgentSquadStatusViewModel(snapshot, options);
|
|
9044
9359
|
const current = model.current;
|
|
9045
|
-
return /* @__PURE__ */
|
|
9360
|
+
return /* @__PURE__ */ jsxDEV18("section", {
|
|
9046
9361
|
className: "absolute-voice-agent-squad-status",
|
|
9047
9362
|
children: [
|
|
9048
|
-
/* @__PURE__ */
|
|
9363
|
+
/* @__PURE__ */ jsxDEV18("header", {
|
|
9049
9364
|
children: [
|
|
9050
|
-
/* @__PURE__ */
|
|
9365
|
+
/* @__PURE__ */ jsxDEV18("span", {
|
|
9051
9366
|
children: model.title
|
|
9052
9367
|
}, undefined, false, undefined, this),
|
|
9053
|
-
/* @__PURE__ */
|
|
9368
|
+
/* @__PURE__ */ jsxDEV18("strong", {
|
|
9054
9369
|
children: model.label
|
|
9055
9370
|
}, undefined, false, undefined, this)
|
|
9056
9371
|
]
|
|
9057
9372
|
}, undefined, true, undefined, this),
|
|
9058
|
-
/* @__PURE__ */
|
|
9373
|
+
/* @__PURE__ */ jsxDEV18("p", {
|
|
9059
9374
|
children: model.description
|
|
9060
9375
|
}, undefined, false, undefined, this),
|
|
9061
|
-
/* @__PURE__ */
|
|
9376
|
+
/* @__PURE__ */ jsxDEV18("dl", {
|
|
9062
9377
|
children: [
|
|
9063
|
-
/* @__PURE__ */
|
|
9378
|
+
/* @__PURE__ */ jsxDEV18("div", {
|
|
9064
9379
|
children: [
|
|
9065
|
-
/* @__PURE__ */
|
|
9380
|
+
/* @__PURE__ */ jsxDEV18("dt", {
|
|
9066
9381
|
children: "Session"
|
|
9067
9382
|
}, undefined, false, undefined, this),
|
|
9068
|
-
/* @__PURE__ */
|
|
9383
|
+
/* @__PURE__ */ jsxDEV18("dd", {
|
|
9069
9384
|
children: current?.sessionId ?? "n/a"
|
|
9070
9385
|
}, undefined, false, undefined, this)
|
|
9071
9386
|
]
|
|
9072
9387
|
}, undefined, true, undefined, this),
|
|
9073
|
-
/* @__PURE__ */
|
|
9388
|
+
/* @__PURE__ */ jsxDEV18("div", {
|
|
9074
9389
|
children: [
|
|
9075
|
-
/* @__PURE__ */
|
|
9390
|
+
/* @__PURE__ */ jsxDEV18("dt", {
|
|
9076
9391
|
children: "Current specialist"
|
|
9077
9392
|
}, undefined, false, undefined, this),
|
|
9078
|
-
/* @__PURE__ */
|
|
9393
|
+
/* @__PURE__ */ jsxDEV18("dd", {
|
|
9079
9394
|
children: current?.targetAgentId ?? "none"
|
|
9080
9395
|
}, undefined, false, undefined, this)
|
|
9081
9396
|
]
|
|
9082
9397
|
}, undefined, true, undefined, this),
|
|
9083
|
-
/* @__PURE__ */
|
|
9398
|
+
/* @__PURE__ */ jsxDEV18("div", {
|
|
9084
9399
|
children: [
|
|
9085
|
-
/* @__PURE__ */
|
|
9400
|
+
/* @__PURE__ */ jsxDEV18("dt", {
|
|
9086
9401
|
children: "Status"
|
|
9087
9402
|
}, undefined, false, undefined, this),
|
|
9088
|
-
/* @__PURE__ */
|
|
9403
|
+
/* @__PURE__ */ jsxDEV18("dd", {
|
|
9089
9404
|
children: current?.status ?? "idle"
|
|
9090
9405
|
}, undefined, false, undefined, this)
|
|
9091
9406
|
]
|
|
9092
9407
|
}, undefined, true, undefined, this)
|
|
9093
9408
|
]
|
|
9094
9409
|
}, undefined, true, undefined, this),
|
|
9095
|
-
model.error ? /* @__PURE__ */
|
|
9410
|
+
model.error ? /* @__PURE__ */ jsxDEV18("p", {
|
|
9096
9411
|
children: model.error
|
|
9097
9412
|
}, undefined, false, undefined, this) : null
|
|
9098
9413
|
]
|
|
9099
9414
|
}, undefined, true, undefined, this);
|
|
9100
9415
|
}
|
|
9101
9416
|
// src/react/useVoiceTurnLatency.tsx
|
|
9102
|
-
import { useEffect as
|
|
9417
|
+
import { useEffect as useEffect19, useRef as useRef19, useSyncExternalStore as useSyncExternalStore19 } from "react";
|
|
9103
9418
|
|
|
9104
9419
|
// src/client/turnLatency.ts
|
|
9105
9420
|
var fetchVoiceTurnLatency = async (path = "/api/turn-latency", options = {}) => {
|
|
@@ -9206,73 +9521,73 @@ var createVoiceTurnLatencyStore = (path = "/api/turn-latency", options = {}) =>
|
|
|
9206
9521
|
|
|
9207
9522
|
// src/react/useVoiceTurnLatency.tsx
|
|
9208
9523
|
var useVoiceTurnLatency = (path = "/api/turn-latency", options = {}) => {
|
|
9209
|
-
const storeRef =
|
|
9524
|
+
const storeRef = useRef19(null);
|
|
9210
9525
|
if (!storeRef.current) {
|
|
9211
9526
|
storeRef.current = createVoiceTurnLatencyStore(path, options);
|
|
9212
9527
|
}
|
|
9213
9528
|
const store = storeRef.current;
|
|
9214
|
-
|
|
9529
|
+
useEffect19(() => {
|
|
9215
9530
|
store.refresh().catch(() => {});
|
|
9216
9531
|
return () => store.close();
|
|
9217
9532
|
}, [store]);
|
|
9218
9533
|
return {
|
|
9219
|
-
...
|
|
9534
|
+
...useSyncExternalStore19(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
9220
9535
|
refresh: store.refresh,
|
|
9221
9536
|
runProof: store.runProof
|
|
9222
9537
|
};
|
|
9223
9538
|
};
|
|
9224
9539
|
|
|
9225
9540
|
// src/client/turnLatencyWidget.ts
|
|
9226
|
-
var
|
|
9227
|
-
var
|
|
9541
|
+
var DEFAULT_TITLE18 = "Turn Latency";
|
|
9542
|
+
var DEFAULT_DESCRIPTION18 = "Per-turn timing from first transcript to commit and assistant response start.";
|
|
9228
9543
|
var DEFAULT_PROOF_LABEL = "Run latency proof";
|
|
9229
|
-
var
|
|
9230
|
-
var
|
|
9544
|
+
var escapeHtml24 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
9545
|
+
var formatMs5 = (value) => typeof value === "number" ? `${Math.round(value)}ms` : "n/a";
|
|
9231
9546
|
var createVoiceTurnLatencyViewModel = (snapshot, options = {}) => {
|
|
9232
9547
|
const turns = (snapshot.report?.turns ?? []).map((turn) => ({
|
|
9233
9548
|
...turn,
|
|
9234
9549
|
label: turn.text || "Empty turn",
|
|
9235
9550
|
rows: turn.stages.map((stage) => ({
|
|
9236
9551
|
label: stage.label,
|
|
9237
|
-
value:
|
|
9552
|
+
value: formatMs5(stage.valueMs)
|
|
9238
9553
|
}))
|
|
9239
9554
|
}));
|
|
9240
9555
|
const warningCount = snapshot.report?.warnings ?? turns.filter((turn) => turn.status === "warn").length;
|
|
9241
9556
|
const failedCount = snapshot.report?.failed ?? turns.filter((turn) => turn.status === "fail").length;
|
|
9242
9557
|
return {
|
|
9243
|
-
description: options.description ??
|
|
9558
|
+
description: options.description ?? DEFAULT_DESCRIPTION18,
|
|
9244
9559
|
error: snapshot.error,
|
|
9245
9560
|
isLoading: snapshot.isLoading,
|
|
9246
|
-
label: snapshot.error ? "Unavailable" : turns.length ? failedCount > 0 ? `${failedCount} slow` : warningCount > 0 ? `${warningCount} warnings` : `avg ${
|
|
9561
|
+
label: snapshot.error ? "Unavailable" : turns.length ? failedCount > 0 ? `${failedCount} slow` : warningCount > 0 ? `${warningCount} warnings` : `avg ${formatMs5(snapshot.report?.averageTotalMs)}` : snapshot.isLoading ? "Checking" : "No turns",
|
|
9247
9562
|
proofLabel: options.proofPath ? options.proofLabel ?? DEFAULT_PROOF_LABEL : undefined,
|
|
9248
9563
|
showProofAction: Boolean(options.proofPath),
|
|
9249
9564
|
status: snapshot.error ? "error" : turns.length ? failedCount > 0 || warningCount > 0 ? "warning" : "ready" : snapshot.isLoading ? "loading" : "empty",
|
|
9250
|
-
title: options.title ??
|
|
9565
|
+
title: options.title ?? DEFAULT_TITLE18,
|
|
9251
9566
|
turns,
|
|
9252
9567
|
updatedAt: snapshot.updatedAt
|
|
9253
9568
|
};
|
|
9254
9569
|
};
|
|
9255
9570
|
var renderVoiceTurnLatencyHTML = (snapshot, options = {}) => {
|
|
9256
9571
|
const model = createVoiceTurnLatencyViewModel(snapshot, options);
|
|
9257
|
-
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--${
|
|
9572
|
+
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--${escapeHtml24(turn.status)}">
|
|
9258
9573
|
<header>
|
|
9259
|
-
<strong>${
|
|
9260
|
-
<span>${
|
|
9574
|
+
<strong>${escapeHtml24(turn.label)}</strong>
|
|
9575
|
+
<span>${escapeHtml24(turn.status)}</span>
|
|
9261
9576
|
</header>
|
|
9262
9577
|
<dl>${turn.rows.map((row) => `<div>
|
|
9263
|
-
<dt>${
|
|
9264
|
-
<dd>${
|
|
9578
|
+
<dt>${escapeHtml24(row.label)}</dt>
|
|
9579
|
+
<dd>${escapeHtml24(row.value)}</dd>
|
|
9265
9580
|
</div>`).join("")}</dl>
|
|
9266
9581
|
</article>`).join("")}</div>` : '<p class="absolute-voice-turn-latency__empty">Complete a voice turn to see latency diagnostics.</p>';
|
|
9267
|
-
return `<section class="absolute-voice-turn-latency absolute-voice-turn-latency--${
|
|
9582
|
+
return `<section class="absolute-voice-turn-latency absolute-voice-turn-latency--${escapeHtml24(model.status)}">
|
|
9268
9583
|
<header class="absolute-voice-turn-latency__header">
|
|
9269
|
-
<span class="absolute-voice-turn-latency__eyebrow">${
|
|
9270
|
-
<strong class="absolute-voice-turn-latency__label">${
|
|
9584
|
+
<span class="absolute-voice-turn-latency__eyebrow">${escapeHtml24(model.title)}</span>
|
|
9585
|
+
<strong class="absolute-voice-turn-latency__label">${escapeHtml24(model.label)}</strong>
|
|
9271
9586
|
</header>
|
|
9272
|
-
<p class="absolute-voice-turn-latency__description">${
|
|
9273
|
-
${model.showProofAction ? `<button class="absolute-voice-turn-latency__proof" data-absolute-voice-turn-latency-proof type="button">${
|
|
9587
|
+
<p class="absolute-voice-turn-latency__description">${escapeHtml24(model.description)}</p>
|
|
9588
|
+
${model.showProofAction ? `<button class="absolute-voice-turn-latency__proof" data-absolute-voice-turn-latency-proof type="button">${escapeHtml24(model.proofLabel ?? DEFAULT_PROOF_LABEL)}</button>` : ""}
|
|
9274
9589
|
${turns}
|
|
9275
|
-
${model.error ? `<p class="absolute-voice-turn-latency__error">${
|
|
9590
|
+
${model.error ? `<p class="absolute-voice-turn-latency__error">${escapeHtml24(model.error)}</p>` : ""}
|
|
9276
9591
|
</section>`;
|
|
9277
9592
|
};
|
|
9278
9593
|
var mountVoiceTurnLatency = (element, path = "/api/turn-latency", options = {}) => {
|
|
@@ -9323,7 +9638,7 @@ var defineVoiceTurnLatencyElement = (tagName = "absolute-voice-turn-latency") =>
|
|
|
9323
9638
|
};
|
|
9324
9639
|
|
|
9325
9640
|
// src/react/VoiceTurnLatency.tsx
|
|
9326
|
-
import { jsxDEV as
|
|
9641
|
+
import { jsxDEV as jsxDEV19 } from "react/jsx-dev-runtime";
|
|
9327
9642
|
var VoiceTurnLatency = ({
|
|
9328
9643
|
className,
|
|
9329
9644
|
path = "/api/turn-latency",
|
|
@@ -9331,31 +9646,31 @@ var VoiceTurnLatency = ({
|
|
|
9331
9646
|
}) => {
|
|
9332
9647
|
const latency = useVoiceTurnLatency(path, options);
|
|
9333
9648
|
const model = createVoiceTurnLatencyViewModel(latency, options);
|
|
9334
|
-
return /* @__PURE__ */
|
|
9649
|
+
return /* @__PURE__ */ jsxDEV19("section", {
|
|
9335
9650
|
className: [
|
|
9336
9651
|
"absolute-voice-turn-latency",
|
|
9337
9652
|
`absolute-voice-turn-latency--${model.status}`,
|
|
9338
9653
|
className
|
|
9339
9654
|
].filter(Boolean).join(" "),
|
|
9340
9655
|
children: [
|
|
9341
|
-
/* @__PURE__ */
|
|
9656
|
+
/* @__PURE__ */ jsxDEV19("header", {
|
|
9342
9657
|
className: "absolute-voice-turn-latency__header",
|
|
9343
9658
|
children: [
|
|
9344
|
-
/* @__PURE__ */
|
|
9659
|
+
/* @__PURE__ */ jsxDEV19("span", {
|
|
9345
9660
|
className: "absolute-voice-turn-latency__eyebrow",
|
|
9346
9661
|
children: model.title
|
|
9347
9662
|
}, undefined, false, undefined, this),
|
|
9348
|
-
/* @__PURE__ */
|
|
9663
|
+
/* @__PURE__ */ jsxDEV19("strong", {
|
|
9349
9664
|
className: "absolute-voice-turn-latency__label",
|
|
9350
9665
|
children: model.label
|
|
9351
9666
|
}, undefined, false, undefined, this)
|
|
9352
9667
|
]
|
|
9353
9668
|
}, undefined, true, undefined, this),
|
|
9354
|
-
/* @__PURE__ */
|
|
9669
|
+
/* @__PURE__ */ jsxDEV19("p", {
|
|
9355
9670
|
className: "absolute-voice-turn-latency__description",
|
|
9356
9671
|
children: model.description
|
|
9357
9672
|
}, undefined, false, undefined, this),
|
|
9358
|
-
model.showProofAction ? /* @__PURE__ */
|
|
9673
|
+
model.showProofAction ? /* @__PURE__ */ jsxDEV19("button", {
|
|
9359
9674
|
className: "absolute-voice-turn-latency__proof",
|
|
9360
9675
|
onClick: () => {
|
|
9361
9676
|
latency.runProof().catch(() => {});
|
|
@@ -9363,31 +9678,31 @@ var VoiceTurnLatency = ({
|
|
|
9363
9678
|
type: "button",
|
|
9364
9679
|
children: model.proofLabel
|
|
9365
9680
|
}, undefined, false, undefined, this) : null,
|
|
9366
|
-
model.turns.length ? /* @__PURE__ */
|
|
9681
|
+
model.turns.length ? /* @__PURE__ */ jsxDEV19("div", {
|
|
9367
9682
|
className: "absolute-voice-turn-latency__turns",
|
|
9368
|
-
children: model.turns.map((turn) => /* @__PURE__ */
|
|
9683
|
+
children: model.turns.map((turn) => /* @__PURE__ */ jsxDEV19("article", {
|
|
9369
9684
|
className: [
|
|
9370
9685
|
"absolute-voice-turn-latency__turn",
|
|
9371
9686
|
`absolute-voice-turn-latency__turn--${turn.status}`
|
|
9372
9687
|
].join(" "),
|
|
9373
9688
|
children: [
|
|
9374
|
-
/* @__PURE__ */
|
|
9689
|
+
/* @__PURE__ */ jsxDEV19("header", {
|
|
9375
9690
|
children: [
|
|
9376
|
-
/* @__PURE__ */
|
|
9691
|
+
/* @__PURE__ */ jsxDEV19("strong", {
|
|
9377
9692
|
children: turn.label
|
|
9378
9693
|
}, undefined, false, undefined, this),
|
|
9379
|
-
/* @__PURE__ */
|
|
9694
|
+
/* @__PURE__ */ jsxDEV19("span", {
|
|
9380
9695
|
children: turn.status
|
|
9381
9696
|
}, undefined, false, undefined, this)
|
|
9382
9697
|
]
|
|
9383
9698
|
}, undefined, true, undefined, this),
|
|
9384
|
-
/* @__PURE__ */
|
|
9385
|
-
children: turn.rows.map((row) => /* @__PURE__ */
|
|
9699
|
+
/* @__PURE__ */ jsxDEV19("dl", {
|
|
9700
|
+
children: turn.rows.map((row) => /* @__PURE__ */ jsxDEV19("div", {
|
|
9386
9701
|
children: [
|
|
9387
|
-
/* @__PURE__ */
|
|
9702
|
+
/* @__PURE__ */ jsxDEV19("dt", {
|
|
9388
9703
|
children: row.label
|
|
9389
9704
|
}, undefined, false, undefined, this),
|
|
9390
|
-
/* @__PURE__ */
|
|
9705
|
+
/* @__PURE__ */ jsxDEV19("dd", {
|
|
9391
9706
|
children: row.value
|
|
9392
9707
|
}, undefined, false, undefined, this)
|
|
9393
9708
|
]
|
|
@@ -9395,11 +9710,11 @@ var VoiceTurnLatency = ({
|
|
|
9395
9710
|
}, undefined, false, undefined, this)
|
|
9396
9711
|
]
|
|
9397
9712
|
}, `${turn.sessionId}:${turn.turnId}`, true, undefined, this))
|
|
9398
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
9713
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV19("p", {
|
|
9399
9714
|
className: "absolute-voice-turn-latency__empty",
|
|
9400
9715
|
children: "Complete a voice turn to see latency diagnostics."
|
|
9401
9716
|
}, undefined, false, undefined, this),
|
|
9402
|
-
model.error ? /* @__PURE__ */
|
|
9717
|
+
model.error ? /* @__PURE__ */ jsxDEV19("p", {
|
|
9403
9718
|
className: "absolute-voice-turn-latency__error",
|
|
9404
9719
|
children: model.error
|
|
9405
9720
|
}, undefined, false, undefined, this) : null
|
|
@@ -9407,7 +9722,7 @@ var VoiceTurnLatency = ({
|
|
|
9407
9722
|
}, undefined, true, undefined, this);
|
|
9408
9723
|
};
|
|
9409
9724
|
// src/react/useVoiceTurnQuality.tsx
|
|
9410
|
-
import { useEffect as
|
|
9725
|
+
import { useEffect as useEffect20, useRef as useRef20, useSyncExternalStore as useSyncExternalStore20 } from "react";
|
|
9411
9726
|
|
|
9412
9727
|
// src/client/turnQuality.ts
|
|
9413
9728
|
var fetchVoiceTurnQuality = async (path = "/api/turn-quality", options = {}) => {
|
|
@@ -9490,25 +9805,25 @@ var createVoiceTurnQualityStore = (path = "/api/turn-quality", options = {}) =>
|
|
|
9490
9805
|
|
|
9491
9806
|
// src/react/useVoiceTurnQuality.tsx
|
|
9492
9807
|
var useVoiceTurnQuality = (path = "/api/turn-quality", options = {}) => {
|
|
9493
|
-
const storeRef =
|
|
9808
|
+
const storeRef = useRef20(null);
|
|
9494
9809
|
if (!storeRef.current) {
|
|
9495
9810
|
storeRef.current = createVoiceTurnQualityStore(path, options);
|
|
9496
9811
|
}
|
|
9497
9812
|
const store = storeRef.current;
|
|
9498
|
-
|
|
9813
|
+
useEffect20(() => {
|
|
9499
9814
|
store.refresh().catch(() => {});
|
|
9500
9815
|
return () => store.close();
|
|
9501
9816
|
}, [store]);
|
|
9502
9817
|
return {
|
|
9503
|
-
...
|
|
9818
|
+
...useSyncExternalStore20(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
9504
9819
|
refresh: store.refresh
|
|
9505
9820
|
};
|
|
9506
9821
|
};
|
|
9507
9822
|
|
|
9508
9823
|
// src/client/turnQualityWidget.ts
|
|
9509
|
-
var
|
|
9510
|
-
var
|
|
9511
|
-
var
|
|
9824
|
+
var DEFAULT_TITLE19 = "Turn Quality";
|
|
9825
|
+
var DEFAULT_DESCRIPTION19 = "Per-turn STT confidence, fallback selection, corrections, and transcript coverage.";
|
|
9826
|
+
var escapeHtml25 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
9512
9827
|
var formatConfidence = (value) => typeof value === "number" ? `${Math.round(value * 100)}%` : "n/a";
|
|
9513
9828
|
var formatMaybe = (value) => value === undefined || value === "" ? "n/a" : String(value);
|
|
9514
9829
|
var getTurnDetail = (turn) => {
|
|
@@ -9552,37 +9867,37 @@ var createVoiceTurnQualityViewModel = (snapshot, options = {}) => {
|
|
|
9552
9867
|
const warningCount = snapshot.report?.warnings ?? turns.filter((turn) => turn.status === "warn").length;
|
|
9553
9868
|
const failedCount = snapshot.report?.failed ?? turns.filter((turn) => turn.status === "fail").length;
|
|
9554
9869
|
return {
|
|
9555
|
-
description: options.description ??
|
|
9870
|
+
description: options.description ?? DEFAULT_DESCRIPTION19,
|
|
9556
9871
|
error: snapshot.error,
|
|
9557
9872
|
isLoading: snapshot.isLoading,
|
|
9558
9873
|
label: snapshot.error ? "Unavailable" : turns.length ? failedCount > 0 ? `${failedCount} failed` : warningCount > 0 ? `${warningCount} warnings` : `${turns.length} healthy` : snapshot.isLoading ? "Checking" : "No turns",
|
|
9559
9874
|
status: snapshot.error ? "error" : turns.length ? failedCount > 0 || warningCount > 0 ? "warning" : "ready" : snapshot.isLoading ? "loading" : "empty",
|
|
9560
|
-
title: options.title ??
|
|
9875
|
+
title: options.title ?? DEFAULT_TITLE19,
|
|
9561
9876
|
turns,
|
|
9562
9877
|
updatedAt: snapshot.updatedAt
|
|
9563
9878
|
};
|
|
9564
9879
|
};
|
|
9565
9880
|
var renderVoiceTurnQualityHTML = (snapshot, options = {}) => {
|
|
9566
9881
|
const model = createVoiceTurnQualityViewModel(snapshot, options);
|
|
9567
|
-
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--${
|
|
9882
|
+
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--${escapeHtml25(turn.status)}">
|
|
9568
9883
|
<header>
|
|
9569
|
-
<strong>${
|
|
9570
|
-
<span>${
|
|
9884
|
+
<strong>${escapeHtml25(turn.label)}</strong>
|
|
9885
|
+
<span>${escapeHtml25(turn.status)}</span>
|
|
9571
9886
|
</header>
|
|
9572
|
-
<p>${
|
|
9887
|
+
<p>${escapeHtml25(turn.detail)}</p>
|
|
9573
9888
|
<dl>${turn.rows.map((row) => `<div>
|
|
9574
|
-
<dt>${
|
|
9575
|
-
<dd>${
|
|
9889
|
+
<dt>${escapeHtml25(row.label)}</dt>
|
|
9890
|
+
<dd>${escapeHtml25(row.value)}</dd>
|
|
9576
9891
|
</div>`).join("")}</dl>
|
|
9577
9892
|
</article>`).join("")}</div>` : '<p class="absolute-voice-turn-quality__empty">Complete a voice turn to see STT quality diagnostics.</p>';
|
|
9578
|
-
return `<section class="absolute-voice-turn-quality absolute-voice-turn-quality--${
|
|
9893
|
+
return `<section class="absolute-voice-turn-quality absolute-voice-turn-quality--${escapeHtml25(model.status)}">
|
|
9579
9894
|
<header class="absolute-voice-turn-quality__header">
|
|
9580
|
-
<span class="absolute-voice-turn-quality__eyebrow">${
|
|
9581
|
-
<strong class="absolute-voice-turn-quality__label">${
|
|
9895
|
+
<span class="absolute-voice-turn-quality__eyebrow">${escapeHtml25(model.title)}</span>
|
|
9896
|
+
<strong class="absolute-voice-turn-quality__label">${escapeHtml25(model.label)}</strong>
|
|
9582
9897
|
</header>
|
|
9583
|
-
<p class="absolute-voice-turn-quality__description">${
|
|
9898
|
+
<p class="absolute-voice-turn-quality__description">${escapeHtml25(model.description)}</p>
|
|
9584
9899
|
${turns}
|
|
9585
|
-
${model.error ? `<p class="absolute-voice-turn-quality__error">${
|
|
9900
|
+
${model.error ? `<p class="absolute-voice-turn-quality__error">${escapeHtml25(model.error)}</p>` : ""}
|
|
9586
9901
|
</section>`;
|
|
9587
9902
|
};
|
|
9588
9903
|
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}`;
|
|
@@ -9624,7 +9939,7 @@ var defineVoiceTurnQualityElement = (tagName = "absolute-voice-turn-quality") =>
|
|
|
9624
9939
|
};
|
|
9625
9940
|
|
|
9626
9941
|
// src/react/VoiceTurnQuality.tsx
|
|
9627
|
-
import { jsxDEV as
|
|
9942
|
+
import { jsxDEV as jsxDEV20 } from "react/jsx-dev-runtime";
|
|
9628
9943
|
var VoiceTurnQuality = ({
|
|
9629
9944
|
className,
|
|
9630
9945
|
path = "/api/turn-quality",
|
|
@@ -9632,58 +9947,58 @@ var VoiceTurnQuality = ({
|
|
|
9632
9947
|
}) => {
|
|
9633
9948
|
const snapshot = useVoiceTurnQuality(path, options);
|
|
9634
9949
|
const model = createVoiceTurnQualityViewModel(snapshot, options);
|
|
9635
|
-
return /* @__PURE__ */
|
|
9950
|
+
return /* @__PURE__ */ jsxDEV20("section", {
|
|
9636
9951
|
className: [
|
|
9637
9952
|
"absolute-voice-turn-quality",
|
|
9638
9953
|
`absolute-voice-turn-quality--${model.status}`,
|
|
9639
9954
|
className
|
|
9640
9955
|
].filter(Boolean).join(" "),
|
|
9641
9956
|
children: [
|
|
9642
|
-
/* @__PURE__ */
|
|
9957
|
+
/* @__PURE__ */ jsxDEV20("header", {
|
|
9643
9958
|
className: "absolute-voice-turn-quality__header",
|
|
9644
9959
|
children: [
|
|
9645
|
-
/* @__PURE__ */
|
|
9960
|
+
/* @__PURE__ */ jsxDEV20("span", {
|
|
9646
9961
|
className: "absolute-voice-turn-quality__eyebrow",
|
|
9647
9962
|
children: model.title
|
|
9648
9963
|
}, undefined, false, undefined, this),
|
|
9649
|
-
/* @__PURE__ */
|
|
9964
|
+
/* @__PURE__ */ jsxDEV20("strong", {
|
|
9650
9965
|
className: "absolute-voice-turn-quality__label",
|
|
9651
9966
|
children: model.label
|
|
9652
9967
|
}, undefined, false, undefined, this)
|
|
9653
9968
|
]
|
|
9654
9969
|
}, undefined, true, undefined, this),
|
|
9655
|
-
/* @__PURE__ */
|
|
9970
|
+
/* @__PURE__ */ jsxDEV20("p", {
|
|
9656
9971
|
className: "absolute-voice-turn-quality__description",
|
|
9657
9972
|
children: model.description
|
|
9658
9973
|
}, undefined, false, undefined, this),
|
|
9659
|
-
model.turns.length ? /* @__PURE__ */
|
|
9974
|
+
model.turns.length ? /* @__PURE__ */ jsxDEV20("div", {
|
|
9660
9975
|
className: "absolute-voice-turn-quality__turns",
|
|
9661
|
-
children: model.turns.map((turn) => /* @__PURE__ */
|
|
9976
|
+
children: model.turns.map((turn) => /* @__PURE__ */ jsxDEV20("article", {
|
|
9662
9977
|
className: [
|
|
9663
9978
|
"absolute-voice-turn-quality__turn",
|
|
9664
9979
|
`absolute-voice-turn-quality__turn--${turn.status}`
|
|
9665
9980
|
].join(" "),
|
|
9666
9981
|
children: [
|
|
9667
|
-
/* @__PURE__ */
|
|
9982
|
+
/* @__PURE__ */ jsxDEV20("header", {
|
|
9668
9983
|
children: [
|
|
9669
|
-
/* @__PURE__ */
|
|
9984
|
+
/* @__PURE__ */ jsxDEV20("strong", {
|
|
9670
9985
|
children: turn.label
|
|
9671
9986
|
}, undefined, false, undefined, this),
|
|
9672
|
-
/* @__PURE__ */
|
|
9987
|
+
/* @__PURE__ */ jsxDEV20("span", {
|
|
9673
9988
|
children: turn.status
|
|
9674
9989
|
}, undefined, false, undefined, this)
|
|
9675
9990
|
]
|
|
9676
9991
|
}, undefined, true, undefined, this),
|
|
9677
|
-
/* @__PURE__ */
|
|
9992
|
+
/* @__PURE__ */ jsxDEV20("p", {
|
|
9678
9993
|
children: turn.detail
|
|
9679
9994
|
}, undefined, false, undefined, this),
|
|
9680
|
-
/* @__PURE__ */
|
|
9681
|
-
children: turn.rows.map((row) => /* @__PURE__ */
|
|
9995
|
+
/* @__PURE__ */ jsxDEV20("dl", {
|
|
9996
|
+
children: turn.rows.map((row) => /* @__PURE__ */ jsxDEV20("div", {
|
|
9682
9997
|
children: [
|
|
9683
|
-
/* @__PURE__ */
|
|
9998
|
+
/* @__PURE__ */ jsxDEV20("dt", {
|
|
9684
9999
|
children: row.label
|
|
9685
10000
|
}, undefined, false, undefined, this),
|
|
9686
|
-
/* @__PURE__ */
|
|
10001
|
+
/* @__PURE__ */ jsxDEV20("dd", {
|
|
9687
10002
|
children: row.value
|
|
9688
10003
|
}, undefined, false, undefined, this)
|
|
9689
10004
|
]
|
|
@@ -9691,11 +10006,11 @@ var VoiceTurnQuality = ({
|
|
|
9691
10006
|
}, undefined, false, undefined, this)
|
|
9692
10007
|
]
|
|
9693
10008
|
}, `${turn.sessionId}:${turn.turnId}`, true, undefined, this))
|
|
9694
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
10009
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV20("p", {
|
|
9695
10010
|
className: "absolute-voice-turn-quality__empty",
|
|
9696
10011
|
children: "Complete a voice turn to see STT quality diagnostics."
|
|
9697
10012
|
}, undefined, false, undefined, this),
|
|
9698
|
-
model.error ? /* @__PURE__ */
|
|
10013
|
+
model.error ? /* @__PURE__ */ jsxDEV20("p", {
|
|
9699
10014
|
className: "absolute-voice-turn-quality__error",
|
|
9700
10015
|
children: model.error
|
|
9701
10016
|
}, undefined, false, undefined, this) : null
|
|
@@ -9703,7 +10018,7 @@ var VoiceTurnQuality = ({
|
|
|
9703
10018
|
}, undefined, true, undefined, this);
|
|
9704
10019
|
};
|
|
9705
10020
|
// src/react/useVoiceLiveOps.tsx
|
|
9706
|
-
import { useEffect as
|
|
10021
|
+
import { useEffect as useEffect21, useRef as useRef21, useSyncExternalStore as useSyncExternalStore21 } from "react";
|
|
9707
10022
|
|
|
9708
10023
|
// src/client/liveOps.ts
|
|
9709
10024
|
var postVoiceLiveOpsAction = async (input, options = {}) => {
|
|
@@ -9793,19 +10108,19 @@ var createVoiceLiveOpsStore = (options = {}) => {
|
|
|
9793
10108
|
|
|
9794
10109
|
// src/react/useVoiceLiveOps.tsx
|
|
9795
10110
|
var useVoiceLiveOps = (options = {}) => {
|
|
9796
|
-
const storeRef =
|
|
10111
|
+
const storeRef = useRef21(null);
|
|
9797
10112
|
if (!storeRef.current) {
|
|
9798
10113
|
storeRef.current = createVoiceLiveOpsStore(options);
|
|
9799
10114
|
}
|
|
9800
10115
|
const store = storeRef.current;
|
|
9801
|
-
|
|
10116
|
+
useEffect21(() => () => store.close(), [store]);
|
|
9802
10117
|
return {
|
|
9803
|
-
...
|
|
10118
|
+
...useSyncExternalStore21(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
9804
10119
|
run: store.run
|
|
9805
10120
|
};
|
|
9806
10121
|
};
|
|
9807
10122
|
// src/react/useVoiceCampaignDialerProof.tsx
|
|
9808
|
-
import { useEffect as
|
|
10123
|
+
import { useEffect as useEffect22, useRef as useRef22, useSyncExternalStore as useSyncExternalStore22 } from "react";
|
|
9809
10124
|
|
|
9810
10125
|
// src/client/campaignDialerProof.ts
|
|
9811
10126
|
var fetchVoiceCampaignDialerProofStatus = async (path = "/api/voice/campaigns/dialer-proof", options = {}) => {
|
|
@@ -9927,23 +10242,23 @@ var createVoiceCampaignDialerProofStore = (path = "/api/voice/campaigns/dialer-p
|
|
|
9927
10242
|
|
|
9928
10243
|
// src/react/useVoiceCampaignDialerProof.tsx
|
|
9929
10244
|
var useVoiceCampaignDialerProof = (path = "/api/voice/campaigns/dialer-proof", options = {}) => {
|
|
9930
|
-
const storeRef =
|
|
10245
|
+
const storeRef = useRef22(null);
|
|
9931
10246
|
if (!storeRef.current) {
|
|
9932
10247
|
storeRef.current = createVoiceCampaignDialerProofStore(path, options);
|
|
9933
10248
|
}
|
|
9934
10249
|
const store = storeRef.current;
|
|
9935
|
-
|
|
10250
|
+
useEffect22(() => {
|
|
9936
10251
|
store.refresh().catch(() => {});
|
|
9937
10252
|
return () => store.close();
|
|
9938
10253
|
}, [store]);
|
|
9939
10254
|
return {
|
|
9940
|
-
...
|
|
10255
|
+
...useSyncExternalStore22(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
9941
10256
|
refresh: store.refresh,
|
|
9942
10257
|
runProof: store.runProof
|
|
9943
10258
|
};
|
|
9944
10259
|
};
|
|
9945
10260
|
// src/react/useVoiceStream.tsx
|
|
9946
|
-
import { useEffect as
|
|
10261
|
+
import { useEffect as useEffect23, useRef as useRef23, useSyncExternalStore as useSyncExternalStore23 } from "react";
|
|
9947
10262
|
|
|
9948
10263
|
// src/client/actions.ts
|
|
9949
10264
|
var normalizeErrorMessage = (value) => {
|
|
@@ -11364,13 +11679,13 @@ var EMPTY_SNAPSHOT = {
|
|
|
11364
11679
|
turns: []
|
|
11365
11680
|
};
|
|
11366
11681
|
var useVoiceStream = (path, options = {}) => {
|
|
11367
|
-
const streamRef =
|
|
11682
|
+
const streamRef = useRef23(null);
|
|
11368
11683
|
if (!streamRef.current) {
|
|
11369
11684
|
streamRef.current = createVoiceStream(path, options);
|
|
11370
11685
|
}
|
|
11371
11686
|
const stream = streamRef.current;
|
|
11372
|
-
|
|
11373
|
-
const snapshot =
|
|
11687
|
+
useEffect23(() => () => stream.close(), [stream]);
|
|
11688
|
+
const snapshot = useSyncExternalStore23(stream.subscribe, stream.getSnapshot, stream.getServerSnapshot) ?? EMPTY_SNAPSHOT;
|
|
11374
11689
|
return {
|
|
11375
11690
|
...snapshot,
|
|
11376
11691
|
callControl: (message) => stream.callControl(message),
|
|
@@ -11381,7 +11696,7 @@ var useVoiceStream = (path, options = {}) => {
|
|
|
11381
11696
|
};
|
|
11382
11697
|
};
|
|
11383
11698
|
// src/react/useVoiceController.tsx
|
|
11384
|
-
import { useEffect as
|
|
11699
|
+
import { useEffect as useEffect24, useRef as useRef24, useSyncExternalStore as useSyncExternalStore24 } from "react";
|
|
11385
11700
|
|
|
11386
11701
|
// src/client/htmx.ts
|
|
11387
11702
|
var DEFAULT_EVENT_NAME = "voice-refresh";
|
|
@@ -12050,13 +12365,13 @@ var EMPTY_SNAPSHOT2 = {
|
|
|
12050
12365
|
turns: []
|
|
12051
12366
|
};
|
|
12052
12367
|
var useVoiceController = (path, options = {}) => {
|
|
12053
|
-
const controllerRef =
|
|
12368
|
+
const controllerRef = useRef24(null);
|
|
12054
12369
|
if (!controllerRef.current) {
|
|
12055
12370
|
controllerRef.current = createVoiceController(path, options);
|
|
12056
12371
|
}
|
|
12057
12372
|
const controller = controllerRef.current;
|
|
12058
|
-
|
|
12059
|
-
const snapshot =
|
|
12373
|
+
useEffect24(() => () => controller.close(), [controller]);
|
|
12374
|
+
const snapshot = useSyncExternalStore24(controller.subscribe, controller.getSnapshot, controller.getServerSnapshot) ?? EMPTY_SNAPSHOT2;
|
|
12060
12375
|
return {
|
|
12061
12376
|
...snapshot,
|
|
12062
12377
|
bindHTMX: controller.bindHTMX,
|
|
@@ -12071,7 +12386,7 @@ var useVoiceController = (path, options = {}) => {
|
|
|
12071
12386
|
};
|
|
12072
12387
|
};
|
|
12073
12388
|
// src/react/useVoiceWorkflowStatus.tsx
|
|
12074
|
-
import { useEffect as
|
|
12389
|
+
import { useEffect as useEffect25, useRef as useRef25, useSyncExternalStore as useSyncExternalStore25 } from "react";
|
|
12075
12390
|
|
|
12076
12391
|
// src/client/workflowStatus.ts
|
|
12077
12392
|
var fetchVoiceWorkflowStatus = async (path = "/evals/scenarios/json", options = {}) => {
|
|
@@ -12154,17 +12469,17 @@ var createVoiceWorkflowStatusStore = (path = "/evals/scenarios/json", options =
|
|
|
12154
12469
|
|
|
12155
12470
|
// src/react/useVoiceWorkflowStatus.tsx
|
|
12156
12471
|
var useVoiceWorkflowStatus = (path = "/evals/scenarios/json", options = {}) => {
|
|
12157
|
-
const storeRef =
|
|
12472
|
+
const storeRef = useRef25(null);
|
|
12158
12473
|
if (!storeRef.current) {
|
|
12159
12474
|
storeRef.current = createVoiceWorkflowStatusStore(path, options);
|
|
12160
12475
|
}
|
|
12161
12476
|
const store = storeRef.current;
|
|
12162
|
-
|
|
12477
|
+
useEffect25(() => {
|
|
12163
12478
|
store.refresh().catch(() => {});
|
|
12164
12479
|
return () => store.close();
|
|
12165
12480
|
}, [store]);
|
|
12166
12481
|
return {
|
|
12167
|
-
...
|
|
12482
|
+
...useSyncExternalStore25(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
12168
12483
|
refresh: store.refresh
|
|
12169
12484
|
};
|
|
12170
12485
|
};
|
|
@@ -12176,6 +12491,7 @@ export {
|
|
|
12176
12491
|
useVoiceStream,
|
|
12177
12492
|
useVoiceSessionSnapshot,
|
|
12178
12493
|
useVoiceRoutingStatus,
|
|
12494
|
+
useVoiceReconnectProfileEvidence,
|
|
12179
12495
|
useVoiceReadinessFailures,
|
|
12180
12496
|
useVoiceProviderStatus,
|
|
12181
12497
|
useVoiceProviderSimulationControls,
|
|
@@ -12198,6 +12514,7 @@ export {
|
|
|
12198
12514
|
VoiceTraceTimeline,
|
|
12199
12515
|
VoiceSessionSnapshot,
|
|
12200
12516
|
VoiceRoutingStatus,
|
|
12517
|
+
VoiceReconnectProfileEvidence,
|
|
12201
12518
|
VoiceReadinessFailures,
|
|
12202
12519
|
VoiceProviderStatus,
|
|
12203
12520
|
VoiceProviderSimulationControls,
|