@absolutejs/voice 0.0.22-beta.167 → 0.0.22-beta.168
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 +228 -47
- package/dist/client/providerContracts.d.ts +19 -0
- package/dist/client/providerContractsWidget.d.ts +32 -0
- package/dist/react/VoiceProviderContracts.d.ts +6 -0
- package/dist/react/index.d.ts +2 -0
- package/dist/react/index.js +472 -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 +264 -78
- package/dist/vue/VoiceProviderContracts.d.ts +21 -0
- package/dist/vue/index.d.ts +2 -0
- package/dist/vue/index.js +446 -170
- package/dist/vue/useVoiceProviderContracts.d.ts +9 -0
- package/package.json +1 -1
package/dist/vue/index.js
CHANGED
|
@@ -1719,8 +1719,282 @@ 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
|
+
rows: [
|
|
1852
|
+
{ label: "Status", value: formatStatus2(row.status) },
|
|
1853
|
+
{ label: "Selected", value: row.selected ? "Yes" : "No" },
|
|
1854
|
+
{ label: "Configured", value: row.configured ? "Yes" : "No" },
|
|
1855
|
+
{
|
|
1856
|
+
label: "Checks",
|
|
1857
|
+
value: row.checks.map((check) => `${check.label}: ${formatStatus2(check.status)}`).join(", ")
|
|
1858
|
+
}
|
|
1859
|
+
]
|
|
1860
|
+
}));
|
|
1861
|
+
const warningCount = snapshot.report ? snapshot.report.failed + snapshot.report.warned : rows.filter((row) => row.status !== "pass").length;
|
|
1862
|
+
return {
|
|
1863
|
+
description: options.description ?? DEFAULT_DESCRIPTION5,
|
|
1864
|
+
error: snapshot.error,
|
|
1865
|
+
isLoading: snapshot.isLoading,
|
|
1866
|
+
label: snapshot.error ? "Unavailable" : rows.length ? warningCount > 0 ? `${warningCount} needs attention` : `${rows.length} passing` : snapshot.isLoading ? "Checking" : "No contracts",
|
|
1867
|
+
rows,
|
|
1868
|
+
status: snapshot.error ? "error" : rows.length ? warningCount > 0 ? "warning" : "ready" : snapshot.isLoading ? "loading" : "empty",
|
|
1869
|
+
title: options.title ?? DEFAULT_TITLE5,
|
|
1870
|
+
updatedAt: snapshot.updatedAt
|
|
1871
|
+
};
|
|
1872
|
+
};
|
|
1873
|
+
var renderVoiceProviderContractsHTML = (snapshot, options = {}) => {
|
|
1874
|
+
const model = createVoiceProviderContractsViewModel(snapshot, options);
|
|
1875
|
+
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)}">
|
|
1876
|
+
<header>
|
|
1877
|
+
<strong>${escapeHtml6(row.label)}</strong>
|
|
1878
|
+
<span>${escapeHtml6(formatStatus2(row.status))}</span>
|
|
1879
|
+
</header>
|
|
1880
|
+
<p>${escapeHtml6(row.detail)}</p>
|
|
1881
|
+
<dl>${row.rows.map((item) => `<div>
|
|
1882
|
+
<dt>${escapeHtml6(item.label)}</dt>
|
|
1883
|
+
<dd>${escapeHtml6(item.value)}</dd>
|
|
1884
|
+
</div>`).join("")}</dl>
|
|
1885
|
+
</article>`).join("")}</div>` : '<p class="absolute-voice-provider-contracts__empty">Configure provider contracts to see production coverage.</p>';
|
|
1886
|
+
return `<section class="absolute-voice-provider-contracts absolute-voice-provider-contracts--${escapeHtml6(model.status)}">
|
|
1887
|
+
<header class="absolute-voice-provider-contracts__header">
|
|
1888
|
+
<span class="absolute-voice-provider-contracts__eyebrow">${escapeHtml6(model.title)}</span>
|
|
1889
|
+
<strong class="absolute-voice-provider-contracts__label">${escapeHtml6(model.label)}</strong>
|
|
1890
|
+
</header>
|
|
1891
|
+
<p class="absolute-voice-provider-contracts__description">${escapeHtml6(model.description)}</p>
|
|
1892
|
+
${rows}
|
|
1893
|
+
${model.error ? `<p class="absolute-voice-provider-contracts__error">${escapeHtml6(model.error)}</p>` : ""}
|
|
1894
|
+
</section>`;
|
|
1895
|
+
};
|
|
1896
|
+
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__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}`;
|
|
1897
|
+
var mountVoiceProviderContracts = (element, path = "/api/provider-contracts", options = {}) => {
|
|
1898
|
+
const store = createVoiceProviderContractsStore(path, options);
|
|
1899
|
+
const render = () => {
|
|
1900
|
+
element.innerHTML = renderVoiceProviderContractsHTML(store.getSnapshot(), options);
|
|
1901
|
+
};
|
|
1902
|
+
const unsubscribe = store.subscribe(render);
|
|
1903
|
+
render();
|
|
1904
|
+
store.refresh().catch(() => {});
|
|
1905
|
+
return {
|
|
1906
|
+
close: () => {
|
|
1907
|
+
unsubscribe();
|
|
1908
|
+
store.close();
|
|
1909
|
+
},
|
|
1910
|
+
refresh: store.refresh
|
|
1911
|
+
};
|
|
1912
|
+
};
|
|
1913
|
+
var defineVoiceProviderContractsElement = (tagName = "absolute-voice-provider-contracts") => {
|
|
1914
|
+
if (typeof window === "undefined" || typeof customElements === "undefined" || customElements.get(tagName)) {
|
|
1915
|
+
return;
|
|
1916
|
+
}
|
|
1917
|
+
customElements.define(tagName, class AbsoluteVoiceProviderContractsElement extends HTMLElement {
|
|
1918
|
+
mounted;
|
|
1919
|
+
connectedCallback() {
|
|
1920
|
+
const intervalMs = Number(this.getAttribute("interval-ms") ?? 5000);
|
|
1921
|
+
this.mounted = mountVoiceProviderContracts(this, this.getAttribute("path") ?? "/api/provider-contracts", {
|
|
1922
|
+
description: this.getAttribute("description") ?? undefined,
|
|
1923
|
+
intervalMs: Number.isFinite(intervalMs) ? intervalMs : 5000,
|
|
1924
|
+
title: this.getAttribute("title") ?? undefined
|
|
1925
|
+
});
|
|
1926
|
+
}
|
|
1927
|
+
disconnectedCallback() {
|
|
1928
|
+
this.mounted?.close();
|
|
1929
|
+
this.mounted = undefined;
|
|
1930
|
+
}
|
|
1931
|
+
});
|
|
1932
|
+
};
|
|
1933
|
+
|
|
1934
|
+
// src/vue/VoiceProviderContracts.ts
|
|
1935
|
+
var VoiceProviderContracts = defineComponent6({
|
|
1936
|
+
name: "VoiceProviderContracts",
|
|
1937
|
+
props: {
|
|
1938
|
+
description: String,
|
|
1939
|
+
intervalMs: Number,
|
|
1940
|
+
path: {
|
|
1941
|
+
default: "/api/provider-contracts",
|
|
1942
|
+
type: String
|
|
1943
|
+
},
|
|
1944
|
+
title: String
|
|
1945
|
+
},
|
|
1946
|
+
setup(props) {
|
|
1947
|
+
const state = useVoiceProviderContracts(props.path, {
|
|
1948
|
+
description: props.description,
|
|
1949
|
+
intervalMs: props.intervalMs,
|
|
1950
|
+
title: props.title
|
|
1951
|
+
});
|
|
1952
|
+
return () => {
|
|
1953
|
+
const model = createVoiceProviderContractsViewModel({
|
|
1954
|
+
error: state.error.value,
|
|
1955
|
+
isLoading: state.isLoading.value,
|
|
1956
|
+
report: state.report.value,
|
|
1957
|
+
updatedAt: state.updatedAt.value
|
|
1958
|
+
}, {
|
|
1959
|
+
description: props.description,
|
|
1960
|
+
intervalMs: props.intervalMs,
|
|
1961
|
+
title: props.title
|
|
1962
|
+
});
|
|
1963
|
+
return h6("section", {
|
|
1964
|
+
class: [
|
|
1965
|
+
"absolute-voice-provider-contracts",
|
|
1966
|
+
`absolute-voice-provider-contracts--${model.status}`
|
|
1967
|
+
]
|
|
1968
|
+
}, [
|
|
1969
|
+
h6("header", { class: "absolute-voice-provider-contracts__header" }, [
|
|
1970
|
+
h6("span", { class: "absolute-voice-provider-contracts__eyebrow" }, model.title),
|
|
1971
|
+
h6("strong", { class: "absolute-voice-provider-contracts__label" }, model.label)
|
|
1972
|
+
]),
|
|
1973
|
+
h6("p", { class: "absolute-voice-provider-contracts__description" }, model.description),
|
|
1974
|
+
model.rows.length ? h6("div", { class: "absolute-voice-provider-contracts__rows" }, model.rows.map((row) => h6("article", {
|
|
1975
|
+
class: [
|
|
1976
|
+
"absolute-voice-provider-contracts__row",
|
|
1977
|
+
`absolute-voice-provider-contracts__row--${row.status}`
|
|
1978
|
+
],
|
|
1979
|
+
key: `${row.kind}:${row.provider}`
|
|
1980
|
+
}, [
|
|
1981
|
+
h6("header", [
|
|
1982
|
+
h6("strong", row.label),
|
|
1983
|
+
h6("span", row.status)
|
|
1984
|
+
]),
|
|
1985
|
+
h6("p", row.detail),
|
|
1986
|
+
h6("dl", row.rows.map((item) => h6("div", { key: item.label }, [
|
|
1987
|
+
h6("dt", item.label),
|
|
1988
|
+
h6("dd", item.value)
|
|
1989
|
+
])))
|
|
1990
|
+
]))) : h6("p", { class: "absolute-voice-provider-contracts__empty" }, "Configure provider contracts to see production coverage."),
|
|
1991
|
+
model.error ? h6("p", { class: "absolute-voice-provider-contracts__error" }, model.error) : null
|
|
1992
|
+
]);
|
|
1993
|
+
};
|
|
1994
|
+
}
|
|
1995
|
+
});
|
|
1722
1996
|
// src/vue/VoiceProviderStatus.ts
|
|
1723
|
-
import { computed as computed3, defineComponent as
|
|
1997
|
+
import { computed as computed3, defineComponent as defineComponent7, h as h7 } from "vue";
|
|
1724
1998
|
|
|
1725
1999
|
// src/client/providerStatus.ts
|
|
1726
2000
|
var fetchVoiceProviderStatus = async (path = "/api/provider-status", options = {}) => {
|
|
@@ -1803,11 +2077,11 @@ var createVoiceProviderStatusStore = (path = "/api/provider-status", options = {
|
|
|
1803
2077
|
};
|
|
1804
2078
|
|
|
1805
2079
|
// src/client/providerStatusWidget.ts
|
|
1806
|
-
var
|
|
1807
|
-
var
|
|
1808
|
-
var
|
|
1809
|
-
var
|
|
1810
|
-
var
|
|
2080
|
+
var DEFAULT_TITLE6 = "Voice Providers";
|
|
2081
|
+
var DEFAULT_DESCRIPTION6 = "Live provider health, fallback counts, latency, and suppression state from your self-hosted trace store.";
|
|
2082
|
+
var escapeHtml7 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
2083
|
+
var formatProvider3 = (provider) => provider.split(/[-_\s]+/).filter(Boolean).map((part) => `${part[0]?.toUpperCase() ?? ""}${part.slice(1)}`).join(" ") || provider;
|
|
2084
|
+
var formatStatus3 = (status) => status.split("-").map((part) => `${part[0]?.toUpperCase() ?? ""}${part.slice(1)}`).join(" ");
|
|
1811
2085
|
var formatLatency = (value) => typeof value === "number" ? `${value}ms` : "No samples";
|
|
1812
2086
|
var formatSuppression = (value) => typeof value === "number" ? `${Math.ceil(value / 1000)}s` : "None";
|
|
1813
2087
|
var getProviderDetail = (provider) => {
|
|
@@ -1833,7 +2107,7 @@ var createVoiceProviderStatusViewModel = (snapshot, options = {}) => {
|
|
|
1833
2107
|
const providers = snapshot.providers.map((provider) => ({
|
|
1834
2108
|
...provider,
|
|
1835
2109
|
detail: getProviderDetail(provider),
|
|
1836
|
-
label: `${
|
|
2110
|
+
label: `${formatProvider3(provider.provider)}${provider.recommended ? " recommended" : ""}`,
|
|
1837
2111
|
rows: [
|
|
1838
2112
|
{ label: "Runs", value: String(provider.runCount) },
|
|
1839
2113
|
{ label: "Avg latency", value: formatLatency(provider.averageElapsedMs) },
|
|
@@ -1849,37 +2123,37 @@ var createVoiceProviderStatusViewModel = (snapshot, options = {}) => {
|
|
|
1849
2123
|
const warningCount = providers.filter((provider) => isWarningStatus2(provider.status)).length;
|
|
1850
2124
|
const healthyCount = providers.filter((provider) => provider.status === "healthy").length;
|
|
1851
2125
|
return {
|
|
1852
|
-
description: options.description ??
|
|
2126
|
+
description: options.description ?? DEFAULT_DESCRIPTION6,
|
|
1853
2127
|
error: snapshot.error,
|
|
1854
2128
|
isLoading: snapshot.isLoading,
|
|
1855
2129
|
label: snapshot.error ? "Unavailable" : providers.length ? warningCount > 0 ? `${warningCount} needs attention` : `${healthyCount} healthy` : snapshot.isLoading ? "Checking" : "No provider traffic",
|
|
1856
2130
|
providers,
|
|
1857
2131
|
status: snapshot.error ? "error" : providers.length ? warningCount > 0 ? "warning" : "ready" : snapshot.isLoading ? "loading" : "empty",
|
|
1858
|
-
title: options.title ??
|
|
2132
|
+
title: options.title ?? DEFAULT_TITLE6,
|
|
1859
2133
|
updatedAt: snapshot.updatedAt
|
|
1860
2134
|
};
|
|
1861
2135
|
};
|
|
1862
2136
|
var renderVoiceProviderStatusHTML = (snapshot, options = {}) => {
|
|
1863
2137
|
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--${
|
|
2138
|
+
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
2139
|
<header>
|
|
1866
|
-
<strong>${
|
|
1867
|
-
<span>${
|
|
2140
|
+
<strong>${escapeHtml7(provider.label)}</strong>
|
|
2141
|
+
<span>${escapeHtml7(formatStatus3(provider.status))}</span>
|
|
1868
2142
|
</header>
|
|
1869
|
-
<p>${
|
|
2143
|
+
<p>${escapeHtml7(provider.detail)}</p>
|
|
1870
2144
|
<dl>${provider.rows.map((row) => `<div>
|
|
1871
|
-
<dt>${
|
|
1872
|
-
<dd>${
|
|
2145
|
+
<dt>${escapeHtml7(row.label)}</dt>
|
|
2146
|
+
<dd>${escapeHtml7(row.value)}</dd>
|
|
1873
2147
|
</div>`).join("")}</dl>
|
|
1874
2148
|
</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--${
|
|
2149
|
+
return `<section class="absolute-voice-provider-status absolute-voice-provider-status--${escapeHtml7(model.status)}">
|
|
1876
2150
|
<header class="absolute-voice-provider-status__header">
|
|
1877
|
-
<span class="absolute-voice-provider-status__eyebrow">${
|
|
1878
|
-
<strong class="absolute-voice-provider-status__label">${
|
|
2151
|
+
<span class="absolute-voice-provider-status__eyebrow">${escapeHtml7(model.title)}</span>
|
|
2152
|
+
<strong class="absolute-voice-provider-status__label">${escapeHtml7(model.label)}</strong>
|
|
1879
2153
|
</header>
|
|
1880
|
-
<p class="absolute-voice-provider-status__description">${
|
|
2154
|
+
<p class="absolute-voice-provider-status__description">${escapeHtml7(model.description)}</p>
|
|
1881
2155
|
${providers}
|
|
1882
|
-
${model.error ? `<p class="absolute-voice-provider-status__error">${
|
|
2156
|
+
${model.error ? `<p class="absolute-voice-provider-status__error">${escapeHtml7(model.error)}</p>` : ""}
|
|
1883
2157
|
</section>`;
|
|
1884
2158
|
};
|
|
1885
2159
|
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 +2195,12 @@ var defineVoiceProviderStatusElement = (tagName = "absolute-voice-provider-statu
|
|
|
1921
2195
|
};
|
|
1922
2196
|
|
|
1923
2197
|
// src/vue/useVoiceProviderStatus.ts
|
|
1924
|
-
import { onUnmounted as
|
|
2198
|
+
import { onUnmounted as onUnmounted7, ref as ref5, shallowRef as shallowRef6 } from "vue";
|
|
1925
2199
|
function useVoiceProviderStatus(path = "/api/provider-status", options = {}) {
|
|
1926
2200
|
const store = createVoiceProviderStatusStore(path, options);
|
|
1927
2201
|
const error = ref5(null);
|
|
1928
2202
|
const isLoading = ref5(false);
|
|
1929
|
-
const providers =
|
|
2203
|
+
const providers = shallowRef6([]);
|
|
1930
2204
|
const updatedAt = ref5(undefined);
|
|
1931
2205
|
const sync = () => {
|
|
1932
2206
|
const snapshot = store.getSnapshot();
|
|
@@ -1938,7 +2212,7 @@ function useVoiceProviderStatus(path = "/api/provider-status", options = {}) {
|
|
|
1938
2212
|
const unsubscribe = store.subscribe(sync);
|
|
1939
2213
|
sync();
|
|
1940
2214
|
store.refresh().catch(() => {});
|
|
1941
|
-
|
|
2215
|
+
onUnmounted7(() => {
|
|
1942
2216
|
unsubscribe();
|
|
1943
2217
|
store.close();
|
|
1944
2218
|
});
|
|
@@ -1952,7 +2226,7 @@ function useVoiceProviderStatus(path = "/api/provider-status", options = {}) {
|
|
|
1952
2226
|
}
|
|
1953
2227
|
|
|
1954
2228
|
// src/vue/VoiceProviderStatus.ts
|
|
1955
|
-
var VoiceProviderStatus =
|
|
2229
|
+
var VoiceProviderStatus = defineComponent7({
|
|
1956
2230
|
name: "VoiceProviderStatus",
|
|
1957
2231
|
props: {
|
|
1958
2232
|
class: {
|
|
@@ -1989,41 +2263,41 @@ var VoiceProviderStatus = defineComponent6({
|
|
|
1989
2263
|
providers: status.providers.value,
|
|
1990
2264
|
updatedAt: status.updatedAt.value
|
|
1991
2265
|
}, options));
|
|
1992
|
-
return () =>
|
|
2266
|
+
return () => h7("section", {
|
|
1993
2267
|
class: [
|
|
1994
2268
|
"absolute-voice-provider-status",
|
|
1995
2269
|
`absolute-voice-provider-status--${model.value.status}`,
|
|
1996
2270
|
props.class
|
|
1997
2271
|
]
|
|
1998
2272
|
}, [
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2273
|
+
h7("header", { class: "absolute-voice-provider-status__header" }, [
|
|
2274
|
+
h7("span", { class: "absolute-voice-provider-status__eyebrow" }, model.value.title),
|
|
2275
|
+
h7("strong", { class: "absolute-voice-provider-status__label" }, model.value.label)
|
|
2002
2276
|
]),
|
|
2003
|
-
|
|
2004
|
-
model.value.providers.length ?
|
|
2277
|
+
h7("p", { class: "absolute-voice-provider-status__description" }, model.value.description),
|
|
2278
|
+
model.value.providers.length ? h7("div", { class: "absolute-voice-provider-status__providers" }, model.value.providers.map((provider) => h7("article", {
|
|
2005
2279
|
class: [
|
|
2006
2280
|
"absolute-voice-provider-status__provider",
|
|
2007
2281
|
`absolute-voice-provider-status__provider--${provider.status}`
|
|
2008
2282
|
],
|
|
2009
2283
|
key: provider.provider
|
|
2010
2284
|
}, [
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2285
|
+
h7("header", [
|
|
2286
|
+
h7("strong", provider.label),
|
|
2287
|
+
h7("span", provider.status)
|
|
2014
2288
|
]),
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2289
|
+
h7("p", provider.detail),
|
|
2290
|
+
h7("dl", provider.rows.map((row) => h7("div", { key: row.label }, [
|
|
2291
|
+
h7("dt", row.label),
|
|
2292
|
+
h7("dd", row.value)
|
|
2019
2293
|
])))
|
|
2020
|
-
]))) :
|
|
2021
|
-
model.value.error ?
|
|
2294
|
+
]))) : h7("p", { class: "absolute-voice-provider-status__empty" }, "Run voice traffic to see provider health."),
|
|
2295
|
+
model.value.error ? h7("p", { class: "absolute-voice-provider-status__error" }, model.value.error) : null
|
|
2022
2296
|
]);
|
|
2023
2297
|
}
|
|
2024
2298
|
});
|
|
2025
2299
|
// src/vue/VoiceRoutingStatus.ts
|
|
2026
|
-
import { computed as computed4, defineComponent as
|
|
2300
|
+
import { computed as computed4, defineComponent as defineComponent8, h as h8 } from "vue";
|
|
2027
2301
|
|
|
2028
2302
|
// src/client/routingStatus.ts
|
|
2029
2303
|
var fetchVoiceRoutingStatus = async (path = "/api/routing/latest", options = {}) => {
|
|
@@ -2106,9 +2380,9 @@ var createVoiceRoutingStatusStore = (path = "/api/routing/latest", options = {})
|
|
|
2106
2380
|
};
|
|
2107
2381
|
|
|
2108
2382
|
// src/client/routingStatusWidget.ts
|
|
2109
|
-
var
|
|
2110
|
-
var
|
|
2111
|
-
var
|
|
2383
|
+
var DEFAULT_TITLE7 = "Voice Routing";
|
|
2384
|
+
var DEFAULT_DESCRIPTION7 = "Latest provider routing decision from the self-hosted trace store.";
|
|
2385
|
+
var escapeHtml8 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
2112
2386
|
var formatValue = (value, fallback = "None") => typeof value === "string" && value.trim() ? value : typeof value === "number" && Number.isFinite(value) ? String(value) : fallback;
|
|
2113
2387
|
var createVoiceRoutingStatusViewModel = (snapshot, options = {}) => {
|
|
2114
2388
|
const decision = snapshot.decision;
|
|
@@ -2132,30 +2406,30 @@ var createVoiceRoutingStatusViewModel = (snapshot, options = {}) => {
|
|
|
2132
2406
|
] : [];
|
|
2133
2407
|
return {
|
|
2134
2408
|
decision,
|
|
2135
|
-
description: options.description ??
|
|
2409
|
+
description: options.description ?? DEFAULT_DESCRIPTION7,
|
|
2136
2410
|
error: snapshot.error,
|
|
2137
2411
|
isLoading: snapshot.isLoading,
|
|
2138
2412
|
label: snapshot.error ? "Unavailable" : decision ? `${formatValue(decision.kind).toUpperCase()} ${formatValue(decision.status, "unknown")}` : snapshot.isLoading ? "Checking" : "No routing yet",
|
|
2139
2413
|
rows,
|
|
2140
2414
|
status: snapshot.error ? "error" : decision ? "ready" : snapshot.isLoading ? "loading" : "empty",
|
|
2141
|
-
title: options.title ??
|
|
2415
|
+
title: options.title ?? DEFAULT_TITLE7,
|
|
2142
2416
|
updatedAt: snapshot.updatedAt
|
|
2143
2417
|
};
|
|
2144
2418
|
};
|
|
2145
2419
|
var renderVoiceRoutingStatusHTML = (snapshot, options = {}) => {
|
|
2146
2420
|
const model = createVoiceRoutingStatusViewModel(snapshot, options);
|
|
2147
2421
|
const rows = model.rows.length ? `<div class="absolute-voice-routing-status__grid">${model.rows.map((row) => `<div>
|
|
2148
|
-
<span>${
|
|
2149
|
-
<strong>${
|
|
2422
|
+
<span>${escapeHtml8(row.label)}</span>
|
|
2423
|
+
<strong>${escapeHtml8(row.value)}</strong>
|
|
2150
2424
|
</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--${
|
|
2425
|
+
return `<section class="absolute-voice-routing-status absolute-voice-routing-status--${escapeHtml8(model.status)}">
|
|
2152
2426
|
<header class="absolute-voice-routing-status__header">
|
|
2153
|
-
<span class="absolute-voice-routing-status__eyebrow">${
|
|
2154
|
-
<strong class="absolute-voice-routing-status__label">${
|
|
2427
|
+
<span class="absolute-voice-routing-status__eyebrow">${escapeHtml8(model.title)}</span>
|
|
2428
|
+
<strong class="absolute-voice-routing-status__label">${escapeHtml8(model.label)}</strong>
|
|
2155
2429
|
</header>
|
|
2156
|
-
<p class="absolute-voice-routing-status__description">${
|
|
2430
|
+
<p class="absolute-voice-routing-status__description">${escapeHtml8(model.description)}</p>
|
|
2157
2431
|
${rows}
|
|
2158
|
-
${model.error ? `<p class="absolute-voice-routing-status__error">${
|
|
2432
|
+
${model.error ? `<p class="absolute-voice-routing-status__error">${escapeHtml8(model.error)}</p>` : ""}
|
|
2159
2433
|
</section>`;
|
|
2160
2434
|
};
|
|
2161
2435
|
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 +2471,10 @@ var defineVoiceRoutingStatusElement = (tagName = "absolute-voice-routing-status"
|
|
|
2197
2471
|
};
|
|
2198
2472
|
|
|
2199
2473
|
// src/vue/useVoiceRoutingStatus.ts
|
|
2200
|
-
import { onUnmounted as
|
|
2474
|
+
import { onUnmounted as onUnmounted8, ref as ref6, shallowRef as shallowRef7 } from "vue";
|
|
2201
2475
|
function useVoiceRoutingStatus(path = "/api/routing/latest", options = {}) {
|
|
2202
2476
|
const store = createVoiceRoutingStatusStore(path, options);
|
|
2203
|
-
const decision =
|
|
2477
|
+
const decision = shallowRef7(null);
|
|
2204
2478
|
const error = ref6(null);
|
|
2205
2479
|
const isLoading = ref6(false);
|
|
2206
2480
|
const updatedAt = ref6(undefined);
|
|
@@ -2214,7 +2488,7 @@ function useVoiceRoutingStatus(path = "/api/routing/latest", options = {}) {
|
|
|
2214
2488
|
const unsubscribe = store.subscribe(sync);
|
|
2215
2489
|
sync();
|
|
2216
2490
|
store.refresh().catch(() => {});
|
|
2217
|
-
|
|
2491
|
+
onUnmounted8(() => {
|
|
2218
2492
|
unsubscribe();
|
|
2219
2493
|
store.close();
|
|
2220
2494
|
});
|
|
@@ -2228,7 +2502,7 @@ function useVoiceRoutingStatus(path = "/api/routing/latest", options = {}) {
|
|
|
2228
2502
|
}
|
|
2229
2503
|
|
|
2230
2504
|
// src/vue/VoiceRoutingStatus.ts
|
|
2231
|
-
var VoiceRoutingStatus =
|
|
2505
|
+
var VoiceRoutingStatus = defineComponent8({
|
|
2232
2506
|
name: "VoiceRoutingStatus",
|
|
2233
2507
|
props: {
|
|
2234
2508
|
class: {
|
|
@@ -2265,28 +2539,28 @@ var VoiceRoutingStatus = defineComponent7({
|
|
|
2265
2539
|
isLoading: status.isLoading.value,
|
|
2266
2540
|
updatedAt: status.updatedAt.value
|
|
2267
2541
|
}, options));
|
|
2268
|
-
return () =>
|
|
2542
|
+
return () => h8("section", {
|
|
2269
2543
|
class: [
|
|
2270
2544
|
"absolute-voice-routing-status",
|
|
2271
2545
|
`absolute-voice-routing-status--${model.value.status}`,
|
|
2272
2546
|
props.class
|
|
2273
2547
|
]
|
|
2274
2548
|
}, [
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2549
|
+
h8("header", { class: "absolute-voice-routing-status__header" }, [
|
|
2550
|
+
h8("span", { class: "absolute-voice-routing-status__eyebrow" }, model.value.title),
|
|
2551
|
+
h8("strong", { class: "absolute-voice-routing-status__label" }, model.value.label)
|
|
2278
2552
|
]),
|
|
2279
|
-
|
|
2280
|
-
model.value.rows.length ?
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
]))) :
|
|
2284
|
-
model.value.error ?
|
|
2553
|
+
h8("p", { class: "absolute-voice-routing-status__description" }, model.value.description),
|
|
2554
|
+
model.value.rows.length ? h8("div", { class: "absolute-voice-routing-status__grid" }, model.value.rows.map((row) => h8("div", { key: row.label }, [
|
|
2555
|
+
h8("span", row.label),
|
|
2556
|
+
h8("strong", row.value)
|
|
2557
|
+
]))) : h8("p", { class: "absolute-voice-routing-status__empty" }, "Start a voice session to see the selected provider."),
|
|
2558
|
+
model.value.error ? h8("p", { class: "absolute-voice-routing-status__error" }, model.value.error) : null
|
|
2285
2559
|
]);
|
|
2286
2560
|
}
|
|
2287
2561
|
});
|
|
2288
2562
|
// src/vue/VoiceTurnLatency.ts
|
|
2289
|
-
import { computed as computed5, defineComponent as
|
|
2563
|
+
import { computed as computed5, defineComponent as defineComponent9, h as h9 } from "vue";
|
|
2290
2564
|
|
|
2291
2565
|
// src/client/turnLatency.ts
|
|
2292
2566
|
var fetchVoiceTurnLatency = async (path = "/api/turn-latency", options = {}) => {
|
|
@@ -2392,10 +2666,10 @@ var createVoiceTurnLatencyStore = (path = "/api/turn-latency", options = {}) =>
|
|
|
2392
2666
|
};
|
|
2393
2667
|
|
|
2394
2668
|
// src/client/turnLatencyWidget.ts
|
|
2395
|
-
var
|
|
2396
|
-
var
|
|
2669
|
+
var DEFAULT_TITLE8 = "Turn Latency";
|
|
2670
|
+
var DEFAULT_DESCRIPTION8 = "Per-turn timing from first transcript to commit and assistant response start.";
|
|
2397
2671
|
var DEFAULT_PROOF_LABEL = "Run latency proof";
|
|
2398
|
-
var
|
|
2672
|
+
var escapeHtml9 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
2399
2673
|
var formatMs = (value) => typeof value === "number" ? `${Math.round(value)}ms` : "n/a";
|
|
2400
2674
|
var createVoiceTurnLatencyViewModel = (snapshot, options = {}) => {
|
|
2401
2675
|
const turns = (snapshot.report?.turns ?? []).map((turn) => ({
|
|
@@ -2409,39 +2683,39 @@ var createVoiceTurnLatencyViewModel = (snapshot, options = {}) => {
|
|
|
2409
2683
|
const warningCount = snapshot.report?.warnings ?? turns.filter((turn) => turn.status === "warn").length;
|
|
2410
2684
|
const failedCount = snapshot.report?.failed ?? turns.filter((turn) => turn.status === "fail").length;
|
|
2411
2685
|
return {
|
|
2412
|
-
description: options.description ??
|
|
2686
|
+
description: options.description ?? DEFAULT_DESCRIPTION8,
|
|
2413
2687
|
error: snapshot.error,
|
|
2414
2688
|
isLoading: snapshot.isLoading,
|
|
2415
2689
|
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
2690
|
proofLabel: options.proofPath ? options.proofLabel ?? DEFAULT_PROOF_LABEL : undefined,
|
|
2417
2691
|
showProofAction: Boolean(options.proofPath),
|
|
2418
2692
|
status: snapshot.error ? "error" : turns.length ? failedCount > 0 || warningCount > 0 ? "warning" : "ready" : snapshot.isLoading ? "loading" : "empty",
|
|
2419
|
-
title: options.title ??
|
|
2693
|
+
title: options.title ?? DEFAULT_TITLE8,
|
|
2420
2694
|
turns,
|
|
2421
2695
|
updatedAt: snapshot.updatedAt
|
|
2422
2696
|
};
|
|
2423
2697
|
};
|
|
2424
2698
|
var renderVoiceTurnLatencyHTML = (snapshot, options = {}) => {
|
|
2425
2699
|
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--${
|
|
2700
|
+
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
2701
|
<header>
|
|
2428
|
-
<strong>${
|
|
2429
|
-
<span>${
|
|
2702
|
+
<strong>${escapeHtml9(turn.label)}</strong>
|
|
2703
|
+
<span>${escapeHtml9(turn.status)}</span>
|
|
2430
2704
|
</header>
|
|
2431
2705
|
<dl>${turn.rows.map((row) => `<div>
|
|
2432
|
-
<dt>${
|
|
2433
|
-
<dd>${
|
|
2706
|
+
<dt>${escapeHtml9(row.label)}</dt>
|
|
2707
|
+
<dd>${escapeHtml9(row.value)}</dd>
|
|
2434
2708
|
</div>`).join("")}</dl>
|
|
2435
2709
|
</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--${
|
|
2710
|
+
return `<section class="absolute-voice-turn-latency absolute-voice-turn-latency--${escapeHtml9(model.status)}">
|
|
2437
2711
|
<header class="absolute-voice-turn-latency__header">
|
|
2438
|
-
<span class="absolute-voice-turn-latency__eyebrow">${
|
|
2439
|
-
<strong class="absolute-voice-turn-latency__label">${
|
|
2712
|
+
<span class="absolute-voice-turn-latency__eyebrow">${escapeHtml9(model.title)}</span>
|
|
2713
|
+
<strong class="absolute-voice-turn-latency__label">${escapeHtml9(model.label)}</strong>
|
|
2440
2714
|
</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">${
|
|
2715
|
+
<p class="absolute-voice-turn-latency__description">${escapeHtml9(model.description)}</p>
|
|
2716
|
+
${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
2717
|
${turns}
|
|
2444
|
-
${model.error ? `<p class="absolute-voice-turn-latency__error">${
|
|
2718
|
+
${model.error ? `<p class="absolute-voice-turn-latency__error">${escapeHtml9(model.error)}</p>` : ""}
|
|
2445
2719
|
</section>`;
|
|
2446
2720
|
};
|
|
2447
2721
|
var mountVoiceTurnLatency = (element, path = "/api/turn-latency", options = {}) => {
|
|
@@ -2492,13 +2766,13 @@ var defineVoiceTurnLatencyElement = (tagName = "absolute-voice-turn-latency") =>
|
|
|
2492
2766
|
};
|
|
2493
2767
|
|
|
2494
2768
|
// src/vue/useVoiceTurnLatency.ts
|
|
2495
|
-
import { onUnmounted as
|
|
2769
|
+
import { onUnmounted as onUnmounted9, shallowRef as shallowRef8 } from "vue";
|
|
2496
2770
|
function useVoiceTurnLatency(path = "/api/turn-latency", options = {}) {
|
|
2497
2771
|
const store = createVoiceTurnLatencyStore(path, options);
|
|
2498
|
-
const error =
|
|
2499
|
-
const isLoading =
|
|
2500
|
-
const report =
|
|
2501
|
-
const updatedAt =
|
|
2772
|
+
const error = shallowRef8(null);
|
|
2773
|
+
const isLoading = shallowRef8(false);
|
|
2774
|
+
const report = shallowRef8();
|
|
2775
|
+
const updatedAt = shallowRef8(undefined);
|
|
2502
2776
|
const sync = () => {
|
|
2503
2777
|
const snapshot = store.getSnapshot();
|
|
2504
2778
|
error.value = snapshot.error;
|
|
@@ -2509,7 +2783,7 @@ function useVoiceTurnLatency(path = "/api/turn-latency", options = {}) {
|
|
|
2509
2783
|
const unsubscribe = store.subscribe(sync);
|
|
2510
2784
|
sync();
|
|
2511
2785
|
store.refresh().catch(() => {});
|
|
2512
|
-
|
|
2786
|
+
onUnmounted9(() => {
|
|
2513
2787
|
unsubscribe();
|
|
2514
2788
|
store.close();
|
|
2515
2789
|
});
|
|
@@ -2524,7 +2798,7 @@ function useVoiceTurnLatency(path = "/api/turn-latency", options = {}) {
|
|
|
2524
2798
|
}
|
|
2525
2799
|
|
|
2526
2800
|
// src/vue/VoiceTurnLatency.ts
|
|
2527
|
-
var VoiceTurnLatency =
|
|
2801
|
+
var VoiceTurnLatency = defineComponent9({
|
|
2528
2802
|
name: "VoiceTurnLatency",
|
|
2529
2803
|
props: {
|
|
2530
2804
|
class: { default: "", type: String },
|
|
@@ -2550,47 +2824,47 @@ var VoiceTurnLatency = defineComponent8({
|
|
|
2550
2824
|
report: latency.report.value,
|
|
2551
2825
|
updatedAt: latency.updatedAt.value
|
|
2552
2826
|
}, options));
|
|
2553
|
-
return () =>
|
|
2827
|
+
return () => h9("section", {
|
|
2554
2828
|
class: [
|
|
2555
2829
|
"absolute-voice-turn-latency",
|
|
2556
2830
|
`absolute-voice-turn-latency--${model.value.status}`,
|
|
2557
2831
|
props.class
|
|
2558
2832
|
]
|
|
2559
2833
|
}, [
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2834
|
+
h9("header", { class: "absolute-voice-turn-latency__header" }, [
|
|
2835
|
+
h9("span", { class: "absolute-voice-turn-latency__eyebrow" }, model.value.title),
|
|
2836
|
+
h9("strong", { class: "absolute-voice-turn-latency__label" }, model.value.label)
|
|
2563
2837
|
]),
|
|
2564
|
-
|
|
2565
|
-
model.value.showProofAction ?
|
|
2838
|
+
h9("p", { class: "absolute-voice-turn-latency__description" }, model.value.description),
|
|
2839
|
+
model.value.showProofAction ? h9("button", {
|
|
2566
2840
|
class: "absolute-voice-turn-latency__proof",
|
|
2567
2841
|
onClick: () => {
|
|
2568
2842
|
latency.runProof().catch(() => {});
|
|
2569
2843
|
},
|
|
2570
2844
|
type: "button"
|
|
2571
2845
|
}, model.value.proofLabel) : null,
|
|
2572
|
-
model.value.turns.length ?
|
|
2846
|
+
model.value.turns.length ? h9("div", { class: "absolute-voice-turn-latency__turns" }, model.value.turns.map((turn) => h9("article", {
|
|
2573
2847
|
class: [
|
|
2574
2848
|
"absolute-voice-turn-latency__turn",
|
|
2575
2849
|
`absolute-voice-turn-latency__turn--${turn.status}`
|
|
2576
2850
|
],
|
|
2577
2851
|
key: `${turn.sessionId}:${turn.turnId}`
|
|
2578
2852
|
}, [
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2853
|
+
h9("header", [
|
|
2854
|
+
h9("strong", turn.label),
|
|
2855
|
+
h9("span", turn.status)
|
|
2582
2856
|
]),
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2857
|
+
h9("dl", turn.rows.map((row) => h9("div", { key: row.label }, [
|
|
2858
|
+
h9("dt", row.label),
|
|
2859
|
+
h9("dd", row.value)
|
|
2586
2860
|
])))
|
|
2587
|
-
]))) :
|
|
2588
|
-
model.value.error ?
|
|
2861
|
+
]))) : h9("p", { class: "absolute-voice-turn-latency__empty" }, "Complete a voice turn to see latency diagnostics."),
|
|
2862
|
+
model.value.error ? h9("p", { class: "absolute-voice-turn-latency__error" }, model.value.error) : null
|
|
2589
2863
|
]);
|
|
2590
2864
|
}
|
|
2591
2865
|
});
|
|
2592
2866
|
// src/vue/VoiceTurnQuality.ts
|
|
2593
|
-
import { computed as computed6, defineComponent as
|
|
2867
|
+
import { computed as computed6, defineComponent as defineComponent10, h as h10 } from "vue";
|
|
2594
2868
|
|
|
2595
2869
|
// src/client/turnQuality.ts
|
|
2596
2870
|
var fetchVoiceTurnQuality = async (path = "/api/turn-quality", options = {}) => {
|
|
@@ -2672,9 +2946,9 @@ var createVoiceTurnQualityStore = (path = "/api/turn-quality", options = {}) =>
|
|
|
2672
2946
|
};
|
|
2673
2947
|
|
|
2674
2948
|
// src/client/turnQualityWidget.ts
|
|
2675
|
-
var
|
|
2676
|
-
var
|
|
2677
|
-
var
|
|
2949
|
+
var DEFAULT_TITLE9 = "Turn Quality";
|
|
2950
|
+
var DEFAULT_DESCRIPTION9 = "Per-turn STT confidence, fallback selection, corrections, and transcript coverage.";
|
|
2951
|
+
var escapeHtml10 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
2678
2952
|
var formatConfidence = (value) => typeof value === "number" ? `${Math.round(value * 100)}%` : "n/a";
|
|
2679
2953
|
var formatMaybe = (value) => value === undefined || value === "" ? "n/a" : String(value);
|
|
2680
2954
|
var getTurnDetail = (turn) => {
|
|
@@ -2712,37 +2986,37 @@ var createVoiceTurnQualityViewModel = (snapshot, options = {}) => {
|
|
|
2712
2986
|
const warningCount = snapshot.report?.warnings ?? turns.filter((turn) => turn.status === "warn").length;
|
|
2713
2987
|
const failedCount = snapshot.report?.failed ?? turns.filter((turn) => turn.status === "fail").length;
|
|
2714
2988
|
return {
|
|
2715
|
-
description: options.description ??
|
|
2989
|
+
description: options.description ?? DEFAULT_DESCRIPTION9,
|
|
2716
2990
|
error: snapshot.error,
|
|
2717
2991
|
isLoading: snapshot.isLoading,
|
|
2718
2992
|
label: snapshot.error ? "Unavailable" : turns.length ? failedCount > 0 ? `${failedCount} failed` : warningCount > 0 ? `${warningCount} warnings` : `${turns.length} healthy` : snapshot.isLoading ? "Checking" : "No turns",
|
|
2719
2993
|
status: snapshot.error ? "error" : turns.length ? failedCount > 0 || warningCount > 0 ? "warning" : "ready" : snapshot.isLoading ? "loading" : "empty",
|
|
2720
|
-
title: options.title ??
|
|
2994
|
+
title: options.title ?? DEFAULT_TITLE9,
|
|
2721
2995
|
turns,
|
|
2722
2996
|
updatedAt: snapshot.updatedAt
|
|
2723
2997
|
};
|
|
2724
2998
|
};
|
|
2725
2999
|
var renderVoiceTurnQualityHTML = (snapshot, options = {}) => {
|
|
2726
3000
|
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--${
|
|
3001
|
+
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
3002
|
<header>
|
|
2729
|
-
<strong>${
|
|
2730
|
-
<span>${
|
|
3003
|
+
<strong>${escapeHtml10(turn.label)}</strong>
|
|
3004
|
+
<span>${escapeHtml10(turn.status)}</span>
|
|
2731
3005
|
</header>
|
|
2732
|
-
<p>${
|
|
3006
|
+
<p>${escapeHtml10(turn.detail)}</p>
|
|
2733
3007
|
<dl>${turn.rows.map((row) => `<div>
|
|
2734
|
-
<dt>${
|
|
2735
|
-
<dd>${
|
|
3008
|
+
<dt>${escapeHtml10(row.label)}</dt>
|
|
3009
|
+
<dd>${escapeHtml10(row.value)}</dd>
|
|
2736
3010
|
</div>`).join("")}</dl>
|
|
2737
3011
|
</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--${
|
|
3012
|
+
return `<section class="absolute-voice-turn-quality absolute-voice-turn-quality--${escapeHtml10(model.status)}">
|
|
2739
3013
|
<header class="absolute-voice-turn-quality__header">
|
|
2740
|
-
<span class="absolute-voice-turn-quality__eyebrow">${
|
|
2741
|
-
<strong class="absolute-voice-turn-quality__label">${
|
|
3014
|
+
<span class="absolute-voice-turn-quality__eyebrow">${escapeHtml10(model.title)}</span>
|
|
3015
|
+
<strong class="absolute-voice-turn-quality__label">${escapeHtml10(model.label)}</strong>
|
|
2742
3016
|
</header>
|
|
2743
|
-
<p class="absolute-voice-turn-quality__description">${
|
|
3017
|
+
<p class="absolute-voice-turn-quality__description">${escapeHtml10(model.description)}</p>
|
|
2744
3018
|
${turns}
|
|
2745
|
-
${model.error ? `<p class="absolute-voice-turn-quality__error">${
|
|
3019
|
+
${model.error ? `<p class="absolute-voice-turn-quality__error">${escapeHtml10(model.error)}</p>` : ""}
|
|
2746
3020
|
</section>`;
|
|
2747
3021
|
};
|
|
2748
3022
|
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 +3058,13 @@ var defineVoiceTurnQualityElement = (tagName = "absolute-voice-turn-quality") =>
|
|
|
2784
3058
|
};
|
|
2785
3059
|
|
|
2786
3060
|
// src/vue/useVoiceTurnQuality.ts
|
|
2787
|
-
import { onUnmounted as
|
|
3061
|
+
import { onUnmounted as onUnmounted10, shallowRef as shallowRef9 } from "vue";
|
|
2788
3062
|
function useVoiceTurnQuality(path = "/api/turn-quality", options = {}) {
|
|
2789
3063
|
const store = createVoiceTurnQualityStore(path, options);
|
|
2790
|
-
const error =
|
|
2791
|
-
const isLoading =
|
|
2792
|
-
const report =
|
|
2793
|
-
const updatedAt =
|
|
3064
|
+
const error = shallowRef9(null);
|
|
3065
|
+
const isLoading = shallowRef9(false);
|
|
3066
|
+
const report = shallowRef9();
|
|
3067
|
+
const updatedAt = shallowRef9(undefined);
|
|
2794
3068
|
const sync = () => {
|
|
2795
3069
|
const snapshot = store.getSnapshot();
|
|
2796
3070
|
error.value = snapshot.error;
|
|
@@ -2801,7 +3075,7 @@ function useVoiceTurnQuality(path = "/api/turn-quality", options = {}) {
|
|
|
2801
3075
|
const unsubscribe = store.subscribe(sync);
|
|
2802
3076
|
sync();
|
|
2803
3077
|
store.refresh().catch(() => {});
|
|
2804
|
-
|
|
3078
|
+
onUnmounted10(() => {
|
|
2805
3079
|
unsubscribe();
|
|
2806
3080
|
store.close();
|
|
2807
3081
|
});
|
|
@@ -2809,7 +3083,7 @@ function useVoiceTurnQuality(path = "/api/turn-quality", options = {}) {
|
|
|
2809
3083
|
}
|
|
2810
3084
|
|
|
2811
3085
|
// src/vue/VoiceTurnQuality.ts
|
|
2812
|
-
var VoiceTurnQuality =
|
|
3086
|
+
var VoiceTurnQuality = defineComponent10({
|
|
2813
3087
|
name: "VoiceTurnQuality",
|
|
2814
3088
|
props: {
|
|
2815
3089
|
class: { default: "", type: String },
|
|
@@ -2831,41 +3105,41 @@ var VoiceTurnQuality = defineComponent9({
|
|
|
2831
3105
|
report: quality.report.value,
|
|
2832
3106
|
updatedAt: quality.updatedAt.value
|
|
2833
3107
|
}, options));
|
|
2834
|
-
return () =>
|
|
3108
|
+
return () => h10("section", {
|
|
2835
3109
|
class: [
|
|
2836
3110
|
"absolute-voice-turn-quality",
|
|
2837
3111
|
`absolute-voice-turn-quality--${model.value.status}`,
|
|
2838
3112
|
props.class
|
|
2839
3113
|
]
|
|
2840
3114
|
}, [
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
3115
|
+
h10("header", { class: "absolute-voice-turn-quality__header" }, [
|
|
3116
|
+
h10("span", { class: "absolute-voice-turn-quality__eyebrow" }, model.value.title),
|
|
3117
|
+
h10("strong", { class: "absolute-voice-turn-quality__label" }, model.value.label)
|
|
2844
3118
|
]),
|
|
2845
|
-
|
|
2846
|
-
model.value.turns.length ?
|
|
3119
|
+
h10("p", { class: "absolute-voice-turn-quality__description" }, model.value.description),
|
|
3120
|
+
model.value.turns.length ? h10("div", { class: "absolute-voice-turn-quality__turns" }, model.value.turns.map((turn) => h10("article", {
|
|
2847
3121
|
class: [
|
|
2848
3122
|
"absolute-voice-turn-quality__turn",
|
|
2849
3123
|
`absolute-voice-turn-quality__turn--${turn.status}`
|
|
2850
3124
|
],
|
|
2851
3125
|
key: `${turn.sessionId}:${turn.turnId}`
|
|
2852
3126
|
}, [
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
|
|
3127
|
+
h10("header", [
|
|
3128
|
+
h10("strong", turn.label),
|
|
3129
|
+
h10("span", turn.status)
|
|
2856
3130
|
]),
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
3131
|
+
h10("p", turn.detail),
|
|
3132
|
+
h10("dl", turn.rows.map((row) => h10("div", { key: row.label }, [
|
|
3133
|
+
h10("dt", row.label),
|
|
3134
|
+
h10("dd", row.value)
|
|
2861
3135
|
])))
|
|
2862
|
-
]))) :
|
|
2863
|
-
model.value.error ?
|
|
3136
|
+
]))) : h10("p", { class: "absolute-voice-turn-quality__empty" }, "Complete a voice turn to see STT quality diagnostics."),
|
|
3137
|
+
model.value.error ? h10("p", { class: "absolute-voice-turn-quality__error" }, model.value.error) : null
|
|
2864
3138
|
]);
|
|
2865
3139
|
}
|
|
2866
3140
|
});
|
|
2867
3141
|
// src/vue/useVoiceCampaignDialerProof.ts
|
|
2868
|
-
import { onUnmounted as
|
|
3142
|
+
import { onUnmounted as onUnmounted11, shallowRef as shallowRef10 } from "vue";
|
|
2869
3143
|
|
|
2870
3144
|
// src/client/campaignDialerProof.ts
|
|
2871
3145
|
var fetchVoiceCampaignDialerProofStatus = async (path = "/api/voice/campaigns/dialer-proof", options = {}) => {
|
|
@@ -2988,11 +3262,11 @@ var createVoiceCampaignDialerProofStore = (path = "/api/voice/campaigns/dialer-p
|
|
|
2988
3262
|
// src/vue/useVoiceCampaignDialerProof.ts
|
|
2989
3263
|
function useVoiceCampaignDialerProof(path = "/api/voice/campaigns/dialer-proof", options = {}) {
|
|
2990
3264
|
const store = createVoiceCampaignDialerProofStore(path, options);
|
|
2991
|
-
const error =
|
|
2992
|
-
const isLoading =
|
|
2993
|
-
const report =
|
|
2994
|
-
const status =
|
|
2995
|
-
const updatedAt =
|
|
3265
|
+
const error = shallowRef10(null);
|
|
3266
|
+
const isLoading = shallowRef10(false);
|
|
3267
|
+
const report = shallowRef10();
|
|
3268
|
+
const status = shallowRef10();
|
|
3269
|
+
const updatedAt = shallowRef10(undefined);
|
|
2996
3270
|
const sync = () => {
|
|
2997
3271
|
const snapshot = store.getSnapshot();
|
|
2998
3272
|
error.value = snapshot.error;
|
|
@@ -3006,7 +3280,7 @@ function useVoiceCampaignDialerProof(path = "/api/voice/campaigns/dialer-proof",
|
|
|
3006
3280
|
if (typeof window !== "undefined") {
|
|
3007
3281
|
store.refresh().catch(() => {});
|
|
3008
3282
|
}
|
|
3009
|
-
|
|
3283
|
+
onUnmounted11(() => {
|
|
3010
3284
|
unsubscribe();
|
|
3011
3285
|
store.close();
|
|
3012
3286
|
});
|
|
@@ -3021,7 +3295,7 @@ function useVoiceCampaignDialerProof(path = "/api/voice/campaigns/dialer-proof",
|
|
|
3021
3295
|
};
|
|
3022
3296
|
}
|
|
3023
3297
|
// src/vue/useVoiceStream.ts
|
|
3024
|
-
import { onUnmounted as
|
|
3298
|
+
import { onUnmounted as onUnmounted12, ref as ref7, shallowRef as shallowRef11 } from "vue";
|
|
3025
3299
|
|
|
3026
3300
|
// src/client/actions.ts
|
|
3027
3301
|
var normalizeErrorMessage = (value) => {
|
|
@@ -3666,16 +3940,16 @@ var createVoiceStream = (path, options = {}) => {
|
|
|
3666
3940
|
// src/vue/useVoiceStream.ts
|
|
3667
3941
|
function useVoiceStream(path, options = {}) {
|
|
3668
3942
|
const stream = createVoiceStream(path, options);
|
|
3669
|
-
const assistantAudio =
|
|
3670
|
-
const assistantTexts =
|
|
3671
|
-
const call =
|
|
3943
|
+
const assistantAudio = shallowRef11([]);
|
|
3944
|
+
const assistantTexts = shallowRef11([]);
|
|
3945
|
+
const call = shallowRef11(null);
|
|
3672
3946
|
const error = ref7(null);
|
|
3673
3947
|
const isConnected = ref7(false);
|
|
3674
3948
|
const partial = ref7("");
|
|
3675
|
-
const reconnect =
|
|
3949
|
+
const reconnect = shallowRef11(stream.reconnect);
|
|
3676
3950
|
const sessionId = ref7(stream.sessionId);
|
|
3677
3951
|
const status = ref7(stream.status);
|
|
3678
|
-
const turns =
|
|
3952
|
+
const turns = shallowRef11([]);
|
|
3679
3953
|
const sync = () => {
|
|
3680
3954
|
assistantAudio.value = [...stream.assistantAudio];
|
|
3681
3955
|
assistantTexts.value = [...stream.assistantTexts];
|
|
@@ -3694,7 +3968,7 @@ function useVoiceStream(path, options = {}) {
|
|
|
3694
3968
|
unsubscribe();
|
|
3695
3969
|
stream.close();
|
|
3696
3970
|
};
|
|
3697
|
-
|
|
3971
|
+
onUnmounted12(destroy);
|
|
3698
3972
|
return {
|
|
3699
3973
|
assistantAudio,
|
|
3700
3974
|
assistantTexts,
|
|
@@ -3713,7 +3987,7 @@ function useVoiceStream(path, options = {}) {
|
|
|
3713
3987
|
};
|
|
3714
3988
|
}
|
|
3715
3989
|
// src/vue/useVoiceController.ts
|
|
3716
|
-
import { onUnmounted as
|
|
3990
|
+
import { onUnmounted as onUnmounted13, ref as ref8, shallowRef as shallowRef12 } from "vue";
|
|
3717
3991
|
|
|
3718
3992
|
// src/client/htmx.ts
|
|
3719
3993
|
var DEFAULT_EVENT_NAME = "voice-refresh";
|
|
@@ -4359,17 +4633,17 @@ var createVoiceController = (path, options = {}) => {
|
|
|
4359
4633
|
// src/vue/useVoiceController.ts
|
|
4360
4634
|
function useVoiceController(path, options = {}) {
|
|
4361
4635
|
const controller = createVoiceController(path, options);
|
|
4362
|
-
const assistantAudio =
|
|
4363
|
-
const assistantTexts =
|
|
4636
|
+
const assistantAudio = shallowRef12([]);
|
|
4637
|
+
const assistantTexts = shallowRef12([]);
|
|
4364
4638
|
const error = ref8(null);
|
|
4365
4639
|
const isConnected = ref8(false);
|
|
4366
4640
|
const isRecording = ref8(false);
|
|
4367
4641
|
const partial = ref8("");
|
|
4368
|
-
const reconnect =
|
|
4642
|
+
const reconnect = shallowRef12(controller.reconnect);
|
|
4369
4643
|
const recordingError = ref8(null);
|
|
4370
4644
|
const sessionId = ref8(controller.sessionId);
|
|
4371
4645
|
const status = ref8(controller.status);
|
|
4372
|
-
const turns =
|
|
4646
|
+
const turns = shallowRef12([]);
|
|
4373
4647
|
const sync = () => {
|
|
4374
4648
|
assistantAudio.value = [...controller.assistantAudio];
|
|
4375
4649
|
assistantTexts.value = [...controller.assistantTexts];
|
|
@@ -4389,7 +4663,7 @@ function useVoiceController(path, options = {}) {
|
|
|
4389
4663
|
unsubscribe();
|
|
4390
4664
|
controller.close();
|
|
4391
4665
|
};
|
|
4392
|
-
|
|
4666
|
+
onUnmounted13(destroy);
|
|
4393
4667
|
return {
|
|
4394
4668
|
assistantAudio,
|
|
4395
4669
|
assistantTexts,
|
|
@@ -4412,7 +4686,7 @@ function useVoiceController(path, options = {}) {
|
|
|
4412
4686
|
};
|
|
4413
4687
|
}
|
|
4414
4688
|
// src/vue/useVoiceTraceTimeline.ts
|
|
4415
|
-
import { onUnmounted as
|
|
4689
|
+
import { onUnmounted as onUnmounted14, ref as ref9, shallowRef as shallowRef13 } from "vue";
|
|
4416
4690
|
|
|
4417
4691
|
// src/client/traceTimeline.ts
|
|
4418
4692
|
var fetchVoiceTraceTimeline = async (path = "/api/voice-traces", options = {}) => {
|
|
@@ -4499,7 +4773,7 @@ function useVoiceTraceTimeline(path = "/api/voice-traces", options = {}) {
|
|
|
4499
4773
|
const store = createVoiceTraceTimelineStore(path, options);
|
|
4500
4774
|
const error = ref9(null);
|
|
4501
4775
|
const isLoading = ref9(false);
|
|
4502
|
-
const report =
|
|
4776
|
+
const report = shallowRef13(null);
|
|
4503
4777
|
const updatedAt = ref9(undefined);
|
|
4504
4778
|
const sync = () => {
|
|
4505
4779
|
const snapshot = store.getSnapshot();
|
|
@@ -4511,7 +4785,7 @@ function useVoiceTraceTimeline(path = "/api/voice-traces", options = {}) {
|
|
|
4511
4785
|
const unsubscribe = store.subscribe(sync);
|
|
4512
4786
|
sync();
|
|
4513
4787
|
store.refresh().catch(() => {});
|
|
4514
|
-
|
|
4788
|
+
onUnmounted14(() => {
|
|
4515
4789
|
unsubscribe();
|
|
4516
4790
|
store.close();
|
|
4517
4791
|
});
|
|
@@ -4524,7 +4798,7 @@ function useVoiceTraceTimeline(path = "/api/voice-traces", options = {}) {
|
|
|
4524
4798
|
};
|
|
4525
4799
|
}
|
|
4526
4800
|
// src/vue/useVoiceWorkflowStatus.ts
|
|
4527
|
-
import { onUnmounted as
|
|
4801
|
+
import { onUnmounted as onUnmounted15, ref as ref10, shallowRef as shallowRef14 } from "vue";
|
|
4528
4802
|
|
|
4529
4803
|
// src/client/workflowStatus.ts
|
|
4530
4804
|
var fetchVoiceWorkflowStatus = async (path = "/evals/scenarios/json", options = {}) => {
|
|
@@ -4610,7 +4884,7 @@ function useVoiceWorkflowStatus(path = "/evals/scenarios/json", options = {}) {
|
|
|
4610
4884
|
const store = createVoiceWorkflowStatusStore(path, options);
|
|
4611
4885
|
const error = ref10(null);
|
|
4612
4886
|
const isLoading = ref10(false);
|
|
4613
|
-
const report =
|
|
4887
|
+
const report = shallowRef14(undefined);
|
|
4614
4888
|
const updatedAt = ref10(undefined);
|
|
4615
4889
|
const sync = () => {
|
|
4616
4890
|
const snapshot = store.getSnapshot();
|
|
@@ -4624,7 +4898,7 @@ function useVoiceWorkflowStatus(path = "/evals/scenarios/json", options = {}) {
|
|
|
4624
4898
|
if (typeof window !== "undefined") {
|
|
4625
4899
|
store.refresh().catch(() => {});
|
|
4626
4900
|
}
|
|
4627
|
-
|
|
4901
|
+
onUnmounted15(() => {
|
|
4628
4902
|
unsubscribe();
|
|
4629
4903
|
store.close();
|
|
4630
4904
|
});
|
|
@@ -4645,6 +4919,7 @@ export {
|
|
|
4645
4919
|
useVoiceRoutingStatus,
|
|
4646
4920
|
useVoiceProviderStatus,
|
|
4647
4921
|
useVoiceProviderSimulationControls,
|
|
4922
|
+
useVoiceProviderContracts,
|
|
4648
4923
|
useVoiceProviderCapabilities,
|
|
4649
4924
|
useVoiceOpsStatus,
|
|
4650
4925
|
useVoiceOpsActionCenter,
|
|
@@ -4656,6 +4931,7 @@ export {
|
|
|
4656
4931
|
VoiceRoutingStatus,
|
|
4657
4932
|
VoiceProviderStatus,
|
|
4658
4933
|
VoiceProviderSimulationControls,
|
|
4934
|
+
VoiceProviderContracts,
|
|
4659
4935
|
VoiceProviderCapabilities,
|
|
4660
4936
|
VoiceOpsStatus,
|
|
4661
4937
|
VoiceOpsActionCenter,
|