@absolutejs/voice 0.0.22-beta.352 → 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 +389 -212
- package/dist/client/profileComparison.d.ts +19 -0
- package/dist/client/profileComparisonWidget.d.ts +41 -0
- package/dist/react/VoiceProfileComparison.d.ts +6 -0
- package/dist/react/index.d.ts +2 -0
- package/dist/react/index.js +675 -397
- 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 +86 -0
- package/dist/vue/index.d.ts +1 -0
- package/dist/vue/index.js +161 -51
- 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,27 +4520,27 @@ 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";
|
|
4268
4544
|
var getProviderRoute = (routes, role) => routes && typeof routes === "object" ? formatValue(routes[role], "Not configured") : "Not configured";
|
|
4269
4545
|
var formatFallbackPath = (decision) => {
|
|
4270
4546
|
const provider = formatValue(decision.provider, "Unknown");
|
|
@@ -4321,7 +4597,7 @@ var createVoiceRoutingStatusViewModel = (snapshot, options = {}) => {
|
|
|
4321
4597
|
},
|
|
4322
4598
|
{
|
|
4323
4599
|
label: "Default routes",
|
|
4324
|
-
value:
|
|
4600
|
+
value: formatProviderRoutes2(decision.providerRoutes)
|
|
4325
4601
|
},
|
|
4326
4602
|
{
|
|
4327
4603
|
label: "Latency budget",
|
|
@@ -4331,35 +4607,35 @@ var createVoiceRoutingStatusViewModel = (snapshot, options = {}) => {
|
|
|
4331
4607
|
return {
|
|
4332
4608
|
activeStack,
|
|
4333
4609
|
decision,
|
|
4334
|
-
description: options.description ??
|
|
4610
|
+
description: options.description ?? DEFAULT_DESCRIPTION11,
|
|
4335
4611
|
error: snapshot.error,
|
|
4336
4612
|
isLoading: snapshot.isLoading,
|
|
4337
4613
|
label: snapshot.error ? "Unavailable" : decision ? `${formatValue(decision.kind).toUpperCase()} ${formatValue(decision.status, "unknown")}` : snapshot.isLoading ? "Checking" : "No routing yet",
|
|
4338
4614
|
rows,
|
|
4339
4615
|
status: snapshot.error ? "error" : decision ? "ready" : snapshot.isLoading ? "loading" : "empty",
|
|
4340
|
-
title: options.title ??
|
|
4616
|
+
title: options.title ?? DEFAULT_TITLE11,
|
|
4341
4617
|
updatedAt: snapshot.updatedAt
|
|
4342
4618
|
};
|
|
4343
4619
|
};
|
|
4344
4620
|
var renderVoiceRoutingStatusHTML = (snapshot, options = {}) => {
|
|
4345
4621
|
const model = createVoiceRoutingStatusViewModel(snapshot, options);
|
|
4346
4622
|
const activeStack = model.activeStack.length ? `<div class="absolute-voice-routing-status__stack" aria-label="Active voice stack">${model.activeStack.map((item) => `<div>
|
|
4347
|
-
<span>${
|
|
4348
|
-
<strong>${
|
|
4623
|
+
<span>${escapeHtml13(item.label)}</span>
|
|
4624
|
+
<strong>${escapeHtml13(item.value)}</strong>
|
|
4349
4625
|
</div>`).join("")}</div>` : "";
|
|
4350
4626
|
const rows = model.rows.length ? `<div class="absolute-voice-routing-status__grid">${model.rows.map((row) => `<div>
|
|
4351
|
-
<span>${
|
|
4352
|
-
<strong>${
|
|
4627
|
+
<span>${escapeHtml13(row.label)}</span>
|
|
4628
|
+
<strong>${escapeHtml13(row.value)}</strong>
|
|
4353
4629
|
</div>`).join("")}</div>` : '<p class="absolute-voice-routing-status__empty">Start a voice session to see the selected provider.</p>';
|
|
4354
|
-
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)}">
|
|
4355
4631
|
<header class="absolute-voice-routing-status__header">
|
|
4356
|
-
<span class="absolute-voice-routing-status__eyebrow">${
|
|
4357
|
-
<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>
|
|
4358
4634
|
</header>
|
|
4359
|
-
<p class="absolute-voice-routing-status__description">${
|
|
4635
|
+
<p class="absolute-voice-routing-status__description">${escapeHtml13(model.description)}</p>
|
|
4360
4636
|
${activeStack}
|
|
4361
4637
|
${rows}
|
|
4362
|
-
${model.error ? `<p class="absolute-voice-routing-status__error">${
|
|
4638
|
+
${model.error ? `<p class="absolute-voice-routing-status__error">${escapeHtml13(model.error)}</p>` : ""}
|
|
4363
4639
|
</section>`;
|
|
4364
4640
|
};
|
|
4365
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}}`;
|
|
@@ -4401,7 +4677,7 @@ var defineVoiceRoutingStatusElement = (tagName = "absolute-voice-routing-status"
|
|
|
4401
4677
|
};
|
|
4402
4678
|
|
|
4403
4679
|
// src/react/VoiceRoutingStatus.tsx
|
|
4404
|
-
import { jsxDEV as
|
|
4680
|
+
import { jsxDEV as jsxDEV12 } from "react/jsx-dev-runtime";
|
|
4405
4681
|
var VoiceRoutingStatus = ({
|
|
4406
4682
|
className,
|
|
4407
4683
|
path = "/api/routing/latest",
|
|
@@ -4409,47 +4685,47 @@ var VoiceRoutingStatus = ({
|
|
|
4409
4685
|
}) => {
|
|
4410
4686
|
const snapshot = useVoiceRoutingStatus(path, options);
|
|
4411
4687
|
const model = createVoiceRoutingStatusViewModel(snapshot, options);
|
|
4412
|
-
return /* @__PURE__ */
|
|
4688
|
+
return /* @__PURE__ */ jsxDEV12("section", {
|
|
4413
4689
|
className: [
|
|
4414
4690
|
"absolute-voice-routing-status",
|
|
4415
4691
|
`absolute-voice-routing-status--${model.status}`,
|
|
4416
4692
|
className
|
|
4417
4693
|
].filter(Boolean).join(" "),
|
|
4418
4694
|
children: [
|
|
4419
|
-
/* @__PURE__ */
|
|
4695
|
+
/* @__PURE__ */ jsxDEV12("header", {
|
|
4420
4696
|
className: "absolute-voice-routing-status__header",
|
|
4421
4697
|
children: [
|
|
4422
|
-
/* @__PURE__ */
|
|
4698
|
+
/* @__PURE__ */ jsxDEV12("span", {
|
|
4423
4699
|
className: "absolute-voice-routing-status__eyebrow",
|
|
4424
4700
|
children: model.title
|
|
4425
4701
|
}, undefined, false, undefined, this),
|
|
4426
|
-
/* @__PURE__ */
|
|
4702
|
+
/* @__PURE__ */ jsxDEV12("strong", {
|
|
4427
4703
|
className: "absolute-voice-routing-status__label",
|
|
4428
4704
|
children: model.label
|
|
4429
4705
|
}, undefined, false, undefined, this)
|
|
4430
4706
|
]
|
|
4431
4707
|
}, undefined, true, undefined, this),
|
|
4432
|
-
/* @__PURE__ */
|
|
4708
|
+
/* @__PURE__ */ jsxDEV12("p", {
|
|
4433
4709
|
className: "absolute-voice-routing-status__description",
|
|
4434
4710
|
children: model.description
|
|
4435
4711
|
}, undefined, false, undefined, this),
|
|
4436
|
-
model.rows.length ? /* @__PURE__ */
|
|
4712
|
+
model.rows.length ? /* @__PURE__ */ jsxDEV12("div", {
|
|
4437
4713
|
className: "absolute-voice-routing-status__grid",
|
|
4438
|
-
children: model.rows.map((row) => /* @__PURE__ */
|
|
4714
|
+
children: model.rows.map((row) => /* @__PURE__ */ jsxDEV12("div", {
|
|
4439
4715
|
children: [
|
|
4440
|
-
/* @__PURE__ */
|
|
4716
|
+
/* @__PURE__ */ jsxDEV12("span", {
|
|
4441
4717
|
children: row.label
|
|
4442
4718
|
}, undefined, false, undefined, this),
|
|
4443
|
-
/* @__PURE__ */
|
|
4719
|
+
/* @__PURE__ */ jsxDEV12("strong", {
|
|
4444
4720
|
children: row.value
|
|
4445
4721
|
}, undefined, false, undefined, this)
|
|
4446
4722
|
]
|
|
4447
4723
|
}, row.label, true, undefined, this))
|
|
4448
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
4724
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV12("p", {
|
|
4449
4725
|
className: "absolute-voice-routing-status__empty",
|
|
4450
4726
|
children: "Start a voice session to see the selected provider."
|
|
4451
4727
|
}, undefined, false, undefined, this),
|
|
4452
|
-
model.error ? /* @__PURE__ */
|
|
4728
|
+
model.error ? /* @__PURE__ */ jsxDEV12("p", {
|
|
4453
4729
|
className: "absolute-voice-routing-status__error",
|
|
4454
4730
|
children: model.error
|
|
4455
4731
|
}, undefined, false, undefined, this) : null
|
|
@@ -4537,16 +4813,16 @@ var createVoiceTraceTimelineStore = (path = "/api/voice-traces", options = {}) =
|
|
|
4537
4813
|
};
|
|
4538
4814
|
|
|
4539
4815
|
// src/client/traceTimelineWidget.ts
|
|
4540
|
-
var
|
|
4541
|
-
var
|
|
4542
|
-
var
|
|
4543
|
-
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";
|
|
4544
4820
|
var formatProviders = (session) => session.providers.length ? session.providers.map((provider) => provider.provider).join(", ") : "No providers";
|
|
4545
4821
|
var createVoiceTraceTimelineViewModel = (snapshot, options = {}) => {
|
|
4546
4822
|
const sessions = (snapshot.report?.sessions ?? []).slice(0, options.limit ?? 3).map((session) => ({
|
|
4547
4823
|
...session,
|
|
4548
4824
|
detailHref: `${options.detailBasePath ?? "/traces"}/${encodeURIComponent(session.sessionId)}`,
|
|
4549
|
-
durationLabel:
|
|
4825
|
+
durationLabel: formatMs3(session.summary.callDurationMs),
|
|
4550
4826
|
incidentBundleHref: options.incidentBundleBasePath === false ? undefined : `${options.incidentBundleBasePath ?? "/voice-incidents"}/${encodeURIComponent(session.sessionId)}/markdown`,
|
|
4551
4827
|
label: `${session.summary.eventCount} events / ${session.summary.turnCount} turns`,
|
|
4552
4828
|
operationsRecordHref: options.operationsRecordBasePath === false ? undefined : `${options.operationsRecordBasePath ?? "/voice-operations"}/${encodeURIComponent(session.sessionId)}`,
|
|
@@ -4555,13 +4831,13 @@ var createVoiceTraceTimelineViewModel = (snapshot, options = {}) => {
|
|
|
4555
4831
|
const failed = sessions.filter((session) => session.status === "failed").length;
|
|
4556
4832
|
const warnings = sessions.filter((session) => session.status === "warning").length;
|
|
4557
4833
|
return {
|
|
4558
|
-
description: options.description ??
|
|
4834
|
+
description: options.description ?? DEFAULT_DESCRIPTION12,
|
|
4559
4835
|
error: snapshot.error,
|
|
4560
4836
|
isLoading: snapshot.isLoading,
|
|
4561
4837
|
label: snapshot.error ? "Unavailable" : failed > 0 ? `${failed} failed` : warnings > 0 ? `${warnings} warning` : sessions.length ? `${sessions.length} recent` : snapshot.isLoading ? "Checking" : "No traces yet",
|
|
4562
4838
|
sessions,
|
|
4563
4839
|
status: snapshot.error ? "error" : failed > 0 ? "failed" : warnings > 0 ? "warning" : sessions.length ? "ready" : snapshot.isLoading ? "loading" : "empty",
|
|
4564
|
-
title: options.title ??
|
|
4840
|
+
title: options.title ?? DEFAULT_TITLE12,
|
|
4565
4841
|
updatedAt: snapshot.updatedAt
|
|
4566
4842
|
};
|
|
4567
4843
|
};
|
|
@@ -4569,27 +4845,27 @@ var renderVoiceTraceTimelineWidgetHTML = (snapshot, options = {}) => {
|
|
|
4569
4845
|
const model = createVoiceTraceTimelineViewModel(snapshot, options);
|
|
4570
4846
|
const sessions = model.sessions.length ? `<div class="absolute-voice-trace-timeline__sessions">${model.sessions.map((session) => {
|
|
4571
4847
|
const supportLinks = [
|
|
4572
|
-
`<a href="${
|
|
4573
|
-
session.operationsRecordHref ? `<a href="${
|
|
4574
|
-
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
|
|
4575
4851
|
].filter(Boolean).join("");
|
|
4576
|
-
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)}">
|
|
4577
4853
|
<header>
|
|
4578
|
-
<strong>${
|
|
4579
|
-
<span>${
|
|
4854
|
+
<strong>${escapeHtml14(session.sessionId)}</strong>
|
|
4855
|
+
<span>${escapeHtml14(session.status)}</span>
|
|
4580
4856
|
</header>
|
|
4581
|
-
<p>${
|
|
4857
|
+
<p>${escapeHtml14(session.label)} \xB7 ${escapeHtml14(session.durationLabel)} \xB7 ${escapeHtml14(session.providerLabel)}</p>
|
|
4582
4858
|
<p class="absolute-voice-trace-timeline__actions">${supportLinks}</p>
|
|
4583
4859
|
</article>`;
|
|
4584
4860
|
}).join("")}</div>` : '<p class="absolute-voice-trace-timeline__empty">Run a voice session to see call timelines.</p>';
|
|
4585
|
-
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)}">
|
|
4586
4862
|
<header class="absolute-voice-trace-timeline__header">
|
|
4587
|
-
<span class="absolute-voice-trace-timeline__eyebrow">${
|
|
4588
|
-
<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>
|
|
4589
4865
|
</header>
|
|
4590
|
-
<p class="absolute-voice-trace-timeline__description">${
|
|
4866
|
+
<p class="absolute-voice-trace-timeline__description">${escapeHtml14(model.description)}</p>
|
|
4591
4867
|
${sessions}
|
|
4592
|
-
${model.error ? `<p class="absolute-voice-trace-timeline__error">${
|
|
4868
|
+
${model.error ? `<p class="absolute-voice-trace-timeline__error">${escapeHtml14(model.error)}</p>` : ""}
|
|
4593
4869
|
</section>`;
|
|
4594
4870
|
};
|
|
4595
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}`;
|
|
@@ -4636,25 +4912,25 @@ var defineVoiceTraceTimelineElement = (tagName = "absolute-voice-trace-timeline"
|
|
|
4636
4912
|
};
|
|
4637
4913
|
|
|
4638
4914
|
// src/react/useVoiceTraceTimeline.tsx
|
|
4639
|
-
import { useEffect as
|
|
4915
|
+
import { useEffect as useEffect13, useRef as useRef13, useSyncExternalStore as useSyncExternalStore13 } from "react";
|
|
4640
4916
|
var useVoiceTraceTimeline = (path = "/api/voice-traces", options = {}) => {
|
|
4641
|
-
const storeRef =
|
|
4917
|
+
const storeRef = useRef13(null);
|
|
4642
4918
|
if (!storeRef.current) {
|
|
4643
4919
|
storeRef.current = createVoiceTraceTimelineStore(path, options);
|
|
4644
4920
|
}
|
|
4645
4921
|
const store = storeRef.current;
|
|
4646
|
-
|
|
4922
|
+
useEffect13(() => {
|
|
4647
4923
|
store.refresh().catch(() => {});
|
|
4648
4924
|
return () => store.close();
|
|
4649
4925
|
}, [store]);
|
|
4650
4926
|
return {
|
|
4651
|
-
...
|
|
4927
|
+
...useSyncExternalStore13(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
4652
4928
|
refresh: store.refresh
|
|
4653
4929
|
};
|
|
4654
4930
|
};
|
|
4655
4931
|
|
|
4656
4932
|
// src/react/VoiceTraceTimeline.tsx
|
|
4657
|
-
import { jsxDEV as
|
|
4933
|
+
import { jsxDEV as jsxDEV13 } from "react/jsx-dev-runtime";
|
|
4658
4934
|
var VoiceTraceTimeline = ({
|
|
4659
4935
|
className,
|
|
4660
4936
|
path = "/api/voice-traces",
|
|
@@ -4662,49 +4938,49 @@ var VoiceTraceTimeline = ({
|
|
|
4662
4938
|
}) => {
|
|
4663
4939
|
const snapshot = useVoiceTraceTimeline(path, options);
|
|
4664
4940
|
const model = createVoiceTraceTimelineViewModel(snapshot, options);
|
|
4665
|
-
return /* @__PURE__ */
|
|
4941
|
+
return /* @__PURE__ */ jsxDEV13("section", {
|
|
4666
4942
|
className: [
|
|
4667
4943
|
"absolute-voice-trace-timeline",
|
|
4668
4944
|
`absolute-voice-trace-timeline--${model.status}`,
|
|
4669
4945
|
className
|
|
4670
4946
|
].filter(Boolean).join(" "),
|
|
4671
4947
|
children: [
|
|
4672
|
-
/* @__PURE__ */
|
|
4948
|
+
/* @__PURE__ */ jsxDEV13("header", {
|
|
4673
4949
|
className: "absolute-voice-trace-timeline__header",
|
|
4674
4950
|
children: [
|
|
4675
|
-
/* @__PURE__ */
|
|
4951
|
+
/* @__PURE__ */ jsxDEV13("span", {
|
|
4676
4952
|
className: "absolute-voice-trace-timeline__eyebrow",
|
|
4677
4953
|
children: model.title
|
|
4678
4954
|
}, undefined, false, undefined, this),
|
|
4679
|
-
/* @__PURE__ */
|
|
4955
|
+
/* @__PURE__ */ jsxDEV13("strong", {
|
|
4680
4956
|
className: "absolute-voice-trace-timeline__label",
|
|
4681
4957
|
children: model.label
|
|
4682
4958
|
}, undefined, false, undefined, this)
|
|
4683
4959
|
]
|
|
4684
4960
|
}, undefined, true, undefined, this),
|
|
4685
|
-
/* @__PURE__ */
|
|
4961
|
+
/* @__PURE__ */ jsxDEV13("p", {
|
|
4686
4962
|
className: "absolute-voice-trace-timeline__description",
|
|
4687
4963
|
children: model.description
|
|
4688
4964
|
}, undefined, false, undefined, this),
|
|
4689
|
-
model.sessions.length ? /* @__PURE__ */
|
|
4965
|
+
model.sessions.length ? /* @__PURE__ */ jsxDEV13("div", {
|
|
4690
4966
|
className: "absolute-voice-trace-timeline__sessions",
|
|
4691
|
-
children: model.sessions.map((session) => /* @__PURE__ */
|
|
4967
|
+
children: model.sessions.map((session) => /* @__PURE__ */ jsxDEV13("article", {
|
|
4692
4968
|
className: [
|
|
4693
4969
|
"absolute-voice-trace-timeline__session",
|
|
4694
4970
|
`absolute-voice-trace-timeline__session--${session.status}`
|
|
4695
4971
|
].join(" "),
|
|
4696
4972
|
children: [
|
|
4697
|
-
/* @__PURE__ */
|
|
4973
|
+
/* @__PURE__ */ jsxDEV13("header", {
|
|
4698
4974
|
children: [
|
|
4699
|
-
/* @__PURE__ */
|
|
4975
|
+
/* @__PURE__ */ jsxDEV13("strong", {
|
|
4700
4976
|
children: session.sessionId
|
|
4701
4977
|
}, undefined, false, undefined, this),
|
|
4702
|
-
/* @__PURE__ */
|
|
4978
|
+
/* @__PURE__ */ jsxDEV13("span", {
|
|
4703
4979
|
children: session.status
|
|
4704
4980
|
}, undefined, false, undefined, this)
|
|
4705
4981
|
]
|
|
4706
4982
|
}, undefined, true, undefined, this),
|
|
4707
|
-
/* @__PURE__ */
|
|
4983
|
+
/* @__PURE__ */ jsxDEV13("p", {
|
|
4708
4984
|
children: [
|
|
4709
4985
|
session.label,
|
|
4710
4986
|
" \xB7 ",
|
|
@@ -4714,18 +4990,18 @@ var VoiceTraceTimeline = ({
|
|
|
4714
4990
|
session.providerLabel
|
|
4715
4991
|
]
|
|
4716
4992
|
}, undefined, true, undefined, this),
|
|
4717
|
-
/* @__PURE__ */
|
|
4993
|
+
/* @__PURE__ */ jsxDEV13("p", {
|
|
4718
4994
|
className: "absolute-voice-trace-timeline__actions",
|
|
4719
4995
|
children: [
|
|
4720
|
-
/* @__PURE__ */
|
|
4996
|
+
/* @__PURE__ */ jsxDEV13("a", {
|
|
4721
4997
|
href: session.detailHref,
|
|
4722
4998
|
children: "Open timeline"
|
|
4723
4999
|
}, undefined, false, undefined, this),
|
|
4724
|
-
session.operationsRecordHref ? /* @__PURE__ */
|
|
5000
|
+
session.operationsRecordHref ? /* @__PURE__ */ jsxDEV13("a", {
|
|
4725
5001
|
href: session.operationsRecordHref,
|
|
4726
5002
|
children: "Open operations record"
|
|
4727
5003
|
}, undefined, false, undefined, this) : null,
|
|
4728
|
-
session.incidentBundleHref ? /* @__PURE__ */
|
|
5004
|
+
session.incidentBundleHref ? /* @__PURE__ */ jsxDEV13("a", {
|
|
4729
5005
|
href: session.incidentBundleHref,
|
|
4730
5006
|
children: "Export incident bundle"
|
|
4731
5007
|
}, undefined, false, undefined, this) : null
|
|
@@ -4733,11 +5009,11 @@ var VoiceTraceTimeline = ({
|
|
|
4733
5009
|
}, undefined, true, undefined, this)
|
|
4734
5010
|
]
|
|
4735
5011
|
}, session.sessionId, true, undefined, this))
|
|
4736
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
5012
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV13("p", {
|
|
4737
5013
|
className: "absolute-voice-trace-timeline__empty",
|
|
4738
5014
|
children: "Run a voice session to see call timelines."
|
|
4739
5015
|
}, undefined, false, undefined, this),
|
|
4740
|
-
model.error ? /* @__PURE__ */
|
|
5016
|
+
model.error ? /* @__PURE__ */ jsxDEV13("p", {
|
|
4741
5017
|
className: "absolute-voice-trace-timeline__error",
|
|
4742
5018
|
children: model.error
|
|
4743
5019
|
}, undefined, false, undefined, this) : null
|
|
@@ -4745,7 +5021,7 @@ var VoiceTraceTimeline = ({
|
|
|
4745
5021
|
}, undefined, true, undefined, this);
|
|
4746
5022
|
};
|
|
4747
5023
|
// src/react/useVoiceAgentSquadStatus.tsx
|
|
4748
|
-
import { useEffect as
|
|
5024
|
+
import { useEffect as useEffect14, useRef as useRef14, useSyncExternalStore as useSyncExternalStore14 } from "react";
|
|
4749
5025
|
|
|
4750
5026
|
// src/client/agentSquadStatus.ts
|
|
4751
5027
|
var getString = (value) => typeof value === "string" && value.trim() ? value.trim() : undefined;
|
|
@@ -4823,25 +5099,25 @@ var createVoiceAgentSquadStatusStore = (path = "/api/voice-traces", options = {}
|
|
|
4823
5099
|
|
|
4824
5100
|
// src/react/useVoiceAgentSquadStatus.tsx
|
|
4825
5101
|
var useVoiceAgentSquadStatus = (path = "/api/voice-traces", options = {}) => {
|
|
4826
|
-
const storeRef =
|
|
5102
|
+
const storeRef = useRef14(null);
|
|
4827
5103
|
if (!storeRef.current) {
|
|
4828
5104
|
storeRef.current = createVoiceAgentSquadStatusStore(path, options);
|
|
4829
5105
|
}
|
|
4830
5106
|
const store = storeRef.current;
|
|
4831
|
-
|
|
5107
|
+
useEffect14(() => {
|
|
4832
5108
|
store.refresh().catch(() => {});
|
|
4833
5109
|
return () => store.close();
|
|
4834
5110
|
}, [store]);
|
|
4835
5111
|
return {
|
|
4836
|
-
...
|
|
5112
|
+
...useSyncExternalStore14(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
4837
5113
|
refresh: store.refresh
|
|
4838
5114
|
};
|
|
4839
5115
|
};
|
|
4840
5116
|
|
|
4841
5117
|
// src/client/agentSquadStatusWidget.ts
|
|
4842
|
-
var
|
|
4843
|
-
var
|
|
4844
|
-
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("'", "'");
|
|
4845
5121
|
var labelFor = (current) => {
|
|
4846
5122
|
if (!current)
|
|
4847
5123
|
return "Waiting for specialist activity";
|
|
@@ -4855,37 +5131,37 @@ var labelFor = (current) => {
|
|
|
4855
5131
|
};
|
|
4856
5132
|
var createVoiceAgentSquadStatusViewModel = (snapshot, options = {}) => ({
|
|
4857
5133
|
current: snapshot.report.current,
|
|
4858
|
-
description: options.description ??
|
|
5134
|
+
description: options.description ?? DEFAULT_DESCRIPTION13,
|
|
4859
5135
|
error: snapshot.error,
|
|
4860
5136
|
isLoading: snapshot.isLoading,
|
|
4861
5137
|
label: snapshot.error ? "Unavailable" : labelFor(snapshot.report.current),
|
|
4862
5138
|
sessionCount: snapshot.report.sessionCount,
|
|
4863
5139
|
sessions: snapshot.report.sessions,
|
|
4864
|
-
title: options.title ??
|
|
5140
|
+
title: options.title ?? DEFAULT_TITLE13,
|
|
4865
5141
|
updatedAt: snapshot.updatedAt
|
|
4866
5142
|
});
|
|
4867
5143
|
var renderVoiceAgentSquadStatusHTML = (snapshot, options = {}) => {
|
|
4868
5144
|
const model = createVoiceAgentSquadStatusViewModel(snapshot, options);
|
|
4869
5145
|
const current = model.current;
|
|
4870
5146
|
const rows = model.sessions.length ? model.sessions.slice(0, 5).map((session) => `<li>
|
|
4871
|
-
<span>${
|
|
4872
|
-
<strong>${
|
|
4873
|
-
<em>${
|
|
4874
|
-
${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>` : ""}
|
|
4875
5151
|
</li>`).join("") : "<li><span>No squad traces yet.</span><strong>Waiting</strong></li>";
|
|
4876
5152
|
return `<section class="absolute-voice-agent-squad-status">
|
|
4877
5153
|
<header>
|
|
4878
|
-
<span>${
|
|
4879
|
-
<strong>${
|
|
5154
|
+
<span>${escapeHtml15(model.title)}</span>
|
|
5155
|
+
<strong>${escapeHtml15(model.label)}</strong>
|
|
4880
5156
|
</header>
|
|
4881
|
-
<p>${
|
|
5157
|
+
<p>${escapeHtml15(model.description)}</p>
|
|
4882
5158
|
<div>
|
|
4883
|
-
<span>Session</span><strong>${
|
|
4884
|
-
<span>From</span><strong>${
|
|
4885
|
-
<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>
|
|
4886
5162
|
</div>
|
|
4887
5163
|
<ul>${rows}</ul>
|
|
4888
|
-
${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>` : ""}
|
|
4889
5165
|
</section>`;
|
|
4890
5166
|
};
|
|
4891
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}`;
|
|
@@ -4930,7 +5206,7 @@ var defineVoiceAgentSquadStatusElement = (tagName = "absolute-voice-agent-squad-
|
|
|
4930
5206
|
};
|
|
4931
5207
|
|
|
4932
5208
|
// src/react/VoiceAgentSquadStatus.tsx
|
|
4933
|
-
import { jsxDEV as
|
|
5209
|
+
import { jsxDEV as jsxDEV14 } from "react/jsx-dev-runtime";
|
|
4934
5210
|
function VoiceAgentSquadStatus({
|
|
4935
5211
|
path = "/api/voice-traces",
|
|
4936
5212
|
...options
|
|
@@ -4938,64 +5214,64 @@ function VoiceAgentSquadStatus({
|
|
|
4938
5214
|
const snapshot = useVoiceAgentSquadStatus(path, options);
|
|
4939
5215
|
const model = createVoiceAgentSquadStatusViewModel(snapshot, options);
|
|
4940
5216
|
const current = model.current;
|
|
4941
|
-
return /* @__PURE__ */
|
|
5217
|
+
return /* @__PURE__ */ jsxDEV14("section", {
|
|
4942
5218
|
className: "absolute-voice-agent-squad-status",
|
|
4943
5219
|
children: [
|
|
4944
|
-
/* @__PURE__ */
|
|
5220
|
+
/* @__PURE__ */ jsxDEV14("header", {
|
|
4945
5221
|
children: [
|
|
4946
|
-
/* @__PURE__ */
|
|
5222
|
+
/* @__PURE__ */ jsxDEV14("span", {
|
|
4947
5223
|
children: model.title
|
|
4948
5224
|
}, undefined, false, undefined, this),
|
|
4949
|
-
/* @__PURE__ */
|
|
5225
|
+
/* @__PURE__ */ jsxDEV14("strong", {
|
|
4950
5226
|
children: model.label
|
|
4951
5227
|
}, undefined, false, undefined, this)
|
|
4952
5228
|
]
|
|
4953
5229
|
}, undefined, true, undefined, this),
|
|
4954
|
-
/* @__PURE__ */
|
|
5230
|
+
/* @__PURE__ */ jsxDEV14("p", {
|
|
4955
5231
|
children: model.description
|
|
4956
5232
|
}, undefined, false, undefined, this),
|
|
4957
|
-
/* @__PURE__ */
|
|
5233
|
+
/* @__PURE__ */ jsxDEV14("dl", {
|
|
4958
5234
|
children: [
|
|
4959
|
-
/* @__PURE__ */
|
|
5235
|
+
/* @__PURE__ */ jsxDEV14("div", {
|
|
4960
5236
|
children: [
|
|
4961
|
-
/* @__PURE__ */
|
|
5237
|
+
/* @__PURE__ */ jsxDEV14("dt", {
|
|
4962
5238
|
children: "Session"
|
|
4963
5239
|
}, undefined, false, undefined, this),
|
|
4964
|
-
/* @__PURE__ */
|
|
5240
|
+
/* @__PURE__ */ jsxDEV14("dd", {
|
|
4965
5241
|
children: current?.sessionId ?? "n/a"
|
|
4966
5242
|
}, undefined, false, undefined, this)
|
|
4967
5243
|
]
|
|
4968
5244
|
}, undefined, true, undefined, this),
|
|
4969
|
-
/* @__PURE__ */
|
|
5245
|
+
/* @__PURE__ */ jsxDEV14("div", {
|
|
4970
5246
|
children: [
|
|
4971
|
-
/* @__PURE__ */
|
|
5247
|
+
/* @__PURE__ */ jsxDEV14("dt", {
|
|
4972
5248
|
children: "Current specialist"
|
|
4973
5249
|
}, undefined, false, undefined, this),
|
|
4974
|
-
/* @__PURE__ */
|
|
5250
|
+
/* @__PURE__ */ jsxDEV14("dd", {
|
|
4975
5251
|
children: current?.targetAgentId ?? "none"
|
|
4976
5252
|
}, undefined, false, undefined, this)
|
|
4977
5253
|
]
|
|
4978
5254
|
}, undefined, true, undefined, this),
|
|
4979
|
-
/* @__PURE__ */
|
|
5255
|
+
/* @__PURE__ */ jsxDEV14("div", {
|
|
4980
5256
|
children: [
|
|
4981
|
-
/* @__PURE__ */
|
|
5257
|
+
/* @__PURE__ */ jsxDEV14("dt", {
|
|
4982
5258
|
children: "Status"
|
|
4983
5259
|
}, undefined, false, undefined, this),
|
|
4984
|
-
/* @__PURE__ */
|
|
5260
|
+
/* @__PURE__ */ jsxDEV14("dd", {
|
|
4985
5261
|
children: current?.status ?? "idle"
|
|
4986
5262
|
}, undefined, false, undefined, this)
|
|
4987
5263
|
]
|
|
4988
5264
|
}, undefined, true, undefined, this)
|
|
4989
5265
|
]
|
|
4990
5266
|
}, undefined, true, undefined, this),
|
|
4991
|
-
model.error ? /* @__PURE__ */
|
|
5267
|
+
model.error ? /* @__PURE__ */ jsxDEV14("p", {
|
|
4992
5268
|
children: model.error
|
|
4993
5269
|
}, undefined, false, undefined, this) : null
|
|
4994
5270
|
]
|
|
4995
5271
|
}, undefined, true, undefined, this);
|
|
4996
5272
|
}
|
|
4997
5273
|
// src/react/useVoiceTurnLatency.tsx
|
|
4998
|
-
import { useEffect as
|
|
5274
|
+
import { useEffect as useEffect15, useRef as useRef15, useSyncExternalStore as useSyncExternalStore15 } from "react";
|
|
4999
5275
|
|
|
5000
5276
|
// src/client/turnLatency.ts
|
|
5001
5277
|
var fetchVoiceTurnLatency = async (path = "/api/turn-latency", options = {}) => {
|
|
@@ -5102,73 +5378,73 @@ var createVoiceTurnLatencyStore = (path = "/api/turn-latency", options = {}) =>
|
|
|
5102
5378
|
|
|
5103
5379
|
// src/react/useVoiceTurnLatency.tsx
|
|
5104
5380
|
var useVoiceTurnLatency = (path = "/api/turn-latency", options = {}) => {
|
|
5105
|
-
const storeRef =
|
|
5381
|
+
const storeRef = useRef15(null);
|
|
5106
5382
|
if (!storeRef.current) {
|
|
5107
5383
|
storeRef.current = createVoiceTurnLatencyStore(path, options);
|
|
5108
5384
|
}
|
|
5109
5385
|
const store = storeRef.current;
|
|
5110
|
-
|
|
5386
|
+
useEffect15(() => {
|
|
5111
5387
|
store.refresh().catch(() => {});
|
|
5112
5388
|
return () => store.close();
|
|
5113
5389
|
}, [store]);
|
|
5114
5390
|
return {
|
|
5115
|
-
...
|
|
5391
|
+
...useSyncExternalStore15(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
5116
5392
|
refresh: store.refresh,
|
|
5117
5393
|
runProof: store.runProof
|
|
5118
5394
|
};
|
|
5119
5395
|
};
|
|
5120
5396
|
|
|
5121
5397
|
// src/client/turnLatencyWidget.ts
|
|
5122
|
-
var
|
|
5123
|
-
var
|
|
5398
|
+
var DEFAULT_TITLE14 = "Turn Latency";
|
|
5399
|
+
var DEFAULT_DESCRIPTION14 = "Per-turn timing from first transcript to commit and assistant response start.";
|
|
5124
5400
|
var DEFAULT_PROOF_LABEL = "Run latency proof";
|
|
5125
|
-
var
|
|
5126
|
-
var
|
|
5401
|
+
var escapeHtml16 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
5402
|
+
var formatMs4 = (value) => typeof value === "number" ? `${Math.round(value)}ms` : "n/a";
|
|
5127
5403
|
var createVoiceTurnLatencyViewModel = (snapshot, options = {}) => {
|
|
5128
5404
|
const turns = (snapshot.report?.turns ?? []).map((turn) => ({
|
|
5129
5405
|
...turn,
|
|
5130
5406
|
label: turn.text || "Empty turn",
|
|
5131
5407
|
rows: turn.stages.map((stage) => ({
|
|
5132
5408
|
label: stage.label,
|
|
5133
|
-
value:
|
|
5409
|
+
value: formatMs4(stage.valueMs)
|
|
5134
5410
|
}))
|
|
5135
5411
|
}));
|
|
5136
5412
|
const warningCount = snapshot.report?.warnings ?? turns.filter((turn) => turn.status === "warn").length;
|
|
5137
5413
|
const failedCount = snapshot.report?.failed ?? turns.filter((turn) => turn.status === "fail").length;
|
|
5138
5414
|
return {
|
|
5139
|
-
description: options.description ??
|
|
5415
|
+
description: options.description ?? DEFAULT_DESCRIPTION14,
|
|
5140
5416
|
error: snapshot.error,
|
|
5141
5417
|
isLoading: snapshot.isLoading,
|
|
5142
|
-
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",
|
|
5143
5419
|
proofLabel: options.proofPath ? options.proofLabel ?? DEFAULT_PROOF_LABEL : undefined,
|
|
5144
5420
|
showProofAction: Boolean(options.proofPath),
|
|
5145
5421
|
status: snapshot.error ? "error" : turns.length ? failedCount > 0 || warningCount > 0 ? "warning" : "ready" : snapshot.isLoading ? "loading" : "empty",
|
|
5146
|
-
title: options.title ??
|
|
5422
|
+
title: options.title ?? DEFAULT_TITLE14,
|
|
5147
5423
|
turns,
|
|
5148
5424
|
updatedAt: snapshot.updatedAt
|
|
5149
5425
|
};
|
|
5150
5426
|
};
|
|
5151
5427
|
var renderVoiceTurnLatencyHTML = (snapshot, options = {}) => {
|
|
5152
5428
|
const model = createVoiceTurnLatencyViewModel(snapshot, options);
|
|
5153
|
-
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)}">
|
|
5154
5430
|
<header>
|
|
5155
|
-
<strong>${
|
|
5156
|
-
<span>${
|
|
5431
|
+
<strong>${escapeHtml16(turn.label)}</strong>
|
|
5432
|
+
<span>${escapeHtml16(turn.status)}</span>
|
|
5157
5433
|
</header>
|
|
5158
5434
|
<dl>${turn.rows.map((row) => `<div>
|
|
5159
|
-
<dt>${
|
|
5160
|
-
<dd>${
|
|
5435
|
+
<dt>${escapeHtml16(row.label)}</dt>
|
|
5436
|
+
<dd>${escapeHtml16(row.value)}</dd>
|
|
5161
5437
|
</div>`).join("")}</dl>
|
|
5162
5438
|
</article>`).join("")}</div>` : '<p class="absolute-voice-turn-latency__empty">Complete a voice turn to see latency diagnostics.</p>';
|
|
5163
|
-
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)}">
|
|
5164
5440
|
<header class="absolute-voice-turn-latency__header">
|
|
5165
|
-
<span class="absolute-voice-turn-latency__eyebrow">${
|
|
5166
|
-
<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>
|
|
5167
5443
|
</header>
|
|
5168
|
-
<p class="absolute-voice-turn-latency__description">${
|
|
5169
|
-
${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>` : ""}
|
|
5170
5446
|
${turns}
|
|
5171
|
-
${model.error ? `<p class="absolute-voice-turn-latency__error">${
|
|
5447
|
+
${model.error ? `<p class="absolute-voice-turn-latency__error">${escapeHtml16(model.error)}</p>` : ""}
|
|
5172
5448
|
</section>`;
|
|
5173
5449
|
};
|
|
5174
5450
|
var mountVoiceTurnLatency = (element, path = "/api/turn-latency", options = {}) => {
|
|
@@ -5219,7 +5495,7 @@ var defineVoiceTurnLatencyElement = (tagName = "absolute-voice-turn-latency") =>
|
|
|
5219
5495
|
};
|
|
5220
5496
|
|
|
5221
5497
|
// src/react/VoiceTurnLatency.tsx
|
|
5222
|
-
import { jsxDEV as
|
|
5498
|
+
import { jsxDEV as jsxDEV15 } from "react/jsx-dev-runtime";
|
|
5223
5499
|
var VoiceTurnLatency = ({
|
|
5224
5500
|
className,
|
|
5225
5501
|
path = "/api/turn-latency",
|
|
@@ -5227,31 +5503,31 @@ var VoiceTurnLatency = ({
|
|
|
5227
5503
|
}) => {
|
|
5228
5504
|
const latency = useVoiceTurnLatency(path, options);
|
|
5229
5505
|
const model = createVoiceTurnLatencyViewModel(latency, options);
|
|
5230
|
-
return /* @__PURE__ */
|
|
5506
|
+
return /* @__PURE__ */ jsxDEV15("section", {
|
|
5231
5507
|
className: [
|
|
5232
5508
|
"absolute-voice-turn-latency",
|
|
5233
5509
|
`absolute-voice-turn-latency--${model.status}`,
|
|
5234
5510
|
className
|
|
5235
5511
|
].filter(Boolean).join(" "),
|
|
5236
5512
|
children: [
|
|
5237
|
-
/* @__PURE__ */
|
|
5513
|
+
/* @__PURE__ */ jsxDEV15("header", {
|
|
5238
5514
|
className: "absolute-voice-turn-latency__header",
|
|
5239
5515
|
children: [
|
|
5240
|
-
/* @__PURE__ */
|
|
5516
|
+
/* @__PURE__ */ jsxDEV15("span", {
|
|
5241
5517
|
className: "absolute-voice-turn-latency__eyebrow",
|
|
5242
5518
|
children: model.title
|
|
5243
5519
|
}, undefined, false, undefined, this),
|
|
5244
|
-
/* @__PURE__ */
|
|
5520
|
+
/* @__PURE__ */ jsxDEV15("strong", {
|
|
5245
5521
|
className: "absolute-voice-turn-latency__label",
|
|
5246
5522
|
children: model.label
|
|
5247
5523
|
}, undefined, false, undefined, this)
|
|
5248
5524
|
]
|
|
5249
5525
|
}, undefined, true, undefined, this),
|
|
5250
|
-
/* @__PURE__ */
|
|
5526
|
+
/* @__PURE__ */ jsxDEV15("p", {
|
|
5251
5527
|
className: "absolute-voice-turn-latency__description",
|
|
5252
5528
|
children: model.description
|
|
5253
5529
|
}, undefined, false, undefined, this),
|
|
5254
|
-
model.showProofAction ? /* @__PURE__ */
|
|
5530
|
+
model.showProofAction ? /* @__PURE__ */ jsxDEV15("button", {
|
|
5255
5531
|
className: "absolute-voice-turn-latency__proof",
|
|
5256
5532
|
onClick: () => {
|
|
5257
5533
|
latency.runProof().catch(() => {});
|
|
@@ -5259,31 +5535,31 @@ var VoiceTurnLatency = ({
|
|
|
5259
5535
|
type: "button",
|
|
5260
5536
|
children: model.proofLabel
|
|
5261
5537
|
}, undefined, false, undefined, this) : null,
|
|
5262
|
-
model.turns.length ? /* @__PURE__ */
|
|
5538
|
+
model.turns.length ? /* @__PURE__ */ jsxDEV15("div", {
|
|
5263
5539
|
className: "absolute-voice-turn-latency__turns",
|
|
5264
|
-
children: model.turns.map((turn) => /* @__PURE__ */
|
|
5540
|
+
children: model.turns.map((turn) => /* @__PURE__ */ jsxDEV15("article", {
|
|
5265
5541
|
className: [
|
|
5266
5542
|
"absolute-voice-turn-latency__turn",
|
|
5267
5543
|
`absolute-voice-turn-latency__turn--${turn.status}`
|
|
5268
5544
|
].join(" "),
|
|
5269
5545
|
children: [
|
|
5270
|
-
/* @__PURE__ */
|
|
5546
|
+
/* @__PURE__ */ jsxDEV15("header", {
|
|
5271
5547
|
children: [
|
|
5272
|
-
/* @__PURE__ */
|
|
5548
|
+
/* @__PURE__ */ jsxDEV15("strong", {
|
|
5273
5549
|
children: turn.label
|
|
5274
5550
|
}, undefined, false, undefined, this),
|
|
5275
|
-
/* @__PURE__ */
|
|
5551
|
+
/* @__PURE__ */ jsxDEV15("span", {
|
|
5276
5552
|
children: turn.status
|
|
5277
5553
|
}, undefined, false, undefined, this)
|
|
5278
5554
|
]
|
|
5279
5555
|
}, undefined, true, undefined, this),
|
|
5280
|
-
/* @__PURE__ */
|
|
5281
|
-
children: turn.rows.map((row) => /* @__PURE__ */
|
|
5556
|
+
/* @__PURE__ */ jsxDEV15("dl", {
|
|
5557
|
+
children: turn.rows.map((row) => /* @__PURE__ */ jsxDEV15("div", {
|
|
5282
5558
|
children: [
|
|
5283
|
-
/* @__PURE__ */
|
|
5559
|
+
/* @__PURE__ */ jsxDEV15("dt", {
|
|
5284
5560
|
children: row.label
|
|
5285
5561
|
}, undefined, false, undefined, this),
|
|
5286
|
-
/* @__PURE__ */
|
|
5562
|
+
/* @__PURE__ */ jsxDEV15("dd", {
|
|
5287
5563
|
children: row.value
|
|
5288
5564
|
}, undefined, false, undefined, this)
|
|
5289
5565
|
]
|
|
@@ -5291,11 +5567,11 @@ var VoiceTurnLatency = ({
|
|
|
5291
5567
|
}, undefined, false, undefined, this)
|
|
5292
5568
|
]
|
|
5293
5569
|
}, `${turn.sessionId}:${turn.turnId}`, true, undefined, this))
|
|
5294
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
5570
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV15("p", {
|
|
5295
5571
|
className: "absolute-voice-turn-latency__empty",
|
|
5296
5572
|
children: "Complete a voice turn to see latency diagnostics."
|
|
5297
5573
|
}, undefined, false, undefined, this),
|
|
5298
|
-
model.error ? /* @__PURE__ */
|
|
5574
|
+
model.error ? /* @__PURE__ */ jsxDEV15("p", {
|
|
5299
5575
|
className: "absolute-voice-turn-latency__error",
|
|
5300
5576
|
children: model.error
|
|
5301
5577
|
}, undefined, false, undefined, this) : null
|
|
@@ -5303,7 +5579,7 @@ var VoiceTurnLatency = ({
|
|
|
5303
5579
|
}, undefined, true, undefined, this);
|
|
5304
5580
|
};
|
|
5305
5581
|
// src/react/useVoiceTurnQuality.tsx
|
|
5306
|
-
import { useEffect as
|
|
5582
|
+
import { useEffect as useEffect16, useRef as useRef16, useSyncExternalStore as useSyncExternalStore16 } from "react";
|
|
5307
5583
|
|
|
5308
5584
|
// src/client/turnQuality.ts
|
|
5309
5585
|
var fetchVoiceTurnQuality = async (path = "/api/turn-quality", options = {}) => {
|
|
@@ -5386,25 +5662,25 @@ var createVoiceTurnQualityStore = (path = "/api/turn-quality", options = {}) =>
|
|
|
5386
5662
|
|
|
5387
5663
|
// src/react/useVoiceTurnQuality.tsx
|
|
5388
5664
|
var useVoiceTurnQuality = (path = "/api/turn-quality", options = {}) => {
|
|
5389
|
-
const storeRef =
|
|
5665
|
+
const storeRef = useRef16(null);
|
|
5390
5666
|
if (!storeRef.current) {
|
|
5391
5667
|
storeRef.current = createVoiceTurnQualityStore(path, options);
|
|
5392
5668
|
}
|
|
5393
5669
|
const store = storeRef.current;
|
|
5394
|
-
|
|
5670
|
+
useEffect16(() => {
|
|
5395
5671
|
store.refresh().catch(() => {});
|
|
5396
5672
|
return () => store.close();
|
|
5397
5673
|
}, [store]);
|
|
5398
5674
|
return {
|
|
5399
|
-
...
|
|
5675
|
+
...useSyncExternalStore16(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
5400
5676
|
refresh: store.refresh
|
|
5401
5677
|
};
|
|
5402
5678
|
};
|
|
5403
5679
|
|
|
5404
5680
|
// src/client/turnQualityWidget.ts
|
|
5405
|
-
var
|
|
5406
|
-
var
|
|
5407
|
-
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("'", "'");
|
|
5408
5684
|
var formatConfidence = (value) => typeof value === "number" ? `${Math.round(value * 100)}%` : "n/a";
|
|
5409
5685
|
var formatMaybe = (value) => value === undefined || value === "" ? "n/a" : String(value);
|
|
5410
5686
|
var getTurnDetail = (turn) => {
|
|
@@ -5442,37 +5718,37 @@ var createVoiceTurnQualityViewModel = (snapshot, options = {}) => {
|
|
|
5442
5718
|
const warningCount = snapshot.report?.warnings ?? turns.filter((turn) => turn.status === "warn").length;
|
|
5443
5719
|
const failedCount = snapshot.report?.failed ?? turns.filter((turn) => turn.status === "fail").length;
|
|
5444
5720
|
return {
|
|
5445
|
-
description: options.description ??
|
|
5721
|
+
description: options.description ?? DEFAULT_DESCRIPTION15,
|
|
5446
5722
|
error: snapshot.error,
|
|
5447
5723
|
isLoading: snapshot.isLoading,
|
|
5448
5724
|
label: snapshot.error ? "Unavailable" : turns.length ? failedCount > 0 ? `${failedCount} failed` : warningCount > 0 ? `${warningCount} warnings` : `${turns.length} healthy` : snapshot.isLoading ? "Checking" : "No turns",
|
|
5449
5725
|
status: snapshot.error ? "error" : turns.length ? failedCount > 0 || warningCount > 0 ? "warning" : "ready" : snapshot.isLoading ? "loading" : "empty",
|
|
5450
|
-
title: options.title ??
|
|
5726
|
+
title: options.title ?? DEFAULT_TITLE15,
|
|
5451
5727
|
turns,
|
|
5452
5728
|
updatedAt: snapshot.updatedAt
|
|
5453
5729
|
};
|
|
5454
5730
|
};
|
|
5455
5731
|
var renderVoiceTurnQualityHTML = (snapshot, options = {}) => {
|
|
5456
5732
|
const model = createVoiceTurnQualityViewModel(snapshot, options);
|
|
5457
|
-
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)}">
|
|
5458
5734
|
<header>
|
|
5459
|
-
<strong>${
|
|
5460
|
-
<span>${
|
|
5735
|
+
<strong>${escapeHtml17(turn.label)}</strong>
|
|
5736
|
+
<span>${escapeHtml17(turn.status)}</span>
|
|
5461
5737
|
</header>
|
|
5462
|
-
<p>${
|
|
5738
|
+
<p>${escapeHtml17(turn.detail)}</p>
|
|
5463
5739
|
<dl>${turn.rows.map((row) => `<div>
|
|
5464
|
-
<dt>${
|
|
5465
|
-
<dd>${
|
|
5740
|
+
<dt>${escapeHtml17(row.label)}</dt>
|
|
5741
|
+
<dd>${escapeHtml17(row.value)}</dd>
|
|
5466
5742
|
</div>`).join("")}</dl>
|
|
5467
5743
|
</article>`).join("")}</div>` : '<p class="absolute-voice-turn-quality__empty">Complete a voice turn to see STT quality diagnostics.</p>';
|
|
5468
|
-
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)}">
|
|
5469
5745
|
<header class="absolute-voice-turn-quality__header">
|
|
5470
|
-
<span class="absolute-voice-turn-quality__eyebrow">${
|
|
5471
|
-
<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>
|
|
5472
5748
|
</header>
|
|
5473
|
-
<p class="absolute-voice-turn-quality__description">${
|
|
5749
|
+
<p class="absolute-voice-turn-quality__description">${escapeHtml17(model.description)}</p>
|
|
5474
5750
|
${turns}
|
|
5475
|
-
${model.error ? `<p class="absolute-voice-turn-quality__error">${
|
|
5751
|
+
${model.error ? `<p class="absolute-voice-turn-quality__error">${escapeHtml17(model.error)}</p>` : ""}
|
|
5476
5752
|
</section>`;
|
|
5477
5753
|
};
|
|
5478
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}`;
|
|
@@ -5514,7 +5790,7 @@ var defineVoiceTurnQualityElement = (tagName = "absolute-voice-turn-quality") =>
|
|
|
5514
5790
|
};
|
|
5515
5791
|
|
|
5516
5792
|
// src/react/VoiceTurnQuality.tsx
|
|
5517
|
-
import { jsxDEV as
|
|
5793
|
+
import { jsxDEV as jsxDEV16 } from "react/jsx-dev-runtime";
|
|
5518
5794
|
var VoiceTurnQuality = ({
|
|
5519
5795
|
className,
|
|
5520
5796
|
path = "/api/turn-quality",
|
|
@@ -5522,58 +5798,58 @@ var VoiceTurnQuality = ({
|
|
|
5522
5798
|
}) => {
|
|
5523
5799
|
const snapshot = useVoiceTurnQuality(path, options);
|
|
5524
5800
|
const model = createVoiceTurnQualityViewModel(snapshot, options);
|
|
5525
|
-
return /* @__PURE__ */
|
|
5801
|
+
return /* @__PURE__ */ jsxDEV16("section", {
|
|
5526
5802
|
className: [
|
|
5527
5803
|
"absolute-voice-turn-quality",
|
|
5528
5804
|
`absolute-voice-turn-quality--${model.status}`,
|
|
5529
5805
|
className
|
|
5530
5806
|
].filter(Boolean).join(" "),
|
|
5531
5807
|
children: [
|
|
5532
|
-
/* @__PURE__ */
|
|
5808
|
+
/* @__PURE__ */ jsxDEV16("header", {
|
|
5533
5809
|
className: "absolute-voice-turn-quality__header",
|
|
5534
5810
|
children: [
|
|
5535
|
-
/* @__PURE__ */
|
|
5811
|
+
/* @__PURE__ */ jsxDEV16("span", {
|
|
5536
5812
|
className: "absolute-voice-turn-quality__eyebrow",
|
|
5537
5813
|
children: model.title
|
|
5538
5814
|
}, undefined, false, undefined, this),
|
|
5539
|
-
/* @__PURE__ */
|
|
5815
|
+
/* @__PURE__ */ jsxDEV16("strong", {
|
|
5540
5816
|
className: "absolute-voice-turn-quality__label",
|
|
5541
5817
|
children: model.label
|
|
5542
5818
|
}, undefined, false, undefined, this)
|
|
5543
5819
|
]
|
|
5544
5820
|
}, undefined, true, undefined, this),
|
|
5545
|
-
/* @__PURE__ */
|
|
5821
|
+
/* @__PURE__ */ jsxDEV16("p", {
|
|
5546
5822
|
className: "absolute-voice-turn-quality__description",
|
|
5547
5823
|
children: model.description
|
|
5548
5824
|
}, undefined, false, undefined, this),
|
|
5549
|
-
model.turns.length ? /* @__PURE__ */
|
|
5825
|
+
model.turns.length ? /* @__PURE__ */ jsxDEV16("div", {
|
|
5550
5826
|
className: "absolute-voice-turn-quality__turns",
|
|
5551
|
-
children: model.turns.map((turn) => /* @__PURE__ */
|
|
5827
|
+
children: model.turns.map((turn) => /* @__PURE__ */ jsxDEV16("article", {
|
|
5552
5828
|
className: [
|
|
5553
5829
|
"absolute-voice-turn-quality__turn",
|
|
5554
5830
|
`absolute-voice-turn-quality__turn--${turn.status}`
|
|
5555
5831
|
].join(" "),
|
|
5556
5832
|
children: [
|
|
5557
|
-
/* @__PURE__ */
|
|
5833
|
+
/* @__PURE__ */ jsxDEV16("header", {
|
|
5558
5834
|
children: [
|
|
5559
|
-
/* @__PURE__ */
|
|
5835
|
+
/* @__PURE__ */ jsxDEV16("strong", {
|
|
5560
5836
|
children: turn.label
|
|
5561
5837
|
}, undefined, false, undefined, this),
|
|
5562
|
-
/* @__PURE__ */
|
|
5838
|
+
/* @__PURE__ */ jsxDEV16("span", {
|
|
5563
5839
|
children: turn.status
|
|
5564
5840
|
}, undefined, false, undefined, this)
|
|
5565
5841
|
]
|
|
5566
5842
|
}, undefined, true, undefined, this),
|
|
5567
|
-
/* @__PURE__ */
|
|
5843
|
+
/* @__PURE__ */ jsxDEV16("p", {
|
|
5568
5844
|
children: turn.detail
|
|
5569
5845
|
}, undefined, false, undefined, this),
|
|
5570
|
-
/* @__PURE__ */
|
|
5571
|
-
children: turn.rows.map((row) => /* @__PURE__ */
|
|
5846
|
+
/* @__PURE__ */ jsxDEV16("dl", {
|
|
5847
|
+
children: turn.rows.map((row) => /* @__PURE__ */ jsxDEV16("div", {
|
|
5572
5848
|
children: [
|
|
5573
|
-
/* @__PURE__ */
|
|
5849
|
+
/* @__PURE__ */ jsxDEV16("dt", {
|
|
5574
5850
|
children: row.label
|
|
5575
5851
|
}, undefined, false, undefined, this),
|
|
5576
|
-
/* @__PURE__ */
|
|
5852
|
+
/* @__PURE__ */ jsxDEV16("dd", {
|
|
5577
5853
|
children: row.value
|
|
5578
5854
|
}, undefined, false, undefined, this)
|
|
5579
5855
|
]
|
|
@@ -5581,11 +5857,11 @@ var VoiceTurnQuality = ({
|
|
|
5581
5857
|
}, undefined, false, undefined, this)
|
|
5582
5858
|
]
|
|
5583
5859
|
}, `${turn.sessionId}:${turn.turnId}`, true, undefined, this))
|
|
5584
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
5860
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV16("p", {
|
|
5585
5861
|
className: "absolute-voice-turn-quality__empty",
|
|
5586
5862
|
children: "Complete a voice turn to see STT quality diagnostics."
|
|
5587
5863
|
}, undefined, false, undefined, this),
|
|
5588
|
-
model.error ? /* @__PURE__ */
|
|
5864
|
+
model.error ? /* @__PURE__ */ jsxDEV16("p", {
|
|
5589
5865
|
className: "absolute-voice-turn-quality__error",
|
|
5590
5866
|
children: model.error
|
|
5591
5867
|
}, undefined, false, undefined, this) : null
|
|
@@ -5593,7 +5869,7 @@ var VoiceTurnQuality = ({
|
|
|
5593
5869
|
}, undefined, true, undefined, this);
|
|
5594
5870
|
};
|
|
5595
5871
|
// src/react/useVoiceLiveOps.tsx
|
|
5596
|
-
import { useEffect as
|
|
5872
|
+
import { useEffect as useEffect17, useRef as useRef17, useSyncExternalStore as useSyncExternalStore17 } from "react";
|
|
5597
5873
|
|
|
5598
5874
|
// src/client/liveOps.ts
|
|
5599
5875
|
var postVoiceLiveOpsAction = async (input, options = {}) => {
|
|
@@ -5683,19 +5959,19 @@ var createVoiceLiveOpsStore = (options = {}) => {
|
|
|
5683
5959
|
|
|
5684
5960
|
// src/react/useVoiceLiveOps.tsx
|
|
5685
5961
|
var useVoiceLiveOps = (options = {}) => {
|
|
5686
|
-
const storeRef =
|
|
5962
|
+
const storeRef = useRef17(null);
|
|
5687
5963
|
if (!storeRef.current) {
|
|
5688
5964
|
storeRef.current = createVoiceLiveOpsStore(options);
|
|
5689
5965
|
}
|
|
5690
5966
|
const store = storeRef.current;
|
|
5691
|
-
|
|
5967
|
+
useEffect17(() => () => store.close(), [store]);
|
|
5692
5968
|
return {
|
|
5693
|
-
...
|
|
5969
|
+
...useSyncExternalStore17(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
5694
5970
|
run: store.run
|
|
5695
5971
|
};
|
|
5696
5972
|
};
|
|
5697
5973
|
// src/react/useVoiceCampaignDialerProof.tsx
|
|
5698
|
-
import { useEffect as
|
|
5974
|
+
import { useEffect as useEffect18, useRef as useRef18, useSyncExternalStore as useSyncExternalStore18 } from "react";
|
|
5699
5975
|
|
|
5700
5976
|
// src/client/campaignDialerProof.ts
|
|
5701
5977
|
var fetchVoiceCampaignDialerProofStatus = async (path = "/api/voice/campaigns/dialer-proof", options = {}) => {
|
|
@@ -5817,23 +6093,23 @@ var createVoiceCampaignDialerProofStore = (path = "/api/voice/campaigns/dialer-p
|
|
|
5817
6093
|
|
|
5818
6094
|
// src/react/useVoiceCampaignDialerProof.tsx
|
|
5819
6095
|
var useVoiceCampaignDialerProof = (path = "/api/voice/campaigns/dialer-proof", options = {}) => {
|
|
5820
|
-
const storeRef =
|
|
6096
|
+
const storeRef = useRef18(null);
|
|
5821
6097
|
if (!storeRef.current) {
|
|
5822
6098
|
storeRef.current = createVoiceCampaignDialerProofStore(path, options);
|
|
5823
6099
|
}
|
|
5824
6100
|
const store = storeRef.current;
|
|
5825
|
-
|
|
6101
|
+
useEffect18(() => {
|
|
5826
6102
|
store.refresh().catch(() => {});
|
|
5827
6103
|
return () => store.close();
|
|
5828
6104
|
}, [store]);
|
|
5829
6105
|
return {
|
|
5830
|
-
...
|
|
6106
|
+
...useSyncExternalStore18(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
5831
6107
|
refresh: store.refresh,
|
|
5832
6108
|
runProof: store.runProof
|
|
5833
6109
|
};
|
|
5834
6110
|
};
|
|
5835
6111
|
// src/react/useVoiceStream.tsx
|
|
5836
|
-
import { useEffect as
|
|
6112
|
+
import { useEffect as useEffect19, useRef as useRef19, useSyncExternalStore as useSyncExternalStore19 } from "react";
|
|
5837
6113
|
|
|
5838
6114
|
// src/client/actions.ts
|
|
5839
6115
|
var normalizeErrorMessage = (value) => {
|
|
@@ -7235,13 +7511,13 @@ var EMPTY_SNAPSHOT = {
|
|
|
7235
7511
|
turns: []
|
|
7236
7512
|
};
|
|
7237
7513
|
var useVoiceStream = (path, options = {}) => {
|
|
7238
|
-
const streamRef =
|
|
7514
|
+
const streamRef = useRef19(null);
|
|
7239
7515
|
if (!streamRef.current) {
|
|
7240
7516
|
streamRef.current = createVoiceStream(path, options);
|
|
7241
7517
|
}
|
|
7242
7518
|
const stream = streamRef.current;
|
|
7243
|
-
|
|
7244
|
-
const snapshot =
|
|
7519
|
+
useEffect19(() => () => stream.close(), [stream]);
|
|
7520
|
+
const snapshot = useSyncExternalStore19(stream.subscribe, stream.getSnapshot, stream.getServerSnapshot) ?? EMPTY_SNAPSHOT;
|
|
7245
7521
|
return {
|
|
7246
7522
|
...snapshot,
|
|
7247
7523
|
callControl: (message) => stream.callControl(message),
|
|
@@ -7251,7 +7527,7 @@ var useVoiceStream = (path, options = {}) => {
|
|
|
7251
7527
|
};
|
|
7252
7528
|
};
|
|
7253
7529
|
// src/react/useVoiceController.tsx
|
|
7254
|
-
import { useEffect as
|
|
7530
|
+
import { useEffect as useEffect20, useRef as useRef20, useSyncExternalStore as useSyncExternalStore20 } from "react";
|
|
7255
7531
|
|
|
7256
7532
|
// src/client/htmx.ts
|
|
7257
7533
|
var DEFAULT_EVENT_NAME = "voice-refresh";
|
|
@@ -7914,13 +8190,13 @@ var EMPTY_SNAPSHOT2 = {
|
|
|
7914
8190
|
turns: []
|
|
7915
8191
|
};
|
|
7916
8192
|
var useVoiceController = (path, options = {}) => {
|
|
7917
|
-
const controllerRef =
|
|
8193
|
+
const controllerRef = useRef20(null);
|
|
7918
8194
|
if (!controllerRef.current) {
|
|
7919
8195
|
controllerRef.current = createVoiceController(path, options);
|
|
7920
8196
|
}
|
|
7921
8197
|
const controller = controllerRef.current;
|
|
7922
|
-
|
|
7923
|
-
const snapshot =
|
|
8198
|
+
useEffect20(() => () => controller.close(), [controller]);
|
|
8199
|
+
const snapshot = useSyncExternalStore20(controller.subscribe, controller.getSnapshot, controller.getServerSnapshot) ?? EMPTY_SNAPSHOT2;
|
|
7924
8200
|
return {
|
|
7925
8201
|
...snapshot,
|
|
7926
8202
|
bindHTMX: controller.bindHTMX,
|
|
@@ -7934,7 +8210,7 @@ var useVoiceController = (path, options = {}) => {
|
|
|
7934
8210
|
};
|
|
7935
8211
|
};
|
|
7936
8212
|
// src/react/useVoiceWorkflowStatus.tsx
|
|
7937
|
-
import { useEffect as
|
|
8213
|
+
import { useEffect as useEffect21, useRef as useRef21, useSyncExternalStore as useSyncExternalStore21 } from "react";
|
|
7938
8214
|
|
|
7939
8215
|
// src/client/workflowStatus.ts
|
|
7940
8216
|
var fetchVoiceWorkflowStatus = async (path = "/evals/scenarios/json", options = {}) => {
|
|
@@ -8017,17 +8293,17 @@ var createVoiceWorkflowStatusStore = (path = "/evals/scenarios/json", options =
|
|
|
8017
8293
|
|
|
8018
8294
|
// src/react/useVoiceWorkflowStatus.tsx
|
|
8019
8295
|
var useVoiceWorkflowStatus = (path = "/evals/scenarios/json", options = {}) => {
|
|
8020
|
-
const storeRef =
|
|
8296
|
+
const storeRef = useRef21(null);
|
|
8021
8297
|
if (!storeRef.current) {
|
|
8022
8298
|
storeRef.current = createVoiceWorkflowStatusStore(path, options);
|
|
8023
8299
|
}
|
|
8024
8300
|
const store = storeRef.current;
|
|
8025
|
-
|
|
8301
|
+
useEffect21(() => {
|
|
8026
8302
|
store.refresh().catch(() => {});
|
|
8027
8303
|
return () => store.close();
|
|
8028
8304
|
}, [store]);
|
|
8029
8305
|
return {
|
|
8030
|
-
...
|
|
8306
|
+
...useSyncExternalStore21(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
8031
8307
|
refresh: store.refresh
|
|
8032
8308
|
};
|
|
8033
8309
|
};
|
|
@@ -8044,6 +8320,7 @@ export {
|
|
|
8044
8320
|
useVoiceProviderContracts,
|
|
8045
8321
|
useVoiceProviderCapabilities,
|
|
8046
8322
|
useVoiceProofTrends,
|
|
8323
|
+
useVoiceProfileComparison,
|
|
8047
8324
|
useVoicePlatformCoverage,
|
|
8048
8325
|
useVoiceOpsStatus,
|
|
8049
8326
|
useVoiceOpsActionCenter,
|
|
@@ -8062,6 +8339,7 @@ export {
|
|
|
8062
8339
|
VoiceProviderContracts,
|
|
8063
8340
|
VoiceProviderCapabilities,
|
|
8064
8341
|
VoiceProofTrends,
|
|
8342
|
+
VoiceProfileComparison,
|
|
8065
8343
|
VoicePlatformCoverage,
|
|
8066
8344
|
VoiceOpsStatus,
|
|
8067
8345
|
VoiceOpsActionCenter,
|