@molecule/api-ai-tools 1.13.0 → 1.13.1

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 CHANGED
@@ -3,7 +3,7 @@ AUTO-GENERATED — DO NOT EDIT THIS FILE.
3
3
  Generated by `mlcl sync-docs` from the package's src/index.ts JSDoc + mlcl/registry.json.
4
4
  Edits here are overwritten on the next commit (molecule's pre-commit hook regenerates).
5
5
  To change this document, edit the module-level JSDoc in src/index.ts.
6
- Generated: 2026-10-22T00:38:26.332Z
6
+ Generated: 2026-10-22T07:11:20.054Z
7
7
  -->
8
8
 
9
9
  # @molecule/api-ai-tools
@@ -2683,13 +2683,15 @@ function withSuiteConfig(command: string, config: string | null | undefined): st
2683
2683
  #### `scopedRerunCommand(command, locations, excluded, config, cwd, env)`
2684
2684
 
2685
2685
  The whole-suite command made scoped to the tests it should re-run instead: the same
2686
- invocation — same directory, same settings — with the named `file:line`s in place of the whole
2687
- suite, `--last-failed` dropped (it re-runs the tests that never ran too, X1 flash-m60) and
2686
+ invocation — same launcher, same settings — with the named `file:line`s in place of every
2687
+ positional selection the run carried (a spec file, a suite directory or a regex filter),
2688
+ `--last-failed` dropped (it re-runs the tests that never ran too, X1 flash-m60) and
2688
2689
  `--retries=0` set (a re-run of a known failure does not need to pay for retries).
2689
2690
 
2690
2691
  The re-run keeps the run's `> <file>` redirect only in the sense of keeping its OUTPUT there:
2691
- the target is rewritten to a fresh sibling ({@link redirectToFreshFile}), so a re-run never
2692
- overwrites the log the run itself is the evidence for (xr-molecule-flash-m173).
2692
+ the target is rewritten to a fresh sibling ({@link redirectRunnerOutputsToFreshFiles}), so a
2693
+ re-run never overwrites the log the run itself is the evidence for (xr-molecule-flash-m173) —
2694
+ and the setup around the run keeps its own file writes untouched (xr-molecule-flash-m429).
2693
2695
 
2694
2696
  `config` is the config the run was measured under ({@link withSuiteConfig}): the narrowed re-run
2695
2697
  carries it whenever the command itself does not, so a run that dropped `--config` cannot be
@@ -4614,7 +4616,9 @@ function whitespaceTolerantReplace(
4614
4616
 
4615
4617
  The shell command that parses one file and exits non-zero with the error
4616
4618
  when it does not parse: `node --check` for JavaScript, `JSON.parse` for
4617
- JSON, esbuild's transform (present wherever Vite is) for TypeScript.
4619
+ ordinary JSON, TypeScript's config parser for `tsconfig`/`jsconfig` files
4620
+ (which are JSONC), esbuild's transform (present wherever Vite is) for
4621
+ TypeScript.
4618
4622
 
4619
4623
  ```typescript
4620
4624
  function parseCheckCommand(path: string): string | null
@@ -79,13 +79,15 @@ export declare function namesSuiteConfig(command: string): boolean;
79
79
  export declare function withSuiteConfig(command: string, config: string | null | undefined): string;
80
80
  /**
81
81
  * The whole-suite command made scoped to the tests it should re-run instead: the same
82
- * invocation — same directory, same settings — with the named `file:line`s in place of the whole
83
- * suite, `--last-failed` dropped (it re-runs the tests that never ran too, X1 flash-m60) and
82
+ * invocation — same launcher, same settings — with the named `file:line`s in place of every
83
+ * positional selection the run carried (a spec file, a suite directory or a regex filter),
84
+ * `--last-failed` dropped (it re-runs the tests that never ran too, X1 flash-m60) and
84
85
  * `--retries=0` set (a re-run of a known failure does not need to pay for retries).
85
86
  *
86
87
  * The re-run keeps the run's `> <file>` redirect only in the sense of keeping its OUTPUT there:
87
- * the target is rewritten to a fresh sibling ({@link redirectToFreshFile}), so a re-run never
88
- * overwrites the log the run itself is the evidence for (xr-molecule-flash-m173).
88
+ * the target is rewritten to a fresh sibling ({@link redirectRunnerOutputsToFreshFiles}), so a
89
+ * re-run never overwrites the log the run itself is the evidence for (xr-molecule-flash-m173) —
90
+ * and the setup around the run keeps its own file writes untouched (xr-molecule-flash-m429).
89
91
  *
90
92
  * `config` is the config the run was measured under ({@link withSuiteConfig}): the narrowed re-run
91
93
  * carries it whenever the command itself does not, so a run that dropped `--config` cannot be
@@ -1 +1 @@
1
- {"version":3,"file":"suite-overlap.d.ts","sourceRoot":"","sources":["../src/suite-overlap.ts"],"names":[],"mappings":"AAAA;;;;;;;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DAA4D;AAC5D,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;CACd;AAmCD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,GAAE,SAAS,aAAa,EAAO,GAAG,MAAM,CAe3F;AAwOD;;;;;;GAMG;AACH,MAAM,WAAW,gBAAgB;IAC/B,+FAA+F;IAC/F,SAAS,EAAE,OAAO,CAAA;IAClB,oFAAoF;IACpF,MAAM,EAAE,MAAM,CAAA;IACd;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAC3B;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,gBAAgB,EACzD,SAAS,EAAE;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,EAC7B,QAAQ,EAAE,SAAS,CAAC,EAAE,GACrB,CAAC,GAAG,IAAI,CAMV;AA2FD;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,kBAAkB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;CACvC;AAmCD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,mBAAmB,GAAG,OAAO,CAYtF"}
@@ -29,7 +29,7 @@
29
29
  * @module
30
30
  */
31
31
  import { posix } from 'node:path';
32
- import { commandSegments, locatedCommandSegments } from './command-position.js';
32
+ import { commandSegments, locatedCommandSegments, statementBoundary, } from './command-position.js';
33
33
  import { commandRunsNoTests } from './no-test-run.js';
34
34
  import { matchingExcludedTitles, shellQuote, suiteRunStatements } from './utilities.js';
35
35
  /**
@@ -127,8 +127,165 @@ const FILE_REDIRECT = /(^|\s)(&>>?|1?>>?)(\s*)(?:'([^']+)'|"([^"]+)"|([^\s;&|]+)
127
127
  /** A target that is not a log anyone could lose: rewriting it would CREATE a file. */
128
128
  const DEVICE_TARGET = /^\/dev\//;
129
129
  /**
130
- * The command with every file redirect pointed at a fresh file beside its original target
131
- * (`/tmp/pw-full.log` → `/tmp/pw-full.rerun.log`), and nothing else changed.
130
+ * The command's words, quotes kept whole and with the offsets they were written at — the reading
131
+ * {@link dropSupersededSelections} tokenizes the runner's arguments with AND the one a redirect
132
+ * reader may not look inside: a quoted `--grep 'a > b'` is one word, and its `>` is the filter's
133
+ * text, not a redirect.
134
+ */
135
+ const ARGUMENT_WORD = /"(?:\\.|[^"\\])*"|'[^']*'|\S+/g;
136
+ /**
137
+ * The command's words as spans, in the order they were written.
138
+ *
139
+ * @param command - The shell command.
140
+ * @returns Each word's span in the command.
141
+ */
142
+ function wordSpans(command) {
143
+ return [...command.matchAll(ARGUMENT_WORD)].map((match) => ({
144
+ start: match.index ?? 0,
145
+ end: (match.index ?? 0) + match[0].length,
146
+ }));
147
+ }
148
+ /**
149
+ * Whether an offset sits strictly INSIDE one of the command's words rather than between them —
150
+ * the quoted data a redirect reader must leave alone.
151
+ *
152
+ * @param at - The offset being read.
153
+ * @param words - The command's word spans.
154
+ * @returns True when the offset is inside a word.
155
+ */
156
+ function insideWord(at, words) {
157
+ return words.some((word) => at > word.start && at < word.end);
158
+ }
159
+ /**
160
+ * The command with the edits applied — right to left, so every edit's offsets are still the ones
161
+ * its reader reported.
162
+ *
163
+ * @param command - The command the edits were read from.
164
+ * @param edits - The replacements, as offsets in that command.
165
+ * @returns The command with each span replaced.
166
+ */
167
+ function applyTextEdits(command, edits) {
168
+ let out = command;
169
+ for (const edit of [...edits].sort((a, b) => b.start - a.start))
170
+ out = out.slice(0, edit.start) + edit.text + out.slice(edit.end);
171
+ return out;
172
+ }
173
+ /**
174
+ * The output redirects of ONE statement's text that name a file, as edits that point them at a
175
+ * fresh sibling of the file they wrote (`/tmp/pw-full.log` → `/tmp/pw-full.rerun.log`).
176
+ *
177
+ * A redirect whose operator sits inside a quoted word is that word's text, not a redirect of the
178
+ * statement: `npx playwright test --grep 'a > b' > /tmp/full.log` carries exactly one redirect.
179
+ *
180
+ * @param statement - The statement's text.
181
+ * @param offset - The statement's offset in the command.
182
+ * @param words - The command's word spans.
183
+ * @returns The edits, in statement order.
184
+ */
185
+ function freshRedirectEdits(statement, offset, words) {
186
+ const edits = [];
187
+ for (const match of statement.matchAll(FILE_REDIRECT)) {
188
+ const before = match[1] ?? '';
189
+ const op = match[2] ?? '';
190
+ const space = match[3] ?? '';
191
+ const single = match[4];
192
+ const double = match[5];
193
+ const target = single ?? double ?? match[6] ?? '';
194
+ // A `>` written inside a quoted value is that value's own text.
195
+ if (insideWord(offset + (match.index ?? 0) + before.length, words))
196
+ continue;
197
+ // `/dev/null` and friends are not a report to preserve; leaving them keeps the re-run silent
198
+ // the way the run was, where rewriting them would create a file nobody asked for.
199
+ if (!target || DEVICE_TARGET.test(target))
200
+ continue;
201
+ // A descriptor (`>&2`) or a process substitution (`> >(tee …)`) is no file either.
202
+ if (target.startsWith('&') || target.startsWith('(') || /^\d+$/.test(target))
203
+ continue;
204
+ const quote = single !== undefined || double !== undefined ? 1 : 0;
205
+ const start = offset + (match.index ?? 0) + before.length + op.length + space.length + quote;
206
+ edits.push({ start, end: start + target.length, text: `${target}.rerun.log` });
207
+ }
208
+ return edits;
209
+ }
210
+ /**
211
+ * The file arguments of a `tee` stage, as edits that point them at a fresh sibling.
212
+ *
213
+ * A pipeline the suite feeds (`… 2>&1 | tee /tmp/full.log`) writes the run's own stream to the
214
+ * files `tee` names, so a re-run through the same pipeline would overwrite the walk's report
215
+ * exactly the way its own `> <file>` redirect would ({@link freshRedirectEdits}). A stage that
216
+ * names no file, reads a device or carries flags keeps those words as written.
217
+ *
218
+ * @param statement - The stage's text.
219
+ * @param offset - The stage's offset in the command.
220
+ * @returns The edits, in stage order.
221
+ */
222
+ function freshTeeEdits(statement, offset) {
223
+ const words = [...statement.matchAll(ARGUMENT_WORD)].map((match) => ({
224
+ text: match[0],
225
+ start: offset + (match.index ?? 0),
226
+ }));
227
+ const program = words.findIndex((word) => unquoted(word.text).replace(/\/+$/, '').split('/').at(-1) === 'tee');
228
+ if (program < 0)
229
+ return [];
230
+ const edits = [];
231
+ for (const word of words.slice(program + 1)) {
232
+ const bare = unquoted(word.text);
233
+ if (!bare || bare.startsWith('-') || DEVICE_TARGET.test(bare))
234
+ continue;
235
+ const quote = /^['"]/.test(word.text) ? 1 : 0;
236
+ edits.push({
237
+ start: word.start + quote,
238
+ end: word.start + word.text.length - quote,
239
+ text: `${bare}.rerun.log`,
240
+ });
241
+ }
242
+ return edits;
243
+ }
244
+ /**
245
+ * The statements that carry the suite run's OWN output: the Playwright statement, and every stage
246
+ * of the pipeline it feeds (`| tee /tmp/full.log | tail -5`).
247
+ *
248
+ * The parse's own spans answer this, so the setup and the tail around the run are never read as
249
+ * its output: `printf … > app/public/_redirects` writes a file BEFORE any suite starts, and
250
+ * `; echo done > /tmp/done` runs after it, whatever their redirects look like. Only a `|` joins a
251
+ * stage to the run's stream; a `;`, `&&` or newline starts a statement of its own whose output is
252
+ * not the run's ({@link redirectRunnerOutputsToFreshFiles}).
253
+ *
254
+ * @param command - The composed command.
255
+ * @returns The statements, or null when the command starts no Playwright run that can be placed.
256
+ */
257
+ function runnerOutputStatements(command) {
258
+ const located = locatedCommandSegments(command);
259
+ const at = located.findIndex((entry) => entry.segment !== null && PLAYWRIGHT_RUN.test(entry.segment.text));
260
+ if (at < 0)
261
+ return null;
262
+ const place = (entry, tee) => {
263
+ if (entry.start === null || entry.end === null)
264
+ return null;
265
+ // A statement can end on an enclosing group's closer (`( … 2>&1)`); the closer is the
266
+ // shell's, not the statement's, so it is not part of what a redirect reader may rewrite.
267
+ const end = statementBoundary(command, entry.start, entry.end)?.textEnd ?? entry.end;
268
+ return { start: entry.start, end, tee };
269
+ };
270
+ const runner = located[at];
271
+ const first = runner === undefined ? null : place(runner, false);
272
+ if (first === null)
273
+ return null;
274
+ const statements = [first];
275
+ for (let i = at + 1; i < located.length; i += 1) {
276
+ const entry = located[i];
277
+ // Only a stage of the SAME pipeline carries the run's output; anything else is the tail.
278
+ if (entry === undefined || entry.separator !== '|')
279
+ break;
280
+ const stage = place(entry, entry.segment?.program === 'tee');
281
+ if (stage !== null)
282
+ statements.push(stage);
283
+ }
284
+ return statements;
285
+ }
286
+ /**
287
+ * The command with the SUITE RUN's own log files pointed at fresh siblings, and nothing else
288
+ * changed.
132
289
  *
133
290
  * A re-run composed from a run's own command keeps the run's redirect by construction, and the
134
291
  * run wrote the walk's only report to that file: xr-molecule-flash-m173 handed over *"Send this
@@ -137,29 +294,42 @@ const DEVICE_TARGET = /^\/dev\//;
137
294
  * full walk's log, destroying the other 11 failures' error reports. Following the platform's own
138
295
  * advice must never destroy the evidence it was based on.
139
296
  *
140
- * @param command - A shell command.
141
- * @returns The command whose file redirects write to a fresh target.
297
+ * Only the run's OWN stream moves. What surrounds it is SETUP and POSTLUDE, and those writes are
298
+ * the command's meaning, not a report: xr-molecule-flash-m429 (2026-10-22) composed
299
+ * `printf '/index.html 200' > app/public/_redirects && npx playwright test specs/auth.spec.ts
300
+ * > /tmp/full.log 2>&1` with its SPA fallback written to `_redirects.rerun.log`, so the re-run
301
+ * measured an app with no fallback at all. A heredoc config, a `.env` the command writes and a
302
+ * source asset it lays down are the same shape: their targets stay byte-for-byte, and so does
303
+ * every statement chained after the run (`; echo EXIT $? > /tmp/done`).
304
+ *
305
+ * @param command - The composed command.
306
+ * @returns The command whose suite-run redirects write to a fresh target.
142
307
  */
143
- function redirectToFreshFile(command) {
144
- return command.replace(FILE_REDIRECT, (whole, before, op, space, single, double, bare) => {
145
- const target = single ?? double ?? bare ?? '';
146
- // `/dev/null` and friends are not a report to preserve; leaving them keeps the re-run silent
147
- // the way the run was, where rewriting them would create a file nobody asked for.
148
- if (!target || DEVICE_TARGET.test(target))
149
- return whole;
150
- const quote = single !== undefined ? "'" : double !== undefined ? '"' : '';
151
- return `${before}${op}${space}${quote}${target}.rerun.log${quote}`;
152
- });
308
+ function redirectRunnerOutputsToFreshFiles(command) {
309
+ const statements = runnerOutputStatements(command);
310
+ if (statements === null)
311
+ return command;
312
+ const words = wordSpans(command);
313
+ const edits = [];
314
+ for (const statement of statements) {
315
+ const text = command.slice(statement.start, statement.end);
316
+ edits.push(...freshRedirectEdits(text, statement.start, words));
317
+ if (statement.tee)
318
+ edits.push(...freshTeeEdits(text, statement.start));
319
+ }
320
+ return applyTextEdits(command, edits);
153
321
  }
154
322
  /**
155
323
  * The whole-suite command made scoped to the tests it should re-run instead: the same
156
- * invocation — same directory, same settings — with the named `file:line`s in place of the whole
157
- * suite, `--last-failed` dropped (it re-runs the tests that never ran too, X1 flash-m60) and
324
+ * invocation — same launcher, same settings — with the named `file:line`s in place of every
325
+ * positional selection the run carried (a spec file, a suite directory or a regex filter),
326
+ * `--last-failed` dropped (it re-runs the tests that never ran too, X1 flash-m60) and
158
327
  * `--retries=0` set (a re-run of a known failure does not need to pay for retries).
159
328
  *
160
329
  * The re-run keeps the run's `> <file>` redirect only in the sense of keeping its OUTPUT there:
161
- * the target is rewritten to a fresh sibling ({@link redirectToFreshFile}), so a re-run never
162
- * overwrites the log the run itself is the evidence for (xr-molecule-flash-m173).
330
+ * the target is rewritten to a fresh sibling ({@link redirectRunnerOutputsToFreshFiles}), so a
331
+ * re-run never overwrites the log the run itself is the evidence for (xr-molecule-flash-m173) —
332
+ * and the setup around the run keeps its own file writes untouched (xr-molecule-flash-m429).
163
333
  *
164
334
  * `config` is the config the run was measured under ({@link withSuiteConfig}): the narrowed re-run
165
335
  * carries it whenever the command itself does not, so a run that dropped `--config` cannot be
@@ -215,8 +385,10 @@ export function scopedRerunCommand(command, locations, excluded = [], config, cw
215
385
  // nothing — "No tests found" — so every location is rendered in a form Playwright can match
216
386
  // ({@link playwrightLocations}).
217
387
  const narrowed = playwrightLocations(locations, command, cwd);
218
- const dropped = dropSupersededSpecFiles(args, narrowed)
219
- .replace(/\s*--last-failed\b/g, '')
388
+ const dropped = dropSupersededSelections(args, narrowed)
389
+ // `--last-failed` re-runs the tests that never ran too (flash-m60); its `--last-failed-file`
390
+ // sibling only moves the file it reads and is a real option of the re-run.
391
+ .replace(/\s*--last-failed(?!-)/g, '')
220
392
  .replace(/\s*--retries(?:[= ]\d+)?/g, '');
221
393
  const scoped = command.slice(0, run.afterRunner) +
222
394
  ` ${narrowed.join(' ')} --retries=0${carry}${invert}` +
@@ -226,7 +398,7 @@ export function scopedRerunCommand(command, locations, excluded = [], config, cw
226
398
  // X1 xr-molecule-flash-m157 (+14:02) was handed a re-run that still carried the chain's second
227
399
  // whole walk — 4.5 minutes measuring code it had not changed.
228
400
  const rerunTail = suiteRunStatements(tail).length > 0 ? '' : tail;
229
- return withRunEnv(`${redirectToFreshFile(scoped)}${redirectToFreshFile(rerunTail)}`, env);
401
+ return withRunEnv(redirectRunnerOutputsToFreshFiles(`${scoped}${rerunTail}`), env);
230
402
  }
231
403
  /** A `NAME=value` word in command position, optionally behind `export`/`env`. */
232
404
  const ENV_WORD = /(^|[\s;&|(])(?:export[ \t]+|env[ \t]+)?([A-Za-z_][A-Za-z0-9_]*)=('[^']*'|"[^"]*"|[^\s;&|]+)/g;
@@ -366,33 +538,145 @@ function playwrightLocations(locations, command, cwd) {
366
538
  return `${resolved}${suffix}`;
367
539
  });
368
540
  }
369
- /** A spec-file argument Playwright accepts as its positional filter — never a flag. */
370
- const SPEC_FILE_ARGUMENT = /^(?!-)[^\s]*\.(?:spec|test)\.[cm]?[jt]sx?(?::\d+(?::\d+)?)?$/;
371
541
  /**
372
- * The runner's own arguments with every bare spec-file argument taken out once the re-run names
542
+ * Every Playwright `test` option that takes its value from the NEXT word, read from the runner's
543
+ * own option table (`playwright test --help`, Playwright 1.63 as the sandbox image ships it).
544
+ *
545
+ * A value here is never a positional selection however much it looks like a path:
546
+ * `--config playwright.config.ts` names the config the run was measured under, and dropping it
547
+ * because it ends in `.ts` would re-create m113 exactly (a re-run with no base URL).
548
+ */
549
+ const SUITE_VALUE_FLAGS = new Set([
550
+ '--add-reporter',
551
+ '--browser',
552
+ '-c',
553
+ '--config',
554
+ '--global-timeout',
555
+ '-g',
556
+ '--grep',
557
+ '-G',
558
+ '--grep-invert',
559
+ '--last-failed-file',
560
+ '--max-failures',
561
+ '--output',
562
+ '--repeat-each',
563
+ '--reporter',
564
+ '--retries',
565
+ '--run-agents',
566
+ '--shard',
567
+ '--test-list',
568
+ '--test-list-invert',
569
+ '--timeout',
570
+ '--trace',
571
+ '--tsconfig',
572
+ '--ui-host',
573
+ '--ui-port',
574
+ '--update-source-method',
575
+ '-j',
576
+ '--workers',
577
+ ]);
578
+ /**
579
+ * Options whose value is optional (`--debug [mode]`, `--only-changed [ref]`): the next word is
580
+ * theirs unless it is another flag — the reading the runner's own command line takes.
581
+ */
582
+ const SUITE_OPTIONAL_VALUE_FLAGS = new Set([
583
+ '--debug',
584
+ '--only-changed',
585
+ '-u',
586
+ '--update-snapshots',
587
+ ]);
588
+ /**
589
+ * `--project <project-name...>` takes every word up to the next flag, as the runner's own command
590
+ * line does; a project name is a selection of projects, never a positional test filter.
591
+ */
592
+ const SUITE_VARIADIC_VALUE_FLAGS = new Set(['--project']);
593
+ /** A redirect written as one word (`2>&1`, `>/tmp/out.log`): not a selection. */
594
+ const ARGUMENT_REDIRECT = /^(?:\d*|&)(?:<<<|<<-?|>>?\|?|<>|>&|<&)(?:&?\d+|-|[^\s;&|()<>]*)?$/;
595
+ /** A redirect operator whose target is the word after it (`> /tmp/out.log`). */
596
+ const ARGUMENT_REDIRECT_OPERATOR = /^(?:\d*|&)(?:<<<|<<-?|>>?\|?|<>|>&|<&)$/;
597
+ /**
598
+ * The runner's own arguments with every positional selection taken out once the re-run names
373
599
  * failure locations.
374
600
  *
375
- * The re-run is "just these": Playwright matches each positional argument against every collected
376
- * file's path, so a bare file left beside the `file:line`s re-admits ALL of that file's tests.
377
- * xr-molecule-flash-m118 (+45:24) kept the one file its 14 failures were in ("~297s" for a file and
378
- * fourteen duplicates); xr-molecule-flash-m134 (+20:0x) kept all four files of a run whose 8
379
- * failures sat in two of them — 32 tests, ~3 min, instead of the 8 failures' ~30 s. A file with no
380
- * failure in it has nothing to re-run, so it goes too.
601
+ * The re-run is "just these", and Playwright OR-s every positional argument into one selection:
602
+ * ANY leftover positional re-admits tests the re-run is supposed to skip. A bare spec file
603
+ * re-admits all of that file's tests (xr-molecule-flash-m118 (+45:24) ~297 s for one file and
604
+ * fourteen duplicates; xr-molecule-flash-m134 (+20:0x) 32 tests instead of 8). A suite DIRECTORY
605
+ * is the same argument and re-admits the WHOLE walk even beside fourteen exact `file:line`s —
606
+ * xr-molecule-flash-m428's suggested "Re-run just these" kept
607
+ * `/workspace/fixtures/realworld/specs/e2e` after `--config playwright.config.ts`, so the command
608
+ * said 14 locations and selected every spec again. A regex positional filter selects files the
609
+ * same way and goes too.
610
+ *
611
+ * What is NOT a selection survives byte-for-byte: every option and its value — whatever it looks
612
+ * like (`--config playwright.config.ts`, `--output test-results`, `--grep 'a|b'`, a `--project`
613
+ * list) — and every redirect. Quoting and spacing survive because the result is a span splice on
614
+ * the raw text, never a rebuild from words.
381
615
  *
382
- * The launcher's words are not arguments and are not here: the caller passes what follows
383
- * `playwright test` ({@link playwrightStatement}'s `afterRunner`), so `node <path>/playwright
384
- * test` and `npx playwright test` lose the same spec files.
616
+ * An empty `locations` list keeps the original selection untouched:
617
+ * {@link scopedRerunCommand} is not narrowing anything then.
385
618
  *
386
619
  * @param args - The run's own arguments, after `playwright test`.
387
620
  * @param locations - The failing `file:line`s the re-run names.
388
- * @returns The arguments without their bare spec-file arguments.
621
+ * @returns The arguments without their positional selections.
389
622
  */
390
- function dropSupersededSpecFiles(args, locations) {
623
+ function dropSupersededSelections(args, locations) {
391
624
  if (locations.length === 0)
392
625
  return args;
393
- return args.replace(/(^|\s+)([^\s]+)(?=\s|$)/g, (whole, _space, token) => {
394
- return SPEC_FILE_ARGUMENT.test(token) ? '' : whole;
395
- });
626
+ const words = [];
627
+ for (const match of args.matchAll(ARGUMENT_WORD))
628
+ words.push({ text: match[0], start: match.index ?? 0 });
629
+ const dropped = new Array(words.length).fill(false);
630
+ let at = 0;
631
+ while (at < words.length) {
632
+ const word = words[at]?.text ?? '';
633
+ if (ARGUMENT_REDIRECT_OPERATOR.test(word)) {
634
+ // The operator and the target after it are one redirect, not two words to judge.
635
+ at += 2;
636
+ continue;
637
+ }
638
+ if (ARGUMENT_REDIRECT.test(word)) {
639
+ at += 1;
640
+ continue;
641
+ }
642
+ if (word.startsWith('-') && word !== '-') {
643
+ // `--flag=value` carries its value inside the same word; only the flag's own name is read.
644
+ if (word.includes('=')) {
645
+ at += 1;
646
+ continue;
647
+ }
648
+ if (SUITE_OPTIONAL_VALUE_FLAGS.has(word)) {
649
+ const next = words[at + 1]?.text;
650
+ at += next !== undefined && !next.startsWith('-') ? 2 : 1;
651
+ continue;
652
+ }
653
+ if (SUITE_VARIADIC_VALUE_FLAGS.has(word)) {
654
+ at += 1;
655
+ while (at < words.length && !(words[at]?.text ?? '').startsWith('-'))
656
+ at += 1;
657
+ continue;
658
+ }
659
+ at += SUITE_VALUE_FLAGS.has(word) ? 2 : 1;
660
+ continue;
661
+ }
662
+ // A bare word — a spec file, a directory or a regex filter — is a positional selection.
663
+ dropped[at] = true;
664
+ at += 1;
665
+ }
666
+ let out = '';
667
+ let cursor = 0;
668
+ for (let i = 0; i < words.length; i += 1) {
669
+ const word = words[i];
670
+ if (word === undefined || !dropped[i])
671
+ continue;
672
+ // The whitespace in front of the word goes with it, so the result is not left double-spaced.
673
+ let start = word.start;
674
+ while (start > cursor && /\s/.test(args[start - 1] ?? ''))
675
+ start -= 1;
676
+ out += args.slice(cursor, start);
677
+ cursor = word.start + word.text.length;
678
+ }
679
+ return out + args.slice(cursor);
396
680
  }
397
681
  /**
398
682
  * The run in flight that makes a second run a hazard, or null when nothing is in the way.
@@ -1491,7 +1491,9 @@ export declare const PARSE_CHECKABLE: RegExp;
1491
1491
  /**
1492
1492
  * The shell command that parses one file and exits non-zero with the error
1493
1493
  * when it does not parse: `node --check` for JavaScript, `JSON.parse` for
1494
- * JSON, esbuild's transform (present wherever Vite is) for TypeScript.
1494
+ * ordinary JSON, TypeScript's config parser for `tsconfig`/`jsconfig` files
1495
+ * (which are JSONC), esbuild's transform (present wherever Vite is) for
1496
+ * TypeScript.
1495
1497
  *
1496
1498
  * @param path - The file's absolute path.
1497
1499
  * @returns The command, or null when the file type has no cheap parser.
@@ -1 +1 @@
1
- {"version":3,"file":"utilities.d.ts","sourceRoot":"","sources":["../src/utilities.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAaH,OAAO,EAAsB,KAAK,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAG3E,OAAO,EACL,KAAK,mBAAmB,EAExB,KAAK,aAAa,EAMnB,MAAM,oBAAoB,CAAA;AAE3B;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAS5C;AAED;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,GAAI,GAAG,MAAM,KAAG,MAEE,CAAA;AAuGhD;;;;;;;;;;;GAWG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAK/C;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAErD;AAaD;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAKhF;AAgFD;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAEzD;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAE7D;AAyFD;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,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-4257,10 +4257,20 @@ export function whitespaceTolerantReplace(content, oldString, newString) {
4257
4257
  }
4258
4258
  /** Files a parse check can vouch for cheaply right after a write. */
4259
4259
  export const PARSE_CHECKABLE = /\.(m?js|cjs|jsx|ts|tsx|mts|cts|json)$/;
4260
+ /**
4261
+ * Basenames TypeScript reads as JSONC: `tsconfig.json`, `tsconfig.*.json` and
4262
+ * the `jsconfig` counterparts. Comments and trailing commas are legal there —
4263
+ * `tsc` accepts them — so a strict `JSON.parse` reports a valid project config
4264
+ * as broken (X0 flash-m436: a commented `tsconfig.conduit-suite.json` was
4265
+ * answered with "every build and test fails until it does").
4266
+ */
4267
+ const TYPESCRIPT_CONFIG = /^(?:ts|js)config(?:\.[^/\\]+)?\.json$/;
4260
4268
  /**
4261
4269
  * The shell command that parses one file and exits non-zero with the error
4262
4270
  * when it does not parse: `node --check` for JavaScript, `JSON.parse` for
4263
- * JSON, esbuild's transform (present wherever Vite is) for TypeScript.
4271
+ * ordinary JSON, TypeScript's config parser for `tsconfig`/`jsconfig` files
4272
+ * (which are JSONC), esbuild's transform (present wherever Vite is) for
4273
+ * TypeScript.
4264
4274
  *
4265
4275
  * @param path - The file's absolute path.
4266
4276
  * @returns The command, or null when the file type has no cheap parser.
@@ -4271,6 +4281,19 @@ export function parseCheckCommand(path) {
4271
4281
  const q = shellQuote(path);
4272
4282
  if (/\.(m?js|cjs)$/.test(path))
4273
4283
  return `node --check ${q}`;
4284
+ if (TYPESCRIPT_CONFIG.test(path.slice(path.lastIndexOf('/') + 1)))
4285
+ // Parsing only: `parseConfigFileTextToJson` reads the text as JSONC and
4286
+ // does not resolve `extends` or inspect the files a config points at, so a
4287
+ // missing input file is not a syntax error here. A missing `typescript`
4288
+ // package reports `Cannot find module`, which parseCheckProblem treats as
4289
+ // "no parser", never as broken syntax.
4290
+ return (`node -e "const p=process.argv[1];const src=require('fs').readFileSync(p,'utf8');` +
4291
+ `const ts=require('typescript');const r=ts.parseConfigFileTextToJson(p,src);` +
4292
+ `if(r.error){const d=r.error;const at=d.start||0;const before=src.slice(0,at);` +
4293
+ `const nl=String.fromCharCode(10);const lines=src.split(nl);` +
4294
+ `const line=before.split(nl).length;const col=at-before.lastIndexOf(nl);` +
4295
+ `const shown=(lines[line-1]||'').slice(0,240);` +
4296
+ `console.error(line+':'+col+': '+ts.flattenDiagnosticMessageText(d.messageText,' ')+nl+shown+nl+' '.repeat(Math.min(col-1,240))+'^');process.exit(1)}" ${q}`);
4274
4297
  if (/\.json$/.test(path))
4275
4298
  return `node -e "JSON.parse(require('fs').readFileSync(process.argv[1],'utf8'))" ${q}`;
4276
4299
  // On failure print `line:column: message`, the offending source line and a
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@molecule/api-ai-tools",
3
- "version": "1.13.0",
3
+ "version": "1.13.1",
4
4
  "description": "Shared AI agent tools with backend abstraction for sandbox and local execution",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",