@dyyz1993/agent-browser 0.23.0 → 0.25.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/README.md +108 -0
- package/bin/agent-browser-darwin-arm64 +0 -0
- package/dist/__tests__/utils/free-port.d.ts +2 -0
- package/dist/__tests__/utils/free-port.d.ts.map +1 -0
- package/dist/__tests__/utils/free-port.js +18 -0
- package/dist/__tests__/utils/free-port.js.map +1 -0
- package/dist/__tests__/utils/parseCli.d.ts.map +1 -1
- package/dist/__tests__/utils/parseCli.js +0 -8
- package/dist/__tests__/utils/parseCli.js.map +1 -1
- package/dist/actions.d.ts.map +1 -1
- package/dist/actions.js +32 -12
- package/dist/actions.js.map +1 -1
- package/dist/browser.d.ts.map +1 -1
- package/dist/browser.js +12 -17
- package/dist/browser.js.map +1 -1
- package/dist/cli/commands.d.ts.map +1 -1
- package/dist/cli/commands.js +11 -13
- package/dist/cli/commands.js.map +1 -1
- package/dist/cli/connection.d.ts.map +1 -1
- package/dist/cli/connection.js +86 -47
- package/dist/cli/connection.js.map +1 -1
- package/dist/cli/flags.d.ts +1 -0
- package/dist/cli/flags.d.ts.map +1 -1
- package/dist/cli/flags.js +8 -1
- package/dist/cli/flags.js.map +1 -1
- package/dist/cli/help.d.ts.map +1 -1
- package/dist/cli/help.js +75 -23
- package/dist/cli/help.js.map +1 -1
- package/dist/cli/output.d.ts.map +1 -1
- package/dist/cli/output.js +0 -32
- package/dist/cli/output.js.map +1 -1
- package/dist/cli.js +150 -15
- package/dist/cli.js.map +1 -1
- package/dist/daemon.d.ts.map +1 -1
- package/dist/daemon.js +285 -280
- package/dist/daemon.js.map +1 -1
- package/dist/flow/exporters/cypress.d.ts +9 -0
- package/dist/flow/exporters/cypress.d.ts.map +1 -0
- package/dist/flow/exporters/cypress.js +256 -0
- package/dist/flow/exporters/cypress.js.map +1 -0
- package/dist/flow/exporters/index.d.ts +2 -0
- package/dist/flow/exporters/index.d.ts.map +1 -1
- package/dist/flow/exporters/index.js +2 -0
- package/dist/flow/exporters/index.js.map +1 -1
- package/dist/flow/exporters/selenium.d.ts +9 -0
- package/dist/flow/exporters/selenium.d.ts.map +1 -0
- package/dist/flow/exporters/selenium.js +298 -0
- package/dist/flow/exporters/selenium.js.map +1 -0
- package/dist/flow/flow-executor.d.ts +2 -0
- package/dist/flow/flow-executor.d.ts.map +1 -1
- package/dist/flow/flow-executor.js +143 -49
- package/dist/flow/flow-executor.js.map +1 -1
- package/dist/flow/index.d.ts +1 -1
- package/dist/flow/index.d.ts.map +1 -1
- package/dist/flow/index.js +1 -1
- package/dist/flow/index.js.map +1 -1
- package/dist/flow/output.js.map +1 -1
- package/dist/flow/plugin-system.d.ts.map +1 -1
- package/dist/flow/plugin-system.js.map +1 -1
- package/dist/flow/presets/console-capture.js +31 -0
- package/dist/flow/presets/fetch-capture.js +78 -0
- package/dist/flow/presets/sse-stream.js +67 -0
- package/dist/flow/presets/xhr-only.js +34 -0
- package/dist/flow/recorder-to-flow.js.map +1 -1
- package/dist/flow/site-manager.js.map +1 -1
- package/dist/flow/types.d.ts +15 -0
- package/dist/flow/types.d.ts.map +1 -1
- package/dist/flow/yaml-parser.d.ts.map +1 -1
- package/dist/flow/yaml-parser.js +2 -0
- package/dist/flow/yaml-parser.js.map +1 -1
- package/dist/human-mouse.d.ts.map +1 -1
- package/dist/protocol.d.ts.map +1 -1
- package/dist/protocol.js +1 -12
- package/dist/protocol.js.map +1 -1
- package/dist/rc-config.d.ts.map +1 -1
- package/dist/rc-config.js +1 -2
- package/dist/rc-config.js.map +1 -1
- package/dist/snapshot-store.d.ts +6 -0
- package/dist/snapshot-store.d.ts.map +1 -1
- package/dist/snapshot-store.js +15 -0
- package/dist/snapshot-store.js.map +1 -1
- package/dist/snapshot.d.ts.map +1 -1
- package/dist/snapshot.js +48 -30
- package/dist/snapshot.js.map +1 -1
- package/dist/stream-server-standalone.d.ts.map +1 -1
- package/dist/stream-server-standalone.js.map +1 -1
- package/dist/stream-server.d.ts.map +1 -1
- package/dist/stream-server.js +38 -13
- package/dist/stream-server.js.map +1 -1
- package/dist/test-live.js +5 -5
- package/dist/test-live.js.map +1 -1
- package/dist/types.d.ts +2 -10
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/viewer-script.d.ts.map +1 -1
- package/dist/viewer-script.js +8 -2
- package/dist/viewer-script.js.map +1 -1
- package/package.json +12 -3
- package/scripts/check_goods_container.js +35 -0
- package/scripts/check_page_content.js +36 -0
- package/scripts/click_applause_rate.js +30 -0
- package/scripts/explore_jd_page.js +31 -0
- package/scripts/extract_all_jd_data.js +80 -0
- package/scripts/extract_jd_product_detail.js +62 -0
- package/scripts/extract_jd_products_correct_links.js +78 -0
- package/scripts/extract_jd_products_final.js +80 -0
- package/scripts/extract_jd_reviews.js +48 -0
- package/scripts/extract_jd_seafood_final.js +78 -0
- package/scripts/extract_multiple_products.js +77 -0
- package/scripts/extract_products_no_scroll.js +68 -0
- package/scripts/extract_products_simple.js +68 -0
- package/scripts/find_applause_rate.js +26 -0
- package/scripts/find_jd_links.js +28 -0
- package/scripts/find_main_content.js +20 -0
- package/scripts/find_product_cards.js +38 -0
- package/scripts/find_root_content.js +26 -0
- package/scripts/find_unique_products.js +55 -0
- package/scripts/get_jd_product_detail.js +16 -0
- package/scripts/get_jd_products.js +23 -0
- package/scripts/get_jd_seafood_products.js +44 -0
- package/scripts/get_product_details_from_images.js +54 -0
- package/scripts/verify-form.sh +67 -0
- package/scripts/verify-login.sh +65 -0
- package/scripts/verify-recording.sh +80 -0
- package/scripts/verify-upload.sh +41 -0
- package/skills/agent-browser/SKILL.md +49 -0
- package/bin/agent-browser-linux-x64 +0 -0
|
@@ -167,6 +167,55 @@ The command succeeds with a yellow warning in the output:
|
|
|
167
167
|
|
|
168
168
|
To target a specific element, use `find nth <index> text "X" --click` or a more specific CSS selector (`#id`, `[data-testid]`).
|
|
169
169
|
|
|
170
|
+
### Self-Healing Replay
|
|
171
|
+
|
|
172
|
+
When replaying recorded flows, the engine automatically tries fallback selectors and element identity matching when the primary selector fails. This makes replays resilient to DOM changes, class renames, and structural reorganizations.
|
|
173
|
+
|
|
174
|
+
Healing strategies (tried in order):
|
|
175
|
+
|
|
176
|
+
1. **fallback** — Try the top-3 alternative selectors captured during recording
|
|
177
|
+
2. **identity_text** — Match by tagName + visible text content
|
|
178
|
+
3. **identity_attr** — Match by tagName + stable attribute combination
|
|
179
|
+
4. **identity_parent** — Match by parent signature + position
|
|
180
|
+
|
|
181
|
+
The healing log is included in flow results when `--output json` is used:
|
|
182
|
+
|
|
183
|
+
```bash
|
|
184
|
+
agent-browser flow run my-site.my-flow --output json
|
|
185
|
+
# healingLog entries show which strategy succeeded and the original vs healed selector
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
### Script Export
|
|
189
|
+
|
|
190
|
+
Flows and recordings can be exported as standalone scripts that run without agent-browser:
|
|
191
|
+
|
|
192
|
+
```bash
|
|
193
|
+
# Export as Playwright TypeScript
|
|
194
|
+
agent-browser flow export recording.yaml --format playwright
|
|
195
|
+
|
|
196
|
+
# Export as Python Playwright
|
|
197
|
+
agent-browser flow export recording.yaml --format python
|
|
198
|
+
|
|
199
|
+
# With options
|
|
200
|
+
agent-browser flow export recording.yaml --format playwright --headless
|
|
201
|
+
agent-browser flow export recording.yaml --format python --base-url https://staging.example.com
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
Options:
|
|
205
|
+
|
|
206
|
+
- `--format <playwright|python>` — Export format (required)
|
|
207
|
+
- `--headless` — Include headless mode in the exported script
|
|
208
|
+
- `--base-url <url>` — Override base URL in the exported script
|
|
209
|
+
|
|
210
|
+
### Enhanced Recording
|
|
211
|
+
|
|
212
|
+
The recorder captures additional metadata beyond basic selectors, enabling self-healing replay and robust script export:
|
|
213
|
+
|
|
214
|
+
- **Fallback selectors** — Top-3 alternative CSS selectors per element, so replay can recover when the primary selector breaks
|
|
215
|
+
- **Element identity** — tagName, visible text, key attributes, and parent signature for fuzzy matching
|
|
216
|
+
- **SPA URL change detection** — Tracks `pushState` and `replaceState` calls to accurately record navigation in single-page applications
|
|
217
|
+
- **DOM stability signals** — Uses MutationObserver to wait for DOM settling before capturing selectors, avoiding stale captures during dynamic rendering
|
|
218
|
+
|
|
170
219
|
### Snapshot --all (Include Visually Hidden Elements)
|
|
171
220
|
|
|
172
221
|
By default, `snapshot -i --selectors` only includes elements that are visually visible. Elements with `opacity: 0`, zero dimensions, or positioned off-screen are filtered out.
|
|
Binary file
|