@absolutejs/voice 0.0.22-beta.354 → 0.0.22-beta.356
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/audit.d.ts +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +83 -0
- package/dist/profileSwitchRecommendation.d.ts +26 -0
- package/dist/react/VoiceProfileSwitchRecommendation.d.ts +6 -0
- package/dist/react/index.d.ts +2 -0
- package/dist/react/index.js +561 -388
- package/dist/react/useVoiceProfileSwitchRecommendation.d.ts +8 -0
- package/dist/vue/useVoiceReadinessFailures.d.ts +2 -0
- package/package.json +1 -1
package/dist/react/index.js
CHANGED
|
@@ -2989,6 +2989,177 @@ var VoiceProfileComparison = ({
|
|
|
2989
2989
|
]
|
|
2990
2990
|
}, undefined, true, undefined, this);
|
|
2991
2991
|
};
|
|
2992
|
+
// src/client/profileSwitchRecommendation.ts
|
|
2993
|
+
var fetchVoiceProfileSwitchRecommendation = async (path = "/api/voice/profile-switch-recommendation", options = {}) => {
|
|
2994
|
+
const fetchImpl = options.fetch ?? globalThis.fetch;
|
|
2995
|
+
const response = await fetchImpl(path);
|
|
2996
|
+
if (!response.ok) {
|
|
2997
|
+
throw new Error(`Voice profile switch recommendation failed: HTTP ${response.status}`);
|
|
2998
|
+
}
|
|
2999
|
+
return await response.json();
|
|
3000
|
+
};
|
|
3001
|
+
var createVoiceProfileSwitchRecommendationStore = (path = "/api/voice/profile-switch-recommendation", options = {}) => {
|
|
3002
|
+
const listeners = new Set;
|
|
3003
|
+
let closed = false;
|
|
3004
|
+
let timer;
|
|
3005
|
+
let snapshot = {
|
|
3006
|
+
error: null,
|
|
3007
|
+
isLoading: false
|
|
3008
|
+
};
|
|
3009
|
+
const emit = () => {
|
|
3010
|
+
for (const listener of listeners) {
|
|
3011
|
+
listener();
|
|
3012
|
+
}
|
|
3013
|
+
};
|
|
3014
|
+
const refresh = async () => {
|
|
3015
|
+
if (closed) {
|
|
3016
|
+
return snapshot.recommendation;
|
|
3017
|
+
}
|
|
3018
|
+
snapshot = { ...snapshot, error: null, isLoading: true };
|
|
3019
|
+
emit();
|
|
3020
|
+
try {
|
|
3021
|
+
const recommendation = await fetchVoiceProfileSwitchRecommendation(path, options);
|
|
3022
|
+
snapshot = {
|
|
3023
|
+
error: null,
|
|
3024
|
+
isLoading: false,
|
|
3025
|
+
recommendation,
|
|
3026
|
+
updatedAt: Date.now()
|
|
3027
|
+
};
|
|
3028
|
+
emit();
|
|
3029
|
+
return recommendation;
|
|
3030
|
+
} catch (error) {
|
|
3031
|
+
snapshot = {
|
|
3032
|
+
...snapshot,
|
|
3033
|
+
error: error instanceof Error ? error.message : String(error),
|
|
3034
|
+
isLoading: false
|
|
3035
|
+
};
|
|
3036
|
+
emit();
|
|
3037
|
+
throw error;
|
|
3038
|
+
}
|
|
3039
|
+
};
|
|
3040
|
+
const close = () => {
|
|
3041
|
+
closed = true;
|
|
3042
|
+
if (timer) {
|
|
3043
|
+
clearInterval(timer);
|
|
3044
|
+
timer = undefined;
|
|
3045
|
+
}
|
|
3046
|
+
listeners.clear();
|
|
3047
|
+
};
|
|
3048
|
+
if (typeof window !== "undefined" && options.intervalMs && options.intervalMs > 0) {
|
|
3049
|
+
timer = setInterval(() => {
|
|
3050
|
+
refresh().catch(() => {});
|
|
3051
|
+
}, options.intervalMs);
|
|
3052
|
+
}
|
|
3053
|
+
return {
|
|
3054
|
+
close,
|
|
3055
|
+
getServerSnapshot: () => snapshot,
|
|
3056
|
+
getSnapshot: () => snapshot,
|
|
3057
|
+
refresh,
|
|
3058
|
+
subscribe: (listener) => {
|
|
3059
|
+
listeners.add(listener);
|
|
3060
|
+
return () => {
|
|
3061
|
+
listeners.delete(listener);
|
|
3062
|
+
};
|
|
3063
|
+
}
|
|
3064
|
+
};
|
|
3065
|
+
};
|
|
3066
|
+
|
|
3067
|
+
// src/client/profileSwitchRecommendationWidget.ts
|
|
3068
|
+
var DEFAULT_TITLE7 = "Profile Switch Recommendation";
|
|
3069
|
+
var DEFAULT_DESCRIPTION7 = "Compares the current session against measured profile evidence and recommends whether to switch stacks.";
|
|
3070
|
+
var escapeHtml8 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
3071
|
+
var formatRoute = (routes) => routes ? Object.entries(routes).map(([role, provider]) => `${role}: ${provider}`).join(", ") : "No route";
|
|
3072
|
+
var renderVoiceProfileSwitchRecommendationHTML = (snapshot, options = {}) => {
|
|
3073
|
+
const recommendation = snapshot.recommendation;
|
|
3074
|
+
const status = snapshot.error ? "error" : recommendation ? recommendation.status : snapshot.isLoading ? "loading" : "empty";
|
|
3075
|
+
const label = snapshot.error ? "Unavailable" : recommendation ? recommendation.status === "switch" ? `Switch to ${recommendation.recommendedProfile?.label ?? recommendation.recommendedProfile?.profileId ?? "recommended profile"}` : recommendation.status === "stay" ? "Keep current profile" : "Needs evidence" : snapshot.isLoading ? "Checking" : "No recommendation";
|
|
3076
|
+
const body = recommendation ? `<div class="absolute-voice-profile-switch__body">
|
|
3077
|
+
<p><strong>Current:</strong> ${escapeHtml8(recommendation.currentProfile?.label ?? recommendation.currentProfile?.profileId ?? "Unknown")}</p>
|
|
3078
|
+
<p><strong>Recommended:</strong> ${escapeHtml8(recommendation.recommendedProfile?.label ?? recommendation.recommendedProfile?.profileId ?? "None")}</p>
|
|
3079
|
+
<p><strong>Routes:</strong> ${escapeHtml8(formatRoute(recommendation.recommendedProfile?.providerRoutes))}</p>
|
|
3080
|
+
<ul>${recommendation.reasons.map((reason) => `<li>${escapeHtml8(reason)}</li>`).join("")}</ul>
|
|
3081
|
+
<em>${escapeHtml8(recommendation.nextMove)}</em>
|
|
3082
|
+
</div>` : `<p class="absolute-voice-profile-switch__empty">${escapeHtml8(snapshot.error ?? "Run session traffic to populate a recommendation.")}</p>`;
|
|
3083
|
+
return `<section class="absolute-voice-profile-switch absolute-voice-profile-switch--${escapeHtml8(status)}">
|
|
3084
|
+
<header class="absolute-voice-profile-switch__header">
|
|
3085
|
+
<span class="absolute-voice-profile-switch__eyebrow">${escapeHtml8(options.title ?? DEFAULT_TITLE7)}</span>
|
|
3086
|
+
<strong class="absolute-voice-profile-switch__label">${escapeHtml8(label)}</strong>
|
|
3087
|
+
</header>
|
|
3088
|
+
<p class="absolute-voice-profile-switch__description">${escapeHtml8(options.description ?? DEFAULT_DESCRIPTION7)}</p>
|
|
3089
|
+
${body}
|
|
3090
|
+
${snapshot.error ? `<p class="absolute-voice-profile-switch__error">${escapeHtml8(snapshot.error)}</p>` : ""}
|
|
3091
|
+
</section>`;
|
|
3092
|
+
};
|
|
3093
|
+
var getVoiceProfileSwitchRecommendationCSS = () => `.absolute-voice-profile-switch{border:1px solid #fed7aa;border-radius:20px;background:#fff7ed;color:#1c1917;padding:18px;box-shadow:0 18px 40px rgba(234,88,12,.12);font-family:inherit}.absolute-voice-profile-switch--switch{border-color:#fdba74}.absolute-voice-profile-switch--stay{border-color:#86efac;background:#f0fdf4}.absolute-voice-profile-switch--warn,.absolute-voice-profile-switch--error{border-color:#fca5a5;background:#fff1f2}.absolute-voice-profile-switch__header{align-items:start;display:flex;gap:12px;justify-content:space-between}.absolute-voice-profile-switch__eyebrow{color:#c2410c;font-size:12px;font-weight:800;letter-spacing:.08em;text-transform:uppercase}.absolute-voice-profile-switch__label{font-size:24px;line-height:1}.absolute-voice-profile-switch__description,.absolute-voice-profile-switch__body em,.absolute-voice-profile-switch__empty{color:#57534e}.absolute-voice-profile-switch__body{background:#fff;border:1px solid #fed7aa;border-radius:16px;margin-top:14px;padding:14px}.absolute-voice-profile-switch__body p{margin:.35rem 0}.absolute-voice-profile-switch__body ul{margin:.75rem 0;padding-left:1.2rem}.absolute-voice-profile-switch__body em{display:block}.absolute-voice-profile-switch__error{color:#9f1239;font-weight:700}`;
|
|
3094
|
+
var mountVoiceProfileSwitchRecommendation = (element, path = "/api/voice/profile-switch-recommendation", options = {}) => {
|
|
3095
|
+
const store = createVoiceProfileSwitchRecommendationStore(path, options);
|
|
3096
|
+
const render = () => {
|
|
3097
|
+
element.innerHTML = renderVoiceProfileSwitchRecommendationHTML(store.getSnapshot(), options);
|
|
3098
|
+
};
|
|
3099
|
+
const unsubscribe = store.subscribe(render);
|
|
3100
|
+
render();
|
|
3101
|
+
store.refresh().catch(() => {});
|
|
3102
|
+
return {
|
|
3103
|
+
close: () => {
|
|
3104
|
+
unsubscribe();
|
|
3105
|
+
store.close();
|
|
3106
|
+
},
|
|
3107
|
+
refresh: store.refresh
|
|
3108
|
+
};
|
|
3109
|
+
};
|
|
3110
|
+
var defineVoiceProfileSwitchRecommendationElement = (tagName = "absolute-voice-profile-switch") => {
|
|
3111
|
+
if (typeof window === "undefined" || typeof customElements === "undefined" || customElements.get(tagName)) {
|
|
3112
|
+
return;
|
|
3113
|
+
}
|
|
3114
|
+
customElements.define(tagName, class AbsoluteVoiceProfileSwitchElement extends HTMLElement {
|
|
3115
|
+
mounted;
|
|
3116
|
+
connectedCallback() {
|
|
3117
|
+
const intervalMs = Number(this.getAttribute("interval-ms") ?? 5000);
|
|
3118
|
+
this.mounted = mountVoiceProfileSwitchRecommendation(this, this.getAttribute("path") ?? "/api/voice/profile-switch-recommendation", {
|
|
3119
|
+
description: this.getAttribute("description") ?? undefined,
|
|
3120
|
+
intervalMs: Number.isFinite(intervalMs) ? intervalMs : 5000,
|
|
3121
|
+
title: this.getAttribute("title") ?? undefined
|
|
3122
|
+
});
|
|
3123
|
+
}
|
|
3124
|
+
disconnectedCallback() {
|
|
3125
|
+
this.mounted?.close();
|
|
3126
|
+
this.mounted = undefined;
|
|
3127
|
+
}
|
|
3128
|
+
});
|
|
3129
|
+
};
|
|
3130
|
+
|
|
3131
|
+
// src/react/useVoiceProfileSwitchRecommendation.tsx
|
|
3132
|
+
import { useEffect as useEffect7, useRef as useRef7, useSyncExternalStore as useSyncExternalStore7 } from "react";
|
|
3133
|
+
var useVoiceProfileSwitchRecommendation = (path = "/api/voice/profile-switch-recommendation", options = {}) => {
|
|
3134
|
+
const storeRef = useRef7(null);
|
|
3135
|
+
if (!storeRef.current) {
|
|
3136
|
+
storeRef.current = createVoiceProfileSwitchRecommendationStore(path, options);
|
|
3137
|
+
}
|
|
3138
|
+
const store = storeRef.current;
|
|
3139
|
+
useEffect7(() => {
|
|
3140
|
+
store.refresh().catch(() => {});
|
|
3141
|
+
return () => store.close();
|
|
3142
|
+
}, [store]);
|
|
3143
|
+
return {
|
|
3144
|
+
...useSyncExternalStore7(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
3145
|
+
refresh: store.refresh
|
|
3146
|
+
};
|
|
3147
|
+
};
|
|
3148
|
+
|
|
3149
|
+
// src/react/VoiceProfileSwitchRecommendation.tsx
|
|
3150
|
+
import { jsxDEV as jsxDEV7 } from "react/jsx-dev-runtime";
|
|
3151
|
+
var VoiceProfileSwitchRecommendation = ({
|
|
3152
|
+
className,
|
|
3153
|
+
path = "/api/voice/profile-switch-recommendation",
|
|
3154
|
+
...options
|
|
3155
|
+
}) => {
|
|
3156
|
+
const snapshot = useVoiceProfileSwitchRecommendation(path, options);
|
|
3157
|
+
const html = renderVoiceProfileSwitchRecommendationHTML(snapshot, options);
|
|
3158
|
+
return /* @__PURE__ */ jsxDEV7("div", {
|
|
3159
|
+
className,
|
|
3160
|
+
dangerouslySetInnerHTML: { __html: html }
|
|
3161
|
+
}, undefined, false, undefined, this);
|
|
3162
|
+
};
|
|
2992
3163
|
// src/client/readinessFailures.ts
|
|
2993
3164
|
var fetchVoiceReadinessFailures = async (path = "/api/production-readiness", options = {}) => {
|
|
2994
3165
|
const fetchImpl = options.fetch ?? globalThis.fetch;
|
|
@@ -3065,13 +3236,13 @@ var createVoiceReadinessFailuresStore = (path = "/api/production-readiness", opt
|
|
|
3065
3236
|
};
|
|
3066
3237
|
|
|
3067
3238
|
// src/client/readinessFailuresWidget.ts
|
|
3068
|
-
var
|
|
3069
|
-
var
|
|
3239
|
+
var DEFAULT_TITLE8 = "Readiness Gate Explanations";
|
|
3240
|
+
var DEFAULT_DESCRIPTION8 = "Structured reasons for calibrated production-readiness warnings and failures.";
|
|
3070
3241
|
var DEFAULT_LINKS4 = [
|
|
3071
3242
|
{ href: "/production-readiness", label: "Readiness page" },
|
|
3072
3243
|
{ href: "/voice/slo-readiness-thresholds", label: "Gate thresholds" }
|
|
3073
3244
|
];
|
|
3074
|
-
var
|
|
3245
|
+
var escapeHtml9 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
3075
3246
|
var formatExplanationValue = (value, unit) => {
|
|
3076
3247
|
if (value === undefined || value === null) {
|
|
3077
3248
|
return "n/a";
|
|
@@ -3099,36 +3270,36 @@ var createVoiceReadinessFailuresViewModel = (snapshot, options = {}) => {
|
|
|
3099
3270
|
const failures = snapshot.report?.checks.map(toFailureView).filter((value) => !!value) ?? [];
|
|
3100
3271
|
const hasOpenIssues = failures.length > 0;
|
|
3101
3272
|
return {
|
|
3102
|
-
description: options.description ??
|
|
3273
|
+
description: options.description ?? DEFAULT_DESCRIPTION8,
|
|
3103
3274
|
error: snapshot.error,
|
|
3104
3275
|
failures,
|
|
3105
3276
|
isLoading: snapshot.isLoading,
|
|
3106
3277
|
label: snapshot.error ? "Unavailable" : snapshot.report ? hasOpenIssues ? `${failures.length} calibrated gate issue(s)` : "No calibrated gate issues" : snapshot.isLoading ? "Checking" : "No readiness report",
|
|
3107
3278
|
links: options.links ?? DEFAULT_LINKS4,
|
|
3108
3279
|
status: snapshot.error ? "error" : snapshot.report ? hasOpenIssues ? "warning" : "ready" : snapshot.isLoading ? "loading" : "empty",
|
|
3109
|
-
title: options.title ??
|
|
3280
|
+
title: options.title ?? DEFAULT_TITLE8,
|
|
3110
3281
|
updatedAt: snapshot.updatedAt
|
|
3111
3282
|
};
|
|
3112
3283
|
};
|
|
3113
3284
|
var renderVoiceReadinessFailuresHTML = (snapshot, options = {}) => {
|
|
3114
3285
|
const model = createVoiceReadinessFailuresViewModel(snapshot, options);
|
|
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--${
|
|
3116
|
-
<span>${
|
|
3117
|
-
<strong>${
|
|
3118
|
-
<p>Observed ${
|
|
3119
|
-
<p>${
|
|
3120
|
-
<p class="absolute-voice-readiness-failures__links">${failure.evidenceHref ? `<a href="${
|
|
3121
|
-
</article>`).join("")}</div>` : `<p class="absolute-voice-readiness-failures__empty">${model.error ?
|
|
3122
|
-
const links = model.links.length ? `<p class="absolute-voice-readiness-failures__links">${model.links.map((link) => `<a href="${
|
|
3123
|
-
return `<section class="absolute-voice-readiness-failures absolute-voice-readiness-failures--${
|
|
3286
|
+
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--${escapeHtml9(failure.status)}">
|
|
3287
|
+
<span>${escapeHtml9(failure.status.toUpperCase())}</span>
|
|
3288
|
+
<strong>${escapeHtml9(failure.label)}</strong>
|
|
3289
|
+
<p>Observed ${escapeHtml9(failure.observed)} against ${escapeHtml9(failure.thresholdLabel)} ${escapeHtml9(failure.threshold)}.</p>
|
|
3290
|
+
<p>${escapeHtml9(failure.remediation)}</p>
|
|
3291
|
+
<p class="absolute-voice-readiness-failures__links">${failure.evidenceHref ? `<a href="${escapeHtml9(failure.evidenceHref)}">Evidence</a>` : ""}${failure.sourceHref ? `<a href="${escapeHtml9(failure.sourceHref)}">Threshold source</a>` : ""}</p>
|
|
3292
|
+
</article>`).join("")}</div>` : `<p class="absolute-voice-readiness-failures__empty">${model.error ? escapeHtml9(model.error) : "No calibrated readiness gate explanations are open."}</p>`;
|
|
3293
|
+
const links = model.links.length ? `<p class="absolute-voice-readiness-failures__links">${model.links.map((link) => `<a href="${escapeHtml9(link.href)}">${escapeHtml9(link.label)}</a>`).join("")}</p>` : "";
|
|
3294
|
+
return `<section class="absolute-voice-readiness-failures absolute-voice-readiness-failures--${escapeHtml9(model.status)}">
|
|
3124
3295
|
<header class="absolute-voice-readiness-failures__header">
|
|
3125
|
-
<span class="absolute-voice-readiness-failures__eyebrow">${
|
|
3126
|
-
<strong class="absolute-voice-readiness-failures__label">${
|
|
3296
|
+
<span class="absolute-voice-readiness-failures__eyebrow">${escapeHtml9(model.title)}</span>
|
|
3297
|
+
<strong class="absolute-voice-readiness-failures__label">${escapeHtml9(model.label)}</strong>
|
|
3127
3298
|
</header>
|
|
3128
|
-
<p class="absolute-voice-readiness-failures__description">${
|
|
3299
|
+
<p class="absolute-voice-readiness-failures__description">${escapeHtml9(model.description)}</p>
|
|
3129
3300
|
${failures}
|
|
3130
3301
|
${links}
|
|
3131
|
-
${model.error ? `<p class="absolute-voice-readiness-failures__error">${
|
|
3302
|
+
${model.error ? `<p class="absolute-voice-readiness-failures__error">${escapeHtml9(model.error)}</p>` : ""}
|
|
3132
3303
|
</section>`;
|
|
3133
3304
|
};
|
|
3134
3305
|
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}`;
|
|
@@ -3169,25 +3340,25 @@ var defineVoiceReadinessFailuresElement = (tagName = "absolute-voice-readiness-f
|
|
|
3169
3340
|
};
|
|
3170
3341
|
|
|
3171
3342
|
// src/react/useVoiceReadinessFailures.tsx
|
|
3172
|
-
import { useEffect as
|
|
3343
|
+
import { useEffect as useEffect8, useRef as useRef8, useSyncExternalStore as useSyncExternalStore8 } from "react";
|
|
3173
3344
|
var useVoiceReadinessFailures = (path = "/api/production-readiness", options = {}) => {
|
|
3174
|
-
const storeRef =
|
|
3345
|
+
const storeRef = useRef8(null);
|
|
3175
3346
|
if (!storeRef.current) {
|
|
3176
3347
|
storeRef.current = createVoiceReadinessFailuresStore(path, options);
|
|
3177
3348
|
}
|
|
3178
3349
|
const store = storeRef.current;
|
|
3179
|
-
|
|
3350
|
+
useEffect8(() => {
|
|
3180
3351
|
store.refresh().catch(() => {});
|
|
3181
3352
|
return () => store.close();
|
|
3182
3353
|
}, [store]);
|
|
3183
3354
|
return {
|
|
3184
|
-
...
|
|
3355
|
+
...useSyncExternalStore8(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
3185
3356
|
refresh: store.refresh
|
|
3186
3357
|
};
|
|
3187
3358
|
};
|
|
3188
3359
|
|
|
3189
3360
|
// src/react/VoiceReadinessFailures.tsx
|
|
3190
|
-
import { jsxDEV as
|
|
3361
|
+
import { jsxDEV as jsxDEV8 } from "react/jsx-dev-runtime";
|
|
3191
3362
|
var VoiceReadinessFailures = ({
|
|
3192
3363
|
className,
|
|
3193
3364
|
path = "/api/production-readiness",
|
|
@@ -3195,42 +3366,42 @@ var VoiceReadinessFailures = ({
|
|
|
3195
3366
|
}) => {
|
|
3196
3367
|
const snapshot = useVoiceReadinessFailures(path, options);
|
|
3197
3368
|
const model = createVoiceReadinessFailuresViewModel(snapshot, options);
|
|
3198
|
-
return /* @__PURE__ */
|
|
3369
|
+
return /* @__PURE__ */ jsxDEV8("section", {
|
|
3199
3370
|
className: [
|
|
3200
3371
|
"absolute-voice-readiness-failures",
|
|
3201
3372
|
`absolute-voice-readiness-failures--${model.status}`,
|
|
3202
3373
|
className
|
|
3203
3374
|
].filter(Boolean).join(" "),
|
|
3204
3375
|
children: [
|
|
3205
|
-
/* @__PURE__ */
|
|
3376
|
+
/* @__PURE__ */ jsxDEV8("header", {
|
|
3206
3377
|
className: "absolute-voice-readiness-failures__header",
|
|
3207
3378
|
children: [
|
|
3208
|
-
/* @__PURE__ */
|
|
3379
|
+
/* @__PURE__ */ jsxDEV8("span", {
|
|
3209
3380
|
className: "absolute-voice-readiness-failures__eyebrow",
|
|
3210
3381
|
children: model.title
|
|
3211
3382
|
}, undefined, false, undefined, this),
|
|
3212
|
-
/* @__PURE__ */
|
|
3383
|
+
/* @__PURE__ */ jsxDEV8("strong", {
|
|
3213
3384
|
className: "absolute-voice-readiness-failures__label",
|
|
3214
3385
|
children: model.label
|
|
3215
3386
|
}, undefined, false, undefined, this)
|
|
3216
3387
|
]
|
|
3217
3388
|
}, undefined, true, undefined, this),
|
|
3218
|
-
/* @__PURE__ */
|
|
3389
|
+
/* @__PURE__ */ jsxDEV8("p", {
|
|
3219
3390
|
className: "absolute-voice-readiness-failures__description",
|
|
3220
3391
|
children: model.description
|
|
3221
3392
|
}, undefined, false, undefined, this),
|
|
3222
|
-
model.failures.length ? /* @__PURE__ */
|
|
3393
|
+
model.failures.length ? /* @__PURE__ */ jsxDEV8("div", {
|
|
3223
3394
|
className: "absolute-voice-readiness-failures__items",
|
|
3224
|
-
children: model.failures.map((failure) => /* @__PURE__ */
|
|
3395
|
+
children: model.failures.map((failure) => /* @__PURE__ */ jsxDEV8("article", {
|
|
3225
3396
|
className: `absolute-voice-readiness-failures__item absolute-voice-readiness-failures__item--${failure.status}`,
|
|
3226
3397
|
children: [
|
|
3227
|
-
/* @__PURE__ */
|
|
3398
|
+
/* @__PURE__ */ jsxDEV8("span", {
|
|
3228
3399
|
children: failure.status.toUpperCase()
|
|
3229
3400
|
}, undefined, false, undefined, this),
|
|
3230
|
-
/* @__PURE__ */
|
|
3401
|
+
/* @__PURE__ */ jsxDEV8("strong", {
|
|
3231
3402
|
children: failure.label
|
|
3232
3403
|
}, undefined, false, undefined, this),
|
|
3233
|
-
/* @__PURE__ */
|
|
3404
|
+
/* @__PURE__ */ jsxDEV8("p", {
|
|
3234
3405
|
children: [
|
|
3235
3406
|
"Observed ",
|
|
3236
3407
|
failure.observed,
|
|
@@ -3241,17 +3412,17 @@ var VoiceReadinessFailures = ({
|
|
|
3241
3412
|
"."
|
|
3242
3413
|
]
|
|
3243
3414
|
}, undefined, true, undefined, this),
|
|
3244
|
-
/* @__PURE__ */
|
|
3415
|
+
/* @__PURE__ */ jsxDEV8("p", {
|
|
3245
3416
|
children: failure.remediation
|
|
3246
3417
|
}, undefined, false, undefined, this),
|
|
3247
|
-
/* @__PURE__ */
|
|
3418
|
+
/* @__PURE__ */ jsxDEV8("p", {
|
|
3248
3419
|
className: "absolute-voice-readiness-failures__links",
|
|
3249
3420
|
children: [
|
|
3250
|
-
failure.evidenceHref ? /* @__PURE__ */
|
|
3421
|
+
failure.evidenceHref ? /* @__PURE__ */ jsxDEV8("a", {
|
|
3251
3422
|
href: failure.evidenceHref,
|
|
3252
3423
|
children: "Evidence"
|
|
3253
3424
|
}, undefined, false, undefined, this) : null,
|
|
3254
|
-
failure.sourceHref ? /* @__PURE__ */
|
|
3425
|
+
failure.sourceHref ? /* @__PURE__ */ jsxDEV8("a", {
|
|
3255
3426
|
href: failure.sourceHref,
|
|
3256
3427
|
children: "Threshold source"
|
|
3257
3428
|
}, undefined, false, undefined, this) : null
|
|
@@ -3259,18 +3430,18 @@ var VoiceReadinessFailures = ({
|
|
|
3259
3430
|
}, undefined, true, undefined, this)
|
|
3260
3431
|
]
|
|
3261
3432
|
}, failure.label, true, undefined, this))
|
|
3262
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
3433
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV8("p", {
|
|
3263
3434
|
className: "absolute-voice-readiness-failures__empty",
|
|
3264
3435
|
children: model.error ?? "No calibrated readiness gate explanations are open."
|
|
3265
3436
|
}, undefined, false, undefined, this),
|
|
3266
|
-
model.links.length ? /* @__PURE__ */
|
|
3437
|
+
model.links.length ? /* @__PURE__ */ jsxDEV8("p", {
|
|
3267
3438
|
className: "absolute-voice-readiness-failures__links",
|
|
3268
|
-
children: model.links.map((link) => /* @__PURE__ */
|
|
3439
|
+
children: model.links.map((link) => /* @__PURE__ */ jsxDEV8("a", {
|
|
3269
3440
|
href: link.href,
|
|
3270
3441
|
children: link.label
|
|
3271
3442
|
}, link.href, false, undefined, this))
|
|
3272
3443
|
}, undefined, false, undefined, this) : null,
|
|
3273
|
-
model.error ? /* @__PURE__ */
|
|
3444
|
+
model.error ? /* @__PURE__ */ jsxDEV8("p", {
|
|
3274
3445
|
className: "absolute-voice-readiness-failures__error",
|
|
3275
3446
|
children: model.error
|
|
3276
3447
|
}, undefined, false, undefined, this) : null
|
|
@@ -3357,7 +3528,7 @@ var createVoiceProviderSimulationControlsStore = (options) => {
|
|
|
3357
3528
|
};
|
|
3358
3529
|
|
|
3359
3530
|
// src/client/providerSimulationControlsWidget.ts
|
|
3360
|
-
var
|
|
3531
|
+
var escapeHtml10 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
3361
3532
|
var formatKind = (kind) => (kind ?? "stt").toUpperCase();
|
|
3362
3533
|
var createVoiceProviderSimulationControlsViewModel = (snapshot, options) => {
|
|
3363
3534
|
const configuredProviders = options.providers.filter((provider) => provider.configured !== false);
|
|
@@ -3377,18 +3548,18 @@ var createVoiceProviderSimulationControlsViewModel = (snapshot, options) => {
|
|
|
3377
3548
|
};
|
|
3378
3549
|
var renderVoiceProviderSimulationControlsHTML = (snapshot, options) => {
|
|
3379
3550
|
const model = createVoiceProviderSimulationControlsViewModel(snapshot, options);
|
|
3380
|
-
const failureButtons = model.failureProviders.map((provider) => `<button type="button" data-voice-provider-fail="${
|
|
3381
|
-
const recoveryButtons = model.providers.map((provider) => `<button type="button" data-voice-provider-recover="${
|
|
3551
|
+
const failureButtons = model.failureProviders.map((provider) => `<button type="button" data-voice-provider-fail="${escapeHtml10(provider.provider)}"${!model.canSimulateFailure || snapshot.isRunning ? " disabled" : ""}>Simulate ${escapeHtml10(provider.provider)} ${escapeHtml10(formatKind(options.kind))} failure</button>`).join("");
|
|
3552
|
+
const recoveryButtons = model.providers.map((provider) => `<button type="button" data-voice-provider-recover="${escapeHtml10(provider.provider)}"${snapshot.isRunning ? " disabled" : ""}>Mark ${escapeHtml10(provider.provider)} recovered</button>`).join("");
|
|
3382
3553
|
return `<section class="absolute-voice-provider-simulation absolute-voice-provider-simulation--${snapshot.error ? "error" : snapshot.isRunning ? "running" : "ready"}">
|
|
3383
3554
|
<header class="absolute-voice-provider-simulation__header">
|
|
3384
|
-
<span class="absolute-voice-provider-simulation__eyebrow">${
|
|
3385
|
-
<strong class="absolute-voice-provider-simulation__label">${
|
|
3555
|
+
<span class="absolute-voice-provider-simulation__eyebrow">${escapeHtml10(model.title)}</span>
|
|
3556
|
+
<strong class="absolute-voice-provider-simulation__label">${escapeHtml10(model.label)}</strong>
|
|
3386
3557
|
</header>
|
|
3387
|
-
<p class="absolute-voice-provider-simulation__description">${
|
|
3388
|
-
${model.canSimulateFailure ? "" : `<p class="absolute-voice-provider-simulation__empty">${
|
|
3558
|
+
<p class="absolute-voice-provider-simulation__description">${escapeHtml10(model.description)}</p>
|
|
3559
|
+
${model.canSimulateFailure ? "" : `<p class="absolute-voice-provider-simulation__empty">${escapeHtml10(options.fallbackRequiredMessage ?? "Configure fallback providers before simulating failure.")}</p>`}
|
|
3389
3560
|
<div class="absolute-voice-provider-simulation__actions">${failureButtons}${recoveryButtons}</div>
|
|
3390
|
-
${snapshot.error ? `<p class="absolute-voice-provider-simulation__error">${
|
|
3391
|
-
${model.resultText ? `<pre class="absolute-voice-provider-simulation__result">${
|
|
3561
|
+
${snapshot.error ? `<p class="absolute-voice-provider-simulation__error">${escapeHtml10(snapshot.error)}</p>` : ""}
|
|
3562
|
+
${model.resultText ? `<pre class="absolute-voice-provider-simulation__result">${escapeHtml10(model.resultText)}</pre>` : ""}
|
|
3392
3563
|
</section>`;
|
|
3393
3564
|
};
|
|
3394
3565
|
var bindVoiceProviderSimulationControls = (element, store) => {
|
|
@@ -3454,22 +3625,22 @@ var defineVoiceProviderSimulationControlsElement = (tagName = "absolute-voice-pr
|
|
|
3454
3625
|
};
|
|
3455
3626
|
|
|
3456
3627
|
// src/react/useVoiceProviderSimulationControls.tsx
|
|
3457
|
-
import { useEffect as
|
|
3628
|
+
import { useEffect as useEffect9, useRef as useRef9, useSyncExternalStore as useSyncExternalStore9 } from "react";
|
|
3458
3629
|
var useVoiceProviderSimulationControls = (options) => {
|
|
3459
|
-
const storeRef =
|
|
3630
|
+
const storeRef = useRef9(null);
|
|
3460
3631
|
if (!storeRef.current) {
|
|
3461
3632
|
storeRef.current = createVoiceProviderSimulationControlsStore(options);
|
|
3462
3633
|
}
|
|
3463
3634
|
const store = storeRef.current;
|
|
3464
|
-
|
|
3635
|
+
useEffect9(() => () => store.close(), [store]);
|
|
3465
3636
|
return {
|
|
3466
|
-
...
|
|
3637
|
+
...useSyncExternalStore9(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
3467
3638
|
run: store.run
|
|
3468
3639
|
};
|
|
3469
3640
|
};
|
|
3470
3641
|
|
|
3471
3642
|
// src/react/VoiceProviderSimulationControls.tsx
|
|
3472
|
-
import { jsxDEV as
|
|
3643
|
+
import { jsxDEV as jsxDEV9 } from "react/jsx-dev-runtime";
|
|
3473
3644
|
var VoiceProviderSimulationControls = ({
|
|
3474
3645
|
className,
|
|
3475
3646
|
...options
|
|
@@ -3479,38 +3650,38 @@ var VoiceProviderSimulationControls = ({
|
|
|
3479
3650
|
const run = (provider, mode) => {
|
|
3480
3651
|
snapshot.run(provider, mode).catch(() => {});
|
|
3481
3652
|
};
|
|
3482
|
-
return /* @__PURE__ */
|
|
3653
|
+
return /* @__PURE__ */ jsxDEV9("section", {
|
|
3483
3654
|
className: [
|
|
3484
3655
|
"absolute-voice-provider-simulation",
|
|
3485
3656
|
`absolute-voice-provider-simulation--${snapshot.error ? "error" : snapshot.isRunning ? "running" : "ready"}`,
|
|
3486
3657
|
className
|
|
3487
3658
|
].filter(Boolean).join(" "),
|
|
3488
3659
|
children: [
|
|
3489
|
-
/* @__PURE__ */
|
|
3660
|
+
/* @__PURE__ */ jsxDEV9("header", {
|
|
3490
3661
|
className: "absolute-voice-provider-simulation__header",
|
|
3491
3662
|
children: [
|
|
3492
|
-
/* @__PURE__ */
|
|
3663
|
+
/* @__PURE__ */ jsxDEV9("span", {
|
|
3493
3664
|
className: "absolute-voice-provider-simulation__eyebrow",
|
|
3494
3665
|
children: model.title
|
|
3495
3666
|
}, undefined, false, undefined, this),
|
|
3496
|
-
/* @__PURE__ */
|
|
3667
|
+
/* @__PURE__ */ jsxDEV9("strong", {
|
|
3497
3668
|
className: "absolute-voice-provider-simulation__label",
|
|
3498
3669
|
children: model.label
|
|
3499
3670
|
}, undefined, false, undefined, this)
|
|
3500
3671
|
]
|
|
3501
3672
|
}, undefined, true, undefined, this),
|
|
3502
|
-
/* @__PURE__ */
|
|
3673
|
+
/* @__PURE__ */ jsxDEV9("p", {
|
|
3503
3674
|
className: "absolute-voice-provider-simulation__description",
|
|
3504
3675
|
children: model.description
|
|
3505
3676
|
}, undefined, false, undefined, this),
|
|
3506
|
-
model.canSimulateFailure ? null : /* @__PURE__ */
|
|
3677
|
+
model.canSimulateFailure ? null : /* @__PURE__ */ jsxDEV9("p", {
|
|
3507
3678
|
className: "absolute-voice-provider-simulation__empty",
|
|
3508
3679
|
children: options.fallbackRequiredMessage ?? "Configure fallback providers before simulating failure."
|
|
3509
3680
|
}, undefined, false, undefined, this),
|
|
3510
|
-
/* @__PURE__ */
|
|
3681
|
+
/* @__PURE__ */ jsxDEV9("div", {
|
|
3511
3682
|
className: "absolute-voice-provider-simulation__actions",
|
|
3512
3683
|
children: [
|
|
3513
|
-
model.failureProviders.map((provider) => /* @__PURE__ */
|
|
3684
|
+
model.failureProviders.map((provider) => /* @__PURE__ */ jsxDEV9("button", {
|
|
3514
3685
|
disabled: !model.canSimulateFailure || snapshot.isRunning,
|
|
3515
3686
|
onClick: () => run(provider.provider, "failure"),
|
|
3516
3687
|
type: "button",
|
|
@@ -3523,7 +3694,7 @@ var VoiceProviderSimulationControls = ({
|
|
|
3523
3694
|
"failure"
|
|
3524
3695
|
]
|
|
3525
3696
|
}, `fail-${provider.provider}`, true, undefined, this)),
|
|
3526
|
-
model.providers.map((provider) => /* @__PURE__ */
|
|
3697
|
+
model.providers.map((provider) => /* @__PURE__ */ jsxDEV9("button", {
|
|
3527
3698
|
disabled: snapshot.isRunning,
|
|
3528
3699
|
onClick: () => run(provider.provider, "recovery"),
|
|
3529
3700
|
type: "button",
|
|
@@ -3535,11 +3706,11 @@ var VoiceProviderSimulationControls = ({
|
|
|
3535
3706
|
}, `recover-${provider.provider}`, true, undefined, this))
|
|
3536
3707
|
]
|
|
3537
3708
|
}, undefined, true, undefined, this),
|
|
3538
|
-
snapshot.error ? /* @__PURE__ */
|
|
3709
|
+
snapshot.error ? /* @__PURE__ */ jsxDEV9("p", {
|
|
3539
3710
|
className: "absolute-voice-provider-simulation__error",
|
|
3540
3711
|
children: snapshot.error
|
|
3541
3712
|
}, undefined, false, undefined, this) : null,
|
|
3542
|
-
model.resultText ? /* @__PURE__ */
|
|
3713
|
+
model.resultText ? /* @__PURE__ */ jsxDEV9("pre", {
|
|
3543
3714
|
className: "absolute-voice-provider-simulation__result",
|
|
3544
3715
|
children: model.resultText
|
|
3545
3716
|
}, undefined, false, undefined, this) : null
|
|
@@ -3547,7 +3718,7 @@ var VoiceProviderSimulationControls = ({
|
|
|
3547
3718
|
}, undefined, true, undefined, this);
|
|
3548
3719
|
};
|
|
3549
3720
|
// src/react/useVoiceProviderCapabilities.tsx
|
|
3550
|
-
import { useEffect as
|
|
3721
|
+
import { useEffect as useEffect10, useRef as useRef10, useSyncExternalStore as useSyncExternalStore10 } from "react";
|
|
3551
3722
|
|
|
3552
3723
|
// src/client/providerCapabilities.ts
|
|
3553
3724
|
var fetchVoiceProviderCapabilities = async (path = "/api/provider-capabilities", options = {}) => {
|
|
@@ -3630,25 +3801,25 @@ var createVoiceProviderCapabilitiesStore = (path = "/api/provider-capabilities",
|
|
|
3630
3801
|
|
|
3631
3802
|
// src/react/useVoiceProviderCapabilities.tsx
|
|
3632
3803
|
var useVoiceProviderCapabilities = (path = "/api/provider-capabilities", options = {}) => {
|
|
3633
|
-
const storeRef =
|
|
3804
|
+
const storeRef = useRef10(null);
|
|
3634
3805
|
if (!storeRef.current) {
|
|
3635
3806
|
storeRef.current = createVoiceProviderCapabilitiesStore(path, options);
|
|
3636
3807
|
}
|
|
3637
3808
|
const store = storeRef.current;
|
|
3638
|
-
|
|
3809
|
+
useEffect10(() => {
|
|
3639
3810
|
store.refresh().catch(() => {});
|
|
3640
3811
|
return () => store.close();
|
|
3641
3812
|
}, [store]);
|
|
3642
3813
|
return {
|
|
3643
|
-
...
|
|
3814
|
+
...useSyncExternalStore10(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
3644
3815
|
refresh: store.refresh
|
|
3645
3816
|
};
|
|
3646
3817
|
};
|
|
3647
3818
|
|
|
3648
3819
|
// src/client/providerCapabilitiesWidget.ts
|
|
3649
|
-
var
|
|
3650
|
-
var
|
|
3651
|
-
var
|
|
3820
|
+
var DEFAULT_TITLE9 = "Provider Capabilities";
|
|
3821
|
+
var DEFAULT_DESCRIPTION9 = "Configured, selected, and healthy voice providers for this deployment.";
|
|
3822
|
+
var escapeHtml11 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
3652
3823
|
var formatProvider = (provider) => provider.split(/[-_\s]+/).filter(Boolean).map((part) => `${part[0]?.toUpperCase() ?? ""}${part.slice(1)}`).join(" ") || provider;
|
|
3653
3824
|
var formatKind2 = (kind) => kind.toUpperCase();
|
|
3654
3825
|
var formatStatus2 = (status) => status.split("-").map((part) => `${part[0]?.toUpperCase() ?? ""}${part.slice(1)}`).join(" ");
|
|
@@ -3692,36 +3863,36 @@ var createVoiceProviderCapabilitiesViewModel = (snapshot, options = {}) => {
|
|
|
3692
3863
|
const selectedCount = snapshot.report?.selected ?? capabilities.filter((capability) => capability.selected).length;
|
|
3693
3864
|
return {
|
|
3694
3865
|
capabilities,
|
|
3695
|
-
description: options.description ??
|
|
3866
|
+
description: options.description ?? DEFAULT_DESCRIPTION9,
|
|
3696
3867
|
error: snapshot.error,
|
|
3697
3868
|
isLoading: snapshot.isLoading,
|
|
3698
3869
|
label: snapshot.error ? "Unavailable" : capabilities.length ? warningCount > 0 ? `${warningCount} needs attention` : `${selectedCount} selected` : snapshot.isLoading ? "Checking" : "No capabilities",
|
|
3699
3870
|
status: snapshot.error ? "error" : capabilities.length ? warningCount > 0 ? "warning" : "ready" : snapshot.isLoading ? "loading" : "empty",
|
|
3700
|
-
title: options.title ??
|
|
3871
|
+
title: options.title ?? DEFAULT_TITLE9,
|
|
3701
3872
|
updatedAt: snapshot.updatedAt
|
|
3702
3873
|
};
|
|
3703
3874
|
};
|
|
3704
3875
|
var renderVoiceProviderCapabilitiesHTML = (snapshot, options = {}) => {
|
|
3705
3876
|
const model = createVoiceProviderCapabilitiesViewModel(snapshot, options);
|
|
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--${
|
|
3877
|
+
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--${escapeHtml11(capability.status)}">
|
|
3707
3878
|
<header>
|
|
3708
|
-
<strong>${
|
|
3709
|
-
<span>${
|
|
3879
|
+
<strong>${escapeHtml11(capability.label)}</strong>
|
|
3880
|
+
<span>${escapeHtml11(formatStatus2(capability.status))}</span>
|
|
3710
3881
|
</header>
|
|
3711
|
-
<p>${
|
|
3882
|
+
<p>${escapeHtml11(capability.detail)}</p>
|
|
3712
3883
|
<dl>${capability.rows.map((row) => `<div>
|
|
3713
|
-
<dt>${
|
|
3714
|
-
<dd>${
|
|
3884
|
+
<dt>${escapeHtml11(row.label)}</dt>
|
|
3885
|
+
<dd>${escapeHtml11(row.value)}</dd>
|
|
3715
3886
|
</div>`).join("")}</dl>
|
|
3716
3887
|
</article>`).join("")}</div>` : '<p class="absolute-voice-provider-capabilities__empty">Configure provider capabilities to see deployment coverage.</p>';
|
|
3717
|
-
return `<section class="absolute-voice-provider-capabilities absolute-voice-provider-capabilities--${
|
|
3888
|
+
return `<section class="absolute-voice-provider-capabilities absolute-voice-provider-capabilities--${escapeHtml11(model.status)}">
|
|
3718
3889
|
<header class="absolute-voice-provider-capabilities__header">
|
|
3719
|
-
<span class="absolute-voice-provider-capabilities__eyebrow">${
|
|
3720
|
-
<strong class="absolute-voice-provider-capabilities__label">${
|
|
3890
|
+
<span class="absolute-voice-provider-capabilities__eyebrow">${escapeHtml11(model.title)}</span>
|
|
3891
|
+
<strong class="absolute-voice-provider-capabilities__label">${escapeHtml11(model.label)}</strong>
|
|
3721
3892
|
</header>
|
|
3722
|
-
<p class="absolute-voice-provider-capabilities__description">${
|
|
3893
|
+
<p class="absolute-voice-provider-capabilities__description">${escapeHtml11(model.description)}</p>
|
|
3723
3894
|
${capabilities}
|
|
3724
|
-
${model.error ? `<p class="absolute-voice-provider-capabilities__error">${
|
|
3895
|
+
${model.error ? `<p class="absolute-voice-provider-capabilities__error">${escapeHtml11(model.error)}</p>` : ""}
|
|
3725
3896
|
</section>`;
|
|
3726
3897
|
};
|
|
3727
3898
|
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}`;
|
|
@@ -3763,7 +3934,7 @@ var defineVoiceProviderCapabilitiesElement = (tagName = "absolute-voice-provider
|
|
|
3763
3934
|
};
|
|
3764
3935
|
|
|
3765
3936
|
// src/react/VoiceProviderCapabilities.tsx
|
|
3766
|
-
import { jsxDEV as
|
|
3937
|
+
import { jsxDEV as jsxDEV10 } from "react/jsx-dev-runtime";
|
|
3767
3938
|
var VoiceProviderCapabilities = ({
|
|
3768
3939
|
className,
|
|
3769
3940
|
path = "/api/provider-capabilities",
|
|
@@ -3771,58 +3942,58 @@ var VoiceProviderCapabilities = ({
|
|
|
3771
3942
|
}) => {
|
|
3772
3943
|
const snapshot = useVoiceProviderCapabilities(path, options);
|
|
3773
3944
|
const model = createVoiceProviderCapabilitiesViewModel(snapshot, options);
|
|
3774
|
-
return /* @__PURE__ */
|
|
3945
|
+
return /* @__PURE__ */ jsxDEV10("section", {
|
|
3775
3946
|
className: [
|
|
3776
3947
|
"absolute-voice-provider-capabilities",
|
|
3777
3948
|
`absolute-voice-provider-capabilities--${model.status}`,
|
|
3778
3949
|
className
|
|
3779
3950
|
].filter(Boolean).join(" "),
|
|
3780
3951
|
children: [
|
|
3781
|
-
/* @__PURE__ */
|
|
3952
|
+
/* @__PURE__ */ jsxDEV10("header", {
|
|
3782
3953
|
className: "absolute-voice-provider-capabilities__header",
|
|
3783
3954
|
children: [
|
|
3784
|
-
/* @__PURE__ */
|
|
3955
|
+
/* @__PURE__ */ jsxDEV10("span", {
|
|
3785
3956
|
className: "absolute-voice-provider-capabilities__eyebrow",
|
|
3786
3957
|
children: model.title
|
|
3787
3958
|
}, undefined, false, undefined, this),
|
|
3788
|
-
/* @__PURE__ */
|
|
3959
|
+
/* @__PURE__ */ jsxDEV10("strong", {
|
|
3789
3960
|
className: "absolute-voice-provider-capabilities__label",
|
|
3790
3961
|
children: model.label
|
|
3791
3962
|
}, undefined, false, undefined, this)
|
|
3792
3963
|
]
|
|
3793
3964
|
}, undefined, true, undefined, this),
|
|
3794
|
-
/* @__PURE__ */
|
|
3965
|
+
/* @__PURE__ */ jsxDEV10("p", {
|
|
3795
3966
|
className: "absolute-voice-provider-capabilities__description",
|
|
3796
3967
|
children: model.description
|
|
3797
3968
|
}, undefined, false, undefined, this),
|
|
3798
|
-
model.capabilities.length ? /* @__PURE__ */
|
|
3969
|
+
model.capabilities.length ? /* @__PURE__ */ jsxDEV10("div", {
|
|
3799
3970
|
className: "absolute-voice-provider-capabilities__providers",
|
|
3800
|
-
children: model.capabilities.map((capability) => /* @__PURE__ */
|
|
3971
|
+
children: model.capabilities.map((capability) => /* @__PURE__ */ jsxDEV10("article", {
|
|
3801
3972
|
className: [
|
|
3802
3973
|
"absolute-voice-provider-capabilities__provider",
|
|
3803
3974
|
`absolute-voice-provider-capabilities__provider--${capability.status}`
|
|
3804
3975
|
].join(" "),
|
|
3805
3976
|
children: [
|
|
3806
|
-
/* @__PURE__ */
|
|
3977
|
+
/* @__PURE__ */ jsxDEV10("header", {
|
|
3807
3978
|
children: [
|
|
3808
|
-
/* @__PURE__ */
|
|
3979
|
+
/* @__PURE__ */ jsxDEV10("strong", {
|
|
3809
3980
|
children: capability.label
|
|
3810
3981
|
}, undefined, false, undefined, this),
|
|
3811
|
-
/* @__PURE__ */
|
|
3982
|
+
/* @__PURE__ */ jsxDEV10("span", {
|
|
3812
3983
|
children: capability.status
|
|
3813
3984
|
}, undefined, false, undefined, this)
|
|
3814
3985
|
]
|
|
3815
3986
|
}, undefined, true, undefined, this),
|
|
3816
|
-
/* @__PURE__ */
|
|
3987
|
+
/* @__PURE__ */ jsxDEV10("p", {
|
|
3817
3988
|
children: capability.detail
|
|
3818
3989
|
}, undefined, false, undefined, this),
|
|
3819
|
-
/* @__PURE__ */
|
|
3820
|
-
children: capability.rows.map((row) => /* @__PURE__ */
|
|
3990
|
+
/* @__PURE__ */ jsxDEV10("dl", {
|
|
3991
|
+
children: capability.rows.map((row) => /* @__PURE__ */ jsxDEV10("div", {
|
|
3821
3992
|
children: [
|
|
3822
|
-
/* @__PURE__ */
|
|
3993
|
+
/* @__PURE__ */ jsxDEV10("dt", {
|
|
3823
3994
|
children: row.label
|
|
3824
3995
|
}, undefined, false, undefined, this),
|
|
3825
|
-
/* @__PURE__ */
|
|
3996
|
+
/* @__PURE__ */ jsxDEV10("dd", {
|
|
3826
3997
|
children: row.value
|
|
3827
3998
|
}, undefined, false, undefined, this)
|
|
3828
3999
|
]
|
|
@@ -3830,11 +4001,11 @@ var VoiceProviderCapabilities = ({
|
|
|
3830
4001
|
}, undefined, false, undefined, this)
|
|
3831
4002
|
]
|
|
3832
4003
|
}, `${capability.kind}:${capability.provider}`, true, undefined, this))
|
|
3833
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
4004
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV10("p", {
|
|
3834
4005
|
className: "absolute-voice-provider-capabilities__empty",
|
|
3835
4006
|
children: "Configure provider capabilities to see deployment coverage."
|
|
3836
4007
|
}, undefined, false, undefined, this),
|
|
3837
|
-
model.error ? /* @__PURE__ */
|
|
4008
|
+
model.error ? /* @__PURE__ */ jsxDEV10("p", {
|
|
3838
4009
|
className: "absolute-voice-provider-capabilities__error",
|
|
3839
4010
|
children: model.error
|
|
3840
4011
|
}, undefined, false, undefined, this) : null
|
|
@@ -3842,7 +4013,7 @@ var VoiceProviderCapabilities = ({
|
|
|
3842
4013
|
}, undefined, true, undefined, this);
|
|
3843
4014
|
};
|
|
3844
4015
|
// src/react/useVoiceProviderContracts.tsx
|
|
3845
|
-
import { useEffect as
|
|
4016
|
+
import { useEffect as useEffect11, useRef as useRef11, useSyncExternalStore as useSyncExternalStore11 } from "react";
|
|
3846
4017
|
|
|
3847
4018
|
// src/client/providerContracts.ts
|
|
3848
4019
|
var fetchVoiceProviderContracts = async (path = "/api/provider-contracts", options = {}) => {
|
|
@@ -3921,25 +4092,25 @@ var createVoiceProviderContractsStore = (path = "/api/provider-contracts", optio
|
|
|
3921
4092
|
|
|
3922
4093
|
// src/react/useVoiceProviderContracts.tsx
|
|
3923
4094
|
var useVoiceProviderContracts = (path = "/api/provider-contracts", options = {}) => {
|
|
3924
|
-
const storeRef =
|
|
4095
|
+
const storeRef = useRef11(null);
|
|
3925
4096
|
if (!storeRef.current) {
|
|
3926
4097
|
storeRef.current = createVoiceProviderContractsStore(path, options);
|
|
3927
4098
|
}
|
|
3928
4099
|
const store = storeRef.current;
|
|
3929
|
-
|
|
4100
|
+
useEffect11(() => {
|
|
3930
4101
|
store.refresh().catch(() => {});
|
|
3931
4102
|
return () => store.close();
|
|
3932
4103
|
}, [store]);
|
|
3933
4104
|
return {
|
|
3934
|
-
...
|
|
4105
|
+
...useSyncExternalStore11(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
3935
4106
|
refresh: store.refresh
|
|
3936
4107
|
};
|
|
3937
4108
|
};
|
|
3938
4109
|
|
|
3939
4110
|
// src/client/providerContractsWidget.ts
|
|
3940
|
-
var
|
|
3941
|
-
var
|
|
3942
|
-
var
|
|
4111
|
+
var DEFAULT_TITLE10 = "Provider Contracts";
|
|
4112
|
+
var DEFAULT_DESCRIPTION10 = "Production contract coverage for provider env, latency, fallback, streaming, and capabilities.";
|
|
4113
|
+
var escapeHtml12 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
3943
4114
|
var formatProvider2 = (provider) => provider.split(/[-_\s]+/).filter(Boolean).map((part) => `${part[0]?.toUpperCase() ?? ""}${part.slice(1)}`).join(" ") || provider;
|
|
3944
4115
|
var formatStatus3 = (status) => status.split("-").map((part) => `${part[0]?.toUpperCase() ?? ""}${part.slice(1)}`).join(" ");
|
|
3945
4116
|
var contractDetail = (row) => {
|
|
@@ -3971,38 +4142,38 @@ var createVoiceProviderContractsViewModel = (snapshot, options = {}) => {
|
|
|
3971
4142
|
}));
|
|
3972
4143
|
const warningCount = snapshot.report ? snapshot.report.failed + snapshot.report.warned : rows.filter((row) => row.status !== "pass").length;
|
|
3973
4144
|
return {
|
|
3974
|
-
description: options.description ??
|
|
4145
|
+
description: options.description ?? DEFAULT_DESCRIPTION10,
|
|
3975
4146
|
error: snapshot.error,
|
|
3976
4147
|
isLoading: snapshot.isLoading,
|
|
3977
4148
|
label: snapshot.error ? "Unavailable" : rows.length ? warningCount > 0 ? `${warningCount} needs attention` : `${rows.length} passing` : snapshot.isLoading ? "Checking" : "No contracts",
|
|
3978
4149
|
rows,
|
|
3979
4150
|
status: snapshot.error ? "error" : rows.length ? warningCount > 0 ? "warning" : "ready" : snapshot.isLoading ? "loading" : "empty",
|
|
3980
|
-
title: options.title ??
|
|
4151
|
+
title: options.title ?? DEFAULT_TITLE10,
|
|
3981
4152
|
updatedAt: snapshot.updatedAt
|
|
3982
4153
|
};
|
|
3983
4154
|
};
|
|
3984
4155
|
var renderVoiceProviderContractsHTML = (snapshot, options = {}) => {
|
|
3985
4156
|
const model = createVoiceProviderContractsViewModel(snapshot, options);
|
|
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--${
|
|
4157
|
+
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--${escapeHtml12(row.status)}">
|
|
3987
4158
|
<header>
|
|
3988
|
-
<strong>${
|
|
3989
|
-
<span>${
|
|
4159
|
+
<strong>${escapeHtml12(row.label)}</strong>
|
|
4160
|
+
<span>${escapeHtml12(formatStatus3(row.status))}</span>
|
|
3990
4161
|
</header>
|
|
3991
|
-
<p>${
|
|
3992
|
-
${row.remediations.length ? `<ul class="absolute-voice-provider-contracts__remediations">${row.remediations.map((remediation) => `<li>${remediation.href ? `<a href="${
|
|
4162
|
+
<p>${escapeHtml12(row.detail)}</p>
|
|
4163
|
+
${row.remediations.length ? `<ul class="absolute-voice-provider-contracts__remediations">${row.remediations.map((remediation) => `<li>${remediation.href ? `<a href="${escapeHtml12(remediation.href)}">${escapeHtml12(remediation.label)}</a>` : `<strong>${escapeHtml12(remediation.label)}</strong>`}<span>${escapeHtml12(remediation.detail)}</span></li>`).join("")}</ul>` : ""}
|
|
3993
4164
|
<dl>${row.rows.map((item) => `<div>
|
|
3994
|
-
<dt>${
|
|
3995
|
-
<dd>${
|
|
4165
|
+
<dt>${escapeHtml12(item.label)}</dt>
|
|
4166
|
+
<dd>${escapeHtml12(item.value)}</dd>
|
|
3996
4167
|
</div>`).join("")}</dl>
|
|
3997
4168
|
</article>`).join("")}</div>` : '<p class="absolute-voice-provider-contracts__empty">Configure provider contracts to see production coverage.</p>';
|
|
3998
|
-
return `<section class="absolute-voice-provider-contracts absolute-voice-provider-contracts--${
|
|
4169
|
+
return `<section class="absolute-voice-provider-contracts absolute-voice-provider-contracts--${escapeHtml12(model.status)}">
|
|
3999
4170
|
<header class="absolute-voice-provider-contracts__header">
|
|
4000
|
-
<span class="absolute-voice-provider-contracts__eyebrow">${
|
|
4001
|
-
<strong class="absolute-voice-provider-contracts__label">${
|
|
4171
|
+
<span class="absolute-voice-provider-contracts__eyebrow">${escapeHtml12(model.title)}</span>
|
|
4172
|
+
<strong class="absolute-voice-provider-contracts__label">${escapeHtml12(model.label)}</strong>
|
|
4002
4173
|
</header>
|
|
4003
|
-
<p class="absolute-voice-provider-contracts__description">${
|
|
4174
|
+
<p class="absolute-voice-provider-contracts__description">${escapeHtml12(model.description)}</p>
|
|
4004
4175
|
${rows}
|
|
4005
|
-
${model.error ? `<p class="absolute-voice-provider-contracts__error">${
|
|
4176
|
+
${model.error ? `<p class="absolute-voice-provider-contracts__error">${escapeHtml12(model.error)}</p>` : ""}
|
|
4006
4177
|
</section>`;
|
|
4007
4178
|
};
|
|
4008
4179
|
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}`;
|
|
@@ -4044,7 +4215,7 @@ var defineVoiceProviderContractsElement = (tagName = "absolute-voice-provider-co
|
|
|
4044
4215
|
};
|
|
4045
4216
|
|
|
4046
4217
|
// src/react/VoiceProviderContracts.tsx
|
|
4047
|
-
import { jsxDEV as
|
|
4218
|
+
import { jsxDEV as jsxDEV11 } from "react/jsx-dev-runtime";
|
|
4048
4219
|
var VoiceProviderContracts = ({
|
|
4049
4220
|
className,
|
|
4050
4221
|
path = "/api/provider-contracts",
|
|
@@ -4052,74 +4223,74 @@ var VoiceProviderContracts = ({
|
|
|
4052
4223
|
}) => {
|
|
4053
4224
|
const snapshot = useVoiceProviderContracts(path, options);
|
|
4054
4225
|
const model = createVoiceProviderContractsViewModel(snapshot, options);
|
|
4055
|
-
return /* @__PURE__ */
|
|
4226
|
+
return /* @__PURE__ */ jsxDEV11("section", {
|
|
4056
4227
|
className: [
|
|
4057
4228
|
"absolute-voice-provider-contracts",
|
|
4058
4229
|
`absolute-voice-provider-contracts--${model.status}`,
|
|
4059
4230
|
className
|
|
4060
4231
|
].filter(Boolean).join(" "),
|
|
4061
4232
|
children: [
|
|
4062
|
-
/* @__PURE__ */
|
|
4233
|
+
/* @__PURE__ */ jsxDEV11("header", {
|
|
4063
4234
|
className: "absolute-voice-provider-contracts__header",
|
|
4064
4235
|
children: [
|
|
4065
|
-
/* @__PURE__ */
|
|
4236
|
+
/* @__PURE__ */ jsxDEV11("span", {
|
|
4066
4237
|
className: "absolute-voice-provider-contracts__eyebrow",
|
|
4067
4238
|
children: model.title
|
|
4068
4239
|
}, undefined, false, undefined, this),
|
|
4069
|
-
/* @__PURE__ */
|
|
4240
|
+
/* @__PURE__ */ jsxDEV11("strong", {
|
|
4070
4241
|
className: "absolute-voice-provider-contracts__label",
|
|
4071
4242
|
children: model.label
|
|
4072
4243
|
}, undefined, false, undefined, this)
|
|
4073
4244
|
]
|
|
4074
4245
|
}, undefined, true, undefined, this),
|
|
4075
|
-
/* @__PURE__ */
|
|
4246
|
+
/* @__PURE__ */ jsxDEV11("p", {
|
|
4076
4247
|
className: "absolute-voice-provider-contracts__description",
|
|
4077
4248
|
children: model.description
|
|
4078
4249
|
}, undefined, false, undefined, this),
|
|
4079
|
-
model.rows.length ? /* @__PURE__ */
|
|
4250
|
+
model.rows.length ? /* @__PURE__ */ jsxDEV11("div", {
|
|
4080
4251
|
className: "absolute-voice-provider-contracts__rows",
|
|
4081
|
-
children: model.rows.map((row) => /* @__PURE__ */
|
|
4252
|
+
children: model.rows.map((row) => /* @__PURE__ */ jsxDEV11("article", {
|
|
4082
4253
|
className: [
|
|
4083
4254
|
"absolute-voice-provider-contracts__row",
|
|
4084
4255
|
`absolute-voice-provider-contracts__row--${row.status}`
|
|
4085
4256
|
].join(" "),
|
|
4086
4257
|
children: [
|
|
4087
|
-
/* @__PURE__ */
|
|
4258
|
+
/* @__PURE__ */ jsxDEV11("header", {
|
|
4088
4259
|
children: [
|
|
4089
|
-
/* @__PURE__ */
|
|
4260
|
+
/* @__PURE__ */ jsxDEV11("strong", {
|
|
4090
4261
|
children: row.label
|
|
4091
4262
|
}, undefined, false, undefined, this),
|
|
4092
|
-
/* @__PURE__ */
|
|
4263
|
+
/* @__PURE__ */ jsxDEV11("span", {
|
|
4093
4264
|
children: row.status
|
|
4094
4265
|
}, undefined, false, undefined, this)
|
|
4095
4266
|
]
|
|
4096
4267
|
}, undefined, true, undefined, this),
|
|
4097
|
-
/* @__PURE__ */
|
|
4268
|
+
/* @__PURE__ */ jsxDEV11("p", {
|
|
4098
4269
|
children: row.detail
|
|
4099
4270
|
}, undefined, false, undefined, this),
|
|
4100
|
-
row.remediations.length ? /* @__PURE__ */
|
|
4271
|
+
row.remediations.length ? /* @__PURE__ */ jsxDEV11("ul", {
|
|
4101
4272
|
className: "absolute-voice-provider-contracts__remediations",
|
|
4102
|
-
children: row.remediations.map((remediation) => /* @__PURE__ */
|
|
4273
|
+
children: row.remediations.map((remediation) => /* @__PURE__ */ jsxDEV11("li", {
|
|
4103
4274
|
children: [
|
|
4104
|
-
remediation.href ? /* @__PURE__ */
|
|
4275
|
+
remediation.href ? /* @__PURE__ */ jsxDEV11("a", {
|
|
4105
4276
|
href: remediation.href,
|
|
4106
4277
|
children: remediation.label
|
|
4107
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
4278
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV11("strong", {
|
|
4108
4279
|
children: remediation.label
|
|
4109
4280
|
}, undefined, false, undefined, this),
|
|
4110
|
-
/* @__PURE__ */
|
|
4281
|
+
/* @__PURE__ */ jsxDEV11("span", {
|
|
4111
4282
|
children: remediation.detail
|
|
4112
4283
|
}, undefined, false, undefined, this)
|
|
4113
4284
|
]
|
|
4114
4285
|
}, `${row.kind}:${row.provider}:${remediation.label}`, true, undefined, this))
|
|
4115
4286
|
}, undefined, false, undefined, this) : null,
|
|
4116
|
-
/* @__PURE__ */
|
|
4117
|
-
children: row.rows.map((item) => /* @__PURE__ */
|
|
4287
|
+
/* @__PURE__ */ jsxDEV11("dl", {
|
|
4288
|
+
children: row.rows.map((item) => /* @__PURE__ */ jsxDEV11("div", {
|
|
4118
4289
|
children: [
|
|
4119
|
-
/* @__PURE__ */
|
|
4290
|
+
/* @__PURE__ */ jsxDEV11("dt", {
|
|
4120
4291
|
children: item.label
|
|
4121
4292
|
}, undefined, false, undefined, this),
|
|
4122
|
-
/* @__PURE__ */
|
|
4293
|
+
/* @__PURE__ */ jsxDEV11("dd", {
|
|
4123
4294
|
children: item.value
|
|
4124
4295
|
}, undefined, false, undefined, this)
|
|
4125
4296
|
]
|
|
@@ -4127,11 +4298,11 @@ var VoiceProviderContracts = ({
|
|
|
4127
4298
|
}, undefined, false, undefined, this)
|
|
4128
4299
|
]
|
|
4129
4300
|
}, `${row.kind}:${row.provider}`, true, undefined, this))
|
|
4130
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
4301
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV11("p", {
|
|
4131
4302
|
className: "absolute-voice-provider-contracts__empty",
|
|
4132
4303
|
children: "Configure provider contracts to see production coverage."
|
|
4133
4304
|
}, undefined, false, undefined, this),
|
|
4134
|
-
model.error ? /* @__PURE__ */
|
|
4305
|
+
model.error ? /* @__PURE__ */ jsxDEV11("p", {
|
|
4135
4306
|
className: "absolute-voice-provider-contracts__error",
|
|
4136
4307
|
children: model.error
|
|
4137
4308
|
}, undefined, false, undefined, this) : null
|
|
@@ -4139,7 +4310,7 @@ var VoiceProviderContracts = ({
|
|
|
4139
4310
|
}, undefined, true, undefined, this);
|
|
4140
4311
|
};
|
|
4141
4312
|
// src/react/useVoiceProviderStatus.tsx
|
|
4142
|
-
import { useEffect as
|
|
4313
|
+
import { useEffect as useEffect12, useRef as useRef12, useSyncExternalStore as useSyncExternalStore12 } from "react";
|
|
4143
4314
|
|
|
4144
4315
|
// src/client/providerStatus.ts
|
|
4145
4316
|
var fetchVoiceProviderStatus = async (path = "/api/provider-status", options = {}) => {
|
|
@@ -4223,25 +4394,25 @@ var createVoiceProviderStatusStore = (path = "/api/provider-status", options = {
|
|
|
4223
4394
|
|
|
4224
4395
|
// src/react/useVoiceProviderStatus.tsx
|
|
4225
4396
|
var useVoiceProviderStatus = (path = "/api/provider-status", options = {}) => {
|
|
4226
|
-
const storeRef =
|
|
4397
|
+
const storeRef = useRef12(null);
|
|
4227
4398
|
if (!storeRef.current) {
|
|
4228
4399
|
storeRef.current = createVoiceProviderStatusStore(path, options);
|
|
4229
4400
|
}
|
|
4230
4401
|
const store = storeRef.current;
|
|
4231
|
-
|
|
4402
|
+
useEffect12(() => {
|
|
4232
4403
|
store.refresh().catch(() => {});
|
|
4233
4404
|
return () => store.close();
|
|
4234
4405
|
}, [store]);
|
|
4235
4406
|
return {
|
|
4236
|
-
...
|
|
4407
|
+
...useSyncExternalStore12(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
4237
4408
|
refresh: store.refresh
|
|
4238
4409
|
};
|
|
4239
4410
|
};
|
|
4240
4411
|
|
|
4241
4412
|
// src/client/providerStatusWidget.ts
|
|
4242
|
-
var
|
|
4243
|
-
var
|
|
4244
|
-
var
|
|
4413
|
+
var DEFAULT_TITLE11 = "Voice Providers";
|
|
4414
|
+
var DEFAULT_DESCRIPTION11 = "Live provider health, fallback counts, latency, and suppression state from your self-hosted trace store.";
|
|
4415
|
+
var escapeHtml13 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
4245
4416
|
var formatProvider3 = (provider) => provider.split(/[-_\s]+/).filter(Boolean).map((part) => `${part[0]?.toUpperCase() ?? ""}${part.slice(1)}`).join(" ") || provider;
|
|
4246
4417
|
var formatStatus4 = (status) => status.split("-").map((part) => `${part[0]?.toUpperCase() ?? ""}${part.slice(1)}`).join(" ");
|
|
4247
4418
|
var formatLatency = (value) => typeof value === "number" ? `${value}ms` : "No samples";
|
|
@@ -4285,37 +4456,37 @@ var createVoiceProviderStatusViewModel = (snapshot, options = {}) => {
|
|
|
4285
4456
|
const warningCount = providers.filter((provider) => isWarningStatus2(provider.status)).length;
|
|
4286
4457
|
const healthyCount = providers.filter((provider) => provider.status === "healthy").length;
|
|
4287
4458
|
return {
|
|
4288
|
-
description: options.description ??
|
|
4459
|
+
description: options.description ?? DEFAULT_DESCRIPTION11,
|
|
4289
4460
|
error: snapshot.error,
|
|
4290
4461
|
isLoading: snapshot.isLoading,
|
|
4291
4462
|
label: snapshot.error ? "Unavailable" : providers.length ? warningCount > 0 ? `${warningCount} needs attention` : `${healthyCount} healthy` : snapshot.isLoading ? "Checking" : "No provider traffic",
|
|
4292
4463
|
providers,
|
|
4293
4464
|
status: snapshot.error ? "error" : providers.length ? warningCount > 0 ? "warning" : "ready" : snapshot.isLoading ? "loading" : "empty",
|
|
4294
|
-
title: options.title ??
|
|
4465
|
+
title: options.title ?? DEFAULT_TITLE11,
|
|
4295
4466
|
updatedAt: snapshot.updatedAt
|
|
4296
4467
|
};
|
|
4297
4468
|
};
|
|
4298
4469
|
var renderVoiceProviderStatusHTML = (snapshot, options = {}) => {
|
|
4299
4470
|
const model = createVoiceProviderStatusViewModel(snapshot, options);
|
|
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--${
|
|
4471
|
+
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--${escapeHtml13(provider.status)}">
|
|
4301
4472
|
<header>
|
|
4302
|
-
<strong>${
|
|
4303
|
-
<span>${
|
|
4473
|
+
<strong>${escapeHtml13(provider.label)}</strong>
|
|
4474
|
+
<span>${escapeHtml13(formatStatus4(provider.status))}</span>
|
|
4304
4475
|
</header>
|
|
4305
|
-
<p>${
|
|
4476
|
+
<p>${escapeHtml13(provider.detail)}</p>
|
|
4306
4477
|
<dl>${provider.rows.map((row) => `<div>
|
|
4307
|
-
<dt>${
|
|
4308
|
-
<dd>${
|
|
4478
|
+
<dt>${escapeHtml13(row.label)}</dt>
|
|
4479
|
+
<dd>${escapeHtml13(row.value)}</dd>
|
|
4309
4480
|
</div>`).join("")}</dl>
|
|
4310
4481
|
</article>`).join("")}</div>` : '<p class="absolute-voice-provider-status__empty">Run voice traffic to see provider health.</p>';
|
|
4311
|
-
return `<section class="absolute-voice-provider-status absolute-voice-provider-status--${
|
|
4482
|
+
return `<section class="absolute-voice-provider-status absolute-voice-provider-status--${escapeHtml13(model.status)}">
|
|
4312
4483
|
<header class="absolute-voice-provider-status__header">
|
|
4313
|
-
<span class="absolute-voice-provider-status__eyebrow">${
|
|
4314
|
-
<strong class="absolute-voice-provider-status__label">${
|
|
4484
|
+
<span class="absolute-voice-provider-status__eyebrow">${escapeHtml13(model.title)}</span>
|
|
4485
|
+
<strong class="absolute-voice-provider-status__label">${escapeHtml13(model.label)}</strong>
|
|
4315
4486
|
</header>
|
|
4316
|
-
<p class="absolute-voice-provider-status__description">${
|
|
4487
|
+
<p class="absolute-voice-provider-status__description">${escapeHtml13(model.description)}</p>
|
|
4317
4488
|
${providers}
|
|
4318
|
-
${model.error ? `<p class="absolute-voice-provider-status__error">${
|
|
4489
|
+
${model.error ? `<p class="absolute-voice-provider-status__error">${escapeHtml13(model.error)}</p>` : ""}
|
|
4319
4490
|
</section>`;
|
|
4320
4491
|
};
|
|
4321
4492
|
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}`;
|
|
@@ -4357,7 +4528,7 @@ var defineVoiceProviderStatusElement = (tagName = "absolute-voice-provider-statu
|
|
|
4357
4528
|
};
|
|
4358
4529
|
|
|
4359
4530
|
// src/react/VoiceProviderStatus.tsx
|
|
4360
|
-
import { jsxDEV as
|
|
4531
|
+
import { jsxDEV as jsxDEV12 } from "react/jsx-dev-runtime";
|
|
4361
4532
|
var VoiceProviderStatus = ({
|
|
4362
4533
|
className,
|
|
4363
4534
|
path = "/api/provider-status",
|
|
@@ -4365,58 +4536,58 @@ var VoiceProviderStatus = ({
|
|
|
4365
4536
|
}) => {
|
|
4366
4537
|
const snapshot = useVoiceProviderStatus(path, options);
|
|
4367
4538
|
const model = createVoiceProviderStatusViewModel(snapshot, options);
|
|
4368
|
-
return /* @__PURE__ */
|
|
4539
|
+
return /* @__PURE__ */ jsxDEV12("section", {
|
|
4369
4540
|
className: [
|
|
4370
4541
|
"absolute-voice-provider-status",
|
|
4371
4542
|
`absolute-voice-provider-status--${model.status}`,
|
|
4372
4543
|
className
|
|
4373
4544
|
].filter(Boolean).join(" "),
|
|
4374
4545
|
children: [
|
|
4375
|
-
/* @__PURE__ */
|
|
4546
|
+
/* @__PURE__ */ jsxDEV12("header", {
|
|
4376
4547
|
className: "absolute-voice-provider-status__header",
|
|
4377
4548
|
children: [
|
|
4378
|
-
/* @__PURE__ */
|
|
4549
|
+
/* @__PURE__ */ jsxDEV12("span", {
|
|
4379
4550
|
className: "absolute-voice-provider-status__eyebrow",
|
|
4380
4551
|
children: model.title
|
|
4381
4552
|
}, undefined, false, undefined, this),
|
|
4382
|
-
/* @__PURE__ */
|
|
4553
|
+
/* @__PURE__ */ jsxDEV12("strong", {
|
|
4383
4554
|
className: "absolute-voice-provider-status__label",
|
|
4384
4555
|
children: model.label
|
|
4385
4556
|
}, undefined, false, undefined, this)
|
|
4386
4557
|
]
|
|
4387
4558
|
}, undefined, true, undefined, this),
|
|
4388
|
-
/* @__PURE__ */
|
|
4559
|
+
/* @__PURE__ */ jsxDEV12("p", {
|
|
4389
4560
|
className: "absolute-voice-provider-status__description",
|
|
4390
4561
|
children: model.description
|
|
4391
4562
|
}, undefined, false, undefined, this),
|
|
4392
|
-
model.providers.length ? /* @__PURE__ */
|
|
4563
|
+
model.providers.length ? /* @__PURE__ */ jsxDEV12("div", {
|
|
4393
4564
|
className: "absolute-voice-provider-status__providers",
|
|
4394
|
-
children: model.providers.map((provider) => /* @__PURE__ */
|
|
4565
|
+
children: model.providers.map((provider) => /* @__PURE__ */ jsxDEV12("article", {
|
|
4395
4566
|
className: [
|
|
4396
4567
|
"absolute-voice-provider-status__provider",
|
|
4397
4568
|
`absolute-voice-provider-status__provider--${provider.status}`
|
|
4398
4569
|
].join(" "),
|
|
4399
4570
|
children: [
|
|
4400
|
-
/* @__PURE__ */
|
|
4571
|
+
/* @__PURE__ */ jsxDEV12("header", {
|
|
4401
4572
|
children: [
|
|
4402
|
-
/* @__PURE__ */
|
|
4573
|
+
/* @__PURE__ */ jsxDEV12("strong", {
|
|
4403
4574
|
children: provider.label
|
|
4404
4575
|
}, undefined, false, undefined, this),
|
|
4405
|
-
/* @__PURE__ */
|
|
4576
|
+
/* @__PURE__ */ jsxDEV12("span", {
|
|
4406
4577
|
children: provider.status
|
|
4407
4578
|
}, undefined, false, undefined, this)
|
|
4408
4579
|
]
|
|
4409
4580
|
}, undefined, true, undefined, this),
|
|
4410
|
-
/* @__PURE__ */
|
|
4581
|
+
/* @__PURE__ */ jsxDEV12("p", {
|
|
4411
4582
|
children: provider.detail
|
|
4412
4583
|
}, undefined, false, undefined, this),
|
|
4413
|
-
/* @__PURE__ */
|
|
4414
|
-
children: provider.rows.map((row) => /* @__PURE__ */
|
|
4584
|
+
/* @__PURE__ */ jsxDEV12("dl", {
|
|
4585
|
+
children: provider.rows.map((row) => /* @__PURE__ */ jsxDEV12("div", {
|
|
4415
4586
|
children: [
|
|
4416
|
-
/* @__PURE__ */
|
|
4587
|
+
/* @__PURE__ */ jsxDEV12("dt", {
|
|
4417
4588
|
children: row.label
|
|
4418
4589
|
}, undefined, false, undefined, this),
|
|
4419
|
-
/* @__PURE__ */
|
|
4590
|
+
/* @__PURE__ */ jsxDEV12("dd", {
|
|
4420
4591
|
children: row.value
|
|
4421
4592
|
}, undefined, false, undefined, this)
|
|
4422
4593
|
]
|
|
@@ -4424,11 +4595,11 @@ var VoiceProviderStatus = ({
|
|
|
4424
4595
|
}, undefined, false, undefined, this)
|
|
4425
4596
|
]
|
|
4426
4597
|
}, provider.provider, true, undefined, this))
|
|
4427
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
4598
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV12("p", {
|
|
4428
4599
|
className: "absolute-voice-provider-status__empty",
|
|
4429
4600
|
children: "Run voice traffic to see provider health."
|
|
4430
4601
|
}, undefined, false, undefined, this),
|
|
4431
|
-
model.error ? /* @__PURE__ */
|
|
4602
|
+
model.error ? /* @__PURE__ */ jsxDEV12("p", {
|
|
4432
4603
|
className: "absolute-voice-provider-status__error",
|
|
4433
4604
|
children: model.error
|
|
4434
4605
|
}, undefined, false, undefined, this) : null
|
|
@@ -4436,7 +4607,7 @@ var VoiceProviderStatus = ({
|
|
|
4436
4607
|
}, undefined, true, undefined, this);
|
|
4437
4608
|
};
|
|
4438
4609
|
// src/react/useVoiceRoutingStatus.tsx
|
|
4439
|
-
import { useEffect as
|
|
4610
|
+
import { useEffect as useEffect13, useRef as useRef13, useSyncExternalStore as useSyncExternalStore13 } from "react";
|
|
4440
4611
|
|
|
4441
4612
|
// src/client/routingStatus.ts
|
|
4442
4613
|
var fetchVoiceRoutingStatus = async (path = "/api/routing/latest", options = {}) => {
|
|
@@ -4520,25 +4691,25 @@ var createVoiceRoutingStatusStore = (path = "/api/routing/latest", options = {})
|
|
|
4520
4691
|
|
|
4521
4692
|
// src/react/useVoiceRoutingStatus.tsx
|
|
4522
4693
|
var useVoiceRoutingStatus = (path = "/api/routing/latest", options = {}) => {
|
|
4523
|
-
const storeRef =
|
|
4694
|
+
const storeRef = useRef13(null);
|
|
4524
4695
|
if (!storeRef.current) {
|
|
4525
4696
|
storeRef.current = createVoiceRoutingStatusStore(path, options);
|
|
4526
4697
|
}
|
|
4527
4698
|
const store = storeRef.current;
|
|
4528
|
-
|
|
4699
|
+
useEffect13(() => {
|
|
4529
4700
|
store.refresh().catch(() => {});
|
|
4530
4701
|
return () => store.close();
|
|
4531
4702
|
}, [store]);
|
|
4532
4703
|
return {
|
|
4533
|
-
...
|
|
4704
|
+
...useSyncExternalStore13(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
4534
4705
|
refresh: store.refresh
|
|
4535
4706
|
};
|
|
4536
4707
|
};
|
|
4537
4708
|
|
|
4538
4709
|
// src/client/routingStatusWidget.ts
|
|
4539
|
-
var
|
|
4540
|
-
var
|
|
4541
|
-
var
|
|
4710
|
+
var DEFAULT_TITLE12 = "Voice Routing";
|
|
4711
|
+
var DEFAULT_DESCRIPTION12 = "Latest provider routing decision from the self-hosted trace store.";
|
|
4712
|
+
var escapeHtml14 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
4542
4713
|
var formatValue = (value, fallback = "None") => typeof value === "string" && value.trim() ? value : typeof value === "number" && Number.isFinite(value) ? String(value) : fallback;
|
|
4543
4714
|
var formatProviderRoutes2 = (routes) => routes && typeof routes === "object" ? Object.entries(routes).map(([role, provider]) => `${role}: ${formatValue(provider)}`).join(", ") || "None" : "None";
|
|
4544
4715
|
var getProviderRoute = (routes, role) => routes && typeof routes === "object" ? formatValue(routes[role], "Not configured") : "Not configured";
|
|
@@ -4607,35 +4778,35 @@ var createVoiceRoutingStatusViewModel = (snapshot, options = {}) => {
|
|
|
4607
4778
|
return {
|
|
4608
4779
|
activeStack,
|
|
4609
4780
|
decision,
|
|
4610
|
-
description: options.description ??
|
|
4781
|
+
description: options.description ?? DEFAULT_DESCRIPTION12,
|
|
4611
4782
|
error: snapshot.error,
|
|
4612
4783
|
isLoading: snapshot.isLoading,
|
|
4613
4784
|
label: snapshot.error ? "Unavailable" : decision ? `${formatValue(decision.kind).toUpperCase()} ${formatValue(decision.status, "unknown")}` : snapshot.isLoading ? "Checking" : "No routing yet",
|
|
4614
4785
|
rows,
|
|
4615
4786
|
status: snapshot.error ? "error" : decision ? "ready" : snapshot.isLoading ? "loading" : "empty",
|
|
4616
|
-
title: options.title ??
|
|
4787
|
+
title: options.title ?? DEFAULT_TITLE12,
|
|
4617
4788
|
updatedAt: snapshot.updatedAt
|
|
4618
4789
|
};
|
|
4619
4790
|
};
|
|
4620
4791
|
var renderVoiceRoutingStatusHTML = (snapshot, options = {}) => {
|
|
4621
4792
|
const model = createVoiceRoutingStatusViewModel(snapshot, options);
|
|
4622
4793
|
const activeStack = model.activeStack.length ? `<div class="absolute-voice-routing-status__stack" aria-label="Active voice stack">${model.activeStack.map((item) => `<div>
|
|
4623
|
-
<span>${
|
|
4624
|
-
<strong>${
|
|
4794
|
+
<span>${escapeHtml14(item.label)}</span>
|
|
4795
|
+
<strong>${escapeHtml14(item.value)}</strong>
|
|
4625
4796
|
</div>`).join("")}</div>` : "";
|
|
4626
4797
|
const rows = model.rows.length ? `<div class="absolute-voice-routing-status__grid">${model.rows.map((row) => `<div>
|
|
4627
|
-
<span>${
|
|
4628
|
-
<strong>${
|
|
4798
|
+
<span>${escapeHtml14(row.label)}</span>
|
|
4799
|
+
<strong>${escapeHtml14(row.value)}</strong>
|
|
4629
4800
|
</div>`).join("")}</div>` : '<p class="absolute-voice-routing-status__empty">Start a voice session to see the selected provider.</p>';
|
|
4630
|
-
return `<section class="absolute-voice-routing-status absolute-voice-routing-status--${
|
|
4801
|
+
return `<section class="absolute-voice-routing-status absolute-voice-routing-status--${escapeHtml14(model.status)}">
|
|
4631
4802
|
<header class="absolute-voice-routing-status__header">
|
|
4632
|
-
<span class="absolute-voice-routing-status__eyebrow">${
|
|
4633
|
-
<strong class="absolute-voice-routing-status__label">${
|
|
4803
|
+
<span class="absolute-voice-routing-status__eyebrow">${escapeHtml14(model.title)}</span>
|
|
4804
|
+
<strong class="absolute-voice-routing-status__label">${escapeHtml14(model.label)}</strong>
|
|
4634
4805
|
</header>
|
|
4635
|
-
<p class="absolute-voice-routing-status__description">${
|
|
4806
|
+
<p class="absolute-voice-routing-status__description">${escapeHtml14(model.description)}</p>
|
|
4636
4807
|
${activeStack}
|
|
4637
4808
|
${rows}
|
|
4638
|
-
${model.error ? `<p class="absolute-voice-routing-status__error">${
|
|
4809
|
+
${model.error ? `<p class="absolute-voice-routing-status__error">${escapeHtml14(model.error)}</p>` : ""}
|
|
4639
4810
|
</section>`;
|
|
4640
4811
|
};
|
|
4641
4812
|
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}}`;
|
|
@@ -4677,7 +4848,7 @@ var defineVoiceRoutingStatusElement = (tagName = "absolute-voice-routing-status"
|
|
|
4677
4848
|
};
|
|
4678
4849
|
|
|
4679
4850
|
// src/react/VoiceRoutingStatus.tsx
|
|
4680
|
-
import { jsxDEV as
|
|
4851
|
+
import { jsxDEV as jsxDEV13 } from "react/jsx-dev-runtime";
|
|
4681
4852
|
var VoiceRoutingStatus = ({
|
|
4682
4853
|
className,
|
|
4683
4854
|
path = "/api/routing/latest",
|
|
@@ -4685,47 +4856,47 @@ var VoiceRoutingStatus = ({
|
|
|
4685
4856
|
}) => {
|
|
4686
4857
|
const snapshot = useVoiceRoutingStatus(path, options);
|
|
4687
4858
|
const model = createVoiceRoutingStatusViewModel(snapshot, options);
|
|
4688
|
-
return /* @__PURE__ */
|
|
4859
|
+
return /* @__PURE__ */ jsxDEV13("section", {
|
|
4689
4860
|
className: [
|
|
4690
4861
|
"absolute-voice-routing-status",
|
|
4691
4862
|
`absolute-voice-routing-status--${model.status}`,
|
|
4692
4863
|
className
|
|
4693
4864
|
].filter(Boolean).join(" "),
|
|
4694
4865
|
children: [
|
|
4695
|
-
/* @__PURE__ */
|
|
4866
|
+
/* @__PURE__ */ jsxDEV13("header", {
|
|
4696
4867
|
className: "absolute-voice-routing-status__header",
|
|
4697
4868
|
children: [
|
|
4698
|
-
/* @__PURE__ */
|
|
4869
|
+
/* @__PURE__ */ jsxDEV13("span", {
|
|
4699
4870
|
className: "absolute-voice-routing-status__eyebrow",
|
|
4700
4871
|
children: model.title
|
|
4701
4872
|
}, undefined, false, undefined, this),
|
|
4702
|
-
/* @__PURE__ */
|
|
4873
|
+
/* @__PURE__ */ jsxDEV13("strong", {
|
|
4703
4874
|
className: "absolute-voice-routing-status__label",
|
|
4704
4875
|
children: model.label
|
|
4705
4876
|
}, undefined, false, undefined, this)
|
|
4706
4877
|
]
|
|
4707
4878
|
}, undefined, true, undefined, this),
|
|
4708
|
-
/* @__PURE__ */
|
|
4879
|
+
/* @__PURE__ */ jsxDEV13("p", {
|
|
4709
4880
|
className: "absolute-voice-routing-status__description",
|
|
4710
4881
|
children: model.description
|
|
4711
4882
|
}, undefined, false, undefined, this),
|
|
4712
|
-
model.rows.length ? /* @__PURE__ */
|
|
4883
|
+
model.rows.length ? /* @__PURE__ */ jsxDEV13("div", {
|
|
4713
4884
|
className: "absolute-voice-routing-status__grid",
|
|
4714
|
-
children: model.rows.map((row) => /* @__PURE__ */
|
|
4885
|
+
children: model.rows.map((row) => /* @__PURE__ */ jsxDEV13("div", {
|
|
4715
4886
|
children: [
|
|
4716
|
-
/* @__PURE__ */
|
|
4887
|
+
/* @__PURE__ */ jsxDEV13("span", {
|
|
4717
4888
|
children: row.label
|
|
4718
4889
|
}, undefined, false, undefined, this),
|
|
4719
|
-
/* @__PURE__ */
|
|
4890
|
+
/* @__PURE__ */ jsxDEV13("strong", {
|
|
4720
4891
|
children: row.value
|
|
4721
4892
|
}, undefined, false, undefined, this)
|
|
4722
4893
|
]
|
|
4723
4894
|
}, row.label, true, undefined, this))
|
|
4724
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
4895
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV13("p", {
|
|
4725
4896
|
className: "absolute-voice-routing-status__empty",
|
|
4726
4897
|
children: "Start a voice session to see the selected provider."
|
|
4727
4898
|
}, undefined, false, undefined, this),
|
|
4728
|
-
model.error ? /* @__PURE__ */
|
|
4899
|
+
model.error ? /* @__PURE__ */ jsxDEV13("p", {
|
|
4729
4900
|
className: "absolute-voice-routing-status__error",
|
|
4730
4901
|
children: model.error
|
|
4731
4902
|
}, undefined, false, undefined, this) : null
|
|
@@ -4813,9 +4984,9 @@ var createVoiceTraceTimelineStore = (path = "/api/voice-traces", options = {}) =
|
|
|
4813
4984
|
};
|
|
4814
4985
|
|
|
4815
4986
|
// src/client/traceTimelineWidget.ts
|
|
4816
|
-
var
|
|
4817
|
-
var
|
|
4818
|
-
var
|
|
4987
|
+
var DEFAULT_TITLE13 = "Voice Traces";
|
|
4988
|
+
var DEFAULT_DESCRIPTION13 = "Latest call timelines with provider latency, fallbacks, handoffs, and errors from your self-hosted trace store.";
|
|
4989
|
+
var escapeHtml15 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
4819
4990
|
var formatMs3 = (value) => typeof value === "number" ? `${value}ms` : "n/a";
|
|
4820
4991
|
var formatProviders = (session) => session.providers.length ? session.providers.map((provider) => provider.provider).join(", ") : "No providers";
|
|
4821
4992
|
var createVoiceTraceTimelineViewModel = (snapshot, options = {}) => {
|
|
@@ -4831,13 +5002,13 @@ var createVoiceTraceTimelineViewModel = (snapshot, options = {}) => {
|
|
|
4831
5002
|
const failed = sessions.filter((session) => session.status === "failed").length;
|
|
4832
5003
|
const warnings = sessions.filter((session) => session.status === "warning").length;
|
|
4833
5004
|
return {
|
|
4834
|
-
description: options.description ??
|
|
5005
|
+
description: options.description ?? DEFAULT_DESCRIPTION13,
|
|
4835
5006
|
error: snapshot.error,
|
|
4836
5007
|
isLoading: snapshot.isLoading,
|
|
4837
5008
|
label: snapshot.error ? "Unavailable" : failed > 0 ? `${failed} failed` : warnings > 0 ? `${warnings} warning` : sessions.length ? `${sessions.length} recent` : snapshot.isLoading ? "Checking" : "No traces yet",
|
|
4838
5009
|
sessions,
|
|
4839
5010
|
status: snapshot.error ? "error" : failed > 0 ? "failed" : warnings > 0 ? "warning" : sessions.length ? "ready" : snapshot.isLoading ? "loading" : "empty",
|
|
4840
|
-
title: options.title ??
|
|
5011
|
+
title: options.title ?? DEFAULT_TITLE13,
|
|
4841
5012
|
updatedAt: snapshot.updatedAt
|
|
4842
5013
|
};
|
|
4843
5014
|
};
|
|
@@ -4845,27 +5016,27 @@ var renderVoiceTraceTimelineWidgetHTML = (snapshot, options = {}) => {
|
|
|
4845
5016
|
const model = createVoiceTraceTimelineViewModel(snapshot, options);
|
|
4846
5017
|
const sessions = model.sessions.length ? `<div class="absolute-voice-trace-timeline__sessions">${model.sessions.map((session) => {
|
|
4847
5018
|
const supportLinks = [
|
|
4848
|
-
`<a href="${
|
|
4849
|
-
session.operationsRecordHref ? `<a href="${
|
|
4850
|
-
session.incidentBundleHref ? `<a href="${
|
|
5019
|
+
`<a href="${escapeHtml15(session.detailHref)}">Open timeline</a>`,
|
|
5020
|
+
session.operationsRecordHref ? `<a href="${escapeHtml15(session.operationsRecordHref)}">Open operations record</a>` : undefined,
|
|
5021
|
+
session.incidentBundleHref ? `<a href="${escapeHtml15(session.incidentBundleHref)}">Export incident bundle</a>` : undefined
|
|
4851
5022
|
].filter(Boolean).join("");
|
|
4852
|
-
return `<article class="absolute-voice-trace-timeline__session absolute-voice-trace-timeline__session--${
|
|
5023
|
+
return `<article class="absolute-voice-trace-timeline__session absolute-voice-trace-timeline__session--${escapeHtml15(session.status)}">
|
|
4853
5024
|
<header>
|
|
4854
|
-
<strong>${
|
|
4855
|
-
<span>${
|
|
5025
|
+
<strong>${escapeHtml15(session.sessionId)}</strong>
|
|
5026
|
+
<span>${escapeHtml15(session.status)}</span>
|
|
4856
5027
|
</header>
|
|
4857
|
-
<p>${
|
|
5028
|
+
<p>${escapeHtml15(session.label)} \xB7 ${escapeHtml15(session.durationLabel)} \xB7 ${escapeHtml15(session.providerLabel)}</p>
|
|
4858
5029
|
<p class="absolute-voice-trace-timeline__actions">${supportLinks}</p>
|
|
4859
5030
|
</article>`;
|
|
4860
5031
|
}).join("")}</div>` : '<p class="absolute-voice-trace-timeline__empty">Run a voice session to see call timelines.</p>';
|
|
4861
|
-
return `<section class="absolute-voice-trace-timeline absolute-voice-trace-timeline--${
|
|
5032
|
+
return `<section class="absolute-voice-trace-timeline absolute-voice-trace-timeline--${escapeHtml15(model.status)}">
|
|
4862
5033
|
<header class="absolute-voice-trace-timeline__header">
|
|
4863
|
-
<span class="absolute-voice-trace-timeline__eyebrow">${
|
|
4864
|
-
<strong class="absolute-voice-trace-timeline__label">${
|
|
5034
|
+
<span class="absolute-voice-trace-timeline__eyebrow">${escapeHtml15(model.title)}</span>
|
|
5035
|
+
<strong class="absolute-voice-trace-timeline__label">${escapeHtml15(model.label)}</strong>
|
|
4865
5036
|
</header>
|
|
4866
|
-
<p class="absolute-voice-trace-timeline__description">${
|
|
5037
|
+
<p class="absolute-voice-trace-timeline__description">${escapeHtml15(model.description)}</p>
|
|
4867
5038
|
${sessions}
|
|
4868
|
-
${model.error ? `<p class="absolute-voice-trace-timeline__error">${
|
|
5039
|
+
${model.error ? `<p class="absolute-voice-trace-timeline__error">${escapeHtml15(model.error)}</p>` : ""}
|
|
4869
5040
|
</section>`;
|
|
4870
5041
|
};
|
|
4871
5042
|
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}`;
|
|
@@ -4912,25 +5083,25 @@ var defineVoiceTraceTimelineElement = (tagName = "absolute-voice-trace-timeline"
|
|
|
4912
5083
|
};
|
|
4913
5084
|
|
|
4914
5085
|
// src/react/useVoiceTraceTimeline.tsx
|
|
4915
|
-
import { useEffect as
|
|
5086
|
+
import { useEffect as useEffect14, useRef as useRef14, useSyncExternalStore as useSyncExternalStore14 } from "react";
|
|
4916
5087
|
var useVoiceTraceTimeline = (path = "/api/voice-traces", options = {}) => {
|
|
4917
|
-
const storeRef =
|
|
5088
|
+
const storeRef = useRef14(null);
|
|
4918
5089
|
if (!storeRef.current) {
|
|
4919
5090
|
storeRef.current = createVoiceTraceTimelineStore(path, options);
|
|
4920
5091
|
}
|
|
4921
5092
|
const store = storeRef.current;
|
|
4922
|
-
|
|
5093
|
+
useEffect14(() => {
|
|
4923
5094
|
store.refresh().catch(() => {});
|
|
4924
5095
|
return () => store.close();
|
|
4925
5096
|
}, [store]);
|
|
4926
5097
|
return {
|
|
4927
|
-
...
|
|
5098
|
+
...useSyncExternalStore14(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
4928
5099
|
refresh: store.refresh
|
|
4929
5100
|
};
|
|
4930
5101
|
};
|
|
4931
5102
|
|
|
4932
5103
|
// src/react/VoiceTraceTimeline.tsx
|
|
4933
|
-
import { jsxDEV as
|
|
5104
|
+
import { jsxDEV as jsxDEV14 } from "react/jsx-dev-runtime";
|
|
4934
5105
|
var VoiceTraceTimeline = ({
|
|
4935
5106
|
className,
|
|
4936
5107
|
path = "/api/voice-traces",
|
|
@@ -4938,49 +5109,49 @@ var VoiceTraceTimeline = ({
|
|
|
4938
5109
|
}) => {
|
|
4939
5110
|
const snapshot = useVoiceTraceTimeline(path, options);
|
|
4940
5111
|
const model = createVoiceTraceTimelineViewModel(snapshot, options);
|
|
4941
|
-
return /* @__PURE__ */
|
|
5112
|
+
return /* @__PURE__ */ jsxDEV14("section", {
|
|
4942
5113
|
className: [
|
|
4943
5114
|
"absolute-voice-trace-timeline",
|
|
4944
5115
|
`absolute-voice-trace-timeline--${model.status}`,
|
|
4945
5116
|
className
|
|
4946
5117
|
].filter(Boolean).join(" "),
|
|
4947
5118
|
children: [
|
|
4948
|
-
/* @__PURE__ */
|
|
5119
|
+
/* @__PURE__ */ jsxDEV14("header", {
|
|
4949
5120
|
className: "absolute-voice-trace-timeline__header",
|
|
4950
5121
|
children: [
|
|
4951
|
-
/* @__PURE__ */
|
|
5122
|
+
/* @__PURE__ */ jsxDEV14("span", {
|
|
4952
5123
|
className: "absolute-voice-trace-timeline__eyebrow",
|
|
4953
5124
|
children: model.title
|
|
4954
5125
|
}, undefined, false, undefined, this),
|
|
4955
|
-
/* @__PURE__ */
|
|
5126
|
+
/* @__PURE__ */ jsxDEV14("strong", {
|
|
4956
5127
|
className: "absolute-voice-trace-timeline__label",
|
|
4957
5128
|
children: model.label
|
|
4958
5129
|
}, undefined, false, undefined, this)
|
|
4959
5130
|
]
|
|
4960
5131
|
}, undefined, true, undefined, this),
|
|
4961
|
-
/* @__PURE__ */
|
|
5132
|
+
/* @__PURE__ */ jsxDEV14("p", {
|
|
4962
5133
|
className: "absolute-voice-trace-timeline__description",
|
|
4963
5134
|
children: model.description
|
|
4964
5135
|
}, undefined, false, undefined, this),
|
|
4965
|
-
model.sessions.length ? /* @__PURE__ */
|
|
5136
|
+
model.sessions.length ? /* @__PURE__ */ jsxDEV14("div", {
|
|
4966
5137
|
className: "absolute-voice-trace-timeline__sessions",
|
|
4967
|
-
children: model.sessions.map((session) => /* @__PURE__ */
|
|
5138
|
+
children: model.sessions.map((session) => /* @__PURE__ */ jsxDEV14("article", {
|
|
4968
5139
|
className: [
|
|
4969
5140
|
"absolute-voice-trace-timeline__session",
|
|
4970
5141
|
`absolute-voice-trace-timeline__session--${session.status}`
|
|
4971
5142
|
].join(" "),
|
|
4972
5143
|
children: [
|
|
4973
|
-
/* @__PURE__ */
|
|
5144
|
+
/* @__PURE__ */ jsxDEV14("header", {
|
|
4974
5145
|
children: [
|
|
4975
|
-
/* @__PURE__ */
|
|
5146
|
+
/* @__PURE__ */ jsxDEV14("strong", {
|
|
4976
5147
|
children: session.sessionId
|
|
4977
5148
|
}, undefined, false, undefined, this),
|
|
4978
|
-
/* @__PURE__ */
|
|
5149
|
+
/* @__PURE__ */ jsxDEV14("span", {
|
|
4979
5150
|
children: session.status
|
|
4980
5151
|
}, undefined, false, undefined, this)
|
|
4981
5152
|
]
|
|
4982
5153
|
}, undefined, true, undefined, this),
|
|
4983
|
-
/* @__PURE__ */
|
|
5154
|
+
/* @__PURE__ */ jsxDEV14("p", {
|
|
4984
5155
|
children: [
|
|
4985
5156
|
session.label,
|
|
4986
5157
|
" \xB7 ",
|
|
@@ -4990,18 +5161,18 @@ var VoiceTraceTimeline = ({
|
|
|
4990
5161
|
session.providerLabel
|
|
4991
5162
|
]
|
|
4992
5163
|
}, undefined, true, undefined, this),
|
|
4993
|
-
/* @__PURE__ */
|
|
5164
|
+
/* @__PURE__ */ jsxDEV14("p", {
|
|
4994
5165
|
className: "absolute-voice-trace-timeline__actions",
|
|
4995
5166
|
children: [
|
|
4996
|
-
/* @__PURE__ */
|
|
5167
|
+
/* @__PURE__ */ jsxDEV14("a", {
|
|
4997
5168
|
href: session.detailHref,
|
|
4998
5169
|
children: "Open timeline"
|
|
4999
5170
|
}, undefined, false, undefined, this),
|
|
5000
|
-
session.operationsRecordHref ? /* @__PURE__ */
|
|
5171
|
+
session.operationsRecordHref ? /* @__PURE__ */ jsxDEV14("a", {
|
|
5001
5172
|
href: session.operationsRecordHref,
|
|
5002
5173
|
children: "Open operations record"
|
|
5003
5174
|
}, undefined, false, undefined, this) : null,
|
|
5004
|
-
session.incidentBundleHref ? /* @__PURE__ */
|
|
5175
|
+
session.incidentBundleHref ? /* @__PURE__ */ jsxDEV14("a", {
|
|
5005
5176
|
href: session.incidentBundleHref,
|
|
5006
5177
|
children: "Export incident bundle"
|
|
5007
5178
|
}, undefined, false, undefined, this) : null
|
|
@@ -5009,11 +5180,11 @@ var VoiceTraceTimeline = ({
|
|
|
5009
5180
|
}, undefined, true, undefined, this)
|
|
5010
5181
|
]
|
|
5011
5182
|
}, session.sessionId, true, undefined, this))
|
|
5012
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
5183
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV14("p", {
|
|
5013
5184
|
className: "absolute-voice-trace-timeline__empty",
|
|
5014
5185
|
children: "Run a voice session to see call timelines."
|
|
5015
5186
|
}, undefined, false, undefined, this),
|
|
5016
|
-
model.error ? /* @__PURE__ */
|
|
5187
|
+
model.error ? /* @__PURE__ */ jsxDEV14("p", {
|
|
5017
5188
|
className: "absolute-voice-trace-timeline__error",
|
|
5018
5189
|
children: model.error
|
|
5019
5190
|
}, undefined, false, undefined, this) : null
|
|
@@ -5021,7 +5192,7 @@ var VoiceTraceTimeline = ({
|
|
|
5021
5192
|
}, undefined, true, undefined, this);
|
|
5022
5193
|
};
|
|
5023
5194
|
// src/react/useVoiceAgentSquadStatus.tsx
|
|
5024
|
-
import { useEffect as
|
|
5195
|
+
import { useEffect as useEffect15, useRef as useRef15, useSyncExternalStore as useSyncExternalStore15 } from "react";
|
|
5025
5196
|
|
|
5026
5197
|
// src/client/agentSquadStatus.ts
|
|
5027
5198
|
var getString = (value) => typeof value === "string" && value.trim() ? value.trim() : undefined;
|
|
@@ -5099,25 +5270,25 @@ var createVoiceAgentSquadStatusStore = (path = "/api/voice-traces", options = {}
|
|
|
5099
5270
|
|
|
5100
5271
|
// src/react/useVoiceAgentSquadStatus.tsx
|
|
5101
5272
|
var useVoiceAgentSquadStatus = (path = "/api/voice-traces", options = {}) => {
|
|
5102
|
-
const storeRef =
|
|
5273
|
+
const storeRef = useRef15(null);
|
|
5103
5274
|
if (!storeRef.current) {
|
|
5104
5275
|
storeRef.current = createVoiceAgentSquadStatusStore(path, options);
|
|
5105
5276
|
}
|
|
5106
5277
|
const store = storeRef.current;
|
|
5107
|
-
|
|
5278
|
+
useEffect15(() => {
|
|
5108
5279
|
store.refresh().catch(() => {});
|
|
5109
5280
|
return () => store.close();
|
|
5110
5281
|
}, [store]);
|
|
5111
5282
|
return {
|
|
5112
|
-
...
|
|
5283
|
+
...useSyncExternalStore15(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
5113
5284
|
refresh: store.refresh
|
|
5114
5285
|
};
|
|
5115
5286
|
};
|
|
5116
5287
|
|
|
5117
5288
|
// src/client/agentSquadStatusWidget.ts
|
|
5118
|
-
var
|
|
5119
|
-
var
|
|
5120
|
-
var
|
|
5289
|
+
var DEFAULT_TITLE14 = "Voice Agent Squad";
|
|
5290
|
+
var DEFAULT_DESCRIPTION14 = "Current specialist and recent handoffs from your self-hosted voice traces.";
|
|
5291
|
+
var escapeHtml16 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
5121
5292
|
var labelFor = (current) => {
|
|
5122
5293
|
if (!current)
|
|
5123
5294
|
return "Waiting for specialist activity";
|
|
@@ -5131,37 +5302,37 @@ var labelFor = (current) => {
|
|
|
5131
5302
|
};
|
|
5132
5303
|
var createVoiceAgentSquadStatusViewModel = (snapshot, options = {}) => ({
|
|
5133
5304
|
current: snapshot.report.current,
|
|
5134
|
-
description: options.description ??
|
|
5305
|
+
description: options.description ?? DEFAULT_DESCRIPTION14,
|
|
5135
5306
|
error: snapshot.error,
|
|
5136
5307
|
isLoading: snapshot.isLoading,
|
|
5137
5308
|
label: snapshot.error ? "Unavailable" : labelFor(snapshot.report.current),
|
|
5138
5309
|
sessionCount: snapshot.report.sessionCount,
|
|
5139
5310
|
sessions: snapshot.report.sessions,
|
|
5140
|
-
title: options.title ??
|
|
5311
|
+
title: options.title ?? DEFAULT_TITLE14,
|
|
5141
5312
|
updatedAt: snapshot.updatedAt
|
|
5142
5313
|
});
|
|
5143
5314
|
var renderVoiceAgentSquadStatusHTML = (snapshot, options = {}) => {
|
|
5144
5315
|
const model = createVoiceAgentSquadStatusViewModel(snapshot, options);
|
|
5145
5316
|
const current = model.current;
|
|
5146
5317
|
const rows = model.sessions.length ? model.sessions.slice(0, 5).map((session) => `<li>
|
|
5147
|
-
<span>${
|
|
5148
|
-
<strong>${
|
|
5149
|
-
<em>${
|
|
5150
|
-
${session.summary || session.reason ? `<p>${
|
|
5318
|
+
<span>${escapeHtml16(session.sessionId)}</span>
|
|
5319
|
+
<strong>${escapeHtml16(session.targetAgentId ?? "none")}</strong>
|
|
5320
|
+
<em>${escapeHtml16(session.status)}</em>
|
|
5321
|
+
${session.summary || session.reason ? `<p>${escapeHtml16(session.summary ?? session.reason ?? "")}</p>` : ""}
|
|
5151
5322
|
</li>`).join("") : "<li><span>No squad traces yet.</span><strong>Waiting</strong></li>";
|
|
5152
5323
|
return `<section class="absolute-voice-agent-squad-status">
|
|
5153
5324
|
<header>
|
|
5154
|
-
<span>${
|
|
5155
|
-
<strong>${
|
|
5325
|
+
<span>${escapeHtml16(model.title)}</span>
|
|
5326
|
+
<strong>${escapeHtml16(model.label)}</strong>
|
|
5156
5327
|
</header>
|
|
5157
|
-
<p>${
|
|
5328
|
+
<p>${escapeHtml16(model.description)}</p>
|
|
5158
5329
|
<div>
|
|
5159
|
-
<span>Session</span><strong>${
|
|
5160
|
-
<span>From</span><strong>${
|
|
5161
|
-
<span>Status</span><strong>${
|
|
5330
|
+
<span>Session</span><strong>${escapeHtml16(current?.sessionId ?? "n/a")}</strong>
|
|
5331
|
+
<span>From</span><strong>${escapeHtml16(current?.fromAgentId ?? "n/a")}</strong>
|
|
5332
|
+
<span>Status</span><strong>${escapeHtml16(current?.status ?? "idle")}</strong>
|
|
5162
5333
|
</div>
|
|
5163
5334
|
<ul>${rows}</ul>
|
|
5164
|
-
${model.error ? `<p class="absolute-voice-agent-squad-status__error">${
|
|
5335
|
+
${model.error ? `<p class="absolute-voice-agent-squad-status__error">${escapeHtml16(model.error)}</p>` : ""}
|
|
5165
5336
|
</section>`;
|
|
5166
5337
|
};
|
|
5167
5338
|
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}`;
|
|
@@ -5206,7 +5377,7 @@ var defineVoiceAgentSquadStatusElement = (tagName = "absolute-voice-agent-squad-
|
|
|
5206
5377
|
};
|
|
5207
5378
|
|
|
5208
5379
|
// src/react/VoiceAgentSquadStatus.tsx
|
|
5209
|
-
import { jsxDEV as
|
|
5380
|
+
import { jsxDEV as jsxDEV15 } from "react/jsx-dev-runtime";
|
|
5210
5381
|
function VoiceAgentSquadStatus({
|
|
5211
5382
|
path = "/api/voice-traces",
|
|
5212
5383
|
...options
|
|
@@ -5214,64 +5385,64 @@ function VoiceAgentSquadStatus({
|
|
|
5214
5385
|
const snapshot = useVoiceAgentSquadStatus(path, options);
|
|
5215
5386
|
const model = createVoiceAgentSquadStatusViewModel(snapshot, options);
|
|
5216
5387
|
const current = model.current;
|
|
5217
|
-
return /* @__PURE__ */
|
|
5388
|
+
return /* @__PURE__ */ jsxDEV15("section", {
|
|
5218
5389
|
className: "absolute-voice-agent-squad-status",
|
|
5219
5390
|
children: [
|
|
5220
|
-
/* @__PURE__ */
|
|
5391
|
+
/* @__PURE__ */ jsxDEV15("header", {
|
|
5221
5392
|
children: [
|
|
5222
|
-
/* @__PURE__ */
|
|
5393
|
+
/* @__PURE__ */ jsxDEV15("span", {
|
|
5223
5394
|
children: model.title
|
|
5224
5395
|
}, undefined, false, undefined, this),
|
|
5225
|
-
/* @__PURE__ */
|
|
5396
|
+
/* @__PURE__ */ jsxDEV15("strong", {
|
|
5226
5397
|
children: model.label
|
|
5227
5398
|
}, undefined, false, undefined, this)
|
|
5228
5399
|
]
|
|
5229
5400
|
}, undefined, true, undefined, this),
|
|
5230
|
-
/* @__PURE__ */
|
|
5401
|
+
/* @__PURE__ */ jsxDEV15("p", {
|
|
5231
5402
|
children: model.description
|
|
5232
5403
|
}, undefined, false, undefined, this),
|
|
5233
|
-
/* @__PURE__ */
|
|
5404
|
+
/* @__PURE__ */ jsxDEV15("dl", {
|
|
5234
5405
|
children: [
|
|
5235
|
-
/* @__PURE__ */
|
|
5406
|
+
/* @__PURE__ */ jsxDEV15("div", {
|
|
5236
5407
|
children: [
|
|
5237
|
-
/* @__PURE__ */
|
|
5408
|
+
/* @__PURE__ */ jsxDEV15("dt", {
|
|
5238
5409
|
children: "Session"
|
|
5239
5410
|
}, undefined, false, undefined, this),
|
|
5240
|
-
/* @__PURE__ */
|
|
5411
|
+
/* @__PURE__ */ jsxDEV15("dd", {
|
|
5241
5412
|
children: current?.sessionId ?? "n/a"
|
|
5242
5413
|
}, undefined, false, undefined, this)
|
|
5243
5414
|
]
|
|
5244
5415
|
}, undefined, true, undefined, this),
|
|
5245
|
-
/* @__PURE__ */
|
|
5416
|
+
/* @__PURE__ */ jsxDEV15("div", {
|
|
5246
5417
|
children: [
|
|
5247
|
-
/* @__PURE__ */
|
|
5418
|
+
/* @__PURE__ */ jsxDEV15("dt", {
|
|
5248
5419
|
children: "Current specialist"
|
|
5249
5420
|
}, undefined, false, undefined, this),
|
|
5250
|
-
/* @__PURE__ */
|
|
5421
|
+
/* @__PURE__ */ jsxDEV15("dd", {
|
|
5251
5422
|
children: current?.targetAgentId ?? "none"
|
|
5252
5423
|
}, undefined, false, undefined, this)
|
|
5253
5424
|
]
|
|
5254
5425
|
}, undefined, true, undefined, this),
|
|
5255
|
-
/* @__PURE__ */
|
|
5426
|
+
/* @__PURE__ */ jsxDEV15("div", {
|
|
5256
5427
|
children: [
|
|
5257
|
-
/* @__PURE__ */
|
|
5428
|
+
/* @__PURE__ */ jsxDEV15("dt", {
|
|
5258
5429
|
children: "Status"
|
|
5259
5430
|
}, undefined, false, undefined, this),
|
|
5260
|
-
/* @__PURE__ */
|
|
5431
|
+
/* @__PURE__ */ jsxDEV15("dd", {
|
|
5261
5432
|
children: current?.status ?? "idle"
|
|
5262
5433
|
}, undefined, false, undefined, this)
|
|
5263
5434
|
]
|
|
5264
5435
|
}, undefined, true, undefined, this)
|
|
5265
5436
|
]
|
|
5266
5437
|
}, undefined, true, undefined, this),
|
|
5267
|
-
model.error ? /* @__PURE__ */
|
|
5438
|
+
model.error ? /* @__PURE__ */ jsxDEV15("p", {
|
|
5268
5439
|
children: model.error
|
|
5269
5440
|
}, undefined, false, undefined, this) : null
|
|
5270
5441
|
]
|
|
5271
5442
|
}, undefined, true, undefined, this);
|
|
5272
5443
|
}
|
|
5273
5444
|
// src/react/useVoiceTurnLatency.tsx
|
|
5274
|
-
import { useEffect as
|
|
5445
|
+
import { useEffect as useEffect16, useRef as useRef16, useSyncExternalStore as useSyncExternalStore16 } from "react";
|
|
5275
5446
|
|
|
5276
5447
|
// src/client/turnLatency.ts
|
|
5277
5448
|
var fetchVoiceTurnLatency = async (path = "/api/turn-latency", options = {}) => {
|
|
@@ -5378,27 +5549,27 @@ var createVoiceTurnLatencyStore = (path = "/api/turn-latency", options = {}) =>
|
|
|
5378
5549
|
|
|
5379
5550
|
// src/react/useVoiceTurnLatency.tsx
|
|
5380
5551
|
var useVoiceTurnLatency = (path = "/api/turn-latency", options = {}) => {
|
|
5381
|
-
const storeRef =
|
|
5552
|
+
const storeRef = useRef16(null);
|
|
5382
5553
|
if (!storeRef.current) {
|
|
5383
5554
|
storeRef.current = createVoiceTurnLatencyStore(path, options);
|
|
5384
5555
|
}
|
|
5385
5556
|
const store = storeRef.current;
|
|
5386
|
-
|
|
5557
|
+
useEffect16(() => {
|
|
5387
5558
|
store.refresh().catch(() => {});
|
|
5388
5559
|
return () => store.close();
|
|
5389
5560
|
}, [store]);
|
|
5390
5561
|
return {
|
|
5391
|
-
...
|
|
5562
|
+
...useSyncExternalStore16(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
5392
5563
|
refresh: store.refresh,
|
|
5393
5564
|
runProof: store.runProof
|
|
5394
5565
|
};
|
|
5395
5566
|
};
|
|
5396
5567
|
|
|
5397
5568
|
// src/client/turnLatencyWidget.ts
|
|
5398
|
-
var
|
|
5399
|
-
var
|
|
5569
|
+
var DEFAULT_TITLE15 = "Turn Latency";
|
|
5570
|
+
var DEFAULT_DESCRIPTION15 = "Per-turn timing from first transcript to commit and assistant response start.";
|
|
5400
5571
|
var DEFAULT_PROOF_LABEL = "Run latency proof";
|
|
5401
|
-
var
|
|
5572
|
+
var escapeHtml17 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
5402
5573
|
var formatMs4 = (value) => typeof value === "number" ? `${Math.round(value)}ms` : "n/a";
|
|
5403
5574
|
var createVoiceTurnLatencyViewModel = (snapshot, options = {}) => {
|
|
5404
5575
|
const turns = (snapshot.report?.turns ?? []).map((turn) => ({
|
|
@@ -5412,39 +5583,39 @@ var createVoiceTurnLatencyViewModel = (snapshot, options = {}) => {
|
|
|
5412
5583
|
const warningCount = snapshot.report?.warnings ?? turns.filter((turn) => turn.status === "warn").length;
|
|
5413
5584
|
const failedCount = snapshot.report?.failed ?? turns.filter((turn) => turn.status === "fail").length;
|
|
5414
5585
|
return {
|
|
5415
|
-
description: options.description ??
|
|
5586
|
+
description: options.description ?? DEFAULT_DESCRIPTION15,
|
|
5416
5587
|
error: snapshot.error,
|
|
5417
5588
|
isLoading: snapshot.isLoading,
|
|
5418
5589
|
label: snapshot.error ? "Unavailable" : turns.length ? failedCount > 0 ? `${failedCount} slow` : warningCount > 0 ? `${warningCount} warnings` : `avg ${formatMs4(snapshot.report?.averageTotalMs)}` : snapshot.isLoading ? "Checking" : "No turns",
|
|
5419
5590
|
proofLabel: options.proofPath ? options.proofLabel ?? DEFAULT_PROOF_LABEL : undefined,
|
|
5420
5591
|
showProofAction: Boolean(options.proofPath),
|
|
5421
5592
|
status: snapshot.error ? "error" : turns.length ? failedCount > 0 || warningCount > 0 ? "warning" : "ready" : snapshot.isLoading ? "loading" : "empty",
|
|
5422
|
-
title: options.title ??
|
|
5593
|
+
title: options.title ?? DEFAULT_TITLE15,
|
|
5423
5594
|
turns,
|
|
5424
5595
|
updatedAt: snapshot.updatedAt
|
|
5425
5596
|
};
|
|
5426
5597
|
};
|
|
5427
5598
|
var renderVoiceTurnLatencyHTML = (snapshot, options = {}) => {
|
|
5428
5599
|
const model = createVoiceTurnLatencyViewModel(snapshot, options);
|
|
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--${
|
|
5600
|
+
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--${escapeHtml17(turn.status)}">
|
|
5430
5601
|
<header>
|
|
5431
|
-
<strong>${
|
|
5432
|
-
<span>${
|
|
5602
|
+
<strong>${escapeHtml17(turn.label)}</strong>
|
|
5603
|
+
<span>${escapeHtml17(turn.status)}</span>
|
|
5433
5604
|
</header>
|
|
5434
5605
|
<dl>${turn.rows.map((row) => `<div>
|
|
5435
|
-
<dt>${
|
|
5436
|
-
<dd>${
|
|
5606
|
+
<dt>${escapeHtml17(row.label)}</dt>
|
|
5607
|
+
<dd>${escapeHtml17(row.value)}</dd>
|
|
5437
5608
|
</div>`).join("")}</dl>
|
|
5438
5609
|
</article>`).join("")}</div>` : '<p class="absolute-voice-turn-latency__empty">Complete a voice turn to see latency diagnostics.</p>';
|
|
5439
|
-
return `<section class="absolute-voice-turn-latency absolute-voice-turn-latency--${
|
|
5610
|
+
return `<section class="absolute-voice-turn-latency absolute-voice-turn-latency--${escapeHtml17(model.status)}">
|
|
5440
5611
|
<header class="absolute-voice-turn-latency__header">
|
|
5441
|
-
<span class="absolute-voice-turn-latency__eyebrow">${
|
|
5442
|
-
<strong class="absolute-voice-turn-latency__label">${
|
|
5612
|
+
<span class="absolute-voice-turn-latency__eyebrow">${escapeHtml17(model.title)}</span>
|
|
5613
|
+
<strong class="absolute-voice-turn-latency__label">${escapeHtml17(model.label)}</strong>
|
|
5443
5614
|
</header>
|
|
5444
|
-
<p class="absolute-voice-turn-latency__description">${
|
|
5445
|
-
${model.showProofAction ? `<button class="absolute-voice-turn-latency__proof" data-absolute-voice-turn-latency-proof type="button">${
|
|
5615
|
+
<p class="absolute-voice-turn-latency__description">${escapeHtml17(model.description)}</p>
|
|
5616
|
+
${model.showProofAction ? `<button class="absolute-voice-turn-latency__proof" data-absolute-voice-turn-latency-proof type="button">${escapeHtml17(model.proofLabel ?? DEFAULT_PROOF_LABEL)}</button>` : ""}
|
|
5446
5617
|
${turns}
|
|
5447
|
-
${model.error ? `<p class="absolute-voice-turn-latency__error">${
|
|
5618
|
+
${model.error ? `<p class="absolute-voice-turn-latency__error">${escapeHtml17(model.error)}</p>` : ""}
|
|
5448
5619
|
</section>`;
|
|
5449
5620
|
};
|
|
5450
5621
|
var mountVoiceTurnLatency = (element, path = "/api/turn-latency", options = {}) => {
|
|
@@ -5495,7 +5666,7 @@ var defineVoiceTurnLatencyElement = (tagName = "absolute-voice-turn-latency") =>
|
|
|
5495
5666
|
};
|
|
5496
5667
|
|
|
5497
5668
|
// src/react/VoiceTurnLatency.tsx
|
|
5498
|
-
import { jsxDEV as
|
|
5669
|
+
import { jsxDEV as jsxDEV16 } from "react/jsx-dev-runtime";
|
|
5499
5670
|
var VoiceTurnLatency = ({
|
|
5500
5671
|
className,
|
|
5501
5672
|
path = "/api/turn-latency",
|
|
@@ -5503,31 +5674,31 @@ var VoiceTurnLatency = ({
|
|
|
5503
5674
|
}) => {
|
|
5504
5675
|
const latency = useVoiceTurnLatency(path, options);
|
|
5505
5676
|
const model = createVoiceTurnLatencyViewModel(latency, options);
|
|
5506
|
-
return /* @__PURE__ */
|
|
5677
|
+
return /* @__PURE__ */ jsxDEV16("section", {
|
|
5507
5678
|
className: [
|
|
5508
5679
|
"absolute-voice-turn-latency",
|
|
5509
5680
|
`absolute-voice-turn-latency--${model.status}`,
|
|
5510
5681
|
className
|
|
5511
5682
|
].filter(Boolean).join(" "),
|
|
5512
5683
|
children: [
|
|
5513
|
-
/* @__PURE__ */
|
|
5684
|
+
/* @__PURE__ */ jsxDEV16("header", {
|
|
5514
5685
|
className: "absolute-voice-turn-latency__header",
|
|
5515
5686
|
children: [
|
|
5516
|
-
/* @__PURE__ */
|
|
5687
|
+
/* @__PURE__ */ jsxDEV16("span", {
|
|
5517
5688
|
className: "absolute-voice-turn-latency__eyebrow",
|
|
5518
5689
|
children: model.title
|
|
5519
5690
|
}, undefined, false, undefined, this),
|
|
5520
|
-
/* @__PURE__ */
|
|
5691
|
+
/* @__PURE__ */ jsxDEV16("strong", {
|
|
5521
5692
|
className: "absolute-voice-turn-latency__label",
|
|
5522
5693
|
children: model.label
|
|
5523
5694
|
}, undefined, false, undefined, this)
|
|
5524
5695
|
]
|
|
5525
5696
|
}, undefined, true, undefined, this),
|
|
5526
|
-
/* @__PURE__ */
|
|
5697
|
+
/* @__PURE__ */ jsxDEV16("p", {
|
|
5527
5698
|
className: "absolute-voice-turn-latency__description",
|
|
5528
5699
|
children: model.description
|
|
5529
5700
|
}, undefined, false, undefined, this),
|
|
5530
|
-
model.showProofAction ? /* @__PURE__ */
|
|
5701
|
+
model.showProofAction ? /* @__PURE__ */ jsxDEV16("button", {
|
|
5531
5702
|
className: "absolute-voice-turn-latency__proof",
|
|
5532
5703
|
onClick: () => {
|
|
5533
5704
|
latency.runProof().catch(() => {});
|
|
@@ -5535,31 +5706,31 @@ var VoiceTurnLatency = ({
|
|
|
5535
5706
|
type: "button",
|
|
5536
5707
|
children: model.proofLabel
|
|
5537
5708
|
}, undefined, false, undefined, this) : null,
|
|
5538
|
-
model.turns.length ? /* @__PURE__ */
|
|
5709
|
+
model.turns.length ? /* @__PURE__ */ jsxDEV16("div", {
|
|
5539
5710
|
className: "absolute-voice-turn-latency__turns",
|
|
5540
|
-
children: model.turns.map((turn) => /* @__PURE__ */
|
|
5711
|
+
children: model.turns.map((turn) => /* @__PURE__ */ jsxDEV16("article", {
|
|
5541
5712
|
className: [
|
|
5542
5713
|
"absolute-voice-turn-latency__turn",
|
|
5543
5714
|
`absolute-voice-turn-latency__turn--${turn.status}`
|
|
5544
5715
|
].join(" "),
|
|
5545
5716
|
children: [
|
|
5546
|
-
/* @__PURE__ */
|
|
5717
|
+
/* @__PURE__ */ jsxDEV16("header", {
|
|
5547
5718
|
children: [
|
|
5548
|
-
/* @__PURE__ */
|
|
5719
|
+
/* @__PURE__ */ jsxDEV16("strong", {
|
|
5549
5720
|
children: turn.label
|
|
5550
5721
|
}, undefined, false, undefined, this),
|
|
5551
|
-
/* @__PURE__ */
|
|
5722
|
+
/* @__PURE__ */ jsxDEV16("span", {
|
|
5552
5723
|
children: turn.status
|
|
5553
5724
|
}, undefined, false, undefined, this)
|
|
5554
5725
|
]
|
|
5555
5726
|
}, undefined, true, undefined, this),
|
|
5556
|
-
/* @__PURE__ */
|
|
5557
|
-
children: turn.rows.map((row) => /* @__PURE__ */
|
|
5727
|
+
/* @__PURE__ */ jsxDEV16("dl", {
|
|
5728
|
+
children: turn.rows.map((row) => /* @__PURE__ */ jsxDEV16("div", {
|
|
5558
5729
|
children: [
|
|
5559
|
-
/* @__PURE__ */
|
|
5730
|
+
/* @__PURE__ */ jsxDEV16("dt", {
|
|
5560
5731
|
children: row.label
|
|
5561
5732
|
}, undefined, false, undefined, this),
|
|
5562
|
-
/* @__PURE__ */
|
|
5733
|
+
/* @__PURE__ */ jsxDEV16("dd", {
|
|
5563
5734
|
children: row.value
|
|
5564
5735
|
}, undefined, false, undefined, this)
|
|
5565
5736
|
]
|
|
@@ -5567,11 +5738,11 @@ var VoiceTurnLatency = ({
|
|
|
5567
5738
|
}, undefined, false, undefined, this)
|
|
5568
5739
|
]
|
|
5569
5740
|
}, `${turn.sessionId}:${turn.turnId}`, true, undefined, this))
|
|
5570
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
5741
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV16("p", {
|
|
5571
5742
|
className: "absolute-voice-turn-latency__empty",
|
|
5572
5743
|
children: "Complete a voice turn to see latency diagnostics."
|
|
5573
5744
|
}, undefined, false, undefined, this),
|
|
5574
|
-
model.error ? /* @__PURE__ */
|
|
5745
|
+
model.error ? /* @__PURE__ */ jsxDEV16("p", {
|
|
5575
5746
|
className: "absolute-voice-turn-latency__error",
|
|
5576
5747
|
children: model.error
|
|
5577
5748
|
}, undefined, false, undefined, this) : null
|
|
@@ -5579,7 +5750,7 @@ var VoiceTurnLatency = ({
|
|
|
5579
5750
|
}, undefined, true, undefined, this);
|
|
5580
5751
|
};
|
|
5581
5752
|
// src/react/useVoiceTurnQuality.tsx
|
|
5582
|
-
import { useEffect as
|
|
5753
|
+
import { useEffect as useEffect17, useRef as useRef17, useSyncExternalStore as useSyncExternalStore17 } from "react";
|
|
5583
5754
|
|
|
5584
5755
|
// src/client/turnQuality.ts
|
|
5585
5756
|
var fetchVoiceTurnQuality = async (path = "/api/turn-quality", options = {}) => {
|
|
@@ -5662,25 +5833,25 @@ var createVoiceTurnQualityStore = (path = "/api/turn-quality", options = {}) =>
|
|
|
5662
5833
|
|
|
5663
5834
|
// src/react/useVoiceTurnQuality.tsx
|
|
5664
5835
|
var useVoiceTurnQuality = (path = "/api/turn-quality", options = {}) => {
|
|
5665
|
-
const storeRef =
|
|
5836
|
+
const storeRef = useRef17(null);
|
|
5666
5837
|
if (!storeRef.current) {
|
|
5667
5838
|
storeRef.current = createVoiceTurnQualityStore(path, options);
|
|
5668
5839
|
}
|
|
5669
5840
|
const store = storeRef.current;
|
|
5670
|
-
|
|
5841
|
+
useEffect17(() => {
|
|
5671
5842
|
store.refresh().catch(() => {});
|
|
5672
5843
|
return () => store.close();
|
|
5673
5844
|
}, [store]);
|
|
5674
5845
|
return {
|
|
5675
|
-
...
|
|
5846
|
+
...useSyncExternalStore17(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
5676
5847
|
refresh: store.refresh
|
|
5677
5848
|
};
|
|
5678
5849
|
};
|
|
5679
5850
|
|
|
5680
5851
|
// src/client/turnQualityWidget.ts
|
|
5681
|
-
var
|
|
5682
|
-
var
|
|
5683
|
-
var
|
|
5852
|
+
var DEFAULT_TITLE16 = "Turn Quality";
|
|
5853
|
+
var DEFAULT_DESCRIPTION16 = "Per-turn STT confidence, fallback selection, corrections, and transcript coverage.";
|
|
5854
|
+
var escapeHtml18 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
5684
5855
|
var formatConfidence = (value) => typeof value === "number" ? `${Math.round(value * 100)}%` : "n/a";
|
|
5685
5856
|
var formatMaybe = (value) => value === undefined || value === "" ? "n/a" : String(value);
|
|
5686
5857
|
var getTurnDetail = (turn) => {
|
|
@@ -5718,37 +5889,37 @@ var createVoiceTurnQualityViewModel = (snapshot, options = {}) => {
|
|
|
5718
5889
|
const warningCount = snapshot.report?.warnings ?? turns.filter((turn) => turn.status === "warn").length;
|
|
5719
5890
|
const failedCount = snapshot.report?.failed ?? turns.filter((turn) => turn.status === "fail").length;
|
|
5720
5891
|
return {
|
|
5721
|
-
description: options.description ??
|
|
5892
|
+
description: options.description ?? DEFAULT_DESCRIPTION16,
|
|
5722
5893
|
error: snapshot.error,
|
|
5723
5894
|
isLoading: snapshot.isLoading,
|
|
5724
5895
|
label: snapshot.error ? "Unavailable" : turns.length ? failedCount > 0 ? `${failedCount} failed` : warningCount > 0 ? `${warningCount} warnings` : `${turns.length} healthy` : snapshot.isLoading ? "Checking" : "No turns",
|
|
5725
5896
|
status: snapshot.error ? "error" : turns.length ? failedCount > 0 || warningCount > 0 ? "warning" : "ready" : snapshot.isLoading ? "loading" : "empty",
|
|
5726
|
-
title: options.title ??
|
|
5897
|
+
title: options.title ?? DEFAULT_TITLE16,
|
|
5727
5898
|
turns,
|
|
5728
5899
|
updatedAt: snapshot.updatedAt
|
|
5729
5900
|
};
|
|
5730
5901
|
};
|
|
5731
5902
|
var renderVoiceTurnQualityHTML = (snapshot, options = {}) => {
|
|
5732
5903
|
const model = createVoiceTurnQualityViewModel(snapshot, options);
|
|
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--${
|
|
5904
|
+
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--${escapeHtml18(turn.status)}">
|
|
5734
5905
|
<header>
|
|
5735
|
-
<strong>${
|
|
5736
|
-
<span>${
|
|
5906
|
+
<strong>${escapeHtml18(turn.label)}</strong>
|
|
5907
|
+
<span>${escapeHtml18(turn.status)}</span>
|
|
5737
5908
|
</header>
|
|
5738
|
-
<p>${
|
|
5909
|
+
<p>${escapeHtml18(turn.detail)}</p>
|
|
5739
5910
|
<dl>${turn.rows.map((row) => `<div>
|
|
5740
|
-
<dt>${
|
|
5741
|
-
<dd>${
|
|
5911
|
+
<dt>${escapeHtml18(row.label)}</dt>
|
|
5912
|
+
<dd>${escapeHtml18(row.value)}</dd>
|
|
5742
5913
|
</div>`).join("")}</dl>
|
|
5743
5914
|
</article>`).join("")}</div>` : '<p class="absolute-voice-turn-quality__empty">Complete a voice turn to see STT quality diagnostics.</p>';
|
|
5744
|
-
return `<section class="absolute-voice-turn-quality absolute-voice-turn-quality--${
|
|
5915
|
+
return `<section class="absolute-voice-turn-quality absolute-voice-turn-quality--${escapeHtml18(model.status)}">
|
|
5745
5916
|
<header class="absolute-voice-turn-quality__header">
|
|
5746
|
-
<span class="absolute-voice-turn-quality__eyebrow">${
|
|
5747
|
-
<strong class="absolute-voice-turn-quality__label">${
|
|
5917
|
+
<span class="absolute-voice-turn-quality__eyebrow">${escapeHtml18(model.title)}</span>
|
|
5918
|
+
<strong class="absolute-voice-turn-quality__label">${escapeHtml18(model.label)}</strong>
|
|
5748
5919
|
</header>
|
|
5749
|
-
<p class="absolute-voice-turn-quality__description">${
|
|
5920
|
+
<p class="absolute-voice-turn-quality__description">${escapeHtml18(model.description)}</p>
|
|
5750
5921
|
${turns}
|
|
5751
|
-
${model.error ? `<p class="absolute-voice-turn-quality__error">${
|
|
5922
|
+
${model.error ? `<p class="absolute-voice-turn-quality__error">${escapeHtml18(model.error)}</p>` : ""}
|
|
5752
5923
|
</section>`;
|
|
5753
5924
|
};
|
|
5754
5925
|
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}`;
|
|
@@ -5790,7 +5961,7 @@ var defineVoiceTurnQualityElement = (tagName = "absolute-voice-turn-quality") =>
|
|
|
5790
5961
|
};
|
|
5791
5962
|
|
|
5792
5963
|
// src/react/VoiceTurnQuality.tsx
|
|
5793
|
-
import { jsxDEV as
|
|
5964
|
+
import { jsxDEV as jsxDEV17 } from "react/jsx-dev-runtime";
|
|
5794
5965
|
var VoiceTurnQuality = ({
|
|
5795
5966
|
className,
|
|
5796
5967
|
path = "/api/turn-quality",
|
|
@@ -5798,58 +5969,58 @@ var VoiceTurnQuality = ({
|
|
|
5798
5969
|
}) => {
|
|
5799
5970
|
const snapshot = useVoiceTurnQuality(path, options);
|
|
5800
5971
|
const model = createVoiceTurnQualityViewModel(snapshot, options);
|
|
5801
|
-
return /* @__PURE__ */
|
|
5972
|
+
return /* @__PURE__ */ jsxDEV17("section", {
|
|
5802
5973
|
className: [
|
|
5803
5974
|
"absolute-voice-turn-quality",
|
|
5804
5975
|
`absolute-voice-turn-quality--${model.status}`,
|
|
5805
5976
|
className
|
|
5806
5977
|
].filter(Boolean).join(" "),
|
|
5807
5978
|
children: [
|
|
5808
|
-
/* @__PURE__ */
|
|
5979
|
+
/* @__PURE__ */ jsxDEV17("header", {
|
|
5809
5980
|
className: "absolute-voice-turn-quality__header",
|
|
5810
5981
|
children: [
|
|
5811
|
-
/* @__PURE__ */
|
|
5982
|
+
/* @__PURE__ */ jsxDEV17("span", {
|
|
5812
5983
|
className: "absolute-voice-turn-quality__eyebrow",
|
|
5813
5984
|
children: model.title
|
|
5814
5985
|
}, undefined, false, undefined, this),
|
|
5815
|
-
/* @__PURE__ */
|
|
5986
|
+
/* @__PURE__ */ jsxDEV17("strong", {
|
|
5816
5987
|
className: "absolute-voice-turn-quality__label",
|
|
5817
5988
|
children: model.label
|
|
5818
5989
|
}, undefined, false, undefined, this)
|
|
5819
5990
|
]
|
|
5820
5991
|
}, undefined, true, undefined, this),
|
|
5821
|
-
/* @__PURE__ */
|
|
5992
|
+
/* @__PURE__ */ jsxDEV17("p", {
|
|
5822
5993
|
className: "absolute-voice-turn-quality__description",
|
|
5823
5994
|
children: model.description
|
|
5824
5995
|
}, undefined, false, undefined, this),
|
|
5825
|
-
model.turns.length ? /* @__PURE__ */
|
|
5996
|
+
model.turns.length ? /* @__PURE__ */ jsxDEV17("div", {
|
|
5826
5997
|
className: "absolute-voice-turn-quality__turns",
|
|
5827
|
-
children: model.turns.map((turn) => /* @__PURE__ */
|
|
5998
|
+
children: model.turns.map((turn) => /* @__PURE__ */ jsxDEV17("article", {
|
|
5828
5999
|
className: [
|
|
5829
6000
|
"absolute-voice-turn-quality__turn",
|
|
5830
6001
|
`absolute-voice-turn-quality__turn--${turn.status}`
|
|
5831
6002
|
].join(" "),
|
|
5832
6003
|
children: [
|
|
5833
|
-
/* @__PURE__ */
|
|
6004
|
+
/* @__PURE__ */ jsxDEV17("header", {
|
|
5834
6005
|
children: [
|
|
5835
|
-
/* @__PURE__ */
|
|
6006
|
+
/* @__PURE__ */ jsxDEV17("strong", {
|
|
5836
6007
|
children: turn.label
|
|
5837
6008
|
}, undefined, false, undefined, this),
|
|
5838
|
-
/* @__PURE__ */
|
|
6009
|
+
/* @__PURE__ */ jsxDEV17("span", {
|
|
5839
6010
|
children: turn.status
|
|
5840
6011
|
}, undefined, false, undefined, this)
|
|
5841
6012
|
]
|
|
5842
6013
|
}, undefined, true, undefined, this),
|
|
5843
|
-
/* @__PURE__ */
|
|
6014
|
+
/* @__PURE__ */ jsxDEV17("p", {
|
|
5844
6015
|
children: turn.detail
|
|
5845
6016
|
}, undefined, false, undefined, this),
|
|
5846
|
-
/* @__PURE__ */
|
|
5847
|
-
children: turn.rows.map((row) => /* @__PURE__ */
|
|
6017
|
+
/* @__PURE__ */ jsxDEV17("dl", {
|
|
6018
|
+
children: turn.rows.map((row) => /* @__PURE__ */ jsxDEV17("div", {
|
|
5848
6019
|
children: [
|
|
5849
|
-
/* @__PURE__ */
|
|
6020
|
+
/* @__PURE__ */ jsxDEV17("dt", {
|
|
5850
6021
|
children: row.label
|
|
5851
6022
|
}, undefined, false, undefined, this),
|
|
5852
|
-
/* @__PURE__ */
|
|
6023
|
+
/* @__PURE__ */ jsxDEV17("dd", {
|
|
5853
6024
|
children: row.value
|
|
5854
6025
|
}, undefined, false, undefined, this)
|
|
5855
6026
|
]
|
|
@@ -5857,11 +6028,11 @@ var VoiceTurnQuality = ({
|
|
|
5857
6028
|
}, undefined, false, undefined, this)
|
|
5858
6029
|
]
|
|
5859
6030
|
}, `${turn.sessionId}:${turn.turnId}`, true, undefined, this))
|
|
5860
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
6031
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV17("p", {
|
|
5861
6032
|
className: "absolute-voice-turn-quality__empty",
|
|
5862
6033
|
children: "Complete a voice turn to see STT quality diagnostics."
|
|
5863
6034
|
}, undefined, false, undefined, this),
|
|
5864
|
-
model.error ? /* @__PURE__ */
|
|
6035
|
+
model.error ? /* @__PURE__ */ jsxDEV17("p", {
|
|
5865
6036
|
className: "absolute-voice-turn-quality__error",
|
|
5866
6037
|
children: model.error
|
|
5867
6038
|
}, undefined, false, undefined, this) : null
|
|
@@ -5869,7 +6040,7 @@ var VoiceTurnQuality = ({
|
|
|
5869
6040
|
}, undefined, true, undefined, this);
|
|
5870
6041
|
};
|
|
5871
6042
|
// src/react/useVoiceLiveOps.tsx
|
|
5872
|
-
import { useEffect as
|
|
6043
|
+
import { useEffect as useEffect18, useRef as useRef18, useSyncExternalStore as useSyncExternalStore18 } from "react";
|
|
5873
6044
|
|
|
5874
6045
|
// src/client/liveOps.ts
|
|
5875
6046
|
var postVoiceLiveOpsAction = async (input, options = {}) => {
|
|
@@ -5959,19 +6130,19 @@ var createVoiceLiveOpsStore = (options = {}) => {
|
|
|
5959
6130
|
|
|
5960
6131
|
// src/react/useVoiceLiveOps.tsx
|
|
5961
6132
|
var useVoiceLiveOps = (options = {}) => {
|
|
5962
|
-
const storeRef =
|
|
6133
|
+
const storeRef = useRef18(null);
|
|
5963
6134
|
if (!storeRef.current) {
|
|
5964
6135
|
storeRef.current = createVoiceLiveOpsStore(options);
|
|
5965
6136
|
}
|
|
5966
6137
|
const store = storeRef.current;
|
|
5967
|
-
|
|
6138
|
+
useEffect18(() => () => store.close(), [store]);
|
|
5968
6139
|
return {
|
|
5969
|
-
...
|
|
6140
|
+
...useSyncExternalStore18(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
5970
6141
|
run: store.run
|
|
5971
6142
|
};
|
|
5972
6143
|
};
|
|
5973
6144
|
// src/react/useVoiceCampaignDialerProof.tsx
|
|
5974
|
-
import { useEffect as
|
|
6145
|
+
import { useEffect as useEffect19, useRef as useRef19, useSyncExternalStore as useSyncExternalStore19 } from "react";
|
|
5975
6146
|
|
|
5976
6147
|
// src/client/campaignDialerProof.ts
|
|
5977
6148
|
var fetchVoiceCampaignDialerProofStatus = async (path = "/api/voice/campaigns/dialer-proof", options = {}) => {
|
|
@@ -6093,23 +6264,23 @@ var createVoiceCampaignDialerProofStore = (path = "/api/voice/campaigns/dialer-p
|
|
|
6093
6264
|
|
|
6094
6265
|
// src/react/useVoiceCampaignDialerProof.tsx
|
|
6095
6266
|
var useVoiceCampaignDialerProof = (path = "/api/voice/campaigns/dialer-proof", options = {}) => {
|
|
6096
|
-
const storeRef =
|
|
6267
|
+
const storeRef = useRef19(null);
|
|
6097
6268
|
if (!storeRef.current) {
|
|
6098
6269
|
storeRef.current = createVoiceCampaignDialerProofStore(path, options);
|
|
6099
6270
|
}
|
|
6100
6271
|
const store = storeRef.current;
|
|
6101
|
-
|
|
6272
|
+
useEffect19(() => {
|
|
6102
6273
|
store.refresh().catch(() => {});
|
|
6103
6274
|
return () => store.close();
|
|
6104
6275
|
}, [store]);
|
|
6105
6276
|
return {
|
|
6106
|
-
...
|
|
6277
|
+
...useSyncExternalStore19(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
6107
6278
|
refresh: store.refresh,
|
|
6108
6279
|
runProof: store.runProof
|
|
6109
6280
|
};
|
|
6110
6281
|
};
|
|
6111
6282
|
// src/react/useVoiceStream.tsx
|
|
6112
|
-
import { useEffect as
|
|
6283
|
+
import { useEffect as useEffect20, useRef as useRef20, useSyncExternalStore as useSyncExternalStore20 } from "react";
|
|
6113
6284
|
|
|
6114
6285
|
// src/client/actions.ts
|
|
6115
6286
|
var normalizeErrorMessage = (value) => {
|
|
@@ -7511,13 +7682,13 @@ var EMPTY_SNAPSHOT = {
|
|
|
7511
7682
|
turns: []
|
|
7512
7683
|
};
|
|
7513
7684
|
var useVoiceStream = (path, options = {}) => {
|
|
7514
|
-
const streamRef =
|
|
7685
|
+
const streamRef = useRef20(null);
|
|
7515
7686
|
if (!streamRef.current) {
|
|
7516
7687
|
streamRef.current = createVoiceStream(path, options);
|
|
7517
7688
|
}
|
|
7518
7689
|
const stream = streamRef.current;
|
|
7519
|
-
|
|
7520
|
-
const snapshot =
|
|
7690
|
+
useEffect20(() => () => stream.close(), [stream]);
|
|
7691
|
+
const snapshot = useSyncExternalStore20(stream.subscribe, stream.getSnapshot, stream.getServerSnapshot) ?? EMPTY_SNAPSHOT;
|
|
7521
7692
|
return {
|
|
7522
7693
|
...snapshot,
|
|
7523
7694
|
callControl: (message) => stream.callControl(message),
|
|
@@ -7527,7 +7698,7 @@ var useVoiceStream = (path, options = {}) => {
|
|
|
7527
7698
|
};
|
|
7528
7699
|
};
|
|
7529
7700
|
// src/react/useVoiceController.tsx
|
|
7530
|
-
import { useEffect as
|
|
7701
|
+
import { useEffect as useEffect21, useRef as useRef21, useSyncExternalStore as useSyncExternalStore21 } from "react";
|
|
7531
7702
|
|
|
7532
7703
|
// src/client/htmx.ts
|
|
7533
7704
|
var DEFAULT_EVENT_NAME = "voice-refresh";
|
|
@@ -8190,13 +8361,13 @@ var EMPTY_SNAPSHOT2 = {
|
|
|
8190
8361
|
turns: []
|
|
8191
8362
|
};
|
|
8192
8363
|
var useVoiceController = (path, options = {}) => {
|
|
8193
|
-
const controllerRef =
|
|
8364
|
+
const controllerRef = useRef21(null);
|
|
8194
8365
|
if (!controllerRef.current) {
|
|
8195
8366
|
controllerRef.current = createVoiceController(path, options);
|
|
8196
8367
|
}
|
|
8197
8368
|
const controller = controllerRef.current;
|
|
8198
|
-
|
|
8199
|
-
const snapshot =
|
|
8369
|
+
useEffect21(() => () => controller.close(), [controller]);
|
|
8370
|
+
const snapshot = useSyncExternalStore21(controller.subscribe, controller.getSnapshot, controller.getServerSnapshot) ?? EMPTY_SNAPSHOT2;
|
|
8200
8371
|
return {
|
|
8201
8372
|
...snapshot,
|
|
8202
8373
|
bindHTMX: controller.bindHTMX,
|
|
@@ -8210,7 +8381,7 @@ var useVoiceController = (path, options = {}) => {
|
|
|
8210
8381
|
};
|
|
8211
8382
|
};
|
|
8212
8383
|
// src/react/useVoiceWorkflowStatus.tsx
|
|
8213
|
-
import { useEffect as
|
|
8384
|
+
import { useEffect as useEffect22, useRef as useRef22, useSyncExternalStore as useSyncExternalStore22 } from "react";
|
|
8214
8385
|
|
|
8215
8386
|
// src/client/workflowStatus.ts
|
|
8216
8387
|
var fetchVoiceWorkflowStatus = async (path = "/evals/scenarios/json", options = {}) => {
|
|
@@ -8293,17 +8464,17 @@ var createVoiceWorkflowStatusStore = (path = "/evals/scenarios/json", options =
|
|
|
8293
8464
|
|
|
8294
8465
|
// src/react/useVoiceWorkflowStatus.tsx
|
|
8295
8466
|
var useVoiceWorkflowStatus = (path = "/evals/scenarios/json", options = {}) => {
|
|
8296
|
-
const storeRef =
|
|
8467
|
+
const storeRef = useRef22(null);
|
|
8297
8468
|
if (!storeRef.current) {
|
|
8298
8469
|
storeRef.current = createVoiceWorkflowStatusStore(path, options);
|
|
8299
8470
|
}
|
|
8300
8471
|
const store = storeRef.current;
|
|
8301
|
-
|
|
8472
|
+
useEffect22(() => {
|
|
8302
8473
|
store.refresh().catch(() => {});
|
|
8303
8474
|
return () => store.close();
|
|
8304
8475
|
}, [store]);
|
|
8305
8476
|
return {
|
|
8306
|
-
...
|
|
8477
|
+
...useSyncExternalStore22(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
8307
8478
|
refresh: store.refresh
|
|
8308
8479
|
};
|
|
8309
8480
|
};
|
|
@@ -8320,6 +8491,7 @@ export {
|
|
|
8320
8491
|
useVoiceProviderContracts,
|
|
8321
8492
|
useVoiceProviderCapabilities,
|
|
8322
8493
|
useVoiceProofTrends,
|
|
8494
|
+
useVoiceProfileSwitchRecommendation,
|
|
8323
8495
|
useVoiceProfileComparison,
|
|
8324
8496
|
useVoicePlatformCoverage,
|
|
8325
8497
|
useVoiceOpsStatus,
|
|
@@ -8339,6 +8511,7 @@ export {
|
|
|
8339
8511
|
VoiceProviderContracts,
|
|
8340
8512
|
VoiceProviderCapabilities,
|
|
8341
8513
|
VoiceProofTrends,
|
|
8514
|
+
VoiceProfileSwitchRecommendation,
|
|
8342
8515
|
VoiceProfileComparison,
|
|
8343
8516
|
VoicePlatformCoverage,
|
|
8344
8517
|
VoiceOpsStatus,
|