Commit Graph

105 Commits

Author SHA1 Message Date
Asen's Agent 350f4fa8db chore: version packages (cli v1.0.2)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-03 14:32:01 +08:00
asensagent 4ee5e44703 docs: remove search and get from help and skills (#476)
docs: remove search and get commands from help and skills

Search and get commands are being removed from the CLI. This removes
all references from help output, SKILL.md, and command-reference.md.
The workflow now starts directly with browser automation via snapshot.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-03 14:29:42 +08:00
mcfn.feng ee83689aa2 [packages/cli]docs: add 1.0.1 entry to CHANGELOG 2026-04-02 23:35:48 +08:00
mcfn.feng 8aa6116cbd [packages/cli]chore: bump version to 1.0.1 (npm rejected 1.0.0 re-publish) 2026-04-02 23:34:40 +08:00
Junliang Feng fcf79b96f1 fix: Windows build, E2E stability, README in npm, workflow_dispatch (#471) 2026-04-02 23:27:23 +08:00
mcfn.feng a171ea2192 [root]fix: copy root README.md to CLI package before npm publish 2026-04-02 23:23:56 +08:00
Junliang Feng b706b2b291 fix: gate Unix-specific APIs for Windows build (#470) 2026-04-02 23:09:54 +08:00
mcfn.feng 6a2b6010fd [packages/cli]fix: increase Chrome startup timeout to 30s and relax snapshot assertion
- Increase DevTools URL discovery timeout from 15s to 30s for CI environments
- Relax snap_selector_flag_limits_subtree assertion to allow ±2 node tolerance
- Increase E2E test workflow timeout to 20 minutes
2026-04-02 23:01:55 +08:00
mcfn.feng fd0dfe3f63 [packages/cli]fix: gate Unix-specific APIs behind #[cfg(unix)] for Windows build
- server.rs: gate flock, kill FFI, UnixListener, SIGHUP behind #[cfg(unix)]
- chrome_reaper.rs: gate SIGTERM FFI, fall back to child.kill() on Windows
- client.rs: gate UnixStream usage, return error on non-Unix platforms
2026-04-02 22:49:36 +08:00
github-actions[bot] 8b55277dad chore: version packages 2026-04-02 14:27:45 +00:00
mcfn.feng 00a9b8ef14 [feat] update version 2026-04-02 20:02:06 +08:00
mcfn.feng c2a2a43de5 [packages/cli]fix: select fixture uses DOM APIs to avoid TrustedHTML error
Chrome 146+ may enforce Trusted Types on certain pages, causing
innerHTML assignments to fail. Replace innerHTML with createElement
+ appendChild in install_select_fixture.
2026-04-02 18:13:32 +08:00
mcfn.feng 5cee89cde8 [packages/cli]fix: type/press key events not reaching correct tab + contenteditable fix
Three issues fixed:

1. Input.dispatchKeyEvent routes to Chrome's active tab, ignoring sessionId.
   - type: add Target.activateTarget before key dispatch loop
   - press: add Target.activateTarget before key dispatch

2. type command used minimal key definitions (just key+text) which didn't
   trigger native text insertion on contenteditable elements.
   - Reuse key_definition() from press module for full CDP key definitions
     (code, windowsVirtualKeyCode, nativeVirtualKeyCode, unmodifiedText)

3. Contenteditable e2e test fixture had element at top:500px, whose center
   (y=531) exceeded headless viewport height (513), causing click to miss.
   - Changed to top:200px

Closes ACT-822
2026-04-02 18:02:23 +08:00
mcfn.feng 66b732b84e [packages/cli]chore: bump version to 1.0.0-alpha.10 2026-04-02 17:49:20 +08:00
Junliang Feng ead3cbe740 fix(cli): support contenteditable elements in type/fill/focus (#461) 2026-04-02 17:44:26 +08:00
AlexZ a2024fbcb1 [packages/cli]chore: fix formatting in contenteditable test
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 17:41:29 +08:00
AlexZ 7ab8a7c576 [packages/cli]fix: support contenteditable elements in type/fill/focus commands
CDP DOM.focus fails on contenteditable divs (e.g., Lark/Notion/Slate editors)
with "Element is not focusable" (-32000). This change adds a JS .focus()
fallback and click-to-place-cursor for rich text editors.

Changes:
- Add TabContext::focus_element() with JS .focus() fallback when DOM.focus fails
- type command: detect contenteditable and click element center to establish
  cursor position (required by Slate/ProseMirror internal cursor management)
- fill/focus commands: use focus_element() instead of raw DOM.focus
- Add E2E tests for type and focus on contenteditable elements

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 17:39:34 +08:00
mcfn.feng ca4303a73d [packages/cli]chore: bump version to 1.0.0-alpha.9 2026-04-02 17:23:37 +08:00
mcfn.feng f472fd2912 [packages/cli]fix: graceful Chrome shutdown via SIGTERM before SIGKILL
Send SIGTERM first so Chrome can flush Preferences (window placement,
cookies, etc.), wait up to 3s for graceful exit, then fall back to
SIGKILL. This allows Chrome to restore window position and size on
next launch.
2026-04-02 17:15:26 +08:00
mcfn.feng 4128749c00 Merge branch 'bugfix/remove-device-metrics-override' into release/1.0.0 2026-04-02 17:08:30 +08:00
mcfn.feng 4f833ac38a [feat] update version. 2026-04-02 17:08:04 +08:00
Junliang Feng b486d8a476 fix(cli): remove setDeviceMetricsOverride to avoid bot detection (#458)
[packages/cli]fix: remove setDeviceMetricsOverride and hardcoded window-size to avoid bot detection

setDeviceMetricsOverride creates detectable inconsistencies between
window.outerWidth/innerWidth and screen dimensions that anti-fingerprint
scripts use to flag automated browsers. The hardcoded --window-size
Chrome arg is also removed to let the browser use its default size.
2026-04-02 17:05:49 +08:00
mcfn.feng ac13df5522 [packages/cli]fix: remove setDeviceMetricsOverride and hardcoded window-size to avoid bot detection
setDeviceMetricsOverride creates detectable inconsistencies between
window.outerWidth/innerWidth and screen dimensions that anti-fingerprint
scripts use to flag automated browsers. The hardcoded --window-size
Chrome arg is also removed to let the browser use its default size.
2026-04-02 17:04:51 +08:00
Junliang Feng 7cbff7fc00 [codex] cli: keep setup and switch its browser modes to local/cloud (#455) 2026-04-02 16:50:47 +08:00
mcfn.feng 9a1d5a756a cli: fix setup clippy lint 2026-04-02 16:42:24 +08:00
mcfn.feng 192905515f cli: restore setup command entrypoint 2026-04-02 16:30:26 +08:00
mcfn.feng 0758c9ef62 [packages/cli]feat: add --session get-or-create and --tab alias for browser commands
browser start --session sid: get-or-create semantics — reuses existing
session if found, creates with that ID if not. Works for both local and
cloud modes. Conflicts with --set-session-id (which always force-creates).

browser new-tab --tab tid: visible alias for --set-tab-id — creates tab
with custom ID, returns TAB_ID_CONFLICT on duplicate.
2026-04-02 16:21:56 +08:00
mcfn.feng d358a27ed0 cli: remove setup command and mark it coming soon 2026-04-02 16:17:34 +08:00
mcfn.feng 8af064f04b cli: switch setup browser modes to local/cloud 2026-04-02 16:13:22 +08:00
mcfn.feng 13abe9370d [packages/cli]fix: key events not reaching correct tab in multi-tab sessions
Input.dispatchKeyEvent always routes to Chrome's active/foreground tab,
ignoring the CDP sessionId. This caused type and press commands to
silently fail when the target tab was not the active one.

- type: replace per-character Input.dispatchKeyEvent with Input.insertText
  which correctly routes via CDP session. Also faster (1 CDP call vs 2N).
- press: add Target.activateTarget before dispatching key events since
  functional keys (Enter, Tab, etc.) require Input.dispatchKeyEvent.
- type: add contentEditable support for cursor positioning (Selection/Range
  API fallback when setSelectionRange is unavailable).

Closes ACT-822
2026-04-02 16:10:17 +08:00
mcfn.feng 969ef0e038 cli: rename setup isolated mode to local 2026-04-02 16:00:22 +08:00
mcfn.feng 69df3da59f [packages/cli]chore: bump version to 1.0.0-alpha.6 2026-04-02 15:15:47 +08:00
asensagent d824149fe6 docs(cli): remove deprecated -i/-c/--cursor from snapshot help (#452)
* docs(cli): remove -i/-c/--cursor from snapshot help, mention path output

These flags are being deprecated. Updated snapshot after_help and
command-reference.md to remove all -i/-c/--cursor examples. Added note
about the path field in snapshot output.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* docs(cli): keep -i/-c in snapshot help, remove only --cursor, add sample output

Per @junliang-mk: -i (interactive) and -c (compact) stay, only --cursor
is removed from help. Added sample snapshot output showing the tree
structure with refs, links, combobox, and clickable elements.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* docs(cli): describe default snapshot as all-inclusive, remove flag descriptions

Default snapshot contains everything. Use additional flags as needed.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-02 13:56:08 +08:00
Junliang Feng d2f9ab93e0 fix: send mouseMoved before mousePressed in dispatch_click (#220)
* [packages/cli]fix: send mouseMoved before mousePressed in dispatch_click (#220)

SPA frameworks (React Router, Vue Router, Next.js) require a prior
mouseMoved event to establish pointer hover state before the click
event synthesizes correctly. Without it, the router's click listener
never fires and the URL remains unchanged (url_changed: false).

Add a single mouseMoved dispatch at (x, y) with button=none before
the existing mousePressed/mouseReleased loop — matches Playwright's
standard click implementation.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* [packages/cli]test: fix click_spa_navigation — use hash for pushState in about:blank (#220)

history.pushState with a path-only URL (/spa-destination) throws a
SecurityError in about:blank (null origin). Use a hash fragment
(#spa-destination) instead, which is always allowed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-02 13:15:06 +08:00
asensagent 60ecefc56b docs(skills): rewrite command-reference.md for CLI v2 (#447) 2026-04-02 13:13:11 +08:00
Asen's Agent bca164412a docs(cli): simplify quick start heading
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-02 13:10:13 +08:00
Asen's Agent 0a565680d5 docs(cli): remove trailing snapshot and -i flag from quick start
Snapshot output is now stored in a yml file so full snapshots are fine.
Remove the redundant second snapshot and drop -i from the first.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-02 13:09:30 +08:00
Junliang Feng 66e74cb139 test: add click_spa_navigation E2E test (#220)
[packages/cli]test: add click_spa_navigation E2E test (#220)

Injects a SPA-style fixture (history.pushState on click with
preventDefault) into about:blank and verifies that browser click
triggers the router handler and returns url_changed=true.

Tests the mouseMoved fix — will fail until dispatch_click sends
mouseMoved before mousePressed in click.rs.

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-02 13:08:40 +08:00
Asen's Agent 0790ba9c4b docs(cli): rewrite quick start as cohesive Airbnb search flow
Follow a single scenario through search → get → browser automation,
using snapshot refs (@eN) for interactions instead of CSS selectors.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-02 13:05:42 +08:00
Asen's Agent 2d78be5830 docs(cli): use more realistic search example in quick start
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-02 13:03:13 +08:00
mcfn.feng fc8a3300ad [packages/cli]fix: set-based inflight tracking + stale eviction for network-idle
Replace simple i64 counter with HashMap<requestId, Instant> per session
(Playwright-style set tracking). Requests whose loadingFinished fires on
a different CDP session (cross-origin iframes) are automatically evicted
after 3 seconds, preventing permanent counter inflation.

Key changes:
- TabNetPending: HashMap<String, i64> → HashMap<String, HashMap<String, Instant>>
- network_pending() evicts entries older than 3s before counting
- Exclude WebSocket, EventSource, favicon, data: from tracking
- Redirect requests don't double-count (requestId reuse)
- Comprehensive unit test for skip/undercount scenarios

Results:
- flightaware.com: 30s timeout → 4s (was stuck on WebSocket)
- costcotravel.com: 30s timeout → 2.6s
- healthline.com: still times out (needs per-frame tracking — follow-up)

TODO: Implement Playwright-style per-frame idle tracking to handle
sites with heavy cross-origin iframe tracking (Facebook pixel, etc.)
2026-04-02 12:52:47 +08:00
Asen's Agent 2b8d28f375 feat(cli): add after_help to search and get commands, remove --api-key from help
Add usage examples to search (query construction, domain/url filters,
pagination) and get (area_id format examples). Also remove --api-key
from top-level help since it's reserved for future use.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-02 12:52:43 +08:00
mcfn.feng df258b8194 [packages/cli]fix: track skipped requestIds to prevent undercount + handle redirects
Address Codex bot P1 review finding: skipping favicon/data: URLs on
requestWillBeSent without also skipping their loadingFinished would
undercount active requests, causing premature network-idle.

Changes:
- Maintain `skipped_request_ids` HashSet to track suppressed requests
- loadingFinished/loadingFailed checks the set and suppresses delta
- Add EventSource exclusion (persistent like WebSocket)
- Handle redirect double-counting (redirectResponse → don't re-increment)
- Add comprehensive unit test covering all skip/undercount scenarios
2026-04-02 12:21:32 +08:00
mcfn.feng a7a61d7e4d [packages/cli]fix: exclude WebSocket/favicon/data: from network-idle pending count
WebSocket upgrade requests fire `Network.requestWillBeSent` but never
`Network.loadingFinished`, leaving the pending counter stuck at ≥1
and causing `wait network-idle` to always time out on sites with
persistent WebSocket connections (analytics, real-time features).

Align with Playwright's behaviour by excluding:
- WebSocket upgrades (type == "WebSocket")
- Favicon requests (url ends with /favicon.ico)
- data: URLs (not intercepted by Network Service)

Before: healthline.com 30s timeout, flightaware.com ~25s
After:  healthline.com 523ms, flightaware.com 514ms
2026-04-02 11:58:46 +08:00
mcfn.feng 5e7a636721 [feat] update version. 2026-04-02 02:53:23 +08:00
mcfn.feng 7a6a240715 [packages/cli]chore: relocate api and commands modules from cli-v2 to cli
Move new files added in upstream release/1.0.0 from the old
packages/cli-v2/ path to packages/cli/ after merge.
2026-04-02 02:21:04 +08:00
mcfn.feng 4d4a437a40 Merge remote-tracking branch 'origin/release/1.0.0' into feat/update-repo 2026-04-02 02:20:01 +08:00
mcfn.feng ebd0f6f416 [doc] remove useless doc. 2026-04-02 01:14:35 +08:00
mcfn.feng 22fd6b2ebc [root]docs: update actionbook-rs references in dify-plugin and cli docs
Fix P1 from review: dify-plugin comments referenced deleted
actionbook-rs paths. Also remove "v2" from IFRAME_DESIGN.md.
2026-04-02 00:55:21 +08:00
mcfn.feng 58545129de [root]refactor: remove actionbook-rs, promote cli-v2 to packages/cli
- Delete packages/actionbook-rs/ (legacy 0.x CLI)
- Delete old packages/cli/ (JS npm wrapper for 0.x)
- Rename packages/cli-v2/ → packages/cli/ (git mv)
- Merge npm wrapper files (bin/actionbook.js, scripts/postinstall.js) into new cli/
- Update package.json: name → @actionbookdev/cli, private → false, add npm distribution fields
- Update sync-versions.js: point Cargo.toml/Cargo.lock sync at packages/cli/
- Update release.yml: build from packages/cli/ instead of packages/actionbook-rs/
- Update test.yml: paths and working-directory from cli-v2 → cli
- Update CLAUDE.md, CONTRIBUTING.md, docs, issue templates
- Delete stale changeset (fix-screenshot-timeout.md)
- Keep 6 platform binary packages unchanged
2026-04-02 00:46:12 +08:00