Commit Graph

7 Commits

Author SHA1 Message Date
mcfn d1b35af548 [packages/cli-v2]feat: implement browser pdf command (Batch 5)
CDP Page.printToPDF → base64 decode → write to path.
Registers pdf.rs in mod.rs/action.rs/cli.rs/router.rs/output.rs.
Text output: path: {path} line per §10.3.
Errors: ARTIFACT_WRITE_FAILED, SESSION_NOT_FOUND, TAB_NOT_FOUND.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-29 23:25:01 +08:00
mcfn.feng 2f421b1dfa [packages/cli-v2]refactor: port setup to interactive wizard from actionbook-rs
Convert setup from a single-file sync implementation to a multi-module
interactive wizard matching the actionbook-rs design:

- setup/mod.rs: 4-step orchestrator (env detect → API key → browser → save)
  with welcome banner, spinners, re-run protection, and completion summary
- setup/theme.rs: dialoguer theme with ◉/○ radio-button style
- setup/detect.rs: environment detection (OS, browsers, Node, npx, existing config)
- setup/api_key.rs: interactive API key input (flag > env > config > prompt)
- setup/browser_cfg.rs: interactive browser mode selection (local/extension/cloud)

Config field renames with serde aliases for backward compatibility:
- api.base_url added
- browser.default_profile → browser.profile_name
- browser.executable → browser.executable_path

TODOs left for future PRs:
- API key server-side validation (requires ApiClient)
- Extension installer integration
- Health check step
- Skills installation step

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 17:28:31 +08:00
mcfn 54396dc185 [packages/cli-v2]fix: align setup path detection 2026-03-28 16:06:32 +08:00
mcfn 46836033a0 [packages/cli-v2]feat: resolve browser start config 2026-03-28 13:06:02 +08:00
mcfn.feng 77f634f484 [packages/cli-v2]refactor: remove search/get/daemon-stop from CLI interface
- Remove search and get subcommands (out of lifecycle scope)
- Remove daemon stop subcommand (daemon is internal, auto-managed)
- Hide daemon serve command (only used by auto-start, not user-facing)
- Remove unused uuid dependency
- Keep reqwest (used internally for CDP HTTP discovery)

Daemon auto-start is transparent: CLI connects to UDS socket on
every browser command. If daemon isn't running, auto-starts it.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 00:33:30 +08:00
mcfn.feng 6a34875cf2 [packages/cli-v2]feat: implement lifecycle commands (GREEN phase)
All 20 lifecycle E2E tests passing:
- Domain types: SessionId, TabId, WindowId, Mode
- Action/ActionResult protocol with serde tagged enums
- Wire protocol: UDS + 4-byte LE length prefix + JSON framing
- CLI layer: clap derive with --session/--tab long flags per PRD
- Daemon server: UDS listener with PID file lock, auto-start from CLI
- Session registry: in-memory HashMap with auto ID generation
- Router: handles start/list-sessions/status/close/restart/goto/new-tab/eval/snapshot
- Browser backend: Chrome launch with CDP, WebSocket for eval/navigate/snapshot
- Output formatting: JSON envelope (§2.4) + text protocol (§2.5)
- Test harness: daemon kill + Chrome cleanup between tests for isolation

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 00:18:38 +08:00
mcfn.feng c3d6fd157a [packages/cli-v2]feat: init project + lifecycle E2E tests (RED phase)
- Initialize independent Rust crate (binary: actionbook)
- Source structure: commands/{browser,daemon}, utils/{wire,client}
- E2E test harness: IsolatedEnv, SessionGuard, headless/headless_json runners
- 17 lifecycle tests covering JSON + text for start/status/list/close/restart
- 11 API tests for search/get/help/version (§6)
- 2 concurrent session tests with profile isolation
- All 28 tests RED (binary is stub only)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 23:31:48 +08:00