Commit Graph

157 Commits

Author SHA1 Message Date
Yanwu 0ae6dc6970 Merge pull request #88 from epiral/release-please--branches--main--components--bb-browser
chore(main): release bb-browser 0.9.0
bb-browser-v0.9.0
2026-03-20 00:14:07 +08:00
github-actions[bot] 2f2e153ef1 chore(main): release bb-browser 0.9.0 2026-03-19 16:08:24 +00:00
Yanwu aa3010f015 Merge pull request #87 from epiral/feat/cdp-monitor
feat(cli): add CDP monitor for persistent monitoring
2026-03-19 23:51:23 +08:00
yan5xu 94c94b7c4e feat(cli): add CDP monitor background process for persistent monitoring (Phase 1, #77)
Monitoring commands (network, console, errors, trace) are broken in
direct CDP mode because each CLI invocation is a new short-lived
process that cannot accumulate events over time.

This introduces a long-running background monitor process that
maintains a persistent CDP connection and collects events:

- cdp-monitor-state.ts: MonitorState class extracted from cdp-client.ts
  event handling logic (Network.*, Runtime.*, trace)
- cdp-monitor.ts: standalone Node.js process that connects to Chrome
  via CDP, attaches to all page targets, and serves an HTTP API on
  127.0.0.1 with bearer-token auth
- monitor-manager.ts: CLI-side lifecycle management (spawn, health
  check, shutdown, command forwarding)
- client.ts: routes monitor actions (network/console/errors/trace)
  through the monitor with graceful fallback to direct CDP
- tsup.config.ts: adds cdp-monitor as a build entry point

The monitor auto-discovers new tabs, writes PID/port/token files to
~/.bb-browser/, and auto-exits after 30 minutes of inactivity.
cdp-client.ts is intentionally left untouched to avoid regressions.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 23:47:12 +08:00
Yanwu 1215b01604 Merge pull request #86 from ox01024/chore/release-please
chore(release): automate versioning and publishing
2026-03-19 20:17:28 +08:00
Yanwu 22d38c1368 Merge pull request #67 from MonkeyLeeT/codex/mcp-site-tools
feat(mcp): add site adapter tools
2026-03-19 20:15:59 +08:00
Yanwu 3a1541114f Merge pull request #69 from ox01024/fix/status-command-help
fix(cli): wire top-level status command
2026-03-19 20:15:22 +08:00
Yanwu a391b8241a Merge pull request #63 from MonkeyLeeT/codex/fix-eval-top-level-await
Clean fix using replMode: true — same approach as Chrome DevTools Console. No side effects on existing expressions. LGTM.
2026-03-19 20:14:39 +08:00
Yanwu 3659fb869a Merge pull request #74 from ox01024/fix/click-navigation
Fixes real click-offset bug on scrolled pages. Viewport coordinate transformation is correct. LGTM.
2026-03-19 20:14:29 +08:00
Yanwu 152225b2e0 Merge pull request #80 from ox01024/fix/get-ref-cross-invocation
Solid state management with proper stale-target protection. LGTM.
2026-03-19 20:14:21 +08:00
Yanwu 3cd1b05fda Merge pull request #81 from ox01024/fix/type-double-insert
Correct root cause analysis and clean fix — collapsing dual write paths into single Input.insertText. LGTM.
2026-03-19 20:14:14 +08:00
Yanwu e716ab59f2 Merge pull request #85 from ox01024/chore/eslint-small-scope
Clean ESLint setup with pragmatic rule choices. Only 1 existing code change needed — great minimal baseline.
2026-03-19 20:14:07 +08:00
Waffle 570737c957 chore(release): automate versioning and publishing 2026-03-19 17:25:33 +08:00
Waffle 0a2e150238 chore(lint): add small-scope eslint checks 2026-03-19 16:37:41 +08:00
Waffle 600244d0da fix(cli): avoid double-inserting typed text 2026-03-19 15:40:47 +08:00
Waffle 578e10f56d fix(cli): persist selected target for get commands 2026-03-19 15:40:10 +08:00
Waffle 92fa9f7fc7 fix(cli): use viewport coordinates for click targets 2026-03-19 14:59:34 +08:00
Waffle c8b1aab0ad fix(cli): wire top-level status command 2026-03-19 11:03:38 +08:00
ted 4626fff84a chore(cli): minimize site command diff 2026-03-18 18:54:06 -07:00
ted 7804f06226 feat(mcp): add site adapter tools 2026-03-18 18:51:25 -07:00
Yanwu d56cab9d6a Merge pull request #62 from MonkeyLeeT/codex/fix-openclaw-noisy-json
LGTM! All review feedback addressed thoroughly in b0b7c7b. Clean implementation, solid test coverage. Thanks for the quick turnaround!
2026-03-18 16:22:58 +08:00
ted 2a5493ea5b Revert "chore(shared): add Runtime.evaluate coverage"
This reverts commit ef79e28e7b.
2026-03-17 23:49:42 -07:00
ted ef79e28e7b chore(shared): add Runtime.evaluate coverage 2026-03-17 23:43:24 -07:00
ted cbad572068 refactor(cli): simplify OpenClaw JSON recovery 2026-03-17 23:39:35 -07:00
ted b0b7c7be0e fix(cli): harden OpenClaw JSON parsing 2026-03-17 23:32:55 -07:00
ted cfbae0763a fix: support top-level await in eval 2026-03-17 23:28:42 -07:00
Yanwu aedca627cf Merge pull request #52 from ox01024/fix/version-sync
Thanks for the clean fix! 🎉 The tsup `define` approach is exactly the right way to handle this.

Quick question: do you have any other suggestions for build/release automation? Things like auto-generating changelogs, version bumping workflows, or CI checks that could prevent this kind of drift in the future? I'm not very familiar with this area and would appreciate any recommendations.
2026-03-18 12:30:46 +08:00
ted 28e0867ee4 fix(cli): tolerate noisy OpenClaw JSON output 2026-03-17 21:10:29 -07:00
Waffle a1b9f38617 fix: derive version metadata from package.json 2026-03-17 11:25:51 +08:00
Yanwu e7de67c4df fix(cli): add Chrome Dev/Canary/Beta/Arc to browser detection (#42) (#43)
- Add missing browser candidates to findBrowserExecutable() on macOS
- Remove obsolete daemon-era commands (start/stop/status/reload)
- Bump to v0.8.3

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
v0.8.3
2026-03-16 11:04:29 +08:00
yan5xu f36297300c chore: bump to v0.8.2 v0.8.2 2026-03-16 10:05:00 +08:00
Yanwu b0cb83a8f6 Merge pull request #38 from epiral/fix/cdp-v0.8.0
fix: CDP direct mode bugs (snapshot, tab list, discovery)
2026-03-16 10:04:01 +08:00
yan5xu 64bb52ae00 chore: bump to v0.9.0 2026-03-16 10:03:49 +08:00
yan5xu 936047ad2b fix: cross-process refs, fill command, snapshot robustness
- Add DOM.getDocument before DOM.performSearch in xpath fallback (fixes cross-process click/fill)
- Persist refs to /tmp/bb-browser-refs-<targetId>.json for cross-process usage
- Fix fill command: use backendNodeId for DOM.focus, add insertTextIntoNode helper
- Graceful snapshot fallback for complex pages (google.com)

All 13 core commands tested and passing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-16 09:57:34 +08:00
yan5xu c3a3bf8d1d fix: snapshot, tab list, and discovery overhead in CDP mode
- Fix snapshot: map buildDomTree.js actual API params and parse return format
- Fix tab list: add "list" as recognized subcommand alias
- Fix discovery: check managed browser first, defer OpenClaw probe
- All 9 core commands passing (open, eval, snapshot, screenshot, tab, site, history, recommend)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-16 02:42:46 +08:00
yan5xu 6a112990e4 chore: bump to 0.8.1 (fix process hang) v0.8.1 2026-03-16 02:16:48 +08:00
yan5xu 4d63ae2935 fix: process hangs after CDP command completes
- Unref WebSocket so it doesn't keep the event loop alive
- Call process.exit(0) after main() resolves

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-16 02:15:42 +08:00
yan5xu d84e45da71 chore: bump version to 0.8.0
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
v0.8.0
2026-03-16 02:07:27 +08:00
yan5xu 7e5c2275c4 feat: set managed Chrome profile name to "bb-browser"
Chrome title bar now shows "bb-browser" to distinguish from user's daily browser.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-16 02:04:24 +08:00
yan5xu 59ab96b4c3 feat: v0.8.0 — CDP direct connection, managed Chrome, no extension needed
Major architecture change: remove dependency on Chrome extension and daemon.
bb-browser now manages its own Chrome instance with --remote-debugging-port
and connects directly via CDP WebSocket.

New files:
- cdp-client.ts: CDP WebSocket client, implements all actions directly
- cdp-discovery.ts: auto-discover CDP port (OpenClaw → managed Chrome → auto-launch)
- history-sqlite.ts: read browser history from SQLite (Chrome/Edge/Brave/Arc)

Key changes:
- Auto-launch managed Chrome at ~/.bb-browser/browser/ on port 19825
- User data persists (logins saved across sessions)
- SQLite history replaces chrome.history extension API
- site recommend reads from main Chrome's history (not managed instance)
- Flat CDP protocol support (Chrome 146+)
- --port flag for explicit CDP port override
- All actions implemented: eval, click, snapshot, network, console, frame, dialog, trace

Zero config setup: npm install -g bb-browser → just works

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-16 02:02:30 +08:00
yan5xu 0551493aa0 feat(cli): auto-check for CLI updates on site update, bump to 0.7.0
- Bump version to 0.7.0
- Fix VERSION constant in index.ts (was stuck at 0.3.0)
- On `site update`, check npm registry for newer version and show upgrade hint
- Only prompt when npm version is higher than current

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
v0.7.0
2026-03-16 00:54:31 +08:00
yan5xu 00ed75fd67 feat(cli): add star command and hint in site update
- `bb-browser star` — stars epiral/bb-browser and epiral/bb-sites via gh CLI
- Show hint after `site update` output to guide agents and users

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-16 00:52:25 +08:00
yan5xu 61a349313b fix(docs): update ClawHub skill link in English README
Match the link fix from #30.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-16 00:09:55 +08:00
Yanwu 776aedf6b6 Merge pull request #30 from UncertaintyDeterminesYou4ndMe/patch-1
Update ClawHub Skill link in README.zh-CN.md
2026-03-16 00:09:04 +08:00
Yanwu cf008d32e5 Merge pull request #32 from powcai001/fix/windows-mcp-path
Clean fix for Windows path resolution. Thanks @powcai001!
2026-03-16 00:05:54 +08:00
powcai 7061ab792a fix: use fileURLToPath for Windows-compatible MCP path resolution
On Windows, new URL(...).pathname returns '/C:/...' which gets
incorrectly resolved to 'C:\C:\...' (double drive letter).
fileURLToPath() correctly handles file:// URL to path conversion
cross-platform.

Fixes #17

Made-with: Cursor
2026-03-15 21:52:05 +08:00
UncertaintyDeterminesYou4ndMe 86518d6bae Update ClawHub Skill link in README.zh-CN.md
https://clawhub.ai/yan5xu/bb-browser-openclaw Skill not found.
2026-03-15 17:34:19 +08:00
yan5xu 020d6bb1c2 docs: add OpenClaw --openclaw mode to README
- OpenClaw section before Chrome Extension (no extension needed)
- Link to ClawHub skill bb-browser-openclaw
- Chrome Extension renamed to "standalone mode"

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-15 13:49:28 +08:00
yan5xu 0f83288ece chore: rename bb-browser-sites skill to bb-browser-openclaw
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
v0.6.0
2026-03-15 13:47:16 +08:00
yan5xu 1a79c3f7d1 chore: bump version to 0.6.0
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-15 13:40:33 +08:00