Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
48aec79
feat(browser-run): add sandboxed Playwright execution engine
rishabhraj36 Jul 28, 2026
c02e5b9
feat(skills): removed recon-to-ipage skill
rishabhraj36 Jul 30, 2026
dc7a75b
feat(browser): expose browser run through local Cloak sessions
rishabhraj36 Jul 29, 2026
0d3edc1
feat(skills): adopt run-first browser workflows
rishabhraj36 Jul 30, 2026
88f1366
Merge branch 'main' into feat/browser-run-playwright-sandbox
beubax Aug 4, 2026
8c8c9e9
feat(browser): vendor Playwright QuickJS client
beubax Aug 4, 2026
a566dbd
fix(browser): harden Playwright QuickJS client
beubax Aug 4, 2026
5ed04ab
fix(browser): cover QuickJS typed arrays
beubax Aug 4, 2026
9ebf3b9
feat(browser): run full Playwright client in QuickJS
beubax Aug 4, 2026
aca82c4
fix(browser): constrain Playwright sandbox capabilities
beubax Aug 4, 2026
f252136
feat(browser): stabilize run results and artifacts
beubax Aug 4, 2026
eddaa1a
fix(browser): preserve run timeout failures
beubax Aug 4, 2026
be87755
fix(browser): preserve run error details
beubax Aug 4, 2026
2f0c98b
feat(browser): add structural snapshot diffs
beubax Aug 4, 2026
a96526e
fix(browser): preserve structural snapshot differences
beubax Aug 4, 2026
7ad5aa6
feat(browser): connect browser run to Cloak
beubax Aug 4, 2026
84e5709
feat(browser): expose run-first command surface
beubax Aug 4, 2026
3799400
fix(browser): materialize hosted run source
beubax Aug 4, 2026
b0ddfd6
docs(skills): teach run-first Playwright workflows
beubax Aug 4, 2026
c7265f8
docs(skills): keep adapter recon run-first
beubax Aug 4, 2026
61c3139
test(browser): cover run-first local lifecycle
beubax Aug 4, 2026
01e9422
test(browser): register lifecycle e2e
beubax Aug 4, 2026
cc2254f
test(browser): serialize local e2e
beubax Aug 4, 2026
40cb857
feat: add browser snapshot baseline types
beubax Aug 5, 2026
e375049
feat: capture browser accessibility snapshots
beubax Aug 5, 2026
4913db4
feat: render compact browser snapshots
beubax Aug 5, 2026
d6b4738
feat: diff browser accessibility snapshots
beubax Aug 5, 2026
b5f5dd7
feat: add browser snapshot command contract
beubax Aug 5, 2026
2096057
fix: forward hosted snapshot diff option
beubax Aug 5, 2026
121e721
feat: return automatic browser run snapshot diffs
beubax Aug 5, 2026
6354278
fix: honor browser run snapshot diff opt-out
beubax Aug 5, 2026
a12ddaa
docs: document browser snapshot workflow
beubax Aug 5, 2026
0d326c7
feat: forward browser snapshot parity to hosted mode
beubax Aug 5, 2026
a02745e
fix: harden browser snapshot parity
beubax Aug 5, 2026
a945111
docs: design risk-aware snapshot compression
beubax Aug 5, 2026
4909251
docs: expand snapshot compression design
beubax Aug 5, 2026
2ccfeed
feat: split browser snapshot modes
beubax Aug 5, 2026
5f38729
feat: scope snapshots to active modals
beubax Aug 5, 2026
0c3b570
feat: summarize snapshot subtree risk
beubax Aug 5, 2026
b1d93d7
fix: retain snapshot record identity
beubax Aug 5, 2026
e84a430
feat: allocate snapshot output by risk
beubax Aug 5, 2026
1a9566f
fix: reclaim snapshot marker budget
beubax Aug 5, 2026
3928430
fix: bound snapshot marker overflow
beubax Aug 5, 2026
aa9c2b4
fix: preserve rejected snapshot path caches
beubax Aug 5, 2026
82c0806
feat: prioritize structural snapshot diffs
beubax Aug 5, 2026
8b6d107
fix: report critical snapshot diff bounds
beubax Aug 5, 2026
bba3807
feat: export shared snapshot capabilities
beubax Aug 5, 2026
854dfa9
perf: calibrate risk-aware snapshot budgets
beubax Aug 5, 2026
d3aef4e
fix: retain critical snapshot content
beubax Aug 6, 2026
a367e5e
fix: preserve nested critical snapshot content
beubax Aug 6, 2026
d98262a
fix: dedupe critical snapshot supplements
beubax Aug 6, 2026
9406a74
fix: dedupe nested critical supplements
beubax Aug 6, 2026
2ed3f79
docs: teach tree snapshot mode in skills
beubax Aug 6, 2026
a1ac643
perf: skip impossible complete snapshot projection
beubax Aug 6, 2026
cfe8047
fix: update lockfile
beubax Aug 6, 2026
40efc5d
fix: install Playwright browsers for Bun compatibility tests
beubax Aug 6, 2026
1dc7e93
fix: exclude browser tests from Bun compatibility check
beubax Aug 6, 2026
51b0845
fix: exclude browser tests from unit test project config
beubax Aug 6, 2026
9bc6361
refactor: standardize browser interaction patterns to use `webcmd bro…
beubax Aug 6, 2026
1de6163
refactor: formalize webcmd-browser behavioral documentation and add v…
beubax Aug 6, 2026
6d8f1d7
chore: remove hosted-contract.json and update README documentation
beubax Aug 6, 2026
9e3f5d7
Merge remote-tracking branch 'origin/main' into feat/browser-run-play…
beubax Aug 6, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions NOTICE
Original file line number Diff line number Diff line change
@@ -1 +1,35 @@
webcmd is based on opencli (https://github.com/jackwener/opencli), Copyright 2025 jackwener, licensed under Apache-2.0.

The browser-run QuickJS lifecycle is derived from dev-browser
(https://github.com/SawyerHood/dev-browser), Copyright Sawyer Hood,
licensed under the MIT License.

The browser-run Playwright QuickJS client includes Playwright code from
https://github.com/microsoft/playwright, licensed under Apache-2.0.

The browser snapshot capture, model, renderer, diff, and page-stability modules
in src/browser/snapshot/capture.ts, types.ts, render.ts, diff.ts, and
wait-for-page-stable.ts are derived from libretto-browser-tools
(https://github.com/Skyvern-AI/libretto).

MIT License

Copyright (c) 2026 Libretto contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,15 @@ On top of live browser control, WebCMD adds 3 layers of learnings. Each layer co
| 3. CLI authoring | The action space is known, but the path is still too variable for one fixed sequence. | Explicitly author a reusable `webcmd <site>` adapter with structured output, so future agents spend tokens on the task instead of navigation. |
| 4. Extend existing CLIs | The workflow is deterministic enough to stop browsing. | Extend the `webcmd <site>` adapter with a tailored command so the workflow runs instantly with the least amount of tokens. |

For local, multi-step browser exploration, agents can send one sandboxed
Playwright-style program to an existing CloakBrowser session:

```bash
webcmd browser work run --file explore.js
printf 'const page = await browser.currentPage(); return await page.title();' \
| webcmd browser work run --stdin
```

## Demo

https://github.com/user-attachments/assets/04eceadc-d398-4303-984d-ae3197bfa664
Expand Down
115 changes: 114 additions & 1 deletion bun.lock

Large diffs are not rendered by default.

34 changes: 34 additions & 0 deletions docs/cli-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,39 @@ webcmd web fetch-browser --url https://example.com/app-shell

The old `web read` command has been renamed to `web fetch-browser`.

## Local Browser Programs

`browser run` executes one Playwright-style JavaScript program against an
existing local CloakBrowser session:

```bash
webcmd browser work snapshot --snapshot-mode act
webcmd browser work snapshot --snapshot-mode read
webcmd browser work run --stdin --timeout 45
webcmd browser work run --stdin --no-snapshot-diff
```

Use `snapshot` for explicit page inspection. `act` is the default
action-first mode, `tree` preserves fuller page structure, and `read` extracts readable article/content text. Exactly one of `--file
<path>` or `--stdin` is required for `run`. The CLI reads files locally and
sends source—not the path—to the local daemon. `--timeout` is in seconds and
`--max-output` bounds returned results and logs. Successful runs return a
`snapshotDiff` by default; pass `--no-snapshot-diff` only when the program is
pure read-only and its result already contains the needed state.

The program runs in a fresh QuickJS sandbox with `page`, `context`, `browser`,
and `console` globals. `page.snapshotForAI()` is not available. It can use the
supported Page/Frame/Locator methods and passively inspect request and response
events. It cannot access Node.js, the filesystem, environment variables, raw
CDP endpoints, browser launch/connect APIs, or browser-context ownership.
Screenshot bytes are written to a Webcmd-owned cache directory and returned as
a receipt.

The public browser surface is `tabs`, `bind`, `run`, `snapshot`, and `close`.
Reusable adapters continue to use the existing `IPage` API. Playwright-style
programs are for reconnaissance and ad-hoc multi-step work; they are not pasted
into adapter modules.

## Top-Level Commands

| Command | Purpose |
Expand Down Expand Up @@ -148,6 +181,7 @@ Register our internal `releasectl` binary as a Webcmd external CLI with a short
| `~/.webcmd/` | User-level Webcmd state. |
| `~/.webcmd/clis/` | Private adapters and local overrides. |
| `~/.webcmd/cache/browser-network/` | Browser network capture cache. |
| `~/.webcmd/cache/browser-run/` | Host-owned browser-run screenshot artifacts. |
| `~/.webcmd/external-clis.yaml` | User external CLI registry. |
| `skills/` | Bundled agent skills shipped with the package. |

Expand Down
135 changes: 124 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
"./browser/ax-snapshot": "./dist/src/browser/ax-snapshot.js",
"./browser/cdp": "./dist/src/browser/cdp.js",
"./browser/page": "./dist/src/browser/page.js",
"./browser/run": "./dist/src/browser/run/index.js",
"./browser/snapshot": "./dist/src/browser/snapshot/index.js",
"./browser/article-extract": "./dist/src/browser/article-extract.js",
"./browser/utils": "./dist/src/browser/utils.js",
"./download": "./dist/src/download/index.js",
"./download/article-download": "./dist/src/download/article-download.js",
Expand Down Expand Up @@ -54,6 +57,7 @@
"sync-community-plugins": "tsx scripts/sync-community-plugins.ts",
"generate-release-notes": "tsx scripts/generate-release-notes.ts",
"docs-sync-review": "tsx scripts/docs-sync-review.ts",
"benchmark:snapshot": "tsx scripts/benchmark-snapshot-render.ts",
"start": "node dist/src/main.js",
"start:bun": "bun dist/src/main.js",
"preuninstall": "node -e \"fetch('http://127.0.0.1:9777/shutdown',{method:'POST',headers:{'X-Webcmd':'1'},signal:AbortSignal.timeout(3000)}).catch(()=>{})\" || true",
Expand Down Expand Up @@ -97,19 +101,22 @@
"js-yaml": "^4.3.0",
"jsdom": "^29.0.2",
"playwright-core": "1.61.1",
"quickjs-emscripten": "0.32.0",
"turndown": "^7.2.2",
"turndown-plugin-gfm": "^1.0.2",
"undici": "^6.27.0",
"ws": "^8.18.0"
},
"devDependencies": {
"@emnapi/core": "^1.11.2",
"@emnapi/runtime": "^1.11.2",
"@google/genai": "^2.10.0",
"@types/js-yaml": "^4.0.9",
"@types/jsdom": "^27.0.0",
"@types/node": "^25.5.2",
"@types/turndown": "^5.0.6",
"@types/ws": "^8.5.13",
"esbuild": "^0.28.1",
"tsx": "^4.19.3",
"typescript": "^6.0.2",
"vitest": "^4.1.0"
Expand Down
Loading