@ai-ecoverse/slicc-cdp 1.1.2 → 1.2.1

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
@@ -1,13 +1,29 @@
1
1
  # slicc-cdp
2
2
 
3
- Node package for SLICC's CDP layer. The JavaScript entry is still empty:
3
+ `@ai-ecoverse/slicc-cdp` publishes `playwright-cli` and `curlwright`, Rust clients for an already-running Chrome. They speak Chrome DevTools Protocol JSON. The JavaScript CDP layer from SLICC is not in this package yet (`src/index.js` is `export {}`).
4
4
 
5
- ```js
6
- import {} from '@ai-ecoverse/slicc-cdp';
7
- ```
5
+ ## playwright-cli
8
6
 
9
- `playwright-cli` is the Rust binary in `crates/playwright-cli`. It speaks Chrome CDP JSON. Connect with `--cdp`, else `SLICC_CDP_URL`, else `GET http://127.0.0.1:9222/json/version`. It does not launch Chrome and does not invent a debugger path.
7
+ The binary is `crates/playwright-cli`. It does not launch Chrome and it does not invent a debugger path.
10
8
 
11
- The kernel command is the `wasm32-wasip1` build at `bin/playwright-cli.wasm`, declared as `slicc.commands.playwright-cli` with `slicc.abi` `wasi`. `npm run build:wasm` produces it, and the release workflow runs that before publish. On that target, TCP comes from the vendored homescoop `wasix-net` crate (`vendor/wasix-net`, pinned in `UPSTREAM`) instead of Rust std, which does not open sockets for `wasm32-wasip1`. `--version` prints the `package.json` version. A server close frame is reported as `websocket closed <code> <reason>`, and this client does not write again after it.
9
+ 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.
12
10
 
13
- Node ≥ 24. `npm run lint` runs `slicc-lint`. Releases use semantic-release on `main`.
11
+ One browser WebSocket. `Target.attachToTarget` uses `{targetId, flatten: true}`. Later page commands send that `sessionId` at the top level. There is no `/devtools/page/<id>` socket.
12
+
13
+ Implemented commands: `open`, `close`, `goto`, `snapshot`, `click`, `fill`, `type`, `press`, `screenshot`, `eval`, `tab-list`, `tab-new`, `tab-select`, `tab-close`. `snapshot` prints ARIA refs such as `e1` and iframe refs such as `f1e5`. Other names from the command manifest print `playwright-cli <command>: not implemented yet` and exit non-zero. `--help` lists those names under "Not implemented yet". It does not yet match upstream help for the whole shared set.
14
+
15
+ A non-2xx discovery response prints the status and the body and exits non-zero. A server close frame prints `websocket closed <code> <reason>` and exits non-zero. After that frame is visible, the client does not write to the socket again. `--version` and `-V` print `playwright-cli` plus the `package.json` version.
16
+
17
+ ## curlwright
18
+
19
+ `curlwright` is the Rust binary in `crates/curlwright`. It runs curl-style requests as a page-context `fetch()` in an already-open tab, so that tab's cookies, origin, and service worker apply. It uses the same connect order. The shared CDP client is `crates/cdp-client`. Without `--tab`, it uses the `current` target in `.playwright-cli/session.json` when that tab is still open, otherwise the single open tab on the request URL's origin. Any other case exits 2 and lists `--tab` choices. A tab on a different origin is not used unless `--tab` or that session names it.
20
+
21
+ ## Kernel commands
22
+
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`).
24
+
25
+ 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
+
27
+ ## Package
28
+
29
+ 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.
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-ecoverse/slicc-cdp",
3
- "version": "1.1.2",
3
+ "version": "1.2.1",
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",
@@ -26,19 +26,23 @@
26
26
  },
27
27
  "files": [
28
28
  "src",
29
- "bin/playwright-cli.wasm"
29
+ "bin/playwright-cli.wasm",
30
+ "bin/curlwright.wasm"
30
31
  ],
31
32
  "slicc": {
32
33
  "abi": "wasi",
33
34
  "commands": {
34
35
  "playwright-cli": {
35
36
  "wasm": "bin/playwright-cli.wasm"
37
+ },
38
+ "curlwright": {
39
+ "wasm": "bin/curlwright.wasm"
36
40
  }
37
41
  }
38
42
  },
39
43
  "scripts": {
40
44
  "prepare": "lefthook install",
41
- "build:wasm": "cargo build --release --target wasm32-wasip1 --bin playwright-cli && mkdir -p bin && cp target/wasm32-wasip1/release/playwright-cli.wasm bin/playwright-cli.wasm",
45
+ "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",
42
46
  "prepublishOnly": "npm run build:wasm",
43
47
  "lint": "slicc-lint",
44
48
  "format": "biome check --write .",
@@ -48,7 +52,7 @@
48
52
  "release": "semantic-release"
49
53
  },
50
54
  "devDependencies": {
51
- "@ai-ecoverse/slicc-shared-web": "1.10.0",
55
+ "@ai-ecoverse/slicc-shared-web": "1.10.1",
52
56
  "@biomejs/biome": "2.5.15",
53
57
  "lefthook": "2.1.16",
54
58
  "semantic-release": "25.0.9"