* [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)