@ai-ecoverse/slicc-cdp 1.5.3 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,9 +2,11 @@
2
2
 
3
3
  `@ai-ecoverse/slicc-cdp` publishes `playwright-cli` and `curlwright`, Rust clients for an already-running Chrome. They speak Chrome DevTools Protocol JSON. The package root exports `CDPClient` and `connect`, one browser DevTools socket.
4
4
 
5
+ `playwright-cli` is a playwright-cli-compatible command for SLICC and not affiliated with Microsoft Playwright.
6
+
5
7
  ## playwright-cli
6
8
 
7
- The binary is `crates/playwright-cli`. It does not launch Chrome and it does not invent a debugger path.
9
+ The binary is `crates/playwright-cli`. Host `open` launches a browser into `<config>/slicc/seven-profiles/<id>` when no debugger is already connected, and inside slicc it only opens a tab. It does not invent a debugger path.
8
10
 
9
11
  Connect, in order: `--cdp`, else `SLICC_CDP_URL`, else `GET http://127.0.0.1:9222/json/version` and dial the returned `webSocketDebuggerUrl`. A `ws://` URL is dialed as given. An `http://` URL is discovery. On the native build a `wss://` URL is dialed as given. The WASI build has no TLS, so `wss://` and `https://` fail there. `--runtime <name>` is appended to the query of the URL that is opened and is not interpreted.
10
12
 
@@ -20,10 +22,45 @@ A non-2xx discovery response prints the status and the body and exits non-zero.
20
22
 
21
23
  ## Kernel commands
22
24
 
23
- `slicc.abi` is `wasi`. The commands are `playwright-cli` (`bin/playwright-cli.wasm`) and `curlwright` (`bin/curlwright.wasm`). `npm run build:wasm` builds both for `wasm32-wasip1` and copies them there. The release workflow runs that before publish. Do not commit the wasm. On that target, TCP comes from the vendored homescoop `wasix-net` crate (`vendor/wasix-net`, pin recorded in `UPSTREAM`).
25
+ `slicc.abi` is `wasi`. The commands are `playwright-cli` (`bin/playwright-cli.wasm`) and `curlwright` (`bin/curlwright.wasm`). `npm run build:wasm` builds both for `wasm32-wasip1` and copies them there. The release workflow runs that before publish. Do not commit the wasm. On that target, TCP comes from the `wasix-net` 0.1 crate on crates.io.
24
26
 
25
27
  Inside the kernel the browser socket is `SLICC_CDP_URL`: `ws://127.0.0.1:9222/devtools/browser/<id>` from slicc-kernel. Port 9222 accepts connections only from inside the kernel.
26
28
 
27
29
  ## Package
28
30
 
29
31
  Node ≥ 24. `npm run lint` runs `slicc-lint`. Releases use semantic-release on `main`. Git `package.json` stays `0.0.0`. The published version is the release tag.
32
+
33
+ ## Install and run
34
+
35
+ `cargo install slicc-cdp` installs the `playwright-cli` command. `cargo install curlwright` installs `curlwright`. Host builds run on macOS, Linux, and Windows. TLS there is `native-tls` (Secure Transport, OpenSSL, or SChannel). The `slicc-cdp` crate needs Rust 1.88. `curlwright` and `slicc-cdp-client` need Rust 1.83.
36
+
37
+ ```
38
+ cargo install slicc-cdp
39
+ cargo install curlwright
40
+ ```
41
+
42
+ `@ai-ecoverse/slicc-cdp` on npm is the SLICC package. It ships `bin/playwright-cli.wasm` and `bin/curlwright.wasm`, built for `wasm32-wasip1`. Those builds have no TLS, so `wss://` and `https://` fail in the kernel. The same commands exist there; the Cargo install is the host build, not those wasm files.
43
+
44
+ Host `open` launches a browser into `<config>/slicc/seven-profiles/<id>` when no debugger is already connected, and inside slicc it only opens a tab. `curlwright` does not launch a browser. You can still start Chrome with `--remote-debugging-port` and a non-default `--user-data-dir`, then pass that HTTP endpoint as `--cdp`. Chrome 136 and later ignore the debugging port on the default profile, and an already-open Chrome ignores a second launch. `--headless` is optional: leave it off to open a window. The examples use port 9333.
45
+
46
+ macOS:
47
+
48
+ ```
49
+ "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" --headless --remote-debugging-port=9333 --user-data-dir=/tmp/chrome-cdp
50
+ ```
51
+
52
+ Linux:
53
+
54
+ ```
55
+ google-chrome --headless --remote-debugging-port=9333 --user-data-dir=/tmp/chrome-cdp
56
+ ```
57
+
58
+ ```
59
+ playwright-cli --cdp http://127.0.0.1:9333 open https://example.com
60
+ playwright-cli --cdp http://127.0.0.1:9333 snapshot
61
+ playwright-cli --cdp http://127.0.0.1:9333 tab-list
62
+ curlwright --cdp http://127.0.0.1:9333 https://example.com/
63
+ curlwright --cdp http://127.0.0.1:9333 -I https://example.com/
64
+ ```
65
+
66
+ `--cdp` still wins over `SLICC_CDP_URL`, which wins over discovery at `http://127.0.0.1:9222/json/version`. A crate installed from crates.io prints its crate version. In this repository, and in the npm wasm builds, `--version` prints the `package.json` version. The release workflow writes that version into the crate manifests before `cargo publish`, and only after semantic-release has published the npm package. Git keeps the crate versions at `0.0.0`.
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-ecoverse/slicc-cdp",
3
- "version": "1.5.3",
3
+ "version": "1.6.0",
4
4
  "description": "SLICC's CDP layer: client, browser API, transports, HAR, and ARIA snapshot",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -11,6 +11,9 @@
