@ia-qa/self-healing 1.6.16 → 1.6.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/args.js +1 -1
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/audit.d.ts +40 -0
- package/dist/cli/audit.js +77 -32
- package/dist/cli/audit.js.map +1 -1
- package/dist/cli/check.d.ts +50 -1
- package/dist/cli/check.js +63 -25
- package/dist/cli/check.js.map +1 -1
- package/dist/cli/index.js +3 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/ingest.d.ts +7 -1
- package/dist/cli/ingest.js +17 -8
- package/dist/cli/ingest.js.map +1 -1
- package/dist/ingest.d.ts +35 -0
- package/dist/ingest.js +32 -0
- package/dist/ingest.js.map +1 -1
- package/dist/mcp/server.d.ts +370 -1
- package/dist/mcp/server.js +196 -1
- package/dist/mcp/server.js.map +1 -1
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -95,13 +95,15 @@ Usage:
|
|
|
95
95
|
(Playwright, .js/.ts) — immune to positional drift
|
|
96
96
|
--dir directory mode: diff all mappings, apply all rewrites
|
|
97
97
|
at once. Layouts in _layouts/ diffed first.
|
|
98
|
-
ia-qa-heal ingest [paths…]
|
|
98
|
+
ia-qa-heal ingest [paths…] [--json] Inventory the locators your tests/POMs actually use — CSS
|
|
99
99
|
selectors AND names (get/find/queryBy* — Playwright, Testing
|
|
100
100
|
Library, @testing-library/cypress — plus cy.contains and
|
|
101
101
|
By.LINK_TEXT) → .ia-qa/usage.json. diff then gates on renames
|
|
102
102
|
your tests locate by name; fix rewrites the role-stating calls
|
|
103
103
|
(getByRole/getByLabel/By.linkText) and only reports the
|
|
104
104
|
text-anchored ones. No arguments: config.testPaths
|
|
105
|
+
--json the inventory as one document, including the FULL
|
|
106
|
+
positional-selector list (the hardening backlog)
|
|
105
107
|
ia-qa-heal audit [paths…] Day one, no baseline: does your suite still name things that
|
|
106
108
|
exist? Cross-references usage.json against the current
|
|
107
109
|
mapping/ and flags locators that match no element.
|
package/dist/cli/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":";;;AACA,sCAAuC;AACvC,iCAA4C;AAC5C,iCAAiC;AACjC,+BAA+B;AAC/B,yCAAyC;AACzC,iCAAiC;AACjC,+BAA+B;AAC/B,qCAAqC;AACrC,mCAAmC;AACnC,mCAAmC;AACnC,+BAA+B;AAC/B,yCAAyC;AACzC,mCAAmC;AACnC,uCAAuC;AACvC,6BAA6B;AAC7B,mCAAmC;AAEnC,qEAAqE;AACrE,MAAM,OAAO,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC,OAAiB,CAAC;AAEhE,MAAM,IAAI,GAAG
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":";;;AACA,sCAAuC;AACvC,iCAA4C;AAC5C,iCAAiC;AACjC,+BAA+B;AAC/B,yCAAyC;AACzC,iCAAiC;AACjC,+BAA+B;AAC/B,qCAAqC;AACrC,mCAAmC;AACnC,mCAAmC;AACnC,+BAA+B;AAC/B,yCAAyC;AACzC,mCAAmC;AACnC,uCAAuC;AACvC,6BAA6B;AAC7B,mCAAmC;AAEnC,qEAAqE;AACrE,MAAM,OAAO,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC,OAAiB,CAAC;AAEhE,MAAM,IAAI,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwLZ,CAAC;AAEF;;;;;;GAMG;AACH,SAAS,gBAAgB,CAAC,IAAc;IACtC,MAAM,IAAI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CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
package/dist/cli/ingest.d.ts
CHANGED
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import { usagePath } from '../ingest';
|
|
2
2
|
/**
|
|
3
|
-
* `ia-qa-heal ingest [paths…]` — inventory the selectors your suite actually uses.
|
|
3
|
+
* `ia-qa-heal ingest [paths…] [--json]` — inventory the selectors your suite actually uses.
|
|
4
4
|
*
|
|
5
5
|
* No arguments: reads `testPaths` from `.ia-qa/config.json`. Writes
|
|
6
6
|
* `.ia-qa/usage.json`, which `diff` reads to say which drift touches your tests
|
|
7
7
|
* and `fix` reads as its default file list.
|
|
8
8
|
*
|
|
9
|
+
* `--json` emits the inventory as one parseable document instead of the report —
|
|
10
|
+
* including the full positional-selector list the terminal truncates to five.
|
|
11
|
+
* That list is the hardening backlog (`data-testid` here, and this selector stops
|
|
12
|
+
* being drift waiting for a release), and it was computed but unreachable by
|
|
13
|
+
* anything that is not a human reading a terminal.
|
|
14
|
+
*
|
|
9
15
|
* Exit codes: 0 on success (even with 0 selectors — an honest empty inventory);
|
|
10
16
|
* 2 = nowhere to scan.
|
|
11
17
|
*/
|
package/dist/cli/ingest.js
CHANGED
|
@@ -39,19 +39,25 @@ const path = __importStar(require("path"));
|
|
|
39
39
|
const config_1 = require("../config");
|
|
40
40
|
const ingest_1 = require("../ingest");
|
|
41
41
|
Object.defineProperty(exports, "usagePath", { enumerable: true, get: function () { return ingest_1.usagePath; } });
|
|
42
|
-
const match_1 = require("../browser/match");
|
|
43
42
|
const summary_1 = require("./summary");
|
|
44
43
|
/**
|
|
45
|
-
* `ia-qa-heal ingest [paths…]` — inventory the selectors your suite actually uses.
|
|
44
|
+
* `ia-qa-heal ingest [paths…] [--json]` — inventory the selectors your suite actually uses.
|
|
46
45
|
*
|
|
47
46
|
* No arguments: reads `testPaths` from `.ia-qa/config.json`. Writes
|
|
48
47
|
* `.ia-qa/usage.json`, which `diff` reads to say which drift touches your tests
|
|
49
48
|
* and `fix` reads as its default file list.
|
|
50
49
|
*
|
|
50
|
+
* `--json` emits the inventory as one parseable document instead of the report —
|
|
51
|
+
* including the full positional-selector list the terminal truncates to five.
|
|
52
|
+
* That list is the hardening backlog (`data-testid` here, and this selector stops
|
|
53
|
+
* being drift waiting for a release), and it was computed but unreachable by
|
|
54
|
+
* anything that is not a human reading a terminal.
|
|
55
|
+
*
|
|
51
56
|
* Exit codes: 0 on success (even with 0 selectors — an honest empty inventory);
|
|
52
57
|
* 2 = nowhere to scan.
|
|
53
58
|
*/
|
|
54
59
|
async function runIngest(args) {
|
|
60
|
+
const json = args.includes('--json');
|
|
55
61
|
let paths = args.filter((a) => !a.startsWith('--'));
|
|
56
62
|
if (paths.length === 0) {
|
|
57
63
|
// Resolved against the config's own directory, not the shell's cwd: under
|
|
@@ -79,6 +85,13 @@ async function runIngest(args) {
|
|
|
79
85
|
...Object.values(usage.names ?? {}).flatMap((sites) => sites.map((s) => s.file)),
|
|
80
86
|
]);
|
|
81
87
|
const file = (0, ingest_1.saveUsage)(usage);
|
|
88
|
+
const inventory = (0, ingest_1.buildInventoryReport)(usage);
|
|
89
|
+
const positionalAll = inventory.positionalSelectors;
|
|
90
|
+
if (json) {
|
|
91
|
+
console.log(JSON.stringify({ usagePath: file, ...inventory }, null, 2));
|
|
92
|
+
process.exitCode = 0;
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
82
95
|
console.log(`\n📇 ia-qa-heal ingest — locator inventory`);
|
|
83
96
|
console.log(` ${selectors.length} selector${selectors.length === 1 ? '' : 's'} (${refs} ref${refs === 1 ? '' : 's'}) · ` +
|
|
84
97
|
`${names.length} name${names.length === 1 ? '' : 's'} (${nameRefs} ref${nameRefs === 1 ? '' : 's'}) · ` +
|
|
@@ -96,11 +109,7 @@ async function runIngest(args) {
|
|
|
96
109
|
}
|
|
97
110
|
// The selectors most worth replacing: positional (nothing anchors them to the
|
|
98
111
|
// element) and referenced the most — each one is drift waiting for a release.
|
|
99
|
-
const positional =
|
|
100
|
-
.filter((s) => !(0, match_1.isIdentitySelector)(s))
|
|
101
|
-
.map((s) => ({ selector: s, count: usage.selectors[s].length }))
|
|
102
|
-
.sort((a, b) => b.count - a.count)
|
|
103
|
-
.slice(0, 5);
|
|
112
|
+
const positional = positionalAll.slice(0, 5);
|
|
104
113
|
if (positional.length > 0) {
|
|
105
114
|
console.log(`\n ⚠ Most-used positional selectors (no identity anchor — first to drift):`);
|
|
106
115
|
for (const p of positional) {
|
|
@@ -113,7 +122,7 @@ async function runIngest(args) {
|
|
|
113
122
|
`concatenation, \${…}) are invisible to a static scan — and to \`fix\`.`);
|
|
114
123
|
}
|
|
115
124
|
console.log('');
|
|
116
|
-
const positionalCount =
|
|
125
|
+
const positionalCount = positionalAll.length;
|
|
117
126
|
const total = selectors.length + names.length;
|
|
118
127
|
(0, summary_1.summaryLine)('ingest', 'ok', `${total} ${total === 1 ? 'locator' : 'locators'} inventoried`, [
|
|
119
128
|
`${selectors.length} selector${selectors.length === 1 ? '' : 's'}`,
|
package/dist/cli/ingest.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ingest.js","sourceRoot":"","sources":["../../src/cli/ingest.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"ingest.js","sourceRoot":"","sources":["../../src/cli/ingest.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBA,8BAkGC;AAvHD,2CAA6B;AAC7B,sCAA4D;AAC5D,sCAAoF;AAuH3E,0FAvH8C,kBAAS,OAuH9C;AAtHlB,uCAAwC;AAExC;;;;;;;;;;;;;;;GAeG;AACI,KAAK,UAAU,SAAS,CAAC,IAAc;IAC5C,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IACrC,IAAI,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EA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,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE;QACtD,eAAe,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,eAAe,qBAAqB,CAAC,CAAC,CAAC,SAAS;KAC1E,CAAC,CAAC;IACH,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;AACvB,CAAC"}
|
package/dist/ingest.d.ts
CHANGED
|
@@ -67,6 +67,41 @@ export interface IngestResult {
|
|
|
67
67
|
skipped: string[];
|
|
68
68
|
}
|
|
69
69
|
export declare function ingestPaths(paths: string[], cwd?: string): IngestResult;
|
|
70
|
+
/**
|
|
71
|
+
* The inventory as a document — what `ingest --json` and the MCP tool both emit.
|
|
72
|
+
*
|
|
73
|
+
* One composer, because the terminal's report and an agent's payload describe the
|
|
74
|
+
* same scan: two of them would drift, and the one nobody reads is the one that
|
|
75
|
+
* goes wrong. The terminal keeps its own prose *around* these numbers; it does not
|
|
76
|
+
* compute different ones.
|
|
77
|
+
*/
|
|
78
|
+
export interface InventoryReport {
|
|
79
|
+
scanned: number;
|
|
80
|
+
filesMatched: number;
|
|
81
|
+
selectors: {
|
|
82
|
+
distinct: number;
|
|
83
|
+
references: number;
|
|
84
|
+
};
|
|
85
|
+
names: {
|
|
86
|
+
distinct: number;
|
|
87
|
+
references: number;
|
|
88
|
+
shapes: string[];
|
|
89
|
+
frameworks: string[];
|
|
90
|
+
};
|
|
91
|
+
/**
|
|
92
|
+
* Every selector with nothing anchoring it to its element, most-used first.
|
|
93
|
+
*
|
|
94
|
+
* The hardening backlog: the next inserted sibling moves each of these, so a
|
|
95
|
+
* `data-testid` here retires a drift that has not happened yet. Full list — the
|
|
96
|
+
* terminal truncates to five, which is right for a report and wrong for a queue.
|
|
97
|
+
*/
|
|
98
|
+
positionalSelectors: Array<{
|
|
99
|
+
selector: string;
|
|
100
|
+
count: number;
|
|
101
|
+
}>;
|
|
102
|
+
note: string;
|
|
103
|
+
}
|
|
104
|
+
export declare function buildInventoryReport(usage: Usage): InventoryReport;
|
|
70
105
|
export declare function saveUsage(usage: Usage, cwd?: string): string;
|
|
71
106
|
export declare function loadUsage(cwd?: string): Usage | null;
|
|
72
107
|
/**
|
package/dist/ingest.js
CHANGED
|
@@ -38,6 +38,7 @@ exports.usagePath = usagePath;
|
|
|
38
38
|
exports.plausibleSelector = plausibleSelector;
|
|
39
39
|
exports.scanText = scanText;
|
|
40
40
|
exports.ingestPaths = ingestPaths;
|
|
41
|
+
exports.buildInventoryReport = buildInventoryReport;
|
|
41
42
|
exports.saveUsage = saveUsage;
|
|
42
43
|
exports.loadUsage = loadUsage;
|
|
43
44
|
exports.usageFiles = usageFiles;
|
|
@@ -46,6 +47,7 @@ const path = __importStar(require("path"));
|
|
|
46
47
|
const config_1 = require("./config");
|
|
47
48
|
const fixEngine_1 = require("./fixEngine");
|
|
48
49
|
const nameLocators_1 = require("./nameLocators");
|
|
50
|
+
const match_1 = require("./browser/match");
|
|
49
51
|
exports.USAGE_FILENAME = 'usage.json';
|
|
50
52
|
/**
|
|
51
53
|
* Every root below defaults to `baseDir()`, never `process.cwd()` — the inventory is
|
|
@@ -220,6 +222,36 @@ function ingestPaths(paths, cwd = (0, config_1.baseDir)()) {
|
|
|
220
222
|
skipped,
|
|
221
223
|
};
|
|
222
224
|
}
|
|
225
|
+
function buildInventoryReport(usage) {
|
|
226
|
+
const selectors = Object.keys(usage.selectors);
|
|
227
|
+
const names = Object.keys(usage.names ?? {});
|
|
228
|
+
const shapes = Array.from(new Set(Object.values(usage.names ?? {}).flatMap((s) => s.map((x) => x.shape))));
|
|
229
|
+
const filesWithHits = new Set([
|
|
230
|
+
...Object.values(usage.selectors).flatMap((sites) => sites.map((s) => s.file)),
|
|
231
|
+
...Object.values(usage.names ?? {}).flatMap((sites) => sites.map((s) => s.file)),
|
|
232
|
+
]);
|
|
233
|
+
return {
|
|
234
|
+
scanned: usage.scanned,
|
|
235
|
+
filesMatched: filesWithHits.size,
|
|
236
|
+
selectors: {
|
|
237
|
+
distinct: selectors.length,
|
|
238
|
+
references: Object.values(usage.selectors).reduce((s, sites) => s + sites.length, 0),
|
|
239
|
+
},
|
|
240
|
+
names: {
|
|
241
|
+
distinct: names.length,
|
|
242
|
+
references: Object.values(usage.names ?? {}).reduce((s, sites) => s + sites.length, 0),
|
|
243
|
+
shapes,
|
|
244
|
+
frameworks: Array.from(new Set(shapes.map((s) => (s.startsWith('playwright') ? 'Playwright' : s.startsWith('cypress') ? 'Cypress' : 'Selenium')))),
|
|
245
|
+
},
|
|
246
|
+
positionalSelectors: selectors
|
|
247
|
+
.filter((s) => !(0, match_1.isIdentitySelector)(s))
|
|
248
|
+
.map((s) => ({ selector: s, count: usage.selectors[s].length }))
|
|
249
|
+
.sort((a, b) => b.count - a.count),
|
|
250
|
+
note: 'Locators built dynamically (variables, concatenation, ${…}) are invisible to this static scan — ' +
|
|
251
|
+
'and to `fix` too, so an empty inventory means "not measurable", never "not used". ' +
|
|
252
|
+
'positionalSelectors is the hardening backlog: a data-testid on those elements retires the risk.',
|
|
253
|
+
};
|
|
254
|
+
}
|
|
223
255
|
function saveUsage(usage, cwd = (0, config_1.baseDir)()) {
|
|
224
256
|
const file = usagePath(cwd);
|
|
225
257
|
fs.mkdirSync(path.dirname(file), { recursive: true });
|
package/dist/ingest.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ingest.js","sourceRoot":"","sources":["../src/ingest.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"ingest.js","sourceRoot":"","sources":["../src/ingest.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgEA,8BAEC;AA4ED,8CAqBC;AAED,4BAmBC;AAOD,kCAyBC;AA0BD,oDAkCC;AAED,8BAKC;AAED,8BAUC;AAQD,gCAaC;AA5TD,uCAAyB;AACzB,2CAA6B;AAC7B,qCAAyD;AACzD,2CAA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QAC3B,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QACpC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;YACnB,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YACd,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAChB,CAAC;IACH,CAAC,CAAC;IACF,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC;QAAE,KAAK,MAAM,CAAC,IAAI,KAAK;YAAE,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IACvF,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,IAAI,EAAE,CAAC;QAAE,KAAK,MAAM,CAAC,IAAI,KAAK;YAAE,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IACzF,OAAO,GAAG,CAAC;AACb,CAAC"}
|
package/dist/mcp/server.d.ts
CHANGED
|
@@ -1,2 +1,371 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
2
|
+
declare const TOOLS: ({
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
inputSchema: {
|
|
6
|
+
type: string;
|
|
7
|
+
properties: {
|
|
8
|
+
url: {
|
|
9
|
+
type: string;
|
|
10
|
+
description: string;
|
|
11
|
+
};
|
|
12
|
+
page_name: {
|
|
13
|
+
type: string;
|
|
14
|
+
description: string;
|
|
15
|
+
};
|
|
16
|
+
out_dir: {
|
|
17
|
+
type: string;
|
|
18
|
+
description: string;
|
|
19
|
+
};
|
|
20
|
+
wait_for_selector: {
|
|
21
|
+
type: string;
|
|
22
|
+
description: string;
|
|
23
|
+
};
|
|
24
|
+
wait_until: {
|
|
25
|
+
type: string;
|
|
26
|
+
enum: string[];
|
|
27
|
+
description: string;
|
|
28
|
+
};
|
|
29
|
+
browser_channel: {
|
|
30
|
+
type: string;
|
|
31
|
+
description: string;
|
|
32
|
+
};
|
|
33
|
+
browser_path: {
|
|
34
|
+
type: string;
|
|
35
|
+
description: string;
|
|
36
|
+
};
|
|
37
|
+
locale: {
|
|
38
|
+
type: string;
|
|
39
|
+
description: string;
|
|
40
|
+
};
|
|
41
|
+
before_path?: undefined;
|
|
42
|
+
after_path?: undefined;
|
|
43
|
+
before_json?: undefined;
|
|
44
|
+
after_json?: undefined;
|
|
45
|
+
test_paths?: undefined;
|
|
46
|
+
dry_run?: undefined;
|
|
47
|
+
use_locators?: undefined;
|
|
48
|
+
provider?: undefined;
|
|
49
|
+
model?: undefined;
|
|
50
|
+
api_key_env?: undefined;
|
|
51
|
+
min_confidence?: undefined;
|
|
52
|
+
write?: undefined;
|
|
53
|
+
offline?: undefined;
|
|
54
|
+
concurrency?: undefined;
|
|
55
|
+
limit?: undefined;
|
|
56
|
+
};
|
|
57
|
+
required: string[];
|
|
58
|
+
};
|
|
59
|
+
} | {
|
|
60
|
+
name: string;
|
|
61
|
+
description: string;
|
|
62
|
+
inputSchema: {
|
|
63
|
+
type: string;
|
|
64
|
+
properties: {
|
|
65
|
+
before_path: {
|
|
66
|
+
type: string;
|
|
67
|
+
description: string;
|
|
68
|
+
};
|
|
69
|
+
after_path: {
|
|
70
|
+
type: string;
|
|
71
|
+
description: string;
|
|
72
|
+
};
|
|
73
|
+
before_json: {
|
|
74
|
+
type: string;
|
|
75
|
+
description: string;
|
|
76
|
+
};
|
|
77
|
+
after_json: {
|
|
78
|
+
type: string;
|
|
79
|
+
description: string;
|
|
80
|
+
};
|
|
81
|
+
url?: undefined;
|
|
82
|
+
page_name?: undefined;
|
|
83
|
+
out_dir?: undefined;
|
|
84
|
+
wait_for_selector?: undefined;
|
|
85
|
+
wait_until?: undefined;
|
|
86
|
+
browser_channel?: undefined;
|
|
87
|
+
browser_path?: undefined;
|
|
88
|
+
locale?: undefined;
|
|
89
|
+
test_paths?: undefined;
|
|
90
|
+
dry_run?: undefined;
|
|
91
|
+
use_locators?: undefined;
|
|
92
|
+
provider?: undefined;
|
|
93
|
+
model?: undefined;
|
|
94
|
+
api_key_env?: undefined;
|
|
95
|
+
min_confidence?: undefined;
|
|
96
|
+
write?: undefined;
|
|
97
|
+
offline?: undefined;
|
|
98
|
+
concurrency?: undefined;
|
|
99
|
+
limit?: undefined;
|
|
100
|
+
};
|
|
101
|
+
required?: undefined;
|
|
102
|
+
};
|
|
103
|
+
} | {
|
|
104
|
+
name: string;
|
|
105
|
+
description: string;
|
|
106
|
+
inputSchema: {
|
|
107
|
+
type: string;
|
|
108
|
+
properties: {
|
|
109
|
+
before_path: {
|
|
110
|
+
type: string;
|
|
111
|
+
description: string;
|
|
112
|
+
};
|
|
113
|
+
after_path: {
|
|
114
|
+
type: string;
|
|
115
|
+
description: string;
|
|
116
|
+
};
|
|
117
|
+
before_json: {
|
|
118
|
+
type: string;
|
|
119
|
+
description: string;
|
|
120
|
+
};
|
|
121
|
+
after_json: {
|
|
122
|
+
type: string;
|
|
123
|
+
description: string;
|
|
124
|
+
};
|
|
125
|
+
test_paths: {
|
|
126
|
+
type: string;
|
|
127
|
+
items: {
|
|
128
|
+
type: string;
|
|
129
|
+
};
|
|
130
|
+
description: string;
|
|
131
|
+
};
|
|
132
|
+
dry_run: {
|
|
133
|
+
type: string;
|
|
134
|
+
description: string;
|
|
135
|
+
};
|
|
136
|
+
use_locators: {
|
|
137
|
+
type: string;
|
|
138
|
+
description: string;
|
|
139
|
+
};
|
|
140
|
+
url?: undefined;
|
|
141
|
+
page_name?: undefined;
|
|
142
|
+
out_dir?: undefined;
|
|
143
|
+
wait_for_selector?: undefined;
|
|
144
|
+
wait_until?: undefined;
|
|
145
|
+
browser_channel?: undefined;
|
|
146
|
+
browser_path?: undefined;
|
|
147
|
+
locale?: undefined;
|
|
148
|
+
provider?: undefined;
|
|
149
|
+
model?: undefined;
|
|
150
|
+
api_key_env?: undefined;
|
|
151
|
+
min_confidence?: undefined;
|
|
152
|
+
write?: undefined;
|
|
153
|
+
offline?: undefined;
|
|
154
|
+
concurrency?: undefined;
|
|
155
|
+
limit?: undefined;
|
|
156
|
+
};
|
|
157
|
+
required: string[];
|
|
158
|
+
};
|
|
159
|
+
} | {
|
|
160
|
+
name: string;
|
|
161
|
+
description: string;
|
|
162
|
+
inputSchema: {
|
|
163
|
+
type: string;
|
|
164
|
+
properties: {
|
|
165
|
+
before_path: {
|
|
166
|
+
type: string;
|
|
167
|
+
description: string;
|
|
168
|
+
};
|
|
169
|
+
after_path: {
|
|
170
|
+
type: string;
|
|
171
|
+
description: string;
|
|
172
|
+
};
|
|
173
|
+
before_json: {
|
|
174
|
+
type: string;
|
|
175
|
+
description: string;
|
|
176
|
+
};
|
|
177
|
+
after_json: {
|
|
178
|
+
type: string;
|
|
179
|
+
description: string;
|
|
180
|
+
};
|
|
181
|
+
provider: {
|
|
182
|
+
type: string;
|
|
183
|
+
enum: string[];
|
|
184
|
+
description: string;
|
|
185
|
+
};
|
|
186
|
+
model: {
|
|
187
|
+
type: string;
|
|
188
|
+
description: string;
|
|
189
|
+
};
|
|
190
|
+
api_key_env: {
|
|
191
|
+
type: string;
|
|
192
|
+
description: string;
|
|
193
|
+
};
|
|
194
|
+
min_confidence: {
|
|
195
|
+
type: string;
|
|
196
|
+
description: string;
|
|
197
|
+
};
|
|
198
|
+
url?: undefined;
|
|
199
|
+
page_name?: undefined;
|
|
200
|
+
out_dir?: undefined;
|
|
201
|
+
wait_for_selector?: undefined;
|
|
202
|
+
wait_until?: undefined;
|
|
203
|
+
browser_channel?: undefined;
|
|
204
|
+
browser_path?: undefined;
|
|
205
|
+
locale?: undefined;
|
|
206
|
+
test_paths?: undefined;
|
|
207
|
+
dry_run?: undefined;
|
|
208
|
+
use_locators?: undefined;
|
|
209
|
+
write?: undefined;
|
|
210
|
+
offline?: undefined;
|
|
211
|
+
concurrency?: undefined;
|
|
212
|
+
limit?: undefined;
|
|
213
|
+
};
|
|
214
|
+
required: string[];
|
|
215
|
+
};
|
|
216
|
+
} | {
|
|
217
|
+
name: string;
|
|
218
|
+
description: string;
|
|
219
|
+
inputSchema: {
|
|
220
|
+
type: string;
|
|
221
|
+
properties: {
|
|
222
|
+
test_paths: {
|
|
223
|
+
type: string;
|
|
224
|
+
items: {
|
|
225
|
+
type: string;
|
|
226
|
+
};
|
|
227
|
+
description: string;
|
|
228
|
+
};
|
|
229
|
+
write: {
|
|
230
|
+
type: string;
|
|
231
|
+
description: string;
|
|
232
|
+
};
|
|
233
|
+
url?: undefined;
|
|
234
|
+
page_name?: undefined;
|
|
235
|
+
out_dir?: undefined;
|
|
236
|
+
wait_for_selector?: undefined;
|
|
237
|
+
wait_until?: undefined;
|
|
238
|
+
browser_channel?: undefined;
|
|
239
|
+
browser_path?: undefined;
|
|
240
|
+
locale?: undefined;
|
|
241
|
+
before_path?: undefined;
|
|
242
|
+
after_path?: undefined;
|
|
243
|
+
before_json?: undefined;
|
|
244
|
+
after_json?: undefined;
|
|
245
|
+
dry_run?: undefined;
|
|
246
|
+
use_locators?: undefined;
|
|
247
|
+
provider?: undefined;
|
|
248
|
+
model?: undefined;
|
|
249
|
+
api_key_env?: undefined;
|
|
250
|
+
min_confidence?: undefined;
|
|
251
|
+
offline?: undefined;
|
|
252
|
+
concurrency?: undefined;
|
|
253
|
+
limit?: undefined;
|
|
254
|
+
};
|
|
255
|
+
required?: undefined;
|
|
256
|
+
};
|
|
257
|
+
} | {
|
|
258
|
+
name: string;
|
|
259
|
+
description: string;
|
|
260
|
+
inputSchema: {
|
|
261
|
+
type: string;
|
|
262
|
+
properties: {
|
|
263
|
+
test_paths: {
|
|
264
|
+
type: string;
|
|
265
|
+
items: {
|
|
266
|
+
type: string;
|
|
267
|
+
};
|
|
268
|
+
description: string;
|
|
269
|
+
};
|
|
270
|
+
url?: undefined;
|
|
271
|
+
page_name?: undefined;
|
|
272
|
+
out_dir?: undefined;
|
|
273
|
+
wait_for_selector?: undefined;
|
|
274
|
+
wait_until?: undefined;
|
|
275
|
+
browser_channel?: undefined;
|
|
276
|
+
browser_path?: undefined;
|
|
277
|
+
locale?: undefined;
|
|
278
|
+
before_path?: undefined;
|
|
279
|
+
after_path?: undefined;
|
|
280
|
+
before_json?: undefined;
|
|
281
|
+
after_json?: undefined;
|
|
282
|
+
dry_run?: undefined;
|
|
283
|
+
use_locators?: undefined;
|
|
284
|
+
provider?: undefined;
|
|
285
|
+
model?: undefined;
|
|
286
|
+
api_key_env?: undefined;
|
|
287
|
+
min_confidence?: undefined;
|
|
288
|
+
write?: undefined;
|
|
289
|
+
offline?: undefined;
|
|
290
|
+
concurrency?: undefined;
|
|
291
|
+
limit?: undefined;
|
|
292
|
+
};
|
|
293
|
+
required?: undefined;
|
|
294
|
+
};
|
|
295
|
+
} | {
|
|
296
|
+
name: string;
|
|
297
|
+
description: string;
|
|
298
|
+
inputSchema: {
|
|
299
|
+
type: string;
|
|
300
|
+
properties: {
|
|
301
|
+
offline: {
|
|
302
|
+
type: string;
|
|
303
|
+
description: string;
|
|
304
|
+
};
|
|
305
|
+
concurrency: {
|
|
306
|
+
type: string;
|
|
307
|
+
description: string;
|
|
308
|
+
};
|
|
309
|
+
url?: undefined;
|
|
310
|
+
page_name?: undefined;
|
|
311
|
+
out_dir?: undefined;
|
|
312
|
+
wait_for_selector?: undefined;
|
|
313
|
+
wait_until?: undefined;
|
|
314
|
+
browser_channel?: undefined;
|
|
315
|
+
browser_path?: undefined;
|
|
316
|
+
locale?: undefined;
|
|
317
|
+
before_path?: undefined;
|
|
318
|
+
after_path?: undefined;
|
|
319
|
+
before_json?: undefined;
|
|
320
|
+
after_json?: undefined;
|
|
321
|
+
test_paths?: undefined;
|
|
322
|
+
dry_run?: undefined;
|
|
323
|
+
use_locators?: undefined;
|
|
324
|
+
provider?: undefined;
|
|
325
|
+
model?: undefined;
|
|
326
|
+
api_key_env?: undefined;
|
|
327
|
+
min_confidence?: undefined;
|
|
328
|
+
write?: undefined;
|
|
329
|
+
limit?: undefined;
|
|
330
|
+
};
|
|
331
|
+
required?: undefined;
|
|
332
|
+
};
|
|
333
|
+
} | {
|
|
334
|
+
name: string;
|
|
335
|
+
description: string;
|
|
336
|
+
inputSchema: {
|
|
337
|
+
type: string;
|
|
338
|
+
properties: {
|
|
339
|
+
limit: {
|
|
340
|
+
type: string;
|
|
341
|
+
description: string;
|
|
342
|
+
};
|
|
343
|
+
url?: undefined;
|
|
344
|
+
page_name?: undefined;
|
|
345
|
+
out_dir?: undefined;
|
|
346
|
+
wait_for_selector?: undefined;
|
|
347
|
+
wait_until?: undefined;
|
|
348
|
+
browser_channel?: undefined;
|
|
349
|
+
browser_path?: undefined;
|
|
350
|
+
locale?: undefined;
|
|
351
|
+
before_path?: undefined;
|
|
352
|
+
after_path?: undefined;
|
|
353
|
+
before_json?: undefined;
|
|
354
|
+
after_json?: undefined;
|
|
355
|
+
test_paths?: undefined;
|
|
356
|
+
dry_run?: undefined;
|
|
357
|
+
use_locators?: undefined;
|
|
358
|
+
provider?: undefined;
|
|
359
|
+
model?: undefined;
|
|
360
|
+
api_key_env?: undefined;
|
|
361
|
+
min_confidence?: undefined;
|
|
362
|
+
write?: undefined;
|
|
363
|
+
offline?: undefined;
|
|
364
|
+
concurrency?: undefined;
|
|
365
|
+
};
|
|
366
|
+
required?: undefined;
|
|
367
|
+
};
|
|
368
|
+
})[];
|
|
369
|
+
export declare function callTool(name: string, args: any): Promise<string>;
|
|
370
|
+
declare function main(): void;
|
|
371
|
+
export { TOOLS, main };
|