@absolutejs/voice 0.0.22-beta.404 → 0.0.22-beta.405
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 +333 -214
- package/dist/angular/voice-call-debugger.service.d.ts +12 -0
- package/dist/react/VoiceCallDebuggerLaunch.d.ts +6 -0
- package/dist/react/index.d.ts +2 -0
- package/dist/react/index.js +739 -483
- package/dist/react/useVoiceCallDebugger.d.ts +8 -0
- package/dist/svelte/createVoiceCallDebugger.d.ts +12 -0
- package/dist/svelte/index.d.ts +1 -0
- package/dist/svelte/index.js +338 -152
- package/dist/vue/VoiceCallDebuggerLaunch.d.ts +68 -0
- package/dist/vue/index.d.ts +2 -0
- package/dist/vue/index.js +628 -364
- package/dist/vue/useVoiceCallDebugger.d.ts +10 -0
- package/package.json +1 -1
package/dist/react/index.js
CHANGED
|
@@ -5545,6 +5545,260 @@ var VoiceProofTrends = ({
|
|
|
5545
5545
|
]
|
|
5546
5546
|
}, undefined, true, undefined, this);
|
|
5547
5547
|
};
|
|
5548
|
+
// src/client/callDebugger.ts
|
|
5549
|
+
var fetchVoiceCallDebugger = async (path, options = {}) => {
|
|
5550
|
+
const fetchImpl = options.fetch ?? globalThis.fetch;
|
|
5551
|
+
const response = await fetchImpl(path);
|
|
5552
|
+
if (!response.ok) {
|
|
5553
|
+
throw new Error(`Voice call debugger failed: HTTP ${response.status}`);
|
|
5554
|
+
}
|
|
5555
|
+
return await response.json();
|
|
5556
|
+
};
|
|
5557
|
+
var createVoiceCallDebuggerStore = (path, options = {}) => {
|
|
5558
|
+
const listeners = new Set;
|
|
5559
|
+
let closed = false;
|
|
5560
|
+
let timer;
|
|
5561
|
+
let snapshot = {
|
|
5562
|
+
error: null,
|
|
5563
|
+
isLoading: false
|
|
5564
|
+
};
|
|
5565
|
+
const emit = () => {
|
|
5566
|
+
for (const listener of listeners) {
|
|
5567
|
+
listener();
|
|
5568
|
+
}
|
|
5569
|
+
};
|
|
5570
|
+
const refresh = async () => {
|
|
5571
|
+
if (closed) {
|
|
5572
|
+
return snapshot.report;
|
|
5573
|
+
}
|
|
5574
|
+
snapshot = { ...snapshot, error: null, isLoading: true };
|
|
5575
|
+
emit();
|
|
5576
|
+
try {
|
|
5577
|
+
const report = await fetchVoiceCallDebugger(path, options);
|
|
5578
|
+
snapshot = {
|
|
5579
|
+
error: null,
|
|
5580
|
+
isLoading: false,
|
|
5581
|
+
report,
|
|
5582
|
+
updatedAt: Date.now()
|
|
5583
|
+
};
|
|
5584
|
+
emit();
|
|
5585
|
+
return report;
|
|
5586
|
+
} catch (error) {
|
|
5587
|
+
snapshot = {
|
|
5588
|
+
...snapshot,
|
|
5589
|
+
error: error instanceof Error ? error.message : String(error),
|
|
5590
|
+
isLoading: false
|
|
5591
|
+
};
|
|
5592
|
+
emit();
|
|
5593
|
+
throw error;
|
|
5594
|
+
}
|
|
5595
|
+
};
|
|
5596
|
+
const close = () => {
|
|
5597
|
+
closed = true;
|
|
5598
|
+
if (timer) {
|
|
5599
|
+
clearInterval(timer);
|
|
5600
|
+
timer = undefined;
|
|
5601
|
+
}
|
|
5602
|
+
listeners.clear();
|
|
5603
|
+
};
|
|
5604
|
+
if (options.intervalMs && options.intervalMs > 0) {
|
|
5605
|
+
timer = setInterval(() => {
|
|
5606
|
+
refresh().catch(() => {});
|
|
5607
|
+
}, options.intervalMs);
|
|
5608
|
+
}
|
|
5609
|
+
return {
|
|
5610
|
+
close,
|
|
5611
|
+
getServerSnapshot: () => snapshot,
|
|
5612
|
+
getSnapshot: () => snapshot,
|
|
5613
|
+
refresh,
|
|
5614
|
+
subscribe: (listener) => {
|
|
5615
|
+
listeners.add(listener);
|
|
5616
|
+
return () => {
|
|
5617
|
+
listeners.delete(listener);
|
|
5618
|
+
};
|
|
5619
|
+
}
|
|
5620
|
+
};
|
|
5621
|
+
};
|
|
5622
|
+
|
|
5623
|
+
// src/client/callDebuggerWidget.ts
|
|
5624
|
+
var DEFAULT_TITLE6 = "Call Debugger";
|
|
5625
|
+
var DEFAULT_DESCRIPTION6 = "Open the latest call artifact with snapshot, operations record, failure replay, provider path, transcript, and incident markdown.";
|
|
5626
|
+
var DEFAULT_LINK_LABEL = "Open debugger";
|
|
5627
|
+
var escapeHtml11 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
5628
|
+
var defaultHref = (path, report) => {
|
|
5629
|
+
if (path.startsWith("/api/voice-call-debugger/")) {
|
|
5630
|
+
return path.replace("/api/voice-call-debugger/", "/voice-call-debugger/");
|
|
5631
|
+
}
|
|
5632
|
+
return report ? `/voice-call-debugger/${encodeURIComponent(report.sessionId)}` : path;
|
|
5633
|
+
};
|
|
5634
|
+
var resolveHref = (path, state, options) => {
|
|
5635
|
+
if (typeof options.href === "function") {
|
|
5636
|
+
return options.href({ report: state.report });
|
|
5637
|
+
}
|
|
5638
|
+
return options.href ?? defaultHref(path, state.report);
|
|
5639
|
+
};
|
|
5640
|
+
var createVoiceCallDebuggerLaunchViewModel = (path, state, options = {}) => {
|
|
5641
|
+
const report = state.report;
|
|
5642
|
+
const href = resolveHref(path, state, options);
|
|
5643
|
+
return {
|
|
5644
|
+
description: options.description ?? DEFAULT_DESCRIPTION6,
|
|
5645
|
+
error: state.error,
|
|
5646
|
+
href,
|
|
5647
|
+
isLoading: state.isLoading,
|
|
5648
|
+
label: state.error ? "Unavailable" : report ? `${report.status} \xB7 ${report.sessionId}` : state.isLoading ? "Loading" : "No call loaded",
|
|
5649
|
+
rows: report ? [
|
|
5650
|
+
{ label: "Events", value: String(report.operationsRecord.summary.eventCount) },
|
|
5651
|
+
{ label: "Turns", value: String(report.operationsRecord.summary.turnCount) },
|
|
5652
|
+
{ label: "Errors", value: String(report.operationsRecord.summary.errorCount) },
|
|
5653
|
+
{
|
|
5654
|
+
label: "Provider recovery",
|
|
5655
|
+
value: report.operationsRecord.providerDecisionSummary.recoveryStatus
|
|
5656
|
+
},
|
|
5657
|
+
{
|
|
5658
|
+
label: "Fallbacks",
|
|
5659
|
+
value: String(report.operationsRecord.providerDecisionSummary.fallbacks)
|
|
5660
|
+
},
|
|
5661
|
+
{ label: "Snapshot", value: report.snapshot.status }
|
|
5662
|
+
] : [],
|
|
5663
|
+
status: state.error ? "error" : report ? report.status === "healthy" ? "ready" : "warning" : state.isLoading ? "loading" : "empty",
|
|
5664
|
+
title: options.title ?? DEFAULT_TITLE6,
|
|
5665
|
+
updatedAt: state.updatedAt
|
|
5666
|
+
};
|
|
5667
|
+
};
|
|
5668
|
+
var renderVoiceCallDebuggerLaunchHTML = (path, state, options = {}) => {
|
|
5669
|
+
const model = createVoiceCallDebuggerLaunchViewModel(path, state, options);
|
|
5670
|
+
const rows = model.rows.length ? `<dl>${model.rows.map((row) => `<div>
|
|
5671
|
+
<dt>${escapeHtml11(row.label)}</dt>
|
|
5672
|
+
<dd>${escapeHtml11(row.value)}</dd>
|
|
5673
|
+
</div>`).join("")}</dl>` : '<p class="absolute-voice-call-debugger-launch__empty">Load a call debugger report to see the latest support artifact.</p>';
|
|
5674
|
+
return `<section class="absolute-voice-call-debugger-launch absolute-voice-call-debugger-launch--${escapeHtml11(model.status)}">
|
|
5675
|
+
<header class="absolute-voice-call-debugger-launch__header">
|
|
5676
|
+
<span class="absolute-voice-call-debugger-launch__eyebrow">${escapeHtml11(model.title)}</span>
|
|
5677
|
+
<strong class="absolute-voice-call-debugger-launch__label">${escapeHtml11(model.label)}</strong>
|
|
5678
|
+
</header>
|
|
5679
|
+
<p class="absolute-voice-call-debugger-launch__description">${escapeHtml11(model.description)}</p>
|
|
5680
|
+
<a class="absolute-voice-call-debugger-launch__link" href="${escapeHtml11(model.href)}">${escapeHtml11(options.linkLabel ?? DEFAULT_LINK_LABEL)}</a>
|
|
5681
|
+
${rows}
|
|
5682
|
+
${model.error ? `<p class="absolute-voice-call-debugger-launch__error">${escapeHtml11(model.error)}</p>` : ""}
|
|
5683
|
+
</section>`;
|
|
5684
|
+
};
|
|
5685
|
+
var mountVoiceCallDebuggerLaunch = (element, path, options = {}) => {
|
|
5686
|
+
const store = createVoiceCallDebuggerStore(path, options);
|
|
5687
|
+
const render = () => {
|
|
5688
|
+
element.innerHTML = renderVoiceCallDebuggerLaunchHTML(path, store.getSnapshot(), options);
|
|
5689
|
+
};
|
|
5690
|
+
const unsubscribe = store.subscribe(render);
|
|
5691
|
+
render();
|
|
5692
|
+
store.refresh().catch(() => {});
|
|
5693
|
+
return {
|
|
5694
|
+
close: () => {
|
|
5695
|
+
unsubscribe();
|
|
5696
|
+
store.close();
|
|
5697
|
+
},
|
|
5698
|
+
refresh: store.refresh
|
|
5699
|
+
};
|
|
5700
|
+
};
|
|
5701
|
+
var defineVoiceCallDebuggerLaunchElement = (tagName = "absolute-voice-call-debugger-launch") => {
|
|
5702
|
+
if (typeof window === "undefined" || typeof customElements === "undefined" || customElements.get(tagName)) {
|
|
5703
|
+
return;
|
|
5704
|
+
}
|
|
5705
|
+
customElements.define(tagName, class AbsoluteVoiceCallDebuggerLaunchElement extends HTMLElement {
|
|
5706
|
+
mounted;
|
|
5707
|
+
connectedCallback() {
|
|
5708
|
+
const intervalMs = Number(this.getAttribute("interval-ms") ?? 0);
|
|
5709
|
+
this.mounted = mountVoiceCallDebuggerLaunch(this, this.getAttribute("path") ?? "/api/voice-call-debugger/latest", {
|
|
5710
|
+
description: this.getAttribute("description") ?? undefined,
|
|
5711
|
+
href: this.getAttribute("href") ?? undefined,
|
|
5712
|
+
intervalMs: Number.isFinite(intervalMs) ? intervalMs : 0,
|
|
5713
|
+
linkLabel: this.getAttribute("link-label") ?? undefined,
|
|
5714
|
+
title: this.getAttribute("title") ?? undefined
|
|
5715
|
+
});
|
|
5716
|
+
}
|
|
5717
|
+
disconnectedCallback() {
|
|
5718
|
+
this.mounted?.close();
|
|
5719
|
+
this.mounted = undefined;
|
|
5720
|
+
}
|
|
5721
|
+
});
|
|
5722
|
+
};
|
|
5723
|
+
|
|
5724
|
+
// src/react/useVoiceCallDebugger.tsx
|
|
5725
|
+
import { useEffect as useEffect6, useRef as useRef6, useSyncExternalStore as useSyncExternalStore6 } from "react";
|
|
5726
|
+
var useVoiceCallDebugger = (path, options = {}) => {
|
|
5727
|
+
const storeRef = useRef6(null);
|
|
5728
|
+
if (!storeRef.current) {
|
|
5729
|
+
storeRef.current = createVoiceCallDebuggerStore(path, options);
|
|
5730
|
+
}
|
|
5731
|
+
const store = storeRef.current;
|
|
5732
|
+
useEffect6(() => {
|
|
5733
|
+
store.refresh().catch(() => {});
|
|
5734
|
+
return () => store.close();
|
|
5735
|
+
}, [store]);
|
|
5736
|
+
return {
|
|
5737
|
+
...useSyncExternalStore6(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
5738
|
+
refresh: store.refresh
|
|
5739
|
+
};
|
|
5740
|
+
};
|
|
5741
|
+
|
|
5742
|
+
// src/react/VoiceCallDebuggerLaunch.tsx
|
|
5743
|
+
import { jsxDEV as jsxDEV6 } from "react/jsx-dev-runtime";
|
|
5744
|
+
var VoiceCallDebuggerLaunch = ({
|
|
5745
|
+
className,
|
|
5746
|
+
path,
|
|
5747
|
+
...options
|
|
5748
|
+
}) => {
|
|
5749
|
+
const state = useVoiceCallDebugger(path, options);
|
|
5750
|
+
const model = createVoiceCallDebuggerLaunchViewModel(path, state, options);
|
|
5751
|
+
return /* @__PURE__ */ jsxDEV6("section", {
|
|
5752
|
+
className: [
|
|
5753
|
+
"absolute-voice-call-debugger-launch",
|
|
5754
|
+
`absolute-voice-call-debugger-launch--${model.status}`,
|
|
5755
|
+
className
|
|
5756
|
+
].filter(Boolean).join(" "),
|
|
5757
|
+
children: [
|
|
5758
|
+
/* @__PURE__ */ jsxDEV6("header", {
|
|
5759
|
+
className: "absolute-voice-call-debugger-launch__header",
|
|
5760
|
+
children: [
|
|
5761
|
+
/* @__PURE__ */ jsxDEV6("span", {
|
|
5762
|
+
className: "absolute-voice-call-debugger-launch__eyebrow",
|
|
5763
|
+
children: model.title
|
|
5764
|
+
}, undefined, false, undefined, this),
|
|
5765
|
+
/* @__PURE__ */ jsxDEV6("strong", {
|
|
5766
|
+
className: "absolute-voice-call-debugger-launch__label",
|
|
5767
|
+
children: model.label
|
|
5768
|
+
}, undefined, false, undefined, this)
|
|
5769
|
+
]
|
|
5770
|
+
}, undefined, true, undefined, this),
|
|
5771
|
+
/* @__PURE__ */ jsxDEV6("p", {
|
|
5772
|
+
className: "absolute-voice-call-debugger-launch__description",
|
|
5773
|
+
children: model.description
|
|
5774
|
+
}, undefined, false, undefined, this),
|
|
5775
|
+
/* @__PURE__ */ jsxDEV6("a", {
|
|
5776
|
+
className: "absolute-voice-call-debugger-launch__link",
|
|
5777
|
+
href: model.href,
|
|
5778
|
+
children: options.linkLabel ?? "Open debugger"
|
|
5779
|
+
}, undefined, false, undefined, this),
|
|
5780
|
+
model.rows.length ? /* @__PURE__ */ jsxDEV6("dl", {
|
|
5781
|
+
children: model.rows.map((row) => /* @__PURE__ */ jsxDEV6("div", {
|
|
5782
|
+
children: [
|
|
5783
|
+
/* @__PURE__ */ jsxDEV6("dt", {
|
|
5784
|
+
children: row.label
|
|
5785
|
+
}, undefined, false, undefined, this),
|
|
5786
|
+
/* @__PURE__ */ jsxDEV6("dd", {
|
|
5787
|
+
children: row.value
|
|
5788
|
+
}, undefined, false, undefined, this)
|
|
5789
|
+
]
|
|
5790
|
+
}, row.label, true, undefined, this))
|
|
5791
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV6("p", {
|
|
5792
|
+
className: "absolute-voice-call-debugger-launch__empty",
|
|
5793
|
+
children: "Load a call debugger report to see the latest support artifact."
|
|
5794
|
+
}, undefined, false, undefined, this),
|
|
5795
|
+
model.error ? /* @__PURE__ */ jsxDEV6("p", {
|
|
5796
|
+
className: "absolute-voice-call-debugger-launch__error",
|
|
5797
|
+
children: model.error
|
|
5798
|
+
}, undefined, false, undefined, this) : null
|
|
5799
|
+
]
|
|
5800
|
+
}, undefined, true, undefined, this);
|
|
5801
|
+
};
|
|
5548
5802
|
// src/client/sessionSnapshot.ts
|
|
5549
5803
|
var withTurnId = (path, turnId) => {
|
|
5550
5804
|
if (!turnId) {
|
|
@@ -5639,10 +5893,10 @@ var createVoiceSessionSnapshotStore = (path, options = {}) => {
|
|
|
5639
5893
|
};
|
|
5640
5894
|
|
|
5641
5895
|
// src/client/sessionSnapshotWidget.ts
|
|
5642
|
-
var
|
|
5643
|
-
var
|
|
5896
|
+
var DEFAULT_TITLE7 = "Session Snapshot";
|
|
5897
|
+
var DEFAULT_DESCRIPTION7 = "Portable call artifact with media graph, provider routing, proof, quality, and telephony evidence.";
|
|
5644
5898
|
var DEFAULT_DOWNLOAD_LABEL = "Download snapshot";
|
|
5645
|
-
var
|
|
5899
|
+
var escapeHtml12 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
5646
5900
|
var formatStatus2 = (status) => status ?? "n/a";
|
|
5647
5901
|
var createVoiceSessionSnapshotViewModel = (state, options = {}) => {
|
|
5648
5902
|
const snapshot = state.snapshot;
|
|
@@ -5658,7 +5912,7 @@ var createVoiceSessionSnapshotViewModel = (state, options = {}) => {
|
|
|
5658
5912
|
label: artifact.label,
|
|
5659
5913
|
status: formatStatus2(artifact.status)
|
|
5660
5914
|
})) ?? [],
|
|
5661
|
-
description: options.description ??
|
|
5915
|
+
description: options.description ?? DEFAULT_DESCRIPTION7,
|
|
5662
5916
|
error: state.error,
|
|
5663
5917
|
isLoading: state.isLoading,
|
|
5664
5918
|
label: state.error ? "Unavailable" : snapshot ? `${snapshot.status} \xB7 ${snapshot.sessionId}` : state.isLoading ? "Loading" : "No snapshot",
|
|
@@ -5682,30 +5936,30 @@ var createVoiceSessionSnapshotViewModel = (state, options = {}) => {
|
|
|
5682
5936
|
] : [],
|
|
5683
5937
|
showDownload: snapshot !== undefined,
|
|
5684
5938
|
status: state.error ? "error" : snapshot ? snapshot.status === "pass" ? "ready" : "warning" : state.isLoading ? "loading" : "empty",
|
|
5685
|
-
title: options.title ??
|
|
5939
|
+
title: options.title ?? DEFAULT_TITLE7,
|
|
5686
5940
|
updatedAt: state.updatedAt
|
|
5687
5941
|
};
|
|
5688
5942
|
};
|
|
5689
5943
|
var renderVoiceSessionSnapshotHTML = (state, options = {}) => {
|
|
5690
5944
|
const model = createVoiceSessionSnapshotViewModel(state, options);
|
|
5691
5945
|
const rows = model.rows.length ? `<dl>${model.rows.map((row) => `<div>
|
|
5692
|
-
<dt>${
|
|
5693
|
-
<dd>${
|
|
5946
|
+
<dt>${escapeHtml12(row.label)}</dt>
|
|
5947
|
+
<dd>${escapeHtml12(row.value)}</dd>
|
|
5694
5948
|
</div>`).join("")}</dl>` : '<p class="absolute-voice-session-snapshot__empty">Load a session snapshot to see support diagnostics.</p>';
|
|
5695
5949
|
const artifacts = model.artifacts.length ? `<div class="absolute-voice-session-snapshot__artifacts">${model.artifacts.map((artifact) => {
|
|
5696
|
-
const body = `<strong>${
|
|
5697
|
-
return artifact.href ? `<a href="${
|
|
5950
|
+
const body = `<strong>${escapeHtml12(artifact.label)}</strong><span>${escapeHtml12(artifact.status)}</span>`;
|
|
5951
|
+
return artifact.href ? `<a href="${escapeHtml12(artifact.href)}">${body}</a>` : `<div>${body}</div>`;
|
|
5698
5952
|
}).join("")}</div>` : "";
|
|
5699
|
-
return `<section class="absolute-voice-session-snapshot absolute-voice-session-snapshot--${
|
|
5953
|
+
return `<section class="absolute-voice-session-snapshot absolute-voice-session-snapshot--${escapeHtml12(model.status)}">
|
|
5700
5954
|
<header class="absolute-voice-session-snapshot__header">
|
|
5701
|
-
<span class="absolute-voice-session-snapshot__eyebrow">${
|
|
5702
|
-
<strong class="absolute-voice-session-snapshot__label">${
|
|
5955
|
+
<span class="absolute-voice-session-snapshot__eyebrow">${escapeHtml12(model.title)}</span>
|
|
5956
|
+
<strong class="absolute-voice-session-snapshot__label">${escapeHtml12(model.label)}</strong>
|
|
5703
5957
|
</header>
|
|
5704
|
-
<p class="absolute-voice-session-snapshot__description">${
|
|
5705
|
-
${model.showDownload ? `<button class="absolute-voice-session-snapshot__download" data-absolute-voice-session-snapshot-download type="button">${
|
|
5958
|
+
<p class="absolute-voice-session-snapshot__description">${escapeHtml12(model.description)}</p>
|
|
5959
|
+
${model.showDownload ? `<button class="absolute-voice-session-snapshot__download" data-absolute-voice-session-snapshot-download type="button">${escapeHtml12(options.downloadLabel ?? DEFAULT_DOWNLOAD_LABEL)}</button>` : ""}
|
|
5706
5960
|
${rows}
|
|
5707
5961
|
${artifacts}
|
|
5708
|
-
${model.error ? `<p class="absolute-voice-session-snapshot__error">${
|
|
5962
|
+
${model.error ? `<p class="absolute-voice-session-snapshot__error">${escapeHtml12(model.error)}</p>` : ""}
|
|
5709
5963
|
</section>`;
|
|
5710
5964
|
};
|
|
5711
5965
|
var downloadBlob = (blob, filename) => {
|
|
@@ -5769,26 +6023,26 @@ var defineVoiceSessionSnapshotElement = (tagName = "absolute-voice-session-snaps
|
|
|
5769
6023
|
};
|
|
5770
6024
|
|
|
5771
6025
|
// src/react/useVoiceSessionSnapshot.tsx
|
|
5772
|
-
import { useEffect as
|
|
6026
|
+
import { useEffect as useEffect7, useRef as useRef7, useSyncExternalStore as useSyncExternalStore7 } from "react";
|
|
5773
6027
|
var useVoiceSessionSnapshot = (path, options = {}) => {
|
|
5774
|
-
const storeRef =
|
|
6028
|
+
const storeRef = useRef7(null);
|
|
5775
6029
|
if (!storeRef.current) {
|
|
5776
6030
|
storeRef.current = createVoiceSessionSnapshotStore(path, options);
|
|
5777
6031
|
}
|
|
5778
6032
|
const store = storeRef.current;
|
|
5779
|
-
|
|
6033
|
+
useEffect7(() => {
|
|
5780
6034
|
store.refresh().catch(() => {});
|
|
5781
6035
|
return () => store.close();
|
|
5782
6036
|
}, [store]);
|
|
5783
6037
|
return {
|
|
5784
|
-
...
|
|
6038
|
+
...useSyncExternalStore7(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
5785
6039
|
download: store.download,
|
|
5786
6040
|
refresh: store.refresh
|
|
5787
6041
|
};
|
|
5788
6042
|
};
|
|
5789
6043
|
|
|
5790
6044
|
// src/react/VoiceSessionSnapshot.tsx
|
|
5791
|
-
import { jsxDEV as
|
|
6045
|
+
import { jsxDEV as jsxDEV7 } from "react/jsx-dev-runtime";
|
|
5792
6046
|
var VoiceSessionSnapshot = ({
|
|
5793
6047
|
className,
|
|
5794
6048
|
path,
|
|
@@ -5796,52 +6050,52 @@ var VoiceSessionSnapshot = ({
|
|
|
5796
6050
|
}) => {
|
|
5797
6051
|
const state = useVoiceSessionSnapshot(path, options);
|
|
5798
6052
|
const model = createVoiceSessionSnapshotViewModel(state, options);
|
|
5799
|
-
return /* @__PURE__ */
|
|
6053
|
+
return /* @__PURE__ */ jsxDEV7("section", {
|
|
5800
6054
|
className: [
|
|
5801
6055
|
"absolute-voice-session-snapshot",
|
|
5802
6056
|
`absolute-voice-session-snapshot--${model.status}`,
|
|
5803
6057
|
className
|
|
5804
6058
|
].filter(Boolean).join(" "),
|
|
5805
6059
|
children: [
|
|
5806
|
-
/* @__PURE__ */
|
|
6060
|
+
/* @__PURE__ */ jsxDEV7("header", {
|
|
5807
6061
|
className: "absolute-voice-session-snapshot__header",
|
|
5808
6062
|
children: [
|
|
5809
|
-
/* @__PURE__ */
|
|
6063
|
+
/* @__PURE__ */ jsxDEV7("span", {
|
|
5810
6064
|
className: "absolute-voice-session-snapshot__eyebrow",
|
|
5811
6065
|
children: model.title
|
|
5812
6066
|
}, undefined, false, undefined, this),
|
|
5813
|
-
/* @__PURE__ */
|
|
6067
|
+
/* @__PURE__ */ jsxDEV7("strong", {
|
|
5814
6068
|
className: "absolute-voice-session-snapshot__label",
|
|
5815
6069
|
children: model.label
|
|
5816
6070
|
}, undefined, false, undefined, this)
|
|
5817
6071
|
]
|
|
5818
6072
|
}, undefined, true, undefined, this),
|
|
5819
|
-
/* @__PURE__ */
|
|
6073
|
+
/* @__PURE__ */ jsxDEV7("p", {
|
|
5820
6074
|
className: "absolute-voice-session-snapshot__description",
|
|
5821
6075
|
children: model.description
|
|
5822
6076
|
}, undefined, false, undefined, this),
|
|
5823
|
-
model.showDownload ? /* @__PURE__ */
|
|
6077
|
+
model.showDownload ? /* @__PURE__ */ jsxDEV7("button", {
|
|
5824
6078
|
className: "absolute-voice-session-snapshot__download",
|
|
5825
6079
|
onClick: () => state.download(),
|
|
5826
6080
|
type: "button",
|
|
5827
6081
|
children: options.downloadLabel ?? "Download snapshot"
|
|
5828
6082
|
}, undefined, false, undefined, this) : null,
|
|
5829
|
-
model.rows.length ? /* @__PURE__ */
|
|
5830
|
-
children: model.rows.map((row) => /* @__PURE__ */
|
|
6083
|
+
model.rows.length ? /* @__PURE__ */ jsxDEV7("dl", {
|
|
6084
|
+
children: model.rows.map((row) => /* @__PURE__ */ jsxDEV7("div", {
|
|
5831
6085
|
children: [
|
|
5832
|
-
/* @__PURE__ */
|
|
6086
|
+
/* @__PURE__ */ jsxDEV7("dt", {
|
|
5833
6087
|
children: row.label
|
|
5834
6088
|
}, undefined, false, undefined, this),
|
|
5835
|
-
/* @__PURE__ */
|
|
6089
|
+
/* @__PURE__ */ jsxDEV7("dd", {
|
|
5836
6090
|
children: row.value
|
|
5837
6091
|
}, undefined, false, undefined, this)
|
|
5838
6092
|
]
|
|
5839
6093
|
}, row.label, true, undefined, this))
|
|
5840
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
6094
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV7("p", {
|
|
5841
6095
|
className: "absolute-voice-session-snapshot__empty",
|
|
5842
6096
|
children: "Load a session snapshot to see support diagnostics."
|
|
5843
6097
|
}, undefined, false, undefined, this),
|
|
5844
|
-
model.error ? /* @__PURE__ */
|
|
6098
|
+
model.error ? /* @__PURE__ */ jsxDEV7("p", {
|
|
5845
6099
|
className: "absolute-voice-session-snapshot__error",
|
|
5846
6100
|
children: model.error
|
|
5847
6101
|
}, undefined, false, undefined, this) : null
|
|
@@ -5924,13 +6178,13 @@ var createVoiceProfileComparisonStore = (path = "/api/voice/real-call-profile-hi
|
|
|
5924
6178
|
};
|
|
5925
6179
|
|
|
5926
6180
|
// src/client/profileComparisonWidget.ts
|
|
5927
|
-
var
|
|
5928
|
-
var
|
|
6181
|
+
var DEFAULT_TITLE8 = "Profile Stack Comparison";
|
|
6182
|
+
var DEFAULT_DESCRIPTION8 = "Measured real-call evidence behind each profile default: provider routes, latency, and the next move.";
|
|
5929
6183
|
var DEFAULT_LINKS3 = [
|
|
5930
6184
|
{ href: "/voice/real-call-profile-history", label: "Profile history" },
|
|
5931
6185
|
{ href: "/api/voice/real-call-profile-history", label: "JSON" }
|
|
5932
6186
|
];
|
|
5933
|
-
var
|
|
6187
|
+
var escapeHtml13 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
5934
6188
|
var formatMs2 = (value) => typeof value === "number" && Number.isFinite(value) ? `${Math.round(value)}ms` : "n/a";
|
|
5935
6189
|
var formatProviderRoutes = (profile) => Object.entries(profile.providerRoutes).map(([role, provider]) => `${role}: ${provider}`).join(", ") || "No complete route yet";
|
|
5936
6190
|
var createProfileView = (profile) => ({
|
|
@@ -5949,37 +6203,37 @@ var createVoiceProfileComparisonViewModel = (snapshot, options = {}) => {
|
|
|
5949
6203
|
const report = snapshot.report;
|
|
5950
6204
|
const profiles = report?.defaults.profiles.map(createProfileView) ?? [];
|
|
5951
6205
|
return {
|
|
5952
|
-
description: options.description ??
|
|
6206
|
+
description: options.description ?? DEFAULT_DESCRIPTION8,
|
|
5953
6207
|
error: snapshot.error,
|
|
5954
6208
|
isLoading: snapshot.isLoading,
|
|
5955
6209
|
label: snapshot.error ? "Unavailable" : report ? `${report.defaults.summary.actionableProfiles}/${report.defaults.summary.profileCount} profiles ready` : snapshot.isLoading ? "Checking" : "No profile evidence",
|
|
5956
6210
|
links: options.links ?? DEFAULT_LINKS3,
|
|
5957
6211
|
profiles,
|
|
5958
6212
|
status: snapshot.error ? "error" : report ? report.status === "pass" ? "ready" : "warning" : snapshot.isLoading ? "loading" : "empty",
|
|
5959
|
-
title: options.title ??
|
|
6213
|
+
title: options.title ?? DEFAULT_TITLE8
|
|
5960
6214
|
};
|
|
5961
6215
|
};
|
|
5962
6216
|
var renderVoiceProfileComparisonHTML = (snapshot, options = {}) => {
|
|
5963
6217
|
const model = createVoiceProfileComparisonViewModel(snapshot, options);
|
|
5964
|
-
const profiles = model.profiles.length ? `<div class="absolute-voice-profile-comparison__profiles">${model.profiles.map((profile) => `<article class="absolute-voice-profile-comparison__profile absolute-voice-profile-comparison__profile--${
|
|
6218
|
+
const profiles = model.profiles.length ? `<div class="absolute-voice-profile-comparison__profiles">${model.profiles.map((profile) => `<article class="absolute-voice-profile-comparison__profile absolute-voice-profile-comparison__profile--${escapeHtml13(profile.status)}">
|
|
5965
6219
|
<header>
|
|
5966
|
-
<span>${
|
|
5967
|
-
<strong>${
|
|
6220
|
+
<span>${escapeHtml13(profile.status)}</span>
|
|
6221
|
+
<strong>${escapeHtml13(profile.label)}</strong>
|
|
5968
6222
|
</header>
|
|
5969
|
-
<p>${
|
|
5970
|
-
<div>${profile.evidence.map((metric) => `<span><small>${
|
|
5971
|
-
<em>${
|
|
5972
|
-
</article>`).join("")}</div>` : `<p class="absolute-voice-profile-comparison__empty">${model.error ?
|
|
5973
|
-
const links = model.links.length ? `<p class="absolute-voice-profile-comparison__links">${model.links.map((link) => `<a href="${
|
|
5974
|
-
return `<section class="absolute-voice-profile-comparison absolute-voice-profile-comparison--${
|
|
6223
|
+
<p>${escapeHtml13(profile.providerRoutes)}</p>
|
|
6224
|
+
<div>${profile.evidence.map((metric) => `<span><small>${escapeHtml13(metric.label)}</small><b>${escapeHtml13(metric.value)}</b></span>`).join("")}</div>
|
|
6225
|
+
<em>${escapeHtml13(profile.nextMove)}</em>
|
|
6226
|
+
</article>`).join("")}</div>` : `<p class="absolute-voice-profile-comparison__empty">${model.error ? escapeHtml13(model.error) : "Run real-call profile collection to populate profile comparisons."}</p>`;
|
|
6227
|
+
const links = model.links.length ? `<p class="absolute-voice-profile-comparison__links">${model.links.map((link) => `<a href="${escapeHtml13(link.href)}">${escapeHtml13(link.label)}</a>`).join("")}</p>` : "";
|
|
6228
|
+
return `<section class="absolute-voice-profile-comparison absolute-voice-profile-comparison--${escapeHtml13(model.status)}">
|
|
5975
6229
|
<header class="absolute-voice-profile-comparison__header">
|
|
5976
|
-
<span class="absolute-voice-profile-comparison__eyebrow">${
|
|
5977
|
-
<strong class="absolute-voice-profile-comparison__label">${
|
|
6230
|
+
<span class="absolute-voice-profile-comparison__eyebrow">${escapeHtml13(model.title)}</span>
|
|
6231
|
+
<strong class="absolute-voice-profile-comparison__label">${escapeHtml13(model.label)}</strong>
|
|
5978
6232
|
</header>
|
|
5979
|
-
<p class="absolute-voice-profile-comparison__description">${
|
|
6233
|
+
<p class="absolute-voice-profile-comparison__description">${escapeHtml13(model.description)}</p>
|
|
5980
6234
|
${profiles}
|
|
5981
6235
|
${links}
|
|
5982
|
-
${model.error ? `<p class="absolute-voice-profile-comparison__error">${
|
|
6236
|
+
${model.error ? `<p class="absolute-voice-profile-comparison__error">${escapeHtml13(model.error)}</p>` : ""}
|
|
5983
6237
|
</section>`;
|
|
5984
6238
|
};
|
|
5985
6239
|
var getVoiceProfileComparisonCSS = () => `.absolute-voice-profile-comparison{border:1px solid #c7d2fe;border-radius:20px;background:#eef2ff;color:#111827;padding:18px;box-shadow:0 18px 40px rgba(79,70,229,.12);font-family:inherit}.absolute-voice-profile-comparison--warning,.absolute-voice-profile-comparison--error{border-color:#fbbf24;background:#fffbeb}.absolute-voice-profile-comparison__header{align-items:start;display:flex;gap:12px;justify-content:space-between}.absolute-voice-profile-comparison__eyebrow{color:#4338ca;font-size:12px;font-weight:800;letter-spacing:.08em;text-transform:uppercase}.absolute-voice-profile-comparison__label{font-size:24px;line-height:1}.absolute-voice-profile-comparison__description,.absolute-voice-profile-comparison__empty{color:#4b5563}.absolute-voice-profile-comparison__profiles{display:grid;gap:12px;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));margin-top:14px}.absolute-voice-profile-comparison__profile{background:#fff;border:1px solid #c7d2fe;border-radius:16px;padding:14px}.absolute-voice-profile-comparison__profile--warn{border-color:#fbbf24}.absolute-voice-profile-comparison__profile--fail{border-color:#f87171}.absolute-voice-profile-comparison__profile header{align-items:center;display:flex;gap:8px;justify-content:space-between}.absolute-voice-profile-comparison__profile header span{border:1px solid currentColor;border-radius:999px;color:#4338ca;font-size:11px;font-weight:900;padding:3px 7px;text-transform:uppercase}.absolute-voice-profile-comparison__profile p{color:#1f2937;font-weight:800;overflow-wrap:anywhere}.absolute-voice-profile-comparison__profile div{display:grid;gap:8px;grid-template-columns:repeat(3,minmax(0,1fr))}.absolute-voice-profile-comparison__profile small{color:#6b7280;display:block;font-size:11px}.absolute-voice-profile-comparison__profile b{display:block}.absolute-voice-profile-comparison__profile em{color:#4b5563;display:block;font-size:13px;margin-top:12px}.absolute-voice-profile-comparison__links{display:flex;flex-wrap:wrap;gap:8px;margin:14px 0 0}.absolute-voice-profile-comparison__links a{border:1px solid #a5b4fc;border-radius:999px;color:#4338ca;font-weight:800;padding:6px 10px;text-decoration:none}.absolute-voice-profile-comparison__error{color:#9f1239;font-weight:700}`;
|
|
@@ -6021,25 +6275,25 @@ var defineVoiceProfileComparisonElement = (tagName = "absolute-voice-profile-com
|
|
|
6021
6275
|
};
|
|
6022
6276
|
|
|
6023
6277
|
// src/react/useVoiceProfileComparison.tsx
|
|
6024
|
-
import { useEffect as
|
|
6278
|
+
import { useEffect as useEffect8, useRef as useRef8, useSyncExternalStore as useSyncExternalStore8 } from "react";
|
|
6025
6279
|
var useVoiceProfileComparison = (path = "/api/voice/real-call-profile-history", options = {}) => {
|
|
6026
|
-
const storeRef =
|
|
6280
|
+
const storeRef = useRef8(null);
|
|
6027
6281
|
if (!storeRef.current) {
|
|
6028
6282
|
storeRef.current = createVoiceProfileComparisonStore(path, options);
|
|
6029
6283
|
}
|
|
6030
6284
|
const store = storeRef.current;
|
|
6031
|
-
|
|
6285
|
+
useEffect8(() => {
|
|
6032
6286
|
store.refresh().catch(() => {});
|
|
6033
6287
|
return () => store.close();
|
|
6034
6288
|
}, [store]);
|
|
6035
6289
|
return {
|
|
6036
|
-
...
|
|
6290
|
+
...useSyncExternalStore8(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
6037
6291
|
refresh: store.refresh
|
|
6038
6292
|
};
|
|
6039
6293
|
};
|
|
6040
6294
|
|
|
6041
6295
|
// src/react/VoiceProfileComparison.tsx
|
|
6042
|
-
import { jsxDEV as
|
|
6296
|
+
import { jsxDEV as jsxDEV8 } from "react/jsx-dev-runtime";
|
|
6043
6297
|
var VoiceProfileComparison = ({
|
|
6044
6298
|
className,
|
|
6045
6299
|
path = "/api/voice/real-call-profile-history",
|
|
@@ -6047,77 +6301,77 @@ var VoiceProfileComparison = ({
|
|
|
6047
6301
|
}) => {
|
|
6048
6302
|
const snapshot = useVoiceProfileComparison(path, options);
|
|
6049
6303
|
const model = createVoiceProfileComparisonViewModel(snapshot, options);
|
|
6050
|
-
return /* @__PURE__ */
|
|
6304
|
+
return /* @__PURE__ */ jsxDEV8("section", {
|
|
6051
6305
|
className: [
|
|
6052
6306
|
"absolute-voice-profile-comparison",
|
|
6053
6307
|
`absolute-voice-profile-comparison--${model.status}`,
|
|
6054
6308
|
className
|
|
6055
6309
|
].filter(Boolean).join(" "),
|
|
6056
6310
|
children: [
|
|
6057
|
-
/* @__PURE__ */
|
|
6311
|
+
/* @__PURE__ */ jsxDEV8("header", {
|
|
6058
6312
|
className: "absolute-voice-profile-comparison__header",
|
|
6059
6313
|
children: [
|
|
6060
|
-
/* @__PURE__ */
|
|
6314
|
+
/* @__PURE__ */ jsxDEV8("span", {
|
|
6061
6315
|
className: "absolute-voice-profile-comparison__eyebrow",
|
|
6062
6316
|
children: model.title
|
|
6063
6317
|
}, undefined, false, undefined, this),
|
|
6064
|
-
/* @__PURE__ */
|
|
6318
|
+
/* @__PURE__ */ jsxDEV8("strong", {
|
|
6065
6319
|
className: "absolute-voice-profile-comparison__label",
|
|
6066
6320
|
children: model.label
|
|
6067
6321
|
}, undefined, false, undefined, this)
|
|
6068
6322
|
]
|
|
6069
6323
|
}, undefined, true, undefined, this),
|
|
6070
|
-
/* @__PURE__ */
|
|
6324
|
+
/* @__PURE__ */ jsxDEV8("p", {
|
|
6071
6325
|
className: "absolute-voice-profile-comparison__description",
|
|
6072
6326
|
children: model.description
|
|
6073
6327
|
}, undefined, false, undefined, this),
|
|
6074
|
-
model.profiles.length ? /* @__PURE__ */
|
|
6328
|
+
model.profiles.length ? /* @__PURE__ */ jsxDEV8("div", {
|
|
6075
6329
|
className: "absolute-voice-profile-comparison__profiles",
|
|
6076
|
-
children: model.profiles.map((profile) => /* @__PURE__ */
|
|
6330
|
+
children: model.profiles.map((profile) => /* @__PURE__ */ jsxDEV8("article", {
|
|
6077
6331
|
className: `absolute-voice-profile-comparison__profile absolute-voice-profile-comparison__profile--${profile.status}`,
|
|
6078
6332
|
children: [
|
|
6079
|
-
/* @__PURE__ */
|
|
6333
|
+
/* @__PURE__ */ jsxDEV8("header", {
|
|
6080
6334
|
children: [
|
|
6081
|
-
/* @__PURE__ */
|
|
6335
|
+
/* @__PURE__ */ jsxDEV8("span", {
|
|
6082
6336
|
children: profile.status
|
|
6083
6337
|
}, undefined, false, undefined, this),
|
|
6084
|
-
/* @__PURE__ */
|
|
6338
|
+
/* @__PURE__ */ jsxDEV8("strong", {
|
|
6085
6339
|
children: profile.label
|
|
6086
6340
|
}, undefined, false, undefined, this)
|
|
6087
6341
|
]
|
|
6088
6342
|
}, undefined, true, undefined, this),
|
|
6089
|
-
/* @__PURE__ */
|
|
6343
|
+
/* @__PURE__ */ jsxDEV8("p", {
|
|
6090
6344
|
children: profile.providerRoutes
|
|
6091
6345
|
}, undefined, false, undefined, this),
|
|
6092
|
-
/* @__PURE__ */
|
|
6093
|
-
children: profile.evidence.map((metric) => /* @__PURE__ */
|
|
6346
|
+
/* @__PURE__ */ jsxDEV8("div", {
|
|
6347
|
+
children: profile.evidence.map((metric) => /* @__PURE__ */ jsxDEV8("span", {
|
|
6094
6348
|
children: [
|
|
6095
|
-
/* @__PURE__ */
|
|
6349
|
+
/* @__PURE__ */ jsxDEV8("small", {
|
|
6096
6350
|
children: metric.label
|
|
6097
6351
|
}, undefined, false, undefined, this),
|
|
6098
|
-
/* @__PURE__ */
|
|
6352
|
+
/* @__PURE__ */ jsxDEV8("b", {
|
|
6099
6353
|
children: metric.value
|
|
6100
6354
|
}, undefined, false, undefined, this)
|
|
6101
6355
|
]
|
|
6102
6356
|
}, metric.label, true, undefined, this))
|
|
6103
6357
|
}, undefined, false, undefined, this),
|
|
6104
|
-
/* @__PURE__ */
|
|
6358
|
+
/* @__PURE__ */ jsxDEV8("em", {
|
|
6105
6359
|
children: profile.nextMove
|
|
6106
6360
|
}, undefined, false, undefined, this)
|
|
6107
6361
|
]
|
|
6108
6362
|
}, profile.profileId, true, undefined, this))
|
|
6109
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
6363
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV8("p", {
|
|
6110
6364
|
className: "absolute-voice-profile-comparison__empty",
|
|
6111
6365
|
children: model.error ?? "Run real-call profile collection to populate profile comparisons."
|
|
6112
6366
|
}, undefined, false, undefined, this),
|
|
6113
|
-
model.links.length ? /* @__PURE__ */
|
|
6367
|
+
model.links.length ? /* @__PURE__ */ jsxDEV8("p", {
|
|
6114
6368
|
className: "absolute-voice-profile-comparison__links",
|
|
6115
|
-
children: model.links.map((link) => /* @__PURE__ */
|
|
6369
|
+
children: model.links.map((link) => /* @__PURE__ */ jsxDEV8("a", {
|
|
6116
6370
|
href: link.href,
|
|
6117
6371
|
children: link.label
|
|
6118
6372
|
}, link.href, false, undefined, this))
|
|
6119
6373
|
}, undefined, false, undefined, this) : null,
|
|
6120
|
-
model.error ? /* @__PURE__ */
|
|
6374
|
+
model.error ? /* @__PURE__ */ jsxDEV8("p", {
|
|
6121
6375
|
className: "absolute-voice-profile-comparison__error",
|
|
6122
6376
|
children: model.error
|
|
6123
6377
|
}, undefined, false, undefined, this) : null
|
|
@@ -6200,29 +6454,29 @@ var createVoiceProfileSwitchRecommendationStore = (path = "/api/voice/profile-sw
|
|
|
6200
6454
|
};
|
|
6201
6455
|
|
|
6202
6456
|
// src/client/profileSwitchRecommendationWidget.ts
|
|
6203
|
-
var
|
|
6204
|
-
var
|
|
6205
|
-
var
|
|
6457
|
+
var DEFAULT_TITLE9 = "Profile Switch Recommendation";
|
|
6458
|
+
var DEFAULT_DESCRIPTION9 = "Compares the current session against measured profile evidence and recommends whether to switch stacks.";
|
|
6459
|
+
var escapeHtml14 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
6206
6460
|
var formatRoute = (routes) => routes ? Object.entries(routes).map(([role, provider]) => `${role}: ${provider}`).join(", ") : "No route";
|
|
6207
6461
|
var renderVoiceProfileSwitchRecommendationHTML = (snapshot, options = {}) => {
|
|
6208
6462
|
const recommendation = snapshot.recommendation;
|
|
6209
6463
|
const status = snapshot.error ? "error" : recommendation ? recommendation.status : snapshot.isLoading ? "loading" : "empty";
|
|
6210
6464
|
const label = snapshot.error ? "Unavailable" : recommendation ? recommendation.status === "switch" ? `Switch to ${recommendation.recommendedProfile?.label ?? recommendation.recommendedProfile?.profileId ?? "recommended profile"}` : recommendation.status === "stay" ? "Keep current profile" : "Needs evidence" : snapshot.isLoading ? "Checking" : "No recommendation";
|
|
6211
6465
|
const body = recommendation ? `<div class="absolute-voice-profile-switch__body">
|
|
6212
|
-
<p><strong>Current:</strong> ${
|
|
6213
|
-
<p><strong>Recommended:</strong> ${
|
|
6214
|
-
<p><strong>Routes:</strong> ${
|
|
6215
|
-
<ul>${recommendation.reasons.map((reason) => `<li>${
|
|
6216
|
-
<em>${
|
|
6217
|
-
</div>` : `<p class="absolute-voice-profile-switch__empty">${
|
|
6218
|
-
return `<section class="absolute-voice-profile-switch absolute-voice-profile-switch--${
|
|
6466
|
+
<p><strong>Current:</strong> ${escapeHtml14(recommendation.currentProfile?.label ?? recommendation.currentProfile?.profileId ?? "Unknown")}</p>
|
|
6467
|
+
<p><strong>Recommended:</strong> ${escapeHtml14(recommendation.recommendedProfile?.label ?? recommendation.recommendedProfile?.profileId ?? "None")}</p>
|
|
6468
|
+
<p><strong>Routes:</strong> ${escapeHtml14(formatRoute(recommendation.recommendedProfile?.providerRoutes))}</p>
|
|
6469
|
+
<ul>${recommendation.reasons.map((reason) => `<li>${escapeHtml14(reason)}</li>`).join("")}</ul>
|
|
6470
|
+
<em>${escapeHtml14(recommendation.nextMove)}</em>
|
|
6471
|
+
</div>` : `<p class="absolute-voice-profile-switch__empty">${escapeHtml14(snapshot.error ?? "Run session traffic to populate a recommendation.")}</p>`;
|
|
6472
|
+
return `<section class="absolute-voice-profile-switch absolute-voice-profile-switch--${escapeHtml14(status)}">
|
|
6219
6473
|
<header class="absolute-voice-profile-switch__header">
|
|
6220
|
-
<span class="absolute-voice-profile-switch__eyebrow">${
|
|
6221
|
-
<strong class="absolute-voice-profile-switch__label">${
|
|
6474
|
+
<span class="absolute-voice-profile-switch__eyebrow">${escapeHtml14(options.title ?? DEFAULT_TITLE9)}</span>
|
|
6475
|
+
<strong class="absolute-voice-profile-switch__label">${escapeHtml14(label)}</strong>
|
|
6222
6476
|
</header>
|
|
6223
|
-
<p class="absolute-voice-profile-switch__description">${
|
|
6477
|
+
<p class="absolute-voice-profile-switch__description">${escapeHtml14(options.description ?? DEFAULT_DESCRIPTION9)}</p>
|
|
6224
6478
|
${body}
|
|
6225
|
-
${snapshot.error ? `<p class="absolute-voice-profile-switch__error">${
|
|
6479
|
+
${snapshot.error ? `<p class="absolute-voice-profile-switch__error">${escapeHtml14(snapshot.error)}</p>` : ""}
|
|
6226
6480
|
</section>`;
|
|
6227
6481
|
};
|
|
6228
6482
|
var getVoiceProfileSwitchRecommendationCSS = () => `.absolute-voice-profile-switch{border:1px solid #fed7aa;border-radius:20px;background:#fff7ed;color:#1c1917;padding:18px;box-shadow:0 18px 40px rgba(234,88,12,.12);font-family:inherit}.absolute-voice-profile-switch--switch{border-color:#fdba74}.absolute-voice-profile-switch--stay{border-color:#86efac;background:#f0fdf4}.absolute-voice-profile-switch--warn,.absolute-voice-profile-switch--error{border-color:#fca5a5;background:#fff1f2}.absolute-voice-profile-switch__header{align-items:start;display:flex;gap:12px;justify-content:space-between}.absolute-voice-profile-switch__eyebrow{color:#c2410c;font-size:12px;font-weight:800;letter-spacing:.08em;text-transform:uppercase}.absolute-voice-profile-switch__label{font-size:24px;line-height:1}.absolute-voice-profile-switch__description,.absolute-voice-profile-switch__body em,.absolute-voice-profile-switch__empty{color:#57534e}.absolute-voice-profile-switch__body{background:#fff;border:1px solid #fed7aa;border-radius:16px;margin-top:14px;padding:14px}.absolute-voice-profile-switch__body p{margin:.35rem 0}.absolute-voice-profile-switch__body ul{margin:.75rem 0;padding-left:1.2rem}.absolute-voice-profile-switch__body em{display:block}.absolute-voice-profile-switch__error{color:#9f1239;font-weight:700}`;
|
|
@@ -6264,25 +6518,25 @@ var defineVoiceProfileSwitchRecommendationElement = (tagName = "absolute-voice-p
|
|
|
6264
6518
|
};
|
|
6265
6519
|
|
|
6266
6520
|
// src/react/useVoiceProfileSwitchRecommendation.tsx
|
|
6267
|
-
import { useEffect as
|
|
6521
|
+
import { useEffect as useEffect9, useRef as useRef9, useSyncExternalStore as useSyncExternalStore9 } from "react";
|
|
6268
6522
|
var useVoiceProfileSwitchRecommendation = (path = "/api/voice/profile-switch-recommendation", options = {}) => {
|
|
6269
|
-
const storeRef =
|
|
6523
|
+
const storeRef = useRef9(null);
|
|
6270
6524
|
if (!storeRef.current) {
|
|
6271
6525
|
storeRef.current = createVoiceProfileSwitchRecommendationStore(path, options);
|
|
6272
6526
|
}
|
|
6273
6527
|
const store = storeRef.current;
|
|
6274
|
-
|
|
6528
|
+
useEffect9(() => {
|
|
6275
6529
|
store.refresh().catch(() => {});
|
|
6276
6530
|
return () => store.close();
|
|
6277
6531
|
}, [store]);
|
|
6278
6532
|
return {
|
|
6279
|
-
...
|
|
6533
|
+
...useSyncExternalStore9(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
6280
6534
|
refresh: store.refresh
|
|
6281
6535
|
};
|
|
6282
6536
|
};
|
|
6283
6537
|
|
|
6284
6538
|
// src/react/VoiceProfileSwitchRecommendation.tsx
|
|
6285
|
-
import { jsxDEV as
|
|
6539
|
+
import { jsxDEV as jsxDEV9 } from "react/jsx-dev-runtime";
|
|
6286
6540
|
var VoiceProfileSwitchRecommendation = ({
|
|
6287
6541
|
className,
|
|
6288
6542
|
path = "/api/voice/profile-switch-recommendation",
|
|
@@ -6290,7 +6544,7 @@ var VoiceProfileSwitchRecommendation = ({
|
|
|
6290
6544
|
}) => {
|
|
6291
6545
|
const snapshot = useVoiceProfileSwitchRecommendation(path, options);
|
|
6292
6546
|
const html = renderVoiceProfileSwitchRecommendationHTML(snapshot, options);
|
|
6293
|
-
return /* @__PURE__ */
|
|
6547
|
+
return /* @__PURE__ */ jsxDEV9("div", {
|
|
6294
6548
|
className,
|
|
6295
6549
|
dangerouslySetInnerHTML: { __html: html }
|
|
6296
6550
|
}, undefined, false, undefined, this);
|
|
@@ -6371,13 +6625,13 @@ var createVoiceReadinessFailuresStore = (path = "/api/production-readiness", opt
|
|
|
6371
6625
|
};
|
|
6372
6626
|
|
|
6373
6627
|
// src/client/readinessFailuresWidget.ts
|
|
6374
|
-
var
|
|
6375
|
-
var
|
|
6628
|
+
var DEFAULT_TITLE10 = "Readiness Gate Explanations";
|
|
6629
|
+
var DEFAULT_DESCRIPTION10 = "Structured reasons for calibrated production-readiness warnings and failures.";
|
|
6376
6630
|
var DEFAULT_LINKS4 = [
|
|
6377
6631
|
{ href: "/production-readiness", label: "Readiness page" },
|
|
6378
6632
|
{ href: "/voice/slo-readiness-thresholds", label: "Gate thresholds" }
|
|
6379
6633
|
];
|
|
6380
|
-
var
|
|
6634
|
+
var escapeHtml15 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
6381
6635
|
var formatExplanationValue = (value, unit) => {
|
|
6382
6636
|
if (value === undefined || value === null) {
|
|
6383
6637
|
return "n/a";
|
|
@@ -6405,36 +6659,36 @@ var createVoiceReadinessFailuresViewModel = (snapshot, options = {}) => {
|
|
|
6405
6659
|
const failures = snapshot.report?.checks.map(toFailureView).filter((value) => !!value) ?? [];
|
|
6406
6660
|
const hasOpenIssues = failures.length > 0;
|
|
6407
6661
|
return {
|
|
6408
|
-
description: options.description ??
|
|
6662
|
+
description: options.description ?? DEFAULT_DESCRIPTION10,
|
|
6409
6663
|
error: snapshot.error,
|
|
6410
6664
|
failures,
|
|
6411
6665
|
isLoading: snapshot.isLoading,
|
|
6412
6666
|
label: snapshot.error ? "Unavailable" : snapshot.report ? hasOpenIssues ? `${failures.length} calibrated gate issue(s)` : "No calibrated gate issues" : snapshot.isLoading ? "Checking" : "No readiness report",
|
|
6413
6667
|
links: options.links ?? DEFAULT_LINKS4,
|
|
6414
6668
|
status: snapshot.error ? "error" : snapshot.report ? hasOpenIssues ? "warning" : "ready" : snapshot.isLoading ? "loading" : "empty",
|
|
6415
|
-
title: options.title ??
|
|
6669
|
+
title: options.title ?? DEFAULT_TITLE10,
|
|
6416
6670
|
updatedAt: snapshot.updatedAt
|
|
6417
6671
|
};
|
|
6418
6672
|
};
|
|
6419
6673
|
var renderVoiceReadinessFailuresHTML = (snapshot, options = {}) => {
|
|
6420
6674
|
const model = createVoiceReadinessFailuresViewModel(snapshot, options);
|
|
6421
|
-
const failures = model.failures.length ? `<div class="absolute-voice-readiness-failures__items">${model.failures.map((failure) => `<article class="absolute-voice-readiness-failures__item absolute-voice-readiness-failures__item--${
|
|
6422
|
-
<span>${
|
|
6423
|
-
<strong>${
|
|
6424
|
-
<p>Observed ${
|
|
6425
|
-
<p>${
|
|
6426
|
-
<p class="absolute-voice-readiness-failures__links">${failure.evidenceHref ? `<a href="${
|
|
6427
|
-
</article>`).join("")}</div>` : `<p class="absolute-voice-readiness-failures__empty">${model.error ?
|
|
6428
|
-
const links = model.links.length ? `<p class="absolute-voice-readiness-failures__links">${model.links.map((link) => `<a href="${
|
|
6429
|
-
return `<section class="absolute-voice-readiness-failures absolute-voice-readiness-failures--${
|
|
6675
|
+
const failures = model.failures.length ? `<div class="absolute-voice-readiness-failures__items">${model.failures.map((failure) => `<article class="absolute-voice-readiness-failures__item absolute-voice-readiness-failures__item--${escapeHtml15(failure.status)}">
|
|
6676
|
+
<span>${escapeHtml15(failure.status.toUpperCase())}</span>
|
|
6677
|
+
<strong>${escapeHtml15(failure.label)}</strong>
|
|
6678
|
+
<p>Observed ${escapeHtml15(failure.observed)} against ${escapeHtml15(failure.thresholdLabel)} ${escapeHtml15(failure.threshold)}.</p>
|
|
6679
|
+
<p>${escapeHtml15(failure.remediation)}</p>
|
|
6680
|
+
<p class="absolute-voice-readiness-failures__links">${failure.evidenceHref ? `<a href="${escapeHtml15(failure.evidenceHref)}">Evidence</a>` : ""}${failure.sourceHref ? `<a href="${escapeHtml15(failure.sourceHref)}">Threshold source</a>` : ""}</p>
|
|
6681
|
+
</article>`).join("")}</div>` : `<p class="absolute-voice-readiness-failures__empty">${model.error ? escapeHtml15(model.error) : "No calibrated readiness gate explanations are open."}</p>`;
|
|
6682
|
+
const links = model.links.length ? `<p class="absolute-voice-readiness-failures__links">${model.links.map((link) => `<a href="${escapeHtml15(link.href)}">${escapeHtml15(link.label)}</a>`).join("")}</p>` : "";
|
|
6683
|
+
return `<section class="absolute-voice-readiness-failures absolute-voice-readiness-failures--${escapeHtml15(model.status)}">
|
|
6430
6684
|
<header class="absolute-voice-readiness-failures__header">
|
|
6431
|
-
<span class="absolute-voice-readiness-failures__eyebrow">${
|
|
6432
|
-
<strong class="absolute-voice-readiness-failures__label">${
|
|
6685
|
+
<span class="absolute-voice-readiness-failures__eyebrow">${escapeHtml15(model.title)}</span>
|
|
6686
|
+
<strong class="absolute-voice-readiness-failures__label">${escapeHtml15(model.label)}</strong>
|
|
6433
6687
|
</header>
|
|
6434
|
-
<p class="absolute-voice-readiness-failures__description">${
|
|
6688
|
+
<p class="absolute-voice-readiness-failures__description">${escapeHtml15(model.description)}</p>
|
|
6435
6689
|
${failures}
|
|
6436
6690
|
${links}
|
|
6437
|
-
${model.error ? `<p class="absolute-voice-readiness-failures__error">${
|
|
6691
|
+
${model.error ? `<p class="absolute-voice-readiness-failures__error">${escapeHtml15(model.error)}</p>` : ""}
|
|
6438
6692
|
</section>`;
|
|
6439
6693
|
};
|
|
6440
6694
|
var getVoiceReadinessFailuresCSS = () => `.absolute-voice-readiness-failures{border:1px solid #fed7aa;border-radius:20px;background:#fff7ed;color:#1c1917;padding:18px;box-shadow:0 18px 40px rgba(234,88,12,.12);font-family:inherit}.absolute-voice-readiness-failures--ready{border-color:#86efac;background:#f0fdf4}.absolute-voice-readiness-failures--error{border-color:#fda4af;background:#fff1f2}.absolute-voice-readiness-failures__header{align-items:start;display:flex;gap:12px;justify-content:space-between}.absolute-voice-readiness-failures__eyebrow{color:#9a3412;font-size:12px;font-weight:800;letter-spacing:.08em;text-transform:uppercase}.absolute-voice-readiness-failures__label{font-size:24px;line-height:1}.absolute-voice-readiness-failures__description,.absolute-voice-readiness-failures__empty{color:#57534e}.absolute-voice-readiness-failures__items{display:grid;gap:10px;margin-top:14px}.absolute-voice-readiness-failures__item{background:white;border:1px solid #fed7aa;border-radius:16px;padding:12px}.absolute-voice-readiness-failures__item--fail{border-color:#fb7185}.absolute-voice-readiness-failures__item span{color:#9a3412;display:block;font-size:12px;font-weight:900;text-transform:uppercase}.absolute-voice-readiness-failures__item strong{display:block;font-size:18px;margin-top:4px}.absolute-voice-readiness-failures__item p{margin:.45rem 0 0}.absolute-voice-readiness-failures__links{display:flex;flex-wrap:wrap;gap:8px;margin:14px 0 0}.absolute-voice-readiness-failures__links a{border:1px solid #fdba74;border-radius:999px;color:#9a3412;font-weight:800;padding:6px 10px;text-decoration:none}.absolute-voice-readiness-failures__error{color:#9f1239;font-weight:700}`;
|
|
@@ -6475,25 +6729,25 @@ var defineVoiceReadinessFailuresElement = (tagName = "absolute-voice-readiness-f
|
|
|
6475
6729
|
};
|
|
6476
6730
|
|
|
6477
6731
|
// src/react/useVoiceReadinessFailures.tsx
|
|
6478
|
-
import { useEffect as
|
|
6732
|
+
import { useEffect as useEffect10, useRef as useRef10, useSyncExternalStore as useSyncExternalStore10 } from "react";
|
|
6479
6733
|
var useVoiceReadinessFailures = (path = "/api/production-readiness", options = {}) => {
|
|
6480
|
-
const storeRef =
|
|
6734
|
+
const storeRef = useRef10(null);
|
|
6481
6735
|
if (!storeRef.current) {
|
|
6482
6736
|
storeRef.current = createVoiceReadinessFailuresStore(path, options);
|
|
6483
6737
|
}
|
|
6484
6738
|
const store = storeRef.current;
|
|
6485
|
-
|
|
6739
|
+
useEffect10(() => {
|
|
6486
6740
|
store.refresh().catch(() => {});
|
|
6487
6741
|
return () => store.close();
|
|
6488
6742
|
}, [store]);
|
|
6489
6743
|
return {
|
|
6490
|
-
...
|
|
6744
|
+
...useSyncExternalStore10(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
6491
6745
|
refresh: store.refresh
|
|
6492
6746
|
};
|
|
6493
6747
|
};
|
|
6494
6748
|
|
|
6495
6749
|
// src/react/VoiceReadinessFailures.tsx
|
|
6496
|
-
import { jsxDEV as
|
|
6750
|
+
import { jsxDEV as jsxDEV10 } from "react/jsx-dev-runtime";
|
|
6497
6751
|
var VoiceReadinessFailures = ({
|
|
6498
6752
|
className,
|
|
6499
6753
|
path = "/api/production-readiness",
|
|
@@ -6501,42 +6755,42 @@ var VoiceReadinessFailures = ({
|
|
|
6501
6755
|
}) => {
|
|
6502
6756
|
const snapshot = useVoiceReadinessFailures(path, options);
|
|
6503
6757
|
const model = createVoiceReadinessFailuresViewModel(snapshot, options);
|
|
6504
|
-
return /* @__PURE__ */
|
|
6758
|
+
return /* @__PURE__ */ jsxDEV10("section", {
|
|
6505
6759
|
className: [
|
|
6506
6760
|
"absolute-voice-readiness-failures",
|
|
6507
6761
|
`absolute-voice-readiness-failures--${model.status}`,
|
|
6508
6762
|
className
|
|
6509
6763
|
].filter(Boolean).join(" "),
|
|
6510
6764
|
children: [
|
|
6511
|
-
/* @__PURE__ */
|
|
6765
|
+
/* @__PURE__ */ jsxDEV10("header", {
|
|
6512
6766
|
className: "absolute-voice-readiness-failures__header",
|
|
6513
6767
|
children: [
|
|
6514
|
-
/* @__PURE__ */
|
|
6768
|
+
/* @__PURE__ */ jsxDEV10("span", {
|
|
6515
6769
|
className: "absolute-voice-readiness-failures__eyebrow",
|
|
6516
6770
|
children: model.title
|
|
6517
6771
|
}, undefined, false, undefined, this),
|
|
6518
|
-
/* @__PURE__ */
|
|
6772
|
+
/* @__PURE__ */ jsxDEV10("strong", {
|
|
6519
6773
|
className: "absolute-voice-readiness-failures__label",
|
|
6520
6774
|
children: model.label
|
|
6521
6775
|
}, undefined, false, undefined, this)
|
|
6522
6776
|
]
|
|
6523
6777
|
}, undefined, true, undefined, this),
|
|
6524
|
-
/* @__PURE__ */
|
|
6778
|
+
/* @__PURE__ */ jsxDEV10("p", {
|
|
6525
6779
|
className: "absolute-voice-readiness-failures__description",
|
|
6526
6780
|
children: model.description
|
|
6527
6781
|
}, undefined, false, undefined, this),
|
|
6528
|
-
model.failures.length ? /* @__PURE__ */
|
|
6782
|
+
model.failures.length ? /* @__PURE__ */ jsxDEV10("div", {
|
|
6529
6783
|
className: "absolute-voice-readiness-failures__items",
|
|
6530
|
-
children: model.failures.map((failure) => /* @__PURE__ */
|
|
6784
|
+
children: model.failures.map((failure) => /* @__PURE__ */ jsxDEV10("article", {
|
|
6531
6785
|
className: `absolute-voice-readiness-failures__item absolute-voice-readiness-failures__item--${failure.status}`,
|
|
6532
6786
|
children: [
|
|
6533
|
-
/* @__PURE__ */
|
|
6787
|
+
/* @__PURE__ */ jsxDEV10("span", {
|
|
6534
6788
|
children: failure.status.toUpperCase()
|
|
6535
6789
|
}, undefined, false, undefined, this),
|
|
6536
|
-
/* @__PURE__ */
|
|
6790
|
+
/* @__PURE__ */ jsxDEV10("strong", {
|
|
6537
6791
|
children: failure.label
|
|
6538
6792
|
}, undefined, false, undefined, this),
|
|
6539
|
-
/* @__PURE__ */
|
|
6793
|
+
/* @__PURE__ */ jsxDEV10("p", {
|
|
6540
6794
|
children: [
|
|
6541
6795
|
"Observed ",
|
|
6542
6796
|
failure.observed,
|
|
@@ -6547,17 +6801,17 @@ var VoiceReadinessFailures = ({
|
|
|
6547
6801
|
"."
|
|
6548
6802
|
]
|
|
6549
6803
|
}, undefined, true, undefined, this),
|
|
6550
|
-
/* @__PURE__ */
|
|
6804
|
+
/* @__PURE__ */ jsxDEV10("p", {
|
|
6551
6805
|
children: failure.remediation
|
|
6552
6806
|
}, undefined, false, undefined, this),
|
|
6553
|
-
/* @__PURE__ */
|
|
6807
|
+
/* @__PURE__ */ jsxDEV10("p", {
|
|
6554
6808
|
className: "absolute-voice-readiness-failures__links",
|
|
6555
6809
|
children: [
|
|
6556
|
-
failure.evidenceHref ? /* @__PURE__ */
|
|
6810
|
+
failure.evidenceHref ? /* @__PURE__ */ jsxDEV10("a", {
|
|
6557
6811
|
href: failure.evidenceHref,
|
|
6558
6812
|
children: "Evidence"
|
|
6559
6813
|
}, undefined, false, undefined, this) : null,
|
|
6560
|
-
failure.sourceHref ? /* @__PURE__ */
|
|
6814
|
+
failure.sourceHref ? /* @__PURE__ */ jsxDEV10("a", {
|
|
6561
6815
|
href: failure.sourceHref,
|
|
6562
6816
|
children: "Threshold source"
|
|
6563
6817
|
}, undefined, false, undefined, this) : null
|
|
@@ -6565,18 +6819,18 @@ var VoiceReadinessFailures = ({
|
|
|
6565
6819
|
}, undefined, true, undefined, this)
|
|
6566
6820
|
]
|
|
6567
6821
|
}, failure.label, true, undefined, this))
|
|
6568
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
6822
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV10("p", {
|
|
6569
6823
|
className: "absolute-voice-readiness-failures__empty",
|
|
6570
6824
|
children: model.error ?? "No calibrated readiness gate explanations are open."
|
|
6571
6825
|
}, undefined, false, undefined, this),
|
|
6572
|
-
model.links.length ? /* @__PURE__ */
|
|
6826
|
+
model.links.length ? /* @__PURE__ */ jsxDEV10("p", {
|
|
6573
6827
|
className: "absolute-voice-readiness-failures__links",
|
|
6574
|
-
children: model.links.map((link) => /* @__PURE__ */
|
|
6828
|
+
children: model.links.map((link) => /* @__PURE__ */ jsxDEV10("a", {
|
|
6575
6829
|
href: link.href,
|
|
6576
6830
|
children: link.label
|
|
6577
6831
|
}, link.href, false, undefined, this))
|
|
6578
6832
|
}, undefined, false, undefined, this) : null,
|
|
6579
|
-
model.error ? /* @__PURE__ */
|
|
6833
|
+
model.error ? /* @__PURE__ */ jsxDEV10("p", {
|
|
6580
6834
|
className: "absolute-voice-readiness-failures__error",
|
|
6581
6835
|
children: model.error
|
|
6582
6836
|
}, undefined, false, undefined, this) : null
|
|
@@ -6663,7 +6917,7 @@ var createVoiceProviderSimulationControlsStore = (options) => {
|
|
|
6663
6917
|
};
|
|
6664
6918
|
|
|
6665
6919
|
// src/client/providerSimulationControlsWidget.ts
|
|
6666
|
-
var
|
|
6920
|
+
var escapeHtml16 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
6667
6921
|
var formatKind = (kind) => (kind ?? "stt").toUpperCase();
|
|
6668
6922
|
var createVoiceProviderSimulationControlsViewModel = (snapshot, options) => {
|
|
6669
6923
|
const configuredProviders = options.providers.filter((provider) => provider.configured !== false);
|
|
@@ -6683,18 +6937,18 @@ var createVoiceProviderSimulationControlsViewModel = (snapshot, options) => {
|
|
|
6683
6937
|
};
|
|
6684
6938
|
var renderVoiceProviderSimulationControlsHTML = (snapshot, options) => {
|
|
6685
6939
|
const model = createVoiceProviderSimulationControlsViewModel(snapshot, options);
|
|
6686
|
-
const failureButtons = model.failureProviders.map((provider) => `<button type="button" data-voice-provider-fail="${
|
|
6687
|
-
const recoveryButtons = model.providers.map((provider) => `<button type="button" data-voice-provider-recover="${
|
|
6940
|
+
const failureButtons = model.failureProviders.map((provider) => `<button type="button" data-voice-provider-fail="${escapeHtml16(provider.provider)}"${!model.canSimulateFailure || snapshot.isRunning ? " disabled" : ""}>Simulate ${escapeHtml16(provider.provider)} ${escapeHtml16(formatKind(options.kind))} failure</button>`).join("");
|
|
6941
|
+
const recoveryButtons = model.providers.map((provider) => `<button type="button" data-voice-provider-recover="${escapeHtml16(provider.provider)}"${snapshot.isRunning ? " disabled" : ""}>Mark ${escapeHtml16(provider.provider)} recovered</button>`).join("");
|
|
6688
6942
|
return `<section class="absolute-voice-provider-simulation absolute-voice-provider-simulation--${snapshot.error ? "error" : snapshot.isRunning ? "running" : "ready"}">
|
|
6689
6943
|
<header class="absolute-voice-provider-simulation__header">
|
|
6690
|
-
<span class="absolute-voice-provider-simulation__eyebrow">${
|
|
6691
|
-
<strong class="absolute-voice-provider-simulation__label">${
|
|
6944
|
+
<span class="absolute-voice-provider-simulation__eyebrow">${escapeHtml16(model.title)}</span>
|
|
6945
|
+
<strong class="absolute-voice-provider-simulation__label">${escapeHtml16(model.label)}</strong>
|
|
6692
6946
|
</header>
|
|
6693
|
-
<p class="absolute-voice-provider-simulation__description">${
|
|
6694
|
-
${model.canSimulateFailure ? "" : `<p class="absolute-voice-provider-simulation__empty">${
|
|
6947
|
+
<p class="absolute-voice-provider-simulation__description">${escapeHtml16(model.description)}</p>
|
|
6948
|
+
${model.canSimulateFailure ? "" : `<p class="absolute-voice-provider-simulation__empty">${escapeHtml16(options.fallbackRequiredMessage ?? "Configure fallback providers before simulating failure.")}</p>`}
|
|
6695
6949
|
<div class="absolute-voice-provider-simulation__actions">${failureButtons}${recoveryButtons}</div>
|
|
6696
|
-
${snapshot.error ? `<p class="absolute-voice-provider-simulation__error">${
|
|
6697
|
-
${model.resultText ? `<pre class="absolute-voice-provider-simulation__result">${
|
|
6950
|
+
${snapshot.error ? `<p class="absolute-voice-provider-simulation__error">${escapeHtml16(snapshot.error)}</p>` : ""}
|
|
6951
|
+
${model.resultText ? `<pre class="absolute-voice-provider-simulation__result">${escapeHtml16(model.resultText)}</pre>` : ""}
|
|
6698
6952
|
</section>`;
|
|
6699
6953
|
};
|
|
6700
6954
|
var bindVoiceProviderSimulationControls = (element, store) => {
|
|
@@ -6760,22 +7014,22 @@ var defineVoiceProviderSimulationControlsElement = (tagName = "absolute-voice-pr
|
|
|
6760
7014
|
};
|
|
6761
7015
|
|
|
6762
7016
|
// src/react/useVoiceProviderSimulationControls.tsx
|
|
6763
|
-
import { useEffect as
|
|
7017
|
+
import { useEffect as useEffect11, useRef as useRef11, useSyncExternalStore as useSyncExternalStore11 } from "react";
|
|
6764
7018
|
var useVoiceProviderSimulationControls = (options) => {
|
|
6765
|
-
const storeRef =
|
|
7019
|
+
const storeRef = useRef11(null);
|
|
6766
7020
|
if (!storeRef.current) {
|
|
6767
7021
|
storeRef.current = createVoiceProviderSimulationControlsStore(options);
|
|
6768
7022
|
}
|
|
6769
7023
|
const store = storeRef.current;
|
|
6770
|
-
|
|
7024
|
+
useEffect11(() => () => store.close(), [store]);
|
|
6771
7025
|
return {
|
|
6772
|
-
...
|
|
7026
|
+
...useSyncExternalStore11(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
6773
7027
|
run: store.run
|
|
6774
7028
|
};
|
|
6775
7029
|
};
|
|
6776
7030
|
|
|
6777
7031
|
// src/react/VoiceProviderSimulationControls.tsx
|
|
6778
|
-
import { jsxDEV as
|
|
7032
|
+
import { jsxDEV as jsxDEV11 } from "react/jsx-dev-runtime";
|
|
6779
7033
|
var VoiceProviderSimulationControls = ({
|
|
6780
7034
|
className,
|
|
6781
7035
|
...options
|
|
@@ -6785,38 +7039,38 @@ var VoiceProviderSimulationControls = ({
|
|
|
6785
7039
|
const run = (provider, mode) => {
|
|
6786
7040
|
snapshot.run(provider, mode).catch(() => {});
|
|
6787
7041
|
};
|
|
6788
|
-
return /* @__PURE__ */
|
|
7042
|
+
return /* @__PURE__ */ jsxDEV11("section", {
|
|
6789
7043
|
className: [
|
|
6790
7044
|
"absolute-voice-provider-simulation",
|
|
6791
7045
|
`absolute-voice-provider-simulation--${snapshot.error ? "error" : snapshot.isRunning ? "running" : "ready"}`,
|
|
6792
7046
|
className
|
|
6793
7047
|
].filter(Boolean).join(" "),
|
|
6794
7048
|
children: [
|
|
6795
|
-
/* @__PURE__ */
|
|
7049
|
+
/* @__PURE__ */ jsxDEV11("header", {
|
|
6796
7050
|
className: "absolute-voice-provider-simulation__header",
|
|
6797
7051
|
children: [
|
|
6798
|
-
/* @__PURE__ */
|
|
7052
|
+
/* @__PURE__ */ jsxDEV11("span", {
|
|
6799
7053
|
className: "absolute-voice-provider-simulation__eyebrow",
|
|
6800
7054
|
children: model.title
|
|
6801
7055
|
}, undefined, false, undefined, this),
|
|
6802
|
-
/* @__PURE__ */
|
|
7056
|
+
/* @__PURE__ */ jsxDEV11("strong", {
|
|
6803
7057
|
className: "absolute-voice-provider-simulation__label",
|
|
6804
7058
|
children: model.label
|
|
6805
7059
|
}, undefined, false, undefined, this)
|
|
6806
7060
|
]
|
|
6807
7061
|
}, undefined, true, undefined, this),
|
|
6808
|
-
/* @__PURE__ */
|
|
7062
|
+
/* @__PURE__ */ jsxDEV11("p", {
|
|
6809
7063
|
className: "absolute-voice-provider-simulation__description",
|
|
6810
7064
|
children: model.description
|
|
6811
7065
|
}, undefined, false, undefined, this),
|
|
6812
|
-
model.canSimulateFailure ? null : /* @__PURE__ */
|
|
7066
|
+
model.canSimulateFailure ? null : /* @__PURE__ */ jsxDEV11("p", {
|
|
6813
7067
|
className: "absolute-voice-provider-simulation__empty",
|
|
6814
7068
|
children: options.fallbackRequiredMessage ?? "Configure fallback providers before simulating failure."
|
|
6815
7069
|
}, undefined, false, undefined, this),
|
|
6816
|
-
/* @__PURE__ */
|
|
7070
|
+
/* @__PURE__ */ jsxDEV11("div", {
|
|
6817
7071
|
className: "absolute-voice-provider-simulation__actions",
|
|
6818
7072
|
children: [
|
|
6819
|
-
model.failureProviders.map((provider) => /* @__PURE__ */
|
|
7073
|
+
model.failureProviders.map((provider) => /* @__PURE__ */ jsxDEV11("button", {
|
|
6820
7074
|
disabled: !model.canSimulateFailure || snapshot.isRunning,
|
|
6821
7075
|
onClick: () => run(provider.provider, "failure"),
|
|
6822
7076
|
type: "button",
|
|
@@ -6829,7 +7083,7 @@ var VoiceProviderSimulationControls = ({
|
|
|
6829
7083
|
"failure"
|
|
6830
7084
|
]
|
|
6831
7085
|
}, `fail-${provider.provider}`, true, undefined, this)),
|
|
6832
|
-
model.providers.map((provider) => /* @__PURE__ */
|
|
7086
|
+
model.providers.map((provider) => /* @__PURE__ */ jsxDEV11("button", {
|
|
6833
7087
|
disabled: snapshot.isRunning,
|
|
6834
7088
|
onClick: () => run(provider.provider, "recovery"),
|
|
6835
7089
|
type: "button",
|
|
@@ -6841,11 +7095,11 @@ var VoiceProviderSimulationControls = ({
|
|
|
6841
7095
|
}, `recover-${provider.provider}`, true, undefined, this))
|
|
6842
7096
|
]
|
|
6843
7097
|
}, undefined, true, undefined, this),
|
|
6844
|
-
snapshot.error ? /* @__PURE__ */
|
|
7098
|
+
snapshot.error ? /* @__PURE__ */ jsxDEV11("p", {
|
|
6845
7099
|
className: "absolute-voice-provider-simulation__error",
|
|
6846
7100
|
children: snapshot.error
|
|
6847
7101
|
}, undefined, false, undefined, this) : null,
|
|
6848
|
-
model.resultText ? /* @__PURE__ */
|
|
7102
|
+
model.resultText ? /* @__PURE__ */ jsxDEV11("pre", {
|
|
6849
7103
|
className: "absolute-voice-provider-simulation__result",
|
|
6850
7104
|
children: model.resultText
|
|
6851
7105
|
}, undefined, false, undefined, this) : null
|
|
@@ -6853,7 +7107,7 @@ var VoiceProviderSimulationControls = ({
|
|
|
6853
7107
|
}, undefined, true, undefined, this);
|
|
6854
7108
|
};
|
|
6855
7109
|
// src/react/useVoiceProviderCapabilities.tsx
|
|
6856
|
-
import { useEffect as
|
|
7110
|
+
import { useEffect as useEffect12, useRef as useRef12, useSyncExternalStore as useSyncExternalStore12 } from "react";
|
|
6857
7111
|
|
|
6858
7112
|
// src/client/providerCapabilities.ts
|
|
6859
7113
|
var fetchVoiceProviderCapabilities = async (path = "/api/provider-capabilities", options = {}) => {
|
|
@@ -6936,25 +7190,25 @@ var createVoiceProviderCapabilitiesStore = (path = "/api/provider-capabilities",
|
|
|
6936
7190
|
|
|
6937
7191
|
// src/react/useVoiceProviderCapabilities.tsx
|
|
6938
7192
|
var useVoiceProviderCapabilities = (path = "/api/provider-capabilities", options = {}) => {
|
|
6939
|
-
const storeRef =
|
|
7193
|
+
const storeRef = useRef12(null);
|
|
6940
7194
|
if (!storeRef.current) {
|
|
6941
7195
|
storeRef.current = createVoiceProviderCapabilitiesStore(path, options);
|
|
6942
7196
|
}
|
|
6943
7197
|
const store = storeRef.current;
|
|
6944
|
-
|
|
7198
|
+
useEffect12(() => {
|
|
6945
7199
|
store.refresh().catch(() => {});
|
|
6946
7200
|
return () => store.close();
|
|
6947
7201
|
}, [store]);
|
|
6948
7202
|
return {
|
|
6949
|
-
...
|
|
7203
|
+
...useSyncExternalStore12(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
6950
7204
|
refresh: store.refresh
|
|
6951
7205
|
};
|
|
6952
7206
|
};
|
|
6953
7207
|
|
|
6954
7208
|
// src/client/providerCapabilitiesWidget.ts
|
|
6955
|
-
var
|
|
6956
|
-
var
|
|
6957
|
-
var
|
|
7209
|
+
var DEFAULT_TITLE11 = "Provider Capabilities";
|
|
7210
|
+
var DEFAULT_DESCRIPTION11 = "Configured, selected, and healthy voice providers for this deployment.";
|
|
7211
|
+
var escapeHtml17 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
6958
7212
|
var formatProvider = (provider) => provider.split(/[-_\s]+/).filter(Boolean).map((part) => `${part[0]?.toUpperCase() ?? ""}${part.slice(1)}`).join(" ") || provider;
|
|
6959
7213
|
var formatKind2 = (kind) => kind.toUpperCase();
|
|
6960
7214
|
var formatStatus3 = (status) => status.split("-").map((part) => `${part[0]?.toUpperCase() ?? ""}${part.slice(1)}`).join(" ");
|
|
@@ -6998,36 +7252,36 @@ var createVoiceProviderCapabilitiesViewModel = (snapshot, options = {}) => {
|
|
|
6998
7252
|
const selectedCount = snapshot.report?.selected ?? capabilities.filter((capability) => capability.selected).length;
|
|
6999
7253
|
return {
|
|
7000
7254
|
capabilities,
|
|
7001
|
-
description: options.description ??
|
|
7255
|
+
description: options.description ?? DEFAULT_DESCRIPTION11,
|
|
7002
7256
|
error: snapshot.error,
|
|
7003
7257
|
isLoading: snapshot.isLoading,
|
|
7004
7258
|
label: snapshot.error ? "Unavailable" : capabilities.length ? warningCount > 0 ? `${warningCount} needs attention` : `${selectedCount} selected` : snapshot.isLoading ? "Checking" : "No capabilities",
|
|
7005
7259
|
status: snapshot.error ? "error" : capabilities.length ? warningCount > 0 ? "warning" : "ready" : snapshot.isLoading ? "loading" : "empty",
|
|
7006
|
-
title: options.title ??
|
|
7260
|
+
title: options.title ?? DEFAULT_TITLE11,
|
|
7007
7261
|
updatedAt: snapshot.updatedAt
|
|
7008
7262
|
};
|
|
7009
7263
|
};
|
|
7010
7264
|
var renderVoiceProviderCapabilitiesHTML = (snapshot, options = {}) => {
|
|
7011
7265
|
const model = createVoiceProviderCapabilitiesViewModel(snapshot, options);
|
|
7012
|
-
const capabilities = model.capabilities.length ? `<div class="absolute-voice-provider-capabilities__providers">${model.capabilities.map((capability) => `<article class="absolute-voice-provider-capabilities__provider absolute-voice-provider-capabilities__provider--${
|
|
7266
|
+
const capabilities = model.capabilities.length ? `<div class="absolute-voice-provider-capabilities__providers">${model.capabilities.map((capability) => `<article class="absolute-voice-provider-capabilities__provider absolute-voice-provider-capabilities__provider--${escapeHtml17(capability.status)}">
|
|
7013
7267
|
<header>
|
|
7014
|
-
<strong>${
|
|
7015
|
-
<span>${
|
|
7268
|
+
<strong>${escapeHtml17(capability.label)}</strong>
|
|
7269
|
+
<span>${escapeHtml17(formatStatus3(capability.status))}</span>
|
|
7016
7270
|
</header>
|
|
7017
|
-
<p>${
|
|
7271
|
+
<p>${escapeHtml17(capability.detail)}</p>
|
|
7018
7272
|
<dl>${capability.rows.map((row) => `<div>
|
|
7019
|
-
<dt>${
|
|
7020
|
-
<dd>${
|
|
7273
|
+
<dt>${escapeHtml17(row.label)}</dt>
|
|
7274
|
+
<dd>${escapeHtml17(row.value)}</dd>
|
|
7021
7275
|
</div>`).join("")}</dl>
|
|
7022
7276
|
</article>`).join("")}</div>` : '<p class="absolute-voice-provider-capabilities__empty">Configure provider capabilities to see deployment coverage.</p>';
|
|
7023
|
-
return `<section class="absolute-voice-provider-capabilities absolute-voice-provider-capabilities--${
|
|
7277
|
+
return `<section class="absolute-voice-provider-capabilities absolute-voice-provider-capabilities--${escapeHtml17(model.status)}">
|
|
7024
7278
|
<header class="absolute-voice-provider-capabilities__header">
|
|
7025
|
-
<span class="absolute-voice-provider-capabilities__eyebrow">${
|
|
7026
|
-
<strong class="absolute-voice-provider-capabilities__label">${
|
|
7279
|
+
<span class="absolute-voice-provider-capabilities__eyebrow">${escapeHtml17(model.title)}</span>
|
|
7280
|
+
<strong class="absolute-voice-provider-capabilities__label">${escapeHtml17(model.label)}</strong>
|
|
7027
7281
|
</header>
|
|
7028
|
-
<p class="absolute-voice-provider-capabilities__description">${
|
|
7282
|
+
<p class="absolute-voice-provider-capabilities__description">${escapeHtml17(model.description)}</p>
|
|
7029
7283
|
${capabilities}
|
|
7030
|
-
${model.error ? `<p class="absolute-voice-provider-capabilities__error">${
|
|
7284
|
+
${model.error ? `<p class="absolute-voice-provider-capabilities__error">${escapeHtml17(model.error)}</p>` : ""}
|
|
7031
7285
|
</section>`;
|
|
7032
7286
|
};
|
|
7033
7287
|
var getVoiceProviderCapabilitiesCSS = () => `.absolute-voice-provider-capabilities{border:1px solid #bfd7ea;border-radius:20px;background:#f6fbff;color:#08131f;padding:18px;box-shadow:0 18px 40px rgba(14,51,78,.12);font-family:inherit}.absolute-voice-provider-capabilities--error,.absolute-voice-provider-capabilities--warning{border-color:#f2a7a7;background:#fff5f3}.absolute-voice-provider-capabilities__header,.absolute-voice-provider-capabilities__provider header{align-items:start;display:flex;gap:12px;justify-content:space-between}.absolute-voice-provider-capabilities__eyebrow{color:#255f85;font-size:12px;font-weight:800;letter-spacing:.08em;text-transform:uppercase}.absolute-voice-provider-capabilities__label{font-size:24px;line-height:1}.absolute-voice-provider-capabilities__description,.absolute-voice-provider-capabilities__provider p,.absolute-voice-provider-capabilities__provider dt,.absolute-voice-provider-capabilities__empty{color:#405467}.absolute-voice-provider-capabilities__providers{display:grid;gap:12px;margin-top:14px}.absolute-voice-provider-capabilities__provider{background:#fff;border:1px solid #d7e7f3;border-radius:16px;padding:14px}.absolute-voice-provider-capabilities__provider--selected,.absolute-voice-provider-capabilities__provider--healthy{border-color:#86efac}.absolute-voice-provider-capabilities__provider--degraded,.absolute-voice-provider-capabilities__provider--rate-limited,.absolute-voice-provider-capabilities__provider--suppressed,.absolute-voice-provider-capabilities__provider--unconfigured{border-color:#f2a7a7}.absolute-voice-provider-capabilities__provider p{margin:10px 0}.absolute-voice-provider-capabilities__provider dl{display:grid;gap:8px;grid-template-columns:repeat(2,minmax(0,1fr));margin:0}.absolute-voice-provider-capabilities__provider div{background:#f6fbff;border:1px solid #d7e7f3;border-radius:12px;padding:8px}.absolute-voice-provider-capabilities__provider dt{font-size:12px}.absolute-voice-provider-capabilities__provider dd{font-weight:800;margin:4px 0 0}.absolute-voice-provider-capabilities__empty{margin:14px 0 0}.absolute-voice-provider-capabilities__error{color:#9f1239;font-weight:700}`;
|
|
@@ -7069,7 +7323,7 @@ var defineVoiceProviderCapabilitiesElement = (tagName = "absolute-voice-provider
|
|
|
7069
7323
|
};
|
|
7070
7324
|
|
|
7071
7325
|
// src/react/VoiceProviderCapabilities.tsx
|
|
7072
|
-
import { jsxDEV as
|
|
7326
|
+
import { jsxDEV as jsxDEV12 } from "react/jsx-dev-runtime";
|
|
7073
7327
|
var VoiceProviderCapabilities = ({
|
|
7074
7328
|
className,
|
|
7075
7329
|
path = "/api/provider-capabilities",
|
|
@@ -7077,58 +7331,58 @@ var VoiceProviderCapabilities = ({
|
|
|
7077
7331
|
}) => {
|
|
7078
7332
|
const snapshot = useVoiceProviderCapabilities(path, options);
|
|
7079
7333
|
const model = createVoiceProviderCapabilitiesViewModel(snapshot, options);
|
|
7080
|
-
return /* @__PURE__ */
|
|
7334
|
+
return /* @__PURE__ */ jsxDEV12("section", {
|
|
7081
7335
|
className: [
|
|
7082
7336
|
"absolute-voice-provider-capabilities",
|
|
7083
7337
|
`absolute-voice-provider-capabilities--${model.status}`,
|
|
7084
7338
|
className
|
|
7085
7339
|
].filter(Boolean).join(" "),
|
|
7086
7340
|
children: [
|
|
7087
|
-
/* @__PURE__ */
|
|
7341
|
+
/* @__PURE__ */ jsxDEV12("header", {
|
|
7088
7342
|
className: "absolute-voice-provider-capabilities__header",
|
|
7089
7343
|
children: [
|
|
7090
|
-
/* @__PURE__ */
|
|
7344
|
+
/* @__PURE__ */ jsxDEV12("span", {
|
|
7091
7345
|
className: "absolute-voice-provider-capabilities__eyebrow",
|
|
7092
7346
|
children: model.title
|
|
7093
7347
|
}, undefined, false, undefined, this),
|
|
7094
|
-
/* @__PURE__ */
|
|
7348
|
+
/* @__PURE__ */ jsxDEV12("strong", {
|
|
7095
7349
|
className: "absolute-voice-provider-capabilities__label",
|
|
7096
7350
|
children: model.label
|
|
7097
7351
|
}, undefined, false, undefined, this)
|
|
7098
7352
|
]
|
|
7099
7353
|
}, undefined, true, undefined, this),
|
|
7100
|
-
/* @__PURE__ */
|
|
7354
|
+
/* @__PURE__ */ jsxDEV12("p", {
|
|
7101
7355
|
className: "absolute-voice-provider-capabilities__description",
|
|
7102
7356
|
children: model.description
|
|
7103
7357
|
}, undefined, false, undefined, this),
|
|
7104
|
-
model.capabilities.length ? /* @__PURE__ */
|
|
7358
|
+
model.capabilities.length ? /* @__PURE__ */ jsxDEV12("div", {
|
|
7105
7359
|
className: "absolute-voice-provider-capabilities__providers",
|
|
7106
|
-
children: model.capabilities.map((capability) => /* @__PURE__ */
|
|
7360
|
+
children: model.capabilities.map((capability) => /* @__PURE__ */ jsxDEV12("article", {
|
|
7107
7361
|
className: [
|
|
7108
7362
|
"absolute-voice-provider-capabilities__provider",
|
|
7109
7363
|
`absolute-voice-provider-capabilities__provider--${capability.status}`
|
|
7110
7364
|
].join(" "),
|
|
7111
7365
|
children: [
|
|
7112
|
-
/* @__PURE__ */
|
|
7366
|
+
/* @__PURE__ */ jsxDEV12("header", {
|
|
7113
7367
|
children: [
|
|
7114
|
-
/* @__PURE__ */
|
|
7368
|
+
/* @__PURE__ */ jsxDEV12("strong", {
|
|
7115
7369
|
children: capability.label
|
|
7116
7370
|
}, undefined, false, undefined, this),
|
|
7117
|
-
/* @__PURE__ */
|
|
7371
|
+
/* @__PURE__ */ jsxDEV12("span", {
|
|
7118
7372
|
children: capability.status
|
|
7119
7373
|
}, undefined, false, undefined, this)
|
|
7120
7374
|
]
|
|
7121
7375
|
}, undefined, true, undefined, this),
|
|
7122
|
-
/* @__PURE__ */
|
|
7376
|
+
/* @__PURE__ */ jsxDEV12("p", {
|
|
7123
7377
|
children: capability.detail
|
|
7124
7378
|
}, undefined, false, undefined, this),
|
|
7125
|
-
/* @__PURE__ */
|
|
7126
|
-
children: capability.rows.map((row) => /* @__PURE__ */
|
|
7379
|
+
/* @__PURE__ */ jsxDEV12("dl", {
|
|
7380
|
+
children: capability.rows.map((row) => /* @__PURE__ */ jsxDEV12("div", {
|
|
7127
7381
|
children: [
|
|
7128
|
-
/* @__PURE__ */
|
|
7382
|
+
/* @__PURE__ */ jsxDEV12("dt", {
|
|
7129
7383
|
children: row.label
|
|
7130
7384
|
}, undefined, false, undefined, this),
|
|
7131
|
-
/* @__PURE__ */
|
|
7385
|
+
/* @__PURE__ */ jsxDEV12("dd", {
|
|
7132
7386
|
children: row.value
|
|
7133
7387
|
}, undefined, false, undefined, this)
|
|
7134
7388
|
]
|
|
@@ -7136,11 +7390,11 @@ var VoiceProviderCapabilities = ({
|
|
|
7136
7390
|
}, undefined, false, undefined, this)
|
|
7137
7391
|
]
|
|
7138
7392
|
}, `${capability.kind}:${capability.provider}`, true, undefined, this))
|
|
7139
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
7393
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV12("p", {
|
|
7140
7394
|
className: "absolute-voice-provider-capabilities__empty",
|
|
7141
7395
|
children: "Configure provider capabilities to see deployment coverage."
|
|
7142
7396
|
}, undefined, false, undefined, this),
|
|
7143
|
-
model.error ? /* @__PURE__ */
|
|
7397
|
+
model.error ? /* @__PURE__ */ jsxDEV12("p", {
|
|
7144
7398
|
className: "absolute-voice-provider-capabilities__error",
|
|
7145
7399
|
children: model.error
|
|
7146
7400
|
}, undefined, false, undefined, this) : null
|
|
@@ -7148,7 +7402,7 @@ var VoiceProviderCapabilities = ({
|
|
|
7148
7402
|
}, undefined, true, undefined, this);
|
|
7149
7403
|
};
|
|
7150
7404
|
// src/react/useVoiceProviderContracts.tsx
|
|
7151
|
-
import { useEffect as
|
|
7405
|
+
import { useEffect as useEffect13, useRef as useRef13, useSyncExternalStore as useSyncExternalStore13 } from "react";
|
|
7152
7406
|
|
|
7153
7407
|
// src/client/providerContracts.ts
|
|
7154
7408
|
var fetchVoiceProviderContracts = async (path = "/api/provider-contracts", options = {}) => {
|
|
@@ -7227,25 +7481,25 @@ var createVoiceProviderContractsStore = (path = "/api/provider-contracts", optio
|
|
|
7227
7481
|
|
|
7228
7482
|
// src/react/useVoiceProviderContracts.tsx
|
|
7229
7483
|
var useVoiceProviderContracts = (path = "/api/provider-contracts", options = {}) => {
|
|
7230
|
-
const storeRef =
|
|
7484
|
+
const storeRef = useRef13(null);
|
|
7231
7485
|
if (!storeRef.current) {
|
|
7232
7486
|
storeRef.current = createVoiceProviderContractsStore(path, options);
|
|
7233
7487
|
}
|
|
7234
7488
|
const store = storeRef.current;
|
|
7235
|
-
|
|
7489
|
+
useEffect13(() => {
|
|
7236
7490
|
store.refresh().catch(() => {});
|
|
7237
7491
|
return () => store.close();
|
|
7238
7492
|
}, [store]);
|
|
7239
7493
|
return {
|
|
7240
|
-
...
|
|
7494
|
+
...useSyncExternalStore13(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
7241
7495
|
refresh: store.refresh
|
|
7242
7496
|
};
|
|
7243
7497
|
};
|
|
7244
7498
|
|
|
7245
7499
|
// src/client/providerContractsWidget.ts
|
|
7246
|
-
var
|
|
7247
|
-
var
|
|
7248
|
-
var
|
|
7500
|
+
var DEFAULT_TITLE12 = "Provider Contracts";
|
|
7501
|
+
var DEFAULT_DESCRIPTION12 = "Production contract coverage for provider env, latency, fallback, streaming, and capabilities.";
|
|
7502
|
+
var escapeHtml18 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
7249
7503
|
var formatProvider2 = (provider) => provider.split(/[-_\s]+/).filter(Boolean).map((part) => `${part[0]?.toUpperCase() ?? ""}${part.slice(1)}`).join(" ") || provider;
|
|
7250
7504
|
var formatStatus4 = (status) => status.split("-").map((part) => `${part[0]?.toUpperCase() ?? ""}${part.slice(1)}`).join(" ");
|
|
7251
7505
|
var contractDetail = (row) => {
|
|
@@ -7277,38 +7531,38 @@ var createVoiceProviderContractsViewModel = (snapshot, options = {}) => {
|
|
|
7277
7531
|
}));
|
|
7278
7532
|
const warningCount = snapshot.report ? snapshot.report.failed + snapshot.report.warned : rows.filter((row) => row.status !== "pass").length;
|
|
7279
7533
|
return {
|
|
7280
|
-
description: options.description ??
|
|
7534
|
+
description: options.description ?? DEFAULT_DESCRIPTION12,
|
|
7281
7535
|
error: snapshot.error,
|
|
7282
7536
|
isLoading: snapshot.isLoading,
|
|
7283
7537
|
label: snapshot.error ? "Unavailable" : rows.length ? warningCount > 0 ? `${warningCount} needs attention` : `${rows.length} passing` : snapshot.isLoading ? "Checking" : "No contracts",
|
|
7284
7538
|
rows,
|
|
7285
7539
|
status: snapshot.error ? "error" : rows.length ? warningCount > 0 ? "warning" : "ready" : snapshot.isLoading ? "loading" : "empty",
|
|
7286
|
-
title: options.title ??
|
|
7540
|
+
title: options.title ?? DEFAULT_TITLE12,
|
|
7287
7541
|
updatedAt: snapshot.updatedAt
|
|
7288
7542
|
};
|
|
7289
7543
|
};
|
|
7290
7544
|
var renderVoiceProviderContractsHTML = (snapshot, options = {}) => {
|
|
7291
7545
|
const model = createVoiceProviderContractsViewModel(snapshot, options);
|
|
7292
|
-
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--${
|
|
7546
|
+
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--${escapeHtml18(row.status)}">
|
|
7293
7547
|
<header>
|
|
7294
|
-
<strong>${
|
|
7295
|
-
<span>${
|
|
7548
|
+
<strong>${escapeHtml18(row.label)}</strong>
|
|
7549
|
+
<span>${escapeHtml18(formatStatus4(row.status))}</span>
|
|
7296
7550
|
</header>
|
|
7297
|
-
<p>${
|
|
7298
|
-
${row.remediations.length ? `<ul class="absolute-voice-provider-contracts__remediations">${row.remediations.map((remediation) => `<li>${remediation.href ? `<a href="${
|
|
7551
|
+
<p>${escapeHtml18(row.detail)}</p>
|
|
7552
|
+
${row.remediations.length ? `<ul class="absolute-voice-provider-contracts__remediations">${row.remediations.map((remediation) => `<li>${remediation.href ? `<a href="${escapeHtml18(remediation.href)}">${escapeHtml18(remediation.label)}</a>` : `<strong>${escapeHtml18(remediation.label)}</strong>`}<span>${escapeHtml18(remediation.detail)}</span></li>`).join("")}</ul>` : ""}
|
|
7299
7553
|
<dl>${row.rows.map((item) => `<div>
|
|
7300
|
-
<dt>${
|
|
7301
|
-
<dd>${
|
|
7554
|
+
<dt>${escapeHtml18(item.label)}</dt>
|
|
7555
|
+
<dd>${escapeHtml18(item.value)}</dd>
|
|
7302
7556
|
</div>`).join("")}</dl>
|
|
7303
7557
|
</article>`).join("")}</div>` : '<p class="absolute-voice-provider-contracts__empty">Configure provider contracts to see production coverage.</p>';
|
|
7304
|
-
return `<section class="absolute-voice-provider-contracts absolute-voice-provider-contracts--${
|
|
7558
|
+
return `<section class="absolute-voice-provider-contracts absolute-voice-provider-contracts--${escapeHtml18(model.status)}">
|
|
7305
7559
|
<header class="absolute-voice-provider-contracts__header">
|
|
7306
|
-
<span class="absolute-voice-provider-contracts__eyebrow">${
|
|
7307
|
-
<strong class="absolute-voice-provider-contracts__label">${
|
|
7560
|
+
<span class="absolute-voice-provider-contracts__eyebrow">${escapeHtml18(model.title)}</span>
|
|
7561
|
+
<strong class="absolute-voice-provider-contracts__label">${escapeHtml18(model.label)}</strong>
|
|
7308
7562
|
</header>
|
|
7309
|
-
<p class="absolute-voice-provider-contracts__description">${
|
|
7563
|
+
<p class="absolute-voice-provider-contracts__description">${escapeHtml18(model.description)}</p>
|
|
7310
7564
|
${rows}
|
|
7311
|
-
${model.error ? `<p class="absolute-voice-provider-contracts__error">${
|
|
7565
|
+
${model.error ? `<p class="absolute-voice-provider-contracts__error">${escapeHtml18(model.error)}</p>` : ""}
|
|
7312
7566
|
</section>`;
|
|
7313
7567
|
};
|
|
7314
7568
|
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}`;
|
|
@@ -7350,7 +7604,7 @@ var defineVoiceProviderContractsElement = (tagName = "absolute-voice-provider-co
|
|
|
7350
7604
|
};
|
|
7351
7605
|
|
|
7352
7606
|
// src/react/VoiceProviderContracts.tsx
|
|
7353
|
-
import { jsxDEV as
|
|
7607
|
+
import { jsxDEV as jsxDEV13 } from "react/jsx-dev-runtime";
|
|
7354
7608
|
var VoiceProviderContracts = ({
|
|
7355
7609
|
className,
|
|
7356
7610
|
path = "/api/provider-contracts",
|
|
@@ -7358,74 +7612,74 @@ var VoiceProviderContracts = ({
|
|
|
7358
7612
|
}) => {
|
|
7359
7613
|
const snapshot = useVoiceProviderContracts(path, options);
|
|
7360
7614
|
const model = createVoiceProviderContractsViewModel(snapshot, options);
|
|
7361
|
-
return /* @__PURE__ */
|
|
7615
|
+
return /* @__PURE__ */ jsxDEV13("section", {
|
|
7362
7616
|
className: [
|
|
7363
7617
|
"absolute-voice-provider-contracts",
|
|
7364
7618
|
`absolute-voice-provider-contracts--${model.status}`,
|
|
7365
7619
|
className
|
|
7366
7620
|
].filter(Boolean).join(" "),
|
|
7367
7621
|
children: [
|
|
7368
|
-
/* @__PURE__ */
|
|
7622
|
+
/* @__PURE__ */ jsxDEV13("header", {
|
|
7369
7623
|
className: "absolute-voice-provider-contracts__header",
|
|
7370
7624
|
children: [
|
|
7371
|
-
/* @__PURE__ */
|
|
7625
|
+
/* @__PURE__ */ jsxDEV13("span", {
|
|
7372
7626
|
className: "absolute-voice-provider-contracts__eyebrow",
|
|
7373
7627
|
children: model.title
|
|
7374
7628
|
}, undefined, false, undefined, this),
|
|
7375
|
-
/* @__PURE__ */
|
|
7629
|
+
/* @__PURE__ */ jsxDEV13("strong", {
|
|
7376
7630
|
className: "absolute-voice-provider-contracts__label",
|
|
7377
7631
|
children: model.label
|
|
7378
7632
|
}, undefined, false, undefined, this)
|
|
7379
7633
|
]
|
|
7380
7634
|
}, undefined, true, undefined, this),
|
|
7381
|
-
/* @__PURE__ */
|
|
7635
|
+
/* @__PURE__ */ jsxDEV13("p", {
|
|
7382
7636
|
className: "absolute-voice-provider-contracts__description",
|
|
7383
7637
|
children: model.description
|
|
7384
7638
|
}, undefined, false, undefined, this),
|
|
7385
|
-
model.rows.length ? /* @__PURE__ */
|
|
7639
|
+
model.rows.length ? /* @__PURE__ */ jsxDEV13("div", {
|
|
7386
7640
|
className: "absolute-voice-provider-contracts__rows",
|
|
7387
|
-
children: model.rows.map((row) => /* @__PURE__ */
|
|
7641
|
+
children: model.rows.map((row) => /* @__PURE__ */ jsxDEV13("article", {
|
|
7388
7642
|
className: [
|
|
7389
7643
|
"absolute-voice-provider-contracts__row",
|
|
7390
7644
|
`absolute-voice-provider-contracts__row--${row.status}`
|
|
7391
7645
|
].join(" "),
|
|
7392
7646
|
children: [
|
|
7393
|
-
/* @__PURE__ */
|
|
7647
|
+
/* @__PURE__ */ jsxDEV13("header", {
|
|
7394
7648
|
children: [
|
|
7395
|
-
/* @__PURE__ */
|
|
7649
|
+
/* @__PURE__ */ jsxDEV13("strong", {
|
|
7396
7650
|
children: row.label
|
|
7397
7651
|
}, undefined, false, undefined, this),
|
|
7398
|
-
/* @__PURE__ */
|
|
7652
|
+
/* @__PURE__ */ jsxDEV13("span", {
|
|
7399
7653
|
children: row.status
|
|
7400
7654
|
}, undefined, false, undefined, this)
|
|
7401
7655
|
]
|
|
7402
7656
|
}, undefined, true, undefined, this),
|
|
7403
|
-
/* @__PURE__ */
|
|
7657
|
+
/* @__PURE__ */ jsxDEV13("p", {
|
|
7404
7658
|
children: row.detail
|
|
7405
7659
|
}, undefined, false, undefined, this),
|
|
7406
|
-
row.remediations.length ? /* @__PURE__ */
|
|
7660
|
+
row.remediations.length ? /* @__PURE__ */ jsxDEV13("ul", {
|
|
7407
7661
|
className: "absolute-voice-provider-contracts__remediations",
|
|
7408
|
-
children: row.remediations.map((remediation) => /* @__PURE__ */
|
|
7662
|
+
children: row.remediations.map((remediation) => /* @__PURE__ */ jsxDEV13("li", {
|
|
7409
7663
|
children: [
|
|
7410
|
-
remediation.href ? /* @__PURE__ */
|
|
7664
|
+
remediation.href ? /* @__PURE__ */ jsxDEV13("a", {
|
|
7411
7665
|
href: remediation.href,
|
|
7412
7666
|
children: remediation.label
|
|
7413
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
7667
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV13("strong", {
|
|
7414
7668
|
children: remediation.label
|
|
7415
7669
|
}, undefined, false, undefined, this),
|
|
7416
|
-
/* @__PURE__ */
|
|
7670
|
+
/* @__PURE__ */ jsxDEV13("span", {
|
|
7417
7671
|
children: remediation.detail
|
|
7418
7672
|
}, undefined, false, undefined, this)
|
|
7419
7673
|
]
|
|
7420
7674
|
}, `${row.kind}:${row.provider}:${remediation.label}`, true, undefined, this))
|
|
7421
7675
|
}, undefined, false, undefined, this) : null,
|
|
7422
|
-
/* @__PURE__ */
|
|
7423
|
-
children: row.rows.map((item) => /* @__PURE__ */
|
|
7676
|
+
/* @__PURE__ */ jsxDEV13("dl", {
|
|
7677
|
+
children: row.rows.map((item) => /* @__PURE__ */ jsxDEV13("div", {
|
|
7424
7678
|
children: [
|
|
7425
|
-
/* @__PURE__ */
|
|
7679
|
+
/* @__PURE__ */ jsxDEV13("dt", {
|
|
7426
7680
|
children: item.label
|
|
7427
7681
|
}, undefined, false, undefined, this),
|
|
7428
|
-
/* @__PURE__ */
|
|
7682
|
+
/* @__PURE__ */ jsxDEV13("dd", {
|
|
7429
7683
|
children: item.value
|
|
7430
7684
|
}, undefined, false, undefined, this)
|
|
7431
7685
|
]
|
|
@@ -7433,11 +7687,11 @@ var VoiceProviderContracts = ({
|
|
|
7433
7687
|
}, undefined, false, undefined, this)
|
|
7434
7688
|
]
|
|
7435
7689
|
}, `${row.kind}:${row.provider}`, true, undefined, this))
|
|
7436
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
7690
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV13("p", {
|
|
7437
7691
|
className: "absolute-voice-provider-contracts__empty",
|
|
7438
7692
|
children: "Configure provider contracts to see production coverage."
|
|
7439
7693
|
}, undefined, false, undefined, this),
|
|
7440
|
-
model.error ? /* @__PURE__ */
|
|
7694
|
+
model.error ? /* @__PURE__ */ jsxDEV13("p", {
|
|
7441
7695
|
className: "absolute-voice-provider-contracts__error",
|
|
7442
7696
|
children: model.error
|
|
7443
7697
|
}, undefined, false, undefined, this) : null
|
|
@@ -7445,7 +7699,7 @@ var VoiceProviderContracts = ({
|
|
|
7445
7699
|
}, undefined, true, undefined, this);
|
|
7446
7700
|
};
|
|
7447
7701
|
// src/react/useVoiceProviderStatus.tsx
|
|
7448
|
-
import { useEffect as
|
|
7702
|
+
import { useEffect as useEffect14, useRef as useRef14, useSyncExternalStore as useSyncExternalStore14 } from "react";
|
|
7449
7703
|
|
|
7450
7704
|
// src/client/providerStatus.ts
|
|
7451
7705
|
var fetchVoiceProviderStatus = async (path = "/api/provider-status", options = {}) => {
|
|
@@ -7529,25 +7783,25 @@ var createVoiceProviderStatusStore = (path = "/api/provider-status", options = {
|
|
|
7529
7783
|
|
|
7530
7784
|
// src/react/useVoiceProviderStatus.tsx
|
|
7531
7785
|
var useVoiceProviderStatus = (path = "/api/provider-status", options = {}) => {
|
|
7532
|
-
const storeRef =
|
|
7786
|
+
const storeRef = useRef14(null);
|
|
7533
7787
|
if (!storeRef.current) {
|
|
7534
7788
|
storeRef.current = createVoiceProviderStatusStore(path, options);
|
|
7535
7789
|
}
|
|
7536
7790
|
const store = storeRef.current;
|
|
7537
|
-
|
|
7791
|
+
useEffect14(() => {
|
|
7538
7792
|
store.refresh().catch(() => {});
|
|
7539
7793
|
return () => store.close();
|
|
7540
7794
|
}, [store]);
|
|
7541
7795
|
return {
|
|
7542
|
-
...
|
|
7796
|
+
...useSyncExternalStore14(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
7543
7797
|
refresh: store.refresh
|
|
7544
7798
|
};
|
|
7545
7799
|
};
|
|
7546
7800
|
|
|
7547
7801
|
// src/client/providerStatusWidget.ts
|
|
7548
|
-
var
|
|
7549
|
-
var
|
|
7550
|
-
var
|
|
7802
|
+
var DEFAULT_TITLE13 = "Voice Providers";
|
|
7803
|
+
var DEFAULT_DESCRIPTION13 = "Live provider health, fallback counts, latency, and suppression state from your self-hosted trace store.";
|
|
7804
|
+
var escapeHtml19 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
7551
7805
|
var formatProvider3 = (provider) => provider.split(/[-_\s]+/).filter(Boolean).map((part) => `${part[0]?.toUpperCase() ?? ""}${part.slice(1)}`).join(" ") || provider;
|
|
7552
7806
|
var formatStatus5 = (status) => status.split("-").map((part) => `${part[0]?.toUpperCase() ?? ""}${part.slice(1)}`).join(" ");
|
|
7553
7807
|
var formatLatency = (value) => typeof value === "number" ? `${value}ms` : "No samples";
|
|
@@ -7591,37 +7845,37 @@ var createVoiceProviderStatusViewModel = (snapshot, options = {}) => {
|
|
|
7591
7845
|
const warningCount = providers.filter((provider) => isWarningStatus2(provider.status)).length;
|
|
7592
7846
|
const healthyCount = providers.filter((provider) => provider.status === "healthy").length;
|
|
7593
7847
|
return {
|
|
7594
|
-
description: options.description ??
|
|
7848
|
+
description: options.description ?? DEFAULT_DESCRIPTION13,
|
|
7595
7849
|
error: snapshot.error,
|
|
7596
7850
|
isLoading: snapshot.isLoading,
|
|
7597
7851
|
label: snapshot.error ? "Unavailable" : providers.length ? warningCount > 0 ? `${warningCount} needs attention` : `${healthyCount} healthy` : snapshot.isLoading ? "Checking" : "No provider traffic",
|
|
7598
7852
|
providers,
|
|
7599
7853
|
status: snapshot.error ? "error" : providers.length ? warningCount > 0 ? "warning" : "ready" : snapshot.isLoading ? "loading" : "empty",
|
|
7600
|
-
title: options.title ??
|
|
7854
|
+
title: options.title ?? DEFAULT_TITLE13,
|
|
7601
7855
|
updatedAt: snapshot.updatedAt
|
|
7602
7856
|
};
|
|
7603
7857
|
};
|
|
7604
7858
|
var renderVoiceProviderStatusHTML = (snapshot, options = {}) => {
|
|
7605
7859
|
const model = createVoiceProviderStatusViewModel(snapshot, options);
|
|
7606
|
-
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--${
|
|
7860
|
+
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--${escapeHtml19(provider.status)}">
|
|
7607
7861
|
<header>
|
|
7608
|
-
<strong>${
|
|
7609
|
-
<span>${
|
|
7862
|
+
<strong>${escapeHtml19(provider.label)}</strong>
|
|
7863
|
+
<span>${escapeHtml19(formatStatus5(provider.status))}</span>
|
|
7610
7864
|
</header>
|
|
7611
|
-
<p>${
|
|
7865
|
+
<p>${escapeHtml19(provider.detail)}</p>
|
|
7612
7866
|
<dl>${provider.rows.map((row) => `<div>
|
|
7613
|
-
<dt>${
|
|
7614
|
-
<dd>${
|
|
7867
|
+
<dt>${escapeHtml19(row.label)}</dt>
|
|
7868
|
+
<dd>${escapeHtml19(row.value)}</dd>
|
|
7615
7869
|
</div>`).join("")}</dl>
|
|
7616
7870
|
</article>`).join("")}</div>` : '<p class="absolute-voice-provider-status__empty">Run voice traffic to see provider health.</p>';
|
|
7617
|
-
return `<section class="absolute-voice-provider-status absolute-voice-provider-status--${
|
|
7871
|
+
return `<section class="absolute-voice-provider-status absolute-voice-provider-status--${escapeHtml19(model.status)}">
|
|
7618
7872
|
<header class="absolute-voice-provider-status__header">
|
|
7619
|
-
<span class="absolute-voice-provider-status__eyebrow">${
|
|
7620
|
-
<strong class="absolute-voice-provider-status__label">${
|
|
7873
|
+
<span class="absolute-voice-provider-status__eyebrow">${escapeHtml19(model.title)}</span>
|
|
7874
|
+
<strong class="absolute-voice-provider-status__label">${escapeHtml19(model.label)}</strong>
|
|
7621
7875
|
</header>
|
|
7622
|
-
<p class="absolute-voice-provider-status__description">${
|
|
7876
|
+
<p class="absolute-voice-provider-status__description">${escapeHtml19(model.description)}</p>
|
|
7623
7877
|
${providers}
|
|
7624
|
-
${model.error ? `<p class="absolute-voice-provider-status__error">${
|
|
7878
|
+
${model.error ? `<p class="absolute-voice-provider-status__error">${escapeHtml19(model.error)}</p>` : ""}
|
|
7625
7879
|
</section>`;
|
|
7626
7880
|
};
|
|
7627
7881
|
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}`;
|
|
@@ -7663,7 +7917,7 @@ var defineVoiceProviderStatusElement = (tagName = "absolute-voice-provider-statu
|
|
|
7663
7917
|
};
|
|
7664
7918
|
|
|
7665
7919
|
// src/react/VoiceProviderStatus.tsx
|
|
7666
|
-
import { jsxDEV as
|
|
7920
|
+
import { jsxDEV as jsxDEV14 } from "react/jsx-dev-runtime";
|
|
7667
7921
|
var VoiceProviderStatus = ({
|
|
7668
7922
|
className,
|
|
7669
7923
|
path = "/api/provider-status",
|
|
@@ -7671,58 +7925,58 @@ var VoiceProviderStatus = ({
|
|
|
7671
7925
|
}) => {
|
|
7672
7926
|
const snapshot = useVoiceProviderStatus(path, options);
|
|
7673
7927
|
const model = createVoiceProviderStatusViewModel(snapshot, options);
|
|
7674
|
-
return /* @__PURE__ */
|
|
7928
|
+
return /* @__PURE__ */ jsxDEV14("section", {
|
|
7675
7929
|
className: [
|
|
7676
7930
|
"absolute-voice-provider-status",
|
|
7677
7931
|
`absolute-voice-provider-status--${model.status}`,
|
|
7678
7932
|
className
|
|
7679
7933
|
].filter(Boolean).join(" "),
|
|
7680
7934
|
children: [
|
|
7681
|
-
/* @__PURE__ */
|
|
7935
|
+
/* @__PURE__ */ jsxDEV14("header", {
|
|
7682
7936
|
className: "absolute-voice-provider-status__header",
|
|
7683
7937
|
children: [
|
|
7684
|
-
/* @__PURE__ */
|
|
7938
|
+
/* @__PURE__ */ jsxDEV14("span", {
|
|
7685
7939
|
className: "absolute-voice-provider-status__eyebrow",
|
|
7686
7940
|
children: model.title
|
|
7687
7941
|
}, undefined, false, undefined, this),
|
|
7688
|
-
/* @__PURE__ */
|
|
7942
|
+
/* @__PURE__ */ jsxDEV14("strong", {
|
|
7689
7943
|
className: "absolute-voice-provider-status__label",
|
|
7690
7944
|
children: model.label
|
|
7691
7945
|
}, undefined, false, undefined, this)
|
|
7692
7946
|
]
|
|
7693
7947
|
}, undefined, true, undefined, this),
|
|
7694
|
-
/* @__PURE__ */
|
|
7948
|
+
/* @__PURE__ */ jsxDEV14("p", {
|
|
7695
7949
|
className: "absolute-voice-provider-status__description",
|
|
7696
7950
|
children: model.description
|
|
7697
7951
|
}, undefined, false, undefined, this),
|
|
7698
|
-
model.providers.length ? /* @__PURE__ */
|
|
7952
|
+
model.providers.length ? /* @__PURE__ */ jsxDEV14("div", {
|
|
7699
7953
|
className: "absolute-voice-provider-status__providers",
|
|
7700
|
-
children: model.providers.map((provider) => /* @__PURE__ */
|
|
7954
|
+
children: model.providers.map((provider) => /* @__PURE__ */ jsxDEV14("article", {
|
|
7701
7955
|
className: [
|
|
7702
7956
|
"absolute-voice-provider-status__provider",
|
|
7703
7957
|
`absolute-voice-provider-status__provider--${provider.status}`
|
|
7704
7958
|
].join(" "),
|
|
7705
7959
|
children: [
|
|
7706
|
-
/* @__PURE__ */
|
|
7960
|
+
/* @__PURE__ */ jsxDEV14("header", {
|
|
7707
7961
|
children: [
|
|
7708
|
-
/* @__PURE__ */
|
|
7962
|
+
/* @__PURE__ */ jsxDEV14("strong", {
|
|
7709
7963
|
children: provider.label
|
|
7710
7964
|
}, undefined, false, undefined, this),
|
|
7711
|
-
/* @__PURE__ */
|
|
7965
|
+
/* @__PURE__ */ jsxDEV14("span", {
|
|
7712
7966
|
children: provider.status
|
|
7713
7967
|
}, undefined, false, undefined, this)
|
|
7714
7968
|
]
|
|
7715
7969
|
}, undefined, true, undefined, this),
|
|
7716
|
-
/* @__PURE__ */
|
|
7970
|
+
/* @__PURE__ */ jsxDEV14("p", {
|
|
7717
7971
|
children: provider.detail
|
|
7718
7972
|
}, undefined, false, undefined, this),
|
|
7719
|
-
/* @__PURE__ */
|
|
7720
|
-
children: provider.rows.map((row) => /* @__PURE__ */
|
|
7973
|
+
/* @__PURE__ */ jsxDEV14("dl", {
|
|
7974
|
+
children: provider.rows.map((row) => /* @__PURE__ */ jsxDEV14("div", {
|
|
7721
7975
|
children: [
|
|
7722
|
-
/* @__PURE__ */
|
|
7976
|
+
/* @__PURE__ */ jsxDEV14("dt", {
|
|
7723
7977
|
children: row.label
|
|
7724
7978
|
}, undefined, false, undefined, this),
|
|
7725
|
-
/* @__PURE__ */
|
|
7979
|
+
/* @__PURE__ */ jsxDEV14("dd", {
|
|
7726
7980
|
children: row.value
|
|
7727
7981
|
}, undefined, false, undefined, this)
|
|
7728
7982
|
]
|
|
@@ -7730,11 +7984,11 @@ var VoiceProviderStatus = ({
|
|
|
7730
7984
|
}, undefined, false, undefined, this)
|
|
7731
7985
|
]
|
|
7732
7986
|
}, provider.provider, true, undefined, this))
|
|
7733
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
7987
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV14("p", {
|
|
7734
7988
|
className: "absolute-voice-provider-status__empty",
|
|
7735
7989
|
children: "Run voice traffic to see provider health."
|
|
7736
7990
|
}, undefined, false, undefined, this),
|
|
7737
|
-
model.error ? /* @__PURE__ */
|
|
7991
|
+
model.error ? /* @__PURE__ */ jsxDEV14("p", {
|
|
7738
7992
|
className: "absolute-voice-provider-status__error",
|
|
7739
7993
|
children: model.error
|
|
7740
7994
|
}, undefined, false, undefined, this) : null
|
|
@@ -7742,7 +7996,7 @@ var VoiceProviderStatus = ({
|
|
|
7742
7996
|
}, undefined, true, undefined, this);
|
|
7743
7997
|
};
|
|
7744
7998
|
// src/react/useVoiceRoutingStatus.tsx
|
|
7745
|
-
import { useEffect as
|
|
7999
|
+
import { useEffect as useEffect15, useRef as useRef15, useSyncExternalStore as useSyncExternalStore15 } from "react";
|
|
7746
8000
|
|
|
7747
8001
|
// src/client/routingStatus.ts
|
|
7748
8002
|
var fetchVoiceRoutingStatus = async (path = "/api/routing/latest", options = {}) => {
|
|
@@ -7826,25 +8080,25 @@ var createVoiceRoutingStatusStore = (path = "/api/routing/latest", options = {})
|
|
|
7826
8080
|
|
|
7827
8081
|
// src/react/useVoiceRoutingStatus.tsx
|
|
7828
8082
|
var useVoiceRoutingStatus = (path = "/api/routing/latest", options = {}) => {
|
|
7829
|
-
const storeRef =
|
|
8083
|
+
const storeRef = useRef15(null);
|
|
7830
8084
|
if (!storeRef.current) {
|
|
7831
8085
|
storeRef.current = createVoiceRoutingStatusStore(path, options);
|
|
7832
8086
|
}
|
|
7833
8087
|
const store = storeRef.current;
|
|
7834
|
-
|
|
8088
|
+
useEffect15(() => {
|
|
7835
8089
|
store.refresh().catch(() => {});
|
|
7836
8090
|
return () => store.close();
|
|
7837
8091
|
}, [store]);
|
|
7838
8092
|
return {
|
|
7839
|
-
...
|
|
8093
|
+
...useSyncExternalStore15(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
7840
8094
|
refresh: store.refresh
|
|
7841
8095
|
};
|
|
7842
8096
|
};
|
|
7843
8097
|
|
|
7844
8098
|
// src/client/routingStatusWidget.ts
|
|
7845
|
-
var
|
|
7846
|
-
var
|
|
7847
|
-
var
|
|
8099
|
+
var DEFAULT_TITLE14 = "Voice Routing";
|
|
8100
|
+
var DEFAULT_DESCRIPTION14 = "Latest provider routing decision from the self-hosted trace store.";
|
|
8101
|
+
var escapeHtml20 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
7848
8102
|
var formatValue = (value, fallback = "None") => typeof value === "string" && value.trim() ? value : typeof value === "number" && Number.isFinite(value) ? String(value) : fallback;
|
|
7849
8103
|
var formatProviderRoutes2 = (routes) => routes && typeof routes === "object" ? Object.entries(routes).map(([role, provider]) => `${role}: ${formatValue(provider)}`).join(", ") || "None" : "None";
|
|
7850
8104
|
var getProviderRoute = (routes, role) => routes && typeof routes === "object" ? formatValue(routes[role], "Not configured") : "Not configured";
|
|
@@ -7913,35 +8167,35 @@ var createVoiceRoutingStatusViewModel = (snapshot, options = {}) => {
|
|
|
7913
8167
|
return {
|
|
7914
8168
|
activeStack,
|
|
7915
8169
|
decision,
|
|
7916
|
-
description: options.description ??
|
|
8170
|
+
description: options.description ?? DEFAULT_DESCRIPTION14,
|
|
7917
8171
|
error: snapshot.error,
|
|
7918
8172
|
isLoading: snapshot.isLoading,
|
|
7919
8173
|
label: snapshot.error ? "Unavailable" : decision ? `${formatValue(decision.kind).toUpperCase()} ${formatValue(decision.status, "unknown")}` : snapshot.isLoading ? "Checking" : "No routing yet",
|
|
7920
8174
|
rows,
|
|
7921
8175
|
status: snapshot.error ? "error" : decision ? "ready" : snapshot.isLoading ? "loading" : "empty",
|
|
7922
|
-
title: options.title ??
|
|
8176
|
+
title: options.title ?? DEFAULT_TITLE14,
|
|
7923
8177
|
updatedAt: snapshot.updatedAt
|
|
7924
8178
|
};
|
|
7925
8179
|
};
|
|
7926
8180
|
var renderVoiceRoutingStatusHTML = (snapshot, options = {}) => {
|
|
7927
8181
|
const model = createVoiceRoutingStatusViewModel(snapshot, options);
|
|
7928
8182
|
const activeStack = model.activeStack.length ? `<div class="absolute-voice-routing-status__stack" aria-label="Active voice stack">${model.activeStack.map((item) => `<div>
|
|
7929
|
-
<span>${
|
|
7930
|
-
<strong>${
|
|
8183
|
+
<span>${escapeHtml20(item.label)}</span>
|
|
8184
|
+
<strong>${escapeHtml20(item.value)}</strong>
|
|
7931
8185
|
</div>`).join("")}</div>` : "";
|
|
7932
8186
|
const rows = model.rows.length ? `<div class="absolute-voice-routing-status__grid">${model.rows.map((row) => `<div>
|
|
7933
|
-
<span>${
|
|
7934
|
-
<strong>${
|
|
8187
|
+
<span>${escapeHtml20(row.label)}</span>
|
|
8188
|
+
<strong>${escapeHtml20(row.value)}</strong>
|
|
7935
8189
|
</div>`).join("")}</div>` : '<p class="absolute-voice-routing-status__empty">Start a voice session to see the selected provider.</p>';
|
|
7936
|
-
return `<section class="absolute-voice-routing-status absolute-voice-routing-status--${
|
|
8190
|
+
return `<section class="absolute-voice-routing-status absolute-voice-routing-status--${escapeHtml20(model.status)}">
|
|
7937
8191
|
<header class="absolute-voice-routing-status__header">
|
|
7938
|
-
<span class="absolute-voice-routing-status__eyebrow">${
|
|
7939
|
-
<strong class="absolute-voice-routing-status__label">${
|
|
8192
|
+
<span class="absolute-voice-routing-status__eyebrow">${escapeHtml20(model.title)}</span>
|
|
8193
|
+
<strong class="absolute-voice-routing-status__label">${escapeHtml20(model.label)}</strong>
|
|
7940
8194
|
</header>
|
|
7941
|
-
<p class="absolute-voice-routing-status__description">${
|
|
8195
|
+
<p class="absolute-voice-routing-status__description">${escapeHtml20(model.description)}</p>
|
|
7942
8196
|
${activeStack}
|
|
7943
8197
|
${rows}
|
|
7944
|
-
${model.error ? `<p class="absolute-voice-routing-status__error">${
|
|
8198
|
+
${model.error ? `<p class="absolute-voice-routing-status__error">${escapeHtml20(model.error)}</p>` : ""}
|
|
7945
8199
|
</section>`;
|
|
7946
8200
|
};
|
|
7947
8201
|
var getVoiceRoutingStatusCSS = () => `.absolute-voice-routing-status{border:1px solid #d8d2c4;border-radius:20px;background:#fffaf0;color:#16130d;padding:18px;box-shadow:0 18px 40px rgba(47,37,18,.12);font-family:inherit}.absolute-voice-routing-status--error{border-color:#f2a7a7;background:#fff5f3}.absolute-voice-routing-status__header{align-items:start;display:flex;gap:12px;justify-content:space-between}.absolute-voice-routing-status__eyebrow{color:#73664f;font-size:12px;font-weight:800;letter-spacing:.08em;text-transform:uppercase}.absolute-voice-routing-status__label{font-size:24px;line-height:1}.absolute-voice-routing-status__description{color:#514733;margin:12px 0 0}.absolute-voice-routing-status__stack{background:linear-gradient(135deg,#16130d,#49391f);border-radius:18px;color:#fff;display:grid;gap:8px;grid-template-columns:repeat(5,minmax(0,1fr));margin-top:14px;padding:12px}.absolute-voice-routing-status__stack div{border-left:1px solid rgba(255,255,255,.18);padding-left:10px}.absolute-voice-routing-status__stack div:first-child{border-left:0;padding-left:0}.absolute-voice-routing-status__stack span{color:#e9d9b8;display:block;font-size:11px;font-weight:800;letter-spacing:.08em;margin-bottom:5px;text-transform:uppercase}.absolute-voice-routing-status__stack strong{display:block;font-size:13px;line-height:1.25;overflow-wrap:anywhere}.absolute-voice-routing-status__grid{display:grid;gap:8px;grid-template-columns:repeat(2,minmax(0,1fr));margin-top:14px}.absolute-voice-routing-status__grid div{background:#fff;border:1px solid #eee4d2;border-radius:14px;padding:10px 12px}.absolute-voice-routing-status__grid span{color:#655944;display:block;font-size:12px;margin-bottom:4px}.absolute-voice-routing-status__grid strong{overflow-wrap:anywhere}.absolute-voice-routing-status__empty{color:#655944;margin:14px 0 0}.absolute-voice-routing-status__error{color:#9f1239;font-weight:700}@media (max-width:760px){.absolute-voice-routing-status__stack{grid-template-columns:repeat(2,minmax(0,1fr))}.absolute-voice-routing-status__stack div{border-left:0;border-top:1px solid rgba(255,255,255,.18);padding-left:0;padding-top:8px}.absolute-voice-routing-status__stack div:first-child{border-top:0;padding-top:0}}`;
|
|
@@ -7983,7 +8237,7 @@ var defineVoiceRoutingStatusElement = (tagName = "absolute-voice-routing-status"
|
|
|
7983
8237
|
};
|
|
7984
8238
|
|
|
7985
8239
|
// src/react/VoiceRoutingStatus.tsx
|
|
7986
|
-
import { jsxDEV as
|
|
8240
|
+
import { jsxDEV as jsxDEV15 } from "react/jsx-dev-runtime";
|
|
7987
8241
|
var VoiceRoutingStatus = ({
|
|
7988
8242
|
className,
|
|
7989
8243
|
path = "/api/routing/latest",
|
|
@@ -7991,47 +8245,47 @@ var VoiceRoutingStatus = ({
|
|
|
7991
8245
|
}) => {
|
|
7992
8246
|
const snapshot = useVoiceRoutingStatus(path, options);
|
|
7993
8247
|
const model = createVoiceRoutingStatusViewModel(snapshot, options);
|
|
7994
|
-
return /* @__PURE__ */
|
|
8248
|
+
return /* @__PURE__ */ jsxDEV15("section", {
|
|
7995
8249
|
className: [
|
|
7996
8250
|
"absolute-voice-routing-status",
|
|
7997
8251
|
`absolute-voice-routing-status--${model.status}`,
|
|
7998
8252
|
className
|
|
7999
8253
|
].filter(Boolean).join(" "),
|
|
8000
8254
|
children: [
|
|
8001
|
-
/* @__PURE__ */
|
|
8255
|
+
/* @__PURE__ */ jsxDEV15("header", {
|
|
8002
8256
|
className: "absolute-voice-routing-status__header",
|
|
8003
8257
|
children: [
|
|
8004
|
-
/* @__PURE__ */
|
|
8258
|
+
/* @__PURE__ */ jsxDEV15("span", {
|
|
8005
8259
|
className: "absolute-voice-routing-status__eyebrow",
|
|
8006
8260
|
children: model.title
|
|
8007
8261
|
}, undefined, false, undefined, this),
|
|
8008
|
-
/* @__PURE__ */
|
|
8262
|
+
/* @__PURE__ */ jsxDEV15("strong", {
|
|
8009
8263
|
className: "absolute-voice-routing-status__label",
|
|
8010
8264
|
children: model.label
|
|
8011
8265
|
}, undefined, false, undefined, this)
|
|
8012
8266
|
]
|
|
8013
8267
|
}, undefined, true, undefined, this),
|
|
8014
|
-
/* @__PURE__ */
|
|
8268
|
+
/* @__PURE__ */ jsxDEV15("p", {
|
|
8015
8269
|
className: "absolute-voice-routing-status__description",
|
|
8016
8270
|
children: model.description
|
|
8017
8271
|
}, undefined, false, undefined, this),
|
|
8018
|
-
model.rows.length ? /* @__PURE__ */
|
|
8272
|
+
model.rows.length ? /* @__PURE__ */ jsxDEV15("div", {
|
|
8019
8273
|
className: "absolute-voice-routing-status__grid",
|
|
8020
|
-
children: model.rows.map((row) => /* @__PURE__ */
|
|
8274
|
+
children: model.rows.map((row) => /* @__PURE__ */ jsxDEV15("div", {
|
|
8021
8275
|
children: [
|
|
8022
|
-
/* @__PURE__ */
|
|
8276
|
+
/* @__PURE__ */ jsxDEV15("span", {
|
|
8023
8277
|
children: row.label
|
|
8024
8278
|
}, undefined, false, undefined, this),
|
|
8025
|
-
/* @__PURE__ */
|
|
8279
|
+
/* @__PURE__ */ jsxDEV15("strong", {
|
|
8026
8280
|
children: row.value
|
|
8027
8281
|
}, undefined, false, undefined, this)
|
|
8028
8282
|
]
|
|
8029
8283
|
}, row.label, true, undefined, this))
|
|
8030
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
8284
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV15("p", {
|
|
8031
8285
|
className: "absolute-voice-routing-status__empty",
|
|
8032
8286
|
children: "Start a voice session to see the selected provider."
|
|
8033
8287
|
}, undefined, false, undefined, this),
|
|
8034
|
-
model.error ? /* @__PURE__ */
|
|
8288
|
+
model.error ? /* @__PURE__ */ jsxDEV15("p", {
|
|
8035
8289
|
className: "absolute-voice-routing-status__error",
|
|
8036
8290
|
children: model.error
|
|
8037
8291
|
}, undefined, false, undefined, this) : null
|
|
@@ -8119,9 +8373,9 @@ var createVoiceTraceTimelineStore = (path = "/api/voice-traces", options = {}) =
|
|
|
8119
8373
|
};
|
|
8120
8374
|
|
|
8121
8375
|
// src/client/traceTimelineWidget.ts
|
|
8122
|
-
var
|
|
8123
|
-
var
|
|
8124
|
-
var
|
|
8376
|
+
var DEFAULT_TITLE15 = "Voice Traces";
|
|
8377
|
+
var DEFAULT_DESCRIPTION15 = "Latest call timelines with provider latency, fallbacks, handoffs, and errors from your self-hosted trace store.";
|
|
8378
|
+
var escapeHtml21 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
8125
8379
|
var formatMs3 = (value) => typeof value === "number" ? `${value}ms` : "n/a";
|
|
8126
8380
|
var formatProviders = (session) => session.providers.length ? session.providers.map((provider) => provider.provider).join(", ") : "No providers";
|
|
8127
8381
|
var createVoiceTraceTimelineViewModel = (snapshot, options = {}) => {
|
|
@@ -8137,13 +8391,13 @@ var createVoiceTraceTimelineViewModel = (snapshot, options = {}) => {
|
|
|
8137
8391
|
const failed = sessions.filter((session) => session.status === "failed").length;
|
|
8138
8392
|
const warnings = sessions.filter((session) => session.status === "warning").length;
|
|
8139
8393
|
return {
|
|
8140
|
-
description: options.description ??
|
|
8394
|
+
description: options.description ?? DEFAULT_DESCRIPTION15,
|
|
8141
8395
|
error: snapshot.error,
|
|
8142
8396
|
isLoading: snapshot.isLoading,
|
|
8143
8397
|
label: snapshot.error ? "Unavailable" : failed > 0 ? `${failed} failed` : warnings > 0 ? `${warnings} warning` : sessions.length ? `${sessions.length} recent` : snapshot.isLoading ? "Checking" : "No traces yet",
|
|
8144
8398
|
sessions,
|
|
8145
8399
|
status: snapshot.error ? "error" : failed > 0 ? "failed" : warnings > 0 ? "warning" : sessions.length ? "ready" : snapshot.isLoading ? "loading" : "empty",
|
|
8146
|
-
title: options.title ??
|
|
8400
|
+
title: options.title ?? DEFAULT_TITLE15,
|
|
8147
8401
|
updatedAt: snapshot.updatedAt
|
|
8148
8402
|
};
|
|
8149
8403
|
};
|
|
@@ -8151,27 +8405,27 @@ var renderVoiceTraceTimelineWidgetHTML = (snapshot, options = {}) => {
|
|
|
8151
8405
|
const model = createVoiceTraceTimelineViewModel(snapshot, options);
|
|
8152
8406
|
const sessions = model.sessions.length ? `<div class="absolute-voice-trace-timeline__sessions">${model.sessions.map((session) => {
|
|
8153
8407
|
const supportLinks = [
|
|
8154
|
-
`<a href="${
|
|
8155
|
-
session.operationsRecordHref ? `<a href="${
|
|
8156
|
-
session.incidentBundleHref ? `<a href="${
|
|
8408
|
+
`<a href="${escapeHtml21(session.detailHref)}">Open timeline</a>`,
|
|
8409
|
+
session.operationsRecordHref ? `<a href="${escapeHtml21(session.operationsRecordHref)}">Open operations record</a>` : undefined,
|
|
8410
|
+
session.incidentBundleHref ? `<a href="${escapeHtml21(session.incidentBundleHref)}">Export incident bundle</a>` : undefined
|
|
8157
8411
|
].filter(Boolean).join("");
|
|
8158
|
-
return `<article class="absolute-voice-trace-timeline__session absolute-voice-trace-timeline__session--${
|
|
8412
|
+
return `<article class="absolute-voice-trace-timeline__session absolute-voice-trace-timeline__session--${escapeHtml21(session.status)}">
|
|
8159
8413
|
<header>
|
|
8160
|
-
<strong>${
|
|
8161
|
-
<span>${
|
|
8414
|
+
<strong>${escapeHtml21(session.sessionId)}</strong>
|
|
8415
|
+
<span>${escapeHtml21(session.status)}</span>
|
|
8162
8416
|
</header>
|
|
8163
|
-
<p>${
|
|
8417
|
+
<p>${escapeHtml21(session.label)} \xB7 ${escapeHtml21(session.durationLabel)} \xB7 ${escapeHtml21(session.providerLabel)}</p>
|
|
8164
8418
|
<p class="absolute-voice-trace-timeline__actions">${supportLinks}</p>
|
|
8165
8419
|
</article>`;
|
|
8166
8420
|
}).join("")}</div>` : '<p class="absolute-voice-trace-timeline__empty">Run a voice session to see call timelines.</p>';
|
|
8167
|
-
return `<section class="absolute-voice-trace-timeline absolute-voice-trace-timeline--${
|
|
8421
|
+
return `<section class="absolute-voice-trace-timeline absolute-voice-trace-timeline--${escapeHtml21(model.status)}">
|
|
8168
8422
|
<header class="absolute-voice-trace-timeline__header">
|
|
8169
|
-
<span class="absolute-voice-trace-timeline__eyebrow">${
|
|
8170
|
-
<strong class="absolute-voice-trace-timeline__label">${
|
|
8423
|
+
<span class="absolute-voice-trace-timeline__eyebrow">${escapeHtml21(model.title)}</span>
|
|
8424
|
+
<strong class="absolute-voice-trace-timeline__label">${escapeHtml21(model.label)}</strong>
|
|
8171
8425
|
</header>
|
|
8172
|
-
<p class="absolute-voice-trace-timeline__description">${
|
|
8426
|
+
<p class="absolute-voice-trace-timeline__description">${escapeHtml21(model.description)}</p>
|
|
8173
8427
|
${sessions}
|
|
8174
|
-
${model.error ? `<p class="absolute-voice-trace-timeline__error">${
|
|
8428
|
+
${model.error ? `<p class="absolute-voice-trace-timeline__error">${escapeHtml21(model.error)}</p>` : ""}
|
|
8175
8429
|
</section>`;
|
|
8176
8430
|
};
|
|
8177
8431
|
var getVoiceTraceTimelineCSS = () => `.absolute-voice-trace-timeline{border:1px solid #bad7d3;border-radius:20px;background:#f3fffb;color:#09201c;padding:18px;box-shadow:0 18px 40px rgba(9,32,28,.12);font-family:inherit}.absolute-voice-trace-timeline--error,.absolute-voice-trace-timeline--failed{border-color:#f2a7a7;background:#fff5f3}.absolute-voice-trace-timeline--warning{border-color:#fbbf24;background:#fffaf0}.absolute-voice-trace-timeline__header,.absolute-voice-trace-timeline__session header{align-items:start;display:flex;gap:12px;justify-content:space-between}.absolute-voice-trace-timeline__eyebrow{color:#17665b;font-size:12px;font-weight:800;letter-spacing:.08em;text-transform:uppercase}.absolute-voice-trace-timeline__label{font-size:24px;line-height:1}.absolute-voice-trace-timeline__description,.absolute-voice-trace-timeline__session p,.absolute-voice-trace-timeline__empty{color:#35544f}.absolute-voice-trace-timeline__sessions{display:grid;gap:12px;margin-top:14px}.absolute-voice-trace-timeline__session{background:#fff;border:1px solid #cfe7e2;border-radius:16px;padding:14px}.absolute-voice-trace-timeline__session--failed{border-color:#f2a7a7}.absolute-voice-trace-timeline__session--warning{border-color:#fbbf24}.absolute-voice-trace-timeline__session p{margin:10px 0}.absolute-voice-trace-timeline__actions{display:flex;flex-wrap:wrap;gap:10px}.absolute-voice-trace-timeline__session a{color:#0f766e;font-weight:800}.absolute-voice-trace-timeline__empty{margin:14px 0 0}.absolute-voice-trace-timeline__error{color:#9f1239;font-weight:700}`;
|
|
@@ -8218,25 +8472,25 @@ var defineVoiceTraceTimelineElement = (tagName = "absolute-voice-trace-timeline"
|
|
|
8218
8472
|
};
|
|
8219
8473
|
|
|
8220
8474
|
// src/react/useVoiceTraceTimeline.tsx
|
|
8221
|
-
import { useEffect as
|
|
8475
|
+
import { useEffect as useEffect16, useRef as useRef16, useSyncExternalStore as useSyncExternalStore16 } from "react";
|
|
8222
8476
|
var useVoiceTraceTimeline = (path = "/api/voice-traces", options = {}) => {
|
|
8223
|
-
const storeRef =
|
|
8477
|
+
const storeRef = useRef16(null);
|
|
8224
8478
|
if (!storeRef.current) {
|
|
8225
8479
|
storeRef.current = createVoiceTraceTimelineStore(path, options);
|
|
8226
8480
|
}
|
|
8227
8481
|
const store = storeRef.current;
|
|
8228
|
-
|
|
8482
|
+
useEffect16(() => {
|
|
8229
8483
|
store.refresh().catch(() => {});
|
|
8230
8484
|
return () => store.close();
|
|
8231
8485
|
}, [store]);
|
|
8232
8486
|
return {
|
|
8233
|
-
...
|
|
8487
|
+
...useSyncExternalStore16(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
8234
8488
|
refresh: store.refresh
|
|
8235
8489
|
};
|
|
8236
8490
|
};
|
|
8237
8491
|
|
|
8238
8492
|
// src/react/VoiceTraceTimeline.tsx
|
|
8239
|
-
import { jsxDEV as
|
|
8493
|
+
import { jsxDEV as jsxDEV16 } from "react/jsx-dev-runtime";
|
|
8240
8494
|
var VoiceTraceTimeline = ({
|
|
8241
8495
|
className,
|
|
8242
8496
|
path = "/api/voice-traces",
|
|
@@ -8244,49 +8498,49 @@ var VoiceTraceTimeline = ({
|
|
|
8244
8498
|
}) => {
|
|
8245
8499
|
const snapshot = useVoiceTraceTimeline(path, options);
|
|
8246
8500
|
const model = createVoiceTraceTimelineViewModel(snapshot, options);
|
|
8247
|
-
return /* @__PURE__ */
|
|
8501
|
+
return /* @__PURE__ */ jsxDEV16("section", {
|
|
8248
8502
|
className: [
|
|
8249
8503
|
"absolute-voice-trace-timeline",
|
|
8250
8504
|
`absolute-voice-trace-timeline--${model.status}`,
|
|
8251
8505
|
className
|
|
8252
8506
|
].filter(Boolean).join(" "),
|
|
8253
8507
|
children: [
|
|
8254
|
-
/* @__PURE__ */
|
|
8508
|
+
/* @__PURE__ */ jsxDEV16("header", {
|
|
8255
8509
|
className: "absolute-voice-trace-timeline__header",
|
|
8256
8510
|
children: [
|
|
8257
|
-
/* @__PURE__ */
|
|
8511
|
+
/* @__PURE__ */ jsxDEV16("span", {
|
|
8258
8512
|
className: "absolute-voice-trace-timeline__eyebrow",
|
|
8259
8513
|
children: model.title
|
|
8260
8514
|
}, undefined, false, undefined, this),
|
|
8261
|
-
/* @__PURE__ */
|
|
8515
|
+
/* @__PURE__ */ jsxDEV16("strong", {
|
|
8262
8516
|
className: "absolute-voice-trace-timeline__label",
|
|
8263
8517
|
children: model.label
|
|
8264
8518
|
}, undefined, false, undefined, this)
|
|
8265
8519
|
]
|
|
8266
8520
|
}, undefined, true, undefined, this),
|
|
8267
|
-
/* @__PURE__ */
|
|
8521
|
+
/* @__PURE__ */ jsxDEV16("p", {
|
|
8268
8522
|
className: "absolute-voice-trace-timeline__description",
|
|
8269
8523
|
children: model.description
|
|
8270
8524
|
}, undefined, false, undefined, this),
|
|
8271
|
-
model.sessions.length ? /* @__PURE__ */
|
|
8525
|
+
model.sessions.length ? /* @__PURE__ */ jsxDEV16("div", {
|
|
8272
8526
|
className: "absolute-voice-trace-timeline__sessions",
|
|
8273
|
-
children: model.sessions.map((session) => /* @__PURE__ */
|
|
8527
|
+
children: model.sessions.map((session) => /* @__PURE__ */ jsxDEV16("article", {
|
|
8274
8528
|
className: [
|
|
8275
8529
|
"absolute-voice-trace-timeline__session",
|
|
8276
8530
|
`absolute-voice-trace-timeline__session--${session.status}`
|
|
8277
8531
|
].join(" "),
|
|
8278
8532
|
children: [
|
|
8279
|
-
/* @__PURE__ */
|
|
8533
|
+
/* @__PURE__ */ jsxDEV16("header", {
|
|
8280
8534
|
children: [
|
|
8281
|
-
/* @__PURE__ */
|
|
8535
|
+
/* @__PURE__ */ jsxDEV16("strong", {
|
|
8282
8536
|
children: session.sessionId
|
|
8283
8537
|
}, undefined, false, undefined, this),
|
|
8284
|
-
/* @__PURE__ */
|
|
8538
|
+
/* @__PURE__ */ jsxDEV16("span", {
|
|
8285
8539
|
children: session.status
|
|
8286
8540
|
}, undefined, false, undefined, this)
|
|
8287
8541
|
]
|
|
8288
8542
|
}, undefined, true, undefined, this),
|
|
8289
|
-
/* @__PURE__ */
|
|
8543
|
+
/* @__PURE__ */ jsxDEV16("p", {
|
|
8290
8544
|
children: [
|
|
8291
8545
|
session.label,
|
|
8292
8546
|
" \xB7 ",
|
|
@@ -8296,18 +8550,18 @@ var VoiceTraceTimeline = ({
|
|
|
8296
8550
|
session.providerLabel
|
|
8297
8551
|
]
|
|
8298
8552
|
}, undefined, true, undefined, this),
|
|
8299
|
-
/* @__PURE__ */
|
|
8553
|
+
/* @__PURE__ */ jsxDEV16("p", {
|
|
8300
8554
|
className: "absolute-voice-trace-timeline__actions",
|
|
8301
8555
|
children: [
|
|
8302
|
-
/* @__PURE__ */
|
|
8556
|
+
/* @__PURE__ */ jsxDEV16("a", {
|
|
8303
8557
|
href: session.detailHref,
|
|
8304
8558
|
children: "Open timeline"
|
|
8305
8559
|
}, undefined, false, undefined, this),
|
|
8306
|
-
session.operationsRecordHref ? /* @__PURE__ */
|
|
8560
|
+
session.operationsRecordHref ? /* @__PURE__ */ jsxDEV16("a", {
|
|
8307
8561
|
href: session.operationsRecordHref,
|
|
8308
8562
|
children: "Open operations record"
|
|
8309
8563
|
}, undefined, false, undefined, this) : null,
|
|
8310
|
-
session.incidentBundleHref ? /* @__PURE__ */
|
|
8564
|
+
session.incidentBundleHref ? /* @__PURE__ */ jsxDEV16("a", {
|
|
8311
8565
|
href: session.incidentBundleHref,
|
|
8312
8566
|
children: "Export incident bundle"
|
|
8313
8567
|
}, undefined, false, undefined, this) : null
|
|
@@ -8315,11 +8569,11 @@ var VoiceTraceTimeline = ({
|
|
|
8315
8569
|
}, undefined, true, undefined, this)
|
|
8316
8570
|
]
|
|
8317
8571
|
}, session.sessionId, true, undefined, this))
|
|
8318
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
8572
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV16("p", {
|
|
8319
8573
|
className: "absolute-voice-trace-timeline__empty",
|
|
8320
8574
|
children: "Run a voice session to see call timelines."
|
|
8321
8575
|
}, undefined, false, undefined, this),
|
|
8322
|
-
model.error ? /* @__PURE__ */
|
|
8576
|
+
model.error ? /* @__PURE__ */ jsxDEV16("p", {
|
|
8323
8577
|
className: "absolute-voice-trace-timeline__error",
|
|
8324
8578
|
children: model.error
|
|
8325
8579
|
}, undefined, false, undefined, this) : null
|
|
@@ -8327,7 +8581,7 @@ var VoiceTraceTimeline = ({
|
|
|
8327
8581
|
}, undefined, true, undefined, this);
|
|
8328
8582
|
};
|
|
8329
8583
|
// src/react/useVoiceAgentSquadStatus.tsx
|
|
8330
|
-
import { useEffect as
|
|
8584
|
+
import { useEffect as useEffect17, useRef as useRef17, useSyncExternalStore as useSyncExternalStore17 } from "react";
|
|
8331
8585
|
|
|
8332
8586
|
// src/client/agentSquadStatus.ts
|
|
8333
8587
|
var getString4 = (value) => typeof value === "string" && value.trim() ? value.trim() : undefined;
|
|
@@ -8405,25 +8659,25 @@ var createVoiceAgentSquadStatusStore = (path = "/api/voice-traces", options = {}
|
|
|
8405
8659
|
|
|
8406
8660
|
// src/react/useVoiceAgentSquadStatus.tsx
|
|
8407
8661
|
var useVoiceAgentSquadStatus = (path = "/api/voice-traces", options = {}) => {
|
|
8408
|
-
const storeRef =
|
|
8662
|
+
const storeRef = useRef17(null);
|
|
8409
8663
|
if (!storeRef.current) {
|
|
8410
8664
|
storeRef.current = createVoiceAgentSquadStatusStore(path, options);
|
|
8411
8665
|
}
|
|
8412
8666
|
const store = storeRef.current;
|
|
8413
|
-
|
|
8667
|
+
useEffect17(() => {
|
|
8414
8668
|
store.refresh().catch(() => {});
|
|
8415
8669
|
return () => store.close();
|
|
8416
8670
|
}, [store]);
|
|
8417
8671
|
return {
|
|
8418
|
-
...
|
|
8672
|
+
...useSyncExternalStore17(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
8419
8673
|
refresh: store.refresh
|
|
8420
8674
|
};
|
|
8421
8675
|
};
|
|
8422
8676
|
|
|
8423
8677
|
// src/client/agentSquadStatusWidget.ts
|
|
8424
|
-
var
|
|
8425
|
-
var
|
|
8426
|
-
var
|
|
8678
|
+
var DEFAULT_TITLE16 = "Voice Agent Squad";
|
|
8679
|
+
var DEFAULT_DESCRIPTION16 = "Current specialist and recent handoffs from your self-hosted voice traces.";
|
|
8680
|
+
var escapeHtml22 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
8427
8681
|
var labelFor = (current) => {
|
|
8428
8682
|
if (!current)
|
|
8429
8683
|
return "Waiting for specialist activity";
|
|
@@ -8437,37 +8691,37 @@ var labelFor = (current) => {
|
|
|
8437
8691
|
};
|
|
8438
8692
|
var createVoiceAgentSquadStatusViewModel = (snapshot, options = {}) => ({
|
|
8439
8693
|
current: snapshot.report.current,
|
|
8440
|
-
description: options.description ??
|
|
8694
|
+
description: options.description ?? DEFAULT_DESCRIPTION16,
|
|
8441
8695
|
error: snapshot.error,
|
|
8442
8696
|
isLoading: snapshot.isLoading,
|
|
8443
8697
|
label: snapshot.error ? "Unavailable" : labelFor(snapshot.report.current),
|
|
8444
8698
|
sessionCount: snapshot.report.sessionCount,
|
|
8445
8699
|
sessions: snapshot.report.sessions,
|
|
8446
|
-
title: options.title ??
|
|
8700
|
+
title: options.title ?? DEFAULT_TITLE16,
|
|
8447
8701
|
updatedAt: snapshot.updatedAt
|
|
8448
8702
|
});
|
|
8449
8703
|
var renderVoiceAgentSquadStatusHTML = (snapshot, options = {}) => {
|
|
8450
8704
|
const model = createVoiceAgentSquadStatusViewModel(snapshot, options);
|
|
8451
8705
|
const current = model.current;
|
|
8452
8706
|
const rows = model.sessions.length ? model.sessions.slice(0, 5).map((session) => `<li>
|
|
8453
|
-
<span>${
|
|
8454
|
-
<strong>${
|
|
8455
|
-
<em>${
|
|
8456
|
-
${session.summary || session.reason ? `<p>${
|
|
8707
|
+
<span>${escapeHtml22(session.sessionId)}</span>
|
|
8708
|
+
<strong>${escapeHtml22(session.targetAgentId ?? "none")}</strong>
|
|
8709
|
+
<em>${escapeHtml22(session.status)}</em>
|
|
8710
|
+
${session.summary || session.reason ? `<p>${escapeHtml22(session.summary ?? session.reason ?? "")}</p>` : ""}
|
|
8457
8711
|
</li>`).join("") : "<li><span>No squad traces yet.</span><strong>Waiting</strong></li>";
|
|
8458
8712
|
return `<section class="absolute-voice-agent-squad-status">
|
|
8459
8713
|
<header>
|
|
8460
|
-
<span>${
|
|
8461
|
-
<strong>${
|
|
8714
|
+
<span>${escapeHtml22(model.title)}</span>
|
|
8715
|
+
<strong>${escapeHtml22(model.label)}</strong>
|
|
8462
8716
|
</header>
|
|
8463
|
-
<p>${
|
|
8717
|
+
<p>${escapeHtml22(model.description)}</p>
|
|
8464
8718
|
<div>
|
|
8465
|
-
<span>Session</span><strong>${
|
|
8466
|
-
<span>From</span><strong>${
|
|
8467
|
-
<span>Status</span><strong>${
|
|
8719
|
+
<span>Session</span><strong>${escapeHtml22(current?.sessionId ?? "n/a")}</strong>
|
|
8720
|
+
<span>From</span><strong>${escapeHtml22(current?.fromAgentId ?? "n/a")}</strong>
|
|
8721
|
+
<span>Status</span><strong>${escapeHtml22(current?.status ?? "idle")}</strong>
|
|
8468
8722
|
</div>
|
|
8469
8723
|
<ul>${rows}</ul>
|
|
8470
|
-
${model.error ? `<p class="absolute-voice-agent-squad-status__error">${
|
|
8724
|
+
${model.error ? `<p class="absolute-voice-agent-squad-status__error">${escapeHtml22(model.error)}</p>` : ""}
|
|
8471
8725
|
</section>`;
|
|
8472
8726
|
};
|
|
8473
8727
|
var getVoiceAgentSquadStatusCSS = () => `.absolute-voice-agent-squad-status{border:1px solid #38bdf866;border-radius:20px;background:#0f172a;color:#f8fafc;padding:18px;font-family:inherit}.absolute-voice-agent-squad-status header{display:grid;gap:4px}.absolute-voice-agent-squad-status header span{color:#7dd3fc;font-size:12px;font-weight:900;letter-spacing:.08em;text-transform:uppercase}.absolute-voice-agent-squad-status header strong{font-size:20px}.absolute-voice-agent-squad-status p{color:#cbd5e1}.absolute-voice-agent-squad-status div{display:grid;gap:6px;grid-template-columns:max-content 1fr;margin:14px 0}.absolute-voice-agent-squad-status div span{color:#94a3b8}.absolute-voice-agent-squad-status ul{display:grid;gap:8px;list-style:none;margin:0;padding:0}.absolute-voice-agent-squad-status li{background:#020617;border:1px solid #1e293b;border-radius:14px;padding:10px}.absolute-voice-agent-squad-status li span{color:#94a3b8;display:block;font-size:12px}.absolute-voice-agent-squad-status li strong{display:block}.absolute-voice-agent-squad-status li em{color:#7dd3fc;font-style:normal}.absolute-voice-agent-squad-status__error{color:#fecaca;font-weight:800}`;
|
|
@@ -8512,7 +8766,7 @@ var defineVoiceAgentSquadStatusElement = (tagName = "absolute-voice-agent-squad-
|
|
|
8512
8766
|
};
|
|
8513
8767
|
|
|
8514
8768
|
// src/react/VoiceAgentSquadStatus.tsx
|
|
8515
|
-
import { jsxDEV as
|
|
8769
|
+
import { jsxDEV as jsxDEV17 } from "react/jsx-dev-runtime";
|
|
8516
8770
|
function VoiceAgentSquadStatus({
|
|
8517
8771
|
path = "/api/voice-traces",
|
|
8518
8772
|
...options
|
|
@@ -8520,64 +8774,64 @@ function VoiceAgentSquadStatus({
|
|
|
8520
8774
|
const snapshot = useVoiceAgentSquadStatus(path, options);
|
|
8521
8775
|
const model = createVoiceAgentSquadStatusViewModel(snapshot, options);
|
|
8522
8776
|
const current = model.current;
|
|
8523
|
-
return /* @__PURE__ */
|
|
8777
|
+
return /* @__PURE__ */ jsxDEV17("section", {
|
|
8524
8778
|
className: "absolute-voice-agent-squad-status",
|
|
8525
8779
|
children: [
|
|
8526
|
-
/* @__PURE__ */
|
|
8780
|
+
/* @__PURE__ */ jsxDEV17("header", {
|
|
8527
8781
|
children: [
|
|
8528
|
-
/* @__PURE__ */
|
|
8782
|
+
/* @__PURE__ */ jsxDEV17("span", {
|
|
8529
8783
|
children: model.title
|
|
8530
8784
|
}, undefined, false, undefined, this),
|
|
8531
|
-
/* @__PURE__ */
|
|
8785
|
+
/* @__PURE__ */ jsxDEV17("strong", {
|
|
8532
8786
|
children: model.label
|
|
8533
8787
|
}, undefined, false, undefined, this)
|
|
8534
8788
|
]
|
|
8535
8789
|
}, undefined, true, undefined, this),
|
|
8536
|
-
/* @__PURE__ */
|
|
8790
|
+
/* @__PURE__ */ jsxDEV17("p", {
|
|
8537
8791
|
children: model.description
|
|
8538
8792
|
}, undefined, false, undefined, this),
|
|
8539
|
-
/* @__PURE__ */
|
|
8793
|
+
/* @__PURE__ */ jsxDEV17("dl", {
|
|
8540
8794
|
children: [
|
|
8541
|
-
/* @__PURE__ */
|
|
8795
|
+
/* @__PURE__ */ jsxDEV17("div", {
|
|
8542
8796
|
children: [
|
|
8543
|
-
/* @__PURE__ */
|
|
8797
|
+
/* @__PURE__ */ jsxDEV17("dt", {
|
|
8544
8798
|
children: "Session"
|
|
8545
8799
|
}, undefined, false, undefined, this),
|
|
8546
|
-
/* @__PURE__ */
|
|
8800
|
+
/* @__PURE__ */ jsxDEV17("dd", {
|
|
8547
8801
|
children: current?.sessionId ?? "n/a"
|
|
8548
8802
|
}, undefined, false, undefined, this)
|
|
8549
8803
|
]
|
|
8550
8804
|
}, undefined, true, undefined, this),
|
|
8551
|
-
/* @__PURE__ */
|
|
8805
|
+
/* @__PURE__ */ jsxDEV17("div", {
|
|
8552
8806
|
children: [
|
|
8553
|
-
/* @__PURE__ */
|
|
8807
|
+
/* @__PURE__ */ jsxDEV17("dt", {
|
|
8554
8808
|
children: "Current specialist"
|
|
8555
8809
|
}, undefined, false, undefined, this),
|
|
8556
|
-
/* @__PURE__ */
|
|
8810
|
+
/* @__PURE__ */ jsxDEV17("dd", {
|
|
8557
8811
|
children: current?.targetAgentId ?? "none"
|
|
8558
8812
|
}, undefined, false, undefined, this)
|
|
8559
8813
|
]
|
|
8560
8814
|
}, undefined, true, undefined, this),
|
|
8561
|
-
/* @__PURE__ */
|
|
8815
|
+
/* @__PURE__ */ jsxDEV17("div", {
|
|
8562
8816
|
children: [
|
|
8563
|
-
/* @__PURE__ */
|
|
8817
|
+
/* @__PURE__ */ jsxDEV17("dt", {
|
|
8564
8818
|
children: "Status"
|
|
8565
8819
|
}, undefined, false, undefined, this),
|
|
8566
|
-
/* @__PURE__ */
|
|
8820
|
+
/* @__PURE__ */ jsxDEV17("dd", {
|
|
8567
8821
|
children: current?.status ?? "idle"
|
|
8568
8822
|
}, undefined, false, undefined, this)
|
|
8569
8823
|
]
|
|
8570
8824
|
}, undefined, true, undefined, this)
|
|
8571
8825
|
]
|
|
8572
8826
|
}, undefined, true, undefined, this),
|
|
8573
|
-
model.error ? /* @__PURE__ */
|
|
8827
|
+
model.error ? /* @__PURE__ */ jsxDEV17("p", {
|
|
8574
8828
|
children: model.error
|
|
8575
8829
|
}, undefined, false, undefined, this) : null
|
|
8576
8830
|
]
|
|
8577
8831
|
}, undefined, true, undefined, this);
|
|
8578
8832
|
}
|
|
8579
8833
|
// src/react/useVoiceTurnLatency.tsx
|
|
8580
|
-
import { useEffect as
|
|
8834
|
+
import { useEffect as useEffect18, useRef as useRef18, useSyncExternalStore as useSyncExternalStore18 } from "react";
|
|
8581
8835
|
|
|
8582
8836
|
// src/client/turnLatency.ts
|
|
8583
8837
|
var fetchVoiceTurnLatency = async (path = "/api/turn-latency", options = {}) => {
|
|
@@ -8684,27 +8938,27 @@ var createVoiceTurnLatencyStore = (path = "/api/turn-latency", options = {}) =>
|
|
|
8684
8938
|
|
|
8685
8939
|
// src/react/useVoiceTurnLatency.tsx
|
|
8686
8940
|
var useVoiceTurnLatency = (path = "/api/turn-latency", options = {}) => {
|
|
8687
|
-
const storeRef =
|
|
8941
|
+
const storeRef = useRef18(null);
|
|
8688
8942
|
if (!storeRef.current) {
|
|
8689
8943
|
storeRef.current = createVoiceTurnLatencyStore(path, options);
|
|
8690
8944
|
}
|
|
8691
8945
|
const store = storeRef.current;
|
|
8692
|
-
|
|
8946
|
+
useEffect18(() => {
|
|
8693
8947
|
store.refresh().catch(() => {});
|
|
8694
8948
|
return () => store.close();
|
|
8695
8949
|
}, [store]);
|
|
8696
8950
|
return {
|
|
8697
|
-
...
|
|
8951
|
+
...useSyncExternalStore18(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
8698
8952
|
refresh: store.refresh,
|
|
8699
8953
|
runProof: store.runProof
|
|
8700
8954
|
};
|
|
8701
8955
|
};
|
|
8702
8956
|
|
|
8703
8957
|
// src/client/turnLatencyWidget.ts
|
|
8704
|
-
var
|
|
8705
|
-
var
|
|
8958
|
+
var DEFAULT_TITLE17 = "Turn Latency";
|
|
8959
|
+
var DEFAULT_DESCRIPTION17 = "Per-turn timing from first transcript to commit and assistant response start.";
|
|
8706
8960
|
var DEFAULT_PROOF_LABEL = "Run latency proof";
|
|
8707
|
-
var
|
|
8961
|
+
var escapeHtml23 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
8708
8962
|
var formatMs4 = (value) => typeof value === "number" ? `${Math.round(value)}ms` : "n/a";
|
|
8709
8963
|
var createVoiceTurnLatencyViewModel = (snapshot, options = {}) => {
|
|
8710
8964
|
const turns = (snapshot.report?.turns ?? []).map((turn) => ({
|
|
@@ -8718,39 +8972,39 @@ var createVoiceTurnLatencyViewModel = (snapshot, options = {}) => {
|
|
|
8718
8972
|
const warningCount = snapshot.report?.warnings ?? turns.filter((turn) => turn.status === "warn").length;
|
|
8719
8973
|
const failedCount = snapshot.report?.failed ?? turns.filter((turn) => turn.status === "fail").length;
|
|
8720
8974
|
return {
|
|
8721
|
-
description: options.description ??
|
|
8975
|
+
description: options.description ?? DEFAULT_DESCRIPTION17,
|
|
8722
8976
|
error: snapshot.error,
|
|
8723
8977
|
isLoading: snapshot.isLoading,
|
|
8724
8978
|
label: snapshot.error ? "Unavailable" : turns.length ? failedCount > 0 ? `${failedCount} slow` : warningCount > 0 ? `${warningCount} warnings` : `avg ${formatMs4(snapshot.report?.averageTotalMs)}` : snapshot.isLoading ? "Checking" : "No turns",
|
|
8725
8979
|
proofLabel: options.proofPath ? options.proofLabel ?? DEFAULT_PROOF_LABEL : undefined,
|
|
8726
8980
|
showProofAction: Boolean(options.proofPath),
|
|
8727
8981
|
status: snapshot.error ? "error" : turns.length ? failedCount > 0 || warningCount > 0 ? "warning" : "ready" : snapshot.isLoading ? "loading" : "empty",
|
|
8728
|
-
title: options.title ??
|
|
8982
|
+
title: options.title ?? DEFAULT_TITLE17,
|
|
8729
8983
|
turns,
|
|
8730
8984
|
updatedAt: snapshot.updatedAt
|
|
8731
8985
|
};
|
|
8732
8986
|
};
|
|
8733
8987
|
var renderVoiceTurnLatencyHTML = (snapshot, options = {}) => {
|
|
8734
8988
|
const model = createVoiceTurnLatencyViewModel(snapshot, options);
|
|
8735
|
-
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--${
|
|
8989
|
+
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--${escapeHtml23(turn.status)}">
|
|
8736
8990
|
<header>
|
|
8737
|
-
<strong>${
|
|
8738
|
-
<span>${
|
|
8991
|
+
<strong>${escapeHtml23(turn.label)}</strong>
|
|
8992
|
+
<span>${escapeHtml23(turn.status)}</span>
|
|
8739
8993
|
</header>
|
|
8740
8994
|
<dl>${turn.rows.map((row) => `<div>
|
|
8741
|
-
<dt>${
|
|
8742
|
-
<dd>${
|
|
8995
|
+
<dt>${escapeHtml23(row.label)}</dt>
|
|
8996
|
+
<dd>${escapeHtml23(row.value)}</dd>
|
|
8743
8997
|
</div>`).join("")}</dl>
|
|
8744
8998
|
</article>`).join("")}</div>` : '<p class="absolute-voice-turn-latency__empty">Complete a voice turn to see latency diagnostics.</p>';
|
|
8745
|
-
return `<section class="absolute-voice-turn-latency absolute-voice-turn-latency--${
|
|
8999
|
+
return `<section class="absolute-voice-turn-latency absolute-voice-turn-latency--${escapeHtml23(model.status)}">
|
|
8746
9000
|
<header class="absolute-voice-turn-latency__header">
|
|
8747
|
-
<span class="absolute-voice-turn-latency__eyebrow">${
|
|
8748
|
-
<strong class="absolute-voice-turn-latency__label">${
|
|
9001
|
+
<span class="absolute-voice-turn-latency__eyebrow">${escapeHtml23(model.title)}</span>
|
|
9002
|
+
<strong class="absolute-voice-turn-latency__label">${escapeHtml23(model.label)}</strong>
|
|
8749
9003
|
</header>
|
|
8750
|
-
<p class="absolute-voice-turn-latency__description">${
|
|
8751
|
-
${model.showProofAction ? `<button class="absolute-voice-turn-latency__proof" data-absolute-voice-turn-latency-proof type="button">${
|
|
9004
|
+
<p class="absolute-voice-turn-latency__description">${escapeHtml23(model.description)}</p>
|
|
9005
|
+
${model.showProofAction ? `<button class="absolute-voice-turn-latency__proof" data-absolute-voice-turn-latency-proof type="button">${escapeHtml23(model.proofLabel ?? DEFAULT_PROOF_LABEL)}</button>` : ""}
|
|
8752
9006
|
${turns}
|
|
8753
|
-
${model.error ? `<p class="absolute-voice-turn-latency__error">${
|
|
9007
|
+
${model.error ? `<p class="absolute-voice-turn-latency__error">${escapeHtml23(model.error)}</p>` : ""}
|
|
8754
9008
|
</section>`;
|
|
8755
9009
|
};
|
|
8756
9010
|
var mountVoiceTurnLatency = (element, path = "/api/turn-latency", options = {}) => {
|
|
@@ -8801,7 +9055,7 @@ var defineVoiceTurnLatencyElement = (tagName = "absolute-voice-turn-latency") =>
|
|
|
8801
9055
|
};
|
|
8802
9056
|
|
|
8803
9057
|
// src/react/VoiceTurnLatency.tsx
|
|
8804
|
-
import { jsxDEV as
|
|
9058
|
+
import { jsxDEV as jsxDEV18 } from "react/jsx-dev-runtime";
|
|
8805
9059
|
var VoiceTurnLatency = ({
|
|
8806
9060
|
className,
|
|
8807
9061
|
path = "/api/turn-latency",
|
|
@@ -8809,31 +9063,31 @@ var VoiceTurnLatency = ({
|
|
|
8809
9063
|
}) => {
|
|
8810
9064
|
const latency = useVoiceTurnLatency(path, options);
|
|
8811
9065
|
const model = createVoiceTurnLatencyViewModel(latency, options);
|
|
8812
|
-
return /* @__PURE__ */
|
|
9066
|
+
return /* @__PURE__ */ jsxDEV18("section", {
|
|
8813
9067
|
className: [
|
|
8814
9068
|
"absolute-voice-turn-latency",
|
|
8815
9069
|
`absolute-voice-turn-latency--${model.status}`,
|
|
8816
9070
|
className
|
|
8817
9071
|
].filter(Boolean).join(" "),
|
|
8818
9072
|
children: [
|
|
8819
|
-
/* @__PURE__ */
|
|
9073
|
+
/* @__PURE__ */ jsxDEV18("header", {
|
|
8820
9074
|
className: "absolute-voice-turn-latency__header",
|
|
8821
9075
|
children: [
|
|
8822
|
-
/* @__PURE__ */
|
|
9076
|
+
/* @__PURE__ */ jsxDEV18("span", {
|
|
8823
9077
|
className: "absolute-voice-turn-latency__eyebrow",
|
|
8824
9078
|
children: model.title
|
|
8825
9079
|
}, undefined, false, undefined, this),
|
|
8826
|
-
/* @__PURE__ */
|
|
9080
|
+
/* @__PURE__ */ jsxDEV18("strong", {
|
|
8827
9081
|
className: "absolute-voice-turn-latency__label",
|
|
8828
9082
|
children: model.label
|
|
8829
9083
|
}, undefined, false, undefined, this)
|
|
8830
9084
|
]
|
|
8831
9085
|
}, undefined, true, undefined, this),
|
|
8832
|
-
/* @__PURE__ */
|
|
9086
|
+
/* @__PURE__ */ jsxDEV18("p", {
|
|
8833
9087
|
className: "absolute-voice-turn-latency__description",
|
|
8834
9088
|
children: model.description
|
|
8835
9089
|
}, undefined, false, undefined, this),
|
|
8836
|
-
model.showProofAction ? /* @__PURE__ */
|
|
9090
|
+
model.showProofAction ? /* @__PURE__ */ jsxDEV18("button", {
|
|
8837
9091
|
className: "absolute-voice-turn-latency__proof",
|
|
8838
9092
|
onClick: () => {
|
|
8839
9093
|
latency.runProof().catch(() => {});
|
|
@@ -8841,31 +9095,31 @@ var VoiceTurnLatency = ({
|
|
|
8841
9095
|
type: "button",
|
|
8842
9096
|
children: model.proofLabel
|
|
8843
9097
|
}, undefined, false, undefined, this) : null,
|
|
8844
|
-
model.turns.length ? /* @__PURE__ */
|
|
9098
|
+
model.turns.length ? /* @__PURE__ */ jsxDEV18("div", {
|
|
8845
9099
|
className: "absolute-voice-turn-latency__turns",
|
|
8846
|
-
children: model.turns.map((turn) => /* @__PURE__ */
|
|
9100
|
+
children: model.turns.map((turn) => /* @__PURE__ */ jsxDEV18("article", {
|
|
8847
9101
|
className: [
|
|
8848
9102
|
"absolute-voice-turn-latency__turn",
|
|
8849
9103
|
`absolute-voice-turn-latency__turn--${turn.status}`
|
|
8850
9104
|
].join(" "),
|
|
8851
9105
|
children: [
|
|
8852
|
-
/* @__PURE__ */
|
|
9106
|
+
/* @__PURE__ */ jsxDEV18("header", {
|
|
8853
9107
|
children: [
|
|
8854
|
-
/* @__PURE__ */
|
|
9108
|
+
/* @__PURE__ */ jsxDEV18("strong", {
|
|
8855
9109
|
children: turn.label
|
|
8856
9110
|
}, undefined, false, undefined, this),
|
|
8857
|
-
/* @__PURE__ */
|
|
9111
|
+
/* @__PURE__ */ jsxDEV18("span", {
|
|
8858
9112
|
children: turn.status
|
|
8859
9113
|
}, undefined, false, undefined, this)
|
|
8860
9114
|
]
|
|
8861
9115
|
}, undefined, true, undefined, this),
|
|
8862
|
-
/* @__PURE__ */
|
|
8863
|
-
children: turn.rows.map((row) => /* @__PURE__ */
|
|
9116
|
+
/* @__PURE__ */ jsxDEV18("dl", {
|
|
9117
|
+
children: turn.rows.map((row) => /* @__PURE__ */ jsxDEV18("div", {
|
|
8864
9118
|
children: [
|
|
8865
|
-
/* @__PURE__ */
|
|
9119
|
+
/* @__PURE__ */ jsxDEV18("dt", {
|
|
8866
9120
|
children: row.label
|
|
8867
9121
|
}, undefined, false, undefined, this),
|
|
8868
|
-
/* @__PURE__ */
|
|
9122
|
+
/* @__PURE__ */ jsxDEV18("dd", {
|
|
8869
9123
|
children: row.value
|
|
8870
9124
|
}, undefined, false, undefined, this)
|
|
8871
9125
|
]
|
|
@@ -8873,11 +9127,11 @@ var VoiceTurnLatency = ({
|
|
|
8873
9127
|
}, undefined, false, undefined, this)
|
|
8874
9128
|
]
|
|
8875
9129
|
}, `${turn.sessionId}:${turn.turnId}`, true, undefined, this))
|
|
8876
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
9130
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV18("p", {
|
|
8877
9131
|
className: "absolute-voice-turn-latency__empty",
|
|
8878
9132
|
children: "Complete a voice turn to see latency diagnostics."
|
|
8879
9133
|
}, undefined, false, undefined, this),
|
|
8880
|
-
model.error ? /* @__PURE__ */
|
|
9134
|
+
model.error ? /* @__PURE__ */ jsxDEV18("p", {
|
|
8881
9135
|
className: "absolute-voice-turn-latency__error",
|
|
8882
9136
|
children: model.error
|
|
8883
9137
|
}, undefined, false, undefined, this) : null
|
|
@@ -8885,7 +9139,7 @@ var VoiceTurnLatency = ({
|
|
|
8885
9139
|
}, undefined, true, undefined, this);
|
|
8886
9140
|
};
|
|
8887
9141
|
// src/react/useVoiceTurnQuality.tsx
|
|
8888
|
-
import { useEffect as
|
|
9142
|
+
import { useEffect as useEffect19, useRef as useRef19, useSyncExternalStore as useSyncExternalStore19 } from "react";
|
|
8889
9143
|
|
|
8890
9144
|
// src/client/turnQuality.ts
|
|
8891
9145
|
var fetchVoiceTurnQuality = async (path = "/api/turn-quality", options = {}) => {
|
|
@@ -8968,25 +9222,25 @@ var createVoiceTurnQualityStore = (path = "/api/turn-quality", options = {}) =>
|
|
|
8968
9222
|
|
|
8969
9223
|
// src/react/useVoiceTurnQuality.tsx
|
|
8970
9224
|
var useVoiceTurnQuality = (path = "/api/turn-quality", options = {}) => {
|
|
8971
|
-
const storeRef =
|
|
9225
|
+
const storeRef = useRef19(null);
|
|
8972
9226
|
if (!storeRef.current) {
|
|
8973
9227
|
storeRef.current = createVoiceTurnQualityStore(path, options);
|
|
8974
9228
|
}
|
|
8975
9229
|
const store = storeRef.current;
|
|
8976
|
-
|
|
9230
|
+
useEffect19(() => {
|
|
8977
9231
|
store.refresh().catch(() => {});
|
|
8978
9232
|
return () => store.close();
|
|
8979
9233
|
}, [store]);
|
|
8980
9234
|
return {
|
|
8981
|
-
...
|
|
9235
|
+
...useSyncExternalStore19(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
8982
9236
|
refresh: store.refresh
|
|
8983
9237
|
};
|
|
8984
9238
|
};
|
|
8985
9239
|
|
|
8986
9240
|
// src/client/turnQualityWidget.ts
|
|
8987
|
-
var
|
|
8988
|
-
var
|
|
8989
|
-
var
|
|
9241
|
+
var DEFAULT_TITLE18 = "Turn Quality";
|
|
9242
|
+
var DEFAULT_DESCRIPTION18 = "Per-turn STT confidence, fallback selection, corrections, and transcript coverage.";
|
|
9243
|
+
var escapeHtml24 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
8990
9244
|
var formatConfidence = (value) => typeof value === "number" ? `${Math.round(value * 100)}%` : "n/a";
|
|
8991
9245
|
var formatMaybe = (value) => value === undefined || value === "" ? "n/a" : String(value);
|
|
8992
9246
|
var getTurnDetail = (turn) => {
|
|
@@ -9024,37 +9278,37 @@ var createVoiceTurnQualityViewModel = (snapshot, options = {}) => {
|
|
|
9024
9278
|
const warningCount = snapshot.report?.warnings ?? turns.filter((turn) => turn.status === "warn").length;
|
|
9025
9279
|
const failedCount = snapshot.report?.failed ?? turns.filter((turn) => turn.status === "fail").length;
|
|
9026
9280
|
return {
|
|
9027
|
-
description: options.description ??
|
|
9281
|
+
description: options.description ?? DEFAULT_DESCRIPTION18,
|
|
9028
9282
|
error: snapshot.error,
|
|
9029
9283
|
isLoading: snapshot.isLoading,
|
|
9030
9284
|
label: snapshot.error ? "Unavailable" : turns.length ? failedCount > 0 ? `${failedCount} failed` : warningCount > 0 ? `${warningCount} warnings` : `${turns.length} healthy` : snapshot.isLoading ? "Checking" : "No turns",
|
|
9031
9285
|
status: snapshot.error ? "error" : turns.length ? failedCount > 0 || warningCount > 0 ? "warning" : "ready" : snapshot.isLoading ? "loading" : "empty",
|
|
9032
|
-
title: options.title ??
|
|
9286
|
+
title: options.title ?? DEFAULT_TITLE18,
|
|
9033
9287
|
turns,
|
|
9034
9288
|
updatedAt: snapshot.updatedAt
|
|
9035
9289
|
};
|
|
9036
9290
|
};
|
|
9037
9291
|
var renderVoiceTurnQualityHTML = (snapshot, options = {}) => {
|
|
9038
9292
|
const model = createVoiceTurnQualityViewModel(snapshot, options);
|
|
9039
|
-
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--${
|
|
9293
|
+
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--${escapeHtml24(turn.status)}">
|
|
9040
9294
|
<header>
|
|
9041
|
-
<strong>${
|
|
9042
|
-
<span>${
|
|
9295
|
+
<strong>${escapeHtml24(turn.label)}</strong>
|
|
9296
|
+
<span>${escapeHtml24(turn.status)}</span>
|
|
9043
9297
|
</header>
|
|
9044
|
-
<p>${
|
|
9298
|
+
<p>${escapeHtml24(turn.detail)}</p>
|
|
9045
9299
|
<dl>${turn.rows.map((row) => `<div>
|
|
9046
|
-
<dt>${
|
|
9047
|
-
<dd>${
|
|
9300
|
+
<dt>${escapeHtml24(row.label)}</dt>
|
|
9301
|
+
<dd>${escapeHtml24(row.value)}</dd>
|
|
9048
9302
|
</div>`).join("")}</dl>
|
|
9049
9303
|
</article>`).join("")}</div>` : '<p class="absolute-voice-turn-quality__empty">Complete a voice turn to see STT quality diagnostics.</p>';
|
|
9050
|
-
return `<section class="absolute-voice-turn-quality absolute-voice-turn-quality--${
|
|
9304
|
+
return `<section class="absolute-voice-turn-quality absolute-voice-turn-quality--${escapeHtml24(model.status)}">
|
|
9051
9305
|
<header class="absolute-voice-turn-quality__header">
|
|
9052
|
-
<span class="absolute-voice-turn-quality__eyebrow">${
|
|
9053
|
-
<strong class="absolute-voice-turn-quality__label">${
|
|
9306
|
+
<span class="absolute-voice-turn-quality__eyebrow">${escapeHtml24(model.title)}</span>
|
|
9307
|
+
<strong class="absolute-voice-turn-quality__label">${escapeHtml24(model.label)}</strong>
|
|
9054
9308
|
</header>
|
|
9055
|
-
<p class="absolute-voice-turn-quality__description">${
|
|
9309
|
+
<p class="absolute-voice-turn-quality__description">${escapeHtml24(model.description)}</p>
|
|
9056
9310
|
${turns}
|
|
9057
|
-
${model.error ? `<p class="absolute-voice-turn-quality__error">${
|
|
9311
|
+
${model.error ? `<p class="absolute-voice-turn-quality__error">${escapeHtml24(model.error)}</p>` : ""}
|
|
9058
9312
|
</section>`;
|
|
9059
9313
|
};
|
|
9060
9314
|
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}`;
|
|
@@ -9096,7 +9350,7 @@ var defineVoiceTurnQualityElement = (tagName = "absolute-voice-turn-quality") =>
|
|
|
9096
9350
|
};
|
|
9097
9351
|
|
|
9098
9352
|
// src/react/VoiceTurnQuality.tsx
|
|
9099
|
-
import { jsxDEV as
|
|
9353
|
+
import { jsxDEV as jsxDEV19 } from "react/jsx-dev-runtime";
|
|
9100
9354
|
var VoiceTurnQuality = ({
|
|
9101
9355
|
className,
|
|
9102
9356
|
path = "/api/turn-quality",
|
|
@@ -9104,58 +9358,58 @@ var VoiceTurnQuality = ({
|
|
|
9104
9358
|
}) => {
|
|
9105
9359
|
const snapshot = useVoiceTurnQuality(path, options);
|
|
9106
9360
|
const model = createVoiceTurnQualityViewModel(snapshot, options);
|
|
9107
|
-
return /* @__PURE__ */
|
|
9361
|
+
return /* @__PURE__ */ jsxDEV19("section", {
|
|
9108
9362
|
className: [
|
|
9109
9363
|
"absolute-voice-turn-quality",
|
|
9110
9364
|
`absolute-voice-turn-quality--${model.status}`,
|
|
9111
9365
|
className
|
|
9112
9366
|
].filter(Boolean).join(" "),
|
|
9113
9367
|
children: [
|
|
9114
|
-
/* @__PURE__ */
|
|
9368
|
+
/* @__PURE__ */ jsxDEV19("header", {
|
|
9115
9369
|
className: "absolute-voice-turn-quality__header",
|
|
9116
9370
|
children: [
|
|
9117
|
-
/* @__PURE__ */
|
|
9371
|
+
/* @__PURE__ */ jsxDEV19("span", {
|
|
9118
9372
|
className: "absolute-voice-turn-quality__eyebrow",
|
|
9119
9373
|
children: model.title
|
|
9120
9374
|
}, undefined, false, undefined, this),
|
|
9121
|
-
/* @__PURE__ */
|
|
9375
|
+
/* @__PURE__ */ jsxDEV19("strong", {
|
|
9122
9376
|
className: "absolute-voice-turn-quality__label",
|
|
9123
9377
|
children: model.label
|
|
9124
9378
|
}, undefined, false, undefined, this)
|
|
9125
9379
|
]
|
|
9126
9380
|
}, undefined, true, undefined, this),
|
|
9127
|
-
/* @__PURE__ */
|
|
9381
|
+
/* @__PURE__ */ jsxDEV19("p", {
|
|
9128
9382
|
className: "absolute-voice-turn-quality__description",
|
|
9129
9383
|
children: model.description
|
|
9130
9384
|
}, undefined, false, undefined, this),
|
|
9131
|
-
model.turns.length ? /* @__PURE__ */
|
|
9385
|
+
model.turns.length ? /* @__PURE__ */ jsxDEV19("div", {
|
|
9132
9386
|
className: "absolute-voice-turn-quality__turns",
|
|
9133
|
-
children: model.turns.map((turn) => /* @__PURE__ */
|
|
9387
|
+
children: model.turns.map((turn) => /* @__PURE__ */ jsxDEV19("article", {
|
|
9134
9388
|
className: [
|
|
9135
9389
|
"absolute-voice-turn-quality__turn",
|
|
9136
9390
|
`absolute-voice-turn-quality__turn--${turn.status}`
|
|
9137
9391
|
].join(" "),
|
|
9138
9392
|
children: [
|
|
9139
|
-
/* @__PURE__ */
|
|
9393
|
+
/* @__PURE__ */ jsxDEV19("header", {
|
|
9140
9394
|
children: [
|
|
9141
|
-
/* @__PURE__ */
|
|
9395
|
+
/* @__PURE__ */ jsxDEV19("strong", {
|
|
9142
9396
|
children: turn.label
|
|
9143
9397
|
}, undefined, false, undefined, this),
|
|
9144
|
-
/* @__PURE__ */
|
|
9398
|
+
/* @__PURE__ */ jsxDEV19("span", {
|
|
9145
9399
|
children: turn.status
|
|
9146
9400
|
}, undefined, false, undefined, this)
|
|
9147
9401
|
]
|
|
9148
9402
|
}, undefined, true, undefined, this),
|
|
9149
|
-
/* @__PURE__ */
|
|
9403
|
+
/* @__PURE__ */ jsxDEV19("p", {
|
|
9150
9404
|
children: turn.detail
|
|
9151
9405
|
}, undefined, false, undefined, this),
|
|
9152
|
-
/* @__PURE__ */
|
|
9153
|
-
children: turn.rows.map((row) => /* @__PURE__ */
|
|
9406
|
+
/* @__PURE__ */ jsxDEV19("dl", {
|
|
9407
|
+
children: turn.rows.map((row) => /* @__PURE__ */ jsxDEV19("div", {
|
|
9154
9408
|
children: [
|
|
9155
|
-
/* @__PURE__ */
|
|
9409
|
+
/* @__PURE__ */ jsxDEV19("dt", {
|
|
9156
9410
|
children: row.label
|
|
9157
9411
|
}, undefined, false, undefined, this),
|
|
9158
|
-
/* @__PURE__ */
|
|
9412
|
+
/* @__PURE__ */ jsxDEV19("dd", {
|
|
9159
9413
|
children: row.value
|
|
9160
9414
|
}, undefined, false, undefined, this)
|
|
9161
9415
|
]
|
|
@@ -9163,11 +9417,11 @@ var VoiceTurnQuality = ({
|
|
|
9163
9417
|
}, undefined, false, undefined, this)
|
|
9164
9418
|
]
|
|
9165
9419
|
}, `${turn.sessionId}:${turn.turnId}`, true, undefined, this))
|
|
9166
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
9420
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV19("p", {
|
|
9167
9421
|
className: "absolute-voice-turn-quality__empty",
|
|
9168
9422
|
children: "Complete a voice turn to see STT quality diagnostics."
|
|
9169
9423
|
}, undefined, false, undefined, this),
|
|
9170
|
-
model.error ? /* @__PURE__ */
|
|
9424
|
+
model.error ? /* @__PURE__ */ jsxDEV19("p", {
|
|
9171
9425
|
className: "absolute-voice-turn-quality__error",
|
|
9172
9426
|
children: model.error
|
|
9173
9427
|
}, undefined, false, undefined, this) : null
|
|
@@ -9175,7 +9429,7 @@ var VoiceTurnQuality = ({
|
|
|
9175
9429
|
}, undefined, true, undefined, this);
|
|
9176
9430
|
};
|
|
9177
9431
|
// src/react/useVoiceLiveOps.tsx
|
|
9178
|
-
import { useEffect as
|
|
9432
|
+
import { useEffect as useEffect20, useRef as useRef20, useSyncExternalStore as useSyncExternalStore20 } from "react";
|
|
9179
9433
|
|
|
9180
9434
|
// src/client/liveOps.ts
|
|
9181
9435
|
var postVoiceLiveOpsAction = async (input, options = {}) => {
|
|
@@ -9265,19 +9519,19 @@ var createVoiceLiveOpsStore = (options = {}) => {
|
|
|
9265
9519
|
|
|
9266
9520
|
// src/react/useVoiceLiveOps.tsx
|
|
9267
9521
|
var useVoiceLiveOps = (options = {}) => {
|
|
9268
|
-
const storeRef =
|
|
9522
|
+
const storeRef = useRef20(null);
|
|
9269
9523
|
if (!storeRef.current) {
|
|
9270
9524
|
storeRef.current = createVoiceLiveOpsStore(options);
|
|
9271
9525
|
}
|
|
9272
9526
|
const store = storeRef.current;
|
|
9273
|
-
|
|
9527
|
+
useEffect20(() => () => store.close(), [store]);
|
|
9274
9528
|
return {
|
|
9275
|
-
...
|
|
9529
|
+
...useSyncExternalStore20(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
9276
9530
|
run: store.run
|
|
9277
9531
|
};
|
|
9278
9532
|
};
|
|
9279
9533
|
// src/react/useVoiceCampaignDialerProof.tsx
|
|
9280
|
-
import { useEffect as
|
|
9534
|
+
import { useEffect as useEffect21, useRef as useRef21, useSyncExternalStore as useSyncExternalStore21 } from "react";
|
|
9281
9535
|
|
|
9282
9536
|
// src/client/campaignDialerProof.ts
|
|
9283
9537
|
var fetchVoiceCampaignDialerProofStatus = async (path = "/api/voice/campaigns/dialer-proof", options = {}) => {
|
|
@@ -9399,23 +9653,23 @@ var createVoiceCampaignDialerProofStore = (path = "/api/voice/campaigns/dialer-p
|
|
|
9399
9653
|
|
|
9400
9654
|
// src/react/useVoiceCampaignDialerProof.tsx
|
|
9401
9655
|
var useVoiceCampaignDialerProof = (path = "/api/voice/campaigns/dialer-proof", options = {}) => {
|
|
9402
|
-
const storeRef =
|
|
9656
|
+
const storeRef = useRef21(null);
|
|
9403
9657
|
if (!storeRef.current) {
|
|
9404
9658
|
storeRef.current = createVoiceCampaignDialerProofStore(path, options);
|
|
9405
9659
|
}
|
|
9406
9660
|
const store = storeRef.current;
|
|
9407
|
-
|
|
9661
|
+
useEffect21(() => {
|
|
9408
9662
|
store.refresh().catch(() => {});
|
|
9409
9663
|
return () => store.close();
|
|
9410
9664
|
}, [store]);
|
|
9411
9665
|
return {
|
|
9412
|
-
...
|
|
9666
|
+
...useSyncExternalStore21(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
9413
9667
|
refresh: store.refresh,
|
|
9414
9668
|
runProof: store.runProof
|
|
9415
9669
|
};
|
|
9416
9670
|
};
|
|
9417
9671
|
// src/react/useVoiceStream.tsx
|
|
9418
|
-
import { useEffect as
|
|
9672
|
+
import { useEffect as useEffect22, useRef as useRef22, useSyncExternalStore as useSyncExternalStore22 } from "react";
|
|
9419
9673
|
|
|
9420
9674
|
// src/client/actions.ts
|
|
9421
9675
|
var normalizeErrorMessage = (value) => {
|
|
@@ -10826,13 +11080,13 @@ var EMPTY_SNAPSHOT = {
|
|
|
10826
11080
|
turns: []
|
|
10827
11081
|
};
|
|
10828
11082
|
var useVoiceStream = (path, options = {}) => {
|
|
10829
|
-
const streamRef =
|
|
11083
|
+
const streamRef = useRef22(null);
|
|
10830
11084
|
if (!streamRef.current) {
|
|
10831
11085
|
streamRef.current = createVoiceStream(path, options);
|
|
10832
11086
|
}
|
|
10833
11087
|
const stream = streamRef.current;
|
|
10834
|
-
|
|
10835
|
-
const snapshot =
|
|
11088
|
+
useEffect22(() => () => stream.close(), [stream]);
|
|
11089
|
+
const snapshot = useSyncExternalStore22(stream.subscribe, stream.getSnapshot, stream.getServerSnapshot) ?? EMPTY_SNAPSHOT;
|
|
10836
11090
|
return {
|
|
10837
11091
|
...snapshot,
|
|
10838
11092
|
callControl: (message) => stream.callControl(message),
|
|
@@ -10842,7 +11096,7 @@ var useVoiceStream = (path, options = {}) => {
|
|
|
10842
11096
|
};
|
|
10843
11097
|
};
|
|
10844
11098
|
// src/react/useVoiceController.tsx
|
|
10845
|
-
import { useEffect as
|
|
11099
|
+
import { useEffect as useEffect23, useRef as useRef23, useSyncExternalStore as useSyncExternalStore23 } from "react";
|
|
10846
11100
|
|
|
10847
11101
|
// src/client/htmx.ts
|
|
10848
11102
|
var DEFAULT_EVENT_NAME = "voice-refresh";
|
|
@@ -11510,13 +11764,13 @@ var EMPTY_SNAPSHOT2 = {
|
|
|
11510
11764
|
turns: []
|
|
11511
11765
|
};
|
|
11512
11766
|
var useVoiceController = (path, options = {}) => {
|
|
11513
|
-
const controllerRef =
|
|
11767
|
+
const controllerRef = useRef23(null);
|
|
11514
11768
|
if (!controllerRef.current) {
|
|
11515
11769
|
controllerRef.current = createVoiceController(path, options);
|
|
11516
11770
|
}
|
|
11517
11771
|
const controller = controllerRef.current;
|
|
11518
|
-
|
|
11519
|
-
const snapshot =
|
|
11772
|
+
useEffect23(() => () => controller.close(), [controller]);
|
|
11773
|
+
const snapshot = useSyncExternalStore23(controller.subscribe, controller.getSnapshot, controller.getServerSnapshot) ?? EMPTY_SNAPSHOT2;
|
|
11520
11774
|
return {
|
|
11521
11775
|
...snapshot,
|
|
11522
11776
|
bindHTMX: controller.bindHTMX,
|
|
@@ -11530,7 +11784,7 @@ var useVoiceController = (path, options = {}) => {
|
|
|
11530
11784
|
};
|
|
11531
11785
|
};
|
|
11532
11786
|
// src/react/useVoiceWorkflowStatus.tsx
|
|
11533
|
-
import { useEffect as
|
|
11787
|
+
import { useEffect as useEffect24, useRef as useRef24, useSyncExternalStore as useSyncExternalStore24 } from "react";
|
|
11534
11788
|
|
|
11535
11789
|
// src/client/workflowStatus.ts
|
|
11536
11790
|
var fetchVoiceWorkflowStatus = async (path = "/evals/scenarios/json", options = {}) => {
|
|
@@ -11613,17 +11867,17 @@ var createVoiceWorkflowStatusStore = (path = "/evals/scenarios/json", options =
|
|
|
11613
11867
|
|
|
11614
11868
|
// src/react/useVoiceWorkflowStatus.tsx
|
|
11615
11869
|
var useVoiceWorkflowStatus = (path = "/evals/scenarios/json", options = {}) => {
|
|
11616
|
-
const storeRef =
|
|
11870
|
+
const storeRef = useRef24(null);
|
|
11617
11871
|
if (!storeRef.current) {
|
|
11618
11872
|
storeRef.current = createVoiceWorkflowStatusStore(path, options);
|
|
11619
11873
|
}
|
|
11620
11874
|
const store = storeRef.current;
|
|
11621
|
-
|
|
11875
|
+
useEffect24(() => {
|
|
11622
11876
|
store.refresh().catch(() => {});
|
|
11623
11877
|
return () => store.close();
|
|
11624
11878
|
}, [store]);
|
|
11625
11879
|
return {
|
|
11626
|
-
...
|
|
11880
|
+
...useSyncExternalStore24(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
11627
11881
|
refresh: store.refresh
|
|
11628
11882
|
};
|
|
11629
11883
|
};
|
|
@@ -11650,6 +11904,7 @@ export {
|
|
|
11650
11904
|
useVoiceDeliveryRuntime,
|
|
11651
11905
|
useVoiceController,
|
|
11652
11906
|
useVoiceCampaignDialerProof,
|
|
11907
|
+
useVoiceCallDebugger,
|
|
11653
11908
|
useVoiceAgentSquadStatus,
|
|
11654
11909
|
VoiceTurnQuality,
|
|
11655
11910
|
VoiceTurnLatency,
|
|
@@ -11668,5 +11923,6 @@ export {
|
|
|
11668
11923
|
VoiceOpsStatus,
|
|
11669
11924
|
VoiceOpsActionCenter,
|
|
11670
11925
|
VoiceDeliveryRuntime,
|
|
11926
|
+
VoiceCallDebuggerLaunch,
|
|
11671
11927
|
VoiceAgentSquadStatus
|
|
11672
11928
|
};
|