@e2edev/e2e 0.8.0 → 0.10.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/README.md +2 -2
- package/dist/agent/act-validation.js +1 -1
- package/dist/agent/act-validation.js.map +1 -1
- package/dist/agent/act.d.ts +1 -0
- package/dist/agent/act.d.ts.map +1 -1
- package/dist/agent/act.js +27 -18
- package/dist/agent/act.js.map +1 -1
- package/dist/agent/index.d.ts.map +1 -1
- package/dist/agent/index.js +17 -12
- package/dist/agent/index.js.map +1 -1
- package/dist/agent/invocation.d.ts +26 -6
- package/dist/agent/invocation.d.ts.map +1 -1
- package/dist/agent/invocation.js +9 -6
- package/dist/agent/invocation.js.map +1 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +3 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/init/engine-versions.json +1 -0
- package/dist/cli/init/engines.d.ts +11 -6
- package/dist/cli/init/engines.d.ts.map +1 -1
- package/dist/cli/init/engines.js +23 -4
- package/dist/cli/init/engines.js.map +1 -1
- package/dist/cli/init/scaffold.d.ts.map +1 -1
- package/dist/cli/init/scaffold.js +5 -3
- package/dist/cli/init/scaffold.js.map +1 -1
- package/dist/cli/init.d.ts.map +1 -1
- package/dist/cli/init.js +0 -6
- package/dist/cli/init.js.map +1 -1
- package/dist/collect/registry.d.ts.map +1 -1
- package/dist/collect/registry.js +3 -0
- package/dist/collect/registry.js.map +1 -1
- package/dist/collect/select.d.ts +2 -0
- package/dist/collect/select.d.ts.map +1 -1
- package/dist/collect/select.js +9 -0
- package/dist/collect/select.js.map +1 -1
- package/dist/config/agent.d.ts +3 -1
- package/dist/config/agent.d.ts.map +1 -1
- package/dist/config/agent.js +25 -24
- package/dist/config/agent.js.map +1 -1
- package/dist/config/app.d.ts +4 -4
- package/dist/config/app.d.ts.map +1 -1
- package/dist/config/esm-hooks.d.ts +28 -0
- package/dist/config/esm-hooks.d.ts.map +1 -0
- package/dist/config/esm-hooks.js +35 -0
- package/dist/config/esm-hooks.js.map +1 -0
- package/dist/config/load.d.ts +6 -0
- package/dist/config/load.d.ts.map +1 -1
- package/dist/config/load.js +52 -5
- package/dist/config/load.js.map +1 -1
- package/dist/config/resolve.d.ts +13 -3
- package/dist/config/resolve.d.ts.map +1 -1
- package/dist/config/resolve.js +119 -34
- package/dist/config/resolve.js.map +1 -1
- package/dist/engine/index.d.ts +21 -4
- package/dist/engine/index.d.ts.map +1 -1
- package/dist/engine/index.js.map +1 -1
- package/dist/engine/surface.d.ts +2 -2
- package/dist/engine/surface.d.ts.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/internal/atomic-write.d.ts +1 -1
- package/dist/internal/atomic-write.d.ts.map +1 -1
- package/dist/internal/atomic-write.js.map +1 -1
- package/dist/internal/package-version.d.ts +2 -0
- package/dist/internal/package-version.d.ts.map +1 -1
- package/dist/internal/package-version.js +9 -0
- package/dist/internal/package-version.js.map +1 -1
- package/dist/internal/redact.d.ts +12 -4
- package/dist/internal/redact.d.ts.map +1 -1
- package/dist/internal/redact.js +61 -12
- package/dist/internal/redact.js.map +1 -1
- package/dist/internal/zip.d.ts +32 -0
- package/dist/internal/zip.d.ts.map +1 -0
- package/dist/internal/zip.js +183 -0
- package/dist/internal/zip.js.map +1 -0
- package/dist/report/build.d.ts +2 -0
- package/dist/report/build.d.ts.map +1 -1
- package/dist/report/build.js.map +1 -1
- package/dist/report/json.d.ts +4 -0
- package/dist/report/json.d.ts.map +1 -0
- package/dist/report/json.js +8 -0
- package/dist/report/json.js.map +1 -0
- package/dist/report/junit.d.ts +7 -0
- package/dist/report/junit.d.ts.map +1 -1
- package/dist/report/junit.js +17 -0
- package/dist/report/junit.js.map +1 -1
- package/dist/report/list.d.ts +7 -2
- package/dist/report/list.d.ts.map +1 -1
- package/dist/report/list.js +15 -3
- package/dist/report/list.js.map +1 -1
- package/dist/run/artifacts.d.ts.map +1 -1
- package/dist/run/artifacts.js +8 -6
- package/dist/run/artifacts.js.map +1 -1
- package/dist/run/events.d.ts +2 -2
- package/dist/run/events.d.ts.map +1 -1
- package/dist/run/execute.d.ts.map +1 -1
- package/dist/run/execute.js +29 -2
- package/dist/run/execute.js.map +1 -1
- package/dist/run/fixtures.d.ts +10 -1
- package/dist/run/fixtures.d.ts.map +1 -1
- package/dist/run/fixtures.js +39 -22
- package/dist/run/fixtures.js.map +1 -1
- package/dist/run/managed-process.d.ts.map +1 -1
- package/dist/run/managed-process.js +6 -2
- package/dist/run/managed-process.js.map +1 -1
- package/dist/run/records.d.ts +8 -6
- package/dist/run/records.d.ts.map +1 -1
- package/dist/run/runner.d.ts +6 -4
- package/dist/run/runner.d.ts.map +1 -1
- package/dist/run/runner.js +130 -54
- package/dist/run/runner.js.map +1 -1
- package/dist/run/scheduler.js +2 -1
- package/dist/run/scheduler.js.map +1 -1
- package/dist/run/secrecy.d.ts +23 -0
- package/dist/run/secrecy.d.ts.map +1 -0
- package/dist/run/secrecy.js +22 -0
- package/dist/run/secrecy.js.map +1 -0
- package/dist/run/steps.d.ts +4 -0
- package/dist/run/steps.d.ts.map +1 -1
- package/dist/run/steps.js +1 -0
- package/dist/run/steps.js.map +1 -1
- package/dist/run/trace-redaction.d.ts +17 -0
- package/dist/run/trace-redaction.d.ts.map +1 -0
- package/dist/run/trace-redaction.js +148 -0
- package/dist/run/trace-redaction.js.map +1 -0
- package/dist/run/units.d.ts +2 -0
- package/dist/run/units.d.ts.map +1 -1
- package/dist/run/units.js.map +1 -1
- package/dist/run/worker-models.d.ts +14 -14
- package/dist/run/worker-models.d.ts.map +1 -1
- package/dist/run/worker-models.js +41 -26
- package/dist/run/worker-models.js.map +1 -1
- package/dist/types.d.ts +78 -13
- package/dist/types.d.ts.map +1 -1
- package/package.json +3 -3
- package/skills/e2e/SKILL.md +2 -2
- package/skills/e2e/references/agent.md +6 -6
- package/skills/e2e/references/debugging.md +1 -1
- package/skills/e2e/references/running.md +4 -0
- package/skills/e2e/references/setup.md +17 -15
- package/skills/e2e/references/writing-tests.md +1 -0
- package/dist/config/esm.d.ts +0 -4
- package/dist/config/esm.d.ts.map +0 -1
- package/dist/config/esm.js +0 -35
- package/dist/config/esm.js.map +0 -1
package/dist/run/steps.js
CHANGED
package/dist/run/steps.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"steps.js","sourceRoot":"","sources":["../../src/run/steps.ts"],"names":[],"mappings":"AAAA,oCAAoC;AAEpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAGjD,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,cAAc,EAAwB,MAAM,uBAAuB,CAAC;AAC5F,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,sFAAsF;AACtF,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE,UAAU,CAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"steps.js","sourceRoot":"","sources":["../../src/run/steps.ts"],"names":[],"mappings":"AAAA,oCAAoC;AAEpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAGjD,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,cAAc,EAAwB,MAAM,uBAAuB,CAAC;AAC5F,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,sFAAsF;AACtF,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE,UAAU,CAAU,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c,CAAC;QAC1F,IAAI,OAAO,CAAC,UAAU,KAAK,SAAS;YAAE,OAAO,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;IAChF,CAAC;IAED,+CAA+C;IAC/C,cAAc,CAAC,QAA0D;QACvE,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC;QAC/B,IAAI,OAAO,KAAK,SAAS;YAAE,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC;IACzD,CAAC;IAED,GAAG;QACD,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAED,6EAA6E;IAC7E,SAAS;QACP,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;IACjE,CAAC;IAEO,OAAO;QACb,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC;QACrC,OAAO,MAAM,KAAK,SAAS,IAAI,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;IAClF,CAAC;CACF"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runner-side redaction of the trace archives an engine wrote, before the
|
|
3
|
+
* runner registers, hashes, or hands them to a store. An engine records what
|
|
4
|
+
* happened, secrets included: a Playwright trace holds the filled value in the
|
|
5
|
+
* action's parameters, in every DOM snapshot of the field, and in the request
|
|
6
|
+
* that carried it. The runner owns the secret ledger, so the runner rewrites.
|
|
7
|
+
*/
|
|
8
|
+
import type { SecretLedger } from '../internal/redact.ts';
|
|
9
|
+
/**
|
|
10
|
+
* Rewrites the archives of one trace in place. `paths` are what the engine
|
|
11
|
+
* returned from `stopTrace`, relative to `dir`; one that resolves outside
|
|
12
|
+
* `dir` is refused before anything is touched. An archive that cannot be
|
|
13
|
+
* rewritten is deleted together with the rest of the trace, and the failure
|
|
14
|
+
* is thrown: the runner keeps no trace it cannot vouch for.
|
|
15
|
+
*/
|
|
16
|
+
export declare function redactTraceArchives(dir: string, paths: readonly string[], ledger: SecretLedger): Promise<void>;
|
|
17
|
+
//# sourceMappingURL=trace-redaction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trace-redaction.d.ts","sourceRoot":"","sources":["../../src/run/trace-redaction.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAG1D;;;;;;GAMG;AACH,wBAAsB,mBAAmB,CACvC,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,SAAS,MAAM,EAAE,EACxB,MAAM,EAAE,YAAY,GACnB,OAAO,CAAC,IAAI,CAAC,CAoBf"}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runner-side redaction of the trace archives an engine wrote, before the
|
|
3
|
+
* runner registers, hashes, or hands them to a store. An engine records what
|
|
4
|
+
* happened, secrets included: a Playwright trace holds the filled value in the
|
|
5
|
+
* action's parameters, in every DOM snapshot of the field, and in the request
|
|
6
|
+
* that carried it. The runner owns the secret ledger, so the runner rewrites.
|
|
7
|
+
*/
|
|
8
|
+
import { readFile, rm } from 'node:fs/promises';
|
|
9
|
+
import path from 'node:path';
|
|
10
|
+
import { writeFileAtomic } from '../internal/atomic-write.js';
|
|
11
|
+
import { errorMessage, InfrastructureError } from '../internal/errors.js';
|
|
12
|
+
import { inflateEntry, readZip, writeZip, zipEntry } from '../internal/zip.js';
|
|
13
|
+
/**
|
|
14
|
+
* Rewrites the archives of one trace in place. `paths` are what the engine
|
|
15
|
+
* returned from `stopTrace`, relative to `dir`; one that resolves outside
|
|
16
|
+
* `dir` is refused before anything is touched. An archive that cannot be
|
|
17
|
+
* rewritten is deleted together with the rest of the trace, and the failure
|
|
18
|
+
* is thrown: the runner keeps no trace it cannot vouch for.
|
|
19
|
+
*/
|
|
20
|
+
export async function redactTraceArchives(dir, paths, ledger) {
|
|
21
|
+
const root = path.resolve(dir);
|
|
22
|
+
const archives = paths.map((relative) => path.resolve(root, relative));
|
|
23
|
+
const outside = archives.find((absolute) => !isInside(root, absolute));
|
|
24
|
+
if (outside !== undefined) {
|
|
25
|
+
throw new InfrastructureError('TRACE_WITHHELD', `the trace was not registered: ${outside} is outside the attempt's artifact directory`);
|
|
26
|
+
}
|
|
27
|
+
try {
|
|
28
|
+
for (const archive of archives)
|
|
29
|
+
await redactArchive(archive, ledger);
|
|
30
|
+
}
|
|
31
|
+
catch (cause) {
|
|
32
|
+
await Promise.all(archives.map((archive) => rm(archive, { force: true })));
|
|
33
|
+
throw new InfrastructureError('TRACE_WITHHELD', `the trace was deleted because it could not be redacted: ${errorMessage(cause)}`, { cause });
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
function isInside(root, absolute) {
|
|
37
|
+
const relative = path.relative(root, absolute);
|
|
38
|
+
return relative !== '' && !relative.startsWith('..') && !path.isAbsolute(relative);
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Every text entry is rewritten through the ledger; one the redactor left
|
|
42
|
+
* unchanged is carried as stored, so an archive with nothing to redact is not
|
|
43
|
+
* rewritten at all. An entry that is not UTF-8 text (a screencast frame, a
|
|
44
|
+
* font, an image) cannot be rewritten: it is carried as stored unless a
|
|
45
|
+
* secret's bytes occur in it, in which case it is dropped from the archive.
|
|
46
|
+
*/
|
|
47
|
+
async function redactArchive(absolute, ledger) {
|
|
48
|
+
const entries = readZip(await readFile(absolute));
|
|
49
|
+
let changed = false;
|
|
50
|
+
const kept = [];
|
|
51
|
+
for (const entry of entries) {
|
|
52
|
+
const bytes = inflateEntry(entry);
|
|
53
|
+
const text = decodeText(bytes);
|
|
54
|
+
if (text === undefined) {
|
|
55
|
+
if (ledger.appearsIn(bytes)) {
|
|
56
|
+
changed = true;
|
|
57
|
+
continue;
|
|
58
|
+
}
|
|
59
|
+
kept.push(entry);
|
|
60
|
+
continue;
|
|
61
|
+
}
|
|
62
|
+
const clean = redactText(text, ledger.redact);
|
|
63
|
+
if (clean === text) {
|
|
64
|
+
kept.push(entry);
|
|
65
|
+
continue;
|
|
66
|
+
}
|
|
67
|
+
changed = true;
|
|
68
|
+
kept.push(zipEntry(entry.name, Buffer.from(clean, 'utf8'), entry));
|
|
69
|
+
}
|
|
70
|
+
if (changed)
|
|
71
|
+
await writeFileAtomic(absolute, writeZip(kept));
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* A trace's own members are JSON, one record per line; a resource is whatever
|
|
75
|
+
* the page served. A line that parses as JSON is redacted value by value and
|
|
76
|
+
* re-serialized only when something changed, so a secret that happens to
|
|
77
|
+
* spell JSON syntax cannot break a record; any other line is redacted as text.
|
|
78
|
+
*/
|
|
79
|
+
function redactText(text, redact) {
|
|
80
|
+
return text
|
|
81
|
+
.split('\n')
|
|
82
|
+
.map((line) => redactLine(line, redact))
|
|
83
|
+
.join('\n');
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Numbers are carried as their source text (`JSON.rawJSON`), so an integer
|
|
87
|
+
* past 2^53 or a negative zero survives the round trip untouched, and the
|
|
88
|
+
* line's trailing whitespace (a CR before the LF) is kept as it was.
|
|
89
|
+
*/
|
|
90
|
+
function redactLine(line, redact) {
|
|
91
|
+
if (!line.startsWith('{') && !line.startsWith('['))
|
|
92
|
+
return redact(line);
|
|
93
|
+
const body = line.trimEnd();
|
|
94
|
+
let parsed;
|
|
95
|
+
try {
|
|
96
|
+
parsed = PARSE_WITH_SOURCE(body, (_key, value, context) => typeof value === 'number' && context.source !== undefined ? RAW_JSON(context.source) : value);
|
|
97
|
+
}
|
|
98
|
+
catch {
|
|
99
|
+
return redact(line);
|
|
100
|
+
}
|
|
101
|
+
const { value, changed } = redactValues(parsed, redact);
|
|
102
|
+
return changed ? JSON.stringify(value) + line.slice(body.length) : line;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* `JSON.rawJSON` and the reviver's source-text argument (ES2025, Node 21+),
|
|
106
|
+
* which the ES2023 lib does not type.
|
|
107
|
+
*/
|
|
108
|
+
const RAW_JSON = JSON.rawJSON.bind(JSON);
|
|
109
|
+
const PARSE_WITH_SOURCE = JSON.parse;
|
|
110
|
+
/** Redacts every string in a parsed JSON value, keys included; reports whether any changed. */
|
|
111
|
+
function redactValues(value, redact) {
|
|
112
|
+
if (typeof value === 'string') {
|
|
113
|
+
const clean = redact(value);
|
|
114
|
+
return { value: clean, changed: clean !== value };
|
|
115
|
+
}
|
|
116
|
+
if (Array.isArray(value)) {
|
|
117
|
+
let changed = false;
|
|
118
|
+
const items = value.map((item) => {
|
|
119
|
+
const result = redactValues(item, redact);
|
|
120
|
+
changed ||= result.changed;
|
|
121
|
+
return result.value;
|
|
122
|
+
});
|
|
123
|
+
return { value: changed ? items : value, changed };
|
|
124
|
+
}
|
|
125
|
+
if (value !== null && typeof value === 'object') {
|
|
126
|
+
let changed = false;
|
|
127
|
+
const entries = Object.entries(value).map(([key, item]) => {
|
|
128
|
+
const cleanKey = redact(key);
|
|
129
|
+
const result = redactValues(item, redact);
|
|
130
|
+
changed ||= cleanKey !== key || result.changed;
|
|
131
|
+
return [cleanKey, result.value];
|
|
132
|
+
});
|
|
133
|
+
return { value: changed ? Object.fromEntries(entries) : value, changed };
|
|
134
|
+
}
|
|
135
|
+
return { value, changed: false };
|
|
136
|
+
}
|
|
137
|
+
const utf8 = new TextDecoder('utf-8', { fatal: true });
|
|
138
|
+
/** The bytes as text when they are valid UTF-8 without NUL bytes; undefined for anything binary. */
|
|
139
|
+
function decodeText(bytes) {
|
|
140
|
+
try {
|
|
141
|
+
const text = utf8.decode(bytes);
|
|
142
|
+
return text.includes('\0') ? undefined : text;
|
|
143
|
+
}
|
|
144
|
+
catch {
|
|
145
|
+
return undefined;
|
|
146
|
+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-run ordinary pairs the scheduler reports without dispatching. */
|
|
31
31
|
readonly immediate: readonly TestTargetPair[];
|
|
32
|
+
/** Worker cap the engine reported from `prepare`, over its declared `workers`. */
|
|
33
|
+
readonly workers?: number;
|
|
32
34
|
}
|
|
33
35
|
/** Builds per-target work plans from a selection, preserving report order. */
|
|
34
36
|
export declare function buildWorkPlans(selection: Selection, collection: Collection, projectRoot: string): TargetWorkPlan[];
|
package/dist/run/units.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"units.d.ts","sourceRoot":"","sources":["../../src/run/units.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAEtE,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAChF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD;;;GAGG;AACH,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,CAAC;IAChC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,kDAAkD;IAClD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,0DAA0D;IAC1D,QAAQ,CAAC,KAAK,EAAE,SAAS,cAAc,EAAE,CAAC;CAC3C;AAED,wDAAwD;AACxD,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAC;IAChC,QAAQ,CAAC,UAAU,EAAE,SAAS,QAAQ,EAAE,CAAC;IACzC,QAAQ,CAAC,SAAS,EAAE,SAAS,QAAQ,EAAE,CAAC;IACxC,wE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,cAAc,EAAE,CA2ClB;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAG7E;AAED,uEAAuE;AACvE,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,QAAQ,CAM9E;AAED,4EAA4E;AAC5E,eAAO,MAAM,wBAAwB,EAAE,QAGtC,CAAC;AAEF;;;GAGG;AACH,wBAAgB,UAAU,CACxB,IAAI,EAAE,cAAc,EACpB,MAAM,EAAE,IAAI,CAAC,YAAY,EAAE,MAAM,GAAG,QAAQ,CAAC,GAC5C,YAAY,CAEd;AAED,iFAAiF;AACjF,wBAAgB,YAAY,CAAC,IAAI,EAAE,cAAc,GAAG,YAAY,CAU/D;AAED,wDAAwD;AACxD,wBAAgB,eAAe,CAAC,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,QAAQ,GAAG,YAAY,CAOlF;AAED,sEAAsE;AACtE,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,YAAY,EAAE,MAAM,EAAE,cAAc,GAAG,YAAY,CAE1F"}
|
package/dist/run/units.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"units.js","sourceRoot":"","sources":["../../src/run/units.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"units.js","sourceRoot":"","sources":["../../src/run/units.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AA+BrD,8EAA8E;AAC9E,MAAM,UAAU,cAAc,CAC5B,SAAoB,EACpB,UAAsB,EACtB,WAAmB;IAEnB,OAAO,SAAS,CAAC,SAAS,C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AE,EAAE,CAAC;AAC1E,CAAC"}
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Worker-scoped model adapters.
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
2
|
+
* Worker-scoped model adapters. An agent's model is checked once per worker,
|
|
3
|
+
* when the first test acquires that agent: adapter construction validates the
|
|
4
|
+
* provider shape and the credential without a live request. A failure is
|
|
5
|
+
* reported once, to abort the run, instead of surfacing as one blocked step
|
|
6
|
+
* per test. Adapters are shared across every agent that names the same
|
|
7
|
+
* model: same provider, id, endpoint, and credential variable.
|
|
7
8
|
*/
|
|
8
9
|
import type { ModelAdapter } from '../agent/model/adapter.ts';
|
|
9
|
-
import type { ResolvedAgentConfig } from '../config/agent.ts';
|
|
10
|
+
import type { ResolvedAgentConfig, ResolvedModel } from '../config/agent.ts';
|
|
10
11
|
import { type E2EError } from '../internal/errors.ts';
|
|
11
12
|
export declare class WorkerModels {
|
|
12
|
-
private readonly agent;
|
|
13
13
|
private readonly onFailure;
|
|
14
|
-
private
|
|
14
|
+
private readonly adapters;
|
|
15
|
+
private readonly checked;
|
|
15
16
|
private failure;
|
|
16
|
-
|
|
17
|
-
constructor(agent: ResolvedAgentConfig, onFailure: (error: E2EError) => void);
|
|
17
|
+
constructor(onFailure: (error: E2EError) => void);
|
|
18
18
|
/**
|
|
19
|
-
* Builds
|
|
19
|
+
* Builds an agent's adapter on its first use and rethrows a failure on
|
|
20
20
|
* every later one. A custom executor with no model configured is exempt:
|
|
21
21
|
* its `act` steps need none, and judgment methods still fail on first use.
|
|
22
22
|
*/
|
|
23
|
-
readonly preflight: () => void;
|
|
24
|
-
/** Adapter for one resolved model;
|
|
25
|
-
readonly build: (model:
|
|
23
|
+
readonly preflight: (agent: ResolvedAgentConfig) => void;
|
|
24
|
+
/** Adapter for one resolved model; each distinct model is built once per worker. */
|
|
25
|
+
readonly build: (model: ResolvedModel | undefined) => ModelAdapter;
|
|
26
26
|
}
|
|
27
27
|
//# sourceMappingURL=worker-models.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worker-models.d.ts","sourceRoot":"","sources":["../../src/run/worker-models.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"worker-models.d.ts","sourceRoot":"","sources":["../../src/run/worker-models.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAE9D,OAAO,KAAK,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAC7E,OAAO,EAAiB,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAErE,qBAAa,YAAY;IAKX,OAAO,CAAC,QAAQ,CAAC,SAAS;IAJtC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAoC;IAC7D,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAkC;IAC1D,OAAO,CAAC,OAAO,CAAuB;IAEtC,YAA6B,SAAS,EAAE,CAAC,KAAK,EAAE,QAAQ,KAAK,IAAI,EAAI;IAErE;;;;OAIG;IACH,QAAQ,CAAC,SAAS,UAAW,mBAAmB,KAAG,IAAI,CAarD;IAEF,oFAAoF;IACpF,QAAQ,CAAC,KAAK,UAAW,aAAa,GAAG,SAAS,KAAG,YAAY,CAS/D;CACH"}
|
|
@@ -1,49 +1,64 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Worker-scoped model adapters.
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
2
|
+
* Worker-scoped model adapters. An agent's model is checked once per worker,
|
|
3
|
+
* when the first test acquires that agent: adapter construction validates the
|
|
4
|
+
* provider shape and the credential without a live request. A failure is
|
|
5
|
+
* reported once, to abort the run, instead of surfacing as one blocked step
|
|
6
|
+
* per test. Adapters are shared across every agent that names the same
|
|
7
|
+
* model: same provider, id, endpoint, and credential variable.
|
|
7
8
|
*/
|
|
8
9
|
import { createModelAdapter } from '../agent/model/sdk.js';
|
|
9
10
|
import { classifyError } from '../internal/errors.js';
|
|
10
11
|
export class WorkerModels {
|
|
11
|
-
agent;
|
|
12
12
|
onFailure;
|
|
13
|
-
|
|
13
|
+
adapters = new Map();
|
|
14
|
+
checked = new Set();
|
|
14
15
|
failure;
|
|
15
|
-
|
|
16
|
-
constructor(agent, onFailure) {
|
|
17
|
-
this.agent = agent;
|
|
16
|
+
constructor(onFailure) {
|
|
18
17
|
this.onFailure = onFailure;
|
|
19
18
|
}
|
|
20
19
|
/**
|
|
21
|
-
* Builds
|
|
20
|
+
* Builds an agent's adapter on its first use and rethrows a failure on
|
|
22
21
|
* every later one. A custom executor with no model configured is exempt:
|
|
23
22
|
* its `act` steps need none, and judgment methods still fail on first use.
|
|
24
23
|
*/
|
|
25
|
-
preflight = () => {
|
|
26
|
-
if (!this.checked) {
|
|
27
|
-
this.checked
|
|
28
|
-
if (
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
24
|
+
preflight = (agent) => {
|
|
25
|
+
if (!this.checked.has(agent)) {
|
|
26
|
+
this.checked.add(agent);
|
|
27
|
+
if (agent.executor === undefined || agent.model !== undefined) {
|
|
28
|
+
try {
|
|
29
|
+
this.build(agent.model);
|
|
30
|
+
}
|
|
31
|
+
catch (cause) {
|
|
32
|
+
this.failure = classifyError(cause);
|
|
33
|
+
this.onFailure(this.failure);
|
|
34
|
+
}
|
|
36
35
|
}
|
|
37
36
|
}
|
|
38
37
|
if (this.failure !== undefined)
|
|
39
38
|
throw this.failure;
|
|
40
39
|
};
|
|
41
|
-
/** Adapter for one resolved model;
|
|
40
|
+
/** Adapter for one resolved model; each distinct model is built once per worker. */
|
|
42
41
|
build = (model) => {
|
|
43
|
-
if (model
|
|
44
|
-
return
|
|
42
|
+
if (model === undefined)
|
|
43
|
+
return createModelAdapter(model);
|
|
44
|
+
const key = modelKey(model);
|
|
45
|
+
let adapter = this.adapters.get(key);
|
|
46
|
+
if (adapter === undefined) {
|
|
47
|
+
adapter = createModelAdapter(model);
|
|
48
|
+
this.adapters.set(key, adapter);
|
|
45
49
|
}
|
|
46
|
-
return
|
|
50
|
+
return adapter;
|
|
47
51
|
};
|
|
48
52
|
}
|
|
53
|
+
/**
|
|
54
|
+
* What makes two resolved models the same adapter. Every agent resolves its
|
|
55
|
+
* own model object, so two agents naming `openai/gpt-5.6-luna-fast` must
|
|
56
|
+
* share by what the reference says, not by object identity: provider, id,
|
|
57
|
+
* endpoint, and the credential variable. A live instance is its own key.
|
|
58
|
+
*/
|
|
59
|
+
function modelKey(model) {
|
|
60
|
+
if (model.kind === 'instance')
|
|
61
|
+
return model.model;
|
|
62
|
+
return `${model.provider}\u0000${model.id}\u0000${model.endpoint ?? ''}\u0000${model.apiKeyEnv}`;
|
|
63
|
+
}
|
|
49
64
|
//# sourceMappingURL=worker-models.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worker-models.js","sourceRoot":"","sources":["../../src/run/worker-models.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"worker-models.js","sourceRoot":"","sources":["../../src/run/worker-models.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,EAAE,aAAa,EAAiB,MAAM,uBAAuB,CAAC;AAErE,MAAM,OAAO,YAAY;IAKM,SAAS;IAJrB,QAAQ,GAAG,IAAI,GAAG,EAAyB,CAAC;IAC5C,OAAO,GAAG,IAAI,GAAG,EAAuB,CAAC;IAClD,OAAO,CAAuB;IAEtC,YAA6B,SAAoC;yBAApC,SAAS;IAA8B,CAAC;IAErE;;;;OAIG;IACM,SAAS,GAAG,CAAC,KAA0B,EAAQ,EAAE;QACxD,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,C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SAAS,KAAK,CAAC,QAAQ,IAAI,EAAE,SAAS,KAAK,CAAC,SAAS,EAAE,CAAC;AACnG,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -7,6 +7,8 @@ import type { StepExecutor } from './agent/executor.ts';
|
|
|
7
7
|
import type { StepCacheInfo } from './run/steps.ts';
|
|
8
8
|
import type { EngineHandle } from './engine/index.ts';
|
|
9
9
|
import type { TraceCacheStore } from './cache/store.ts';
|
|
10
|
+
import type { RunEvent, RunExitCode, RunStatus } from './run/events.ts';
|
|
11
|
+
import type { Report1Document } from './report/build.ts';
|
|
10
12
|
export type { CacheReadResult, TraceCacheStore } from './cache/store.ts';
|
|
11
13
|
export type { StepCacheInfo } from './run/steps.ts';
|
|
12
14
|
export type { ActionTrace, RecordedAction, TraceEntry, TraceTargetDescriptor, } from './cache/trace.ts';
|
|
@@ -103,15 +105,19 @@ export type VisionMode = boolean | 'fallback' | 'only';
|
|
|
103
105
|
export interface VisionOption {
|
|
104
106
|
vision?: VisionMode;
|
|
105
107
|
}
|
|
108
|
+
/** The configured agent (`agents.<name>`) one call runs with, in place of the test's. */
|
|
109
|
+
export interface AgentOption {
|
|
110
|
+
agent?: string;
|
|
111
|
+
}
|
|
106
112
|
/** `assert` options: one judgment plus one repair round, within `timeout`. */
|
|
107
|
-
export interface AssertOptions extends VisionOption {
|
|
113
|
+
export interface AssertOptions extends VisionOption, AgentOption {
|
|
108
114
|
/** Deadline in milliseconds; defaults to the judgment budget, `max(30000, actionTimeout)`. */
|
|
109
115
|
timeout?: number;
|
|
110
116
|
/** Attach a redacted screenshot to the step; on by default, denied after a secret fill. */
|
|
111
117
|
screenshot?: boolean;
|
|
112
118
|
}
|
|
113
119
|
/** `waitFor` options: a judgment at most once per `interval` until `timeout`. */
|
|
114
|
-
export interface WaitForOptions extends VisionOption {
|
|
120
|
+
export interface WaitForOptions extends VisionOption, AgentOption {
|
|
115
121
|
/** Deadline in milliseconds; defaults to the judgment budget, `max(30000, actionTimeout)`. */
|
|
116
122
|
timeout?: number;
|
|
117
123
|
/** Least time between two judgments, in milliseconds; 100 through 60000, default 3000. */
|
|
@@ -120,7 +126,7 @@ export interface WaitForOptions extends VisionOption {
|
|
|
120
126
|
maxModelCalls?: number;
|
|
121
127
|
}
|
|
122
128
|
/** `extract` options: one extraction plus one repair round, validated against `schema`. */
|
|
123
|
-
export interface ExtractOptions<Schema extends StandardSchemaV1> extends VisionOption {
|
|
129
|
+
export interface ExtractOptions<Schema extends StandardSchemaV1> extends VisionOption, AgentOption {
|
|
124
130
|
schema: Schema;
|
|
125
131
|
/** Deadline in milliseconds; defaults to the judgment budget, `max(30000, actionTimeout)`. */
|
|
126
132
|
timeout?: number;
|
|
@@ -130,7 +136,7 @@ export interface ExtractOptions<Schema extends StandardSchemaV1> extends VisionO
|
|
|
130
136
|
* budgets. Structured output and vision are judgment-tier options:
|
|
131
137
|
* `extract` takes `schema`; `assert`, `waitFor`, and `extract` take `vision`.
|
|
132
138
|
*/
|
|
133
|
-
export interface ActOptions {
|
|
139
|
+
export interface ActOptions extends AgentOption {
|
|
134
140
|
/**
|
|
135
141
|
* JSON-safe values the instruction refers to, at most 64 KiB and 32 levels
|
|
136
142
|
* deep. A `Secret` reaches the model by name only; the runner fills it.
|
|
@@ -346,6 +352,12 @@ export interface TestOptions {
|
|
|
346
352
|
requires?: readonly Capability[];
|
|
347
353
|
session?: string;
|
|
348
354
|
agentContext?: string;
|
|
355
|
+
/**
|
|
356
|
+
* The configured agent (`agents.<name>`) this test or group runs with, in
|
|
357
|
+
* place of the run's agent. Innermost wins; a call's own `agent` option wins
|
|
358
|
+
* over it.
|
|
359
|
+
*/
|
|
360
|
+
agent?: string;
|
|
349
361
|
}
|
|
350
362
|
export interface DescribeOptions extends Omit<TestOptions, 'only'> {
|
|
351
363
|
serial?: boolean;
|
|
@@ -678,6 +690,54 @@ export interface AgentConfig {
|
|
|
678
690
|
/** Provider options every model call carries, e.g. a reasoning effort. */
|
|
679
691
|
providerOptions?: ProviderOptions;
|
|
680
692
|
}
|
|
693
|
+
/** The reporters the runner ships, named by id; each is a `Reporter` on the same contract. */
|
|
694
|
+
export type BuiltinReporter = 'list' | 'json' | 'junit';
|
|
695
|
+
/**
|
|
696
|
+
* The run's report document, the one `.e2e/report.json` holds. Its
|
|
697
|
+
* `schemaVersion` names the wire format (`report-1`), pinned by
|
|
698
|
+
* `schema/report-v1.schema.json` in the package.
|
|
699
|
+
*/
|
|
700
|
+
export type Report = Report1Document;
|
|
701
|
+
/** What a reporter receives once the run is over and its report is on disk. */
|
|
702
|
+
export interface FinishedRun {
|
|
703
|
+
readonly report: Report;
|
|
704
|
+
/** The same status `report.run.status` carries. */
|
|
705
|
+
readonly status: RunStatus;
|
|
706
|
+
readonly exitCode: RunExitCode;
|
|
707
|
+
/** Absolute project root, what the terminal shows paths relative to. */
|
|
708
|
+
readonly projectRoot: string;
|
|
709
|
+
/** Where `report.json` was written; undefined when the write failed or config never loaded. */
|
|
710
|
+
readonly reportPath: string | undefined;
|
|
711
|
+
/** Absolute directory the report's artifact paths are relative to. */
|
|
712
|
+
readonly artifactsRoot: string;
|
|
713
|
+
/** Where `--ai-trace` wrote the run's model calls, when it was requested. */
|
|
714
|
+
readonly aiTracePath: string | undefined;
|
|
715
|
+
}
|
|
716
|
+
/** Rows a reporter hands back for the terminal summary: a label and its text, a URL or a path. */
|
|
717
|
+
export type ReporterSummary = readonly {
|
|
718
|
+
readonly label: string;
|
|
719
|
+
readonly text: string;
|
|
720
|
+
}[];
|
|
721
|
+
/**
|
|
722
|
+
* A reporter in `reporters`, the contract the built-in `list`, `json`, and
|
|
723
|
+
* `junit` reporters implement too. `onEvent` sees every run event as it
|
|
724
|
+
* happens, exactly what the `list` reporter renders, and must not block: a
|
|
725
|
+
* throw quarantines it for the rest of the run. `onRunFinished` runs once
|
|
726
|
+
* `report.json` is written and the summary has printed; it is awaited within
|
|
727
|
+
* a fixed budget, and the rows it resolves with print under the summary. Its
|
|
728
|
+
* `signal` aborts when that budget runs out or the run is forced to stop, so
|
|
729
|
+
* a reporter hands it to its requests and leaves nothing running behind. A
|
|
730
|
+
* reporter can never change the run's status or exit code: a failure or a
|
|
731
|
+
* timeout is one line on stderr. Like every live value, a reporter never
|
|
732
|
+
* crosses a process boundary; workers construct their own copy when they
|
|
733
|
+
* load the config module and never call it, so constructing one must have no
|
|
734
|
+
* side effects.
|
|
735
|
+
*/
|
|
736
|
+
export interface Reporter {
|
|
737
|
+
readonly name: string;
|
|
738
|
+
onEvent?(event: RunEvent): void;
|
|
739
|
+
onRunFinished?(run: FinishedRun, signal: AbortSignal): Promise<ReporterSummary | void>;
|
|
740
|
+
}
|
|
681
741
|
export interface E2EConfig {
|
|
682
742
|
specVersion?: '0.1';
|
|
683
743
|
projectId?: string;
|
|
@@ -692,20 +752,25 @@ export interface E2EConfig {
|
|
|
692
752
|
workers?: number;
|
|
693
753
|
/** Artifact kinds, or `{ kinds, store, video }` to also hand every artifact to a host store. */
|
|
694
754
|
artifacts?: readonly ConfiguredArtifactKind[] | ArtifactsConfig;
|
|
695
|
-
/**
|
|
696
|
-
|
|
755
|
+
/**
|
|
756
|
+
* Output renderers and reporter objects. `junit` writes `.e2e/junit.xml`,
|
|
757
|
+
* `json` prints the report and excludes `list`; a `Reporter` object runs
|
|
758
|
+
* beside them and `--reporter` never removes it.
|
|
759
|
+
*/
|
|
760
|
+
reporters?: readonly (BuiltinReporter | Reporter)[];
|
|
697
761
|
screen?: {
|
|
698
762
|
testIdAttribute?: string;
|
|
699
763
|
};
|
|
700
764
|
/**
|
|
701
|
-
*
|
|
702
|
-
* from `@e2edev/e2e/agent`, or any hand-rolled
|
|
703
|
-
*
|
|
704
|
-
*
|
|
705
|
-
*
|
|
706
|
-
*
|
|
765
|
+
* The agents by name. Each is either an options block or the agent itself:
|
|
766
|
+
* `createAgent(...)` from `@e2edev/e2e/agent`, or any hand-rolled
|
|
767
|
+
* `StepExecutor`. `default` is the one tests run with; `e2e run --agent
|
|
768
|
+
* <name>` runs them with another. With an agent value, the model falls back
|
|
769
|
+
* to `E2E_MODEL` and every other option keeps its default. Agents never
|
|
770
|
+
* cross a process boundary: workers re-resolve the config module and
|
|
771
|
+
* construct their own, exactly like model instances.
|
|
707
772
|
*/
|
|
708
|
-
|
|
773
|
+
agents?: Readonly<Record<string, AgentConfig | StepExecutor>>;
|
|
709
774
|
/**
|
|
710
775
|
* The adaptive trace cache. Opt-out: unset means
|
|
711
776
|
* `read-write`, and `'off'` — or the `--no-cache` flag, which wins over the
|