Commit Graph

58 Commits

Author SHA1 Message Date
mcfn 1ec2fdcbff [packages/cli]fix: await Promise in eval command via awaitPromise CDP flag
Runtime.evaluate without awaitPromise returns the Promise object itself,
which serializes to {} since Promises have no enumerable properties.
Setting awaitPromise: true makes CDP wait for resolution, matching
Playwright's behavior.
2026-04-10 17:11:31 +08:00
mcfn 2238c15e64 Merge branch 'main' of github.com:actionbook/actionbook 2026-04-10 14:55:15 +08:00
sen 86905ebe11 feat(cli): restore extension browser mode with bridge relay (#486)
* [packages/cli]feat: restore extension browser mode with bridge relay

Add a WebSocket bridge server inside the daemon that transparently
relays CDP messages between the Chrome extension and CdpSession.
Extension mode was removed in v1.0.0; this restores it with minimal
changes by reusing the existing cloud-mode CDP connection flow.

- daemon/bridge.rs: WS bridge on port 19222, hello handshake with
  extension origin validation, bidirectional CDP message relay
- daemon/server.rs: spawn bridge as tokio task (non-fatal on bind fail)
- daemon/registry.rs: store SharedBridgeState for session start access
- browser/session/start.rs: execute_extension() reusing cloud CDP flow
- setup: unblock extension mode in wizard and --browser flag
- CdpSession: zero changes
- Extension side: zero changes

* [packages/cli]fix: use Extension API for tab discovery in extension mode

Extension bridge requires Extension.attachTab before any CDP command
can be relayed. Replaced Target.getTargets + Target.attachToTarget
with Extension.createTab / Extension.attachActiveTab flow. Added
CdpSession.register_extension_tab() to register tabs without CDP
flat-session handshake. Local and cloud modes are unaffected.

* [packages/cli]fix: close tabs and detach debugger in extension mode

Session close and close-tab now use Extension.closeTab / Extension.detachTab
in extension mode instead of Target.closeTarget which the bridge doesn't
support. Added Extension.closeTab to the extension that detaches the
debugger and removes the tab via chrome.tabs.remove. Local and cloud
modes are unaffected.

* [packages/cli]fix: revert extension JS change, use detachTab for close

Extension is loaded from CWS — local JS changes don't take effect.
Reverted Extension.closeTab addition to background.js. Session close
and close-tab now use Extension.detachTab to release the debugger in
extension mode. Tabs are left open since CLI doesn't own the browser.

* [packages/cli]fix: read default browser mode from config instead of hardcoding Local

When --mode is not specified, browser start now reads browser.mode from
config.toml (e.g. mode = "extension") instead of always falling back to
Local mode. This allows users with extension mode configured to connect
to their existing browser without explicitly passing --mode extension.

* [packages/cli]fix: build.rs track branch ref for accurate BUILD_VERSION in worktrees

build.rs only watched .git/HEAD which doesn't change on new commits in a
worktree (it stays as ref: refs/heads/branch-name). This caused stale
BUILD_VERSION, preventing daemon version-mismatch detection when the
npm-installed binary shared the same cached hash.

Now also watches the actual ref file and packed-refs via --git-common-dir
so BUILD_VERSION updates on every new commit.

Also adds a guard in start.rs Local mode section to reject non-Local
modes explicitly instead of silently launching a local Chrome.

* [packages/cli]fix: clippy/fmt fixes and reject concurrent CDP clients in bridge

- Fix rustfmt formatting (collapsed if chains, import order, line width)
- Fix clippy collapsible-if warnings
- Reject concurrent CDP clients in bridge relay to prevent response
  channel hijacking between sessions

* [packages/cli]fix: suppress result_large_err for accept_hdr_async callback

The closure signature is dictated by tokio-tungstenite's API and cannot
use Box<Err>. Allow the lint on this specific closure.

* [root]chore: add changeset for CLI v1.2.0 (extension mode restore)
2026-04-09 20:01:37 +08:00
s1mba 2e9ee9c245 [packages/cli]fix: batch new-tab session-loss failures (#482)
Fix skipped batch new-tab failures
2026-04-07 21:21:07 +08:00
4bmis b3498b9625 Support multi-URL browser new-tab 2026-04-07 17:03:12 +08:00
Junliang Feng 0711c870e7 feat(browser): save snapshot as Playwright-style YAML (#477)
* test(browser): add render_yaml unit tests

* test(browser): extend render_yaml edge coverage

* feat(browser): save snapshot as Playwright-style YAML

Add render_yaml() to snapshot_transform.rs that converts a flat AXNode
list into a nested Playwright-style YAML DSL string. Format rules:
- Container nodes (children or URL): `- role "name" [ref=eN]:`
- Leaf with ref: `- role "name" [ref=eN]`
- Leaf with value (no ref): `- role "name": value`
- Leaf with name only (no ref): `- role: name`
- URL rendered as child: `- /url: <url>`
- [cursor=pointer] added when cursor_info has cursor:pointer hint

Switch build_output() to call render_yaml() instead of render_content(),
and change snapshot file extension from .txt to .yaml.

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

* fix(browser): escape name and value in render_yaml leaf nodes

- Use escaped_name (not node.name) in the inline leaf branch
- Escape node.value with the same rules to prevent injection

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

* fix(browser): render value inline even when ref is present in render_yaml

Textbox/combobox nodes are interactive and typically have both a ref and
a value. Previously, the ref branch dropped the value entirely. Now the
value is appended inline: `- textbox "Label" [ref=eN]: value`.

Also moves escaped_value computation to the top of the loop so it can be
shared across both the ref and no-ref branches.

Adds unit test for the ref+value path.

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

* test(browser): update snapshot e2e for yaml artifacts

- assert data.path ends with .yaml
- snapshot_content() validates .yaml extension before reading
- rename assert_content_has_refs to assert_content_is_yaml_snapshot
- add assertions: no legacy `url=` format, at least one YAML container line

Co-Authored-By: cli-roger-test <cli-roger-test@local>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* style: fix rustfmt formatting in render_yaml tests

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

* fix: rustfmt formatting and update link URL test for YAML format

Apply rustfmt-required formatting:
- Expand format!() call with 3+ args to multi-line
- Expand assert!(cond, msg) to multi-line
- Expand assert_eq! with long string to multi-line

Update test_build_output_renders_link_urls_from_ax_properties:
- Old format: `url=https://...` inline
- New YAML format: `- link "Docs" [ref=e1]:` + child `- /url: https://...`

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

* style: fix final rustfmt issue in link URL test assertion

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

* fix: replace map_or(false) with is_some_and per clippy

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

---------

Co-authored-by: cli-roger-test <cli-roger-test@local>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-03 15:10:56 +08:00
Junliang Feng 7336c1e11f fix(cli): native-ish stealth + OOPIF iframe click offset (#465) 2026-04-03 14:51:37 +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 0a25f2cace [packages/cli]perf: reduce Runtime.evaluate calls per click from 5 to 2
Merged pre-click (url+focus) and post-click (url+title+focus) state reads
each into a single JS evaluate, eliminating 3 serial main-thread round-trips
per click. Also removed wait_for_navigation's fixed 2s wait — now exits
immediately when URL hasn't changed (DOM-only interactions like card expand).

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-04-03 10:35:42 +08:00
mcfn a3b3385f3f [packages/cli]feat: add batch click support and optimize wait_for_navigation
- Support multiple selectors in click command: click @e1 @e2 @e3
- Execute clicks sequentially with fail-fast on first error
- Batch response includes all results with url_changed/focus_changed per click
- Optimize wait_for_navigation: return immediately on URL change detection, avoid polling for DOM-only interactions
- Format text output for batch clicks (clicks count + target list)

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-04-03 09:57:50 +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
AlexZ 022ab6ea1d [packages/cli]chore: fix clippy collapsible-if warnings
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 22:04:13 +08:00
AlexZ 1c7c02eb63 [packages/cli]fix: address Codex review — OOPIF expansion + ref stability
- P1: expand_undiscovered_oopifs now uses frame_ids expanded in the
  current pass (returned by expand_iframes) instead of persisted cache.
  Prevents stale cache entries from causing OOPIF frames to be skipped.
- P1: remap_frame_id_for_backend_nodes skips if the new (frame_id, bid)
  key already exists, preserving stable ref_ids across snapshots.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 21:56:51 +08:00
AlexZ 850e4430a3 [packages/cli]chore: fix formatting
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 21:50:14 +08:00
AlexZ 8b2b64d56b merge: resolve conflicts with main (browser.rs, cdp_session.rs)
- browser.rs: keep native-ish stealth flags, drop duplicate WebRTC line
- cdp_session.rs: keep apply_stealth() refactor over inline version

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 21:48:34 +08:00
AlexZ d31d70ead1 [packages/cli]fix: native-ish stealth + OOPIF iframe click offset
Stealth rewrite ("native-ish" strategy):
- Only remove automation traces (webdriver, cdc_*, Playwright markers)
- Preserve real system fingerprints (plugins, screen, language, WebGL)
- Minimal chrome.runtime stub for Cloudflare Turnstile compatibility
- Canvas noise for fingerprint tracking prevention
- Remove heavy spoofing that triggered Akamai/DataDome detection

OOPIF iframe click offset:
- Add get_iframe_offset() via DOM.getFrameOwner + DOM.getBoxModel
- Remap RefCache frame_id for nodes inlined by Chrome AX tree
- Expand undiscovered OOPIF frames in snapshot
- RefCache.remap_frame_id_for_backend_nodes() for closed shadow root iframes

Stealth apply refactor:
- Extract apply_stealth() method on CdpSession
- Apply stealth to already-attached tabs (Target.setAutoAttach race)
- Remove DeviceMetricsOverride (fixed 1920x1080 is a bot signal)

Tested: Reddit, BBB Scam Tracker (Cloudflare Turnstile), Etsy (DataDome)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 21:44:22 +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
Junliang Feng ead3cbe740 fix(cli): support contenteditable elements in type/fill/focus (#461) 2026-04-02 17:44:26 +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
Junliang Feng 943980b066 fix(cli): graceful Chrome shutdown to preserve window state (#459)
[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:20:46 +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
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
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
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 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 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
4bmis 4715896e2e [packages/cli]refactor: replace TypeScript CLI with Rust binary wrapper
Replace the TypeScript CLI implementation with a thin JS wrapper that
executes the native Rust binary. The npm package now ships all platform
binaries directly, with a postinstall fallback to download from GitHub
Releases if needed.

- Add bin/actionbook.js: platform detection + binary execution
- Add scripts/postinstall.js: fallback download from GitHub Releases
- Remove all TypeScript source, build config, and dependencies
- Update CI workflow to build, package, and publish with binaries
- Update README with full Rust CLI command documentation

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 12:44:19 +08:00
4bmis bb4ae30281 [packages/*]feat: migrate to new text-based API
- Replace old JSON API with new text-based API using area_id format
- Add get_action_by_area_id tool to MCP server
- Update search_actions with new parameters (domain, url, page, page_size)
- Remove --json option from CLI commands (output is now plain text)
- Disable sources command temporarily in CLI
- Update README documentation for CLI and MCP

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 15:29:38 +08:00
junliang.feng 18e9e6732d [packages/cli]refactor: use direct playwright-core CLI instead of npx for browser installation
Replace npx playwright@{version} with direct node execution of playwright-core CLI.
Find CLI path by checking multiple node_modules structures (pnpm .pnpm/*, npm flat, npm nested).
Search both package dir and workspace root to support pnpm workspaces.

Benefits:
- Eliminates npx overhead and potential version mismatches
- Works reliably with both npm and pnpm package managers
- No need to parse agent-browser's
2026-01-28 16:40:50 +08:00
junliang.feng 5befdfbe01 [packages/cli]feat: forward help to agent-browser for complete documentation
Remove custom help text and disable Commander.js help option.
Now 'actionbook browser -h' displays full agent-browser help with all
commands, options, and examples instead of minimal Commander help.

Benefits:
- Users see complete command reference without extra steps
- Automatically stays up-to-date with agent-browser changes
- Consistent help across -h, --help, and no-args invocations
2026-01-28 16:01:06 +08:00
junliang.feng ffd4405e81 [packages/cli]fix: dynamically match playwright version with agent-browser
Read playwright-core version from agent-browser's package.json to ensure
binary compatibility when installing Chromium. This prevents 'executable
doesn't exist' errors that occur when npx downloads a mismatched Playwright
version.

- Add getAgentBrowserPlaywrightVersion() to read version dynamically
- Use playwright@{version} instead of hardcoded version
- Fallback to 'latest' if version detection fails
2026-01-27 23:18:12 +08:00
junliang.feng 3b3b8cd95e [packages/cli]docs: update browser command description and help text
- Change command description from "agent-browser" to "actionbook browser"
- Simplify help text from "detailed agent-browser commands" to "detailed commands"
2026-01-27 23:09:42 +08:00