@absolutejs/voice 0.0.22-beta.204 → 0.0.22-beta.206
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/README.md +398 -1
- package/dist/angular/index.d.ts +1 -0
- package/dist/angular/index.js +150 -31
- package/dist/angular/voice-agent-squad-status.service.d.ts +12 -0
- package/dist/client/agentSquadStatus.d.ts +37 -0
- package/dist/client/agentSquadStatusWidget.d.ts +24 -0
- package/dist/client/index.d.ts +4 -0
- package/dist/client/index.js +170 -0
- package/dist/index.js +46 -7
- package/dist/phoneAgent.d.ts +14 -0
- package/dist/react/VoiceAgentSquadStatus.d.ts +5 -0
- package/dist/react/index.d.ts +2 -0
- package/dist/react/index.js +349 -97
- package/dist/react/useVoiceAgentSquadStatus.d.ts +8 -0
- package/dist/svelte/createVoiceAgentSquadStatus.d.ts +9 -0
- package/dist/svelte/index.d.ts +1 -0
- package/dist/svelte/index.js +211 -33
- package/dist/traceTimeline.d.ts +1 -0
- package/dist/vue/index.d.ts +1 -0
- package/dist/vue/index.js +255 -145
- package/dist/vue/useVoiceAgentSquadStatus.d.ts +9 -0
- package/package.json +1 -1
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type VoiceAgentSquadStatusClientOptions } from '../client/agentSquadStatus';
|
|
2
|
+
export declare const useVoiceAgentSquadStatus: (path?: string, options?: VoiceAgentSquadStatusClientOptions) => {
|
|
3
|
+
refresh: () => Promise<import("..").VoiceTraceTimelineReport | null>;
|
|
4
|
+
error: string | null;
|
|
5
|
+
isLoading: boolean;
|
|
6
|
+
report: import("../client").VoiceAgentSquadStatusReport;
|
|
7
|
+
updatedAt?: number;
|
|
8
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type VoiceAgentSquadStatusWidgetOptions } from '../client/agentSquadStatusWidget';
|
|
2
|
+
export declare const createVoiceAgentSquadStatus: (path?: string, options?: VoiceAgentSquadStatusWidgetOptions) => {
|
|
3
|
+
close: () => void;
|
|
4
|
+
getHTML: () => string;
|
|
5
|
+
getSnapshot: () => import("../client").VoiceAgentSquadStatusSnapshot;
|
|
6
|
+
getViewModel: () => import("../client").VoiceAgentSquadStatusViewModel;
|
|
7
|
+
refresh: () => Promise<import("..").VoiceTraceTimelineReport | null>;
|
|
8
|
+
subscribe: (listener: () => void) => () => void;
|
|
9
|
+
};
|
package/dist/svelte/index.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export { createVoiceStream } from './createVoiceStream';
|
|
|
10
10
|
export { createVoiceProviderStatus } from './createVoiceProviderStatus';
|
|
11
11
|
export { createVoiceRoutingStatus } from './createVoiceRoutingStatus';
|
|
12
12
|
export { createVoiceTraceTimeline } from './createVoiceTraceTimeline';
|
|
13
|
+
export { createVoiceAgentSquadStatus } from './createVoiceAgentSquadStatus';
|
|
13
14
|
export { createVoiceTurnLatency } from './createVoiceTurnLatency';
|
|
14
15
|
export { createVoiceTurnQuality } from './createVoiceTurnQuality';
|
|
15
16
|
export { createVoiceWorkflowStatus } from './createVoiceWorkflowStatus';
|
package/dist/svelte/index.js
CHANGED
|
@@ -4064,6 +4064,183 @@ var createVoiceTraceTimeline = (path = "/api/voice-traces", options = {}) => {
|
|
|
4064
4064
|
getViewModel: () => createVoiceTraceTimelineViewModel(store.getSnapshot(), options)
|
|
4065
4065
|
};
|
|
4066
4066
|
};
|
|
4067
|
+
// src/client/agentSquadStatus.ts
|
|
4068
|
+
var getString = (value) => typeof value === "string" && value.trim() ? value.trim() : undefined;
|
|
4069
|
+
var getPayloadString = (event, key) => getString(event.payload?.[key]);
|
|
4070
|
+
var eventStatus = (event) => {
|
|
4071
|
+
const status = getPayloadString(event, "status");
|
|
4072
|
+
if (status === "blocked")
|
|
4073
|
+
return "blocked";
|
|
4074
|
+
if (status === "unknown-target")
|
|
4075
|
+
return "unknown-target";
|
|
4076
|
+
if (status === "allowed")
|
|
4077
|
+
return "handoff";
|
|
4078
|
+
return event.type === "agent.result" ? "active" : "handoff";
|
|
4079
|
+
};
|
|
4080
|
+
var deriveSessionSpecialist = (session) => {
|
|
4081
|
+
const events = [...session.events].sort((left, right) => left.at - right.at);
|
|
4082
|
+
const agentEvents = events.filter((event) => event.type === "agent.handoff" || event.type === "agent.context" || event.type === "agent.result" || event.type === "agent.model");
|
|
4083
|
+
const latest = agentEvents.at(-1);
|
|
4084
|
+
if (!latest) {
|
|
4085
|
+
return {
|
|
4086
|
+
lastEventAt: session.lastEventAt,
|
|
4087
|
+
sessionId: session.sessionId,
|
|
4088
|
+
status: "idle"
|
|
4089
|
+
};
|
|
4090
|
+
}
|
|
4091
|
+
const handoffEvents = events.filter((event) => event.type === "agent.handoff");
|
|
4092
|
+
const lastHandoff = handoffEvents.at(-1);
|
|
4093
|
+
const latestAgentId = getPayloadString(latest, "agentId");
|
|
4094
|
+
const handoffStatus = lastHandoff ? eventStatus(lastHandoff) : undefined;
|
|
4095
|
+
const currentTarget = handoffStatus === "blocked" || handoffStatus === "unknown-target" ? getPayloadString(lastHandoff, "fromAgentId") ?? latestAgentId : getPayloadString(lastHandoff ?? latest, "targetAgentId") ?? latestAgentId;
|
|
4096
|
+
return {
|
|
4097
|
+
fromAgentId: getPayloadString(lastHandoff ?? latest, "fromAgentId"),
|
|
4098
|
+
lastEventAt: latest.at,
|
|
4099
|
+
reason: getPayloadString(lastHandoff ?? latest, "reason") ?? getPayloadString(latest, "handoffTarget"),
|
|
4100
|
+
sessionId: session.sessionId,
|
|
4101
|
+
status: lastHandoff ? eventStatus(lastHandoff) : "active",
|
|
4102
|
+
summary: getPayloadString(lastHandoff ?? latest, "summary"),
|
|
4103
|
+
targetAgentId: currentTarget,
|
|
4104
|
+
turnId: latest.turnId
|
|
4105
|
+
};
|
|
4106
|
+
};
|
|
4107
|
+
var buildVoiceAgentSquadStatusReport = (timeline, options = {}) => {
|
|
4108
|
+
const sessions = (timeline?.sessions ?? []).filter((session) => !options.sessionId || session.sessionId === options.sessionId).map(deriveSessionSpecialist).sort((left, right) => (right.lastEventAt ?? 0) - (left.lastEventAt ?? 0));
|
|
4109
|
+
const active = sessions.filter((session) => session.status !== "idle");
|
|
4110
|
+
return {
|
|
4111
|
+
active,
|
|
4112
|
+
checkedAt: timeline?.checkedAt,
|
|
4113
|
+
current: active[0] ?? sessions[0],
|
|
4114
|
+
sessionCount: sessions.length,
|
|
4115
|
+
sessions
|
|
4116
|
+
};
|
|
4117
|
+
};
|
|
4118
|
+
var createVoiceAgentSquadStatusStore = (path = "/api/voice-traces", options = {}) => {
|
|
4119
|
+
const timelineStore = createVoiceTraceTimelineStore(path, options);
|
|
4120
|
+
const getReport = () => buildVoiceAgentSquadStatusReport(timelineStore.getSnapshot().report, {
|
|
4121
|
+
sessionId: options.sessionId
|
|
4122
|
+
});
|
|
4123
|
+
const getSnapshot = () => {
|
|
4124
|
+
const snapshot = timelineStore.getSnapshot();
|
|
4125
|
+
return {
|
|
4126
|
+
error: snapshot.error,
|
|
4127
|
+
isLoading: snapshot.isLoading,
|
|
4128
|
+
report: getReport(),
|
|
4129
|
+
updatedAt: snapshot.updatedAt
|
|
4130
|
+
};
|
|
4131
|
+
};
|
|
4132
|
+
return {
|
|
4133
|
+
close: timelineStore.close,
|
|
4134
|
+
getServerSnapshot: getSnapshot,
|
|
4135
|
+
getSnapshot,
|
|
4136
|
+
refresh: timelineStore.refresh,
|
|
4137
|
+
subscribe: timelineStore.subscribe
|
|
4138
|
+
};
|
|
4139
|
+
};
|
|
4140
|
+
|
|
4141
|
+
// src/client/agentSquadStatusWidget.ts
|
|
4142
|
+
var DEFAULT_TITLE9 = "Voice Agent Squad";
|
|
4143
|
+
var DEFAULT_DESCRIPTION9 = "Current specialist and recent handoffs from your self-hosted voice traces.";
|
|
4144
|
+
var escapeHtml12 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
4145
|
+
var labelFor = (current) => {
|
|
4146
|
+
if (!current)
|
|
4147
|
+
return "Waiting for specialist activity";
|
|
4148
|
+
if (current.status === "blocked")
|
|
4149
|
+
return "Handoff blocked";
|
|
4150
|
+
if (current.status === "unknown-target")
|
|
4151
|
+
return "Unknown specialist";
|
|
4152
|
+
if (current.targetAgentId)
|
|
4153
|
+
return `Current: ${current.targetAgentId}`;
|
|
4154
|
+
return "Specialist active";
|
|
4155
|
+
};
|
|
4156
|
+
var createVoiceAgentSquadStatusViewModel = (snapshot, options = {}) => ({
|
|
4157
|
+
current: snapshot.report.current,
|
|
4158
|
+
description: options.description ?? DEFAULT_DESCRIPTION9,
|
|
4159
|
+
error: snapshot.error,
|
|
4160
|
+
isLoading: snapshot.isLoading,
|
|
4161
|
+
label: snapshot.error ? "Unavailable" : labelFor(snapshot.report.current),
|
|
4162
|
+
sessionCount: snapshot.report.sessionCount,
|
|
4163
|
+
sessions: snapshot.report.sessions,
|
|
4164
|
+
title: options.title ?? DEFAULT_TITLE9,
|
|
4165
|
+
updatedAt: snapshot.updatedAt
|
|
4166
|
+
});
|
|
4167
|
+
var renderVoiceAgentSquadStatusHTML = (snapshot, options = {}) => {
|
|
4168
|
+
const model = createVoiceAgentSquadStatusViewModel(snapshot, options);
|
|
4169
|
+
const current = model.current;
|
|
4170
|
+
const rows = model.sessions.length ? model.sessions.slice(0, 5).map((session) => `<li>
|
|
4171
|
+
<span>${escapeHtml12(session.sessionId)}</span>
|
|
4172
|
+
<strong>${escapeHtml12(session.targetAgentId ?? "none")}</strong>
|
|
4173
|
+
<em>${escapeHtml12(session.status)}</em>
|
|
4174
|
+
${session.summary || session.reason ? `<p>${escapeHtml12(session.summary ?? session.reason ?? "")}</p>` : ""}
|
|
4175
|
+
</li>`).join("") : "<li><span>No squad traces yet.</span><strong>Waiting</strong></li>";
|
|
4176
|
+
return `<section class="absolute-voice-agent-squad-status">
|
|
4177
|
+
<header>
|
|
4178
|
+
<span>${escapeHtml12(model.title)}</span>
|
|
4179
|
+
<strong>${escapeHtml12(model.label)}</strong>
|
|
4180
|
+
</header>
|
|
4181
|
+
<p>${escapeHtml12(model.description)}</p>
|
|
4182
|
+
<div>
|
|
4183
|
+
<span>Session</span><strong>${escapeHtml12(current?.sessionId ?? "n/a")}</strong>
|
|
4184
|
+
<span>From</span><strong>${escapeHtml12(current?.fromAgentId ?? "n/a")}</strong>
|
|
4185
|
+
<span>Status</span><strong>${escapeHtml12(current?.status ?? "idle")}</strong>
|
|
4186
|
+
</div>
|
|
4187
|
+
<ul>${rows}</ul>
|
|
4188
|
+
${model.error ? `<p class="absolute-voice-agent-squad-status__error">${escapeHtml12(model.error)}</p>` : ""}
|
|
4189
|
+
</section>`;
|
|
4190
|
+
};
|
|
4191
|
+
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}`;
|
|
4192
|
+
var mountVoiceAgentSquadStatus = (element, path = "/api/voice-traces", options = {}) => {
|
|
4193
|
+
if (!element) {
|
|
4194
|
+
throw new Error("mountVoiceAgentSquadStatus requires an element.");
|
|
4195
|
+
}
|
|
4196
|
+
const store = createVoiceAgentSquadStatusStore(path, options);
|
|
4197
|
+
const render = () => {
|
|
4198
|
+
element.innerHTML = `<style>${getVoiceAgentSquadStatusCSS()}</style>${renderVoiceAgentSquadStatusHTML(store.getSnapshot(), options)}`;
|
|
4199
|
+
};
|
|
4200
|
+
const unsubscribe = store.subscribe(render);
|
|
4201
|
+
render();
|
|
4202
|
+
store.refresh().catch(() => {});
|
|
4203
|
+
return {
|
|
4204
|
+
close: () => {
|
|
4205
|
+
unsubscribe();
|
|
4206
|
+
store.close();
|
|
4207
|
+
},
|
|
4208
|
+
refresh: store.refresh
|
|
4209
|
+
};
|
|
4210
|
+
};
|
|
4211
|
+
var defineVoiceAgentSquadStatusElement = (tagName = "absolute-voice-agent-squad-status", options = {}) => {
|
|
4212
|
+
if (typeof window === "undefined" || typeof customElements === "undefined" || customElements.get(tagName)) {
|
|
4213
|
+
return;
|
|
4214
|
+
}
|
|
4215
|
+
customElements.define(tagName, class AbsoluteVoiceAgentSquadStatusElement extends HTMLElement {
|
|
4216
|
+
mounted;
|
|
4217
|
+
connectedCallback() {
|
|
4218
|
+
this.mounted = mountVoiceAgentSquadStatus(this, this.getAttribute("path") ?? "/api/voice-traces", {
|
|
4219
|
+
...options,
|
|
4220
|
+
description: this.getAttribute("description") ?? options.description,
|
|
4221
|
+
sessionId: this.getAttribute("session-id") ?? options.sessionId,
|
|
4222
|
+
title: this.getAttribute("title") ?? options.title
|
|
4223
|
+
});
|
|
4224
|
+
}
|
|
4225
|
+
disconnectedCallback() {
|
|
4226
|
+
this.mounted?.close();
|
|
4227
|
+
this.mounted = undefined;
|
|
4228
|
+
}
|
|
4229
|
+
});
|
|
4230
|
+
};
|
|
4231
|
+
|
|
4232
|
+
// src/svelte/createVoiceAgentSquadStatus.ts
|
|
4233
|
+
var createVoiceAgentSquadStatus = (path = "/api/voice-traces", options = {}) => {
|
|
4234
|
+
const store = createVoiceAgentSquadStatusStore(path, options);
|
|
4235
|
+
return {
|
|
4236
|
+
close: store.close,
|
|
4237
|
+
getHTML: () => renderVoiceAgentSquadStatusHTML(store.getSnapshot(), options),
|
|
4238
|
+
getSnapshot: store.getSnapshot,
|
|
4239
|
+
getViewModel: () => createVoiceAgentSquadStatusViewModel(store.getSnapshot(), options),
|
|
4240
|
+
refresh: store.refresh,
|
|
4241
|
+
subscribe: store.subscribe
|
|
4242
|
+
};
|
|
4243
|
+
};
|
|
4067
4244
|
// src/client/turnLatency.ts
|
|
4068
4245
|
var fetchVoiceTurnLatency = async (path = "/api/turn-latency", options = {}) => {
|
|
4069
4246
|
const fetchImpl = options.fetch ?? globalThis.fetch;
|
|
@@ -4168,10 +4345,10 @@ var createVoiceTurnLatencyStore = (path = "/api/turn-latency", options = {}) =>
|
|
|
4168
4345
|
};
|
|
4169
4346
|
|
|
4170
4347
|
// src/client/turnLatencyWidget.ts
|
|
4171
|
-
var
|
|
4172
|
-
var
|
|
4348
|
+
var DEFAULT_TITLE10 = "Turn Latency";
|
|
4349
|
+
var DEFAULT_DESCRIPTION10 = "Per-turn timing from first transcript to commit and assistant response start.";
|
|
4173
4350
|
var DEFAULT_PROOF_LABEL = "Run latency proof";
|
|
4174
|
-
var
|
|
4351
|
+
var escapeHtml13 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
4175
4352
|
var formatMs2 = (value) => typeof value === "number" ? `${Math.round(value)}ms` : "n/a";
|
|
4176
4353
|
var createVoiceTurnLatencyViewModel = (snapshot, options = {}) => {
|
|
4177
4354
|
const turns = (snapshot.report?.turns ?? []).map((turn) => ({
|
|
@@ -4185,39 +4362,39 @@ var createVoiceTurnLatencyViewModel = (snapshot, options = {}) => {
|
|
|
4185
4362
|
const warningCount = snapshot.report?.warnings ?? turns.filter((turn) => turn.status === "warn").length;
|
|
4186
4363
|
const failedCount = snapshot.report?.failed ?? turns.filter((turn) => turn.status === "fail").length;
|
|
4187
4364
|
return {
|
|
4188
|
-
description: options.description ??
|
|
4365
|
+
description: options.description ?? DEFAULT_DESCRIPTION10,
|
|
4189
4366
|
error: snapshot.error,
|
|
4190
4367
|
isLoading: snapshot.isLoading,
|
|
4191
4368
|
label: snapshot.error ? "Unavailable" : turns.length ? failedCount > 0 ? `${failedCount} slow` : warningCount > 0 ? `${warningCount} warnings` : `avg ${formatMs2(snapshot.report?.averageTotalMs)}` : snapshot.isLoading ? "Checking" : "No turns",
|
|
4192
4369
|
proofLabel: options.proofPath ? options.proofLabel ?? DEFAULT_PROOF_LABEL : undefined,
|
|
4193
4370
|
showProofAction: Boolean(options.proofPath),
|
|
4194
4371
|
status: snapshot.error ? "error" : turns.length ? failedCount > 0 || warningCount > 0 ? "warning" : "ready" : snapshot.isLoading ? "loading" : "empty",
|
|
4195
|
-
title: options.title ??
|
|
4372
|
+
title: options.title ?? DEFAULT_TITLE10,
|
|
4196
4373
|
turns,
|
|
4197
4374
|
updatedAt: snapshot.updatedAt
|
|
4198
4375
|
};
|
|
4199
4376
|
};
|
|
4200
4377
|
var renderVoiceTurnLatencyHTML = (snapshot, options = {}) => {
|
|
4201
4378
|
const model = createVoiceTurnLatencyViewModel(snapshot, options);
|
|
4202
|
-
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--${
|
|
4379
|
+
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--${escapeHtml13(turn.status)}">
|
|
4203
4380
|
<header>
|
|
4204
|
-
<strong>${
|
|
4205
|
-
<span>${
|
|
4381
|
+
<strong>${escapeHtml13(turn.label)}</strong>
|
|
4382
|
+
<span>${escapeHtml13(turn.status)}</span>
|
|
4206
4383
|
</header>
|
|
4207
4384
|
<dl>${turn.rows.map((row) => `<div>
|
|
4208
|
-
<dt>${
|
|
4209
|
-
<dd>${
|
|
4385
|
+
<dt>${escapeHtml13(row.label)}</dt>
|
|
4386
|
+
<dd>${escapeHtml13(row.value)}</dd>
|
|
4210
4387
|
</div>`).join("")}</dl>
|
|
4211
4388
|
</article>`).join("")}</div>` : '<p class="absolute-voice-turn-latency__empty">Complete a voice turn to see latency diagnostics.</p>';
|
|
4212
|
-
return `<section class="absolute-voice-turn-latency absolute-voice-turn-latency--${
|
|
4389
|
+
return `<section class="absolute-voice-turn-latency absolute-voice-turn-latency--${escapeHtml13(model.status)}">
|
|
4213
4390
|
<header class="absolute-voice-turn-latency__header">
|
|
4214
|
-
<span class="absolute-voice-turn-latency__eyebrow">${
|
|
4215
|
-
<strong class="absolute-voice-turn-latency__label">${
|
|
4391
|
+
<span class="absolute-voice-turn-latency__eyebrow">${escapeHtml13(model.title)}</span>
|
|
4392
|
+
<strong class="absolute-voice-turn-latency__label">${escapeHtml13(model.label)}</strong>
|
|
4216
4393
|
</header>
|
|
4217
|
-
<p class="absolute-voice-turn-latency__description">${
|
|
4218
|
-
${model.showProofAction ? `<button class="absolute-voice-turn-latency__proof" data-absolute-voice-turn-latency-proof type="button">${
|
|
4394
|
+
<p class="absolute-voice-turn-latency__description">${escapeHtml13(model.description)}</p>
|
|
4395
|
+
${model.showProofAction ? `<button class="absolute-voice-turn-latency__proof" data-absolute-voice-turn-latency-proof type="button">${escapeHtml13(model.proofLabel ?? DEFAULT_PROOF_LABEL)}</button>` : ""}
|
|
4219
4396
|
${turns}
|
|
4220
|
-
${model.error ? `<p class="absolute-voice-turn-latency__error">${
|
|
4397
|
+
${model.error ? `<p class="absolute-voice-turn-latency__error">${escapeHtml13(model.error)}</p>` : ""}
|
|
4221
4398
|
</section>`;
|
|
4222
4399
|
};
|
|
4223
4400
|
var mountVoiceTurnLatency = (element, path = "/api/turn-latency", options = {}) => {
|
|
@@ -4356,9 +4533,9 @@ var createVoiceTurnQualityStore = (path = "/api/turn-quality", options = {}) =>
|
|
|
4356
4533
|
};
|
|
4357
4534
|
|
|
4358
4535
|
// src/client/turnQualityWidget.ts
|
|
4359
|
-
var
|
|
4360
|
-
var
|
|
4361
|
-
var
|
|
4536
|
+
var DEFAULT_TITLE11 = "Turn Quality";
|
|
4537
|
+
var DEFAULT_DESCRIPTION11 = "Per-turn STT confidence, fallback selection, corrections, and transcript coverage.";
|
|
4538
|
+
var escapeHtml14 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
4362
4539
|
var formatConfidence = (value) => typeof value === "number" ? `${Math.round(value * 100)}%` : "n/a";
|
|
4363
4540
|
var formatMaybe = (value) => value === undefined || value === "" ? "n/a" : String(value);
|
|
4364
4541
|
var getTurnDetail = (turn) => {
|
|
@@ -4396,37 +4573,37 @@ var createVoiceTurnQualityViewModel = (snapshot, options = {}) => {
|
|
|
4396
4573
|
const warningCount = snapshot.report?.warnings ?? turns.filter((turn) => turn.status === "warn").length;
|
|
4397
4574
|
const failedCount = snapshot.report?.failed ?? turns.filter((turn) => turn.status === "fail").length;
|
|
4398
4575
|
return {
|
|
4399
|
-
description: options.description ??
|
|
4576
|
+
description: options.description ?? DEFAULT_DESCRIPTION11,
|
|
4400
4577
|
error: snapshot.error,
|
|
4401
4578
|
isLoading: snapshot.isLoading,
|
|
4402
4579
|
label: snapshot.error ? "Unavailable" : turns.length ? failedCount > 0 ? `${failedCount} failed` : warningCount > 0 ? `${warningCount} warnings` : `${turns.length} healthy` : snapshot.isLoading ? "Checking" : "No turns",
|
|
4403
4580
|
status: snapshot.error ? "error" : turns.length ? failedCount > 0 || warningCount > 0 ? "warning" : "ready" : snapshot.isLoading ? "loading" : "empty",
|
|
4404
|
-
title: options.title ??
|
|
4581
|
+
title: options.title ?? DEFAULT_TITLE11,
|
|
4405
4582
|
turns,
|
|
4406
4583
|
updatedAt: snapshot.updatedAt
|
|
4407
4584
|
};
|
|
4408
4585
|
};
|
|
4409
4586
|
var renderVoiceTurnQualityHTML = (snapshot, options = {}) => {
|
|
4410
4587
|
const model = createVoiceTurnQualityViewModel(snapshot, options);
|
|
4411
|
-
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--${
|
|
4588
|
+
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--${escapeHtml14(turn.status)}">
|
|
4412
4589
|
<header>
|
|
4413
|
-
<strong>${
|
|
4414
|
-
<span>${
|
|
4590
|
+
<strong>${escapeHtml14(turn.label)}</strong>
|
|
4591
|
+
<span>${escapeHtml14(turn.status)}</span>
|
|
4415
4592
|
</header>
|
|
4416
|
-
<p>${
|
|
4593
|
+
<p>${escapeHtml14(turn.detail)}</p>
|
|
4417
4594
|
<dl>${turn.rows.map((row) => `<div>
|
|
4418
|
-
<dt>${
|
|
4419
|
-
<dd>${
|
|
4595
|
+
<dt>${escapeHtml14(row.label)}</dt>
|
|
4596
|
+
<dd>${escapeHtml14(row.value)}</dd>
|
|
4420
4597
|
</div>`).join("")}</dl>
|
|
4421
4598
|
</article>`).join("")}</div>` : '<p class="absolute-voice-turn-quality__empty">Complete a voice turn to see STT quality diagnostics.</p>';
|
|
4422
|
-
return `<section class="absolute-voice-turn-quality absolute-voice-turn-quality--${
|
|
4599
|
+
return `<section class="absolute-voice-turn-quality absolute-voice-turn-quality--${escapeHtml14(model.status)}">
|
|
4423
4600
|
<header class="absolute-voice-turn-quality__header">
|
|
4424
|
-
<span class="absolute-voice-turn-quality__eyebrow">${
|
|
4425
|
-
<strong class="absolute-voice-turn-quality__label">${
|
|
4601
|
+
<span class="absolute-voice-turn-quality__eyebrow">${escapeHtml14(model.title)}</span>
|
|
4602
|
+
<strong class="absolute-voice-turn-quality__label">${escapeHtml14(model.label)}</strong>
|
|
4426
4603
|
</header>
|
|
4427
|
-
<p class="absolute-voice-turn-quality__description">${
|
|
4604
|
+
<p class="absolute-voice-turn-quality__description">${escapeHtml14(model.description)}</p>
|
|
4428
4605
|
${turns}
|
|
4429
|
-
${model.error ? `<p class="absolute-voice-turn-quality__error">${
|
|
4606
|
+
${model.error ? `<p class="absolute-voice-turn-quality__error">${escapeHtml14(model.error)}</p>` : ""}
|
|
4430
4607
|
</section>`;
|
|
4431
4608
|
};
|
|
4432
4609
|
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}`;
|
|
@@ -5213,5 +5390,6 @@ export {
|
|
|
5213
5390
|
createVoiceLiveOps,
|
|
5214
5391
|
createVoiceDeliveryRuntime,
|
|
5215
5392
|
createVoiceController,
|
|
5216
|
-
createVoiceCampaignDialerProof
|
|
5393
|
+
createVoiceCampaignDialerProof,
|
|
5394
|
+
createVoiceAgentSquadStatus
|
|
5217
5395
|
};
|
package/dist/traceTimeline.d.ts
CHANGED
package/dist/vue/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export { VoiceProviderCapabilities } from './VoiceProviderCapabilities';
|
|
|
6
6
|
export { VoiceProviderContracts } from './VoiceProviderContracts';
|
|
7
7
|
export { VoiceProviderStatus } from './VoiceProviderStatus';
|
|
8
8
|
export { VoiceRoutingStatus } from './VoiceRoutingStatus';
|
|
9
|
+
export { useVoiceAgentSquadStatus } from './useVoiceAgentSquadStatus';
|
|
9
10
|
export { VoiceTurnLatency } from './VoiceTurnLatency';
|
|
10
11
|
export { VoiceTurnQuality } from './VoiceTurnQuality';
|
|
11
12
|
export { useVoiceOpsStatus } from './useVoiceOpsStatus';
|