chrometools-mcp 2.5.0 → 3.1.3

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.
Files changed (48) hide show
  1. package/CHANGELOG.md +433 -0
  2. package/COMPONENT_MAPPING_SPEC.md +1217 -0
  3. package/README.md +510 -57
  4. package/bridge/bridge-client.js +472 -0
  5. package/bridge/bridge-service.js +399 -0
  6. package/bridge/install.js +241 -0
  7. package/browser/browser-manager.js +107 -2
  8. package/browser/page-manager.js +226 -69
  9. package/docs/CHROME_EXTENSION.md +219 -0
  10. package/docs/PAGE_OBJECT_MODEL_CONCEPT.md +1756 -0
  11. package/extension/background.js +643 -0
  12. package/extension/content.js +715 -0
  13. package/extension/icons/create-icons.js +164 -0
  14. package/extension/icons/icon128.png +0 -0
  15. package/extension/icons/icon16.png +0 -0
  16. package/extension/icons/icon48.png +0 -0
  17. package/extension/manifest.json +58 -0
  18. package/extension/popup/popup.css +437 -0
  19. package/extension/popup/popup.html +102 -0
  20. package/extension/popup/popup.js +415 -0
  21. package/extension/recorder-overlay.css +93 -0
  22. package/index.js +3347 -2901
  23. package/models/BaseInputModel.js +93 -0
  24. package/models/CheckboxGroupModel.js +199 -0
  25. package/models/CheckboxModel.js +103 -0
  26. package/models/ColorInputModel.js +53 -0
  27. package/models/DateInputModel.js +67 -0
  28. package/models/RadioGroupModel.js +126 -0
  29. package/models/RangeInputModel.js +60 -0
  30. package/models/SelectModel.js +97 -0
  31. package/models/TextInputModel.js +34 -0
  32. package/models/TextareaModel.js +59 -0
  33. package/models/TimeInputModel.js +49 -0
  34. package/models/index.js +122 -0
  35. package/package.json +3 -2
  36. package/pom/apom-converter.js +267 -0
  37. package/pom/apom-tree-converter.js +515 -0
  38. package/pom/element-id-generator.js +175 -0
  39. package/recorder/page-object-generator.js +16 -0
  40. package/recorder/scenario-executor.js +80 -2
  41. package/server/tool-definitions.js +839 -713
  42. package/server/tool-groups.js +1 -1
  43. package/server/tool-schemas.js +367 -326
  44. package/server/websocket-bridge.js +447 -0
  45. package/utils/selector-resolver.js +186 -0
  46. package/utils/ui-framework-detector.js +392 -0
  47. package/RELEASE_NOTES_v2.5.0.md +0 -109
  48. package/npm_publish_output.txt +0 -0
