Route desktop agents through Browser Harness JS#417
Merged
Conversation
18c21ba to
664562d
Compare
a5c568f to
ce6b623
Compare
Collaborator
Author
|
@cubic review |
Agents need a local CDP runtime that does not depend on legacy helper tools or global skill installation. This vendors the upstream browser-harness-js runtime and interaction recipes, while excluding the bundled SDK from app TypeScript and ESLint passes because it is a runtime asset rather than app source. Constraint: App-spawned agents run from userData/harness and need the CLI available relative to that harness. Rejected: Install the upstream skill globally at task time | mutates the user's toolchain and makes launches depend on external setup. Confidence: high Scope-risk: moderate Directive: Treat browser-harness-js/sdk as vendored runtime; update from upstream intentionally, not via incidental formatting or lint fixes. Tested: cd app && npm run typecheck; targeted Vitest harness and adapter tests. Not-tested: Fresh packaged production app launch.
The desktop app now gives agents a vendored browser-harness-js CLI, an assigned-target connection helper, and reference folders for browser mechanics and domain playbooks. This replaces the old helpers.js/TOOLS.json tool-extension path while preserving a narrow manual-edit escape hatch for real runtime blockers. Constraint: Agents must drive only the BrowserPool-assigned CDP target identified by BU_TARGET_ID and BU_CDP_PORT. Rejected: Keep regular helper APIs as the primary surface | it keeps encouraging agents to patch tools that the upstream CDP runtime already covers. Confidence: high Scope-risk: moderate Directive: Do not reintroduce TOOLS.json as an agent-facing browser control surface; add browser mechanics as upstream browser-harness-js recipes or tightly scoped app runtime fixes. Tested: cd app && npm run typecheck; cd app && npm run test -- --run tests/unit/hl/stock-helpers.test.ts tests/unit/hl/harnessBootstrap.test.ts tests/unit/hl/codexAdapter.test.ts tests/unit/hl/browsercodeAdapter.test.ts; task agent:run smoke opened example.com and returned Example Domain. Not-tested: Fresh packaged production app launch.
ce6b623 to
343ae93
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Verification
Stacked on #415 (
fix/onboarding-cli-launch-router) to avoid mixing with that existing branch.Summary by cubic
Routes desktop agents through a vendored
browser-harness-jsCLI to drive the assigned Chromium target over CDP, replacingTOOLS.jsonand most ofhelpers.jswith a thin bridge. Bundles the runtime and recipes in the harness and updates agent guidance to use CDP domains directly.New Features
browser-harness-jsruntime (./browser-harness-js/sdk/) andSKILL.md, plus new interaction skill docs (cookies, iframes, dialogs, uploads, etc.) in the harness.codex,claude-code, andbrowsercodeengines through the CLI; injects PATH,CDP_REPL_PORT, andCDP_REPL_LOGviaapplyBrowserHarnessEnv.AGENTS.mdfor Browser Harness JS;helpers.jsis now a minimal CLI bridge; UI/logs showAGENTS.mdwhen edited.Migration
TOOLS.jsonis removed; usebrowser-harness-jssnippets instead of adding browser control tools.helpers.jsstill run, but preferconnectToAssignedTarget()andsession.*CDP calls.eslint.config.js,tsconfig.json).Written for commit 343ae93. Summary will update on new commits.