@absolutejs/voice 0.0.22-beta.290 → 0.0.22-beta.292
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +53 -0
- package/dist/angular/index.d.ts +1 -0
- package/dist/angular/index.js +303 -181
- package/dist/angular/voice-readiness-failures.service.d.ts +13 -0
- package/dist/client/index.d.ts +4 -0
- package/dist/client/index.js +367 -183
- package/dist/client/readinessFailures.d.ts +19 -0
- package/dist/client/readinessFailuresWidget.d.ts +42 -0
- package/dist/index.d.ts +3 -3
- package/dist/index.js +90 -14
- package/dist/modelAdapters.d.ts +37 -0
- package/dist/react/VoiceReadinessFailures.d.ts +6 -0
- package/dist/react/index.d.ts +2 -0
- package/dist/react/index.js +635 -345
- package/dist/react/useVoiceReadinessFailures.d.ts +8 -0
- package/dist/svelte/createVoiceReadinessFailures.d.ts +7 -0
- package/dist/svelte/index.d.ts +1 -0
- package/dist/svelte/index.js +86 -0
- package/dist/testing/index.js +87 -12
- package/dist/vue/VoiceReadinessFailures.d.ts +21 -0
- package/dist/vue/index.d.ts +2 -0
- package/dist/vue/index.js +540 -262
- package/dist/vue/useVoiceReadinessFailures.d.ts +755 -0
- package/package.json +1 -1
package/dist/react/index.js
CHANGED
|
@@ -1849,6 +1849,294 @@ var VoiceProofTrends = ({
|
|
|
1849
1849
|
]
|
|
1850
1850
|
}, undefined, true, undefined, this);
|
|
1851
1851
|
};
|
|
1852
|
+
// src/client/readinessFailures.ts
|
|
1853
|
+
var fetchVoiceReadinessFailures = async (path = "/api/production-readiness", options = {}) => {
|
|
1854
|
+
const fetchImpl = options.fetch ?? globalThis.fetch;
|
|
1855
|
+
const response = await fetchImpl(path);
|
|
1856
|
+
if (!response.ok) {
|
|
1857
|
+
throw new Error(`Voice readiness failed: HTTP ${response.status}`);
|
|
1858
|
+
}
|
|
1859
|
+
return await response.json();
|
|
1860
|
+
};
|
|
1861
|
+
var createVoiceReadinessFailuresStore = (path = "/api/production-readiness", options = {}) => {
|
|
1862
|
+
const listeners = new Set;
|
|
1863
|
+
let closed = false;
|
|
1864
|
+
let timer;
|
|
1865
|
+
let snapshot = {
|
|
1866
|
+
error: null,
|
|
1867
|
+
isLoading: false
|
|
1868
|
+
};
|
|
1869
|
+
const emit = () => {
|
|
1870
|
+
for (const listener of listeners) {
|
|
1871
|
+
listener();
|
|
1872
|
+
}
|
|
1873
|
+
};
|
|
1874
|
+
const refresh = async () => {
|
|
1875
|
+
if (closed) {
|
|
1876
|
+
return snapshot.report;
|
|
1877
|
+
}
|
|
1878
|
+
snapshot = { ...snapshot, error: null, isLoading: true };
|
|
1879
|
+
emit();
|
|
1880
|
+
try {
|
|
1881
|
+
const report = await fetchVoiceReadinessFailures(path, options);
|
|
1882
|
+
snapshot = {
|
|
1883
|
+
error: null,
|
|
1884
|
+
isLoading: false,
|
|
1885
|
+
report,
|
|
1886
|
+
updatedAt: Date.now()
|
|
1887
|
+
};
|
|
1888
|
+
emit();
|
|
1889
|
+
return report;
|
|
1890
|
+
} catch (error) {
|
|
1891
|
+
snapshot = {
|
|
1892
|
+
...snapshot,
|
|
1893
|
+
error: error instanceof Error ? error.message : String(error),
|
|
1894
|
+
isLoading: false
|
|
1895
|
+
};
|
|
1896
|
+
emit();
|
|
1897
|
+
throw error;
|
|
1898
|
+
}
|
|
1899
|
+
};
|
|
1900
|
+
const close = () => {
|
|
1901
|
+
closed = true;
|
|
1902
|
+
if (timer) {
|
|
1903
|
+
clearInterval(timer);
|
|
1904
|
+
timer = undefined;
|
|
1905
|
+
}
|
|
1906
|
+
listeners.clear();
|
|
1907
|
+
};
|
|
1908
|
+
if (typeof window !== "undefined" && options.intervalMs && options.intervalMs > 0) {
|
|
1909
|
+
timer = setInterval(() => {
|
|
1910
|
+
refresh().catch(() => {});
|
|
1911
|
+
}, options.intervalMs);
|
|
1912
|
+
}
|
|
1913
|
+
return {
|
|
1914
|
+
close,
|
|
1915
|
+
getServerSnapshot: () => snapshot,
|
|
1916
|
+
getSnapshot: () => snapshot,
|
|
1917
|
+
refresh,
|
|
1918
|
+
subscribe: (listener) => {
|
|
1919
|
+
listeners.add(listener);
|
|
1920
|
+
return () => {
|
|
1921
|
+
listeners.delete(listener);
|
|
1922
|
+
};
|
|
1923
|
+
}
|
|
1924
|
+
};
|
|
1925
|
+
};
|
|
1926
|
+
|
|
1927
|
+
// src/client/readinessFailuresWidget.ts
|
|
1928
|
+
var DEFAULT_TITLE6 = "Readiness Gate Explanations";
|
|
1929
|
+
var DEFAULT_DESCRIPTION6 = "Structured reasons for calibrated production-readiness warnings and failures.";
|
|
1930
|
+
var DEFAULT_LINKS3 = [
|
|
1931
|
+
{ href: "/production-readiness", label: "Readiness page" },
|
|
1932
|
+
{ href: "/voice/slo-readiness-thresholds", label: "Gate thresholds" }
|
|
1933
|
+
];
|
|
1934
|
+
var escapeHtml6 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
1935
|
+
var formatExplanationValue = (value, unit) => {
|
|
1936
|
+
if (value === undefined || value === null) {
|
|
1937
|
+
return "n/a";
|
|
1938
|
+
}
|
|
1939
|
+
const suffix = unit && unit !== "status" ? ` ${unit}` : "";
|
|
1940
|
+
return `${String(value)}${suffix}`;
|
|
1941
|
+
};
|
|
1942
|
+
var toFailureView = (check) => {
|
|
1943
|
+
const explanation = check.gateExplanation;
|
|
1944
|
+
if (!explanation || check.status === "pass") {
|
|
1945
|
+
return;
|
|
1946
|
+
}
|
|
1947
|
+
return {
|
|
1948
|
+
evidenceHref: explanation.evidenceHref ?? check.href,
|
|
1949
|
+
label: check.label,
|
|
1950
|
+
observed: formatExplanationValue(explanation.observed, explanation.unit),
|
|
1951
|
+
remediation: explanation.remediation,
|
|
1952
|
+
sourceHref: explanation.sourceHref,
|
|
1953
|
+
status: check.status,
|
|
1954
|
+
threshold: formatExplanationValue(explanation.threshold, explanation.unit),
|
|
1955
|
+
thresholdLabel: explanation.thresholdLabel ?? "Readiness threshold"
|
|
1956
|
+
};
|
|
1957
|
+
};
|
|
1958
|
+
var createVoiceReadinessFailuresViewModel = (snapshot, options = {}) => {
|
|
1959
|
+
const failures = snapshot.report?.checks.map(toFailureView).filter((value) => !!value) ?? [];
|
|
1960
|
+
const hasOpenIssues = failures.length > 0;
|
|
1961
|
+
return {
|
|
1962
|
+
description: options.description ?? DEFAULT_DESCRIPTION6,
|
|
1963
|
+
error: snapshot.error,
|
|
1964
|
+
failures,
|
|
1965
|
+
isLoading: snapshot.isLoading,
|
|
1966
|
+
label: snapshot.error ? "Unavailable" : snapshot.report ? hasOpenIssues ? `${failures.length} calibrated gate issue(s)` : "No calibrated gate issues" : snapshot.isLoading ? "Checking" : "No readiness report",
|
|
1967
|
+
links: options.links ?? DEFAULT_LINKS3,
|
|
1968
|
+
status: snapshot.error ? "error" : snapshot.report ? hasOpenIssues ? "warning" : "ready" : snapshot.isLoading ? "loading" : "empty",
|
|
1969
|
+
title: options.title ?? DEFAULT_TITLE6,
|
|
1970
|
+
updatedAt: snapshot.updatedAt
|
|
1971
|
+
};
|
|
1972
|
+
};
|
|
1973
|
+
var renderVoiceReadinessFailuresHTML = (snapshot, options = {}) => {
|
|
1974
|
+
const model = createVoiceReadinessFailuresViewModel(snapshot, options);
|
|
1975
|
+
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--${escapeHtml6(failure.status)}">
|
|
1976
|
+
<span>${escapeHtml6(failure.status.toUpperCase())}</span>
|
|
1977
|
+
<strong>${escapeHtml6(failure.label)}</strong>
|
|
1978
|
+
<p>Observed ${escapeHtml6(failure.observed)} against ${escapeHtml6(failure.thresholdLabel)} ${escapeHtml6(failure.threshold)}.</p>
|
|
1979
|
+
<p>${escapeHtml6(failure.remediation)}</p>
|
|
1980
|
+
<p class="absolute-voice-readiness-failures__links">${failure.evidenceHref ? `<a href="${escapeHtml6(failure.evidenceHref)}">Evidence</a>` : ""}${failure.sourceHref ? `<a href="${escapeHtml6(failure.sourceHref)}">Threshold source</a>` : ""}</p>
|
|
1981
|
+
</article>`).join("")}</div>` : `<p class="absolute-voice-readiness-failures__empty">${model.error ? escapeHtml6(model.error) : "No calibrated readiness gate explanations are open."}</p>`;
|
|
1982
|
+
const links = model.links.length ? `<p class="absolute-voice-readiness-failures__links">${model.links.map((link) => `<a href="${escapeHtml6(link.href)}">${escapeHtml6(link.label)}</a>`).join("")}</p>` : "";
|
|
1983
|
+
return `<section class="absolute-voice-readiness-failures absolute-voice-readiness-failures--${escapeHtml6(model.status)}">
|
|
1984
|
+
<header class="absolute-voice-readiness-failures__header">
|
|
1985
|
+
<span class="absolute-voice-readiness-failures__eyebrow">${escapeHtml6(model.title)}</span>
|
|
1986
|
+
<strong class="absolute-voice-readiness-failures__label">${escapeHtml6(model.label)}</strong>
|
|
1987
|
+
</header>
|
|
1988
|
+
<p class="absolute-voice-readiness-failures__description">${escapeHtml6(model.description)}</p>
|
|
1989
|
+
${failures}
|
|
1990
|
+
${links}
|
|
1991
|
+
${model.error ? `<p class="absolute-voice-readiness-failures__error">${escapeHtml6(model.error)}</p>` : ""}
|
|
1992
|
+
</section>`;
|
|
1993
|
+
};
|
|
1994
|
+
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}`;
|
|
1995
|
+
var mountVoiceReadinessFailures = (element, path = "/api/production-readiness", options = {}) => {
|
|
1996
|
+
const store = createVoiceReadinessFailuresStore(path, options);
|
|
1997
|
+
const render = () => {
|
|
1998
|
+
element.innerHTML = renderVoiceReadinessFailuresHTML(store.getSnapshot(), options);
|
|
1999
|
+
};
|
|
2000
|
+
const unsubscribe = store.subscribe(render);
|
|
2001
|
+
render();
|
|
2002
|
+
store.refresh().catch(() => {});
|
|
2003
|
+
return {
|
|
2004
|
+
close: () => {
|
|
2005
|
+
unsubscribe();
|
|
2006
|
+
store.close();
|
|
2007
|
+
},
|
|
2008
|
+
refresh: store.refresh
|
|
2009
|
+
};
|
|
2010
|
+
};
|
|
2011
|
+
var defineVoiceReadinessFailuresElement = (tagName = "absolute-voice-readiness-failures") => {
|
|
2012
|
+
if (typeof window === "undefined" || typeof customElements === "undefined" || customElements.get(tagName)) {
|
|
2013
|
+
return;
|
|
2014
|
+
}
|
|
2015
|
+
customElements.define(tagName, class AbsoluteVoiceReadinessFailuresElement extends HTMLElement {
|
|
2016
|
+
mounted;
|
|
2017
|
+
connectedCallback() {
|
|
2018
|
+
this.mounted = mountVoiceReadinessFailures(this, this.getAttribute("path") ?? "/api/production-readiness", {
|
|
2019
|
+
description: this.getAttribute("description") ?? undefined,
|
|
2020
|
+
intervalMs: Number(this.getAttribute("interval-ms") ?? 0) || undefined,
|
|
2021
|
+
title: this.getAttribute("title") ?? undefined
|
|
2022
|
+
});
|
|
2023
|
+
}
|
|
2024
|
+
disconnectedCallback() {
|
|
2025
|
+
this.mounted?.close();
|
|
2026
|
+
this.mounted = undefined;
|
|
2027
|
+
}
|
|
2028
|
+
});
|
|
2029
|
+
};
|
|
2030
|
+
|
|
2031
|
+
// src/react/useVoiceReadinessFailures.tsx
|
|
2032
|
+
import { useEffect as useEffect6, useRef as useRef6, useSyncExternalStore as useSyncExternalStore6 } from "react";
|
|
2033
|
+
var useVoiceReadinessFailures = (path = "/api/production-readiness", options = {}) => {
|
|
2034
|
+
const storeRef = useRef6(null);
|
|
2035
|
+
if (!storeRef.current) {
|
|
2036
|
+
storeRef.current = createVoiceReadinessFailuresStore(path, options);
|
|
2037
|
+
}
|
|
2038
|
+
const store = storeRef.current;
|
|
2039
|
+
useEffect6(() => {
|
|
2040
|
+
store.refresh().catch(() => {});
|
|
2041
|
+
return () => store.close();
|
|
2042
|
+
}, [store]);
|
|
2043
|
+
return {
|
|
2044
|
+
...useSyncExternalStore6(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
2045
|
+
refresh: store.refresh
|
|
2046
|
+
};
|
|
2047
|
+
};
|
|
2048
|
+
|
|
2049
|
+
// src/react/VoiceReadinessFailures.tsx
|
|
2050
|
+
import { jsxDEV as jsxDEV6 } from "react/jsx-dev-runtime";
|
|
2051
|
+
var VoiceReadinessFailures = ({
|
|
2052
|
+
className,
|
|
2053
|
+
path = "/api/production-readiness",
|
|
2054
|
+
...options
|
|
2055
|
+
}) => {
|
|
2056
|
+
const snapshot = useVoiceReadinessFailures(path, options);
|
|
2057
|
+
const model = createVoiceReadinessFailuresViewModel(snapshot, options);
|
|
2058
|
+
return /* @__PURE__ */ jsxDEV6("section", {
|
|
2059
|
+
className: [
|
|
2060
|
+
"absolute-voice-readiness-failures",
|
|
2061
|
+
`absolute-voice-readiness-failures--${model.status}`,
|
|
2062
|
+
className
|
|
2063
|
+
].filter(Boolean).join(" "),
|
|
2064
|
+
children: [
|
|
2065
|
+
/* @__PURE__ */ jsxDEV6("header", {
|
|
2066
|
+
className: "absolute-voice-readiness-failures__header",
|
|
2067
|
+
children: [
|
|
2068
|
+
/* @__PURE__ */ jsxDEV6("span", {
|
|
2069
|
+
className: "absolute-voice-readiness-failures__eyebrow",
|
|
2070
|
+
children: model.title
|
|
2071
|
+
}, undefined, false, undefined, this),
|
|
2072
|
+
/* @__PURE__ */ jsxDEV6("strong", {
|
|
2073
|
+
className: "absolute-voice-readiness-failures__label",
|
|
2074
|
+
children: model.label
|
|
2075
|
+
}, undefined, false, undefined, this)
|
|
2076
|
+
]
|
|
2077
|
+
}, undefined, true, undefined, this),
|
|
2078
|
+
/* @__PURE__ */ jsxDEV6("p", {
|
|
2079
|
+
className: "absolute-voice-readiness-failures__description",
|
|
2080
|
+
children: model.description
|
|
2081
|
+
}, undefined, false, undefined, this),
|
|
2082
|
+
model.failures.length ? /* @__PURE__ */ jsxDEV6("div", {
|
|
2083
|
+
className: "absolute-voice-readiness-failures__items",
|
|
2084
|
+
children: model.failures.map((failure) => /* @__PURE__ */ jsxDEV6("article", {
|
|
2085
|
+
className: `absolute-voice-readiness-failures__item absolute-voice-readiness-failures__item--${failure.status}`,
|
|
2086
|
+
children: [
|
|
2087
|
+
/* @__PURE__ */ jsxDEV6("span", {
|
|
2088
|
+
children: failure.status.toUpperCase()
|
|
2089
|
+
}, undefined, false, undefined, this),
|
|
2090
|
+
/* @__PURE__ */ jsxDEV6("strong", {
|
|
2091
|
+
children: failure.label
|
|
2092
|
+
}, undefined, false, undefined, this),
|
|
2093
|
+
/* @__PURE__ */ jsxDEV6("p", {
|
|
2094
|
+
children: [
|
|
2095
|
+
"Observed ",
|
|
2096
|
+
failure.observed,
|
|
2097
|
+
" against ",
|
|
2098
|
+
failure.thresholdLabel,
|
|
2099
|
+
" ",
|
|
2100
|
+
failure.threshold,
|
|
2101
|
+
"."
|
|
2102
|
+
]
|
|
2103
|
+
}, undefined, true, undefined, this),
|
|
2104
|
+
/* @__PURE__ */ jsxDEV6("p", {
|
|
2105
|
+
children: failure.remediation
|
|
2106
|
+
}, undefined, false, undefined, this),
|
|
2107
|
+
/* @__PURE__ */ jsxDEV6("p", {
|
|
2108
|
+
className: "absolute-voice-readiness-failures__links",
|
|
2109
|
+
children: [
|
|
2110
|
+
failure.evidenceHref ? /* @__PURE__ */ jsxDEV6("a", {
|
|
2111
|
+
href: failure.evidenceHref,
|
|
2112
|
+
children: "Evidence"
|
|
2113
|
+
}, undefined, false, undefined, this) : null,
|
|
2114
|
+
failure.sourceHref ? /* @__PURE__ */ jsxDEV6("a", {
|
|
2115
|
+
href: failure.sourceHref,
|
|
2116
|
+
children: "Threshold source"
|
|
2117
|
+
}, undefined, false, undefined, this) : null
|
|
2118
|
+
]
|
|
2119
|
+
}, undefined, true, undefined, this)
|
|
2120
|
+
]
|
|
2121
|
+
}, failure.label, true, undefined, this))
|
|
2122
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV6("p", {
|
|
2123
|
+
className: "absolute-voice-readiness-failures__empty",
|
|
2124
|
+
children: model.error ?? "No calibrated readiness gate explanations are open."
|
|
2125
|
+
}, undefined, false, undefined, this),
|
|
2126
|
+
model.links.length ? /* @__PURE__ */ jsxDEV6("p", {
|
|
2127
|
+
className: "absolute-voice-readiness-failures__links",
|
|
2128
|
+
children: model.links.map((link) => /* @__PURE__ */ jsxDEV6("a", {
|
|
2129
|
+
href: link.href,
|
|
2130
|
+
children: link.label
|
|
2131
|
+
}, link.href, false, undefined, this))
|
|
2132
|
+
}, undefined, false, undefined, this) : null,
|
|
2133
|
+
model.error ? /* @__PURE__ */ jsxDEV6("p", {
|
|
2134
|
+
className: "absolute-voice-readiness-failures__error",
|
|
2135
|
+
children: model.error
|
|
2136
|
+
}, undefined, false, undefined, this) : null
|
|
2137
|
+
]
|
|
2138
|
+
}, undefined, true, undefined, this);
|
|
2139
|
+
};
|
|
1852
2140
|
// src/client/providerSimulationControls.ts
|
|
1853
2141
|
var postSimulation = async (pathPrefix, mode, provider, fetchImpl) => {
|
|
1854
2142
|
const response = await fetchImpl(`${pathPrefix}/${mode}?provider=${encodeURIComponent(provider)}`, { method: "POST" });
|
|
@@ -1929,7 +2217,7 @@ var createVoiceProviderSimulationControlsStore = (options) => {
|
|
|
1929
2217
|
};
|
|
1930
2218
|
|
|
1931
2219
|
// src/client/providerSimulationControlsWidget.ts
|
|
1932
|
-
var
|
|
2220
|
+
var escapeHtml7 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
1933
2221
|
var formatKind = (kind) => (kind ?? "stt").toUpperCase();
|
|
1934
2222
|
var createVoiceProviderSimulationControlsViewModel = (snapshot, options) => {
|
|
1935
2223
|
const configuredProviders = options.providers.filter((provider) => provider.configured !== false);
|
|
@@ -1949,18 +2237,18 @@ var createVoiceProviderSimulationControlsViewModel = (snapshot, options) => {
|
|
|
1949
2237
|
};
|
|
1950
2238
|
var renderVoiceProviderSimulationControlsHTML = (snapshot, options) => {
|
|
1951
2239
|
const model = createVoiceProviderSimulationControlsViewModel(snapshot, options);
|
|
1952
|
-
const failureButtons = model.failureProviders.map((provider) => `<button type="button" data-voice-provider-fail="${
|
|
1953
|
-
const recoveryButtons = model.providers.map((provider) => `<button type="button" data-voice-provider-recover="${
|
|
2240
|
+
const failureButtons = model.failureProviders.map((provider) => `<button type="button" data-voice-provider-fail="${escapeHtml7(provider.provider)}"${!model.canSimulateFailure || snapshot.isRunning ? " disabled" : ""}>Simulate ${escapeHtml7(provider.provider)} ${escapeHtml7(formatKind(options.kind))} failure</button>`).join("");
|
|
2241
|
+
const recoveryButtons = model.providers.map((provider) => `<button type="button" data-voice-provider-recover="${escapeHtml7(provider.provider)}"${snapshot.isRunning ? " disabled" : ""}>Mark ${escapeHtml7(provider.provider)} recovered</button>`).join("");
|
|
1954
2242
|
return `<section class="absolute-voice-provider-simulation absolute-voice-provider-simulation--${snapshot.error ? "error" : snapshot.isRunning ? "running" : "ready"}">
|
|
1955
2243
|
<header class="absolute-voice-provider-simulation__header">
|
|
1956
|
-
<span class="absolute-voice-provider-simulation__eyebrow">${
|
|
1957
|
-
<strong class="absolute-voice-provider-simulation__label">${
|
|
2244
|
+
<span class="absolute-voice-provider-simulation__eyebrow">${escapeHtml7(model.title)}</span>
|
|
2245
|
+
<strong class="absolute-voice-provider-simulation__label">${escapeHtml7(model.label)}</strong>
|
|
1958
2246
|
</header>
|
|
1959
|
-
<p class="absolute-voice-provider-simulation__description">${
|
|
1960
|
-
${model.canSimulateFailure ? "" : `<p class="absolute-voice-provider-simulation__empty">${
|
|
2247
|
+
<p class="absolute-voice-provider-simulation__description">${escapeHtml7(model.description)}</p>
|
|
2248
|
+
${model.canSimulateFailure ? "" : `<p class="absolute-voice-provider-simulation__empty">${escapeHtml7(options.fallbackRequiredMessage ?? "Configure fallback providers before simulating failure.")}</p>`}
|
|
1961
2249
|
<div class="absolute-voice-provider-simulation__actions">${failureButtons}${recoveryButtons}</div>
|
|
1962
|
-
${snapshot.error ? `<p class="absolute-voice-provider-simulation__error">${
|
|
1963
|
-
${model.resultText ? `<pre class="absolute-voice-provider-simulation__result">${
|
|
2250
|
+
${snapshot.error ? `<p class="absolute-voice-provider-simulation__error">${escapeHtml7(snapshot.error)}</p>` : ""}
|
|
2251
|
+
${model.resultText ? `<pre class="absolute-voice-provider-simulation__result">${escapeHtml7(model.resultText)}</pre>` : ""}
|
|
1964
2252
|
</section>`;
|
|
1965
2253
|
};
|
|
1966
2254
|
var bindVoiceProviderSimulationControls = (element, store) => {
|
|
@@ -2026,22 +2314,22 @@ var defineVoiceProviderSimulationControlsElement = (tagName = "absolute-voice-pr
|
|
|
2026
2314
|
};
|
|
2027
2315
|
|
|
2028
2316
|
// src/react/useVoiceProviderSimulationControls.tsx
|
|
2029
|
-
import { useEffect as
|
|
2317
|
+
import { useEffect as useEffect7, useRef as useRef7, useSyncExternalStore as useSyncExternalStore7 } from "react";
|
|
2030
2318
|
var useVoiceProviderSimulationControls = (options) => {
|
|
2031
|
-
const storeRef =
|
|
2319
|
+
const storeRef = useRef7(null);
|
|
2032
2320
|
if (!storeRef.current) {
|
|
2033
2321
|
storeRef.current = createVoiceProviderSimulationControlsStore(options);
|
|
2034
2322
|
}
|
|
2035
2323
|
const store = storeRef.current;
|
|
2036
|
-
|
|
2324
|
+
useEffect7(() => () => store.close(), [store]);
|
|
2037
2325
|
return {
|
|
2038
|
-
...
|
|
2326
|
+
...useSyncExternalStore7(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
2039
2327
|
run: store.run
|
|
2040
2328
|
};
|
|
2041
2329
|
};
|
|
2042
2330
|
|
|
2043
2331
|
// src/react/VoiceProviderSimulationControls.tsx
|
|
2044
|
-
import { jsxDEV as
|
|
2332
|
+
import { jsxDEV as jsxDEV7 } from "react/jsx-dev-runtime";
|
|
2045
2333
|
var VoiceProviderSimulationControls = ({
|
|
2046
2334
|
className,
|
|
2047
2335
|
...options
|
|
@@ -2051,38 +2339,38 @@ var VoiceProviderSimulationControls = ({
|
|
|
2051
2339
|
const run = (provider, mode) => {
|
|
2052
2340
|
snapshot.run(provider, mode).catch(() => {});
|
|
2053
2341
|
};
|
|
2054
|
-
return /* @__PURE__ */
|
|
2342
|
+
return /* @__PURE__ */ jsxDEV7("section", {
|
|
2055
2343
|
className: [
|
|
2056
2344
|
"absolute-voice-provider-simulation",
|
|
2057
2345
|
`absolute-voice-provider-simulation--${snapshot.error ? "error" : snapshot.isRunning ? "running" : "ready"}`,
|
|
2058
2346
|
className
|
|
2059
2347
|
].filter(Boolean).join(" "),
|
|
2060
2348
|
children: [
|
|
2061
|
-
/* @__PURE__ */
|
|
2349
|
+
/* @__PURE__ */ jsxDEV7("header", {
|
|
2062
2350
|
className: "absolute-voice-provider-simulation__header",
|
|
2063
2351
|
children: [
|
|
2064
|
-
/* @__PURE__ */
|
|
2352
|
+
/* @__PURE__ */ jsxDEV7("span", {
|
|
2065
2353
|
className: "absolute-voice-provider-simulation__eyebrow",
|
|
2066
2354
|
children: model.title
|
|
2067
2355
|
}, undefined, false, undefined, this),
|
|
2068
|
-
/* @__PURE__ */
|
|
2356
|
+
/* @__PURE__ */ jsxDEV7("strong", {
|
|
2069
2357
|
className: "absolute-voice-provider-simulation__label",
|
|
2070
2358
|
children: model.label
|
|
2071
2359
|
}, undefined, false, undefined, this)
|
|
2072
2360
|
]
|
|
2073
2361
|
}, undefined, true, undefined, this),
|
|
2074
|
-
/* @__PURE__ */
|
|
2362
|
+
/* @__PURE__ */ jsxDEV7("p", {
|
|
2075
2363
|
className: "absolute-voice-provider-simulation__description",
|
|
2076
2364
|
children: model.description
|
|
2077
2365
|
}, undefined, false, undefined, this),
|
|
2078
|
-
model.canSimulateFailure ? null : /* @__PURE__ */
|
|
2366
|
+
model.canSimulateFailure ? null : /* @__PURE__ */ jsxDEV7("p", {
|
|
2079
2367
|
className: "absolute-voice-provider-simulation__empty",
|
|
2080
2368
|
children: options.fallbackRequiredMessage ?? "Configure fallback providers before simulating failure."
|
|
2081
2369
|
}, undefined, false, undefined, this),
|
|
2082
|
-
/* @__PURE__ */
|
|
2370
|
+
/* @__PURE__ */ jsxDEV7("div", {
|
|
2083
2371
|
className: "absolute-voice-provider-simulation__actions",
|
|
2084
2372
|
children: [
|
|
2085
|
-
model.failureProviders.map((provider) => /* @__PURE__ */
|
|
2373
|
+
model.failureProviders.map((provider) => /* @__PURE__ */ jsxDEV7("button", {
|
|
2086
2374
|
disabled: !model.canSimulateFailure || snapshot.isRunning,
|
|
2087
2375
|
onClick: () => run(provider.provider, "failure"),
|
|
2088
2376
|
type: "button",
|
|
@@ -2095,7 +2383,7 @@ var VoiceProviderSimulationControls = ({
|
|
|
2095
2383
|
"failure"
|
|
2096
2384
|
]
|
|
2097
2385
|
}, `fail-${provider.provider}`, true, undefined, this)),
|
|
2098
|
-
model.providers.map((provider) => /* @__PURE__ */
|
|
2386
|
+
model.providers.map((provider) => /* @__PURE__ */ jsxDEV7("button", {
|
|
2099
2387
|
disabled: snapshot.isRunning,
|
|
2100
2388
|
onClick: () => run(provider.provider, "recovery"),
|
|
2101
2389
|
type: "button",
|
|
@@ -2107,11 +2395,11 @@ var VoiceProviderSimulationControls = ({
|
|
|
2107
2395
|
}, `recover-${provider.provider}`, true, undefined, this))
|
|
2108
2396
|
]
|
|
2109
2397
|
}, undefined, true, undefined, this),
|
|
2110
|
-
snapshot.error ? /* @__PURE__ */
|
|
2398
|
+
snapshot.error ? /* @__PURE__ */ jsxDEV7("p", {
|
|
2111
2399
|
className: "absolute-voice-provider-simulation__error",
|
|
2112
2400
|
children: snapshot.error
|
|
2113
2401
|
}, undefined, false, undefined, this) : null,
|
|
2114
|
-
model.resultText ? /* @__PURE__ */
|
|
2402
|
+
model.resultText ? /* @__PURE__ */ jsxDEV7("pre", {
|
|
2115
2403
|
className: "absolute-voice-provider-simulation__result",
|
|
2116
2404
|
children: model.resultText
|
|
2117
2405
|
}, undefined, false, undefined, this) : null
|
|
@@ -2119,7 +2407,7 @@ var VoiceProviderSimulationControls = ({
|
|
|
2119
2407
|
}, undefined, true, undefined, this);
|
|
2120
2408
|
};
|
|
2121
2409
|
// src/react/useVoiceProviderCapabilities.tsx
|
|
2122
|
-
import { useEffect as
|
|
2410
|
+
import { useEffect as useEffect8, useRef as useRef8, useSyncExternalStore as useSyncExternalStore8 } from "react";
|
|
2123
2411
|
|
|
2124
2412
|
// src/client/providerCapabilities.ts
|
|
2125
2413
|
var fetchVoiceProviderCapabilities = async (path = "/api/provider-capabilities", options = {}) => {
|
|
@@ -2202,25 +2490,25 @@ var createVoiceProviderCapabilitiesStore = (path = "/api/provider-capabilities",
|
|
|
2202
2490
|
|
|
2203
2491
|
// src/react/useVoiceProviderCapabilities.tsx
|
|
2204
2492
|
var useVoiceProviderCapabilities = (path = "/api/provider-capabilities", options = {}) => {
|
|
2205
|
-
const storeRef =
|
|
2493
|
+
const storeRef = useRef8(null);
|
|
2206
2494
|
if (!storeRef.current) {
|
|
2207
2495
|
storeRef.current = createVoiceProviderCapabilitiesStore(path, options);
|
|
2208
2496
|
}
|
|
2209
2497
|
const store = storeRef.current;
|
|
2210
|
-
|
|
2498
|
+
useEffect8(() => {
|
|
2211
2499
|
store.refresh().catch(() => {});
|
|
2212
2500
|
return () => store.close();
|
|
2213
2501
|
}, [store]);
|
|
2214
2502
|
return {
|
|
2215
|
-
...
|
|
2503
|
+
...useSyncExternalStore8(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
2216
2504
|
refresh: store.refresh
|
|
2217
2505
|
};
|
|
2218
2506
|
};
|
|
2219
2507
|
|
|
2220
2508
|
// src/client/providerCapabilitiesWidget.ts
|
|
2221
|
-
var
|
|
2222
|
-
var
|
|
2223
|
-
var
|
|
2509
|
+
var DEFAULT_TITLE7 = "Provider Capabilities";
|
|
2510
|
+
var DEFAULT_DESCRIPTION7 = "Configured, selected, and healthy voice providers for this deployment.";
|
|
2511
|
+
var escapeHtml8 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
2224
2512
|
var formatProvider = (provider) => provider.split(/[-_\s]+/).filter(Boolean).map((part) => `${part[0]?.toUpperCase() ?? ""}${part.slice(1)}`).join(" ") || provider;
|
|
2225
2513
|
var formatKind2 = (kind) => kind.toUpperCase();
|
|
2226
2514
|
var formatStatus2 = (status) => status.split("-").map((part) => `${part[0]?.toUpperCase() ?? ""}${part.slice(1)}`).join(" ");
|
|
@@ -2264,36 +2552,36 @@ var createVoiceProviderCapabilitiesViewModel = (snapshot, options = {}) => {
|
|
|
2264
2552
|
const selectedCount = snapshot.report?.selected ?? capabilities.filter((capability) => capability.selected).length;
|
|
2265
2553
|
return {
|
|
2266
2554
|
capabilities,
|
|
2267
|
-
description: options.description ??
|
|
2555
|
+
description: options.description ?? DEFAULT_DESCRIPTION7,
|
|
2268
2556
|
error: snapshot.error,
|
|
2269
2557
|
isLoading: snapshot.isLoading,
|
|
2270
2558
|
label: snapshot.error ? "Unavailable" : capabilities.length ? warningCount > 0 ? `${warningCount} needs attention` : `${selectedCount} selected` : snapshot.isLoading ? "Checking" : "No capabilities",
|
|
2271
2559
|
status: snapshot.error ? "error" : capabilities.length ? warningCount > 0 ? "warning" : "ready" : snapshot.isLoading ? "loading" : "empty",
|
|
2272
|
-
title: options.title ??
|
|
2560
|
+
title: options.title ?? DEFAULT_TITLE7,
|
|
2273
2561
|
updatedAt: snapshot.updatedAt
|
|
2274
2562
|
};
|
|
2275
2563
|
};
|
|
2276
2564
|
var renderVoiceProviderCapabilitiesHTML = (snapshot, options = {}) => {
|
|
2277
2565
|
const model = createVoiceProviderCapabilitiesViewModel(snapshot, options);
|
|
2278
|
-
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--${
|
|
2566
|
+
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--${escapeHtml8(capability.status)}">
|
|
2279
2567
|
<header>
|
|
2280
|
-
<strong>${
|
|
2281
|
-
<span>${
|
|
2568
|
+
<strong>${escapeHtml8(capability.label)}</strong>
|
|
2569
|
+
<span>${escapeHtml8(formatStatus2(capability.status))}</span>
|
|
2282
2570
|
</header>
|
|
2283
|
-
<p>${
|
|
2571
|
+
<p>${escapeHtml8(capability.detail)}</p>
|
|
2284
2572
|
<dl>${capability.rows.map((row) => `<div>
|
|
2285
|
-
<dt>${
|
|
2286
|
-
<dd>${
|
|
2573
|
+
<dt>${escapeHtml8(row.label)}</dt>
|
|
2574
|
+
<dd>${escapeHtml8(row.value)}</dd>
|
|
2287
2575
|
</div>`).join("")}</dl>
|
|
2288
2576
|
</article>`).join("")}</div>` : '<p class="absolute-voice-provider-capabilities__empty">Configure provider capabilities to see deployment coverage.</p>';
|
|
2289
|
-
return `<section class="absolute-voice-provider-capabilities absolute-voice-provider-capabilities--${
|
|
2577
|
+
return `<section class="absolute-voice-provider-capabilities absolute-voice-provider-capabilities--${escapeHtml8(model.status)}">
|
|
2290
2578
|
<header class="absolute-voice-provider-capabilities__header">
|
|
2291
|
-
<span class="absolute-voice-provider-capabilities__eyebrow">${
|
|
2292
|
-
<strong class="absolute-voice-provider-capabilities__label">${
|
|
2579
|
+
<span class="absolute-voice-provider-capabilities__eyebrow">${escapeHtml8(model.title)}</span>
|
|
2580
|
+
<strong class="absolute-voice-provider-capabilities__label">${escapeHtml8(model.label)}</strong>
|
|
2293
2581
|
</header>
|
|
2294
|
-
<p class="absolute-voice-provider-capabilities__description">${
|
|
2582
|
+
<p class="absolute-voice-provider-capabilities__description">${escapeHtml8(model.description)}</p>
|
|
2295
2583
|
${capabilities}
|
|
2296
|
-
${model.error ? `<p class="absolute-voice-provider-capabilities__error">${
|
|
2584
|
+
${model.error ? `<p class="absolute-voice-provider-capabilities__error">${escapeHtml8(model.error)}</p>` : ""}
|
|
2297
2585
|
</section>`;
|
|
2298
2586
|
};
|
|
2299
2587
|
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}`;
|
|
@@ -2335,7 +2623,7 @@ var defineVoiceProviderCapabilitiesElement = (tagName = "absolute-voice-provider
|
|
|
2335
2623
|
};
|
|
2336
2624
|
|
|
2337
2625
|
// src/react/VoiceProviderCapabilities.tsx
|
|
2338
|
-
import { jsxDEV as
|
|
2626
|
+
import { jsxDEV as jsxDEV8 } from "react/jsx-dev-runtime";
|
|
2339
2627
|
var VoiceProviderCapabilities = ({
|
|
2340
2628
|
className,
|
|
2341
2629
|
path = "/api/provider-capabilities",
|
|
@@ -2343,58 +2631,58 @@ var VoiceProviderCapabilities = ({
|
|
|
2343
2631
|
}) => {
|
|
2344
2632
|
const snapshot = useVoiceProviderCapabilities(path, options);
|
|
2345
2633
|
const model = createVoiceProviderCapabilitiesViewModel(snapshot, options);
|
|
2346
|
-
return /* @__PURE__ */
|
|
2634
|
+
return /* @__PURE__ */ jsxDEV8("section", {
|
|
2347
2635
|
className: [
|
|
2348
2636
|
"absolute-voice-provider-capabilities",
|
|
2349
2637
|
`absolute-voice-provider-capabilities--${model.status}`,
|
|
2350
2638
|
className
|
|
2351
2639
|
].filter(Boolean).join(" "),
|
|
2352
2640
|
children: [
|
|
2353
|
-
/* @__PURE__ */
|
|
2641
|
+
/* @__PURE__ */ jsxDEV8("header", {
|
|
2354
2642
|
className: "absolute-voice-provider-capabilities__header",
|
|
2355
2643
|
children: [
|
|
2356
|
-
/* @__PURE__ */
|
|
2644
|
+
/* @__PURE__ */ jsxDEV8("span", {
|
|
2357
2645
|
className: "absolute-voice-provider-capabilities__eyebrow",
|
|
2358
2646
|
children: model.title
|
|
2359
2647
|
}, undefined, false, undefined, this),
|
|
2360
|
-
/* @__PURE__ */
|
|
2648
|
+
/* @__PURE__ */ jsxDEV8("strong", {
|
|
2361
2649
|
className: "absolute-voice-provider-capabilities__label",
|
|
2362
2650
|
children: model.label
|
|
2363
2651
|
}, undefined, false, undefined, this)
|
|
2364
2652
|
]
|
|
2365
2653
|
}, undefined, true, undefined, this),
|
|
2366
|
-
/* @__PURE__ */
|
|
2654
|
+
/* @__PURE__ */ jsxDEV8("p", {
|
|
2367
2655
|
className: "absolute-voice-provider-capabilities__description",
|
|
2368
2656
|
children: model.description
|
|
2369
2657
|
}, undefined, false, undefined, this),
|
|
2370
|
-
model.capabilities.length ? /* @__PURE__ */
|
|
2658
|
+
model.capabilities.length ? /* @__PURE__ */ jsxDEV8("div", {
|
|
2371
2659
|
className: "absolute-voice-provider-capabilities__providers",
|
|
2372
|
-
children: model.capabilities.map((capability) => /* @__PURE__ */
|
|
2660
|
+
children: model.capabilities.map((capability) => /* @__PURE__ */ jsxDEV8("article", {
|
|
2373
2661
|
className: [
|
|
2374
2662
|
"absolute-voice-provider-capabilities__provider",
|
|
2375
2663
|
`absolute-voice-provider-capabilities__provider--${capability.status}`
|
|
2376
2664
|
].join(" "),
|
|
2377
2665
|
children: [
|
|
2378
|
-
/* @__PURE__ */
|
|
2666
|
+
/* @__PURE__ */ jsxDEV8("header", {
|
|
2379
2667
|
children: [
|
|
2380
|
-
/* @__PURE__ */
|
|
2668
|
+
/* @__PURE__ */ jsxDEV8("strong", {
|
|
2381
2669
|
children: capability.label
|
|
2382
2670
|
}, undefined, false, undefined, this),
|
|
2383
|
-
/* @__PURE__ */
|
|
2671
|
+
/* @__PURE__ */ jsxDEV8("span", {
|
|
2384
2672
|
children: capability.status
|
|
2385
2673
|
}, undefined, false, undefined, this)
|
|
2386
2674
|
]
|
|
2387
2675
|
}, undefined, true, undefined, this),
|
|
2388
|
-
/* @__PURE__ */
|
|
2676
|
+
/* @__PURE__ */ jsxDEV8("p", {
|
|
2389
2677
|
children: capability.detail
|
|
2390
2678
|
}, undefined, false, undefined, this),
|
|
2391
|
-
/* @__PURE__ */
|
|
2392
|
-
children: capability.rows.map((row) => /* @__PURE__ */
|
|
2679
|
+
/* @__PURE__ */ jsxDEV8("dl", {
|
|
2680
|
+
children: capability.rows.map((row) => /* @__PURE__ */ jsxDEV8("div", {
|
|
2393
2681
|
children: [
|
|
2394
|
-
/* @__PURE__ */
|
|
2682
|
+
/* @__PURE__ */ jsxDEV8("dt", {
|
|
2395
2683
|
children: row.label
|
|
2396
2684
|
}, undefined, false, undefined, this),
|
|
2397
|
-
/* @__PURE__ */
|
|
2685
|
+
/* @__PURE__ */ jsxDEV8("dd", {
|
|
2398
2686
|
children: row.value
|
|
2399
2687
|
}, undefined, false, undefined, this)
|
|
2400
2688
|
]
|
|
@@ -2402,11 +2690,11 @@ var VoiceProviderCapabilities = ({
|
|
|
2402
2690
|
}, undefined, false, undefined, this)
|
|
2403
2691
|
]
|
|
2404
2692
|
}, `${capability.kind}:${capability.provider}`, true, undefined, this))
|
|
2405
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
2693
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV8("p", {
|
|
2406
2694
|
className: "absolute-voice-provider-capabilities__empty",
|
|
2407
2695
|
children: "Configure provider capabilities to see deployment coverage."
|
|
2408
2696
|
}, undefined, false, undefined, this),
|
|
2409
|
-
model.error ? /* @__PURE__ */
|
|
2697
|
+
model.error ? /* @__PURE__ */ jsxDEV8("p", {
|
|
2410
2698
|
className: "absolute-voice-provider-capabilities__error",
|
|
2411
2699
|
children: model.error
|
|
2412
2700
|
}, undefined, false, undefined, this) : null
|
|
@@ -2414,7 +2702,7 @@ var VoiceProviderCapabilities = ({
|
|
|
2414
2702
|
}, undefined, true, undefined, this);
|
|
2415
2703
|
};
|
|
2416
2704
|
// src/react/useVoiceProviderContracts.tsx
|
|
2417
|
-
import { useEffect as
|
|
2705
|
+
import { useEffect as useEffect9, useRef as useRef9, useSyncExternalStore as useSyncExternalStore9 } from "react";
|
|
2418
2706
|
|
|
2419
2707
|
// src/client/providerContracts.ts
|
|
2420
2708
|
var fetchVoiceProviderContracts = async (path = "/api/provider-contracts", options = {}) => {
|
|
@@ -2493,25 +2781,25 @@ var createVoiceProviderContractsStore = (path = "/api/provider-contracts", optio
|
|
|
2493
2781
|
|
|
2494
2782
|
// src/react/useVoiceProviderContracts.tsx
|
|
2495
2783
|
var useVoiceProviderContracts = (path = "/api/provider-contracts", options = {}) => {
|
|
2496
|
-
const storeRef =
|
|
2784
|
+
const storeRef = useRef9(null);
|
|
2497
2785
|
if (!storeRef.current) {
|
|
2498
2786
|
storeRef.current = createVoiceProviderContractsStore(path, options);
|
|
2499
2787
|
}
|
|
2500
2788
|
const store = storeRef.current;
|
|
2501
|
-
|
|
2789
|
+
useEffect9(() => {
|
|
2502
2790
|
store.refresh().catch(() => {});
|
|
2503
2791
|
return () => store.close();
|
|
2504
2792
|
}, [store]);
|
|
2505
2793
|
return {
|
|
2506
|
-
...
|
|
2794
|
+
...useSyncExternalStore9(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
2507
2795
|
refresh: store.refresh
|
|
2508
2796
|
};
|
|
2509
2797
|
};
|
|
2510
2798
|
|
|
2511
2799
|
// src/client/providerContractsWidget.ts
|
|
2512
|
-
var
|
|
2513
|
-
var
|
|
2514
|
-
var
|
|
2800
|
+
var DEFAULT_TITLE8 = "Provider Contracts";
|
|
2801
|
+
var DEFAULT_DESCRIPTION8 = "Production contract coverage for provider env, latency, fallback, streaming, and capabilities.";
|
|
2802
|
+
var escapeHtml9 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
2515
2803
|
var formatProvider2 = (provider) => provider.split(/[-_\s]+/).filter(Boolean).map((part) => `${part[0]?.toUpperCase() ?? ""}${part.slice(1)}`).join(" ") || provider;
|
|
2516
2804
|
var formatStatus3 = (status) => status.split("-").map((part) => `${part[0]?.toUpperCase() ?? ""}${part.slice(1)}`).join(" ");
|
|
2517
2805
|
var contractDetail = (row) => {
|
|
@@ -2543,38 +2831,38 @@ var createVoiceProviderContractsViewModel = (snapshot, options = {}) => {
|
|
|
2543
2831
|
}));
|
|
2544
2832
|
const warningCount = snapshot.report ? snapshot.report.failed + snapshot.report.warned : rows.filter((row) => row.status !== "pass").length;
|
|
2545
2833
|
return {
|
|
2546
|
-
description: options.description ??
|
|
2834
|
+
description: options.description ?? DEFAULT_DESCRIPTION8,
|
|
2547
2835
|
error: snapshot.error,
|
|
2548
2836
|
isLoading: snapshot.isLoading,
|
|
2549
2837
|
label: snapshot.error ? "Unavailable" : rows.length ? warningCount > 0 ? `${warningCount} needs attention` : `${rows.length} passing` : snapshot.isLoading ? "Checking" : "No contracts",
|
|
2550
2838
|
rows,
|
|
2551
2839
|
status: snapshot.error ? "error" : rows.length ? warningCount > 0 ? "warning" : "ready" : snapshot.isLoading ? "loading" : "empty",
|
|
2552
|
-
title: options.title ??
|
|
2840
|
+
title: options.title ?? DEFAULT_TITLE8,
|
|
2553
2841
|
updatedAt: snapshot.updatedAt
|
|
2554
2842
|
};
|
|
2555
2843
|
};
|
|
2556
2844
|
var renderVoiceProviderContractsHTML = (snapshot, options = {}) => {
|
|
2557
2845
|
const model = createVoiceProviderContractsViewModel(snapshot, options);
|
|
2558
|
-
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--${
|
|
2846
|
+
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--${escapeHtml9(row.status)}">
|
|
2559
2847
|
<header>
|
|
2560
|
-
<strong>${
|
|
2561
|
-
<span>${
|
|
2848
|
+
<strong>${escapeHtml9(row.label)}</strong>
|
|
2849
|
+
<span>${escapeHtml9(formatStatus3(row.status))}</span>
|
|
2562
2850
|
</header>
|
|
2563
|
-
<p>${
|
|
2564
|
-
${row.remediations.length ? `<ul class="absolute-voice-provider-contracts__remediations">${row.remediations.map((remediation) => `<li>${remediation.href ? `<a href="${
|
|
2851
|
+
<p>${escapeHtml9(row.detail)}</p>
|
|
2852
|
+
${row.remediations.length ? `<ul class="absolute-voice-provider-contracts__remediations">${row.remediations.map((remediation) => `<li>${remediation.href ? `<a href="${escapeHtml9(remediation.href)}">${escapeHtml9(remediation.label)}</a>` : `<strong>${escapeHtml9(remediation.label)}</strong>`}<span>${escapeHtml9(remediation.detail)}</span></li>`).join("")}</ul>` : ""}
|
|
2565
2853
|
<dl>${row.rows.map((item) => `<div>
|
|
2566
|
-
<dt>${
|
|
2567
|
-
<dd>${
|
|
2854
|
+
<dt>${escapeHtml9(item.label)}</dt>
|
|
2855
|
+
<dd>${escapeHtml9(item.value)}</dd>
|
|
2568
2856
|
</div>`).join("")}</dl>
|
|
2569
2857
|
</article>`).join("")}</div>` : '<p class="absolute-voice-provider-contracts__empty">Configure provider contracts to see production coverage.</p>';
|
|
2570
|
-
return `<section class="absolute-voice-provider-contracts absolute-voice-provider-contracts--${
|
|
2858
|
+
return `<section class="absolute-voice-provider-contracts absolute-voice-provider-contracts--${escapeHtml9(model.status)}">
|
|
2571
2859
|
<header class="absolute-voice-provider-contracts__header">
|
|
2572
|
-
<span class="absolute-voice-provider-contracts__eyebrow">${
|
|
2573
|
-
<strong class="absolute-voice-provider-contracts__label">${
|
|
2860
|
+
<span class="absolute-voice-provider-contracts__eyebrow">${escapeHtml9(model.title)}</span>
|
|
2861
|
+
<strong class="absolute-voice-provider-contracts__label">${escapeHtml9(model.label)}</strong>
|
|
2574
2862
|
</header>
|
|
2575
|
-
<p class="absolute-voice-provider-contracts__description">${
|
|
2863
|
+
<p class="absolute-voice-provider-contracts__description">${escapeHtml9(model.description)}</p>
|
|
2576
2864
|
${rows}
|
|
2577
|
-
${model.error ? `<p class="absolute-voice-provider-contracts__error">${
|
|
2865
|
+
${model.error ? `<p class="absolute-voice-provider-contracts__error">${escapeHtml9(model.error)}</p>` : ""}
|
|
2578
2866
|
</section>`;
|
|
2579
2867
|
};
|
|
2580
2868
|
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}`;
|
|
@@ -2616,7 +2904,7 @@ var defineVoiceProviderContractsElement = (tagName = "absolute-voice-provider-co
|
|
|
2616
2904
|
};
|
|
2617
2905
|
|
|
2618
2906
|
// src/react/VoiceProviderContracts.tsx
|
|
2619
|
-
import { jsxDEV as
|
|
2907
|
+
import { jsxDEV as jsxDEV9 } from "react/jsx-dev-runtime";
|
|
2620
2908
|
var VoiceProviderContracts = ({
|
|
2621
2909
|
className,
|
|
2622
2910
|
path = "/api/provider-contracts",
|
|
@@ -2624,74 +2912,74 @@ var VoiceProviderContracts = ({
|
|
|
2624
2912
|
}) => {
|
|
2625
2913
|
const snapshot = useVoiceProviderContracts(path, options);
|
|
2626
2914
|
const model = createVoiceProviderContractsViewModel(snapshot, options);
|
|
2627
|
-
return /* @__PURE__ */
|
|
2915
|
+
return /* @__PURE__ */ jsxDEV9("section", {
|
|
2628
2916
|
className: [
|
|
2629
2917
|
"absolute-voice-provider-contracts",
|
|
2630
2918
|
`absolute-voice-provider-contracts--${model.status}`,
|
|
2631
2919
|
className
|
|
2632
2920
|
].filter(Boolean).join(" "),
|
|
2633
2921
|
children: [
|
|
2634
|
-
/* @__PURE__ */
|
|
2922
|
+
/* @__PURE__ */ jsxDEV9("header", {
|
|
2635
2923
|
className: "absolute-voice-provider-contracts__header",
|
|
2636
2924
|
children: [
|
|
2637
|
-
/* @__PURE__ */
|
|
2925
|
+
/* @__PURE__ */ jsxDEV9("span", {
|
|
2638
2926
|
className: "absolute-voice-provider-contracts__eyebrow",
|
|
2639
2927
|
children: model.title
|
|
2640
2928
|
}, undefined, false, undefined, this),
|
|
2641
|
-
/* @__PURE__ */
|
|
2929
|
+
/* @__PURE__ */ jsxDEV9("strong", {
|
|
2642
2930
|
className: "absolute-voice-provider-contracts__label",
|
|
2643
2931
|
children: model.label
|
|
2644
2932
|
}, undefined, false, undefined, this)
|
|
2645
2933
|
]
|
|
2646
2934
|
}, undefined, true, undefined, this),
|
|
2647
|
-
/* @__PURE__ */
|
|
2935
|
+
/* @__PURE__ */ jsxDEV9("p", {
|
|
2648
2936
|
className: "absolute-voice-provider-contracts__description",
|
|
2649
2937
|
children: model.description
|
|
2650
2938
|
}, undefined, false, undefined, this),
|
|
2651
|
-
model.rows.length ? /* @__PURE__ */
|
|
2939
|
+
model.rows.length ? /* @__PURE__ */ jsxDEV9("div", {
|
|
2652
2940
|
className: "absolute-voice-provider-contracts__rows",
|
|
2653
|
-
children: model.rows.map((row) => /* @__PURE__ */
|
|
2941
|
+
children: model.rows.map((row) => /* @__PURE__ */ jsxDEV9("article", {
|
|
2654
2942
|
className: [
|
|
2655
2943
|
"absolute-voice-provider-contracts__row",
|
|
2656
2944
|
`absolute-voice-provider-contracts__row--${row.status}`
|
|
2657
2945
|
].join(" "),
|
|
2658
2946
|
children: [
|
|
2659
|
-
/* @__PURE__ */
|
|
2947
|
+
/* @__PURE__ */ jsxDEV9("header", {
|
|
2660
2948
|
children: [
|
|
2661
|
-
/* @__PURE__ */
|
|
2949
|
+
/* @__PURE__ */ jsxDEV9("strong", {
|
|
2662
2950
|
children: row.label
|
|
2663
2951
|
}, undefined, false, undefined, this),
|
|
2664
|
-
/* @__PURE__ */
|
|
2952
|
+
/* @__PURE__ */ jsxDEV9("span", {
|
|
2665
2953
|
children: row.status
|
|
2666
2954
|
}, undefined, false, undefined, this)
|
|
2667
2955
|
]
|
|
2668
2956
|
}, undefined, true, undefined, this),
|
|
2669
|
-
/* @__PURE__ */
|
|
2957
|
+
/* @__PURE__ */ jsxDEV9("p", {
|
|
2670
2958
|
children: row.detail
|
|
2671
2959
|
}, undefined, false, undefined, this),
|
|
2672
|
-
row.remediations.length ? /* @__PURE__ */
|
|
2960
|
+
row.remediations.length ? /* @__PURE__ */ jsxDEV9("ul", {
|
|
2673
2961
|
className: "absolute-voice-provider-contracts__remediations",
|
|
2674
|
-
children: row.remediations.map((remediation) => /* @__PURE__ */
|
|
2962
|
+
children: row.remediations.map((remediation) => /* @__PURE__ */ jsxDEV9("li", {
|
|
2675
2963
|
children: [
|
|
2676
|
-
remediation.href ? /* @__PURE__ */
|
|
2964
|
+
remediation.href ? /* @__PURE__ */ jsxDEV9("a", {
|
|
2677
2965
|
href: remediation.href,
|
|
2678
2966
|
children: remediation.label
|
|
2679
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
2967
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV9("strong", {
|
|
2680
2968
|
children: remediation.label
|
|
2681
2969
|
}, undefined, false, undefined, this),
|
|
2682
|
-
/* @__PURE__ */
|
|
2970
|
+
/* @__PURE__ */ jsxDEV9("span", {
|
|
2683
2971
|
children: remediation.detail
|
|
2684
2972
|
}, undefined, false, undefined, this)
|
|
2685
2973
|
]
|
|
2686
2974
|
}, `${row.kind}:${row.provider}:${remediation.label}`, true, undefined, this))
|
|
2687
2975
|
}, undefined, false, undefined, this) : null,
|
|
2688
|
-
/* @__PURE__ */
|
|
2689
|
-
children: row.rows.map((item) => /* @__PURE__ */
|
|
2976
|
+
/* @__PURE__ */ jsxDEV9("dl", {
|
|
2977
|
+
children: row.rows.map((item) => /* @__PURE__ */ jsxDEV9("div", {
|
|
2690
2978
|
children: [
|
|
2691
|
-
/* @__PURE__ */
|
|
2979
|
+
/* @__PURE__ */ jsxDEV9("dt", {
|
|
2692
2980
|
children: item.label
|
|
2693
2981
|
}, undefined, false, undefined, this),
|
|
2694
|
-
/* @__PURE__ */
|
|
2982
|
+
/* @__PURE__ */ jsxDEV9("dd", {
|
|
2695
2983
|
children: item.value
|
|
2696
2984
|
}, undefined, false, undefined, this)
|
|
2697
2985
|
]
|
|
@@ -2699,11 +2987,11 @@ var VoiceProviderContracts = ({
|
|
|
2699
2987
|
}, undefined, false, undefined, this)
|
|
2700
2988
|
]
|
|
2701
2989
|
}, `${row.kind}:${row.provider}`, true, undefined, this))
|
|
2702
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
2990
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV9("p", {
|
|
2703
2991
|
className: "absolute-voice-provider-contracts__empty",
|
|
2704
2992
|
children: "Configure provider contracts to see production coverage."
|
|
2705
2993
|
}, undefined, false, undefined, this),
|
|
2706
|
-
model.error ? /* @__PURE__ */
|
|
2994
|
+
model.error ? /* @__PURE__ */ jsxDEV9("p", {
|
|
2707
2995
|
className: "absolute-voice-provider-contracts__error",
|
|
2708
2996
|
children: model.error
|
|
2709
2997
|
}, undefined, false, undefined, this) : null
|
|
@@ -2711,7 +2999,7 @@ var VoiceProviderContracts = ({
|
|
|
2711
2999
|
}, undefined, true, undefined, this);
|
|
2712
3000
|
};
|
|
2713
3001
|
// src/react/useVoiceProviderStatus.tsx
|
|
2714
|
-
import { useEffect as
|
|
3002
|
+
import { useEffect as useEffect10, useRef as useRef10, useSyncExternalStore as useSyncExternalStore10 } from "react";
|
|
2715
3003
|
|
|
2716
3004
|
// src/client/providerStatus.ts
|
|
2717
3005
|
var fetchVoiceProviderStatus = async (path = "/api/provider-status", options = {}) => {
|
|
@@ -2795,25 +3083,25 @@ var createVoiceProviderStatusStore = (path = "/api/provider-status", options = {
|
|
|
2795
3083
|
|
|
2796
3084
|
// src/react/useVoiceProviderStatus.tsx
|
|
2797
3085
|
var useVoiceProviderStatus = (path = "/api/provider-status", options = {}) => {
|
|
2798
|
-
const storeRef =
|
|
3086
|
+
const storeRef = useRef10(null);
|
|
2799
3087
|
if (!storeRef.current) {
|
|
2800
3088
|
storeRef.current = createVoiceProviderStatusStore(path, options);
|
|
2801
3089
|
}
|
|
2802
3090
|
const store = storeRef.current;
|
|
2803
|
-
|
|
3091
|
+
useEffect10(() => {
|
|
2804
3092
|
store.refresh().catch(() => {});
|
|
2805
3093
|
return () => store.close();
|
|
2806
3094
|
}, [store]);
|
|
2807
3095
|
return {
|
|
2808
|
-
...
|
|
3096
|
+
...useSyncExternalStore10(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
2809
3097
|
refresh: store.refresh
|
|
2810
3098
|
};
|
|
2811
3099
|
};
|
|
2812
3100
|
|
|
2813
3101
|
// src/client/providerStatusWidget.ts
|
|
2814
|
-
var
|
|
2815
|
-
var
|
|
2816
|
-
var
|
|
3102
|
+
var DEFAULT_TITLE9 = "Voice Providers";
|
|
3103
|
+
var DEFAULT_DESCRIPTION9 = "Live provider health, fallback counts, latency, and suppression state from your self-hosted trace store.";
|
|
3104
|
+
var escapeHtml10 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
2817
3105
|
var formatProvider3 = (provider) => provider.split(/[-_\s]+/).filter(Boolean).map((part) => `${part[0]?.toUpperCase() ?? ""}${part.slice(1)}`).join(" ") || provider;
|
|
2818
3106
|
var formatStatus4 = (status) => status.split("-").map((part) => `${part[0]?.toUpperCase() ?? ""}${part.slice(1)}`).join(" ");
|
|
2819
3107
|
var formatLatency = (value) => typeof value === "number" ? `${value}ms` : "No samples";
|
|
@@ -2857,37 +3145,37 @@ var createVoiceProviderStatusViewModel = (snapshot, options = {}) => {
|
|
|
2857
3145
|
const warningCount = providers.filter((provider) => isWarningStatus2(provider.status)).length;
|
|
2858
3146
|
const healthyCount = providers.filter((provider) => provider.status === "healthy").length;
|
|
2859
3147
|
return {
|
|
2860
|
-
description: options.description ??
|
|
3148
|
+
description: options.description ?? DEFAULT_DESCRIPTION9,
|
|
2861
3149
|
error: snapshot.error,
|
|
2862
3150
|
isLoading: snapshot.isLoading,
|
|
2863
3151
|
label: snapshot.error ? "Unavailable" : providers.length ? warningCount > 0 ? `${warningCount} needs attention` : `${healthyCount} healthy` : snapshot.isLoading ? "Checking" : "No provider traffic",
|
|
2864
3152
|
providers,
|
|
2865
3153
|
status: snapshot.error ? "error" : providers.length ? warningCount > 0 ? "warning" : "ready" : snapshot.isLoading ? "loading" : "empty",
|
|
2866
|
-
title: options.title ??
|
|
3154
|
+
title: options.title ?? DEFAULT_TITLE9,
|
|
2867
3155
|
updatedAt: snapshot.updatedAt
|
|
2868
3156
|
};
|
|
2869
3157
|
};
|
|
2870
3158
|
var renderVoiceProviderStatusHTML = (snapshot, options = {}) => {
|
|
2871
3159
|
const model = createVoiceProviderStatusViewModel(snapshot, options);
|
|
2872
|
-
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--${
|
|
3160
|
+
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--${escapeHtml10(provider.status)}">
|
|
2873
3161
|
<header>
|
|
2874
|
-
<strong>${
|
|
2875
|
-
<span>${
|
|
3162
|
+
<strong>${escapeHtml10(provider.label)}</strong>
|
|
3163
|
+
<span>${escapeHtml10(formatStatus4(provider.status))}</span>
|
|
2876
3164
|
</header>
|
|
2877
|
-
<p>${
|
|
3165
|
+
<p>${escapeHtml10(provider.detail)}</p>
|
|
2878
3166
|
<dl>${provider.rows.map((row) => `<div>
|
|
2879
|
-
<dt>${
|
|
2880
|
-
<dd>${
|
|
3167
|
+
<dt>${escapeHtml10(row.label)}</dt>
|
|
3168
|
+
<dd>${escapeHtml10(row.value)}</dd>
|
|
2881
3169
|
</div>`).join("")}</dl>
|
|
2882
3170
|
</article>`).join("")}</div>` : '<p class="absolute-voice-provider-status__empty">Run voice traffic to see provider health.</p>';
|
|
2883
|
-
return `<section class="absolute-voice-provider-status absolute-voice-provider-status--${
|
|
3171
|
+
return `<section class="absolute-voice-provider-status absolute-voice-provider-status--${escapeHtml10(model.status)}">
|
|
2884
3172
|
<header class="absolute-voice-provider-status__header">
|
|
2885
|
-
<span class="absolute-voice-provider-status__eyebrow">${
|
|
2886
|
-
<strong class="absolute-voice-provider-status__label">${
|
|
3173
|
+
<span class="absolute-voice-provider-status__eyebrow">${escapeHtml10(model.title)}</span>
|
|
3174
|
+
<strong class="absolute-voice-provider-status__label">${escapeHtml10(model.label)}</strong>
|
|
2887
3175
|
</header>
|
|
2888
|
-
<p class="absolute-voice-provider-status__description">${
|
|
3176
|
+
<p class="absolute-voice-provider-status__description">${escapeHtml10(model.description)}</p>
|
|
2889
3177
|
${providers}
|
|
2890
|
-
${model.error ? `<p class="absolute-voice-provider-status__error">${
|
|
3178
|
+
${model.error ? `<p class="absolute-voice-provider-status__error">${escapeHtml10(model.error)}</p>` : ""}
|
|
2891
3179
|
</section>`;
|
|
2892
3180
|
};
|
|
2893
3181
|
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}`;
|
|
@@ -2929,7 +3217,7 @@ var defineVoiceProviderStatusElement = (tagName = "absolute-voice-provider-statu
|
|
|
2929
3217
|
};
|
|
2930
3218
|
|
|
2931
3219
|
// src/react/VoiceProviderStatus.tsx
|
|
2932
|
-
import { jsxDEV as
|
|
3220
|
+
import { jsxDEV as jsxDEV10 } from "react/jsx-dev-runtime";
|
|
2933
3221
|
var VoiceProviderStatus = ({
|
|
2934
3222
|
className,
|
|
2935
3223
|
path = "/api/provider-status",
|
|
@@ -2937,58 +3225,58 @@ var VoiceProviderStatus = ({
|
|
|
2937
3225
|
}) => {
|
|
2938
3226
|
const snapshot = useVoiceProviderStatus(path, options);
|
|
2939
3227
|
const model = createVoiceProviderStatusViewModel(snapshot, options);
|
|
2940
|
-
return /* @__PURE__ */
|
|
3228
|
+
return /* @__PURE__ */ jsxDEV10("section", {
|
|
2941
3229
|
className: [
|
|
2942
3230
|
"absolute-voice-provider-status",
|
|
2943
3231
|
`absolute-voice-provider-status--${model.status}`,
|
|
2944
3232
|
className
|
|
2945
3233
|
].filter(Boolean).join(" "),
|
|
2946
3234
|
children: [
|
|
2947
|
-
/* @__PURE__ */
|
|
3235
|
+
/* @__PURE__ */ jsxDEV10("header", {
|
|
2948
3236
|
className: "absolute-voice-provider-status__header",
|
|
2949
3237
|
children: [
|
|
2950
|
-
/* @__PURE__ */
|
|
3238
|
+
/* @__PURE__ */ jsxDEV10("span", {
|
|
2951
3239
|
className: "absolute-voice-provider-status__eyebrow",
|
|
2952
3240
|
children: model.title
|
|
2953
3241
|
}, undefined, false, undefined, this),
|
|
2954
|
-
/* @__PURE__ */
|
|
3242
|
+
/* @__PURE__ */ jsxDEV10("strong", {
|
|
2955
3243
|
className: "absolute-voice-provider-status__label",
|
|
2956
3244
|
children: model.label
|
|
2957
3245
|
}, undefined, false, undefined, this)
|
|
2958
3246
|
]
|
|
2959
3247
|
}, undefined, true, undefined, this),
|
|
2960
|
-
/* @__PURE__ */
|
|
3248
|
+
/* @__PURE__ */ jsxDEV10("p", {
|
|
2961
3249
|
className: "absolute-voice-provider-status__description",
|
|
2962
3250
|
children: model.description
|
|
2963
3251
|
}, undefined, false, undefined, this),
|
|
2964
|
-
model.providers.length ? /* @__PURE__ */
|
|
3252
|
+
model.providers.length ? /* @__PURE__ */ jsxDEV10("div", {
|
|
2965
3253
|
className: "absolute-voice-provider-status__providers",
|
|
2966
|
-
children: model.providers.map((provider) => /* @__PURE__ */
|
|
3254
|
+
children: model.providers.map((provider) => /* @__PURE__ */ jsxDEV10("article", {
|
|
2967
3255
|
className: [
|
|
2968
3256
|
"absolute-voice-provider-status__provider",
|
|
2969
3257
|
`absolute-voice-provider-status__provider--${provider.status}`
|
|
2970
3258
|
].join(" "),
|
|
2971
3259
|
children: [
|
|
2972
|
-
/* @__PURE__ */
|
|
3260
|
+
/* @__PURE__ */ jsxDEV10("header", {
|
|
2973
3261
|
children: [
|
|
2974
|
-
/* @__PURE__ */
|
|
3262
|
+
/* @__PURE__ */ jsxDEV10("strong", {
|
|
2975
3263
|
children: provider.label
|
|
2976
3264
|
}, undefined, false, undefined, this),
|
|
2977
|
-
/* @__PURE__ */
|
|
3265
|
+
/* @__PURE__ */ jsxDEV10("span", {
|
|
2978
3266
|
children: provider.status
|
|
2979
3267
|
}, undefined, false, undefined, this)
|
|
2980
3268
|
]
|
|
2981
3269
|
}, undefined, true, undefined, this),
|
|
2982
|
-
/* @__PURE__ */
|
|
3270
|
+
/* @__PURE__ */ jsxDEV10("p", {
|
|
2983
3271
|
children: provider.detail
|
|
2984
3272
|
}, undefined, false, undefined, this),
|
|
2985
|
-
/* @__PURE__ */
|
|
2986
|
-
children: provider.rows.map((row) => /* @__PURE__ */
|
|
3273
|
+
/* @__PURE__ */ jsxDEV10("dl", {
|
|
3274
|
+
children: provider.rows.map((row) => /* @__PURE__ */ jsxDEV10("div", {
|
|
2987
3275
|
children: [
|
|
2988
|
-
/* @__PURE__ */
|
|
3276
|
+
/* @__PURE__ */ jsxDEV10("dt", {
|
|
2989
3277
|
children: row.label
|
|
2990
3278
|
}, undefined, false, undefined, this),
|
|
2991
|
-
/* @__PURE__ */
|
|
3279
|
+
/* @__PURE__ */ jsxDEV10("dd", {
|
|
2992
3280
|
children: row.value
|
|
2993
3281
|
}, undefined, false, undefined, this)
|
|
2994
3282
|
]
|
|
@@ -2996,11 +3284,11 @@ var VoiceProviderStatus = ({
|
|
|
2996
3284
|
}, undefined, false, undefined, this)
|
|
2997
3285
|
]
|
|
2998
3286
|
}, provider.provider, true, undefined, this))
|
|
2999
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
3287
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV10("p", {
|
|
3000
3288
|
className: "absolute-voice-provider-status__empty",
|
|
3001
3289
|
children: "Run voice traffic to see provider health."
|
|
3002
3290
|
}, undefined, false, undefined, this),
|
|
3003
|
-
model.error ? /* @__PURE__ */
|
|
3291
|
+
model.error ? /* @__PURE__ */ jsxDEV10("p", {
|
|
3004
3292
|
className: "absolute-voice-provider-status__error",
|
|
3005
3293
|
children: model.error
|
|
3006
3294
|
}, undefined, false, undefined, this) : null
|
|
@@ -3008,7 +3296,7 @@ var VoiceProviderStatus = ({
|
|
|
3008
3296
|
}, undefined, true, undefined, this);
|
|
3009
3297
|
};
|
|
3010
3298
|
// src/react/useVoiceRoutingStatus.tsx
|
|
3011
|
-
import { useEffect as
|
|
3299
|
+
import { useEffect as useEffect11, useRef as useRef11, useSyncExternalStore as useSyncExternalStore11 } from "react";
|
|
3012
3300
|
|
|
3013
3301
|
// src/client/routingStatus.ts
|
|
3014
3302
|
var fetchVoiceRoutingStatus = async (path = "/api/routing/latest", options = {}) => {
|
|
@@ -3092,25 +3380,25 @@ var createVoiceRoutingStatusStore = (path = "/api/routing/latest", options = {})
|
|
|
3092
3380
|
|
|
3093
3381
|
// src/react/useVoiceRoutingStatus.tsx
|
|
3094
3382
|
var useVoiceRoutingStatus = (path = "/api/routing/latest", options = {}) => {
|
|
3095
|
-
const storeRef =
|
|
3383
|
+
const storeRef = useRef11(null);
|
|
3096
3384
|
if (!storeRef.current) {
|
|
3097
3385
|
storeRef.current = createVoiceRoutingStatusStore(path, options);
|
|
3098
3386
|
}
|
|
3099
3387
|
const store = storeRef.current;
|
|
3100
|
-
|
|
3388
|
+
useEffect11(() => {
|
|
3101
3389
|
store.refresh().catch(() => {});
|
|
3102
3390
|
return () => store.close();
|
|
3103
3391
|
}, [store]);
|
|
3104
3392
|
return {
|
|
3105
|
-
...
|
|
3393
|
+
...useSyncExternalStore11(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
3106
3394
|
refresh: store.refresh
|
|
3107
3395
|
};
|
|
3108
3396
|
};
|
|
3109
3397
|
|
|
3110
3398
|
// src/client/routingStatusWidget.ts
|
|
3111
|
-
var
|
|
3112
|
-
var
|
|
3113
|
-
var
|
|
3399
|
+
var DEFAULT_TITLE10 = "Voice Routing";
|
|
3400
|
+
var DEFAULT_DESCRIPTION10 = "Latest provider routing decision from the self-hosted trace store.";
|
|
3401
|
+
var escapeHtml11 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
3114
3402
|
var formatValue = (value, fallback = "None") => typeof value === "string" && value.trim() ? value : typeof value === "number" && Number.isFinite(value) ? String(value) : fallback;
|
|
3115
3403
|
var createVoiceRoutingStatusViewModel = (snapshot, options = {}) => {
|
|
3116
3404
|
const decision = snapshot.decision;
|
|
@@ -3134,30 +3422,30 @@ var createVoiceRoutingStatusViewModel = (snapshot, options = {}) => {
|
|
|
3134
3422
|
] : [];
|
|
3135
3423
|
return {
|
|
3136
3424
|
decision,
|
|
3137
|
-
description: options.description ??
|
|
3425
|
+
description: options.description ?? DEFAULT_DESCRIPTION10,
|
|
3138
3426
|
error: snapshot.error,
|
|
3139
3427
|
isLoading: snapshot.isLoading,
|
|
3140
3428
|
label: snapshot.error ? "Unavailable" : decision ? `${formatValue(decision.kind).toUpperCase()} ${formatValue(decision.status, "unknown")}` : snapshot.isLoading ? "Checking" : "No routing yet",
|
|
3141
3429
|
rows,
|
|
3142
3430
|
status: snapshot.error ? "error" : decision ? "ready" : snapshot.isLoading ? "loading" : "empty",
|
|
3143
|
-
title: options.title ??
|
|
3431
|
+
title: options.title ?? DEFAULT_TITLE10,
|
|
3144
3432
|
updatedAt: snapshot.updatedAt
|
|
3145
3433
|
};
|
|
3146
3434
|
};
|
|
3147
3435
|
var renderVoiceRoutingStatusHTML = (snapshot, options = {}) => {
|
|
3148
3436
|
const model = createVoiceRoutingStatusViewModel(snapshot, options);
|
|
3149
3437
|
const rows = model.rows.length ? `<div class="absolute-voice-routing-status__grid">${model.rows.map((row) => `<div>
|
|
3150
|
-
<span>${
|
|
3151
|
-
<strong>${
|
|
3438
|
+
<span>${escapeHtml11(row.label)}</span>
|
|
3439
|
+
<strong>${escapeHtml11(row.value)}</strong>
|
|
3152
3440
|
</div>`).join("")}</div>` : '<p class="absolute-voice-routing-status__empty">Start a voice session to see the selected provider.</p>';
|
|
3153
|
-
return `<section class="absolute-voice-routing-status absolute-voice-routing-status--${
|
|
3441
|
+
return `<section class="absolute-voice-routing-status absolute-voice-routing-status--${escapeHtml11(model.status)}">
|
|
3154
3442
|
<header class="absolute-voice-routing-status__header">
|
|
3155
|
-
<span class="absolute-voice-routing-status__eyebrow">${
|
|
3156
|
-
<strong class="absolute-voice-routing-status__label">${
|
|
3443
|
+
<span class="absolute-voice-routing-status__eyebrow">${escapeHtml11(model.title)}</span>
|
|
3444
|
+
<strong class="absolute-voice-routing-status__label">${escapeHtml11(model.label)}</strong>
|
|
3157
3445
|
</header>
|
|
3158
|
-
<p class="absolute-voice-routing-status__description">${
|
|
3446
|
+
<p class="absolute-voice-routing-status__description">${escapeHtml11(model.description)}</p>
|
|
3159
3447
|
${rows}
|
|
3160
|
-
${model.error ? `<p class="absolute-voice-routing-status__error">${
|
|
3448
|
+
${model.error ? `<p class="absolute-voice-routing-status__error">${escapeHtml11(model.error)}</p>` : ""}
|
|
3161
3449
|
</section>`;
|
|
3162
3450
|
};
|
|
3163
3451
|
var getVoiceRoutingStatusCSS = () => `.absolute-voice-routing-status{border:1px solid #d8d2c4;border-radius:20px;background:#fffaf0;color:#16130d;padding:18px;box-shadow:0 18px 40px rgba(47,37,18,.12);font-family:inherit}.absolute-voice-routing-status--error{border-color:#f2a7a7;background:#fff5f3}.absolute-voice-routing-status__header{align-items:start;display:flex;gap:12px;justify-content:space-between}.absolute-voice-routing-status__eyebrow{color:#73664f;font-size:12px;font-weight:800;letter-spacing:.08em;text-transform:uppercase}.absolute-voice-routing-status__label{font-size:24px;line-height:1}.absolute-voice-routing-status__description{color:#514733;margin:12px 0 0}.absolute-voice-routing-status__grid{display:grid;gap:8px;grid-template-columns:repeat(2,minmax(0,1fr));margin-top:14px}.absolute-voice-routing-status__grid div{background:#fff;border:1px solid #eee4d2;border-radius:14px;padding:10px 12px}.absolute-voice-routing-status__grid span{color:#655944;display:block;font-size:12px;margin-bottom:4px}.absolute-voice-routing-status__grid strong{overflow-wrap:anywhere}.absolute-voice-routing-status__empty{color:#655944;margin:14px 0 0}.absolute-voice-routing-status__error{color:#9f1239;font-weight:700}`;
|
|
@@ -3199,7 +3487,7 @@ var defineVoiceRoutingStatusElement = (tagName = "absolute-voice-routing-status"
|
|
|
3199
3487
|
};
|
|
3200
3488
|
|
|
3201
3489
|
// src/react/VoiceRoutingStatus.tsx
|
|
3202
|
-
import { jsxDEV as
|
|
3490
|
+
import { jsxDEV as jsxDEV11 } from "react/jsx-dev-runtime";
|
|
3203
3491
|
var VoiceRoutingStatus = ({
|
|
3204
3492
|
className,
|
|
3205
3493
|
path = "/api/routing/latest",
|
|
@@ -3207,47 +3495,47 @@ var VoiceRoutingStatus = ({
|
|
|
3207
3495
|
}) => {
|
|
3208
3496
|
const snapshot = useVoiceRoutingStatus(path, options);
|
|
3209
3497
|
const model = createVoiceRoutingStatusViewModel(snapshot, options);
|
|
3210
|
-
return /* @__PURE__ */
|
|
3498
|
+
return /* @__PURE__ */ jsxDEV11("section", {
|
|
3211
3499
|
className: [
|
|
3212
3500
|
"absolute-voice-routing-status",
|
|
3213
3501
|
`absolute-voice-routing-status--${model.status}`,
|
|
3214
3502
|
className
|
|
3215
3503
|
].filter(Boolean).join(" "),
|
|
3216
3504
|
children: [
|
|
3217
|
-
/* @__PURE__ */
|
|
3505
|
+
/* @__PURE__ */ jsxDEV11("header", {
|
|
3218
3506
|
className: "absolute-voice-routing-status__header",
|
|
3219
3507
|
children: [
|
|
3220
|
-
/* @__PURE__ */
|
|
3508
|
+
/* @__PURE__ */ jsxDEV11("span", {
|
|
3221
3509
|
className: "absolute-voice-routing-status__eyebrow",
|
|
3222
3510
|
children: model.title
|
|
3223
3511
|
}, undefined, false, undefined, this),
|
|
3224
|
-
/* @__PURE__ */
|
|
3512
|
+
/* @__PURE__ */ jsxDEV11("strong", {
|
|
3225
3513
|
className: "absolute-voice-routing-status__label",
|
|
3226
3514
|
children: model.label
|
|
3227
3515
|
}, undefined, false, undefined, this)
|
|
3228
3516
|
]
|
|
3229
3517
|
}, undefined, true, undefined, this),
|
|
3230
|
-
/* @__PURE__ */
|
|
3518
|
+
/* @__PURE__ */ jsxDEV11("p", {
|
|
3231
3519
|
className: "absolute-voice-routing-status__description",
|
|
3232
3520
|
children: model.description
|
|
3233
3521
|
}, undefined, false, undefined, this),
|
|
3234
|
-
model.rows.length ? /* @__PURE__ */
|
|
3522
|
+
model.rows.length ? /* @__PURE__ */ jsxDEV11("div", {
|
|
3235
3523
|
className: "absolute-voice-routing-status__grid",
|
|
3236
|
-
children: model.rows.map((row) => /* @__PURE__ */
|
|
3524
|
+
children: model.rows.map((row) => /* @__PURE__ */ jsxDEV11("div", {
|
|
3237
3525
|
children: [
|
|
3238
|
-
/* @__PURE__ */
|
|
3526
|
+
/* @__PURE__ */ jsxDEV11("span", {
|
|
3239
3527
|
children: row.label
|
|
3240
3528
|
}, undefined, false, undefined, this),
|
|
3241
|
-
/* @__PURE__ */
|
|
3529
|
+
/* @__PURE__ */ jsxDEV11("strong", {
|
|
3242
3530
|
children: row.value
|
|
3243
3531
|
}, undefined, false, undefined, this)
|
|
3244
3532
|
]
|
|
3245
3533
|
}, row.label, true, undefined, this))
|
|
3246
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
3534
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV11("p", {
|
|
3247
3535
|
className: "absolute-voice-routing-status__empty",
|
|
3248
3536
|
children: "Start a voice session to see the selected provider."
|
|
3249
3537
|
}, undefined, false, undefined, this),
|
|
3250
|
-
model.error ? /* @__PURE__ */
|
|
3538
|
+
model.error ? /* @__PURE__ */ jsxDEV11("p", {
|
|
3251
3539
|
className: "absolute-voice-routing-status__error",
|
|
3252
3540
|
children: model.error
|
|
3253
3541
|
}, undefined, false, undefined, this) : null
|
|
@@ -3335,9 +3623,9 @@ var createVoiceTraceTimelineStore = (path = "/api/voice-traces", options = {}) =
|
|
|
3335
3623
|
};
|
|
3336
3624
|
|
|
3337
3625
|
// src/client/traceTimelineWidget.ts
|
|
3338
|
-
var
|
|
3339
|
-
var
|
|
3340
|
-
var
|
|
3626
|
+
var DEFAULT_TITLE11 = "Voice Traces";
|
|
3627
|
+
var DEFAULT_DESCRIPTION11 = "Latest call timelines with provider latency, fallbacks, handoffs, and errors from your self-hosted trace store.";
|
|
3628
|
+
var escapeHtml12 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
3341
3629
|
var formatMs2 = (value) => typeof value === "number" ? `${value}ms` : "n/a";
|
|
3342
3630
|
var formatProviders = (session) => session.providers.length ? session.providers.map((provider) => provider.provider).join(", ") : "No providers";
|
|
3343
3631
|
var createVoiceTraceTimelineViewModel = (snapshot, options = {}) => {
|
|
@@ -3353,13 +3641,13 @@ var createVoiceTraceTimelineViewModel = (snapshot, options = {}) => {
|
|
|
3353
3641
|
const failed = sessions.filter((session) => session.status === "failed").length;
|
|
3354
3642
|
const warnings = sessions.filter((session) => session.status === "warning").length;
|
|
3355
3643
|
return {
|
|
3356
|
-
description: options.description ??
|
|
3644
|
+
description: options.description ?? DEFAULT_DESCRIPTION11,
|
|
3357
3645
|
error: snapshot.error,
|
|
3358
3646
|
isLoading: snapshot.isLoading,
|
|
3359
3647
|
label: snapshot.error ? "Unavailable" : failed > 0 ? `${failed} failed` : warnings > 0 ? `${warnings} warning` : sessions.length ? `${sessions.length} recent` : snapshot.isLoading ? "Checking" : "No traces yet",
|
|
3360
3648
|
sessions,
|
|
3361
3649
|
status: snapshot.error ? "error" : failed > 0 ? "failed" : warnings > 0 ? "warning" : sessions.length ? "ready" : snapshot.isLoading ? "loading" : "empty",
|
|
3362
|
-
title: options.title ??
|
|
3650
|
+
title: options.title ?? DEFAULT_TITLE11,
|
|
3363
3651
|
updatedAt: snapshot.updatedAt
|
|
3364
3652
|
};
|
|
3365
3653
|
};
|
|
@@ -3367,27 +3655,27 @@ var renderVoiceTraceTimelineWidgetHTML = (snapshot, options = {}) => {
|
|
|
3367
3655
|
const model = createVoiceTraceTimelineViewModel(snapshot, options);
|
|
3368
3656
|
const sessions = model.sessions.length ? `<div class="absolute-voice-trace-timeline__sessions">${model.sessions.map((session) => {
|
|
3369
3657
|
const supportLinks = [
|
|
3370
|
-
`<a href="${
|
|
3371
|
-
session.operationsRecordHref ? `<a href="${
|
|
3372
|
-
session.incidentBundleHref ? `<a href="${
|
|
3658
|
+
`<a href="${escapeHtml12(session.detailHref)}">Open timeline</a>`,
|
|
3659
|
+
session.operationsRecordHref ? `<a href="${escapeHtml12(session.operationsRecordHref)}">Open operations record</a>` : undefined,
|
|
3660
|
+
session.incidentBundleHref ? `<a href="${escapeHtml12(session.incidentBundleHref)}">Export incident bundle</a>` : undefined
|
|
3373
3661
|
].filter(Boolean).join("");
|
|
3374
|
-
return `<article class="absolute-voice-trace-timeline__session absolute-voice-trace-timeline__session--${
|
|
3662
|
+
return `<article class="absolute-voice-trace-timeline__session absolute-voice-trace-timeline__session--${escapeHtml12(session.status)}">
|
|
3375
3663
|
<header>
|
|
3376
|
-
<strong>${
|
|
3377
|
-
<span>${
|
|
3664
|
+
<strong>${escapeHtml12(session.sessionId)}</strong>
|
|
3665
|
+
<span>${escapeHtml12(session.status)}</span>
|
|
3378
3666
|
</header>
|
|
3379
|
-
<p>${
|
|
3667
|
+
<p>${escapeHtml12(session.label)} \xB7 ${escapeHtml12(session.durationLabel)} \xB7 ${escapeHtml12(session.providerLabel)}</p>
|
|
3380
3668
|
<p class="absolute-voice-trace-timeline__actions">${supportLinks}</p>
|
|
3381
3669
|
</article>`;
|
|
3382
3670
|
}).join("")}</div>` : '<p class="absolute-voice-trace-timeline__empty">Run a voice session to see call timelines.</p>';
|
|
3383
|
-
return `<section class="absolute-voice-trace-timeline absolute-voice-trace-timeline--${
|
|
3671
|
+
return `<section class="absolute-voice-trace-timeline absolute-voice-trace-timeline--${escapeHtml12(model.status)}">
|
|
3384
3672
|
<header class="absolute-voice-trace-timeline__header">
|
|
3385
|
-
<span class="absolute-voice-trace-timeline__eyebrow">${
|
|
3386
|
-
<strong class="absolute-voice-trace-timeline__label">${
|
|
3673
|
+
<span class="absolute-voice-trace-timeline__eyebrow">${escapeHtml12(model.title)}</span>
|
|
3674
|
+
<strong class="absolute-voice-trace-timeline__label">${escapeHtml12(model.label)}</strong>
|
|
3387
3675
|
</header>
|
|
3388
|
-
<p class="absolute-voice-trace-timeline__description">${
|
|
3676
|
+
<p class="absolute-voice-trace-timeline__description">${escapeHtml12(model.description)}</p>
|
|
3389
3677
|
${sessions}
|
|
3390
|
-
${model.error ? `<p class="absolute-voice-trace-timeline__error">${
|
|
3678
|
+
${model.error ? `<p class="absolute-voice-trace-timeline__error">${escapeHtml12(model.error)}</p>` : ""}
|
|
3391
3679
|
</section>`;
|
|
3392
3680
|
};
|
|
3393
3681
|
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}`;
|
|
@@ -3434,25 +3722,25 @@ var defineVoiceTraceTimelineElement = (tagName = "absolute-voice-trace-timeline"
|
|
|
3434
3722
|
};
|
|
3435
3723
|
|
|
3436
3724
|
// src/react/useVoiceTraceTimeline.tsx
|
|
3437
|
-
import { useEffect as
|
|
3725
|
+
import { useEffect as useEffect12, useRef as useRef12, useSyncExternalStore as useSyncExternalStore12 } from "react";
|
|
3438
3726
|
var useVoiceTraceTimeline = (path = "/api/voice-traces", options = {}) => {
|
|
3439
|
-
const storeRef =
|
|
3727
|
+
const storeRef = useRef12(null);
|
|
3440
3728
|
if (!storeRef.current) {
|
|
3441
3729
|
storeRef.current = createVoiceTraceTimelineStore(path, options);
|
|
3442
3730
|
}
|
|
3443
3731
|
const store = storeRef.current;
|
|
3444
|
-
|
|
3732
|
+
useEffect12(() => {
|
|
3445
3733
|
store.refresh().catch(() => {});
|
|
3446
3734
|
return () => store.close();
|
|
3447
3735
|
}, [store]);
|
|
3448
3736
|
return {
|
|
3449
|
-
...
|
|
3737
|
+
...useSyncExternalStore12(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
3450
3738
|
refresh: store.refresh
|
|
3451
3739
|
};
|
|
3452
3740
|
};
|
|
3453
3741
|
|
|
3454
3742
|
// src/react/VoiceTraceTimeline.tsx
|
|
3455
|
-
import { jsxDEV as
|
|
3743
|
+
import { jsxDEV as jsxDEV12 } from "react/jsx-dev-runtime";
|
|
3456
3744
|
var VoiceTraceTimeline = ({
|
|
3457
3745
|
className,
|
|
3458
3746
|
path = "/api/voice-traces",
|
|
@@ -3460,49 +3748,49 @@ var VoiceTraceTimeline = ({
|
|
|
3460
3748
|
}) => {
|
|
3461
3749
|
const snapshot = useVoiceTraceTimeline(path, options);
|
|
3462
3750
|
const model = createVoiceTraceTimelineViewModel(snapshot, options);
|
|
3463
|
-
return /* @__PURE__ */
|
|
3751
|
+
return /* @__PURE__ */ jsxDEV12("section", {
|
|
3464
3752
|
className: [
|
|
3465
3753
|
"absolute-voice-trace-timeline",
|
|
3466
3754
|
`absolute-voice-trace-timeline--${model.status}`,
|
|
3467
3755
|
className
|
|
3468
3756
|
].filter(Boolean).join(" "),
|
|
3469
3757
|
children: [
|
|
3470
|
-
/* @__PURE__ */
|
|
3758
|
+
/* @__PURE__ */ jsxDEV12("header", {
|
|
3471
3759
|
className: "absolute-voice-trace-timeline__header",
|
|
3472
3760
|
children: [
|
|
3473
|
-
/* @__PURE__ */
|
|
3761
|
+
/* @__PURE__ */ jsxDEV12("span", {
|
|
3474
3762
|
className: "absolute-voice-trace-timeline__eyebrow",
|
|
3475
3763
|
children: model.title
|
|
3476
3764
|
}, undefined, false, undefined, this),
|
|
3477
|
-
/* @__PURE__ */
|
|
3765
|
+
/* @__PURE__ */ jsxDEV12("strong", {
|
|
3478
3766
|
className: "absolute-voice-trace-timeline__label",
|
|
3479
3767
|
children: model.label
|
|
3480
3768
|
}, undefined, false, undefined, this)
|
|
3481
3769
|
]
|
|
3482
3770
|
}, undefined, true, undefined, this),
|
|
3483
|
-
/* @__PURE__ */
|
|
3771
|
+
/* @__PURE__ */ jsxDEV12("p", {
|
|
3484
3772
|
className: "absolute-voice-trace-timeline__description",
|
|
3485
3773
|
children: model.description
|
|
3486
3774
|
}, undefined, false, undefined, this),
|
|
3487
|
-
model.sessions.length ? /* @__PURE__ */
|
|
3775
|
+
model.sessions.length ? /* @__PURE__ */ jsxDEV12("div", {
|
|
3488
3776
|
className: "absolute-voice-trace-timeline__sessions",
|
|
3489
|
-
children: model.sessions.map((session) => /* @__PURE__ */
|
|
3777
|
+
children: model.sessions.map((session) => /* @__PURE__ */ jsxDEV12("article", {
|
|
3490
3778
|
className: [
|
|
3491
3779
|
"absolute-voice-trace-timeline__session",
|
|
3492
3780
|
`absolute-voice-trace-timeline__session--${session.status}`
|
|
3493
3781
|
].join(" "),
|
|
3494
3782
|
children: [
|
|
3495
|
-
/* @__PURE__ */
|
|
3783
|
+
/* @__PURE__ */ jsxDEV12("header", {
|
|
3496
3784
|
children: [
|
|
3497
|
-
/* @__PURE__ */
|
|
3785
|
+
/* @__PURE__ */ jsxDEV12("strong", {
|
|
3498
3786
|
children: session.sessionId
|
|
3499
3787
|
}, undefined, false, undefined, this),
|
|
3500
|
-
/* @__PURE__ */
|
|
3788
|
+
/* @__PURE__ */ jsxDEV12("span", {
|
|
3501
3789
|
children: session.status
|
|
3502
3790
|
}, undefined, false, undefined, this)
|
|
3503
3791
|
]
|
|
3504
3792
|
}, undefined, true, undefined, this),
|
|
3505
|
-
/* @__PURE__ */
|
|
3793
|
+
/* @__PURE__ */ jsxDEV12("p", {
|
|
3506
3794
|
children: [
|
|
3507
3795
|
session.label,
|
|
3508
3796
|
" \xB7 ",
|
|
@@ -3512,18 +3800,18 @@ var VoiceTraceTimeline = ({
|
|
|
3512
3800
|
session.providerLabel
|
|
3513
3801
|
]
|
|
3514
3802
|
}, undefined, true, undefined, this),
|
|
3515
|
-
/* @__PURE__ */
|
|
3803
|
+
/* @__PURE__ */ jsxDEV12("p", {
|
|
3516
3804
|
className: "absolute-voice-trace-timeline__actions",
|
|
3517
3805
|
children: [
|
|
3518
|
-
/* @__PURE__ */
|
|
3806
|
+
/* @__PURE__ */ jsxDEV12("a", {
|
|
3519
3807
|
href: session.detailHref,
|
|
3520
3808
|
children: "Open timeline"
|
|
3521
3809
|
}, undefined, false, undefined, this),
|
|
3522
|
-
session.operationsRecordHref ? /* @__PURE__ */
|
|
3810
|
+
session.operationsRecordHref ? /* @__PURE__ */ jsxDEV12("a", {
|
|
3523
3811
|
href: session.operationsRecordHref,
|
|
3524
3812
|
children: "Open operations record"
|
|
3525
3813
|
}, undefined, false, undefined, this) : null,
|
|
3526
|
-
session.incidentBundleHref ? /* @__PURE__ */
|
|
3814
|
+
session.incidentBundleHref ? /* @__PURE__ */ jsxDEV12("a", {
|
|
3527
3815
|
href: session.incidentBundleHref,
|
|
3528
3816
|
children: "Export incident bundle"
|
|
3529
3817
|
}, undefined, false, undefined, this) : null
|
|
@@ -3531,11 +3819,11 @@ var VoiceTraceTimeline = ({
|
|
|
3531
3819
|
}, undefined, true, undefined, this)
|
|
3532
3820
|
]
|
|
3533
3821
|
}, session.sessionId, true, undefined, this))
|
|
3534
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
3822
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV12("p", {
|
|
3535
3823
|
className: "absolute-voice-trace-timeline__empty",
|
|
3536
3824
|
children: "Run a voice session to see call timelines."
|
|
3537
3825
|
}, undefined, false, undefined, this),
|
|
3538
|
-
model.error ? /* @__PURE__ */
|
|
3826
|
+
model.error ? /* @__PURE__ */ jsxDEV12("p", {
|
|
3539
3827
|
className: "absolute-voice-trace-timeline__error",
|
|
3540
3828
|
children: model.error
|
|
3541
3829
|
}, undefined, false, undefined, this) : null
|
|
@@ -3543,7 +3831,7 @@ var VoiceTraceTimeline = ({
|
|
|
3543
3831
|
}, undefined, true, undefined, this);
|
|
3544
3832
|
};
|
|
3545
3833
|
// src/react/useVoiceAgentSquadStatus.tsx
|
|
3546
|
-
import { useEffect as
|
|
3834
|
+
import { useEffect as useEffect13, useRef as useRef13, useSyncExternalStore as useSyncExternalStore13 } from "react";
|
|
3547
3835
|
|
|
3548
3836
|
// src/client/agentSquadStatus.ts
|
|
3549
3837
|
var getString = (value) => typeof value === "string" && value.trim() ? value.trim() : undefined;
|
|
@@ -3621,25 +3909,25 @@ var createVoiceAgentSquadStatusStore = (path = "/api/voice-traces", options = {}
|
|
|
3621
3909
|
|
|
3622
3910
|
// src/react/useVoiceAgentSquadStatus.tsx
|
|
3623
3911
|
var useVoiceAgentSquadStatus = (path = "/api/voice-traces", options = {}) => {
|
|
3624
|
-
const storeRef =
|
|
3912
|
+
const storeRef = useRef13(null);
|
|
3625
3913
|
if (!storeRef.current) {
|
|
3626
3914
|
storeRef.current = createVoiceAgentSquadStatusStore(path, options);
|
|
3627
3915
|
}
|
|
3628
3916
|
const store = storeRef.current;
|
|
3629
|
-
|
|
3917
|
+
useEffect13(() => {
|
|
3630
3918
|
store.refresh().catch(() => {});
|
|
3631
3919
|
return () => store.close();
|
|
3632
3920
|
}, [store]);
|
|
3633
3921
|
return {
|
|
3634
|
-
...
|
|
3922
|
+
...useSyncExternalStore13(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
3635
3923
|
refresh: store.refresh
|
|
3636
3924
|
};
|
|
3637
3925
|
};
|
|
3638
3926
|
|
|
3639
3927
|
// src/client/agentSquadStatusWidget.ts
|
|
3640
|
-
var
|
|
3641
|
-
var
|
|
3642
|
-
var
|
|
3928
|
+
var DEFAULT_TITLE12 = "Voice Agent Squad";
|
|
3929
|
+
var DEFAULT_DESCRIPTION12 = "Current specialist and recent handoffs from your self-hosted voice traces.";
|
|
3930
|
+
var escapeHtml13 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
3643
3931
|
var labelFor = (current) => {
|
|
3644
3932
|
if (!current)
|
|
3645
3933
|
return "Waiting for specialist activity";
|
|
@@ -3653,37 +3941,37 @@ var labelFor = (current) => {
|
|
|
3653
3941
|
};
|
|
3654
3942
|
var createVoiceAgentSquadStatusViewModel = (snapshot, options = {}) => ({
|
|
3655
3943
|
current: snapshot.report.current,
|
|
3656
|
-
description: options.description ??
|
|
3944
|
+
description: options.description ?? DEFAULT_DESCRIPTION12,
|
|
3657
3945
|
error: snapshot.error,
|
|
3658
3946
|
isLoading: snapshot.isLoading,
|
|
3659
3947
|
label: snapshot.error ? "Unavailable" : labelFor(snapshot.report.current),
|
|
3660
3948
|
sessionCount: snapshot.report.sessionCount,
|
|
3661
3949
|
sessions: snapshot.report.sessions,
|
|
3662
|
-
title: options.title ??
|
|
3950
|
+
title: options.title ?? DEFAULT_TITLE12,
|
|
3663
3951
|
updatedAt: snapshot.updatedAt
|
|
3664
3952
|
});
|
|
3665
3953
|
var renderVoiceAgentSquadStatusHTML = (snapshot, options = {}) => {
|
|
3666
3954
|
const model = createVoiceAgentSquadStatusViewModel(snapshot, options);
|
|
3667
3955
|
const current = model.current;
|
|
3668
3956
|
const rows = model.sessions.length ? model.sessions.slice(0, 5).map((session) => `<li>
|
|
3669
|
-
<span>${
|
|
3670
|
-
<strong>${
|
|
3671
|
-
<em>${
|
|
3672
|
-
${session.summary || session.reason ? `<p>${
|
|
3957
|
+
<span>${escapeHtml13(session.sessionId)}</span>
|
|
3958
|
+
<strong>${escapeHtml13(session.targetAgentId ?? "none")}</strong>
|
|
3959
|
+
<em>${escapeHtml13(session.status)}</em>
|
|
3960
|
+
${session.summary || session.reason ? `<p>${escapeHtml13(session.summary ?? session.reason ?? "")}</p>` : ""}
|
|
3673
3961
|
</li>`).join("") : "<li><span>No squad traces yet.</span><strong>Waiting</strong></li>";
|
|
3674
3962
|
return `<section class="absolute-voice-agent-squad-status">
|
|
3675
3963
|
<header>
|
|
3676
|
-
<span>${
|
|
3677
|
-
<strong>${
|
|
3964
|
+
<span>${escapeHtml13(model.title)}</span>
|
|
3965
|
+
<strong>${escapeHtml13(model.label)}</strong>
|
|
3678
3966
|
</header>
|
|
3679
|
-
<p>${
|
|
3967
|
+
<p>${escapeHtml13(model.description)}</p>
|
|
3680
3968
|
<div>
|
|
3681
|
-
<span>Session</span><strong>${
|
|
3682
|
-
<span>From</span><strong>${
|
|
3683
|
-
<span>Status</span><strong>${
|
|
3969
|
+
<span>Session</span><strong>${escapeHtml13(current?.sessionId ?? "n/a")}</strong>
|
|
3970
|
+
<span>From</span><strong>${escapeHtml13(current?.fromAgentId ?? "n/a")}</strong>
|
|
3971
|
+
<span>Status</span><strong>${escapeHtml13(current?.status ?? "idle")}</strong>
|
|
3684
3972
|
</div>
|
|
3685
3973
|
<ul>${rows}</ul>
|
|
3686
|
-
${model.error ? `<p class="absolute-voice-agent-squad-status__error">${
|
|
3974
|
+
${model.error ? `<p class="absolute-voice-agent-squad-status__error">${escapeHtml13(model.error)}</p>` : ""}
|
|
3687
3975
|
</section>`;
|
|
3688
3976
|
};
|
|
3689
3977
|
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}`;
|
|
@@ -3728,7 +4016,7 @@ var defineVoiceAgentSquadStatusElement = (tagName = "absolute-voice-agent-squad-
|
|
|
3728
4016
|
};
|
|
3729
4017
|
|
|
3730
4018
|
// src/react/VoiceAgentSquadStatus.tsx
|
|
3731
|
-
import { jsxDEV as
|
|
4019
|
+
import { jsxDEV as jsxDEV13 } from "react/jsx-dev-runtime";
|
|
3732
4020
|
function VoiceAgentSquadStatus({
|
|
3733
4021
|
path = "/api/voice-traces",
|
|
3734
4022
|
...options
|
|
@@ -3736,64 +4024,64 @@ function VoiceAgentSquadStatus({
|
|
|
3736
4024
|
const snapshot = useVoiceAgentSquadStatus(path, options);
|
|
3737
4025
|
const model = createVoiceAgentSquadStatusViewModel(snapshot, options);
|
|
3738
4026
|
const current = model.current;
|
|
3739
|
-
return /* @__PURE__ */
|
|
4027
|
+
return /* @__PURE__ */ jsxDEV13("section", {
|
|
3740
4028
|
className: "absolute-voice-agent-squad-status",
|
|
3741
4029
|
children: [
|
|
3742
|
-
/* @__PURE__ */
|
|
4030
|
+
/* @__PURE__ */ jsxDEV13("header", {
|
|
3743
4031
|
children: [
|
|
3744
|
-
/* @__PURE__ */
|
|
4032
|
+
/* @__PURE__ */ jsxDEV13("span", {
|
|
3745
4033
|
children: model.title
|
|
3746
4034
|
}, undefined, false, undefined, this),
|
|
3747
|
-
/* @__PURE__ */
|
|
4035
|
+
/* @__PURE__ */ jsxDEV13("strong", {
|
|
3748
4036
|
children: model.label
|
|
3749
4037
|
}, undefined, false, undefined, this)
|
|
3750
4038
|
]
|
|
3751
4039
|
}, undefined, true, undefined, this),
|
|
3752
|
-
/* @__PURE__ */
|
|
4040
|
+
/* @__PURE__ */ jsxDEV13("p", {
|
|
3753
4041
|
children: model.description
|
|
3754
4042
|
}, undefined, false, undefined, this),
|
|
3755
|
-
/* @__PURE__ */
|
|
4043
|
+
/* @__PURE__ */ jsxDEV13("dl", {
|
|
3756
4044
|
children: [
|
|
3757
|
-
/* @__PURE__ */
|
|
4045
|
+
/* @__PURE__ */ jsxDEV13("div", {
|
|
3758
4046
|
children: [
|
|
3759
|
-
/* @__PURE__ */
|
|
4047
|
+
/* @__PURE__ */ jsxDEV13("dt", {
|
|
3760
4048
|
children: "Session"
|
|
3761
4049
|
}, undefined, false, undefined, this),
|
|
3762
|
-
/* @__PURE__ */
|
|
4050
|
+
/* @__PURE__ */ jsxDEV13("dd", {
|
|
3763
4051
|
children: current?.sessionId ?? "n/a"
|
|
3764
4052
|
}, undefined, false, undefined, this)
|
|
3765
4053
|
]
|
|
3766
4054
|
}, undefined, true, undefined, this),
|
|
3767
|
-
/* @__PURE__ */
|
|
4055
|
+
/* @__PURE__ */ jsxDEV13("div", {
|
|
3768
4056
|
children: [
|
|
3769
|
-
/* @__PURE__ */
|
|
4057
|
+
/* @__PURE__ */ jsxDEV13("dt", {
|
|
3770
4058
|
children: "Current specialist"
|
|
3771
4059
|
}, undefined, false, undefined, this),
|
|
3772
|
-
/* @__PURE__ */
|
|
4060
|
+
/* @__PURE__ */ jsxDEV13("dd", {
|
|
3773
4061
|
children: current?.targetAgentId ?? "none"
|
|
3774
4062
|
}, undefined, false, undefined, this)
|
|
3775
4063
|
]
|
|
3776
4064
|
}, undefined, true, undefined, this),
|
|
3777
|
-
/* @__PURE__ */
|
|
4065
|
+
/* @__PURE__ */ jsxDEV13("div", {
|
|
3778
4066
|
children: [
|
|
3779
|
-
/* @__PURE__ */
|
|
4067
|
+
/* @__PURE__ */ jsxDEV13("dt", {
|
|
3780
4068
|
children: "Status"
|
|
3781
4069
|
}, undefined, false, undefined, this),
|
|
3782
|
-
/* @__PURE__ */
|
|
4070
|
+
/* @__PURE__ */ jsxDEV13("dd", {
|
|
3783
4071
|
children: current?.status ?? "idle"
|
|
3784
4072
|
}, undefined, false, undefined, this)
|
|
3785
4073
|
]
|
|
3786
4074
|
}, undefined, true, undefined, this)
|
|
3787
4075
|
]
|
|
3788
4076
|
}, undefined, true, undefined, this),
|
|
3789
|
-
model.error ? /* @__PURE__ */
|
|
4077
|
+
model.error ? /* @__PURE__ */ jsxDEV13("p", {
|
|
3790
4078
|
children: model.error
|
|
3791
4079
|
}, undefined, false, undefined, this) : null
|
|
3792
4080
|
]
|
|
3793
4081
|
}, undefined, true, undefined, this);
|
|
3794
4082
|
}
|
|
3795
4083
|
// src/react/useVoiceTurnLatency.tsx
|
|
3796
|
-
import { useEffect as
|
|
4084
|
+
import { useEffect as useEffect14, useRef as useRef14, useSyncExternalStore as useSyncExternalStore14 } from "react";
|
|
3797
4085
|
|
|
3798
4086
|
// src/client/turnLatency.ts
|
|
3799
4087
|
var fetchVoiceTurnLatency = async (path = "/api/turn-latency", options = {}) => {
|
|
@@ -3900,27 +4188,27 @@ var createVoiceTurnLatencyStore = (path = "/api/turn-latency", options = {}) =>
|
|
|
3900
4188
|
|
|
3901
4189
|
// src/react/useVoiceTurnLatency.tsx
|
|
3902
4190
|
var useVoiceTurnLatency = (path = "/api/turn-latency", options = {}) => {
|
|
3903
|
-
const storeRef =
|
|
4191
|
+
const storeRef = useRef14(null);
|
|
3904
4192
|
if (!storeRef.current) {
|
|
3905
4193
|
storeRef.current = createVoiceTurnLatencyStore(path, options);
|
|
3906
4194
|
}
|
|
3907
4195
|
const store = storeRef.current;
|
|
3908
|
-
|
|
4196
|
+
useEffect14(() => {
|
|
3909
4197
|
store.refresh().catch(() => {});
|
|
3910
4198
|
return () => store.close();
|
|
3911
4199
|
}, [store]);
|
|
3912
4200
|
return {
|
|
3913
|
-
...
|
|
4201
|
+
...useSyncExternalStore14(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
3914
4202
|
refresh: store.refresh,
|
|
3915
4203
|
runProof: store.runProof
|
|
3916
4204
|
};
|
|
3917
4205
|
};
|
|
3918
4206
|
|
|
3919
4207
|
// src/client/turnLatencyWidget.ts
|
|
3920
|
-
var
|
|
3921
|
-
var
|
|
4208
|
+
var DEFAULT_TITLE13 = "Turn Latency";
|
|
4209
|
+
var DEFAULT_DESCRIPTION13 = "Per-turn timing from first transcript to commit and assistant response start.";
|
|
3922
4210
|
var DEFAULT_PROOF_LABEL = "Run latency proof";
|
|
3923
|
-
var
|
|
4211
|
+
var escapeHtml14 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
3924
4212
|
var formatMs3 = (value) => typeof value === "number" ? `${Math.round(value)}ms` : "n/a";
|
|
3925
4213
|
var createVoiceTurnLatencyViewModel = (snapshot, options = {}) => {
|
|
3926
4214
|
const turns = (snapshot.report?.turns ?? []).map((turn) => ({
|
|
@@ -3934,39 +4222,39 @@ var createVoiceTurnLatencyViewModel = (snapshot, options = {}) => {
|
|
|
3934
4222
|
const warningCount = snapshot.report?.warnings ?? turns.filter((turn) => turn.status === "warn").length;
|
|
3935
4223
|
const failedCount = snapshot.report?.failed ?? turns.filter((turn) => turn.status === "fail").length;
|
|
3936
4224
|
return {
|
|
3937
|
-
description: options.description ??
|
|
4225
|
+
description: options.description ?? DEFAULT_DESCRIPTION13,
|
|
3938
4226
|
error: snapshot.error,
|
|
3939
4227
|
isLoading: snapshot.isLoading,
|
|
3940
4228
|
label: snapshot.error ? "Unavailable" : turns.length ? failedCount > 0 ? `${failedCount} slow` : warningCount > 0 ? `${warningCount} warnings` : `avg ${formatMs3(snapshot.report?.averageTotalMs)}` : snapshot.isLoading ? "Checking" : "No turns",
|
|
3941
4229
|
proofLabel: options.proofPath ? options.proofLabel ?? DEFAULT_PROOF_LABEL : undefined,
|
|
3942
4230
|
showProofAction: Boolean(options.proofPath),
|
|
3943
4231
|
status: snapshot.error ? "error" : turns.length ? failedCount > 0 || warningCount > 0 ? "warning" : "ready" : snapshot.isLoading ? "loading" : "empty",
|
|
3944
|
-
title: options.title ??
|
|
4232
|
+
title: options.title ?? DEFAULT_TITLE13,
|
|
3945
4233
|
turns,
|
|
3946
4234
|
updatedAt: snapshot.updatedAt
|
|
3947
4235
|
};
|
|
3948
4236
|
};
|
|
3949
4237
|
var renderVoiceTurnLatencyHTML = (snapshot, options = {}) => {
|
|
3950
4238
|
const model = createVoiceTurnLatencyViewModel(snapshot, options);
|
|
3951
|
-
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--${
|
|
4239
|
+
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--${escapeHtml14(turn.status)}">
|
|
3952
4240
|
<header>
|
|
3953
|
-
<strong>${
|
|
3954
|
-
<span>${
|
|
4241
|
+
<strong>${escapeHtml14(turn.label)}</strong>
|
|
4242
|
+
<span>${escapeHtml14(turn.status)}</span>
|
|
3955
4243
|
</header>
|
|
3956
4244
|
<dl>${turn.rows.map((row) => `<div>
|
|
3957
|
-
<dt>${
|
|
3958
|
-
<dd>${
|
|
4245
|
+
<dt>${escapeHtml14(row.label)}</dt>
|
|
4246
|
+
<dd>${escapeHtml14(row.value)}</dd>
|
|
3959
4247
|
</div>`).join("")}</dl>
|
|
3960
4248
|
</article>`).join("")}</div>` : '<p class="absolute-voice-turn-latency__empty">Complete a voice turn to see latency diagnostics.</p>';
|
|
3961
|
-
return `<section class="absolute-voice-turn-latency absolute-voice-turn-latency--${
|
|
4249
|
+
return `<section class="absolute-voice-turn-latency absolute-voice-turn-latency--${escapeHtml14(model.status)}">
|
|
3962
4250
|
<header class="absolute-voice-turn-latency__header">
|
|
3963
|
-
<span class="absolute-voice-turn-latency__eyebrow">${
|
|
3964
|
-
<strong class="absolute-voice-turn-latency__label">${
|
|
4251
|
+
<span class="absolute-voice-turn-latency__eyebrow">${escapeHtml14(model.title)}</span>
|
|
4252
|
+
<strong class="absolute-voice-turn-latency__label">${escapeHtml14(model.label)}</strong>
|
|
3965
4253
|
</header>
|
|
3966
|
-
<p class="absolute-voice-turn-latency__description">${
|
|
3967
|
-
${model.showProofAction ? `<button class="absolute-voice-turn-latency__proof" data-absolute-voice-turn-latency-proof type="button">${
|
|
4254
|
+
<p class="absolute-voice-turn-latency__description">${escapeHtml14(model.description)}</p>
|
|
4255
|
+
${model.showProofAction ? `<button class="absolute-voice-turn-latency__proof" data-absolute-voice-turn-latency-proof type="button">${escapeHtml14(model.proofLabel ?? DEFAULT_PROOF_LABEL)}</button>` : ""}
|
|
3968
4256
|
${turns}
|
|
3969
|
-
${model.error ? `<p class="absolute-voice-turn-latency__error">${
|
|
4257
|
+
${model.error ? `<p class="absolute-voice-turn-latency__error">${escapeHtml14(model.error)}</p>` : ""}
|
|
3970
4258
|
</section>`;
|
|
3971
4259
|
};
|
|
3972
4260
|
var mountVoiceTurnLatency = (element, path = "/api/turn-latency", options = {}) => {
|
|
@@ -4017,7 +4305,7 @@ var defineVoiceTurnLatencyElement = (tagName = "absolute-voice-turn-latency") =>
|
|
|
4017
4305
|
};
|
|
4018
4306
|
|
|
4019
4307
|
// src/react/VoiceTurnLatency.tsx
|
|
4020
|
-
import { jsxDEV as
|
|
4308
|
+
import { jsxDEV as jsxDEV14 } from "react/jsx-dev-runtime";
|
|
4021
4309
|
var VoiceTurnLatency = ({
|
|
4022
4310
|
className,
|
|
4023
4311
|
path = "/api/turn-latency",
|
|
@@ -4025,31 +4313,31 @@ var VoiceTurnLatency = ({
|
|
|
4025
4313
|
}) => {
|
|
4026
4314
|
const latency = useVoiceTurnLatency(path, options);
|
|
4027
4315
|
const model = createVoiceTurnLatencyViewModel(latency, options);
|
|
4028
|
-
return /* @__PURE__ */
|
|
4316
|
+
return /* @__PURE__ */ jsxDEV14("section", {
|
|
4029
4317
|
className: [
|
|
4030
4318
|
"absolute-voice-turn-latency",
|
|
4031
4319
|
`absolute-voice-turn-latency--${model.status}`,
|
|
4032
4320
|
className
|
|
4033
4321
|
].filter(Boolean).join(" "),
|
|
4034
4322
|
children: [
|
|
4035
|
-
/* @__PURE__ */
|
|
4323
|
+
/* @__PURE__ */ jsxDEV14("header", {
|
|
4036
4324
|
className: "absolute-voice-turn-latency__header",
|
|
4037
4325
|
children: [
|
|
4038
|
-
/* @__PURE__ */
|
|
4326
|
+
/* @__PURE__ */ jsxDEV14("span", {
|
|
4039
4327
|
className: "absolute-voice-turn-latency__eyebrow",
|
|
4040
4328
|
children: model.title
|
|
4041
4329
|
}, undefined, false, undefined, this),
|
|
4042
|
-
/* @__PURE__ */
|
|
4330
|
+
/* @__PURE__ */ jsxDEV14("strong", {
|
|
4043
4331
|
className: "absolute-voice-turn-latency__label",
|
|
4044
4332
|
children: model.label
|
|
4045
4333
|
}, undefined, false, undefined, this)
|
|
4046
4334
|
]
|
|
4047
4335
|
}, undefined, true, undefined, this),
|
|
4048
|
-
/* @__PURE__ */
|
|
4336
|
+
/* @__PURE__ */ jsxDEV14("p", {
|
|
4049
4337
|
className: "absolute-voice-turn-latency__description",
|
|
4050
4338
|
children: model.description
|
|
4051
4339
|
}, undefined, false, undefined, this),
|
|
4052
|
-
model.showProofAction ? /* @__PURE__ */
|
|
4340
|
+
model.showProofAction ? /* @__PURE__ */ jsxDEV14("button", {
|
|
4053
4341
|
className: "absolute-voice-turn-latency__proof",
|
|
4054
4342
|
onClick: () => {
|
|
4055
4343
|
latency.runProof().catch(() => {});
|
|
@@ -4057,31 +4345,31 @@ var VoiceTurnLatency = ({
|
|
|
4057
4345
|
type: "button",
|
|
4058
4346
|
children: model.proofLabel
|
|
4059
4347
|
}, undefined, false, undefined, this) : null,
|
|
4060
|
-
model.turns.length ? /* @__PURE__ */
|
|
4348
|
+
model.turns.length ? /* @__PURE__ */ jsxDEV14("div", {
|
|
4061
4349
|
className: "absolute-voice-turn-latency__turns",
|
|
4062
|
-
children: model.turns.map((turn) => /* @__PURE__ */
|
|
4350
|
+
children: model.turns.map((turn) => /* @__PURE__ */ jsxDEV14("article", {
|
|
4063
4351
|
className: [
|
|
4064
4352
|
"absolute-voice-turn-latency__turn",
|
|
4065
4353
|
`absolute-voice-turn-latency__turn--${turn.status}`
|
|
4066
4354
|
].join(" "),
|
|
4067
4355
|
children: [
|
|
4068
|
-
/* @__PURE__ */
|
|
4356
|
+
/* @__PURE__ */ jsxDEV14("header", {
|
|
4069
4357
|
children: [
|
|
4070
|
-
/* @__PURE__ */
|
|
4358
|
+
/* @__PURE__ */ jsxDEV14("strong", {
|
|
4071
4359
|
children: turn.label
|
|
4072
4360
|
}, undefined, false, undefined, this),
|
|
4073
|
-
/* @__PURE__ */
|
|
4361
|
+
/* @__PURE__ */ jsxDEV14("span", {
|
|
4074
4362
|
children: turn.status
|
|
4075
4363
|
}, undefined, false, undefined, this)
|
|
4076
4364
|
]
|
|
4077
4365
|
}, undefined, true, undefined, this),
|
|
4078
|
-
/* @__PURE__ */
|
|
4079
|
-
children: turn.rows.map((row) => /* @__PURE__ */
|
|
4366
|
+
/* @__PURE__ */ jsxDEV14("dl", {
|
|
4367
|
+
children: turn.rows.map((row) => /* @__PURE__ */ jsxDEV14("div", {
|
|
4080
4368
|
children: [
|
|
4081
|
-
/* @__PURE__ */
|
|
4369
|
+
/* @__PURE__ */ jsxDEV14("dt", {
|
|
4082
4370
|
children: row.label
|
|
4083
4371
|
}, undefined, false, undefined, this),
|
|
4084
|
-
/* @__PURE__ */
|
|
4372
|
+
/* @__PURE__ */ jsxDEV14("dd", {
|
|
4085
4373
|
children: row.value
|
|
4086
4374
|
}, undefined, false, undefined, this)
|
|
4087
4375
|
]
|
|
@@ -4089,11 +4377,11 @@ var VoiceTurnLatency = ({
|
|
|
4089
4377
|
}, undefined, false, undefined, this)
|
|
4090
4378
|
]
|
|
4091
4379
|
}, `${turn.sessionId}:${turn.turnId}`, true, undefined, this))
|
|
4092
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
4380
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV14("p", {
|
|
4093
4381
|
className: "absolute-voice-turn-latency__empty",
|
|
4094
4382
|
children: "Complete a voice turn to see latency diagnostics."
|
|
4095
4383
|
}, undefined, false, undefined, this),
|
|
4096
|
-
model.error ? /* @__PURE__ */
|
|
4384
|
+
model.error ? /* @__PURE__ */ jsxDEV14("p", {
|
|
4097
4385
|
className: "absolute-voice-turn-latency__error",
|
|
4098
4386
|
children: model.error
|
|
4099
4387
|
}, undefined, false, undefined, this) : null
|
|
@@ -4101,7 +4389,7 @@ var VoiceTurnLatency = ({
|
|
|
4101
4389
|
}, undefined, true, undefined, this);
|
|
4102
4390
|
};
|
|
4103
4391
|
// src/react/useVoiceTurnQuality.tsx
|
|
4104
|
-
import { useEffect as
|
|
4392
|
+
import { useEffect as useEffect15, useRef as useRef15, useSyncExternalStore as useSyncExternalStore15 } from "react";
|
|
4105
4393
|
|
|
4106
4394
|
// src/client/turnQuality.ts
|
|
4107
4395
|
var fetchVoiceTurnQuality = async (path = "/api/turn-quality", options = {}) => {
|
|
@@ -4184,25 +4472,25 @@ var createVoiceTurnQualityStore = (path = "/api/turn-quality", options = {}) =>
|
|
|
4184
4472
|
|
|
4185
4473
|
// src/react/useVoiceTurnQuality.tsx
|
|
4186
4474
|
var useVoiceTurnQuality = (path = "/api/turn-quality", options = {}) => {
|
|
4187
|
-
const storeRef =
|
|
4475
|
+
const storeRef = useRef15(null);
|
|
4188
4476
|
if (!storeRef.current) {
|
|
4189
4477
|
storeRef.current = createVoiceTurnQualityStore(path, options);
|
|
4190
4478
|
}
|
|
4191
4479
|
const store = storeRef.current;
|
|
4192
|
-
|
|
4480
|
+
useEffect15(() => {
|
|
4193
4481
|
store.refresh().catch(() => {});
|
|
4194
4482
|
return () => store.close();
|
|
4195
4483
|
}, [store]);
|
|
4196
4484
|
return {
|
|
4197
|
-
...
|
|
4485
|
+
...useSyncExternalStore15(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
4198
4486
|
refresh: store.refresh
|
|
4199
4487
|
};
|
|
4200
4488
|
};
|
|
4201
4489
|
|
|
4202
4490
|
// src/client/turnQualityWidget.ts
|
|
4203
|
-
var
|
|
4204
|
-
var
|
|
4205
|
-
var
|
|
4491
|
+
var DEFAULT_TITLE14 = "Turn Quality";
|
|
4492
|
+
var DEFAULT_DESCRIPTION14 = "Per-turn STT confidence, fallback selection, corrections, and transcript coverage.";
|
|
4493
|
+
var escapeHtml15 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
4206
4494
|
var formatConfidence = (value) => typeof value === "number" ? `${Math.round(value * 100)}%` : "n/a";
|
|
4207
4495
|
var formatMaybe = (value) => value === undefined || value === "" ? "n/a" : String(value);
|
|
4208
4496
|
var getTurnDetail = (turn) => {
|
|
@@ -4240,37 +4528,37 @@ var createVoiceTurnQualityViewModel = (snapshot, options = {}) => {
|
|
|
4240
4528
|
const warningCount = snapshot.report?.warnings ?? turns.filter((turn) => turn.status === "warn").length;
|
|
4241
4529
|
const failedCount = snapshot.report?.failed ?? turns.filter((turn) => turn.status === "fail").length;
|
|
4242
4530
|
return {
|
|
4243
|
-
description: options.description ??
|
|
4531
|
+
description: options.description ?? DEFAULT_DESCRIPTION14,
|
|
4244
4532
|
error: snapshot.error,
|
|
4245
4533
|
isLoading: snapshot.isLoading,
|
|
4246
4534
|
label: snapshot.error ? "Unavailable" : turns.length ? failedCount > 0 ? `${failedCount} failed` : warningCount > 0 ? `${warningCount} warnings` : `${turns.length} healthy` : snapshot.isLoading ? "Checking" : "No turns",
|
|
4247
4535
|
status: snapshot.error ? "error" : turns.length ? failedCount > 0 || warningCount > 0 ? "warning" : "ready" : snapshot.isLoading ? "loading" : "empty",
|
|
4248
|
-
title: options.title ??
|
|
4536
|
+
title: options.title ?? DEFAULT_TITLE14,
|
|
4249
4537
|
turns,
|
|
4250
4538
|
updatedAt: snapshot.updatedAt
|
|
4251
4539
|
};
|
|
4252
4540
|
};
|
|
4253
4541
|
var renderVoiceTurnQualityHTML = (snapshot, options = {}) => {
|
|
4254
4542
|
const model = createVoiceTurnQualityViewModel(snapshot, options);
|
|
4255
|
-
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--${
|
|
4543
|
+
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--${escapeHtml15(turn.status)}">
|
|
4256
4544
|
<header>
|
|
4257
|
-
<strong>${
|
|
4258
|
-
<span>${
|
|
4545
|
+
<strong>${escapeHtml15(turn.label)}</strong>
|
|
4546
|
+
<span>${escapeHtml15(turn.status)}</span>
|
|
4259
4547
|
</header>
|
|
4260
|
-
<p>${
|
|
4548
|
+
<p>${escapeHtml15(turn.detail)}</p>
|
|
4261
4549
|
<dl>${turn.rows.map((row) => `<div>
|
|
4262
|
-
<dt>${
|
|
4263
|
-
<dd>${
|
|
4550
|
+
<dt>${escapeHtml15(row.label)}</dt>
|
|
4551
|
+
<dd>${escapeHtml15(row.value)}</dd>
|
|
4264
4552
|
</div>`).join("")}</dl>
|
|
4265
4553
|
</article>`).join("")}</div>` : '<p class="absolute-voice-turn-quality__empty">Complete a voice turn to see STT quality diagnostics.</p>';
|
|
4266
|
-
return `<section class="absolute-voice-turn-quality absolute-voice-turn-quality--${
|
|
4554
|
+
return `<section class="absolute-voice-turn-quality absolute-voice-turn-quality--${escapeHtml15(model.status)}">
|
|
4267
4555
|
<header class="absolute-voice-turn-quality__header">
|
|
4268
|
-
<span class="absolute-voice-turn-quality__eyebrow">${
|
|
4269
|
-
<strong class="absolute-voice-turn-quality__label">${
|
|
4556
|
+
<span class="absolute-voice-turn-quality__eyebrow">${escapeHtml15(model.title)}</span>
|
|
4557
|
+
<strong class="absolute-voice-turn-quality__label">${escapeHtml15(model.label)}</strong>
|
|
4270
4558
|
</header>
|
|
4271
|
-
<p class="absolute-voice-turn-quality__description">${
|
|
4559
|
+
<p class="absolute-voice-turn-quality__description">${escapeHtml15(model.description)}</p>
|
|
4272
4560
|
${turns}
|
|
4273
|
-
${model.error ? `<p class="absolute-voice-turn-quality__error">${
|
|
4561
|
+
${model.error ? `<p class="absolute-voice-turn-quality__error">${escapeHtml15(model.error)}</p>` : ""}
|
|
4274
4562
|
</section>`;
|
|
4275
4563
|
};
|
|
4276
4564
|
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}`;
|
|
@@ -4312,7 +4600,7 @@ var defineVoiceTurnQualityElement = (tagName = "absolute-voice-turn-quality") =>
|
|
|
4312
4600
|
};
|
|
4313
4601
|
|
|
4314
4602
|
// src/react/VoiceTurnQuality.tsx
|
|
4315
|
-
import { jsxDEV as
|
|
4603
|
+
import { jsxDEV as jsxDEV15 } from "react/jsx-dev-runtime";
|
|
4316
4604
|
var VoiceTurnQuality = ({
|
|
4317
4605
|
className,
|
|
4318
4606
|
path = "/api/turn-quality",
|
|
@@ -4320,58 +4608,58 @@ var VoiceTurnQuality = ({
|
|
|
4320
4608
|
}) => {
|
|
4321
4609
|
const snapshot = useVoiceTurnQuality(path, options);
|
|
4322
4610
|
const model = createVoiceTurnQualityViewModel(snapshot, options);
|
|
4323
|
-
return /* @__PURE__ */
|
|
4611
|
+
return /* @__PURE__ */ jsxDEV15("section", {
|
|
4324
4612
|
className: [
|
|
4325
4613
|
"absolute-voice-turn-quality",
|
|
4326
4614
|
`absolute-voice-turn-quality--${model.status}`,
|
|
4327
4615
|
className
|
|
4328
4616
|
].filter(Boolean).join(" "),
|
|
4329
4617
|
children: [
|
|
4330
|
-
/* @__PURE__ */
|
|
4618
|
+
/* @__PURE__ */ jsxDEV15("header", {
|
|
4331
4619
|
className: "absolute-voice-turn-quality__header",
|
|
4332
4620
|
children: [
|
|
4333
|
-
/* @__PURE__ */
|
|
4621
|
+
/* @__PURE__ */ jsxDEV15("span", {
|
|
4334
4622
|
className: "absolute-voice-turn-quality__eyebrow",
|
|
4335
4623
|
children: model.title
|
|
4336
4624
|
}, undefined, false, undefined, this),
|
|
4337
|
-
/* @__PURE__ */
|
|
4625
|
+
/* @__PURE__ */ jsxDEV15("strong", {
|
|
4338
4626
|
className: "absolute-voice-turn-quality__label",
|
|
4339
4627
|
children: model.label
|
|
4340
4628
|
}, undefined, false, undefined, this)
|
|
4341
4629
|
]
|
|
4342
4630
|
}, undefined, true, undefined, this),
|
|
4343
|
-
/* @__PURE__ */
|
|
4631
|
+
/* @__PURE__ */ jsxDEV15("p", {
|
|
4344
4632
|
className: "absolute-voice-turn-quality__description",
|
|
4345
4633
|
children: model.description
|
|
4346
4634
|
}, undefined, false, undefined, this),
|
|
4347
|
-
model.turns.length ? /* @__PURE__ */
|
|
4635
|
+
model.turns.length ? /* @__PURE__ */ jsxDEV15("div", {
|
|
4348
4636
|
className: "absolute-voice-turn-quality__turns",
|
|
4349
|
-
children: model.turns.map((turn) => /* @__PURE__ */
|
|
4637
|
+
children: model.turns.map((turn) => /* @__PURE__ */ jsxDEV15("article", {
|
|
4350
4638
|
className: [
|
|
4351
4639
|
"absolute-voice-turn-quality__turn",
|
|
4352
4640
|
`absolute-voice-turn-quality__turn--${turn.status}`
|
|
4353
4641
|
].join(" "),
|
|
4354
4642
|
children: [
|
|
4355
|
-
/* @__PURE__ */
|
|
4643
|
+
/* @__PURE__ */ jsxDEV15("header", {
|
|
4356
4644
|
children: [
|
|
4357
|
-
/* @__PURE__ */
|
|
4645
|
+
/* @__PURE__ */ jsxDEV15("strong", {
|
|
4358
4646
|
children: turn.label
|
|
4359
4647
|
}, undefined, false, undefined, this),
|
|
4360
|
-
/* @__PURE__ */
|
|
4648
|
+
/* @__PURE__ */ jsxDEV15("span", {
|
|
4361
4649
|
children: turn.status
|
|
4362
4650
|
}, undefined, false, undefined, this)
|
|
4363
4651
|
]
|
|
4364
4652
|
}, undefined, true, undefined, this),
|
|
4365
|
-
/* @__PURE__ */
|
|
4653
|
+
/* @__PURE__ */ jsxDEV15("p", {
|
|
4366
4654
|
children: turn.detail
|
|
4367
4655
|
}, undefined, false, undefined, this),
|
|
4368
|
-
/* @__PURE__ */
|
|
4369
|
-
children: turn.rows.map((row) => /* @__PURE__ */
|
|
4656
|
+
/* @__PURE__ */ jsxDEV15("dl", {
|
|
4657
|
+
children: turn.rows.map((row) => /* @__PURE__ */ jsxDEV15("div", {
|
|
4370
4658
|
children: [
|
|
4371
|
-
/* @__PURE__ */
|
|
4659
|
+
/* @__PURE__ */ jsxDEV15("dt", {
|
|
4372
4660
|
children: row.label
|
|
4373
4661
|
}, undefined, false, undefined, this),
|
|
4374
|
-
/* @__PURE__ */
|
|
4662
|
+
/* @__PURE__ */ jsxDEV15("dd", {
|
|
4375
4663
|
children: row.value
|
|
4376
4664
|
}, undefined, false, undefined, this)
|
|
4377
4665
|
]
|
|
@@ -4379,11 +4667,11 @@ var VoiceTurnQuality = ({
|
|
|
4379
4667
|
}, undefined, false, undefined, this)
|
|
4380
4668
|
]
|
|
4381
4669
|
}, `${turn.sessionId}:${turn.turnId}`, true, undefined, this))
|
|
4382
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
4670
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV15("p", {
|
|
4383
4671
|
className: "absolute-voice-turn-quality__empty",
|
|
4384
4672
|
children: "Complete a voice turn to see STT quality diagnostics."
|
|
4385
4673
|
}, undefined, false, undefined, this),
|
|
4386
|
-
model.error ? /* @__PURE__ */
|
|
4674
|
+
model.error ? /* @__PURE__ */ jsxDEV15("p", {
|
|
4387
4675
|
className: "absolute-voice-turn-quality__error",
|
|
4388
4676
|
children: model.error
|
|
4389
4677
|
}, undefined, false, undefined, this) : null
|
|
@@ -4391,7 +4679,7 @@ var VoiceTurnQuality = ({
|
|
|
4391
4679
|
}, undefined, true, undefined, this);
|
|
4392
4680
|
};
|
|
4393
4681
|
// src/react/useVoiceLiveOps.tsx
|
|
4394
|
-
import { useEffect as
|
|
4682
|
+
import { useEffect as useEffect16, useRef as useRef16, useSyncExternalStore as useSyncExternalStore16 } from "react";
|
|
4395
4683
|
|
|
4396
4684
|
// src/client/liveOps.ts
|
|
4397
4685
|
var postVoiceLiveOpsAction = async (input, options = {}) => {
|
|
@@ -4481,19 +4769,19 @@ var createVoiceLiveOpsStore = (options = {}) => {
|
|
|
4481
4769
|
|
|
4482
4770
|
// src/react/useVoiceLiveOps.tsx
|
|
4483
4771
|
var useVoiceLiveOps = (options = {}) => {
|
|
4484
|
-
const storeRef =
|
|
4772
|
+
const storeRef = useRef16(null);
|
|
4485
4773
|
if (!storeRef.current) {
|
|
4486
4774
|
storeRef.current = createVoiceLiveOpsStore(options);
|
|
4487
4775
|
}
|
|
4488
4776
|
const store = storeRef.current;
|
|
4489
|
-
|
|
4777
|
+
useEffect16(() => () => store.close(), [store]);
|
|
4490
4778
|
return {
|
|
4491
|
-
...
|
|
4779
|
+
...useSyncExternalStore16(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
4492
4780
|
run: store.run
|
|
4493
4781
|
};
|
|
4494
4782
|
};
|
|
4495
4783
|
// src/react/useVoiceCampaignDialerProof.tsx
|
|
4496
|
-
import { useEffect as
|
|
4784
|
+
import { useEffect as useEffect17, useRef as useRef17, useSyncExternalStore as useSyncExternalStore17 } from "react";
|
|
4497
4785
|
|
|
4498
4786
|
// src/client/campaignDialerProof.ts
|
|
4499
4787
|
var fetchVoiceCampaignDialerProofStatus = async (path = "/api/voice/campaigns/dialer-proof", options = {}) => {
|
|
@@ -4615,23 +4903,23 @@ var createVoiceCampaignDialerProofStore = (path = "/api/voice/campaigns/dialer-p
|
|
|
4615
4903
|
|
|
4616
4904
|
// src/react/useVoiceCampaignDialerProof.tsx
|
|
4617
4905
|
var useVoiceCampaignDialerProof = (path = "/api/voice/campaigns/dialer-proof", options = {}) => {
|
|
4618
|
-
const storeRef =
|
|
4906
|
+
const storeRef = useRef17(null);
|
|
4619
4907
|
if (!storeRef.current) {
|
|
4620
4908
|
storeRef.current = createVoiceCampaignDialerProofStore(path, options);
|
|
4621
4909
|
}
|
|
4622
4910
|
const store = storeRef.current;
|
|
4623
|
-
|
|
4911
|
+
useEffect17(() => {
|
|
4624
4912
|
store.refresh().catch(() => {});
|
|
4625
4913
|
return () => store.close();
|
|
4626
4914
|
}, [store]);
|
|
4627
4915
|
return {
|
|
4628
|
-
...
|
|
4916
|
+
...useSyncExternalStore17(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
4629
4917
|
refresh: store.refresh,
|
|
4630
4918
|
runProof: store.runProof
|
|
4631
4919
|
};
|
|
4632
4920
|
};
|
|
4633
4921
|
// src/react/useVoiceStream.tsx
|
|
4634
|
-
import { useEffect as
|
|
4922
|
+
import { useEffect as useEffect18, useRef as useRef18, useSyncExternalStore as useSyncExternalStore18 } from "react";
|
|
4635
4923
|
|
|
4636
4924
|
// src/client/actions.ts
|
|
4637
4925
|
var normalizeErrorMessage = (value) => {
|
|
@@ -5291,13 +5579,13 @@ var EMPTY_SNAPSHOT = {
|
|
|
5291
5579
|
turns: []
|
|
5292
5580
|
};
|
|
5293
5581
|
var useVoiceStream = (path, options = {}) => {
|
|
5294
|
-
const streamRef =
|
|
5582
|
+
const streamRef = useRef18(null);
|
|
5295
5583
|
if (!streamRef.current) {
|
|
5296
5584
|
streamRef.current = createVoiceStream(path, options);
|
|
5297
5585
|
}
|
|
5298
5586
|
const stream = streamRef.current;
|
|
5299
|
-
|
|
5300
|
-
const snapshot =
|
|
5587
|
+
useEffect18(() => () => stream.close(), [stream]);
|
|
5588
|
+
const snapshot = useSyncExternalStore18(stream.subscribe, stream.getSnapshot, stream.getServerSnapshot) ?? EMPTY_SNAPSHOT;
|
|
5301
5589
|
return {
|
|
5302
5590
|
...snapshot,
|
|
5303
5591
|
callControl: (message) => stream.callControl(message),
|
|
@@ -5307,7 +5595,7 @@ var useVoiceStream = (path, options = {}) => {
|
|
|
5307
5595
|
};
|
|
5308
5596
|
};
|
|
5309
5597
|
// src/react/useVoiceController.tsx
|
|
5310
|
-
import { useEffect as
|
|
5598
|
+
import { useEffect as useEffect19, useRef as useRef19, useSyncExternalStore as useSyncExternalStore19 } from "react";
|
|
5311
5599
|
|
|
5312
5600
|
// src/client/htmx.ts
|
|
5313
5601
|
var DEFAULT_EVENT_NAME = "voice-refresh";
|
|
@@ -5970,13 +6258,13 @@ var EMPTY_SNAPSHOT2 = {
|
|
|
5970
6258
|
turns: []
|
|
5971
6259
|
};
|
|
5972
6260
|
var useVoiceController = (path, options = {}) => {
|
|
5973
|
-
const controllerRef =
|
|
6261
|
+
const controllerRef = useRef19(null);
|
|
5974
6262
|
if (!controllerRef.current) {
|
|
5975
6263
|
controllerRef.current = createVoiceController(path, options);
|
|
5976
6264
|
}
|
|
5977
6265
|
const controller = controllerRef.current;
|
|
5978
|
-
|
|
5979
|
-
const snapshot =
|
|
6266
|
+
useEffect19(() => () => controller.close(), [controller]);
|
|
6267
|
+
const snapshot = useSyncExternalStore19(controller.subscribe, controller.getSnapshot, controller.getServerSnapshot) ?? EMPTY_SNAPSHOT2;
|
|
5980
6268
|
return {
|
|
5981
6269
|
...snapshot,
|
|
5982
6270
|
bindHTMX: controller.bindHTMX,
|
|
@@ -5990,7 +6278,7 @@ var useVoiceController = (path, options = {}) => {
|
|
|
5990
6278
|
};
|
|
5991
6279
|
};
|
|
5992
6280
|
// src/react/useVoiceWorkflowStatus.tsx
|
|
5993
|
-
import { useEffect as
|
|
6281
|
+
import { useEffect as useEffect20, useRef as useRef20, useSyncExternalStore as useSyncExternalStore20 } from "react";
|
|
5994
6282
|
|
|
5995
6283
|
// src/client/workflowStatus.ts
|
|
5996
6284
|
var fetchVoiceWorkflowStatus = async (path = "/evals/scenarios/json", options = {}) => {
|
|
@@ -6073,17 +6361,17 @@ var createVoiceWorkflowStatusStore = (path = "/evals/scenarios/json", options =
|
|
|
6073
6361
|
|
|
6074
6362
|
// src/react/useVoiceWorkflowStatus.tsx
|
|
6075
6363
|
var useVoiceWorkflowStatus = (path = "/evals/scenarios/json", options = {}) => {
|
|
6076
|
-
const storeRef =
|
|
6364
|
+
const storeRef = useRef20(null);
|
|
6077
6365
|
if (!storeRef.current) {
|
|
6078
6366
|
storeRef.current = createVoiceWorkflowStatusStore(path, options);
|
|
6079
6367
|
}
|
|
6080
6368
|
const store = storeRef.current;
|
|
6081
|
-
|
|
6369
|
+
useEffect20(() => {
|
|
6082
6370
|
store.refresh().catch(() => {});
|
|
6083
6371
|
return () => store.close();
|
|
6084
6372
|
}, [store]);
|
|
6085
6373
|
return {
|
|
6086
|
-
...
|
|
6374
|
+
...useSyncExternalStore20(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
6087
6375
|
refresh: store.refresh
|
|
6088
6376
|
};
|
|
6089
6377
|
};
|
|
@@ -6094,6 +6382,7 @@ export {
|
|
|
6094
6382
|
useVoiceTraceTimeline,
|
|
6095
6383
|
useVoiceStream,
|
|
6096
6384
|
useVoiceRoutingStatus,
|
|
6385
|
+
useVoiceReadinessFailures,
|
|
6097
6386
|
useVoiceProviderStatus,
|
|
6098
6387
|
useVoiceProviderSimulationControls,
|
|
6099
6388
|
useVoiceProviderContracts,
|
|
@@ -6111,6 +6400,7 @@ export {
|
|
|
6111
6400
|
VoiceTurnLatency,
|
|
6112
6401
|
VoiceTraceTimeline,
|
|
6113
6402
|
VoiceRoutingStatus,
|
|
6403
|
+
VoiceReadinessFailures,
|
|
6114
6404
|
VoiceProviderStatus,
|
|
6115
6405
|
VoiceProviderSimulationControls,
|
|
6116
6406
|
VoiceProviderContracts,
|