chrometools-mcp 1.8.2 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +757 -494
- package/README.md +219 -41
- package/browser/browser-manager.js +206 -0
- package/browser/page-manager.js +298 -0
- package/index.js +525 -1892
- package/package.json +55 -55
- package/recorder/page-object-generator.js +720 -0
- package/recorder/recorder-script.js +118 -12
- package/recorder/scenario-executor.js +970 -946
- package/recorder/scenario-storage.js +253 -29
- package/server/tool-definitions.js +620 -0
- package/server/tool-schemas.js +295 -0
- package/utils/code-generators/code-generator-base.js +61 -0
- package/utils/code-generators/file-appender.js +202 -0
- package/utils/code-generators/playwright-python.js +84 -0
- package/utils/code-generators/playwright-typescript.js +95 -0
- package/utils/code-generators/selenium-java.js +123 -0
- package/utils/code-generators/selenium-python.js +82 -0
- package/utils/css-utils.js +151 -0
- package/utils/image-processing.js +236 -0
- package/utils/platform-utils.js +62 -0
- package/utils/url-to-project.js +141 -0
- package/index.js.backup +0 -3674
- package/utils/project-detector.js +0 -87
package/CHANGELOG.md
CHANGED
|
@@ -1,494 +1,757 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
All notable changes to this project will be documented in this file.
|
|
4
|
-
|
|
5
|
-
## [
|
|
6
|
-
|
|
7
|
-
###
|
|
8
|
-
- **
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
-
|
|
23
|
-
-
|
|
24
|
-
- Location: `
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
-
|
|
28
|
-
-
|
|
29
|
-
-
|
|
30
|
-
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
-
|
|
36
|
-
-
|
|
37
|
-
-
|
|
38
|
-
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
-
|
|
45
|
-
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
-
|
|
65
|
-
-
|
|
66
|
-
-
|
|
67
|
-
- Location: `index.js:
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
-
|
|
73
|
-
-
|
|
74
|
-
-
|
|
75
|
-
-
|
|
76
|
-
-
|
|
77
|
-
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
-
|
|
85
|
-
-
|
|
86
|
-
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
-
|
|
92
|
-
-
|
|
93
|
-
-
|
|
94
|
-
-
|
|
95
|
-
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
-
|
|
101
|
-
-
|
|
102
|
-
-
|
|
103
|
-
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
###
|
|
112
|
-
-
|
|
113
|
-
-
|
|
114
|
-
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
###
|
|
119
|
-
- **
|
|
120
|
-
-
|
|
121
|
-
-
|
|
122
|
-
-
|
|
123
|
-
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
###
|
|
132
|
-
- **
|
|
133
|
-
-
|
|
134
|
-
-
|
|
135
|
-
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
-
|
|
144
|
-
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
-
|
|
164
|
-
-
|
|
165
|
-
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
-
|
|
171
|
-
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
-
|
|
177
|
-
- `
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
- `
|
|
181
|
-
-
|
|
182
|
-
-
|
|
183
|
-
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
-
|
|
189
|
-
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
-
|
|
194
|
-
-
|
|
195
|
-
-
|
|
196
|
-
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
-
|
|
202
|
-
- `
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
-
|
|
206
|
-
-
|
|
207
|
-
-
|
|
208
|
-
- `
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
-
|
|
226
|
-
-
|
|
227
|
-
-
|
|
228
|
-
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
-
|
|
234
|
-
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
-
|
|
240
|
-
|
|
241
|
-
-
|
|
242
|
-
-
|
|
243
|
-
-
|
|
244
|
-
-
|
|
245
|
-
-
|
|
246
|
-
|
|
247
|
-
###
|
|
248
|
-
-
|
|
249
|
-
-
|
|
250
|
-
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
-
|
|
255
|
-
- Added
|
|
256
|
-
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
-
|
|
262
|
-
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
-
|
|
266
|
-
- `
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
-
|
|
272
|
-
-
|
|
273
|
-
-
|
|
274
|
-
- **
|
|
275
|
-
-
|
|
276
|
-
-
|
|
277
|
-
- `
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
-
|
|
283
|
-
- `
|
|
284
|
-
- `
|
|
285
|
-
-
|
|
286
|
-
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
-
|
|
299
|
-
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
-
|
|
303
|
-
-
|
|
304
|
-
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
-
|
|
310
|
-
- `
|
|
311
|
-
- `
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
-
|
|
344
|
-
- Added
|
|
345
|
-
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
-
|
|
349
|
-
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
-
|
|
355
|
-
-
|
|
356
|
-
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
-
|
|
383
|
-
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
})
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
- `
|
|
420
|
-
- `
|
|
421
|
-
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
-
|
|
465
|
-
- `
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
-
|
|
469
|
-
-
|
|
470
|
-
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
-
|
|
474
|
-
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
-
|
|
489
|
-
-
|
|
490
|
-
-
|
|
491
|
-
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
## [2.2.0] - 2025-12-21
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
- **Page Object Model (POM) Generator** - New `generatePageObject` MCP tool for automated Page Object creation
|
|
9
|
+
- Analyzes current page and extracts interactive elements (inputs, buttons, links, etc.)
|
|
10
|
+
- Smart selector generation: prioritizes id > name > data-testid > unique class > CSS path
|
|
11
|
+
- Auto-generates meaningful element names from labels, placeholders, text content
|
|
12
|
+
- Groups elements by semantic sections (header, nav, form, footer, etc.)
|
|
13
|
+
- Supports 4 frameworks: Playwright TypeScript/Python, Selenium Python/Java
|
|
14
|
+
- Generates helper methods automatically (fill/click methods for common actions)
|
|
15
|
+
- Example: `generatePageObject({ framework: 'playwright-typescript' })`
|
|
16
|
+
- Location: `recorder/page-object-generator.js`, `index.js:46,2098-2136`
|
|
17
|
+
|
|
18
|
+
- **Page Object Integration in exportScenarioAsCode** - Optional Page Object generation when exporting scenarios
|
|
19
|
+
- New parameter `generatePageObject` (default: false) to generate both test code and Page Object class
|
|
20
|
+
- New parameter `pageObjectClassName` for custom Page Object class names
|
|
21
|
+
- Opens scenario's entry URL and analyzes page structure automatically
|
|
22
|
+
- Returns JSON with both `testCode` and `pageObjectCode` when enabled
|
|
23
|
+
- Example: `exportScenarioAsCode({ scenarioName: "login", language: "playwright-typescript", generatePageObject: true })`
|
|
24
|
+
- Location: `index.js:2090-2186`, `server/tool-schemas.js:281-282`, `server/tool-definitions.js:565-572`
|
|
25
|
+
|
|
26
|
+
- **Append Mode for exportScenarioAsCode** - Ability to append generated tests to existing test files
|
|
27
|
+
- New parameter `appendToFile`: Path to existing test file to append to (enables append mode)
|
|
28
|
+
- New parameter `testName`: Override test name (default: from scenario name)
|
|
29
|
+
- New parameter `insertPosition`: Where to insert test - 'end' (default), 'before', or 'after' a reference test
|
|
30
|
+
- New parameter `referenceTestName`: Reference test name for 'before'/'after' insertion
|
|
31
|
+
- Supports all 4 frameworks: Playwright TypeScript/Python, Selenium Python/Java
|
|
32
|
+
- Automatic file validation (extension must match language)
|
|
33
|
+
- Automatic backup before file modification (.backup extension)
|
|
34
|
+
- Smart test name conversion (camelCase for Java, snake_case for Python, kebab-case for TypeScript)
|
|
35
|
+
- Framework-specific parsing: brace counting for TypeScript/Java, indentation-based for Python
|
|
36
|
+
- PEP 8 compliance: 2 blank lines between Python functions
|
|
37
|
+
- Example: `exportScenarioAsCode({ scenarioName: "new_test", language: "playwright-typescript", appendToFile: "./tests/suite.spec.ts" })`
|
|
38
|
+
- Location: `utils/code-generators/file-appender.js` (new 177 lines), `index.js:2044-2116`, `server/tool-schemas.js:283-286`, `utils/code-generators/*.js`
|
|
39
|
+
|
|
40
|
+
### Fixed
|
|
41
|
+
- **Dependency Resolution with projectId** - Fixed collision errors when executing scenarios with dependencies
|
|
42
|
+
- Dependencies now correctly inherit parent scenario's projectId when not explicitly specified
|
|
43
|
+
- Explicit dependency projectId in metadata takes precedence over inherited value
|
|
44
|
+
- Fixes error: "Dependency 'test': Multiple scenarios named 'test' found"
|
|
45
|
+
- Location: `recorder/scenario-executor.js:63-119`
|
|
46
|
+
|
|
47
|
+
## [2.1.1] - 2025-12-21
|
|
48
|
+
|
|
49
|
+
### Fixed
|
|
50
|
+
- **executeScenario Timeout Fix** - Prevents hanging when no browser tab is attached
|
|
51
|
+
- Auto-opens browser at scenario's entryUrl if no page is open
|
|
52
|
+
- Added timeout protection (1s) for page state checks to prevent hanging on `isClosed()`
|
|
53
|
+
- Added 30s timeout for browser opening operation
|
|
54
|
+
- Added 5min timeout for scenario execution with clear error messages
|
|
55
|
+
- Location: `browser/page-manager.js:255-290`, `index.js:1875-1955`
|
|
56
|
+
|
|
57
|
+
- **URL Validation Fix** - Fixed false negative in scenario exit URL validation
|
|
58
|
+
- Added 500ms wait before URL check to allow navigation/redirects to complete
|
|
59
|
+
- Changed from `page.url()` to `page.evaluate(() => window.location.href)` for more reliable current URL
|
|
60
|
+
- Fixes issue where correct URL was reported as wrong due to timing
|
|
61
|
+
- Location: `recorder/scenario-executor.js:186-191`
|
|
62
|
+
|
|
63
|
+
- **Global Timeout Protection** - All MCP tools now protected from hanging
|
|
64
|
+
- Added `executeToolWithTimeout()` wrapper for all tool calls
|
|
65
|
+
- Default timeout: 2 minutes for regular tools, 6 minutes for executeScenario
|
|
66
|
+
- Tools return clear error messages instead of hanging indefinitely
|
|
67
|
+
- Location: `index.js:183-217`
|
|
68
|
+
|
|
69
|
+
### Changed
|
|
70
|
+
- **Code Refactoring** - Reduced index.js from 3761 to 2093 lines (-44%)
|
|
71
|
+
- Extracted tool schemas to `server/tool-schemas.js` (34 schemas, 282 lines)
|
|
72
|
+
- Extracted tool definitions to `server/tool-definitions.js` (41 tools, 569 lines)
|
|
73
|
+
- Extracted browser management to `browser/browser-manager.js` (207 lines)
|
|
74
|
+
- Extracted page management to `browser/page-manager.js` (268 lines)
|
|
75
|
+
- Extracted image processing to `utils/image-processing.js` (254 lines)
|
|
76
|
+
- Extracted CSS utilities to `utils/css-utils.js` (163 lines)
|
|
77
|
+
- Extracted platform utilities to `utils/platform-utils.js` (63 lines)
|
|
78
|
+
- Better code organization and maintainability
|
|
79
|
+
|
|
80
|
+
## [2.1.0] - 2025-12-21
|
|
81
|
+
|
|
82
|
+
### Added
|
|
83
|
+
- **Name Collision Detection** - Smart handling of scenarios with same name across different projects
|
|
84
|
+
- `executeScenario` now detects when multiple scenarios share the same name
|
|
85
|
+
- Returns helpful error with list of available `projectId` values
|
|
86
|
+
- Optional `projectId` parameter to disambiguate: `executeScenario({ name: "login", projectId: "google" })`
|
|
87
|
+
- Location: `recorder/scenario-storage.js:111-163`, `recorder/scenario-executor.js:33,49-61,86-90`, `index.js:1677,3558-3571,3597-3600`
|
|
88
|
+
|
|
89
|
+
### Changed
|
|
90
|
+
- **URL-Based Scenario Organization** - Scenarios now organized by website domain instead of file system project
|
|
91
|
+
- Project ID automatically extracted from URL where recording starts: `https://google.com` → `google`
|
|
92
|
+
- Main domain only (subdomains stripped): `mail.google.com` → `google`
|
|
93
|
+
- Ports included for ALL domains: `localhost:3000` → `localhost-3000`, `example.com:8080` → `example-8080`
|
|
94
|
+
- Protocol ignored: `http` and `https` both map to same projectId
|
|
95
|
+
- File URLs: `file:///` → `local`
|
|
96
|
+
- Location: `utils/url-to-project.js`, `recorder/recorder-script.js:30-78`
|
|
97
|
+
|
|
98
|
+
- **Global Scenario Access** - All tools now return scenarios from ALL websites
|
|
99
|
+
- `listScenarios()` returns ALL scenarios with `projectId`, `entryUrl`, `exitUrl` metadata
|
|
100
|
+
- `searchScenarios()` searches ALL scenarios across all websites
|
|
101
|
+
- Agent can filter results by `projectId`, `entryUrl`, or `exitUrl` as needed
|
|
102
|
+
- Removed `allProjects` parameter (no longer needed, always returns all)
|
|
103
|
+
- Location: `index.js:3586-3610`
|
|
104
|
+
|
|
105
|
+
- **Simplified API** - Recorder no longer depends on file system project detection
|
|
106
|
+
- `injectRecorder()` signature changed from `(page, projectDir, projectId, projectPath)` to `(page)`
|
|
107
|
+
- Project ID determined automatically from page URL in browser context
|
|
108
|
+
- Removed dependency on `utils/project-detector.js`
|
|
109
|
+
- Location: `recorder/recorder-script.js:1710-1763`, `index.js:3512-3533`
|
|
110
|
+
|
|
111
|
+
### Added
|
|
112
|
+
- **URL Normalization Utilities** - New module for extracting project ID from URLs
|
|
113
|
+
- `urlToProjectId(url)` - Extract and sanitize domain-based project ID
|
|
114
|
+
- `sanitizeProjectId(id)` - Clean project IDs (lowercase, alphanumeric, hyphens)
|
|
115
|
+
- Browser-compatible version injected into recorder widget
|
|
116
|
+
- Location: `utils/url-to-project.js`
|
|
117
|
+
|
|
118
|
+
### Migration
|
|
119
|
+
- **Automatic v2.1.0 Migration** - Old project-based scenarios removed on first run
|
|
120
|
+
- Deletes `~/.config/chrometools-mcp/projects/` directory from v2.0
|
|
121
|
+
- Deletes old global index
|
|
122
|
+
- Creates `.migration-v2.1.0-done` flag file
|
|
123
|
+
- One-time migration, starts fresh with URL-based organization
|
|
124
|
+
- Location: `index.js:780-811`
|
|
125
|
+
|
|
126
|
+
### Removed
|
|
127
|
+
- **Removed `utils/project-detector.js`** - No longer needed for URL-based organization
|
|
128
|
+
- **Removed helper functions** - `getProjectId()`, `getProjectDir()`, `getCurrentProjectDir()`
|
|
129
|
+
- **Removed old scenarios** - All v2.0 scenarios deleted during migration
|
|
130
|
+
|
|
131
|
+
### Documentation
|
|
132
|
+
- **Updated README.md** - Complete rewrite of Recorder Tools section
|
|
133
|
+
- Explained URL-based storage approach with examples
|
|
134
|
+
- Updated all tool descriptions and examples
|
|
135
|
+
- Documented domain extraction rules
|
|
136
|
+
- Added filtering examples for agents
|
|
137
|
+
- Location: `README.md:507-618`
|
|
138
|
+
|
|
139
|
+
## [2.0.2] - 2025-12-21
|
|
140
|
+
|
|
141
|
+
### Fixed
|
|
142
|
+
- **Project Detection for VS Code** - Improved project root detection for IDE environments
|
|
143
|
+
- Added support for `INIT_CWD` and `npm_config_local_prefix` environment variables
|
|
144
|
+
- Added `findProjectRootByMarkers()` to detect project by package.json, pom.xml, etc.
|
|
145
|
+
- Walks up parent directories to find Git root when cwd is IDE installation
|
|
146
|
+
- Now correctly detects `C:\prj\automation` instead of `Microsoft VS Code` when running in VS Code
|
|
147
|
+
- Location: `utils/project-detector.js:38-68`, `utils/project-detector.js:85-140`
|
|
148
|
+
|
|
149
|
+
### Added
|
|
150
|
+
- **Enhanced Project Detection Strategy** - Multiple fallback mechanisms for project root detection
|
|
151
|
+
- Priority: CLAUDE_PROJECT_DIR → PROJECT_DIR → INIT_CWD → npm prefix → Git root → markers → parent Git → cwd
|
|
152
|
+
- Supports 8+ project markers: package.json, pom.xml, build.gradle, Cargo.toml, go.mod, etc.
|
|
153
|
+
- Better logging with `console.error` for debugging project detection
|
|
154
|
+
|
|
155
|
+
### Documentation
|
|
156
|
+
- **VS Code Setup Guide** - Add instructions for setting PROJECT_DIR in MCP config for VS Code users
|
|
157
|
+
|
|
158
|
+
## [2.0.1] - 2025-12-21
|
|
159
|
+
|
|
160
|
+
### Fixed
|
|
161
|
+
- **Recorder Auto-Reinjection** - Fixed critical bug where recorder widget didn't reinject after page navigation
|
|
162
|
+
- Updated `setupRecorderAutoReinjection()` to use new v2.0 API signature
|
|
163
|
+
- Fixed both navigation (`framenavigated`) and reload (`load`) event handlers
|
|
164
|
+
- Recorder now correctly passes `projectDir`, `projectId`, and `projectPath` instead of deprecated `baseDir`
|
|
165
|
+
- Location: `index.js:483-486`, `index.js:499-502`
|
|
166
|
+
|
|
167
|
+
## [2.0.0] - 2025-12-21
|
|
168
|
+
|
|
169
|
+
### Breaking Changes
|
|
170
|
+
- **Project-Based Scenario Storage** - Complete restructuring of scenario storage system
|
|
171
|
+
- Scenarios now stored in `~/.config/chrometools-mcp/projects/{projectName}/scenarios/`
|
|
172
|
+
- Each project has its own isolated scenario storage
|
|
173
|
+
- Automatic project detection via `detectProjectRoot()` (CLAUDE_PROJECT_DIR → PROJECT_DIR → git root → cwd)
|
|
174
|
+
- Global index file at `~/.config/chrometools-mcp/index.json` for fast scenario discovery
|
|
175
|
+
- Scenarios include `projectId` and `projectPath` in metadata
|
|
176
|
+
- Old scenarios in `~/.config/chrometools-mcp/scenarios/` will no longer be accessible
|
|
177
|
+
- Location: `index.js:66-159`, `recorder/scenario-storage.js`
|
|
178
|
+
|
|
179
|
+
- **Removed `directory` parameter** - All scenario tools no longer accept explicit directory parameter
|
|
180
|
+
- Removed from: `enableRecorder`, `executeScenario`, `listScenarios`, `searchScenarios`, `getScenarioInfo`, `deleteScenario`, `exportScenarioAsCode`
|
|
181
|
+
- Project directory is now automatically determined
|
|
182
|
+
- Simplifies API and improves consistency
|
|
183
|
+
- Location: `index.js:1659-1750` (tool definitions)
|
|
184
|
+
|
|
185
|
+
### Added
|
|
186
|
+
- **Global Scenario Index** - Fast O(1) scenario lookups without filesystem scanning
|
|
187
|
+
- Location: `~/.config/chrometools-mcp/index.json`
|
|
188
|
+
- Contains all projects and their scenarios
|
|
189
|
+
- Enables quick discovery of scenarios across all projects
|
|
190
|
+
- AI-friendly: agents can read global index to understand all available scenarios
|
|
191
|
+
- Location: `index.js:103-159`, `recorder/scenario-storage.js:23-136`
|
|
192
|
+
|
|
193
|
+
- **Multi-Project Filtering** - New `allProjects` parameter for `listScenarios` and `searchScenarios`
|
|
194
|
+
- `allProjects: false` (default) - shows only current project's scenarios
|
|
195
|
+
- `allProjects: true` - shows scenarios from all projects
|
|
196
|
+
- Enables cross-project scenario discovery and reuse
|
|
197
|
+
- Location: `index.js:1685`, `index.js:1697`, `recorder/scenario-storage.js:385-453`
|
|
198
|
+
|
|
199
|
+
- **Cross-Project Dependency Support** - Scenarios can depend on scenarios from other projects
|
|
200
|
+
- Dependencies automatically resolved across projects via global index
|
|
201
|
+
- Enables scenario reuse between projects
|
|
202
|
+
- Location: `recorder/scenario-executor.js:27-121`
|
|
203
|
+
|
|
204
|
+
- **Storage Path in Tool Descriptions** - All scenario tools now document storage location
|
|
205
|
+
- Every tool description includes: "Scenarios are stored in ~/.config/chrometools-mcp/projects/{projectName}/scenarios/"
|
|
206
|
+
- Helps AI agents understand where to find scenarios
|
|
207
|
+
- Includes reference to global index location
|
|
208
|
+
- Location: `index.js:1660`, `index.js:1668`, `index.js:1681`, etc.
|
|
209
|
+
|
|
210
|
+
### Changed
|
|
211
|
+
- **Scenario Storage Functions** - Updated all storage functions for new architecture
|
|
212
|
+
- `saveScenario(scenario, projectId, projectPath)` - now requires project info instead of baseDir
|
|
213
|
+
- `loadScenario(name, includeSecrets, projectId)` - searches globally, optional project filter
|
|
214
|
+
- `listScenarios(projectId, allProjects)` - reads from global index
|
|
215
|
+
- `searchScenarios(query, projectId, allProjects)` - searches global index
|
|
216
|
+
- `deleteScenario(name, projectId)` - finds and deletes from correct project
|
|
217
|
+
- Location: `recorder/scenario-storage.js:191-500`
|
|
218
|
+
|
|
219
|
+
- **Recorder Injection** - Updated to pass project information
|
|
220
|
+
- `injectRecorder(page, projectDir, projectId, projectPath)` - now accepts project details
|
|
221
|
+
- Scenarios saved with project context automatically
|
|
222
|
+
- Location: `recorder/recorder-script.js:1659`
|
|
223
|
+
|
|
224
|
+
### Migration Guide
|
|
225
|
+
- **Old scenarios are inaccessible** - Scenarios in `~/.config/chrometools-mcp/scenarios/` will no longer be found
|
|
226
|
+
- To migrate: Manually move scenarios to new structure or re-record them
|
|
227
|
+
- New structure: `~/.config/chrometools-mcp/projects/{projectName}/scenarios/`
|
|
228
|
+
- **No code changes needed** - All changes are internal, MCP tool interface remains compatible (except removed `directory` parameter)
|
|
229
|
+
|
|
230
|
+
## [1.9.1] - 2025-12-19
|
|
231
|
+
|
|
232
|
+
### Fixed
|
|
233
|
+
- **MCP Protocol Errors** - Fixed "Unexpected token" JSON parsing errors caused by console output
|
|
234
|
+
- Added debug mode (`CHROMETOOLS_DEBUG=true`) to control logging
|
|
235
|
+
- Replaced all `console.log/error` with `debugLog` to prevent STDIO pollution
|
|
236
|
+
- MCP uses STDIO for JSON-RPC, debug logs were breaking the protocol
|
|
237
|
+
- Fixed errors: `"Unexpected token 'c', "[chrometool"... is not valid JSON"`
|
|
238
|
+
- Fixed errors: `"Unexpected token 'S', "[Smart Wait"... is not valid JSON"`
|
|
239
|
+
- Location: `index.js:21-24`, `recorder/scenario-executor.js:15-17`
|
|
240
|
+
|
|
241
|
+
- **Recorder localStorage Corruption** - Added robust error handling for corrupted state data
|
|
242
|
+
- Validates JSON before parsing from localStorage
|
|
243
|
+
- Validates state structure after parsing
|
|
244
|
+
- Automatic cleanup of corrupted data with error logging
|
|
245
|
+
- Location: `recorder/recorder-script.js:64-159`
|
|
246
|
+
|
|
247
|
+
### Added
|
|
248
|
+
- **Scenario Index Enhancement** - Added `entryUrl` and `exitUrl` to scenario index
|
|
249
|
+
- `listScenarios` now returns entry and exit URLs for each scenario
|
|
250
|
+
- Helps identify scenario flow and dependencies
|
|
251
|
+
- Location: `recorder/scenario-storage.js:197-198`
|
|
252
|
+
|
|
253
|
+
### Changed
|
|
254
|
+
- **Code Cleanup** - Removed backup files and improved .gitignore
|
|
255
|
+
- Added `*.bak`, `*.backup`, `*~`, `*.tmp` to .gitignore
|
|
256
|
+
- Removed leftover `index.js.backup` file
|
|
257
|
+
|
|
258
|
+
## [1.9.0] - 2025-12-19
|
|
259
|
+
|
|
260
|
+
### Changed
|
|
261
|
+
- **Default Scenarios Storage Location** - Scenarios now save to `~/.config/chrometools-mcp` by default
|
|
262
|
+
- Previous behavior: auto-detected project root (Git root or cwd) which could be unpredictable
|
|
263
|
+
- New behavior: consistent location in user's home folder (`~/.config/chrometools-mcp`)
|
|
264
|
+
- Can still override with explicit `directory` parameter on recorder tools
|
|
265
|
+
- Improves reliability for AI agents and users without Git repositories
|
|
266
|
+
- Location: `index.js:64`, `index.js:101-119`
|
|
267
|
+
|
|
268
|
+
## [1.8.2] - 2025-12-19
|
|
269
|
+
|
|
270
|
+
### Fixed
|
|
271
|
+
- **Code Generator Bugs** - Fixed multiple issues in test code generators
|
|
272
|
+
- **Python generators**: Fixed comment syntax - now use `#` instead of `//`
|
|
273
|
+
- **Python generators**: Moved `import re` to top of file instead of inline
|
|
274
|
+
- **Java generator**: Fixed variable name conflicts - now uses unique names (`typeElement`, `hoverElement`, etc.) instead of reusing `element`
|
|
275
|
+
- **Java generator**: Added missing imports (`JavascriptExecutor`, `Select`)
|
|
276
|
+
- **All generators**: Implemented language-specific comment generation via `generateComment()` method
|
|
277
|
+
- Location: `utils/code-generators/code-generator-base.js`, `playwright-python.js`, `selenium-python.js`, `selenium-java.js`
|
|
278
|
+
|
|
279
|
+
## [1.8.1] - 2025-12-19
|
|
280
|
+
|
|
281
|
+
### Added
|
|
282
|
+
- **Smart Project Directory Detection** - Scenarios now automatically save to the correct project directory
|
|
283
|
+
- Auto-detection cascade: `CLAUDE_PROJECT_DIR` env var → `PROJECT_DIR` env var → Git root → current working directory
|
|
284
|
+
- Optional `directory` parameter on all recorder tools (`enableRecorder`, `executeScenario`, `listScenarios`, `searchScenarios`, `getScenarioInfo`, `deleteScenario`, `exportScenarioAsCode`)
|
|
285
|
+
- Session memory: once directory is set (explicitly or auto-detected), it's remembered for the entire MCP server session
|
|
286
|
+
- Solves issue where scenarios were saved to unpredictable locations based on where MCP process was launched
|
|
287
|
+
- Location: `utils/project-detector.js`, `index.js:97-115`
|
|
288
|
+
|
|
289
|
+
### Changed
|
|
290
|
+
- **All recorder storage functions now accept `baseDir` parameter** - Breaking change for direct API usage
|
|
291
|
+
- Updated: `saveScenario()`, `loadScenario()`, `listScenarios()`, `searchScenarios()`, `deleteScenario()`, `loadIndex()`, and all other storage functions
|
|
292
|
+
- MCP tool users: no breaking changes, just new optional `directory` parameter
|
|
293
|
+
- Location: `recorder/scenario-storage.js`, `recorder/scenario-executor.js`, `recorder/recorder-script.js`
|
|
294
|
+
|
|
295
|
+
## [1.8.0] - 2025-12-19
|
|
296
|
+
|
|
297
|
+
### Added
|
|
298
|
+
- **Test Code Generation** - New MCP tool `exportScenarioAsCode` for generating executable test code from recorded scenarios
|
|
299
|
+
- Supports 4 test frameworks: Playwright (TypeScript/Python), Selenium (Python/Java)
|
|
300
|
+
- Automatic selector cleaning - removes unstable CSS classes (CSS Modules, styled-components, Emotion, hashed classes)
|
|
301
|
+
- Generates clean, readable test code with comments
|
|
302
|
+
- Smart selector stability analysis with pattern-based detection
|
|
303
|
+
- Fallback selector selection - chooses most stable selector from fallbacks
|
|
304
|
+
- Location: `utils/code-generators/`, `utils/selector-cleaner.js`
|
|
305
|
+
|
|
306
|
+
**Unstable patterns detected:**
|
|
307
|
+
- CSS Modules: `Button_primary__2x3yZ`
|
|
308
|
+
- Styled-components: `sc-AbCdEf-0`
|
|
309
|
+
- Emotion: `css-1a2b3c4d`
|
|
310
|
+
- Hash suffixes: `component_a1b2c3d`
|
|
311
|
+
- Random hashes: `_1a2b3c4d`
|
|
312
|
+
|
|
313
|
+
**Usage:**
|
|
314
|
+
```javascript
|
|
315
|
+
exportScenarioAsCode('checkout', {
|
|
316
|
+
language: 'playwright-typescript',
|
|
317
|
+
cleanSelectors: true,
|
|
318
|
+
includeComments: true
|
|
319
|
+
})
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
## [1.7.4] - 2025-12-19
|
|
323
|
+
|
|
324
|
+
### Changed
|
|
325
|
+
- **executeScenario auto-opens browser** - No longer throws error when no page is open
|
|
326
|
+
- Automatically opens browser at scenario's `entryUrl` if no page is currently open
|
|
327
|
+
- Eliminates need to manually call `openBrowser` before executing scenarios
|
|
328
|
+
- Improves user experience by treating browser opening as a side effect
|
|
329
|
+
- Falls back gracefully: shows error only if scenario has no `entryUrl`
|
|
330
|
+
- Location: `index.js:3417-3469`
|
|
331
|
+
|
|
332
|
+
## [1.7.3] - 2025-12-19
|
|
333
|
+
|
|
334
|
+
### Fixed
|
|
335
|
+
- **Fixed CSS selector generation crash** - `analyzePage` now handles attribute values with special characters
|
|
336
|
+
- Added `isSafeSelectorValue()` function to validate attribute values before using in selectors
|
|
337
|
+
- Filters out attributes containing problematic characters: `["'\\[]{}()]`
|
|
338
|
+
- Added try-catch blocks to prevent selector syntax errors
|
|
339
|
+
- Example: `button[data-counter="["b"]"]` (invalid) is now skipped
|
|
340
|
+
- Location: `element-finder-utils.js:302-360`
|
|
341
|
+
|
|
342
|
+
### Improved
|
|
343
|
+
- **Recorder now skips hidden elements** - Prevents recording actions on invisible elements
|
|
344
|
+
- Added `isElementVisible()` function to check element visibility before recording
|
|
345
|
+
- Checks: offsetWidth/Height, display, visibility, opacity
|
|
346
|
+
- Applies to all event types: click, type, select, upload, hover, drag
|
|
347
|
+
- Prevents scenarios with duplicate/invisible element actions (e.g., Yandex search with hidden input)
|
|
348
|
+
- Console logs when skipping hidden elements for debugging
|
|
349
|
+
- Location: `recorder/recorder-script.js:1173-1188`
|
|
350
|
+
|
|
351
|
+
## [1.7.2] - 2025-12-16
|
|
352
|
+
|
|
353
|
+
### Added
|
|
354
|
+
- **Figma API Token Setup documentation** - Added comprehensive guide on how to obtain and configure Figma Personal Access Token
|
|
355
|
+
- Step-by-step instructions for getting token from Figma account settings
|
|
356
|
+
- Configuration examples for both Claude Desktop and Claude Code
|
|
357
|
+
- Environment variable setup (`FIGMA_TOKEN`)
|
|
358
|
+
- Note about alternative parameter-based token passing
|
|
359
|
+
|
|
360
|
+
## [1.7.1] - 2025-12-15
|
|
361
|
+
|
|
362
|
+
### Performance
|
|
363
|
+
- **Optimized tool descriptions** - Reduced token usage by 35-45% (~1,500-2,000 tokens)
|
|
364
|
+
- Shortened main tool descriptions from verbose to concise format
|
|
365
|
+
- Reduced parameter descriptions (e.g., "CSS selector for element to click" → "CSS selector")
|
|
366
|
+
- Standardized Figma tool parameters (7 tools optimized)
|
|
367
|
+
- Pattern-based reductions across all 41 tools
|
|
368
|
+
- Impact: Saves 1,500-2,000 tokens in every request to Claude
|
|
369
|
+
- Examples:
|
|
370
|
+
- `analyzePage`: 95 tokens → 30 tokens (68% reduction)
|
|
371
|
+
- `screenshot`: 75 tokens → 25 tokens (66% reduction)
|
|
372
|
+
- `listNetworkRequests`: 50 tokens → 20 tokens (60% reduction)
|
|
373
|
+
|
|
374
|
+
### Changed
|
|
375
|
+
- All tool descriptions now use imperative voice and remove redundancy
|
|
376
|
+
- Figma tools: "Figma API token (optional if FIGMA_TOKEN env var is set)" → "API token (optional)"
|
|
377
|
+
- Common patterns: "Milliseconds to wait" → "Wait ms", "Maximum" → "Max", etc.
|
|
378
|
+
|
|
379
|
+
## [1.7.0] - 2025-12-14
|
|
380
|
+
|
|
381
|
+
### Removed
|
|
382
|
+
- **Removed Angular tools** - Removed all 5 Angular-specific tools to reduce context window usage
|
|
383
|
+
- Removed tools: `listAngularComponents`, `getAngularComponent`, `callAngularMethod`, `getAngularForm`, `submitAngularForm`
|
|
384
|
+
- Removed from: tool definitions, handlers, Zod schemas, README documentation
|
|
385
|
+
- Impact: Reduced token usage by ~2500-3000 tokens (~10 pages of context)
|
|
386
|
+
- Tool count: 45 → 40 tools
|
|
387
|
+
|
|
388
|
+
### Changed
|
|
389
|
+
- **Simplified tool descriptions** - Removed Angular references from `screenshot` and `executeScript` descriptions
|
|
390
|
+
- Cleaner, more focused descriptions for remaining tools
|
|
391
|
+
|
|
392
|
+
## [1.6.2] - 2025-12-14
|
|
393
|
+
|
|
394
|
+
### Fixed
|
|
395
|
+
- **Fixed JSON Schema validation error for `callAngularMethod`** - Added missing `items` field to `args` array parameter
|
|
396
|
+
- Error: "array schema missing items" when using with OpenAI/OpenRouter providers
|
|
397
|
+
- Impact: Tool now works correctly with all LLM providers that validate JSON Schema strictly
|
|
398
|
+
- Note: This tool was subsequently removed in v1.7.0
|
|
399
|
+
|
|
400
|
+
## [1.6.1] - 2025-12-03
|
|
401
|
+
|
|
402
|
+
### Changed
|
|
403
|
+
- **Optimized `listNetworkRequests` with pagination** - Added `limit` and `offset` parameters
|
|
404
|
+
- Default limit: 50 requests (max: 500)
|
|
405
|
+
- Returns: `{ totalCount, returnedCount, hasMore, offset, limit, requests: [...] }`
|
|
406
|
+
- Prevents excessive token usage when pages have hundreds of network requests
|
|
407
|
+
- Example: `listNetworkRequests({ limit: 20, offset: 20 })` returns requests 21-40
|
|
408
|
+
|
|
409
|
+
### Performance
|
|
410
|
+
- Reduced token usage for network request inspection on pages with many requests
|
|
411
|
+
- AI receives pagination metadata (`hasMore`, `totalCount`) to request additional pages as needed
|
|
412
|
+
|
|
413
|
+
## [1.6.0] - 2025-12-03
|
|
414
|
+
|
|
415
|
+
### Changed
|
|
416
|
+
- **Code organization improved** - Major refactoring to modular architecture
|
|
417
|
+
- Created `tools/` directory with `tool-schemas.js` (all Zod validation schemas)
|
|
418
|
+
- Created `utils/` directory with specialized utility modules:
|
|
419
|
+
- `css-helpers.js` - CSS categorization and filtering (~133 lines)
|
|
420
|
+
- `screenshot-processor.js` - Screenshot processing and image comparison (~210 lines)
|
|
421
|
+
- `element-actions.js` - Element interaction actions (~115 lines)
|
|
422
|
+
- Total **~712 lines moved to separate modules** for better maintainability
|
|
423
|
+
- Created REFACTORING.md documenting modular structure and future improvements
|
|
424
|
+
|
|
425
|
+
### Benefits
|
|
426
|
+
- **Better code organization** - Related functionality grouped logically
|
|
427
|
+
- **Improved maintainability** - Easier to find and modify specific functionality
|
|
428
|
+
- **Reusability** - Modules can be tested and used independently
|
|
429
|
+
- **Cleaner main file** - index.js reduced by ~20% (712 lines)
|
|
430
|
+
|
|
431
|
+
### Technical Details
|
|
432
|
+
- Backup created (index.js.backup) before refactoring
|
|
433
|
+
- Modules are independent with no circular dependencies
|
|
434
|
+
- Additional utility modules prepared for future integration (browser-manager, network-monitor, recorder-helper)
|
|
435
|
+
|
|
436
|
+
## [1.5.0] - 2025-12-02
|
|
437
|
+
|
|
438
|
+
### Added
|
|
439
|
+
- **6 new Figma tools** - Major enhancement to Figma integration (total: 9 Figma tools)
|
|
440
|
+
- `parseFigmaUrl` - Parse full Figma URLs to extract fileKey and nodeId automatically
|
|
441
|
+
- `listFigmaPages` - Browse entire file structure: all pages and frames with IDs
|
|
442
|
+
- `searchFigmaFrames` - Search frames/components by name across entire file
|
|
443
|
+
- `getFigmaComponents` - Extract all components (Design System)
|
|
444
|
+
- `getFigmaStyles` - Get all shared styles (colors, text, effects, grids)
|
|
445
|
+
- `getFigmaColorPalette` - Extract complete color palette with usage statistics
|
|
446
|
+
- **figma-tools.js module** - All Figma functionality moved to dedicated module for better organization
|
|
447
|
+
- **URL support for all Figma tools** - All tools now accept full Figma URLs or fileKeys
|
|
448
|
+
- **Automatic URL parsing** - No need to manually extract fileKey and nodeId from Figma links
|
|
449
|
+
|
|
450
|
+
### Changed
|
|
451
|
+
- **Figma code refactored** - Moved all Figma functions to separate figma-tools.js module
|
|
452
|
+
- **Improved Figma workflow** - Use `listFigmaPages` → `searchFigmaFrames` → specific tool workflow
|
|
453
|
+
|
|
454
|
+
### Use Cases
|
|
455
|
+
- Browse Figma files without opening Figma UI
|
|
456
|
+
- Extract design system components and styles
|
|
457
|
+
- Generate CSS variables from color palette
|
|
458
|
+
- Find frames by name across all pages
|
|
459
|
+
- Copy-paste Figma URLs directly into tools
|
|
460
|
+
|
|
461
|
+
## [1.4.0] - 2025-12-02
|
|
462
|
+
|
|
463
|
+
### Added
|
|
464
|
+
- **getFigmaSpecs text extraction** - Extract all text content from Figma designs (buttons, labels, headings, paragraphs)
|
|
465
|
+
- `textContent`: Direct text for TEXT nodes with character count
|
|
466
|
+
- `allTextContent`: Array of all text nodes (name, text, visibility) from entire tree
|
|
467
|
+
- `textSummary`: Statistics (total nodes, visible nodes, combined text)
|
|
468
|
+
- Recursive extraction from all child elements
|
|
469
|
+
- Example use: Get button labels, form placeholders, UI copy from designs
|
|
470
|
+
- **getComputedCss filtering** - Intelligent CSS property filtering to reduce token usage from ~14k to ~1-2k tokens
|
|
471
|
+
- `category` parameter: Filter by 'layout', 'typography', 'colors', 'visual', or 'all' (default)
|
|
472
|
+
- `properties` parameter: Request specific CSS properties (e.g., `['color', 'font-size']`)
|
|
473
|
+
- `includeDefaults` parameter: Optionally include/exclude properties with default values (default: false)
|
|
474
|
+
- Returns metadata: total properties, filtered count, applied filters
|
|
475
|
+
- Example: `{ selector: ".header", category: "layout" }` returns only layout-related properties
|
|
476
|
+
|
|
477
|
+
### Changed
|
|
478
|
+
- **getFigmaSpecs children structure enhanced** - Now includes text content and dimensions for all child elements
|
|
479
|
+
|
|
480
|
+
### Performance
|
|
481
|
+
- **getComputedCss now 7-14x more efficient** - Filtering reduces output from ~300 properties to 10-50 properties
|
|
482
|
+
- Default behavior (no filters) filters out default values, reducing typical response from ~14k to ~3-5k tokens
|
|
483
|
+
|
|
484
|
+
## [1.3.8] - 2025-12-02
|
|
485
|
+
|
|
486
|
+
### Added
|
|
487
|
+
- **Automatic image compression to 3 MB limit** - All screenshots and Figma images are now automatically compressed if they exceed 3 MB
|
|
488
|
+
- Images are first compressed by reducing JPEG quality (from 85 to 10 in steps of 10)
|
|
489
|
+
- If quality reduction is insufficient, images are scaled down to fit within the size limit
|
|
490
|
+
- PNG images that exceed 3 MB are automatically converted to JPEG and compressed
|
|
491
|
+
- Compression metadata includes: final file size, quality level, compression ratio, number of compression attempts
|
|
492
|
+
|
|
493
|
+
### Changed
|
|
494
|
+
- `processScreenshot` function now includes `maxFileSize` parameter (default: 3 MB)
|
|
495
|
+
- `getFigmaFrame` now applies automatic compression to exported Figma images
|
|
496
|
+
- `compareFigmaToElement` now compresses all three images (Figma design, page screenshot, difference map)
|
|
497
|
+
- All image processing preserves original dimensions by default, only scaling down if necessary to meet size limits
|
|
498
|
+
|
|
499
|
+
## [1.3.7] - 2025-12-01
|
|
500
|
+
|
|
501
|
+
### Added
|
|
502
|
+
- **Angular-specific tools** - 5 new tools for working with Angular applications
|
|
503
|
+
- `listAngularComponents` - Discover all Angular components on page with methods/properties
|
|
504
|
+
- `getAngularComponent` - Get detailed info about specific component (methods, properties, state)
|
|
505
|
+
- `callAngularMethod` - Call component methods reliably with auto change detection
|
|
506
|
+
- `getAngularForm` - Get form data, validation state, errors (ReactiveFormsModule & Template-driven)
|
|
507
|
+
- `submitAngularForm` - Submit forms with automatic fallback strategies (method → button → event)
|
|
508
|
+
- **`waitForElement`** - Wait for elements to appear (autocomplete, lazy loading, dynamic content)
|
|
509
|
+
|
|
510
|
+
### Fixed (additional)
|
|
511
|
+
- **`findElementsByText` token overflow** - removed `fullText`, added visibility check, limit 20 results
|
|
512
|
+
- Prioritizes visible elements over hidden ones
|
|
513
|
+
- Now returns `truncated: true` when results are limited
|
|
514
|
+
|
|
515
|
+
### Fixed
|
|
516
|
+
- **Auto-reconnection after Chrome closure**
|
|
517
|
+
- Browser now automatically reconnects when Chrome is closed and reopened with debug port
|
|
518
|
+
- Added `browser.isConnected()` check before reusing cached browser instance
|
|
519
|
+
- Added `disconnected` event handler to reset browser state
|
|
520
|
+
- Fixes "Connection closed" error when Chrome debug session is manually restarted
|
|
521
|
+
- **scrollTo tool now works correctly**
|
|
522
|
+
- Fixed incorrect usage of `element.scrollIntoView()` method (not available in Puppeteer ElementHandle)
|
|
523
|
+
- Now uses `page.evaluate()` to properly execute `scrollIntoView()` in browser context
|
|
524
|
+
- Added `block: 'center'` for better element positioning
|
|
525
|
+
- Increased wait time to 500ms for smooth scrolling completion
|
|
526
|
+
|
|
527
|
+
### Changed
|
|
528
|
+
- **Angular tools descriptions updated** - emphasize use BEFORE executeScript
|
|
529
|
+
- `getAngularComponent` - marked as PREFERRED over executeScript with ng.getComponent
|
|
530
|
+
- `getAngularForm` - now returns both value and rawValue (shows disabled controls!)
|
|
531
|
+
- `executeScript` - explicit warnings: DO NOT use for Angular (use specialized tools instead)
|
|
532
|
+
- **`analyzePage` description updated** - clarified use AFTER page changes (clicks, submissions, AJAX)
|
|
533
|
+
- Now emphasizes `refresh:true` to get current state after interactions
|
|
534
|
+
- Compares favorably to screenshot for debugging (2-5k vs 15-25k tokens, actual data vs visual)
|
|
535
|
+
- **`screenshot` description updated** - clarified when NOT to use (debugging data, after clicks)
|
|
536
|
+
- Emphasizes use for visual comparison only, not for inspecting form values or state
|
|
537
|
+
- **Network monitoring split into 3 specialized tools** (massive token reduction)
|
|
538
|
+
- `listNetworkRequests` - compact summary (requestId, method, URL, status only)
|
|
539
|
+
- `getNetworkRequest` - full details of single request by requestId
|
|
540
|
+
- `filterNetworkRequests` - filter by URL pattern with full details
|
|
541
|
+
- Replaces monolithic `getNetworkRequests` with targeted workflow
|
|
542
|
+
- **`analyzePage` description emphasizes REQUIRED usage on every page**
|
|
543
|
+
- Tool descriptions updated to prioritize `analyzePage` over manual element searching
|
|
544
|
+
- `executeScript` description clarified as last resort after `analyzePage`
|
|
545
|
+
- `smartFindElement` now recommends `analyzePage` first for better performance
|
|
546
|
+
- `getElement` now recommends `analyzePage` for bulk element inspection
|
|
547
|
+
- `getBrowser()` now validates connection status before returning cached browser
|
|
548
|
+
- Browser promise is reset on disconnect for automatic reconnection
|
|
549
|
+
- `scrollTo` implementation rewritten to use proper Puppeteer API
|
|
550
|
+
|
|
551
|
+
### Removed
|
|
552
|
+
- `getNetworkRequests` tool (replaced by 3 specialized tools above)
|
|
553
|
+
|
|
554
|
+
## [1.3.6] - 2025-12-01
|
|
555
|
+
|
|
556
|
+
### Changed
|
|
557
|
+
- **Optimized getNetworkRequests output for reduced token usage**
|
|
558
|
+
- Default filter now Fetch/XHR only (excludes images, scripts, stylesheets, etc.)
|
|
559
|
+
- Minified JSON payloads (request/response bodies now compact, no whitespace)
|
|
560
|
+
- Essential headers only (content-type, authorization, x-api-key, set-cookie)
|
|
561
|
+
- Conditional fields (error details only on failure, cache flag only when true)
|
|
562
|
+
- Duration calculation instead of separate timestamp fields
|
|
563
|
+
|
|
564
|
+
### Performance
|
|
565
|
+
- Significantly reduced output size (50-80% reduction typical)
|
|
566
|
+
- Better for AI context windows with large API traces
|
|
567
|
+
- Essential data preserved, noise eliminated
|
|
568
|
+
|
|
569
|
+
## [1.3.5] - 2025-01-26
|
|
570
|
+
|
|
571
|
+
### Added
|
|
572
|
+
- **Request/Response payload and headers now included in getNetworkRequests**
|
|
573
|
+
- `postData` - POST request body (e.g., form data, JSON payload)
|
|
574
|
+
- `requestHeaders` - Request headers
|
|
575
|
+
- `responseHeaders` - Response headers
|
|
576
|
+
|
|
577
|
+
### Changed
|
|
578
|
+
- `getNetworkRequests` now returns complete request/response details
|
|
579
|
+
- Essential for debugging API calls with payloads
|
|
580
|
+
|
|
581
|
+
### Example
|
|
582
|
+
```javascript
|
|
583
|
+
getNetworkRequests({ urlPattern: 'send_otp' })
|
|
584
|
+
|
|
585
|
+
// Now returns:
|
|
586
|
+
{
|
|
587
|
+
"url": "http://localhost:4200/api/auth/send_otp/",
|
|
588
|
+
"method": "POST",
|
|
589
|
+
"postData": "{\"phone\":\"+79001234567\"}", // ← NEW!
|
|
590
|
+
"requestHeaders": { // ← NEW!
|
|
591
|
+
"content-type": "application/json",
|
|
592
|
+
"authorization": "Bearer ..."
|
|
593
|
+
},
|
|
594
|
+
"responseHeaders": { // ← NEW!
|
|
595
|
+
"content-type": "application/json"
|
|
596
|
+
},
|
|
597
|
+
"status": 200,
|
|
598
|
+
...
|
|
599
|
+
}
|
|
600
|
+
```
|
|
601
|
+
|
|
602
|
+
## [1.3.4] - 2025-01-26
|
|
603
|
+
|
|
604
|
+
### Fixed
|
|
605
|
+
- **Network monitoring now persists across page navigations** - auto-reinitializes on navigation
|
|
606
|
+
- Network requests are now captured correctly after form submissions, link clicks, and redirects
|
|
607
|
+
- Added WeakSet tracking to prevent duplicate CDP session setup
|
|
608
|
+
- Added 100ms debounce on navigation to ensure stability
|
|
609
|
+
|
|
610
|
+
### Changed
|
|
611
|
+
- Refactored network monitoring into `setupNetworkMonitoring()` helper function
|
|
612
|
+
- Network monitoring automatically re-enables on framenavigated events
|
|
613
|
+
- Global `networkRequests[]` array preserves history across all navigations
|
|
614
|
+
|
|
615
|
+
### Technical Details
|
|
616
|
+
- CDP (Chrome DevTools Protocol) session is recreated on each navigation
|
|
617
|
+
- Network.enable is automatically re-sent after navigation completes
|
|
618
|
+
- Request history accumulates across multiple pages in the same session
|
|
619
|
+
- Use `getNetworkRequests({ clear: true })` to reset history when needed
|
|
620
|
+
|
|
621
|
+
### Example Use Case
|
|
622
|
+
```javascript
|
|
623
|
+
// 1. Open login page
|
|
624
|
+
openBrowser({ url: 'https://app.com/login' })
|
|
625
|
+
// Network monitoring: ✅ active
|
|
626
|
+
|
|
627
|
+
// 2. Fill form and submit (navigates to /dashboard)
|
|
628
|
+
click({ selector: 'button[type="submit"]' })
|
|
629
|
+
// Network monitoring: ✅ auto-reinitialized
|
|
630
|
+
// Captures POST /api/login, GET /dashboard, etc.
|
|
631
|
+
|
|
632
|
+
// 3. Check all requests from both pages
|
|
633
|
+
getNetworkRequests({ types: ['XHR', 'Fetch'] })
|
|
634
|
+
// Returns requests from /login AND /dashboard
|
|
635
|
+
```
|
|
636
|
+
|
|
637
|
+
## [1.3.3] - 2025-01-26
|
|
638
|
+
|
|
639
|
+
### Added
|
|
640
|
+
- `getNetworkRequests` tool - monitor all network requests (XHR, Fetch, API calls, resources)
|
|
641
|
+
- Network monitoring via Chrome DevTools Protocol (CDP)
|
|
642
|
+
- Automatic capture of all HTTP/HTTPS requests from page load
|
|
643
|
+
- Filter requests by type (XHR, Fetch, Script, Document, etc.)
|
|
644
|
+
- Filter by status (pending, completed, failed)
|
|
645
|
+
- Filter by URL pattern (regex support)
|
|
646
|
+
- Request details include: URL, method, status, headers, timing, cache info, errors
|
|
647
|
+
|
|
648
|
+
### Changed
|
|
649
|
+
- Network.enable added to CDP session setup in getOrCreatePage
|
|
650
|
+
- Global networkRequests array for request storage
|
|
651
|
+
|
|
652
|
+
### Examples
|
|
653
|
+
```javascript
|
|
654
|
+
// Get all network requests
|
|
655
|
+
getNetworkRequests()
|
|
656
|
+
|
|
657
|
+
// Get only XHR and Fetch requests (API calls)
|
|
658
|
+
getNetworkRequests({
|
|
659
|
+
types: ['XHR', 'Fetch']
|
|
660
|
+
})
|
|
661
|
+
|
|
662
|
+
// Get failed requests
|
|
663
|
+
getNetworkRequests({
|
|
664
|
+
status: 'failed'
|
|
665
|
+
})
|
|
666
|
+
|
|
667
|
+
// Get requests to specific API
|
|
668
|
+
getNetworkRequests({
|
|
669
|
+
urlPattern: 'api\\.example\\.com'
|
|
670
|
+
})
|
|
671
|
+
|
|
672
|
+
// Get requests and clear history
|
|
673
|
+
getNetworkRequests({
|
|
674
|
+
types: ['XHR', 'Fetch'],
|
|
675
|
+
clear: true
|
|
676
|
+
})
|
|
677
|
+
```
|
|
678
|
+
|
|
679
|
+
## [1.3.2] - 2025-01-26
|
|
680
|
+
|
|
681
|
+
### Added
|
|
682
|
+
- `action` parameter for `smartFindElement` - perform actions (click, type, scrollTo, screenshot, hover, setStyles) on the best match immediately
|
|
683
|
+
- `action` parameter for `findElementsByText` - perform actions on the first matching element immediately
|
|
684
|
+
- New helper function `executeElementAction` for unified action execution
|
|
685
|
+
|
|
686
|
+
### Changed
|
|
687
|
+
- `smartFindElement` can now execute actions on found elements in a single call
|
|
688
|
+
- `findElementsByText` can now execute actions on found elements in a single call
|
|
689
|
+
- Reduces need for separate find + action calls, improving performance
|
|
690
|
+
|
|
691
|
+
### Examples
|
|
692
|
+
```javascript
|
|
693
|
+
// Find and click in one call
|
|
694
|
+
smartFindElement({
|
|
695
|
+
description: 'login button',
|
|
696
|
+
action: { type: 'click' }
|
|
697
|
+
})
|
|
698
|
+
|
|
699
|
+
// Find and type in one call
|
|
700
|
+
findElementsByText({
|
|
701
|
+
text: 'Email',
|
|
702
|
+
action: { type: 'type', text: 'user@example.com' }
|
|
703
|
+
})
|
|
704
|
+
|
|
705
|
+
// Find, style and screenshot
|
|
706
|
+
smartFindElement({
|
|
707
|
+
description: 'submit button',
|
|
708
|
+
action: {
|
|
709
|
+
type: 'setStyles',
|
|
710
|
+
styles: [{ name: 'background', value: 'red' }],
|
|
711
|
+
screenshot: true
|
|
712
|
+
}
|
|
713
|
+
})
|
|
714
|
+
```
|
|
715
|
+
|
|
716
|
+
## [1.3.1] - 2025-01-26
|
|
717
|
+
|
|
718
|
+
### Performance Improvements
|
|
719
|
+
- **BREAKING BEHAVIOR CHANGE**: `click` and `executeScript` commands no longer capture screenshots by default
|
|
720
|
+
- Screenshots were causing significant performance overhead (2-10x slowdown)
|
|
721
|
+
- Add `screenshot: true` parameter to explicitly request screenshots when needed
|
|
722
|
+
- This is backward compatible but changes default behavior for better performance
|
|
723
|
+
|
|
724
|
+
### Added
|
|
725
|
+
- `screenshot` parameter for `click` command (boolean, default: `false`)
|
|
726
|
+
- `screenshot` parameter for `executeScript` command (boolean, default: `false`)
|
|
727
|
+
- `timeout` parameter for `click` command (number, default: `30000ms`)
|
|
728
|
+
- `timeout` parameter for `executeScript` command (number, default: `30000ms`)
|
|
729
|
+
|
|
730
|
+
### Changed
|
|
731
|
+
- `click` command now executes 2-10x faster without screenshots
|
|
732
|
+
- `executeScript` command now executes 2-10x faster without screenshots
|
|
733
|
+
- Both commands now have 30-second timeout by default to prevent hanging
|
|
734
|
+
|
|
735
|
+
### Fixed
|
|
736
|
+
- Commands no longer hang indefinitely if operations fail
|
|
737
|
+
- Reduced memory usage by not capturing unnecessary screenshots
|
|
738
|
+
|
|
739
|
+
### Migration
|
|
740
|
+
If you relied on automatic screenshots, add `screenshot: true` to your calls:
|
|
741
|
+
```javascript
|
|
742
|
+
// Before (v1.3.0 and earlier)
|
|
743
|
+
await click({ selector: 'button' }) // Always included screenshot
|
|
744
|
+
|
|
745
|
+
// After (v1.3.1+)
|
|
746
|
+
await click({ selector: 'button', screenshot: true }) // Explicitly request screenshot
|
|
747
|
+
await click({ selector: 'button' }) // Fast mode (no screenshot)
|
|
748
|
+
```
|
|
749
|
+
|
|
750
|
+
## [1.3.0] - Previous version
|
|
751
|
+
- Scenario recorder with auto-reinjection
|
|
752
|
+
- Smart element finder
|
|
753
|
+
- Page analysis tools
|
|
754
|
+
- Figma integration
|
|
755
|
+
|
|
756
|
+
## Earlier versions
|
|
757
|
+
See git history for details.
|