@absolutejs/voice 0.0.22-beta.351 → 0.0.22-beta.353
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 +313 -192
- package/dist/angular/voice-profile-comparison.service.d.ts +12 -0
- package/dist/client/index.d.ts +4 -0
- package/dist/client/index.js +429 -211
- package/dist/client/profileComparison.d.ts +19 -0
- package/dist/client/profileComparisonWidget.d.ts +41 -0
- package/dist/client/routingStatusWidget.d.ts +4 -0
- package/dist/react/VoiceProfileComparison.d.ts +6 -0
- package/dist/react/index.d.ts +2 -0
- package/dist/react/index.js +715 -396
- package/dist/react/useVoiceProfileComparison.d.ts +8 -0
- package/dist/svelte/createVoiceProfileComparison.d.ts +7 -0
- package/dist/svelte/index.d.ts +1 -0
- package/dist/svelte/index.js +128 -1
- package/dist/vue/index.d.ts +1 -0
- package/dist/vue/index.js +203 -52
- package/dist/vue/useVoiceProfileComparison.d.ts +9 -0
- package/package.json +1 -1
package/dist/react/index.js
CHANGED
|
@@ -2713,6 +2713,282 @@ var VoiceProofTrends = ({
|
|
|
2713
2713
|
]
|
|
2714
2714
|
}, undefined, true, undefined, this);
|
|
2715
2715
|
};
|
|
2716
|
+
// src/client/profileComparison.ts
|
|
2717
|
+
var fetchVoiceProfileComparison = async (path = "/api/voice/real-call-profile-history", options = {}) => {
|
|
2718
|
+
const fetchImpl = options.fetch ?? globalThis.fetch;
|
|
2719
|
+
const response = await fetchImpl(path);
|
|
2720
|
+
if (!response.ok) {
|
|
2721
|
+
throw new Error(`Voice profile comparison failed: HTTP ${response.status}`);
|
|
2722
|
+
}
|
|
2723
|
+
return await response.json();
|
|
2724
|
+
};
|
|
2725
|
+
var createVoiceProfileComparisonStore = (path = "/api/voice/real-call-profile-history", options = {}) => {
|
|
2726
|
+
const listeners = new Set;
|
|
2727
|
+
let closed = false;
|
|
2728
|
+
let timer;
|
|
2729
|
+
let snapshot = {
|
|
2730
|
+
error: null,
|
|
2731
|
+
isLoading: false
|
|
2732
|
+
};
|
|
2733
|
+
const emit = () => {
|
|
2734
|
+
for (const listener of listeners) {
|
|
2735
|
+
listener();
|
|
2736
|
+
}
|
|
2737
|
+
};
|
|
2738
|
+
const refresh = async () => {
|
|
2739
|
+
if (closed) {
|
|
2740
|
+
return snapshot.report;
|
|
2741
|
+
}
|
|
2742
|
+
snapshot = { ...snapshot, error: null, isLoading: true };
|
|
2743
|
+
emit();
|
|
2744
|
+
try {
|
|
2745
|
+
const report = await fetchVoiceProfileComparison(path, options);
|
|
2746
|
+
snapshot = {
|
|
2747
|
+
error: null,
|
|
2748
|
+
isLoading: false,
|
|
2749
|
+
report,
|
|
2750
|
+
updatedAt: Date.now()
|
|
2751
|
+
};
|
|
2752
|
+
emit();
|
|
2753
|
+
return report;
|
|
2754
|
+
} catch (error) {
|
|
2755
|
+
snapshot = {
|
|
2756
|
+
...snapshot,
|
|
2757
|
+
error: error instanceof Error ? error.message : String(error),
|
|
2758
|
+
isLoading: false
|
|
2759
|
+
};
|
|
2760
|
+
emit();
|
|
2761
|
+
throw error;
|
|
2762
|
+
}
|
|
2763
|
+
};
|
|
2764
|
+
const close = () => {
|
|
2765
|
+
closed = true;
|
|
2766
|
+
if (timer) {
|
|
2767
|
+
clearInterval(timer);
|
|
2768
|
+
timer = undefined;
|
|
2769
|
+
}
|
|
2770
|
+
listeners.clear();
|
|
2771
|
+
};
|
|
2772
|
+
if (typeof window !== "undefined" && options.intervalMs && options.intervalMs > 0) {
|
|
2773
|
+
timer = setInterval(() => {
|
|
2774
|
+
refresh().catch(() => {});
|
|
2775
|
+
}, options.intervalMs);
|
|
2776
|
+
}
|
|
2777
|
+
return {
|
|
2778
|
+
close,
|
|
2779
|
+
getServerSnapshot: () => snapshot,
|
|
2780
|
+
getSnapshot: () => snapshot,
|
|
2781
|
+
refresh,
|
|
2782
|
+
subscribe: (listener) => {
|
|
2783
|
+
listeners.add(listener);
|
|
2784
|
+
return () => {
|
|
2785
|
+
listeners.delete(listener);
|
|
2786
|
+
};
|
|
2787
|
+
}
|
|
2788
|
+
};
|
|
2789
|
+
};
|
|
2790
|
+
|
|
2791
|
+
// src/client/profileComparisonWidget.ts
|
|
2792
|
+
var DEFAULT_TITLE6 = "Profile Stack Comparison";
|
|
2793
|
+
var DEFAULT_DESCRIPTION6 = "Measured real-call evidence behind each profile default: provider routes, latency, and the next move.";
|
|
2794
|
+
var DEFAULT_LINKS3 = [
|
|
2795
|
+
{ href: "/voice/real-call-profile-history", label: "Profile history" },
|
|
2796
|
+
{ href: "/api/voice/real-call-profile-history", label: "JSON" }
|
|
2797
|
+
];
|
|
2798
|
+
var escapeHtml7 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
2799
|
+
var formatMs2 = (value) => typeof value === "number" && Number.isFinite(value) ? `${Math.round(value)}ms` : "n/a";
|
|
2800
|
+
var formatProviderRoutes = (profile) => Object.entries(profile.providerRoutes).map(([role, provider]) => `${role}: ${provider}`).join(", ") || "No complete route yet";
|
|
2801
|
+
var createProfileView = (profile) => ({
|
|
2802
|
+
evidence: [
|
|
2803
|
+
{ label: "Live p95", value: formatMs2(profile.evidence.liveP95Ms) },
|
|
2804
|
+
{ label: "Provider p95", value: formatMs2(profile.evidence.providerP95Ms) },
|
|
2805
|
+
{ label: "Turn p95", value: formatMs2(profile.evidence.turnP95Ms) }
|
|
2806
|
+
],
|
|
2807
|
+
label: profile.label ?? profile.profileId,
|
|
2808
|
+
nextMove: profile.nextMove,
|
|
2809
|
+
profileId: profile.profileId,
|
|
2810
|
+
providerRoutes: formatProviderRoutes(profile),
|
|
2811
|
+
status: profile.status
|
|
2812
|
+
});
|
|
2813
|
+
var createVoiceProfileComparisonViewModel = (snapshot, options = {}) => {
|
|
2814
|
+
const report = snapshot.report;
|
|
2815
|
+
const profiles = report?.defaults.profiles.map(createProfileView) ?? [];
|
|
2816
|
+
return {
|
|
2817
|
+
description: options.description ?? DEFAULT_DESCRIPTION6,
|
|
2818
|
+
error: snapshot.error,
|
|
2819
|
+
isLoading: snapshot.isLoading,
|
|
2820
|
+
label: snapshot.error ? "Unavailable" : report ? `${report.defaults.summary.actionableProfiles}/${report.defaults.summary.profileCount} profiles ready` : snapshot.isLoading ? "Checking" : "No profile evidence",
|
|
2821
|
+
links: options.links ?? DEFAULT_LINKS3,
|
|
2822
|
+
profiles,
|
|
2823
|
+
status: snapshot.error ? "error" : report ? report.status === "pass" ? "ready" : "warning" : snapshot.isLoading ? "loading" : "empty",
|
|
2824
|
+
title: options.title ?? DEFAULT_TITLE6
|
|
2825
|
+
};
|
|
2826
|
+
};
|
|
2827
|
+
var renderVoiceProfileComparisonHTML = (snapshot, options = {}) => {
|
|
2828
|
+
const model = createVoiceProfileComparisonViewModel(snapshot, options);
|
|
2829
|
+
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--${escapeHtml7(profile.status)}">
|
|
2830
|
+
<header>
|
|
2831
|
+
<span>${escapeHtml7(profile.status)}</span>
|
|
2832
|
+
<strong>${escapeHtml7(profile.label)}</strong>
|
|
2833
|
+
</header>
|
|
2834
|
+
<p>${escapeHtml7(profile.providerRoutes)}</p>
|
|
2835
|
+
<div>${profile.evidence.map((metric) => `<span><small>${escapeHtml7(metric.label)}</small><b>${escapeHtml7(metric.value)}</b></span>`).join("")}</div>
|
|
2836
|
+
<em>${escapeHtml7(profile.nextMove)}</em>
|
|
2837
|
+
</article>`).join("")}</div>` : `<p class="absolute-voice-profile-comparison__empty">${model.error ? escapeHtml7(model.error) : "Run real-call profile collection to populate profile comparisons."}</p>`;
|
|
2838
|
+
const links = model.links.length ? `<p class="absolute-voice-profile-comparison__links">${model.links.map((link) => `<a href="${escapeHtml7(link.href)}">${escapeHtml7(link.label)}</a>`).join("")}</p>` : "";
|
|
2839
|
+
return `<section class="absolute-voice-profile-comparison absolute-voice-profile-comparison--${escapeHtml7(model.status)}">
|
|
2840
|
+
<header class="absolute-voice-profile-comparison__header">
|
|
2841
|
+
<span class="absolute-voice-profile-comparison__eyebrow">${escapeHtml7(model.title)}</span>
|
|
2842
|
+
<strong class="absolute-voice-profile-comparison__label">${escapeHtml7(model.label)}</strong>
|
|
2843
|
+
</header>
|
|
2844
|
+
<p class="absolute-voice-profile-comparison__description">${escapeHtml7(model.description)}</p>
|
|
2845
|
+
${profiles}
|
|
2846
|
+
${links}
|
|
2847
|
+
${model.error ? `<p class="absolute-voice-profile-comparison__error">${escapeHtml7(model.error)}</p>` : ""}
|
|
2848
|
+
</section>`;
|
|
2849
|
+
};
|
|
2850
|
+
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}`;
|
|
2851
|
+
var mountVoiceProfileComparison = (element, path = "/api/voice/real-call-profile-history", options = {}) => {
|
|
2852
|
+
const store = createVoiceProfileComparisonStore(path, options);
|
|
2853
|
+
const render = () => {
|
|
2854
|
+
element.innerHTML = renderVoiceProfileComparisonHTML(store.getSnapshot(), options);
|
|
2855
|
+
};
|
|
2856
|
+
const unsubscribe = store.subscribe(render);
|
|
2857
|
+
render();
|
|
2858
|
+
store.refresh().catch(() => {});
|
|
2859
|
+
return {
|
|
2860
|
+
close: () => {
|
|
2861
|
+
unsubscribe();
|
|
2862
|
+
store.close();
|
|
2863
|
+
},
|
|
2864
|
+
refresh: store.refresh
|
|
2865
|
+
};
|
|
2866
|
+
};
|
|
2867
|
+
var defineVoiceProfileComparisonElement = (tagName = "absolute-voice-profile-comparison") => {
|
|
2868
|
+
if (typeof window === "undefined" || typeof customElements === "undefined" || customElements.get(tagName)) {
|
|
2869
|
+
return;
|
|
2870
|
+
}
|
|
2871
|
+
customElements.define(tagName, class AbsoluteVoiceProfileComparisonElement extends HTMLElement {
|
|
2872
|
+
mounted;
|
|
2873
|
+
connectedCallback() {
|
|
2874
|
+
const intervalMs = Number(this.getAttribute("interval-ms") ?? 5000);
|
|
2875
|
+
this.mounted = mountVoiceProfileComparison(this, this.getAttribute("path") ?? "/api/voice/real-call-profile-history", {
|
|
2876
|
+
description: this.getAttribute("description") ?? undefined,
|
|
2877
|
+
intervalMs: Number.isFinite(intervalMs) ? intervalMs : 5000,
|
|
2878
|
+
title: this.getAttribute("title") ?? undefined
|
|
2879
|
+
});
|
|
2880
|
+
}
|
|
2881
|
+
disconnectedCallback() {
|
|
2882
|
+
this.mounted?.close();
|
|
2883
|
+
this.mounted = undefined;
|
|
2884
|
+
}
|
|
2885
|
+
});
|
|
2886
|
+
};
|
|
2887
|
+
|
|
2888
|
+
// src/react/useVoiceProfileComparison.tsx
|
|
2889
|
+
import { useEffect as useEffect6, useRef as useRef6, useSyncExternalStore as useSyncExternalStore6 } from "react";
|
|
2890
|
+
var useVoiceProfileComparison = (path = "/api/voice/real-call-profile-history", options = {}) => {
|
|
2891
|
+
const storeRef = useRef6(null);
|
|
2892
|
+
if (!storeRef.current) {
|
|
2893
|
+
storeRef.current = createVoiceProfileComparisonStore(path, options);
|
|
2894
|
+
}
|
|
2895
|
+
const store = storeRef.current;
|
|
2896
|
+
useEffect6(() => {
|
|
2897
|
+
store.refresh().catch(() => {});
|
|
2898
|
+
return () => store.close();
|
|
2899
|
+
}, [store]);
|
|
2900
|
+
return {
|
|
2901
|
+
...useSyncExternalStore6(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
2902
|
+
refresh: store.refresh
|
|
2903
|
+
};
|
|
2904
|
+
};
|
|
2905
|
+
|
|
2906
|
+
// src/react/VoiceProfileComparison.tsx
|
|
2907
|
+
import { jsxDEV as jsxDEV6 } from "react/jsx-dev-runtime";
|
|
2908
|
+
var VoiceProfileComparison = ({
|
|
2909
|
+
className,
|
|
2910
|
+
path = "/api/voice/real-call-profile-history",
|
|
2911
|
+
...options
|
|
2912
|
+
}) => {
|
|
2913
|
+
const snapshot = useVoiceProfileComparison(path, options);
|
|
2914
|
+
const model = createVoiceProfileComparisonViewModel(snapshot, options);
|
|
2915
|
+
return /* @__PURE__ */ jsxDEV6("section", {
|
|
2916
|
+
className: [
|
|
2917
|
+
"absolute-voice-profile-comparison",
|
|
2918
|
+
`absolute-voice-profile-comparison--${model.status}`,
|
|
2919
|
+
className
|
|
2920
|
+
].filter(Boolean).join(" "),
|
|
2921
|
+
children: [
|
|
2922
|
+
/* @__PURE__ */ jsxDEV6("header", {
|
|
2923
|
+
className: "absolute-voice-profile-comparison__header",
|
|
2924
|
+
children: [
|
|
2925
|
+
/* @__PURE__ */ jsxDEV6("span", {
|
|
2926
|
+
className: "absolute-voice-profile-comparison__eyebrow",
|
|
2927
|
+
children: model.title
|
|
2928
|
+
}, undefined, false, undefined, this),
|
|
2929
|
+
/* @__PURE__ */ jsxDEV6("strong", {
|
|
2930
|
+
className: "absolute-voice-profile-comparison__label",
|
|
2931
|
+
children: model.label
|
|
2932
|
+
}, undefined, false, undefined, this)
|
|
2933
|
+
]
|
|
2934
|
+
}, undefined, true, undefined, this),
|
|
2935
|
+
/* @__PURE__ */ jsxDEV6("p", {
|
|
2936
|
+
className: "absolute-voice-profile-comparison__description",
|
|
2937
|
+
children: model.description
|
|
2938
|
+
}, undefined, false, undefined, this),
|
|
2939
|
+
model.profiles.length ? /* @__PURE__ */ jsxDEV6("div", {
|
|
2940
|
+
className: "absolute-voice-profile-comparison__profiles",
|
|
2941
|
+
children: model.profiles.map((profile) => /* @__PURE__ */ jsxDEV6("article", {
|
|
2942
|
+
className: `absolute-voice-profile-comparison__profile absolute-voice-profile-comparison__profile--${profile.status}`,
|
|
2943
|
+
children: [
|
|
2944
|
+
/* @__PURE__ */ jsxDEV6("header", {
|
|
2945
|
+
children: [
|
|
2946
|
+
/* @__PURE__ */ jsxDEV6("span", {
|
|
2947
|
+
children: profile.status
|
|
2948
|
+
}, undefined, false, undefined, this),
|
|
2949
|
+
/* @__PURE__ */ jsxDEV6("strong", {
|
|
2950
|
+
children: profile.label
|
|
2951
|
+
}, undefined, false, undefined, this)
|
|
2952
|
+
]
|
|
2953
|
+
}, undefined, true, undefined, this),
|
|
2954
|
+
/* @__PURE__ */ jsxDEV6("p", {
|
|
2955
|
+
children: profile.providerRoutes
|
|
2956
|
+
}, undefined, false, undefined, this),
|
|
2957
|
+
/* @__PURE__ */ jsxDEV6("div", {
|
|
2958
|
+
children: profile.evidence.map((metric) => /* @__PURE__ */ jsxDEV6("span", {
|
|
2959
|
+
children: [
|
|
2960
|
+
/* @__PURE__ */ jsxDEV6("small", {
|
|
2961
|
+
children: metric.label
|
|
2962
|
+
}, undefined, false, undefined, this),
|
|
2963
|
+
/* @__PURE__ */ jsxDEV6("b", {
|
|
2964
|
+
children: metric.value
|
|
2965
|
+
}, undefined, false, undefined, this)
|
|
2966
|
+
]
|
|
2967
|
+
}, metric.label, true, undefined, this))
|
|
2968
|
+
}, undefined, false, undefined, this),
|
|
2969
|
+
/* @__PURE__ */ jsxDEV6("em", {
|
|
2970
|
+
children: profile.nextMove
|
|
2971
|
+
}, undefined, false, undefined, this)
|
|
2972
|
+
]
|
|
2973
|
+
}, profile.profileId, true, undefined, this))
|
|
2974
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV6("p", {
|
|
2975
|
+
className: "absolute-voice-profile-comparison__empty",
|
|
2976
|
+
children: model.error ?? "Run real-call profile collection to populate profile comparisons."
|
|
2977
|
+
}, undefined, false, undefined, this),
|
|
2978
|
+
model.links.length ? /* @__PURE__ */ jsxDEV6("p", {
|
|
2979
|
+
className: "absolute-voice-profile-comparison__links",
|
|
2980
|
+
children: model.links.map((link) => /* @__PURE__ */ jsxDEV6("a", {
|
|
2981
|
+
href: link.href,
|
|
2982
|
+
children: link.label
|
|
2983
|
+
}, link.href, false, undefined, this))
|
|
2984
|
+
}, undefined, false, undefined, this) : null,
|
|
2985
|
+
model.error ? /* @__PURE__ */ jsxDEV6("p", {
|
|
2986
|
+
className: "absolute-voice-profile-comparison__error",
|
|
2987
|
+
children: model.error
|
|
2988
|
+
}, undefined, false, undefined, this) : null
|
|
2989
|
+
]
|
|
2990
|
+
}, undefined, true, undefined, this);
|
|
2991
|
+
};
|
|
2716
2992
|
// src/client/readinessFailures.ts
|
|
2717
2993
|
var fetchVoiceReadinessFailures = async (path = "/api/production-readiness", options = {}) => {
|
|
2718
2994
|
const fetchImpl = options.fetch ?? globalThis.fetch;
|
|
@@ -2789,13 +3065,13 @@ var createVoiceReadinessFailuresStore = (path = "/api/production-readiness", opt
|
|
|
2789
3065
|
};
|
|
2790
3066
|
|
|
2791
3067
|
// src/client/readinessFailuresWidget.ts
|
|
2792
|
-
var
|
|
2793
|
-
var
|
|
2794
|
-
var
|
|
3068
|
+
var DEFAULT_TITLE7 = "Readiness Gate Explanations";
|
|
3069
|
+
var DEFAULT_DESCRIPTION7 = "Structured reasons for calibrated production-readiness warnings and failures.";
|
|
3070
|
+
var DEFAULT_LINKS4 = [
|
|
2795
3071
|
{ href: "/production-readiness", label: "Readiness page" },
|
|
2796
3072
|
{ href: "/voice/slo-readiness-thresholds", label: "Gate thresholds" }
|
|
2797
3073
|
];
|
|
2798
|
-
var
|
|
3074
|
+
var escapeHtml8 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
2799
3075
|
var formatExplanationValue = (value, unit) => {
|
|
2800
3076
|
if (value === undefined || value === null) {
|
|
2801
3077
|
return "n/a";
|
|
@@ -2823,36 +3099,36 @@ var createVoiceReadinessFailuresViewModel = (snapshot, options = {}) => {
|
|
|
2823
3099
|
const failures = snapshot.report?.checks.map(toFailureView).filter((value) => !!value) ?? [];
|
|
2824
3100
|
const hasOpenIssues = failures.length > 0;
|
|
2825
3101
|
return {
|
|
2826
|
-
description: options.description ??
|
|
3102
|
+
description: options.description ?? DEFAULT_DESCRIPTION7,
|
|
2827
3103
|
error: snapshot.error,
|
|
2828
3104
|
failures,
|
|
2829
3105
|
isLoading: snapshot.isLoading,
|
|
2830
3106
|
label: snapshot.error ? "Unavailable" : snapshot.report ? hasOpenIssues ? `${failures.length} calibrated gate issue(s)` : "No calibrated gate issues" : snapshot.isLoading ? "Checking" : "No readiness report",
|
|
2831
|
-
links: options.links ??
|
|
3107
|
+
links: options.links ?? DEFAULT_LINKS4,
|
|
2832
3108
|
status: snapshot.error ? "error" : snapshot.report ? hasOpenIssues ? "warning" : "ready" : snapshot.isLoading ? "loading" : "empty",
|
|
2833
|
-
title: options.title ??
|
|
3109
|
+
title: options.title ?? DEFAULT_TITLE7,
|
|
2834
3110
|
updatedAt: snapshot.updatedAt
|
|
2835
3111
|
};
|
|
2836
3112
|
};
|
|
2837
3113
|
var renderVoiceReadinessFailuresHTML = (snapshot, options = {}) => {
|
|
2838
3114
|
const model = createVoiceReadinessFailuresViewModel(snapshot, options);
|
|
2839
|
-
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--${
|
|
2840
|
-
<span>${
|
|
2841
|
-
<strong>${
|
|
2842
|
-
<p>Observed ${
|
|
2843
|
-
<p>${
|
|
2844
|
-
<p class="absolute-voice-readiness-failures__links">${failure.evidenceHref ? `<a href="${
|
|
2845
|
-
</article>`).join("")}</div>` : `<p class="absolute-voice-readiness-failures__empty">${model.error ?
|
|
2846
|
-
const links = model.links.length ? `<p class="absolute-voice-readiness-failures__links">${model.links.map((link) => `<a href="${
|
|
2847
|
-
return `<section class="absolute-voice-readiness-failures absolute-voice-readiness-failures--${
|
|
3115
|
+
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--${escapeHtml8(failure.status)}">
|
|
3116
|
+
<span>${escapeHtml8(failure.status.toUpperCase())}</span>
|
|
3117
|
+
<strong>${escapeHtml8(failure.label)}</strong>
|
|
3118
|
+
<p>Observed ${escapeHtml8(failure.observed)} against ${escapeHtml8(failure.thresholdLabel)} ${escapeHtml8(failure.threshold)}.</p>
|
|
3119
|
+
<p>${escapeHtml8(failure.remediation)}</p>
|
|
3120
|
+
<p class="absolute-voice-readiness-failures__links">${failure.evidenceHref ? `<a href="${escapeHtml8(failure.evidenceHref)}">Evidence</a>` : ""}${failure.sourceHref ? `<a href="${escapeHtml8(failure.sourceHref)}">Threshold source</a>` : ""}</p>
|
|
3121
|
+
</article>`).join("")}</div>` : `<p class="absolute-voice-readiness-failures__empty">${model.error ? escapeHtml8(model.error) : "No calibrated readiness gate explanations are open."}</p>`;
|
|
3122
|
+
const links = model.links.length ? `<p class="absolute-voice-readiness-failures__links">${model.links.map((link) => `<a href="${escapeHtml8(link.href)}">${escapeHtml8(link.label)}</a>`).join("")}</p>` : "";
|
|
3123
|
+
return `<section class="absolute-voice-readiness-failures absolute-voice-readiness-failures--${escapeHtml8(model.status)}">
|
|
2848
3124
|
<header class="absolute-voice-readiness-failures__header">
|
|
2849
|
-
<span class="absolute-voice-readiness-failures__eyebrow">${
|
|
2850
|
-
<strong class="absolute-voice-readiness-failures__label">${
|
|
3125
|
+
<span class="absolute-voice-readiness-failures__eyebrow">${escapeHtml8(model.title)}</span>
|
|
3126
|
+
<strong class="absolute-voice-readiness-failures__label">${escapeHtml8(model.label)}</strong>
|
|
2851
3127
|
</header>
|
|
2852
|
-
<p class="absolute-voice-readiness-failures__description">${
|
|
3128
|
+
<p class="absolute-voice-readiness-failures__description">${escapeHtml8(model.description)}</p>
|
|
2853
3129
|
${failures}
|
|
2854
3130
|
${links}
|
|
2855
|
-
${model.error ? `<p class="absolute-voice-readiness-failures__error">${
|
|
3131
|
+
${model.error ? `<p class="absolute-voice-readiness-failures__error">${escapeHtml8(model.error)}</p>` : ""}
|
|
2856
3132
|
</section>`;
|
|
2857
3133
|
};
|
|
2858
3134
|
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}`;
|
|
@@ -2893,25 +3169,25 @@ var defineVoiceReadinessFailuresElement = (tagName = "absolute-voice-readiness-f
|
|
|
2893
3169
|
};
|
|
2894
3170
|
|
|
2895
3171
|
// src/react/useVoiceReadinessFailures.tsx
|
|
2896
|
-
import { useEffect as
|
|
3172
|
+
import { useEffect as useEffect7, useRef as useRef7, useSyncExternalStore as useSyncExternalStore7 } from "react";
|
|
2897
3173
|
var useVoiceReadinessFailures = (path = "/api/production-readiness", options = {}) => {
|
|
2898
|
-
const storeRef =
|
|
3174
|
+
const storeRef = useRef7(null);
|
|
2899
3175
|
if (!storeRef.current) {
|
|
2900
3176
|
storeRef.current = createVoiceReadinessFailuresStore(path, options);
|
|
2901
3177
|
}
|
|
2902
3178
|
const store = storeRef.current;
|
|
2903
|
-
|
|
3179
|
+
useEffect7(() => {
|
|
2904
3180
|
store.refresh().catch(() => {});
|
|
2905
3181
|
return () => store.close();
|
|
2906
3182
|
}, [store]);
|
|
2907
3183
|
return {
|
|
2908
|
-
...
|
|
3184
|
+
...useSyncExternalStore7(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
2909
3185
|
refresh: store.refresh
|
|
2910
3186
|
};
|
|
2911
3187
|
};
|
|
2912
3188
|
|
|
2913
3189
|
// src/react/VoiceReadinessFailures.tsx
|
|
2914
|
-
import { jsxDEV as
|
|
3190
|
+
import { jsxDEV as jsxDEV7 } from "react/jsx-dev-runtime";
|
|
2915
3191
|
var VoiceReadinessFailures = ({
|
|
2916
3192
|
className,
|
|
2917
3193
|
path = "/api/production-readiness",
|
|
@@ -2919,42 +3195,42 @@ var VoiceReadinessFailures = ({
|
|
|
2919
3195
|
}) => {
|
|
2920
3196
|
const snapshot = useVoiceReadinessFailures(path, options);
|
|
2921
3197
|
const model = createVoiceReadinessFailuresViewModel(snapshot, options);
|
|
2922
|
-
return /* @__PURE__ */
|
|
3198
|
+
return /* @__PURE__ */ jsxDEV7("section", {
|
|
2923
3199
|
className: [
|
|
2924
3200
|
"absolute-voice-readiness-failures",
|
|
2925
3201
|
`absolute-voice-readiness-failures--${model.status}`,
|
|
2926
3202
|
className
|
|
2927
3203
|
].filter(Boolean).join(" "),
|
|
2928
3204
|
children: [
|
|
2929
|
-
/* @__PURE__ */
|
|
3205
|
+
/* @__PURE__ */ jsxDEV7("header", {
|
|
2930
3206
|
className: "absolute-voice-readiness-failures__header",
|
|
2931
3207
|
children: [
|
|
2932
|
-
/* @__PURE__ */
|
|
3208
|
+
/* @__PURE__ */ jsxDEV7("span", {
|
|
2933
3209
|
className: "absolute-voice-readiness-failures__eyebrow",
|
|
2934
3210
|
children: model.title
|
|
2935
3211
|
}, undefined, false, undefined, this),
|
|
2936
|
-
/* @__PURE__ */
|
|
3212
|
+
/* @__PURE__ */ jsxDEV7("strong", {
|
|
2937
3213
|
className: "absolute-voice-readiness-failures__label",
|
|
2938
3214
|
children: model.label
|
|
2939
3215
|
}, undefined, false, undefined, this)
|
|
2940
3216
|
]
|
|
2941
3217
|
}, undefined, true, undefined, this),
|
|
2942
|
-
/* @__PURE__ */
|
|
3218
|
+
/* @__PURE__ */ jsxDEV7("p", {
|
|
2943
3219
|
className: "absolute-voice-readiness-failures__description",
|
|
2944
3220
|
children: model.description
|
|
2945
3221
|
}, undefined, false, undefined, this),
|
|
2946
|
-
model.failures.length ? /* @__PURE__ */
|
|
3222
|
+
model.failures.length ? /* @__PURE__ */ jsxDEV7("div", {
|
|
2947
3223
|
className: "absolute-voice-readiness-failures__items",
|
|
2948
|
-
children: model.failures.map((failure) => /* @__PURE__ */
|
|
3224
|
+
children: model.failures.map((failure) => /* @__PURE__ */ jsxDEV7("article", {
|
|
2949
3225
|
className: `absolute-voice-readiness-failures__item absolute-voice-readiness-failures__item--${failure.status}`,
|
|
2950
3226
|
children: [
|
|
2951
|
-
/* @__PURE__ */
|
|
3227
|
+
/* @__PURE__ */ jsxDEV7("span", {
|
|
2952
3228
|
children: failure.status.toUpperCase()
|
|
2953
3229
|
}, undefined, false, undefined, this),
|
|
2954
|
-
/* @__PURE__ */
|
|
3230
|
+
/* @__PURE__ */ jsxDEV7("strong", {
|
|
2955
3231
|
children: failure.label
|
|
2956
3232
|
}, undefined, false, undefined, this),
|
|
2957
|
-
/* @__PURE__ */
|
|
3233
|
+
/* @__PURE__ */ jsxDEV7("p", {
|
|
2958
3234
|
children: [
|
|
2959
3235
|
"Observed ",
|
|
2960
3236
|
failure.observed,
|
|
@@ -2965,17 +3241,17 @@ var VoiceReadinessFailures = ({
|
|
|
2965
3241
|
"."
|
|
2966
3242
|
]
|
|
2967
3243
|
}, undefined, true, undefined, this),
|
|
2968
|
-
/* @__PURE__ */
|
|
3244
|
+
/* @__PURE__ */ jsxDEV7("p", {
|
|
2969
3245
|
children: failure.remediation
|
|
2970
3246
|
}, undefined, false, undefined, this),
|
|
2971
|
-
/* @__PURE__ */
|
|
3247
|
+
/* @__PURE__ */ jsxDEV7("p", {
|
|
2972
3248
|
className: "absolute-voice-readiness-failures__links",
|
|
2973
3249
|
children: [
|
|
2974
|
-
failure.evidenceHref ? /* @__PURE__ */
|
|
3250
|
+
failure.evidenceHref ? /* @__PURE__ */ jsxDEV7("a", {
|
|
2975
3251
|
href: failure.evidenceHref,
|
|
2976
3252
|
children: "Evidence"
|
|
2977
3253
|
}, undefined, false, undefined, this) : null,
|
|
2978
|
-
failure.sourceHref ? /* @__PURE__ */
|
|
3254
|
+
failure.sourceHref ? /* @__PURE__ */ jsxDEV7("a", {
|
|
2979
3255
|
href: failure.sourceHref,
|
|
2980
3256
|
children: "Threshold source"
|
|
2981
3257
|
}, undefined, false, undefined, this) : null
|
|
@@ -2983,18 +3259,18 @@ var VoiceReadinessFailures = ({
|
|
|
2983
3259
|
}, undefined, true, undefined, this)
|
|
2984
3260
|
]
|
|
2985
3261
|
}, failure.label, true, undefined, this))
|
|
2986
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
3262
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV7("p", {
|
|
2987
3263
|
className: "absolute-voice-readiness-failures__empty",
|
|
2988
3264
|
children: model.error ?? "No calibrated readiness gate explanations are open."
|
|
2989
3265
|
}, undefined, false, undefined, this),
|
|
2990
|
-
model.links.length ? /* @__PURE__ */
|
|
3266
|
+
model.links.length ? /* @__PURE__ */ jsxDEV7("p", {
|
|
2991
3267
|
className: "absolute-voice-readiness-failures__links",
|
|
2992
|
-
children: model.links.map((link) => /* @__PURE__ */
|
|
3268
|
+
children: model.links.map((link) => /* @__PURE__ */ jsxDEV7("a", {
|
|
2993
3269
|
href: link.href,
|
|
2994
3270
|
children: link.label
|
|
2995
3271
|
}, link.href, false, undefined, this))
|
|
2996
3272
|
}, undefined, false, undefined, this) : null,
|
|
2997
|
-
model.error ? /* @__PURE__ */
|
|
3273
|
+
model.error ? /* @__PURE__ */ jsxDEV7("p", {
|
|
2998
3274
|
className: "absolute-voice-readiness-failures__error",
|
|
2999
3275
|
children: model.error
|
|
3000
3276
|
}, undefined, false, undefined, this) : null
|
|
@@ -3081,7 +3357,7 @@ var createVoiceProviderSimulationControlsStore = (options) => {
|
|
|
3081
3357
|
};
|
|
3082
3358
|
|
|
3083
3359
|
// src/client/providerSimulationControlsWidget.ts
|
|
3084
|
-
var
|
|
3360
|
+
var escapeHtml9 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
3085
3361
|
var formatKind = (kind) => (kind ?? "stt").toUpperCase();
|
|
3086
3362
|
var createVoiceProviderSimulationControlsViewModel = (snapshot, options) => {
|
|
3087
3363
|
const configuredProviders = options.providers.filter((provider) => provider.configured !== false);
|
|
@@ -3101,18 +3377,18 @@ var createVoiceProviderSimulationControlsViewModel = (snapshot, options) => {
|
|
|
3101
3377
|
};
|
|
3102
3378
|
var renderVoiceProviderSimulationControlsHTML = (snapshot, options) => {
|
|
3103
3379
|
const model = createVoiceProviderSimulationControlsViewModel(snapshot, options);
|
|
3104
|
-
const failureButtons = model.failureProviders.map((provider) => `<button type="button" data-voice-provider-fail="${
|
|
3105
|
-
const recoveryButtons = model.providers.map((provider) => `<button type="button" data-voice-provider-recover="${
|
|
3380
|
+
const failureButtons = model.failureProviders.map((provider) => `<button type="button" data-voice-provider-fail="${escapeHtml9(provider.provider)}"${!model.canSimulateFailure || snapshot.isRunning ? " disabled" : ""}>Simulate ${escapeHtml9(provider.provider)} ${escapeHtml9(formatKind(options.kind))} failure</button>`).join("");
|
|
3381
|
+
const recoveryButtons = model.providers.map((provider) => `<button type="button" data-voice-provider-recover="${escapeHtml9(provider.provider)}"${snapshot.isRunning ? " disabled" : ""}>Mark ${escapeHtml9(provider.provider)} recovered</button>`).join("");
|
|
3106
3382
|
return `<section class="absolute-voice-provider-simulation absolute-voice-provider-simulation--${snapshot.error ? "error" : snapshot.isRunning ? "running" : "ready"}">
|
|
3107
3383
|
<header class="absolute-voice-provider-simulation__header">
|
|
3108
|
-
<span class="absolute-voice-provider-simulation__eyebrow">${
|
|
3109
|
-
<strong class="absolute-voice-provider-simulation__label">${
|
|
3384
|
+
<span class="absolute-voice-provider-simulation__eyebrow">${escapeHtml9(model.title)}</span>
|
|
3385
|
+
<strong class="absolute-voice-provider-simulation__label">${escapeHtml9(model.label)}</strong>
|
|
3110
3386
|
</header>
|
|
3111
|
-
<p class="absolute-voice-provider-simulation__description">${
|
|
3112
|
-
${model.canSimulateFailure ? "" : `<p class="absolute-voice-provider-simulation__empty">${
|
|
3387
|
+
<p class="absolute-voice-provider-simulation__description">${escapeHtml9(model.description)}</p>
|
|
3388
|
+
${model.canSimulateFailure ? "" : `<p class="absolute-voice-provider-simulation__empty">${escapeHtml9(options.fallbackRequiredMessage ?? "Configure fallback providers before simulating failure.")}</p>`}
|
|
3113
3389
|
<div class="absolute-voice-provider-simulation__actions">${failureButtons}${recoveryButtons}</div>
|
|
3114
|
-
${snapshot.error ? `<p class="absolute-voice-provider-simulation__error">${
|
|
3115
|
-
${model.resultText ? `<pre class="absolute-voice-provider-simulation__result">${
|
|
3390
|
+
${snapshot.error ? `<p class="absolute-voice-provider-simulation__error">${escapeHtml9(snapshot.error)}</p>` : ""}
|
|
3391
|
+
${model.resultText ? `<pre class="absolute-voice-provider-simulation__result">${escapeHtml9(model.resultText)}</pre>` : ""}
|
|
3116
3392
|
</section>`;
|
|
3117
3393
|
};
|
|
3118
3394
|
var bindVoiceProviderSimulationControls = (element, store) => {
|
|
@@ -3178,22 +3454,22 @@ var defineVoiceProviderSimulationControlsElement = (tagName = "absolute-voice-pr
|
|
|
3178
3454
|
};
|
|
3179
3455
|
|
|
3180
3456
|
// src/react/useVoiceProviderSimulationControls.tsx
|
|
3181
|
-
import { useEffect as
|
|
3457
|
+
import { useEffect as useEffect8, useRef as useRef8, useSyncExternalStore as useSyncExternalStore8 } from "react";
|
|
3182
3458
|
var useVoiceProviderSimulationControls = (options) => {
|
|
3183
|
-
const storeRef =
|
|
3459
|
+
const storeRef = useRef8(null);
|
|
3184
3460
|
if (!storeRef.current) {
|
|
3185
3461
|
storeRef.current = createVoiceProviderSimulationControlsStore(options);
|
|
3186
3462
|
}
|
|
3187
3463
|
const store = storeRef.current;
|
|
3188
|
-
|
|
3464
|
+
useEffect8(() => () => store.close(), [store]);
|
|
3189
3465
|
return {
|
|
3190
|
-
...
|
|
3466
|
+
...useSyncExternalStore8(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
3191
3467
|
run: store.run
|
|
3192
3468
|
};
|
|
3193
3469
|
};
|
|
3194
3470
|
|
|
3195
3471
|
// src/react/VoiceProviderSimulationControls.tsx
|
|
3196
|
-
import { jsxDEV as
|
|
3472
|
+
import { jsxDEV as jsxDEV8 } from "react/jsx-dev-runtime";
|
|
3197
3473
|
var VoiceProviderSimulationControls = ({
|
|
3198
3474
|
className,
|
|
3199
3475
|
...options
|
|
@@ -3203,38 +3479,38 @@ var VoiceProviderSimulationControls = ({
|
|
|
3203
3479
|
const run = (provider, mode) => {
|
|
3204
3480
|
snapshot.run(provider, mode).catch(() => {});
|
|
3205
3481
|
};
|
|
3206
|
-
return /* @__PURE__ */
|
|
3482
|
+
return /* @__PURE__ */ jsxDEV8("section", {
|
|
3207
3483
|
className: [
|
|
3208
3484
|
"absolute-voice-provider-simulation",
|
|
3209
3485
|
`absolute-voice-provider-simulation--${snapshot.error ? "error" : snapshot.isRunning ? "running" : "ready"}`,
|
|
3210
3486
|
className
|
|
3211
3487
|
].filter(Boolean).join(" "),
|
|
3212
3488
|
children: [
|
|
3213
|
-
/* @__PURE__ */
|
|
3489
|
+
/* @__PURE__ */ jsxDEV8("header", {
|
|
3214
3490
|
className: "absolute-voice-provider-simulation__header",
|
|
3215
3491
|
children: [
|
|
3216
|
-
/* @__PURE__ */
|
|
3492
|
+
/* @__PURE__ */ jsxDEV8("span", {
|
|
3217
3493
|
className: "absolute-voice-provider-simulation__eyebrow",
|
|
3218
3494
|
children: model.title
|
|
3219
3495
|
}, undefined, false, undefined, this),
|
|
3220
|
-
/* @__PURE__ */
|
|
3496
|
+
/* @__PURE__ */ jsxDEV8("strong", {
|
|
3221
3497
|
className: "absolute-voice-provider-simulation__label",
|
|
3222
3498
|
children: model.label
|
|
3223
3499
|
}, undefined, false, undefined, this)
|
|
3224
3500
|
]
|
|
3225
3501
|
}, undefined, true, undefined, this),
|
|
3226
|
-
/* @__PURE__ */
|
|
3502
|
+
/* @__PURE__ */ jsxDEV8("p", {
|
|
3227
3503
|
className: "absolute-voice-provider-simulation__description",
|
|
3228
3504
|
children: model.description
|
|
3229
3505
|
}, undefined, false, undefined, this),
|
|
3230
|
-
model.canSimulateFailure ? null : /* @__PURE__ */
|
|
3506
|
+
model.canSimulateFailure ? null : /* @__PURE__ */ jsxDEV8("p", {
|
|
3231
3507
|
className: "absolute-voice-provider-simulation__empty",
|
|
3232
3508
|
children: options.fallbackRequiredMessage ?? "Configure fallback providers before simulating failure."
|
|
3233
3509
|
}, undefined, false, undefined, this),
|
|
3234
|
-
/* @__PURE__ */
|
|
3510
|
+
/* @__PURE__ */ jsxDEV8("div", {
|
|
3235
3511
|
className: "absolute-voice-provider-simulation__actions",
|
|
3236
3512
|
children: [
|
|
3237
|
-
model.failureProviders.map((provider) => /* @__PURE__ */
|
|
3513
|
+
model.failureProviders.map((provider) => /* @__PURE__ */ jsxDEV8("button", {
|
|
3238
3514
|
disabled: !model.canSimulateFailure || snapshot.isRunning,
|
|
3239
3515
|
onClick: () => run(provider.provider, "failure"),
|
|
3240
3516
|
type: "button",
|
|
@@ -3247,7 +3523,7 @@ var VoiceProviderSimulationControls = ({
|
|
|
3247
3523
|
"failure"
|
|
3248
3524
|
]
|
|
3249
3525
|
}, `fail-${provider.provider}`, true, undefined, this)),
|
|
3250
|
-
model.providers.map((provider) => /* @__PURE__ */
|
|
3526
|
+
model.providers.map((provider) => /* @__PURE__ */ jsxDEV8("button", {
|
|
3251
3527
|
disabled: snapshot.isRunning,
|
|
3252
3528
|
onClick: () => run(provider.provider, "recovery"),
|
|
3253
3529
|
type: "button",
|
|
@@ -3259,11 +3535,11 @@ var VoiceProviderSimulationControls = ({
|
|
|
3259
3535
|
}, `recover-${provider.provider}`, true, undefined, this))
|
|
3260
3536
|
]
|
|
3261
3537
|
}, undefined, true, undefined, this),
|
|
3262
|
-
snapshot.error ? /* @__PURE__ */
|
|
3538
|
+
snapshot.error ? /* @__PURE__ */ jsxDEV8("p", {
|
|
3263
3539
|
className: "absolute-voice-provider-simulation__error",
|
|
3264
3540
|
children: snapshot.error
|
|
3265
3541
|
}, undefined, false, undefined, this) : null,
|
|
3266
|
-
model.resultText ? /* @__PURE__ */
|
|
3542
|
+
model.resultText ? /* @__PURE__ */ jsxDEV8("pre", {
|
|
3267
3543
|
className: "absolute-voice-provider-simulation__result",
|
|
3268
3544
|
children: model.resultText
|
|
3269
3545
|
}, undefined, false, undefined, this) : null
|
|
@@ -3271,7 +3547,7 @@ var VoiceProviderSimulationControls = ({
|
|
|
3271
3547
|
}, undefined, true, undefined, this);
|
|
3272
3548
|
};
|
|
3273
3549
|
// src/react/useVoiceProviderCapabilities.tsx
|
|
3274
|
-
import { useEffect as
|
|
3550
|
+
import { useEffect as useEffect9, useRef as useRef9, useSyncExternalStore as useSyncExternalStore9 } from "react";
|
|
3275
3551
|
|
|
3276
3552
|
// src/client/providerCapabilities.ts
|
|
3277
3553
|
var fetchVoiceProviderCapabilities = async (path = "/api/provider-capabilities", options = {}) => {
|
|
@@ -3354,25 +3630,25 @@ var createVoiceProviderCapabilitiesStore = (path = "/api/provider-capabilities",
|
|
|
3354
3630
|
|
|
3355
3631
|
// src/react/useVoiceProviderCapabilities.tsx
|
|
3356
3632
|
var useVoiceProviderCapabilities = (path = "/api/provider-capabilities", options = {}) => {
|
|
3357
|
-
const storeRef =
|
|
3633
|
+
const storeRef = useRef9(null);
|
|
3358
3634
|
if (!storeRef.current) {
|
|
3359
3635
|
storeRef.current = createVoiceProviderCapabilitiesStore(path, options);
|
|
3360
3636
|
}
|
|
3361
3637
|
const store = storeRef.current;
|
|
3362
|
-
|
|
3638
|
+
useEffect9(() => {
|
|
3363
3639
|
store.refresh().catch(() => {});
|
|
3364
3640
|
return () => store.close();
|
|
3365
3641
|
}, [store]);
|
|
3366
3642
|
return {
|
|
3367
|
-
...
|
|
3643
|
+
...useSyncExternalStore9(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
3368
3644
|
refresh: store.refresh
|
|
3369
3645
|
};
|
|
3370
3646
|
};
|
|
3371
3647
|
|
|
3372
3648
|
// src/client/providerCapabilitiesWidget.ts
|
|
3373
|
-
var
|
|
3374
|
-
var
|
|
3375
|
-
var
|
|
3649
|
+
var DEFAULT_TITLE8 = "Provider Capabilities";
|
|
3650
|
+
var DEFAULT_DESCRIPTION8 = "Configured, selected, and healthy voice providers for this deployment.";
|
|
3651
|
+
var escapeHtml10 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
3376
3652
|
var formatProvider = (provider) => provider.split(/[-_\s]+/).filter(Boolean).map((part) => `${part[0]?.toUpperCase() ?? ""}${part.slice(1)}`).join(" ") || provider;
|
|
3377
3653
|
var formatKind2 = (kind) => kind.toUpperCase();
|
|
3378
3654
|
var formatStatus2 = (status) => status.split("-").map((part) => `${part[0]?.toUpperCase() ?? ""}${part.slice(1)}`).join(" ");
|
|
@@ -3416,36 +3692,36 @@ var createVoiceProviderCapabilitiesViewModel = (snapshot, options = {}) => {
|
|
|
3416
3692
|
const selectedCount = snapshot.report?.selected ?? capabilities.filter((capability) => capability.selected).length;
|
|
3417
3693
|
return {
|
|
3418
3694
|
capabilities,
|
|
3419
|
-
description: options.description ??
|
|
3695
|
+
description: options.description ?? DEFAULT_DESCRIPTION8,
|
|
3420
3696
|
error: snapshot.error,
|
|
3421
3697
|
isLoading: snapshot.isLoading,
|
|
3422
3698
|
label: snapshot.error ? "Unavailable" : capabilities.length ? warningCount > 0 ? `${warningCount} needs attention` : `${selectedCount} selected` : snapshot.isLoading ? "Checking" : "No capabilities",
|
|
3423
3699
|
status: snapshot.error ? "error" : capabilities.length ? warningCount > 0 ? "warning" : "ready" : snapshot.isLoading ? "loading" : "empty",
|
|
3424
|
-
title: options.title ??
|
|
3700
|
+
title: options.title ?? DEFAULT_TITLE8,
|
|
3425
3701
|
updatedAt: snapshot.updatedAt
|
|
3426
3702
|
};
|
|
3427
3703
|
};
|
|
3428
3704
|
var renderVoiceProviderCapabilitiesHTML = (snapshot, options = {}) => {
|
|
3429
3705
|
const model = createVoiceProviderCapabilitiesViewModel(snapshot, options);
|
|
3430
|
-
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--${
|
|
3706
|
+
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--${escapeHtml10(capability.status)}">
|
|
3431
3707
|
<header>
|
|
3432
|
-
<strong>${
|
|
3433
|
-
<span>${
|
|
3708
|
+
<strong>${escapeHtml10(capability.label)}</strong>
|
|
3709
|
+
<span>${escapeHtml10(formatStatus2(capability.status))}</span>
|
|
3434
3710
|
</header>
|
|
3435
|
-
<p>${
|
|
3711
|
+
<p>${escapeHtml10(capability.detail)}</p>
|
|
3436
3712
|
<dl>${capability.rows.map((row) => `<div>
|
|
3437
|
-
<dt>${
|
|
3438
|
-
<dd>${
|
|
3713
|
+
<dt>${escapeHtml10(row.label)}</dt>
|
|
3714
|
+
<dd>${escapeHtml10(row.value)}</dd>
|
|
3439
3715
|
</div>`).join("")}</dl>
|
|
3440
3716
|
</article>`).join("")}</div>` : '<p class="absolute-voice-provider-capabilities__empty">Configure provider capabilities to see deployment coverage.</p>';
|
|
3441
|
-
return `<section class="absolute-voice-provider-capabilities absolute-voice-provider-capabilities--${
|
|
3717
|
+
return `<section class="absolute-voice-provider-capabilities absolute-voice-provider-capabilities--${escapeHtml10(model.status)}">
|
|
3442
3718
|
<header class="absolute-voice-provider-capabilities__header">
|
|
3443
|
-
<span class="absolute-voice-provider-capabilities__eyebrow">${
|
|
3444
|
-
<strong class="absolute-voice-provider-capabilities__label">${
|
|
3719
|
+
<span class="absolute-voice-provider-capabilities__eyebrow">${escapeHtml10(model.title)}</span>
|
|
3720
|
+
<strong class="absolute-voice-provider-capabilities__label">${escapeHtml10(model.label)}</strong>
|
|
3445
3721
|
</header>
|
|
3446
|
-
<p class="absolute-voice-provider-capabilities__description">${
|
|
3722
|
+
<p class="absolute-voice-provider-capabilities__description">${escapeHtml10(model.description)}</p>
|
|
3447
3723
|
${capabilities}
|
|
3448
|
-
${model.error ? `<p class="absolute-voice-provider-capabilities__error">${
|
|
3724
|
+
${model.error ? `<p class="absolute-voice-provider-capabilities__error">${escapeHtml10(model.error)}</p>` : ""}
|
|
3449
3725
|
</section>`;
|
|
3450
3726
|
};
|
|
3451
3727
|
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}`;
|
|
@@ -3487,7 +3763,7 @@ var defineVoiceProviderCapabilitiesElement = (tagName = "absolute-voice-provider
|
|
|
3487
3763
|
};
|
|
3488
3764
|
|
|
3489
3765
|
// src/react/VoiceProviderCapabilities.tsx
|
|
3490
|
-
import { jsxDEV as
|
|
3766
|
+
import { jsxDEV as jsxDEV9 } from "react/jsx-dev-runtime";
|
|
3491
3767
|
var VoiceProviderCapabilities = ({
|
|
3492
3768
|
className,
|
|
3493
3769
|
path = "/api/provider-capabilities",
|
|
@@ -3495,58 +3771,58 @@ var VoiceProviderCapabilities = ({
|
|
|
3495
3771
|
}) => {
|
|
3496
3772
|
const snapshot = useVoiceProviderCapabilities(path, options);
|
|
3497
3773
|
const model = createVoiceProviderCapabilitiesViewModel(snapshot, options);
|
|
3498
|
-
return /* @__PURE__ */
|
|
3774
|
+
return /* @__PURE__ */ jsxDEV9("section", {
|
|
3499
3775
|
className: [
|
|
3500
3776
|
"absolute-voice-provider-capabilities",
|
|
3501
3777
|
`absolute-voice-provider-capabilities--${model.status}`,
|
|
3502
3778
|
className
|
|
3503
3779
|
].filter(Boolean).join(" "),
|
|
3504
3780
|
children: [
|
|
3505
|
-
/* @__PURE__ */
|
|
3781
|
+
/* @__PURE__ */ jsxDEV9("header", {
|
|
3506
3782
|
className: "absolute-voice-provider-capabilities__header",
|
|
3507
3783
|
children: [
|
|
3508
|
-
/* @__PURE__ */
|
|
3784
|
+
/* @__PURE__ */ jsxDEV9("span", {
|
|
3509
3785
|
className: "absolute-voice-provider-capabilities__eyebrow",
|
|
3510
3786
|
children: model.title
|
|
3511
3787
|
}, undefined, false, undefined, this),
|
|
3512
|
-
/* @__PURE__ */
|
|
3788
|
+
/* @__PURE__ */ jsxDEV9("strong", {
|
|
3513
3789
|
className: "absolute-voice-provider-capabilities__label",
|
|
3514
3790
|
children: model.label
|
|
3515
3791
|
}, undefined, false, undefined, this)
|
|
3516
3792
|
]
|
|
3517
3793
|
}, undefined, true, undefined, this),
|
|
3518
|
-
/* @__PURE__ */
|
|
3794
|
+
/* @__PURE__ */ jsxDEV9("p", {
|
|
3519
3795
|
className: "absolute-voice-provider-capabilities__description",
|
|
3520
3796
|
children: model.description
|
|
3521
3797
|
}, undefined, false, undefined, this),
|
|
3522
|
-
model.capabilities.length ? /* @__PURE__ */
|
|
3798
|
+
model.capabilities.length ? /* @__PURE__ */ jsxDEV9("div", {
|
|
3523
3799
|
className: "absolute-voice-provider-capabilities__providers",
|
|
3524
|
-
children: model.capabilities.map((capability) => /* @__PURE__ */
|
|
3800
|
+
children: model.capabilities.map((capability) => /* @__PURE__ */ jsxDEV9("article", {
|
|
3525
3801
|
className: [
|
|
3526
3802
|
"absolute-voice-provider-capabilities__provider",
|
|
3527
3803
|
`absolute-voice-provider-capabilities__provider--${capability.status}`
|
|
3528
3804
|
].join(" "),
|
|
3529
3805
|
children: [
|
|
3530
|
-
/* @__PURE__ */
|
|
3806
|
+
/* @__PURE__ */ jsxDEV9("header", {
|
|
3531
3807
|
children: [
|
|
3532
|
-
/* @__PURE__ */
|
|
3808
|
+
/* @__PURE__ */ jsxDEV9("strong", {
|
|
3533
3809
|
children: capability.label
|
|
3534
3810
|
}, undefined, false, undefined, this),
|
|
3535
|
-
/* @__PURE__ */
|
|
3811
|
+
/* @__PURE__ */ jsxDEV9("span", {
|
|
3536
3812
|
children: capability.status
|
|
3537
3813
|
}, undefined, false, undefined, this)
|
|
3538
3814
|
]
|
|
3539
3815
|
}, undefined, true, undefined, this),
|
|
3540
|
-
/* @__PURE__ */
|
|
3816
|
+
/* @__PURE__ */ jsxDEV9("p", {
|
|
3541
3817
|
children: capability.detail
|
|
3542
3818
|
}, undefined, false, undefined, this),
|
|
3543
|
-
/* @__PURE__ */
|
|
3544
|
-
children: capability.rows.map((row) => /* @__PURE__ */
|
|
3819
|
+
/* @__PURE__ */ jsxDEV9("dl", {
|
|
3820
|
+
children: capability.rows.map((row) => /* @__PURE__ */ jsxDEV9("div", {
|
|
3545
3821
|
children: [
|
|
3546
|
-
/* @__PURE__ */
|
|
3822
|
+
/* @__PURE__ */ jsxDEV9("dt", {
|
|
3547
3823
|
children: row.label
|
|
3548
3824
|
}, undefined, false, undefined, this),
|
|
3549
|
-
/* @__PURE__ */
|
|
3825
|
+
/* @__PURE__ */ jsxDEV9("dd", {
|
|
3550
3826
|
children: row.value
|
|
3551
3827
|
}, undefined, false, undefined, this)
|
|
3552
3828
|
]
|
|
@@ -3554,11 +3830,11 @@ var VoiceProviderCapabilities = ({
|
|
|
3554
3830
|
}, undefined, false, undefined, this)
|
|
3555
3831
|
]
|
|
3556
3832
|
}, `${capability.kind}:${capability.provider}`, true, undefined, this))
|
|
3557
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
3833
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV9("p", {
|
|
3558
3834
|
className: "absolute-voice-provider-capabilities__empty",
|
|
3559
3835
|
children: "Configure provider capabilities to see deployment coverage."
|
|
3560
3836
|
}, undefined, false, undefined, this),
|
|
3561
|
-
model.error ? /* @__PURE__ */
|
|
3837
|
+
model.error ? /* @__PURE__ */ jsxDEV9("p", {
|
|
3562
3838
|
className: "absolute-voice-provider-capabilities__error",
|
|
3563
3839
|
children: model.error
|
|
3564
3840
|
}, undefined, false, undefined, this) : null
|
|
@@ -3566,7 +3842,7 @@ var VoiceProviderCapabilities = ({
|
|
|
3566
3842
|
}, undefined, true, undefined, this);
|
|
3567
3843
|
};
|
|
3568
3844
|
// src/react/useVoiceProviderContracts.tsx
|
|
3569
|
-
import { useEffect as
|
|
3845
|
+
import { useEffect as useEffect10, useRef as useRef10, useSyncExternalStore as useSyncExternalStore10 } from "react";
|
|
3570
3846
|
|
|
3571
3847
|
// src/client/providerContracts.ts
|
|
3572
3848
|
var fetchVoiceProviderContracts = async (path = "/api/provider-contracts", options = {}) => {
|
|
@@ -3645,25 +3921,25 @@ var createVoiceProviderContractsStore = (path = "/api/provider-contracts", optio
|
|
|
3645
3921
|
|
|
3646
3922
|
// src/react/useVoiceProviderContracts.tsx
|
|
3647
3923
|
var useVoiceProviderContracts = (path = "/api/provider-contracts", options = {}) => {
|
|
3648
|
-
const storeRef =
|
|
3924
|
+
const storeRef = useRef10(null);
|
|
3649
3925
|
if (!storeRef.current) {
|
|
3650
3926
|
storeRef.current = createVoiceProviderContractsStore(path, options);
|
|
3651
3927
|
}
|
|
3652
3928
|
const store = storeRef.current;
|
|
3653
|
-
|
|
3929
|
+
useEffect10(() => {
|
|
3654
3930
|
store.refresh().catch(() => {});
|
|
3655
3931
|
return () => store.close();
|
|
3656
3932
|
}, [store]);
|
|
3657
3933
|
return {
|
|
3658
|
-
...
|
|
3934
|
+
...useSyncExternalStore10(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
3659
3935
|
refresh: store.refresh
|
|
3660
3936
|
};
|
|
3661
3937
|
};
|
|
3662
3938
|
|
|
3663
3939
|
// src/client/providerContractsWidget.ts
|
|
3664
|
-
var
|
|
3665
|
-
var
|
|
3666
|
-
var
|
|
3940
|
+
var DEFAULT_TITLE9 = "Provider Contracts";
|
|
3941
|
+
var DEFAULT_DESCRIPTION9 = "Production contract coverage for provider env, latency, fallback, streaming, and capabilities.";
|
|
3942
|
+
var escapeHtml11 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
3667
3943
|
var formatProvider2 = (provider) => provider.split(/[-_\s]+/).filter(Boolean).map((part) => `${part[0]?.toUpperCase() ?? ""}${part.slice(1)}`).join(" ") || provider;
|
|
3668
3944
|
var formatStatus3 = (status) => status.split("-").map((part) => `${part[0]?.toUpperCase() ?? ""}${part.slice(1)}`).join(" ");
|
|
3669
3945
|
var contractDetail = (row) => {
|
|
@@ -3695,38 +3971,38 @@ var createVoiceProviderContractsViewModel = (snapshot, options = {}) => {
|
|
|
3695
3971
|
}));
|
|
3696
3972
|
const warningCount = snapshot.report ? snapshot.report.failed + snapshot.report.warned : rows.filter((row) => row.status !== "pass").length;
|
|
3697
3973
|
return {
|
|
3698
|
-
description: options.description ??
|
|
3974
|
+
description: options.description ?? DEFAULT_DESCRIPTION9,
|
|
3699
3975
|
error: snapshot.error,
|
|
3700
3976
|
isLoading: snapshot.isLoading,
|
|
3701
3977
|
label: snapshot.error ? "Unavailable" : rows.length ? warningCount > 0 ? `${warningCount} needs attention` : `${rows.length} passing` : snapshot.isLoading ? "Checking" : "No contracts",
|
|
3702
3978
|
rows,
|
|
3703
3979
|
status: snapshot.error ? "error" : rows.length ? warningCount > 0 ? "warning" : "ready" : snapshot.isLoading ? "loading" : "empty",
|
|
3704
|
-
title: options.title ??
|
|
3980
|
+
title: options.title ?? DEFAULT_TITLE9,
|
|
3705
3981
|
updatedAt: snapshot.updatedAt
|
|
3706
3982
|
};
|
|
3707
3983
|
};
|
|
3708
3984
|
var renderVoiceProviderContractsHTML = (snapshot, options = {}) => {
|
|
3709
3985
|
const model = createVoiceProviderContractsViewModel(snapshot, options);
|
|
3710
|
-
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--${
|
|
3986
|
+
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--${escapeHtml11(row.status)}">
|
|
3711
3987
|
<header>
|
|
3712
|
-
<strong>${
|
|
3713
|
-
<span>${
|
|
3988
|
+
<strong>${escapeHtml11(row.label)}</strong>
|
|
3989
|
+
<span>${escapeHtml11(formatStatus3(row.status))}</span>
|
|
3714
3990
|
</header>
|
|
3715
|
-
<p>${
|
|
3716
|
-
${row.remediations.length ? `<ul class="absolute-voice-provider-contracts__remediations">${row.remediations.map((remediation) => `<li>${remediation.href ? `<a href="${
|
|
3991
|
+
<p>${escapeHtml11(row.detail)}</p>
|
|
3992
|
+
${row.remediations.length ? `<ul class="absolute-voice-provider-contracts__remediations">${row.remediations.map((remediation) => `<li>${remediation.href ? `<a href="${escapeHtml11(remediation.href)}">${escapeHtml11(remediation.label)}</a>` : `<strong>${escapeHtml11(remediation.label)}</strong>`}<span>${escapeHtml11(remediation.detail)}</span></li>`).join("")}</ul>` : ""}
|
|
3717
3993
|
<dl>${row.rows.map((item) => `<div>
|
|
3718
|
-
<dt>${
|
|
3719
|
-
<dd>${
|
|
3994
|
+
<dt>${escapeHtml11(item.label)}</dt>
|
|
3995
|
+
<dd>${escapeHtml11(item.value)}</dd>
|
|
3720
3996
|
</div>`).join("")}</dl>
|
|
3721
3997
|
</article>`).join("")}</div>` : '<p class="absolute-voice-provider-contracts__empty">Configure provider contracts to see production coverage.</p>';
|
|
3722
|
-
return `<section class="absolute-voice-provider-contracts absolute-voice-provider-contracts--${
|
|
3998
|
+
return `<section class="absolute-voice-provider-contracts absolute-voice-provider-contracts--${escapeHtml11(model.status)}">
|
|
3723
3999
|
<header class="absolute-voice-provider-contracts__header">
|
|
3724
|
-
<span class="absolute-voice-provider-contracts__eyebrow">${
|
|
3725
|
-
<strong class="absolute-voice-provider-contracts__label">${
|
|
4000
|
+
<span class="absolute-voice-provider-contracts__eyebrow">${escapeHtml11(model.title)}</span>
|
|
4001
|
+
<strong class="absolute-voice-provider-contracts__label">${escapeHtml11(model.label)}</strong>
|
|
3726
4002
|
</header>
|
|
3727
|
-
<p class="absolute-voice-provider-contracts__description">${
|
|
4003
|
+
<p class="absolute-voice-provider-contracts__description">${escapeHtml11(model.description)}</p>
|
|
3728
4004
|
${rows}
|
|
3729
|
-
${model.error ? `<p class="absolute-voice-provider-contracts__error">${
|
|
4005
|
+
${model.error ? `<p class="absolute-voice-provider-contracts__error">${escapeHtml11(model.error)}</p>` : ""}
|
|
3730
4006
|
</section>`;
|
|
3731
4007
|
};
|
|
3732
4008
|
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}`;
|
|
@@ -3768,7 +4044,7 @@ var defineVoiceProviderContractsElement = (tagName = "absolute-voice-provider-co
|
|
|
3768
4044
|
};
|
|
3769
4045
|
|
|
3770
4046
|
// src/react/VoiceProviderContracts.tsx
|
|
3771
|
-
import { jsxDEV as
|
|
4047
|
+
import { jsxDEV as jsxDEV10 } from "react/jsx-dev-runtime";
|
|
3772
4048
|
var VoiceProviderContracts = ({
|
|
3773
4049
|
className,
|
|
3774
4050
|
path = "/api/provider-contracts",
|
|
@@ -3776,74 +4052,74 @@ var VoiceProviderContracts = ({
|
|
|
3776
4052
|
}) => {
|
|
3777
4053
|
const snapshot = useVoiceProviderContracts(path, options);
|
|
3778
4054
|
const model = createVoiceProviderContractsViewModel(snapshot, options);
|
|
3779
|
-
return /* @__PURE__ */
|
|
4055
|
+
return /* @__PURE__ */ jsxDEV10("section", {
|
|
3780
4056
|
className: [
|
|
3781
4057
|
"absolute-voice-provider-contracts",
|
|
3782
4058
|
`absolute-voice-provider-contracts--${model.status}`,
|
|
3783
4059
|
className
|
|
3784
4060
|
].filter(Boolean).join(" "),
|
|
3785
4061
|
children: [
|
|
3786
|
-
/* @__PURE__ */
|
|
4062
|
+
/* @__PURE__ */ jsxDEV10("header", {
|
|
3787
4063
|
className: "absolute-voice-provider-contracts__header",
|
|
3788
4064
|
children: [
|
|
3789
|
-
/* @__PURE__ */
|
|
4065
|
+
/* @__PURE__ */ jsxDEV10("span", {
|
|
3790
4066
|
className: "absolute-voice-provider-contracts__eyebrow",
|
|
3791
4067
|
children: model.title
|
|
3792
4068
|
}, undefined, false, undefined, this),
|
|
3793
|
-
/* @__PURE__ */
|
|
4069
|
+
/* @__PURE__ */ jsxDEV10("strong", {
|
|
3794
4070
|
className: "absolute-voice-provider-contracts__label",
|
|
3795
4071
|
children: model.label
|
|
3796
4072
|
}, undefined, false, undefined, this)
|
|
3797
4073
|
]
|
|
3798
4074
|
}, undefined, true, undefined, this),
|
|
3799
|
-
/* @__PURE__ */
|
|
4075
|
+
/* @__PURE__ */ jsxDEV10("p", {
|
|
3800
4076
|
className: "absolute-voice-provider-contracts__description",
|
|
3801
4077
|
children: model.description
|
|
3802
4078
|
}, undefined, false, undefined, this),
|
|
3803
|
-
model.rows.length ? /* @__PURE__ */
|
|
4079
|
+
model.rows.length ? /* @__PURE__ */ jsxDEV10("div", {
|
|
3804
4080
|
className: "absolute-voice-provider-contracts__rows",
|
|
3805
|
-
children: model.rows.map((row) => /* @__PURE__ */
|
|
4081
|
+
children: model.rows.map((row) => /* @__PURE__ */ jsxDEV10("article", {
|
|
3806
4082
|
className: [
|
|
3807
4083
|
"absolute-voice-provider-contracts__row",
|
|
3808
4084
|
`absolute-voice-provider-contracts__row--${row.status}`
|
|
3809
4085
|
].join(" "),
|
|
3810
4086
|
children: [
|
|
3811
|
-
/* @__PURE__ */
|
|
4087
|
+
/* @__PURE__ */ jsxDEV10("header", {
|
|
3812
4088
|
children: [
|
|
3813
|
-
/* @__PURE__ */
|
|
4089
|
+
/* @__PURE__ */ jsxDEV10("strong", {
|
|
3814
4090
|
children: row.label
|
|
3815
4091
|
}, undefined, false, undefined, this),
|
|
3816
|
-
/* @__PURE__ */
|
|
4092
|
+
/* @__PURE__ */ jsxDEV10("span", {
|
|
3817
4093
|
children: row.status
|
|
3818
4094
|
}, undefined, false, undefined, this)
|
|
3819
4095
|
]
|
|
3820
4096
|
}, undefined, true, undefined, this),
|
|
3821
|
-
/* @__PURE__ */
|
|
4097
|
+
/* @__PURE__ */ jsxDEV10("p", {
|
|
3822
4098
|
children: row.detail
|
|
3823
4099
|
}, undefined, false, undefined, this),
|
|
3824
|
-
row.remediations.length ? /* @__PURE__ */
|
|
4100
|
+
row.remediations.length ? /* @__PURE__ */ jsxDEV10("ul", {
|
|
3825
4101
|
className: "absolute-voice-provider-contracts__remediations",
|
|
3826
|
-
children: row.remediations.map((remediation) => /* @__PURE__ */
|
|
4102
|
+
children: row.remediations.map((remediation) => /* @__PURE__ */ jsxDEV10("li", {
|
|
3827
4103
|
children: [
|
|
3828
|
-
remediation.href ? /* @__PURE__ */
|
|
4104
|
+
remediation.href ? /* @__PURE__ */ jsxDEV10("a", {
|
|
3829
4105
|
href: remediation.href,
|
|
3830
4106
|
children: remediation.label
|
|
3831
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
4107
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV10("strong", {
|
|
3832
4108
|
children: remediation.label
|
|
3833
4109
|
}, undefined, false, undefined, this),
|
|
3834
|
-
/* @__PURE__ */
|
|
4110
|
+
/* @__PURE__ */ jsxDEV10("span", {
|
|
3835
4111
|
children: remediation.detail
|
|
3836
4112
|
}, undefined, false, undefined, this)
|
|
3837
4113
|
]
|
|
3838
4114
|
}, `${row.kind}:${row.provider}:${remediation.label}`, true, undefined, this))
|
|
3839
4115
|
}, undefined, false, undefined, this) : null,
|
|
3840
|
-
/* @__PURE__ */
|
|
3841
|
-
children: row.rows.map((item) => /* @__PURE__ */
|
|
4116
|
+
/* @__PURE__ */ jsxDEV10("dl", {
|
|
4117
|
+
children: row.rows.map((item) => /* @__PURE__ */ jsxDEV10("div", {
|
|
3842
4118
|
children: [
|
|
3843
|
-
/* @__PURE__ */
|
|
4119
|
+
/* @__PURE__ */ jsxDEV10("dt", {
|
|
3844
4120
|
children: item.label
|
|
3845
4121
|
}, undefined, false, undefined, this),
|
|
3846
|
-
/* @__PURE__ */
|
|
4122
|
+
/* @__PURE__ */ jsxDEV10("dd", {
|
|
3847
4123
|
children: item.value
|
|
3848
4124
|
}, undefined, false, undefined, this)
|
|
3849
4125
|
]
|
|
@@ -3851,11 +4127,11 @@ var VoiceProviderContracts = ({
|
|
|
3851
4127
|
}, undefined, false, undefined, this)
|
|
3852
4128
|
]
|
|
3853
4129
|
}, `${row.kind}:${row.provider}`, true, undefined, this))
|
|
3854
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
4130
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV10("p", {
|
|
3855
4131
|
className: "absolute-voice-provider-contracts__empty",
|
|
3856
4132
|
children: "Configure provider contracts to see production coverage."
|
|
3857
4133
|
}, undefined, false, undefined, this),
|
|
3858
|
-
model.error ? /* @__PURE__ */
|
|
4134
|
+
model.error ? /* @__PURE__ */ jsxDEV10("p", {
|
|
3859
4135
|
className: "absolute-voice-provider-contracts__error",
|
|
3860
4136
|
children: model.error
|
|
3861
4137
|
}, undefined, false, undefined, this) : null
|
|
@@ -3863,7 +4139,7 @@ var VoiceProviderContracts = ({
|
|
|
3863
4139
|
}, undefined, true, undefined, this);
|
|
3864
4140
|
};
|
|
3865
4141
|
// src/react/useVoiceProviderStatus.tsx
|
|
3866
|
-
import { useEffect as
|
|
4142
|
+
import { useEffect as useEffect11, useRef as useRef11, useSyncExternalStore as useSyncExternalStore11 } from "react";
|
|
3867
4143
|
|
|
3868
4144
|
// src/client/providerStatus.ts
|
|
3869
4145
|
var fetchVoiceProviderStatus = async (path = "/api/provider-status", options = {}) => {
|
|
@@ -3947,25 +4223,25 @@ var createVoiceProviderStatusStore = (path = "/api/provider-status", options = {
|
|
|
3947
4223
|
|
|
3948
4224
|
// src/react/useVoiceProviderStatus.tsx
|
|
3949
4225
|
var useVoiceProviderStatus = (path = "/api/provider-status", options = {}) => {
|
|
3950
|
-
const storeRef =
|
|
4226
|
+
const storeRef = useRef11(null);
|
|
3951
4227
|
if (!storeRef.current) {
|
|
3952
4228
|
storeRef.current = createVoiceProviderStatusStore(path, options);
|
|
3953
4229
|
}
|
|
3954
4230
|
const store = storeRef.current;
|
|
3955
|
-
|
|
4231
|
+
useEffect11(() => {
|
|
3956
4232
|
store.refresh().catch(() => {});
|
|
3957
4233
|
return () => store.close();
|
|
3958
4234
|
}, [store]);
|
|
3959
4235
|
return {
|
|
3960
|
-
...
|
|
4236
|
+
...useSyncExternalStore11(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
3961
4237
|
refresh: store.refresh
|
|
3962
4238
|
};
|
|
3963
4239
|
};
|
|
3964
4240
|
|
|
3965
4241
|
// src/client/providerStatusWidget.ts
|
|
3966
|
-
var
|
|
3967
|
-
var
|
|
3968
|
-
var
|
|
4242
|
+
var DEFAULT_TITLE10 = "Voice Providers";
|
|
4243
|
+
var DEFAULT_DESCRIPTION10 = "Live provider health, fallback counts, latency, and suppression state from your self-hosted trace store.";
|
|
4244
|
+
var escapeHtml12 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
3969
4245
|
var formatProvider3 = (provider) => provider.split(/[-_\s]+/).filter(Boolean).map((part) => `${part[0]?.toUpperCase() ?? ""}${part.slice(1)}`).join(" ") || provider;
|
|
3970
4246
|
var formatStatus4 = (status) => status.split("-").map((part) => `${part[0]?.toUpperCase() ?? ""}${part.slice(1)}`).join(" ");
|
|
3971
4247
|
var formatLatency = (value) => typeof value === "number" ? `${value}ms` : "No samples";
|
|
@@ -4009,37 +4285,37 @@ var createVoiceProviderStatusViewModel = (snapshot, options = {}) => {
|
|
|
4009
4285
|
const warningCount = providers.filter((provider) => isWarningStatus2(provider.status)).length;
|
|
4010
4286
|
const healthyCount = providers.filter((provider) => provider.status === "healthy").length;
|
|
4011
4287
|
return {
|
|
4012
|
-
description: options.description ??
|
|
4288
|
+
description: options.description ?? DEFAULT_DESCRIPTION10,
|
|
4013
4289
|
error: snapshot.error,
|
|
4014
4290
|
isLoading: snapshot.isLoading,
|
|
4015
4291
|
label: snapshot.error ? "Unavailable" : providers.length ? warningCount > 0 ? `${warningCount} needs attention` : `${healthyCount} healthy` : snapshot.isLoading ? "Checking" : "No provider traffic",
|
|
4016
4292
|
providers,
|
|
4017
4293
|
status: snapshot.error ? "error" : providers.length ? warningCount > 0 ? "warning" : "ready" : snapshot.isLoading ? "loading" : "empty",
|
|
4018
|
-
title: options.title ??
|
|
4294
|
+
title: options.title ?? DEFAULT_TITLE10,
|
|
4019
4295
|
updatedAt: snapshot.updatedAt
|
|
4020
4296
|
};
|
|
4021
4297
|
};
|
|
4022
4298
|
var renderVoiceProviderStatusHTML = (snapshot, options = {}) => {
|
|
4023
4299
|
const model = createVoiceProviderStatusViewModel(snapshot, options);
|
|
4024
|
-
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--${
|
|
4300
|
+
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--${escapeHtml12(provider.status)}">
|
|
4025
4301
|
<header>
|
|
4026
|
-
<strong>${
|
|
4027
|
-
<span>${
|
|
4302
|
+
<strong>${escapeHtml12(provider.label)}</strong>
|
|
4303
|
+
<span>${escapeHtml12(formatStatus4(provider.status))}</span>
|
|
4028
4304
|
</header>
|
|
4029
|
-
<p>${
|
|
4305
|
+
<p>${escapeHtml12(provider.detail)}</p>
|
|
4030
4306
|
<dl>${provider.rows.map((row) => `<div>
|
|
4031
|
-
<dt>${
|
|
4032
|
-
<dd>${
|
|
4307
|
+
<dt>${escapeHtml12(row.label)}</dt>
|
|
4308
|
+
<dd>${escapeHtml12(row.value)}</dd>
|
|
4033
4309
|
</div>`).join("")}</dl>
|
|
4034
4310
|
</article>`).join("")}</div>` : '<p class="absolute-voice-provider-status__empty">Run voice traffic to see provider health.</p>';
|
|
4035
|
-
return `<section class="absolute-voice-provider-status absolute-voice-provider-status--${
|
|
4311
|
+
return `<section class="absolute-voice-provider-status absolute-voice-provider-status--${escapeHtml12(model.status)}">
|
|
4036
4312
|
<header class="absolute-voice-provider-status__header">
|
|
4037
|
-
<span class="absolute-voice-provider-status__eyebrow">${
|
|
4038
|
-
<strong class="absolute-voice-provider-status__label">${
|
|
4313
|
+
<span class="absolute-voice-provider-status__eyebrow">${escapeHtml12(model.title)}</span>
|
|
4314
|
+
<strong class="absolute-voice-provider-status__label">${escapeHtml12(model.label)}</strong>
|
|
4039
4315
|
</header>
|
|
4040
|
-
<p class="absolute-voice-provider-status__description">${
|
|
4316
|
+
<p class="absolute-voice-provider-status__description">${escapeHtml12(model.description)}</p>
|
|
4041
4317
|
${providers}
|
|
4042
|
-
${model.error ? `<p class="absolute-voice-provider-status__error">${
|
|
4318
|
+
${model.error ? `<p class="absolute-voice-provider-status__error">${escapeHtml12(model.error)}</p>` : ""}
|
|
4043
4319
|
</section>`;
|
|
4044
4320
|
};
|
|
4045
4321
|
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}`;
|
|
@@ -4081,7 +4357,7 @@ var defineVoiceProviderStatusElement = (tagName = "absolute-voice-provider-statu
|
|
|
4081
4357
|
};
|
|
4082
4358
|
|
|
4083
4359
|
// src/react/VoiceProviderStatus.tsx
|
|
4084
|
-
import { jsxDEV as
|
|
4360
|
+
import { jsxDEV as jsxDEV11 } from "react/jsx-dev-runtime";
|
|
4085
4361
|
var VoiceProviderStatus = ({
|
|
4086
4362
|
className,
|
|
4087
4363
|
path = "/api/provider-status",
|
|
@@ -4089,58 +4365,58 @@ var VoiceProviderStatus = ({
|
|
|
4089
4365
|
}) => {
|
|
4090
4366
|
const snapshot = useVoiceProviderStatus(path, options);
|
|
4091
4367
|
const model = createVoiceProviderStatusViewModel(snapshot, options);
|
|
4092
|
-
return /* @__PURE__ */
|
|
4368
|
+
return /* @__PURE__ */ jsxDEV11("section", {
|
|
4093
4369
|
className: [
|
|
4094
4370
|
"absolute-voice-provider-status",
|
|
4095
4371
|
`absolute-voice-provider-status--${model.status}`,
|
|
4096
4372
|
className
|
|
4097
4373
|
].filter(Boolean).join(" "),
|
|
4098
4374
|
children: [
|
|
4099
|
-
/* @__PURE__ */
|
|
4375
|
+
/* @__PURE__ */ jsxDEV11("header", {
|
|
4100
4376
|
className: "absolute-voice-provider-status__header",
|
|
4101
4377
|
children: [
|
|
4102
|
-
/* @__PURE__ */
|
|
4378
|
+
/* @__PURE__ */ jsxDEV11("span", {
|
|
4103
4379
|
className: "absolute-voice-provider-status__eyebrow",
|
|
4104
4380
|
children: model.title
|
|
4105
4381
|
}, undefined, false, undefined, this),
|
|
4106
|
-
/* @__PURE__ */
|
|
4382
|
+
/* @__PURE__ */ jsxDEV11("strong", {
|
|
4107
4383
|
className: "absolute-voice-provider-status__label",
|
|
4108
4384
|
children: model.label
|
|
4109
4385
|
}, undefined, false, undefined, this)
|
|
4110
4386
|
]
|
|
4111
4387
|
}, undefined, true, undefined, this),
|
|
4112
|
-
/* @__PURE__ */
|
|
4388
|
+
/* @__PURE__ */ jsxDEV11("p", {
|
|
4113
4389
|
className: "absolute-voice-provider-status__description",
|
|
4114
4390
|
children: model.description
|
|
4115
4391
|
}, undefined, false, undefined, this),
|
|
4116
|
-
model.providers.length ? /* @__PURE__ */
|
|
4392
|
+
model.providers.length ? /* @__PURE__ */ jsxDEV11("div", {
|
|
4117
4393
|
className: "absolute-voice-provider-status__providers",
|
|
4118
|
-
children: model.providers.map((provider) => /* @__PURE__ */
|
|
4394
|
+
children: model.providers.map((provider) => /* @__PURE__ */ jsxDEV11("article", {
|
|
4119
4395
|
className: [
|
|
4120
4396
|
"absolute-voice-provider-status__provider",
|
|
4121
4397
|
`absolute-voice-provider-status__provider--${provider.status}`
|
|
4122
4398
|
].join(" "),
|
|
4123
4399
|
children: [
|
|
4124
|
-
/* @__PURE__ */
|
|
4400
|
+
/* @__PURE__ */ jsxDEV11("header", {
|
|
4125
4401
|
children: [
|
|
4126
|
-
/* @__PURE__ */
|
|
4402
|
+
/* @__PURE__ */ jsxDEV11("strong", {
|
|
4127
4403
|
children: provider.label
|
|
4128
4404
|
}, undefined, false, undefined, this),
|
|
4129
|
-
/* @__PURE__ */
|
|
4405
|
+
/* @__PURE__ */ jsxDEV11("span", {
|
|
4130
4406
|
children: provider.status
|
|
4131
4407
|
}, undefined, false, undefined, this)
|
|
4132
4408
|
]
|
|
4133
4409
|
}, undefined, true, undefined, this),
|
|
4134
|
-
/* @__PURE__ */
|
|
4410
|
+
/* @__PURE__ */ jsxDEV11("p", {
|
|
4135
4411
|
children: provider.detail
|
|
4136
4412
|
}, undefined, false, undefined, this),
|
|
4137
|
-
/* @__PURE__ */
|
|
4138
|
-
children: provider.rows.map((row) => /* @__PURE__ */
|
|
4413
|
+
/* @__PURE__ */ jsxDEV11("dl", {
|
|
4414
|
+
children: provider.rows.map((row) => /* @__PURE__ */ jsxDEV11("div", {
|
|
4139
4415
|
children: [
|
|
4140
|
-
/* @__PURE__ */
|
|
4416
|
+
/* @__PURE__ */ jsxDEV11("dt", {
|
|
4141
4417
|
children: row.label
|
|
4142
4418
|
}, undefined, false, undefined, this),
|
|
4143
|
-
/* @__PURE__ */
|
|
4419
|
+
/* @__PURE__ */ jsxDEV11("dd", {
|
|
4144
4420
|
children: row.value
|
|
4145
4421
|
}, undefined, false, undefined, this)
|
|
4146
4422
|
]
|
|
@@ -4148,11 +4424,11 @@ var VoiceProviderStatus = ({
|
|
|
4148
4424
|
}, undefined, false, undefined, this)
|
|
4149
4425
|
]
|
|
4150
4426
|
}, provider.provider, true, undefined, this))
|
|
4151
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
4427
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV11("p", {
|
|
4152
4428
|
className: "absolute-voice-provider-status__empty",
|
|
4153
4429
|
children: "Run voice traffic to see provider health."
|
|
4154
4430
|
}, undefined, false, undefined, this),
|
|
4155
|
-
model.error ? /* @__PURE__ */
|
|
4431
|
+
model.error ? /* @__PURE__ */ jsxDEV11("p", {
|
|
4156
4432
|
className: "absolute-voice-provider-status__error",
|
|
4157
4433
|
children: model.error
|
|
4158
4434
|
}, undefined, false, undefined, this) : null
|
|
@@ -4160,7 +4436,7 @@ var VoiceProviderStatus = ({
|
|
|
4160
4436
|
}, undefined, true, undefined, this);
|
|
4161
4437
|
};
|
|
4162
4438
|
// src/react/useVoiceRoutingStatus.tsx
|
|
4163
|
-
import { useEffect as
|
|
4439
|
+
import { useEffect as useEffect12, useRef as useRef12, useSyncExternalStore as useSyncExternalStore12 } from "react";
|
|
4164
4440
|
|
|
4165
4441
|
// src/client/routingStatus.ts
|
|
4166
4442
|
var fetchVoiceRoutingStatus = async (path = "/api/routing/latest", options = {}) => {
|
|
@@ -4244,29 +4520,64 @@ var createVoiceRoutingStatusStore = (path = "/api/routing/latest", options = {})
|
|
|
4244
4520
|
|
|
4245
4521
|
// src/react/useVoiceRoutingStatus.tsx
|
|
4246
4522
|
var useVoiceRoutingStatus = (path = "/api/routing/latest", options = {}) => {
|
|
4247
|
-
const storeRef =
|
|
4523
|
+
const storeRef = useRef12(null);
|
|
4248
4524
|
if (!storeRef.current) {
|
|
4249
4525
|
storeRef.current = createVoiceRoutingStatusStore(path, options);
|
|
4250
4526
|
}
|
|
4251
4527
|
const store = storeRef.current;
|
|
4252
|
-
|
|
4528
|
+
useEffect12(() => {
|
|
4253
4529
|
store.refresh().catch(() => {});
|
|
4254
4530
|
return () => store.close();
|
|
4255
4531
|
}, [store]);
|
|
4256
4532
|
return {
|
|
4257
|
-
...
|
|
4533
|
+
...useSyncExternalStore12(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
4258
4534
|
refresh: store.refresh
|
|
4259
4535
|
};
|
|
4260
4536
|
};
|
|
4261
4537
|
|
|
4262
4538
|
// src/client/routingStatusWidget.ts
|
|
4263
|
-
var
|
|
4264
|
-
var
|
|
4265
|
-
var
|
|
4539
|
+
var DEFAULT_TITLE11 = "Voice Routing";
|
|
4540
|
+
var DEFAULT_DESCRIPTION11 = "Latest provider routing decision from the self-hosted trace store.";
|
|
4541
|
+
var escapeHtml13 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
4266
4542
|
var formatValue = (value, fallback = "None") => typeof value === "string" && value.trim() ? value : typeof value === "number" && Number.isFinite(value) ? String(value) : fallback;
|
|
4267
|
-
var
|
|
4543
|
+
var formatProviderRoutes2 = (routes) => routes && typeof routes === "object" ? Object.entries(routes).map(([role, provider]) => `${role}: ${formatValue(provider)}`).join(", ") || "None" : "None";
|
|
4544
|
+
var getProviderRoute = (routes, role) => routes && typeof routes === "object" ? formatValue(routes[role], "Not configured") : "Not configured";
|
|
4545
|
+
var formatFallbackPath = (decision) => {
|
|
4546
|
+
const provider = formatValue(decision.provider, "Unknown");
|
|
4547
|
+
const selectedProvider = formatValue(decision.selectedProvider, provider);
|
|
4548
|
+
const fallbackProvider = formatValue(decision.fallbackProvider, "");
|
|
4549
|
+
if (fallbackProvider !== "None" && fallbackProvider.trim()) {
|
|
4550
|
+
return `${provider} -> ${fallbackProvider}`;
|
|
4551
|
+
}
|
|
4552
|
+
if (selectedProvider !== provider) {
|
|
4553
|
+
return `${provider} -> ${selectedProvider}`;
|
|
4554
|
+
}
|
|
4555
|
+
return `${provider} primary`;
|
|
4556
|
+
};
|
|
4268
4557
|
var createVoiceRoutingStatusViewModel = (snapshot, options = {}) => {
|
|
4269
4558
|
const decision = snapshot.decision;
|
|
4559
|
+
const activeStack = decision ? [
|
|
4560
|
+
{
|
|
4561
|
+
label: "Profile",
|
|
4562
|
+
value: formatValue(decision.profileLabel ?? decision.profileId)
|
|
4563
|
+
},
|
|
4564
|
+
{
|
|
4565
|
+
label: "LLM",
|
|
4566
|
+
value: getProviderRoute(decision.providerRoutes, "llm")
|
|
4567
|
+
},
|
|
4568
|
+
{
|
|
4569
|
+
label: "STT",
|
|
4570
|
+
value: getProviderRoute(decision.providerRoutes, "stt")
|
|
4571
|
+
},
|
|
4572
|
+
{
|
|
4573
|
+
label: "TTS",
|
|
4574
|
+
value: getProviderRoute(decision.providerRoutes, "tts")
|
|
4575
|
+
},
|
|
4576
|
+
{
|
|
4577
|
+
label: "Fallback path",
|
|
4578
|
+
value: formatFallbackPath(decision)
|
|
4579
|
+
}
|
|
4580
|
+
] : [];
|
|
4270
4581
|
const rows = decision ? [
|
|
4271
4582
|
{ label: "Kind", value: decision.kind.toUpperCase() },
|
|
4272
4583
|
{ label: "Policy", value: formatValue(decision.routing, "Unknown") },
|
|
@@ -4286,7 +4597,7 @@ var createVoiceRoutingStatusViewModel = (snapshot, options = {}) => {
|
|
|
4286
4597
|
},
|
|
4287
4598
|
{
|
|
4288
4599
|
label: "Default routes",
|
|
4289
|
-
value:
|
|
4600
|
+
value: formatProviderRoutes2(decision.providerRoutes)
|
|
4290
4601
|
},
|
|
4291
4602
|
{
|
|
4292
4603
|
label: "Latency budget",
|
|
@@ -4294,34 +4605,40 @@ var createVoiceRoutingStatusViewModel = (snapshot, options = {}) => {
|
|
|
4294
4605
|
}
|
|
4295
4606
|
] : [];
|
|
4296
4607
|
return {
|
|
4608
|
+
activeStack,
|
|
4297
4609
|
decision,
|
|
4298
|
-
description: options.description ??
|
|
4610
|
+
description: options.description ?? DEFAULT_DESCRIPTION11,
|
|
4299
4611
|
error: snapshot.error,
|
|
4300
4612
|
isLoading: snapshot.isLoading,
|
|
4301
4613
|
label: snapshot.error ? "Unavailable" : decision ? `${formatValue(decision.kind).toUpperCase()} ${formatValue(decision.status, "unknown")}` : snapshot.isLoading ? "Checking" : "No routing yet",
|
|
4302
4614
|
rows,
|
|
4303
4615
|
status: snapshot.error ? "error" : decision ? "ready" : snapshot.isLoading ? "loading" : "empty",
|
|
4304
|
-
title: options.title ??
|
|
4616
|
+
title: options.title ?? DEFAULT_TITLE11,
|
|
4305
4617
|
updatedAt: snapshot.updatedAt
|
|
4306
4618
|
};
|
|
4307
4619
|
};
|
|
4308
4620
|
var renderVoiceRoutingStatusHTML = (snapshot, options = {}) => {
|
|
4309
4621
|
const model = createVoiceRoutingStatusViewModel(snapshot, options);
|
|
4622
|
+
const activeStack = model.activeStack.length ? `<div class="absolute-voice-routing-status__stack" aria-label="Active voice stack">${model.activeStack.map((item) => `<div>
|
|
4623
|
+
<span>${escapeHtml13(item.label)}</span>
|
|
4624
|
+
<strong>${escapeHtml13(item.value)}</strong>
|
|
4625
|
+
</div>`).join("")}</div>` : "";
|
|
4310
4626
|
const rows = model.rows.length ? `<div class="absolute-voice-routing-status__grid">${model.rows.map((row) => `<div>
|
|
4311
|
-
<span>${
|
|
4312
|
-
<strong>${
|
|
4627
|
+
<span>${escapeHtml13(row.label)}</span>
|
|
4628
|
+
<strong>${escapeHtml13(row.value)}</strong>
|
|
4313
4629
|
</div>`).join("")}</div>` : '<p class="absolute-voice-routing-status__empty">Start a voice session to see the selected provider.</p>';
|
|
4314
|
-
return `<section class="absolute-voice-routing-status absolute-voice-routing-status--${
|
|
4630
|
+
return `<section class="absolute-voice-routing-status absolute-voice-routing-status--${escapeHtml13(model.status)}">
|
|
4315
4631
|
<header class="absolute-voice-routing-status__header">
|
|
4316
|
-
<span class="absolute-voice-routing-status__eyebrow">${
|
|
4317
|
-
<strong class="absolute-voice-routing-status__label">${
|
|
4632
|
+
<span class="absolute-voice-routing-status__eyebrow">${escapeHtml13(model.title)}</span>
|
|
4633
|
+
<strong class="absolute-voice-routing-status__label">${escapeHtml13(model.label)}</strong>
|
|
4318
4634
|
</header>
|
|
4319
|
-
<p class="absolute-voice-routing-status__description">${
|
|
4635
|
+
<p class="absolute-voice-routing-status__description">${escapeHtml13(model.description)}</p>
|
|
4636
|
+
${activeStack}
|
|
4320
4637
|
${rows}
|
|
4321
|
-
${model.error ? `<p class="absolute-voice-routing-status__error">${
|
|
4638
|
+
${model.error ? `<p class="absolute-voice-routing-status__error">${escapeHtml13(model.error)}</p>` : ""}
|
|
4322
4639
|
</section>`;
|
|
4323
4640
|
};
|
|
4324
|
-
var getVoiceRoutingStatusCSS = () => `.absolute-voice-routing-status{border:1px solid #d8d2c4;border-radius:20px;background:#fffaf0;color:#16130d;padding:18px;box-shadow:0 18px 40px rgba(47,37,18,.12);font-family:inherit}.absolute-voice-routing-status--error{border-color:#f2a7a7;background:#fff5f3}.absolute-voice-routing-status__header{align-items:start;display:flex;gap:12px;justify-content:space-between}.absolute-voice-routing-status__eyebrow{color:#73664f;font-size:12px;font-weight:800;letter-spacing:.08em;text-transform:uppercase}.absolute-voice-routing-status__label{font-size:24px;line-height:1}.absolute-voice-routing-status__description{color:#514733;margin:12px 0 0}.absolute-voice-routing-status__grid{display:grid;gap:8px;grid-template-columns:repeat(2,minmax(0,1fr));margin-top:14px}.absolute-voice-routing-status__grid div{background:#fff;border:1px solid #eee4d2;border-radius:14px;padding:10px 12px}.absolute-voice-routing-status__grid span{color:#655944;display:block;font-size:12px;margin-bottom:4px}.absolute-voice-routing-status__grid strong{overflow-wrap:anywhere}.absolute-voice-routing-status__empty{color:#655944;margin:14px 0 0}.absolute-voice-routing-status__error{color:#9f1239;font-weight:700}`;
|
|
4641
|
+
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}}`;
|
|
4325
4642
|
var mountVoiceRoutingStatus = (element, path = "/api/routing/latest", options = {}) => {
|
|
4326
4643
|
const store = createVoiceRoutingStatusStore(path, options);
|
|
4327
4644
|
const render = () => {
|
|
@@ -4360,7 +4677,7 @@ var defineVoiceRoutingStatusElement = (tagName = "absolute-voice-routing-status"
|
|
|
4360
4677
|
};
|
|
4361
4678
|
|
|
4362
4679
|
// src/react/VoiceRoutingStatus.tsx
|
|
4363
|
-
import { jsxDEV as
|
|
4680
|
+
import { jsxDEV as jsxDEV12 } from "react/jsx-dev-runtime";
|
|
4364
4681
|
var VoiceRoutingStatus = ({
|
|
4365
4682
|
className,
|
|
4366
4683
|
path = "/api/routing/latest",
|
|
@@ -4368,47 +4685,47 @@ var VoiceRoutingStatus = ({
|
|
|
4368
4685
|
}) => {
|
|
4369
4686
|
const snapshot = useVoiceRoutingStatus(path, options);
|
|
4370
4687
|
const model = createVoiceRoutingStatusViewModel(snapshot, options);
|
|
4371
|
-
return /* @__PURE__ */
|
|
4688
|
+
return /* @__PURE__ */ jsxDEV12("section", {
|
|
4372
4689
|
className: [
|
|
4373
4690
|
"absolute-voice-routing-status",
|
|
4374
4691
|
`absolute-voice-routing-status--${model.status}`,
|
|
4375
4692
|
className
|
|
4376
4693
|
].filter(Boolean).join(" "),
|
|
4377
4694
|
children: [
|
|
4378
|
-
/* @__PURE__ */
|
|
4695
|
+
/* @__PURE__ */ jsxDEV12("header", {
|
|
4379
4696
|
className: "absolute-voice-routing-status__header",
|
|
4380
4697
|
children: [
|
|
4381
|
-
/* @__PURE__ */
|
|
4698
|
+
/* @__PURE__ */ jsxDEV12("span", {
|
|
4382
4699
|
className: "absolute-voice-routing-status__eyebrow",
|
|
4383
4700
|
children: model.title
|
|
4384
4701
|
}, undefined, false, undefined, this),
|
|
4385
|
-
/* @__PURE__ */
|
|
4702
|
+
/* @__PURE__ */ jsxDEV12("strong", {
|
|
4386
4703
|
className: "absolute-voice-routing-status__label",
|
|
4387
4704
|
children: model.label
|
|
4388
4705
|
}, undefined, false, undefined, this)
|
|
4389
4706
|
]
|
|
4390
4707
|
}, undefined, true, undefined, this),
|
|
4391
|
-
/* @__PURE__ */
|
|
4708
|
+
/* @__PURE__ */ jsxDEV12("p", {
|
|
4392
4709
|
className: "absolute-voice-routing-status__description",
|
|
4393
4710
|
children: model.description
|
|
4394
4711
|
}, undefined, false, undefined, this),
|
|
4395
|
-
model.rows.length ? /* @__PURE__ */
|
|
4712
|
+
model.rows.length ? /* @__PURE__ */ jsxDEV12("div", {
|
|
4396
4713
|
className: "absolute-voice-routing-status__grid",
|
|
4397
|
-
children: model.rows.map((row) => /* @__PURE__ */
|
|
4714
|
+
children: model.rows.map((row) => /* @__PURE__ */ jsxDEV12("div", {
|
|
4398
4715
|
children: [
|
|
4399
|
-
/* @__PURE__ */
|
|
4716
|
+
/* @__PURE__ */ jsxDEV12("span", {
|
|
4400
4717
|
children: row.label
|
|
4401
4718
|
}, undefined, false, undefined, this),
|
|
4402
|
-
/* @__PURE__ */
|
|
4719
|
+
/* @__PURE__ */ jsxDEV12("strong", {
|
|
4403
4720
|
children: row.value
|
|
4404
4721
|
}, undefined, false, undefined, this)
|
|
4405
4722
|
]
|
|
4406
4723
|
}, row.label, true, undefined, this))
|
|
4407
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
4724
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV12("p", {
|
|
4408
4725
|
className: "absolute-voice-routing-status__empty",
|
|
4409
4726
|
children: "Start a voice session to see the selected provider."
|
|
4410
4727
|
}, undefined, false, undefined, this),
|
|
4411
|
-
model.error ? /* @__PURE__ */
|
|
4728
|
+
model.error ? /* @__PURE__ */ jsxDEV12("p", {
|
|
4412
4729
|
className: "absolute-voice-routing-status__error",
|
|
4413
4730
|
children: model.error
|
|
4414
4731
|
}, undefined, false, undefined, this) : null
|
|
@@ -4496,16 +4813,16 @@ var createVoiceTraceTimelineStore = (path = "/api/voice-traces", options = {}) =
|
|
|
4496
4813
|
};
|
|
4497
4814
|
|
|
4498
4815
|
// src/client/traceTimelineWidget.ts
|
|
4499
|
-
var
|
|
4500
|
-
var
|
|
4501
|
-
var
|
|
4502
|
-
var
|
|
4816
|
+
var DEFAULT_TITLE12 = "Voice Traces";
|
|
4817
|
+
var DEFAULT_DESCRIPTION12 = "Latest call timelines with provider latency, fallbacks, handoffs, and errors from your self-hosted trace store.";
|
|
4818
|
+
var escapeHtml14 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
4819
|
+
var formatMs3 = (value) => typeof value === "number" ? `${value}ms` : "n/a";
|
|
4503
4820
|
var formatProviders = (session) => session.providers.length ? session.providers.map((provider) => provider.provider).join(", ") : "No providers";
|
|
4504
4821
|
var createVoiceTraceTimelineViewModel = (snapshot, options = {}) => {
|
|
4505
4822
|
const sessions = (snapshot.report?.sessions ?? []).slice(0, options.limit ?? 3).map((session) => ({
|
|
4506
4823
|
...session,
|
|
4507
4824
|
detailHref: `${options.detailBasePath ?? "/traces"}/${encodeURIComponent(session.sessionId)}`,
|
|
4508
|
-
durationLabel:
|
|
4825
|
+
durationLabel: formatMs3(session.summary.callDurationMs),
|
|
4509
4826
|
incidentBundleHref: options.incidentBundleBasePath === false ? undefined : `${options.incidentBundleBasePath ?? "/voice-incidents"}/${encodeURIComponent(session.sessionId)}/markdown`,
|
|
4510
4827
|
label: `${session.summary.eventCount} events / ${session.summary.turnCount} turns`,
|
|
4511
4828
|
operationsRecordHref: options.operationsRecordBasePath === false ? undefined : `${options.operationsRecordBasePath ?? "/voice-operations"}/${encodeURIComponent(session.sessionId)}`,
|
|
@@ -4514,13 +4831,13 @@ var createVoiceTraceTimelineViewModel = (snapshot, options = {}) => {
|
|
|
4514
4831
|
const failed = sessions.filter((session) => session.status === "failed").length;
|
|
4515
4832
|
const warnings = sessions.filter((session) => session.status === "warning").length;
|
|
4516
4833
|
return {
|
|
4517
|
-
description: options.description ??
|
|
4834
|
+
description: options.description ?? DEFAULT_DESCRIPTION12,
|
|
4518
4835
|
error: snapshot.error,
|
|
4519
4836
|
isLoading: snapshot.isLoading,
|
|
4520
4837
|
label: snapshot.error ? "Unavailable" : failed > 0 ? `${failed} failed` : warnings > 0 ? `${warnings} warning` : sessions.length ? `${sessions.length} recent` : snapshot.isLoading ? "Checking" : "No traces yet",
|
|
4521
4838
|
sessions,
|
|
4522
4839
|
status: snapshot.error ? "error" : failed > 0 ? "failed" : warnings > 0 ? "warning" : sessions.length ? "ready" : snapshot.isLoading ? "loading" : "empty",
|
|
4523
|
-
title: options.title ??
|
|
4840
|
+
title: options.title ?? DEFAULT_TITLE12,
|
|
4524
4841
|
updatedAt: snapshot.updatedAt
|
|
4525
4842
|
};
|
|
4526
4843
|
};
|
|
@@ -4528,27 +4845,27 @@ var renderVoiceTraceTimelineWidgetHTML = (snapshot, options = {}) => {
|
|
|
4528
4845
|
const model = createVoiceTraceTimelineViewModel(snapshot, options);
|
|
4529
4846
|
const sessions = model.sessions.length ? `<div class="absolute-voice-trace-timeline__sessions">${model.sessions.map((session) => {
|
|
4530
4847
|
const supportLinks = [
|
|
4531
|
-
`<a href="${
|
|
4532
|
-
session.operationsRecordHref ? `<a href="${
|
|
4533
|
-
session.incidentBundleHref ? `<a href="${
|
|
4848
|
+
`<a href="${escapeHtml14(session.detailHref)}">Open timeline</a>`,
|
|
4849
|
+
session.operationsRecordHref ? `<a href="${escapeHtml14(session.operationsRecordHref)}">Open operations record</a>` : undefined,
|
|
4850
|
+
session.incidentBundleHref ? `<a href="${escapeHtml14(session.incidentBundleHref)}">Export incident bundle</a>` : undefined
|
|
4534
4851
|
].filter(Boolean).join("");
|
|
4535
|
-
return `<article class="absolute-voice-trace-timeline__session absolute-voice-trace-timeline__session--${
|
|
4852
|
+
return `<article class="absolute-voice-trace-timeline__session absolute-voice-trace-timeline__session--${escapeHtml14(session.status)}">
|
|
4536
4853
|
<header>
|
|
4537
|
-
<strong>${
|
|
4538
|
-
<span>${
|
|
4854
|
+
<strong>${escapeHtml14(session.sessionId)}</strong>
|
|
4855
|
+
<span>${escapeHtml14(session.status)}</span>
|
|
4539
4856
|
</header>
|
|
4540
|
-
<p>${
|
|
4857
|
+
<p>${escapeHtml14(session.label)} \xB7 ${escapeHtml14(session.durationLabel)} \xB7 ${escapeHtml14(session.providerLabel)}</p>
|
|
4541
4858
|
<p class="absolute-voice-trace-timeline__actions">${supportLinks}</p>
|
|
4542
4859
|
</article>`;
|
|
4543
4860
|
}).join("")}</div>` : '<p class="absolute-voice-trace-timeline__empty">Run a voice session to see call timelines.</p>';
|
|
4544
|
-
return `<section class="absolute-voice-trace-timeline absolute-voice-trace-timeline--${
|
|
4861
|
+
return `<section class="absolute-voice-trace-timeline absolute-voice-trace-timeline--${escapeHtml14(model.status)}">
|
|
4545
4862
|
<header class="absolute-voice-trace-timeline__header">
|
|
4546
|
-
<span class="absolute-voice-trace-timeline__eyebrow">${
|
|
4547
|
-
<strong class="absolute-voice-trace-timeline__label">${
|
|
4863
|
+
<span class="absolute-voice-trace-timeline__eyebrow">${escapeHtml14(model.title)}</span>
|
|
4864
|
+
<strong class="absolute-voice-trace-timeline__label">${escapeHtml14(model.label)}</strong>
|
|
4548
4865
|
</header>
|
|
4549
|
-
<p class="absolute-voice-trace-timeline__description">${
|
|
4866
|
+
<p class="absolute-voice-trace-timeline__description">${escapeHtml14(model.description)}</p>
|
|
4550
4867
|
${sessions}
|
|
4551
|
-
${model.error ? `<p class="absolute-voice-trace-timeline__error">${
|
|
4868
|
+
${model.error ? `<p class="absolute-voice-trace-timeline__error">${escapeHtml14(model.error)}</p>` : ""}
|
|
4552
4869
|
</section>`;
|
|
4553
4870
|
};
|
|
4554
4871
|
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}`;
|
|
@@ -4595,25 +4912,25 @@ var defineVoiceTraceTimelineElement = (tagName = "absolute-voice-trace-timeline"
|
|
|
4595
4912
|
};
|
|
4596
4913
|
|
|
4597
4914
|
// src/react/useVoiceTraceTimeline.tsx
|
|
4598
|
-
import { useEffect as
|
|
4915
|
+
import { useEffect as useEffect13, useRef as useRef13, useSyncExternalStore as useSyncExternalStore13 } from "react";
|
|
4599
4916
|
var useVoiceTraceTimeline = (path = "/api/voice-traces", options = {}) => {
|
|
4600
|
-
const storeRef =
|
|
4917
|
+
const storeRef = useRef13(null);
|
|
4601
4918
|
if (!storeRef.current) {
|
|
4602
4919
|
storeRef.current = createVoiceTraceTimelineStore(path, options);
|
|
4603
4920
|
}
|
|
4604
4921
|
const store = storeRef.current;
|
|
4605
|
-
|
|
4922
|
+
useEffect13(() => {
|
|
4606
4923
|
store.refresh().catch(() => {});
|
|
4607
4924
|
return () => store.close();
|
|
4608
4925
|
}, [store]);
|
|
4609
4926
|
return {
|
|
4610
|
-
...
|
|
4927
|
+
...useSyncExternalStore13(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
4611
4928
|
refresh: store.refresh
|
|
4612
4929
|
};
|
|
4613
4930
|
};
|
|
4614
4931
|
|
|
4615
4932
|
// src/react/VoiceTraceTimeline.tsx
|
|
4616
|
-
import { jsxDEV as
|
|
4933
|
+
import { jsxDEV as jsxDEV13 } from "react/jsx-dev-runtime";
|
|
4617
4934
|
var VoiceTraceTimeline = ({
|
|
4618
4935
|
className,
|
|
4619
4936
|
path = "/api/voice-traces",
|
|
@@ -4621,49 +4938,49 @@ var VoiceTraceTimeline = ({
|
|
|
4621
4938
|
}) => {
|
|
4622
4939
|
const snapshot = useVoiceTraceTimeline(path, options);
|
|
4623
4940
|
const model = createVoiceTraceTimelineViewModel(snapshot, options);
|
|
4624
|
-
return /* @__PURE__ */
|
|
4941
|
+
return /* @__PURE__ */ jsxDEV13("section", {
|
|
4625
4942
|
className: [
|
|
4626
4943
|
"absolute-voice-trace-timeline",
|
|
4627
4944
|
`absolute-voice-trace-timeline--${model.status}`,
|
|
4628
4945
|
className
|
|
4629
4946
|
].filter(Boolean).join(" "),
|
|
4630
4947
|
children: [
|
|
4631
|
-
/* @__PURE__ */
|
|
4948
|
+
/* @__PURE__ */ jsxDEV13("header", {
|
|
4632
4949
|
className: "absolute-voice-trace-timeline__header",
|
|
4633
4950
|
children: [
|
|
4634
|
-
/* @__PURE__ */
|
|
4951
|
+
/* @__PURE__ */ jsxDEV13("span", {
|
|
4635
4952
|
className: "absolute-voice-trace-timeline__eyebrow",
|
|
4636
4953
|
children: model.title
|
|
4637
4954
|
}, undefined, false, undefined, this),
|
|
4638
|
-
/* @__PURE__ */
|
|
4955
|
+
/* @__PURE__ */ jsxDEV13("strong", {
|
|
4639
4956
|
className: "absolute-voice-trace-timeline__label",
|
|
4640
4957
|
children: model.label
|
|
4641
4958
|
}, undefined, false, undefined, this)
|
|
4642
4959
|
]
|
|
4643
4960
|
}, undefined, true, undefined, this),
|
|
4644
|
-
/* @__PURE__ */
|
|
4961
|
+
/* @__PURE__ */ jsxDEV13("p", {
|
|
4645
4962
|
className: "absolute-voice-trace-timeline__description",
|
|
4646
4963
|
children: model.description
|
|
4647
4964
|
}, undefined, false, undefined, this),
|
|
4648
|
-
model.sessions.length ? /* @__PURE__ */
|
|
4965
|
+
model.sessions.length ? /* @__PURE__ */ jsxDEV13("div", {
|
|
4649
4966
|
className: "absolute-voice-trace-timeline__sessions",
|
|
4650
|
-
children: model.sessions.map((session) => /* @__PURE__ */
|
|
4967
|
+
children: model.sessions.map((session) => /* @__PURE__ */ jsxDEV13("article", {
|
|
4651
4968
|
className: [
|
|
4652
4969
|
"absolute-voice-trace-timeline__session",
|
|
4653
4970
|
`absolute-voice-trace-timeline__session--${session.status}`
|
|
4654
4971
|
].join(" "),
|
|
4655
4972
|
children: [
|
|
4656
|
-
/* @__PURE__ */
|
|
4973
|
+
/* @__PURE__ */ jsxDEV13("header", {
|
|
4657
4974
|
children: [
|
|
4658
|
-
/* @__PURE__ */
|
|
4975
|
+
/* @__PURE__ */ jsxDEV13("strong", {
|
|
4659
4976
|
children: session.sessionId
|
|
4660
4977
|
}, undefined, false, undefined, this),
|
|
4661
|
-
/* @__PURE__ */
|
|
4978
|
+
/* @__PURE__ */ jsxDEV13("span", {
|
|
4662
4979
|
children: session.status
|
|
4663
4980
|
}, undefined, false, undefined, this)
|
|
4664
4981
|
]
|
|
4665
4982
|
}, undefined, true, undefined, this),
|
|
4666
|
-
/* @__PURE__ */
|
|
4983
|
+
/* @__PURE__ */ jsxDEV13("p", {
|
|
4667
4984
|
children: [
|
|
4668
4985
|
session.label,
|
|
4669
4986
|
" \xB7 ",
|
|
@@ -4673,18 +4990,18 @@ var VoiceTraceTimeline = ({
|
|
|
4673
4990
|
session.providerLabel
|
|
4674
4991
|
]
|
|
4675
4992
|
}, undefined, true, undefined, this),
|
|
4676
|
-
/* @__PURE__ */
|
|
4993
|
+
/* @__PURE__ */ jsxDEV13("p", {
|
|
4677
4994
|
className: "absolute-voice-trace-timeline__actions",
|
|
4678
4995
|
children: [
|
|
4679
|
-
/* @__PURE__ */
|
|
4996
|
+
/* @__PURE__ */ jsxDEV13("a", {
|
|
4680
4997
|
href: session.detailHref,
|
|
4681
4998
|
children: "Open timeline"
|
|
4682
4999
|
}, undefined, false, undefined, this),
|
|
4683
|
-
session.operationsRecordHref ? /* @__PURE__ */
|
|
5000
|
+
session.operationsRecordHref ? /* @__PURE__ */ jsxDEV13("a", {
|
|
4684
5001
|
href: session.operationsRecordHref,
|
|
4685
5002
|
children: "Open operations record"
|
|
4686
5003
|
}, undefined, false, undefined, this) : null,
|
|
4687
|
-
session.incidentBundleHref ? /* @__PURE__ */
|
|
5004
|
+
session.incidentBundleHref ? /* @__PURE__ */ jsxDEV13("a", {
|
|
4688
5005
|
href: session.incidentBundleHref,
|
|
4689
5006
|
children: "Export incident bundle"
|
|
4690
5007
|
}, undefined, false, undefined, this) : null
|
|
@@ -4692,11 +5009,11 @@ var VoiceTraceTimeline = ({
|
|
|
4692
5009
|
}, undefined, true, undefined, this)
|
|
4693
5010
|
]
|
|
4694
5011
|
}, session.sessionId, true, undefined, this))
|
|
4695
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
5012
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV13("p", {
|
|
4696
5013
|
className: "absolute-voice-trace-timeline__empty",
|
|
4697
5014
|
children: "Run a voice session to see call timelines."
|
|
4698
5015
|
}, undefined, false, undefined, this),
|
|
4699
|
-
model.error ? /* @__PURE__ */
|
|
5016
|
+
model.error ? /* @__PURE__ */ jsxDEV13("p", {
|
|
4700
5017
|
className: "absolute-voice-trace-timeline__error",
|
|
4701
5018
|
children: model.error
|
|
4702
5019
|
}, undefined, false, undefined, this) : null
|
|
@@ -4704,7 +5021,7 @@ var VoiceTraceTimeline = ({
|
|
|
4704
5021
|
}, undefined, true, undefined, this);
|
|
4705
5022
|
};
|
|
4706
5023
|
// src/react/useVoiceAgentSquadStatus.tsx
|
|
4707
|
-
import { useEffect as
|
|
5024
|
+
import { useEffect as useEffect14, useRef as useRef14, useSyncExternalStore as useSyncExternalStore14 } from "react";
|
|
4708
5025
|
|
|
4709
5026
|
// src/client/agentSquadStatus.ts
|
|
4710
5027
|
var getString = (value) => typeof value === "string" && value.trim() ? value.trim() : undefined;
|
|
@@ -4782,25 +5099,25 @@ var createVoiceAgentSquadStatusStore = (path = "/api/voice-traces", options = {}
|
|
|
4782
5099
|
|
|
4783
5100
|
// src/react/useVoiceAgentSquadStatus.tsx
|
|
4784
5101
|
var useVoiceAgentSquadStatus = (path = "/api/voice-traces", options = {}) => {
|
|
4785
|
-
const storeRef =
|
|
5102
|
+
const storeRef = useRef14(null);
|
|
4786
5103
|
if (!storeRef.current) {
|
|
4787
5104
|
storeRef.current = createVoiceAgentSquadStatusStore(path, options);
|
|
4788
5105
|
}
|
|
4789
5106
|
const store = storeRef.current;
|
|
4790
|
-
|
|
5107
|
+
useEffect14(() => {
|
|
4791
5108
|
store.refresh().catch(() => {});
|
|
4792
5109
|
return () => store.close();
|
|
4793
5110
|
}, [store]);
|
|
4794
5111
|
return {
|
|
4795
|
-
...
|
|
5112
|
+
...useSyncExternalStore14(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
4796
5113
|
refresh: store.refresh
|
|
4797
5114
|
};
|
|
4798
5115
|
};
|
|
4799
5116
|
|
|
4800
5117
|
// src/client/agentSquadStatusWidget.ts
|
|
4801
|
-
var
|
|
4802
|
-
var
|
|
4803
|
-
var
|
|
5118
|
+
var DEFAULT_TITLE13 = "Voice Agent Squad";
|
|
5119
|
+
var DEFAULT_DESCRIPTION13 = "Current specialist and recent handoffs from your self-hosted voice traces.";
|
|
5120
|
+
var escapeHtml15 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
4804
5121
|
var labelFor = (current) => {
|
|
4805
5122
|
if (!current)
|
|
4806
5123
|
return "Waiting for specialist activity";
|
|
@@ -4814,37 +5131,37 @@ var labelFor = (current) => {
|
|
|
4814
5131
|
};
|
|
4815
5132
|
var createVoiceAgentSquadStatusViewModel = (snapshot, options = {}) => ({
|
|
4816
5133
|
current: snapshot.report.current,
|
|
4817
|
-
description: options.description ??
|
|
5134
|
+
description: options.description ?? DEFAULT_DESCRIPTION13,
|
|
4818
5135
|
error: snapshot.error,
|
|
4819
5136
|
isLoading: snapshot.isLoading,
|
|
4820
5137
|
label: snapshot.error ? "Unavailable" : labelFor(snapshot.report.current),
|
|
4821
5138
|
sessionCount: snapshot.report.sessionCount,
|
|
4822
5139
|
sessions: snapshot.report.sessions,
|
|
4823
|
-
title: options.title ??
|
|
5140
|
+
title: options.title ?? DEFAULT_TITLE13,
|
|
4824
5141
|
updatedAt: snapshot.updatedAt
|
|
4825
5142
|
});
|
|
4826
5143
|
var renderVoiceAgentSquadStatusHTML = (snapshot, options = {}) => {
|
|
4827
5144
|
const model = createVoiceAgentSquadStatusViewModel(snapshot, options);
|
|
4828
5145
|
const current = model.current;
|
|
4829
5146
|
const rows = model.sessions.length ? model.sessions.slice(0, 5).map((session) => `<li>
|
|
4830
|
-
<span>${
|
|
4831
|
-
<strong>${
|
|
4832
|
-
<em>${
|
|
4833
|
-
${session.summary || session.reason ? `<p>${
|
|
5147
|
+
<span>${escapeHtml15(session.sessionId)}</span>
|
|
5148
|
+
<strong>${escapeHtml15(session.targetAgentId ?? "none")}</strong>
|
|
5149
|
+
<em>${escapeHtml15(session.status)}</em>
|
|
5150
|
+
${session.summary || session.reason ? `<p>${escapeHtml15(session.summary ?? session.reason ?? "")}</p>` : ""}
|
|
4834
5151
|
</li>`).join("") : "<li><span>No squad traces yet.</span><strong>Waiting</strong></li>";
|
|
4835
5152
|
return `<section class="absolute-voice-agent-squad-status">
|
|
4836
5153
|
<header>
|
|
4837
|
-
<span>${
|
|
4838
|
-
<strong>${
|
|
5154
|
+
<span>${escapeHtml15(model.title)}</span>
|
|
5155
|
+
<strong>${escapeHtml15(model.label)}</strong>
|
|
4839
5156
|
</header>
|
|
4840
|
-
<p>${
|
|
5157
|
+
<p>${escapeHtml15(model.description)}</p>
|
|
4841
5158
|
<div>
|
|
4842
|
-
<span>Session</span><strong>${
|
|
4843
|
-
<span>From</span><strong>${
|
|
4844
|
-
<span>Status</span><strong>${
|
|
5159
|
+
<span>Session</span><strong>${escapeHtml15(current?.sessionId ?? "n/a")}</strong>
|
|
5160
|
+
<span>From</span><strong>${escapeHtml15(current?.fromAgentId ?? "n/a")}</strong>
|
|
5161
|
+
<span>Status</span><strong>${escapeHtml15(current?.status ?? "idle")}</strong>
|
|
4845
5162
|
</div>
|
|
4846
5163
|
<ul>${rows}</ul>
|
|
4847
|
-
${model.error ? `<p class="absolute-voice-agent-squad-status__error">${
|
|
5164
|
+
${model.error ? `<p class="absolute-voice-agent-squad-status__error">${escapeHtml15(model.error)}</p>` : ""}
|
|
4848
5165
|
</section>`;
|
|
4849
5166
|
};
|
|
4850
5167
|
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}`;
|
|
@@ -4889,7 +5206,7 @@ var defineVoiceAgentSquadStatusElement = (tagName = "absolute-voice-agent-squad-
|
|
|
4889
5206
|
};
|
|
4890
5207
|
|
|
4891
5208
|
// src/react/VoiceAgentSquadStatus.tsx
|
|
4892
|
-
import { jsxDEV as
|
|
5209
|
+
import { jsxDEV as jsxDEV14 } from "react/jsx-dev-runtime";
|
|
4893
5210
|
function VoiceAgentSquadStatus({
|
|
4894
5211
|
path = "/api/voice-traces",
|
|
4895
5212
|
...options
|
|
@@ -4897,64 +5214,64 @@ function VoiceAgentSquadStatus({
|
|
|
4897
5214
|
const snapshot = useVoiceAgentSquadStatus(path, options);
|
|
4898
5215
|
const model = createVoiceAgentSquadStatusViewModel(snapshot, options);
|
|
4899
5216
|
const current = model.current;
|
|
4900
|
-
return /* @__PURE__ */
|
|
5217
|
+
return /* @__PURE__ */ jsxDEV14("section", {
|
|
4901
5218
|
className: "absolute-voice-agent-squad-status",
|
|
4902
5219
|
children: [
|
|
4903
|
-
/* @__PURE__ */
|
|
5220
|
+
/* @__PURE__ */ jsxDEV14("header", {
|
|
4904
5221
|
children: [
|
|
4905
|
-
/* @__PURE__ */
|
|
5222
|
+
/* @__PURE__ */ jsxDEV14("span", {
|
|
4906
5223
|
children: model.title
|
|
4907
5224
|
}, undefined, false, undefined, this),
|
|
4908
|
-
/* @__PURE__ */
|
|
5225
|
+
/* @__PURE__ */ jsxDEV14("strong", {
|
|
4909
5226
|
children: model.label
|
|
4910
5227
|
}, undefined, false, undefined, this)
|
|
4911
5228
|
]
|
|
4912
5229
|
}, undefined, true, undefined, this),
|
|
4913
|
-
/* @__PURE__ */
|
|
5230
|
+
/* @__PURE__ */ jsxDEV14("p", {
|
|
4914
5231
|
children: model.description
|
|
4915
5232
|
}, undefined, false, undefined, this),
|
|
4916
|
-
/* @__PURE__ */
|
|
5233
|
+
/* @__PURE__ */ jsxDEV14("dl", {
|
|
4917
5234
|
children: [
|
|
4918
|
-
/* @__PURE__ */
|
|
5235
|
+
/* @__PURE__ */ jsxDEV14("div", {
|
|
4919
5236
|
children: [
|
|
4920
|
-
/* @__PURE__ */
|
|
5237
|
+
/* @__PURE__ */ jsxDEV14("dt", {
|
|
4921
5238
|
children: "Session"
|
|
4922
5239
|
}, undefined, false, undefined, this),
|
|
4923
|
-
/* @__PURE__ */
|
|
5240
|
+
/* @__PURE__ */ jsxDEV14("dd", {
|
|
4924
5241
|
children: current?.sessionId ?? "n/a"
|
|
4925
5242
|
}, undefined, false, undefined, this)
|
|
4926
5243
|
]
|
|
4927
5244
|
}, undefined, true, undefined, this),
|
|
4928
|
-
/* @__PURE__ */
|
|
5245
|
+
/* @__PURE__ */ jsxDEV14("div", {
|
|
4929
5246
|
children: [
|
|
4930
|
-
/* @__PURE__ */
|
|
5247
|
+
/* @__PURE__ */ jsxDEV14("dt", {
|
|
4931
5248
|
children: "Current specialist"
|
|
4932
5249
|
}, undefined, false, undefined, this),
|
|
4933
|
-
/* @__PURE__ */
|
|
5250
|
+
/* @__PURE__ */ jsxDEV14("dd", {
|
|
4934
5251
|
children: current?.targetAgentId ?? "none"
|
|
4935
5252
|
}, undefined, false, undefined, this)
|
|
4936
5253
|
]
|
|
4937
5254
|
}, undefined, true, undefined, this),
|
|
4938
|
-
/* @__PURE__ */
|
|
5255
|
+
/* @__PURE__ */ jsxDEV14("div", {
|
|
4939
5256
|
children: [
|
|
4940
|
-
/* @__PURE__ */
|
|
5257
|
+
/* @__PURE__ */ jsxDEV14("dt", {
|
|
4941
5258
|
children: "Status"
|
|
4942
5259
|
}, undefined, false, undefined, this),
|
|
4943
|
-
/* @__PURE__ */
|
|
5260
|
+
/* @__PURE__ */ jsxDEV14("dd", {
|
|
4944
5261
|
children: current?.status ?? "idle"
|
|
4945
5262
|
}, undefined, false, undefined, this)
|
|
4946
5263
|
]
|
|
4947
5264
|
}, undefined, true, undefined, this)
|
|
4948
5265
|
]
|
|
4949
5266
|
}, undefined, true, undefined, this),
|
|
4950
|
-
model.error ? /* @__PURE__ */
|
|
5267
|
+
model.error ? /* @__PURE__ */ jsxDEV14("p", {
|
|
4951
5268
|
children: model.error
|
|
4952
5269
|
}, undefined, false, undefined, this) : null
|
|
4953
5270
|
]
|
|
4954
5271
|
}, undefined, true, undefined, this);
|
|
4955
5272
|
}
|
|
4956
5273
|
// src/react/useVoiceTurnLatency.tsx
|
|
4957
|
-
import { useEffect as
|
|
5274
|
+
import { useEffect as useEffect15, useRef as useRef15, useSyncExternalStore as useSyncExternalStore15 } from "react";
|
|
4958
5275
|
|
|
4959
5276
|
// src/client/turnLatency.ts
|
|
4960
5277
|
var fetchVoiceTurnLatency = async (path = "/api/turn-latency", options = {}) => {
|
|
@@ -5061,73 +5378,73 @@ var createVoiceTurnLatencyStore = (path = "/api/turn-latency", options = {}) =>
|
|
|
5061
5378
|
|
|
5062
5379
|
// src/react/useVoiceTurnLatency.tsx
|
|
5063
5380
|
var useVoiceTurnLatency = (path = "/api/turn-latency", options = {}) => {
|
|
5064
|
-
const storeRef =
|
|
5381
|
+
const storeRef = useRef15(null);
|
|
5065
5382
|
if (!storeRef.current) {
|
|
5066
5383
|
storeRef.current = createVoiceTurnLatencyStore(path, options);
|
|
5067
5384
|
}
|
|
5068
5385
|
const store = storeRef.current;
|
|
5069
|
-
|
|
5386
|
+
useEffect15(() => {
|
|
5070
5387
|
store.refresh().catch(() => {});
|
|
5071
5388
|
return () => store.close();
|
|
5072
5389
|
}, [store]);
|
|
5073
5390
|
return {
|
|
5074
|
-
...
|
|
5391
|
+
...useSyncExternalStore15(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
5075
5392
|
refresh: store.refresh,
|
|
5076
5393
|
runProof: store.runProof
|
|
5077
5394
|
};
|
|
5078
5395
|
};
|
|
5079
5396
|
|
|
5080
5397
|
// src/client/turnLatencyWidget.ts
|
|
5081
|
-
var
|
|
5082
|
-
var
|
|
5398
|
+
var DEFAULT_TITLE14 = "Turn Latency";
|
|
5399
|
+
var DEFAULT_DESCRIPTION14 = "Per-turn timing from first transcript to commit and assistant response start.";
|
|
5083
5400
|
var DEFAULT_PROOF_LABEL = "Run latency proof";
|
|
5084
|
-
var
|
|
5085
|
-
var
|
|
5401
|
+
var escapeHtml16 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
5402
|
+
var formatMs4 = (value) => typeof value === "number" ? `${Math.round(value)}ms` : "n/a";
|
|
5086
5403
|
var createVoiceTurnLatencyViewModel = (snapshot, options = {}) => {
|
|
5087
5404
|
const turns = (snapshot.report?.turns ?? []).map((turn) => ({
|
|
5088
5405
|
...turn,
|
|
5089
5406
|
label: turn.text || "Empty turn",
|
|
5090
5407
|
rows: turn.stages.map((stage) => ({
|
|
5091
5408
|
label: stage.label,
|
|
5092
|
-
value:
|
|
5409
|
+
value: formatMs4(stage.valueMs)
|
|
5093
5410
|
}))
|
|
5094
5411
|
}));
|
|
5095
5412
|
const warningCount = snapshot.report?.warnings ?? turns.filter((turn) => turn.status === "warn").length;
|
|
5096
5413
|
const failedCount = snapshot.report?.failed ?? turns.filter((turn) => turn.status === "fail").length;
|
|
5097
5414
|
return {
|
|
5098
|
-
description: options.description ??
|
|
5415
|
+
description: options.description ?? DEFAULT_DESCRIPTION14,
|
|
5099
5416
|
error: snapshot.error,
|
|
5100
5417
|
isLoading: snapshot.isLoading,
|
|
5101
|
-
label: snapshot.error ? "Unavailable" : turns.length ? failedCount > 0 ? `${failedCount} slow` : warningCount > 0 ? `${warningCount} warnings` : `avg ${
|
|
5418
|
+
label: snapshot.error ? "Unavailable" : turns.length ? failedCount > 0 ? `${failedCount} slow` : warningCount > 0 ? `${warningCount} warnings` : `avg ${formatMs4(snapshot.report?.averageTotalMs)}` : snapshot.isLoading ? "Checking" : "No turns",
|
|
5102
5419
|
proofLabel: options.proofPath ? options.proofLabel ?? DEFAULT_PROOF_LABEL : undefined,
|
|
5103
5420
|
showProofAction: Boolean(options.proofPath),
|
|
5104
5421
|
status: snapshot.error ? "error" : turns.length ? failedCount > 0 || warningCount > 0 ? "warning" : "ready" : snapshot.isLoading ? "loading" : "empty",
|
|
5105
|
-
title: options.title ??
|
|
5422
|
+
title: options.title ?? DEFAULT_TITLE14,
|
|
5106
5423
|
turns,
|
|
5107
5424
|
updatedAt: snapshot.updatedAt
|
|
5108
5425
|
};
|
|
5109
5426
|
};
|
|
5110
5427
|
var renderVoiceTurnLatencyHTML = (snapshot, options = {}) => {
|
|
5111
5428
|
const model = createVoiceTurnLatencyViewModel(snapshot, options);
|
|
5112
|
-
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--${
|
|
5429
|
+
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--${escapeHtml16(turn.status)}">
|
|
5113
5430
|
<header>
|
|
5114
|
-
<strong>${
|
|
5115
|
-
<span>${
|
|
5431
|
+
<strong>${escapeHtml16(turn.label)}</strong>
|
|
5432
|
+
<span>${escapeHtml16(turn.status)}</span>
|
|
5116
5433
|
</header>
|
|
5117
5434
|
<dl>${turn.rows.map((row) => `<div>
|
|
5118
|
-
<dt>${
|
|
5119
|
-
<dd>${
|
|
5435
|
+
<dt>${escapeHtml16(row.label)}</dt>
|
|
5436
|
+
<dd>${escapeHtml16(row.value)}</dd>
|
|
5120
5437
|
</div>`).join("")}</dl>
|
|
5121
5438
|
</article>`).join("")}</div>` : '<p class="absolute-voice-turn-latency__empty">Complete a voice turn to see latency diagnostics.</p>';
|
|
5122
|
-
return `<section class="absolute-voice-turn-latency absolute-voice-turn-latency--${
|
|
5439
|
+
return `<section class="absolute-voice-turn-latency absolute-voice-turn-latency--${escapeHtml16(model.status)}">
|
|
5123
5440
|
<header class="absolute-voice-turn-latency__header">
|
|
5124
|
-
<span class="absolute-voice-turn-latency__eyebrow">${
|
|
5125
|
-
<strong class="absolute-voice-turn-latency__label">${
|
|
5441
|
+
<span class="absolute-voice-turn-latency__eyebrow">${escapeHtml16(model.title)}</span>
|
|
5442
|
+
<strong class="absolute-voice-turn-latency__label">${escapeHtml16(model.label)}</strong>
|
|
5126
5443
|
</header>
|
|
5127
|
-
<p class="absolute-voice-turn-latency__description">${
|
|
5128
|
-
${model.showProofAction ? `<button class="absolute-voice-turn-latency__proof" data-absolute-voice-turn-latency-proof type="button">${
|
|
5444
|
+
<p class="absolute-voice-turn-latency__description">${escapeHtml16(model.description)}</p>
|
|
5445
|
+
${model.showProofAction ? `<button class="absolute-voice-turn-latency__proof" data-absolute-voice-turn-latency-proof type="button">${escapeHtml16(model.proofLabel ?? DEFAULT_PROOF_LABEL)}</button>` : ""}
|
|
5129
5446
|
${turns}
|
|
5130
|
-
${model.error ? `<p class="absolute-voice-turn-latency__error">${
|
|
5447
|
+
${model.error ? `<p class="absolute-voice-turn-latency__error">${escapeHtml16(model.error)}</p>` : ""}
|
|
5131
5448
|
</section>`;
|
|
5132
5449
|
};
|
|
5133
5450
|
var mountVoiceTurnLatency = (element, path = "/api/turn-latency", options = {}) => {
|
|
@@ -5178,7 +5495,7 @@ var defineVoiceTurnLatencyElement = (tagName = "absolute-voice-turn-latency") =>
|
|
|
5178
5495
|
};
|
|
5179
5496
|
|
|
5180
5497
|
// src/react/VoiceTurnLatency.tsx
|
|
5181
|
-
import { jsxDEV as
|
|
5498
|
+
import { jsxDEV as jsxDEV15 } from "react/jsx-dev-runtime";
|
|
5182
5499
|
var VoiceTurnLatency = ({
|
|
5183
5500
|
className,
|
|
5184
5501
|
path = "/api/turn-latency",
|
|
@@ -5186,31 +5503,31 @@ var VoiceTurnLatency = ({
|
|
|
5186
5503
|
}) => {
|
|
5187
5504
|
const latency = useVoiceTurnLatency(path, options);
|
|
5188
5505
|
const model = createVoiceTurnLatencyViewModel(latency, options);
|
|
5189
|
-
return /* @__PURE__ */
|
|
5506
|
+
return /* @__PURE__ */ jsxDEV15("section", {
|
|
5190
5507
|
className: [
|
|
5191
5508
|
"absolute-voice-turn-latency",
|
|
5192
5509
|
`absolute-voice-turn-latency--${model.status}`,
|
|
5193
5510
|
className
|
|
5194
5511
|
].filter(Boolean).join(" "),
|
|
5195
5512
|
children: [
|
|
5196
|
-
/* @__PURE__ */
|
|
5513
|
+
/* @__PURE__ */ jsxDEV15("header", {
|
|
5197
5514
|
className: "absolute-voice-turn-latency__header",
|
|
5198
5515
|
children: [
|
|
5199
|
-
/* @__PURE__ */
|
|
5516
|
+
/* @__PURE__ */ jsxDEV15("span", {
|
|
5200
5517
|
className: "absolute-voice-turn-latency__eyebrow",
|
|
5201
5518
|
children: model.title
|
|
5202
5519
|
}, undefined, false, undefined, this),
|
|
5203
|
-
/* @__PURE__ */
|
|
5520
|
+
/* @__PURE__ */ jsxDEV15("strong", {
|
|
5204
5521
|
className: "absolute-voice-turn-latency__label",
|
|
5205
5522
|
children: model.label
|
|
5206
5523
|
}, undefined, false, undefined, this)
|
|
5207
5524
|
]
|
|
5208
5525
|
}, undefined, true, undefined, this),
|
|
5209
|
-
/* @__PURE__ */
|
|
5526
|
+
/* @__PURE__ */ jsxDEV15("p", {
|
|
5210
5527
|
className: "absolute-voice-turn-latency__description",
|
|
5211
5528
|
children: model.description
|
|
5212
5529
|
}, undefined, false, undefined, this),
|
|
5213
|
-
model.showProofAction ? /* @__PURE__ */
|
|
5530
|
+
model.showProofAction ? /* @__PURE__ */ jsxDEV15("button", {
|
|
5214
5531
|
className: "absolute-voice-turn-latency__proof",
|
|
5215
5532
|
onClick: () => {
|
|
5216
5533
|
latency.runProof().catch(() => {});
|
|
@@ -5218,31 +5535,31 @@ var VoiceTurnLatency = ({
|
|
|
5218
5535
|
type: "button",
|
|
5219
5536
|
children: model.proofLabel
|
|
5220
5537
|
}, undefined, false, undefined, this) : null,
|
|
5221
|
-
model.turns.length ? /* @__PURE__ */
|
|
5538
|
+
model.turns.length ? /* @__PURE__ */ jsxDEV15("div", {
|
|
5222
5539
|
className: "absolute-voice-turn-latency__turns",
|
|
5223
|
-
children: model.turns.map((turn) => /* @__PURE__ */
|
|
5540
|
+
children: model.turns.map((turn) => /* @__PURE__ */ jsxDEV15("article", {
|
|
5224
5541
|
className: [
|
|
5225
5542
|
"absolute-voice-turn-latency__turn",
|
|
5226
5543
|
`absolute-voice-turn-latency__turn--${turn.status}`
|
|
5227
5544
|
].join(" "),
|
|
5228
5545
|
children: [
|
|
5229
|
-
/* @__PURE__ */
|
|
5546
|
+
/* @__PURE__ */ jsxDEV15("header", {
|
|
5230
5547
|
children: [
|
|
5231
|
-
/* @__PURE__ */
|
|
5548
|
+
/* @__PURE__ */ jsxDEV15("strong", {
|
|
5232
5549
|
children: turn.label
|
|
5233
5550
|
}, undefined, false, undefined, this),
|
|
5234
|
-
/* @__PURE__ */
|
|
5551
|
+
/* @__PURE__ */ jsxDEV15("span", {
|
|
5235
5552
|
children: turn.status
|
|
5236
5553
|
}, undefined, false, undefined, this)
|
|
5237
5554
|
]
|
|
5238
5555
|
}, undefined, true, undefined, this),
|
|
5239
|
-
/* @__PURE__ */
|
|
5240
|
-
children: turn.rows.map((row) => /* @__PURE__ */
|
|
5556
|
+
/* @__PURE__ */ jsxDEV15("dl", {
|
|
5557
|
+
children: turn.rows.map((row) => /* @__PURE__ */ jsxDEV15("div", {
|
|
5241
5558
|
children: [
|
|
5242
|
-
/* @__PURE__ */
|
|
5559
|
+
/* @__PURE__ */ jsxDEV15("dt", {
|
|
5243
5560
|
children: row.label
|
|
5244
5561
|
}, undefined, false, undefined, this),
|
|
5245
|
-
/* @__PURE__ */
|
|
5562
|
+
/* @__PURE__ */ jsxDEV15("dd", {
|
|
5246
5563
|
children: row.value
|
|
5247
5564
|
}, undefined, false, undefined, this)
|
|
5248
5565
|
]
|
|
@@ -5250,11 +5567,11 @@ var VoiceTurnLatency = ({
|
|
|
5250
5567
|
}, undefined, false, undefined, this)
|
|
5251
5568
|
]
|
|
5252
5569
|
}, `${turn.sessionId}:${turn.turnId}`, true, undefined, this))
|
|
5253
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
5570
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV15("p", {
|
|
5254
5571
|
className: "absolute-voice-turn-latency__empty",
|
|
5255
5572
|
children: "Complete a voice turn to see latency diagnostics."
|
|
5256
5573
|
}, undefined, false, undefined, this),
|
|
5257
|
-
model.error ? /* @__PURE__ */
|
|
5574
|
+
model.error ? /* @__PURE__ */ jsxDEV15("p", {
|
|
5258
5575
|
className: "absolute-voice-turn-latency__error",
|
|
5259
5576
|
children: model.error
|
|
5260
5577
|
}, undefined, false, undefined, this) : null
|
|
@@ -5262,7 +5579,7 @@ var VoiceTurnLatency = ({
|
|
|
5262
5579
|
}, undefined, true, undefined, this);
|
|
5263
5580
|
};
|
|
5264
5581
|
// src/react/useVoiceTurnQuality.tsx
|
|
5265
|
-
import { useEffect as
|
|
5582
|
+
import { useEffect as useEffect16, useRef as useRef16, useSyncExternalStore as useSyncExternalStore16 } from "react";
|
|
5266
5583
|
|
|
5267
5584
|
// src/client/turnQuality.ts
|
|
5268
5585
|
var fetchVoiceTurnQuality = async (path = "/api/turn-quality", options = {}) => {
|
|
@@ -5345,25 +5662,25 @@ var createVoiceTurnQualityStore = (path = "/api/turn-quality", options = {}) =>
|
|
|
5345
5662
|
|
|
5346
5663
|
// src/react/useVoiceTurnQuality.tsx
|
|
5347
5664
|
var useVoiceTurnQuality = (path = "/api/turn-quality", options = {}) => {
|
|
5348
|
-
const storeRef =
|
|
5665
|
+
const storeRef = useRef16(null);
|
|
5349
5666
|
if (!storeRef.current) {
|
|
5350
5667
|
storeRef.current = createVoiceTurnQualityStore(path, options);
|
|
5351
5668
|
}
|
|
5352
5669
|
const store = storeRef.current;
|
|
5353
|
-
|
|
5670
|
+
useEffect16(() => {
|
|
5354
5671
|
store.refresh().catch(() => {});
|
|
5355
5672
|
return () => store.close();
|
|
5356
5673
|
}, [store]);
|
|
5357
5674
|
return {
|
|
5358
|
-
...
|
|
5675
|
+
...useSyncExternalStore16(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
5359
5676
|
refresh: store.refresh
|
|
5360
5677
|
};
|
|
5361
5678
|
};
|
|
5362
5679
|
|
|
5363
5680
|
// src/client/turnQualityWidget.ts
|
|
5364
|
-
var
|
|
5365
|
-
var
|
|
5366
|
-
var
|
|
5681
|
+
var DEFAULT_TITLE15 = "Turn Quality";
|
|
5682
|
+
var DEFAULT_DESCRIPTION15 = "Per-turn STT confidence, fallback selection, corrections, and transcript coverage.";
|
|
5683
|
+
var escapeHtml17 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
5367
5684
|
var formatConfidence = (value) => typeof value === "number" ? `${Math.round(value * 100)}%` : "n/a";
|
|
5368
5685
|
var formatMaybe = (value) => value === undefined || value === "" ? "n/a" : String(value);
|
|
5369
5686
|
var getTurnDetail = (turn) => {
|
|
@@ -5401,37 +5718,37 @@ var createVoiceTurnQualityViewModel = (snapshot, options = {}) => {
|
|
|
5401
5718
|
const warningCount = snapshot.report?.warnings ?? turns.filter((turn) => turn.status === "warn").length;
|
|
5402
5719
|
const failedCount = snapshot.report?.failed ?? turns.filter((turn) => turn.status === "fail").length;
|
|
5403
5720
|
return {
|
|
5404
|
-
description: options.description ??
|
|
5721
|
+
description: options.description ?? DEFAULT_DESCRIPTION15,
|
|
5405
5722
|
error: snapshot.error,
|
|
5406
5723
|
isLoading: snapshot.isLoading,
|
|
5407
5724
|
label: snapshot.error ? "Unavailable" : turns.length ? failedCount > 0 ? `${failedCount} failed` : warningCount > 0 ? `${warningCount} warnings` : `${turns.length} healthy` : snapshot.isLoading ? "Checking" : "No turns",
|
|
5408
5725
|
status: snapshot.error ? "error" : turns.length ? failedCount > 0 || warningCount > 0 ? "warning" : "ready" : snapshot.isLoading ? "loading" : "empty",
|
|
5409
|
-
title: options.title ??
|
|
5726
|
+
title: options.title ?? DEFAULT_TITLE15,
|
|
5410
5727
|
turns,
|
|
5411
5728
|
updatedAt: snapshot.updatedAt
|
|
5412
5729
|
};
|
|
5413
5730
|
};
|
|
5414
5731
|
var renderVoiceTurnQualityHTML = (snapshot, options = {}) => {
|
|
5415
5732
|
const model = createVoiceTurnQualityViewModel(snapshot, options);
|
|
5416
|
-
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--${
|
|
5733
|
+
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--${escapeHtml17(turn.status)}">
|
|
5417
5734
|
<header>
|
|
5418
|
-
<strong>${
|
|
5419
|
-
<span>${
|
|
5735
|
+
<strong>${escapeHtml17(turn.label)}</strong>
|
|
5736
|
+
<span>${escapeHtml17(turn.status)}</span>
|
|
5420
5737
|
</header>
|
|
5421
|
-
<p>${
|
|
5738
|
+
<p>${escapeHtml17(turn.detail)}</p>
|
|
5422
5739
|
<dl>${turn.rows.map((row) => `<div>
|
|
5423
|
-
<dt>${
|
|
5424
|
-
<dd>${
|
|
5740
|
+
<dt>${escapeHtml17(row.label)}</dt>
|
|
5741
|
+
<dd>${escapeHtml17(row.value)}</dd>
|
|
5425
5742
|
</div>`).join("")}</dl>
|
|
5426
5743
|
</article>`).join("")}</div>` : '<p class="absolute-voice-turn-quality__empty">Complete a voice turn to see STT quality diagnostics.</p>';
|
|
5427
|
-
return `<section class="absolute-voice-turn-quality absolute-voice-turn-quality--${
|
|
5744
|
+
return `<section class="absolute-voice-turn-quality absolute-voice-turn-quality--${escapeHtml17(model.status)}">
|
|
5428
5745
|
<header class="absolute-voice-turn-quality__header">
|
|
5429
|
-
<span class="absolute-voice-turn-quality__eyebrow">${
|
|
5430
|
-
<strong class="absolute-voice-turn-quality__label">${
|
|
5746
|
+
<span class="absolute-voice-turn-quality__eyebrow">${escapeHtml17(model.title)}</span>
|
|
5747
|
+
<strong class="absolute-voice-turn-quality__label">${escapeHtml17(model.label)}</strong>
|
|
5431
5748
|
</header>
|
|
5432
|
-
<p class="absolute-voice-turn-quality__description">${
|
|
5749
|
+
<p class="absolute-voice-turn-quality__description">${escapeHtml17(model.description)}</p>
|
|
5433
5750
|
${turns}
|
|
5434
|
-
${model.error ? `<p class="absolute-voice-turn-quality__error">${
|
|
5751
|
+
${model.error ? `<p class="absolute-voice-turn-quality__error">${escapeHtml17(model.error)}</p>` : ""}
|
|
5435
5752
|
</section>`;
|
|
5436
5753
|
};
|
|
5437
5754
|
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}`;
|
|
@@ -5473,7 +5790,7 @@ var defineVoiceTurnQualityElement = (tagName = "absolute-voice-turn-quality") =>
|
|
|
5473
5790
|
};
|
|
5474
5791
|
|
|
5475
5792
|
// src/react/VoiceTurnQuality.tsx
|
|
5476
|
-
import { jsxDEV as
|
|
5793
|
+
import { jsxDEV as jsxDEV16 } from "react/jsx-dev-runtime";
|
|
5477
5794
|
var VoiceTurnQuality = ({
|
|
5478
5795
|
className,
|
|
5479
5796
|
path = "/api/turn-quality",
|
|
@@ -5481,58 +5798,58 @@ var VoiceTurnQuality = ({
|
|
|
5481
5798
|
}) => {
|
|
5482
5799
|
const snapshot = useVoiceTurnQuality(path, options);
|
|
5483
5800
|
const model = createVoiceTurnQualityViewModel(snapshot, options);
|
|
5484
|
-
return /* @__PURE__ */
|
|
5801
|
+
return /* @__PURE__ */ jsxDEV16("section", {
|
|
5485
5802
|
className: [
|
|
5486
5803
|
"absolute-voice-turn-quality",
|
|
5487
5804
|
`absolute-voice-turn-quality--${model.status}`,
|
|
5488
5805
|
className
|
|
5489
5806
|
].filter(Boolean).join(" "),
|
|
5490
5807
|
children: [
|
|
5491
|
-
/* @__PURE__ */
|
|
5808
|
+
/* @__PURE__ */ jsxDEV16("header", {
|
|
5492
5809
|
className: "absolute-voice-turn-quality__header",
|
|
5493
5810
|
children: [
|
|
5494
|
-
/* @__PURE__ */
|
|
5811
|
+
/* @__PURE__ */ jsxDEV16("span", {
|
|
5495
5812
|
className: "absolute-voice-turn-quality__eyebrow",
|
|
5496
5813
|
children: model.title
|
|
5497
5814
|
}, undefined, false, undefined, this),
|
|
5498
|
-
/* @__PURE__ */
|
|
5815
|
+
/* @__PURE__ */ jsxDEV16("strong", {
|
|
5499
5816
|
className: "absolute-voice-turn-quality__label",
|
|
5500
5817
|
children: model.label
|
|
5501
5818
|
}, undefined, false, undefined, this)
|
|
5502
5819
|
]
|
|
5503
5820
|
}, undefined, true, undefined, this),
|
|
5504
|
-
/* @__PURE__ */
|
|
5821
|
+
/* @__PURE__ */ jsxDEV16("p", {
|
|
5505
5822
|
className: "absolute-voice-turn-quality__description",
|
|
5506
5823
|
children: model.description
|
|
5507
5824
|
}, undefined, false, undefined, this),
|
|
5508
|
-
model.turns.length ? /* @__PURE__ */
|
|
5825
|
+
model.turns.length ? /* @__PURE__ */ jsxDEV16("div", {
|
|
5509
5826
|
className: "absolute-voice-turn-quality__turns",
|
|
5510
|
-
children: model.turns.map((turn) => /* @__PURE__ */
|
|
5827
|
+
children: model.turns.map((turn) => /* @__PURE__ */ jsxDEV16("article", {
|
|
5511
5828
|
className: [
|
|
5512
5829
|
"absolute-voice-turn-quality__turn",
|
|
5513
5830
|
`absolute-voice-turn-quality__turn--${turn.status}`
|
|
5514
5831
|
].join(" "),
|
|
5515
5832
|
children: [
|
|
5516
|
-
/* @__PURE__ */
|
|
5833
|
+
/* @__PURE__ */ jsxDEV16("header", {
|
|
5517
5834
|
children: [
|
|
5518
|
-
/* @__PURE__ */
|
|
5835
|
+
/* @__PURE__ */ jsxDEV16("strong", {
|
|
5519
5836
|
children: turn.label
|
|
5520
5837
|
}, undefined, false, undefined, this),
|
|
5521
|
-
/* @__PURE__ */
|
|
5838
|
+
/* @__PURE__ */ jsxDEV16("span", {
|
|
5522
5839
|
children: turn.status
|
|
5523
5840
|
}, undefined, false, undefined, this)
|
|
5524
5841
|
]
|
|
5525
5842
|
}, undefined, true, undefined, this),
|
|
5526
|
-
/* @__PURE__ */
|
|
5843
|
+
/* @__PURE__ */ jsxDEV16("p", {
|
|
5527
5844
|
children: turn.detail
|
|
5528
5845
|
}, undefined, false, undefined, this),
|
|
5529
|
-
/* @__PURE__ */
|
|
5530
|
-
children: turn.rows.map((row) => /* @__PURE__ */
|
|
5846
|
+
/* @__PURE__ */ jsxDEV16("dl", {
|
|
5847
|
+
children: turn.rows.map((row) => /* @__PURE__ */ jsxDEV16("div", {
|
|
5531
5848
|
children: [
|
|
5532
|
-
/* @__PURE__ */
|
|
5849
|
+
/* @__PURE__ */ jsxDEV16("dt", {
|
|
5533
5850
|
children: row.label
|
|
5534
5851
|
}, undefined, false, undefined, this),
|
|
5535
|
-
/* @__PURE__ */
|
|
5852
|
+
/* @__PURE__ */ jsxDEV16("dd", {
|
|
5536
5853
|
children: row.value
|
|
5537
5854
|
}, undefined, false, undefined, this)
|
|
5538
5855
|
]
|
|
@@ -5540,11 +5857,11 @@ var VoiceTurnQuality = ({
|
|
|
5540
5857
|
}, undefined, false, undefined, this)
|
|
5541
5858
|
]
|
|
5542
5859
|
}, `${turn.sessionId}:${turn.turnId}`, true, undefined, this))
|
|
5543
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
5860
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV16("p", {
|
|
5544
5861
|
className: "absolute-voice-turn-quality__empty",
|
|
5545
5862
|
children: "Complete a voice turn to see STT quality diagnostics."
|
|
5546
5863
|
}, undefined, false, undefined, this),
|
|
5547
|
-
model.error ? /* @__PURE__ */
|
|
5864
|
+
model.error ? /* @__PURE__ */ jsxDEV16("p", {
|
|
5548
5865
|
className: "absolute-voice-turn-quality__error",
|
|
5549
5866
|
children: model.error
|
|
5550
5867
|
}, undefined, false, undefined, this) : null
|
|
@@ -5552,7 +5869,7 @@ var VoiceTurnQuality = ({
|
|
|
5552
5869
|
}, undefined, true, undefined, this);
|
|
5553
5870
|
};
|
|
5554
5871
|
// src/react/useVoiceLiveOps.tsx
|
|
5555
|
-
import { useEffect as
|
|
5872
|
+
import { useEffect as useEffect17, useRef as useRef17, useSyncExternalStore as useSyncExternalStore17 } from "react";
|
|
5556
5873
|
|
|
5557
5874
|
// src/client/liveOps.ts
|
|
5558
5875
|
var postVoiceLiveOpsAction = async (input, options = {}) => {
|
|
@@ -5642,19 +5959,19 @@ var createVoiceLiveOpsStore = (options = {}) => {
|
|
|
5642
5959
|
|
|
5643
5960
|
// src/react/useVoiceLiveOps.tsx
|
|
5644
5961
|
var useVoiceLiveOps = (options = {}) => {
|
|
5645
|
-
const storeRef =
|
|
5962
|
+
const storeRef = useRef17(null);
|
|
5646
5963
|
if (!storeRef.current) {
|
|
5647
5964
|
storeRef.current = createVoiceLiveOpsStore(options);
|
|
5648
5965
|
}
|
|
5649
5966
|
const store = storeRef.current;
|
|
5650
|
-
|
|
5967
|
+
useEffect17(() => () => store.close(), [store]);
|
|
5651
5968
|
return {
|
|
5652
|
-
...
|
|
5969
|
+
...useSyncExternalStore17(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
5653
5970
|
run: store.run
|
|
5654
5971
|
};
|
|
5655
5972
|
};
|
|
5656
5973
|
// src/react/useVoiceCampaignDialerProof.tsx
|
|
5657
|
-
import { useEffect as
|
|
5974
|
+
import { useEffect as useEffect18, useRef as useRef18, useSyncExternalStore as useSyncExternalStore18 } from "react";
|
|
5658
5975
|
|
|
5659
5976
|
// src/client/campaignDialerProof.ts
|
|
5660
5977
|
var fetchVoiceCampaignDialerProofStatus = async (path = "/api/voice/campaigns/dialer-proof", options = {}) => {
|
|
@@ -5776,23 +6093,23 @@ var createVoiceCampaignDialerProofStore = (path = "/api/voice/campaigns/dialer-p
|
|
|
5776
6093
|
|
|
5777
6094
|
// src/react/useVoiceCampaignDialerProof.tsx
|
|
5778
6095
|
var useVoiceCampaignDialerProof = (path = "/api/voice/campaigns/dialer-proof", options = {}) => {
|
|
5779
|
-
const storeRef =
|
|
6096
|
+
const storeRef = useRef18(null);
|
|
5780
6097
|
if (!storeRef.current) {
|
|
5781
6098
|
storeRef.current = createVoiceCampaignDialerProofStore(path, options);
|
|
5782
6099
|
}
|
|
5783
6100
|
const store = storeRef.current;
|
|
5784
|
-
|
|
6101
|
+
useEffect18(() => {
|
|
5785
6102
|
store.refresh().catch(() => {});
|
|
5786
6103
|
return () => store.close();
|
|
5787
6104
|
}, [store]);
|
|
5788
6105
|
return {
|
|
5789
|
-
...
|
|
6106
|
+
...useSyncExternalStore18(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
5790
6107
|
refresh: store.refresh,
|
|
5791
6108
|
runProof: store.runProof
|
|
5792
6109
|
};
|
|
5793
6110
|
};
|
|
5794
6111
|
// src/react/useVoiceStream.tsx
|
|
5795
|
-
import { useEffect as
|
|
6112
|
+
import { useEffect as useEffect19, useRef as useRef19, useSyncExternalStore as useSyncExternalStore19 } from "react";
|
|
5796
6113
|
|
|
5797
6114
|
// src/client/actions.ts
|
|
5798
6115
|
var normalizeErrorMessage = (value) => {
|
|
@@ -7194,13 +7511,13 @@ var EMPTY_SNAPSHOT = {
|
|
|
7194
7511
|
turns: []
|
|
7195
7512
|
};
|
|
7196
7513
|
var useVoiceStream = (path, options = {}) => {
|
|
7197
|
-
const streamRef =
|
|
7514
|
+
const streamRef = useRef19(null);
|
|
7198
7515
|
if (!streamRef.current) {
|
|
7199
7516
|
streamRef.current = createVoiceStream(path, options);
|
|
7200
7517
|
}
|
|
7201
7518
|
const stream = streamRef.current;
|
|
7202
|
-
|
|
7203
|
-
const snapshot =
|
|
7519
|
+
useEffect19(() => () => stream.close(), [stream]);
|
|
7520
|
+
const snapshot = useSyncExternalStore19(stream.subscribe, stream.getSnapshot, stream.getServerSnapshot) ?? EMPTY_SNAPSHOT;
|
|
7204
7521
|
return {
|
|
7205
7522
|
...snapshot,
|
|
7206
7523
|
callControl: (message) => stream.callControl(message),
|
|
@@ -7210,7 +7527,7 @@ var useVoiceStream = (path, options = {}) => {
|
|
|
7210
7527
|
};
|
|
7211
7528
|
};
|
|
7212
7529
|
// src/react/useVoiceController.tsx
|
|
7213
|
-
import { useEffect as
|
|
7530
|
+
import { useEffect as useEffect20, useRef as useRef20, useSyncExternalStore as useSyncExternalStore20 } from "react";
|
|
7214
7531
|
|
|
7215
7532
|
// src/client/htmx.ts
|
|
7216
7533
|
var DEFAULT_EVENT_NAME = "voice-refresh";
|
|
@@ -7873,13 +8190,13 @@ var EMPTY_SNAPSHOT2 = {
|
|
|
7873
8190
|
turns: []
|
|
7874
8191
|
};
|
|
7875
8192
|
var useVoiceController = (path, options = {}) => {
|
|
7876
|
-
const controllerRef =
|
|
8193
|
+
const controllerRef = useRef20(null);
|
|
7877
8194
|
if (!controllerRef.current) {
|
|
7878
8195
|
controllerRef.current = createVoiceController(path, options);
|
|
7879
8196
|
}
|
|
7880
8197
|
const controller = controllerRef.current;
|
|
7881
|
-
|
|
7882
|
-
const snapshot =
|
|
8198
|
+
useEffect20(() => () => controller.close(), [controller]);
|
|
8199
|
+
const snapshot = useSyncExternalStore20(controller.subscribe, controller.getSnapshot, controller.getServerSnapshot) ?? EMPTY_SNAPSHOT2;
|
|
7883
8200
|
return {
|
|
7884
8201
|
...snapshot,
|
|
7885
8202
|
bindHTMX: controller.bindHTMX,
|
|
@@ -7893,7 +8210,7 @@ var useVoiceController = (path, options = {}) => {
|
|
|
7893
8210
|
};
|
|
7894
8211
|
};
|
|
7895
8212
|
// src/react/useVoiceWorkflowStatus.tsx
|
|
7896
|
-
import { useEffect as
|
|
8213
|
+
import { useEffect as useEffect21, useRef as useRef21, useSyncExternalStore as useSyncExternalStore21 } from "react";
|
|
7897
8214
|
|
|
7898
8215
|
// src/client/workflowStatus.ts
|
|
7899
8216
|
var fetchVoiceWorkflowStatus = async (path = "/evals/scenarios/json", options = {}) => {
|
|
@@ -7976,17 +8293,17 @@ var createVoiceWorkflowStatusStore = (path = "/evals/scenarios/json", options =
|
|
|
7976
8293
|
|
|
7977
8294
|
// src/react/useVoiceWorkflowStatus.tsx
|
|
7978
8295
|
var useVoiceWorkflowStatus = (path = "/evals/scenarios/json", options = {}) => {
|
|
7979
|
-
const storeRef =
|
|
8296
|
+
const storeRef = useRef21(null);
|
|
7980
8297
|
if (!storeRef.current) {
|
|
7981
8298
|
storeRef.current = createVoiceWorkflowStatusStore(path, options);
|
|
7982
8299
|
}
|
|
7983
8300
|
const store = storeRef.current;
|
|
7984
|
-
|
|
8301
|
+
useEffect21(() => {
|
|
7985
8302
|
store.refresh().catch(() => {});
|
|
7986
8303
|
return () => store.close();
|
|
7987
8304
|
}, [store]);
|
|
7988
8305
|
return {
|
|
7989
|
-
...
|
|
8306
|
+
...useSyncExternalStore21(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
7990
8307
|
refresh: store.refresh
|
|
7991
8308
|
};
|
|
7992
8309
|
};
|
|
@@ -8003,6 +8320,7 @@ export {
|
|
|
8003
8320
|
useVoiceProviderContracts,
|
|
8004
8321
|
useVoiceProviderCapabilities,
|
|
8005
8322
|
useVoiceProofTrends,
|
|
8323
|
+
useVoiceProfileComparison,
|
|
8006
8324
|
useVoicePlatformCoverage,
|
|
8007
8325
|
useVoiceOpsStatus,
|
|
8008
8326
|
useVoiceOpsActionCenter,
|
|
@@ -8021,6 +8339,7 @@ export {
|
|
|
8021
8339
|
VoiceProviderContracts,
|
|
8022
8340
|
VoiceProviderCapabilities,
|
|
8023
8341
|
VoiceProofTrends,
|
|
8342
|
+
VoiceProfileComparison,
|
|
8024
8343
|
VoicePlatformCoverage,
|
|
8025
8344
|
VoiceOpsStatus,
|
|
8026
8345
|
VoiceOpsActionCenter,
|