@absolutejs/voice 0.0.22-beta.167 → 0.0.22-beta.169
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/angular/index.d.ts +1 -0
- package/dist/angular/index.js +177 -58
- package/dist/angular/voice-provider-contracts.service.d.ts +12 -0
- package/dist/client/index.d.ts +4 -0
- package/dist/client/index.js +234 -47
- package/dist/client/providerContracts.d.ts +19 -0
- package/dist/client/providerContractsWidget.d.ts +37 -0
- package/dist/index.js +38 -2
- package/dist/providerStackRecommendations.d.ts +8 -0
- package/dist/react/VoiceProviderContracts.d.ts +6 -0
- package/dist/react/index.d.ts +2 -0
- package/dist/react/index.js +494 -195
- package/dist/react/useVoiceProviderContracts.d.ts +8 -0
- package/dist/svelte/createVoiceProviderContracts.d.ts +10 -0
- package/dist/svelte/index.d.ts +1 -0
- package/dist/svelte/index.js +270 -78
- package/dist/vue/VoiceProviderContracts.d.ts +21 -0
- package/dist/vue/index.d.ts +2 -0
- package/dist/vue/index.js +460 -170
- package/dist/vue/useVoiceProviderContracts.d.ts +9 -0
- package/package.json +1 -1
package/dist/vue/index.js
CHANGED
|
@@ -1719,8 +1719,296 @@ var VoiceProviderCapabilities = defineComponent5({
|
|
|
1719
1719
|
]);
|
|
1720
1720
|
}
|
|
1721
1721
|
});
|
|
1722
|
+
// src/vue/VoiceProviderContracts.ts
|
|
1723
|
+
import { defineComponent as defineComponent6, h as h6 } from "vue";
|
|
1724
|
+
|
|
1725
|
+
// src/vue/useVoiceProviderContracts.ts
|
|
1726
|
+
import { onUnmounted as onUnmounted6, shallowRef as shallowRef5 } from "vue";
|
|
1727
|
+
|
|
1728
|
+
// src/client/providerContracts.ts
|
|
1729
|
+
var fetchVoiceProviderContracts = async (path = "/api/provider-contracts", options = {}) => {
|
|
1730
|
+
const fetchImpl = options.fetch ?? globalThis.fetch;
|
|
1731
|
+
const response = await fetchImpl(path);
|
|
1732
|
+
if (!response.ok) {
|
|
1733
|
+
throw new Error(`Voice provider contracts failed: HTTP ${response.status}`);
|
|
1734
|
+
}
|
|
1735
|
+
return await response.json();
|
|
1736
|
+
};
|
|
1737
|
+
var createVoiceProviderContractsStore = (path = "/api/provider-contracts", options = {}) => {
|
|
1738
|
+
const listeners = new Set;
|
|
1739
|
+
let closed = false;
|
|
1740
|
+
let timer;
|
|
1741
|
+
let snapshot = {
|
|
1742
|
+
error: null,
|
|
1743
|
+
isLoading: false
|
|
1744
|
+
};
|
|
1745
|
+
const emit = () => {
|
|
1746
|
+
for (const listener of listeners) {
|
|
1747
|
+
listener();
|
|
1748
|
+
}
|
|
1749
|
+
};
|
|
1750
|
+
const refresh = async () => {
|
|
1751
|
+
if (closed) {
|
|
1752
|
+
return snapshot.report;
|
|
1753
|
+
}
|
|
1754
|
+
snapshot = { ...snapshot, error: null, isLoading: true };
|
|
1755
|
+
emit();
|
|
1756
|
+
try {
|
|
1757
|
+
const report = await fetchVoiceProviderContracts(path, options);
|
|
1758
|
+
snapshot = {
|
|
1759
|
+
error: null,
|
|
1760
|
+
isLoading: false,
|
|
1761
|
+
report,
|
|
1762
|
+
updatedAt: Date.now()
|
|
1763
|
+
};
|
|
1764
|
+
emit();
|
|
1765
|
+
return report;
|
|
1766
|
+
} catch (error) {
|
|
1767
|
+
snapshot = {
|
|
1768
|
+
...snapshot,
|
|
1769
|
+
error: error instanceof Error ? error.message : String(error),
|
|
1770
|
+
isLoading: false
|
|
1771
|
+
};
|
|
1772
|
+
emit();
|
|
1773
|
+
throw error;
|
|
1774
|
+
}
|
|
1775
|
+
};
|
|
1776
|
+
const close = () => {
|
|
1777
|
+
closed = true;
|
|
1778
|
+
if (timer) {
|
|
1779
|
+
clearInterval(timer);
|
|
1780
|
+
timer = undefined;
|
|
1781
|
+
}
|
|
1782
|
+
listeners.clear();
|
|
1783
|
+
};
|
|
1784
|
+
if (options.intervalMs && options.intervalMs > 0) {
|
|
1785
|
+
timer = setInterval(() => {
|
|
1786
|
+
refresh().catch(() => {});
|
|
1787
|
+
}, options.intervalMs);
|
|
1788
|
+
}
|
|
1789
|
+
return {
|
|
1790
|
+
close,
|
|
1791
|
+
getServerSnapshot: () => snapshot,
|
|
1792
|
+
getSnapshot: () => snapshot,
|
|
1793
|
+
refresh,
|
|
1794
|
+
subscribe: (listener) => {
|
|
1795
|
+
listeners.add(listener);
|
|
1796
|
+
return () => {
|
|
1797
|
+
listeners.delete(listener);
|
|
1798
|
+
};
|
|
1799
|
+
}
|
|
1800
|
+
};
|
|
1801
|
+
};
|
|
1802
|
+
|
|
1803
|
+
// src/vue/useVoiceProviderContracts.ts
|
|
1804
|
+
function useVoiceProviderContracts(path = "/api/provider-contracts", options = {}) {
|
|
1805
|
+
const store = createVoiceProviderContractsStore(path, options);
|
|
1806
|
+
const error = shallowRef5(null);
|
|
1807
|
+
const isLoading = shallowRef5(false);
|
|
1808
|
+
const report = shallowRef5();
|
|
1809
|
+
const updatedAt = shallowRef5(undefined);
|
|
1810
|
+
const sync = () => {
|
|
1811
|
+
const snapshot = store.getSnapshot();
|
|
1812
|
+
error.value = snapshot.error;
|
|
1813
|
+
isLoading.value = snapshot.isLoading;
|
|
1814
|
+
report.value = snapshot.report;
|
|
1815
|
+
updatedAt.value = snapshot.updatedAt;
|
|
1816
|
+
};
|
|
1817
|
+
const unsubscribe = store.subscribe(sync);
|
|
1818
|
+
sync();
|
|
1819
|
+
store.refresh().catch(() => {});
|
|
1820
|
+
onUnmounted6(() => {
|
|
1821
|
+
unsubscribe();
|
|
1822
|
+
store.close();
|
|
1823
|
+
});
|
|
1824
|
+
return {
|
|
1825
|
+
error,
|
|
1826
|
+
isLoading,
|
|
1827
|
+
refresh: store.refresh,
|
|
1828
|
+
report,
|
|
1829
|
+
updatedAt
|
|
1830
|
+
};
|
|
1831
|
+
}
|
|
1832
|
+
|
|
1833
|
+
// src/client/providerContractsWidget.ts
|
|
1834
|
+
var DEFAULT_TITLE5 = "Provider Contracts";
|
|
1835
|
+
var DEFAULT_DESCRIPTION5 = "Production contract coverage for provider env, latency, fallback, streaming, and capabilities.";
|
|
1836
|
+
var escapeHtml6 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
1837
|
+
var formatProvider2 = (provider) => provider.split(/[-_\s]+/).filter(Boolean).map((part) => `${part[0]?.toUpperCase() ?? ""}${part.slice(1)}`).join(" ") || provider;
|
|
1838
|
+
var formatStatus2 = (status) => status.split("-").map((part) => `${part[0]?.toUpperCase() ?? ""}${part.slice(1)}`).join(" ");
|
|
1839
|
+
var contractDetail = (row) => {
|
|
1840
|
+
const failing = row.checks.filter((check) => check.status !== "pass");
|
|
1841
|
+
if (failing.length === 0) {
|
|
1842
|
+
return "Provider contract is production-ready.";
|
|
1843
|
+
}
|
|
1844
|
+
return failing.map((check) => `${check.label}: ${check.detail ?? check.status}`).join(" ");
|
|
1845
|
+
};
|
|
1846
|
+
var createVoiceProviderContractsViewModel = (snapshot, options = {}) => {
|
|
1847
|
+
const rows = (snapshot.report?.rows ?? []).map((row) => ({
|
|
1848
|
+
...row,
|
|
1849
|
+
detail: contractDetail(row),
|
|
1850
|
+
label: `${formatProvider2(row.provider)} ${row.kind.toUpperCase()}`,
|
|
1851
|
+
remediations: row.checks.filter((check) => check.status !== "pass" && check.remediation).map((check) => ({
|
|
1852
|
+
detail: check.remediation?.detail ?? "",
|
|
1853
|
+
href: check.remediation?.href,
|
|
1854
|
+
label: check.remediation?.label ?? check.label
|
|
1855
|
+
})),
|
|
1856
|
+
rows: [
|
|
1857
|
+
{ label: "Status", value: formatStatus2(row.status) },
|
|
1858
|
+
{ label: "Selected", value: row.selected ? "Yes" : "No" },
|
|
1859
|
+
{ label: "Configured", value: row.configured ? "Yes" : "No" },
|
|
1860
|
+
{
|
|
1861
|
+
label: "Checks",
|
|
1862
|
+
value: row.checks.map((check) => `${check.label}: ${formatStatus2(check.status)}`).join(", ")
|
|
1863
|
+
}
|
|
1864
|
+
]
|
|
1865
|
+
}));
|
|
1866
|
+
const warningCount = snapshot.report ? snapshot.report.failed + snapshot.report.warned : rows.filter((row) => row.status !== "pass").length;
|
|
1867
|
+
return {
|
|
1868
|
+
description: options.description ?? DEFAULT_DESCRIPTION5,
|
|
1869
|
+
error: snapshot.error,
|
|
1870
|
+
isLoading: snapshot.isLoading,
|
|
1871
|
+
label: snapshot.error ? "Unavailable" : rows.length ? warningCount > 0 ? `${warningCount} needs attention` : `${rows.length} passing` : snapshot.isLoading ? "Checking" : "No contracts",
|
|
1872
|
+
rows,
|
|
1873
|
+
status: snapshot.error ? "error" : rows.length ? warningCount > 0 ? "warning" : "ready" : snapshot.isLoading ? "loading" : "empty",
|
|
1874
|
+
title: options.title ?? DEFAULT_TITLE5,
|
|
1875
|
+
updatedAt: snapshot.updatedAt
|
|
1876
|
+
};
|
|
1877
|
+
};
|
|
1878
|
+
var renderVoiceProviderContractsHTML = (snapshot, options = {}) => {
|
|
1879
|
+
const model = createVoiceProviderContractsViewModel(snapshot, options);
|
|
1880
|
+
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--${escapeHtml6(row.status)}">
|
|
1881
|
+
<header>
|
|
1882
|
+
<strong>${escapeHtml6(row.label)}</strong>
|
|
1883
|
+
<span>${escapeHtml6(formatStatus2(row.status))}</span>
|
|
1884
|
+
</header>
|
|
1885
|
+
<p>${escapeHtml6(row.detail)}</p>
|
|
1886
|
+
${row.remediations.length ? `<ul class="absolute-voice-provider-contracts__remediations">${row.remediations.map((remediation) => `<li>${remediation.href ? `<a href="${escapeHtml6(remediation.href)}">${escapeHtml6(remediation.label)}</a>` : `<strong>${escapeHtml6(remediation.label)}</strong>`}<span>${escapeHtml6(remediation.detail)}</span></li>`).join("")}</ul>` : ""}
|
|
1887
|
+
<dl>${row.rows.map((item) => `<div>
|
|
1888
|
+
<dt>${escapeHtml6(item.label)}</dt>
|
|
1889
|
+
<dd>${escapeHtml6(item.value)}</dd>
|
|
1890
|
+
</div>`).join("")}</dl>
|
|
1891
|
+
</article>`).join("")}</div>` : '<p class="absolute-voice-provider-contracts__empty">Configure provider contracts to see production coverage.</p>';
|
|
1892
|
+
return `<section class="absolute-voice-provider-contracts absolute-voice-provider-contracts--${escapeHtml6(model.status)}">
|
|
1893
|
+
<header class="absolute-voice-provider-contracts__header">
|
|
1894
|
+
<span class="absolute-voice-provider-contracts__eyebrow">${escapeHtml6(model.title)}</span>
|
|
1895
|
+
<strong class="absolute-voice-provider-contracts__label">${escapeHtml6(model.label)}</strong>
|
|
1896
|
+
</header>
|
|
1897
|
+
<p class="absolute-voice-provider-contracts__description">${escapeHtml6(model.description)}</p>
|
|
1898
|
+
${rows}
|
|
1899
|
+
${model.error ? `<p class="absolute-voice-provider-contracts__error">${escapeHtml6(model.error)}</p>` : ""}
|
|
1900
|
+
</section>`;
|
|
1901
|
+
};
|
|
1902
|
+
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}`;
|
|
1903
|
+
var mountVoiceProviderContracts = (element, path = "/api/provider-contracts", options = {}) => {
|
|
1904
|
+
const store = createVoiceProviderContractsStore(path, options);
|
|
1905
|
+
const render = () => {
|
|
1906
|
+
element.innerHTML = renderVoiceProviderContractsHTML(store.getSnapshot(), options);
|
|
1907
|
+
};
|
|
1908
|
+
const unsubscribe = store.subscribe(render);
|
|
1909
|
+
render();
|
|
1910
|
+
store.refresh().catch(() => {});
|
|
1911
|
+
return {
|
|
1912
|
+
close: () => {
|
|
1913
|
+
unsubscribe();
|
|
1914
|
+
store.close();
|
|
1915
|
+
},
|
|
1916
|
+
refresh: store.refresh
|
|
1917
|
+
};
|
|
1918
|
+
};
|
|
1919
|
+
var defineVoiceProviderContractsElement = (tagName = "absolute-voice-provider-contracts") => {
|
|
1920
|
+
if (typeof window === "undefined" || typeof customElements === "undefined" || customElements.get(tagName)) {
|
|
1921
|
+
return;
|
|
1922
|
+
}
|
|
1923
|
+
customElements.define(tagName, class AbsoluteVoiceProviderContractsElement extends HTMLElement {
|
|
1924
|
+
mounted;
|
|
1925
|
+
connectedCallback() {
|
|
1926
|
+
const intervalMs = Number(this.getAttribute("interval-ms") ?? 5000);
|
|
1927
|
+
this.mounted = mountVoiceProviderContracts(this, this.getAttribute("path") ?? "/api/provider-contracts", {
|
|
1928
|
+
description: this.getAttribute("description") ?? undefined,
|
|
1929
|
+
intervalMs: Number.isFinite(intervalMs) ? intervalMs : 5000,
|
|
1930
|
+
title: this.getAttribute("title") ?? undefined
|
|
1931
|
+
});
|
|
1932
|
+
}
|
|
1933
|
+
disconnectedCallback() {
|
|
1934
|
+
this.mounted?.close();
|
|
1935
|
+
this.mounted = undefined;
|
|
1936
|
+
}
|
|
1937
|
+
});
|
|
1938
|
+
};
|
|
1939
|
+
|
|
1940
|
+
// src/vue/VoiceProviderContracts.ts
|
|
1941
|
+
var VoiceProviderContracts = defineComponent6({
|
|
1942
|
+
name: "VoiceProviderContracts",
|
|
1943
|
+
props: {
|
|
1944
|
+
description: String,
|
|
1945
|
+
intervalMs: Number,
|
|
1946
|
+
path: {
|
|
1947
|
+
default: "/api/provider-contracts",
|
|
1948
|
+
type: String
|
|
1949
|
+
},
|
|
1950
|
+
title: String
|
|
1951
|
+
},
|
|
1952
|
+
setup(props) {
|
|
1953
|
+
const state = useVoiceProviderContracts(props.path, {
|
|
1954
|
+
description: props.description,
|
|
1955
|
+
intervalMs: props.intervalMs,
|
|
1956
|
+
title: props.title
|
|
1957
|
+
});
|
|
1958
|
+
return () => {
|
|
1959
|
+
const model = createVoiceProviderContractsViewModel({
|
|
1960
|
+
error: state.error.value,
|
|
1961
|
+
isLoading: state.isLoading.value,
|
|
1962
|
+
report: state.report.value,
|
|
1963
|
+
updatedAt: state.updatedAt.value
|
|
1964
|
+
}, {
|
|
1965
|
+
description: props.description,
|
|
1966
|
+
intervalMs: props.intervalMs,
|
|
1967
|
+
title: props.title
|
|
1968
|
+
});
|
|
1969
|
+
return h6("section", {
|
|
1970
|
+
class: [
|
|
1971
|
+
"absolute-voice-provider-contracts",
|
|
1972
|
+
`absolute-voice-provider-contracts--${model.status}`
|
|
1973
|
+
]
|
|
1974
|
+
}, [
|
|
1975
|
+
h6("header", { class: "absolute-voice-provider-contracts__header" }, [
|
|
1976
|
+
h6("span", { class: "absolute-voice-provider-contracts__eyebrow" }, model.title),
|
|
1977
|
+
h6("strong", { class: "absolute-voice-provider-contracts__label" }, model.label)
|
|
1978
|
+
]),
|
|
1979
|
+
h6("p", { class: "absolute-voice-provider-contracts__description" }, model.description),
|
|
1980
|
+
model.rows.length ? h6("div", { class: "absolute-voice-provider-contracts__rows" }, model.rows.map((row) => h6("article", {
|
|
1981
|
+
class: [
|
|
1982
|
+
"absolute-voice-provider-contracts__row",
|
|
1983
|
+
`absolute-voice-provider-contracts__row--${row.status}`
|
|
1984
|
+
],
|
|
1985
|
+
key: `${row.kind}:${row.provider}`
|
|
1986
|
+
}, [
|
|
1987
|
+
h6("header", [
|
|
1988
|
+
h6("strong", row.label),
|
|
1989
|
+
h6("span", row.status)
|
|
1990
|
+
]),
|
|
1991
|
+
h6("p", row.detail),
|
|
1992
|
+
row.remediations.length ? h6("ul", {
|
|
1993
|
+
class: "absolute-voice-provider-contracts__remediations"
|
|
1994
|
+
}, row.remediations.map((remediation) => h6("li", {
|
|
1995
|
+
key: `${row.kind}:${row.provider}:${remediation.label}`
|
|
1996
|
+
}, [
|
|
1997
|
+
remediation.href ? h6("a", { href: remediation.href }, remediation.label) : h6("strong", remediation.label),
|
|
1998
|
+
h6("span", remediation.detail)
|
|
1999
|
+
]))) : null,
|
|
2000
|
+
h6("dl", row.rows.map((item) => h6("div", { key: item.label }, [
|
|
2001
|
+
h6("dt", item.label),
|
|
2002
|
+
h6("dd", item.value)
|
|
2003
|
+
])))
|
|
2004
|
+
]))) : h6("p", { class: "absolute-voice-provider-contracts__empty" }, "Configure provider contracts to see production coverage."),
|
|
2005
|
+
model.error ? h6("p", { class: "absolute-voice-provider-contracts__error" }, model.error) : null
|
|
2006
|
+
]);
|
|
2007
|
+
};
|
|
2008
|
+
}
|
|
2009
|
+
});
|
|
1722
2010
|
// src/vue/VoiceProviderStatus.ts
|
|
1723
|
-
import { computed as computed3, defineComponent as
|
|
2011
|
+
import { computed as computed3, defineComponent as defineComponent7, h as h7 } from "vue";
|
|
1724
2012
|
|
|
1725
2013
|
// src/client/providerStatus.ts
|
|
1726
2014
|
var fetchVoiceProviderStatus = async (path = "/api/provider-status", options = {}) => {
|
|
@@ -1803,11 +2091,11 @@ var createVoiceProviderStatusStore = (path = "/api/provider-status", options = {
|
|
|
1803
2091
|
};
|
|
1804
2092
|
|
|
1805
2093
|
// src/client/providerStatusWidget.ts
|
|
1806
|
-
var
|
|
1807
|
-
var
|
|
1808
|
-
var
|
|
1809
|
-
var
|
|
1810
|
-
var
|
|
2094
|
+
var DEFAULT_TITLE6 = "Voice Providers";
|
|
2095
|
+
var DEFAULT_DESCRIPTION6 = "Live provider health, fallback counts, latency, and suppression state from your self-hosted trace store.";
|
|
2096
|
+
var escapeHtml7 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
2097
|
+
var formatProvider3 = (provider) => provider.split(/[-_\s]+/).filter(Boolean).map((part) => `${part[0]?.toUpperCase() ?? ""}${part.slice(1)}`).join(" ") || provider;
|
|
2098
|
+
var formatStatus3 = (status) => status.split("-").map((part) => `${part[0]?.toUpperCase() ?? ""}${part.slice(1)}`).join(" ");
|
|
1811
2099
|
var formatLatency = (value) => typeof value === "number" ? `${value}ms` : "No samples";
|
|
1812
2100
|
var formatSuppression = (value) => typeof value === "number" ? `${Math.ceil(value / 1000)}s` : "None";
|
|
1813
2101
|
var getProviderDetail = (provider) => {
|
|
@@ -1833,7 +2121,7 @@ var createVoiceProviderStatusViewModel = (snapshot, options = {}) => {
|
|
|
1833
2121
|
const providers = snapshot.providers.map((provider) => ({
|
|
1834
2122
|
...provider,
|
|
1835
2123
|
detail: getProviderDetail(provider),
|
|
1836
|
-
label: `${
|
|
2124
|
+
label: `${formatProvider3(provider.provider)}${provider.recommended ? " recommended" : ""}`,
|
|
1837
2125
|
rows: [
|
|
1838
2126
|
{ label: "Runs", value: String(provider.runCount) },
|
|
1839
2127
|
{ label: "Avg latency", value: formatLatency(provider.averageElapsedMs) },
|
|
@@ -1849,37 +2137,37 @@ var createVoiceProviderStatusViewModel = (snapshot, options = {}) => {
|
|
|
1849
2137
|
const warningCount = providers.filter((provider) => isWarningStatus2(provider.status)).length;
|
|
1850
2138
|
const healthyCount = providers.filter((provider) => provider.status === "healthy").length;
|
|
1851
2139
|
return {
|
|
1852
|
-
description: options.description ??
|
|
2140
|
+
description: options.description ?? DEFAULT_DESCRIPTION6,
|
|
1853
2141
|
error: snapshot.error,
|
|
1854
2142
|
isLoading: snapshot.isLoading,
|
|
1855
2143
|
label: snapshot.error ? "Unavailable" : providers.length ? warningCount > 0 ? `${warningCount} needs attention` : `${healthyCount} healthy` : snapshot.isLoading ? "Checking" : "No provider traffic",
|
|
1856
2144
|
providers,
|
|
1857
2145
|
status: snapshot.error ? "error" : providers.length ? warningCount > 0 ? "warning" : "ready" : snapshot.isLoading ? "loading" : "empty",
|
|
1858
|
-
title: options.title ??
|
|
2146
|
+
title: options.title ?? DEFAULT_TITLE6,
|
|
1859
2147
|
updatedAt: snapshot.updatedAt
|
|
1860
2148
|
};
|
|
1861
2149
|
};
|
|
1862
2150
|
var renderVoiceProviderStatusHTML = (snapshot, options = {}) => {
|
|
1863
2151
|
const model = createVoiceProviderStatusViewModel(snapshot, options);
|
|
1864
|
-
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--${
|
|
2152
|
+
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--${escapeHtml7(provider.status)}">
|
|
1865
2153
|
<header>
|
|
1866
|
-
<strong>${
|
|
1867
|
-
<span>${
|
|
2154
|
+
<strong>${escapeHtml7(provider.label)}</strong>
|
|
2155
|
+
<span>${escapeHtml7(formatStatus3(provider.status))}</span>
|
|
1868
2156
|
</header>
|
|
1869
|
-
<p>${
|
|
2157
|
+
<p>${escapeHtml7(provider.detail)}</p>
|
|
1870
2158
|
<dl>${provider.rows.map((row) => `<div>
|
|
1871
|
-
<dt>${
|
|
1872
|
-
<dd>${
|
|
2159
|
+
<dt>${escapeHtml7(row.label)}</dt>
|
|
2160
|
+
<dd>${escapeHtml7(row.value)}</dd>
|
|
1873
2161
|
</div>`).join("")}</dl>
|
|
1874
2162
|
</article>`).join("")}</div>` : '<p class="absolute-voice-provider-status__empty">Run voice traffic to see provider health.</p>';
|
|
1875
|
-
return `<section class="absolute-voice-provider-status absolute-voice-provider-status--${
|
|
2163
|
+
return `<section class="absolute-voice-provider-status absolute-voice-provider-status--${escapeHtml7(model.status)}">
|
|
1876
2164
|
<header class="absolute-voice-provider-status__header">
|
|
1877
|
-
<span class="absolute-voice-provider-status__eyebrow">${
|
|
1878
|
-
<strong class="absolute-voice-provider-status__label">${
|
|
2165
|
+
<span class="absolute-voice-provider-status__eyebrow">${escapeHtml7(model.title)}</span>
|
|
2166
|
+
<strong class="absolute-voice-provider-status__label">${escapeHtml7(model.label)}</strong>
|
|
1879
2167
|
</header>
|
|
1880
|
-
<p class="absolute-voice-provider-status__description">${
|
|
2168
|
+
<p class="absolute-voice-provider-status__description">${escapeHtml7(model.description)}</p>
|
|
1881
2169
|
${providers}
|
|
1882
|
-
${model.error ? `<p class="absolute-voice-provider-status__error">${
|
|
2170
|
+
${model.error ? `<p class="absolute-voice-provider-status__error">${escapeHtml7(model.error)}</p>` : ""}
|
|
1883
2171
|
</section>`;
|
|
1884
2172
|
};
|
|
1885
2173
|
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}`;
|
|
@@ -1921,12 +2209,12 @@ var defineVoiceProviderStatusElement = (tagName = "absolute-voice-provider-statu
|
|
|
1921
2209
|
};
|
|
1922
2210
|
|
|
1923
2211
|
// src/vue/useVoiceProviderStatus.ts
|
|
1924
|
-
import { onUnmounted as
|
|
2212
|
+
import { onUnmounted as onUnmounted7, ref as ref5, shallowRef as shallowRef6 } from "vue";
|
|
1925
2213
|
function useVoiceProviderStatus(path = "/api/provider-status", options = {}) {
|
|
1926
2214
|
const store = createVoiceProviderStatusStore(path, options);
|
|
1927
2215
|
const error = ref5(null);
|
|
1928
2216
|
const isLoading = ref5(false);
|
|
1929
|
-
const providers =
|
|
2217
|
+
const providers = shallowRef6([]);
|
|
1930
2218
|
const updatedAt = ref5(undefined);
|
|
1931
2219
|
const sync = () => {
|
|
1932
2220
|
const snapshot = store.getSnapshot();
|
|
@@ -1938,7 +2226,7 @@ function useVoiceProviderStatus(path = "/api/provider-status", options = {}) {
|
|
|
1938
2226
|
const unsubscribe = store.subscribe(sync);
|
|
1939
2227
|
sync();
|
|
1940
2228
|
store.refresh().catch(() => {});
|
|
1941
|
-
|
|
2229
|
+
onUnmounted7(() => {
|
|
1942
2230
|
unsubscribe();
|
|
1943
2231
|
store.close();
|
|
1944
2232
|
});
|
|
@@ -1952,7 +2240,7 @@ function useVoiceProviderStatus(path = "/api/provider-status", options = {}) {
|
|
|
1952
2240
|
}
|
|
1953
2241
|
|
|
1954
2242
|
// src/vue/VoiceProviderStatus.ts
|
|
1955
|
-
var VoiceProviderStatus =
|
|
2243
|
+
var VoiceProviderStatus = defineComponent7({
|
|
1956
2244
|
name: "VoiceProviderStatus",
|
|
1957
2245
|
props: {
|
|
1958
2246
|
class: {
|
|
@@ -1989,41 +2277,41 @@ var VoiceProviderStatus = defineComponent6({
|
|
|
1989
2277
|
providers: status.providers.value,
|
|
1990
2278
|
updatedAt: status.updatedAt.value
|
|
1991
2279
|
}, options));
|
|
1992
|
-
return () =>
|
|
2280
|
+
return () => h7("section", {
|
|
1993
2281
|
class: [
|
|
1994
2282
|
"absolute-voice-provider-status",
|
|
1995
2283
|
`absolute-voice-provider-status--${model.value.status}`,
|
|
1996
2284
|
props.class
|
|
1997
2285
|
]
|
|
1998
2286
|
}, [
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2287
|
+
h7("header", { class: "absolute-voice-provider-status__header" }, [
|
|
2288
|
+
h7("span", { class: "absolute-voice-provider-status__eyebrow" }, model.value.title),
|
|
2289
|
+
h7("strong", { class: "absolute-voice-provider-status__label" }, model.value.label)
|
|
2002
2290
|
]),
|
|
2003
|
-
|
|
2004
|
-
model.value.providers.length ?
|
|
2291
|
+
h7("p", { class: "absolute-voice-provider-status__description" }, model.value.description),
|
|
2292
|
+
model.value.providers.length ? h7("div", { class: "absolute-voice-provider-status__providers" }, model.value.providers.map((provider) => h7("article", {
|
|
2005
2293
|
class: [
|
|
2006
2294
|
"absolute-voice-provider-status__provider",
|
|
2007
2295
|
`absolute-voice-provider-status__provider--${provider.status}`
|
|
2008
2296
|
],
|
|
2009
2297
|
key: provider.provider
|
|
2010
2298
|
}, [
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2299
|
+
h7("header", [
|
|
2300
|
+
h7("strong", provider.label),
|
|
2301
|
+
h7("span", provider.status)
|
|
2014
2302
|
]),
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2303
|
+
h7("p", provider.detail),
|
|
2304
|
+
h7("dl", provider.rows.map((row) => h7("div", { key: row.label }, [
|
|
2305
|
+
h7("dt", row.label),
|
|
2306
|
+
h7("dd", row.value)
|
|
2019
2307
|
])))
|
|
2020
|
-
]))) :
|
|
2021
|
-
model.value.error ?
|
|
2308
|
+
]))) : h7("p", { class: "absolute-voice-provider-status__empty" }, "Run voice traffic to see provider health."),
|
|
2309
|
+
model.value.error ? h7("p", { class: "absolute-voice-provider-status__error" }, model.value.error) : null
|
|
2022
2310
|
]);
|
|
2023
2311
|
}
|
|
2024
2312
|
});
|
|
2025
2313
|
// src/vue/VoiceRoutingStatus.ts
|
|
2026
|
-
import { computed as computed4, defineComponent as
|
|
2314
|
+
import { computed as computed4, defineComponent as defineComponent8, h as h8 } from "vue";
|
|
2027
2315
|
|
|
2028
2316
|
// src/client/routingStatus.ts
|
|
2029
2317
|
var fetchVoiceRoutingStatus = async (path = "/api/routing/latest", options = {}) => {
|
|
@@ -2106,9 +2394,9 @@ var createVoiceRoutingStatusStore = (path = "/api/routing/latest", options = {})
|
|
|
2106
2394
|
};
|
|
2107
2395
|
|
|
2108
2396
|
// src/client/routingStatusWidget.ts
|
|
2109
|
-
var
|
|
2110
|
-
var
|
|
2111
|
-
var
|
|
2397
|
+
var DEFAULT_TITLE7 = "Voice Routing";
|
|
2398
|
+
var DEFAULT_DESCRIPTION7 = "Latest provider routing decision from the self-hosted trace store.";
|
|
2399
|
+
var escapeHtml8 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
2112
2400
|
var formatValue = (value, fallback = "None") => typeof value === "string" && value.trim() ? value : typeof value === "number" && Number.isFinite(value) ? String(value) : fallback;
|
|
2113
2401
|
var createVoiceRoutingStatusViewModel = (snapshot, options = {}) => {
|
|
2114
2402
|
const decision = snapshot.decision;
|
|
@@ -2132,30 +2420,30 @@ var createVoiceRoutingStatusViewModel = (snapshot, options = {}) => {
|
|
|
2132
2420
|
] : [];
|
|
2133
2421
|
return {
|
|
2134
2422
|
decision,
|
|
2135
|
-
description: options.description ??
|
|
2423
|
+
description: options.description ?? DEFAULT_DESCRIPTION7,
|
|
2136
2424
|
error: snapshot.error,
|
|
2137
2425
|
isLoading: snapshot.isLoading,
|
|
2138
2426
|
label: snapshot.error ? "Unavailable" : decision ? `${formatValue(decision.kind).toUpperCase()} ${formatValue(decision.status, "unknown")}` : snapshot.isLoading ? "Checking" : "No routing yet",
|
|
2139
2427
|
rows,
|
|
2140
2428
|
status: snapshot.error ? "error" : decision ? "ready" : snapshot.isLoading ? "loading" : "empty",
|
|
2141
|
-
title: options.title ??
|
|
2429
|
+
title: options.title ?? DEFAULT_TITLE7,
|
|
2142
2430
|
updatedAt: snapshot.updatedAt
|
|
2143
2431
|
};
|
|
2144
2432
|
};
|
|
2145
2433
|
var renderVoiceRoutingStatusHTML = (snapshot, options = {}) => {
|
|
2146
2434
|
const model = createVoiceRoutingStatusViewModel(snapshot, options);
|
|
2147
2435
|
const rows = model.rows.length ? `<div class="absolute-voice-routing-status__grid">${model.rows.map((row) => `<div>
|
|
2148
|
-
<span>${
|
|
2149
|
-
<strong>${
|
|
2436
|
+
<span>${escapeHtml8(row.label)}</span>
|
|
2437
|
+
<strong>${escapeHtml8(row.value)}</strong>
|
|
2150
2438
|
</div>`).join("")}</div>` : '<p class="absolute-voice-routing-status__empty">Start a voice session to see the selected provider.</p>';
|
|
2151
|
-
return `<section class="absolute-voice-routing-status absolute-voice-routing-status--${
|
|
2439
|
+
return `<section class="absolute-voice-routing-status absolute-voice-routing-status--${escapeHtml8(model.status)}">
|
|
2152
2440
|
<header class="absolute-voice-routing-status__header">
|
|
2153
|
-
<span class="absolute-voice-routing-status__eyebrow">${
|
|
2154
|
-
<strong class="absolute-voice-routing-status__label">${
|
|
2441
|
+
<span class="absolute-voice-routing-status__eyebrow">${escapeHtml8(model.title)}</span>
|
|
2442
|
+
<strong class="absolute-voice-routing-status__label">${escapeHtml8(model.label)}</strong>
|
|
2155
2443
|
</header>
|
|
2156
|
-
<p class="absolute-voice-routing-status__description">${
|
|
2444
|
+
<p class="absolute-voice-routing-status__description">${escapeHtml8(model.description)}</p>
|
|
2157
2445
|
${rows}
|
|
2158
|
-
${model.error ? `<p class="absolute-voice-routing-status__error">${
|
|
2446
|
+
${model.error ? `<p class="absolute-voice-routing-status__error">${escapeHtml8(model.error)}</p>` : ""}
|
|
2159
2447
|
</section>`;
|
|
2160
2448
|
};
|
|
2161
2449
|
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}`;
|
|
@@ -2197,10 +2485,10 @@ var defineVoiceRoutingStatusElement = (tagName = "absolute-voice-routing-status"
|
|
|
2197
2485
|
};
|
|
2198
2486
|
|
|
2199
2487
|
// src/vue/useVoiceRoutingStatus.ts
|
|
2200
|
-
import { onUnmounted as
|
|
2488
|
+
import { onUnmounted as onUnmounted8, ref as ref6, shallowRef as shallowRef7 } from "vue";
|
|
2201
2489
|
function useVoiceRoutingStatus(path = "/api/routing/latest", options = {}) {
|
|
2202
2490
|
const store = createVoiceRoutingStatusStore(path, options);
|
|
2203
|
-
const decision =
|
|
2491
|
+
const decision = shallowRef7(null);
|
|
2204
2492
|
const error = ref6(null);
|
|
2205
2493
|
const isLoading = ref6(false);
|
|
2206
2494
|
const updatedAt = ref6(undefined);
|
|
@@ -2214,7 +2502,7 @@ function useVoiceRoutingStatus(path = "/api/routing/latest", options = {}) {
|
|
|
2214
2502
|
const unsubscribe = store.subscribe(sync);
|
|
2215
2503
|
sync();
|
|
2216
2504
|
store.refresh().catch(() => {});
|
|
2217
|
-
|
|
2505
|
+
onUnmounted8(() => {
|
|
2218
2506
|
unsubscribe();
|
|
2219
2507
|
store.close();
|
|
2220
2508
|
});
|
|
@@ -2228,7 +2516,7 @@ function useVoiceRoutingStatus(path = "/api/routing/latest", options = {}) {
|
|
|
2228
2516
|
}
|
|
2229
2517
|
|
|
2230
2518
|
// src/vue/VoiceRoutingStatus.ts
|
|
2231
|
-
var VoiceRoutingStatus =
|
|
2519
|
+
var VoiceRoutingStatus = defineComponent8({
|
|
2232
2520
|
name: "VoiceRoutingStatus",
|
|
2233
2521
|
props: {
|
|
2234
2522
|
class: {
|
|
@@ -2265,28 +2553,28 @@ var VoiceRoutingStatus = defineComponent7({
|
|
|
2265
2553
|
isLoading: status.isLoading.value,
|
|
2266
2554
|
updatedAt: status.updatedAt.value
|
|
2267
2555
|
}, options));
|
|
2268
|
-
return () =>
|
|
2556
|
+
return () => h8("section", {
|
|
2269
2557
|
class: [
|
|
2270
2558
|
"absolute-voice-routing-status",
|
|
2271
2559
|
`absolute-voice-routing-status--${model.value.status}`,
|
|
2272
2560
|
props.class
|
|
2273
2561
|
]
|
|
2274
2562
|
}, [
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2563
|
+
h8("header", { class: "absolute-voice-routing-status__header" }, [
|
|
2564
|
+
h8("span", { class: "absolute-voice-routing-status__eyebrow" }, model.value.title),
|
|
2565
|
+
h8("strong", { class: "absolute-voice-routing-status__label" }, model.value.label)
|
|
2278
2566
|
]),
|
|
2279
|
-
|
|
2280
|
-
model.value.rows.length ?
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
]))) :
|
|
2284
|
-
model.value.error ?
|
|
2567
|
+
h8("p", { class: "absolute-voice-routing-status__description" }, model.value.description),
|
|
2568
|
+
model.value.rows.length ? h8("div", { class: "absolute-voice-routing-status__grid" }, model.value.rows.map((row) => h8("div", { key: row.label }, [
|
|
2569
|
+
h8("span", row.label),
|
|
2570
|
+
h8("strong", row.value)
|
|
2571
|
+
]))) : h8("p", { class: "absolute-voice-routing-status__empty" }, "Start a voice session to see the selected provider."),
|
|
2572
|
+
model.value.error ? h8("p", { class: "absolute-voice-routing-status__error" }, model.value.error) : null
|
|
2285
2573
|
]);
|
|
2286
2574
|
}
|
|
2287
2575
|
});
|
|
2288
2576
|
// src/vue/VoiceTurnLatency.ts
|
|
2289
|
-
import { computed as computed5, defineComponent as
|
|
2577
|
+
import { computed as computed5, defineComponent as defineComponent9, h as h9 } from "vue";
|
|
2290
2578
|
|
|
2291
2579
|
// src/client/turnLatency.ts
|
|
2292
2580
|
var fetchVoiceTurnLatency = async (path = "/api/turn-latency", options = {}) => {
|
|
@@ -2392,10 +2680,10 @@ var createVoiceTurnLatencyStore = (path = "/api/turn-latency", options = {}) =>
|
|
|
2392
2680
|
};
|
|
2393
2681
|
|
|
2394
2682
|
// src/client/turnLatencyWidget.ts
|
|
2395
|
-
var
|
|
2396
|
-
var
|
|
2683
|
+
var DEFAULT_TITLE8 = "Turn Latency";
|
|
2684
|
+
var DEFAULT_DESCRIPTION8 = "Per-turn timing from first transcript to commit and assistant response start.";
|
|
2397
2685
|
var DEFAULT_PROOF_LABEL = "Run latency proof";
|
|
2398
|
-
var
|
|
2686
|
+
var escapeHtml9 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
2399
2687
|
var formatMs = (value) => typeof value === "number" ? `${Math.round(value)}ms` : "n/a";
|
|
2400
2688
|
var createVoiceTurnLatencyViewModel = (snapshot, options = {}) => {
|
|
2401
2689
|
const turns = (snapshot.report?.turns ?? []).map((turn) => ({
|
|
@@ -2409,39 +2697,39 @@ var createVoiceTurnLatencyViewModel = (snapshot, options = {}) => {
|
|
|
2409
2697
|
const warningCount = snapshot.report?.warnings ?? turns.filter((turn) => turn.status === "warn").length;
|
|
2410
2698
|
const failedCount = snapshot.report?.failed ?? turns.filter((turn) => turn.status === "fail").length;
|
|
2411
2699
|
return {
|
|
2412
|
-
description: options.description ??
|
|
2700
|
+
description: options.description ?? DEFAULT_DESCRIPTION8,
|
|
2413
2701
|
error: snapshot.error,
|
|
2414
2702
|
isLoading: snapshot.isLoading,
|
|
2415
2703
|
label: snapshot.error ? "Unavailable" : turns.length ? failedCount > 0 ? `${failedCount} slow` : warningCount > 0 ? `${warningCount} warnings` : `avg ${formatMs(snapshot.report?.averageTotalMs)}` : snapshot.isLoading ? "Checking" : "No turns",
|
|
2416
2704
|
proofLabel: options.proofPath ? options.proofLabel ?? DEFAULT_PROOF_LABEL : undefined,
|
|
2417
2705
|
showProofAction: Boolean(options.proofPath),
|
|
2418
2706
|
status: snapshot.error ? "error" : turns.length ? failedCount > 0 || warningCount > 0 ? "warning" : "ready" : snapshot.isLoading ? "loading" : "empty",
|
|
2419
|
-
title: options.title ??
|
|
2707
|
+
title: options.title ?? DEFAULT_TITLE8,
|
|
2420
2708
|
turns,
|
|
2421
2709
|
updatedAt: snapshot.updatedAt
|
|
2422
2710
|
};
|
|
2423
2711
|
};
|
|
2424
2712
|
var renderVoiceTurnLatencyHTML = (snapshot, options = {}) => {
|
|
2425
2713
|
const model = createVoiceTurnLatencyViewModel(snapshot, options);
|
|
2426
|
-
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--${
|
|
2714
|
+
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--${escapeHtml9(turn.status)}">
|
|
2427
2715
|
<header>
|
|
2428
|
-
<strong>${
|
|
2429
|
-
<span>${
|
|
2716
|
+
<strong>${escapeHtml9(turn.label)}</strong>
|
|
2717
|
+
<span>${escapeHtml9(turn.status)}</span>
|
|
2430
2718
|
</header>
|
|
2431
2719
|
<dl>${turn.rows.map((row) => `<div>
|
|
2432
|
-
<dt>${
|
|
2433
|
-
<dd>${
|
|
2720
|
+
<dt>${escapeHtml9(row.label)}</dt>
|
|
2721
|
+
<dd>${escapeHtml9(row.value)}</dd>
|
|
2434
2722
|
</div>`).join("")}</dl>
|
|
2435
2723
|
</article>`).join("")}</div>` : '<p class="absolute-voice-turn-latency__empty">Complete a voice turn to see latency diagnostics.</p>';
|
|
2436
|
-
return `<section class="absolute-voice-turn-latency absolute-voice-turn-latency--${
|
|
2724
|
+
return `<section class="absolute-voice-turn-latency absolute-voice-turn-latency--${escapeHtml9(model.status)}">
|
|
2437
2725
|
<header class="absolute-voice-turn-latency__header">
|
|
2438
|
-
<span class="absolute-voice-turn-latency__eyebrow">${
|
|
2439
|
-
<strong class="absolute-voice-turn-latency__label">${
|
|
2726
|
+
<span class="absolute-voice-turn-latency__eyebrow">${escapeHtml9(model.title)}</span>
|
|
2727
|
+
<strong class="absolute-voice-turn-latency__label">${escapeHtml9(model.label)}</strong>
|
|
2440
2728
|
</header>
|
|
2441
|
-
<p class="absolute-voice-turn-latency__description">${
|
|
2442
|
-
${model.showProofAction ? `<button class="absolute-voice-turn-latency__proof" data-absolute-voice-turn-latency-proof type="button">${
|
|
2729
|
+
<p class="absolute-voice-turn-latency__description">${escapeHtml9(model.description)}</p>
|
|
2730
|
+
${model.showProofAction ? `<button class="absolute-voice-turn-latency__proof" data-absolute-voice-turn-latency-proof type="button">${escapeHtml9(model.proofLabel ?? DEFAULT_PROOF_LABEL)}</button>` : ""}
|
|
2443
2731
|
${turns}
|
|
2444
|
-
${model.error ? `<p class="absolute-voice-turn-latency__error">${
|
|
2732
|
+
${model.error ? `<p class="absolute-voice-turn-latency__error">${escapeHtml9(model.error)}</p>` : ""}
|
|
2445
2733
|
</section>`;
|
|
2446
2734
|
};
|
|
2447
2735
|
var mountVoiceTurnLatency = (element, path = "/api/turn-latency", options = {}) => {
|
|
@@ -2492,13 +2780,13 @@ var defineVoiceTurnLatencyElement = (tagName = "absolute-voice-turn-latency") =>
|
|
|
2492
2780
|
};
|
|
2493
2781
|
|
|
2494
2782
|
// src/vue/useVoiceTurnLatency.ts
|
|
2495
|
-
import { onUnmounted as
|
|
2783
|
+
import { onUnmounted as onUnmounted9, shallowRef as shallowRef8 } from "vue";
|
|
2496
2784
|
function useVoiceTurnLatency(path = "/api/turn-latency", options = {}) {
|
|
2497
2785
|
const store = createVoiceTurnLatencyStore(path, options);
|
|
2498
|
-
const error =
|
|
2499
|
-
const isLoading =
|
|
2500
|
-
const report =
|
|
2501
|
-
const updatedAt =
|
|
2786
|
+
const error = shallowRef8(null);
|
|
2787
|
+
const isLoading = shallowRef8(false);
|
|
2788
|
+
const report = shallowRef8();
|
|
2789
|
+
const updatedAt = shallowRef8(undefined);
|
|
2502
2790
|
const sync = () => {
|
|
2503
2791
|
const snapshot = store.getSnapshot();
|
|
2504
2792
|
error.value = snapshot.error;
|
|
@@ -2509,7 +2797,7 @@ function useVoiceTurnLatency(path = "/api/turn-latency", options = {}) {
|
|
|
2509
2797
|
const unsubscribe = store.subscribe(sync);
|
|
2510
2798
|
sync();
|
|
2511
2799
|
store.refresh().catch(() => {});
|
|
2512
|
-
|
|
2800
|
+
onUnmounted9(() => {
|
|
2513
2801
|
unsubscribe();
|
|
2514
2802
|
store.close();
|
|
2515
2803
|
});
|
|
@@ -2524,7 +2812,7 @@ function useVoiceTurnLatency(path = "/api/turn-latency", options = {}) {
|
|
|
2524
2812
|
}
|
|
2525
2813
|
|
|
2526
2814
|
// src/vue/VoiceTurnLatency.ts
|
|
2527
|
-
var VoiceTurnLatency =
|
|
2815
|
+
var VoiceTurnLatency = defineComponent9({
|
|
2528
2816
|
name: "VoiceTurnLatency",
|
|
2529
2817
|
props: {
|
|
2530
2818
|
class: { default: "", type: String },
|
|
@@ -2550,47 +2838,47 @@ var VoiceTurnLatency = defineComponent8({
|
|
|
2550
2838
|
report: latency.report.value,
|
|
2551
2839
|
updatedAt: latency.updatedAt.value
|
|
2552
2840
|
}, options));
|
|
2553
|
-
return () =>
|
|
2841
|
+
return () => h9("section", {
|
|
2554
2842
|
class: [
|
|
2555
2843
|
"absolute-voice-turn-latency",
|
|
2556
2844
|
`absolute-voice-turn-latency--${model.value.status}`,
|
|
2557
2845
|
props.class
|
|
2558
2846
|
]
|
|
2559
2847
|
}, [
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2848
|
+
h9("header", { class: "absolute-voice-turn-latency__header" }, [
|
|
2849
|
+
h9("span", { class: "absolute-voice-turn-latency__eyebrow" }, model.value.title),
|
|
2850
|
+
h9("strong", { class: "absolute-voice-turn-latency__label" }, model.value.label)
|
|
2563
2851
|
]),
|
|
2564
|
-
|
|
2565
|
-
model.value.showProofAction ?
|
|
2852
|
+
h9("p", { class: "absolute-voice-turn-latency__description" }, model.value.description),
|
|
2853
|
+
model.value.showProofAction ? h9("button", {
|
|
2566
2854
|
class: "absolute-voice-turn-latency__proof",
|
|
2567
2855
|
onClick: () => {
|
|
2568
2856
|
latency.runProof().catch(() => {});
|
|
2569
2857
|
},
|
|
2570
2858
|
type: "button"
|
|
2571
2859
|
}, model.value.proofLabel) : null,
|
|
2572
|
-
model.value.turns.length ?
|
|
2860
|
+
model.value.turns.length ? h9("div", { class: "absolute-voice-turn-latency__turns" }, model.value.turns.map((turn) => h9("article", {
|
|
2573
2861
|
class: [
|
|
2574
2862
|
"absolute-voice-turn-latency__turn",
|
|
2575
2863
|
`absolute-voice-turn-latency__turn--${turn.status}`
|
|
2576
2864
|
],
|
|
2577
2865
|
key: `${turn.sessionId}:${turn.turnId}`
|
|
2578
2866
|
}, [
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2867
|
+
h9("header", [
|
|
2868
|
+
h9("strong", turn.label),
|
|
2869
|
+
h9("span", turn.status)
|
|
2582
2870
|
]),
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2871
|
+
h9("dl", turn.rows.map((row) => h9("div", { key: row.label }, [
|
|
2872
|
+
h9("dt", row.label),
|
|
2873
|
+
h9("dd", row.value)
|
|
2586
2874
|
])))
|
|
2587
|
-
]))) :
|
|
2588
|
-
model.value.error ?
|
|
2875
|
+
]))) : h9("p", { class: "absolute-voice-turn-latency__empty" }, "Complete a voice turn to see latency diagnostics."),
|
|
2876
|
+
model.value.error ? h9("p", { class: "absolute-voice-turn-latency__error" }, model.value.error) : null
|
|
2589
2877
|
]);
|
|
2590
2878
|
}
|
|
2591
2879
|
});
|
|
2592
2880
|
// src/vue/VoiceTurnQuality.ts
|
|
2593
|
-
import { computed as computed6, defineComponent as
|
|
2881
|
+
import { computed as computed6, defineComponent as defineComponent10, h as h10 } from "vue";
|
|
2594
2882
|
|
|
2595
2883
|
// src/client/turnQuality.ts
|
|
2596
2884
|
var fetchVoiceTurnQuality = async (path = "/api/turn-quality", options = {}) => {
|
|
@@ -2672,9 +2960,9 @@ var createVoiceTurnQualityStore = (path = "/api/turn-quality", options = {}) =>
|
|
|
2672
2960
|
};
|
|
2673
2961
|
|
|
2674
2962
|
// src/client/turnQualityWidget.ts
|
|
2675
|
-
var
|
|
2676
|
-
var
|
|
2677
|
-
var
|
|
2963
|
+
var DEFAULT_TITLE9 = "Turn Quality";
|
|
2964
|
+
var DEFAULT_DESCRIPTION9 = "Per-turn STT confidence, fallback selection, corrections, and transcript coverage.";
|
|
2965
|
+
var escapeHtml10 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
2678
2966
|
var formatConfidence = (value) => typeof value === "number" ? `${Math.round(value * 100)}%` : "n/a";
|
|
2679
2967
|
var formatMaybe = (value) => value === undefined || value === "" ? "n/a" : String(value);
|
|
2680
2968
|
var getTurnDetail = (turn) => {
|
|
@@ -2712,37 +3000,37 @@ var createVoiceTurnQualityViewModel = (snapshot, options = {}) => {
|
|
|
2712
3000
|
const warningCount = snapshot.report?.warnings ?? turns.filter((turn) => turn.status === "warn").length;
|
|
2713
3001
|
const failedCount = snapshot.report?.failed ?? turns.filter((turn) => turn.status === "fail").length;
|
|
2714
3002
|
return {
|
|
2715
|
-
description: options.description ??
|
|
3003
|
+
description: options.description ?? DEFAULT_DESCRIPTION9,
|
|
2716
3004
|
error: snapshot.error,
|
|
2717
3005
|
isLoading: snapshot.isLoading,
|
|
2718
3006
|
label: snapshot.error ? "Unavailable" : turns.length ? failedCount > 0 ? `${failedCount} failed` : warningCount > 0 ? `${warningCount} warnings` : `${turns.length} healthy` : snapshot.isLoading ? "Checking" : "No turns",
|
|
2719
3007
|
status: snapshot.error ? "error" : turns.length ? failedCount > 0 || warningCount > 0 ? "warning" : "ready" : snapshot.isLoading ? "loading" : "empty",
|
|
2720
|
-
title: options.title ??
|
|
3008
|
+
title: options.title ?? DEFAULT_TITLE9,
|
|
2721
3009
|
turns,
|
|
2722
3010
|
updatedAt: snapshot.updatedAt
|
|
2723
3011
|
};
|
|
2724
3012
|
};
|
|
2725
3013
|
var renderVoiceTurnQualityHTML = (snapshot, options = {}) => {
|
|
2726
3014
|
const model = createVoiceTurnQualityViewModel(snapshot, options);
|
|
2727
|
-
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--${
|
|
3015
|
+
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--${escapeHtml10(turn.status)}">
|
|
2728
3016
|
<header>
|
|
2729
|
-
<strong>${
|
|
2730
|
-
<span>${
|
|
3017
|
+
<strong>${escapeHtml10(turn.label)}</strong>
|
|
3018
|
+
<span>${escapeHtml10(turn.status)}</span>
|
|
2731
3019
|
</header>
|
|
2732
|
-
<p>${
|
|
3020
|
+
<p>${escapeHtml10(turn.detail)}</p>
|
|
2733
3021
|
<dl>${turn.rows.map((row) => `<div>
|
|
2734
|
-
<dt>${
|
|
2735
|
-
<dd>${
|
|
3022
|
+
<dt>${escapeHtml10(row.label)}</dt>
|
|
3023
|
+
<dd>${escapeHtml10(row.value)}</dd>
|
|
2736
3024
|
</div>`).join("")}</dl>
|
|
2737
3025
|
</article>`).join("")}</div>` : '<p class="absolute-voice-turn-quality__empty">Complete a voice turn to see STT quality diagnostics.</p>';
|
|
2738
|
-
return `<section class="absolute-voice-turn-quality absolute-voice-turn-quality--${
|
|
3026
|
+
return `<section class="absolute-voice-turn-quality absolute-voice-turn-quality--${escapeHtml10(model.status)}">
|
|
2739
3027
|
<header class="absolute-voice-turn-quality__header">
|
|
2740
|
-
<span class="absolute-voice-turn-quality__eyebrow">${
|
|
2741
|
-
<strong class="absolute-voice-turn-quality__label">${
|
|
3028
|
+
<span class="absolute-voice-turn-quality__eyebrow">${escapeHtml10(model.title)}</span>
|
|
3029
|
+
<strong class="absolute-voice-turn-quality__label">${escapeHtml10(model.label)}</strong>
|
|
2742
3030
|
</header>
|
|
2743
|
-
<p class="absolute-voice-turn-quality__description">${
|
|
3031
|
+
<p class="absolute-voice-turn-quality__description">${escapeHtml10(model.description)}</p>
|
|
2744
3032
|
${turns}
|
|
2745
|
-
${model.error ? `<p class="absolute-voice-turn-quality__error">${
|
|
3033
|
+
${model.error ? `<p class="absolute-voice-turn-quality__error">${escapeHtml10(model.error)}</p>` : ""}
|
|
2746
3034
|
</section>`;
|
|
2747
3035
|
};
|
|
2748
3036
|
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}`;
|
|
@@ -2784,13 +3072,13 @@ var defineVoiceTurnQualityElement = (tagName = "absolute-voice-turn-quality") =>
|
|
|
2784
3072
|
};
|
|
2785
3073
|
|
|
2786
3074
|
// src/vue/useVoiceTurnQuality.ts
|
|
2787
|
-
import { onUnmounted as
|
|
3075
|
+
import { onUnmounted as onUnmounted10, shallowRef as shallowRef9 } from "vue";
|
|
2788
3076
|
function useVoiceTurnQuality(path = "/api/turn-quality", options = {}) {
|
|
2789
3077
|
const store = createVoiceTurnQualityStore(path, options);
|
|
2790
|
-
const error =
|
|
2791
|
-
const isLoading =
|
|
2792
|
-
const report =
|
|
2793
|
-
const updatedAt =
|
|
3078
|
+
const error = shallowRef9(null);
|
|
3079
|
+
const isLoading = shallowRef9(false);
|
|
3080
|
+
const report = shallowRef9();
|
|
3081
|
+
const updatedAt = shallowRef9(undefined);
|
|
2794
3082
|
const sync = () => {
|
|
2795
3083
|
const snapshot = store.getSnapshot();
|
|
2796
3084
|
error.value = snapshot.error;
|
|
@@ -2801,7 +3089,7 @@ function useVoiceTurnQuality(path = "/api/turn-quality", options = {}) {
|
|
|
2801
3089
|
const unsubscribe = store.subscribe(sync);
|
|
2802
3090
|
sync();
|
|
2803
3091
|
store.refresh().catch(() => {});
|
|
2804
|
-
|
|
3092
|
+
onUnmounted10(() => {
|
|
2805
3093
|
unsubscribe();
|
|
2806
3094
|
store.close();
|
|
2807
3095
|
});
|
|
@@ -2809,7 +3097,7 @@ function useVoiceTurnQuality(path = "/api/turn-quality", options = {}) {
|
|
|
2809
3097
|
}
|
|
2810
3098
|
|
|
2811
3099
|
// src/vue/VoiceTurnQuality.ts
|
|
2812
|
-
var VoiceTurnQuality =
|
|
3100
|
+
var VoiceTurnQuality = defineComponent10({
|
|
2813
3101
|
name: "VoiceTurnQuality",
|
|
2814
3102
|
props: {
|
|
2815
3103
|
class: { default: "", type: String },
|
|
@@ -2831,41 +3119,41 @@ var VoiceTurnQuality = defineComponent9({
|
|
|
2831
3119
|
report: quality.report.value,
|
|
2832
3120
|
updatedAt: quality.updatedAt.value
|
|
2833
3121
|
}, options));
|
|
2834
|
-
return () =>
|
|
3122
|
+
return () => h10("section", {
|
|
2835
3123
|
class: [
|
|
2836
3124
|
"absolute-voice-turn-quality",
|
|
2837
3125
|
`absolute-voice-turn-quality--${model.value.status}`,
|
|
2838
3126
|
props.class
|
|
2839
3127
|
]
|
|
2840
3128
|
}, [
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
3129
|
+
h10("header", { class: "absolute-voice-turn-quality__header" }, [
|
|
3130
|
+
h10("span", { class: "absolute-voice-turn-quality__eyebrow" }, model.value.title),
|
|
3131
|
+
h10("strong", { class: "absolute-voice-turn-quality__label" }, model.value.label)
|
|
2844
3132
|
]),
|
|
2845
|
-
|
|
2846
|
-
model.value.turns.length ?
|
|
3133
|
+
h10("p", { class: "absolute-voice-turn-quality__description" }, model.value.description),
|
|
3134
|
+
model.value.turns.length ? h10("div", { class: "absolute-voice-turn-quality__turns" }, model.value.turns.map((turn) => h10("article", {
|
|
2847
3135
|
class: [
|
|
2848
3136
|
"absolute-voice-turn-quality__turn",
|
|
2849
3137
|
`absolute-voice-turn-quality__turn--${turn.status}`
|
|
2850
3138
|
],
|
|
2851
3139
|
key: `${turn.sessionId}:${turn.turnId}`
|
|
2852
3140
|
}, [
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
|
|
3141
|
+
h10("header", [
|
|
3142
|
+
h10("strong", turn.label),
|
|
3143
|
+
h10("span", turn.status)
|
|
2856
3144
|
]),
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
3145
|
+
h10("p", turn.detail),
|
|
3146
|
+
h10("dl", turn.rows.map((row) => h10("div", { key: row.label }, [
|
|
3147
|
+
h10("dt", row.label),
|
|
3148
|
+
h10("dd", row.value)
|
|
2861
3149
|
])))
|
|
2862
|
-
]))) :
|
|
2863
|
-
model.value.error ?
|
|
3150
|
+
]))) : h10("p", { class: "absolute-voice-turn-quality__empty" }, "Complete a voice turn to see STT quality diagnostics."),
|
|
3151
|
+
model.value.error ? h10("p", { class: "absolute-voice-turn-quality__error" }, model.value.error) : null
|
|
2864
3152
|
]);
|
|
2865
3153
|
}
|
|
2866
3154
|
});
|
|
2867
3155
|
// src/vue/useVoiceCampaignDialerProof.ts
|
|
2868
|
-
import { onUnmounted as
|
|
3156
|
+
import { onUnmounted as onUnmounted11, shallowRef as shallowRef10 } from "vue";
|
|
2869
3157
|
|
|
2870
3158
|
// src/client/campaignDialerProof.ts
|
|
2871
3159
|
var fetchVoiceCampaignDialerProofStatus = async (path = "/api/voice/campaigns/dialer-proof", options = {}) => {
|
|
@@ -2988,11 +3276,11 @@ var createVoiceCampaignDialerProofStore = (path = "/api/voice/campaigns/dialer-p
|
|
|
2988
3276
|
// src/vue/useVoiceCampaignDialerProof.ts
|
|
2989
3277
|
function useVoiceCampaignDialerProof(path = "/api/voice/campaigns/dialer-proof", options = {}) {
|
|
2990
3278
|
const store = createVoiceCampaignDialerProofStore(path, options);
|
|
2991
|
-
const error =
|
|
2992
|
-
const isLoading =
|
|
2993
|
-
const report =
|
|
2994
|
-
const status =
|
|
2995
|
-
const updatedAt =
|
|
3279
|
+
const error = shallowRef10(null);
|
|
3280
|
+
const isLoading = shallowRef10(false);
|
|
3281
|
+
const report = shallowRef10();
|
|
3282
|
+
const status = shallowRef10();
|
|
3283
|
+
const updatedAt = shallowRef10(undefined);
|
|
2996
3284
|
const sync = () => {
|
|
2997
3285
|
const snapshot = store.getSnapshot();
|
|
2998
3286
|
error.value = snapshot.error;
|
|
@@ -3006,7 +3294,7 @@ function useVoiceCampaignDialerProof(path = "/api/voice/campaigns/dialer-proof",
|
|
|
3006
3294
|
if (typeof window !== "undefined") {
|
|
3007
3295
|
store.refresh().catch(() => {});
|
|
3008
3296
|
}
|
|
3009
|
-
|
|
3297
|
+
onUnmounted11(() => {
|
|
3010
3298
|
unsubscribe();
|
|
3011
3299
|
store.close();
|
|
3012
3300
|
});
|
|
@@ -3021,7 +3309,7 @@ function useVoiceCampaignDialerProof(path = "/api/voice/campaigns/dialer-proof",
|
|
|
3021
3309
|
};
|
|
3022
3310
|
}
|
|
3023
3311
|
// src/vue/useVoiceStream.ts
|
|
3024
|
-
import { onUnmounted as
|
|
3312
|
+
import { onUnmounted as onUnmounted12, ref as ref7, shallowRef as shallowRef11 } from "vue";
|
|
3025
3313
|
|
|
3026
3314
|
// src/client/actions.ts
|
|
3027
3315
|
var normalizeErrorMessage = (value) => {
|
|
@@ -3666,16 +3954,16 @@ var createVoiceStream = (path, options = {}) => {
|
|
|
3666
3954
|
// src/vue/useVoiceStream.ts
|
|
3667
3955
|
function useVoiceStream(path, options = {}) {
|
|
3668
3956
|
const stream = createVoiceStream(path, options);
|
|
3669
|
-
const assistantAudio =
|
|
3670
|
-
const assistantTexts =
|
|
3671
|
-
const call =
|
|
3957
|
+
const assistantAudio = shallowRef11([]);
|
|
3958
|
+
const assistantTexts = shallowRef11([]);
|
|
3959
|
+
const call = shallowRef11(null);
|
|
3672
3960
|
const error = ref7(null);
|
|
3673
3961
|
const isConnected = ref7(false);
|
|
3674
3962
|
const partial = ref7("");
|
|
3675
|
-
const reconnect =
|
|
3963
|
+
const reconnect = shallowRef11(stream.reconnect);
|
|
3676
3964
|
const sessionId = ref7(stream.sessionId);
|
|
3677
3965
|
const status = ref7(stream.status);
|
|
3678
|
-
const turns =
|
|
3966
|
+
const turns = shallowRef11([]);
|
|
3679
3967
|
const sync = () => {
|
|
3680
3968
|
assistantAudio.value = [...stream.assistantAudio];
|
|
3681
3969
|
assistantTexts.value = [...stream.assistantTexts];
|
|
@@ -3694,7 +3982,7 @@ function useVoiceStream(path, options = {}) {
|
|
|
3694
3982
|
unsubscribe();
|
|
3695
3983
|
stream.close();
|
|
3696
3984
|
};
|
|
3697
|
-
|
|
3985
|
+
onUnmounted12(destroy);
|
|
3698
3986
|
return {
|
|
3699
3987
|
assistantAudio,
|
|
3700
3988
|
assistantTexts,
|
|
@@ -3713,7 +4001,7 @@ function useVoiceStream(path, options = {}) {
|
|
|
3713
4001
|
};
|
|
3714
4002
|
}
|
|
3715
4003
|
// src/vue/useVoiceController.ts
|
|
3716
|
-
import { onUnmounted as
|
|
4004
|
+
import { onUnmounted as onUnmounted13, ref as ref8, shallowRef as shallowRef12 } from "vue";
|
|
3717
4005
|
|
|
3718
4006
|
// src/client/htmx.ts
|
|
3719
4007
|
var DEFAULT_EVENT_NAME = "voice-refresh";
|
|
@@ -4359,17 +4647,17 @@ var createVoiceController = (path, options = {}) => {
|
|
|
4359
4647
|
// src/vue/useVoiceController.ts
|
|
4360
4648
|
function useVoiceController(path, options = {}) {
|
|
4361
4649
|
const controller = createVoiceController(path, options);
|
|
4362
|
-
const assistantAudio =
|
|
4363
|
-
const assistantTexts =
|
|
4650
|
+
const assistantAudio = shallowRef12([]);
|
|
4651
|
+
const assistantTexts = shallowRef12([]);
|
|
4364
4652
|
const error = ref8(null);
|
|
4365
4653
|
const isConnected = ref8(false);
|
|
4366
4654
|
const isRecording = ref8(false);
|
|
4367
4655
|
const partial = ref8("");
|
|
4368
|
-
const reconnect =
|
|
4656
|
+
const reconnect = shallowRef12(controller.reconnect);
|
|
4369
4657
|
const recordingError = ref8(null);
|
|
4370
4658
|
const sessionId = ref8(controller.sessionId);
|
|
4371
4659
|
const status = ref8(controller.status);
|
|
4372
|
-
const turns =
|
|
4660
|
+
const turns = shallowRef12([]);
|
|
4373
4661
|
const sync = () => {
|
|
4374
4662
|
assistantAudio.value = [...controller.assistantAudio];
|
|
4375
4663
|
assistantTexts.value = [...controller.assistantTexts];
|
|
@@ -4389,7 +4677,7 @@ function useVoiceController(path, options = {}) {
|
|
|
4389
4677
|
unsubscribe();
|
|
4390
4678
|
controller.close();
|
|
4391
4679
|
};
|
|
4392
|
-
|
|
4680
|
+
onUnmounted13(destroy);
|
|
4393
4681
|
return {
|
|
4394
4682
|
assistantAudio,
|
|
4395
4683
|
assistantTexts,
|
|
@@ -4412,7 +4700,7 @@ function useVoiceController(path, options = {}) {
|
|
|
4412
4700
|
};
|
|
4413
4701
|
}
|
|
4414
4702
|
// src/vue/useVoiceTraceTimeline.ts
|
|
4415
|
-
import { onUnmounted as
|
|
4703
|
+
import { onUnmounted as onUnmounted14, ref as ref9, shallowRef as shallowRef13 } from "vue";
|
|
4416
4704
|
|
|
4417
4705
|
// src/client/traceTimeline.ts
|
|
4418
4706
|
var fetchVoiceTraceTimeline = async (path = "/api/voice-traces", options = {}) => {
|
|
@@ -4499,7 +4787,7 @@ function useVoiceTraceTimeline(path = "/api/voice-traces", options = {}) {
|
|
|
4499
4787
|
const store = createVoiceTraceTimelineStore(path, options);
|
|
4500
4788
|
const error = ref9(null);
|
|
4501
4789
|
const isLoading = ref9(false);
|
|
4502
|
-
const report =
|
|
4790
|
+
const report = shallowRef13(null);
|
|
4503
4791
|
const updatedAt = ref9(undefined);
|
|
4504
4792
|
const sync = () => {
|
|
4505
4793
|
const snapshot = store.getSnapshot();
|
|
@@ -4511,7 +4799,7 @@ function useVoiceTraceTimeline(path = "/api/voice-traces", options = {}) {
|
|
|
4511
4799
|
const unsubscribe = store.subscribe(sync);
|
|
4512
4800
|
sync();
|
|
4513
4801
|
store.refresh().catch(() => {});
|
|
4514
|
-
|
|
4802
|
+
onUnmounted14(() => {
|
|
4515
4803
|
unsubscribe();
|
|
4516
4804
|
store.close();
|
|
4517
4805
|
});
|
|
@@ -4524,7 +4812,7 @@ function useVoiceTraceTimeline(path = "/api/voice-traces", options = {}) {
|
|
|
4524
4812
|
};
|
|
4525
4813
|
}
|
|
4526
4814
|
// src/vue/useVoiceWorkflowStatus.ts
|
|
4527
|
-
import { onUnmounted as
|
|
4815
|
+
import { onUnmounted as onUnmounted15, ref as ref10, shallowRef as shallowRef14 } from "vue";
|
|
4528
4816
|
|
|
4529
4817
|
// src/client/workflowStatus.ts
|
|
4530
4818
|
var fetchVoiceWorkflowStatus = async (path = "/evals/scenarios/json", options = {}) => {
|
|
@@ -4610,7 +4898,7 @@ function useVoiceWorkflowStatus(path = "/evals/scenarios/json", options = {}) {
|
|
|
4610
4898
|
const store = createVoiceWorkflowStatusStore(path, options);
|
|
4611
4899
|
const error = ref10(null);
|
|
4612
4900
|
const isLoading = ref10(false);
|
|
4613
|
-
const report =
|
|
4901
|
+
const report = shallowRef14(undefined);
|
|
4614
4902
|
const updatedAt = ref10(undefined);
|
|
4615
4903
|
const sync = () => {
|
|
4616
4904
|
const snapshot = store.getSnapshot();
|
|
@@ -4624,7 +4912,7 @@ function useVoiceWorkflowStatus(path = "/evals/scenarios/json", options = {}) {
|
|
|
4624
4912
|
if (typeof window !== "undefined") {
|
|
4625
4913
|
store.refresh().catch(() => {});
|
|
4626
4914
|
}
|
|
4627
|
-
|
|
4915
|
+
onUnmounted15(() => {
|
|
4628
4916
|
unsubscribe();
|
|
4629
4917
|
store.close();
|
|
4630
4918
|
});
|
|
@@ -4645,6 +4933,7 @@ export {
|
|
|
4645
4933
|
useVoiceRoutingStatus,
|
|
4646
4934
|
useVoiceProviderStatus,
|
|
4647
4935
|
useVoiceProviderSimulationControls,
|
|
4936
|
+
useVoiceProviderContracts,
|
|
4648
4937
|
useVoiceProviderCapabilities,
|
|
4649
4938
|
useVoiceOpsStatus,
|
|
4650
4939
|
useVoiceOpsActionCenter,
|
|
@@ -4656,6 +4945,7 @@ export {
|
|
|
4656
4945
|
VoiceRoutingStatus,
|
|
4657
4946
|
VoiceProviderStatus,
|
|
4658
4947
|
VoiceProviderSimulationControls,
|
|
4948
|
+
VoiceProviderContracts,
|
|
4659
4949
|
VoiceProviderCapabilities,
|
|
4660
4950
|
VoiceOpsStatus,
|
|
4661
4951
|
VoiceOpsActionCenter,
|