@jevitate/cli 0.2.0 → 0.3.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/dist/ai-cli.d.ts +31 -11
- package/dist/ai-cli.js +100 -67
- package/dist/ai-cli.js.map +1 -1
- package/dist/author-journey-cli.js +3 -1
- package/dist/author-journey-cli.js.map +1 -1
- package/dist/bin.js +48218 -39969
- package/dist/browser-run-options.d.ts +32 -1
- package/dist/browser-run-options.js +69 -0
- package/dist/browser-run-options.js.map +1 -1
- package/dist/build-info.generated.js +2 -2
- package/dist/campaign-api.d.ts +151 -0
- package/dist/campaign-api.js +446 -0
- package/dist/campaign-api.js.map +1 -0
- package/dist/campaign-cli.d.ts +6 -0
- package/dist/campaign-cli.js +66 -0
- package/dist/campaign-cli.js.map +1 -0
- package/dist/check-api.js +3 -2
- package/dist/check-api.js.map +1 -1
- package/dist/check-budget.js +2 -1
- package/dist/check-budget.js.map +1 -1
- package/dist/check-execute.d.ts +4 -0
- package/dist/check-execute.js +41 -6
- package/dist/check-execute.js.map +1 -1
- package/dist/check-plan.d.ts +5 -0
- package/dist/check-plan.js +72 -4
- package/dist/check-plan.js.map +1 -1
- package/dist/check-suite.d.ts +14 -1
- package/dist/check-suite.js +26 -1
- package/dist/check-suite.js.map +1 -1
- package/dist/cli-output.d.ts +4 -0
- package/dist/cli-output.js +52 -5
- package/dist/cli-output.js.map +1 -1
- package/dist/cli-shared.d.ts +13 -3
- package/dist/cli-shared.js +52 -7
- package/dist/cli-shared.js.map +1 -1
- package/dist/defect-evidence.js +6 -3
- package/dist/defect-evidence.js.map +1 -1
- package/dist/demo-aspect-api.js +2 -1
- package/dist/demo-aspect-api.js.map +1 -1
- package/dist/demo-aspect-cli.js +3 -1
- package/dist/demo-aspect-cli.js.map +1 -1
- package/dist/demo-capture.d.ts +37 -3
- package/dist/demo-capture.js +119 -20
- package/dist/demo-capture.js.map +1 -1
- package/dist/explore-adversarial.d.ts +11 -4
- package/dist/explore-adversarial.js +21 -12
- package/dist/explore-adversarial.js.map +1 -1
- package/dist/explore-cli.js +262 -26
- package/dist/explore-cli.js.map +1 -1
- package/dist/explore-coverage.d.ts +17 -2
- package/dist/explore-coverage.js +19 -13
- package/dist/explore-coverage.js.map +1 -1
- package/dist/explore-feature.d.ts +0 -2
- package/dist/explore-feature.js +6 -8
- package/dist/explore-feature.js.map +1 -1
- package/dist/explore-goal.d.ts +25 -7
- package/dist/explore-goal.js +61 -18
- package/dist/explore-goal.js.map +1 -1
- package/dist/explore-shared.d.ts +27 -2
- package/dist/explore-shared.js +21 -1
- package/dist/explore-shared.js.map +1 -1
- package/dist/fixture-auth.d.ts +13 -2
- package/dist/fixture-auth.js +19 -6
- package/dist/fixture-auth.js.map +1 -1
- package/dist/fixture-cli.d.ts +29 -0
- package/dist/fixture-cli.js +121 -7
- package/dist/fixture-cli.js.map +1 -1
- package/dist/github-issue-filer.js +2 -1
- package/dist/github-issue-filer.js.map +1 -1
- package/dist/host-health-run.d.ts +2 -1
- package/dist/host-health-run.js +8 -2
- package/dist/host-health-run.js.map +1 -1
- package/dist/init-cli.js +34 -5
- package/dist/init-cli.js.map +1 -1
- package/dist/init-keys.d.ts +11 -0
- package/dist/init-keys.js +5 -2
- package/dist/init-keys.js.map +1 -1
- package/dist/journey-annotate-api.js +17 -4
- package/dist/journey-annotate-api.js.map +1 -1
- package/dist/journey-annotate-cli.js +3 -1
- package/dist/journey-annotate-cli.js.map +1 -1
- package/dist/journey-api.d.ts +26 -1
- package/dist/journey-api.js +51 -25
- package/dist/journey-api.js.map +1 -1
- package/dist/journey-cli.d.ts +1 -1
- package/dist/journey-cli.js +44 -3
- package/dist/journey-cli.js.map +1 -1
- package/dist/journey-demo-api.d.ts +2 -0
- package/dist/journey-demo-api.js +23 -10
- package/dist/journey-demo-api.js.map +1 -1
- package/dist/journey-demo-cli.js +5 -2
- package/dist/journey-demo-cli.js.map +1 -1
- package/dist/journey-prefix.d.ts +194 -0
- package/dist/journey-prefix.js +279 -0
- package/dist/journey-prefix.js.map +1 -0
- package/dist/key-report.d.ts +49 -0
- package/dist/key-report.js +101 -0
- package/dist/key-report.js.map +1 -0
- package/dist/kill-signal.js +0 -1
- package/dist/kill-signal.js.map +1 -1
- package/dist/ledger-api.js +3 -1
- package/dist/ledger-api.js.map +1 -1
- package/dist/log-correlation.d.ts +54 -1
- package/dist/log-correlation.js +83 -14
- package/dist/log-correlation.js.map +1 -1
- package/dist/log-sources.js +6 -5
- package/dist/log-sources.js.map +1 -1
- package/dist/log-trace.d.ts +80 -0
- package/dist/log-trace.js +210 -0
- package/dist/log-trace.js.map +1 -0
- package/dist/logs-retention.js +2 -1
- package/dist/logs-retention.js.map +1 -1
- package/dist/masked-input.d.ts +22 -0
- package/dist/masked-input.js +99 -0
- package/dist/masked-input.js.map +1 -0
- package/dist/mcp-api.d.ts +3 -1
- package/dist/mcp-api.js +49 -7
- package/dist/mcp-api.js.map +1 -1
- package/dist/mcp-args.d.ts +12 -0
- package/dist/mcp-args.js +33 -0
- package/dist/mcp-args.js.map +1 -1
- package/dist/mcp-cli-tools.d.ts +5 -1
- package/dist/mcp-cli-tools.js +73 -16
- package/dist/mcp-cli-tools.js.map +1 -1
- package/dist/mission-api.js +2 -1
- package/dist/mission-api.js.map +1 -1
- package/dist/mission-cli.js +2 -1
- package/dist/mission-cli.js.map +1 -1
- package/dist/mission-fixtures.d.ts +10 -1
- package/dist/mission-fixtures.js +49 -15
- package/dist/mission-fixtures.js.map +1 -1
- package/dist/mission-queue-runner.js +11 -2
- package/dist/mission-queue-runner.js.map +1 -1
- package/dist/multi-run-cli.js +7 -1
- package/dist/multi-run-cli.js.map +1 -1
- package/dist/openrouter-call.js +3 -2
- package/dist/openrouter-call.js.map +1 -1
- package/dist/program.js +4 -0
- package/dist/program.js.map +1 -1
- package/dist/project-dir.js +3 -2
- package/dist/project-dir.js.map +1 -1
- package/dist/record-api.d.ts +3 -1
- package/dist/record-api.js +5 -2
- package/dist/record-api.js.map +1 -1
- package/dist/record-cli.js +14 -2
- package/dist/record-cli.js.map +1 -1
- package/dist/regression-api.d.ts +6 -0
- package/dist/regression-api.js +4 -2
- package/dist/regression-api.js.map +1 -1
- package/dist/regression-cli.js +56 -4
- package/dist/regression-cli.js.map +1 -1
- package/dist/report-api.js +2 -1
- package/dist/report-api.js.map +1 -1
- package/dist/resource-preflight.d.ts +87 -0
- package/dist/resource-preflight.js +160 -0
- package/dist/resource-preflight.js.map +1 -0
- package/dist/result-schema.d.ts +1 -1
- package/dist/result-schema.js +1 -1
- package/dist/run-key-preflight.d.ts +42 -0
- package/dist/run-key-preflight.js +82 -0
- package/dist/run-key-preflight.js.map +1 -0
- package/dist/run-screenshots.js +11 -5
- package/dist/run-screenshots.js.map +1 -1
- package/dist/runtime-env.js +3 -2
- package/dist/runtime-env.js.map +1 -1
- package/dist/server-log-verify.d.ts +2 -0
- package/dist/server-log-verify.js +8 -3
- package/dist/server-log-verify.js.map +1 -1
- package/dist/site-gate-cli.js +2 -1
- package/dist/site-gate-cli.js.map +1 -1
- package/dist/source-api.js +2 -1
- package/dist/source-api.js.map +1 -1
- package/dist/suite-explore-options.d.ts +32 -0
- package/dist/suite-explore-options.js +22 -0
- package/dist/suite-explore-options.js.map +1 -1
- package/dist/target-config.d.ts +6 -0
- package/dist/target-config.js +9 -0
- package/dist/target-config.js.map +1 -1
- package/dist/type-fixture-file.d.ts +9 -0
- package/dist/type-fixture-file.js +48 -0
- package/dist/type-fixture-file.js.map +1 -0
- package/dist/ui-api.js +4 -3
- package/dist/ui-api.js.map +1 -1
- package/dist/usability-capture.js +4 -3
- package/dist/usability-capture.js.map +1 -1
- package/dist/usage-config.d.ts +1 -1
- package/dist/usage-config.js +1 -1
- package/dist/ux-claim-probe.d.ts +45 -0
- package/dist/ux-claim-probe.js +386 -0
- package/dist/ux-claim-probe.js.map +1 -0
- package/dist/ux-cli.js +8 -1
- package/dist/ux-cli.js.map +1 -1
- package/dist/ux-product.d.ts +14 -0
- package/dist/ux-product.js +39 -0
- package/dist/ux-product.js.map +1 -0
- package/dist/ux-review.d.ts +4 -0
- package/dist/ux-review.js +27 -7
- package/dist/ux-review.js.map +1 -1
- package/dist/ux-usability.d.ts +34 -9
- package/dist/ux-usability.js +100 -14
- package/dist/ux-usability.js.map +1 -1
- package/dist/verify-fix-api.d.ts +21 -0
- package/dist/verify-fix-api.js +85 -33
- package/dist/verify-fix-api.js.map +1 -1
- package/dist/verify-fix-cli.js +7 -2
- package/dist/verify-fix-cli.js.map +1 -1
- package/package.json +9 -9
- package/skills/jevitate-explore/SKILL.md +8 -0
- package/skills/jevitate-getting-started/SKILL.md +2 -1
- package/skills/jevitate-test-campaign/SKILL.md +203 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type BrowserLaunchOptions, type ExtensionIdentity, type OpenOptions } from "@jevitate/playwright";
|
|
2
2
|
/** The browser options a runner takes: how Chromium is launched, plus how the run is shown (#245). */
|
|
3
3
|
export interface BrowserRunOptions extends BrowserLaunchOptions {
|
|
4
4
|
/** A visible browser window (`--headed` / `JEVITATE_HEADED=1` / a suite item's `headed`). Default: headless. */
|
|
@@ -56,3 +56,34 @@ export declare function assertHeadedDisplay(headed: boolean, env?: Readonly<Reco
|
|
|
56
56
|
export declare function headedFromEnv(env: Readonly<Record<string, string | undefined>>): boolean;
|
|
57
57
|
/** The one-line warning for a headed run that opens several windows at once (#245: warn, never refuse). */
|
|
58
58
|
export declare function multiWindowWarning(what: string): string;
|
|
59
|
+
/** #256: a `chrome-extension://` target or replay that does not match the loaded `--extension`s (exit 64). */
|
|
60
|
+
export declare class ExtensionMismatchError extends Error {
|
|
61
|
+
readonly code: "E_EXTENSION_ARGS";
|
|
62
|
+
constructor(message: string);
|
|
63
|
+
}
|
|
64
|
+
/** #256: the `chrome-extension://<id>` origin of every loaded `--extension`. */
|
|
65
|
+
export declare function extensionOrigins(browser: BrowserLaunchOptions | undefined): string[];
|
|
66
|
+
/** #256: what a run records about its loaded extensions (Recording `extensions`), or undefined for none. */
|
|
67
|
+
export declare function loadedExtensions(browser: BrowserLaunchOptions | undefined): ExtensionIdentity[] | undefined;
|
|
68
|
+
/** #256: `{ extensions }` to spread into a Recording a run wrote, or `{}` when it loaded none. */
|
|
69
|
+
export declare function extensionsStamp(browser: BrowserLaunchOptions | undefined): {
|
|
70
|
+
extensions?: ExtensionIdentity[];
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* #256: the `--allow` list a run uses once its loaded extensions' origins are allowed too — ONLY
|
|
74
|
+
* those ids. With no `--allow`, the default (the URL's own origin) plus the extension origins; with
|
|
75
|
+
* `--allow`, those plus the extension origins. No extensions: `allow` unchanged.
|
|
76
|
+
*/
|
|
77
|
+
export declare function allowWithExtensions(url: string | undefined, allow: readonly string[], browser: BrowserLaunchOptions | undefined): string[];
|
|
78
|
+
/**
|
|
79
|
+
* #256: a `chrome-extension://<id>/…` start URL must name an extension this run loads — refused
|
|
80
|
+
* before any browser opens otherwise (listing the loaded ids, since an unpacked id is derived from
|
|
81
|
+
* the directory's path). Any other URL passes.
|
|
82
|
+
*/
|
|
83
|
+
export declare function assertExtensionTargetLoaded(url: string | undefined, browser: BrowserLaunchOptions | undefined): void;
|
|
84
|
+
/**
|
|
85
|
+
* #256: a replay (verify-fix, journey run) refuses when the extensions the Recording ran with are
|
|
86
|
+
* not the build loaded now — same ids, names and versions — so a "fixed" verdict is never reached
|
|
87
|
+
* against a different extension build (or without the extension at all).
|
|
88
|
+
*/
|
|
89
|
+
export declare function assertSameExtensionBuild(recorded: readonly ExtensionIdentity[] | undefined, browser: BrowserLaunchOptions | undefined, what: string): void;
|
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import { readdirSync, statSync } from "node:fs";
|
|
10
10
|
import { basename, dirname, join } from "node:path";
|
|
11
|
+
import { describeExtensions, EXTENSION_ID, extensionIdentity, extensionOrigin, sameExtensionBuild } from "@jevitate/playwright";
|
|
12
|
+
import { normalizeAllowlist } from "@jevitate/explore";
|
|
11
13
|
/** `--slow-mo` when `--headed` is given without one: slow enough for an audience to follow. */
|
|
12
14
|
export const HEADED_DEFAULT_SLOW_MO_MS = 250;
|
|
13
15
|
/**
|
|
@@ -103,4 +105,71 @@ export function headedFromEnv(env) {
|
|
|
103
105
|
export function multiWindowWarning(what) {
|
|
104
106
|
return `warning: --headed with ${what} opens several browser windows; each is shown.\n`;
|
|
105
107
|
}
|
|
108
|
+
/** #256: a `chrome-extension://` target or replay that does not match the loaded `--extension`s (exit 64). */
|
|
109
|
+
export class ExtensionMismatchError extends Error {
|
|
110
|
+
code = "E_EXTENSION_ARGS";
|
|
111
|
+
constructor(message) {
|
|
112
|
+
super(message);
|
|
113
|
+
this.name = "ExtensionMismatchError";
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
/** #256: the `chrome-extension://<id>` origin of every loaded `--extension`. */
|
|
117
|
+
export function extensionOrigins(browser) {
|
|
118
|
+
return (browser?.extensions ?? []).map((e) => extensionOrigin(e.id));
|
|
119
|
+
}
|
|
120
|
+
/** #256: what a run records about its loaded extensions (Recording `extensions`), or undefined for none. */
|
|
121
|
+
export function loadedExtensions(browser) {
|
|
122
|
+
const xs = browser?.extensions ?? [];
|
|
123
|
+
return xs.length === 0 ? undefined : xs.map(extensionIdentity);
|
|
124
|
+
}
|
|
125
|
+
/** #256: `{ extensions }` to spread into a Recording a run wrote, or `{}` when it loaded none. */
|
|
126
|
+
export function extensionsStamp(browser) {
|
|
127
|
+
const xs = loadedExtensions(browser);
|
|
128
|
+
return xs === undefined ? {} : { extensions: xs };
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* #256: the `--allow` list a run uses once its loaded extensions' origins are allowed too — ONLY
|
|
132
|
+
* those ids. With no `--allow`, the default (the URL's own origin) plus the extension origins; with
|
|
133
|
+
* `--allow`, those plus the extension origins. No extensions: `allow` unchanged.
|
|
134
|
+
*/
|
|
135
|
+
export function allowWithExtensions(url, allow, browser) {
|
|
136
|
+
const ext = extensionOrigins(browser);
|
|
137
|
+
if (ext.length === 0)
|
|
138
|
+
return [...allow];
|
|
139
|
+
const base = allow.length > 0 ? [...allow] : url === undefined ? [] : normalizeAllowlist([url]);
|
|
140
|
+
return [...new Set([...base, ...ext])];
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* #256: a `chrome-extension://<id>/…` start URL must name an extension this run loads — refused
|
|
144
|
+
* before any browser opens otherwise (listing the loaded ids, since an unpacked id is derived from
|
|
145
|
+
* the directory's path). Any other URL passes.
|
|
146
|
+
*/
|
|
147
|
+
export function assertExtensionTargetLoaded(url, browser) {
|
|
148
|
+
if (url === undefined || !url.toLowerCase().startsWith("chrome-extension:"))
|
|
149
|
+
return;
|
|
150
|
+
let host = "";
|
|
151
|
+
try {
|
|
152
|
+
host = new URL(url).host;
|
|
153
|
+
}
|
|
154
|
+
catch {
|
|
155
|
+
/* refused below */
|
|
156
|
+
}
|
|
157
|
+
const loaded = browser?.extensions ?? [];
|
|
158
|
+
if (EXTENSION_ID.test(host) && loaded.some((e) => e.id === host))
|
|
159
|
+
return;
|
|
160
|
+
const hint = loaded.length === 0 ? "load it with --extension <dir>" : `loaded: ${loaded.map((e) => `${e.name} → ${extensionOrigin(e.id)}/`).join(", ")}`;
|
|
161
|
+
throw new ExtensionMismatchError(`${url} is not a page of a loaded extension (${hint})`);
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* #256: a replay (verify-fix, journey run) refuses when the extensions the Recording ran with are
|
|
165
|
+
* not the build loaded now — same ids, names and versions — so a "fixed" verdict is never reached
|
|
166
|
+
* against a different extension build (or without the extension at all).
|
|
167
|
+
*/
|
|
168
|
+
export function assertSameExtensionBuild(recorded, browser, what) {
|
|
169
|
+
const loaded = loadedExtensions(browser);
|
|
170
|
+
if (sameExtensionBuild(recorded, loaded))
|
|
171
|
+
return;
|
|
172
|
+
throw new ExtensionMismatchError(`${what} was recorded with extensions ${describeExtensions(recorded)} but this run loads ${describeExtensions(loaded)}; ` +
|
|
173
|
+
"pass the same --extension build (an unpacked extension's id follows its directory path unless its manifest pins a \"key\")");
|
|
174
|
+
}
|
|
106
175
|
//# sourceMappingURL=browser-run-options.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser-run-options.js","sourceRoot":"","sources":["../src/browser-run-options.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"browser-run-options.js","sourceRoot":"","sources":["../src/browser-run-options.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,iBAAiB,EAAE,eAAe,EAAE,kBAAkB,EAAuE,MAAM,sBAAsB,CAAC;AACrM,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAevD,+FAA+F;AAC/F,MAAM,CAAC,MAAM,yBAAyB,GAAG,GAAG,CAAC;AAK7C;;;;GAIG;AACH,MAAM,UAAU,oBAAoB,CAAC,OAAsC,EAAE,QAAiB;IAC5F,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,GAAG,OAAO,IAAI,EAAE,CAAC;IAC5F,MAAM,eAAe,GAAG,MAAM,IAAI,CAAC,MAAM,KAAK,IAAI,CAAC,CAAC,CAAC,yBAAyB,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IAC5F,OAAO;QACL,GAAG,MAAM;QACT,QAA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GAAG,MAAM,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,gCAAgC,CAAC,CAAC,CAAC,WAAW,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,MAAM,eAAe,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;IACzJ,MAAM,IAAI,sBAAsB,CAAC,GAAG,GAAG,yCAAyC,IAAI,GAAG,CAAC,CAAC;AAC3F,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,wBAAwB,CAAC,QAAkD,EAAE,OAAyC,EAAE,IAAY;IAClJ,MAAM,MAAM,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;IACzC,IAAI,kBAAkB,CAAC,QAAQ,EAAE,MAAM,CAAC;QAAE,OAAO;IACjD,MAAM,IAAI,sBAAsB,CAC9B,GAAG,IAAI,iCAAiC,kBAAkB,CAAC,QAAQ,CAAC,uBAAuB,kBAAkB,CAAC,MAAM,CAAC,IAAI;QACvH,4HAA4H,CAC/H,CAAC;AACJ,CAAC"}
|
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
// this plain `tsc --build` dist (no bundler substitution), so it needs real committed values
|
|
6
6
|
// here instead. See ./engine.ts, which prefers the esbuild-injected value when present and
|
|
7
7
|
// falls back to these.
|
|
8
|
-
export const GENERATED_COMMIT = "
|
|
9
|
-
export const GENERATED_BUILT_AT = "2026-
|
|
8
|
+
export const GENERATED_COMMIT = "7937daf";
|
|
9
|
+
export const GENERATED_BUILT_AT = "2026-10-02T05:17:24.714Z";
|
|
10
10
|
//# sourceMappingURL=build-info.generated.js.map
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import type { Command } from "commander";
|
|
2
|
+
import { type JourneyBranchPoint } from "@jevitate/journey";
|
|
3
|
+
import { type MissionOutcome } from "@jevitate/domain";
|
|
4
|
+
import type { ConsolidatedDefect } from "@jevitate/findings";
|
|
5
|
+
import type { AnchoredStrategy } from "./journey-prefix.js";
|
|
6
|
+
import { type MissionFixtures } from "./mission-fixtures.js";
|
|
7
|
+
import { type RunSummary } from "./report-api.js";
|
|
8
|
+
/**
|
|
9
|
+
* #293 — `jevitate campaign run <spec.json>`: many journey-anchored missions, run in order, read as
|
|
10
|
+
* ONE deduped report.
|
|
11
|
+
*
|
|
12
|
+
* A campaign spec lists jobs: a promoted Journey, the anchors (names or step numbers) to branch off,
|
|
13
|
+
* the strategies to run from each, and their budgets. The run is:
|
|
14
|
+
*
|
|
15
|
+
* 1. discovery — each job's whole Journey is replayed once (`journey run`, fail-closed): a stale
|
|
16
|
+
* Journey is reported and its missions are skipped (`journey-stale`), never run from a URL;
|
|
17
|
+
* 2. anchored missions, in spec order (job → anchor → strategy): each is `explore --from-journey
|
|
18
|
+
* <id> --at-step <anchor> --strategy <s>` (its own fresh browser context), with the campaign's
|
|
19
|
+
* state restore around it — the `--fixtures` setup/restore semantics (and operator hooks when
|
|
20
|
+
* `--allow-shell-hooks` is given) — so one mission's side effects never leak into the next;
|
|
21
|
+
* 3. one report — every mission's persisted result consolidated by `@jevitate/findings` (the same
|
|
22
|
+
* dedupe as `jevitate report`), each defect listing the Journey steps it branched from.
|
|
23
|
+
*
|
|
24
|
+
* Bounded: at most 50 jobs and `maxRuns` missions (default 50, at most 200), each with an action
|
|
25
|
+
* budget (default 40). An invalid spec is refused with EVERY problem listed (E_CAMPAIGN_SPEC, exit
|
|
26
|
+
* 64) before any browser opens. The campaign's outcome is the worst of its missions' (a broken or
|
|
27
|
+
* stale mission dominates, as `combineOutcomes` rules) — the report keeps every finding either way.
|
|
28
|
+
*/
|
|
29
|
+
export { CAMPAIGN_LIMITS, CampaignSpecSchema, type CampaignSpec } from "@jevitate/journey";
|
|
30
|
+
/** The spec cannot be run as given — every problem listed (exit 64, nothing ran). */
|
|
31
|
+
export declare class CampaignSpecError extends Error {
|
|
32
|
+
readonly problems: readonly string[];
|
|
33
|
+
readonly code: "E_CAMPAIGN_SPEC";
|
|
34
|
+
constructor(problems: readonly string[]);
|
|
35
|
+
}
|
|
36
|
+
export interface CampaignAnchor {
|
|
37
|
+
/** What `--at-step` is given (the anchor's name, else the step number). */
|
|
38
|
+
readonly atStep: string;
|
|
39
|
+
readonly branch: JourneyBranchPoint;
|
|
40
|
+
}
|
|
41
|
+
export interface CampaignJobPlan {
|
|
42
|
+
readonly id: string;
|
|
43
|
+
readonly journey: string;
|
|
44
|
+
readonly params: Readonly<Record<string, string>>;
|
|
45
|
+
readonly storageState?: string;
|
|
46
|
+
readonly anchors: readonly CampaignAnchor[];
|
|
47
|
+
readonly strategies: readonly AnchoredStrategy[];
|
|
48
|
+
readonly goal?: string;
|
|
49
|
+
readonly appClass?: string;
|
|
50
|
+
readonly success: readonly string[];
|
|
51
|
+
/** Per mission (a sweep's total already split). */
|
|
52
|
+
readonly maxActions: number;
|
|
53
|
+
readonly maxDecisions?: number;
|
|
54
|
+
/** #293: set when the job sweeps every step (`all`) or every anchor (`anchors`). */
|
|
55
|
+
readonly sweep?: "all" | "anchors";
|
|
56
|
+
/** The campaign's state restore for this job's runs (built for its Journey's origins). */
|
|
57
|
+
readonly fixtures?: MissionFixtures;
|
|
58
|
+
}
|
|
59
|
+
export interface CampaignPlan {
|
|
60
|
+
readonly name?: string;
|
|
61
|
+
readonly specPath: string;
|
|
62
|
+
readonly env?: string;
|
|
63
|
+
readonly baseUrl?: string;
|
|
64
|
+
readonly discovery: boolean;
|
|
65
|
+
readonly totalRuns: number;
|
|
66
|
+
readonly jobs: readonly CampaignJobPlan[];
|
|
67
|
+
}
|
|
68
|
+
export interface ValidateCampaignOptions {
|
|
69
|
+
readonly journeysDir: string;
|
|
70
|
+
/** `--allow-shell-hooks`: the spec's before/after hooks may run. */
|
|
71
|
+
readonly allowShellHooks?: boolean;
|
|
72
|
+
/** #247 seams (`environments.json`, `targets.json`). */
|
|
73
|
+
readonly environmentSeams?: {
|
|
74
|
+
readonly environmentsFile?: string;
|
|
75
|
+
readonly targetsFile?: string;
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Reads and validates a campaign spec against the Journey store — structure, then every job's
|
|
80
|
+
* Journey (exists, promoted), anchors, params, session, strategies' inputs, the fixtures and the
|
|
81
|
+
* run cap — and returns the plan. Throws `CampaignSpecError` listing EVERY problem found.
|
|
82
|
+
*/
|
|
83
|
+
export declare function validateCampaign(specPath: string, opts: ValidateCampaignOptions): Promise<CampaignPlan>;
|
|
84
|
+
/**
|
|
85
|
+
* Validates a campaign spec OBJECT (`specPath` names where it came from; its relative paths resolve
|
|
86
|
+
* against that file's directory) — what `explore --at-step all|anchors` builds for its sweep.
|
|
87
|
+
*/
|
|
88
|
+
export declare function validateCampaignSpec(raw: unknown, specPath: string, opts: ValidateCampaignOptions): Promise<CampaignPlan>;
|
|
89
|
+
export interface CampaignDiscovery {
|
|
90
|
+
readonly job: string;
|
|
91
|
+
readonly journeyId: string;
|
|
92
|
+
/** `ok`: the whole Journey replays · `stale`: it did not (its missions were skipped) · `error`: the replay could not run. */
|
|
93
|
+
readonly outcome: "ok" | "stale" | "error";
|
|
94
|
+
readonly reason?: string;
|
|
95
|
+
}
|
|
96
|
+
export interface CampaignMission {
|
|
97
|
+
readonly job: string;
|
|
98
|
+
readonly strategy: AnchoredStrategy;
|
|
99
|
+
readonly branch: JourneyBranchPoint;
|
|
100
|
+
/** `ran`: the mission ran (its outcome is `missionOutcome`) · `skipped`: its Journey was stale at discovery · `error`: it could not run. */
|
|
101
|
+
readonly status: "ran" | "skipped" | "error";
|
|
102
|
+
readonly missionOutcome: MissionOutcome;
|
|
103
|
+
readonly exitCode: number;
|
|
104
|
+
readonly resultPath?: string;
|
|
105
|
+
readonly failure?: {
|
|
106
|
+
readonly kind: string;
|
|
107
|
+
readonly message: string;
|
|
108
|
+
};
|
|
109
|
+
/** True when the campaign's state restore (`fixtures`/hooks) ran around this mission (setup before, restore after). */
|
|
110
|
+
readonly restored?: boolean;
|
|
111
|
+
}
|
|
112
|
+
export interface CampaignResult {
|
|
113
|
+
readonly name?: string;
|
|
114
|
+
readonly specPath: string;
|
|
115
|
+
readonly outDir: string;
|
|
116
|
+
readonly startedAt: string;
|
|
117
|
+
readonly finishedAt: string;
|
|
118
|
+
readonly discovery: readonly CampaignDiscovery[];
|
|
119
|
+
readonly missions: readonly CampaignMission[];
|
|
120
|
+
/** One deduped defect list across every mission (`@jevitate/findings`), each with its branch points. */
|
|
121
|
+
readonly report: {
|
|
122
|
+
readonly defects: readonly ConsolidatedDefect[];
|
|
123
|
+
readonly summary: {
|
|
124
|
+
readonly defects: number;
|
|
125
|
+
readonly advisory: number;
|
|
126
|
+
readonly runs: number;
|
|
127
|
+
};
|
|
128
|
+
readonly runs: readonly RunSummary[];
|
|
129
|
+
};
|
|
130
|
+
/** `campaign.json` (this result) and `campaign.md` (the report) in `outDir`. */
|
|
131
|
+
readonly resultPath: string;
|
|
132
|
+
readonly reportPath: string;
|
|
133
|
+
/** The worst mission outcome (`combineOutcomes`). */
|
|
134
|
+
readonly missionOutcome: MissionOutcome;
|
|
135
|
+
readonly exitCode: number;
|
|
136
|
+
}
|
|
137
|
+
export interface RunCampaignOptions {
|
|
138
|
+
/** A fresh, unparsed program (each run is the same CLI command, in process). */
|
|
139
|
+
readonly newProgram: () => Command;
|
|
140
|
+
readonly journeysDir: string;
|
|
141
|
+
readonly outDir?: string;
|
|
142
|
+
readonly real?: boolean;
|
|
143
|
+
readonly fakeAi?: boolean;
|
|
144
|
+
/** Where `jevitate report`'s target filter would read mission targets (unused without one). */
|
|
145
|
+
readonly missionTargetsDir: string;
|
|
146
|
+
readonly nowIso?: () => string;
|
|
147
|
+
/** More `explore` flags every mission is run with (an `explore --at-step all` sweep forwards its own). */
|
|
148
|
+
readonly missionArgs?: readonly string[];
|
|
149
|
+
}
|
|
150
|
+
/** Runs a validated campaign: discovery, then every anchored mission in order with state restore, then one report. */
|
|
151
|
+
export declare function runCampaign(plan: CampaignPlan, opts: RunCampaignOptions): Promise<CampaignResult>;
|