@ai-ecoverse/slicc-kernel 1.191.3 → 1.192.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
@@ -304,6 +304,7 @@ The Worker needs a Worker Loader binding (`worker_loaders`) and a SQLite-backed
304
304
  | `isolates` | `{ max: 8, waitMs: 10000, memory: 64 MiB, perInstance: 8 MiB }` | how many Dynamic Workers run at once, how long a spawn waits for one, and the memory budget per Dynamic Worker |
305
305
  | `commands` | none | `{ append }`: more command roots, as for `createKernel`; one can be a mount (see [A file system the Durable Object serves](#a-file-system-the-durable-object-serves)) |
306
306
  | `network` | none | `{ transport, tlsEngine, uplink, doh }`: the transport programs reach the outside world through, and the TLS engine for their `https://` requests (see [The network](#the-network-in-a-durable-object)) |
307
+ | `cdp` | none | a `CdpHook` that offers programs a browser, as `createKernel`'s `cdp` does (see [Browser automation](#browser-automation-cdp)); a relay to Cloudflare Browser Run, say, without a client of its own and its `serveCdp` |
307
308
 
308
309
  **How it works.** Workers has no `Worker`, refuses `Atomics.wait`, and does not share memory between isolates, so a process cannot block the way it does in a page. Here a process is a wasm instance in a Dynamic Worker, parked with JSPI (`WebAssembly.Suspending`) while its system call is answered by the Durable Object over Workers RPC.
309
310
  - **The kernel side is the same code as in the page.** A proxy in the Durable Object speaks the kernel's shared-memory protocol on behalf of each remote process (`src/async/remote-worker.ts`).
@@ -960,7 +961,7 @@ Programs drive a browser with the Chrome DevTools Protocol over a WebSocket, whi
960
961
  - **No host**: `/json/*` and the WebSocket handshake answer `503` with `slicc-kernel: no CDP host is attached (createKernel({ cdp }) or client.serveCdp)`, and a host that refuses (an unknown runtime, say) gives `502` with its message.
961
962
  - **Kernel-only**: port `9222` is reserved (a program's `bind()` to it fails with `EADDRINUSE`, so none can squat it) and takes connections only from programs in the kernel. `kernel.dial`, a client's `dial` and `loopbackFetch` (and so `9222.kernel.localhost`) are refused with `ECONNREFUSED`, since the facade drives the user's real browser.
962
963
 
963
- An embedder offers a browser with the `cdp` option of `createKernel` or `createNodeKernel`, or from an attached client with `client.serveCdp(hook, { runtime })`:
964
+ An embedder offers a browser with the `cdp` option of `createKernel`, `createNodeKernel` or `createCloudflareKernel`, or from an attached client with `client.serveCdp(hook, { runtime })`:
964
965
 
965
966
  ```ts
966
967
  interface CdpConnection {
@@ -972,6 +973,7 @@ interface CdpConnection {
972
973
  type CdpHook = (request: { runtime?: string; stamp?: ConnectorStamp }) => Promise<CdpConnection>;
973
974
  ```
974
975
 
976
+ - **A failing host** answers the program, whichever way it fails: a hook that throws or rejects gives `502` with its message, and a connection that calls `onclose` (even from the `onclose` setter, or before the kernel set it) gives a WebSocket `1011` with its reason, or `/json/list` a `502`. The kernel holds a connection's messages and close until it has set `onmessage` and `onclose`, so a hook may call them as soon as it has the connection.
975
977
  - **The stamp** is the connecting process's identity, the same [`ConnectorStamp`](#page-facades) a facade's hook gets: `{ pid, ppid, uid, gid, user?, groups, users, tag?, tags? }`. The kernel takes it at `connect()` from the process's credentials and tags, never from anything the program sends or sets (its URL, headers, environment or arguments), so a program cannot forge it. `tag` is the first tag, and `tags` lists them all when there are more than one, so a host that treats a run's processes differently (slicc-bios drops the `Slicc.action` intent of a process tagged `slicc-taint:<id>`) checks every one of `tags ?? [tag]`. Every hook call for a program's connection to `9222` (`/json/list` and the WebSocket alike) has it, a copy of its own, for the embedder's `cdp` hook and a client's `serveCdp` hook. A kernel from before the field gives no `stamp` (to a client's hook: a kernel before protocol 1.17), so a host should treat a request without one as untrusted. As with a facade, a socket handed to another process keeps the stamp of the process that connected.
976
978
 
977
979
  A connection is one browser-level CDP session; a host with only per-tab debugging emulates the `Target` domain behind it. A connection asking for a `runtime` goes to the newest client that offered that name; any other goes to the `cdp` option, or else to the newest client offer. In the browser the hook runs on the page, with a `MessagePort` per connection to the kernel worker.
@@ -1362,7 +1362,7 @@ function createParentRefreshCount() {
1362
1362
  }
1363
1363
 
1364
1364
  // src/version.ts
1365
- var KERNEL_VERSION = true ? "1.191.3" : "0.0.0-dev";
1365
+ var KERNEL_VERSION = true ? "1.192.0" : "0.0.0-dev";
1366
1366
  var OS_RELEASE = "6.0.0-slicc";
1367
1367
  function procVersion() {
1368
1368
  return `Linux version ${OS_RELEASE} (slicc-kernel ${KERNEL_VERSION}) #1 SMP PREEMPT_DYNAMIC