11
11
  "engines": {
12
12
  "node": ">=24"
13
13
  },
14
+ "workspaces": [
15
+ "packages/sliccy-browser"
16
+ ],
14
17
  "fledgling": {
15
18
  "provider": "github",
16
19
  "workflow": "release.yml",
@@ -44,22 +47,22 @@
44
47
  }
45
48
  },
46
49
  "scripts": {
47
- "prepare": "lefthook install",
48
- "build:wasm": "cargo build --release --target wasm32-wasip1 -p playwright-cli -p curlwright && mkdir -p bin && cp target/wasm32-wasip1/release/playwright-cli.wasm bin/playwright-cli.wasm && cp target/wasm32-wasip1/release/curlwright.wasm bin/curlwright.wasm",
50
+ "prepare": "lefthook install && node scripts/allow-crate-readmes.mjs",
51
+ "build:wasm": "cargo build --release --target wasm32-wasip1 -p slicc-cdp -p curlwright && mkdir -p bin && cp target/wasm32-wasip1/release/playwright-cli.wasm bin/playwright-cli.wasm && cp target/wasm32-wasip1/release/curlwright.wasm bin/curlwright.wasm",
49
52
  "prepublishOnly": "npm run build:wasm",
50
53
  "lint": "slicc-lint",
51
- "typecheck": "node --check src/index.js && node --check src/cdp-client.js && node --check src/connect.js && node --check src/page.js",
54
+ "typecheck": "node --check src/index.js && node --check src/cdp-client.js && node --check src/connect.js && node --check src/page.js && node --check packages/sliccy-browser/src/browser.js && node --check packages/sliccy-browser/src/fetch-script.js && node --check packages/sliccy-browser/src/ws-router.js",
52
55
  "format": "biome check --write .",
53
56
  "test": "true",
54
- "test:integration": "PATH=\"$HOME/.cargo/bin:$PATH\" cargo build -p playwright-cli -p curlwright && PATH=\"$HOME/.cargo/bin:$PATH\" cargo build --target wasm32-wasip1 -p playwright-cli -p curlwright && npx playwright-core install chromium && node --test --test-timeout=180000 test/integration/chromium.test.mjs",
57
+ "test:integration": "PATH=\"$HOME/.cargo/bin:$PATH\" cargo build -p slicc-cdp -p curlwright && PATH=\"$HOME/.cargo/bin:$PATH\" cargo build --target wasm32-wasip1 -p slicc-cdp -p curlwright && npx playwright-core install chromium && node --test --test-timeout=180000 test/integration/*.test.mjs",
55
58
  "test:unit": "mcr -c node_modules/@ai-ecoverse/slicc-shared-web/mcr.config.mjs node --test 'test/unit/**/*.test.mjs'",
56
59
  "trust": "npx fledgling sync -y --skip-publish",
57
60
  "trust:dry": "npx fledgling sync --dry-run -y --skip-publish",
58
61
  "release": "semantic-release"
59
62
  },
60
63
  "devDependencies": {
61
- "@ai-ecoverse/slicc-kernel": "1.54.2",
62
- "@ai-ecoverse/slicc-shared-web": "1.12.1",
64
+ "@ai-ecoverse/slicc-kernel": "1.60.1",
65
+ "@ai-ecoverse/slicc-shared-web": "1.12.2",
63
66
  "@biomejs/biome": "2.5.15",
64
67
  "lefthook": "2.1.16",
65
68
  "playwright-core": "1.63.0",