@absolutejs/voice 0.0.22-beta.402 → 0.0.22-beta.404
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/callDebugger.d.ts +8 -0
- package/dist/client/callDebugger.d.ts +19 -0
- package/dist/client/callDebuggerWidget.d.ts +30 -0
- package/dist/client/index.d.ts +4 -0
- package/dist/client/index.js +525 -345
- package/dist/index.d.ts +1 -1
- package/dist/index.js +42 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -33,7 +33,7 @@ export type { VoicePlatformCoverageAssertionInput, VoicePlatformCoverageAssertio
|
|
|
33
33
|
export { assertVoiceProofTrendEvidence, appendVoiceRealCallProfileRecoveryEvidence, buildEmptyVoiceProofTrendReport, buildVoiceProofTrendProfileSummaries, buildVoiceProofTrendRecommendationReport, buildVoiceProofTrendReportFromRealCallProfiles, buildVoiceProofTrendReport, buildVoiceRealCallProfileEvidenceFromTraceEvents, buildVoiceRealCallProfileDefaults, buildVoiceRealCallProfileHistoryReport, buildVoiceRealCallProfileReadinessCheck, buildVoiceRealCallProfileRecoveryJobHistoryCheck, buildVoiceRealCallProfileRecoveryActions, createVoiceInMemoryRealCallProfileRecoveryJobStore, createVoiceRealCallProfileTraceCollector, createVoiceSQLiteRealCallProfileRecoveryJobStore, createVoiceProofTrendRecommendationRoutes, createVoiceProofTrendRoutes, createVoiceRealCallProfileHistoryRoutes, createVoiceRealCallProfileRecoveryActionRoutes, DEFAULT_VOICE_PROOF_TREND_PROFILE_DEFINITIONS, DEFAULT_VOICE_PROOF_TRENDS_MAX_AGE_MS, evaluateVoiceProofTrendEvidence, formatVoiceProofTrendAge, loadVoiceRealCallProfileEvidenceFromTraceStore, normalizeVoiceProofTrendReport, readVoiceProofTrendReportFile, renderVoiceProofTrendRecommendationHTML, renderVoiceProofTrendRecommendationMarkdown, renderVoiceRealCallProfileHistoryHTML, renderVoiceRealCallProfileHistoryMarkdown, runVoiceRealCallProfileRecoveryLoop, resolveVoiceRealCallProfileProviderRoute } from './proofTrends';
|
|
34
34
|
export { createVoiceEvidenceAssertion, createVoiceProofAssertion, summarizeVoiceProofAssertions } from './proofAssertions';
|
|
35
35
|
export { buildVoiceSessionSnapshot, buildVoiceSessionSnapshotStatus, createVoiceSessionSnapshotRoutes, parseVoiceSessionSnapshot } from './sessionSnapshot';
|
|
36
|
-
export { buildVoiceCallDebuggerReport, createVoiceCallDebuggerRoutes, renderVoiceCallDebuggerHTML } from './callDebugger';
|
|
36
|
+
export { buildVoiceCallDebuggerReport, createVoiceCallDebuggerRoutes, renderVoiceCallDebuggerHTML, resolveLatestVoiceCallDebuggerSessionId } from './callDebugger';
|
|
37
37
|
export type { VoiceEvidenceAssertionInput, VoiceProofAssertionInput, VoiceProofAssertionResult, VoiceProofAssertionSummary } from './proofAssertions';
|
|
38
38
|
export type { VoiceSessionSnapshot, VoiceSessionSnapshotArtifact, VoiceSessionSnapshotArtifactKind, VoiceSessionSnapshotInput, VoiceSessionSnapshotQualityEvidence, VoiceSessionSnapshotRoutesOptions, VoiceSessionSnapshotRouteSource, VoiceSessionSnapshotRouteSourceInput, VoiceSessionSnapshotStatus } from './sessionSnapshot';
|
|
39
39
|
export type { VoiceCallDebuggerReport, VoiceCallDebuggerRoutesOptions } from './callDebugger';
|
package/dist/index.js
CHANGED
|
@@ -19880,6 +19880,40 @@ var resolveOperationsRecordHref2 = (href, sessionId) => {
|
|
|
19880
19880
|
}
|
|
19881
19881
|
return href?.replaceAll(":sessionId", encodeURIComponent(sessionId));
|
|
19882
19882
|
};
|
|
19883
|
+
var resolveLatestVoiceCallDebuggerSessionId = (events) => {
|
|
19884
|
+
const bySession = new Map;
|
|
19885
|
+
for (const event of events) {
|
|
19886
|
+
if (!event.sessionId) {
|
|
19887
|
+
continue;
|
|
19888
|
+
}
|
|
19889
|
+
bySession.set(event.sessionId, [
|
|
19890
|
+
...bySession.get(event.sessionId) ?? [],
|
|
19891
|
+
event
|
|
19892
|
+
]);
|
|
19893
|
+
}
|
|
19894
|
+
const candidates = [...bySession.entries()].map(([sessionId, sessionEvents]) => {
|
|
19895
|
+
const sorted = filterVoiceTraceEvents([...sessionEvents]);
|
|
19896
|
+
const summary = summarizeVoiceTrace(sorted);
|
|
19897
|
+
const latestAt = sorted.at(-1)?.at ?? 0;
|
|
19898
|
+
const meaningful = summary.turnCount > 0 || summary.transcriptCount > 0 || summary.assistantReplyCount > 0 || sorted.some((event) => event.type === "call.lifecycle");
|
|
19899
|
+
const failed = summary.failed || summary.errorCount > 0 || sorted.some((event) => event.type.includes("provider") && (event.payload.status === "error" || event.payload.status === "degraded"));
|
|
19900
|
+
return { failed, latestAt, meaningful, sessionId };
|
|
19901
|
+
}).filter((candidate) => candidate.meaningful).sort((left, right) => Number(right.failed) - Number(left.failed) || right.latestAt - left.latestAt || left.sessionId.localeCompare(right.sessionId));
|
|
19902
|
+
return candidates[0]?.sessionId;
|
|
19903
|
+
};
|
|
19904
|
+
var resolveCallDebuggerSessionId = async (options, input) => {
|
|
19905
|
+
if (input.requestedSessionId !== "latest") {
|
|
19906
|
+
return input.requestedSessionId;
|
|
19907
|
+
}
|
|
19908
|
+
const events = options.events ?? await options.store?.list({ limit: 1000 }) ?? [];
|
|
19909
|
+
const resolved = await options.resolveSessionId?.({
|
|
19910
|
+
events,
|
|
19911
|
+
request: input.request,
|
|
19912
|
+
requestedSessionId: input.requestedSessionId,
|
|
19913
|
+
store: options.store
|
|
19914
|
+
});
|
|
19915
|
+
return resolved ?? resolveLatestVoiceCallDebuggerSessionId(events) ?? "latest";
|
|
19916
|
+
};
|
|
19883
19917
|
var isVoiceSessionSnapshot2 = (value) => value.schema === "absolute.voice.session.snapshot.v1";
|
|
19884
19918
|
var resolveSnapshot = async (options, input) => {
|
|
19885
19919
|
const source = typeof options.snapshot === "function" ? await options.snapshot(input) : options.snapshot ?? {
|
|
@@ -19949,7 +19983,13 @@ var createVoiceCallDebuggerRoutes = (options) => {
|
|
|
19949
19983
|
const app = new Elysia29({
|
|
19950
19984
|
name: options.name ?? "absolutejs-voice-call-debugger"
|
|
19951
19985
|
});
|
|
19952
|
-
const build = (request,
|
|
19986
|
+
const build = async (request, requestedSessionId) => buildVoiceCallDebuggerReport(options, {
|
|
19987
|
+
request,
|
|
19988
|
+
sessionId: await resolveCallDebuggerSessionId(options, {
|
|
19989
|
+
request,
|
|
19990
|
+
requestedSessionId
|
|
19991
|
+
})
|
|
19992
|
+
});
|
|
19953
19993
|
app.get(path, async ({ params, request }) => Response.json(await build(request, resolveSessionId2(params)), {
|
|
19954
19994
|
headers: options.headers
|
|
19955
19995
|
}));
|
|
@@ -39869,6 +39909,7 @@ export {
|
|
|
39869
39909
|
resolveVoiceAuditDeliveryFilter,
|
|
39870
39910
|
resolveVoiceAssistantMemoryNamespace,
|
|
39871
39911
|
resolveTurnDetectionConfig,
|
|
39912
|
+
resolveLatestVoiceCallDebuggerSessionId,
|
|
39872
39913
|
resolveAudioConditioningConfig,
|
|
39873
39914
|
requeueVoiceOpsTask,
|
|
39874
39915
|
replayVoiceObservabilityExport,
|