From a8fcdb972b245850b1933d02da210a6dc056c4bc Mon Sep 17 00:00:00 2001 From: Sina Meraji Date: Mon, 2 Nov 2026 15:36:53 +0800 Subject: [PATCH 1/2] fix(cli): expose workerd's WebSocket ready-state constants in the native engine workerd's WebSocket has both OPEN/CLOSED and READY_STATE_* statics. The native engine only had the short spellings, so libraries that read WebSocket.READY_STATE_OPEN (PartyServer's connection manager, for one) saw undefined and treated every hibernatable socket as closed. Co-authored-by: autopilot Signed-off-by: Sina Meraji --- packages/cli/src/native/engine.js | 5 +++++ packages/cli/src/native/websocket.js | 6 ++++++ packages/cli/test/native-websocket.test.js | 11 ++++++++++- 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/packages/cli/src/native/engine.js b/packages/cli/src/native/engine.js index e9ba14b..7540b75 100644 --- a/packages/cli/src/native/engine.js +++ b/packages/cli/src/native/engine.js @@ -432,6 +432,11 @@ function installWorkersGlobals() { value: (value) => value instanceof WorkersWebSocket || nativeHasInstance.call(ClientWebSocket, value), configurable: true, }); + // workerd's WebSocket exposes both spellings of the ready-state constants; + // libraries such as PartyServer read the READY_STATE_* ones. + for (const [name, value] of Object.entries({ READY_STATE_CONNECTING: 0, READY_STATE_OPEN: 1, READY_STATE_CLOSING: 2, READY_STATE_CLOSED: 3 })) { + if (!(name in ClientWebSocket)) Object.defineProperty(ClientWebSocket, name, { value, configurable: true }); + } Object.defineProperty(ClientWebSocket, RESPONSE_PATCHED, { value: true }); } if (globalThis.Response[RESPONSE_PATCHED]) return; diff --git a/packages/cli/src/native/websocket.js b/packages/cli/src/native/websocket.js index d8db59a..7732d08 100644 --- a/packages/cli/src/native/websocket.js +++ b/packages/cli/src/native/websocket.js @@ -37,6 +37,12 @@ export class WorkersWebSocket extends EventTarget { static OPEN = 1; static CLOSING = 2; static CLOSED = 3; + // workerd exposes both spellings; libraries such as PartyServer read the + // READY_STATE_* statics when they check a socket's state. + static READY_STATE_CONNECTING = 0; + static READY_STATE_OPEN = 1; + static READY_STATE_CLOSING = 2; + static READY_STATE_CLOSED = 3; #peer; #owner; diff --git a/packages/cli/test/native-websocket.test.js b/packages/cli/test/native-websocket.test.js index a7db4b9..7bccd03 100644 --- a/packages/cli/test/native-websocket.test.js +++ b/packages/cli/test/native-websocket.test.js @@ -3,7 +3,7 @@ import { mkdtemp, mkdir, rm, writeFile } from "node:fs/promises"; import { tmpdir } from "node:os"; import { join } from "node:path"; import { after, test } from "node:test"; -import { FrameParser, WebSocketPair, acceptKey, encodeFrame } from "../src/native/websocket.js"; +import { FrameParser, WebSocketPair, WorkersWebSocket, acceptKey, encodeFrame } from "../src/native/websocket.js"; import { NativeEngine, loadProjectConfig } from "../src/native/engine.js"; const directories = []; @@ -64,6 +64,11 @@ test("parsing stays linear for large frames and floods of empty fragments", () = }); test("pair ends deliver messages after accept(), keep attachments, and close both sides", async () => { + // workerd exposes both spellings; PartyServer reads the READY_STATE_* ones. + assert.deepEqual( + [WorkersWebSocket.READY_STATE_CONNECTING, WorkersWebSocket.READY_STATE_OPEN, WorkersWebSocket.READY_STATE_CLOSING, WorkersWebSocket.READY_STATE_CLOSED], + [0, 1, 2, 3], + ); const [client, server] = new WebSocketPair(); const received = []; server.addEventListener("message", (event) => received.push(event.data)); @@ -139,6 +144,10 @@ test("Durable Objects accept hibernatable WebSockets through the engine", async await engine.start(); const { port } = await engine.listen({ port: 0 }); try { + // The global WebSocket is Node's client class; the engine adds workerd's + // ready-state constants to it, which PartyServer reads. + assert.equal(globalThis.WebSocket.READY_STATE_OPEN, 1); + assert.equal(globalThis.WebSocket.READY_STATE_CLOSED, 3); const plain = await fetch(`http://127.0.0.1:${port}/`); assert.equal(plain.status, 426); From fa494df708761df28b94c730b0c41e156d007aa7 Mon Sep 17 00:00:00 2001 From: Sina Meraji Date: Mon, 2 Nov 2026 15:36:56 +0800 Subject: [PATCH 2/2] feat(conformance): add a PartyServer suite and record its results PartyServer was only ever tested by hand on celld in M0. Add party-app/, a partyserver 0.5.10 Server with hibernation enabled, and a party suite in the runner: storage and addressing through getServerByName, alarms, /parties/chat/ routing, broadcast to two connections, connection attachments, and hibernation across idle eviction (celld and native; Wrangler's local runtime gives the runner no eviction control). Wrangler 21/21, celld 24/24, native 23/23 (also 23/23 on three threads). Update the results table, compatibility table, native engine docs, README and AGENTS.md. Co-authored-by: autopilot Signed-off-by: Sina Meraji --- AGENTS.md | 6 +- README.md | 6 +- docs/compatibility.md | 3 +- docs/conformance/results.md | 17 +- docs/native-engine.md | 7 +- package-lock.json | 217 +++++++++++++++---- packages/conformance/README.md | 11 +- packages/conformance/package.json | 1 + packages/conformance/party-app/src/index.js | 166 ++++++++++++++ packages/conformance/party-app/wrangler.json | 10 + packages/conformance/src/run.js | 114 +++++++++- packages/conformance/test/run.test.js | 5 +- 12 files changed, 490 insertions(+), 73 deletions(-) create mode 100644 packages/conformance/party-app/src/index.js create mode 100644 packages/conformance/party-app/wrangler.json diff --git a/AGENTS.md b/AGENTS.md index e3fe7c5..833e6b7 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -5,7 +5,7 @@ Guidance for agents working in this repository. Prefer the checked-in code and t ## 1. Project - Published on npm as one package, `serverless-objects` (0.13.x, pre-alpha). It contains the `sobjects` CLI, the native engine, and the `serverless-objects/hotcell` and `serverless-objects/autopilot` modules. There is no `@serverless-objects` npm scope; ship new modules as subpath exports of this package. -- Two engines: celld (external, pinned 0.6.2) and the native engine (`sobjects dev --engine native`: in-process, trusted code, node:sqlite per object). Conformance: Cloudflare 17/17 (`test:cloudflare`, deploys to the logged-in account and deletes afterwards), Wrangler 4.150.0 17/17, celld 0.6.2 19/19, native 18/18 (hibernation runs everywhere but Wrangler; facets pass on Wrangler and celld but not the native engine; a schedule across restart runs on celld and native). +- Two engines: celld (external, pinned 0.6.2) and the native engine (`sobjects dev --engine native`: in-process, trusted code, node:sqlite per object). Conformance: Cloudflare 17/17 (`test:cloudflare`, deploys to the logged-in account and deletes afterwards), Wrangler 4.150.0 21/21, celld 0.6.2 24/24, native 23/23 (hibernation runs everywhere but Wrangler; facets pass on Wrangler and celld but not the native engine; a schedule across restart runs on celld and native; the PartyServer suite runs on Wrangler, celld and native but not Cloudflare). - ACME HTTP-01 is verified only against a local Pebble server. Point-in-time restore is not available on celld 0.6. The native engine has bucket backups (`--backup-bucket`; `--backup-mode durable` holds each result until its writes are in the bucket and adds Cloudflare's point-in-time recovery API, back `--backup-retention-days`), several nodes per bucket (`--node-name`, `--peer-listen`), and optional worker threads (`--threads`; fault and CPU isolation, not a security boundary). A `[native]` table in `sobjects.toml` (instead of `[celld]`) makes `sobjects up` run it as `sobjects dev --engine native` in a child process; `[admin]` isn't supported with it yet. Roadmap targets are not guarantees. Serverless Objects is a self-hostable operating layer for Cloudflare Workers and Durable Objects applications, aimed at coding-agent infrastructure. It is JavaScript (ES modules) on Node.js >=22, managed with npm workspaces; the product is the `sobjects` CLI (workspace package `serverless-objects`). The CLI supervises the external celld runtime (pinned v0.6.2) for production nodes and also ships a Node-native engine for trusted code. Cloudflare Workers/Wrangler APIs are the compatibility contract. The dashboard is plain HTML/CSS/JS; there is no application framework or TypeScript codebase. Status: pre-alpha. @@ -54,7 +54,7 @@ CI: `.github/workflows/ci.yml` runs `npm ci`, `npm test`, and the Wrangler and n | `packages/cli/autopilot/` | `serverless-objects/autopilot` (and `/autopilot/cell`): `RunObject`/`RunRegistry`/`AutopilotCellRun`. Runtime-independent logic in `run-store.js`, `run-host.js`, `registry-store.js` and `cell-executor.js` over an `{exec, transaction}` SQL adapter; tests (`test/autopilot-*.test.js`) use `node:sqlite`. | | `deploy/compose/` | Dockerfile and Compose bundle for a single node; pins the npm CLI version via `SOBJECTS_VERSION`. | | `examples/` | Runnable Wrangler projects (not workspaces) that import the packages through the root `node_modules`. | -| `packages/conformance/` | Private workspace: conformance apps (`app/` core, `agents-app/` Agents SDK), runner (`src/run.js`) for Wrangler, celld and native, and runner tests. | +| `packages/conformance/` | Private workspace: conformance apps (`app/` core, `agents-app/` Agents SDK, `party-app/` PartyServer), runner (`src/run.js`) for Wrangler, celld and native, and runner tests. | | `sobjects.example.toml` | Safe starter configuration; copy to the ignored, machine-specific `sobjects.toml`. | | `docs/conformance/` | Recorded Workers/celld compatibility findings (`m0-celld.md`) and conformance results (`results.md`); consult before changing runtime assumptions. | | `docs/install.md`, `docs/porting-from-cloudflare.md`, `docs/compatibility.md` | User guides and the supported/unsupported table; keep them in step with conformance results. | @@ -77,7 +77,7 @@ CI: `.github/workflows/ci.yml` runs `npm ci`, `npm test`, and the Wrangler and n ## 5. Dependencies - Use npm workspaces and commit the matching `package-lock.json` update. Add CLI runtime dependencies with `npm install --workspace=serverless-objects `; use `--save-dev` for tools used only in development/tests. Keep root tooling out of runtime dependencies. -- CLI runtime dependencies: `jsonc-parser`, `smol-toml`, `esbuild` (celld deploy, the native engine and `build`), `@hotcell/sdk` (Hotcell binding and cell executor), and for ACME `jose`, `@root/csr`, `@root/keypairs`, `@root/encoding`; tests use Node built-ins and `node:sqlite`. The conformance workspace pins `wrangler` and `agents` exactly as dev dependencies. Avoid adding dependencies for functionality available in supported Node versions. +- CLI runtime dependencies: `jsonc-parser`, `smol-toml`, `esbuild` (celld deploy, the native engine and `build`), `@hotcell/sdk` (Hotcell binding and cell executor), and for ACME `jose`, `@root/csr`, `@root/keypairs`, `@root/encoding`; tests use Node built-ins and `node:sqlite`. The conformance workspace pins `wrangler`, `agents` and `partyserver` exactly as dev dependencies. Avoid adding dependencies for functionality available in supported Node versions. - Examples: runtime package `npm install --workspace=serverless-objects `; test/build-only tool `npm install --workspace=serverless-objects --save-dev `. Keep the root lockfile synchronized. - No bundler/native dependency pipeline exists. Keep celld as an external executable: `engine.js` pins its version and SHA-256 asset checksums, installs/verifies it at runtime, and supports `SOBJECTS_CELLD_BIN` for an existing binary. Do not bundle or bypass verification of it. - Package dependency ranges currently use npm semver ranges (for example `^`) with the lockfile providing reproducibility; the engine version is exact and checksum-pinned. Preserve that distinction and update checksums when intentionally changing celld. diff --git a/README.md b/README.md index 01d2683..a096e39 100644 --- a/README.md +++ b/README.md @@ -94,9 +94,9 @@ State survives `down` and `up` because it lives in the bucket. The [install guid ## Compatibility -Cloudflare's APIs are the contract. The current [conformance results](docs/conformance/results.md) pass every check on real Cloudflare (17/17), Wrangler 4.150.0 (17/17), celld 0.6.2 (19/19) and the native engine (18/18): the same apps, unchanged. They cover Durable Object IDs, KV and SQL storage, transactions, input gates, RPC, alarms (including across a restart), WebSockets with hibernation on celld, facets on Wrangler and celld, and an Agents SDK suite: state, SQL, schedules (including one across a restart), addressing and `@callable()` RPC. +Cloudflare's APIs are the contract. The current [conformance results](docs/conformance/results.md) pass every check on real Cloudflare (17/17), Wrangler 4.150.0 (21/21), celld 0.6.2 (24/24) and the native engine (23/23): the same apps, unchanged. They cover Durable Object IDs, KV and SQL storage, transactions, input gates, RPC, alarms (including across a restart), WebSockets with hibernation on celld, facets on Wrangler and celld, an Agents SDK suite (state, SQL, schedules including one across a restart, addressing and `@callable()` RPC), and a PartyServer suite (storage, alarms, room routing, broadcast and hibernation). The Cloudflare run predates the PartyServer suite. -Not covered yet: sockets across a cell move between nodes, PartyServer, Agents SDK chat, MCP and Workflows, and Cloudflare-hosted production behavior. Facets pass on Wrangler and celld but are not implemented by the native engine. Point-in-time restore isn't available on celld 0.6; the native engine has Cloudflare's point-in-time recovery API in durable mode. The [compatibility table](docs/compatibility.md) has the details, including Containers and `@cloudflare/sandbox` 1.0 on celld. The [porting guide](docs/porting-from-cloudflare.md) covers moving an existing project. +Not covered yet: sockets across a cell move between nodes, PartyServer on Cloudflare or through `sobjects deploy`, Agents SDK chat, MCP and Workflows, and Cloudflare-hosted production behavior. Facets pass on Wrangler and celld but are not implemented by the native engine. Point-in-time restore isn't available on celld 0.6; the native engine has Cloudflare's point-in-time recovery API in durable mode. The [compatibility table](docs/compatibility.md) has the details, including Containers and `@cloudflare/sandbox` 1.0 on celld. The [porting guide](docs/porting-from-cloudflare.md) covers moving an existing project. ## Repository layout @@ -115,7 +115,7 @@ celld is driven through a small contract: the Wrangler bundle, the Wrangler conf | Engine | Status | Notes | |---|---|---| | [celld](https://github.com/denoland/celld) | Supported (0.6.2, pinned) | Runs Wrangler bundles with Durable Objects, KV, D1, R2, Queues, Workflows and Containers. | -| native | In progress: `sobjects dev --engine native` | Runs the Worker and Durable Objects in Node, with each object in its own SQLite file and full Node APIs inside objects. It passes the full conformance suite (18/18, hibernation and the Agents SDK included, with facets skipped), with idle eviction. `sobjects build --strict` checks that an app stays portable to Cloudflare. `--backup-bucket` backs objects up to S3-compatible storage (with `--backup-mode durable`, every acknowledged write is in the bucket), `--threads N` spreads objects over worker threads, and `--node-name` lets several nodes share one bucket, taking over each other's objects and forwarding calls. A `[native]` table in `sobjects.toml` runs it under `sobjects up`. For trusted code. See [the native engine](docs/native-engine.md). | +| native | In progress: `sobjects dev --engine native` | Runs the Worker and Durable Objects in Node, with each object in its own SQLite file and full Node APIs inside objects. It passes the full conformance suite (23/23, hibernation, the Agents SDK and PartyServer included, with facets skipped), with idle eviction. `sobjects build --strict` checks that an app stays portable to Cloudflare. `--backup-bucket` backs objects up to S3-compatible storage (with `--backup-mode durable`, every acknowledged write is in the bucket), `--threads N` spreads objects over worker threads, and `--node-name` lets several nodes share one bucket, taking over each other's objects and forwarding calls. A `[native]` table in `sobjects.toml` runs it under `sobjects up`. For trusted code. See [the native engine](docs/native-engine.md). | ## Why diff --git a/docs/compatibility.md b/docs/compatibility.md index 2d12bcd..da523f5 100644 --- a/docs/compatibility.md +++ b/docs/compatibility.md @@ -18,7 +18,8 @@ This table distinguishes behavior exercised by the project from functionality de | WebSocket hibernation/eviction | Tested on celld | Same-node hibernation passed on celld 0.6.2: the object was evicted with a socket open, and the next message reached a new instance with tags and attachment intact. Not run on Wrangler (no eviction control). celld documents that sockets may close when a cell moves between nodes; that is not tested. | | Facets | Tested on Wrangler and celld | `ctx.facets.get` with a class taken from `ctx.exports` passed on Wrangler 4.150.0 and celld 0.6.2: state by name, isolation between facets, storage separate from the parent, and alarms refused. The native engine does not implement `ctx.facets`, so the check is skipped there. | | Durable Object migrations | Limited upstream support | celld 0.6.2 accepts `tag` and `new_sqlite_classes`; rename/delete/transfer migrations are rejected. | -| Agents SDK / PartyServer | Partial | A minimal `agents` 0.28.1 app was deployed through `sobjects deploy` and served by `sobjects up` behind TLS ingress (celld 0.6.2, SeaweedFS): routing, `setState`, `this.sql`, `schedule()` (including one pending across a node restart), and the WebSocket identity/state protocol matched `wrangler dev`. Callable RPC passes in the conformance suite on celld and the native engine (Agents SDK client protocol), and a delayed schedule now survives a process restart there, but neither has been exercised through `sobjects deploy`/`up`; chat agents, MCP, Workflows and the official samples have not been run through the CLI. PartyServer chat was tested only directly on celld in M0. See [M0 findings](conformance/m0-celld.md). | +| Agents SDK | Partial | A minimal `agents` 0.28.1 app was deployed through `sobjects deploy` and served by `sobjects up` behind TLS ingress (celld 0.6.2, SeaweedFS): routing, `setState`, `this.sql`, `schedule()` (including one pending across a node restart), and the WebSocket identity/state protocol matched `wrangler dev`. Callable RPC passes in the conformance suite on celld and the native engine (Agents SDK client protocol), and a delayed schedule now survives a process restart there, but neither has been exercised through `sobjects deploy`/`up`; chat agents, MCP, Workflows and the official samples have not been run through the CLI. | +| PartyServer | Tested on Wrangler, celld and the native engine | `partyserver` 0.5.10 in its own conformance app: `getServerByName` and `this.name` from `ctx.id.name`, `onStart`, `this.sql`, alarms, `/parties//` routing, `broadcast()` to two connections, connection attachments, and hibernation across idle eviction (celld and native only; Wrangler's local runtime gives the runner no eviction control). Not run on Cloudflare, and not through `sobjects deploy`/`up`. The native engine needed workerd's `READY_STATE_*` ready-state constants on the global `WebSocket` for PartyServer's connection manager. See [results](conformance/results.md). | | Cloudflare-hosted production behavior | Not tested | Local Wrangler and celld results do not certify production Cloudflare behavior. | ## Bindings and topology diff --git a/docs/conformance/results.md b/docs/conformance/results.md index 8737f14..ab358eb 100644 --- a/docs/conformance/results.md +++ b/docs/conformance/results.md @@ -2,11 +2,12 @@ Recorded 19–29 Oct 2026 on macOS arm64 with Node.js 24.12.0, using the local Wrangler runner as the reference and celld's local development server. Each -runner completed all of its checks in one run: 17 on Wrangler (11 core, 6 Agents SDK), 19 on celld (adding hibernation and facets) and 18 on the native engine (adding hibernation and a schedule across restart, without facets). +runner completed all of its checks in one run: 21 on Wrangler (11 core, 6 Agents SDK, 4 PartyServer), 24 on celld (adding hibernation and facets, plus a PartyServer hibernation check) and 23 on the native engine (adding hibernation and a schedule across restart, without facets). - Wrangler: 4.150.0 (`wrangler dev --local`) - celld: 0.6.2 (`celld dev`) - Agents SDK: `agents` 0.28.1 (separate app with `nodejs_compat`) +- PartyServer: `partyserver` 0.5.10 (separate app with `nodejs_compat`) - Worker compatibility date: `2026-02-24` - Command: `npm run test:wrangler --workspace=sobjects-conformance` and `npm run test:celld --workspace=sobjects-conformance` @@ -29,10 +30,14 @@ runner completed all of its checks in one run: 17 on Wrangler (11 core, 6 Agents | Agents SDK schedule across restart | Not run | Not run | Pass | Pass | A delayed schedule armed before a process restart was still pending afterwards and fired | | Agents SDK addressing | Pass | Pass | Pass | Pass | `getAgentByName`, `this.name`, class name, `/agents//` routing | | Agents SDK client protocol | Pass | Pass | Pass | Pass | Identity and state frames, `@callable()` RPC over WebSocket, state broadcast, non-callable methods refused | +| PartyServer storage and addressing | Not run | Pass | Pass | Pass | `getServerByName`, `this.name` from `ctx.id.name`, `onStart`, and `this.sql` create/insert/ordered select | +| PartyServer alarm | Not run | Pass | Pass | Pass | `setAlarm`, `onAlarm` and `getAlarm` through PartyServer's `alarm()` | +| PartyServer WebSocket broadcast | Not run | Pass | Pass | Pass | `/parties/chat/` routing, welcome frames, `broadcast()` to both connections, connection count, attachment, and `this.sql` from a socket message | +| PartyServer WebSocket hibernation | Not run | Not run | Pass | Pass | Evicted with the socket open; the next message reached a new instance with the connection attachment rehydrated from the socket | -The Cloudflare column is from `npm run test:cloudflare` (20 Oct 2026): 17/17. The runner deployed both apps unchanged with `wrangler deploy` to a workers.dev subdomain on the free plan, ran every check against the deployment, and deleted the Workers. Cloudflare hibernated the object on its own during a 30-second idle period. There is no process to restart, so the alarm-across-restart check runs as plain alarm delivery there. The facets and schedule-across-restart checks were added after that run and have not been run on Cloudflare. +The Cloudflare column is from `npm run test:cloudflare` (20 Oct 2026): 17/17. The runner deployed both apps unchanged with `wrangler deploy` to a workers.dev subdomain on the free plan, ran every check against the deployment, and deleted the Workers. Cloudflare hibernated the object on its own during a 30-second idle period. There is no process to restart, so the alarm-across-restart check runs as plain alarm delivery there. The facets, schedule-across-restart and PartyServer checks were added after that run and have not been run on Cloudflare. -The native engine column is from `npm run test:native` on the same host (29 Oct 2026): 18/18, with `--idle-evict-seconds 2` for the hibernation check; see [the native engine](../native-engine.md). +The native engine column is from `npm run test:native` on the same host (29 Oct 2026): 23/23, with `--idle-evict-seconds 2` for the hibernation checks; see [the native engine](../native-engine.md). The PartyServer suite needed one engine fix: the global `WebSocket` now exposes workerd's `READY_STATE_*` ready-state constants, which PartyServer reads when it filters hibernatable sockets. ## Platforms @@ -41,7 +46,9 @@ Every column above is one local run on macOS arm64. CI runs the Wrangler and nat ## Not covered This v0 run does not test hibernation on Wrangler, the alarm-across-restart check on Cloudflare or Wrangler, sockets across a cell move between nodes, all -compatibility flags, PartyServer, or -Agents SDK chat agents, MCP, Workflows and streaming RPC. These runners use `wrangler dev` and `celld dev` directly; they do not +compatibility flags, or +Agents SDK chat agents, MCP, Workflows and streaming RPC. PartyServer is covered +by its own suite on Wrangler, celld and the native engine, but not on Cloudflare, +and not through `sobjects deploy`. These runners use `wrangler dev` and `celld dev` directly; they do not go through `sobjects deploy`. Those remain separate conformance and product-level gates. diff --git a/docs/native-engine.md b/docs/native-engine.md index 81de518..f3fabe6 100644 --- a/docs/native-engine.md +++ b/docs/native-engine.md @@ -21,9 +21,10 @@ The app's own code is bundled with esbuild, which handles TypeScript and `define | Storage | Yes: async and synchronous (`ctx.storage.kv`) KV with V8 structured clone, ordered `list`, `sql.exec` cursors (`toArray`, `one`, `raw`, `columnNames`, `rowsRead`, `rowsWritten`, `databaseSize`), `transactionSync`, `transaction`, `deleteAll` (also clears the alarm) | | Alarms | Yes: `setAlarm`/`getAlarm`/`deleteAlarm`, delivered after a restart, and retried with backoff (up to 6 retries) when the handler throws | | `vars`, `cloudflare:workers` (`DurableObject`, `WorkerEntrypoint`, `WorkflowEntrypoint`, `RpcTarget`, `env`, `exports`), `cloudflare:email` (`EmailMessage` only) | Yes | -| WebSockets | Yes: `WebSocketPair`, `accept()`, event listeners, attachments, and a built-in RFC 6455 server (handshake, masking, fragmentation, ping/pong, close handshake) | +| WebSockets | Yes: `WebSocketPair`, `accept()`, event listeners, attachments, the `OPEN`/`CLOSED` and `READY_STATE_*` ready-state constants, and a built-in RFC 6455 server (handshake, masking, fragmentation, ping/pong, close handshake) | | Hibernation API | Yes: `acceptWebSocket` with tags, `getWebSockets`, `getTags`, `setWebSocketAutoResponse` (answered without waking the object), and `webSocketMessage`/`webSocketClose`/`webSocketError` delivered through the object's input-gated queue. Sockets belong to the object's host, so an evicted object's hibernatable sockets stay open, and the next message wakes a new instance. | | Agents SDK | Yes: the conformance Agents suite passes (state, SQL, schedules, addressing, `@callable()` RPC over WebSocket, and a delayed schedule that survives a process restart) | +| PartyServer | Yes: the conformance PartyServer suite passes (storage and addressing through `getServerByName`, alarms, `/parties//` routing, `broadcast()`, connection attachments, and hibernation across idle eviction) | | Facets (`ctx.facets`) | Not yet. The engine has no `ctx.facets`, so the conformance facet check is skipped on this target. | | KV, D1, R2, Queues, Workflows, service bindings, assets | Not yet. The engine refuses a config that declares them. | | Idle eviction | Yes: an object idle for `--idle-evict-seconds` (default 60; 0 never) loses its instance. Sockets accepted with `accept()` and listeners keep it in memory. An object with no sockets and no pending alarm also closes its database. | @@ -176,7 +177,7 @@ What they don't: - Cheap operations get slower, not faster: a call that crosses threads costs roughly 0.3–0.5 ms more, and the main thread's HTTP handling limits throughput as it does with one thread. - A Worker that receives a WebSocket from an object on another thread can return it as a 101 response, but can't add its own event listeners to it. -The conformance suite passes 17/17 on three threads, and CI runs it that way too. +The conformance suite passes 23/23 on three threads, and CI runs it that way too. ## Performance @@ -186,4 +187,4 @@ See [benchmarks](benchmarks.md) for latency and throughput next to celld and Wra The conformance runner has a `native` target: `npm run test:native --workspace=sobjects-conformance`. -It passes all 18 checks: the core suite, including the alarm-across-restart and hibernation checks, plus the Agents SDK suite, including a schedule that survives a process restart. The facet check is skipped here because the engine has no `ctx.facets`. The runner starts the engine with `--idle-evict-seconds 2`. CI runs it on every change. See [results](conformance/results.md). +It passes all 23 checks: the core suite, including the alarm-across-restart and hibernation checks, the Agents SDK suite, including a schedule that survives a process restart, and the PartyServer suite, including hibernation across idle eviction. The facet check is skipped here because the engine has no `ctx.facets`. The runner starts the engine with `--idle-evict-seconds 2`. CI runs it on every change. See [results](conformance/results.md). diff --git a/package-lock.json b/package-lock.json index 8aa71a7..5b99fb1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -35,6 +35,7 @@ "integrity": "sha512-YLsYoQMvL8l8WrGpN3Zj7O1wK5LEBN+cQtux7BcuHyxIXve724XG+zuJ1n3U1cUweRtTzQOA4IHbuQw3N34SZw==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": "^22.18.0 || >=24.11.0" } @@ -120,6 +121,7 @@ "integrity": "sha512-ilAZCdOOlOVA7dQbaFNw2f/59p6GW33NxTopc3DvEE3efp3ZXTrGX/yZScaKw8/vd9bq31Ag0EcXiLw32bAgJg==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@babel/compat-data": "^8.0.5", "@babel/helper-validator-option": "^8.0.0", @@ -261,6 +263,7 @@ "integrity": "sha512-U4Dybxh4WESWHt5XhBeExi4DrY0/DNK1aHpQbsrQXCUbFHuMweT0TpLEWKvaraV2Y6fS+ZXunsZ8zIuZIgvF2Q==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": "^22.18.0 || >=24.11.0" } @@ -271,6 +274,7 @@ "integrity": "sha512-5dMj5kFwS2AY7Dt4PZp4px3c5ThMbbEa7tZfuHTncCGSFYq8uoA1ufDE1IS/lYpQedE+3+GQ3cPZUiplIu195w==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@babel/template": "^8.0.0", "@babel/types": "^8.0.6" @@ -335,7 +339,6 @@ "integrity": "sha512-NpugTzbKgGrNe45Ui32cN8vCFFMxVtP/9rtfwv0nP5FRDAjvYBxJcLVpYA9mr1jxP6cnIT7x9LUzuDTbWYYNRA==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=6.9.0" } @@ -406,8 +409,7 @@ "resolved": "https://registry.npmjs.org/@cfworker/json-schema/-/json-schema-4.1.1.tgz", "integrity": "sha512-gAmrUZSGtKc3AiBL71iNWxDsyUC5uMaKKGdvzYsBoTW/xi42JQHl7eKV2OYzCUqvc+D2RCcf7EXY2iCyFIk6og==", "dev": true, - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/@cloudflare/kv-asset-handler": { "version": "0.5.0", @@ -520,6 +522,14 @@ "node": ">=16" } }, + "node_modules/@cloudflare/workers-types": { + "version": "5.20261102.1", + "resolved": "https://registry.npmjs.org/@cloudflare/workers-types/-/workers-types-5.20261102.1.tgz", + "integrity": "sha512-rRNznLGla+8vRdToTN/5M+AzlopILSLLZ3qo2L5Ku/dY792iOlX/K9ZLkLnLYji1jycv7+FB12hiE+fFjVgMrw==", + "dev": true, + "license": "MIT OR Apache-2.0", + "peer": true + }, "node_modules/@cspotcode/source-map-support": { "version": "0.8.1", "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", @@ -966,6 +976,7 @@ "integrity": "sha512-MgP/I06GdvsilDspMk/qmRzpk8LOUStP6jFAbSRi40W09DhoyUn+Mj7eyKICPqeYKybOjVFLVIAQzvu1bfIa7Q==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=20" }, @@ -1585,6 +1596,7 @@ "integrity": "sha512-laVmIhPGpWi7rG9q+0UigblRN0Hws/Yjlb6qLFtVqryXVLkc4h+yN8z731POD2LnAGQlFe7/tXhUm7Bi0YB91g==", "dev": true, "license": "Apache-2.0", + "peer": true, "dependencies": { "zod": "^4.2.0" }, @@ -1655,6 +1667,7 @@ "integrity": "sha512-KYOUGQFlLWR+s4QMV2Q9ko38TZm7EdO87Qm7rvZLqk/webse/cDjtyxKhg/47l0byCbs/k46LT8qc4PKjAikzA==", "dev": true, "license": "MIT", + "peer": true, "funding": { "url": "https://github.com/sponsors/oxc-project" } @@ -1701,6 +1714,7 @@ "os": [ "android" ], + "peer": true, "engines": { "node": "^20.19.0 || >=22.12.0" } @@ -1718,6 +1732,7 @@ "os": [ "android" ], + "peer": true, "engines": { "node": "^20.19.0 || >=22.12.0" } @@ -1735,6 +1750,7 @@ "os": [ "darwin" ], + "peer": true, "engines": { "node": "^20.19.0 || >=22.12.0" } @@ -1752,6 +1768,7 @@ "os": [ "darwin" ], + "peer": true, "engines": { "node": "^20.19.0 || >=22.12.0" } @@ -1769,6 +1786,7 @@ "os": [ "freebsd" ], + "peer": true, "engines": { "node": "^20.19.0 || >=22.12.0" } @@ -1786,6 +1804,7 @@ "os": [ "linux" ], + "peer": true, "engines": { "node": "^20.19.0 || >=22.12.0" } @@ -1803,6 +1822,7 @@ "os": [ "linux" ], + "peer": true, "engines": { "node": "^20.19.0 || >=22.12.0" } @@ -1820,6 +1840,7 @@ "os": [ "linux" ], + "peer": true, "engines": { "node": "^20.19.0 || >=22.12.0" } @@ -1837,6 +1858,7 @@ "os": [ "linux" ], + "peer": true, "engines": { "node": "^20.19.0 || >=22.12.0" } @@ -1854,6 +1876,7 @@ "os": [ "linux" ], + "peer": true, "engines": { "node": "^20.19.0 || >=22.12.0" } @@ -1871,6 +1894,7 @@ "os": [ "linux" ], + "peer": true, "engines": { "node": "^20.19.0 || >=22.12.0" } @@ -1888,6 +1912,7 @@ "os": [ "linux" ], + "peer": true, "engines": { "node": "^20.19.0 || >=22.12.0" } @@ -1905,6 +1930,7 @@ "os": [ "openharmony" ], + "peer": true, "engines": { "node": "^20.19.0 || >=22.12.0" } @@ -1922,6 +1948,7 @@ "os": [ "win32" ], + "peer": true, "engines": { "node": "^20.19.0 || >=22.12.0" } @@ -1939,6 +1966,7 @@ "os": [ "win32" ], + "peer": true, "engines": { "node": "^20.19.0 || >=22.12.0" } @@ -1979,7 +2007,8 @@ "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.1.tgz", "integrity": "sha512-2j9bGt5Jh8hj+vPtgzPtl72j0yRxHAyumoo6TNfAjsLB04UtpSvPbPcDcBMxz7n+9CYB0c1GxQFxYRg2jimqGw==", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/@root/asn1": { "version": "1.0.2", @@ -2060,7 +2089,8 @@ "resolved": "https://registry.npmjs.org/@types/gensync/-/gensync-1.0.5.tgz", "integrity": "sha512-MbsRCT7mTikHwKZ0X+LVUTLRrZZRLipTuXEO9qOYO+zmjMVk81axyClMROf6uoPD9MRVu46bx8zoR0Ad9q3NAg==", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/@types/jsesc": { "version": "2.5.1", @@ -2081,6 +2111,7 @@ "integrity": "sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "mime-types": "^3.0.0", "negotiator": "^1.0.0" @@ -2186,6 +2217,7 @@ "integrity": "sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "fast-deep-equal": "^3.1.3", "fast-uri": "^3.0.1", @@ -2203,6 +2235,7 @@ "integrity": "sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "ajv": "^8.0.0" }, @@ -2221,6 +2254,7 @@ "integrity": "sha512-YeesxhUmR4h5y5V8KF8iBCqJb8YFrBJ++XBTeGcWIaQOYXGN19JM0FoiOjAhwuDoln8owMgXcWBmgHtYSkky2w==", "dev": true, "license": "Apache-2.0", + "peer": true, "bin": { "baseline-browser-mapping": "dist/cli.cjs" }, @@ -2241,6 +2275,7 @@ "integrity": "sha512-2cGmJupaNgg+QUwVLAucDuWuoMZ6EX9iHDRswZ5lsNYEmwPaRknMPCLZz07yTzVq/83p4o/wzbDZbBrTvGGTIw==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "bytes": "^3.1.2", "content-type": "^2.0.0", @@ -2266,6 +2301,7 @@ "integrity": "sha512-mj7UPXE0jaqaOsukNZRUEfEi2AcL7C/vwmwcHV0O97eO1E1pxBZuyjlZrx5seTaNBg1U6+o35wpa35Qfcc+7ag==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=18" }, @@ -2315,6 +2351,7 @@ "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">= 0.8" } @@ -2325,6 +2362,7 @@ "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "es-errors": "^1.3.0", "function-bind": "^1.1.2" @@ -2339,6 +2377,7 @@ "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "call-bind-apply-helpers": "^1.0.2", "get-intrinsic": "^1.3.0" @@ -2369,7 +2408,8 @@ "url": "https://github.com/sponsors/ai" } ], - "license": "CC-BY-4.0" + "license": "CC-BY-4.0", + "peer": true }, "node_modules/capnweb": { "version": "0.12.0", @@ -2388,6 +2428,7 @@ "integrity": "sha512-e+H0ZXHSWYrENhQzw1LPuP4oF5MzVKmDU6d3hxlvaPEYLLg62MxtQNPRx4SYSuYJSBUgnQIG4HIN2tEtNv7Dog==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=18" }, @@ -2402,6 +2443,7 @@ "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">= 0.6" } @@ -2411,7 +2453,8 @@ "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/cookie": { "version": "1.1.1", @@ -2433,6 +2476,7 @@ "integrity": "sha512-D76uU73ulSXrD1UXF4KE2TMxVVwhsnCgfAyTg9k8P6KGZjlXKrOLe4dJQKI3Bxi5wjesZoFXJWElNWBjPZMbhg==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=6.6.0" } @@ -2458,6 +2502,7 @@ "integrity": "sha512-tJtZBBHA6vjIAaF6EnIaq6laBBP9aq/Y3ouVJjEfoHbRBcHBAHYcMh/w8LDrk2PvIMMq8gmopa5D4V8RmbrxGw==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "object-assign": "^4", "vary": "^1" @@ -2486,6 +2531,7 @@ "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", @@ -2501,6 +2547,7 @@ "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "ms": "^2.1.3" }, @@ -2519,6 +2566,7 @@ "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">= 0.8" } @@ -2539,6 +2587,7 @@ "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "call-bind-apply-helpers": "^1.0.1", "es-errors": "^1.3.0", @@ -2553,14 +2602,16 @@ "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/electron-to-chromium": { "version": "1.5.459", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.459.tgz", "integrity": "sha512-4SC9HHSFjO/liAhifpdOL5hG9b4BP7/5G3y3UPZVO8trlAXr1CaUEEJL0gWK3kOcYcZrOA5rkwG45Gra/lTIgg==", "dev": true, - "license": "ISC" + "license": "ISC", + "peer": true }, "node_modules/empathic": { "version": "2.1.0", @@ -2568,6 +2619,7 @@ "integrity": "sha512-AnfC1ATldl49/cvZdLPDjBfrRNwbDO05aibiOtzQu3qtlbJtomNLhF30HEtn/7iBz50dlMECqATo3fG0LrdEgw==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=14" } @@ -2578,6 +2630,7 @@ "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">= 0.8" } @@ -2598,6 +2651,7 @@ "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">= 0.4" } @@ -2608,6 +2662,7 @@ "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">= 0.4" } @@ -2618,6 +2673,7 @@ "integrity": "sha512-HWcBoN6NileqtSydK2FqHbS/LoDd2pqrnQHLyJzBj4kOp/ky2MWMN694xOfkK8/SnUsW2DH7EfyVlydKCsm1Zw==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "es-errors": "^1.3.0" }, @@ -2672,6 +2728,7 @@ "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=6" } @@ -2681,7 +2738,8 @@ "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/etag": { "version": "1.8.1", @@ -2689,6 +2747,7 @@ "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">= 0.6" } @@ -2706,6 +2765,7 @@ "integrity": "sha512-CRT1WTyuQoD771GW56XEZFQ/ZoSfWid1alKGDYMmkt2yl8UXrVR4pspqWNEcqKvVIzg6PAltWjxcSSPrboA4iA==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "eventsource-parser": "^3.0.1" }, @@ -2719,6 +2779,7 @@ "integrity": "sha512-EKN1vKAMcZ8MlYMpaNuxN6R9yakzH6uajHcHVTqWJzvu5pWw9DyhbP35HH8MVBQ+dZjAfDxk+A8NiR9KWaXiyQ==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=18.0.0" } @@ -2729,6 +2790,7 @@ "integrity": "sha512-qCqy1xSoaugxOD4IVHb1ZWdkvCF2W3aE2okKouWj8VwJ+ztskSiXoBnCSJqfKT+cVPJhuJqe9YLbY425+Zh00g==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "accepts": "^2.0.0", "body-parser": "^2.3.0", @@ -2773,6 +2835,7 @@ "integrity": "sha512-2FXbqkygil3mZiXzEtM0IjE/UBmBNot0J1GEVrJT4JbrvwOSoEtqtO+wHbiMQELWe1eNvHoYRg2dkjOid+6JkA==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "debug": "^4.4.3", "ip-address": "^10.2.0" @@ -2793,6 +2856,7 @@ "integrity": "sha512-mj7UPXE0jaqaOsukNZRUEfEi2AcL7C/vwmwcHV0O97eO1E1pxBZuyjlZrx5seTaNBg1U6+o35wpa35Qfcc+7ag==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=18" }, @@ -2807,6 +2871,7 @@ "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">= 0.6" } @@ -2816,7 +2881,8 @@ "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/fast-uri": { "version": "3.1.8", @@ -2833,7 +2899,8 @@ "url": "https://opencollective.com/fastify" } ], - "license": "BSD-3-Clause" + "license": "BSD-3-Clause", + "peer": true }, "node_modules/finalhandler": { "version": "2.1.1", @@ -2841,6 +2908,7 @@ "integrity": "sha512-S8KoZgRZN+a5rNwqTxlZZePjT/4cnm0ROV70LedRHZ0p8u9fRID0hJUZQpkKLzro8LfmC8sx23bY6tVNxv8pQA==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "debug": "^4.4.0", "encodeurl": "^2.0.0", @@ -2863,6 +2931,7 @@ "integrity": "sha512-kWyh8ADvHBFz6ua5xYOPnUroZTT/bwWfrCeL0Wj1dzG4/YOmOcfJ99W8dOVyyynJN35rZ9aCOtHChqQovV7yog==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=6" } @@ -2873,6 +2942,7 @@ "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">= 0.6" } @@ -2883,6 +2953,7 @@ "integrity": "sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">= 0.8" } @@ -2908,6 +2979,7 @@ "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", "dev": true, "license": "MIT", + "peer": true, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -2918,6 +2990,7 @@ "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=6.9.0" } @@ -2928,6 +3001,7 @@ "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "call-bind-apply-helpers": "^1.0.2", "es-define-property": "^1.0.1", @@ -2953,6 +3027,7 @@ "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "dunder-proto": "^1.0.1", "es-object-atoms": "^1.0.0" @@ -2967,6 +3042,7 @@ "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">= 0.4" }, @@ -2980,6 +3056,7 @@ "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">= 0.4" }, @@ -2993,6 +3070,7 @@ "integrity": "sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "function-bind": "^1.1.2" }, @@ -3017,6 +3095,7 @@ "integrity": "sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "depd": "~2.0.0", "inherits": "~2.0.4", @@ -3038,6 +3117,7 @@ "integrity": "sha512-IKXpvIzjnC9XTAUbVBcMfGS0EPaIXtW6v+zr+RRp+hqULEpo0owZax6wyRwPOJbWbzjYspQwusTsfVr0ifh4uQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "safer-buffer": ">= 2.1.2 < 3.0.0" }, @@ -3055,6 +3135,7 @@ "integrity": "sha512-Iqv2fzaTQN28s/FwZAoFq0ZSs/7hMAHJVX+w8PZl3cY19Pxk6jFFalxQoIfW2826i/fDLXv8IiEZRIT0lDuWcg==", "dev": true, "license": "MIT", + "peer": true, "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -3065,7 +3146,8 @@ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "dev": true, - "license": "ISC" + "license": "ISC", + "peer": true }, "node_modules/ip-address": { "version": "10.7.4", @@ -3073,6 +3155,7 @@ "integrity": "sha512-DWBMKyeM25D70nrIiTkgQth59/G+naKOTep6huF9j+GmeK3DMD60Zvxg5d5qQnz+38AHgou6ean2LECX+lrKDg==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">= 12" } @@ -3083,6 +3166,7 @@ "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">= 0.10" } @@ -3092,14 +3176,16 @@ "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-4.0.0.tgz", "integrity": "sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", "dev": true, - "license": "ISC" + "license": "ISC", + "peer": true }, "node_modules/jose": { "version": "6.2.12", @@ -3142,14 +3228,16 @@ "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/json-schema-typed": { "version": "8.0.2", "resolved": "https://registry.npmjs.org/json-schema-typed/-/json-schema-typed-8.0.2.tgz", "integrity": "sha512-fQhoXdcvc3V28x7C7BMs4P5+kNlgUURe2jmUT1T//oBRMDrqy1QPelJimwZGo7Hg9VPV3EQV5Bnq4hbFy2vetA==", "dev": true, - "license": "BSD-2-Clause" + "license": "BSD-2-Clause", + "peer": true }, "node_modules/json5": { "version": "2.2.3", @@ -3157,6 +3245,7 @@ "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", "dev": true, "license": "MIT", + "peer": true, "bin": { "json5": "lib/cli.js" }, @@ -3186,6 +3275,7 @@ "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">= 0.4" } @@ -3196,6 +3286,7 @@ "integrity": "sha512-yz3xRaG20c6/BOzvYoDaGtPmGscs7YivItZEEqe6GbwNfHuxu9YNmvnEkMzKldAGY4/80pRcQRZSEnhquk9XuQ==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">= 0.8" }, @@ -3210,6 +3301,7 @@ "integrity": "sha512-Snk314V5ayFLhp3fkUREub6WtjBfPdCPY1Ln8/8munuLuiYhsABgBVWsozAG+MWMbVEvcdcpbi9R7ww22l9Q3g==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=18" }, @@ -3223,6 +3315,7 @@ "integrity": "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">= 0.6" } @@ -3233,6 +3326,7 @@ "integrity": "sha512-Lbgzdk0h4juoQ9fCKXW4by0UJqj+nOOrI9MJ1sSj4nI8aI2eo1qmvQEie4VD1glsS250n15LsWsYtCugiStS5A==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "mime-db": "^1.54.0" }, @@ -3307,7 +3401,8 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/nanoid": { "version": "5.1.16", @@ -3334,6 +3429,7 @@ "integrity": "sha512-NMPBRMJgiQHjbd8phG3Vebdx4kZ1H121rbl5IkMqeOsahptB9BKo/d7oJ3zTXqTgagn2bWlNSXkh0QUGM31RYg==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "content-type": "^2.1.0" }, @@ -3351,6 +3447,7 @@ "integrity": "sha512-mj7UPXE0jaqaOsukNZRUEfEi2AcL7C/vwmwcHV0O97eO1E1pxBZuyjlZrx5seTaNBg1U6+o35wpa35Qfcc+7ag==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=18" }, @@ -3365,6 +3462,7 @@ "integrity": "sha512-5qr2okC4ItAI0hG5SaV0HoYMpnM/Y6+Oqr7AmPYy/2uEoGvS+GbSKLeRxSS1uAdu59yz0ouzcuXievSgg///WA==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=18" } @@ -3375,6 +3473,7 @@ "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=0.10.0" } @@ -3385,6 +3484,7 @@ "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">= 0.4" }, @@ -3412,6 +3512,7 @@ "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "ee-first": "1.1.1" }, @@ -3425,6 +3526,7 @@ "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", "dev": true, "license": "ISC", + "peer": true, "dependencies": { "wrappy": "1" } @@ -3435,10 +3537,24 @@ "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">= 0.8" } }, + "node_modules/partyserver": { + "version": "0.5.10", + "resolved": "https://registry.npmjs.org/partyserver/-/partyserver-0.5.10.tgz", + "integrity": "sha512-t2B3mhTL1IOxCsj8rZgn4TxTuub7oLhypjc1/fGPNsbgnn9OsHms6uR3QEd5bFJ/7xrFo771j3DdUlll8cxgBg==", + "dev": true, + "license": "ISC", + "dependencies": { + "nanoid": "^5.1.9" + }, + "peerDependencies": { + "@cloudflare/workers-types": "^4.20260424.1 || ^5.20260703.1" + } + }, "node_modules/partysocket": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/partysocket/-/partysocket-1.3.0.tgz", @@ -3463,6 +3579,7 @@ "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=8" } @@ -3486,7 +3603,8 @@ "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", "dev": true, - "license": "ISC" + "license": "ISC", + "peer": true }, "node_modules/picomatch": { "version": "4.0.7", @@ -3507,6 +3625,7 @@ "integrity": "sha512-wQ0b/W4Fr01qtpHlqSqspcj3EhBvimsdh0KlHhH8HRZnMsEa0ea2fTULOXOS9ccQr3om+GcGRk4e+isrZWV8qQ==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=16.20.0" } @@ -3524,6 +3643,7 @@ "integrity": "sha512-5nnx0yGyVUcY6t9RnWcARWtwT9F1D8O9rt08htPvnd49W1IgZtmLkhu9WfMzQj1cFxjHIO6connUNVW5k7AVyQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "forwarded": "0.2.0", "ipaddr.js": "1.9.1" @@ -3542,6 +3662,7 @@ "integrity": "sha512-5Px6J7rfHBAGUhNQ3es4YzcOdBBw0SDcVtThJml4RdnKw4tKs2epA0kPZ+K8X+WiHktT93RHVcQ/3ym5aTCgtg==", "dev": true, "license": "BSD-3-Clause", + "peer": true, "dependencies": { "es-define-property": "^1.0.1", "side-channel": "^1.1.1" @@ -3559,6 +3680,7 @@ "integrity": "sha512-hek2mFQpPuI4E1BBKrSto+BU3e3x4xuarsbiwr3+lf7p44juvFMV0XFWQAP3xUyqXA4RrXLIoaSUGbSt056ZMw==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">= 0.6" }, @@ -3573,6 +3695,7 @@ "integrity": "sha512-K5zQjDllxWkf7Z5xJdV0/B0WTNqx6vxG70zJE4N0kBs4LovmEYWJzQGxC9bS9RAKu3bgM40lrd5zoLJ12MQ5BA==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "bytes": "~3.1.2", "http-errors": "~2.0.1", @@ -3589,6 +3712,7 @@ "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=0.10.0" } @@ -3634,6 +3758,7 @@ "integrity": "sha512-nLTrUKm2UyiL7rlhapu/Zl45FwNgkZGaCpZbIHajDYgwlJCOzLSk+cIPAnsEqV955GjILJnKbdQC1nVPz+gAYQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "debug": "^4.4.0", "depd": "^2.0.0", @@ -3651,6 +3776,7 @@ "integrity": "sha512-qRcuIdP69NPm4qbACK+aDogI5CBDMi1jKe0ry5rSQJz8JVLsC7jV8XpiJjGRLLol3N+R5ihGYcrPLTno6pAdBA==", "dev": true, "license": "MIT", + "peer": true, "funding": { "type": "opencollective", "url": "https://opencollective.com/express" @@ -3661,7 +3787,8 @@ "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/semver": { "version": "7.8.5", @@ -3682,6 +3809,7 @@ "integrity": "sha512-1gnZf7DFcoIcajTjTwjwuDjzuz4PPcY2StKPlsGAQ1+YH20IRVrBaXSWmdjowTJ6u8Rc01PoYOGHXfP1mYcZNQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "debug": "^4.4.3", "encodeurl": "^2.0.0", @@ -3709,6 +3837,7 @@ "integrity": "sha512-xRXBn0pPqQTVQiC8wyQrKs2MOlX24zQ0POGaj0kultvoOCstBQM5yvOhAVSUwOMjQtTvsPWoNCHfPGwaaQJhTw==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "encodeurl": "^2.0.0", "escape-html": "^1.0.3", @@ -3732,7 +3861,8 @@ "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", "dev": true, - "license": "ISC" + "license": "ISC", + "peer": true }, "node_modules/sharp": { "version": "0.35.5", @@ -3790,6 +3920,7 @@ "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "shebang-regex": "^3.0.0" }, @@ -3803,6 +3934,7 @@ "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=8" } @@ -3813,6 +3945,7 @@ "integrity": "sha512-6x6dK6zJdpTzF4sQeNYxwtvBzf6Eg4GtlesS94HOvTudUeyK2WXAaIfmDgsyslYrRBeFIlsi54AYsFGUuhmvrQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "es-errors": "^1.3.0", "object-inspect": "^1.13.4", @@ -3833,6 +3966,7 @@ "integrity": "sha512-mjn/0bi/oUURjc5Xl7IaWi/OJJJumuoJFQJfDDyO46+hBWsfaVM65TBHq2eoZBhzl9EchxOijpkbRC8SVBQU0w==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "es-errors": "^1.3.0", "object-inspect": "^1.13.4" @@ -3850,6 +3984,7 @@ "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "call-bound": "^1.0.2", "es-errors": "^1.3.0", @@ -3869,6 +4004,7 @@ "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "call-bound": "^1.0.2", "es-errors": "^1.3.0", @@ -3905,6 +4041,7 @@ "integrity": "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">= 0.8" } @@ -3928,6 +4065,7 @@ "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=0.6" } @@ -3946,6 +4084,7 @@ "integrity": "sha512-faYHw0anBbc/kWF3zFTEnxSFOAGUX9GFbOBthvDdLsIlEoWOFOtS0zgCiQYwIskL9iGXZL3kAXD8OoZ4GmMATA==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "content-type": "^2.0.0", "media-typer": "^1.1.0", @@ -3965,6 +4104,7 @@ "integrity": "sha512-mj7UPXE0jaqaOsukNZRUEfEi2AcL7C/vwmwcHV0O97eO1E1pxBZuyjlZrx5seTaNBg1U6+o35wpa35Qfcc+7ag==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=18" }, @@ -3989,7 +4129,6 @@ "integrity": "sha512-i7qRCmY42zmCwnYlh9H2SvLEypEFGye5iRmEMKjcGi7zk9UquigRjFtTLz0TYqr0ZGLZhaMHl/foy1bZR+Cwlw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "pathe": "^2.0.3" } @@ -4000,6 +4139,7 @@ "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">= 0.8" } @@ -4024,6 +4164,7 @@ } ], "license": "MIT", + "peer": true, "dependencies": { "escalade": "^3.2.0", "picocolors": "^1.1.1" @@ -4041,6 +4182,7 @@ "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">= 0.8" } @@ -4064,6 +4206,7 @@ "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", "dev": true, "license": "ISC", + "peer": true, "dependencies": { "isexe": "^2.0.0" }, @@ -4081,7 +4224,6 @@ "dev": true, "hasInstallScript": true, "license": "Apache-2.0", - "peer": true, "bin": { "workerd": "bin/workerd" }, @@ -4137,7 +4279,8 @@ "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", "dev": true, - "license": "ISC" + "license": "ISC", + "peer": true }, "node_modules/ws": { "version": "8.21.0", @@ -4219,22 +4362,11 @@ "integrity": "sha512-O/PgfnpT1xKSDeQYSCfRI5Gy3hPf91mKVDuYLUHZJMiDFptvP41MSnWofm8dnCm0256ZNfZIM7DSzuSMAFnjHA==", "dev": true, "license": "ISC", + "peer": true, "peerDependencies": { "zod": "^3.25.28 || ^4" } }, - "packages/autopilot": { - "name": "@serverless-objects/autopilot", - "version": "0.1.0", - "extraneous": true, - "license": "Apache-2.0", - "dependencies": { - "@hotcell/sdk": "^0.1.19" - }, - "engines": { - "node": ">=22" - } - }, "packages/cli": { "name": "serverless-objects", "version": "0.13.6", @@ -4261,20 +4393,9 @@ "version": "0.1.0", "devDependencies": { "agents": "0.28.1", + "partyserver": "^0.5.10", "wrangler": "4.150.0" } - }, - "packages/hotcell": { - "name": "@serverless-objects/hotcell", - "version": "0.1.0", - "extraneous": true, - "license": "Apache-2.0", - "dependencies": { - "@hotcell/sdk": "^0.1.19" - }, - "engines": { - "node": ">=22" - } } } } diff --git a/packages/conformance/README.md b/packages/conformance/README.md index 5b908c8..4a41b1b 100644 --- a/packages/conformance/README.md +++ b/packages/conformance/README.md @@ -3,11 +3,14 @@ `app/` is a small Workers application whose Durable Objects run checks and return `{ pass, detail }` at `/case/`. `/cases` lists the cases. `agents-app/` does the same for the Agents SDK (pinned `agents` 0.28.1, with -`nodejs_compat`); the runner also drives its WebSocket client protocol. Select -one with `--suite core|agents|all` (default `all`). The +`nodejs_compat`); the runner also drives its WebSocket client protocol. +`party-app/` does the same for PartyServer (pinned `partyserver` 0.5.10, with +`nodejs_compat`): a `Server` with hibernation enabled, driven over +`/parties/chat/` and its WebSocket protocol. Select one with +`--suite core|agents|party|all` (default `all`). The runner launches a disposable copy under the git-ignored `.runs/` directory, -so the Agents app resolves the workspace's `node_modules`, and removes it -afterwards. +so the Agents and PartyServer apps resolve the workspace's `node_modules`, and +removes it afterwards. Run the reference runner or celld runner from the repository root: diff --git a/packages/conformance/package.json b/packages/conformance/package.json index e115359..304aabf 100644 --- a/packages/conformance/package.json +++ b/packages/conformance/package.json @@ -13,6 +13,7 @@ }, "devDependencies": { "agents": "0.28.1", + "partyserver": "^0.5.10", "wrangler": "4.150.0" } } diff --git a/packages/conformance/party-app/src/index.js b/packages/conformance/party-app/src/index.js new file mode 100644 index 0000000..06368df --- /dev/null +++ b/packages/conformance/party-app/src/index.js @@ -0,0 +1,166 @@ +// PartyServer conformance app. `Chat` is an unmodified `partyserver` Server +// with hibernation enabled, so the checks exercise PartyServer's own routing, +// connection manager, attachment handling and alarm plumbing rather than a +// hand-written Durable Object. Server-side checks answer {pass, detail} at +// /case/; the runner drives the WebSocket protocol. +import { Server, getServerByName, routePartykitRequest } from "partyserver"; + +const json = (body, status = 200) => Response.json(body, { status }); + +function check(name, condition, detail) { + if (!condition) throw new Error(`${name}: ${detail === undefined ? "failed" : JSON.stringify(detail)}`); +} + +export class Chat extends Server { + // Hibernation is what makes PartyServer use ctx.acceptWebSocket() and + // rehydrate connections from their attachments after eviction. + static options = { hibernate: true }; + + onStart() { + // A fresh instance id per construction lets the runner prove that an + // evicted object was really replaced. + this.instanceId = crypto.randomUUID(); + this.sql`CREATE TABLE IF NOT EXISTS messages (id INTEGER PRIMARY KEY, body TEXT)`; + } + + onConnect(connection) { + connection.send(JSON.stringify({ + type: "welcome", + id: connection.id, + room: this.name, + instance: this.instanceId, + connections: this.connectionCount(), + })); + } + + onMessage(connection, message) { + const data = JSON.parse(String(message)); + if (data.type === "broadcast") { + this.broadcast(JSON.stringify({ + type: "broadcast", + from: connection.id, + body: data.body, + connections: this.connectionCount(), + })); + } else if (data.type === "attach") { + connection.serializeAttachment(data.value); + connection.send(JSON.stringify({ type: "attached", attachment: connection.deserializeAttachment() })); + } else if (data.type === "attachment") { + connection.send(JSON.stringify({ + type: "attachment", + attachment: connection.deserializeAttachment(), + instance: this.instanceId, + connections: this.connectionCount(), + })); + } else if (data.type === "count") { + connection.send(JSON.stringify({ type: "count", connections: this.connectionCount() })); + } else if (data.type === "store") { + this.sql`INSERT INTO messages (body) VALUES (${data.body})`; + connection.send(JSON.stringify({ type: "stored", messages: this.messages() })); + } else if (data.type === "messages") { + connection.send(JSON.stringify({ type: "messages", messages: this.messages() })); + } + } + + onRequest(request) { + const url = new URL(request.url); + if (url.pathname.endsWith("/info")) { + return json({ room: this.name, instance: this.instanceId, connections: this.connectionCount(), messages: this.messages() }); + } + return json({ error: "not found" }, 404); + } + + onAlarm() { + this.ctx.storage.put("alarmFired", Date.now()); + } + + connectionCount() { + let count = 0; + for (const _connection of this.getConnections()) count += 1; + return count; + } + + messages() { + return [...this.sql`SELECT body FROM messages ORDER BY id`].map((row) => row.body); + } + + // RPC surface used by getServerByName() checks. + async info() { + return { room: this.name, instance: this.instanceId, messages: this.messages() }; + } + + async store(body) { + this.sql`INSERT INTO messages (body) VALUES (${body})`; + return this.messages(); + } + + async reset() { + this.sql`DELETE FROM messages`; + await this.ctx.storage.delete("alarmFired"); + await this.ctx.storage.deleteAlarm(); + return this.messages(); + } + + async armAlarm(ms) { + await this.ctx.storage.setAlarm(Date.now() + ms); + return this.ctx.storage.getAlarm(); + } + + async alarmStatus() { + return { fired: (await this.ctx.storage.get("alarmFired")) ?? null, pending: await this.ctx.storage.getAlarm() }; + } +} + +const CASES = { + async storage(env) { + const chat = await chatByName(env, "storage"); + await chat.reset(); + const messages = await chat.store("first"); + check("insert", messages.join() === "first", messages); + const more = await chat.store("second"); + check("append", more.join() === "first,second", more); + return "this.sql create, insert and ordered select"; + }, + async addressing(env) { + const chat = await chatByName(env, "addressing"); + const info = await chat.info(); + check("name", info.room === "addressing", info); + check("instance", typeof info.instance === "string" && info.instance.length > 0, info); + return "getServerByName, this.name and onStart"; + }, + async alarm(env) { + const chat = await chatByName(env, "alarm"); + await chat.reset(); + const pending = await chat.armAlarm(1_000); + check("armed", typeof pending === "number" && pending > Date.now(), pending); + const deadline = Date.now() + 20_000; + let status = await chat.alarmStatus(); + while (Date.now() < deadline) { + if (status.fired) return "setAlarm, onAlarm and getAlarm"; + await new Promise((resolve) => setTimeout(resolve, 250)); + status = await chat.alarmStatus(); + } + throw new Error(`alarm: did not fire before timeout ${JSON.stringify(status)}`); + }, +}; + +function chatByName(env, name) { + return getServerByName(env.Chat, name); +} + +export default { + async fetch(request, env) { + const url = new URL(request.url); + if (url.pathname === "/cases") return json(Object.keys(CASES)); + if (url.pathname.startsWith("/case/")) { + const name = url.pathname.slice("/case/".length); + if (!CASES[name]) return json({ error: "unknown case" }, 404); + try { + return json({ pass: true, detail: await CASES[name](env) }); + } catch (error) { + return json({ pass: false, detail: String(error?.message ?? error) }); + } + } + return (await routePartykitRequest(request, env)) ?? json({ error: "not found" }, 404); + }, +}; diff --git a/packages/conformance/party-app/wrangler.json b/packages/conformance/party-app/wrangler.json new file mode 100644 index 0000000..e062367 --- /dev/null +++ b/packages/conformance/party-app/wrangler.json @@ -0,0 +1,10 @@ +{ + "name": "sobjects-conformance-party", + "main": "src/index.js", + "compatibility_date": "2026-02-24", + "compatibility_flags": ["nodejs_compat"], + "durable_objects": { + "bindings": [{ "name": "Chat", "class_name": "Chat" }] + }, + "migrations": [{ "tag": "v1", "new_sqlite_classes": ["Chat"] }] +} diff --git a/packages/conformance/src/run.js b/packages/conformance/src/run.js index 30be4cb..200672f 100644 --- a/packages/conformance/src/run.js +++ b/packages/conformance/src/run.js @@ -9,6 +9,7 @@ const PACKAGE_DIR = path.resolve(path.dirname(fileURLToPath(import.meta.url)), " const SUITES = { core: path.join(PACKAGE_DIR, "app"), agents: path.join(PACKAGE_DIR, "agents-app"), + party: path.join(PACKAGE_DIR, "party-app"), }; const SOBJECTS_BIN = path.resolve(PACKAGE_DIR, "..", "cli", "bin", "sobjects.mjs"); const DEFAULT_CELLD_BIN = path.join(os.homedir(), ".local/share/serverless-objects/engines/celld-0.6.2/celld"); @@ -47,7 +48,7 @@ export function parseArgs(args) { if (options.help) return options; if (!["wrangler", "celld", "native", "cloudflare"].includes(options.target)) throw new Error("--target must be wrangler, celld, native or cloudflare"); if (options.target === "cloudflare" && options.restartAfterAlarm) throw new Error("--restart-after-alarm is not possible on Cloudflare"); - if (options.suites.some((suite) => !SUITES[suite])) throw new Error("--suite must be core, agents, or all"); + if (options.suites.some((suite) => !SUITES[suite])) throw new Error("--suite must be core, agents, party, or all"); if (!Number.isInteger(options.port) || options.port < 1 || options.port > 65_535) throw new Error("--port must be an integer from 1 to 65535"); if (!Number.isInteger(options.timeoutMs) || options.timeoutMs < 1_000) throw new Error("--timeout must be at least 1000 milliseconds"); if (options.alarmDelayMs !== undefined && (!Number.isInteger(options.alarmDelayMs) || options.alarmDelayMs < 1_000)) { @@ -75,7 +76,7 @@ function usage() { " --timeout MS Startup timeout (default: 60000)", " --alarm-delay MS Alarm delay (default: 2000; 30000 with restart)", " --celld-bin PATH celld executable (or set CELLD_BIN)", - " --suite SUITE core, agents, or all (default: all)", + " --suite SUITE core, agents, party, or all (default: all)", " --keep-deployment cloudflare: leave the Workers deployed afterwards", " --native-threads N native: run the engine on N worker threads", " --native-arg ARG native: pass ARG to sobjects dev (repeatable)", @@ -344,6 +345,104 @@ async function runAgentsScheduleRestartCheck(baseUrl, restart) { throw new Error(`Schedule did not fire after restart before timeout: ${JSON.stringify(status)}`); } +// Opens a PartyServer socket to /parties/chat/ and collects JSON frames. +function openPartySocket(baseUrl, room) { + const url = new URL(`/parties/chat/${encodeURIComponent(room)}`, baseUrl); + url.protocol = url.protocol === "https:" ? "wss:" : "ws:"; + const socket = new WebSocket(url); + const frames = []; + const waiters = []; + socket.addEventListener("message", (event) => { + const frame = JSON.parse(String(event.data)); + frames.push(frame); + for (const waiter of [...waiters]) if (waiter.match(frame)) waiter.resolve(frame); + }); + const nextFrame = (match, label) => new Promise((resolve, reject) => { + const found = frames.find(match); + if (found) return resolve(found); + const waiter = { + match, + resolve: (frame) => { + clearTimeout(timer); + waiters.splice(waiters.indexOf(waiter), 1); + resolve(frame); + }, + }; + const timer = setTimeout(() => reject(new Error(`Timed out waiting for ${label}; frames: ${JSON.stringify(frames)}`)), 5_000); + waiters.push(waiter); + }); + return { socket, frames, nextFrame }; +} + +function closePartySocket(socket) { + if (socket.readyState === WebSocket.OPEN || socket.readyState === WebSocket.CONNECTING) socket.close(); +} + +// Two connections to one room: PartyServer's routing, welcome frames, +// broadcast, connection manager and attachment API. +async function runPartyWebSocketCheck(baseUrl) { + if (typeof WebSocket !== "function") throw new Error("This Node.js version does not provide the WebSocket client API"); + const room = `broadcast-${Date.now()}`; + const first = openPartySocket(baseUrl, room); + const second = openPartySocket(baseUrl, room); + try { + await Promise.all([waitForWebSocketEvent(first.socket, "open"), waitForWebSocketEvent(second.socket, "open")]); + const firstWelcome = await first.nextFrame((frame) => frame.type === "welcome", "first welcome"); + const secondWelcome = await second.nextFrame((frame) => frame.type === "welcome", "second welcome"); + if (firstWelcome.room !== room || secondWelcome.room !== room) throw new Error(`room mismatch: ${JSON.stringify([firstWelcome, secondWelcome])}`); + if (firstWelcome.instance !== secondWelcome.instance) throw new Error("the two connections reached different instances"); + + first.socket.send(JSON.stringify({ type: "broadcast", body: "hello" })); + const [firstEcho, secondEcho] = await Promise.all([ + first.nextFrame((frame) => frame.type === "broadcast", "first broadcast"), + second.nextFrame((frame) => frame.type === "broadcast", "second broadcast"), + ]); + if (firstEcho.from !== firstWelcome.id || secondEcho.from !== firstWelcome.id) throw new Error(`broadcast sender mismatch: ${JSON.stringify([firstEcho, secondEcho])}`); + if (firstEcho.body !== "hello" || secondEcho.body !== "hello") throw new Error(`broadcast body mismatch: ${JSON.stringify([firstEcho, secondEcho])}`); + if (firstEcho.connections !== 2) throw new Error(`connection count: ${JSON.stringify(firstEcho)}`); + + first.socket.send(JSON.stringify({ type: "attach", value: { tag: "party" } })); + const attached = await first.nextFrame((frame) => frame.type === "attached", "attachment reply"); + if (attached.attachment?.tag !== "party") throw new Error(`attachment mismatch: ${JSON.stringify(attached)}`); + + second.socket.send(JSON.stringify({ type: "store", body: "from-socket" })); + const stored = await second.nextFrame((frame) => frame.type === "stored", "stored reply"); + if (!stored.messages.includes("from-socket")) throw new Error(`stored messages: ${JSON.stringify(stored)}`); + + return { pass: true, detail: "routing, welcome frames, broadcast to both connections, connection count, attachment and this.sql over a socket" }; + } finally { + closePartySocket(first.socket); + closePartySocket(second.socket); + } +} + +// PartyServer's hibernation path: the object is evicted with the socket open, +// and the next message must reach a new instance with the connection +// attachment rehydrated from the socket. +async function runPartyHibernationCheck(baseUrl, idleMs = 8_000) { + const room = `hibernate-${Date.now()}`; + const { socket, nextFrame } = openPartySocket(baseUrl, room); + try { + await waitForWebSocketEvent(socket, "open"); + const welcome = await nextFrame((frame) => frame.type === "welcome", "welcome"); + socket.send(JSON.stringify({ type: "attach", value: { tag: "hibernation" } })); + const attached = await nextFrame((frame) => frame.type === "attached", "attachment reply"); + if (attached.attachment?.tag !== "hibernation") throw new Error(`attachment mismatch: ${JSON.stringify(attached)}`); + + await new Promise((resolve) => setTimeout(resolve, idleMs)); + if (socket.readyState !== WebSocket.OPEN) throw new Error("the socket closed while the object was idle"); + + socket.send(JSON.stringify({ type: "attachment" })); + const after = await nextFrame((frame) => frame.type === "attachment", "attachment after idle"); + if (after.instance === welcome.instance) throw new Error("the object was not evicted while idle; hibernation was not exercised"); + if (after.attachment?.tag !== "hibernation") throw new Error(`attachment lost across hibernation: ${JSON.stringify(after)}`); + if (after.connections < 1) throw new Error(`connection lost across hibernation: ${JSON.stringify(after)}`); + return { pass: true, detail: "evicted with the socket open; a new instance received the next message with the connection attachment intact" }; + } finally { + closePartySocket(socket); + } +} + // Deploys a suite's app to the Cloudflare account Wrangler is logged in to // and returns its workers.dev URL. async function deployToCloudflare(projectDir) { @@ -402,10 +501,14 @@ async function runSuite(suite, options, scratchDir) { if (options.target !== "native") await record("facets", () => runFacetCheck(baseUrl)); // Point-in-time recovery needs the native engine's durable mode (a bucket). if (options.target === "native" && (options.nativeArgs ?? []).includes("durable")) await record("point-in-time-recovery", () => runPitrCheck(baseUrl)); - } else { + } else if (suite === "agents") { await record("client-protocol", () => runAgentsClientCheck(baseUrl)); await record("schedule-fires", () => runAgentsScheduleCheck(baseUrl)); if (options.restartAfterAlarm) await record("schedule-across-restart", () => runAgentsScheduleRestartCheck(baseUrl, restart)); + } else { + await record("websocket-broadcast", () => runPartyWebSocketCheck(baseUrl)); + // Wrangler's local runtime gives the runner no eviction control. + if (options.target !== "wrangler") await record("websocket-hibernation", () => runPartyHibernationCheck(baseUrl)); } return suite === "core" ? results : results.map((result) => ({ ...result, name: `${suite}/${result.name}` })); } finally { @@ -434,9 +537,12 @@ async function runCloudflareSuite(suite, options, projectDir) { await record("websocket-hibernation", () => runHibernationCheck(baseUrl, 30_000)); await record("facets", () => runFacetCheck(baseUrl)); await record("point-in-time-recovery", () => runPitrCheck(baseUrl)); - } else { + } else if (suite === "agents") { await record("client-protocol", () => runAgentsClientCheck(baseUrl)); await record("schedule-fires", () => runAgentsScheduleCheck(baseUrl)); + } else { + await record("websocket-broadcast", () => runPartyWebSocketCheck(baseUrl)); + await record("websocket-hibernation", () => runPartyHibernationCheck(baseUrl, 30_000)); } return suite === "core" ? results : results.map((result) => ({ ...result, name: `${suite}/${result.name}` })); } finally { diff --git a/packages/conformance/test/run.test.js b/packages/conformance/test/run.test.js index 5d4f205..b724c7d 100644 --- a/packages/conformance/test/run.test.js +++ b/packages/conformance/test/run.test.js @@ -31,9 +31,10 @@ test("case result validation preserves an explicit engine failure", () => { }); test("runs every suite unless one is selected", () => { - assert.deepEqual(parseArgs([]).suites, ["core", "agents"]); + assert.deepEqual(parseArgs([]).suites, ["core", "agents", "party"]); assert.deepEqual(parseArgs(["--suite", "agents"]).suites, ["agents"]); - assert.deepEqual(parseArgs(["--suite", "all"]).suites, ["core", "agents"]); + assert.deepEqual(parseArgs(["--suite", "party"]).suites, ["party"]); + assert.deepEqual(parseArgs(["--suite", "all"]).suites, ["core", "agents", "party"]); assert.throws(() => parseArgs(["--suite", "partyserver"]), /--suite must be/); });