@absolutejs/voice 0.0.22-beta.453 → 0.0.22-beta.455
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/angular/index.d.ts +1 -0
- package/dist/angular/index.js +345 -224
- package/dist/angular/voice-reconnect-profile-evidence.service.d.ts +12 -0
- package/dist/client/index.d.ts +4 -0
- package/dist/client/index.js +659 -240
- package/dist/client/reconnectProfileEvidence.d.ts +19 -0
- package/dist/client/reconnectProfileEvidenceWidget.d.ts +39 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +224 -0
- package/dist/proofTrends.d.ts +103 -0
- package/dist/react/VoiceReconnectProfileEvidence.d.ts +6 -0
- package/dist/react/index.d.ts +2 -0
- package/dist/react/index.js +1035 -526
- package/dist/react/useVoiceReconnectProfileEvidence.d.ts +8 -0
- package/dist/svelte/createVoiceReconnectProfileEvidence.d.ts +7 -0
- package/dist/svelte/index.d.ts +1 -0
- package/dist/svelte/index.js +86 -0
- package/dist/vue/VoiceReconnectProfileEvidence.d.ts +21 -0
- package/dist/vue/index.d.ts +2 -0
- package/dist/vue/index.js +941 -438
- package/dist/vue/useVoiceReconnectProfileEvidence.d.ts +9 -0
- package/package.json +1 -1
package/dist/react/index.js
CHANGED
|
@@ -3414,6 +3414,33 @@ var maxNumber = (values) => {
|
|
|
3414
3414
|
const finite = values.filter((value) => typeof value === "number" && Number.isFinite(value));
|
|
3415
3415
|
return finite.length > 0 ? Math.max(...finite) : undefined;
|
|
3416
3416
|
};
|
|
3417
|
+
var buildVoiceReconnectProfileEvidenceSummary = (evidence, options = {}) => {
|
|
3418
|
+
const profileId = options.profileId ?? "reconnect-resume";
|
|
3419
|
+
const filtered = evidence.filter((record) => record.profileId === profileId).sort((left, right) => {
|
|
3420
|
+
const leftAt = Date.parse(left.generatedAt ?? left.createdAt);
|
|
3421
|
+
const rightAt = Date.parse(right.generatedAt ?? right.createdAt);
|
|
3422
|
+
return (Number.isFinite(rightAt) ? rightAt : 0) - (Number.isFinite(leftAt) ? leftAt : 0);
|
|
3423
|
+
});
|
|
3424
|
+
const latest = filtered[0];
|
|
3425
|
+
const sampleCount = filtered.reduce((total, record) => total + (record.reconnect?.samples ?? 1), 0);
|
|
3426
|
+
const snapshotCount = filtered.reduce((total, record) => total + (record.reconnect?.snapshotCount ?? 0), 0);
|
|
3427
|
+
const resumeLatencyP95Ms = maxNumber(filtered.map((record) => record.reconnect?.resumeLatencyP95Ms));
|
|
3428
|
+
const failed = filtered.some((record) => record.ok === false || record.reconnect?.status === "fail");
|
|
3429
|
+
const passed = filtered.some((record) => record.ok === true && record.reconnect?.resumed === true && record.reconnect?.reconnected === true);
|
|
3430
|
+
const status = filtered.length === 0 ? "empty" : failed ? "fail" : passed ? "pass" : "warn";
|
|
3431
|
+
return {
|
|
3432
|
+
evidence: filtered,
|
|
3433
|
+
generatedAt: options.generatedAt ?? new Date().toISOString(),
|
|
3434
|
+
latest,
|
|
3435
|
+
ok: status === "pass",
|
|
3436
|
+
profileId,
|
|
3437
|
+
resumeLatencyP95Ms,
|
|
3438
|
+
sampleCount,
|
|
3439
|
+
snapshotCount,
|
|
3440
|
+
sourceHref: options.sourceHref,
|
|
3441
|
+
status
|
|
3442
|
+
};
|
|
3443
|
+
};
|
|
3417
3444
|
var percentile = (values, rank) => {
|
|
3418
3445
|
const finite = values.filter((value) => Number.isFinite(value)).sort((left, right) => left - right);
|
|
3419
3446
|
if (finite.length === 0) {
|
|
@@ -3734,6 +3761,133 @@ var buildVoiceRealCallProfileEvidenceFromReconnectProofReports = (input, options
|
|
|
3734
3761
|
};
|
|
3735
3762
|
var loadVoiceRealCallProfileEvidenceFromTraceStore = async (options) => buildVoiceRealCallProfileEvidenceFromTraceEvents(await options.store.list({ limit: options.limit ?? 5000 }), options);
|
|
3736
3763
|
var loadVoiceRealCallProfileEvidenceFromStore = async (options) => options.store.list(options);
|
|
3764
|
+
var readRealCallEvidenceRuntimeKey = (evidence) => [evidence.profileId, evidence.sessionId, evidence.generatedAt ?? ""].join("\x00");
|
|
3765
|
+
var resolveRealCallEvidenceRuntimeReconnectReports = async (reports, options) => {
|
|
3766
|
+
const resolved = typeof reports === "function" ? await reports(options) : reports;
|
|
3767
|
+
if (!resolved) {
|
|
3768
|
+
return [];
|
|
3769
|
+
}
|
|
3770
|
+
return Array.isArray(resolved) ? resolved : [resolved];
|
|
3771
|
+
};
|
|
3772
|
+
var mergeRealCallEvidenceRuntimeOptions = (base, override = {}) => ({
|
|
3773
|
+
dedupe: override.dedupe ?? base.dedupe,
|
|
3774
|
+
evidenceStore: override.evidenceStore ?? base.evidenceStore,
|
|
3775
|
+
existingEvidenceLimit: override.existingEvidenceLimit ?? base.existingEvidenceLimit,
|
|
3776
|
+
history: {
|
|
3777
|
+
...base.history ?? {},
|
|
3778
|
+
...override.history ?? {}
|
|
3779
|
+
},
|
|
3780
|
+
now: override.now ?? base.now,
|
|
3781
|
+
reconnectEvidence: {
|
|
3782
|
+
...base.reconnectEvidence ?? {},
|
|
3783
|
+
...override.reconnectEvidence ?? {}
|
|
3784
|
+
},
|
|
3785
|
+
reconnectReports: override.reconnectReports ?? base.reconnectReports,
|
|
3786
|
+
traceEvidence: mergeRealCallProfileCollectorOptions(base.traceEvidence ?? {}, override.traceEvidence ?? {}),
|
|
3787
|
+
traceStore: override.traceStore ?? base.traceStore
|
|
3788
|
+
});
|
|
3789
|
+
var buildRealCallEvidenceRuntimeReport = async (options, input = {}) => {
|
|
3790
|
+
const evidence = await options.evidenceStore.list({
|
|
3791
|
+
limit: options.existingEvidenceLimit ?? 5000
|
|
3792
|
+
});
|
|
3793
|
+
const history = await buildVoiceRealCallProfileHistoryReportFromStore({
|
|
3794
|
+
...options.history ?? {},
|
|
3795
|
+
limit: options.existingEvidenceLimit ?? 5000,
|
|
3796
|
+
store: options.evidenceStore
|
|
3797
|
+
});
|
|
3798
|
+
const generatedAt = (options.now ?? (() => new Date))().toISOString();
|
|
3799
|
+
const sessions = new Set(evidence.map((record) => record.sessionId)).size;
|
|
3800
|
+
const failedProfiles = history.summary.profiles?.filter((profile) => profile.status === "fail").length;
|
|
3801
|
+
const issues = [
|
|
3802
|
+
...evidence.length === 0 ? ["No real-call profile evidence has been collected yet."] : [],
|
|
3803
|
+
...history.issues
|
|
3804
|
+
];
|
|
3805
|
+
const status = evidence.length === 0 ? "empty" : issues.length > 0 ? history.status === "pass" ? "fail" : history.status : history.status;
|
|
3806
|
+
return {
|
|
3807
|
+
appended: input.appended ?? 0,
|
|
3808
|
+
collected: input.collected ?? [],
|
|
3809
|
+
duplicateKeys: input.duplicateKeys ?? [],
|
|
3810
|
+
evidence,
|
|
3811
|
+
generatedAt,
|
|
3812
|
+
history,
|
|
3813
|
+
issues,
|
|
3814
|
+
ok: status === "pass" && issues.length === 0,
|
|
3815
|
+
skippedDuplicates: input.skippedDuplicates ?? 0,
|
|
3816
|
+
source: "real-call-evidence-runtime",
|
|
3817
|
+
status,
|
|
3818
|
+
summary: {
|
|
3819
|
+
collectedEvidence: input.collected?.length ?? 0,
|
|
3820
|
+
failedProfiles: failedProfiles ?? 0,
|
|
3821
|
+
profiles: history.summary.profileCount,
|
|
3822
|
+
sessions,
|
|
3823
|
+
storedEvidence: evidence.length
|
|
3824
|
+
}
|
|
3825
|
+
};
|
|
3826
|
+
};
|
|
3827
|
+
var collectVoiceRealCallEvidenceRuntimeEvidence = async (options) => {
|
|
3828
|
+
const evidence = [];
|
|
3829
|
+
if (options.traceStore) {
|
|
3830
|
+
evidence.push(...buildVoiceRealCallProfileEvidenceFromTraceEvents(await options.traceStore.list({
|
|
3831
|
+
limit: options.traceEvidence?.limit ?? 5000
|
|
3832
|
+
}), options.traceEvidence));
|
|
3833
|
+
}
|
|
3834
|
+
const reconnectReports = await resolveRealCallEvidenceRuntimeReconnectReports(options.reconnectReports, options);
|
|
3835
|
+
if (reconnectReports.length > 0) {
|
|
3836
|
+
evidence.push(...buildVoiceRealCallProfileEvidenceFromReconnectProofReports(reconnectReports, options.reconnectEvidence));
|
|
3837
|
+
}
|
|
3838
|
+
return evidence;
|
|
3839
|
+
};
|
|
3840
|
+
var createVoiceRealCallEvidenceRuntime = (options) => {
|
|
3841
|
+
const appendEvidence = async (evidenceInput, collectOptions = {}) => {
|
|
3842
|
+
const merged = mergeRealCallEvidenceRuntimeOptions(options, collectOptions);
|
|
3843
|
+
const evidence = Array.isArray(evidenceInput) ? [...evidenceInput] : [evidenceInput];
|
|
3844
|
+
const dedupe = merged.dedupe ?? true;
|
|
3845
|
+
const existing = dedupe ? await merged.evidenceStore.list({
|
|
3846
|
+
limit: merged.existingEvidenceLimit ?? 5000
|
|
3847
|
+
}) : [];
|
|
3848
|
+
const seen = new Set(existing.map(readRealCallEvidenceRuntimeKey));
|
|
3849
|
+
const incomingSeen = new Set;
|
|
3850
|
+
const duplicateKeys = [];
|
|
3851
|
+
let appended = 0;
|
|
3852
|
+
for (const item of evidence) {
|
|
3853
|
+
const key = readRealCallEvidenceRuntimeKey(item);
|
|
3854
|
+
if (dedupe && (seen.has(key) || incomingSeen.has(key))) {
|
|
3855
|
+
duplicateKeys.push(key);
|
|
3856
|
+
continue;
|
|
3857
|
+
}
|
|
3858
|
+
incomingSeen.add(key);
|
|
3859
|
+
await merged.evidenceStore.append(item);
|
|
3860
|
+
appended += 1;
|
|
3861
|
+
}
|
|
3862
|
+
return buildRealCallEvidenceRuntimeReport(merged, {
|
|
3863
|
+
appended,
|
|
3864
|
+
collected: evidence,
|
|
3865
|
+
duplicateKeys,
|
|
3866
|
+
skippedDuplicates: duplicateKeys.length
|
|
3867
|
+
});
|
|
3868
|
+
};
|
|
3869
|
+
return {
|
|
3870
|
+
appendEvidence,
|
|
3871
|
+
buildHistoryReport: async (historyOptions = {}) => buildVoiceRealCallProfileHistoryReportFromStore({
|
|
3872
|
+
...options.history ?? {},
|
|
3873
|
+
...historyOptions,
|
|
3874
|
+
limit: historyOptions.limit ?? options.existingEvidenceLimit ?? 5000,
|
|
3875
|
+
store: options.evidenceStore
|
|
3876
|
+
}),
|
|
3877
|
+
buildReport: async (collectOptions = {}) => buildRealCallEvidenceRuntimeReport(mergeRealCallEvidenceRuntimeOptions(options, collectOptions)),
|
|
3878
|
+
collect: async (collectOptions = {}) => {
|
|
3879
|
+
const merged = mergeRealCallEvidenceRuntimeOptions(options, collectOptions);
|
|
3880
|
+
const evidence = await collectVoiceRealCallEvidenceRuntimeEvidence(merged);
|
|
3881
|
+
return appendEvidence(evidence, {
|
|
3882
|
+
dedupe: merged.dedupe
|
|
3883
|
+
});
|
|
3884
|
+
},
|
|
3885
|
+
listEvidence: async (listOptions = {}) => await options.evidenceStore.list({
|
|
3886
|
+
limit: options.existingEvidenceLimit ?? 5000,
|
|
3887
|
+
...listOptions
|
|
3888
|
+
})
|
|
3889
|
+
};
|
|
3890
|
+
};
|
|
3737
3891
|
var realCallProfileTraceSignalTypes = new Set([
|
|
3738
3892
|
"client.barge_in",
|
|
3739
3893
|
"client.browser_media",
|
|
@@ -5320,6 +5474,31 @@ var renderVoiceRealCallProfileHistoryHTML = (report, title = "Voice Real-Call Pr
|
|
|
5320
5474
|
const issues = report.issues.length === 0 ? "<li>None</li>" : report.issues.map((issue) => `<li>${escapeHtml9(issue)}</li>`).join("");
|
|
5321
5475
|
return `<!doctype html><html lang="en"><head><meta charset="utf-8" /><meta name="viewport" content="width=device-width,initial-scale=1" /><title>${escapeHtml9(title)}</title><style>body{background:#111510;color:#f6f0dd;font-family:ui-sans-serif,system-ui,sans-serif;margin:0}main{margin:auto;max-width:1120px;padding:32px}.hero,article,.card{background:#182117;border:1px solid #32412d;border-radius:24px;margin-bottom:16px;padding:22px}.hero{background:linear-gradient(135deg,rgba(132,204,22,.16),rgba(20,184,166,.12))}.eyebrow{color:#bef264;font-weight:900;letter-spacing:.1em;text-transform:uppercase}h1{font-size:clamp(2.2rem,6vw,4.7rem);letter-spacing:-.06em;line-height:.92;margin:.2rem 0 1rem}.summary{display:flex;flex-wrap:wrap;gap:10px}.pill{border:1px solid #52624b;border-radius:999px;padding:8px 12px}.pass{border-color:rgba(34,197,94,.55)}.warn{border-color:rgba(245,158,11,.7)}.fail{border-color:rgba(239,68,68,.75)}table{border-collapse:collapse;width:100%}td,th{border-bottom:1px solid #32412d;padding:10px;text-align:left}</style></head><body><main><section class="hero"><p class="eyebrow">Real-call benchmark history</p><h1>${escapeHtml9(title)}</h1><p>Generated ${escapeHtml9(report.generatedAt)} from ${escapeHtml9(report.source)}.</p><div class="summary"><span class="pill">Status ${escapeHtml9(report.status)}</span><span class="pill">Reports ${String(report.reports)}</span><span class="pill">Profiles ${String(report.summary.profileCount)}</span><span class="pill">Defaults ${String(report.defaults.summary.actionableProfiles)}/${String(report.defaults.summary.profileCount)}</span><span class="pill">Cycles ${String(report.summary.cycles ?? 0)}</span><span class="pill">Best mix ${escapeHtml9(formatProviderMix(report.recommendations.bestProviders))}</span></div></section><section class="card"><h2>Profiles</h2><table><thead><tr><th>Profile</th><th>Status</th><th>Live p95</th><th>Provider p95</th><th>Turn p95</th><th>Provider mix</th></tr></thead><tbody>${profileRows}</tbody></table></section><section class="card"><h2>Actionable Defaults</h2><table><thead><tr><th>Profile</th><th>Status</th><th>Provider routes</th><th>Live budget</th><th>Provider budget</th><th>Turn budget</th></tr></thead><tbody>${defaultRows}</tbody></table></section>${recommendations}<section class="card"><h2>Issues</h2><ul>${issues}</ul></section></main></body></html>`;
|
|
5322
5476
|
};
|
|
5477
|
+
var renderVoiceRealCallEvidenceRuntimeMarkdown = (report, title = "Voice Real-Call Evidence Runtime") => [
|
|
5478
|
+
`# ${title}`,
|
|
5479
|
+
"",
|
|
5480
|
+
`- Status: ${report.status}`,
|
|
5481
|
+
`- Stored evidence: ${String(report.summary.storedEvidence)}`,
|
|
5482
|
+
`- Collected evidence: ${String(report.summary.collectedEvidence)}`,
|
|
5483
|
+
`- Appended: ${String(report.appended)}`,
|
|
5484
|
+
`- Skipped duplicates: ${String(report.skippedDuplicates)}`,
|
|
5485
|
+
`- Sessions: ${String(report.summary.sessions)}`,
|
|
5486
|
+
`- Profiles: ${String(report.summary.profiles)}`,
|
|
5487
|
+
"",
|
|
5488
|
+
"## Rolling Profile History",
|
|
5489
|
+
"",
|
|
5490
|
+
renderVoiceRealCallProfileHistoryMarkdown(report.history, "Rolling Real-Call Profile History"),
|
|
5491
|
+
"",
|
|
5492
|
+
"## Issues",
|
|
5493
|
+
"",
|
|
5494
|
+
...report.issues.length ? report.issues.map((issue) => `- ${issue}`) : ["- None"]
|
|
5495
|
+
].join(`
|
|
5496
|
+
`);
|
|
5497
|
+
var renderVoiceRealCallEvidenceRuntimeHTML = (report, title = "Voice Real-Call Evidence Runtime") => {
|
|
5498
|
+
const issueItems = report.issues.length === 0 ? "<li>None</li>" : report.issues.map((issue) => `<li>${escapeHtml9(issue)}</li>`).join("");
|
|
5499
|
+
const profileRows = report.history.summary.profiles?.length ? report.history.summary.profiles.map((profile) => `<tr><td>${escapeHtml9(profile.label ?? profile.id)}</td><td>${escapeHtml9(profile.status ?? "unknown")}</td><td>${escapeHtml9(profile.sessionCount ?? "n/a")}</td><td>${escapeHtml9(profile.maxLiveP95Ms ?? "n/a")}</td><td>${escapeHtml9(profile.maxProviderP95Ms ?? "n/a")}</td><td>${escapeHtml9(formatProviderMix(profile.providers ?? []))}</td></tr>`).join("") : '<tr><td colspan="6">No profile history has been collected yet.</td></tr>';
|
|
5500
|
+
return `<!doctype html><html lang="en"><head><meta charset="utf-8" /><meta name="viewport" content="width=device-width,initial-scale=1" /><title>${escapeHtml9(title)}</title><style>body{background:#0f1618;color:#f2f7f2;font-family:ui-sans-serif,system-ui,sans-serif;margin:0}main{margin:auto;max-width:1120px;padding:32px}.hero,.card{background:#162225;border:1px solid #2f4548;border-radius:24px;margin-bottom:16px;padding:22px}.hero{background:linear-gradient(135deg,rgba(20,184,166,.18),rgba(132,204,22,.1))}.eyebrow{color:#99f6e4;font-weight:900;letter-spacing:.1em;text-transform:uppercase}h1{font-size:clamp(2.1rem,6vw,4.3rem);letter-spacing:-.06em;line-height:.94;margin:.2rem 0 1rem}.summary{display:flex;flex-wrap:wrap;gap:10px}.pill{border:1px solid #4b6669;border-radius:999px;padding:8px 12px}.pass{border-color:rgba(34,197,94,.55)}.warn{border-color:rgba(245,158,11,.7)}.fail,.empty,.stale{border-color:rgba(239,68,68,.75)}table{border-collapse:collapse;width:100%}td,th{border-bottom:1px solid #2f4548;padding:10px;text-align:left}</style></head><body><main><section class="hero"><p class="eyebrow">Real-call evidence runtime</p><h1>${escapeHtml9(title)}</h1><p>Generated ${escapeHtml9(report.generatedAt)} from ${escapeHtml9(report.source)}.</p><div class="summary"><span class="pill ${escapeHtml9(report.status)}">Status ${escapeHtml9(report.status)}</span><span class="pill">Stored ${String(report.summary.storedEvidence)}</span><span class="pill">Collected ${String(report.summary.collectedEvidence)}</span><span class="pill">Appended ${String(report.appended)}</span><span class="pill">Duplicates ${String(report.skippedDuplicates)}</span><span class="pill">Sessions ${String(report.summary.sessions)}</span><span class="pill">Profiles ${String(report.summary.profiles)}</span></div></section><section class="card"><h2>Rolling Profile History</h2><table><thead><tr><th>Profile</th><th>Status</th><th>Sessions</th><th>Live p95</th><th>Provider p95</th><th>Provider mix</th></tr></thead><tbody>${profileRows}</tbody></table></section><section class="card"><h2>Issues</h2><ul>${issueItems}</ul></section></main></body></html>`;
|
|
5501
|
+
};
|
|
5323
5502
|
var createVoiceProofTrendRecommendationRoutes = (options) => {
|
|
5324
5503
|
const path = options.path ?? "/api/voice/proof-trend-recommendations";
|
|
5325
5504
|
const htmlPath = options.htmlPath === undefined ? "/voice/proof-trend-recommendations" : options.htmlPath;
|
|
@@ -5403,6 +5582,46 @@ var createVoiceRealCallProfileHistoryRoutes = (options = {}) => {
|
|
|
5403
5582
|
}
|
|
5404
5583
|
return routes;
|
|
5405
5584
|
};
|
|
5585
|
+
var createVoiceRealCallEvidenceRuntimeRoutes = (options) => {
|
|
5586
|
+
const path = options.jsonPath ?? "/api/voice/real-call-evidence-runtime";
|
|
5587
|
+
const collectPath = options.collectPath === undefined ? `${path}/collect` : options.collectPath;
|
|
5588
|
+
const htmlPath = options.htmlPath === undefined ? "/voice/real-call-evidence-runtime" : options.htmlPath;
|
|
5589
|
+
const markdownPath = options.markdownPath === undefined ? "/voice/real-call-evidence-runtime.md" : options.markdownPath;
|
|
5590
|
+
const title = options.title ?? "Voice Real-Call Evidence Runtime";
|
|
5591
|
+
const runtime = options.runtime ?? createVoiceRealCallEvidenceRuntime({
|
|
5592
|
+
...options
|
|
5593
|
+
});
|
|
5594
|
+
const routes = new Elysia4({
|
|
5595
|
+
name: options.name ?? "absolutejs-voice-real-call-evidence-runtime"
|
|
5596
|
+
});
|
|
5597
|
+
routes.get(path, async () => Response.json(await runtime.buildReport(), { headers: options.headers }));
|
|
5598
|
+
if (collectPath !== false) {
|
|
5599
|
+
routes.post(collectPath, async () => Response.json(await runtime.collect(), { headers: options.headers }));
|
|
5600
|
+
}
|
|
5601
|
+
if (htmlPath !== false) {
|
|
5602
|
+
routes.get(htmlPath, async () => {
|
|
5603
|
+
const report = await runtime.buildReport();
|
|
5604
|
+
return new Response(renderVoiceRealCallEvidenceRuntimeHTML(report, title), {
|
|
5605
|
+
headers: {
|
|
5606
|
+
"content-type": "text/html; charset=utf-8",
|
|
5607
|
+
...Object.fromEntries(new Headers(options.headers))
|
|
5608
|
+
}
|
|
5609
|
+
});
|
|
5610
|
+
});
|
|
5611
|
+
}
|
|
5612
|
+
if (markdownPath !== false) {
|
|
5613
|
+
routes.get(markdownPath, async () => {
|
|
5614
|
+
const report = await runtime.buildReport();
|
|
5615
|
+
return new Response(renderVoiceRealCallEvidenceRuntimeMarkdown(report, title), {
|
|
5616
|
+
headers: {
|
|
5617
|
+
"content-type": "text/markdown; charset=utf-8",
|
|
5618
|
+
...Object.fromEntries(new Headers(options.headers))
|
|
5619
|
+
}
|
|
5620
|
+
});
|
|
5621
|
+
});
|
|
5622
|
+
}
|
|
5623
|
+
return routes;
|
|
5624
|
+
};
|
|
5406
5625
|
var realCallProfileActionPaths = {
|
|
5407
5626
|
"collect-browser-proof": "/collect-browser-proof",
|
|
5408
5627
|
"collect-phone-proof": "/collect-phone-proof",
|
|
@@ -5801,6 +6020,294 @@ var VoiceProofTrends = ({
|
|
|
5801
6020
|
]
|
|
5802
6021
|
}, undefined, true, undefined, this);
|
|
5803
6022
|
};
|
|
6023
|
+
// src/client/reconnectProfileEvidence.ts
|
|
6024
|
+
var fetchVoiceReconnectProfileEvidence = async (path = "/api/voice/reconnect-profile-evidence", options = {}) => {
|
|
6025
|
+
const fetchImpl = options.fetch ?? globalThis.fetch;
|
|
6026
|
+
const response = await fetchImpl(path);
|
|
6027
|
+
if (!response.ok) {
|
|
6028
|
+
throw new Error(`Voice reconnect profile evidence failed: HTTP ${response.status}`);
|
|
6029
|
+
}
|
|
6030
|
+
return await response.json();
|
|
6031
|
+
};
|
|
6032
|
+
var createVoiceReconnectProfileEvidenceStore = (path = "/api/voice/reconnect-profile-evidence", options = {}) => {
|
|
6033
|
+
const listeners = new Set;
|
|
6034
|
+
let closed = false;
|
|
6035
|
+
let timer;
|
|
6036
|
+
let snapshot = {
|
|
6037
|
+
error: null,
|
|
6038
|
+
isLoading: false
|
|
6039
|
+
};
|
|
6040
|
+
const emit = () => {
|
|
6041
|
+
for (const listener of listeners) {
|
|
6042
|
+
listener();
|
|
6043
|
+
}
|
|
6044
|
+
};
|
|
6045
|
+
const refresh = async () => {
|
|
6046
|
+
if (closed) {
|
|
6047
|
+
return snapshot.report;
|
|
6048
|
+
}
|
|
6049
|
+
snapshot = { ...snapshot, error: null, isLoading: true };
|
|
6050
|
+
emit();
|
|
6051
|
+
try {
|
|
6052
|
+
const report = await fetchVoiceReconnectProfileEvidence(path, options);
|
|
6053
|
+
snapshot = {
|
|
6054
|
+
error: null,
|
|
6055
|
+
isLoading: false,
|
|
6056
|
+
report,
|
|
6057
|
+
updatedAt: Date.now()
|
|
6058
|
+
};
|
|
6059
|
+
emit();
|
|
6060
|
+
return report;
|
|
6061
|
+
} catch (error) {
|
|
6062
|
+
snapshot = {
|
|
6063
|
+
...snapshot,
|
|
6064
|
+
error: error instanceof Error ? error.message : String(error),
|
|
6065
|
+
isLoading: false
|
|
6066
|
+
};
|
|
6067
|
+
emit();
|
|
6068
|
+
throw error;
|
|
6069
|
+
}
|
|
6070
|
+
};
|
|
6071
|
+
const close = () => {
|
|
6072
|
+
closed = true;
|
|
6073
|
+
if (timer) {
|
|
6074
|
+
clearInterval(timer);
|
|
6075
|
+
timer = undefined;
|
|
6076
|
+
}
|
|
6077
|
+
listeners.clear();
|
|
6078
|
+
};
|
|
6079
|
+
if (typeof window !== "undefined" && options.intervalMs && options.intervalMs > 0) {
|
|
6080
|
+
timer = setInterval(() => {
|
|
6081
|
+
refresh().catch(() => {});
|
|
6082
|
+
}, options.intervalMs);
|
|
6083
|
+
}
|
|
6084
|
+
return {
|
|
6085
|
+
close,
|
|
6086
|
+
getServerSnapshot: () => snapshot,
|
|
6087
|
+
getSnapshot: () => snapshot,
|
|
6088
|
+
refresh,
|
|
6089
|
+
subscribe: (listener) => {
|
|
6090
|
+
listeners.add(listener);
|
|
6091
|
+
return () => {
|
|
6092
|
+
listeners.delete(listener);
|
|
6093
|
+
};
|
|
6094
|
+
}
|
|
6095
|
+
};
|
|
6096
|
+
};
|
|
6097
|
+
|
|
6098
|
+
// src/client/reconnectProfileEvidenceWidget.ts
|
|
6099
|
+
var DEFAULT_TITLE6 = "Persisted Reconnect Evidence";
|
|
6100
|
+
var DEFAULT_DESCRIPTION6 = "Real browser reconnect/resume evidence persisted into profile history so recovery claims are backed by durable traces.";
|
|
6101
|
+
var DEFAULT_LINKS3 = [
|
|
6102
|
+
{ href: "/voice/reconnect-contract", label: "Reconnect contract" },
|
|
6103
|
+
{
|
|
6104
|
+
href: "/api/voice/real-call-profile-history",
|
|
6105
|
+
label: "Profile history JSON"
|
|
6106
|
+
}
|
|
6107
|
+
];
|
|
6108
|
+
var escapeHtml11 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
6109
|
+
var formatMs2 = (value) => typeof value === "number" && Number.isFinite(value) ? `${Math.round(value)}ms` : "n/a";
|
|
6110
|
+
var formatCount = (value) => new Intl.NumberFormat("en-US").format(value);
|
|
6111
|
+
var formatAge = (value) => {
|
|
6112
|
+
if (!value) {
|
|
6113
|
+
return "No evidence";
|
|
6114
|
+
}
|
|
6115
|
+
const elapsedMs = Date.now() - Date.parse(value);
|
|
6116
|
+
if (!Number.isFinite(elapsedMs) || elapsedMs < 0) {
|
|
6117
|
+
return "Just now";
|
|
6118
|
+
}
|
|
6119
|
+
const minutes = Math.floor(elapsedMs / 60000);
|
|
6120
|
+
if (minutes < 1) {
|
|
6121
|
+
return "Just now";
|
|
6122
|
+
}
|
|
6123
|
+
if (minutes < 60) {
|
|
6124
|
+
return `${minutes}m ago`;
|
|
6125
|
+
}
|
|
6126
|
+
const hours = Math.floor(minutes / 60);
|
|
6127
|
+
if (hours < 24) {
|
|
6128
|
+
return `${hours}h ago`;
|
|
6129
|
+
}
|
|
6130
|
+
return `${Math.floor(hours / 24)}d ago`;
|
|
6131
|
+
};
|
|
6132
|
+
var createVoiceReconnectProfileEvidenceViewModel = (snapshot, options = {}) => {
|
|
6133
|
+
const report = snapshot.report;
|
|
6134
|
+
const latest = report?.latest;
|
|
6135
|
+
const latestAt = latest?.generatedAt ?? latest?.createdAt;
|
|
6136
|
+
return {
|
|
6137
|
+
description: options.description ?? latest?.profileDescription ?? DEFAULT_DESCRIPTION6,
|
|
6138
|
+
error: snapshot.error,
|
|
6139
|
+
isLoading: snapshot.isLoading,
|
|
6140
|
+
label: snapshot.error ? "Unavailable" : report ? report.status === "pass" ? "Reconnect evidence passing" : report.status === "warn" ? "Reconnect evidence incomplete" : report.status === "fail" ? "Reconnect evidence failing" : "Waiting for reconnect evidence" : snapshot.isLoading ? "Checking" : "No reconnect evidence",
|
|
6141
|
+
latest: latest ? {
|
|
6142
|
+
profileLabel: latest.profileLabel ?? latest.profileId,
|
|
6143
|
+
sessionId: latest.sessionId,
|
|
6144
|
+
surfaces: (latest.surfaces ?? []).join(", ") || "browser"
|
|
6145
|
+
} : undefined,
|
|
6146
|
+
links: options.links ?? DEFAULT_LINKS3,
|
|
6147
|
+
metrics: [
|
|
6148
|
+
{ label: "Samples", value: formatCount(report?.sampleCount ?? 0) },
|
|
6149
|
+
{ label: "Snapshots", value: formatCount(report?.snapshotCount ?? 0) },
|
|
6150
|
+
{
|
|
6151
|
+
label: "Resume p95",
|
|
6152
|
+
value: formatMs2(report?.resumeLatencyP95Ms ?? latest?.reconnect?.resumeLatencyP95Ms)
|
|
6153
|
+
},
|
|
6154
|
+
{ label: "Last proof", value: formatAge(latestAt) }
|
|
6155
|
+
],
|
|
6156
|
+
status: snapshot.error ? "error" : report ? report.status === "pass" ? "ready" : report.status === "empty" ? "empty" : "warning" : snapshot.isLoading ? "loading" : "empty",
|
|
6157
|
+
title: options.title ?? DEFAULT_TITLE6
|
|
6158
|
+
};
|
|
6159
|
+
};
|
|
6160
|
+
var renderVoiceReconnectProfileEvidenceHTML = (snapshot, options = {}) => {
|
|
6161
|
+
const model = createVoiceReconnectProfileEvidenceViewModel(snapshot, options);
|
|
6162
|
+
const metrics = `<div class="absolute-voice-reconnect-evidence__metrics">${model.metrics.map((metric) => `<article>
|
|
6163
|
+
<span>${escapeHtml11(metric.label)}</span>
|
|
6164
|
+
<strong>${escapeHtml11(metric.value)}</strong>
|
|
6165
|
+
</article>`).join("")}</div>`;
|
|
6166
|
+
const latest = model.latest ? `<p class="absolute-voice-reconnect-evidence__latest">Latest ${escapeHtml11(model.latest.profileLabel)} \xB7 ${escapeHtml11(model.latest.sessionId)} \xB7 ${escapeHtml11(model.latest.surfaces)}</p>` : `<p class="absolute-voice-reconnect-evidence__empty">No persisted reconnect profile evidence yet.</p>`;
|
|
6167
|
+
const links = model.links.length ? `<p class="absolute-voice-reconnect-evidence__links">${model.links.map((link) => `<a href="${escapeHtml11(link.href)}">${escapeHtml11(link.label)}</a>`).join("")}</p>` : "";
|
|
6168
|
+
return `<section class="absolute-voice-reconnect-evidence absolute-voice-reconnect-evidence--${escapeHtml11(model.status)}">
|
|
6169
|
+
<header class="absolute-voice-reconnect-evidence__header">
|
|
6170
|
+
<span class="absolute-voice-reconnect-evidence__eyebrow">${escapeHtml11(model.title)}</span>
|
|
6171
|
+
<strong class="absolute-voice-reconnect-evidence__label">${escapeHtml11(model.label)}</strong>
|
|
6172
|
+
</header>
|
|
6173
|
+
<p class="absolute-voice-reconnect-evidence__description">${escapeHtml11(model.description)}</p>
|
|
6174
|
+
${metrics}
|
|
6175
|
+
${latest}
|
|
6176
|
+
${links}
|
|
6177
|
+
${model.error ? `<p class="absolute-voice-reconnect-evidence__error">${escapeHtml11(model.error)}</p>` : ""}
|
|
6178
|
+
</section>`;
|
|
6179
|
+
};
|
|
6180
|
+
var getVoiceReconnectProfileEvidenceCSS = () => `.absolute-voice-reconnect-evidence{border:1px solid #bae6fd;border-radius:20px;background:#f0f9ff;color:#0f172a;padding:18px;box-shadow:0 18px 40px rgba(14,165,233,.12);font-family:inherit}.absolute-voice-reconnect-evidence--warning,.absolute-voice-reconnect-evidence--error{border-color:#fbbf24;background:#fffbeb}.absolute-voice-reconnect-evidence__header{align-items:start;display:flex;gap:12px;justify-content:space-between}.absolute-voice-reconnect-evidence__eyebrow{color:#0369a1;font-size:12px;font-weight:800;letter-spacing:.08em;text-transform:uppercase}.absolute-voice-reconnect-evidence__label{font-size:24px;line-height:1}.absolute-voice-reconnect-evidence__description,.absolute-voice-reconnect-evidence__empty,.absolute-voice-reconnect-evidence__latest{color:#475569}.absolute-voice-reconnect-evidence__metrics{display:grid;gap:10px;grid-template-columns:repeat(4,minmax(0,1fr));margin-top:14px}.absolute-voice-reconnect-evidence__metrics article{background:#fff;border:1px solid #bae6fd;border-radius:16px;padding:12px}.absolute-voice-reconnect-evidence__metrics span{color:#64748b;display:block;font-size:11px;font-weight:800;text-transform:uppercase}.absolute-voice-reconnect-evidence__metrics strong{display:block;font-size:20px;margin-top:4px}.absolute-voice-reconnect-evidence__links{display:flex;flex-wrap:wrap;gap:8px;margin:14px 0 0}.absolute-voice-reconnect-evidence__links a{border:1px solid #7dd3fc;border-radius:999px;color:#0369a1;font-weight:800;padding:6px 10px;text-decoration:none}.absolute-voice-reconnect-evidence__error{color:#9f1239;font-weight:700}@media (max-width:720px){.absolute-voice-reconnect-evidence__metrics{grid-template-columns:repeat(2,minmax(0,1fr))}}`;
|
|
6181
|
+
var mountVoiceReconnectProfileEvidence = (element, path = "/api/voice/reconnect-profile-evidence", options = {}) => {
|
|
6182
|
+
const store = createVoiceReconnectProfileEvidenceStore(path, options);
|
|
6183
|
+
const render = () => {
|
|
6184
|
+
element.innerHTML = renderVoiceReconnectProfileEvidenceHTML(store.getSnapshot(), options);
|
|
6185
|
+
};
|
|
6186
|
+
const unsubscribe = store.subscribe(render);
|
|
6187
|
+
render();
|
|
6188
|
+
store.refresh().catch(() => {});
|
|
6189
|
+
return {
|
|
6190
|
+
close: () => {
|
|
6191
|
+
unsubscribe();
|
|
6192
|
+
store.close();
|
|
6193
|
+
},
|
|
6194
|
+
refresh: store.refresh
|
|
6195
|
+
};
|
|
6196
|
+
};
|
|
6197
|
+
var defineVoiceReconnectProfileEvidenceElement = (tagName = "absolute-voice-reconnect-profile-evidence") => {
|
|
6198
|
+
if (typeof window === "undefined" || typeof customElements === "undefined" || customElements.get(tagName)) {
|
|
6199
|
+
return;
|
|
6200
|
+
}
|
|
6201
|
+
customElements.define(tagName, class AbsoluteVoiceReconnectProfileEvidenceElement extends HTMLElement {
|
|
6202
|
+
mounted;
|
|
6203
|
+
connectedCallback() {
|
|
6204
|
+
const intervalMs = Number(this.getAttribute("interval-ms") ?? 5000);
|
|
6205
|
+
this.mounted = mountVoiceReconnectProfileEvidence(this, this.getAttribute("path") ?? "/api/voice/reconnect-profile-evidence", {
|
|
6206
|
+
description: this.getAttribute("description") ?? undefined,
|
|
6207
|
+
intervalMs: Number.isFinite(intervalMs) ? intervalMs : 5000,
|
|
6208
|
+
title: this.getAttribute("title") ?? undefined
|
|
6209
|
+
});
|
|
6210
|
+
}
|
|
6211
|
+
disconnectedCallback() {
|
|
6212
|
+
this.mounted?.close();
|
|
6213
|
+
this.mounted = undefined;
|
|
6214
|
+
}
|
|
6215
|
+
});
|
|
6216
|
+
};
|
|
6217
|
+
|
|
6218
|
+
// src/react/useVoiceReconnectProfileEvidence.tsx
|
|
6219
|
+
import { useEffect as useEffect6, useRef as useRef6, useSyncExternalStore as useSyncExternalStore6 } from "react";
|
|
6220
|
+
var useVoiceReconnectProfileEvidence = (path = "/api/voice/reconnect-profile-evidence", options = {}) => {
|
|
6221
|
+
const storeRef = useRef6(null);
|
|
6222
|
+
if (!storeRef.current) {
|
|
6223
|
+
storeRef.current = createVoiceReconnectProfileEvidenceStore(path, options);
|
|
6224
|
+
}
|
|
6225
|
+
const store = storeRef.current;
|
|
6226
|
+
useEffect6(() => {
|
|
6227
|
+
store.refresh().catch(() => {});
|
|
6228
|
+
return () => store.close();
|
|
6229
|
+
}, [store]);
|
|
6230
|
+
return {
|
|
6231
|
+
...useSyncExternalStore6(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
6232
|
+
refresh: store.refresh
|
|
6233
|
+
};
|
|
6234
|
+
};
|
|
6235
|
+
|
|
6236
|
+
// src/react/VoiceReconnectProfileEvidence.tsx
|
|
6237
|
+
import { jsxDEV as jsxDEV6 } from "react/jsx-dev-runtime";
|
|
6238
|
+
var VoiceReconnectProfileEvidence = ({
|
|
6239
|
+
className,
|
|
6240
|
+
path = "/api/voice/reconnect-profile-evidence",
|
|
6241
|
+
...options
|
|
6242
|
+
}) => {
|
|
6243
|
+
const snapshot = useVoiceReconnectProfileEvidence(path, options);
|
|
6244
|
+
const model = createVoiceReconnectProfileEvidenceViewModel(snapshot, options);
|
|
6245
|
+
return /* @__PURE__ */ jsxDEV6("section", {
|
|
6246
|
+
className: [
|
|
6247
|
+
"absolute-voice-reconnect-evidence",
|
|
6248
|
+
`absolute-voice-reconnect-evidence--${model.status}`,
|
|
6249
|
+
className
|
|
6250
|
+
].filter(Boolean).join(" "),
|
|
6251
|
+
children: [
|
|
6252
|
+
/* @__PURE__ */ jsxDEV6("header", {
|
|
6253
|
+
className: "absolute-voice-reconnect-evidence__header",
|
|
6254
|
+
children: [
|
|
6255
|
+
/* @__PURE__ */ jsxDEV6("span", {
|
|
6256
|
+
className: "absolute-voice-reconnect-evidence__eyebrow",
|
|
6257
|
+
children: model.title
|
|
6258
|
+
}, undefined, false, undefined, this),
|
|
6259
|
+
/* @__PURE__ */ jsxDEV6("strong", {
|
|
6260
|
+
className: "absolute-voice-reconnect-evidence__label",
|
|
6261
|
+
children: model.label
|
|
6262
|
+
}, undefined, false, undefined, this)
|
|
6263
|
+
]
|
|
6264
|
+
}, undefined, true, undefined, this),
|
|
6265
|
+
/* @__PURE__ */ jsxDEV6("p", {
|
|
6266
|
+
className: "absolute-voice-reconnect-evidence__description",
|
|
6267
|
+
children: model.description
|
|
6268
|
+
}, undefined, false, undefined, this),
|
|
6269
|
+
/* @__PURE__ */ jsxDEV6("div", {
|
|
6270
|
+
className: "absolute-voice-reconnect-evidence__metrics",
|
|
6271
|
+
children: model.metrics.map((metric) => /* @__PURE__ */ jsxDEV6("article", {
|
|
6272
|
+
children: [
|
|
6273
|
+
/* @__PURE__ */ jsxDEV6("span", {
|
|
6274
|
+
children: metric.label
|
|
6275
|
+
}, undefined, false, undefined, this),
|
|
6276
|
+
/* @__PURE__ */ jsxDEV6("strong", {
|
|
6277
|
+
children: metric.value
|
|
6278
|
+
}, undefined, false, undefined, this)
|
|
6279
|
+
]
|
|
6280
|
+
}, metric.label, true, undefined, this))
|
|
6281
|
+
}, undefined, false, undefined, this),
|
|
6282
|
+
model.latest ? /* @__PURE__ */ jsxDEV6("p", {
|
|
6283
|
+
className: "absolute-voice-reconnect-evidence__latest",
|
|
6284
|
+
children: [
|
|
6285
|
+
"Latest ",
|
|
6286
|
+
model.latest.profileLabel,
|
|
6287
|
+
" \xB7 ",
|
|
6288
|
+
model.latest.sessionId,
|
|
6289
|
+
" \xB7",
|
|
6290
|
+
" ",
|
|
6291
|
+
model.latest.surfaces
|
|
6292
|
+
]
|
|
6293
|
+
}, undefined, true, undefined, this) : /* @__PURE__ */ jsxDEV6("p", {
|
|
6294
|
+
className: "absolute-voice-reconnect-evidence__empty",
|
|
6295
|
+
children: "No persisted reconnect profile evidence yet."
|
|
6296
|
+
}, undefined, false, undefined, this),
|
|
6297
|
+
model.links.length ? /* @__PURE__ */ jsxDEV6("p", {
|
|
6298
|
+
className: "absolute-voice-reconnect-evidence__links",
|
|
6299
|
+
children: model.links.map((link) => /* @__PURE__ */ jsxDEV6("a", {
|
|
6300
|
+
href: link.href,
|
|
6301
|
+
children: link.label
|
|
6302
|
+
}, link.href, false, undefined, this))
|
|
6303
|
+
}, undefined, false, undefined, this) : null,
|
|
6304
|
+
model.error ? /* @__PURE__ */ jsxDEV6("p", {
|
|
6305
|
+
className: "absolute-voice-reconnect-evidence__error",
|
|
6306
|
+
children: model.error
|
|
6307
|
+
}, undefined, false, undefined, this) : null
|
|
6308
|
+
]
|
|
6309
|
+
}, undefined, true, undefined, this);
|
|
6310
|
+
};
|
|
5804
6311
|
// src/client/callDebugger.ts
|
|
5805
6312
|
var fetchVoiceCallDebugger = async (path, options = {}) => {
|
|
5806
6313
|
const fetchImpl = options.fetch ?? globalThis.fetch;
|
|
@@ -5877,10 +6384,10 @@ var createVoiceCallDebuggerStore = (path, options = {}) => {
|
|
|
5877
6384
|
};
|
|
5878
6385
|
|
|
5879
6386
|
// src/client/callDebuggerWidget.ts
|
|
5880
|
-
var
|
|
5881
|
-
var
|
|
6387
|
+
var DEFAULT_TITLE7 = "Call Debugger";
|
|
6388
|
+
var DEFAULT_DESCRIPTION7 = "Open the latest call artifact with snapshot, operations record, failure replay, provider path, transcript, and incident markdown.";
|
|
5882
6389
|
var DEFAULT_LINK_LABEL = "Open debugger";
|
|
5883
|
-
var
|
|
6390
|
+
var escapeHtml12 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
5884
6391
|
var defaultHref = (path, report) => {
|
|
5885
6392
|
if (path.startsWith("/api/voice-call-debugger/")) {
|
|
5886
6393
|
return path.replace("/api/voice-call-debugger/", "/voice-call-debugger/");
|
|
@@ -5897,7 +6404,7 @@ var createVoiceCallDebuggerLaunchViewModel = (path, state, options = {}) => {
|
|
|
5897
6404
|
const report = state.report;
|
|
5898
6405
|
const href = resolveHref(path, state, options);
|
|
5899
6406
|
return {
|
|
5900
|
-
description: options.description ??
|
|
6407
|
+
description: options.description ?? DEFAULT_DESCRIPTION7,
|
|
5901
6408
|
error: state.error,
|
|
5902
6409
|
href,
|
|
5903
6410
|
isLoading: state.isLoading,
|
|
@@ -5926,25 +6433,25 @@ var createVoiceCallDebuggerLaunchViewModel = (path, state, options = {}) => {
|
|
|
5926
6433
|
{ label: "Snapshot", value: report.snapshot.status }
|
|
5927
6434
|
] : [],
|
|
5928
6435
|
status: state.error ? "error" : report ? report.status === "healthy" ? "ready" : "warning" : state.isLoading ? "loading" : "empty",
|
|
5929
|
-
title: options.title ??
|
|
6436
|
+
title: options.title ?? DEFAULT_TITLE7,
|
|
5930
6437
|
updatedAt: state.updatedAt
|
|
5931
6438
|
};
|
|
5932
6439
|
};
|
|
5933
6440
|
var renderVoiceCallDebuggerLaunchHTML = (path, state, options = {}) => {
|
|
5934
6441
|
const model = createVoiceCallDebuggerLaunchViewModel(path, state, options);
|
|
5935
6442
|
const rows = model.rows.length ? `<dl>${model.rows.map((row) => `<div>
|
|
5936
|
-
<dt>${
|
|
5937
|
-
<dd>${
|
|
6443
|
+
<dt>${escapeHtml12(row.label)}</dt>
|
|
6444
|
+
<dd>${escapeHtml12(row.value)}</dd>
|
|
5938
6445
|
</div>`).join("")}</dl>` : '<p class="absolute-voice-call-debugger-launch__empty">Load a call debugger report to see the latest support artifact.</p>';
|
|
5939
|
-
return `<section class="absolute-voice-call-debugger-launch absolute-voice-call-debugger-launch--${
|
|
6446
|
+
return `<section class="absolute-voice-call-debugger-launch absolute-voice-call-debugger-launch--${escapeHtml12(model.status)}">
|
|
5940
6447
|
<header class="absolute-voice-call-debugger-launch__header">
|
|
5941
|
-
<span class="absolute-voice-call-debugger-launch__eyebrow">${
|
|
5942
|
-
<strong class="absolute-voice-call-debugger-launch__label">${
|
|
6448
|
+
<span class="absolute-voice-call-debugger-launch__eyebrow">${escapeHtml12(model.title)}</span>
|
|
6449
|
+
<strong class="absolute-voice-call-debugger-launch__label">${escapeHtml12(model.label)}</strong>
|
|
5943
6450
|
</header>
|
|
5944
|
-
<p class="absolute-voice-call-debugger-launch__description">${
|
|
5945
|
-
<a class="absolute-voice-call-debugger-launch__link" href="${
|
|
6451
|
+
<p class="absolute-voice-call-debugger-launch__description">${escapeHtml12(model.description)}</p>
|
|
6452
|
+
<a class="absolute-voice-call-debugger-launch__link" href="${escapeHtml12(model.href)}">${escapeHtml12(options.linkLabel ?? DEFAULT_LINK_LABEL)}</a>
|
|
5946
6453
|
${rows}
|
|
5947
|
-
${model.error ? `<p class="absolute-voice-call-debugger-launch__error">${
|
|
6454
|
+
${model.error ? `<p class="absolute-voice-call-debugger-launch__error">${escapeHtml12(model.error)}</p>` : ""}
|
|
5948
6455
|
</section>`;
|
|
5949
6456
|
};
|
|
5950
6457
|
var mountVoiceCallDebuggerLaunch = (element, path, options = {}) => {
|
|
@@ -5987,25 +6494,25 @@ var defineVoiceCallDebuggerLaunchElement = (tagName = "absolute-voice-call-debug
|
|
|
5987
6494
|
};
|
|
5988
6495
|
|
|
5989
6496
|
// src/react/useVoiceCallDebugger.tsx
|
|
5990
|
-
import { useEffect as
|
|
6497
|
+
import { useEffect as useEffect7, useRef as useRef7, useSyncExternalStore as useSyncExternalStore7 } from "react";
|
|
5991
6498
|
var useVoiceCallDebugger = (path, options = {}) => {
|
|
5992
|
-
const storeRef =
|
|
6499
|
+
const storeRef = useRef7(null);
|
|
5993
6500
|
if (!storeRef.current) {
|
|
5994
6501
|
storeRef.current = createVoiceCallDebuggerStore(path, options);
|
|
5995
6502
|
}
|
|
5996
6503
|
const store = storeRef.current;
|
|
5997
|
-
|
|
6504
|
+
useEffect7(() => {
|
|
5998
6505
|
store.refresh().catch(() => {});
|
|
5999
6506
|
return () => store.close();
|
|
6000
6507
|
}, [store]);
|
|
6001
6508
|
return {
|
|
6002
|
-
...
|
|
6509
|
+
...useSyncExternalStore7(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
6003
6510
|
refresh: store.refresh
|
|
6004
6511
|
};
|
|
6005
6512
|
};
|
|
6006
6513
|
|
|
6007
6514
|
// src/react/VoiceCallDebuggerLaunch.tsx
|
|
6008
|
-
import { jsxDEV as
|
|
6515
|
+
import { jsxDEV as jsxDEV7 } from "react/jsx-dev-runtime";
|
|
6009
6516
|
var VoiceCallDebuggerLaunch = ({
|
|
6010
6517
|
className,
|
|
6011
6518
|
path,
|
|
@@ -6013,51 +6520,51 @@ var VoiceCallDebuggerLaunch = ({
|
|
|
6013
6520
|
}) => {
|
|
6014
6521
|
const state = useVoiceCallDebugger(path, options);
|
|
6015
6522
|
const model = createVoiceCallDebuggerLaunchViewModel(path, state, options);
|
|
6016
|
-
return /* @__PURE__ */
|
|
6523
|
+
return /* @__PURE__ */ jsxDEV7("section", {
|
|
6017
6524
|
className: [
|
|
6018
6525
|
"absolute-voice-call-debugger-launch",
|
|
6019
6526
|
`absolute-voice-call-debugger-launch--${model.status}`,
|
|
6020
6527
|
className
|
|
6021
6528
|
].filter(Boolean).join(" "),
|
|
6022
6529
|
children: [
|
|
6023
|
-
/* @__PURE__ */
|
|
6530
|
+
/* @__PURE__ */ jsxDEV7("header", {
|
|
6024
6531
|
className: "absolute-voice-call-debugger-launch__header",
|
|
6025
6532
|
children: [
|
|
6026
|
-
/* @__PURE__ */
|
|
6533
|
+
/* @__PURE__ */ jsxDEV7("span", {
|
|
6027
6534
|
className: "absolute-voice-call-debugger-launch__eyebrow",
|
|
6028
6535
|
children: model.title
|
|
6029
6536
|
}, undefined, false, undefined, this),
|
|
6030
|
-
/* @__PURE__ */
|
|
6537
|
+
/* @__PURE__ */ jsxDEV7("strong", {
|
|
6031
6538
|
className: "absolute-voice-call-debugger-launch__label",
|
|
6032
6539
|
children: model.label
|
|
6033
6540
|
}, undefined, false, undefined, this)
|
|
6034
6541
|
]
|
|
6035
6542
|
}, undefined, true, undefined, this),
|
|
6036
|
-
/* @__PURE__ */
|
|
6543
|
+
/* @__PURE__ */ jsxDEV7("p", {
|
|
6037
6544
|
className: "absolute-voice-call-debugger-launch__description",
|
|
6038
6545
|
children: model.description
|
|
6039
6546
|
}, undefined, false, undefined, this),
|
|
6040
|
-
/* @__PURE__ */
|
|
6547
|
+
/* @__PURE__ */ jsxDEV7("a", {
|
|
6041
6548
|
className: "absolute-voice-call-debugger-launch__link",
|
|
6042
6549
|
href: model.href,
|
|
6043
6550
|
children: options.linkLabel ?? "Open debugger"
|
|
6044
6551
|
}, undefined, false, undefined, this),
|
|
6045
|
-
model.rows.length ? /* @__PURE__ */
|
|
6046
|
-
children: model.rows.map((row) => /* @__PURE__ */
|
|
6552
|
+
model.rows.length ? /* @__PURE__ */ jsxDEV7("dl", {
|
|
6553
|
+
children: model.rows.map((row) => /* @__PURE__ */ jsxDEV7("div", {
|
|
6047
6554
|
children: [
|
|
6048
|
-
/* @__PURE__ */
|
|
6555
|
+
/* @__PURE__ */ jsxDEV7("dt", {
|
|
6049
6556
|
children: row.label
|
|
6050
6557
|
}, undefined, false, undefined, this),
|
|
6051
|
-
/* @__PURE__ */
|
|
6558
|
+
/* @__PURE__ */ jsxDEV7("dd", {
|
|
6052
6559
|
children: row.value
|
|
6053
6560
|
}, undefined, false, undefined, this)
|
|
6054
6561
|
]
|
|
6055
6562
|
}, row.label, true, undefined, this))
|
|
6056
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
6563
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV7("p", {
|
|
6057
6564
|
className: "absolute-voice-call-debugger-launch__empty",
|
|
6058
6565
|
children: "Load a call debugger report to see the latest support artifact."
|
|
6059
6566
|
}, undefined, false, undefined, this),
|
|
6060
|
-
model.error ? /* @__PURE__ */
|
|
6567
|
+
model.error ? /* @__PURE__ */ jsxDEV7("p", {
|
|
6061
6568
|
className: "absolute-voice-call-debugger-launch__error",
|
|
6062
6569
|
children: model.error
|
|
6063
6570
|
}, undefined, false, undefined, this) : null
|
|
@@ -6158,10 +6665,10 @@ var createVoiceSessionSnapshotStore = (path, options = {}) => {
|
|
|
6158
6665
|
};
|
|
6159
6666
|
|
|
6160
6667
|
// src/client/sessionSnapshotWidget.ts
|
|
6161
|
-
var
|
|
6162
|
-
var
|
|
6668
|
+
var DEFAULT_TITLE8 = "Session Snapshot";
|
|
6669
|
+
var DEFAULT_DESCRIPTION8 = "Portable call artifact with media graph, provider routing, proof, quality, and telephony evidence.";
|
|
6163
6670
|
var DEFAULT_DOWNLOAD_LABEL = "Download snapshot";
|
|
6164
|
-
var
|
|
6671
|
+
var escapeHtml13 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
6165
6672
|
var formatStatus2 = (status) => status ?? "n/a";
|
|
6166
6673
|
var createVoiceSessionSnapshotViewModel = (state, options = {}) => {
|
|
6167
6674
|
const snapshot = state.snapshot;
|
|
@@ -6177,7 +6684,7 @@ var createVoiceSessionSnapshotViewModel = (state, options = {}) => {
|
|
|
6177
6684
|
label: artifact.label,
|
|
6178
6685
|
status: formatStatus2(artifact.status)
|
|
6179
6686
|
})) ?? [],
|
|
6180
|
-
description: options.description ??
|
|
6687
|
+
description: options.description ?? DEFAULT_DESCRIPTION8,
|
|
6181
6688
|
error: state.error,
|
|
6182
6689
|
isLoading: state.isLoading,
|
|
6183
6690
|
label: state.error ? "Unavailable" : snapshot ? `${snapshot.status} \xB7 ${snapshot.sessionId}` : state.isLoading ? "Loading" : "No snapshot",
|
|
@@ -6204,30 +6711,30 @@ var createVoiceSessionSnapshotViewModel = (state, options = {}) => {
|
|
|
6204
6711
|
] : [],
|
|
6205
6712
|
showDownload: snapshot !== undefined,
|
|
6206
6713
|
status: state.error ? "error" : snapshot ? snapshot.status === "pass" ? "ready" : "warning" : state.isLoading ? "loading" : "empty",
|
|
6207
|
-
title: options.title ??
|
|
6714
|
+
title: options.title ?? DEFAULT_TITLE8,
|
|
6208
6715
|
updatedAt: state.updatedAt
|
|
6209
6716
|
};
|
|
6210
6717
|
};
|
|
6211
6718
|
var renderVoiceSessionSnapshotHTML = (state, options = {}) => {
|
|
6212
6719
|
const model = createVoiceSessionSnapshotViewModel(state, options);
|
|
6213
6720
|
const rows = model.rows.length ? `<dl>${model.rows.map((row) => `<div>
|
|
6214
|
-
<dt>${
|
|
6215
|
-
<dd>${
|
|
6721
|
+
<dt>${escapeHtml13(row.label)}</dt>
|
|
6722
|
+
<dd>${escapeHtml13(row.value)}</dd>
|
|
6216
6723
|
</div>`).join("")}</dl>` : '<p class="absolute-voice-session-snapshot__empty">Load a session snapshot to see support diagnostics.</p>';
|
|
6217
6724
|
const artifacts = model.artifacts.length ? `<div class="absolute-voice-session-snapshot__artifacts">${model.artifacts.map((artifact) => {
|
|
6218
|
-
const body = `<strong>${
|
|
6219
|
-
return artifact.href ? `<a href="${
|
|
6725
|
+
const body = `<strong>${escapeHtml13(artifact.label)}</strong><span>${escapeHtml13(artifact.status)}</span>`;
|
|
6726
|
+
return artifact.href ? `<a href="${escapeHtml13(artifact.href)}">${body}</a>` : `<div>${body}</div>`;
|
|
6220
6727
|
}).join("")}</div>` : "";
|
|
6221
|
-
return `<section class="absolute-voice-session-snapshot absolute-voice-session-snapshot--${
|
|
6728
|
+
return `<section class="absolute-voice-session-snapshot absolute-voice-session-snapshot--${escapeHtml13(model.status)}">
|
|
6222
6729
|
<header class="absolute-voice-session-snapshot__header">
|
|
6223
|
-
<span class="absolute-voice-session-snapshot__eyebrow">${
|
|
6224
|
-
<strong class="absolute-voice-session-snapshot__label">${
|
|
6730
|
+
<span class="absolute-voice-session-snapshot__eyebrow">${escapeHtml13(model.title)}</span>
|
|
6731
|
+
<strong class="absolute-voice-session-snapshot__label">${escapeHtml13(model.label)}</strong>
|
|
6225
6732
|
</header>
|
|
6226
|
-
<p class="absolute-voice-session-snapshot__description">${
|
|
6227
|
-
${model.showDownload ? `<button class="absolute-voice-session-snapshot__download" data-absolute-voice-session-snapshot-download type="button">${
|
|
6733
|
+
<p class="absolute-voice-session-snapshot__description">${escapeHtml13(model.description)}</p>
|
|
6734
|
+
${model.showDownload ? `<button class="absolute-voice-session-snapshot__download" data-absolute-voice-session-snapshot-download type="button">${escapeHtml13(options.downloadLabel ?? DEFAULT_DOWNLOAD_LABEL)}</button>` : ""}
|
|
6228
6735
|
${rows}
|
|
6229
6736
|
${artifacts}
|
|
6230
|
-
${model.error ? `<p class="absolute-voice-session-snapshot__error">${
|
|
6737
|
+
${model.error ? `<p class="absolute-voice-session-snapshot__error">${escapeHtml13(model.error)}</p>` : ""}
|
|
6231
6738
|
</section>`;
|
|
6232
6739
|
};
|
|
6233
6740
|
var downloadBlob = (blob, filename) => {
|
|
@@ -6291,26 +6798,26 @@ var defineVoiceSessionSnapshotElement = (tagName = "absolute-voice-session-snaps
|
|
|
6291
6798
|
};
|
|
6292
6799
|
|
|
6293
6800
|
// src/react/useVoiceSessionSnapshot.tsx
|
|
6294
|
-
import { useEffect as
|
|
6801
|
+
import { useEffect as useEffect8, useRef as useRef8, useSyncExternalStore as useSyncExternalStore8 } from "react";
|
|
6295
6802
|
var useVoiceSessionSnapshot = (path, options = {}) => {
|
|
6296
|
-
const storeRef =
|
|
6803
|
+
const storeRef = useRef8(null);
|
|
6297
6804
|
if (!storeRef.current) {
|
|
6298
6805
|
storeRef.current = createVoiceSessionSnapshotStore(path, options);
|
|
6299
6806
|
}
|
|
6300
6807
|
const store = storeRef.current;
|
|
6301
|
-
|
|
6808
|
+
useEffect8(() => {
|
|
6302
6809
|
store.refresh().catch(() => {});
|
|
6303
6810
|
return () => store.close();
|
|
6304
6811
|
}, [store]);
|
|
6305
6812
|
return {
|
|
6306
|
-
...
|
|
6813
|
+
...useSyncExternalStore8(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
6307
6814
|
download: store.download,
|
|
6308
6815
|
refresh: store.refresh
|
|
6309
6816
|
};
|
|
6310
6817
|
};
|
|
6311
6818
|
|
|
6312
6819
|
// src/react/VoiceSessionSnapshot.tsx
|
|
6313
|
-
import { jsxDEV as
|
|
6820
|
+
import { jsxDEV as jsxDEV8 } from "react/jsx-dev-runtime";
|
|
6314
6821
|
var VoiceSessionSnapshot = ({
|
|
6315
6822
|
className,
|
|
6316
6823
|
path,
|
|
@@ -6318,52 +6825,52 @@ var VoiceSessionSnapshot = ({
|
|
|
6318
6825
|
}) => {
|
|
6319
6826
|
const state = useVoiceSessionSnapshot(path, options);
|
|
6320
6827
|
const model = createVoiceSessionSnapshotViewModel(state, options);
|
|
6321
|
-
return /* @__PURE__ */
|
|
6828
|
+
return /* @__PURE__ */ jsxDEV8("section", {
|
|
6322
6829
|
className: [
|
|
6323
6830
|
"absolute-voice-session-snapshot",
|
|
6324
6831
|
`absolute-voice-session-snapshot--${model.status}`,
|
|
6325
6832
|
className
|
|
6326
6833
|
].filter(Boolean).join(" "),
|
|
6327
6834
|
children: [
|
|
6328
|
-
/* @__PURE__ */
|
|
6835
|
+
/* @__PURE__ */ jsxDEV8("header", {
|
|
6329
6836
|
className: "absolute-voice-session-snapshot__header",
|
|
6330
6837
|
children: [
|
|
6331
|
-
/* @__PURE__ */
|
|
6838
|
+
/* @__PURE__ */ jsxDEV8("span", {
|
|
6332
6839
|
className: "absolute-voice-session-snapshot__eyebrow",
|
|
6333
6840
|
children: model.title
|
|
6334
6841
|
}, undefined, false, undefined, this),
|
|
6335
|
-
/* @__PURE__ */
|
|
6842
|
+
/* @__PURE__ */ jsxDEV8("strong", {
|
|
6336
6843
|
className: "absolute-voice-session-snapshot__label",
|
|
6337
6844
|
children: model.label
|
|
6338
6845
|
}, undefined, false, undefined, this)
|
|
6339
6846
|
]
|
|
6340
6847
|
}, undefined, true, undefined, this),
|
|
6341
|
-
/* @__PURE__ */
|
|
6848
|
+
/* @__PURE__ */ jsxDEV8("p", {
|
|
6342
6849
|
className: "absolute-voice-session-snapshot__description",
|
|
6343
6850
|
children: model.description
|
|
6344
6851
|
}, undefined, false, undefined, this),
|
|
6345
|
-
model.showDownload ? /* @__PURE__ */
|
|
6852
|
+
model.showDownload ? /* @__PURE__ */ jsxDEV8("button", {
|
|
6346
6853
|
className: "absolute-voice-session-snapshot__download",
|
|
6347
6854
|
onClick: () => state.download(),
|
|
6348
6855
|
type: "button",
|
|
6349
6856
|
children: options.downloadLabel ?? "Download snapshot"
|
|
6350
6857
|
}, undefined, false, undefined, this) : null,
|
|
6351
|
-
model.rows.length ? /* @__PURE__ */
|
|
6352
|
-
children: model.rows.map((row) => /* @__PURE__ */
|
|
6858
|
+
model.rows.length ? /* @__PURE__ */ jsxDEV8("dl", {
|
|
6859
|
+
children: model.rows.map((row) => /* @__PURE__ */ jsxDEV8("div", {
|
|
6353
6860
|
children: [
|
|
6354
|
-
/* @__PURE__ */
|
|
6861
|
+
/* @__PURE__ */ jsxDEV8("dt", {
|
|
6355
6862
|
children: row.label
|
|
6356
6863
|
}, undefined, false, undefined, this),
|
|
6357
|
-
/* @__PURE__ */
|
|
6864
|
+
/* @__PURE__ */ jsxDEV8("dd", {
|
|
6358
6865
|
children: row.value
|
|
6359
6866
|
}, undefined, false, undefined, this)
|
|
6360
6867
|
]
|
|
6361
6868
|
}, row.label, true, undefined, this))
|
|
6362
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
6869
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV8("p", {
|
|
6363
6870
|
className: "absolute-voice-session-snapshot__empty",
|
|
6364
6871
|
children: "Load a session snapshot to see support diagnostics."
|
|
6365
6872
|
}, undefined, false, undefined, this),
|
|
6366
|
-
model.error ? /* @__PURE__ */
|
|
6873
|
+
model.error ? /* @__PURE__ */ jsxDEV8("p", {
|
|
6367
6874
|
className: "absolute-voice-session-snapshot__error",
|
|
6368
6875
|
children: model.error
|
|
6369
6876
|
}, undefined, false, undefined, this) : null
|
|
@@ -6446,20 +6953,20 @@ var createVoiceProfileComparisonStore = (path = "/api/voice/real-call-profile-hi
|
|
|
6446
6953
|
};
|
|
6447
6954
|
|
|
6448
6955
|
// src/client/profileComparisonWidget.ts
|
|
6449
|
-
var
|
|
6450
|
-
var
|
|
6451
|
-
var
|
|
6956
|
+
var DEFAULT_TITLE9 = "Profile Stack Comparison";
|
|
6957
|
+
var DEFAULT_DESCRIPTION9 = "Measured real-call evidence behind each profile default: provider routes, latency, and the next move.";
|
|
6958
|
+
var DEFAULT_LINKS4 = [
|
|
6452
6959
|
{ href: "/voice/real-call-profile-history", label: "Profile history" },
|
|
6453
6960
|
{ href: "/api/voice/real-call-profile-history", label: "JSON" }
|
|
6454
6961
|
];
|
|
6455
|
-
var
|
|
6456
|
-
var
|
|
6962
|
+
var escapeHtml14 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
6963
|
+
var formatMs3 = (value) => typeof value === "number" && Number.isFinite(value) ? `${Math.round(value)}ms` : "n/a";
|
|
6457
6964
|
var formatProviderRoutes = (profile) => Object.entries(profile.providerRoutes).map(([role, provider]) => `${role}: ${provider}`).join(", ") || "No complete route yet";
|
|
6458
6965
|
var createProfileView = (profile) => ({
|
|
6459
6966
|
evidence: [
|
|
6460
|
-
{ label: "Live p95", value:
|
|
6461
|
-
{ label: "Provider p95", value:
|
|
6462
|
-
{ label: "Turn p95", value:
|
|
6967
|
+
{ label: "Live p95", value: formatMs3(profile.evidence.liveP95Ms) },
|
|
6968
|
+
{ label: "Provider p95", value: formatMs3(profile.evidence.providerP95Ms) },
|
|
6969
|
+
{ label: "Turn p95", value: formatMs3(profile.evidence.turnP95Ms) }
|
|
6463
6970
|
],
|
|
6464
6971
|
label: profile.label ?? profile.profileId,
|
|
6465
6972
|
nextMove: profile.nextMove,
|
|
@@ -6471,37 +6978,37 @@ var createVoiceProfileComparisonViewModel = (snapshot, options = {}) => {
|
|
|
6471
6978
|
const report = snapshot.report;
|
|
6472
6979
|
const profiles = report?.defaults.profiles.map(createProfileView) ?? [];
|
|
6473
6980
|
return {
|
|
6474
|
-
description: options.description ??
|
|
6981
|
+
description: options.description ?? DEFAULT_DESCRIPTION9,
|
|
6475
6982
|
error: snapshot.error,
|
|
6476
6983
|
isLoading: snapshot.isLoading,
|
|
6477
6984
|
label: snapshot.error ? "Unavailable" : report ? `${report.defaults.summary.actionableProfiles}/${report.defaults.summary.profileCount} profiles ready` : snapshot.isLoading ? "Checking" : "No profile evidence",
|
|
6478
|
-
links: options.links ??
|
|
6985
|
+
links: options.links ?? DEFAULT_LINKS4,
|
|
6479
6986
|
profiles,
|
|
6480
6987
|
status: snapshot.error ? "error" : report ? report.status === "pass" ? "ready" : "warning" : snapshot.isLoading ? "loading" : "empty",
|
|
6481
|
-
title: options.title ??
|
|
6988
|
+
title: options.title ?? DEFAULT_TITLE9
|
|
6482
6989
|
};
|
|
6483
6990
|
};
|
|
6484
6991
|
var renderVoiceProfileComparisonHTML = (snapshot, options = {}) => {
|
|
6485
6992
|
const model = createVoiceProfileComparisonViewModel(snapshot, options);
|
|
6486
|
-
const profiles = model.profiles.length ? `<div class="absolute-voice-profile-comparison__profiles">${model.profiles.map((profile) => `<article class="absolute-voice-profile-comparison__profile absolute-voice-profile-comparison__profile--${
|
|
6993
|
+
const profiles = model.profiles.length ? `<div class="absolute-voice-profile-comparison__profiles">${model.profiles.map((profile) => `<article class="absolute-voice-profile-comparison__profile absolute-voice-profile-comparison__profile--${escapeHtml14(profile.status)}">
|
|
6487
6994
|
<header>
|
|
6488
|
-
<span>${
|
|
6489
|
-
<strong>${
|
|
6995
|
+
<span>${escapeHtml14(profile.status)}</span>
|
|
6996
|
+
<strong>${escapeHtml14(profile.label)}</strong>
|
|
6490
6997
|
</header>
|
|
6491
|
-
<p>${
|
|
6492
|
-
<div>${profile.evidence.map((metric) => `<span><small>${
|
|
6493
|
-
<em>${
|
|
6494
|
-
</article>`).join("")}</div>` : `<p class="absolute-voice-profile-comparison__empty">${model.error ?
|
|
6495
|
-
const links = model.links.length ? `<p class="absolute-voice-profile-comparison__links">${model.links.map((link) => `<a href="${
|
|
6496
|
-
return `<section class="absolute-voice-profile-comparison absolute-voice-profile-comparison--${
|
|
6998
|
+
<p>${escapeHtml14(profile.providerRoutes)}</p>
|
|
6999
|
+
<div>${profile.evidence.map((metric) => `<span><small>${escapeHtml14(metric.label)}</small><b>${escapeHtml14(metric.value)}</b></span>`).join("")}</div>
|
|
7000
|
+
<em>${escapeHtml14(profile.nextMove)}</em>
|
|
7001
|
+
</article>`).join("")}</div>` : `<p class="absolute-voice-profile-comparison__empty">${model.error ? escapeHtml14(model.error) : "Run real-call profile collection to populate profile comparisons."}</p>`;
|
|
7002
|
+
const links = model.links.length ? `<p class="absolute-voice-profile-comparison__links">${model.links.map((link) => `<a href="${escapeHtml14(link.href)}">${escapeHtml14(link.label)}</a>`).join("")}</p>` : "";
|
|
7003
|
+
return `<section class="absolute-voice-profile-comparison absolute-voice-profile-comparison--${escapeHtml14(model.status)}">
|
|
6497
7004
|
<header class="absolute-voice-profile-comparison__header">
|
|
6498
|
-
<span class="absolute-voice-profile-comparison__eyebrow">${
|
|
6499
|
-
<strong class="absolute-voice-profile-comparison__label">${
|
|
7005
|
+
<span class="absolute-voice-profile-comparison__eyebrow">${escapeHtml14(model.title)}</span>
|
|
7006
|
+
<strong class="absolute-voice-profile-comparison__label">${escapeHtml14(model.label)}</strong>
|
|
6500
7007
|
</header>
|
|
6501
|
-
<p class="absolute-voice-profile-comparison__description">${
|
|
7008
|
+
<p class="absolute-voice-profile-comparison__description">${escapeHtml14(model.description)}</p>
|
|
6502
7009
|
${profiles}
|
|
6503
7010
|
${links}
|
|
6504
|
-
${model.error ? `<p class="absolute-voice-profile-comparison__error">${
|
|
7011
|
+
${model.error ? `<p class="absolute-voice-profile-comparison__error">${escapeHtml14(model.error)}</p>` : ""}
|
|
6505
7012
|
</section>`;
|
|
6506
7013
|
};
|
|
6507
7014
|
var getVoiceProfileComparisonCSS = () => `.absolute-voice-profile-comparison{border:1px solid #c7d2fe;border-radius:20px;background:#eef2ff;color:#111827;padding:18px;box-shadow:0 18px 40px rgba(79,70,229,.12);font-family:inherit}.absolute-voice-profile-comparison--warning,.absolute-voice-profile-comparison--error{border-color:#fbbf24;background:#fffbeb}.absolute-voice-profile-comparison__header{align-items:start;display:flex;gap:12px;justify-content:space-between}.absolute-voice-profile-comparison__eyebrow{color:#4338ca;font-size:12px;font-weight:800;letter-spacing:.08em;text-transform:uppercase}.absolute-voice-profile-comparison__label{font-size:24px;line-height:1}.absolute-voice-profile-comparison__description,.absolute-voice-profile-comparison__empty{color:#4b5563}.absolute-voice-profile-comparison__profiles{display:grid;gap:12px;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));margin-top:14px}.absolute-voice-profile-comparison__profile{background:#fff;border:1px solid #c7d2fe;border-radius:16px;padding:14px}.absolute-voice-profile-comparison__profile--warn{border-color:#fbbf24}.absolute-voice-profile-comparison__profile--fail{border-color:#f87171}.absolute-voice-profile-comparison__profile header{align-items:center;display:flex;gap:8px;justify-content:space-between}.absolute-voice-profile-comparison__profile header span{border:1px solid currentColor;border-radius:999px;color:#4338ca;font-size:11px;font-weight:900;padding:3px 7px;text-transform:uppercase}.absolute-voice-profile-comparison__profile p{color:#1f2937;font-weight:800;overflow-wrap:anywhere}.absolute-voice-profile-comparison__profile div{display:grid;gap:8px;grid-template-columns:repeat(3,minmax(0,1fr))}.absolute-voice-profile-comparison__profile small{color:#6b7280;display:block;font-size:11px}.absolute-voice-profile-comparison__profile b{display:block}.absolute-voice-profile-comparison__profile em{color:#4b5563;display:block;font-size:13px;margin-top:12px}.absolute-voice-profile-comparison__links{display:flex;flex-wrap:wrap;gap:8px;margin:14px 0 0}.absolute-voice-profile-comparison__links a{border:1px solid #a5b4fc;border-radius:999px;color:#4338ca;font-weight:800;padding:6px 10px;text-decoration:none}.absolute-voice-profile-comparison__error{color:#9f1239;font-weight:700}`;
|
|
@@ -6543,25 +7050,25 @@ var defineVoiceProfileComparisonElement = (tagName = "absolute-voice-profile-com
|
|
|
6543
7050
|
};
|
|
6544
7051
|
|
|
6545
7052
|
// src/react/useVoiceProfileComparison.tsx
|
|
6546
|
-
import { useEffect as
|
|
7053
|
+
import { useEffect as useEffect9, useRef as useRef9, useSyncExternalStore as useSyncExternalStore9 } from "react";
|
|
6547
7054
|
var useVoiceProfileComparison = (path = "/api/voice/real-call-profile-history", options = {}) => {
|
|
6548
|
-
const storeRef =
|
|
7055
|
+
const storeRef = useRef9(null);
|
|
6549
7056
|
if (!storeRef.current) {
|
|
6550
7057
|
storeRef.current = createVoiceProfileComparisonStore(path, options);
|
|
6551
7058
|
}
|
|
6552
7059
|
const store = storeRef.current;
|
|
6553
|
-
|
|
7060
|
+
useEffect9(() => {
|
|
6554
7061
|
store.refresh().catch(() => {});
|
|
6555
7062
|
return () => store.close();
|
|
6556
7063
|
}, [store]);
|
|
6557
7064
|
return {
|
|
6558
|
-
...
|
|
7065
|
+
...useSyncExternalStore9(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
6559
7066
|
refresh: store.refresh
|
|
6560
7067
|
};
|
|
6561
7068
|
};
|
|
6562
7069
|
|
|
6563
7070
|
// src/react/VoiceProfileComparison.tsx
|
|
6564
|
-
import { jsxDEV as
|
|
7071
|
+
import { jsxDEV as jsxDEV9 } from "react/jsx-dev-runtime";
|
|
6565
7072
|
var VoiceProfileComparison = ({
|
|
6566
7073
|
className,
|
|
6567
7074
|
path = "/api/voice/real-call-profile-history",
|
|
@@ -6569,77 +7076,77 @@ var VoiceProfileComparison = ({
|
|
|
6569
7076
|
}) => {
|
|
6570
7077
|
const snapshot = useVoiceProfileComparison(path, options);
|
|
6571
7078
|
const model = createVoiceProfileComparisonViewModel(snapshot, options);
|
|
6572
|
-
return /* @__PURE__ */
|
|
7079
|
+
return /* @__PURE__ */ jsxDEV9("section", {
|
|
6573
7080
|
className: [
|
|
6574
7081
|
"absolute-voice-profile-comparison",
|
|
6575
7082
|
`absolute-voice-profile-comparison--${model.status}`,
|
|
6576
7083
|
className
|
|
6577
7084
|
].filter(Boolean).join(" "),
|
|
6578
7085
|
children: [
|
|
6579
|
-
/* @__PURE__ */
|
|
7086
|
+
/* @__PURE__ */ jsxDEV9("header", {
|
|
6580
7087
|
className: "absolute-voice-profile-comparison__header",
|
|
6581
7088
|
children: [
|
|
6582
|
-
/* @__PURE__ */
|
|
7089
|
+
/* @__PURE__ */ jsxDEV9("span", {
|
|
6583
7090
|
className: "absolute-voice-profile-comparison__eyebrow",
|
|
6584
7091
|
children: model.title
|
|
6585
7092
|
}, undefined, false, undefined, this),
|
|
6586
|
-
/* @__PURE__ */
|
|
7093
|
+
/* @__PURE__ */ jsxDEV9("strong", {
|
|
6587
7094
|
className: "absolute-voice-profile-comparison__label",
|
|
6588
7095
|
children: model.label
|
|
6589
7096
|
}, undefined, false, undefined, this)
|
|
6590
7097
|
]
|
|
6591
7098
|
}, undefined, true, undefined, this),
|
|
6592
|
-
/* @__PURE__ */
|
|
7099
|
+
/* @__PURE__ */ jsxDEV9("p", {
|
|
6593
7100
|
className: "absolute-voice-profile-comparison__description",
|
|
6594
7101
|
children: model.description
|
|
6595
7102
|
}, undefined, false, undefined, this),
|
|
6596
|
-
model.profiles.length ? /* @__PURE__ */
|
|
7103
|
+
model.profiles.length ? /* @__PURE__ */ jsxDEV9("div", {
|
|
6597
7104
|
className: "absolute-voice-profile-comparison__profiles",
|
|
6598
|
-
children: model.profiles.map((profile) => /* @__PURE__ */
|
|
7105
|
+
children: model.profiles.map((profile) => /* @__PURE__ */ jsxDEV9("article", {
|
|
6599
7106
|
className: `absolute-voice-profile-comparison__profile absolute-voice-profile-comparison__profile--${profile.status}`,
|
|
6600
7107
|
children: [
|
|
6601
|
-
/* @__PURE__ */
|
|
7108
|
+
/* @__PURE__ */ jsxDEV9("header", {
|
|
6602
7109
|
children: [
|
|
6603
|
-
/* @__PURE__ */
|
|
7110
|
+
/* @__PURE__ */ jsxDEV9("span", {
|
|
6604
7111
|
children: profile.status
|
|
6605
7112
|
}, undefined, false, undefined, this),
|
|
6606
|
-
/* @__PURE__ */
|
|
7113
|
+
/* @__PURE__ */ jsxDEV9("strong", {
|
|
6607
7114
|
children: profile.label
|
|
6608
7115
|
}, undefined, false, undefined, this)
|
|
6609
7116
|
]
|
|
6610
7117
|
}, undefined, true, undefined, this),
|
|
6611
|
-
/* @__PURE__ */
|
|
7118
|
+
/* @__PURE__ */ jsxDEV9("p", {
|
|
6612
7119
|
children: profile.providerRoutes
|
|
6613
7120
|
}, undefined, false, undefined, this),
|
|
6614
|
-
/* @__PURE__ */
|
|
6615
|
-
children: profile.evidence.map((metric) => /* @__PURE__ */
|
|
7121
|
+
/* @__PURE__ */ jsxDEV9("div", {
|
|
7122
|
+
children: profile.evidence.map((metric) => /* @__PURE__ */ jsxDEV9("span", {
|
|
6616
7123
|
children: [
|
|
6617
|
-
/* @__PURE__ */
|
|
7124
|
+
/* @__PURE__ */ jsxDEV9("small", {
|
|
6618
7125
|
children: metric.label
|
|
6619
7126
|
}, undefined, false, undefined, this),
|
|
6620
|
-
/* @__PURE__ */
|
|
7127
|
+
/* @__PURE__ */ jsxDEV9("b", {
|
|
6621
7128
|
children: metric.value
|
|
6622
7129
|
}, undefined, false, undefined, this)
|
|
6623
7130
|
]
|
|
6624
7131
|
}, metric.label, true, undefined, this))
|
|
6625
7132
|
}, undefined, false, undefined, this),
|
|
6626
|
-
/* @__PURE__ */
|
|
7133
|
+
/* @__PURE__ */ jsxDEV9("em", {
|
|
6627
7134
|
children: profile.nextMove
|
|
6628
7135
|
}, undefined, false, undefined, this)
|
|
6629
7136
|
]
|
|
6630
7137
|
}, profile.profileId, true, undefined, this))
|
|
6631
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
7138
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV9("p", {
|
|
6632
7139
|
className: "absolute-voice-profile-comparison__empty",
|
|
6633
7140
|
children: model.error ?? "Run real-call profile collection to populate profile comparisons."
|
|
6634
7141
|
}, undefined, false, undefined, this),
|
|
6635
|
-
model.links.length ? /* @__PURE__ */
|
|
7142
|
+
model.links.length ? /* @__PURE__ */ jsxDEV9("p", {
|
|
6636
7143
|
className: "absolute-voice-profile-comparison__links",
|
|
6637
|
-
children: model.links.map((link) => /* @__PURE__ */
|
|
7144
|
+
children: model.links.map((link) => /* @__PURE__ */ jsxDEV9("a", {
|
|
6638
7145
|
href: link.href,
|
|
6639
7146
|
children: link.label
|
|
6640
7147
|
}, link.href, false, undefined, this))
|
|
6641
7148
|
}, undefined, false, undefined, this) : null,
|
|
6642
|
-
model.error ? /* @__PURE__ */
|
|
7149
|
+
model.error ? /* @__PURE__ */ jsxDEV9("p", {
|
|
6643
7150
|
className: "absolute-voice-profile-comparison__error",
|
|
6644
7151
|
children: model.error
|
|
6645
7152
|
}, undefined, false, undefined, this) : null
|
|
@@ -6722,29 +7229,29 @@ var createVoiceProfileSwitchRecommendationStore = (path = "/api/voice/profile-sw
|
|
|
6722
7229
|
};
|
|
6723
7230
|
|
|
6724
7231
|
// src/client/profileSwitchRecommendationWidget.ts
|
|
6725
|
-
var
|
|
6726
|
-
var
|
|
6727
|
-
var
|
|
7232
|
+
var DEFAULT_TITLE10 = "Profile Switch Recommendation";
|
|
7233
|
+
var DEFAULT_DESCRIPTION10 = "Compares the current session against measured profile evidence and recommends whether to switch stacks.";
|
|
7234
|
+
var escapeHtml15 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
6728
7235
|
var formatRoute = (routes) => routes ? Object.entries(routes).map(([role, provider]) => `${role}: ${provider}`).join(", ") : "No route";
|
|
6729
7236
|
var renderVoiceProfileSwitchRecommendationHTML = (snapshot, options = {}) => {
|
|
6730
7237
|
const recommendation = snapshot.recommendation;
|
|
6731
7238
|
const status = snapshot.error ? "error" : recommendation ? recommendation.status : snapshot.isLoading ? "loading" : "empty";
|
|
6732
7239
|
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";
|
|
6733
7240
|
const body = recommendation ? `<div class="absolute-voice-profile-switch__body">
|
|
6734
|
-
<p><strong>Current:</strong> ${
|
|
6735
|
-
<p><strong>Recommended:</strong> ${
|
|
6736
|
-
<p><strong>Routes:</strong> ${
|
|
6737
|
-
<ul>${recommendation.reasons.map((reason) => `<li>${
|
|
6738
|
-
<em>${
|
|
6739
|
-
</div>` : `<p class="absolute-voice-profile-switch__empty">${
|
|
6740
|
-
return `<section class="absolute-voice-profile-switch absolute-voice-profile-switch--${
|
|
7241
|
+
<p><strong>Current:</strong> ${escapeHtml15(recommendation.currentProfile?.label ?? recommendation.currentProfile?.profileId ?? "Unknown")}</p>
|
|
7242
|
+
<p><strong>Recommended:</strong> ${escapeHtml15(recommendation.recommendedProfile?.label ?? recommendation.recommendedProfile?.profileId ?? "None")}</p>
|
|
7243
|
+
<p><strong>Routes:</strong> ${escapeHtml15(formatRoute(recommendation.recommendedProfile?.providerRoutes))}</p>
|
|
7244
|
+
<ul>${recommendation.reasons.map((reason) => `<li>${escapeHtml15(reason)}</li>`).join("")}</ul>
|
|
7245
|
+
<em>${escapeHtml15(recommendation.nextMove)}</em>
|
|
7246
|
+
</div>` : `<p class="absolute-voice-profile-switch__empty">${escapeHtml15(snapshot.error ?? "Run session traffic to populate a recommendation.")}</p>`;
|
|
7247
|
+
return `<section class="absolute-voice-profile-switch absolute-voice-profile-switch--${escapeHtml15(status)}">
|
|
6741
7248
|
<header class="absolute-voice-profile-switch__header">
|
|
6742
|
-
<span class="absolute-voice-profile-switch__eyebrow">${
|
|
6743
|
-
<strong class="absolute-voice-profile-switch__label">${
|
|
7249
|
+
<span class="absolute-voice-profile-switch__eyebrow">${escapeHtml15(options.title ?? DEFAULT_TITLE10)}</span>
|
|
7250
|
+
<strong class="absolute-voice-profile-switch__label">${escapeHtml15(label)}</strong>
|
|
6744
7251
|
</header>
|
|
6745
|
-
<p class="absolute-voice-profile-switch__description">${
|
|
7252
|
+
<p class="absolute-voice-profile-switch__description">${escapeHtml15(options.description ?? DEFAULT_DESCRIPTION10)}</p>
|
|
6746
7253
|
${body}
|
|
6747
|
-
${snapshot.error ? `<p class="absolute-voice-profile-switch__error">${
|
|
7254
|
+
${snapshot.error ? `<p class="absolute-voice-profile-switch__error">${escapeHtml15(snapshot.error)}</p>` : ""}
|
|
6748
7255
|
</section>`;
|
|
6749
7256
|
};
|
|
6750
7257
|
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}`;
|
|
@@ -6786,25 +7293,25 @@ var defineVoiceProfileSwitchRecommendationElement = (tagName = "absolute-voice-p
|
|
|
6786
7293
|
};
|
|
6787
7294
|
|
|
6788
7295
|
// src/react/useVoiceProfileSwitchRecommendation.tsx
|
|
6789
|
-
import { useEffect as
|
|
7296
|
+
import { useEffect as useEffect10, useRef as useRef10, useSyncExternalStore as useSyncExternalStore10 } from "react";
|
|
6790
7297
|
var useVoiceProfileSwitchRecommendation = (path = "/api/voice/profile-switch-recommendation", options = {}) => {
|
|
6791
|
-
const storeRef =
|
|
7298
|
+
const storeRef = useRef10(null);
|
|
6792
7299
|
if (!storeRef.current) {
|
|
6793
7300
|
storeRef.current = createVoiceProfileSwitchRecommendationStore(path, options);
|
|
6794
7301
|
}
|
|
6795
7302
|
const store = storeRef.current;
|
|
6796
|
-
|
|
7303
|
+
useEffect10(() => {
|
|
6797
7304
|
store.refresh().catch(() => {});
|
|
6798
7305
|
return () => store.close();
|
|
6799
7306
|
}, [store]);
|
|
6800
7307
|
return {
|
|
6801
|
-
...
|
|
7308
|
+
...useSyncExternalStore10(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
6802
7309
|
refresh: store.refresh
|
|
6803
7310
|
};
|
|
6804
7311
|
};
|
|
6805
7312
|
|
|
6806
7313
|
// src/react/VoiceProfileSwitchRecommendation.tsx
|
|
6807
|
-
import { jsxDEV as
|
|
7314
|
+
import { jsxDEV as jsxDEV10 } from "react/jsx-dev-runtime";
|
|
6808
7315
|
var VoiceProfileSwitchRecommendation = ({
|
|
6809
7316
|
className,
|
|
6810
7317
|
path = "/api/voice/profile-switch-recommendation",
|
|
@@ -6812,7 +7319,7 @@ var VoiceProfileSwitchRecommendation = ({
|
|
|
6812
7319
|
}) => {
|
|
6813
7320
|
const snapshot = useVoiceProfileSwitchRecommendation(path, options);
|
|
6814
7321
|
const html = renderVoiceProfileSwitchRecommendationHTML(snapshot, options);
|
|
6815
|
-
return /* @__PURE__ */
|
|
7322
|
+
return /* @__PURE__ */ jsxDEV10("div", {
|
|
6816
7323
|
className,
|
|
6817
7324
|
dangerouslySetInnerHTML: { __html: html }
|
|
6818
7325
|
}, undefined, false, undefined, this);
|
|
@@ -6893,13 +7400,13 @@ var createVoiceReadinessFailuresStore = (path = "/api/production-readiness", opt
|
|
|
6893
7400
|
};
|
|
6894
7401
|
|
|
6895
7402
|
// src/client/readinessFailuresWidget.ts
|
|
6896
|
-
var
|
|
6897
|
-
var
|
|
6898
|
-
var
|
|
7403
|
+
var DEFAULT_TITLE11 = "Readiness Gate Explanations";
|
|
7404
|
+
var DEFAULT_DESCRIPTION11 = "Structured reasons for calibrated production-readiness warnings and failures.";
|
|
7405
|
+
var DEFAULT_LINKS5 = [
|
|
6899
7406
|
{ href: "/production-readiness", label: "Readiness page" },
|
|
6900
7407
|
{ href: "/voice/slo-readiness-thresholds", label: "Gate thresholds" }
|
|
6901
7408
|
];
|
|
6902
|
-
var
|
|
7409
|
+
var escapeHtml16 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
6903
7410
|
var formatExplanationValue = (value, unit) => {
|
|
6904
7411
|
if (value === undefined || value === null) {
|
|
6905
7412
|
return "n/a";
|
|
@@ -6927,36 +7434,36 @@ var createVoiceReadinessFailuresViewModel = (snapshot, options = {}) => {
|
|
|
6927
7434
|
const failures = snapshot.report?.checks.map(toFailureView).filter((value) => !!value) ?? [];
|
|
6928
7435
|
const hasOpenIssues = failures.length > 0;
|
|
6929
7436
|
return {
|
|
6930
|
-
description: options.description ??
|
|
7437
|
+
description: options.description ?? DEFAULT_DESCRIPTION11,
|
|
6931
7438
|
error: snapshot.error,
|
|
6932
7439
|
failures,
|
|
6933
7440
|
isLoading: snapshot.isLoading,
|
|
6934
7441
|
label: snapshot.error ? "Unavailable" : snapshot.report ? hasOpenIssues ? `${failures.length} calibrated gate issue(s)` : "No calibrated gate issues" : snapshot.isLoading ? "Checking" : "No readiness report",
|
|
6935
|
-
links: options.links ??
|
|
7442
|
+
links: options.links ?? DEFAULT_LINKS5,
|
|
6936
7443
|
status: snapshot.error ? "error" : snapshot.report ? hasOpenIssues ? "warning" : "ready" : snapshot.isLoading ? "loading" : "empty",
|
|
6937
|
-
title: options.title ??
|
|
7444
|
+
title: options.title ?? DEFAULT_TITLE11,
|
|
6938
7445
|
updatedAt: snapshot.updatedAt
|
|
6939
7446
|
};
|
|
6940
7447
|
};
|
|
6941
7448
|
var renderVoiceReadinessFailuresHTML = (snapshot, options = {}) => {
|
|
6942
7449
|
const model = createVoiceReadinessFailuresViewModel(snapshot, options);
|
|
6943
|
-
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--${
|
|
6944
|
-
<span>${
|
|
6945
|
-
<strong>${
|
|
6946
|
-
<p>Observed ${
|
|
6947
|
-
<p>${
|
|
6948
|
-
<p class="absolute-voice-readiness-failures__links">${failure.evidenceHref ? `<a href="${
|
|
6949
|
-
</article>`).join("")}</div>` : `<p class="absolute-voice-readiness-failures__empty">${model.error ?
|
|
6950
|
-
const links = model.links.length ? `<p class="absolute-voice-readiness-failures__links">${model.links.map((link) => `<a href="${
|
|
6951
|
-
return `<section class="absolute-voice-readiness-failures absolute-voice-readiness-failures--${
|
|
7450
|
+
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--${escapeHtml16(failure.status)}">
|
|
7451
|
+
<span>${escapeHtml16(failure.status.toUpperCase())}</span>
|
|
7452
|
+
<strong>${escapeHtml16(failure.label)}</strong>
|
|
7453
|
+
<p>Observed ${escapeHtml16(failure.observed)} against ${escapeHtml16(failure.thresholdLabel)} ${escapeHtml16(failure.threshold)}.</p>
|
|
7454
|
+
<p>${escapeHtml16(failure.remediation)}</p>
|
|
7455
|
+
<p class="absolute-voice-readiness-failures__links">${failure.evidenceHref ? `<a href="${escapeHtml16(failure.evidenceHref)}">Evidence</a>` : ""}${failure.sourceHref ? `<a href="${escapeHtml16(failure.sourceHref)}">Threshold source</a>` : ""}</p>
|
|
7456
|
+
</article>`).join("")}</div>` : `<p class="absolute-voice-readiness-failures__empty">${model.error ? escapeHtml16(model.error) : "No calibrated readiness gate explanations are open."}</p>`;
|
|
7457
|
+
const links = model.links.length ? `<p class="absolute-voice-readiness-failures__links">${model.links.map((link) => `<a href="${escapeHtml16(link.href)}">${escapeHtml16(link.label)}</a>`).join("")}</p>` : "";
|
|
7458
|
+
return `<section class="absolute-voice-readiness-failures absolute-voice-readiness-failures--${escapeHtml16(model.status)}">
|
|
6952
7459
|
<header class="absolute-voice-readiness-failures__header">
|
|
6953
|
-
<span class="absolute-voice-readiness-failures__eyebrow">${
|
|
6954
|
-
<strong class="absolute-voice-readiness-failures__label">${
|
|
7460
|
+
<span class="absolute-voice-readiness-failures__eyebrow">${escapeHtml16(model.title)}</span>
|
|
7461
|
+
<strong class="absolute-voice-readiness-failures__label">${escapeHtml16(model.label)}</strong>
|
|
6955
7462
|
</header>
|
|
6956
|
-
<p class="absolute-voice-readiness-failures__description">${
|
|
7463
|
+
<p class="absolute-voice-readiness-failures__description">${escapeHtml16(model.description)}</p>
|
|
6957
7464
|
${failures}
|
|
6958
7465
|
${links}
|
|
6959
|
-
${model.error ? `<p class="absolute-voice-readiness-failures__error">${
|
|
7466
|
+
${model.error ? `<p class="absolute-voice-readiness-failures__error">${escapeHtml16(model.error)}</p>` : ""}
|
|
6960
7467
|
</section>`;
|
|
6961
7468
|
};
|
|
6962
7469
|
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}`;
|
|
@@ -6997,25 +7504,25 @@ var defineVoiceReadinessFailuresElement = (tagName = "absolute-voice-readiness-f
|
|
|
6997
7504
|
};
|
|
6998
7505
|
|
|
6999
7506
|
// src/react/useVoiceReadinessFailures.tsx
|
|
7000
|
-
import { useEffect as
|
|
7507
|
+
import { useEffect as useEffect11, useRef as useRef11, useSyncExternalStore as useSyncExternalStore11 } from "react";
|
|
7001
7508
|
var useVoiceReadinessFailures = (path = "/api/production-readiness", options = {}) => {
|
|
7002
|
-
const storeRef =
|
|
7509
|
+
const storeRef = useRef11(null);
|
|
7003
7510
|
if (!storeRef.current) {
|
|
7004
7511
|
storeRef.current = createVoiceReadinessFailuresStore(path, options);
|
|
7005
7512
|
}
|
|
7006
7513
|
const store = storeRef.current;
|
|
7007
|
-
|
|
7514
|
+
useEffect11(() => {
|
|
7008
7515
|
store.refresh().catch(() => {});
|
|
7009
7516
|
return () => store.close();
|
|
7010
7517
|
}, [store]);
|
|
7011
7518
|
return {
|
|
7012
|
-
...
|
|
7519
|
+
...useSyncExternalStore11(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
7013
7520
|
refresh: store.refresh
|
|
7014
7521
|
};
|
|
7015
7522
|
};
|
|
7016
7523
|
|
|
7017
7524
|
// src/react/VoiceReadinessFailures.tsx
|
|
7018
|
-
import { jsxDEV as
|
|
7525
|
+
import { jsxDEV as jsxDEV11 } from "react/jsx-dev-runtime";
|
|
7019
7526
|
var VoiceReadinessFailures = ({
|
|
7020
7527
|
className,
|
|
7021
7528
|
path = "/api/production-readiness",
|
|
@@ -7023,42 +7530,42 @@ var VoiceReadinessFailures = ({
|
|
|
7023
7530
|
}) => {
|
|
7024
7531
|
const snapshot = useVoiceReadinessFailures(path, options);
|
|
7025
7532
|
const model = createVoiceReadinessFailuresViewModel(snapshot, options);
|
|
7026
|
-
return /* @__PURE__ */
|
|
7533
|
+
return /* @__PURE__ */ jsxDEV11("section", {
|
|
7027
7534
|
className: [
|
|
7028
7535
|
"absolute-voice-readiness-failures",
|
|
7029
7536
|
`absolute-voice-readiness-failures--${model.status}`,
|
|
7030
7537
|
className
|
|
7031
7538
|
].filter(Boolean).join(" "),
|
|
7032
7539
|
children: [
|
|
7033
|
-
/* @__PURE__ */
|
|
7540
|
+
/* @__PURE__ */ jsxDEV11("header", {
|
|
7034
7541
|
className: "absolute-voice-readiness-failures__header",
|
|
7035
7542
|
children: [
|
|
7036
|
-
/* @__PURE__ */
|
|
7543
|
+
/* @__PURE__ */ jsxDEV11("span", {
|
|
7037
7544
|
className: "absolute-voice-readiness-failures__eyebrow",
|
|
7038
7545
|
children: model.title
|
|
7039
7546
|
}, undefined, false, undefined, this),
|
|
7040
|
-
/* @__PURE__ */
|
|
7547
|
+
/* @__PURE__ */ jsxDEV11("strong", {
|
|
7041
7548
|
className: "absolute-voice-readiness-failures__label",
|
|
7042
7549
|
children: model.label
|
|
7043
7550
|
}, undefined, false, undefined, this)
|
|
7044
7551
|
]
|
|
7045
7552
|
}, undefined, true, undefined, this),
|
|
7046
|
-
/* @__PURE__ */
|
|
7553
|
+
/* @__PURE__ */ jsxDEV11("p", {
|
|
7047
7554
|
className: "absolute-voice-readiness-failures__description",
|
|
7048
7555
|
children: model.description
|
|
7049
7556
|
}, undefined, false, undefined, this),
|
|
7050
|
-
model.failures.length ? /* @__PURE__ */
|
|
7557
|
+
model.failures.length ? /* @__PURE__ */ jsxDEV11("div", {
|
|
7051
7558
|
className: "absolute-voice-readiness-failures__items",
|
|
7052
|
-
children: model.failures.map((failure) => /* @__PURE__ */
|
|
7559
|
+
children: model.failures.map((failure) => /* @__PURE__ */ jsxDEV11("article", {
|
|
7053
7560
|
className: `absolute-voice-readiness-failures__item absolute-voice-readiness-failures__item--${failure.status}`,
|
|
7054
7561
|
children: [
|
|
7055
|
-
/* @__PURE__ */
|
|
7562
|
+
/* @__PURE__ */ jsxDEV11("span", {
|
|
7056
7563
|
children: failure.status.toUpperCase()
|
|
7057
7564
|
}, undefined, false, undefined, this),
|
|
7058
|
-
/* @__PURE__ */
|
|
7565
|
+
/* @__PURE__ */ jsxDEV11("strong", {
|
|
7059
7566
|
children: failure.label
|
|
7060
7567
|
}, undefined, false, undefined, this),
|
|
7061
|
-
/* @__PURE__ */
|
|
7568
|
+
/* @__PURE__ */ jsxDEV11("p", {
|
|
7062
7569
|
children: [
|
|
7063
7570
|
"Observed ",
|
|
7064
7571
|
failure.observed,
|
|
@@ -7069,17 +7576,17 @@ var VoiceReadinessFailures = ({
|
|
|
7069
7576
|
"."
|
|
7070
7577
|
]
|
|
7071
7578
|
}, undefined, true, undefined, this),
|
|
7072
|
-
/* @__PURE__ */
|
|
7579
|
+
/* @__PURE__ */ jsxDEV11("p", {
|
|
7073
7580
|
children: failure.remediation
|
|
7074
7581
|
}, undefined, false, undefined, this),
|
|
7075
|
-
/* @__PURE__ */
|
|
7582
|
+
/* @__PURE__ */ jsxDEV11("p", {
|
|
7076
7583
|
className: "absolute-voice-readiness-failures__links",
|
|
7077
7584
|
children: [
|
|
7078
|
-
failure.evidenceHref ? /* @__PURE__ */
|
|
7585
|
+
failure.evidenceHref ? /* @__PURE__ */ jsxDEV11("a", {
|
|
7079
7586
|
href: failure.evidenceHref,
|
|
7080
7587
|
children: "Evidence"
|
|
7081
7588
|
}, undefined, false, undefined, this) : null,
|
|
7082
|
-
failure.sourceHref ? /* @__PURE__ */
|
|
7589
|
+
failure.sourceHref ? /* @__PURE__ */ jsxDEV11("a", {
|
|
7083
7590
|
href: failure.sourceHref,
|
|
7084
7591
|
children: "Threshold source"
|
|
7085
7592
|
}, undefined, false, undefined, this) : null
|
|
@@ -7087,18 +7594,18 @@ var VoiceReadinessFailures = ({
|
|
|
7087
7594
|
}, undefined, true, undefined, this)
|
|
7088
7595
|
]
|
|
7089
7596
|
}, failure.label, true, undefined, this))
|
|
7090
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
7597
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV11("p", {
|
|
7091
7598
|
className: "absolute-voice-readiness-failures__empty",
|
|
7092
7599
|
children: model.error ?? "No calibrated readiness gate explanations are open."
|
|
7093
7600
|
}, undefined, false, undefined, this),
|
|
7094
|
-
model.links.length ? /* @__PURE__ */
|
|
7601
|
+
model.links.length ? /* @__PURE__ */ jsxDEV11("p", {
|
|
7095
7602
|
className: "absolute-voice-readiness-failures__links",
|
|
7096
|
-
children: model.links.map((link) => /* @__PURE__ */
|
|
7603
|
+
children: model.links.map((link) => /* @__PURE__ */ jsxDEV11("a", {
|
|
7097
7604
|
href: link.href,
|
|
7098
7605
|
children: link.label
|
|
7099
7606
|
}, link.href, false, undefined, this))
|
|
7100
7607
|
}, undefined, false, undefined, this) : null,
|
|
7101
|
-
model.error ? /* @__PURE__ */
|
|
7608
|
+
model.error ? /* @__PURE__ */ jsxDEV11("p", {
|
|
7102
7609
|
className: "absolute-voice-readiness-failures__error",
|
|
7103
7610
|
children: model.error
|
|
7104
7611
|
}, undefined, false, undefined, this) : null
|
|
@@ -7185,7 +7692,7 @@ var createVoiceProviderSimulationControlsStore = (options) => {
|
|
|
7185
7692
|
};
|
|
7186
7693
|
|
|
7187
7694
|
// src/client/providerSimulationControlsWidget.ts
|
|
7188
|
-
var
|
|
7695
|
+
var escapeHtml17 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
7189
7696
|
var formatKind = (kind) => (kind ?? "stt").toUpperCase();
|
|
7190
7697
|
var createVoiceProviderSimulationControlsViewModel = (snapshot, options) => {
|
|
7191
7698
|
const configuredProviders = options.providers.filter((provider) => provider.configured !== false);
|
|
@@ -7205,18 +7712,18 @@ var createVoiceProviderSimulationControlsViewModel = (snapshot, options) => {
|
|
|
7205
7712
|
};
|
|
7206
7713
|
var renderVoiceProviderSimulationControlsHTML = (snapshot, options) => {
|
|
7207
7714
|
const model = createVoiceProviderSimulationControlsViewModel(snapshot, options);
|
|
7208
|
-
const failureButtons = model.failureProviders.map((provider) => `<button type="button" data-voice-provider-fail="${
|
|
7209
|
-
const recoveryButtons = model.providers.map((provider) => `<button type="button" data-voice-provider-recover="${
|
|
7715
|
+
const failureButtons = model.failureProviders.map((provider) => `<button type="button" data-voice-provider-fail="${escapeHtml17(provider.provider)}"${!model.canSimulateFailure || snapshot.isRunning ? " disabled" : ""}>Simulate ${escapeHtml17(provider.provider)} ${escapeHtml17(formatKind(options.kind))} failure</button>`).join("");
|
|
7716
|
+
const recoveryButtons = model.providers.map((provider) => `<button type="button" data-voice-provider-recover="${escapeHtml17(provider.provider)}"${snapshot.isRunning ? " disabled" : ""}>Mark ${escapeHtml17(provider.provider)} recovered</button>`).join("");
|
|
7210
7717
|
return `<section class="absolute-voice-provider-simulation absolute-voice-provider-simulation--${snapshot.error ? "error" : snapshot.isRunning ? "running" : "ready"}">
|
|
7211
7718
|
<header class="absolute-voice-provider-simulation__header">
|
|
7212
|
-
<span class="absolute-voice-provider-simulation__eyebrow">${
|
|
7213
|
-
<strong class="absolute-voice-provider-simulation__label">${
|
|
7719
|
+
<span class="absolute-voice-provider-simulation__eyebrow">${escapeHtml17(model.title)}</span>
|
|
7720
|
+
<strong class="absolute-voice-provider-simulation__label">${escapeHtml17(model.label)}</strong>
|
|
7214
7721
|
</header>
|
|
7215
|
-
<p class="absolute-voice-provider-simulation__description">${
|
|
7216
|
-
${model.canSimulateFailure ? "" : `<p class="absolute-voice-provider-simulation__empty">${
|
|
7722
|
+
<p class="absolute-voice-provider-simulation__description">${escapeHtml17(model.description)}</p>
|
|
7723
|
+
${model.canSimulateFailure ? "" : `<p class="absolute-voice-provider-simulation__empty">${escapeHtml17(options.fallbackRequiredMessage ?? "Configure fallback providers before simulating failure.")}</p>`}
|
|
7217
7724
|
<div class="absolute-voice-provider-simulation__actions">${failureButtons}${recoveryButtons}</div>
|
|
7218
|
-
${snapshot.error ? `<p class="absolute-voice-provider-simulation__error">${
|
|
7219
|
-
${model.resultText ? `<pre class="absolute-voice-provider-simulation__result">${
|
|
7725
|
+
${snapshot.error ? `<p class="absolute-voice-provider-simulation__error">${escapeHtml17(snapshot.error)}</p>` : ""}
|
|
7726
|
+
${model.resultText ? `<pre class="absolute-voice-provider-simulation__result">${escapeHtml17(model.resultText)}</pre>` : ""}
|
|
7220
7727
|
</section>`;
|
|
7221
7728
|
};
|
|
7222
7729
|
var bindVoiceProviderSimulationControls = (element, store) => {
|
|
@@ -7282,22 +7789,22 @@ var defineVoiceProviderSimulationControlsElement = (tagName = "absolute-voice-pr
|
|
|
7282
7789
|
};
|
|
7283
7790
|
|
|
7284
7791
|
// src/react/useVoiceProviderSimulationControls.tsx
|
|
7285
|
-
import { useEffect as
|
|
7792
|
+
import { useEffect as useEffect12, useRef as useRef12, useSyncExternalStore as useSyncExternalStore12 } from "react";
|
|
7286
7793
|
var useVoiceProviderSimulationControls = (options) => {
|
|
7287
|
-
const storeRef =
|
|
7794
|
+
const storeRef = useRef12(null);
|
|
7288
7795
|
if (!storeRef.current) {
|
|
7289
7796
|
storeRef.current = createVoiceProviderSimulationControlsStore(options);
|
|
7290
7797
|
}
|
|
7291
7798
|
const store = storeRef.current;
|
|
7292
|
-
|
|
7799
|
+
useEffect12(() => () => store.close(), [store]);
|
|
7293
7800
|
return {
|
|
7294
|
-
...
|
|
7801
|
+
...useSyncExternalStore12(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
7295
7802
|
run: store.run
|
|
7296
7803
|
};
|
|
7297
7804
|
};
|
|
7298
7805
|
|
|
7299
7806
|
// src/react/VoiceProviderSimulationControls.tsx
|
|
7300
|
-
import { jsxDEV as
|
|
7807
|
+
import { jsxDEV as jsxDEV12 } from "react/jsx-dev-runtime";
|
|
7301
7808
|
var VoiceProviderSimulationControls = ({
|
|
7302
7809
|
className,
|
|
7303
7810
|
...options
|
|
@@ -7307,38 +7814,38 @@ var VoiceProviderSimulationControls = ({
|
|
|
7307
7814
|
const run = (provider, mode) => {
|
|
7308
7815
|
snapshot.run(provider, mode).catch(() => {});
|
|
7309
7816
|
};
|
|
7310
|
-
return /* @__PURE__ */
|
|
7817
|
+
return /* @__PURE__ */ jsxDEV12("section", {
|
|
7311
7818
|
className: [
|
|
7312
7819
|
"absolute-voice-provider-simulation",
|
|
7313
7820
|
`absolute-voice-provider-simulation--${snapshot.error ? "error" : snapshot.isRunning ? "running" : "ready"}`,
|
|
7314
7821
|
className
|
|
7315
7822
|
].filter(Boolean).join(" "),
|
|
7316
7823
|
children: [
|
|
7317
|
-
/* @__PURE__ */
|
|
7824
|
+
/* @__PURE__ */ jsxDEV12("header", {
|
|
7318
7825
|
className: "absolute-voice-provider-simulation__header",
|
|
7319
7826
|
children: [
|
|
7320
|
-
/* @__PURE__ */
|
|
7827
|
+
/* @__PURE__ */ jsxDEV12("span", {
|
|
7321
7828
|
className: "absolute-voice-provider-simulation__eyebrow",
|
|
7322
7829
|
children: model.title
|
|
7323
7830
|
}, undefined, false, undefined, this),
|
|
7324
|
-
/* @__PURE__ */
|
|
7831
|
+
/* @__PURE__ */ jsxDEV12("strong", {
|
|
7325
7832
|
className: "absolute-voice-provider-simulation__label",
|
|
7326
7833
|
children: model.label
|
|
7327
7834
|
}, undefined, false, undefined, this)
|
|
7328
7835
|
]
|
|
7329
7836
|
}, undefined, true, undefined, this),
|
|
7330
|
-
/* @__PURE__ */
|
|
7837
|
+
/* @__PURE__ */ jsxDEV12("p", {
|
|
7331
7838
|
className: "absolute-voice-provider-simulation__description",
|
|
7332
7839
|
children: model.description
|
|
7333
7840
|
}, undefined, false, undefined, this),
|
|
7334
|
-
model.canSimulateFailure ? null : /* @__PURE__ */
|
|
7841
|
+
model.canSimulateFailure ? null : /* @__PURE__ */ jsxDEV12("p", {
|
|
7335
7842
|
className: "absolute-voice-provider-simulation__empty",
|
|
7336
7843
|
children: options.fallbackRequiredMessage ?? "Configure fallback providers before simulating failure."
|
|
7337
7844
|
}, undefined, false, undefined, this),
|
|
7338
|
-
/* @__PURE__ */
|
|
7845
|
+
/* @__PURE__ */ jsxDEV12("div", {
|
|
7339
7846
|
className: "absolute-voice-provider-simulation__actions",
|
|
7340
7847
|
children: [
|
|
7341
|
-
model.failureProviders.map((provider) => /* @__PURE__ */
|
|
7848
|
+
model.failureProviders.map((provider) => /* @__PURE__ */ jsxDEV12("button", {
|
|
7342
7849
|
disabled: !model.canSimulateFailure || snapshot.isRunning,
|
|
7343
7850
|
onClick: () => run(provider.provider, "failure"),
|
|
7344
7851
|
type: "button",
|
|
@@ -7351,7 +7858,7 @@ var VoiceProviderSimulationControls = ({
|
|
|
7351
7858
|
"failure"
|
|
7352
7859
|
]
|
|
7353
7860
|
}, `fail-${provider.provider}`, true, undefined, this)),
|
|
7354
|
-
model.providers.map((provider) => /* @__PURE__ */
|
|
7861
|
+
model.providers.map((provider) => /* @__PURE__ */ jsxDEV12("button", {
|
|
7355
7862
|
disabled: snapshot.isRunning,
|
|
7356
7863
|
onClick: () => run(provider.provider, "recovery"),
|
|
7357
7864
|
type: "button",
|
|
@@ -7363,11 +7870,11 @@ var VoiceProviderSimulationControls = ({
|
|
|
7363
7870
|
}, `recover-${provider.provider}`, true, undefined, this))
|
|
7364
7871
|
]
|
|
7365
7872
|
}, undefined, true, undefined, this),
|
|
7366
|
-
snapshot.error ? /* @__PURE__ */
|
|
7873
|
+
snapshot.error ? /* @__PURE__ */ jsxDEV12("p", {
|
|
7367
7874
|
className: "absolute-voice-provider-simulation__error",
|
|
7368
7875
|
children: snapshot.error
|
|
7369
7876
|
}, undefined, false, undefined, this) : null,
|
|
7370
|
-
model.resultText ? /* @__PURE__ */
|
|
7877
|
+
model.resultText ? /* @__PURE__ */ jsxDEV12("pre", {
|
|
7371
7878
|
className: "absolute-voice-provider-simulation__result",
|
|
7372
7879
|
children: model.resultText
|
|
7373
7880
|
}, undefined, false, undefined, this) : null
|
|
@@ -7375,7 +7882,7 @@ var VoiceProviderSimulationControls = ({
|
|
|
7375
7882
|
}, undefined, true, undefined, this);
|
|
7376
7883
|
};
|
|
7377
7884
|
// src/react/useVoiceProviderCapabilities.tsx
|
|
7378
|
-
import { useEffect as
|
|
7885
|
+
import { useEffect as useEffect13, useRef as useRef13, useSyncExternalStore as useSyncExternalStore13 } from "react";
|
|
7379
7886
|
|
|
7380
7887
|
// src/client/providerCapabilities.ts
|
|
7381
7888
|
var fetchVoiceProviderCapabilities = async (path = "/api/provider-capabilities", options = {}) => {
|
|
@@ -7458,25 +7965,25 @@ var createVoiceProviderCapabilitiesStore = (path = "/api/provider-capabilities",
|
|
|
7458
7965
|
|
|
7459
7966
|
// src/react/useVoiceProviderCapabilities.tsx
|
|
7460
7967
|
var useVoiceProviderCapabilities = (path = "/api/provider-capabilities", options = {}) => {
|
|
7461
|
-
const storeRef =
|
|
7968
|
+
const storeRef = useRef13(null);
|
|
7462
7969
|
if (!storeRef.current) {
|
|
7463
7970
|
storeRef.current = createVoiceProviderCapabilitiesStore(path, options);
|
|
7464
7971
|
}
|
|
7465
7972
|
const store = storeRef.current;
|
|
7466
|
-
|
|
7973
|
+
useEffect13(() => {
|
|
7467
7974
|
store.refresh().catch(() => {});
|
|
7468
7975
|
return () => store.close();
|
|
7469
7976
|
}, [store]);
|
|
7470
7977
|
return {
|
|
7471
|
-
...
|
|
7978
|
+
...useSyncExternalStore13(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
7472
7979
|
refresh: store.refresh
|
|
7473
7980
|
};
|
|
7474
7981
|
};
|
|
7475
7982
|
|
|
7476
7983
|
// src/client/providerCapabilitiesWidget.ts
|
|
7477
|
-
var
|
|
7478
|
-
var
|
|
7479
|
-
var
|
|
7984
|
+
var DEFAULT_TITLE12 = "Provider Capabilities";
|
|
7985
|
+
var DEFAULT_DESCRIPTION12 = "Configured, selected, and healthy voice providers for this deployment.";
|
|
7986
|
+
var escapeHtml18 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
7480
7987
|
var formatProvider = (provider) => provider.split(/[-_\s]+/).filter(Boolean).map((part) => `${part[0]?.toUpperCase() ?? ""}${part.slice(1)}`).join(" ") || provider;
|
|
7481
7988
|
var formatKind2 = (kind) => kind.toUpperCase();
|
|
7482
7989
|
var formatStatus3 = (status) => status.split("-").map((part) => `${part[0]?.toUpperCase() ?? ""}${part.slice(1)}`).join(" ");
|
|
@@ -7520,36 +8027,36 @@ var createVoiceProviderCapabilitiesViewModel = (snapshot, options = {}) => {
|
|
|
7520
8027
|
const selectedCount = snapshot.report?.selected ?? capabilities.filter((capability) => capability.selected).length;
|
|
7521
8028
|
return {
|
|
7522
8029
|
capabilities,
|
|
7523
|
-
description: options.description ??
|
|
8030
|
+
description: options.description ?? DEFAULT_DESCRIPTION12,
|
|
7524
8031
|
error: snapshot.error,
|
|
7525
8032
|
isLoading: snapshot.isLoading,
|
|
7526
8033
|
label: snapshot.error ? "Unavailable" : capabilities.length ? warningCount > 0 ? `${warningCount} needs attention` : `${selectedCount} selected` : snapshot.isLoading ? "Checking" : "No capabilities",
|
|
7527
8034
|
status: snapshot.error ? "error" : capabilities.length ? warningCount > 0 ? "warning" : "ready" : snapshot.isLoading ? "loading" : "empty",
|
|
7528
|
-
title: options.title ??
|
|
8035
|
+
title: options.title ?? DEFAULT_TITLE12,
|
|
7529
8036
|
updatedAt: snapshot.updatedAt
|
|
7530
8037
|
};
|
|
7531
8038
|
};
|
|
7532
8039
|
var renderVoiceProviderCapabilitiesHTML = (snapshot, options = {}) => {
|
|
7533
8040
|
const model = createVoiceProviderCapabilitiesViewModel(snapshot, options);
|
|
7534
|
-
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--${
|
|
8041
|
+
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--${escapeHtml18(capability.status)}">
|
|
7535
8042
|
<header>
|
|
7536
|
-
<strong>${
|
|
7537
|
-
<span>${
|
|
8043
|
+
<strong>${escapeHtml18(capability.label)}</strong>
|
|
8044
|
+
<span>${escapeHtml18(formatStatus3(capability.status))}</span>
|
|
7538
8045
|
</header>
|
|
7539
|
-
<p>${
|
|
8046
|
+
<p>${escapeHtml18(capability.detail)}</p>
|
|
7540
8047
|
<dl>${capability.rows.map((row) => `<div>
|
|
7541
|
-
<dt>${
|
|
7542
|
-
<dd>${
|
|
8048
|
+
<dt>${escapeHtml18(row.label)}</dt>
|
|
8049
|
+
<dd>${escapeHtml18(row.value)}</dd>
|
|
7543
8050
|
</div>`).join("")}</dl>
|
|
7544
8051
|
</article>`).join("")}</div>` : '<p class="absolute-voice-provider-capabilities__empty">Configure provider capabilities to see deployment coverage.</p>';
|
|
7545
|
-
return `<section class="absolute-voice-provider-capabilities absolute-voice-provider-capabilities--${
|
|
8052
|
+
return `<section class="absolute-voice-provider-capabilities absolute-voice-provider-capabilities--${escapeHtml18(model.status)}">
|
|
7546
8053
|
<header class="absolute-voice-provider-capabilities__header">
|
|
7547
|
-
<span class="absolute-voice-provider-capabilities__eyebrow">${
|
|
7548
|
-
<strong class="absolute-voice-provider-capabilities__label">${
|
|
8054
|
+
<span class="absolute-voice-provider-capabilities__eyebrow">${escapeHtml18(model.title)}</span>
|
|
8055
|
+
<strong class="absolute-voice-provider-capabilities__label">${escapeHtml18(model.label)}</strong>
|
|
7549
8056
|
</header>
|
|
7550
|
-
<p class="absolute-voice-provider-capabilities__description">${
|
|
8057
|
+
<p class="absolute-voice-provider-capabilities__description">${escapeHtml18(model.description)}</p>
|
|
7551
8058
|
${capabilities}
|
|
7552
|
-
${model.error ? `<p class="absolute-voice-provider-capabilities__error">${
|
|
8059
|
+
${model.error ? `<p class="absolute-voice-provider-capabilities__error">${escapeHtml18(model.error)}</p>` : ""}
|
|
7553
8060
|
</section>`;
|
|
7554
8061
|
};
|
|
7555
8062
|
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}`;
|
|
@@ -7591,7 +8098,7 @@ var defineVoiceProviderCapabilitiesElement = (tagName = "absolute-voice-provider
|
|
|
7591
8098
|
};
|
|
7592
8099
|
|
|
7593
8100
|
// src/react/VoiceProviderCapabilities.tsx
|
|
7594
|
-
import { jsxDEV as
|
|
8101
|
+
import { jsxDEV as jsxDEV13 } from "react/jsx-dev-runtime";
|
|
7595
8102
|
var VoiceProviderCapabilities = ({
|
|
7596
8103
|
className,
|
|
7597
8104
|
path = "/api/provider-capabilities",
|
|
@@ -7599,58 +8106,58 @@ var VoiceProviderCapabilities = ({
|
|
|
7599
8106
|
}) => {
|
|
7600
8107
|
const snapshot = useVoiceProviderCapabilities(path, options);
|
|
7601
8108
|
const model = createVoiceProviderCapabilitiesViewModel(snapshot, options);
|
|
7602
|
-
return /* @__PURE__ */
|
|
8109
|
+
return /* @__PURE__ */ jsxDEV13("section", {
|
|
7603
8110
|
className: [
|
|
7604
8111
|
"absolute-voice-provider-capabilities",
|
|
7605
8112
|
`absolute-voice-provider-capabilities--${model.status}`,
|
|
7606
8113
|
className
|
|
7607
8114
|
].filter(Boolean).join(" "),
|
|
7608
8115
|
children: [
|
|
7609
|
-
/* @__PURE__ */
|
|
8116
|
+
/* @__PURE__ */ jsxDEV13("header", {
|
|
7610
8117
|
className: "absolute-voice-provider-capabilities__header",
|
|
7611
8118
|
children: [
|
|
7612
|
-
/* @__PURE__ */
|
|
8119
|
+
/* @__PURE__ */ jsxDEV13("span", {
|
|
7613
8120
|
className: "absolute-voice-provider-capabilities__eyebrow",
|
|
7614
8121
|
children: model.title
|
|
7615
8122
|
}, undefined, false, undefined, this),
|
|
7616
|
-
/* @__PURE__ */
|
|
8123
|
+
/* @__PURE__ */ jsxDEV13("strong", {
|
|
7617
8124
|
className: "absolute-voice-provider-capabilities__label",
|
|
7618
8125
|
children: model.label
|
|
7619
8126
|
}, undefined, false, undefined, this)
|
|
7620
8127
|
]
|
|
7621
8128
|
}, undefined, true, undefined, this),
|
|
7622
|
-
/* @__PURE__ */
|
|
8129
|
+
/* @__PURE__ */ jsxDEV13("p", {
|
|
7623
8130
|
className: "absolute-voice-provider-capabilities__description",
|
|
7624
8131
|
children: model.description
|
|
7625
8132
|
}, undefined, false, undefined, this),
|
|
7626
|
-
model.capabilities.length ? /* @__PURE__ */
|
|
8133
|
+
model.capabilities.length ? /* @__PURE__ */ jsxDEV13("div", {
|
|
7627
8134
|
className: "absolute-voice-provider-capabilities__providers",
|
|
7628
|
-
children: model.capabilities.map((capability) => /* @__PURE__ */
|
|
8135
|
+
children: model.capabilities.map((capability) => /* @__PURE__ */ jsxDEV13("article", {
|
|
7629
8136
|
className: [
|
|
7630
8137
|
"absolute-voice-provider-capabilities__provider",
|
|
7631
8138
|
`absolute-voice-provider-capabilities__provider--${capability.status}`
|
|
7632
8139
|
].join(" "),
|
|
7633
8140
|
children: [
|
|
7634
|
-
/* @__PURE__ */
|
|
8141
|
+
/* @__PURE__ */ jsxDEV13("header", {
|
|
7635
8142
|
children: [
|
|
7636
|
-
/* @__PURE__ */
|
|
8143
|
+
/* @__PURE__ */ jsxDEV13("strong", {
|
|
7637
8144
|
children: capability.label
|
|
7638
8145
|
}, undefined, false, undefined, this),
|
|
7639
|
-
/* @__PURE__ */
|
|
8146
|
+
/* @__PURE__ */ jsxDEV13("span", {
|
|
7640
8147
|
children: capability.status
|
|
7641
8148
|
}, undefined, false, undefined, this)
|
|
7642
8149
|
]
|
|
7643
8150
|
}, undefined, true, undefined, this),
|
|
7644
|
-
/* @__PURE__ */
|
|
8151
|
+
/* @__PURE__ */ jsxDEV13("p", {
|
|
7645
8152
|
children: capability.detail
|
|
7646
8153
|
}, undefined, false, undefined, this),
|
|
7647
|
-
/* @__PURE__ */
|
|
7648
|
-
children: capability.rows.map((row) => /* @__PURE__ */
|
|
8154
|
+
/* @__PURE__ */ jsxDEV13("dl", {
|
|
8155
|
+
children: capability.rows.map((row) => /* @__PURE__ */ jsxDEV13("div", {
|
|
7649
8156
|
children: [
|
|
7650
|
-
/* @__PURE__ */
|
|
8157
|
+
/* @__PURE__ */ jsxDEV13("dt", {
|
|
7651
8158
|
children: row.label
|
|
7652
8159
|
}, undefined, false, undefined, this),
|
|
7653
|
-
/* @__PURE__ */
|
|
8160
|
+
/* @__PURE__ */ jsxDEV13("dd", {
|
|
7654
8161
|
children: row.value
|
|
7655
8162
|
}, undefined, false, undefined, this)
|
|
7656
8163
|
]
|
|
@@ -7658,11 +8165,11 @@ var VoiceProviderCapabilities = ({
|
|
|
7658
8165
|
}, undefined, false, undefined, this)
|
|
7659
8166
|
]
|
|
7660
8167
|
}, `${capability.kind}:${capability.provider}`, true, undefined, this))
|
|
7661
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
8168
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV13("p", {
|
|
7662
8169
|
className: "absolute-voice-provider-capabilities__empty",
|
|
7663
8170
|
children: "Configure provider capabilities to see deployment coverage."
|
|
7664
8171
|
}, undefined, false, undefined, this),
|
|
7665
|
-
model.error ? /* @__PURE__ */
|
|
8172
|
+
model.error ? /* @__PURE__ */ jsxDEV13("p", {
|
|
7666
8173
|
className: "absolute-voice-provider-capabilities__error",
|
|
7667
8174
|
children: model.error
|
|
7668
8175
|
}, undefined, false, undefined, this) : null
|
|
@@ -7670,7 +8177,7 @@ var VoiceProviderCapabilities = ({
|
|
|
7670
8177
|
}, undefined, true, undefined, this);
|
|
7671
8178
|
};
|
|
7672
8179
|
// src/react/useVoiceProviderContracts.tsx
|
|
7673
|
-
import { useEffect as
|
|
8180
|
+
import { useEffect as useEffect14, useRef as useRef14, useSyncExternalStore as useSyncExternalStore14 } from "react";
|
|
7674
8181
|
|
|
7675
8182
|
// src/client/providerContracts.ts
|
|
7676
8183
|
var fetchVoiceProviderContracts = async (path = "/api/provider-contracts", options = {}) => {
|
|
@@ -7749,25 +8256,25 @@ var createVoiceProviderContractsStore = (path = "/api/provider-contracts", optio
|
|
|
7749
8256
|
|
|
7750
8257
|
// src/react/useVoiceProviderContracts.tsx
|
|
7751
8258
|
var useVoiceProviderContracts = (path = "/api/provider-contracts", options = {}) => {
|
|
7752
|
-
const storeRef =
|
|
8259
|
+
const storeRef = useRef14(null);
|
|
7753
8260
|
if (!storeRef.current) {
|
|
7754
8261
|
storeRef.current = createVoiceProviderContractsStore(path, options);
|
|
7755
8262
|
}
|
|
7756
8263
|
const store = storeRef.current;
|
|
7757
|
-
|
|
8264
|
+
useEffect14(() => {
|
|
7758
8265
|
store.refresh().catch(() => {});
|
|
7759
8266
|
return () => store.close();
|
|
7760
8267
|
}, [store]);
|
|
7761
8268
|
return {
|
|
7762
|
-
...
|
|
8269
|
+
...useSyncExternalStore14(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
7763
8270
|
refresh: store.refresh
|
|
7764
8271
|
};
|
|
7765
8272
|
};
|
|
7766
8273
|
|
|
7767
8274
|
// src/client/providerContractsWidget.ts
|
|
7768
|
-
var
|
|
7769
|
-
var
|
|
7770
|
-
var
|
|
8275
|
+
var DEFAULT_TITLE13 = "Provider Contracts";
|
|
8276
|
+
var DEFAULT_DESCRIPTION13 = "Production contract coverage for provider env, latency, fallback, streaming, and capabilities.";
|
|
8277
|
+
var escapeHtml19 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
7771
8278
|
var formatProvider2 = (provider) => provider.split(/[-_\s]+/).filter(Boolean).map((part) => `${part[0]?.toUpperCase() ?? ""}${part.slice(1)}`).join(" ") || provider;
|
|
7772
8279
|
var formatStatus4 = (status) => status.split("-").map((part) => `${part[0]?.toUpperCase() ?? ""}${part.slice(1)}`).join(" ");
|
|
7773
8280
|
var contractDetail = (row) => {
|
|
@@ -7799,38 +8306,38 @@ var createVoiceProviderContractsViewModel = (snapshot, options = {}) => {
|
|
|
7799
8306
|
}));
|
|
7800
8307
|
const warningCount = snapshot.report ? snapshot.report.failed + snapshot.report.warned : rows.filter((row) => row.status !== "pass").length;
|
|
7801
8308
|
return {
|
|
7802
|
-
description: options.description ??
|
|
8309
|
+
description: options.description ?? DEFAULT_DESCRIPTION13,
|
|
7803
8310
|
error: snapshot.error,
|
|
7804
8311
|
isLoading: snapshot.isLoading,
|
|
7805
8312
|
label: snapshot.error ? "Unavailable" : rows.length ? warningCount > 0 ? `${warningCount} needs attention` : `${rows.length} passing` : snapshot.isLoading ? "Checking" : "No contracts",
|
|
7806
8313
|
rows,
|
|
7807
8314
|
status: snapshot.error ? "error" : rows.length ? warningCount > 0 ? "warning" : "ready" : snapshot.isLoading ? "loading" : "empty",
|
|
7808
|
-
title: options.title ??
|
|
8315
|
+
title: options.title ?? DEFAULT_TITLE13,
|
|
7809
8316
|
updatedAt: snapshot.updatedAt
|
|
7810
8317
|
};
|
|
7811
8318
|
};
|
|
7812
8319
|
var renderVoiceProviderContractsHTML = (snapshot, options = {}) => {
|
|
7813
8320
|
const model = createVoiceProviderContractsViewModel(snapshot, options);
|
|
7814
|
-
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--${
|
|
8321
|
+
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--${escapeHtml19(row.status)}">
|
|
7815
8322
|
<header>
|
|
7816
|
-
<strong>${
|
|
7817
|
-
<span>${
|
|
8323
|
+
<strong>${escapeHtml19(row.label)}</strong>
|
|
8324
|
+
<span>${escapeHtml19(formatStatus4(row.status))}</span>
|
|
7818
8325
|
</header>
|
|
7819
|
-
<p>${
|
|
7820
|
-
${row.remediations.length ? `<ul class="absolute-voice-provider-contracts__remediations">${row.remediations.map((remediation) => `<li>${remediation.href ? `<a href="${
|
|
8326
|
+
<p>${escapeHtml19(row.detail)}</p>
|
|
8327
|
+
${row.remediations.length ? `<ul class="absolute-voice-provider-contracts__remediations">${row.remediations.map((remediation) => `<li>${remediation.href ? `<a href="${escapeHtml19(remediation.href)}">${escapeHtml19(remediation.label)}</a>` : `<strong>${escapeHtml19(remediation.label)}</strong>`}<span>${escapeHtml19(remediation.detail)}</span></li>`).join("")}</ul>` : ""}
|
|
7821
8328
|
<dl>${row.rows.map((item) => `<div>
|
|
7822
|
-
<dt>${
|
|
7823
|
-
<dd>${
|
|
8329
|
+
<dt>${escapeHtml19(item.label)}</dt>
|
|
8330
|
+
<dd>${escapeHtml19(item.value)}</dd>
|
|
7824
8331
|
</div>`).join("")}</dl>
|
|
7825
8332
|
</article>`).join("")}</div>` : '<p class="absolute-voice-provider-contracts__empty">Configure provider contracts to see production coverage.</p>';
|
|
7826
|
-
return `<section class="absolute-voice-provider-contracts absolute-voice-provider-contracts--${
|
|
8333
|
+
return `<section class="absolute-voice-provider-contracts absolute-voice-provider-contracts--${escapeHtml19(model.status)}">
|
|
7827
8334
|
<header class="absolute-voice-provider-contracts__header">
|
|
7828
|
-
<span class="absolute-voice-provider-contracts__eyebrow">${
|
|
7829
|
-
<strong class="absolute-voice-provider-contracts__label">${
|
|
8335
|
+
<span class="absolute-voice-provider-contracts__eyebrow">${escapeHtml19(model.title)}</span>
|
|
8336
|
+
<strong class="absolute-voice-provider-contracts__label">${escapeHtml19(model.label)}</strong>
|
|
7830
8337
|
</header>
|
|
7831
|
-
<p class="absolute-voice-provider-contracts__description">${
|
|
8338
|
+
<p class="absolute-voice-provider-contracts__description">${escapeHtml19(model.description)}</p>
|
|
7832
8339
|
${rows}
|
|
7833
|
-
${model.error ? `<p class="absolute-voice-provider-contracts__error">${
|
|
8340
|
+
${model.error ? `<p class="absolute-voice-provider-contracts__error">${escapeHtml19(model.error)}</p>` : ""}
|
|
7834
8341
|
</section>`;
|
|
7835
8342
|
};
|
|
7836
8343
|
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}`;
|
|
@@ -7872,7 +8379,7 @@ var defineVoiceProviderContractsElement = (tagName = "absolute-voice-provider-co
|
|
|
7872
8379
|
};
|
|
7873
8380
|
|
|
7874
8381
|
// src/react/VoiceProviderContracts.tsx
|
|
7875
|
-
import { jsxDEV as
|
|
8382
|
+
import { jsxDEV as jsxDEV14 } from "react/jsx-dev-runtime";
|
|
7876
8383
|
var VoiceProviderContracts = ({
|
|
7877
8384
|
className,
|
|
7878
8385
|
path = "/api/provider-contracts",
|
|
@@ -7880,74 +8387,74 @@ var VoiceProviderContracts = ({
|
|
|
7880
8387
|
}) => {
|
|
7881
8388
|
const snapshot = useVoiceProviderContracts(path, options);
|
|
7882
8389
|
const model = createVoiceProviderContractsViewModel(snapshot, options);
|
|
7883
|
-
return /* @__PURE__ */
|
|
8390
|
+
return /* @__PURE__ */ jsxDEV14("section", {
|
|
7884
8391
|
className: [
|
|
7885
8392
|
"absolute-voice-provider-contracts",
|
|
7886
8393
|
`absolute-voice-provider-contracts--${model.status}`,
|
|
7887
8394
|
className
|
|
7888
8395
|
].filter(Boolean).join(" "),
|
|
7889
8396
|
children: [
|
|
7890
|
-
/* @__PURE__ */
|
|
8397
|
+
/* @__PURE__ */ jsxDEV14("header", {
|
|
7891
8398
|
className: "absolute-voice-provider-contracts__header",
|
|
7892
8399
|
children: [
|
|
7893
|
-
/* @__PURE__ */
|
|
8400
|
+
/* @__PURE__ */ jsxDEV14("span", {
|
|
7894
8401
|
className: "absolute-voice-provider-contracts__eyebrow",
|
|
7895
8402
|
children: model.title
|
|
7896
8403
|
}, undefined, false, undefined, this),
|
|
7897
|
-
/* @__PURE__ */
|
|
8404
|
+
/* @__PURE__ */ jsxDEV14("strong", {
|
|
7898
8405
|
className: "absolute-voice-provider-contracts__label",
|
|
7899
8406
|
children: model.label
|
|
7900
8407
|
}, undefined, false, undefined, this)
|
|
7901
8408
|
]
|
|
7902
8409
|
}, undefined, true, undefined, this),
|
|
7903
|
-
/* @__PURE__ */
|
|
8410
|
+
/* @__PURE__ */ jsxDEV14("p", {
|
|
7904
8411
|
className: "absolute-voice-provider-contracts__description",
|
|
7905
8412
|
children: model.description
|
|
7906
8413
|
}, undefined, false, undefined, this),
|
|
7907
|
-
model.rows.length ? /* @__PURE__ */
|
|
8414
|
+
model.rows.length ? /* @__PURE__ */ jsxDEV14("div", {
|
|
7908
8415
|
className: "absolute-voice-provider-contracts__rows",
|
|
7909
|
-
children: model.rows.map((row) => /* @__PURE__ */
|
|
8416
|
+
children: model.rows.map((row) => /* @__PURE__ */ jsxDEV14("article", {
|
|
7910
8417
|
className: [
|
|
7911
8418
|
"absolute-voice-provider-contracts__row",
|
|
7912
8419
|
`absolute-voice-provider-contracts__row--${row.status}`
|
|
7913
8420
|
].join(" "),
|
|
7914
8421
|
children: [
|
|
7915
|
-
/* @__PURE__ */
|
|
8422
|
+
/* @__PURE__ */ jsxDEV14("header", {
|
|
7916
8423
|
children: [
|
|
7917
|
-
/* @__PURE__ */
|
|
8424
|
+
/* @__PURE__ */ jsxDEV14("strong", {
|
|
7918
8425
|
children: row.label
|
|
7919
8426
|
}, undefined, false, undefined, this),
|
|
7920
|
-
/* @__PURE__ */
|
|
8427
|
+
/* @__PURE__ */ jsxDEV14("span", {
|
|
7921
8428
|
children: row.status
|
|
7922
8429
|
}, undefined, false, undefined, this)
|
|
7923
8430
|
]
|
|
7924
8431
|
}, undefined, true, undefined, this),
|
|
7925
|
-
/* @__PURE__ */
|
|
8432
|
+
/* @__PURE__ */ jsxDEV14("p", {
|
|
7926
8433
|
children: row.detail
|
|
7927
8434
|
}, undefined, false, undefined, this),
|
|
7928
|
-
row.remediations.length ? /* @__PURE__ */
|
|
8435
|
+
row.remediations.length ? /* @__PURE__ */ jsxDEV14("ul", {
|
|
7929
8436
|
className: "absolute-voice-provider-contracts__remediations",
|
|
7930
|
-
children: row.remediations.map((remediation) => /* @__PURE__ */
|
|
8437
|
+
children: row.remediations.map((remediation) => /* @__PURE__ */ jsxDEV14("li", {
|
|
7931
8438
|
children: [
|
|
7932
|
-
remediation.href ? /* @__PURE__ */
|
|
8439
|
+
remediation.href ? /* @__PURE__ */ jsxDEV14("a", {
|
|
7933
8440
|
href: remediation.href,
|
|
7934
8441
|
children: remediation.label
|
|
7935
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
8442
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV14("strong", {
|
|
7936
8443
|
children: remediation.label
|
|
7937
8444
|
}, undefined, false, undefined, this),
|
|
7938
|
-
/* @__PURE__ */
|
|
8445
|
+
/* @__PURE__ */ jsxDEV14("span", {
|
|
7939
8446
|
children: remediation.detail
|
|
7940
8447
|
}, undefined, false, undefined, this)
|
|
7941
8448
|
]
|
|
7942
8449
|
}, `${row.kind}:${row.provider}:${remediation.label}`, true, undefined, this))
|
|
7943
8450
|
}, undefined, false, undefined, this) : null,
|
|
7944
|
-
/* @__PURE__ */
|
|
7945
|
-
children: row.rows.map((item) => /* @__PURE__ */
|
|
8451
|
+
/* @__PURE__ */ jsxDEV14("dl", {
|
|
8452
|
+
children: row.rows.map((item) => /* @__PURE__ */ jsxDEV14("div", {
|
|
7946
8453
|
children: [
|
|
7947
|
-
/* @__PURE__ */
|
|
8454
|
+
/* @__PURE__ */ jsxDEV14("dt", {
|
|
7948
8455
|
children: item.label
|
|
7949
8456
|
}, undefined, false, undefined, this),
|
|
7950
|
-
/* @__PURE__ */
|
|
8457
|
+
/* @__PURE__ */ jsxDEV14("dd", {
|
|
7951
8458
|
children: item.value
|
|
7952
8459
|
}, undefined, false, undefined, this)
|
|
7953
8460
|
]
|
|
@@ -7955,11 +8462,11 @@ var VoiceProviderContracts = ({
|
|
|
7955
8462
|
}, undefined, false, undefined, this)
|
|
7956
8463
|
]
|
|
7957
8464
|
}, `${row.kind}:${row.provider}`, true, undefined, this))
|
|
7958
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
8465
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV14("p", {
|
|
7959
8466
|
className: "absolute-voice-provider-contracts__empty",
|
|
7960
8467
|
children: "Configure provider contracts to see production coverage."
|
|
7961
8468
|
}, undefined, false, undefined, this),
|
|
7962
|
-
model.error ? /* @__PURE__ */
|
|
8469
|
+
model.error ? /* @__PURE__ */ jsxDEV14("p", {
|
|
7963
8470
|
className: "absolute-voice-provider-contracts__error",
|
|
7964
8471
|
children: model.error
|
|
7965
8472
|
}, undefined, false, undefined, this) : null
|
|
@@ -7967,7 +8474,7 @@ var VoiceProviderContracts = ({
|
|
|
7967
8474
|
}, undefined, true, undefined, this);
|
|
7968
8475
|
};
|
|
7969
8476
|
// src/react/useVoiceProviderStatus.tsx
|
|
7970
|
-
import { useEffect as
|
|
8477
|
+
import { useEffect as useEffect15, useRef as useRef15, useSyncExternalStore as useSyncExternalStore15 } from "react";
|
|
7971
8478
|
|
|
7972
8479
|
// src/client/providerStatus.ts
|
|
7973
8480
|
var fetchVoiceProviderStatus = async (path = "/api/provider-status", options = {}) => {
|
|
@@ -8051,25 +8558,25 @@ var createVoiceProviderStatusStore = (path = "/api/provider-status", options = {
|
|
|
8051
8558
|
|
|
8052
8559
|
// src/react/useVoiceProviderStatus.tsx
|
|
8053
8560
|
var useVoiceProviderStatus = (path = "/api/provider-status", options = {}) => {
|
|
8054
|
-
const storeRef =
|
|
8561
|
+
const storeRef = useRef15(null);
|
|
8055
8562
|
if (!storeRef.current) {
|
|
8056
8563
|
storeRef.current = createVoiceProviderStatusStore(path, options);
|
|
8057
8564
|
}
|
|
8058
8565
|
const store = storeRef.current;
|
|
8059
|
-
|
|
8566
|
+
useEffect15(() => {
|
|
8060
8567
|
store.refresh().catch(() => {});
|
|
8061
8568
|
return () => store.close();
|
|
8062
8569
|
}, [store]);
|
|
8063
8570
|
return {
|
|
8064
|
-
...
|
|
8571
|
+
...useSyncExternalStore15(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
8065
8572
|
refresh: store.refresh
|
|
8066
8573
|
};
|
|
8067
8574
|
};
|
|
8068
8575
|
|
|
8069
8576
|
// src/client/providerStatusWidget.ts
|
|
8070
|
-
var
|
|
8071
|
-
var
|
|
8072
|
-
var
|
|
8577
|
+
var DEFAULT_TITLE14 = "Voice Providers";
|
|
8578
|
+
var DEFAULT_DESCRIPTION14 = "Live provider health, fallback counts, latency, and suppression state from your self-hosted trace store.";
|
|
8579
|
+
var escapeHtml20 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
8073
8580
|
var formatProvider3 = (provider) => provider.split(/[-_\s]+/).filter(Boolean).map((part) => `${part[0]?.toUpperCase() ?? ""}${part.slice(1)}`).join(" ") || provider;
|
|
8074
8581
|
var formatStatus5 = (status) => status.split("-").map((part) => `${part[0]?.toUpperCase() ?? ""}${part.slice(1)}`).join(" ");
|
|
8075
8582
|
var formatLatency = (value) => typeof value === "number" ? `${value}ms` : "No samples";
|
|
@@ -8113,37 +8620,37 @@ var createVoiceProviderStatusViewModel = (snapshot, options = {}) => {
|
|
|
8113
8620
|
const warningCount = providers.filter((provider) => isWarningStatus2(provider.status)).length;
|
|
8114
8621
|
const healthyCount = providers.filter((provider) => provider.status === "healthy").length;
|
|
8115
8622
|
return {
|
|
8116
|
-
description: options.description ??
|
|
8623
|
+
description: options.description ?? DEFAULT_DESCRIPTION14,
|
|
8117
8624
|
error: snapshot.error,
|
|
8118
8625
|
isLoading: snapshot.isLoading,
|
|
8119
8626
|
label: snapshot.error ? "Unavailable" : providers.length ? warningCount > 0 ? `${warningCount} needs attention` : `${healthyCount} healthy` : snapshot.isLoading ? "Checking" : "No provider traffic",
|
|
8120
8627
|
providers,
|
|
8121
8628
|
status: snapshot.error ? "error" : providers.length ? warningCount > 0 ? "warning" : "ready" : snapshot.isLoading ? "loading" : "empty",
|
|
8122
|
-
title: options.title ??
|
|
8629
|
+
title: options.title ?? DEFAULT_TITLE14,
|
|
8123
8630
|
updatedAt: snapshot.updatedAt
|
|
8124
8631
|
};
|
|
8125
8632
|
};
|
|
8126
8633
|
var renderVoiceProviderStatusHTML = (snapshot, options = {}) => {
|
|
8127
8634
|
const model = createVoiceProviderStatusViewModel(snapshot, options);
|
|
8128
|
-
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--${
|
|
8635
|
+
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--${escapeHtml20(provider.status)}">
|
|
8129
8636
|
<header>
|
|
8130
|
-
<strong>${
|
|
8131
|
-
<span>${
|
|
8637
|
+
<strong>${escapeHtml20(provider.label)}</strong>
|
|
8638
|
+
<span>${escapeHtml20(formatStatus5(provider.status))}</span>
|
|
8132
8639
|
</header>
|
|
8133
|
-
<p>${
|
|
8640
|
+
<p>${escapeHtml20(provider.detail)}</p>
|
|
8134
8641
|
<dl>${provider.rows.map((row) => `<div>
|
|
8135
|
-
<dt>${
|
|
8136
|
-
<dd>${
|
|
8642
|
+
<dt>${escapeHtml20(row.label)}</dt>
|
|
8643
|
+
<dd>${escapeHtml20(row.value)}</dd>
|
|
8137
8644
|
</div>`).join("")}</dl>
|
|
8138
8645
|
</article>`).join("")}</div>` : '<p class="absolute-voice-provider-status__empty">Run voice traffic to see provider health.</p>';
|
|
8139
|
-
return `<section class="absolute-voice-provider-status absolute-voice-provider-status--${
|
|
8646
|
+
return `<section class="absolute-voice-provider-status absolute-voice-provider-status--${escapeHtml20(model.status)}">
|
|
8140
8647
|
<header class="absolute-voice-provider-status__header">
|
|
8141
|
-
<span class="absolute-voice-provider-status__eyebrow">${
|
|
8142
|
-
<strong class="absolute-voice-provider-status__label">${
|
|
8648
|
+
<span class="absolute-voice-provider-status__eyebrow">${escapeHtml20(model.title)}</span>
|
|
8649
|
+
<strong class="absolute-voice-provider-status__label">${escapeHtml20(model.label)}</strong>
|
|
8143
8650
|
</header>
|
|
8144
|
-
<p class="absolute-voice-provider-status__description">${
|
|
8651
|
+
<p class="absolute-voice-provider-status__description">${escapeHtml20(model.description)}</p>
|
|
8145
8652
|
${providers}
|
|
8146
|
-
${model.error ? `<p class="absolute-voice-provider-status__error">${
|
|
8653
|
+
${model.error ? `<p class="absolute-voice-provider-status__error">${escapeHtml20(model.error)}</p>` : ""}
|
|
8147
8654
|
</section>`;
|
|
8148
8655
|
};
|
|
8149
8656
|
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}`;
|
|
@@ -8185,7 +8692,7 @@ var defineVoiceProviderStatusElement = (tagName = "absolute-voice-provider-statu
|
|
|
8185
8692
|
};
|
|
8186
8693
|
|
|
8187
8694
|
// src/react/VoiceProviderStatus.tsx
|
|
8188
|
-
import { jsxDEV as
|
|
8695
|
+
import { jsxDEV as jsxDEV15 } from "react/jsx-dev-runtime";
|
|
8189
8696
|
var VoiceProviderStatus = ({
|
|
8190
8697
|
className,
|
|
8191
8698
|
path = "/api/provider-status",
|
|
@@ -8193,58 +8700,58 @@ var VoiceProviderStatus = ({
|
|
|
8193
8700
|
}) => {
|
|
8194
8701
|
const snapshot = useVoiceProviderStatus(path, options);
|
|
8195
8702
|
const model = createVoiceProviderStatusViewModel(snapshot, options);
|
|
8196
|
-
return /* @__PURE__ */
|
|
8703
|
+
return /* @__PURE__ */ jsxDEV15("section", {
|
|
8197
8704
|
className: [
|
|
8198
8705
|
"absolute-voice-provider-status",
|
|
8199
8706
|
`absolute-voice-provider-status--${model.status}`,
|
|
8200
8707
|
className
|
|
8201
8708
|
].filter(Boolean).join(" "),
|
|
8202
8709
|
children: [
|
|
8203
|
-
/* @__PURE__ */
|
|
8710
|
+
/* @__PURE__ */ jsxDEV15("header", {
|
|
8204
8711
|
className: "absolute-voice-provider-status__header",
|
|
8205
8712
|
children: [
|
|
8206
|
-
/* @__PURE__ */
|
|
8713
|
+
/* @__PURE__ */ jsxDEV15("span", {
|
|
8207
8714
|
className: "absolute-voice-provider-status__eyebrow",
|
|
8208
8715
|
children: model.title
|
|
8209
8716
|
}, undefined, false, undefined, this),
|
|
8210
|
-
/* @__PURE__ */
|
|
8717
|
+
/* @__PURE__ */ jsxDEV15("strong", {
|
|
8211
8718
|
className: "absolute-voice-provider-status__label",
|
|
8212
8719
|
children: model.label
|
|
8213
8720
|
}, undefined, false, undefined, this)
|
|
8214
8721
|
]
|
|
8215
8722
|
}, undefined, true, undefined, this),
|
|
8216
|
-
/* @__PURE__ */
|
|
8723
|
+
/* @__PURE__ */ jsxDEV15("p", {
|
|
8217
8724
|
className: "absolute-voice-provider-status__description",
|
|
8218
8725
|
children: model.description
|
|
8219
8726
|
}, undefined, false, undefined, this),
|
|
8220
|
-
model.providers.length ? /* @__PURE__ */
|
|
8727
|
+
model.providers.length ? /* @__PURE__ */ jsxDEV15("div", {
|
|
8221
8728
|
className: "absolute-voice-provider-status__providers",
|
|
8222
|
-
children: model.providers.map((provider) => /* @__PURE__ */
|
|
8729
|
+
children: model.providers.map((provider) => /* @__PURE__ */ jsxDEV15("article", {
|
|
8223
8730
|
className: [
|
|
8224
8731
|
"absolute-voice-provider-status__provider",
|
|
8225
8732
|
`absolute-voice-provider-status__provider--${provider.status}`
|
|
8226
8733
|
].join(" "),
|
|
8227
8734
|
children: [
|
|
8228
|
-
/* @__PURE__ */
|
|
8735
|
+
/* @__PURE__ */ jsxDEV15("header", {
|
|
8229
8736
|
children: [
|
|
8230
|
-
/* @__PURE__ */
|
|
8737
|
+
/* @__PURE__ */ jsxDEV15("strong", {
|
|
8231
8738
|
children: provider.label
|
|
8232
8739
|
}, undefined, false, undefined, this),
|
|
8233
|
-
/* @__PURE__ */
|
|
8740
|
+
/* @__PURE__ */ jsxDEV15("span", {
|
|
8234
8741
|
children: provider.status
|
|
8235
8742
|
}, undefined, false, undefined, this)
|
|
8236
8743
|
]
|
|
8237
8744
|
}, undefined, true, undefined, this),
|
|
8238
|
-
/* @__PURE__ */
|
|
8745
|
+
/* @__PURE__ */ jsxDEV15("p", {
|
|
8239
8746
|
children: provider.detail
|
|
8240
8747
|
}, undefined, false, undefined, this),
|
|
8241
|
-
/* @__PURE__ */
|
|
8242
|
-
children: provider.rows.map((row) => /* @__PURE__ */
|
|
8748
|
+
/* @__PURE__ */ jsxDEV15("dl", {
|
|
8749
|
+
children: provider.rows.map((row) => /* @__PURE__ */ jsxDEV15("div", {
|
|
8243
8750
|
children: [
|
|
8244
|
-
/* @__PURE__ */
|
|
8751
|
+
/* @__PURE__ */ jsxDEV15("dt", {
|
|
8245
8752
|
children: row.label
|
|
8246
8753
|
}, undefined, false, undefined, this),
|
|
8247
|
-
/* @__PURE__ */
|
|
8754
|
+
/* @__PURE__ */ jsxDEV15("dd", {
|
|
8248
8755
|
children: row.value
|
|
8249
8756
|
}, undefined, false, undefined, this)
|
|
8250
8757
|
]
|
|
@@ -8252,11 +8759,11 @@ var VoiceProviderStatus = ({
|
|
|
8252
8759
|
}, undefined, false, undefined, this)
|
|
8253
8760
|
]
|
|
8254
8761
|
}, provider.provider, true, undefined, this))
|
|
8255
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
8762
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV15("p", {
|
|
8256
8763
|
className: "absolute-voice-provider-status__empty",
|
|
8257
8764
|
children: "Run voice traffic to see provider health."
|
|
8258
8765
|
}, undefined, false, undefined, this),
|
|
8259
|
-
model.error ? /* @__PURE__ */
|
|
8766
|
+
model.error ? /* @__PURE__ */ jsxDEV15("p", {
|
|
8260
8767
|
className: "absolute-voice-provider-status__error",
|
|
8261
8768
|
children: model.error
|
|
8262
8769
|
}, undefined, false, undefined, this) : null
|
|
@@ -8264,7 +8771,7 @@ var VoiceProviderStatus = ({
|
|
|
8264
8771
|
}, undefined, true, undefined, this);
|
|
8265
8772
|
};
|
|
8266
8773
|
// src/react/useVoiceRoutingStatus.tsx
|
|
8267
|
-
import { useEffect as
|
|
8774
|
+
import { useEffect as useEffect16, useRef as useRef16, useSyncExternalStore as useSyncExternalStore16 } from "react";
|
|
8268
8775
|
|
|
8269
8776
|
// src/client/routingStatus.ts
|
|
8270
8777
|
var fetchVoiceRoutingStatus = async (path = "/api/routing/latest", options = {}) => {
|
|
@@ -8348,25 +8855,25 @@ var createVoiceRoutingStatusStore = (path = "/api/routing/latest", options = {})
|
|
|
8348
8855
|
|
|
8349
8856
|
// src/react/useVoiceRoutingStatus.tsx
|
|
8350
8857
|
var useVoiceRoutingStatus = (path = "/api/routing/latest", options = {}) => {
|
|
8351
|
-
const storeRef =
|
|
8858
|
+
const storeRef = useRef16(null);
|
|
8352
8859
|
if (!storeRef.current) {
|
|
8353
8860
|
storeRef.current = createVoiceRoutingStatusStore(path, options);
|
|
8354
8861
|
}
|
|
8355
8862
|
const store = storeRef.current;
|
|
8356
|
-
|
|
8863
|
+
useEffect16(() => {
|
|
8357
8864
|
store.refresh().catch(() => {});
|
|
8358
8865
|
return () => store.close();
|
|
8359
8866
|
}, [store]);
|
|
8360
8867
|
return {
|
|
8361
|
-
...
|
|
8868
|
+
...useSyncExternalStore16(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
8362
8869
|
refresh: store.refresh
|
|
8363
8870
|
};
|
|
8364
8871
|
};
|
|
8365
8872
|
|
|
8366
8873
|
// src/client/routingStatusWidget.ts
|
|
8367
|
-
var
|
|
8368
|
-
var
|
|
8369
|
-
var
|
|
8874
|
+
var DEFAULT_TITLE15 = "Voice Routing";
|
|
8875
|
+
var DEFAULT_DESCRIPTION15 = "Latest provider routing decision from the self-hosted trace store.";
|
|
8876
|
+
var escapeHtml21 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
8370
8877
|
var formatValue = (value, fallback = "None") => typeof value === "string" && value.trim() ? value : typeof value === "number" && Number.isFinite(value) ? String(value) : fallback;
|
|
8371
8878
|
var formatProviderRoutes2 = (routes) => routes && typeof routes === "object" ? Object.entries(routes).map(([role, provider]) => `${role}: ${formatValue(provider)}`).join(", ") || "None" : "None";
|
|
8372
8879
|
var getProviderRoute = (routes, role) => routes && typeof routes === "object" ? formatValue(routes[role], "Not configured") : "Not configured";
|
|
@@ -8435,35 +8942,35 @@ var createVoiceRoutingStatusViewModel = (snapshot, options = {}) => {
|
|
|
8435
8942
|
return {
|
|
8436
8943
|
activeStack,
|
|
8437
8944
|
decision,
|
|
8438
|
-
description: options.description ??
|
|
8945
|
+
description: options.description ?? DEFAULT_DESCRIPTION15,
|
|
8439
8946
|
error: snapshot.error,
|
|
8440
8947
|
isLoading: snapshot.isLoading,
|
|
8441
8948
|
label: snapshot.error ? "Unavailable" : decision ? `${formatValue(decision.kind).toUpperCase()} ${formatValue(decision.status, "unknown")}` : snapshot.isLoading ? "Checking" : "No routing yet",
|
|
8442
8949
|
rows,
|
|
8443
8950
|
status: snapshot.error ? "error" : decision ? "ready" : snapshot.isLoading ? "loading" : "empty",
|
|
8444
|
-
title: options.title ??
|
|
8951
|
+
title: options.title ?? DEFAULT_TITLE15,
|
|
8445
8952
|
updatedAt: snapshot.updatedAt
|
|
8446
8953
|
};
|
|
8447
8954
|
};
|
|
8448
8955
|
var renderVoiceRoutingStatusHTML = (snapshot, options = {}) => {
|
|
8449
8956
|
const model = createVoiceRoutingStatusViewModel(snapshot, options);
|
|
8450
8957
|
const activeStack = model.activeStack.length ? `<div class="absolute-voice-routing-status__stack" aria-label="Active voice stack">${model.activeStack.map((item) => `<div>
|
|
8451
|
-
<span>${
|
|
8452
|
-
<strong>${
|
|
8958
|
+
<span>${escapeHtml21(item.label)}</span>
|
|
8959
|
+
<strong>${escapeHtml21(item.value)}</strong>
|
|
8453
8960
|
</div>`).join("")}</div>` : "";
|
|
8454
8961
|
const rows = model.rows.length ? `<div class="absolute-voice-routing-status__grid">${model.rows.map((row) => `<div>
|
|
8455
|
-
<span>${
|
|
8456
|
-
<strong>${
|
|
8962
|
+
<span>${escapeHtml21(row.label)}</span>
|
|
8963
|
+
<strong>${escapeHtml21(row.value)}</strong>
|
|
8457
8964
|
</div>`).join("")}</div>` : '<p class="absolute-voice-routing-status__empty">Start a voice session to see the selected provider.</p>';
|
|
8458
|
-
return `<section class="absolute-voice-routing-status absolute-voice-routing-status--${
|
|
8965
|
+
return `<section class="absolute-voice-routing-status absolute-voice-routing-status--${escapeHtml21(model.status)}">
|
|
8459
8966
|
<header class="absolute-voice-routing-status__header">
|
|
8460
|
-
<span class="absolute-voice-routing-status__eyebrow">${
|
|
8461
|
-
<strong class="absolute-voice-routing-status__label">${
|
|
8967
|
+
<span class="absolute-voice-routing-status__eyebrow">${escapeHtml21(model.title)}</span>
|
|
8968
|
+
<strong class="absolute-voice-routing-status__label">${escapeHtml21(model.label)}</strong>
|
|
8462
8969
|
</header>
|
|
8463
|
-
<p class="absolute-voice-routing-status__description">${
|
|
8970
|
+
<p class="absolute-voice-routing-status__description">${escapeHtml21(model.description)}</p>
|
|
8464
8971
|
${activeStack}
|
|
8465
8972
|
${rows}
|
|
8466
|
-
${model.error ? `<p class="absolute-voice-routing-status__error">${
|
|
8973
|
+
${model.error ? `<p class="absolute-voice-routing-status__error">${escapeHtml21(model.error)}</p>` : ""}
|
|
8467
8974
|
</section>`;
|
|
8468
8975
|
};
|
|
8469
8976
|
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}}`;
|
|
@@ -8505,7 +9012,7 @@ var defineVoiceRoutingStatusElement = (tagName = "absolute-voice-routing-status"
|
|
|
8505
9012
|
};
|
|
8506
9013
|
|
|
8507
9014
|
// src/react/VoiceRoutingStatus.tsx
|
|
8508
|
-
import { jsxDEV as
|
|
9015
|
+
import { jsxDEV as jsxDEV16 } from "react/jsx-dev-runtime";
|
|
8509
9016
|
var VoiceRoutingStatus = ({
|
|
8510
9017
|
className,
|
|
8511
9018
|
path = "/api/routing/latest",
|
|
@@ -8513,47 +9020,47 @@ var VoiceRoutingStatus = ({
|
|
|
8513
9020
|
}) => {
|
|
8514
9021
|
const snapshot = useVoiceRoutingStatus(path, options);
|
|
8515
9022
|
const model = createVoiceRoutingStatusViewModel(snapshot, options);
|
|
8516
|
-
return /* @__PURE__ */
|
|
9023
|
+
return /* @__PURE__ */ jsxDEV16("section", {
|
|
8517
9024
|
className: [
|
|
8518
9025
|
"absolute-voice-routing-status",
|
|
8519
9026
|
`absolute-voice-routing-status--${model.status}`,
|
|
8520
9027
|
className
|
|
8521
9028
|
].filter(Boolean).join(" "),
|
|
8522
9029
|
children: [
|
|
8523
|
-
/* @__PURE__ */
|
|
9030
|
+
/* @__PURE__ */ jsxDEV16("header", {
|
|
8524
9031
|
className: "absolute-voice-routing-status__header",
|
|
8525
9032
|
children: [
|
|
8526
|
-
/* @__PURE__ */
|
|
9033
|
+
/* @__PURE__ */ jsxDEV16("span", {
|
|
8527
9034
|
className: "absolute-voice-routing-status__eyebrow",
|
|
8528
9035
|
children: model.title
|
|
8529
9036
|
}, undefined, false, undefined, this),
|
|
8530
|
-
/* @__PURE__ */
|
|
9037
|
+
/* @__PURE__ */ jsxDEV16("strong", {
|
|
8531
9038
|
className: "absolute-voice-routing-status__label",
|
|
8532
9039
|
children: model.label
|
|
8533
9040
|
}, undefined, false, undefined, this)
|
|
8534
9041
|
]
|
|
8535
9042
|
}, undefined, true, undefined, this),
|
|
8536
|
-
/* @__PURE__ */
|
|
9043
|
+
/* @__PURE__ */ jsxDEV16("p", {
|
|
8537
9044
|
className: "absolute-voice-routing-status__description",
|
|
8538
9045
|
children: model.description
|
|
8539
9046
|
}, undefined, false, undefined, this),
|
|
8540
|
-
model.rows.length ? /* @__PURE__ */
|
|
9047
|
+
model.rows.length ? /* @__PURE__ */ jsxDEV16("div", {
|
|
8541
9048
|
className: "absolute-voice-routing-status__grid",
|
|
8542
|
-
children: model.rows.map((row) => /* @__PURE__ */
|
|
9049
|
+
children: model.rows.map((row) => /* @__PURE__ */ jsxDEV16("div", {
|
|
8543
9050
|
children: [
|
|
8544
|
-
/* @__PURE__ */
|
|
9051
|
+
/* @__PURE__ */ jsxDEV16("span", {
|
|
8545
9052
|
children: row.label
|
|
8546
9053
|
}, undefined, false, undefined, this),
|
|
8547
|
-
/* @__PURE__ */
|
|
9054
|
+
/* @__PURE__ */ jsxDEV16("strong", {
|
|
8548
9055
|
children: row.value
|
|
8549
9056
|
}, undefined, false, undefined, this)
|
|
8550
9057
|
]
|
|
8551
9058
|
}, row.label, true, undefined, this))
|
|
8552
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
9059
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV16("p", {
|
|
8553
9060
|
className: "absolute-voice-routing-status__empty",
|
|
8554
9061
|
children: "Start a voice session to see the selected provider."
|
|
8555
9062
|
}, undefined, false, undefined, this),
|
|
8556
|
-
model.error ? /* @__PURE__ */
|
|
9063
|
+
model.error ? /* @__PURE__ */ jsxDEV16("p", {
|
|
8557
9064
|
className: "absolute-voice-routing-status__error",
|
|
8558
9065
|
children: model.error
|
|
8559
9066
|
}, undefined, false, undefined, this) : null
|
|
@@ -8641,16 +9148,16 @@ var createVoiceTraceTimelineStore = (path = "/api/voice-traces", options = {}) =
|
|
|
8641
9148
|
};
|
|
8642
9149
|
|
|
8643
9150
|
// src/client/traceTimelineWidget.ts
|
|
8644
|
-
var
|
|
8645
|
-
var
|
|
8646
|
-
var
|
|
8647
|
-
var
|
|
9151
|
+
var DEFAULT_TITLE16 = "Voice Traces";
|
|
9152
|
+
var DEFAULT_DESCRIPTION16 = "Latest call timelines with provider latency, fallbacks, handoffs, and errors from your self-hosted trace store.";
|
|
9153
|
+
var escapeHtml22 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
9154
|
+
var formatMs4 = (value) => typeof value === "number" ? `${value}ms` : "n/a";
|
|
8648
9155
|
var formatProviders = (session) => session.providers.length ? session.providers.map((provider) => provider.provider).join(", ") : "No providers";
|
|
8649
9156
|
var createVoiceTraceTimelineViewModel = (snapshot, options = {}) => {
|
|
8650
9157
|
const sessions = (snapshot.report?.sessions ?? []).slice(0, options.limit ?? 3).map((session) => ({
|
|
8651
9158
|
...session,
|
|
8652
9159
|
detailHref: `${options.detailBasePath ?? "/traces"}/${encodeURIComponent(session.sessionId)}`,
|
|
8653
|
-
durationLabel:
|
|
9160
|
+
durationLabel: formatMs4(session.summary.callDurationMs),
|
|
8654
9161
|
incidentBundleHref: options.incidentBundleBasePath === false ? undefined : `${options.incidentBundleBasePath ?? "/voice-incidents"}/${encodeURIComponent(session.sessionId)}/markdown`,
|
|
8655
9162
|
label: `${session.summary.eventCount} events / ${session.summary.turnCount} turns`,
|
|
8656
9163
|
operationsRecordHref: options.operationsRecordBasePath === false ? undefined : `${options.operationsRecordBasePath ?? "/voice-operations"}/${encodeURIComponent(session.sessionId)}`,
|
|
@@ -8659,13 +9166,13 @@ var createVoiceTraceTimelineViewModel = (snapshot, options = {}) => {
|
|
|
8659
9166
|
const failed = sessions.filter((session) => session.status === "failed").length;
|
|
8660
9167
|
const warnings = sessions.filter((session) => session.status === "warning").length;
|
|
8661
9168
|
return {
|
|
8662
|
-
description: options.description ??
|
|
9169
|
+
description: options.description ?? DEFAULT_DESCRIPTION16,
|
|
8663
9170
|
error: snapshot.error,
|
|
8664
9171
|
isLoading: snapshot.isLoading,
|
|
8665
9172
|
label: snapshot.error ? "Unavailable" : failed > 0 ? `${failed} failed` : warnings > 0 ? `${warnings} warning` : sessions.length ? `${sessions.length} recent` : snapshot.isLoading ? "Checking" : "No traces yet",
|
|
8666
9173
|
sessions,
|
|
8667
9174
|
status: snapshot.error ? "error" : failed > 0 ? "failed" : warnings > 0 ? "warning" : sessions.length ? "ready" : snapshot.isLoading ? "loading" : "empty",
|
|
8668
|
-
title: options.title ??
|
|
9175
|
+
title: options.title ?? DEFAULT_TITLE16,
|
|
8669
9176
|
updatedAt: snapshot.updatedAt
|
|
8670
9177
|
};
|
|
8671
9178
|
};
|
|
@@ -8673,27 +9180,27 @@ var renderVoiceTraceTimelineWidgetHTML = (snapshot, options = {}) => {
|
|
|
8673
9180
|
const model = createVoiceTraceTimelineViewModel(snapshot, options);
|
|
8674
9181
|
const sessions = model.sessions.length ? `<div class="absolute-voice-trace-timeline__sessions">${model.sessions.map((session) => {
|
|
8675
9182
|
const supportLinks = [
|
|
8676
|
-
`<a href="${
|
|
8677
|
-
session.operationsRecordHref ? `<a href="${
|
|
8678
|
-
session.incidentBundleHref ? `<a href="${
|
|
9183
|
+
`<a href="${escapeHtml22(session.detailHref)}">Open timeline</a>`,
|
|
9184
|
+
session.operationsRecordHref ? `<a href="${escapeHtml22(session.operationsRecordHref)}">Open operations record</a>` : undefined,
|
|
9185
|
+
session.incidentBundleHref ? `<a href="${escapeHtml22(session.incidentBundleHref)}">Export incident bundle</a>` : undefined
|
|
8679
9186
|
].filter(Boolean).join("");
|
|
8680
|
-
return `<article class="absolute-voice-trace-timeline__session absolute-voice-trace-timeline__session--${
|
|
9187
|
+
return `<article class="absolute-voice-trace-timeline__session absolute-voice-trace-timeline__session--${escapeHtml22(session.status)}">
|
|
8681
9188
|
<header>
|
|
8682
|
-
<strong>${
|
|
8683
|
-
<span>${
|
|
9189
|
+
<strong>${escapeHtml22(session.sessionId)}</strong>
|
|
9190
|
+
<span>${escapeHtml22(session.status)}</span>
|
|
8684
9191
|
</header>
|
|
8685
|
-
<p>${
|
|
9192
|
+
<p>${escapeHtml22(session.label)} \xB7 ${escapeHtml22(session.durationLabel)} \xB7 ${escapeHtml22(session.providerLabel)}</p>
|
|
8686
9193
|
<p class="absolute-voice-trace-timeline__actions">${supportLinks}</p>
|
|
8687
9194
|
</article>`;
|
|
8688
9195
|
}).join("")}</div>` : '<p class="absolute-voice-trace-timeline__empty">Run a voice session to see call timelines.</p>';
|
|
8689
|
-
return `<section class="absolute-voice-trace-timeline absolute-voice-trace-timeline--${
|
|
9196
|
+
return `<section class="absolute-voice-trace-timeline absolute-voice-trace-timeline--${escapeHtml22(model.status)}">
|
|
8690
9197
|
<header class="absolute-voice-trace-timeline__header">
|
|
8691
|
-
<span class="absolute-voice-trace-timeline__eyebrow">${
|
|
8692
|
-
<strong class="absolute-voice-trace-timeline__label">${
|
|
9198
|
+
<span class="absolute-voice-trace-timeline__eyebrow">${escapeHtml22(model.title)}</span>
|
|
9199
|
+
<strong class="absolute-voice-trace-timeline__label">${escapeHtml22(model.label)}</strong>
|
|
8693
9200
|
</header>
|
|
8694
|
-
<p class="absolute-voice-trace-timeline__description">${
|
|
9201
|
+
<p class="absolute-voice-trace-timeline__description">${escapeHtml22(model.description)}</p>
|
|
8695
9202
|
${sessions}
|
|
8696
|
-
${model.error ? `<p class="absolute-voice-trace-timeline__error">${
|
|
9203
|
+
${model.error ? `<p class="absolute-voice-trace-timeline__error">${escapeHtml22(model.error)}</p>` : ""}
|
|
8697
9204
|
</section>`;
|
|
8698
9205
|
};
|
|
8699
9206
|
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}`;
|
|
@@ -8740,25 +9247,25 @@ var defineVoiceTraceTimelineElement = (tagName = "absolute-voice-trace-timeline"
|
|
|
8740
9247
|
};
|
|
8741
9248
|
|
|
8742
9249
|
// src/react/useVoiceTraceTimeline.tsx
|
|
8743
|
-
import { useEffect as
|
|
9250
|
+
import { useEffect as useEffect17, useRef as useRef17, useSyncExternalStore as useSyncExternalStore17 } from "react";
|
|
8744
9251
|
var useVoiceTraceTimeline = (path = "/api/voice-traces", options = {}) => {
|
|
8745
|
-
const storeRef =
|
|
9252
|
+
const storeRef = useRef17(null);
|
|
8746
9253
|
if (!storeRef.current) {
|
|
8747
9254
|
storeRef.current = createVoiceTraceTimelineStore(path, options);
|
|
8748
9255
|
}
|
|
8749
9256
|
const store = storeRef.current;
|
|
8750
|
-
|
|
9257
|
+
useEffect17(() => {
|
|
8751
9258
|
store.refresh().catch(() => {});
|
|
8752
9259
|
return () => store.close();
|
|
8753
9260
|
}, [store]);
|
|
8754
9261
|
return {
|
|
8755
|
-
...
|
|
9262
|
+
...useSyncExternalStore17(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
8756
9263
|
refresh: store.refresh
|
|
8757
9264
|
};
|
|
8758
9265
|
};
|
|
8759
9266
|
|
|
8760
9267
|
// src/react/VoiceTraceTimeline.tsx
|
|
8761
|
-
import { jsxDEV as
|
|
9268
|
+
import { jsxDEV as jsxDEV17 } from "react/jsx-dev-runtime";
|
|
8762
9269
|
var VoiceTraceTimeline = ({
|
|
8763
9270
|
className,
|
|
8764
9271
|
path = "/api/voice-traces",
|
|
@@ -8766,49 +9273,49 @@ var VoiceTraceTimeline = ({
|
|
|
8766
9273
|
}) => {
|
|
8767
9274
|
const snapshot = useVoiceTraceTimeline(path, options);
|
|
8768
9275
|
const model = createVoiceTraceTimelineViewModel(snapshot, options);
|
|
8769
|
-
return /* @__PURE__ */
|
|
9276
|
+
return /* @__PURE__ */ jsxDEV17("section", {
|
|
8770
9277
|
className: [
|
|
8771
9278
|
"absolute-voice-trace-timeline",
|
|
8772
9279
|
`absolute-voice-trace-timeline--${model.status}`,
|
|
8773
9280
|
className
|
|
8774
9281
|
].filter(Boolean).join(" "),
|
|
8775
9282
|
children: [
|
|
8776
|
-
/* @__PURE__ */
|
|
9283
|
+
/* @__PURE__ */ jsxDEV17("header", {
|
|
8777
9284
|
className: "absolute-voice-trace-timeline__header",
|
|
8778
9285
|
children: [
|
|
8779
|
-
/* @__PURE__ */
|
|
9286
|
+
/* @__PURE__ */ jsxDEV17("span", {
|
|
8780
9287
|
className: "absolute-voice-trace-timeline__eyebrow",
|
|
8781
9288
|
children: model.title
|
|
8782
9289
|
}, undefined, false, undefined, this),
|
|
8783
|
-
/* @__PURE__ */
|
|
9290
|
+
/* @__PURE__ */ jsxDEV17("strong", {
|
|
8784
9291
|
className: "absolute-voice-trace-timeline__label",
|
|
8785
9292
|
children: model.label
|
|
8786
9293
|
}, undefined, false, undefined, this)
|
|
8787
9294
|
]
|
|
8788
9295
|
}, undefined, true, undefined, this),
|
|
8789
|
-
/* @__PURE__ */
|
|
9296
|
+
/* @__PURE__ */ jsxDEV17("p", {
|
|
8790
9297
|
className: "absolute-voice-trace-timeline__description",
|
|
8791
9298
|
children: model.description
|
|
8792
9299
|
}, undefined, false, undefined, this),
|
|
8793
|
-
model.sessions.length ? /* @__PURE__ */
|
|
9300
|
+
model.sessions.length ? /* @__PURE__ */ jsxDEV17("div", {
|
|
8794
9301
|
className: "absolute-voice-trace-timeline__sessions",
|
|
8795
|
-
children: model.sessions.map((session) => /* @__PURE__ */
|
|
9302
|
+
children: model.sessions.map((session) => /* @__PURE__ */ jsxDEV17("article", {
|
|
8796
9303
|
className: [
|
|
8797
9304
|
"absolute-voice-trace-timeline__session",
|
|
8798
9305
|
`absolute-voice-trace-timeline__session--${session.status}`
|
|
8799
9306
|
].join(" "),
|
|
8800
9307
|
children: [
|
|
8801
|
-
/* @__PURE__ */
|
|
9308
|
+
/* @__PURE__ */ jsxDEV17("header", {
|
|
8802
9309
|
children: [
|
|
8803
|
-
/* @__PURE__ */
|
|
9310
|
+
/* @__PURE__ */ jsxDEV17("strong", {
|
|
8804
9311
|
children: session.sessionId
|
|
8805
9312
|
}, undefined, false, undefined, this),
|
|
8806
|
-
/* @__PURE__ */
|
|
9313
|
+
/* @__PURE__ */ jsxDEV17("span", {
|
|
8807
9314
|
children: session.status
|
|
8808
9315
|
}, undefined, false, undefined, this)
|
|
8809
9316
|
]
|
|
8810
9317
|
}, undefined, true, undefined, this),
|
|
8811
|
-
/* @__PURE__ */
|
|
9318
|
+
/* @__PURE__ */ jsxDEV17("p", {
|
|
8812
9319
|
children: [
|
|
8813
9320
|
session.label,
|
|
8814
9321
|
" \xB7 ",
|
|
@@ -8818,18 +9325,18 @@ var VoiceTraceTimeline = ({
|
|
|
8818
9325
|
session.providerLabel
|
|
8819
9326
|
]
|
|
8820
9327
|
}, undefined, true, undefined, this),
|
|
8821
|
-
/* @__PURE__ */
|
|
9328
|
+
/* @__PURE__ */ jsxDEV17("p", {
|
|
8822
9329
|
className: "absolute-voice-trace-timeline__actions",
|
|
8823
9330
|
children: [
|
|
8824
|
-
/* @__PURE__ */
|
|
9331
|
+
/* @__PURE__ */ jsxDEV17("a", {
|
|
8825
9332
|
href: session.detailHref,
|
|
8826
9333
|
children: "Open timeline"
|
|
8827
9334
|
}, undefined, false, undefined, this),
|
|
8828
|
-
session.operationsRecordHref ? /* @__PURE__ */
|
|
9335
|
+
session.operationsRecordHref ? /* @__PURE__ */ jsxDEV17("a", {
|
|
8829
9336
|
href: session.operationsRecordHref,
|
|
8830
9337
|
children: "Open operations record"
|
|
8831
9338
|
}, undefined, false, undefined, this) : null,
|
|
8832
|
-
session.incidentBundleHref ? /* @__PURE__ */
|
|
9339
|
+
session.incidentBundleHref ? /* @__PURE__ */ jsxDEV17("a", {
|
|
8833
9340
|
href: session.incidentBundleHref,
|
|
8834
9341
|
children: "Export incident bundle"
|
|
8835
9342
|
}, undefined, false, undefined, this) : null
|
|
@@ -8837,11 +9344,11 @@ var VoiceTraceTimeline = ({
|
|
|
8837
9344
|
}, undefined, true, undefined, this)
|
|
8838
9345
|
]
|
|
8839
9346
|
}, session.sessionId, true, undefined, this))
|
|
8840
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
9347
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV17("p", {
|
|
8841
9348
|
className: "absolute-voice-trace-timeline__empty",
|
|
8842
9349
|
children: "Run a voice session to see call timelines."
|
|
8843
9350
|
}, undefined, false, undefined, this),
|
|
8844
|
-
model.error ? /* @__PURE__ */
|
|
9351
|
+
model.error ? /* @__PURE__ */ jsxDEV17("p", {
|
|
8845
9352
|
className: "absolute-voice-trace-timeline__error",
|
|
8846
9353
|
children: model.error
|
|
8847
9354
|
}, undefined, false, undefined, this) : null
|
|
@@ -8849,7 +9356,7 @@ var VoiceTraceTimeline = ({
|
|
|
8849
9356
|
}, undefined, true, undefined, this);
|
|
8850
9357
|
};
|
|
8851
9358
|
// src/react/useVoiceAgentSquadStatus.tsx
|
|
8852
|
-
import { useEffect as
|
|
9359
|
+
import { useEffect as useEffect18, useRef as useRef18, useSyncExternalStore as useSyncExternalStore18 } from "react";
|
|
8853
9360
|
|
|
8854
9361
|
// src/client/agentSquadStatus.ts
|
|
8855
9362
|
var getString4 = (value) => typeof value === "string" && value.trim() ? value.trim() : undefined;
|
|
@@ -8927,25 +9434,25 @@ var createVoiceAgentSquadStatusStore = (path = "/api/voice-traces", options = {}
|
|
|
8927
9434
|
|
|
8928
9435
|
// src/react/useVoiceAgentSquadStatus.tsx
|
|
8929
9436
|
var useVoiceAgentSquadStatus = (path = "/api/voice-traces", options = {}) => {
|
|
8930
|
-
const storeRef =
|
|
9437
|
+
const storeRef = useRef18(null);
|
|
8931
9438
|
if (!storeRef.current) {
|
|
8932
9439
|
storeRef.current = createVoiceAgentSquadStatusStore(path, options);
|
|
8933
9440
|
}
|
|
8934
9441
|
const store = storeRef.current;
|
|
8935
|
-
|
|
9442
|
+
useEffect18(() => {
|
|
8936
9443
|
store.refresh().catch(() => {});
|
|
8937
9444
|
return () => store.close();
|
|
8938
9445
|
}, [store]);
|
|
8939
9446
|
return {
|
|
8940
|
-
...
|
|
9447
|
+
...useSyncExternalStore18(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
8941
9448
|
refresh: store.refresh
|
|
8942
9449
|
};
|
|
8943
9450
|
};
|
|
8944
9451
|
|
|
8945
9452
|
// src/client/agentSquadStatusWidget.ts
|
|
8946
|
-
var
|
|
8947
|
-
var
|
|
8948
|
-
var
|
|
9453
|
+
var DEFAULT_TITLE17 = "Voice Agent Squad";
|
|
9454
|
+
var DEFAULT_DESCRIPTION17 = "Current specialist and recent handoffs from your self-hosted voice traces.";
|
|
9455
|
+
var escapeHtml23 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
8949
9456
|
var labelFor = (current) => {
|
|
8950
9457
|
if (!current)
|
|
8951
9458
|
return "Waiting for specialist activity";
|
|
@@ -8959,37 +9466,37 @@ var labelFor = (current) => {
|
|
|
8959
9466
|
};
|
|
8960
9467
|
var createVoiceAgentSquadStatusViewModel = (snapshot, options = {}) => ({
|
|
8961
9468
|
current: snapshot.report.current,
|
|
8962
|
-
description: options.description ??
|
|
9469
|
+
description: options.description ?? DEFAULT_DESCRIPTION17,
|
|
8963
9470
|
error: snapshot.error,
|
|
8964
9471
|
isLoading: snapshot.isLoading,
|
|
8965
9472
|
label: snapshot.error ? "Unavailable" : labelFor(snapshot.report.current),
|
|
8966
9473
|
sessionCount: snapshot.report.sessionCount,
|
|
8967
9474
|
sessions: snapshot.report.sessions,
|
|
8968
|
-
title: options.title ??
|
|
9475
|
+
title: options.title ?? DEFAULT_TITLE17,
|
|
8969
9476
|
updatedAt: snapshot.updatedAt
|
|
8970
9477
|
});
|
|
8971
9478
|
var renderVoiceAgentSquadStatusHTML = (snapshot, options = {}) => {
|
|
8972
9479
|
const model = createVoiceAgentSquadStatusViewModel(snapshot, options);
|
|
8973
9480
|
const current = model.current;
|
|
8974
9481
|
const rows = model.sessions.length ? model.sessions.slice(0, 5).map((session) => `<li>
|
|
8975
|
-
<span>${
|
|
8976
|
-
<strong>${
|
|
8977
|
-
<em>${
|
|
8978
|
-
${session.summary || session.reason ? `<p>${
|
|
9482
|
+
<span>${escapeHtml23(session.sessionId)}</span>
|
|
9483
|
+
<strong>${escapeHtml23(session.targetAgentId ?? "none")}</strong>
|
|
9484
|
+
<em>${escapeHtml23(session.status)}</em>
|
|
9485
|
+
${session.summary || session.reason ? `<p>${escapeHtml23(session.summary ?? session.reason ?? "")}</p>` : ""}
|
|
8979
9486
|
</li>`).join("") : "<li><span>No squad traces yet.</span><strong>Waiting</strong></li>";
|
|
8980
9487
|
return `<section class="absolute-voice-agent-squad-status">
|
|
8981
9488
|
<header>
|
|
8982
|
-
<span>${
|
|
8983
|
-
<strong>${
|
|
9489
|
+
<span>${escapeHtml23(model.title)}</span>
|
|
9490
|
+
<strong>${escapeHtml23(model.label)}</strong>
|
|
8984
9491
|
</header>
|
|
8985
|
-
<p>${
|
|
9492
|
+
<p>${escapeHtml23(model.description)}</p>
|
|
8986
9493
|
<div>
|
|
8987
|
-
<span>Session</span><strong>${
|
|
8988
|
-
<span>From</span><strong>${
|
|
8989
|
-
<span>Status</span><strong>${
|
|
9494
|
+
<span>Session</span><strong>${escapeHtml23(current?.sessionId ?? "n/a")}</strong>
|
|
9495
|
+
<span>From</span><strong>${escapeHtml23(current?.fromAgentId ?? "n/a")}</strong>
|
|
9496
|
+
<span>Status</span><strong>${escapeHtml23(current?.status ?? "idle")}</strong>
|
|
8990
9497
|
</div>
|
|
8991
9498
|
<ul>${rows}</ul>
|
|
8992
|
-
${model.error ? `<p class="absolute-voice-agent-squad-status__error">${
|
|
9499
|
+
${model.error ? `<p class="absolute-voice-agent-squad-status__error">${escapeHtml23(model.error)}</p>` : ""}
|
|
8993
9500
|
</section>`;
|
|
8994
9501
|
};
|
|
8995
9502
|
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}`;
|
|
@@ -9034,7 +9541,7 @@ var defineVoiceAgentSquadStatusElement = (tagName = "absolute-voice-agent-squad-
|
|
|
9034
9541
|
};
|
|
9035
9542
|
|
|
9036
9543
|
// src/react/VoiceAgentSquadStatus.tsx
|
|
9037
|
-
import { jsxDEV as
|
|
9544
|
+
import { jsxDEV as jsxDEV18 } from "react/jsx-dev-runtime";
|
|
9038
9545
|
function VoiceAgentSquadStatus({
|
|
9039
9546
|
path = "/api/voice-traces",
|
|
9040
9547
|
...options
|
|
@@ -9042,64 +9549,64 @@ function VoiceAgentSquadStatus({
|
|
|
9042
9549
|
const snapshot = useVoiceAgentSquadStatus(path, options);
|
|
9043
9550
|
const model = createVoiceAgentSquadStatusViewModel(snapshot, options);
|
|
9044
9551
|
const current = model.current;
|
|
9045
|
-
return /* @__PURE__ */
|
|
9552
|
+
return /* @__PURE__ */ jsxDEV18("section", {
|
|
9046
9553
|
className: "absolute-voice-agent-squad-status",
|
|
9047
9554
|
children: [
|
|
9048
|
-
/* @__PURE__ */
|
|
9555
|
+
/* @__PURE__ */ jsxDEV18("header", {
|
|
9049
9556
|
children: [
|
|
9050
|
-
/* @__PURE__ */
|
|
9557
|
+
/* @__PURE__ */ jsxDEV18("span", {
|
|
9051
9558
|
children: model.title
|
|
9052
9559
|
}, undefined, false, undefined, this),
|
|
9053
|
-
/* @__PURE__ */
|
|
9560
|
+
/* @__PURE__ */ jsxDEV18("strong", {
|
|
9054
9561
|
children: model.label
|
|
9055
9562
|
}, undefined, false, undefined, this)
|
|
9056
9563
|
]
|
|
9057
9564
|
}, undefined, true, undefined, this),
|
|
9058
|
-
/* @__PURE__ */
|
|
9565
|
+
/* @__PURE__ */ jsxDEV18("p", {
|
|
9059
9566
|
children: model.description
|
|
9060
9567
|
}, undefined, false, undefined, this),
|
|
9061
|
-
/* @__PURE__ */
|
|
9568
|
+
/* @__PURE__ */ jsxDEV18("dl", {
|
|
9062
9569
|
children: [
|
|
9063
|
-
/* @__PURE__ */
|
|
9570
|
+
/* @__PURE__ */ jsxDEV18("div", {
|
|
9064
9571
|
children: [
|
|
9065
|
-
/* @__PURE__ */
|
|
9572
|
+
/* @__PURE__ */ jsxDEV18("dt", {
|
|
9066
9573
|
children: "Session"
|
|
9067
9574
|
}, undefined, false, undefined, this),
|
|
9068
|
-
/* @__PURE__ */
|
|
9575
|
+
/* @__PURE__ */ jsxDEV18("dd", {
|
|
9069
9576
|
children: current?.sessionId ?? "n/a"
|
|
9070
9577
|
}, undefined, false, undefined, this)
|
|
9071
9578
|
]
|
|
9072
9579
|
}, undefined, true, undefined, this),
|
|
9073
|
-
/* @__PURE__ */
|
|
9580
|
+
/* @__PURE__ */ jsxDEV18("div", {
|
|
9074
9581
|
children: [
|
|
9075
|
-
/* @__PURE__ */
|
|
9582
|
+
/* @__PURE__ */ jsxDEV18("dt", {
|
|
9076
9583
|
children: "Current specialist"
|
|
9077
9584
|
}, undefined, false, undefined, this),
|
|
9078
|
-
/* @__PURE__ */
|
|
9585
|
+
/* @__PURE__ */ jsxDEV18("dd", {
|
|
9079
9586
|
children: current?.targetAgentId ?? "none"
|
|
9080
9587
|
}, undefined, false, undefined, this)
|
|
9081
9588
|
]
|
|
9082
9589
|
}, undefined, true, undefined, this),
|
|
9083
|
-
/* @__PURE__ */
|
|
9590
|
+
/* @__PURE__ */ jsxDEV18("div", {
|
|
9084
9591
|
children: [
|
|
9085
|
-
/* @__PURE__ */
|
|
9592
|
+
/* @__PURE__ */ jsxDEV18("dt", {
|
|
9086
9593
|
children: "Status"
|
|
9087
9594
|
}, undefined, false, undefined, this),
|
|
9088
|
-
/* @__PURE__ */
|
|
9595
|
+
/* @__PURE__ */ jsxDEV18("dd", {
|
|
9089
9596
|
children: current?.status ?? "idle"
|
|
9090
9597
|
}, undefined, false, undefined, this)
|
|
9091
9598
|
]
|
|
9092
9599
|
}, undefined, true, undefined, this)
|
|
9093
9600
|
]
|
|
9094
9601
|
}, undefined, true, undefined, this),
|
|
9095
|
-
model.error ? /* @__PURE__ */
|
|
9602
|
+
model.error ? /* @__PURE__ */ jsxDEV18("p", {
|
|
9096
9603
|
children: model.error
|
|
9097
9604
|
}, undefined, false, undefined, this) : null
|
|
9098
9605
|
]
|
|
9099
9606
|
}, undefined, true, undefined, this);
|
|
9100
9607
|
}
|
|
9101
9608
|
// src/react/useVoiceTurnLatency.tsx
|
|
9102
|
-
import { useEffect as
|
|
9609
|
+
import { useEffect as useEffect19, useRef as useRef19, useSyncExternalStore as useSyncExternalStore19 } from "react";
|
|
9103
9610
|
|
|
9104
9611
|
// src/client/turnLatency.ts
|
|
9105
9612
|
var fetchVoiceTurnLatency = async (path = "/api/turn-latency", options = {}) => {
|
|
@@ -9206,73 +9713,73 @@ var createVoiceTurnLatencyStore = (path = "/api/turn-latency", options = {}) =>
|
|
|
9206
9713
|
|
|
9207
9714
|
// src/react/useVoiceTurnLatency.tsx
|
|
9208
9715
|
var useVoiceTurnLatency = (path = "/api/turn-latency", options = {}) => {
|
|
9209
|
-
const storeRef =
|
|
9716
|
+
const storeRef = useRef19(null);
|
|
9210
9717
|
if (!storeRef.current) {
|
|
9211
9718
|
storeRef.current = createVoiceTurnLatencyStore(path, options);
|
|
9212
9719
|
}
|
|
9213
9720
|
const store = storeRef.current;
|
|
9214
|
-
|
|
9721
|
+
useEffect19(() => {
|
|
9215
9722
|
store.refresh().catch(() => {});
|
|
9216
9723
|
return () => store.close();
|
|
9217
9724
|
}, [store]);
|
|
9218
9725
|
return {
|
|
9219
|
-
...
|
|
9726
|
+
...useSyncExternalStore19(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
9220
9727
|
refresh: store.refresh,
|
|
9221
9728
|
runProof: store.runProof
|
|
9222
9729
|
};
|
|
9223
9730
|
};
|
|
9224
9731
|
|
|
9225
9732
|
// src/client/turnLatencyWidget.ts
|
|
9226
|
-
var
|
|
9227
|
-
var
|
|
9733
|
+
var DEFAULT_TITLE18 = "Turn Latency";
|
|
9734
|
+
var DEFAULT_DESCRIPTION18 = "Per-turn timing from first transcript to commit and assistant response start.";
|
|
9228
9735
|
var DEFAULT_PROOF_LABEL = "Run latency proof";
|
|
9229
|
-
var
|
|
9230
|
-
var
|
|
9736
|
+
var escapeHtml24 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
9737
|
+
var formatMs5 = (value) => typeof value === "number" ? `${Math.round(value)}ms` : "n/a";
|
|
9231
9738
|
var createVoiceTurnLatencyViewModel = (snapshot, options = {}) => {
|
|
9232
9739
|
const turns = (snapshot.report?.turns ?? []).map((turn) => ({
|
|
9233
9740
|
...turn,
|
|
9234
9741
|
label: turn.text || "Empty turn",
|
|
9235
9742
|
rows: turn.stages.map((stage) => ({
|
|
9236
9743
|
label: stage.label,
|
|
9237
|
-
value:
|
|
9744
|
+
value: formatMs5(stage.valueMs)
|
|
9238
9745
|
}))
|
|
9239
9746
|
}));
|
|
9240
9747
|
const warningCount = snapshot.report?.warnings ?? turns.filter((turn) => turn.status === "warn").length;
|
|
9241
9748
|
const failedCount = snapshot.report?.failed ?? turns.filter((turn) => turn.status === "fail").length;
|
|
9242
9749
|
return {
|
|
9243
|
-
description: options.description ??
|
|
9750
|
+
description: options.description ?? DEFAULT_DESCRIPTION18,
|
|
9244
9751
|
error: snapshot.error,
|
|
9245
9752
|
isLoading: snapshot.isLoading,
|
|
9246
|
-
label: snapshot.error ? "Unavailable" : turns.length ? failedCount > 0 ? `${failedCount} slow` : warningCount > 0 ? `${warningCount} warnings` : `avg ${
|
|
9753
|
+
label: snapshot.error ? "Unavailable" : turns.length ? failedCount > 0 ? `${failedCount} slow` : warningCount > 0 ? `${warningCount} warnings` : `avg ${formatMs5(snapshot.report?.averageTotalMs)}` : snapshot.isLoading ? "Checking" : "No turns",
|
|
9247
9754
|
proofLabel: options.proofPath ? options.proofLabel ?? DEFAULT_PROOF_LABEL : undefined,
|
|
9248
9755
|
showProofAction: Boolean(options.proofPath),
|
|
9249
9756
|
status: snapshot.error ? "error" : turns.length ? failedCount > 0 || warningCount > 0 ? "warning" : "ready" : snapshot.isLoading ? "loading" : "empty",
|
|
9250
|
-
title: options.title ??
|
|
9757
|
+
title: options.title ?? DEFAULT_TITLE18,
|
|
9251
9758
|
turns,
|
|
9252
9759
|
updatedAt: snapshot.updatedAt
|
|
9253
9760
|
};
|
|
9254
9761
|
};
|
|
9255
9762
|
var renderVoiceTurnLatencyHTML = (snapshot, options = {}) => {
|
|
9256
9763
|
const model = createVoiceTurnLatencyViewModel(snapshot, options);
|
|
9257
|
-
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--${
|
|
9764
|
+
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--${escapeHtml24(turn.status)}">
|
|
9258
9765
|
<header>
|
|
9259
|
-
<strong>${
|
|
9260
|
-
<span>${
|
|
9766
|
+
<strong>${escapeHtml24(turn.label)}</strong>
|
|
9767
|
+
<span>${escapeHtml24(turn.status)}</span>
|
|
9261
9768
|
</header>
|
|
9262
9769
|
<dl>${turn.rows.map((row) => `<div>
|
|
9263
|
-
<dt>${
|
|
9264
|
-
<dd>${
|
|
9770
|
+
<dt>${escapeHtml24(row.label)}</dt>
|
|
9771
|
+
<dd>${escapeHtml24(row.value)}</dd>
|
|
9265
9772
|
</div>`).join("")}</dl>
|
|
9266
9773
|
</article>`).join("")}</div>` : '<p class="absolute-voice-turn-latency__empty">Complete a voice turn to see latency diagnostics.</p>';
|
|
9267
|
-
return `<section class="absolute-voice-turn-latency absolute-voice-turn-latency--${
|
|
9774
|
+
return `<section class="absolute-voice-turn-latency absolute-voice-turn-latency--${escapeHtml24(model.status)}">
|
|
9268
9775
|
<header class="absolute-voice-turn-latency__header">
|
|
9269
|
-
<span class="absolute-voice-turn-latency__eyebrow">${
|
|
9270
|
-
<strong class="absolute-voice-turn-latency__label">${
|
|
9776
|
+
<span class="absolute-voice-turn-latency__eyebrow">${escapeHtml24(model.title)}</span>
|
|
9777
|
+
<strong class="absolute-voice-turn-latency__label">${escapeHtml24(model.label)}</strong>
|
|
9271
9778
|
</header>
|
|
9272
|
-
<p class="absolute-voice-turn-latency__description">${
|
|
9273
|
-
${model.showProofAction ? `<button class="absolute-voice-turn-latency__proof" data-absolute-voice-turn-latency-proof type="button">${
|
|
9779
|
+
<p class="absolute-voice-turn-latency__description">${escapeHtml24(model.description)}</p>
|
|
9780
|
+
${model.showProofAction ? `<button class="absolute-voice-turn-latency__proof" data-absolute-voice-turn-latency-proof type="button">${escapeHtml24(model.proofLabel ?? DEFAULT_PROOF_LABEL)}</button>` : ""}
|
|
9274
9781
|
${turns}
|
|
9275
|
-
${model.error ? `<p class="absolute-voice-turn-latency__error">${
|
|
9782
|
+
${model.error ? `<p class="absolute-voice-turn-latency__error">${escapeHtml24(model.error)}</p>` : ""}
|
|
9276
9783
|
</section>`;
|
|
9277
9784
|
};
|
|
9278
9785
|
var mountVoiceTurnLatency = (element, path = "/api/turn-latency", options = {}) => {
|
|
@@ -9323,7 +9830,7 @@ var defineVoiceTurnLatencyElement = (tagName = "absolute-voice-turn-latency") =>
|
|
|
9323
9830
|
};
|
|
9324
9831
|
|
|
9325
9832
|
// src/react/VoiceTurnLatency.tsx
|
|
9326
|
-
import { jsxDEV as
|
|
9833
|
+
import { jsxDEV as jsxDEV19 } from "react/jsx-dev-runtime";
|
|
9327
9834
|
var VoiceTurnLatency = ({
|
|
9328
9835
|
className,
|
|
9329
9836
|
path = "/api/turn-latency",
|
|
@@ -9331,31 +9838,31 @@ var VoiceTurnLatency = ({
|
|
|
9331
9838
|
}) => {
|
|
9332
9839
|
const latency = useVoiceTurnLatency(path, options);
|
|
9333
9840
|
const model = createVoiceTurnLatencyViewModel(latency, options);
|
|
9334
|
-
return /* @__PURE__ */
|
|
9841
|
+
return /* @__PURE__ */ jsxDEV19("section", {
|
|
9335
9842
|
className: [
|
|
9336
9843
|
"absolute-voice-turn-latency",
|
|
9337
9844
|
`absolute-voice-turn-latency--${model.status}`,
|
|
9338
9845
|
className
|
|
9339
9846
|
].filter(Boolean).join(" "),
|
|
9340
9847
|
children: [
|
|
9341
|
-
/* @__PURE__ */
|
|
9848
|
+
/* @__PURE__ */ jsxDEV19("header", {
|
|
9342
9849
|
className: "absolute-voice-turn-latency__header",
|
|
9343
9850
|
children: [
|
|
9344
|
-
/* @__PURE__ */
|
|
9851
|
+
/* @__PURE__ */ jsxDEV19("span", {
|
|
9345
9852
|
className: "absolute-voice-turn-latency__eyebrow",
|
|
9346
9853
|
children: model.title
|
|
9347
9854
|
}, undefined, false, undefined, this),
|
|
9348
|
-
/* @__PURE__ */
|
|
9855
|
+
/* @__PURE__ */ jsxDEV19("strong", {
|
|
9349
9856
|
className: "absolute-voice-turn-latency__label",
|
|
9350
9857
|
children: model.label
|
|
9351
9858
|
}, undefined, false, undefined, this)
|
|
9352
9859
|
]
|
|
9353
9860
|
}, undefined, true, undefined, this),
|
|
9354
|
-
/* @__PURE__ */
|
|
9861
|
+
/* @__PURE__ */ jsxDEV19("p", {
|
|
9355
9862
|
className: "absolute-voice-turn-latency__description",
|
|
9356
9863
|
children: model.description
|
|
9357
9864
|
}, undefined, false, undefined, this),
|
|
9358
|
-
model.showProofAction ? /* @__PURE__ */
|
|
9865
|
+
model.showProofAction ? /* @__PURE__ */ jsxDEV19("button", {
|
|
9359
9866
|
className: "absolute-voice-turn-latency__proof",
|
|
9360
9867
|
onClick: () => {
|
|
9361
9868
|
latency.runProof().catch(() => {});
|
|
@@ -9363,31 +9870,31 @@ var VoiceTurnLatency = ({
|
|
|
9363
9870
|
type: "button",
|
|
9364
9871
|
children: model.proofLabel
|
|
9365
9872
|
}, undefined, false, undefined, this) : null,
|
|
9366
|
-
model.turns.length ? /* @__PURE__ */
|
|
9873
|
+
model.turns.length ? /* @__PURE__ */ jsxDEV19("div", {
|
|
9367
9874
|
className: "absolute-voice-turn-latency__turns",
|
|
9368
|
-
children: model.turns.map((turn) => /* @__PURE__ */
|
|
9875
|
+
children: model.turns.map((turn) => /* @__PURE__ */ jsxDEV19("article", {
|
|
9369
9876
|
className: [
|
|
9370
9877
|
"absolute-voice-turn-latency__turn",
|
|
9371
9878
|
`absolute-voice-turn-latency__turn--${turn.status}`
|
|
9372
9879
|
].join(" "),
|
|
9373
9880
|
children: [
|
|
9374
|
-
/* @__PURE__ */
|
|
9881
|
+
/* @__PURE__ */ jsxDEV19("header", {
|
|
9375
9882
|
children: [
|
|
9376
|
-
/* @__PURE__ */
|
|
9883
|
+
/* @__PURE__ */ jsxDEV19("strong", {
|
|
9377
9884
|
children: turn.label
|
|
9378
9885
|
}, undefined, false, undefined, this),
|
|
9379
|
-
/* @__PURE__ */
|
|
9886
|
+
/* @__PURE__ */ jsxDEV19("span", {
|
|
9380
9887
|
children: turn.status
|
|
9381
9888
|
}, undefined, false, undefined, this)
|
|
9382
9889
|
]
|
|
9383
9890
|
}, undefined, true, undefined, this),
|
|
9384
|
-
/* @__PURE__ */
|
|
9385
|
-
children: turn.rows.map((row) => /* @__PURE__ */
|
|
9891
|
+
/* @__PURE__ */ jsxDEV19("dl", {
|
|
9892
|
+
children: turn.rows.map((row) => /* @__PURE__ */ jsxDEV19("div", {
|
|
9386
9893
|
children: [
|
|
9387
|
-
/* @__PURE__ */
|
|
9894
|
+
/* @__PURE__ */ jsxDEV19("dt", {
|
|
9388
9895
|
children: row.label
|
|
9389
9896
|
}, undefined, false, undefined, this),
|
|
9390
|
-
/* @__PURE__ */
|
|
9897
|
+
/* @__PURE__ */ jsxDEV19("dd", {
|
|
9391
9898
|
children: row.value
|
|
9392
9899
|
}, undefined, false, undefined, this)
|
|
9393
9900
|
]
|
|
@@ -9395,11 +9902,11 @@ var VoiceTurnLatency = ({
|
|
|
9395
9902
|
}, undefined, false, undefined, this)
|
|
9396
9903
|
]
|
|
9397
9904
|
}, `${turn.sessionId}:${turn.turnId}`, true, undefined, this))
|
|
9398
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
9905
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV19("p", {
|
|
9399
9906
|
className: "absolute-voice-turn-latency__empty",
|
|
9400
9907
|
children: "Complete a voice turn to see latency diagnostics."
|
|
9401
9908
|
}, undefined, false, undefined, this),
|
|
9402
|
-
model.error ? /* @__PURE__ */
|
|
9909
|
+
model.error ? /* @__PURE__ */ jsxDEV19("p", {
|
|
9403
9910
|
className: "absolute-voice-turn-latency__error",
|
|
9404
9911
|
children: model.error
|
|
9405
9912
|
}, undefined, false, undefined, this) : null
|
|
@@ -9407,7 +9914,7 @@ var VoiceTurnLatency = ({
|
|
|
9407
9914
|
}, undefined, true, undefined, this);
|
|
9408
9915
|
};
|
|
9409
9916
|
// src/react/useVoiceTurnQuality.tsx
|
|
9410
|
-
import { useEffect as
|
|
9917
|
+
import { useEffect as useEffect20, useRef as useRef20, useSyncExternalStore as useSyncExternalStore20 } from "react";
|
|
9411
9918
|
|
|
9412
9919
|
// src/client/turnQuality.ts
|
|
9413
9920
|
var fetchVoiceTurnQuality = async (path = "/api/turn-quality", options = {}) => {
|
|
@@ -9490,25 +9997,25 @@ var createVoiceTurnQualityStore = (path = "/api/turn-quality", options = {}) =>
|
|
|
9490
9997
|
|
|
9491
9998
|
// src/react/useVoiceTurnQuality.tsx
|
|
9492
9999
|
var useVoiceTurnQuality = (path = "/api/turn-quality", options = {}) => {
|
|
9493
|
-
const storeRef =
|
|
10000
|
+
const storeRef = useRef20(null);
|
|
9494
10001
|
if (!storeRef.current) {
|
|
9495
10002
|
storeRef.current = createVoiceTurnQualityStore(path, options);
|
|
9496
10003
|
}
|
|
9497
10004
|
const store = storeRef.current;
|
|
9498
|
-
|
|
10005
|
+
useEffect20(() => {
|
|
9499
10006
|
store.refresh().catch(() => {});
|
|
9500
10007
|
return () => store.close();
|
|
9501
10008
|
}, [store]);
|
|
9502
10009
|
return {
|
|
9503
|
-
...
|
|
10010
|
+
...useSyncExternalStore20(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
9504
10011
|
refresh: store.refresh
|
|
9505
10012
|
};
|
|
9506
10013
|
};
|
|
9507
10014
|
|
|
9508
10015
|
// src/client/turnQualityWidget.ts
|
|
9509
|
-
var
|
|
9510
|
-
var
|
|
9511
|
-
var
|
|
10016
|
+
var DEFAULT_TITLE19 = "Turn Quality";
|
|
10017
|
+
var DEFAULT_DESCRIPTION19 = "Per-turn STT confidence, fallback selection, corrections, and transcript coverage.";
|
|
10018
|
+
var escapeHtml25 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
9512
10019
|
var formatConfidence = (value) => typeof value === "number" ? `${Math.round(value * 100)}%` : "n/a";
|
|
9513
10020
|
var formatMaybe = (value) => value === undefined || value === "" ? "n/a" : String(value);
|
|
9514
10021
|
var getTurnDetail = (turn) => {
|
|
@@ -9552,37 +10059,37 @@ var createVoiceTurnQualityViewModel = (snapshot, options = {}) => {
|
|
|
9552
10059
|
const warningCount = snapshot.report?.warnings ?? turns.filter((turn) => turn.status === "warn").length;
|
|
9553
10060
|
const failedCount = snapshot.report?.failed ?? turns.filter((turn) => turn.status === "fail").length;
|
|
9554
10061
|
return {
|
|
9555
|
-
description: options.description ??
|
|
10062
|
+
description: options.description ?? DEFAULT_DESCRIPTION19,
|
|
9556
10063
|
error: snapshot.error,
|
|
9557
10064
|
isLoading: snapshot.isLoading,
|
|
9558
10065
|
label: snapshot.error ? "Unavailable" : turns.length ? failedCount > 0 ? `${failedCount} failed` : warningCount > 0 ? `${warningCount} warnings` : `${turns.length} healthy` : snapshot.isLoading ? "Checking" : "No turns",
|
|
9559
10066
|
status: snapshot.error ? "error" : turns.length ? failedCount > 0 || warningCount > 0 ? "warning" : "ready" : snapshot.isLoading ? "loading" : "empty",
|
|
9560
|
-
title: options.title ??
|
|
10067
|
+
title: options.title ?? DEFAULT_TITLE19,
|
|
9561
10068
|
turns,
|
|
9562
10069
|
updatedAt: snapshot.updatedAt
|
|
9563
10070
|
};
|
|
9564
10071
|
};
|
|
9565
10072
|
var renderVoiceTurnQualityHTML = (snapshot, options = {}) => {
|
|
9566
10073
|
const model = createVoiceTurnQualityViewModel(snapshot, options);
|
|
9567
|
-
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--${
|
|
10074
|
+
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--${escapeHtml25(turn.status)}">
|
|
9568
10075
|
<header>
|
|
9569
|
-
<strong>${
|
|
9570
|
-
<span>${
|
|
10076
|
+
<strong>${escapeHtml25(turn.label)}</strong>
|
|
10077
|
+
<span>${escapeHtml25(turn.status)}</span>
|
|
9571
10078
|
</header>
|
|
9572
|
-
<p>${
|
|
10079
|
+
<p>${escapeHtml25(turn.detail)}</p>
|
|
9573
10080
|
<dl>${turn.rows.map((row) => `<div>
|
|
9574
|
-
<dt>${
|
|
9575
|
-
<dd>${
|
|
10081
|
+
<dt>${escapeHtml25(row.label)}</dt>
|
|
10082
|
+
<dd>${escapeHtml25(row.value)}</dd>
|
|
9576
10083
|
</div>`).join("")}</dl>
|
|
9577
10084
|
</article>`).join("")}</div>` : '<p class="absolute-voice-turn-quality__empty">Complete a voice turn to see STT quality diagnostics.</p>';
|
|
9578
|
-
return `<section class="absolute-voice-turn-quality absolute-voice-turn-quality--${
|
|
10085
|
+
return `<section class="absolute-voice-turn-quality absolute-voice-turn-quality--${escapeHtml25(model.status)}">
|
|
9579
10086
|
<header class="absolute-voice-turn-quality__header">
|
|
9580
|
-
<span class="absolute-voice-turn-quality__eyebrow">${
|
|
9581
|
-
<strong class="absolute-voice-turn-quality__label">${
|
|
10087
|
+
<span class="absolute-voice-turn-quality__eyebrow">${escapeHtml25(model.title)}</span>
|
|
10088
|
+
<strong class="absolute-voice-turn-quality__label">${escapeHtml25(model.label)}</strong>
|
|
9582
10089
|
</header>
|
|
9583
|
-
<p class="absolute-voice-turn-quality__description">${
|
|
10090
|
+
<p class="absolute-voice-turn-quality__description">${escapeHtml25(model.description)}</p>
|
|
9584
10091
|
${turns}
|
|
9585
|
-
${model.error ? `<p class="absolute-voice-turn-quality__error">${
|
|
10092
|
+
${model.error ? `<p class="absolute-voice-turn-quality__error">${escapeHtml25(model.error)}</p>` : ""}
|
|
9586
10093
|
</section>`;
|
|
9587
10094
|
};
|
|
9588
10095
|
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}`;
|
|
@@ -9624,7 +10131,7 @@ var defineVoiceTurnQualityElement = (tagName = "absolute-voice-turn-quality") =>
|
|
|
9624
10131
|
};
|
|
9625
10132
|
|
|
9626
10133
|
// src/react/VoiceTurnQuality.tsx
|
|
9627
|
-
import { jsxDEV as
|
|
10134
|
+
import { jsxDEV as jsxDEV20 } from "react/jsx-dev-runtime";
|
|
9628
10135
|
var VoiceTurnQuality = ({
|
|
9629
10136
|
className,
|
|
9630
10137
|
path = "/api/turn-quality",
|
|
@@ -9632,58 +10139,58 @@ var VoiceTurnQuality = ({
|
|
|
9632
10139
|
}) => {
|
|
9633
10140
|
const snapshot = useVoiceTurnQuality(path, options);
|
|
9634
10141
|
const model = createVoiceTurnQualityViewModel(snapshot, options);
|
|
9635
|
-
return /* @__PURE__ */
|
|
10142
|
+
return /* @__PURE__ */ jsxDEV20("section", {
|
|
9636
10143
|
className: [
|
|
9637
10144
|
"absolute-voice-turn-quality",
|
|
9638
10145
|
`absolute-voice-turn-quality--${model.status}`,
|
|
9639
10146
|
className
|
|
9640
10147
|
].filter(Boolean).join(" "),
|
|
9641
10148
|
children: [
|
|
9642
|
-
/* @__PURE__ */
|
|
10149
|
+
/* @__PURE__ */ jsxDEV20("header", {
|
|
9643
10150
|
className: "absolute-voice-turn-quality__header",
|
|
9644
10151
|
children: [
|
|
9645
|
-
/* @__PURE__ */
|
|
10152
|
+
/* @__PURE__ */ jsxDEV20("span", {
|
|
9646
10153
|
className: "absolute-voice-turn-quality__eyebrow",
|
|
9647
10154
|
children: model.title
|
|
9648
10155
|
}, undefined, false, undefined, this),
|
|
9649
|
-
/* @__PURE__ */
|
|
10156
|
+
/* @__PURE__ */ jsxDEV20("strong", {
|
|
9650
10157
|
className: "absolute-voice-turn-quality__label",
|
|
9651
10158
|
children: model.label
|
|
9652
10159
|
}, undefined, false, undefined, this)
|
|
9653
10160
|
]
|
|
9654
10161
|
}, undefined, true, undefined, this),
|
|
9655
|
-
/* @__PURE__ */
|
|
10162
|
+
/* @__PURE__ */ jsxDEV20("p", {
|
|
9656
10163
|
className: "absolute-voice-turn-quality__description",
|
|
9657
10164
|
children: model.description
|
|
9658
10165
|
}, undefined, false, undefined, this),
|
|
9659
|
-
model.turns.length ? /* @__PURE__ */
|
|
10166
|
+
model.turns.length ? /* @__PURE__ */ jsxDEV20("div", {
|
|
9660
10167
|
className: "absolute-voice-turn-quality__turns",
|
|
9661
|
-
children: model.turns.map((turn) => /* @__PURE__ */
|
|
10168
|
+
children: model.turns.map((turn) => /* @__PURE__ */ jsxDEV20("article", {
|
|
9662
10169
|
className: [
|
|
9663
10170
|
"absolute-voice-turn-quality__turn",
|
|
9664
10171
|
`absolute-voice-turn-quality__turn--${turn.status}`
|
|
9665
10172
|
].join(" "),
|
|
9666
10173
|
children: [
|
|
9667
|
-
/* @__PURE__ */
|
|
10174
|
+
/* @__PURE__ */ jsxDEV20("header", {
|
|
9668
10175
|
children: [
|
|
9669
|
-
/* @__PURE__ */
|
|
10176
|
+
/* @__PURE__ */ jsxDEV20("strong", {
|
|
9670
10177
|
children: turn.label
|
|
9671
10178
|
}, undefined, false, undefined, this),
|
|
9672
|
-
/* @__PURE__ */
|
|
10179
|
+
/* @__PURE__ */ jsxDEV20("span", {
|
|
9673
10180
|
children: turn.status
|
|
9674
10181
|
}, undefined, false, undefined, this)
|
|
9675
10182
|
]
|
|
9676
10183
|
}, undefined, true, undefined, this),
|
|
9677
|
-
/* @__PURE__ */
|
|
10184
|
+
/* @__PURE__ */ jsxDEV20("p", {
|
|
9678
10185
|
children: turn.detail
|
|
9679
10186
|
}, undefined, false, undefined, this),
|
|
9680
|
-
/* @__PURE__ */
|
|
9681
|
-
children: turn.rows.map((row) => /* @__PURE__ */
|
|
10187
|
+
/* @__PURE__ */ jsxDEV20("dl", {
|
|
10188
|
+
children: turn.rows.map((row) => /* @__PURE__ */ jsxDEV20("div", {
|
|
9682
10189
|
children: [
|
|
9683
|
-
/* @__PURE__ */
|
|
10190
|
+
/* @__PURE__ */ jsxDEV20("dt", {
|
|
9684
10191
|
children: row.label
|
|
9685
10192
|
}, undefined, false, undefined, this),
|
|
9686
|
-
/* @__PURE__ */
|
|
10193
|
+
/* @__PURE__ */ jsxDEV20("dd", {
|
|
9687
10194
|
children: row.value
|
|
9688
10195
|
}, undefined, false, undefined, this)
|
|
9689
10196
|
]
|
|
@@ -9691,11 +10198,11 @@ var VoiceTurnQuality = ({
|
|
|
9691
10198
|
}, undefined, false, undefined, this)
|
|
9692
10199
|
]
|
|
9693
10200
|
}, `${turn.sessionId}:${turn.turnId}`, true, undefined, this))
|
|
9694
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
10201
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV20("p", {
|
|
9695
10202
|
className: "absolute-voice-turn-quality__empty",
|
|
9696
10203
|
children: "Complete a voice turn to see STT quality diagnostics."
|
|
9697
10204
|
}, undefined, false, undefined, this),
|
|
9698
|
-
model.error ? /* @__PURE__ */
|
|
10205
|
+
model.error ? /* @__PURE__ */ jsxDEV20("p", {
|
|
9699
10206
|
className: "absolute-voice-turn-quality__error",
|
|
9700
10207
|
children: model.error
|
|
9701
10208
|
}, undefined, false, undefined, this) : null
|
|
@@ -9703,7 +10210,7 @@ var VoiceTurnQuality = ({
|
|
|
9703
10210
|
}, undefined, true, undefined, this);
|
|
9704
10211
|
};
|
|
9705
10212
|
// src/react/useVoiceLiveOps.tsx
|
|
9706
|
-
import { useEffect as
|
|
10213
|
+
import { useEffect as useEffect21, useRef as useRef21, useSyncExternalStore as useSyncExternalStore21 } from "react";
|
|
9707
10214
|
|
|
9708
10215
|
// src/client/liveOps.ts
|
|
9709
10216
|
var postVoiceLiveOpsAction = async (input, options = {}) => {
|
|
@@ -9793,19 +10300,19 @@ var createVoiceLiveOpsStore = (options = {}) => {
|
|
|
9793
10300
|
|
|
9794
10301
|
// src/react/useVoiceLiveOps.tsx
|
|
9795
10302
|
var useVoiceLiveOps = (options = {}) => {
|
|
9796
|
-
const storeRef =
|
|
10303
|
+
const storeRef = useRef21(null);
|
|
9797
10304
|
if (!storeRef.current) {
|
|
9798
10305
|
storeRef.current = createVoiceLiveOpsStore(options);
|
|
9799
10306
|
}
|
|
9800
10307
|
const store = storeRef.current;
|
|
9801
|
-
|
|
10308
|
+
useEffect21(() => () => store.close(), [store]);
|
|
9802
10309
|
return {
|
|
9803
|
-
...
|
|
10310
|
+
...useSyncExternalStore21(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
9804
10311
|
run: store.run
|
|
9805
10312
|
};
|
|
9806
10313
|
};
|
|
9807
10314
|
// src/react/useVoiceCampaignDialerProof.tsx
|
|
9808
|
-
import { useEffect as
|
|
10315
|
+
import { useEffect as useEffect22, useRef as useRef22, useSyncExternalStore as useSyncExternalStore22 } from "react";
|
|
9809
10316
|
|
|
9810
10317
|
// src/client/campaignDialerProof.ts
|
|
9811
10318
|
var fetchVoiceCampaignDialerProofStatus = async (path = "/api/voice/campaigns/dialer-proof", options = {}) => {
|
|
@@ -9927,23 +10434,23 @@ var createVoiceCampaignDialerProofStore = (path = "/api/voice/campaigns/dialer-p
|
|
|
9927
10434
|
|
|
9928
10435
|
// src/react/useVoiceCampaignDialerProof.tsx
|
|
9929
10436
|
var useVoiceCampaignDialerProof = (path = "/api/voice/campaigns/dialer-proof", options = {}) => {
|
|
9930
|
-
const storeRef =
|
|
10437
|
+
const storeRef = useRef22(null);
|
|
9931
10438
|
if (!storeRef.current) {
|
|
9932
10439
|
storeRef.current = createVoiceCampaignDialerProofStore(path, options);
|
|
9933
10440
|
}
|
|
9934
10441
|
const store = storeRef.current;
|
|
9935
|
-
|
|
10442
|
+
useEffect22(() => {
|
|
9936
10443
|
store.refresh().catch(() => {});
|
|
9937
10444
|
return () => store.close();
|
|
9938
10445
|
}, [store]);
|
|
9939
10446
|
return {
|
|
9940
|
-
...
|
|
10447
|
+
...useSyncExternalStore22(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
9941
10448
|
refresh: store.refresh,
|
|
9942
10449
|
runProof: store.runProof
|
|
9943
10450
|
};
|
|
9944
10451
|
};
|
|
9945
10452
|
// src/react/useVoiceStream.tsx
|
|
9946
|
-
import { useEffect as
|
|
10453
|
+
import { useEffect as useEffect23, useRef as useRef23, useSyncExternalStore as useSyncExternalStore23 } from "react";
|
|
9947
10454
|
|
|
9948
10455
|
// src/client/actions.ts
|
|
9949
10456
|
var normalizeErrorMessage = (value) => {
|
|
@@ -11364,13 +11871,13 @@ var EMPTY_SNAPSHOT = {
|
|
|
11364
11871
|
turns: []
|
|
11365
11872
|
};
|
|
11366
11873
|
var useVoiceStream = (path, options = {}) => {
|
|
11367
|
-
const streamRef =
|
|
11874
|
+
const streamRef = useRef23(null);
|
|
11368
11875
|
if (!streamRef.current) {
|
|
11369
11876
|
streamRef.current = createVoiceStream(path, options);
|
|
11370
11877
|
}
|
|
11371
11878
|
const stream = streamRef.current;
|
|
11372
|
-
|
|
11373
|
-
const snapshot =
|
|
11879
|
+
useEffect23(() => () => stream.close(), [stream]);
|
|
11880
|
+
const snapshot = useSyncExternalStore23(stream.subscribe, stream.getSnapshot, stream.getServerSnapshot) ?? EMPTY_SNAPSHOT;
|
|
11374
11881
|
return {
|
|
11375
11882
|
...snapshot,
|
|
11376
11883
|
callControl: (message) => stream.callControl(message),
|
|
@@ -11381,7 +11888,7 @@ var useVoiceStream = (path, options = {}) => {
|
|
|
11381
11888
|
};
|
|
11382
11889
|
};
|
|
11383
11890
|
// src/react/useVoiceController.tsx
|
|
11384
|
-
import { useEffect as
|
|
11891
|
+
import { useEffect as useEffect24, useRef as useRef24, useSyncExternalStore as useSyncExternalStore24 } from "react";
|
|
11385
11892
|
|
|
11386
11893
|
// src/client/htmx.ts
|
|
11387
11894
|
var DEFAULT_EVENT_NAME = "voice-refresh";
|
|
@@ -12050,13 +12557,13 @@ var EMPTY_SNAPSHOT2 = {
|
|
|
12050
12557
|
turns: []
|
|
12051
12558
|
};
|
|
12052
12559
|
var useVoiceController = (path, options = {}) => {
|
|
12053
|
-
const controllerRef =
|
|
12560
|
+
const controllerRef = useRef24(null);
|
|
12054
12561
|
if (!controllerRef.current) {
|
|
12055
12562
|
controllerRef.current = createVoiceController(path, options);
|
|
12056
12563
|
}
|
|
12057
12564
|
const controller = controllerRef.current;
|
|
12058
|
-
|
|
12059
|
-
const snapshot =
|
|
12565
|
+
useEffect24(() => () => controller.close(), [controller]);
|
|
12566
|
+
const snapshot = useSyncExternalStore24(controller.subscribe, controller.getSnapshot, controller.getServerSnapshot) ?? EMPTY_SNAPSHOT2;
|
|
12060
12567
|
return {
|
|
12061
12568
|
...snapshot,
|
|
12062
12569
|
bindHTMX: controller.bindHTMX,
|
|
@@ -12071,7 +12578,7 @@ var useVoiceController = (path, options = {}) => {
|
|
|
12071
12578
|
};
|
|
12072
12579
|
};
|
|
12073
12580
|
// src/react/useVoiceWorkflowStatus.tsx
|
|
12074
|
-
import { useEffect as
|
|
12581
|
+
import { useEffect as useEffect25, useRef as useRef25, useSyncExternalStore as useSyncExternalStore25 } from "react";
|
|
12075
12582
|
|
|
12076
12583
|
// src/client/workflowStatus.ts
|
|
12077
12584
|
var fetchVoiceWorkflowStatus = async (path = "/evals/scenarios/json", options = {}) => {
|
|
@@ -12154,17 +12661,17 @@ var createVoiceWorkflowStatusStore = (path = "/evals/scenarios/json", options =
|
|
|
12154
12661
|
|
|
12155
12662
|
// src/react/useVoiceWorkflowStatus.tsx
|
|
12156
12663
|
var useVoiceWorkflowStatus = (path = "/evals/scenarios/json", options = {}) => {
|
|
12157
|
-
const storeRef =
|
|
12664
|
+
const storeRef = useRef25(null);
|
|
12158
12665
|
if (!storeRef.current) {
|
|
12159
12666
|
storeRef.current = createVoiceWorkflowStatusStore(path, options);
|
|
12160
12667
|
}
|
|
12161
12668
|
const store = storeRef.current;
|
|
12162
|
-
|
|
12669
|
+
useEffect25(() => {
|
|
12163
12670
|
store.refresh().catch(() => {});
|
|
12164
12671
|
return () => store.close();
|
|
12165
12672
|
}, [store]);
|
|
12166
12673
|
return {
|
|
12167
|
-
...
|
|
12674
|
+
...useSyncExternalStore25(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
12168
12675
|
refresh: store.refresh
|
|
12169
12676
|
};
|
|
12170
12677
|
};
|
|
@@ -12176,6 +12683,7 @@ export {
|
|
|
12176
12683
|
useVoiceStream,
|
|
12177
12684
|
useVoiceSessionSnapshot,
|
|
12178
12685
|
useVoiceRoutingStatus,
|
|
12686
|
+
useVoiceReconnectProfileEvidence,
|
|
12179
12687
|
useVoiceReadinessFailures,
|
|
12180
12688
|
useVoiceProviderStatus,
|
|
12181
12689
|
useVoiceProviderSimulationControls,
|
|
@@ -12198,6 +12706,7 @@ export {
|
|
|
12198
12706
|
VoiceTraceTimeline,
|
|
12199
12707
|
VoiceSessionSnapshot,
|
|
12200
12708
|
VoiceRoutingStatus,
|
|
12709
|
+
VoiceReconnectProfileEvidence,
|
|
12201
12710
|
VoiceReadinessFailures,
|
|
12202
12711
|
VoiceProviderStatus,
|
|
12203
12712
|
VoiceProviderSimulationControls,
|