Context
Per the Middleware Boundary Principle, RemoteClaw's browser MCP tool (`browser_request`) routes through paired nodes — that's infrastructure. But `src/browser/` also contains a full Playwright automation framework (14,221 lines, 69% of the directory) that is generic browser automation, not node-bound routing.
The node-routing layer (5,543 lines: bridge server, extension relay, profiles, config, security, CDP layer, basic+tabs routes) has a clean boundary from the Playwright layer. `server-context.ts` has soft deps on Playwright (already handles `PwAiModule | null`).
Found during MBP deep dive audit of `src/browser/`.
Scope
Delete Playwright layer (~14,221 lines, 74 files):
- All `pw-` files: pw-session.ts, pw-ai.ts, pw-ai-module.ts, pw-ai-state.ts, pw-role-snapshot.ts, pw-tools-core..ts (16 prod + tests)
- All `routes/agent.*` files: agent.ts, agent.shared.ts, agent.act.ts, agent.act.shared.ts, agent.act.hooks.ts, agent.act.download.ts, agent.snapshot.ts, agent.storage.ts, routes/output-paths.ts (9 prod + tests)
- Chrome process management: chrome.ts, chrome.executables.ts, chrome.profile-decoration.ts + tests
- Client action wrappers: client-actions.ts, client-actions-core.ts, client-actions-observe.ts, client-actions-state.ts
- Automation utilities: screenshot.ts, paths.ts, session-tab-registry.ts, form-fields.ts, safe-filename.ts, output-atomic.ts, proxy-files.ts, trash.ts + tests
Clean up KEEP files:
- `server-context.ts`: Remove Playwright fallback paths (listPagesViaPlaywright, createPageViaPlaywright) — CDP-only or error
- `routes/index.ts`: Remove agent route registration, keep basic + tabs only
Acceptance Criteria
Size
~14,221 lines removed. Node-routing layer (~5,543 lines) preserved.
Context
Per the Middleware Boundary Principle, RemoteClaw's browser MCP tool (`browser_request`) routes through paired nodes — that's infrastructure. But `src/browser/` also contains a full Playwright automation framework (14,221 lines, 69% of the directory) that is generic browser automation, not node-bound routing.
The node-routing layer (5,543 lines: bridge server, extension relay, profiles, config, security, CDP layer, basic+tabs routes) has a clean boundary from the Playwright layer. `server-context.ts` has soft deps on Playwright (already handles `PwAiModule | null`).
Found during MBP deep dive audit of `src/browser/`.
Scope
Delete Playwright layer (~14,221 lines, 74 files):
Clean up KEEP files:
Acceptance Criteria
Size
~14,221 lines removed. Node-routing layer (~5,543 lines) preserved.