Commit Graph

52 Commits

Author SHA1 Message Date
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
AlexZ 0949311c2e [docs]fix: mark CDP-only commands in browser automation guide
Address Codex review feedback on PR #235 — extension-mode users would
hit runtime errors copying examples for wait-idle, console, fetch,
emulate, and switch-frame. Add [CDP] inline markers and section-level
<sup>CDP</sup> tags so the limitation is visible before users try.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 01:57:01 +08:00
AlexZ 8d3aa994bc [docs]fix: correct fill command argument order (text first, selector second)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 01:57:01 +08:00
AlexZ 509f3fd8ae [docs]docs: comprehensive browser automation guide with multi-session
- Rename page from "Browser Modes" to "Browser Automation"
- Add multi-session section: -S flag usage, session management, 3 common mistake patterns
- Document all 44 browser subcommands (was ~20, now complete)
- New sections: file upload, fetch (one-shot), batch actions, advanced features
- Expand page interaction: type, hotkey, scroll, wait-idle, wait-fn
- Expand debug & export: pdf, snapshot flags, console, info, viewport, inspect
- Add cookie & storage operations, tab management with full subcommands
- Simplify shutdown section, add restart command

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 01:57:01 +08:00
sen 2bff3f9b75 [docs]fix: adjust skill-based guidance wording per review feedback
Soften the "no prompt injection" claim to avoid mismatch with current
plugin implementation that still uses before_prompt_build.
2026-03-19 13:53:56 +08:00
sen e0a5ebcecc [docs]docs: rewrite openclaw guide for native plugin integration
Replace CLI + Skills indirect setup with @actionbookdev/openclaw-plugin
native installation via `openclaw plugins install`, gateway config, and
skill-based agent guidance.
2026-03-19 13:45:55 +08:00
Adcent 963dc903d4 [root]chore: remove private build pipeline workspaces 2026-03-17 16:36:01 +08:00
sen 7372b285b0 docs: refresh dify plugin guide 2026-03-15 23:59:49 +08:00
sen f14d139e64 docs: refresh dify plugin guide 2026-03-15 22:31:56 +08:00
sen d39b75fe62 [root]docs: add dify plugin documentation 2026-03-15 22:26:02 +08:00
AlexZ a35ba49827 [docs]fix: address PR #199 Codex review — correct CLI flags and arguments
- P2-1: `app attach [port]` → `app attach <target>` (required argument)
- P2-2: `--port` → `--cdp` (correct global flag for CDP port)
- P2-3: Remove invalid custom-path launch fallback; show manual
  start + attach workflow instead

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 18:35:51 +08:00
AlexZ 3299a0c5db [docs]feat: add actionbook app command documentation
- Add CLI reference for `actionbook app` commands (launch, attach, list, etc.)
- Add app automation guide with Electron use cases
- Update docs.json navigation structure
- Add agent prompt files to .gitignore

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 14:35:42 +08:00
Junliang Feng 6502eb87d8 docs: fix snippet import syntax for Mintlify (#187)
Replace unsupported <Snippet file="..."> component with standard
MDX import syntax. Mintlify requires ESM imports for reusable snippets.

Fixes install tabs not rendering on live docs site.

Affected pages:
- docs/guides/installation.mdx
- docs/quickstart.mdx
- docs/openclaw.mdx
- docs/guides/cli-and-skills.mdx
2026-03-04 17:24:16 +08:00
sen f9d0c0fd27 Merge pull request #181 from actionbook/feat/chrome-store-first-setup
feat: prefer Chrome Web Store extension setup with local fallback
2026-03-04 14:43:10 +08:00
Junliang Feng f021862187 docs: extract install tabs into reusable snippet, fix tab order (script > npm > brew > windows) (#186) 2026-03-04 07:18:44 +08:00
Junliang Feng 115233d7f8 docs: migrate install guides to brew/script-first (CUE-504) (#184)
* docs: migrate install guides to brew/script-first, keep npm (CUE-504)

* docs: keep README install simple (npm only), link to full guide

* docs: use script install in README (no Node.js dependency)

* docs: split Installation into sub-headings per platform
2026-03-04 06:06:02 +08:00
SenKe0x 52edfc69ca feat(setup): prefer Chrome Web Store extension flow with local fallback 2026-03-03 16:59:00 +08:00
adcentury b80f1991a1 docs(skill): clarify extract get-first with mechanism probes 2026-02-23 19:43:41 +08:00
adcentury be6621fc11 docs(skill): enforce extract get-first execution path 2026-02-23 19:39:17 +08:00
adcentury 8a95cd72c8 docs(skill): harden extract scroll/pagination examples 2026-02-23 19:01:07 +08:00
adcentury e29cf507ca docs(skill): fix extract pagination advance checks 2026-02-23 18:51:32 +08:00
adcentury 918c93040e docs(skill): add extract guardrails and runtime clarifications 2026-02-23 18:34:59 +08:00
adcentury 763fb0e763 docs(skill): harden extract script/runtime guidance 2026-02-23 18:31:48 +08:00
adcentury b1b2eb0910 feat(skill): add extract core skill (CUE-420)
Add new extract skill for structured data extraction from websites.
Produces executable Playwright scripts and extracted data (JSON/CSV).
Includes mechanism-aware strategies for hydration, virtualized lists,
infinite scroll, and pagination.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 17:35:18 +08:00
sen c70683da86 [docs]docs: simplify browser workflow and make setup-first quickstart (#147) 2026-02-19 00:50:14 +08:00
adcentury fdfd8c4533 docs: clarify installing multiple skills via interactive flow 2026-02-16 13:45:57 +08:00
adcentury cd36f834cb docs: fix skills install command guidance 2026-02-16 13:44:16 +08:00
adcentury ce5fe60712 docs: flatten docs navigation and split CLI skills (CUE-418) 2026-02-16 13:31:04 +08:00
adcentury 801c29ea2d docs: add contextual menu options (CUE-419) 2026-02-16 12:53:09 +08:00
adcentury 6148e64709 docs: hardcode Get Started URL to dashboard (CUE-416) 2026-02-15 13:48:46 +08:00
adcentury fd1a598999 docs: route Get Started button to /dashboard 2026-02-15 13:36:27 +08:00
adcentury 656fa48362 docs: point Get Started button to dashboard (CUE-416) 2026-02-15 13:35:23 +08:00
adcentury 5977a385d1 docs: simplify OpenClaw step 3 and use GitHub stars example 2026-02-15 13:27:08 +08:00
adcentury e5f4dff4e3 docs: simplify OpenClaw guide wording and title 2026-02-15 13:19:53 +08:00
adcentury d5dfd5b8ea docs: make browser-disable guidance non-destructive 2026-02-15 13:12:22 +08:00
adcentury 440bcfbeac docs: address review gaps in OpenClaw CLI guide 2026-02-15 13:10:28 +08:00
adcentury 4dc18c67e0 docs: align OpenClaw guide with CLI+setup+browser-disable flow 2026-02-15 13:08:58 +08:00
adcentury 12fee49e92 docs: make OpenClaw guide CLI + Skills only 2026-02-15 12:51:51 +08:00
adcentury f653750cda docs: add OpenClaw welcome guide (CUE-415) 2026-02-15 12:43:41 +08:00
adcentury 026a2c8ba0 chore: replace Discord links with actionbook.dev/discord (CUE-412)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 23:41:14 +08:00
adcentury 234142f56d revert(docs): keep Why Actionbook section unchanged 2026-02-13 08:43:42 +08:00
adcentury 2b475c7c7b docs: align core tagline with resilience-first messaging 2026-02-13 08:36:09 +08:00
Adcent 1aaa6548e8 docs: make website CLI-first and demote MCP/SDK paths (#119) 2026-02-12 10:43:34 +08:00
sen c91746d24f refactor: remove extension isolated mode, unify browser docs (#111)
* [packages/actionbook-rs]refactor: remove extension isolated mode, unify browser docs

Simplify browser architecture from three modes to two:
- Isolated (default): launches a fresh Chrome profile via CDP
- Extension: connects to the user's running Chrome via bridge

Remove extension isolated mode entirely:
- Delete isolated_extension.rs, cdp_pipe.rs, cdp_http.rs
- Remove --isolated flag from CLI and config
- Simplify extension_bridge (remove isolated file helpers)
- Simplify launcher (remove pipe transport, LaunchResult)
- Clean up setup wizard and config fields
- Add legacy .isolated file cleanup for upgrade compatibility
- Fix stop() to also resolve legacy bridge-pid.isolated

Merge browser-extension.mdx into unified browser.mdx guide:
- Single page covers both Isolated and Extension modes
- Browser commands listed once (add --extension to switch)
- Update all cross-references in docs

* [packages/actionbook-rs]fix: add liveness check to extension stop PID resolution

Previously, `extension stop` blindly preferred the standard PID file over
the legacy `.isolated` file without checking liveness. In upgrade scenarios
where the legacy file held the live bridge PID and the standard file was
stale (PID possibly reused by OS), this could send SIGTERM to an unrelated
process.

Introduce `resolve_pid_for_port()` with liveness checking:
- Same PID in both files → select safely
- Different PIDs → check liveness, pick the live one
- Both alive → refuse to kill (Ambiguous), warn user
- Both dead → clean up stale files (BothMatchedButDead)

Includes 5 unit tests covering all branches.
2026-02-11 00:10:06 +08:00
sen 1484b5b59c feat: isolated extension profile + extension stop command (#99)
* [packages/actionbook-rs]feat: add isolated Chrome profile for extension bridge mode

Support running the extension bridge with a dedicated Chrome profile
that contains no personal data. This adds:

- `extension_isolated_profile` config field with backward-compatible default
- `--isolated` CLI flag on `extension serve`
- `serve_with_shutdown()` bridge refactor for external lifecycle control
- `isolated_extension` orchestrator: launches Chrome with extension
  pre-loaded on CDP port 9333, monitors process, handles cleanup
- `with_load_extension()` builder on BrowserLauncher
- Setup wizard prompt for isolated vs shared extension profile
- Recap and completion output updates

CUE-347

* [packages/actionbook-rs]fix: harden isolated extension bridge lifecycle

- Propagate bridge server errors (e.g. port-in-use) instead of
  swallowing them; callers now see a non-zero exit code
- Reset extension_isolated_profile flag when switching to built-in
  browser, preventing stale config from routing to isolated mode
- Replace shell-based `kill` command with libc::kill() to eliminate
  PATH-hijacking risk; only send signals when Chrome hasn't already
  exited to avoid hitting a recycled PID
- Tighten "already running" detection: require both SingletonLock in
  the isolated profile dir AND a responsive CDP endpoint, preventing
  mistaken reuse of a different Chrome instance on the same port

* [packages/actionbook-rs]fix: harden isolated extension bridge with CDP pipe transport

- Replace --load-extension (removed in Chrome 137+) with CDP pipe
  transport: launch Chrome with --remote-debugging-pipe, then send
  Extensions.loadUnpacked over fd 3/4 post-launch
- Add cdp_pipe.rs: null-terminated pipe protocol, PipeKeepAlive handle,
  and load_extension with blocking I/O for spawn_blocking
- Add cdp_http.rs: CDP /json/list target discovery and Runtime.evaluate
  for injecting bridge token directly into extension storage via CDP
- Add background.js storage.onChanged listener for CDP-injected tokens
- Fix non-Unix isolated mode: fail early with clear error instead of
  silently launching without extension loading capability
- Fix CLOEXEC on fd 3/4: when os_pipe fd already equals target fd
  number, clear FD_CLOEXEC via fcntl instead of skipping dup2
- Fix token injection safety: find_any_extension_service_worker now
  matches only SWs ending with /background.js to avoid injecting
  tokens into third-party extensions
- Fix cleanup cross-contamination: serve_with_shutdown and
  isolated_extension only delete files belonging to their own mode,
  preventing concurrent bridge interference
- Refactor resolve_cdp_endpoint for reuse across connect and --cdp
- Add session WS URL refresh on reconnect to handle browser restarts
- Update tests for pipe flags, SW filename filtering, stale WS URLs

* [packages/actionbook-rs]feat: add `extension stop` command to gracefully stop bridge server

Adds PID file mechanism so `actionbook extension stop` can locate and
terminate the running bridge process without manual Ctrl+C or `kill`.

- PID files written with 0600 permissions (atomic write) to prevent injection
- Validates bridge is listening on expected port before sending SIGTERM (no PID recycling risk)
- SIGKILL escalation after 2.5s timeout
- Platform guards: #[cfg(unix)] with Windows taskkill fallback
- Tracks isolated vs global PID files independently

* [skills/actionbook]docs: update skill with extension stop command and full lifecycle

- Add `actionbook extension stop` to command list
- Replace manual process kill comment with concrete `extension stop` command
  in the cleanup lifecycle (Step 2)
- Update extension mode example to include stop in cleanup

* [docs/guides]docs: add extension stop command to browser extension guide

- Setup Step 3: mention `extension stop` as the way to stop the bridge
- New "Shutdown" section with proper cleanup order (browser close → extension stop)
- Troubleshooting: reference `extension stop` for bridge restart flow

* [docs/guides]docs: add isolated extension mode to browser extension guide

- Overview: expand mode table with Extension (Isolated) as third option
- New "Isolated Mode" section: quick start, config, comparison table,
  when-to-use guidance
- Shutdown: separate instructions for standard vs isolated mode

* [packages/actionbook-rs]fix: resolve PID by port and preserve PID file when process alive

Fix two bugs in `extension stop` identified in PR review:

1. Use port files to match the requested port to the correct PID file
   (isolated vs standard), preventing SIGTERM to the wrong bridge when
   both are running on different ports.

2. Only delete the PID file when the process is confirmed dead (via
   kill(pid, 0)), not merely because the port probe failed. This
   preserves the PID file for a subsequent `extension stop --port
   <correct>` when the bridge is on a different port.

* [packages/actionbook-rs]fix: smart cleanup of cross-mode stale files and prevent ambiguous PID selection

Address follow-up review findings on extension stop and bridge startup:

1. Extract `is_pid_alive()` utility to extension_bridge for cross-platform
   PID liveness checks (kill(0) on Unix, tasklist on Windows).

2. Smart cross-mode cleanup at startup: instead of blindly deleting the
   other mode's files (breaks concurrent bridges) or never deleting them
   (leaves stale tokens that confuse send_command), check if the other
   mode's process is alive via PID probe before deciding.

3. Refuse to auto-stop when both PID files exist but no port file matches
   the requested port, preventing SIGTERM to the wrong bridge.

4. Make serve_with_shutdown mode-aware: only clean the current mode's
   stale port file instead of always cleaning the standard one.

* [packages/actionbook-rs]fix: atomic PID:PORT mapping to prevent SIGTERM to wrong process

Store port alongside PID in the same file (PID:PORT format) to create
an atomic PID-to-port mapping. This eliminates all port-file-based
guessing in `extension stop`, fixing the root cause of the P1 bug
where SIGTERM could be sent to the wrong process.

- write_pid_file/write_isolated_pid_file: write "PID:PORT" format
- read_pid_file/read_isolated_pid_file: return Option<(u32, u16)>
- stop(): deterministic PID selection via embedded port match
- is_pid_alive (Windows): fix tasklist substring match (exact field)
- taskkill: only delete PID file when process confirmed dead

* [packages/actionbook-rs]fix: select token by port in send_command for parallel bridges

Use PID:PORT mapping to select the correct token file based on target
port, so parallel bridges (standard + isolated) authenticate correctly.
Previously the fixed read order (standard first) caused auth failures
when sending commands to the isolated bridge while standard was running.

* [packages/actionbook-rs]fix: clean up Chrome and bridge on isolated extension load failure

When extension loading fails (CDP error, panic, or timeout), the early
return bypassed all cleanup logic, leaving the child Chrome process
running and stale bridge state files on disk. Now performs shutdown
signal, file cleanup, and Chrome termination before returning the error.
2026-02-10 13:56:03 +08:00
sen 2e47ee6dab Add browser extension and CLI reference documentation (#95)
* [docs]feat: add browser extension documentation for PR #89

Add comprehensive documentation for the Chrome Extension Bridge feature:
- New guides/browser-extension.mdx with setup, usage, security, and
  troubleshooting sections
- docs.json navigation updated with new page entry
- index.mdx gains Integration Options card section (CLI/Extension/MCP)
- installation.mdx table and links include extension method
- cli-and-skills.mdx adds extension mode tip after browser examples
- api-reference/cli.mdx adds extension subcommands and --extension
  global flag documentation

* [docs]fix: update extension docs to reflect GitHub Release install flow

Sync documentation with PR #93 changes: extension is now downloaded
from GitHub Releases instead of extracted from embedded CLI binary.
2026-02-09 18:42:47 +08:00
Adcent 3e7874b166 docs: remove obsolete browser install step for Rust CLI 2026-02-06 21:55:49 +08:00
Adcent 9c5db26e1a docs: restructure documentation for CLI-first approach 2026-02-05 17:01:11 +08:00
AlexZ a95c3878e0 demo doc 2026-01-30 02:43:20 +08:00
AlexZ b83d097512 add json-ui skills 2026-01-30 02:36:12 +08:00