agent-scenario-loop 0.1.0
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/LICENSE +21 -0
- package/README.md +119 -0
- package/app/profile-session.ts +812 -0
- package/core/config-template.json +41 -0
- package/dist/core/agent-summary.d.ts +15 -0
- package/dist/core/agent-summary.js +177 -0
- package/dist/core/artifact-contract.d.ts +151 -0
- package/dist/core/artifact-contract.js +897 -0
- package/dist/core/artifact-layout.d.ts +56 -0
- package/dist/core/artifact-layout.js +61 -0
- package/dist/core/artifact-writer.d.ts +44 -0
- package/dist/core/artifact-writer.js +55 -0
- package/dist/core/comparison.d.ts +133 -0
- package/dist/core/comparison.js +294 -0
- package/dist/core/evidence-interpreter.d.ts +28 -0
- package/dist/core/evidence-interpreter.js +69 -0
- package/dist/core/execution-plan.d.ts +44 -0
- package/dist/core/execution-plan.js +95 -0
- package/dist/core/planner.d.ts +132 -0
- package/dist/core/planner.js +812 -0
- package/dist/core/ports.d.ts +198 -0
- package/dist/core/ports.js +146 -0
- package/dist/core/run-index.d.ts +62 -0
- package/dist/core/run-index.js +143 -0
- package/dist/core/schema-validator.d.ts +86 -0
- package/dist/core/schema-validator.js +407 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +27 -0
- package/dist/runner/agent-device-driver.d.ts +126 -0
- package/dist/runner/agent-device-driver.js +168 -0
- package/dist/runner/agent-device.d.ts +295 -0
- package/dist/runner/agent-device.js +1271 -0
- package/dist/runner/android-adb-driver.d.ts +175 -0
- package/dist/runner/android-adb-driver.js +399 -0
- package/dist/runner/android-adb.d.ts +254 -0
- package/dist/runner/android-adb.js +1618 -0
- package/dist/runner/argent-driver.d.ts +183 -0
- package/dist/runner/argent-driver.js +297 -0
- package/dist/runner/argent.d.ts +349 -0
- package/dist/runner/argent.js +1211 -0
- package/dist/runner/check-plan.d.ts +45 -0
- package/dist/runner/check-plan.js +210 -0
- package/dist/runner/cli.d.ts +20 -0
- package/dist/runner/cli.js +23 -0
- package/dist/runner/compare-latest.d.ts +99 -0
- package/dist/runner/compare-latest.js +233 -0
- package/dist/runner/compare.d.ts +58 -0
- package/dist/runner/compare.js +157 -0
- package/dist/runner/demo-loop.d.ts +45 -0
- package/dist/runner/demo-loop.js +170 -0
- package/dist/runner/example-android-live.d.ts +137 -0
- package/dist/runner/example-android-live.js +454 -0
- package/dist/runner/example-ios-live.d.ts +137 -0
- package/dist/runner/example-ios-live.js +471 -0
- package/dist/runner/host-doctor.d.ts +131 -0
- package/dist/runner/host-doctor.js +628 -0
- package/dist/runner/init-project.d.ts +88 -0
- package/dist/runner/init-project.js +263 -0
- package/dist/runner/ios-simctl-driver.d.ts +69 -0
- package/dist/runner/ios-simctl-driver.js +97 -0
- package/dist/runner/ios-simctl.d.ts +254 -0
- package/dist/runner/ios-simctl.js +1415 -0
- package/dist/runner/live-android.d.ts +137 -0
- package/dist/runner/live-android.js +539 -0
- package/dist/runner/live-comparison.d.ts +67 -0
- package/dist/runner/live-comparison.js +147 -0
- package/dist/runner/live-ios.d.ts +137 -0
- package/dist/runner/live-ios.js +460 -0
- package/dist/runner/live-proof-summary.d.ts +263 -0
- package/dist/runner/live-proof-summary.js +465 -0
- package/dist/runner/live-proof.d.ts +467 -0
- package/dist/runner/live-proof.js +920 -0
- package/dist/runner/local-env.d.ts +64 -0
- package/dist/runner/local-env.js +155 -0
- package/dist/runner/profile-android.d.ts +82 -0
- package/dist/runner/profile-android.js +671 -0
- package/dist/runner/profile-ios.d.ts +108 -0
- package/dist/runner/profile-ios.js +532 -0
- package/dist/runner/profile-mobile.d.ts +254 -0
- package/dist/runner/profile-mobile.js +1307 -0
- package/dist/runner/validate-project.d.ts +273 -0
- package/dist/runner/validate-project.js +1501 -0
- package/docs/adapters.md +145 -0
- package/docs/api.md +94 -0
- package/docs/authoring.md +196 -0
- package/docs/concepts.md +136 -0
- package/docs/consumer-rehearsal.md +115 -0
- package/docs/contracts.md +267 -0
- package/docs/live-proofs.md +270 -0
- package/docs/principles.md +46 -0
- package/examples/event-logs/app-startup-baseline.log +4 -0
- package/examples/event-logs/app-startup-current.log +4 -0
- package/examples/minimal-app/README.md +70 -0
- package/examples/mobile-app/README.md +302 -0
- package/examples/mobile-app/app.json +22 -0
- package/examples/mobile-app/asl/package-scripts.json +32 -0
- package/examples/mobile-app/asl.config.json +37 -0
- package/examples/mobile-app/event-logs/android-app-startup.log +4 -0
- package/examples/mobile-app/event-logs/android-open-close-cycle.log +12 -0
- package/examples/mobile-app/event-logs/android-scroll-settle.log +12 -0
- package/examples/mobile-app/event-logs/app-startup.log +4 -0
- package/examples/mobile-app/event-logs/open-close-cycle.log +12 -0
- package/examples/mobile-app/event-logs/scroll-settle.log +12 -0
- package/examples/mobile-app/index.ts +20 -0
- package/examples/mobile-app/metro.config.js +20 -0
- package/examples/mobile-app/package.json +62 -0
- package/examples/mobile-app/patches/expo-modules-jsi@56.0.10.patch +19 -0
- package/examples/mobile-app/plugins/with-ios-build-compat.js +271 -0
- package/examples/mobile-app/pnpm-lock.yaml +4440 -0
- package/examples/mobile-app/runner-manifests/evidence-provider.json +79 -0
- package/examples/mobile-app/runner-manifests/primary-runner.json +19 -0
- package/examples/mobile-app/scenarios/android/app-startup-video.json +73 -0
- package/examples/mobile-app/scenarios/android/app-startup.json +44 -0
- package/examples/mobile-app/scenarios/android/open-close-cycle.json +54 -0
- package/examples/mobile-app/scenarios/android/scroll-settle.json +49 -0
- package/examples/mobile-app/scenarios/ios/app-startup.json +44 -0
- package/examples/mobile-app/scenarios/ios/open-close-cycle.json +54 -0
- package/examples/mobile-app/scenarios/ios/scroll-settle.json +49 -0
- package/examples/mobile-app/scenarios/mobile/app-startup.json +91 -0
- package/examples/mobile-app/scenarios/mobile/open-close-cycle.json +160 -0
- package/examples/mobile-app/scenarios/mobile/scroll-settle.json +148 -0
- package/examples/mobile-app/scripts/asl-capture-accessibility-provider.mjs +112 -0
- package/examples/mobile-app/scripts/asl-capture-profiler-provider.mjs +127 -0
- package/examples/mobile-app/src/devtools/profile-session.ts +7 -0
- package/examples/mobile-app/src/example-screen.tsx +322 -0
- package/examples/mobile-app/tsconfig.json +16 -0
- package/examples/mobile-app/tsconfig.typecheck.json +13 -0
- package/examples/runners/README.md +44 -0
- package/examples/runners/adb-android.json +25 -0
- package/examples/runners/agent-device-android.json +27 -0
- package/examples/runners/agent-device-ios.json +27 -0
- package/examples/runners/argent-android.json +32 -0
- package/examples/runners/argent-ios.json +32 -0
- package/examples/runners/argent-react-profiler-provider.json +15 -0
- package/examples/runners/axe-accessibility-provider.json +24 -0
- package/examples/runners/manual-log-ingest.json +9 -0
- package/examples/runners/rozenite-profiler-provider.json +9 -0
- package/examples/runners/script-accessibility-provider.json +24 -0
- package/examples/runners/script-memory-provider.json +24 -0
- package/examples/runners/script-network-provider.json +24 -0
- package/examples/runners/script-profiler-provider.json +30 -0
- package/examples/runners/xcodebuildmcp-ios.json +29 -0
- package/examples/scenarios/ios/app-startup.json +28 -0
- package/examples/scenarios/ios/open-close-cycle.json +35 -0
- package/examples/scenarios/mobile/app-startup.json +72 -0
- package/examples/scenarios/mobile/media-open-close.json +141 -0
- package/examples/scenarios/mobile/open-close-cycle.json +135 -0
- package/examples/scenarios/mobile/scroll-settle.json +106 -0
- package/package.json +240 -0
- package/schemas/budget-verdict.schema.json +115 -0
- package/schemas/causal-run.schema.json +279 -0
- package/schemas/comparison.schema.json +196 -0
- package/schemas/health.schema.json +108 -0
- package/schemas/live-proof-set.schema.json +195 -0
- package/schemas/live-proof.schema.json +413 -0
- package/schemas/manifest.schema.json +204 -0
- package/schemas/metrics.schema.json +137 -0
- package/schemas/project-validation.schema.json +343 -0
- package/schemas/runner-capabilities.schema.json +217 -0
- package/schemas/scenario.schema.json +400 -0
- package/schemas/verdict.schema.json +88 -0
- package/templates/evidence-provider.json +83 -0
- package/templates/gitignore-snippet +9 -0
- package/templates/integration-readme.md +125 -0
- package/templates/mobile-scenario.json +133 -0
- package/templates/package-scripts.json +32 -0
- package/templates/primary-runner.json +19 -0
- package/templates/project.config.json +37 -0
- package/templates/scripts/asl-capture-accessibility-provider.mjs +112 -0
- package/templates/scripts/asl-capture-profiler-provider.mjs +127 -0
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.interpretEvidence = interpretEvidence;
|
|
4
|
+
exports.isTimingEvidenceTrusted = isTimingEvidenceTrusted;
|
|
5
|
+
/**
|
|
6
|
+
* Returns an array when the value is already an array; otherwise returns an empty array.
|
|
7
|
+
*
|
|
8
|
+
* @param {unknown} value
|
|
9
|
+
* @returns {unknown[]}
|
|
10
|
+
*/
|
|
11
|
+
function asArray(value) {
|
|
12
|
+
return Array.isArray(value) ? value : [];
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Returns whether timing evidence can be used for interpretation.
|
|
16
|
+
*
|
|
17
|
+
* @param {Record<string, unknown>} health
|
|
18
|
+
* @returns {boolean}
|
|
19
|
+
*/
|
|
20
|
+
function isTimingEvidenceTrusted(health) {
|
|
21
|
+
return health?.healthStatus === 'passed';
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Builds evidence-backed interpretation hints without overriding scenario health.
|
|
25
|
+
*
|
|
26
|
+
* Timing-based hints are only emitted after scenario health passed.
|
|
27
|
+
*
|
|
28
|
+
* @param {{health: Record<string, unknown>, verdict?: Record<string, unknown> | null, comparison?: Record<string, unknown> | null}} options
|
|
29
|
+
* @returns {{timingTrusted: boolean, recommendations: string[], blockedReasons: string[]}}
|
|
30
|
+
*/
|
|
31
|
+
function interpretEvidence({ health, verdict = null, comparison = null, }) {
|
|
32
|
+
const timingTrusted = isTimingEvidenceTrusted(health);
|
|
33
|
+
const blockedReasons = [];
|
|
34
|
+
const recommendations = [];
|
|
35
|
+
if (!timingTrusted) {
|
|
36
|
+
blockedReasons.push('scenario health did not pass');
|
|
37
|
+
recommendations.push('harden scenario health before interpreting timing evidence');
|
|
38
|
+
}
|
|
39
|
+
const failedChecks = asArray(health?.checks).filter((check) => {
|
|
40
|
+
const record = check;
|
|
41
|
+
return !!record && typeof record === 'object' && record.status !== 'passed';
|
|
42
|
+
});
|
|
43
|
+
for (const check of failedChecks) {
|
|
44
|
+
const record = check;
|
|
45
|
+
const name = typeof record.name === 'string' ? record.name : record.code;
|
|
46
|
+
recommendations.push(`resolve health check ${name ?? 'unknown_check'}`);
|
|
47
|
+
}
|
|
48
|
+
if (timingTrusted) {
|
|
49
|
+
const failedBudgets = asArray(verdict?.budgetChecks).filter((check) => {
|
|
50
|
+
const record = check;
|
|
51
|
+
return !!record && typeof record === 'object' && record.pass === false;
|
|
52
|
+
});
|
|
53
|
+
for (const check of failedBudgets) {
|
|
54
|
+
const record = check;
|
|
55
|
+
recommendations.push(`investigate failed budget ${record.name ?? 'unknown budget'}`);
|
|
56
|
+
}
|
|
57
|
+
if (comparison?.comparisonStatus === 'worse') {
|
|
58
|
+
recommendations.push('investigate regression against baseline comparison');
|
|
59
|
+
}
|
|
60
|
+
if (comparison?.comparisonStatus === 'mixed') {
|
|
61
|
+
recommendations.push('inspect mixed baseline comparison signals before claiming improvement');
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return {
|
|
65
|
+
timingTrusted,
|
|
66
|
+
recommendations,
|
|
67
|
+
blockedReasons,
|
|
68
|
+
};
|
|
69
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
type ScenarioManifest = import('./planner').ScenarioManifest;
|
|
2
|
+
type ScenarioStepKind = 'launch' | 'command' | 'waitForMilestone' | 'captureEvidence' | 'gesture' | 'assertUi';
|
|
3
|
+
type RunnerPortMethod = 'launch' | 'executeStep' | 'waitForTruthEvent' | 'captureEvidence';
|
|
4
|
+
type ScenarioExecutionStep = {
|
|
5
|
+
id: string;
|
|
6
|
+
index: number;
|
|
7
|
+
kind: ScenarioStepKind;
|
|
8
|
+
portMethod: RunnerPortMethod;
|
|
9
|
+
required: boolean;
|
|
10
|
+
adapterOptions?: Record<string, unknown>;
|
|
11
|
+
artifact?: string;
|
|
12
|
+
command?: string;
|
|
13
|
+
driverAction?: string;
|
|
14
|
+
milestone?: string;
|
|
15
|
+
selector?: Record<string, unknown>;
|
|
16
|
+
timeoutMs?: number;
|
|
17
|
+
};
|
|
18
|
+
type ScenarioExecutionPlan = {
|
|
19
|
+
scenarioId: string;
|
|
20
|
+
flowId?: string;
|
|
21
|
+
steps: ScenarioExecutionStep[];
|
|
22
|
+
driverActions: {
|
|
23
|
+
optional: string[];
|
|
24
|
+
required: string[];
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
declare const STEP_KIND_TO_PORT_METHOD: Record<ScenarioStepKind, RunnerPortMethod>;
|
|
28
|
+
/**
|
|
29
|
+
* Normalizes one scenario step into an adapter-facing execution step.
|
|
30
|
+
*
|
|
31
|
+
* @param {Record<string, unknown>} step
|
|
32
|
+
* @param {number} index
|
|
33
|
+
* @returns {ScenarioExecutionStep}
|
|
34
|
+
*/
|
|
35
|
+
declare function normalizeScenarioStep(step: Record<string, unknown>, index: number): ScenarioExecutionStep;
|
|
36
|
+
/**
|
|
37
|
+
* Builds the adapter-facing execution plan for a scenario manifest.
|
|
38
|
+
*
|
|
39
|
+
* @param {Record<string, unknown>} scenario
|
|
40
|
+
* @returns {ScenarioExecutionPlan}
|
|
41
|
+
*/
|
|
42
|
+
declare function buildScenarioExecutionPlan(scenario: ScenarioManifest): ScenarioExecutionPlan;
|
|
43
|
+
export { STEP_KIND_TO_PORT_METHOD, buildScenarioExecutionPlan, normalizeScenarioStep, };
|
|
44
|
+
export type { RunnerPortMethod, ScenarioExecutionPlan, ScenarioExecutionStep, ScenarioStepKind, };
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.STEP_KIND_TO_PORT_METHOD = void 0;
|
|
4
|
+
exports.buildScenarioExecutionPlan = buildScenarioExecutionPlan;
|
|
5
|
+
exports.normalizeScenarioStep = normalizeScenarioStep;
|
|
6
|
+
const { collectScenarioDriverActions } = require('./planner');
|
|
7
|
+
const STEP_KIND_TO_PORT_METHOD = {
|
|
8
|
+
assertUi: 'executeStep',
|
|
9
|
+
captureEvidence: 'captureEvidence',
|
|
10
|
+
command: 'executeStep',
|
|
11
|
+
gesture: 'executeStep',
|
|
12
|
+
launch: 'launch',
|
|
13
|
+
waitForMilestone: 'waitForTruthEvent',
|
|
14
|
+
};
|
|
15
|
+
exports.STEP_KIND_TO_PORT_METHOD = STEP_KIND_TO_PORT_METHOD;
|
|
16
|
+
/**
|
|
17
|
+
* Resolves the scenario identifier for execution-plan artifacts and logs.
|
|
18
|
+
*
|
|
19
|
+
* @param {Record<string, unknown>} scenario
|
|
20
|
+
* @returns {string}
|
|
21
|
+
*/
|
|
22
|
+
function getScenarioId(scenario) {
|
|
23
|
+
return scenario.id ?? scenario.name ?? 'unknown-scenario';
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Returns true for scenario step kinds supported by the execution-plan contract.
|
|
27
|
+
*
|
|
28
|
+
* @param {unknown} kind
|
|
29
|
+
* @returns {kind is ScenarioStepKind}
|
|
30
|
+
*/
|
|
31
|
+
function isScenarioStepKind(kind) {
|
|
32
|
+
return typeof kind === 'string' && kind in STEP_KIND_TO_PORT_METHOD;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Builds a deterministic id for an unnamed scenario step.
|
|
36
|
+
*
|
|
37
|
+
* @param {number} index
|
|
38
|
+
* @param {ScenarioStepKind} kind
|
|
39
|
+
* @returns {string}
|
|
40
|
+
*/
|
|
41
|
+
function buildDefaultStepId(index, kind) {
|
|
42
|
+
return `${String(index + 1).padStart(2, '0')}-${kind}`;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Normalizes one scenario step into an adapter-facing execution step.
|
|
46
|
+
*
|
|
47
|
+
* @param {Record<string, unknown>} step
|
|
48
|
+
* @param {number} index
|
|
49
|
+
* @returns {ScenarioExecutionStep}
|
|
50
|
+
*/
|
|
51
|
+
function normalizeScenarioStep(step, index) {
|
|
52
|
+
if (!isScenarioStepKind(step.kind)) {
|
|
53
|
+
throw new Error(`Scenario step ${index + 1} has unsupported kind.`);
|
|
54
|
+
}
|
|
55
|
+
return {
|
|
56
|
+
id: typeof step.id === 'string' && step.id.length > 0 ? step.id : buildDefaultStepId(index, step.kind),
|
|
57
|
+
index,
|
|
58
|
+
kind: step.kind,
|
|
59
|
+
portMethod: STEP_KIND_TO_PORT_METHOD[step.kind],
|
|
60
|
+
required: step.required !== false,
|
|
61
|
+
...(step.adapterOptions && typeof step.adapterOptions === 'object' && !Array.isArray(step.adapterOptions)
|
|
62
|
+
? { adapterOptions: step.adapterOptions }
|
|
63
|
+
: {}),
|
|
64
|
+
...(typeof step.artifact === 'string' ? { artifact: step.artifact } : {}),
|
|
65
|
+
...(typeof step.command === 'string' ? { command: step.command } : {}),
|
|
66
|
+
...(typeof step.driverAction === 'string' ? { driverAction: step.driverAction } : {}),
|
|
67
|
+
...(typeof step.milestone === 'string' ? { milestone: step.milestone } : {}),
|
|
68
|
+
...(step.selector && typeof step.selector === 'object' && !Array.isArray(step.selector)
|
|
69
|
+
? { selector: step.selector }
|
|
70
|
+
: {}),
|
|
71
|
+
...(typeof step.timeoutMs === 'number' && Number.isFinite(step.timeoutMs) ? { timeoutMs: step.timeoutMs } : {}),
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Builds the adapter-facing execution plan for a scenario manifest.
|
|
76
|
+
*
|
|
77
|
+
* @param {Record<string, unknown>} scenario
|
|
78
|
+
* @returns {ScenarioExecutionPlan}
|
|
79
|
+
*/
|
|
80
|
+
function buildScenarioExecutionPlan(scenario) {
|
|
81
|
+
const steps = Array.isArray(scenario.steps)
|
|
82
|
+
? scenario.steps.map((step, index) => {
|
|
83
|
+
if (!step || typeof step !== 'object' || Array.isArray(step)) {
|
|
84
|
+
throw new Error(`Scenario step ${index + 1} must be an object.`);
|
|
85
|
+
}
|
|
86
|
+
return normalizeScenarioStep(step, index);
|
|
87
|
+
})
|
|
88
|
+
: [];
|
|
89
|
+
return {
|
|
90
|
+
scenarioId: getScenarioId(scenario),
|
|
91
|
+
...(typeof scenario.flowId === 'string' ? { flowId: scenario.flowId } : {}),
|
|
92
|
+
steps,
|
|
93
|
+
driverActions: collectScenarioDriverActions(scenario),
|
|
94
|
+
};
|
|
95
|
+
}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
type ManifestRecord = Record<string, unknown>;
|
|
2
|
+
type PlannerIssue = {
|
|
3
|
+
code: string;
|
|
4
|
+
message: string;
|
|
5
|
+
[key: string]: unknown;
|
|
6
|
+
};
|
|
7
|
+
type CompatibilityResult = {
|
|
8
|
+
compatible: boolean;
|
|
9
|
+
errors: PlannerIssue[];
|
|
10
|
+
warnings: PlannerIssue[];
|
|
11
|
+
matched: {
|
|
12
|
+
platforms: string[];
|
|
13
|
+
capabilities: string[];
|
|
14
|
+
driverActions: string[];
|
|
15
|
+
artifacts: string[];
|
|
16
|
+
evidenceProviders: string[];
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
type ScenarioStep = ManifestRecord & {
|
|
20
|
+
adapterOptions?: unknown;
|
|
21
|
+
driverAction?: unknown;
|
|
22
|
+
id?: unknown;
|
|
23
|
+
required?: unknown;
|
|
24
|
+
selector?: unknown;
|
|
25
|
+
};
|
|
26
|
+
type ScenarioManifest = ManifestRecord & {
|
|
27
|
+
adapterOptions?: unknown;
|
|
28
|
+
id?: string;
|
|
29
|
+
name?: string;
|
|
30
|
+
flowId?: string;
|
|
31
|
+
platforms?: unknown[];
|
|
32
|
+
requiredCapabilities?: unknown[];
|
|
33
|
+
optionalCapabilities?: unknown[];
|
|
34
|
+
steps?: ScenarioStep[];
|
|
35
|
+
artifacts?: {
|
|
36
|
+
required?: unknown[];
|
|
37
|
+
optional?: unknown[];
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
type RunnerManifest = ManifestRecord & {
|
|
41
|
+
runnerId?: string;
|
|
42
|
+
name?: string;
|
|
43
|
+
kind?: string;
|
|
44
|
+
platforms?: unknown[];
|
|
45
|
+
capabilities?: unknown[];
|
|
46
|
+
driverActions?: unknown[];
|
|
47
|
+
artifactOutputs?: unknown[];
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* Returns non-empty string values with duplicates removed and deterministic ordering.
|
|
51
|
+
*
|
|
52
|
+
* @param {unknown[]} values
|
|
53
|
+
* @returns {string[]}
|
|
54
|
+
*/
|
|
55
|
+
declare function uniqueSorted(values: unknown[]): string[];
|
|
56
|
+
/**
|
|
57
|
+
* Finds the unique string values shared by two arrays.
|
|
58
|
+
*
|
|
59
|
+
* @param {unknown[]} left
|
|
60
|
+
* @param {unknown[]} right
|
|
61
|
+
* @returns {string[]}
|
|
62
|
+
*/
|
|
63
|
+
declare function intersection(left: unknown[], right: unknown[]): string[];
|
|
64
|
+
/**
|
|
65
|
+
* Collects driver operations available from the primary runner and active providers.
|
|
66
|
+
*
|
|
67
|
+
* @param {{runner: Record<string, unknown>, evidenceProviders: Record<string, unknown>[], effectivePlatforms: string[]}} options
|
|
68
|
+
* @returns {string[]}
|
|
69
|
+
*/
|
|
70
|
+
declare function collectProvidedDriverActions({ runner, evidenceProviders, effectivePlatforms, }: {
|
|
71
|
+
runner: RunnerManifest;
|
|
72
|
+
evidenceProviders: RunnerManifest[];
|
|
73
|
+
effectivePlatforms: string[];
|
|
74
|
+
}): string[];
|
|
75
|
+
/**
|
|
76
|
+
* Collects driver operations required by scenario steps.
|
|
77
|
+
*
|
|
78
|
+
* @param {Record<string, unknown>} scenario
|
|
79
|
+
* @returns {{required: string[], optional: string[]}}
|
|
80
|
+
*/
|
|
81
|
+
declare function collectScenarioDriverActions(scenario: ScenarioManifest): {
|
|
82
|
+
required: string[];
|
|
83
|
+
optional: string[];
|
|
84
|
+
};
|
|
85
|
+
/**
|
|
86
|
+
* Validates adapter-specific scenario metadata for the selected platform set.
|
|
87
|
+
*
|
|
88
|
+
* @param {{scenario: ScenarioManifest, effectivePlatforms: string[], errors: PlannerIssue[], runner?: RunnerManifest}} options
|
|
89
|
+
* @returns {void}
|
|
90
|
+
*/
|
|
91
|
+
declare function validateScenarioAdapterOptions({ effectivePlatforms, errors, runner, scenario, }: {
|
|
92
|
+
effectivePlatforms: string[];
|
|
93
|
+
errors: PlannerIssue[];
|
|
94
|
+
runner?: RunnerManifest;
|
|
95
|
+
scenario: ScenarioManifest;
|
|
96
|
+
}): void;
|
|
97
|
+
/**
|
|
98
|
+
* Evaluates whether a scenario can be served by a primary runner plus evidence providers.
|
|
99
|
+
*
|
|
100
|
+
* @param {{scenario?: Record<string, unknown>, runner?: Record<string, unknown>, evidenceProviders?: Record<string, unknown>[], platform?: string | null}} [options]
|
|
101
|
+
* @returns {{compatible: boolean, errors: Record<string, unknown>[], warnings: Record<string, unknown>[], matched: {platforms: string[], capabilities: string[], driverActions: string[], artifacts: string[], evidenceProviders: string[]}}}
|
|
102
|
+
*/
|
|
103
|
+
declare function evaluateRunnerCompatibility({ scenario, runner, evidenceProviders, platform, }?: {
|
|
104
|
+
scenario?: ScenarioManifest;
|
|
105
|
+
runner?: RunnerManifest;
|
|
106
|
+
evidenceProviders?: RunnerManifest[];
|
|
107
|
+
platform?: string | null;
|
|
108
|
+
}): CompatibilityResult;
|
|
109
|
+
/**
|
|
110
|
+
* Builds the initial `health.json` artifact from planner compatibility results.
|
|
111
|
+
*
|
|
112
|
+
* @param {{scenario: Record<string, unknown>, runId?: string, compatibility: Record<string, unknown>}} options
|
|
113
|
+
* @returns {Record<string, unknown>}
|
|
114
|
+
*/
|
|
115
|
+
declare function buildCompatibilityHealth({ scenario, runId, compatibility, }: {
|
|
116
|
+
scenario: ScenarioManifest;
|
|
117
|
+
runId?: string;
|
|
118
|
+
compatibility: CompatibilityResult;
|
|
119
|
+
}): ManifestRecord;
|
|
120
|
+
/**
|
|
121
|
+
* Builds a pre-budget `verdict.json` artifact from scenario health.
|
|
122
|
+
*
|
|
123
|
+
* @param {{scenario: Record<string, unknown>, runId?: string, health: Record<string, unknown>}} options
|
|
124
|
+
* @returns {Record<string, unknown>}
|
|
125
|
+
*/
|
|
126
|
+
declare function buildUnevaluatedVerdict({ scenario, runId, health, }: {
|
|
127
|
+
scenario: ScenarioManifest;
|
|
128
|
+
runId?: string;
|
|
129
|
+
health: ManifestRecord;
|
|
130
|
+
}): ManifestRecord;
|
|
131
|
+
export { buildCompatibilityHealth, buildUnevaluatedVerdict, collectProvidedDriverActions, collectScenarioDriverActions, evaluateRunnerCompatibility, intersection, uniqueSorted, validateScenarioAdapterOptions, };
|
|
132
|
+
export type { CompatibilityResult, ManifestRecord, PlannerIssue, RunnerManifest, ScenarioManifest, };
|