@absolutejs/voice 0.0.22-beta.395 → 0.0.22-beta.397
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/index.d.ts +4 -2
- package/dist/index.js +134 -14
- package/dist/proofRunner.d.ts +36 -0
- package/dist/sessionSnapshot.d.ts +44 -0
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -32,9 +32,11 @@ export type { VoiceCompetitiveCoverageAssertionInput, VoiceCompetitiveCoverageAs
|
|
|
32
32
|
export type { VoicePlatformCoverageAssertionInput, VoicePlatformCoverageAssertionReport, VoicePlatformCoverageEvidence, VoicePlatformCoverageRoutesOptions, VoicePlatformCoverageStatus, VoicePlatformCoverageSummary, VoicePlatformCoverageSummaryInput, VoicePlatformCoverageSurface } from './platformCoverage';
|
|
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
|
+
export { buildVoiceSessionSnapshot, buildVoiceSessionSnapshotStatus, parseVoiceSessionSnapshot } from './sessionSnapshot';
|
|
35
36
|
export type { VoiceEvidenceAssertionInput, VoiceProofAssertionInput, VoiceProofAssertionResult, VoiceProofAssertionSummary } from './proofAssertions';
|
|
36
|
-
export {
|
|
37
|
-
export
|
|
37
|
+
export type { VoiceSessionSnapshot, VoiceSessionSnapshotInput, VoiceSessionSnapshotQualityEvidence, VoiceSessionSnapshotStatus } from './sessionSnapshot';
|
|
38
|
+
export { fetchVoiceProofTarget, getVoiceProofTargetLogicalFailure, mapVoiceProofTargetsWithConcurrency, runVoiceCommandProofTarget, runVoiceCommandProofTargets, runVoiceProofTargets } from './proofRunner';
|
|
39
|
+
export type { VoiceCommandProofExecutionResult, VoiceCommandProofTarget, VoiceCommandProofTargetResult, VoiceCommandProofTargetRunnerOptions, VoiceCommandProofTargetRunOptions, VoiceProofTarget, VoiceProofTargetMethod, VoiceProofTargetResult, VoiceProofTargetRunnerOptions, VoiceProofTargetRunOptions } from './proofRunner';
|
|
38
40
|
export { applyVoiceProfileSwitchGuard, buildVoiceProfileSwitchReadinessReport, buildVoiceProfileSwitchLiveDecisionReport, createVoiceProfileSwitchLiveDecisionRoutes, createVoiceProfileSwitchPolicyProofRoutes, createVoiceProfileSwitchReadinessRoutes, recommendVoiceProfileSwitch, renderVoiceProfileSwitchLiveDecisionHTML, renderVoiceProfileSwitchPolicyProofHTML, renderVoiceProfileSwitchReadinessHTML, runVoiceProfileSwitchPolicyProof } from './profileSwitchRecommendation';
|
|
39
41
|
export type { VoiceProfileSwitchGuardAction, VoiceProfileSwitchGuardDecision, VoiceProfileSwitchGuardMode, VoiceProfileSwitchGuardOptions, VoiceProfileSwitchObservedSignals, VoiceProfileSwitchLiveDecisionEvidence, VoiceProfileSwitchLiveDecisionReport, VoiceProfileSwitchLiveDecisionReportOptions, VoiceProfileSwitchLiveDecisionRoutesOptions, VoiceProfileSwitchLiveDecisionSession, VoiceProfileSwitchPolicyProofCase, VoiceProfileSwitchPolicyProofCaseResult, VoiceProfileSwitchPolicyProofOptions, VoiceProfileSwitchPolicyProofReport, VoiceProfileSwitchPolicyProofRoutesOptions, VoiceProfileSwitchReadinessIssue, VoiceProfileSwitchReadinessOptions, VoiceProfileSwitchReadinessReport, VoiceProfileSwitchReadinessRoutesOptions, VoiceProfileSwitchReadinessStatus, VoiceProfileSwitchRecommendation, VoiceProfileSwitchRecommendationOptions } from './profileSwitchRecommendation';
|
|
40
42
|
export { buildVoiceProviderDecisionTraceReport, createVoiceProviderDecisionTraceEvent, createVoiceProviderDecisionTraceRoutes, listVoiceProviderDecisionTraces, renderVoiceProviderDecisionTraceHTML, renderVoiceProviderDecisionTraceMarkdown } from './providerDecisionTraces';
|
package/dist/index.js
CHANGED
|
@@ -18385,6 +18385,73 @@ var summarizeVoiceProofAssertions = (assertions) => {
|
|
|
18385
18385
|
total: assertions.length
|
|
18386
18386
|
};
|
|
18387
18387
|
};
|
|
18388
|
+
// src/sessionSnapshot.ts
|
|
18389
|
+
var statusRank4 = (status) => {
|
|
18390
|
+
if (status === "fail") {
|
|
18391
|
+
return 2;
|
|
18392
|
+
}
|
|
18393
|
+
if (status === "warn") {
|
|
18394
|
+
return 1;
|
|
18395
|
+
}
|
|
18396
|
+
return 0;
|
|
18397
|
+
};
|
|
18398
|
+
var maxStatus = (statuses) => statuses.reduce((current, status) => statusRank4(status) > statusRank4(current) ? status : current, "pass");
|
|
18399
|
+
var buildVoiceSessionSnapshotStatus = (input) => {
|
|
18400
|
+
const statuses = [];
|
|
18401
|
+
for (const media of input.media ?? []) {
|
|
18402
|
+
statuses.push(media.report.status);
|
|
18403
|
+
}
|
|
18404
|
+
for (const quality of input.quality ?? []) {
|
|
18405
|
+
if (quality.status !== undefined) {
|
|
18406
|
+
statuses.push(quality.status);
|
|
18407
|
+
}
|
|
18408
|
+
}
|
|
18409
|
+
for (const outcome of input.telephonyOutcomes ?? []) {
|
|
18410
|
+
if (outcome.campaignOutcome.status === "failed") {
|
|
18411
|
+
statuses.push("fail");
|
|
18412
|
+
} else if (outcome.duplicate === true || !outcome.campaignOutcome.applied) {
|
|
18413
|
+
statuses.push("warn");
|
|
18414
|
+
}
|
|
18415
|
+
}
|
|
18416
|
+
if (input.proofSummary?.ok === false) {
|
|
18417
|
+
statuses.push("fail");
|
|
18418
|
+
}
|
|
18419
|
+
return maxStatus(statuses);
|
|
18420
|
+
};
|
|
18421
|
+
var buildVoiceSessionSnapshot = (input) => {
|
|
18422
|
+
const proofAssertions = [...input.proofAssertions ?? []];
|
|
18423
|
+
const proofSummary = summarizeVoiceProofAssertions(proofAssertions);
|
|
18424
|
+
const media = [...input.media ?? []];
|
|
18425
|
+
const providerRoutingEvents = [...input.providerRoutingEvents ?? []];
|
|
18426
|
+
const quality = [...input.quality ?? []];
|
|
18427
|
+
const telephonyOutcomes = [...input.telephonyOutcomes ?? []];
|
|
18428
|
+
return {
|
|
18429
|
+
capturedAt: Date.now(),
|
|
18430
|
+
media,
|
|
18431
|
+
name: input.name,
|
|
18432
|
+
proofAssertions,
|
|
18433
|
+
proofSummary,
|
|
18434
|
+
providerRoutingEvents,
|
|
18435
|
+
quality,
|
|
18436
|
+
scenarioId: input.scenarioId,
|
|
18437
|
+
schema: "absolute.voice.session.snapshot.v1",
|
|
18438
|
+
sessionId: input.sessionId,
|
|
18439
|
+
status: buildVoiceSessionSnapshotStatus({
|
|
18440
|
+
media,
|
|
18441
|
+
proofSummary,
|
|
18442
|
+
quality,
|
|
18443
|
+
telephonyOutcomes
|
|
18444
|
+
}),
|
|
18445
|
+
telephonyOutcomes,
|
|
18446
|
+
turnId: input.turnId
|
|
18447
|
+
};
|
|
18448
|
+
};
|
|
18449
|
+
var parseVoiceSessionSnapshot = (snapshot) => {
|
|
18450
|
+
if (snapshot.schema !== "absolute.voice.session.snapshot.v1") {
|
|
18451
|
+
throw new Error("Unsupported voice session snapshot schema.");
|
|
18452
|
+
}
|
|
18453
|
+
return snapshot;
|
|
18454
|
+
};
|
|
18388
18455
|
// src/proofRunner.ts
|
|
18389
18456
|
var encoder = new TextEncoder;
|
|
18390
18457
|
var trimBaseUrl = (baseUrl) => baseUrl.replace(/\/$/, "");
|
|
@@ -18549,6 +18616,54 @@ var fetchVoiceProofTarget = async (target, options) => {
|
|
|
18549
18616
|
}
|
|
18550
18617
|
};
|
|
18551
18618
|
var runVoiceProofTargets = (targets, options) => mapVoiceProofTargetsWithConcurrency(targets, options.concurrency ?? 2, (target) => fetchVoiceProofTarget(target, options));
|
|
18619
|
+
var runVoiceCommandProofTarget = async (target, options) => {
|
|
18620
|
+
const now = options.now ?? performance.now.bind(performance);
|
|
18621
|
+
const startedAt = now();
|
|
18622
|
+
const execution = await options.execute(target);
|
|
18623
|
+
const stdout = execution.stdout ?? "";
|
|
18624
|
+
const stderr = execution.stderr ?? "";
|
|
18625
|
+
const status = execution.status;
|
|
18626
|
+
const text = stdout.trim();
|
|
18627
|
+
const bytes = encoder.encode(`${stdout}${stderr}`).byteLength;
|
|
18628
|
+
let body = text;
|
|
18629
|
+
let parseError;
|
|
18630
|
+
if (text) {
|
|
18631
|
+
const jsonStart = text.indexOf("{");
|
|
18632
|
+
const jsonText = jsonStart >= 0 ? text.slice(jsonStart) : text;
|
|
18633
|
+
try {
|
|
18634
|
+
body = JSON.parse(jsonText);
|
|
18635
|
+
} catch (error) {
|
|
18636
|
+
parseError = error instanceof Error ? error.message : String(error);
|
|
18637
|
+
}
|
|
18638
|
+
}
|
|
18639
|
+
await options.writeArtifact?.({
|
|
18640
|
+
content: `${JSON.stringify({
|
|
18641
|
+
command: target.command,
|
|
18642
|
+
parseError,
|
|
18643
|
+
stderr,
|
|
18644
|
+
stdout,
|
|
18645
|
+
status,
|
|
18646
|
+
summary: parseError ? undefined : body
|
|
18647
|
+
}, null, 2)}
|
|
18648
|
+
`,
|
|
18649
|
+
name: `${safeArtifactName(target.name)}.json`,
|
|
18650
|
+
target
|
|
18651
|
+
});
|
|
18652
|
+
const logicalFailure = !parseError ? getVoiceProofTargetLogicalFailure(body) : undefined;
|
|
18653
|
+
return {
|
|
18654
|
+
body,
|
|
18655
|
+
bytes,
|
|
18656
|
+
command: target.command,
|
|
18657
|
+
elapsedMs: Math.round(now() - startedAt),
|
|
18658
|
+
error: parseError ?? logicalFailure ?? (status === 0 ? undefined : stderr.trim() || `Command exited ${status}`),
|
|
18659
|
+
kind: "command",
|
|
18660
|
+
name: target.name,
|
|
18661
|
+
ok: status === 0 && !parseError && !logicalFailure,
|
|
18662
|
+
status,
|
|
18663
|
+
summary: parseError ? { bytes, parseError } : summarizeValue(body)
|
|
18664
|
+
};
|
|
18665
|
+
};
|
|
18666
|
+
var runVoiceCommandProofTargets = (targets, options) => mapVoiceProofTargetsWithConcurrency(targets, options.concurrency ?? targets.length, (target) => runVoiceCommandProofTarget(target, options));
|
|
18552
18667
|
// src/providerRouterTraces.ts
|
|
18553
18668
|
var buildVoiceProviderRouterTraceEvent = (options) => ({
|
|
18554
18669
|
at: options.at ?? options.event.at,
|
|
@@ -28889,7 +29004,7 @@ var defaultRequirement = {
|
|
|
28889
29004
|
requireFallback: false,
|
|
28890
29005
|
requireTimeoutBudget: false
|
|
28891
29006
|
};
|
|
28892
|
-
var
|
|
29007
|
+
var statusRank5 = {
|
|
28893
29008
|
pass: 0,
|
|
28894
29009
|
warn: 1,
|
|
28895
29010
|
fail: 2
|
|
@@ -28905,7 +29020,7 @@ var surfaceProviderNames = (surface) => uniqueSorted6([
|
|
|
28905
29020
|
...isProviderList(surface.fallback) ? surface.fallback : [],
|
|
28906
29021
|
...isProviderList(surface.allowProviders) ? surface.allowProviders : []
|
|
28907
29022
|
]);
|
|
28908
|
-
var surfaceStatus = (issues) => issues.reduce((status, issue) =>
|
|
29023
|
+
var surfaceStatus = (issues) => issues.reduce((status, issue) => statusRank5[issue.status] > statusRank5[status] ? issue.status : status, "pass");
|
|
28909
29024
|
var resolvedRequirement = (surface, options) => ({
|
|
28910
29025
|
...defaultRequirement,
|
|
28911
29026
|
...options.defaultRequirement ?? {},
|
|
@@ -29256,7 +29371,7 @@ var defaultThresholds = {
|
|
|
29256
29371
|
}
|
|
29257
29372
|
};
|
|
29258
29373
|
var providerKinds = ["llm", "stt", "tts"];
|
|
29259
|
-
var
|
|
29374
|
+
var statusRank6 = {
|
|
29260
29375
|
pass: 0,
|
|
29261
29376
|
warn: 1,
|
|
29262
29377
|
fail: 2
|
|
@@ -29452,9 +29567,9 @@ var evaluateVoiceProviderSloEvidence = (report, input = {}) => {
|
|
|
29452
29567
|
const fallbacks = kindReports.reduce((total, kind) => total + kind.fallbacks, 0);
|
|
29453
29568
|
const timeouts = kindReports.reduce((total, kind) => total + kind.timeouts, 0);
|
|
29454
29569
|
const unresolvedErrors = kindReports.reduce((total, kind) => total + kind.unresolvedErrors, 0);
|
|
29455
|
-
const
|
|
29456
|
-
if (
|
|
29457
|
-
issues.push(`Expected provider SLO status at most ${
|
|
29570
|
+
const maxStatus2 = input.maxStatus ?? "pass";
|
|
29571
|
+
if (statusRank6[report.status] > statusRank6[maxStatus2]) {
|
|
29572
|
+
issues.push(`Expected provider SLO status at most ${maxStatus2}, found ${report.status}.`);
|
|
29458
29573
|
}
|
|
29459
29574
|
if (input.minEvents !== undefined && report.events < input.minEvents) {
|
|
29460
29575
|
issues.push(`Expected at least ${String(input.minEvents)} provider routing events, found ${String(report.events)}.`);
|
|
@@ -36052,12 +36167,12 @@ var recommendVoiceProviderStack = (input) => {
|
|
|
36052
36167
|
};
|
|
36053
36168
|
};
|
|
36054
36169
|
var rollupContractStatus = (checks) => checks.some((check) => check.status === "fail") ? "fail" : checks.some((check) => check.status === "warn") ? "warn" : "pass";
|
|
36055
|
-
var
|
|
36170
|
+
var statusRank7 = {
|
|
36056
36171
|
pass: 0,
|
|
36057
36172
|
warn: 1,
|
|
36058
36173
|
fail: 2
|
|
36059
36174
|
};
|
|
36060
|
-
var statusExceeds2 = (actual, max2) =>
|
|
36175
|
+
var statusExceeds2 = (actual, max2) => statusRank7[actual] > statusRank7[max2];
|
|
36061
36176
|
var buildVoiceProviderContractMatrix = (input) => {
|
|
36062
36177
|
const rows = input.contracts.map((contract) => {
|
|
36063
36178
|
const configured = contract.configured !== false;
|
|
@@ -36160,7 +36275,7 @@ var buildVoiceProviderContractMatrix = (input) => {
|
|
|
36160
36275
|
};
|
|
36161
36276
|
var evaluateVoiceProviderContractMatrixEvidence = (report, input = {}) => {
|
|
36162
36277
|
const issues = [];
|
|
36163
|
-
const
|
|
36278
|
+
const maxStatus2 = input.maxStatus ?? "pass";
|
|
36164
36279
|
const maxFailed = input.maxFailed ?? 0;
|
|
36165
36280
|
const maxWarned = input.maxWarned ?? 0;
|
|
36166
36281
|
const minRows = input.minRows ?? 1;
|
|
@@ -36170,8 +36285,8 @@ var evaluateVoiceProviderContractMatrixEvidence = (report, input = {}) => {
|
|
|
36170
36285
|
const selectedKinds = [
|
|
36171
36286
|
...new Set(report.rows.filter((row) => row.selected).map((row) => row.kind))
|
|
36172
36287
|
].sort();
|
|
36173
|
-
if (statusExceeds2(report.status,
|
|
36174
|
-
issues.push(`Expected provider contract matrix status at most ${
|
|
36288
|
+
if (statusExceeds2(report.status, maxStatus2)) {
|
|
36289
|
+
issues.push(`Expected provider contract matrix status at most ${maxStatus2}, found ${report.status}.`);
|
|
36175
36290
|
}
|
|
36176
36291
|
if (report.failed > maxFailed) {
|
|
36177
36292
|
issues.push(`Expected at most ${String(maxFailed)} failing provider contract row(s), found ${String(report.failed)}.`);
|
|
@@ -36365,15 +36480,15 @@ var evaluateVoiceProviderStackGaps = (input) => {
|
|
|
36365
36480
|
};
|
|
36366
36481
|
var evaluateVoiceProviderStackEvidence = (report, input = {}) => {
|
|
36367
36482
|
const issues = [];
|
|
36368
|
-
const
|
|
36483
|
+
const maxStatus2 = input.maxStatus ?? "pass";
|
|
36369
36484
|
const maxMissing = input.maxMissing ?? 0;
|
|
36370
36485
|
const requireProviders = input.requireProviders ?? true;
|
|
36371
36486
|
const kinds = [...new Set(report.gaps.map((gap) => gap.kind))].sort();
|
|
36372
36487
|
const providers = [
|
|
36373
36488
|
...new Set(report.gaps.map((gap) => gap.provider).filter((provider) => provider !== undefined))
|
|
36374
36489
|
].sort();
|
|
36375
|
-
if (statusExceeds2(report.status,
|
|
36376
|
-
issues.push(`Expected provider stack status at most ${
|
|
36490
|
+
if (statusExceeds2(report.status, maxStatus2)) {
|
|
36491
|
+
issues.push(`Expected provider stack status at most ${maxStatus2}, found ${report.status}.`);
|
|
36377
36492
|
}
|
|
36378
36493
|
if (report.missing > maxMissing) {
|
|
36379
36494
|
issues.push(`Expected at most ${String(maxMissing)} missing provider stack capability/capabilities, found ${String(report.missing)}.`);
|
|
@@ -39552,6 +39667,8 @@ export {
|
|
|
39552
39667
|
runVoiceProfileSwitchPolicyProof,
|
|
39553
39668
|
runVoicePhoneAgentProductionSmokeContract,
|
|
39554
39669
|
runVoiceOutcomeContractSuite,
|
|
39670
|
+
runVoiceCommandProofTargets,
|
|
39671
|
+
runVoiceCommandProofTarget,
|
|
39555
39672
|
runVoiceCampaignReadinessProof,
|
|
39556
39673
|
runVoiceCampaignProof,
|
|
39557
39674
|
runVoiceCampaignDialerProof,
|
|
@@ -39683,6 +39800,7 @@ export {
|
|
|
39683
39800
|
pruneVoiceTraceEvents,
|
|
39684
39801
|
pruneVoiceIncidentBundleArtifacts,
|
|
39685
39802
|
parseVoiceTelephonyWebhookEvent,
|
|
39803
|
+
parseVoiceSessionSnapshot,
|
|
39686
39804
|
normalizeVoiceProofTrendReport,
|
|
39687
39805
|
muteVoiceMonitorIssue,
|
|
39688
39806
|
matchesVoiceOpsTaskAssignmentRule,
|
|
@@ -40073,6 +40191,8 @@ export {
|
|
|
40073
40191
|
buildVoiceTelephonyMediaReport,
|
|
40074
40192
|
buildVoiceSloReadinessThresholdReport,
|
|
40075
40193
|
buildVoiceSloCalibrationReport,
|
|
40194
|
+
buildVoiceSessionSnapshotStatus,
|
|
40195
|
+
buildVoiceSessionSnapshot,
|
|
40076
40196
|
buildVoiceRealtimeProviderContractMatrix,
|
|
40077
40197
|
buildVoiceRealtimeChannelRuntimeSamplesFromTrace,
|
|
40078
40198
|
buildVoiceRealtimeChannelReport,
|
package/dist/proofRunner.d.ts
CHANGED
|
@@ -23,6 +23,28 @@ export type VoiceProofTargetResult = {
|
|
|
23
23
|
summary?: Record<string, unknown>;
|
|
24
24
|
url: string;
|
|
25
25
|
};
|
|
26
|
+
export type VoiceCommandProofTarget = {
|
|
27
|
+
command: string[];
|
|
28
|
+
kind: 'command';
|
|
29
|
+
name: string;
|
|
30
|
+
};
|
|
31
|
+
export type VoiceCommandProofExecutionResult = {
|
|
32
|
+
status: number;
|
|
33
|
+
stderr?: string;
|
|
34
|
+
stdout?: string;
|
|
35
|
+
};
|
|
36
|
+
export type VoiceCommandProofTargetResult = {
|
|
37
|
+
body?: unknown;
|
|
38
|
+
bytes: number;
|
|
39
|
+
command: string[];
|
|
40
|
+
elapsedMs: number;
|
|
41
|
+
error?: string;
|
|
42
|
+
kind: 'command';
|
|
43
|
+
name: string;
|
|
44
|
+
ok: boolean;
|
|
45
|
+
status?: number;
|
|
46
|
+
summary?: Record<string, unknown>;
|
|
47
|
+
};
|
|
26
48
|
export type VoiceProofTargetRunnerOptions = {
|
|
27
49
|
baseUrl: string;
|
|
28
50
|
fetch?: typeof fetch;
|
|
@@ -37,7 +59,21 @@ export type VoiceProofTargetRunnerOptions = {
|
|
|
37
59
|
export type VoiceProofTargetRunOptions = VoiceProofTargetRunnerOptions & {
|
|
38
60
|
concurrency?: number;
|
|
39
61
|
};
|
|
62
|
+
export type VoiceCommandProofTargetRunnerOptions = {
|
|
63
|
+
execute: (target: VoiceCommandProofTarget) => Promise<VoiceCommandProofExecutionResult> | VoiceCommandProofExecutionResult;
|
|
64
|
+
now?: () => number;
|
|
65
|
+
writeArtifact?: (input: {
|
|
66
|
+
content: string;
|
|
67
|
+
name: string;
|
|
68
|
+
target: VoiceCommandProofTarget;
|
|
69
|
+
}) => Promise<void> | void;
|
|
70
|
+
};
|
|
71
|
+
export type VoiceCommandProofTargetRunOptions = VoiceCommandProofTargetRunnerOptions & {
|
|
72
|
+
concurrency?: number;
|
|
73
|
+
};
|
|
40
74
|
export declare const getVoiceProofTargetLogicalFailure: (value: unknown) => "Response status is \"fail\"." | "Response pass is false." | "Response ok is false." | undefined;
|
|
41
75
|
export declare const mapVoiceProofTargetsWithConcurrency: <TInput, TOutput>(items: TInput[], limit: number, mapper: (item: TInput) => Promise<TOutput>) => Promise<TOutput[]>;
|
|
42
76
|
export declare const fetchVoiceProofTarget: (target: VoiceProofTarget, options: VoiceProofTargetRunnerOptions) => Promise<VoiceProofTargetResult>;
|
|
43
77
|
export declare const runVoiceProofTargets: (targets: VoiceProofTarget[], options: VoiceProofTargetRunOptions) => Promise<VoiceProofTargetResult[]>;
|
|
78
|
+
export declare const runVoiceCommandProofTarget: (target: VoiceCommandProofTarget, options: VoiceCommandProofTargetRunnerOptions) => Promise<VoiceCommandProofTargetResult>;
|
|
79
|
+
export declare const runVoiceCommandProofTargets: (targets: VoiceCommandProofTarget[], options: VoiceCommandProofTargetRunOptions) => Promise<VoiceCommandProofTargetResult[]>;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { MediaProcessorGraphSnapshot } from '@absolutejs/media';
|
|
2
|
+
import type { VoiceProofAssertionResult, VoiceProofAssertionSummary } from './proofAssertions';
|
|
3
|
+
import type { VoiceCampaignTelephonyOutcomeSnapshot } from './campaign';
|
|
4
|
+
import type { StoredVoiceTraceEvent } from './trace';
|
|
5
|
+
export type VoiceSessionSnapshotStatus = 'fail' | 'pass' | 'warn';
|
|
6
|
+
export type VoiceSessionSnapshotQualityEvidence = {
|
|
7
|
+
name: string;
|
|
8
|
+
report: unknown;
|
|
9
|
+
status?: VoiceSessionSnapshotStatus;
|
|
10
|
+
};
|
|
11
|
+
export type VoiceSessionSnapshot = {
|
|
12
|
+
capturedAt: number;
|
|
13
|
+
media: readonly MediaProcessorGraphSnapshot[];
|
|
14
|
+
name?: string;
|
|
15
|
+
proofAssertions: readonly VoiceProofAssertionResult[];
|
|
16
|
+
proofSummary: VoiceProofAssertionSummary;
|
|
17
|
+
providerRoutingEvents: readonly StoredVoiceTraceEvent[];
|
|
18
|
+
quality: readonly VoiceSessionSnapshotQualityEvidence[];
|
|
19
|
+
scenarioId?: string;
|
|
20
|
+
schema: 'absolute.voice.session.snapshot.v1';
|
|
21
|
+
sessionId: string;
|
|
22
|
+
status: VoiceSessionSnapshotStatus;
|
|
23
|
+
telephonyOutcomes: readonly VoiceCampaignTelephonyOutcomeSnapshot[];
|
|
24
|
+
turnId?: string;
|
|
25
|
+
};
|
|
26
|
+
export type VoiceSessionSnapshotInput = {
|
|
27
|
+
media?: readonly MediaProcessorGraphSnapshot[];
|
|
28
|
+
name?: string;
|
|
29
|
+
proofAssertions?: readonly VoiceProofAssertionResult[];
|
|
30
|
+
providerRoutingEvents?: readonly StoredVoiceTraceEvent[];
|
|
31
|
+
quality?: readonly VoiceSessionSnapshotQualityEvidence[];
|
|
32
|
+
scenarioId?: string;
|
|
33
|
+
sessionId: string;
|
|
34
|
+
telephonyOutcomes?: readonly VoiceCampaignTelephonyOutcomeSnapshot[];
|
|
35
|
+
turnId?: string;
|
|
36
|
+
};
|
|
37
|
+
export declare const buildVoiceSessionSnapshotStatus: (input: {
|
|
38
|
+
media?: readonly Pick<MediaProcessorGraphSnapshot, "report">[];
|
|
39
|
+
proofSummary?: Pick<VoiceProofAssertionSummary, "ok">;
|
|
40
|
+
quality?: readonly Pick<VoiceSessionSnapshotQualityEvidence, "status">[];
|
|
41
|
+
telephonyOutcomes?: readonly Pick<VoiceCampaignTelephonyOutcomeSnapshot, "campaignOutcome" | "duplicate">[];
|
|
42
|
+
}) => VoiceSessionSnapshotStatus;
|
|
43
|
+
export declare const buildVoiceSessionSnapshot: (input: VoiceSessionSnapshotInput) => VoiceSessionSnapshot;
|
|
44
|
+
export declare const parseVoiceSessionSnapshot: (snapshot: VoiceSessionSnapshot) => VoiceSessionSnapshot;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@absolutejs/voice",
|
|
3
|
-
"version": "0.0.22-beta.
|
|
3
|
+
"version": "0.0.22-beta.397",
|
|
4
4
|
"description": "Voice primitives and Elysia plugin for AbsoluteJS",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -246,7 +246,7 @@
|
|
|
246
246
|
}
|
|
247
247
|
},
|
|
248
248
|
"dependencies": {
|
|
249
|
-
"@absolutejs/media": "0.0.1-beta.
|
|
249
|
+
"@absolutejs/media": "0.0.1-beta.14"
|
|
250
250
|
},
|
|
251
251
|
"devDependencies": {
|
|
252
252
|
"@absolutejs/absolute": "0.19.0-beta.646",
|