@molecule/api-ai-tools 1.14.6 → 1.14.9

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-26T04:22:08.815Z
6
+ Generated: 2026-10-29T00:17:56.663Z
7
7
  -->
8
8
 
9
9
  # @molecule/api-ai-tools
@@ -384,7 +384,7 @@ interface PlaywrightReportAttachment {
384
384
  name: string
385
385
  /** Its media type, when the runner recorded one. */
386
386
  contentType: string | null
387
- /** Where the runner saved it, as the report wrote the path. */
387
+ /** This attempt's published artifact path; a per-call copy when retention succeeded. */
388
388
  path: string
389
389
  }
390
390
  ```
@@ -454,6 +454,14 @@ A reader that needs evidence this record does not carry reads {@link path} in th
454
454
 
455
455
  ```typescript
456
456
  interface PlaywrightRunReport {
457
+ /** Whether the published attachment paths were retained outside the runner's mutable output. */
458
+ artifactRetention?: {
459
+ status: 'retained' | 'partial' | 'unavailable'
460
+ omittedAttachments: number
461
+ bytes: number
462
+ /** The per-call snapshot root for readers of the retained trace tree. */
463
+ directory?: string
464
+ }
457
465
  /** How much of the report was read — see {@link PlaywrightReportStatus}. */
458
466
  status: PlaywrightReportStatus
459
467
  /** Where the report file is, for the full evidence. Always the runner's own file. */
@@ -2816,6 +2824,27 @@ function withRunEnv(command: string, settings?: readonly RunEnvSetting[]): strin
2816
2824
 
2817
2825
  **Returns:** The command, or the command unchanged when it already carries every setting.
2818
2826
 
2827
+ #### `resolvePlaywrightSelectionPaths(command, cwd)`
2828
+
2829
+ Resolve literal `./`/`../` Playwright file selections against the runner's own directory.
2830
+
2831
+ Playwright treats every positional selection as a regular expression matched against each
2832
+ collected test's ABSOLUTE path. A location copied from its reporter (`../checks/smoke.spec.ts:9`)
2833
+ therefore collects nothing even though that path exists relative to the shell. Resolving a
2834
+ literal path also escapes its regex metacharacters and shell-quotes the result: `+` and `.`
2835
+ must match themselves, and the shell must pass the whole filter as one argument. Option values,
2836
+ redirects, regex selections, absolute paths, and commands whose directory cannot be known stay
2837
+ byte-for-byte unchanged.
2838
+
2839
+ ```typescript
2840
+ function resolvePlaywrightSelectionPaths(command: string, cwd?: string | null): string
2841
+ ```
2842
+
2843
+ - `command` — The command that invokes Playwright.
2844
+ - `cwd` — The tool's working directory, used when the command has no absolute `cd`.
2845
+
2846
+ **Returns:** The command with only its literal dot-relative positional selections resolved.
2847
+
2819
2848
  #### `suiteRunInTheWay(candidate, inFlight)`
2820
2849
 
2821
2850
  The run in flight that makes a second run a hazard, or null when nothing is in the way.
@@ -2942,6 +2971,27 @@ function createDeferredToolCatalog(options: DeferredToolCatalogOptions): Deferre
2942
2971
 
2943
2972
  **Returns:** A loader tool and the current provider-facing selection.
2944
2973
 
2974
+ #### `readPlaywrightRunReport(backend, path, sanitize)`
2975
+
2976
+ One report file's bounded facts and retained native attachments, or honest omissions.
2977
+
2978
+ A report that is not there is NOT "the run failed nothing": `summarizePlaywrightReport` answers
2979
+ `missing`, and every reader treats that as no machine data rather than as a clean run.
2980
+
2981
+ ```typescript
2982
+ function readPlaywrightRunReport(
2983
+ backend: Pick<ExecutionBackend, 'readFile' | 'run'>,
2984
+ path: string,
2985
+ sanitize: (text: string) => string,
2986
+ ): Promise<PlaywrightRunReport>
2987
+ ```
2988
+
2989
+ - `backend` — The project's execution backend.
2990
+ - `path` — The report file's absolute path (`/tmp/…`).
2991
+ - `sanitize` — The consumer's redactor for the error text the record carries.
2992
+
2993
+ **Returns:** The bounded record with per-call attachment copies; never a verdict.
2994
+
2945
2995
  #### `taskStopCommand(backend, taskId)`
2946
2996
 
2947
2997
  The command that stops a running background task, read from the sandbox's own pid files.
@@ -3903,7 +3953,7 @@ function checkBlockedCommand(command: string): string | null
3903
3953
 
3904
3954
  #### `resolvePath(path, projectRoot)`
3905
3955
 
3906
- Normalize a path to be absolute within the project root.
3956
+ Normalize the project root and resolve a path absolutely within it.
3907
3957
  Empty string and '/' both resolve to projectRoot.
3908
3958
  Rejects paths that escape via traversal or absolute paths outside root.
3909
3959
 
@@ -3918,7 +3968,7 @@ function resolvePath(path: string, projectRoot: string): string
3918
3968
 
3919
3969
  #### `isOutsideRoot(path, projectRoot)`
3920
3970
 
3921
- Whether a tool path points outside the project root once normalized (an
3971
+ Whether a tool path points outside the normalized project root (an
3922
3972
  absolute path elsewhere, or a `..` that climbs out). {@link resolvePath}
3923
3973
  clamps such a path to the root; a file tool must refuse it instead of
3924
3974
  answering about the root — a `list_files /tmp/x` used to return the
@@ -14,7 +14,9 @@
14
14
  * per-run file with the reporter's own `PLAYWRIGHT_JSON_OUTPUT_FILE` option, and this module turns
15
15
  * that file into a small, bounded record on the tool result ({@link PlaywrightRunReport}). The
16
16
  * whole file stays where it was written, so full evidence has a path; the record carries only what
17
- * a diagnosis needs.
17
+ * a diagnosis needs. Before publication, execution tools retain bounded attachment copies beside
18
+ * the call's report. Later native runs may clean their output without invalidating these paths;
19
+ * `artifactRetention` reports omitted or unavailable copies honestly.
18
20
  *
19
21
  * Honesty rules, which every reader below follows:
20
22
  *
@@ -69,7 +71,7 @@ export interface PlaywrightReportAttachment {
69
71
  name: string;
70
72
  /** Its media type, when the runner recorded one. */
71
73
  contentType: string | null;
72
- /** Where the runner saved it, as the report wrote the path. */
74
+ /** This attempt's published artifact path; a per-call copy when retention succeeded. */
73
75
  path: string;
74
76
  }
75
77
  /**
@@ -125,6 +127,14 @@ export interface PlaywrightReportStats {
125
127
  * A reader that needs evidence this record does not carry reads {@link path} in the sandbox.
126
128
  */
127
129
  export interface PlaywrightRunReport {
130
+ /** Whether the published attachment paths were retained outside the runner's mutable output. */
131
+ artifactRetention?: {
132
+ status: 'retained' | 'partial' | 'unavailable';
133
+ omittedAttachments: number;
134
+ bytes: number;
135
+ /** The per-call snapshot root for readers of the retained trace tree. */
136
+ directory?: string;
137
+ };
128
138
  /** How much of the report was read — see {@link PlaywrightReportStatus}. */
129
139
  status: PlaywrightReportStatus;
130
140
  /** Where the report file is, for the full evidence. Always the runner's own file. */
@@ -1 +1 @@
1
- {"version":3,"file":"playwright-report.d.ts","sourceRoot":"","sources":["../src/playwright-report.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAIH;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,gCAAgC,CAAA;AAElE,kFAAkF;AAClF,eAAO,MAAM,wBAAwB,qBAAqB,CAAA;AAE1D;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,UAAY,CAAA;AAE/C,8FAA8F;AAC9F,eAAO,MAAM,qBAAqB,KAAK,CAAA;AAEvC,iFAAiF;AACjF,eAAO,MAAM,wBAAwB,IAAI,CAAA;AAEzC,iEAAiE;AACjE,eAAO,MAAM,wBAAwB,MAAM,CAAA;AAe3C;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,sBAAsB,GAAG,UAAU,GAAG,SAAS,GAAG,WAAW,GAAG,SAAS,CAAA;AAErF,4EAA4E;AAC5E,MAAM,WAAW,0BAA0B;IACzC,wDAAwD;IACxD,IAAI,EAAE,MAAM,CAAA;IACZ,oDAAoD;IACpD,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,+DAA+D;IAC/D,IAAI,EAAE,MAAM,CAAA;CACb;AAED;;;;;GAKG;AACH,MAAM,WAAW,oBAAoB;IACnC,yDAAyD;IACzD,EAAE,EAAE,MAAM,GAAG,IAAI,CAAA;IACjB,8CAA8C;IAC9C,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB,sFAAsF;IACtF,IAAI,EAAE,MAAM,CAAA;IACZ,mCAAmC;IACnC,IAAI,EAAE,MAAM,CAAA;IACZ,qCAAqC;IACrC,MAAM,EAAE,MAAM,CAAA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sBAAsB,CAAA;IAC9B,qFAAqF;IACrF,IAAI,EAAE,MAAM,CAAA;IACZ,8EAA8E;IAC9E,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,qEAAqE;IACrE,KAAK,EAAE,qBAAqB,GAAG,IAAI,CAAA;IACnC,8FAA8F;IAC9F,QAAQ,EAAE,oBAAoB,EAAE,CAAA;IAChC,0DAA0D;IAC1D,eAAe,EAAE,MAAM,CAAA;CACxB;AAiCD;;;;;;;;;GASG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,sBAAsB,GAAG,OAAO,CAE/E;AA+BD;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,oBAAoB,GAAG,MAAM,EAAE,CAE9E;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,oBAAoB,GAAG,MAAM,GAAG,IAAI,CAG/E;AAmHD;;;;;;;;;;;GAWG;AACH,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAA;CAAE,GAC7D,mBAAmB,CA8GrB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAKpF;AAED;;;;;;;;;GASG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAE9D"}
@@ -14,7 +14,9 @@
14
14
  * per-run file with the reporter's own `PLAYWRIGHT_JSON_OUTPUT_FILE` option, and this module turns
15
15
  * that file into a small, bounded record on the tool result ({@link PlaywrightRunReport}). The
16
16
  * whole file stays where it was written, so full evidence has a path; the record carries only what
17
- * a diagnosis needs.
17
+ * a diagnosis needs. Before publication, execution tools retain bounded attachment copies beside
18
+ * the call's report. Later native runs may clean their output without invalidating these paths;
19
+ * `artifactRetention` reports omitted or unavailable copies honestly.
18
20
  *
19
21
  * Honesty rules, which every reader below follows:
20
22
  *
@@ -0,0 +1,19 @@
1
+ /** Keep a published run's bounded native attachments independent of later runner cleanup. */
2
+ import type { PlaywrightRunReport } from './playwright-report.js';
3
+ import type { ExecutionBackend } from './types.js';
4
+ /** A single attachment larger than this is reported unavailable instead of copied. */
5
+ export declare const MAX_RETAINED_ATTACHMENT_BYTES: number;
6
+ /** The total copied bytes for one published report. */
7
+ export declare const MAX_RETAINED_RUN_BYTES: number;
8
+ /**
9
+ * Copy only the bounded files the report names into its own per-call scratch directory.
10
+ * Native commands, configs and custom output directories are untouched. Missing, changed,
11
+ * oversized or unsupported files lose their references rather than point at mutable evidence.
12
+ * The derived record lives beside the call's existing report/log files and survives recollection.
13
+ *
14
+ * @param backend - The existing sandbox/local execution bond.
15
+ * @param report - This call's normalized, redacted machine report.
16
+ * @returns The same verdict/counts, with retained attachment paths or honest omissions.
17
+ */
18
+ export declare function retainPlaywrightArtifacts(backend: Pick<ExecutionBackend, 'run'>, report: PlaywrightRunReport): Promise<PlaywrightRunReport>;
19
+ //# sourceMappingURL=report-attachment-retention.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"report-attachment-retention.d.ts","sourceRoot":"","sources":["../src/report-attachment-retention.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAC7F,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAA;AACjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAElD,sFAAsF;AACtF,eAAO,MAAM,6BAA6B,QAAmB,CAAA;AAC7D,uDAAuD;AACvD,eAAO,MAAM,sBAAsB,QAAoB,CAAA;AAuDvD;;;;;;;;;GASG;AACH,wBAAsB,yBAAyB,CAC7C,OAAO,EAAE,IAAI,CAAC,gBAAgB,EAAE,KAAK,CAAC,EACtC,MAAM,EAAE,mBAAmB,GAC1B,OAAO,CAAC,mBAAmB,CAAC,CAkD9B"}
@@ -0,0 +1,107 @@
1
+ /** A single attachment larger than this is reported unavailable instead of copied. */
2
+ export const MAX_RETAINED_ATTACHMENT_BYTES = 32 * 1024 * 1024;
3
+ /** The total copied bytes for one published report. */
4
+ export const MAX_RETAINED_RUN_BYTES = 128 * 1024 * 1024;
5
+ const COPY = String.raw `
6
+ const fs=require('node:fs'),path=require('node:path'),crypto=require('node:crypto');
7
+ const input=JSON.parse(Buffer.from(process.argv[1],'base64').toString('utf8'));
8
+ const digest=crypto.createHash('sha256').update(JSON.stringify(input.report)).digest('hex');
9
+ const cache=input.report.path+'.attachments-'+digest+'.json';
10
+ function previous(){
11
+ const value=JSON.parse(fs.readFileSync(cache,'utf8'));
12
+ if(value.schema!==1||value.report.path!==input.report.path)throw Error('invalid artifact record');
13
+ return value.report;
14
+ }
15
+ if(fs.existsSync(cache)){process.stdout.write(JSON.stringify(previous()));process.exit(0)}
16
+ const directory=fs.mkdtempSync(input.report.path+'.attachments-');
17
+ let bytes=0,omitted=0;
18
+ const report=input.report;
19
+ try{
20
+ for(let i=0;i<report.failures.length;i++){
21
+ const test=report.failures[i],kept=[];
22
+ for(let j=0;j<test.attachments.length;j++){
23
+ const attachment=test.attachments[j];
24
+ let destination;
25
+ try{
26
+ if(!path.isAbsolute(attachment.path))throw Error('relative attachment');
27
+ const before=fs.lstatSync(attachment.path);
28
+ if(!before.isFile()||before.size>input.single||bytes+before.size>input.total)throw Error('artifact unavailable or over budget');
29
+ const folder=path.join(directory,String(i));fs.mkdirSync(folder,{recursive:true,mode:0o700});
30
+ let name=path.basename(attachment.path);
31
+ if(name.length>100)name=crypto.createHash('sha256').update(name).digest('hex').slice(0,16)+path.extname(name).slice(0,12);
32
+ destination=path.join(folder,name);
33
+ if(fs.existsSync(destination))destination=path.join(folder,String(j)+'-'+name);
34
+ fs.copyFileSync(attachment.path,destination,fs.constants.COPYFILE_EXCL);
35
+ const after=fs.lstatSync(attachment.path);
36
+ if(before.ino!==after.ino||before.size!==after.size||before.mtimeMs!==after.mtimeMs)throw Error('artifact changed while copying');
37
+ fs.utimesSync(destination,before.atimeMs/1000,before.mtimeMs/1000);
38
+ fs.chmodSync(destination,0o400);bytes+=before.size;
39
+ kept.push({...attachment,path:destination});
40
+ }catch(error){if(destination)fs.rmSync(destination,{force:true});omitted++}
41
+ }
42
+ test.attachments=kept;
43
+ }
44
+ report.artifactRetention={status:omitted?'partial':'retained',directory,omittedAttachments:omitted,bytes};
45
+ const temporary=path.join(directory,'record.json');
46
+ fs.writeFileSync(temporary,JSON.stringify({schema:1,report}),{mode:0o600,flag:'wx'});
47
+ try{fs.linkSync(temporary,cache)}catch(error){
48
+ if(error.code!=='EEXIST')throw error;
49
+ const winner=previous();fs.rmSync(directory,{recursive:true,force:true});
50
+ process.stdout.write(JSON.stringify(winner));process.exit(0);
51
+ }
52
+ fs.rmSync(temporary);process.stdout.write(JSON.stringify(report));
53
+ }catch(error){fs.rmSync(directory,{recursive:true,force:true});throw error}
54
+ `;
55
+ const quote = (value) => `'${value.replace(/'/g, "'\\''")}'`;
56
+ /**
57
+ * Copy only the bounded files the report names into its own per-call scratch directory.
58
+ * Native commands, configs and custom output directories are untouched. Missing, changed,
59
+ * oversized or unsupported files lose their references rather than point at mutable evidence.
60
+ * The derived record lives beside the call's existing report/log files and survives recollection.
61
+ *
62
+ * @param backend - The existing sandbox/local execution bond.
63
+ * @param report - This call's normalized, redacted machine report.
64
+ * @returns The same verdict/counts, with retained attachment paths or honest omissions.
65
+ */
66
+ export async function retainPlaywrightArtifacts(backend, report) {
67
+ if (!report.failures.some((test) => test.attachments.length > 0))
68
+ return report;
69
+ const unavailable = () => ({
70
+ ...report,
71
+ failures: report.failures.map((test) => ({ ...test, attachments: [] })),
72
+ artifactRetention: {
73
+ status: 'unavailable',
74
+ omittedAttachments: report.failures.reduce((count, test) => count + test.attachments.length, 0),
75
+ bytes: 0,
76
+ },
77
+ });
78
+ try {
79
+ const input = Buffer.from(JSON.stringify({
80
+ report,
81
+ single: MAX_RETAINED_ATTACHMENT_BYTES,
82
+ total: MAX_RETAINED_RUN_BYTES,
83
+ })).toString('base64');
84
+ const result = await backend.run(`node -e ${quote(COPY)} ${quote(input)}`, {
85
+ timeout: 10_000,
86
+ budgetMs: 10_000,
87
+ });
88
+ if (result.exitCode !== 0)
89
+ return unavailable();
90
+ const retained = JSON.parse(result.stdout);
91
+ const directory = retained.artifactRetention?.directory;
92
+ const prefix = report.path + '.attachments-';
93
+ if (retained.path !== report.path ||
94
+ !Array.isArray(retained.failures) ||
95
+ typeof directory !== 'string' ||
96
+ !directory.startsWith(prefix) ||
97
+ !/^[A-Za-z0-9]{6}$/.test(directory.slice(prefix.length)) ||
98
+ retained.failures.some((test) => !Array.isArray(test.attachments) ||
99
+ test.attachments.some((item) => !item.path.startsWith(directory + '/') || item.path.split('/').includes('..'))))
100
+ return unavailable();
101
+ return retained;
102
+ }
103
+ catch (_error) {
104
+ // Retention is optional evidence; a failed copy never publishes mutable fallback paths.
105
+ return unavailable();
106
+ }
107
+ }
@@ -147,6 +147,22 @@ export interface RunEnvSetting {
147
147
  * @returns The command, or the command unchanged when it already carries every setting.
148
148
  */
149
149
  export declare function withRunEnv(command: string, settings?: readonly RunEnvSetting[]): string;
150
+ /**
151
+ * Resolve literal `./`/`../` Playwright file selections against the runner's own directory.
152
+ *
153
+ * Playwright treats every positional selection as a regular expression matched against each
154
+ * collected test's ABSOLUTE path. A location copied from its reporter (`../checks/smoke.spec.ts:9`)
155
+ * therefore collects nothing even though that path exists relative to the shell. Resolving a
156
+ * literal path also escapes its regex metacharacters and shell-quotes the result: `+` and `.`
157
+ * must match themselves, and the shell must pass the whole filter as one argument. Option values,
158
+ * redirects, regex selections, absolute paths, and commands whose directory cannot be known stay
159
+ * byte-for-byte unchanged.
160
+ *
161
+ * @param command - The command that invokes Playwright.
162
+ * @param cwd - The tool's working directory, used when the command has no absolute `cd`.
163
+ * @returns The command with only its literal dot-relative positional selections resolved.
164
+ */
165
+ export declare function resolvePlaywrightSelectionPaths(command: string, cwd?: string | null): string;
150
166
  /**
151
167
  * One suite run, as the rule that decides whether a second may start beside it reads it.
152
168
  *
@@ -1 +1 @@
1
- {"version":3,"file":"suite-overlap.d.ts","sourceRoot":"","sources":["../src/suite-overlap.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAaH;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEvD;AAED;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAoB1D;AAKD;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAEzD;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,CAS1F;AA2VD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,SAAS,MAAM,EAAE,EAC5B,QAAQ,GAAE,SAAS,MAAM,EAAO,EAChC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,EACtB,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,EACnB,GAAG,GAAE,SAAS,aAAa,EAAO,EAClC,OAAO,GAAE;IAAE,aAAa,CAAC,EAAE,OAAO,CAAA;CAAO,GACxC,MAAM,CA2DR;AAED,4DAA4D;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,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AE,MAAM,CAAA;CAAE,EAC7B,QAAQ,EAAE,SAAS,CAAC,EAAE,GACrB,CAAC,GAAG,IAAI,CAMV;AAqHD;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,kBAAkB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IACtC;;;;;;;;;;;;;OAaG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,cAAc,EAAE,OAAO,MAA4D,CAAA;AAEhG;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAM7D;AAmCD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,mBAAmB,GAAG,OAAO,CA2BtF"}
@@ -733,8 +733,7 @@ const ARGUMENT_REDIRECT = /^(?:\d*|&)(?:<<<|<<-?|>>?\|?|<>|>&|<&)(?:&?\d+|-|[^\s
733
733
  /** A redirect operator whose target is the word after it (`> /tmp/out.log`). */
734
734
  const ARGUMENT_REDIRECT_OPERATOR = /^(?:\d*|&)(?:<<<|<<-?|>>?\|?|<>|>&|<&)$/;
735
735
  /**
736
- * The runner's own arguments with every positional selection taken out once the re-run names
737
- * failure locations.
736
+ * Rewrite positional test selections while preserving the other runner arguments.
738
737
  *
739
738
  * The re-run is "just these", and Playwright OR-s every positional argument into one selection:
740
739
  * ANY leftover positional re-admits tests the re-run is supposed to skip. A bare spec file
@@ -751,20 +750,17 @@ const ARGUMENT_REDIRECT_OPERATOR = /^(?:\d*|&)(?:<<<|<<-?|>>?\|?|<>|>&|<&)$/;
751
750
  * list) — and every redirect. Quoting and spacing survive because the result is a span splice on
752
751
  * the raw text, never a rebuild from words.
753
752
  *
754
- * An empty `locations` list keeps the original selection untouched:
755
- * {@link scopedRerunCommand} is not narrowing anything then.
753
+ * The caller can replace each selection or return null to remove it.
756
754
  *
757
755
  * @param args - The run's own arguments, after `playwright test`.
758
- * @param locations - The failing `file:line`s the re-run names.
759
- * @returns The arguments without their positional selections.
756
+ * @param rewrite - Return a replacement for a positional word, or null to remove it.
757
+ * @returns The rewritten runner arguments.
760
758
  */
761
- function dropSupersededSelections(args, locations) {
762
- if (locations.length === 0)
763
- return args;
759
+ function rewritePositionalSelections(args, rewrite) {
764
760
  const words = [];
765
761
  for (const match of args.matchAll(ARGUMENT_WORD))
766
762
  words.push({ text: match[0], start: match.index ?? 0 });
767
- const dropped = new Array(words.length).fill(false);
763
+ const edits = new Map();
768
764
  let at = 0;
769
765
  while (at < words.length) {
770
766
  const word = words[at]?.text ?? '';
@@ -798,24 +794,76 @@ function dropSupersededSelections(args, locations) {
798
794
  continue;
799
795
  }
800
796
  // A bare word — a spec file, a directory or a regex filter — is a positional selection.
801
- dropped[at] = true;
797
+ edits.set(at, rewrite(word));
802
798
  at += 1;
803
799
  }
804
800
  let out = '';
805
801
  let cursor = 0;
806
802
  for (let i = 0; i < words.length; i += 1) {
807
803
  const word = words[i];
808
- if (word === undefined || !dropped[i])
804
+ if (word === undefined || !edits.has(i))
809
805
  continue;
810
- // The whitespace in front of the word goes with it, so the result is not left double-spaced.
806
+ const replacement = edits.get(i) ?? null;
811
807
  let start = word.start;
812
- while (start > cursor && /\s/.test(args[start - 1] ?? ''))
813
- start -= 1;
808
+ // A dropped word takes the whitespace in front of it, so the result is not left double-spaced.
809
+ if (replacement === null)
810
+ while (start > cursor && /\s/.test(args[start - 1] ?? ''))
811
+ start -= 1;
814
812
  out += args.slice(cursor, start);
813
+ if (replacement !== null)
814
+ out += replacement;
815
815
  cursor = word.start + word.text.length;
816
816
  }
817
817
  return out + args.slice(cursor);
818
818
  }
819
+ /**
820
+ * Remove positional selections when explicit failure locations replace them.
821
+ *
822
+ * @param args - The runner's arguments.
823
+ * @param locations - The replacement failure locations.
824
+ * @returns The arguments without superseded positional selections.
825
+ */
826
+ function dropSupersededSelections(args, locations) {
827
+ if (locations.length === 0)
828
+ return args;
829
+ return rewritePositionalSelections(args, () => null);
830
+ }
831
+ /** A dot-relative literal path, not a regular-expression selection or a dynamic shell word. */
832
+ const DOT_RELATIVE_SELECTION = /^(?:\.\.?\/)+[A-Za-z0-9_./+@-]*$/;
833
+ /** A filesystem-literal path in the regular-expression dialect Playwright uses for selections. */
834
+ const escapeRegExp = (value) => value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
835
+ /**
836
+ * Resolve literal `./`/`../` Playwright file selections against the runner's own directory.
837
+ *
838
+ * Playwright treats every positional selection as a regular expression matched against each
839
+ * collected test's ABSOLUTE path. A location copied from its reporter (`../checks/smoke.spec.ts:9`)
840
+ * therefore collects nothing even though that path exists relative to the shell. Resolving a
841
+ * literal path also escapes its regex metacharacters and shell-quotes the result: `+` and `.`
842
+ * must match themselves, and the shell must pass the whole filter as one argument. Option values,
843
+ * redirects, regex selections, absolute paths, and commands whose directory cannot be known stay
844
+ * byte-for-byte unchanged.
845
+ *
846
+ * @param command - The command that invokes Playwright.
847
+ * @param cwd - The tool's working directory, used when the command has no absolute `cd`.
848
+ * @returns The command with only its literal dot-relative positional selections resolved.
849
+ */
850
+ export function resolvePlaywrightSelectionPaths(command, cwd) {
851
+ const run = playwrightStatement(command);
852
+ if (run === null)
853
+ return command;
854
+ const base = suiteRunDirectory(command, cwd);
855
+ if (base === null)
856
+ return command;
857
+ const args = command.slice(run.afterRunner, run.end);
858
+ const resolved = rewritePositionalSelections(args, (word) => {
859
+ const raw = unquoted(word);
860
+ const [, file = raw, suffix = ''] = LOCATION_LINE.exec(raw) ?? [];
861
+ if (!DOT_RELATIVE_SELECTION.test(file))
862
+ return word;
863
+ return shellQuote(`${escapeRegExp(posix.resolve(base, file))}${suffix}`);
864
+ });
865
+ return command.slice(0, run.afterRunner) + resolved + command.slice(run.end);
866
+ }
819
867
  /**
820
868
  * The run in flight that makes a second run a hazard, or null when nothing is in the way.
821
869
  *
package/dist/tools.d.ts CHANGED
@@ -7,6 +7,19 @@
7
7
  * @module
8
8
  */
9
9
  import type { AITool } from '@molecule/api-ai';
10
+ import { type PlaywrightRunReport } from './playwright-report.js';
11
+ /**
12
+ * One report file's bounded facts and retained native attachments, or honest omissions.
13
+ *
14
+ * A report that is not there is NOT "the run failed nothing": `summarizePlaywrightReport` answers
15
+ * `missing`, and every reader treats that as no machine data rather than as a clean run.
16
+ *
17
+ * @param backend - The project's execution backend.
18
+ * @param path - The report file's absolute path (`/tmp/…`).
19
+ * @param sanitize - The consumer's redactor for the error text the record carries.
20
+ * @returns The bounded record with per-call attachment copies; never a verdict.
21
+ */
22
+ export declare function readPlaywrightRunReport(backend: Pick<ExecutionBackend, 'readFile' | 'run'>, path: string, sanitize: (text: string) => string): Promise<PlaywrightRunReport>;
10
23
  /**
11
24
  * The command that stops a running background task, read from the sandbox's own pid files.
12
25
  *
@@ -1 +1 @@
1
- {"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AA+R9C;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,eAAe,CAAC,OAAO,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAahG;AAwdD,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAkInE;;;GAGG;AACH,eAAO,MAAM,iBAAiB,QAEA,CAAA;AAE9B;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,wBAAwB,QAI6C,CAAA;AA0DlF;;;;;;;;;;;GAWG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAUhE;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,MAAM,G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;AA2GD;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,gBAAgB,EAAE,MAAM,CAAC,EAAE,eAAe,GAAG,MAAM,EAAE,CA8mGxF"}
package/dist/tools.js CHANGED
@@ -16,6 +16,7 @@ import { guardToolExecute, missingParamError, ToolInputError } from './input-nor
16
16
  import { diffLineCount } from './line-diff.js';
17
17
  import { pipelineExitCodeNote } from './pipeline-exit-note.js';
18
18
  import { commandWritesReportTo, PLAYWRIGHT_REPORT_SUFFIX, playwrightReportPathFor, summarizePlaywrightReport, } from './playwright-report.js';
19
+ import { retainPlaywrightArtifacts } from './report-attachment-retention.js';
19
20
  import { TOOL_SCHEMAS } from './schemas.js';
20
21
  import { foregroundBrowserProbe, foregroundServerCommand, SERVER_OVER_BUDGET_ADVICE, serverCommandRefusal, startsServerProgram, } from './server-command.js';
21
22
  import { leadingSleepPeek } from './sleep-peek.js';
@@ -43,7 +44,7 @@ const outputFileByTask = new Map();
43
44
  */
44
45
  const reportByTask = new Map();
45
46
  /**
46
- * One report file's bounded facts, or the honest reason there are none.
47
+ * One report file's bounded facts and retained native attachments, or honest omissions.
47
48
  *
48
49
  * A report that is not there is NOT "the run failed nothing": `summarizePlaywrightReport` answers
49
50
  * `missing`, and every reader treats that as no machine data rather than as a clean run.
@@ -51,9 +52,9 @@ const reportByTask = new Map();
51
52
  * @param backend - The project's execution backend.
52
53
  * @param path - The report file's absolute path (`/tmp/…`).
53
54
  * @param sanitize - The consumer's redactor for the error text the record carries.
54
- * @returns The bounded record; never a verdict.
55
+ * @returns The bounded record with per-call attachment copies; never a verdict.
55
56
  */
56
- async function readPlaywrightRunReport(backend, path, sanitize) {
57
+ export async function readPlaywrightRunReport(backend, path, sanitize) {
57
58
  let text;
58
59
  try {
59
60
  text = await backend.readFile(path);
@@ -71,7 +72,7 @@ async function readPlaywrightRunReport(backend, path, sanitize) {
71
72
  omittedFailures: 0,
72
73
  };
73
74
  }
74
- return summarizePlaywrightReport(text, { path, sanitize });
75
+ return retainPlaywrightArtifacts(backend, summarizePlaywrightReport(text, { path, sanitize }));
75
76
  }
76
77
  /**
77
78
  * Recovered legacy task ids whose command ENDS with a backgrounded statement (`… &`).
@@ -1072,7 +1073,9 @@ function packageCatalog(path) {
1072
1073
  */
1073
1074
  export function buildTools(backend, config) {
1074
1075
  const { include, exclude, pathGuards = true, symlinkGuards = false, redactSecrets: doRedact = true, blockDangerousCommands = false, blockCommand, execTimeoutMs = 120_000, commandBudgetMs, overCeilingGraceMs = OVER_CEILING_GRACE_MS, searchExcludedDirs, outlineLargeHtml, excludedTestTitles, requiredSuiteEnv, suiteRunMs, onAfterWrite, onFileDiff, onFileChange, } = config ?? {};
1075
- const root = backend.projectRoot;
1076
+ // Directory URLs and backend callers can supply trailing slashes or dot
1077
+ // segments. Compare every lexical and realpath guard against the same root.
1078
+ const root = posix.resolve(backend.projectRoot);
1076
1079
  // A host-filesystem backend with escape guards off is the combination the
1077
1080
  // audit flagged: `pathGuards` off lets `..` paths out of the workspace,
1078
1081
  // and `symlinkGuards` off lets a workspace SYMLINK redirect reads/writes
@@ -1235,7 +1238,9 @@ export function buildTools(backend, config) {
1235
1238
  try {
1236
1239
  const result = await backend.run(`readlink -f ${shellQuote(path)} 2>/dev/null || echo ${shellQuote(path)}`, { timeout: 5000 });
1237
1240
  const realPath = result.stdout.trim();
1238
- if (realPath && realPath !== root && !realPath.startsWith(root + '/')) {
1241
+ if (realPath &&
1242
+ realPath !== root &&
1243
+ !realPath.startsWith(root === '/' ? '/' : root + '/')) {
1239
1244
  return 'Access denied: path resolves outside the project workspace';
1240
1245
  }
1241
1246
  return null;
@@ -497,7 +497,7 @@ export declare function suiteRunPriorityLaunch(command: string, launch: string):
497
497
  */
498
498
  export declare function checkBlockedCommand(command: string): string | null;
499
499
  /**
500
- * Normalize a path to be absolute within the project root.
500
+ * Normalize the project root and resolve a path absolutely within it.
501
501
  * Empty string and '/' both resolve to projectRoot.
502
502
  * Rejects paths that escape via traversal or absolute paths outside root.
503
503
  *
@@ -507,7 +507,7 @@ export declare function checkBlockedCommand(command: string): string | null;
507
507
  */
508
508
  export declare function resolvePath(path: string, projectRoot: string): string;
509
509
  /**
510
- * Whether a tool path points outside the project root once normalized (an
510
+ * Whether a tool path points outside the normalized project root (an
511
511
  * absolute path elsewhere, or a `..` that climbs out). {@link resolvePath}
512
512
  * clamps such a path to the root; a file tool must refuse it instead of
513
513
  * answering about the root — a `list_files /tmp/x` used to return the
@@ -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,I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,EAAE,MAAM,CAAA;CACjB,GAAG,MAAM,GAAG,IAAI,CAKhB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,SAAS,CACvB,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,GAChB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAgBvC"}
package/dist/utilities.js CHANGED
@@ -9,7 +9,7 @@ import { commandSegments, executedCommands, locatedCommandSegments, statementArg
9
9
  import { classifyRunFailure } from './failure-kind.js';
10
10
  import { commandRunsNoTests } from './no-test-run.js';
11
11
  import { PLAYWRIGHT_REPORT_ENV } from './playwright-report.js';
12
- import { isDiagnosisRun, scopedRerunCommand, suiteCommandTarget, suiteRunInTheWay, withoutHeredocs, withSuiteConfig, } from './suite-overlap.js';
12
+ import { isDiagnosisRun, resolvePlaywrightSelectionPaths, scopedRerunCommand, suiteCommandTarget, suiteRunInTheWay, withoutHeredocs, withSuiteConfig, } from './suite-overlap.js';
13
13
  /**
14
14
  * Shell-safe quoting using single quotes. Unlike JSON.stringify (double quotes),
15
15
  * single-quoted strings prevent command substitution ($(), backticks) and variable expansion.
@@ -670,7 +670,11 @@ export function streamingBackgroundCommand(command, context, reportPath) {
670
670
  if (commandRunsNoTests(command))
671
671
  return { command, changes: [] };
672
672
  const changes = [];
673
- let out = command;
673
+ let out = resolvePlaywrightSelectionPaths(command);
674
+ if (out !== command) {
675
+ changes.push('Resolved dot-relative Playwright file selections to absolute paths against the runner’s ' +
676
+ 'working directory: Playwright matches positional selections against absolute test-file paths.');
677
+ }
674
678
  // A filter after the suite runner is not output the platform can read: it hides the failing
675
679
  // test's own error, and its exit status replaces the run's with the filter's — m101's
676
680
  // `… | grep -E "✘|passed|failed|skipped" | tail -20` reported `exitCode: 0` for a run with a
@@ -1856,7 +1860,7 @@ export function checkBlockedCommand(command) {
1856
1860
  }
1857
1861
  // ── Path resolution ───────────────────────────────────────────────────────────
1858
1862
  /**
1859
- * Normalize a path to be absolute within the project root.
1863
+ * Normalize the project root and resolve a path absolutely within it.
1860
1864
  * Empty string and '/' both resolve to projectRoot.
1861
1865
  * Rejects paths that escape via traversal or absolute paths outside root.
1862
1866
  *
@@ -1865,11 +1869,12 @@ export function checkBlockedCommand(command) {
1865
1869
  * @returns A normalized absolute path confined to `projectRoot`.
1866
1870
  */
1867
1871
  export function resolvePath(path, projectRoot) {
1872
+ const root = posix.resolve(projectRoot);
1868
1873
  if (path === '' || path === '/')
1869
- return projectRoot;
1870
- const resolved = rootedPath(path, projectRoot);
1871
- if (resolved !== projectRoot && !resolved.startsWith(projectRoot + '/'))
1872
- return projectRoot;
1874
+ return root;
1875
+ const resolved = rootedPath(path, root);
1876
+ if (resolved !== root && !resolved.startsWith(root === '/' ? '/' : root + '/'))
1877
+ return root;
1873
1878
  return resolved;
1874
1879
  }
1875
1880
  /**
@@ -1886,7 +1891,7 @@ function rootedPath(path, projectRoot) {
1886
1891
  return clean.startsWith('/') ? posix.normalize(clean) : posix.normalize(`${projectRoot}/${clean}`);
1887
1892
  }
1888
1893
  /**
1889
- * Whether a tool path points outside the project root once normalized (an
1894
+ * Whether a tool path points outside the normalized project root (an
1890
1895
  * absolute path elsewhere, or a `..` that climbs out). {@link resolvePath}
1891
1896
  * clamps such a path to the root; a file tool must refuse it instead of
1892
1897
  * answering about the root — a `list_files /tmp/x` used to return the
@@ -1899,8 +1904,9 @@ function rootedPath(path, projectRoot) {
1899
1904
  export function isOutsideRoot(path, projectRoot) {
1900
1905
  if (path === '' || path === '/')
1901
1906
  return false;
1902
- const resolved = rootedPath(path, projectRoot);
1903
- return resolved !== projectRoot && !resolved.startsWith(projectRoot + '/');
1907
+ const root = posix.resolve(projectRoot);
1908
+ const resolved = rootedPath(path, root);
1909
+ return resolved !== root && !resolved.startsWith(root === '/' ? '/' : root + '/');
1904
1910
  }
1905
1911
  /**
1906
1912
  * Whether a command's FIRST statement already changes into `directory`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@molecule/api-ai-tools",
3
- "version": "1.14.6",
3
+ "version": "1.14.9",
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",