@absolutejs/voice 0.0.22-beta.395 → 0.0.22-beta.396
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 +2 -2
- package/dist/index.js +50 -0
- package/dist/proofRunner.d.ts +36 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -33,8 +33,8 @@ 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 type { VoiceEvidenceAssertionInput, VoiceProofAssertionInput, VoiceProofAssertionResult, VoiceProofAssertionSummary } from './proofAssertions';
|
|
36
|
-
export { fetchVoiceProofTarget, getVoiceProofTargetLogicalFailure, mapVoiceProofTargetsWithConcurrency, runVoiceProofTargets } from './proofRunner';
|
|
37
|
-
export type { VoiceProofTarget, VoiceProofTargetMethod, VoiceProofTargetResult, VoiceProofTargetRunnerOptions, VoiceProofTargetRunOptions } from './proofRunner';
|
|
36
|
+
export { fetchVoiceProofTarget, getVoiceProofTargetLogicalFailure, mapVoiceProofTargetsWithConcurrency, runVoiceCommandProofTarget, runVoiceCommandProofTargets, runVoiceProofTargets } from './proofRunner';
|
|
37
|
+
export type { VoiceCommandProofExecutionResult, VoiceCommandProofTarget, VoiceCommandProofTargetResult, VoiceCommandProofTargetRunnerOptions, VoiceCommandProofTargetRunOptions, VoiceProofTarget, VoiceProofTargetMethod, VoiceProofTargetResult, VoiceProofTargetRunnerOptions, VoiceProofTargetRunOptions } from './proofRunner';
|
|
38
38
|
export { applyVoiceProfileSwitchGuard, buildVoiceProfileSwitchReadinessReport, buildVoiceProfileSwitchLiveDecisionReport, createVoiceProfileSwitchLiveDecisionRoutes, createVoiceProfileSwitchPolicyProofRoutes, createVoiceProfileSwitchReadinessRoutes, recommendVoiceProfileSwitch, renderVoiceProfileSwitchLiveDecisionHTML, renderVoiceProfileSwitchPolicyProofHTML, renderVoiceProfileSwitchReadinessHTML, runVoiceProfileSwitchPolicyProof } from './profileSwitchRecommendation';
|
|
39
39
|
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
40
|
export { buildVoiceProviderDecisionTraceReport, createVoiceProviderDecisionTraceEvent, createVoiceProviderDecisionTraceRoutes, listVoiceProviderDecisionTraces, renderVoiceProviderDecisionTraceHTML, renderVoiceProviderDecisionTraceMarkdown } from './providerDecisionTraces';
|
package/dist/index.js
CHANGED
|
@@ -18549,6 +18549,54 @@ var fetchVoiceProofTarget = async (target, options) => {
|
|
|
18549
18549
|
}
|
|
18550
18550
|
};
|
|
18551
18551
|
var runVoiceProofTargets = (targets, options) => mapVoiceProofTargetsWithConcurrency(targets, options.concurrency ?? 2, (target) => fetchVoiceProofTarget(target, options));
|
|
18552
|
+
var runVoiceCommandProofTarget = async (target, options) => {
|
|
18553
|
+
const now = options.now ?? performance.now.bind(performance);
|
|
18554
|
+
const startedAt = now();
|
|
18555
|
+
const execution = await options.execute(target);
|
|
18556
|
+
const stdout = execution.stdout ?? "";
|
|
18557
|
+
const stderr = execution.stderr ?? "";
|
|
18558
|
+
const status = execution.status;
|
|
18559
|
+
const text = stdout.trim();
|
|
18560
|
+
const bytes = encoder.encode(`${stdout}${stderr}`).byteLength;
|
|
18561
|
+
let body = text;
|
|
18562
|
+
let parseError;
|
|
18563
|
+
if (text) {
|
|
18564
|
+
const jsonStart = text.indexOf("{");
|
|
18565
|
+
const jsonText = jsonStart >= 0 ? text.slice(jsonStart) : text;
|
|
18566
|
+
try {
|
|
18567
|
+
body = JSON.parse(jsonText);
|
|
18568
|
+
} catch (error) {
|
|
18569
|
+
parseError = error instanceof Error ? error.message : String(error);
|
|
18570
|
+
}
|
|
18571
|
+
}
|
|
18572
|
+
await options.writeArtifact?.({
|
|
18573
|
+
content: `${JSON.stringify({
|
|
18574
|
+
command: target.command,
|
|
18575
|
+
parseError,
|
|
18576
|
+
stderr,
|
|
18577
|
+
stdout,
|
|
18578
|
+
status,
|
|
18579
|
+
summary: parseError ? undefined : body
|
|
18580
|
+
}, null, 2)}
|
|
18581
|
+
`,
|
|
18582
|
+
name: `${safeArtifactName(target.name)}.json`,
|
|
18583
|
+
target
|
|
18584
|
+
});
|
|
18585
|
+
const logicalFailure = !parseError ? getVoiceProofTargetLogicalFailure(body) : undefined;
|
|
18586
|
+
return {
|
|
18587
|
+
body,
|
|
18588
|
+
bytes,
|
|
18589
|
+
command: target.command,
|
|
18590
|
+
elapsedMs: Math.round(now() - startedAt),
|
|
18591
|
+
error: parseError ?? logicalFailure ?? (status === 0 ? undefined : stderr.trim() || `Command exited ${status}`),
|
|
18592
|
+
kind: "command",
|
|
18593
|
+
name: target.name,
|
|
18594
|
+
ok: status === 0 && !parseError && !logicalFailure,
|
|
18595
|
+
status,
|
|
18596
|
+
summary: parseError ? { bytes, parseError } : summarizeValue(body)
|
|
18597
|
+
};
|
|
18598
|
+
};
|
|
18599
|
+
var runVoiceCommandProofTargets = (targets, options) => mapVoiceProofTargetsWithConcurrency(targets, options.concurrency ?? targets.length, (target) => runVoiceCommandProofTarget(target, options));
|
|
18552
18600
|
// src/providerRouterTraces.ts
|
|
18553
18601
|
var buildVoiceProviderRouterTraceEvent = (options) => ({
|
|
18554
18602
|
at: options.at ?? options.event.at,
|
|
@@ -39552,6 +39600,8 @@ export {
|
|
|
39552
39600
|
runVoiceProfileSwitchPolicyProof,
|
|
39553
39601
|
runVoicePhoneAgentProductionSmokeContract,
|
|
39554
39602
|
runVoiceOutcomeContractSuite,
|
|
39603
|
+
runVoiceCommandProofTargets,
|
|
39604
|
+
runVoiceCommandProofTarget,
|
|
39555
39605
|
runVoiceCampaignReadinessProof,
|
|
39556
39606
|
runVoiceCampaignProof,
|
|
39557
39607
|
runVoiceCampaignDialerProof,
|
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[]>;
|