package/CHANGELOG.md CHANGED
@@ -2,6 +2,439 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## [3.1.3] - 2026-01-27
6
+
7
+ ### Changed
8
+ - **README.md installation section reorganization** — Improved installation documentation
9
+ - Moved Installation section to the top for better visibility
10
+ - Added Claude Code (CLI) installation with `claude mcp add chrometools-mcp` command
11
+ - Separated installation instructions by client type (Claude Code, Claude Desktop, Cursor, Antigravity, Other MCP Clients)
12
+ - Added detailed step-by-step instructions for Cursor IDE (MCP Settings via Command Palette)
13
+ - Added detailed step-by-step instructions for Google Antigravity (MCP Store → Manage → View raw config)
14
+ - Added configuration file paths for Claude Desktop (macOS/Linux/Windows)
15
+ - Added notes about Antigravity's 100-tool limit and optimal configuration
16
+ - Removed duplicate Installation/Usage sections
17
+
18
+ ## [3.1.2] - 2026-01-26
19
+
20
+ ### Added
21
+ - **Multi-tab scenario recording** — Automatic recording of tab switches during scenario capture
22
+ - When user switches tabs during recording, an `openTab` action is automatically recorded
23
+ - Records tab URL, title, and switch reason for accurate playback
24
+ - Only records if switching to a different tab (ignores same-tab activations)
25
+ - Location: `extension/background.js` (chrome.tabs.onActivated listener)
26
+
27
+ ### Changed
28
+ - **openTab navigation strategy** — Changed from `networkidle2` to `domcontentloaded` in scenario executor
29
+ - Prevents timeout errors when opening tabs with continuous ad/tracking loading
30
+ - Consistent with other navigation improvements in 3.1.1
31
+ - Location: `recorder/scenario-executor.js:979`
32
+
33
+ ### Fixed
34
+ - **openTab with empty URL uses look-ahead to next action's URL** — Smart URL detection for tab switches
35
+ - When openTab has empty URL, executor looks at next action's tabUrl
36
+ - If next action has real URL, uses it for tab opening/switching
37
+ - Fixes scenarios where new tab was opened but URL loaded immediately after
38
+ - Empty URLs without look-ahead match are still skipped (prevents about:blank tabs)
39
+ - Location: `recorder/scenario-executor.js:168-176, 987-990`
40
+
41
+ - **Added 500ms delay before tab switch** — Prevents race conditions during scenario playback
42
+ - Allows previous tab's pending processes (navigation, AJAX, form submissions) to complete
43
+ - Ensures stable state before switching to new tab
44
+ - Location: `recorder/scenario-executor.js:990-992`
45
+
46
+ ## [3.1.1] - 2026-01-26
47
+
48
+ ### Fixed
49
+ - **Scenario recording and saving flow** — Fixed critical bugs preventing scenario recording
50
+ - Fixed Extension → Bridge → MCP communication flow for recording control
51
+ - `startRecording` now properly sends command to Extension via Bridge WebSocket
52
+ - `stopRecording` correctly retrieves recorded actions from Extension state
53
+ - `saveScenario` now successfully saves scenarios to correct project directory
54
+ - Recording state properly synchronized between Extension popup and MCP tools
55
+ - Location: `index.js` (startRecording/stopRecording/saveScenario handlers)
56
+
57
+ - **Navigation timeout for slow websites** — Fixed timeout errors on sites with continuous loading
58
+ - Increased navigation timeout from 30s to 60s
59
+ - Changed wait strategy from `networkidle2` to `domcontentloaded` (less strict)
60
+ - Fixes timeout errors on sites like Yahoo that continuously load ads and tracking scripts
61
+ - Location: `browser/page-manager.js:188-193`
62
+
63
+ ### Changed
64
+ - **Improved WebSocket message handling** — Better error reporting and state management
65
+ - Bridge now properly forwards recording commands to Extension
66
+ - MCP server correctly receives recording state updates from Bridge
67
+ - Clear error messages when Extension is not connected or recording fails
68
+
69
+ ## [3.1.0] - 2026-01-26
70
+
71
+ ### Added
72
+ - **Native Messaging Bridge Architecture** — complete rewrite of Extension ↔ MCP communication
73
+ - Bridge Service runs as Native Messaging Host (launched by Chrome with Extension)
74
+ - MCP servers connect as WebSocket clients (not servers)
75
+ - Supports 0-8 simultaneous MCP clients connecting/disconnecting at any time
76
+ - Full state (tabs, recordings) sent immediately on client connect
77
+ - No more scanning delays — instant connection to persistent Bridge
78
+
79
+ - **CLI commands for Bridge management**
80
+ - `--install-bridge` — Install Native Messaging Bridge (one-time setup)
81
+ - `--uninstall-bridge` — Remove Bridge installation
82
+ - `--check-bridge` — Verify Bridge is installed
83
+ - `--help` — Show all CLI options
84
+
85
+ - **Stable Extension ID** via manifest key
86
+ - Extension ID is now deterministic: `dmehkibmncgphijnigkahhlekgajhpbl`
87
+ - Required for Native Messaging Host registration
88
+
89
+ - **New extension icons** — Chrome/robot themed design (16, 48, 128px)
90
+
91
+ ### Changed
92
+ - **Extension is now Event Producer** — sends all events to Bridge, doesn't manage WebSocket connections
93
+ - **MCP is now Event Consumer** — connects to Bridge as client, receives state on demand
94
+ - **Bridge lifecycle** — starts with Chrome Extension, stops when Chrome closes
95
+ - Removed port scanning (9223-9227) — Bridge uses single fixed port 9223
96
+
97
+ ### Architecture
98
+ ```
99
+ Chrome Extension (producer) → Native Messaging → Bridge Service (:9223) ← WebSocket ← MCP clients (0-8)
100
+ ```
101
+
102
+ ### Migration
103
+ 1. Run `npx chrometools-mcp --install-bridge` once
104
+ 2. Reload Extension in chrome://extensions
105
+ 3. Use normally — MCP auto-connects to Bridge
106
+
107
+ ## [3.0.4] - 2026-01-26
108
+
109
+ ### Added
110
+ - **Smart tab tracking for scenario recording**
111
+ - Recording automatically follows the active tab
112
+ - When user switches tabs during recording, an `openTab` action is recorded
113
+ - When user opens new tab, an `openTab` action is recorded
114
+ - Actions from non-active tabs are automatically filtered out
115
+ - `openTab` action ensures tab exists during playback (opens tab with URL if not exists)
116
+ - Scenario executor supports `openTab` with automatic tab reuse and creation
117
+ - **MCP tools for programmatic recording control**
118
+ - `startRecording` - Start recording from AI/code
119
+ - `stopRecording` - Stop and retrieve recorded actions
120
+ - `getRecorderState` - Query current recording state
121
+ - `saveScenario` - Save recorded actions as scenario
122
+ - AI agents can now fully control recording without manual interaction
123
+
124
+ ### Changed
125
+ - Recording now tracks `currentTabId` instead of being locked to `startTabId`
126
+ - Content scripts only send actions when their tab is the active recording target
127
+ - Replaced `switchTab`/`newTab` with unified `openTab` action type
128
+ - `openTab` intelligently checks if tab already exists before creating new one
129
+ - `enableRecorder` now mentions programmatic control tools
130
+
131
+ ## [3.0.3] - 2026-01-25
132
+
133
+ ### Added
134
+ - **Multi-instance MCP server support** via dynamic port allocation
135
+ - MCP server automatically finds available port from range 9223-9227
136
+ - Chrome Extension scans for running MCP instances every 20 seconds (port scanning)
137
+ - Extension connects to multiple MCP servers simultaneously (broadcast pattern)
138
+ - Enables multiple AI clients (Claude Desktop, Telegram bot, etc.) to work in parallel
139
+ - Graceful handling of ungraceful shutdowns (kill -9) via WebSocket.onclose
140
+
141
+ ### Changed
142
+ - **Auto-sync active tab when user switches tabs manually**
143
+ - MCP server now syncs Puppeteer's `lastPage` when extension reports `tab_activated`
144
+ - Callback pattern avoids circular dependencies between websocket-bridge and page-manager
145
+ - MCP commands automatically target the user's currently active tab
146
+
147
+ ### Fixed
148
+ - **Input recording deduplication** in Chrome Extension
149
+ - Extension now records only final text value after blur/Enter or 1.5s pause
150
+ - Eliminated intermediate keystroke recordings (e.g., "test" → "test1" recorded as one action)
151
+ - Improved debouncing with `inputStartValues` tracking
152
+
153
+ ## [3.0.2] - 2026-01-25
154
+
155
+ ### Added
156
+ - **Extension installation instructions for AI agents**
157
+ - `listTabs`, `switchTab`, `enableRecorder` now include install steps when extension not connected
158
+ - `openBrowser` shows warning when connected to existing Chrome (extension needs manual install)
159
+ - Clear step-by-step instructions with extension path for manual installation
160
+ - Alternative fix: close all Chrome windows and restart MCP for auto-install
161
+
162
+ ### Changed
163
+ - Improved extension status reporting with `extensionConnected` flag in responses
164
+
165
+ ## [3.0.1] - 2026-01-25
166
+
167
+ ### Fixed
168
+ - **Multi-tab support** - Fixed extension-based tab switching
169
+ - `switchTab` now uses Chrome Extension for reliable tab switching
170
+ - Auto-connects Puppeteer to switched tab (fixes `analyzePage` after tab switch)
171
+ - `puppeteerConnected: true` in response confirms Puppeteer sync
172
+
173
+ ## [3.0.0] - 2026-01-25
174
+
175
+ ### BREAKING CHANGES
176
+ - **Chrome Extension for Recording** - Scenario recording now requires Chrome Extension
177
+ - Old HTML-injection recorder (`injectRecorder`) removed
178
+ - Extension auto-loads when Chrome is started by chrometools-mcp
179
+ - Recording controlled via Extension popup (click CT icon in toolbar)
180
+
181
+ ### Added
182
+ - **ChromeTools Chrome Extension** (`extension/` folder)
183
+ - Full tab tracking via Chrome tabs API (catches ALL new tabs including Ctrl+T, context menu)
184
+ - Scenario recording via content script (works across all domains)
185
+ - Popup UI for recording control
186
+ - WebSocket connection to MCP server for real-time communication
187
+
188
+ - **WebSocket Bridge** (`server/websocket-bridge.js`)
189
+ - Bidirectional communication between Extension and MCP server
190
+ - Port 9223 (CHROME_DEBUG_PORT + 1)
191
+ - Tab state sync, recorder commands, scenario save/list
192
+
193
+ - **Auto-load Extension** - Chrome launched with `--load-extension` flag
194
+ - Extension automatically installed when Chrome starts
195
+ - No manual installation required
196
+
197
+ ### Changed
198
+ - `enableRecorder` tool now checks Extension connection status instead of injecting HTML
199
+ - Tab tracking improved: Extension provides complete tab list including manually opened tabs
200
+ - Recording state persisted in `chrome.storage.local` (survives cross-domain navigation)
201
+
202
+ ### Removed
203
+ - `recorder-script.js` HTML injection functionality (still exists for reference)
204
+ - `pagesWithRecorder` tracking (Extension handles this now)
205
+ - `setupRecorderAutoReinjection` function (Extension handles this now)
206
+
207
+ ## [2.9.0] - 2026-01-25
208
+
209
+ ### Added
210
+ - **Automatic new tab detection** - Tracks tabs opened via `window.open()`, `target="_blank"`, or user actions
211
+ - New tabs automatically become the active page
212
+ - Network monitoring, console capture, and recorder auto-injection enabled on new tabs
213
+ - New tab events queued for AI notification via `listTabs`
214
+
215
+ - **`listTabs` tool** - List all open browser tabs
216
+ - Returns: `{ tabs: [{ index, url, title, isActive }], totalCount }`
217
+ - Includes `newTabsDetected` array when new tabs were opened since last check
218
+ - Use tab index with `switchTab` to change active tab
219
+
220
+ - **`switchTab` tool** - Switch between browser tabs
221
+ - Parameters: `tab` - Tab index (number) or URL pattern (string, partial match)
222
+ - Makes the specified tab active for subsequent commands
223
+ - Returns: `{ success, switchedTo: { url, title } }`
224
+
225
+ ### Changed
226
+ - `openPages` Map now tracks all tabs including those opened externally
227
+ - Browser `targetcreated` event handler added for automatic tab tracking
228
+
229
+ ## [2.8.0] - 2026-01-25
230
+
231
+ ### Added
232
+ - **`getElementByApomId` tool** - Get detailed element information by APOM ID
233
+ - Parameters: `id` (required) - APOM element ID from analyzePage (e.g., `"input_20"`)
234
+ - Returns: Full element details including bounds, attributes, computed styles, visibility
235
+ - Use case: Inspect specific elements without re-analyzing entire page
236
+
237
+ ### Changed
238
+ - **APOM format optimization** - ~82% token reduction
239
+ - Tree-structured output with hierarchical parent-child relationships
240
+ - Minified JSON output (no pretty printing)
241
+ - Parent nodes contain only position info (no bounds/metadata)
242
+ - Interactive elements retain full details (bounds, type, metadata)
243
+ - Groups section for radio/checkbox groups with options
244
+
245
+ - **Separate `id` and `selector` parameters** for click, type, hover, selectOption
246
+ - **PREFERRED**: Use `id` parameter with APOM ID from analyzePage (e.g., `click({ id: "button_45" })`)
247
+ - **ALTERNATIVE**: Use `selector` parameter with CSS selector (e.g., `click({ selector: ".submit" })`)
248
+ - Parameters are mutually exclusive (use one or the other)
249
+ - Makes API clearer: agent knows exactly what it's passing
250
+ - Updated tool descriptions with PREFERRED/ALTERNATIVE guidance
251
+
252
+ ### Removed
253
+ - **`registerPageObject` tool** - No longer needed
254
+ - `analyzePage()` now automatically registers elements with unique IDs
255
+ - Use APOM IDs directly with click/type/hover/selectOption tools
256
+ - Simplifies workflow: just call `analyzePage()` and use the returned IDs
257
+
258
+ ### Performance
259
+ - APOM token usage reduced from ~31,000 to ~5,684 tokens on typical pages
260
+ - Tree structure eliminates redundant parent information
261
+ - Minified JSON further reduces output size
262
+
263
+ ## [2.7.0] - 2026-01-25
264
+
265
+ ### 🔄 BREAKING CHANGE
266
+ - **`analyzePage` now returns APOM format by default**
267
+ - Previous default was legacy format, now APOM is default
268
+ - Use `useLegacyFormat: true` to get old format if needed
269
+ - Migration: `analyzePage()` now returns APOM instead of legacy
270
+ - Rationale: APOM is superior - provides unique IDs, better structure, automatic registration
271
+
272
+ ### Added
273
+ - **🎉 Agent Page Object Model (APOM) - Now Default Format**
274
+ - `analyzePage()` returns structured APOM format (no parameters needed!)
275
+ - New parameter: `useLegacyFormat` - Return old format (default: false)
276
+ - Parameter: `registerElements` - Auto-register elements (default: true)
277
+ - Parameter: `groupBy: 'type' | 'flat'` - Control element grouping
278
+ - Returns: `{ pageId, url, title, timestamp, elements, groups, metadata }`
279
+ - Each element gets unique ID: `input_0`, `button_1`, `form_0`, `radio_0`, `checkbox_0`
280
+ - Elements automatically registered in persistent `window.__ELEMENT_REGISTRY__`
281
+ - **Use IDs instead of CSS selectors**: `type({ id: "input_0", text: "..." })`
282
+ - **Backward compatible**: Set `useLegacyFormat: true` for old format
283
+ - **Tested**: Fully functional with real-world forms
284
+
285
+ - **New POM Modules**
286
+ - `pom/element-id-generator.js` (171 lines) - Smart ID generation
287
+ - Priority: data-testid > id attribute > semantic path + index
288
+ - Supports: input, button, link, form, textarea, select, radio, checkbox
289
+ - `pom/apom-converter.js` (294 lines) - Convert analyzePage to APOM
290
+ - Transforms legacy format to structured model
291
+ - Groups elements by type (forms, inputs, buttons, links)
292
+ - Generates pageId, metadata
293
+
294
+ - **Input Models Architecture** - Modular input handling system
295
+ - New `models/` directory with specialized input handlers
296
+ - `BaseInputModel` - Abstract base class with common interface (setValue, getValue, clear, focus)
297
+ - `TextInputModel` - Default for text-like inputs (text, email, password, search, tel, url)
298
+ - `TimeInputModel` - Correct handling for `input[type="time"]` via JavaScript value assignment
299
+ - `DateInputModel` - Handles date, datetime-local, month, week inputs
300
+ - `ColorInputModel` - Color picker input handling
301
+ - `RangeInputModel` - Slider/range input handling
302
+ - `SelectModel` - HTML `<select>` element handling
303
+ - `CheckboxModel` - Single checkbox toggle
304
+ - `TextareaModel` - Multi-line text input
305
+ - `InputModelFactory` - Factory pattern for selecting appropriate model
306
+ - Fixes issue where keyboard input didn't work for time inputs (only minutes showed)
307
+
308
+ - **Radio/Checkbox Group Models** - Abstract group-level operations
309
+ - `RadioGroupModel` - Select single option from radio group by name, value, or label text
310
+ - `CheckboxGroupModel` - Multi-select from checkbox group with modes:
311
+ - `set` - Replace all selections
312
+ - `add` - Check additional values
313
+ - `remove` - Uncheck specific values
314
+ - `toggle` - Flip specific values
315
+
316
+ - **`selectFromGroup` tool** - New MCP tool for radio/checkbox group selection
317
+ - Parameters: `name` (required), `value`, `values`, `text`, `texts`, `mode`, `by`
318
+ - Works with radio groups (single selection) and checkbox groups (multi-selection)
319
+ - Match by value attribute or label text (`by: 'value' | 'text' | 'auto'`)
320
+ - Example: `selectFromGroup({ name: "size", value: "large" })`
321
+ - Example: `selectFromGroup({ name: "toppings", values: ["cheese", "bacon"], mode: "add" })`
322
+
323
+ - **Radio/Checkbox Groups in `analyzePage`**
324
+ - APOM output now includes `groups` section with radio and checkbox groups
325
+ - Each group shows: name, all options with values, labels, checked state
326
+ - Labels extracted from: parent `<label>`, `<label for="id">`, aria-label attribute
327
+ - Example output:
328
+ ```json
329
+ "groups": {
330
+ "radio": {
331
+ "size": {
332
+ "options": [
333
+ { "value": "small", "label": "Small", "checked": false },
334
+ { "value": "large", "label": "Large", "checked": true }
335
+ ]
336
+ }
337
+ },
338
+ "checkbox": { ... }
339
+ }
340
+ ```
341
+
342
+ ### Fixed
343
+ - **Critical Bug**: Variable shadowing in analyzePage APOM conversion (commit e1e63e2)
344
+ - Fixed `const analysis` shadowing in else block causing undefined analysis
345
+ - **Critical Bug**: Element registry not persisting across page.evaluate calls (commit faadd0e)
346
+ - Changed `const elementRegistry = new Map()` to `window.__ELEMENT_REGISTRY__`
347
+ - Registry now persists between tool calls
348
+ - All selector-resolver functions exported to window
349
+ - **API Error**: `oneOf` not supported at top level in tool schemas
350
+ - Removed `oneOf` blocks from click, type, hover, selectOption tool definitions
351
+ - Both `id` and `selector` parameters now optional with description indicating one is required
352
+ - Fixes error: `tools.19.custom.input_schema: input_schema does not support oneOf, allOf, or anyOf at the top level`
353
+
354
+ ### Changed
355
+ - **`analyzePage` enhanced with APOM support**
356
+ - Now supports both legacy and APOM formats
357
+ - Cache logic updated to handle generateIds parameter
358
+ - Elements automatically registered when generateIds=true
359
+ - Radio/checkbox elements now include label text
360
+
361
+ - **`utils/selector-resolver.js` updated for persistence**
362
+ - Registry stored in `window.__ELEMENT_REGISTRY__` instead of local const
363
+ - All functions (registerElement, resolveSelector, etc.) exported to window
364
+ - Survives across multiple page.evaluate contexts
365
+
366
+ - **`navigateTo` auto-opens browser** - No longer throws error when no page is open
367
+ - Automatically opens browser at specified URL if no page is currently open
368
+ - Eliminates need to manually call `openBrowser` before navigation
369
+ - Falls back gracefully with informative message
370
+
371
+ - **`type` tool uses Input Models** - Automatically selects appropriate model based on input type
372
+ - Time inputs now correctly set full value (e.g., "18:30" not just "30")
373
+ - Date inputs work without keyboard simulation issues
374
+ - All specialized inputs handled by their respective models
375
+
376
+ ### Technical Details
377
+ - APOM conversion happens in browser context via page.evaluate
378
+ - Element IDs remain stable across page refreshes (based on testid/id/structure)
379
+ - Dual selector mode: all tools accept both IDs and CSS selectors
380
+ - Input models use JavaScript value assignment with proper event dispatching
381
+
382
+ ## [2.6.0] - 2026-01-25
383
+
384
+ ### Added
385
+ - **UI Framework Detection** - Automatic detection of UI component libraries (MUI, Ant Design, Chakra UI, Bootstrap, Vuetify, Semantic UI)
386
+ - New utility: `utils/ui-framework-detector.js`
387
+ - Detects framework name, version, and component type for each element
388
+ - Integrated into `analyzePage` - all elements now include `uiFramework` field
389
+ - Extracts options from both native `<select>` and custom framework dropdowns
390
+
391
+ - **Enhanced Select/Dropdown Options Extraction** - Smart extraction of dropdown options from various UI libraries
392
+ - Native HTML `<select>` with `<optgroup>` support
393
+ - Material-UI (MUI) Select components
394
+ - Ant Design Select components
395
+ - Chakra UI, Bootstrap, Vuetify, Semantic UI dropdowns
396
+ - Options include: value, text, index, selected, disabled, group
397
+ - Handles cases where options aren't rendered until dropdown opens (with informative notes)
398
+
399
+ - **Page Object ID Support** - Use element IDs instead of CSS selectors
400
+ - New utility: `utils/selector-resolver.js` - Registry for Page Object element IDs
401
+ - New tool: `registerPageObject` - Register elements from Page Object for use with IDs
402
+ - **Backward compatible**: All interaction tools (click, type, selectOption, hover, etc.) now accept BOTH:
403
+ - Page Object IDs (e.g., `"login_email_input"`)
404
+ - CSS selectors (e.g., `"input[name='email']"`)
405
+ - Element registry persists in page context between tool calls
406
+
407
+ - **`registerPageObject` tool** - Register Page Object elements for ID-based interaction
408
+ - Parameters:
409
+ - `elements` (required) - Array of {id, selector, metadata}
410
+ - `clearExisting` (optional) - Clear registry before registering
411
+ - Enables using meaningful IDs instead of fragile CSS selectors
412
+ - Example: After registering, use `click("login_submit_button")` instead of `click("button[type='submit']")`
413
+
414
+ - **Enhanced Page Object Generation** - Page Objects now include comprehensive element information
415
+ - Each element gets unique ID: `{name}_{timestamp}_{random}`
416
+ - Select elements include full options array with groups
417
+ - UI framework detection for all elements
418
+ - Metadata includes: type, label, placeholder, required, validation hints
419
+
420
+ ### Changed
421
+ - **`analyzePage` enhanced with UI framework detection**
422
+ - All form fields and inputs now include `uiFramework` field
423
+ - Select elements use smart extraction: works with both vanilla HTML and UI frameworks
424
+ - Better handling of MUI, Ant Design, and other component libraries
425
+
426
+ - **All interaction tools now support dual selector mode**
427
+ - Tools affected: `click`, `type`, `selectOption`, `hover`, `scrollTo`, `drag`, `setStyles`
428
+ - Automatically resolves Page Object IDs to CSS selectors
429
+ - Error messages indicate whether identifier was Page Object ID or CSS selector
430
+ - No breaking changes - existing CSS selector usage works unchanged
431
+
432
+ ### Technical Details
433
+ - Selector resolution happens in page context using injected `selector-resolver.js`
434
+ - UI framework detection uses class names, data attributes, and DOM structure analysis
435
+ - Element registry stored in browser page context (survives navigation within same page)
436
+ - New helper function `resolveSelector(page, identifier)` in `index.js`
437
+
5
438
  ## [2.5.0] - 2026-01-21
6
439
 
7
440
  ### Added